blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
1df11bdd73e1eacdd611e9d73fbec79f6487c2d0
6253283b67c01a0d7395e38aeeea65e06f62504b
/decompile/app/Mms/src/main/java/com/google/common/util/concurrent/Striped$SmallLazyStriped.java
47b94c93f50c19e9eb5151eca26c889fb2c8fa9e
[]
no_license
sufadi/decompile-hw
2e0457a0a7ade103908a6a41757923a791248215
4c3efd95f3e997b44dd4ceec506de6164192eca3
refs/heads/master
2023-03-15T15:56:03.968086
2017-11-08T03:29:10
2017-11-08T03:29:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
255
java
package com.google.common.util.concurrent; import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.Striped.PowerOfTwoStriped; @VisibleForTesting class Striped$SmallLazyStriped<L> extends PowerOfTwoStriped<L> { }
[ "liming@droi.com" ]
liming@droi.com
c3998953aa6432084380d93b70ba5b6990e04b65
225114fc3fbc5f3d9da747ee63a5b9938ebac838
/Generics - Exercise/09. Custom List Iterator/src/Main.java
144bf49dfe69123c7e2083244460fdd85b2623e2
[]
no_license
boyanLakev/JAVA-Advance-september-2019
abfb214da6c0924a2969edb59cb72610de9378bf
1d8263e2df23ac1df97341c36effd3830e35bfb1
refs/heads/master
2020-07-30T07:33:35.828033
2019-10-31T09:23:26
2019-10-31T09:23:26
210,136,813
0
0
null
null
null
null
UTF-8
Java
false
false
1,481
java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); CustomList<String> list = new CustomList<>(); String line = scanner.nextLine(); while (!"END".equals(line)) { String[] tokens = line.split("\\s+"); switch (tokens[0]) { case "Sort": list.sort(); break; case "Add": list.add(tokens[1]); break; case "Remove": list.remove(Integer.parseInt(tokens[1])); break; case "Contains": System.out.println(list.contains(tokens[1])); break; case "Swap": list.swap(Integer.parseInt(tokens[1]), Integer.parseInt(tokens[2])); break; case "Greater": System.out.println(list.countGreaterThan(tokens[1])); break; case "Max": System.out.println(list.getMax()); break; case "Min": System.out.println(list.getMin()); break; case "Print": list.print(); break; } line = scanner.nextLine(); } } }
[ "blakev@abv.bg" ]
blakev@abv.bg
7369913a970d439d7884fc6185011e6376434e7c
3fb0961c123d0259a8fc54c82f89ed5cb5948a1e
/src/main/java/com/imitee/bleadv/lib/base/AdvertiseType.java
b650dfb47a3417669db84bf6a8763d18df6a3c83
[ "MIT" ]
permissive
ve3344/BleAdvertisement
c41c10fd2ea50194f4d7cf7f254e41e8405680f4
d1093d2e2521c0487ff3542fd3517367fa4ec7b9
refs/heads/master
2023-03-24T04:14:28.783289
2021-03-26T01:23:37
2021-03-26T01:23:37
262,993,340
4
2
null
null
null
null
UTF-8
Java
false
false
285
java
package com.imitee.bleadv.lib.base; public enum AdvertiseType { BROADCAST("broadcast"), PERIPHERAL("peripheral") ; private String value; public String getValue() { return value; } AdvertiseType(String value) { this.value = value; } }
[ "1515792890@qq.com" ]
1515792890@qq.com
03d63d02301825b6496a04d805bfe0c3c96569fb
f0b78c5f8f04a38c8329d35497ed99b94c328fec
/liferay-training/modules/salesforce/salesforce-api/src/main/java/com/liferay/salesforce/service/SalesforceAccountLocalService.java
5980ee528a34ed655856c561210dc687dc62b7a7
[]
no_license
dimplekoticha/workspace
1d7087be8edfb3c8b571dafd459dec99073af574
958e73e25e11e5dc8a69173ae76653f51f9e716c
refs/heads/master
2020-04-02T05:47:04.266750
2016-09-23T19:59:55
2016-09-23T19:59:55
65,832,974
0
1
null
null
null
null
UTF-8
Java
false
false
3,302
java
/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.liferay.salesforce.service; import aQute.bnd.annotation.ProviderType; import com.liferay.portal.kernel.dao.orm.ObjectNotFoundException; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.messaging.MessageBatch; import com.liferay.portal.kernel.service.BaseLocalService; import com.liferay.portal.kernel.transaction.Isolation; import com.liferay.portal.kernel.transaction.Propagation; import com.liferay.portal.kernel.transaction.Transactional; import java.util.List; /** * Provides the local service interface for SalesforceAccount. Methods of this * service will not have security checks based on the propagated JAAS * credentials because this service can only be accessed from within the same * VM. * * @author Brian Wing Shun Chan * @see SalesforceAccountLocalServiceUtil * @see com.liferay.salesforce.service.base.SalesforceAccountLocalServiceBaseImpl * @see com.liferay.salesforce.service.impl.SalesforceAccountLocalServiceImpl * @generated */ @ProviderType @Transactional(isolation = Isolation.PORTAL, rollbackFor = { PortalException.class, SystemException.class}) public interface SalesforceAccountLocalService extends BaseLocalService { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this interface directly. Always use {@link SalesforceAccountLocalServiceUtil} to access the salesforce account local service. Add custom service methods to {@link com.liferay.salesforce.service.impl.SalesforceAccountLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public MessageBatch getAccountsByName(long companyId, java.lang.String name, List<java.lang.String> fieldNames, long ownerId) throws SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public MessageBatch getAccountsByOwnerId(long companyId, java.lang.String ownerId, List<java.lang.String> fieldNames, long ownerID) throws ObjectNotFoundException, SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public MessageBatch getAccountsByUserName(long companyId, java.lang.String userName, List<java.lang.String> fieldNames, long ownerId) throws ObjectNotFoundException, SystemException; @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public MessageBatch getFields(long companyId, long ownerId) throws SystemException; /** * Returns the OSGi service identifier. * * @return the OSGi service identifier */ public java.lang.String getOSGiServiceIdentifier(); }
[ "dimple.koticha@liferay.com" ]
dimple.koticha@liferay.com
5c14140ae0903592d310446ca90b922bec5edecb
a55b85b6dd6a4ebf856b3fd80c9a424da2cd12bd
/ors/src/main/java/org/marketcetera/ors/history/ReportPersistenceException.java
37e354f01c08de2a15e0a27669e1cc961bed3abe
[]
no_license
jeffreymu/marketcetera-2.2.0-16652
a384a42b2e404bcc6140119dd2c6d297d466596c
81cdd34979492f839233552432f80b3606d0349f
refs/heads/master
2021-12-02T11:18:01.399940
2013-08-09T14:36:21
2013-08-09T14:36:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
844
java
package org.marketcetera.ors.history; import org.marketcetera.util.misc.ClassVersion; import org.marketcetera.util.except.I18NException; import org.marketcetera.util.log.I18NBoundMessage; /* $License$ */ /** * ReportPersistenceException * * @author anshul@marketcetera.com * @version $Id: ReportPersistenceException.java 16154 2012-07-14 16:34:05Z colin $ * @since 1.0.0 */ @ClassVersion("$Id: ReportPersistenceException.java 16154 2012-07-14 16:34:05Z colin $") public class ReportPersistenceException extends I18NException { /** * Create an instance. * * @param cause the underlying cause. * @param message the error message. */ public ReportPersistenceException(Throwable cause, I18NBoundMessage message) { super(cause, message); } private static final long serialVersionUID = 1L; }
[ "vladimir_petrovich@yahoo.com" ]
vladimir_petrovich@yahoo.com
af14d2d5a5b9490ae12a022348d88d518df5c75b
b7ac80392339ad44466578f40b1ea1b03d81acae
/outstagram-login/src/main/java/com/project/outstagram/OutstagramLoginServerApplication.java
79371da691810bde66abbc93827eaa5a2c4d4093
[]
no_license
DaeAkin/outstagram
660d00bb88d843aa510d93b47acaa3174ba94275
4422283e11c4dd3250505227ff72453d1a0391b2
refs/heads/master
2020-09-25T12:04:14.234990
2020-07-07T13:02:14
2020-07-07T13:02:14
226,001,513
2
1
null
null
null
null
UTF-8
Java
false
false
2,857
java
package com.project.outstagram; import brave.sampler.Sampler; import com.project.outstagram.global.utils.UserContextInterceptor; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoRestTemplateFactory; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.cloud.stream.annotation.StreamListener; import org.springframework.cloud.stream.messaging.Sink; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Primary; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.security.oauth2.client.OAuth2RestTemplate; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; import org.springframework.web.client.RestTemplate; import java.util.Collections; import java.util.List; @SpringBootApplication @EnableJpaAuditing @EnableJpaRepositories @RefreshScope @EnableEurekaClient @EnableCircuitBreaker @EnableResourceServer //kafka https://yfkwon.tistory.com/26 @EnableBinding(Sink.class) public class OutstagramLoginServerApplication { public static void main(String[] args) { SpringApplication.run(OutstagramLoginServerApplication.class, args); } @StreamListener(Sink.INPUT) /** 메소드이름이 handle로 시작해야 작동함 */ public void handle(String s) { System.out.println("왜 안와!!"); System.out.println("카프카에서 보낸 메세지 : " + s); } @Bean public Sampler defaultSampler() { // return new AlwaysSampler(); return Sampler.ALWAYS_SAMPLE; } //TODO WebFlux로 교체 예정 // @LoadBalanced // @Bean // public RestTemplate getRestTemplate() { // return new RestTemplate(); // } @Bean public OAuth2RestTemplate restTemplate(UserInfoRestTemplateFactory factory) { return factory.getUserInfoRestTemplate(); } @Primary @Bean public RestTemplate getCustomRestTemplate() { RestTemplate template = new RestTemplate(); List interceptors = template.getInterceptors(); if (interceptors == null) { template.setInterceptors(Collections.singletonList(new UserContextInterceptor())); } else { interceptors.add(new UserContextInterceptor()); template.setInterceptors(interceptors); } return template; } }
[ "mindonghyeon890@gmail.com" ]
mindonghyeon890@gmail.com
6659fd0452a54a7420927bd40858c366ce8d3e8e
d84fb60595312136aeb1069baad585da325c218d
/HuaShanApp/app/src/main/java/com/karazam/huashanapp/manage/main/view/fragment/ManageFragment.java
28cec100356bcb1f7f946e28de423998bd30fc49
[]
no_license
awplying12/huashanApp
d6a72b248c94a65e882385edf92231552214340c
86bd908ec2f82fc030a9d83238144a943461c842
refs/heads/master
2021-01-11T00:21:10.870110
2017-02-10T11:27:06
2017-02-10T11:27:06
70,544,770
0
0
null
null
null
null
UTF-8
Java
false
false
8,459
java
package com.karazam.huashanapp.manage.main.view.fragment; import android.databinding.DataBindingUtil; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.example.utils.base.BaseFragment; import com.example.utils.custom.RefreshRecyclerView; import com.example.utils.custom.WrapContentLinearLayoutManager; import com.karazam.huashanapp.HuaShanApplication; import com.karazam.huashanapp.R; import com.karazam.huashanapp.databinding.FragmentManageBinding; import com.karazam.huashanapp.main.Bean.HotProjects; import com.karazam.huashanapp.manage.main.model.databinding.ManageEntity; import com.karazam.huashanapp.manage.main.model.databinding.Project; import com.karazam.huashanapp.manage.main.view.ManageView; import com.karazam.huashanapp.manage.main.view.view.ContentAdapter; import com.karazam.huashanapp.main.adapter.TitleBarAdapter; import com.karazam.huashanapp.manage.main.viewmodel.ManageViewModel; import com.karazam.huashanapp.manage.main.viewmodel.ManageViewModelImpl; import com.ogaclejapan.rx.binding.Rx; import com.ogaclejapan.rx.binding.RxView; import java.util.ArrayList; /** * Created by Administrator on 2016/10/11. */ public class ManageFragment extends BaseFragment implements ManageView,SwipeRefreshLayout.OnRefreshListener{ private View view; private FragmentManageBinding binding; private ManageEntity entity = new ManageEntity(); private ManageViewModel mModel; private RecyclerView titlebar_rl; private TitleBarAdapter titlebarAdapter; private SwipeRefreshLayout mSwipeLayout; private RefreshRecyclerView content_rl; private ContentAdapter adapter; private String type = "guarantee"; private static int page = 1; private ImageView faile_img; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { binding = DataBindingUtil.inflate(inflater, R.layout.fragment_manage,container,false); view = binding.getRoot(); mModel = new ManageViewModelImpl(entity,this,getContext(),getActivity()); binding.setHandler(mModel); binding.setEntity(entity); initView(); setTitlebBar(); setRefreshRecyclerView(); initRefresh(); return view; } /** * 初始化View */ private void initView() { titlebar_rl = (RecyclerView) getView(R.id.manage_titlebar_rl,view); LinearLayoutManager lm = new LinearLayoutManager(getActivity(),LinearLayoutManager.HORIZONTAL,false); titlebar_rl.setLayoutManager(lm); // faile_img = (ImageView) getView(R.id.faile_img); mSwipeLayout = (SwipeRefreshLayout) getView(R.id.manage_sl,view); mSwipeLayout.setOnRefreshListener(this); mSwipeLayout.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light); content_rl = (RefreshRecyclerView) getView(R.id.content_rl,view); content_rl.setSwl_pl(mSwipeLayout); } /** * 设置标题栏 */ private void setTitlebBar() { ArrayList<String> list = new ArrayList<>(); list.add("产融贷"); list.add("优企宝"); list.add("保理贷"); // list.add("债权转让"); titlebarAdapter = new TitleBarAdapter(list,getContext(),17); titlebar_rl.setAdapter(titlebarAdapter); titlebarAdapter.setmOnItemClickListener(new TitleBarAdapter.onItemClickListener() { @Override public void onItemClick(View view, int position) { onItem(position); } }); } public void setCurrentItem(int position){ titlebarAdapter.setCurrentItem(position); onItem(position); } private void onItem(int position){ switch (position){ case 0: //产融货 type = "guarantee"; break; case 1: //优企宝 type = "mortgage"; break; case 2: //保理贷 type = "credit"; break; // case 3: //债权转让 // break; default: break; } Refresh(); } private void initRefresh() { Refresh(); RxView.of(content_rl).bind(HuaShanApplication.refreshManage, new Rx.Action<RefreshRecyclerView, String>() { @Override public void call(RefreshRecyclerView target, String s) { if(s.equals("Refresh")||s.equals("getManage")){ Refresh(); } } }); } /** * SwipeRefreshLayout配合RecyclerView * 实现下拉刷新和上拉加载更多以及没有数据的显示 * */ private void setRefreshRecyclerView() { // mSwipeLayout.addView(); WrapContentLinearLayoutManager layoutManager = new WrapContentLinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false){ @Override protected int getExtraLayoutSpace(RecyclerView.State state) { return 6000; } }; content_rl.setLayoutManager(layoutManager); ArrayList<HotProjects> list = new ArrayList<>(); // list.add(new HotProjects()); // list.add(new HotProjects()); // list.add(new HotProjects()); // list.add(new HotProjects()); // list.add(new HotProjects()); adapter = new ContentAdapter(getContext(),list,getActivity()); content_rl.setAdapter(adapter); // adapter.setmOnItemClickListener(new BidingAdapter.onItemClickListener() { // @Override // public void onItemClick(View view, int position) { // showToast("点击 Item"+position); // } // }); } @Override public void onRefresh() { // showToast("onRefresh Down"); Refresh(); } /** * 刷新数据 */ private void Refresh(){ page = 1; mModel.getManageData(type,page); } /** * 添加数据 */ private void addData(){ if(page >mModel.allpage){ showToast("到最后一页了!"); return; } mModel.getManageData(type,page); } /** * 获取数据成功 */ @Override public void getManageDataSuccess(ArrayList<HotProjects> datas) { mSwipeLayout.setRefreshing(false); if(content_rl.getVisibility() != View.VISIBLE){ content_rl.setVisibility(View.VISIBLE); } if(page == 1){ adapter.setmData(datas); adapter.notifyDataSetChanged(); }else { ArrayList<HotProjects> data = adapter.getmData(); data.addAll(datas); adapter.setmData(data); adapter.notifyDataSetChanged(); } // if(page >= mModel.allpage){ // return; // } page ++; } /** * 获取数据失败 * @param e */ @Override public void getManageDataFaile(String e) { mSwipeLayout.setRefreshing(false); if(content_rl.getVisibility() == View.VISIBLE ){ content_rl.setVisibility(View.GONE); } // else { // showToast("获取数据失败"); // } } /** * 获取数据故障 * @param e */ @Override public void getManageDataError(Throwable e) { mSwipeLayout.setRefreshing(false); if(content_rl.getVisibility() == View.VISIBLE ){ content_rl.setVisibility(View.GONE); } // else { // showToast("获取数据失败"); // } } @Override public void onStart() { super.onStart(); content_rl.setOnRefreshListener(new RefreshRecyclerView.OnRefreshListener() { @Override public void onRefreshUp() { addData(); } }); } }
[ "awplying14@163.com" ]
awplying14@163.com
0463c2f97780811fc3159559c0fc0aca77bf7e90
c0b37a664fde6a57ae61c4af635e6dea28d7905e
/Helpful dev stuff/AeriesMobilePortal_v1.2.0_apkpure.com_source_from_JADX/com/google/android/gms/internal/clearcut/zzaz.java
33039a5eb9d4369df82711b49124d070b6578e9f
[]
no_license
joshkmartinez/Grades
a21ce8ede1371b9a7af11c4011e965f603c43291
53760e47f808780d06c4fbc2f74028a2db8e2942
refs/heads/master
2023-01-30T13:23:07.129566
2020-12-07T18:20:46
2020-12-07T18:20:46
131,549,535
0
0
null
null
null
null
UTF-8
Java
false
false
5,510
java
package com.google.android.gms.internal.clearcut; import java.util.Arrays; import java.util.Collection; import java.util.RandomAccess; final class zzaz extends zzav<Boolean> implements zzcn<Boolean>, RandomAccess { private static final zzaz zzfg; private int size; private boolean[] zzfh; static { zzav com_google_android_gms_internal_clearcut_zzaz = new zzaz(); zzfg = com_google_android_gms_internal_clearcut_zzaz; com_google_android_gms_internal_clearcut_zzaz.zzv(); } zzaz() { this(new boolean[10], 0); } private zzaz(boolean[] zArr, int i) { this.zzfh = zArr; this.size = i; } private final void zza(int i, boolean z) { zzw(); if (i < 0 || i > this.size) { throw new IndexOutOfBoundsException(zzh(i)); } if (this.size < this.zzfh.length) { System.arraycopy(this.zzfh, i, this.zzfh, i + 1, this.size - i); } else { Object obj = new boolean[(((this.size * 3) / 2) + 1)]; System.arraycopy(this.zzfh, 0, obj, 0, i); System.arraycopy(this.zzfh, i, obj, i + 1, this.size - i); this.zzfh = obj; } this.zzfh[i] = z; this.size++; this.modCount++; } private final void zzg(int i) { if (i < 0 || i >= this.size) { throw new IndexOutOfBoundsException(zzh(i)); } } private final String zzh(int i) { int i2 = this.size; StringBuilder stringBuilder = new StringBuilder(35); stringBuilder.append("Index:"); stringBuilder.append(i); stringBuilder.append(", Size:"); stringBuilder.append(i2); return stringBuilder.toString(); } public final /* synthetic */ void add(int i, Object obj) { zza(i, ((Boolean) obj).booleanValue()); } public final boolean addAll(Collection<? extends Boolean> collection) { zzw(); zzci.checkNotNull(collection); if (!(collection instanceof zzaz)) { return super.addAll(collection); } zzaz com_google_android_gms_internal_clearcut_zzaz = (zzaz) collection; if (com_google_android_gms_internal_clearcut_zzaz.size == 0) { return false; } if (Integer.MAX_VALUE - this.size >= com_google_android_gms_internal_clearcut_zzaz.size) { int i = this.size + com_google_android_gms_internal_clearcut_zzaz.size; if (i > this.zzfh.length) { this.zzfh = Arrays.copyOf(this.zzfh, i); } System.arraycopy(com_google_android_gms_internal_clearcut_zzaz.zzfh, 0, this.zzfh, this.size, com_google_android_gms_internal_clearcut_zzaz.size); this.size = i; this.modCount++; return true; } throw new OutOfMemoryError(); } public final void addBoolean(boolean z) { zza(this.size, z); } public final boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof zzaz)) { return super.equals(obj); } zzaz com_google_android_gms_internal_clearcut_zzaz = (zzaz) obj; if (this.size != com_google_android_gms_internal_clearcut_zzaz.size) { return false; } boolean[] zArr = com_google_android_gms_internal_clearcut_zzaz.zzfh; for (int i = 0; i < this.size; i++) { if (this.zzfh[i] != zArr[i]) { return false; } } return true; } public final /* synthetic */ Object get(int i) { zzg(i); return Boolean.valueOf(this.zzfh[i]); } public final int hashCode() { int i = 1; for (int i2 = 0; i2 < this.size; i2++) { i = (i * 31) + zzci.zzc(this.zzfh[i2]); } return i; } public final /* synthetic */ Object remove(int i) { zzw(); zzg(i); boolean z = this.zzfh[i]; if (i < this.size - 1) { System.arraycopy(this.zzfh, i + 1, this.zzfh, i, this.size - i); } this.size--; this.modCount++; return Boolean.valueOf(z); } public final boolean remove(Object obj) { zzw(); for (int i = 0; i < this.size; i++) { if (obj.equals(Boolean.valueOf(this.zzfh[i]))) { System.arraycopy(this.zzfh, i + 1, this.zzfh, i, this.size - i); this.size--; this.modCount++; return true; } } return false; } protected final void removeRange(int i, int i2) { zzw(); if (i2 >= i) { System.arraycopy(this.zzfh, i2, this.zzfh, i, this.size - i2); this.size -= i2 - i; this.modCount++; return; } throw new IndexOutOfBoundsException("toIndex < fromIndex"); } public final /* synthetic */ Object set(int i, Object obj) { boolean booleanValue = ((Boolean) obj).booleanValue(); zzw(); zzg(i); boolean z = this.zzfh[i]; this.zzfh[i] = booleanValue; return Boolean.valueOf(z); } public final int size() { return this.size; } public final /* synthetic */ zzcn zzi(int i) { if (i >= this.size) { return new zzaz(Arrays.copyOf(this.zzfh, i), this.size); } throw new IllegalArgumentException(); } }
[ "joshkmartinez@gmail.com" ]
joshkmartinez@gmail.com
0f147fc07608fe396fdb5a7b923480f0badab55f
6db5dd98c5a6f505b0f7be0a18786a0c58a1829d
/genie-agent/src/main/java/com/netflix/genie/agent/cli/GenieAgentRunnner.java
4d14059ca33238ee58169c214222331638d825f2
[ "Apache-2.0" ]
permissive
zmyer/genie
d817f8715b135fa20e9a438082de7cf856c578c8
2f17f28f6e9b20f78af4abae44f5723f7de17375
refs/heads/master
2021-04-27T08:39:30.161566
2018-09-08T14:45:14
2018-09-08T14:45:14
122,494,637
0
0
null
2018-02-22T15:07:28
2018-02-22T15:07:28
null
UTF-8
Java
false
false
3,726
java
/* * * Copyright 2018 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.netflix.genie.agent.cli; import com.beust.jcommander.ParameterException; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.ExitCodeGenerator; import org.springframework.stereotype.Component; import java.util.Arrays; import java.util.Set; /** * Main entry point for execution after the application is initialized. * * @author mprimi * @since 4.0.0 */ @Slf4j @Component public class GenieAgentRunnner implements CommandLineRunner, ExitCodeGenerator { private final ArgumentParser argumentParser; private final CommandFactory commandFactory; private ExitCode exitCode = ExitCode.INIT_FAIL; GenieAgentRunnner( final ArgumentParser argumentParser, final CommandFactory commandFactory ) { this.argumentParser = argumentParser; this.commandFactory = commandFactory; } @Override public void run(final String... args) throws Exception { try { internalRun(args); } catch (final Throwable t) { final Throwable userConsoleException = t.getCause() != null ? t.getCause() : t; UserConsole.getLogger().error( "Command execution failed: {}", userConsoleException.getMessage(), userConsoleException ); UserConsole.getLogger().info("Full execution log file: {}", UserConsole.getLogFilePath()); log.info("Command execution failed", t); } } private void internalRun(final String[] args) { log.info("Parsing arguments..."); log.debug("Arguments: {}", Arrays.toString(args)); exitCode = ExitCode.INVALID_ARGS; try { argumentParser.parse(args); } catch (ParameterException e) { throw new IllegalArgumentException("Failed to parse arguments: " + e.getMessage(), e); } final String commandName = argumentParser.getSelectedCommand(); final Set<String> availableCommands = argumentParser.getCommandNames(); final String availableCommandsString = Arrays.toString(availableCommands.toArray()); if (commandName == null) { throw new IllegalArgumentException("No command selected -- commands available: " + availableCommandsString); } else if (!availableCommands.contains(commandName)) { throw new IllegalArgumentException("Invalid command -- commands available: " + availableCommandsString); } UserConsole.getLogger().info("Initializing command {}", commandName); log.info("Initializing command: {}", commandName); exitCode = ExitCode.COMMAND_INIT_FAIL; final AgentCommand command = commandFactory.get(commandName); exitCode = ExitCode.EXEC_FAIL; command.run(); exitCode = ExitCode.SUCCESS; } @Override public int getExitCode() { UserConsole.getLogger().info("Terminating with code: {} ({})", exitCode.getCode(), exitCode.getMessage()); return exitCode.getCode(); } }
[ "mprimi@netflix.com" ]
mprimi@netflix.com
a48d42bb7b72e60362513c89c77c88d04e24fa17
1b36819121a38f48887107a84e0d5e9315493237
/dmz-inward-test/src/test/java/dmztest/nioserver/src/org/sse/server/Queue.java
a0e2896e4eb11703e17a816456ab06dbb653c932
[]
no_license
dreamming/dmz-inward-
b74dc6dafe49806a1d2f85f8c6f621fdc3d81216
59d21aff412246112691e345a829212a1c5218b5
refs/heads/master
2021-05-23T05:51:04.644522
2018-08-13T12:36:28
2018-08-13T12:36:28
94,977,075
0
1
null
null
null
null
UTF-8
Java
false
false
681
java
package dmztest.nioserver.src.org.sse.server; import java.util.LinkedList; /** * @author tcowan */ public class Queue extends LinkedList { private int waitingThreads = 0; public synchronized void insert(Object obj) { addLast(obj); notify(); } public synchronized Object remove() { if (isEmpty()) { try { waitingThreads++; wait(); } catch (InterruptedException e) { Thread.interrupted(); } waitingThreads--; } return removeFirst(); } public boolean isEmpty() { return (size() - waitingThreads <= 0); } }
[ "yinming@namibank.com" ]
yinming@namibank.com
b90fb9e701c5678dfbfe1b940bac3dfb06814452
eb2d5b7111fc34c811b479083bb304058709d2f6
/app/src/main/java/com/zsml/textbannerview/utils/StatusBarUtil.java
bc70330cec43a4c4ef00c549c81df5b30c44a8f5
[ "Apache-2.0" ]
permissive
my11712/TextBannerViewNew
e61f72d636f47c01ec58d21c625b18fdc504fa36
5556aa32a54f4503ac88605eac60b9b731f78f9b
refs/heads/master
2020-04-13T08:00:23.173375
2018-12-26T05:05:28
2018-12-26T05:05:28
163,069,378
2
0
null
null
null
null
UTF-8
Java
false
false
12,479
java
package com.zsml.textbannerview.utils; import android.app.Activity; import android.content.Context; import android.content.res.Resources; import android.os.Build; import android.support.annotation.FloatRange; import android.support.annotation.RequiresApi; import android.util.Log; import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.regex.Pattern; @SuppressWarnings("unused") public class StatusBarUtil { public static int DEFAULT_COLOR = 0; public static float DEFAULT_ALPHA = 0;//Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? 0.2f : 0.3f; public static final int MIN_API = 19; //<editor-fold desc="沉侵"> public static void immersive(Activity activity) { immersive(activity, DEFAULT_COLOR, DEFAULT_ALPHA); } public static void immersive(Activity activity, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { immersive(activity.getWindow(), color, alpha); } public static void immersive(Activity activity, int color) { immersive(activity.getWindow(), color, 1f); } public static void immersive(Window window) { immersive(window, DEFAULT_COLOR, DEFAULT_ALPHA); } public static void immersive(Window window, int color) { immersive(window, color, 1f); } public static void immersive(Window window, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { if (Build.VERSION.SDK_INT >= 21) { window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(mixtureColor(color, alpha)); int systemUiVisibility = window.getDecorView().getSystemUiVisibility(); systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE; window.getDecorView().setSystemUiVisibility(systemUiVisibility); } else if (Build.VERSION.SDK_INT >= 19) { window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); setTranslucentView((ViewGroup) window.getDecorView(), color, alpha); } else if (Build.VERSION.SDK_INT >= MIN_API && Build.VERSION.SDK_INT > 16) { int systemUiVisibility = window.getDecorView().getSystemUiVisibility(); systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE; window.getDecorView().setSystemUiVisibility(systemUiVisibility); } } //</editor-fold> //<editor-fold desc="DarkMode"> public static void darkMode(Activity activity, boolean dark) { if (isFlyme4Later()) { darkModeForFlyme4(activity.getWindow(), dark); } else if (isMIUI6Later()) { darkModeForMIUI6(activity.getWindow(), dark); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { darkModeForM(activity.getWindow(), dark); } } /** 设置状态栏darkMode,字体颜色及icon变黑(目前支持MIUI6以上,Flyme4以上,Android M以上) */ public static void darkMode(Activity activity) { darkMode(activity.getWindow(), DEFAULT_COLOR, DEFAULT_ALPHA); } public static void darkMode(Activity activity, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { darkMode(activity.getWindow(), color, alpha); } /** 设置状态栏darkMode,字体颜色及icon变黑(目前支持MIUI6以上,Flyme4以上,Android M以上) */ public static void darkMode(Window window, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { if (isFlyme4Later()) { darkModeForFlyme4(window, true); immersive(window,color,alpha); } else if (isMIUI6Later()) { darkModeForMIUI6(window, true); immersive(window,color,alpha); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { darkModeForM(window, true); immersive(window, color, alpha); } else if (Build.VERSION.SDK_INT >= 19) { window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); setTranslucentView((ViewGroup) window.getDecorView(), color, alpha); } else { immersive(window, color, alpha); } // if (Build.VERSION.SDK_INT >= 21) { // window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); // window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); // window.setStatusBarColor(Color.TRANSPARENT); // } else if (Build.VERSION.SDK_INT >= 19) { // window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); // } // setTranslucentView((ViewGroup) window.getDecorView(), color, alpha); } //-------------------------> /** android 6.0设置字体颜色 */ @RequiresApi(Build.VERSION_CODES.M) private static void darkModeForM(Window window, boolean dark) { // window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); // window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); // window.setStatusBarColor(Color.TRANSPARENT); int systemUiVisibility = window.getDecorView().getSystemUiVisibility(); if (dark) { systemUiVisibility |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; } else { systemUiVisibility &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; } window.getDecorView().setSystemUiVisibility(systemUiVisibility); } /** * 设置Flyme4+的darkMode,darkMode时候字体颜色及icon变黑 * http://open-wiki.flyme.cn/index.php?title=Flyme%E7%B3%BB%E7%BB%9FAPI */ public static boolean darkModeForFlyme4(Window window, boolean dark) { boolean result = false; if (window != null) { try { WindowManager.LayoutParams e = window.getAttributes(); Field darkFlag = WindowManager.LayoutParams.class.getDeclaredField("MEIZU_FLAG_DARK_STATUS_BAR_ICON"); Field meizuFlags = WindowManager.LayoutParams.class.getDeclaredField("meizuFlags"); darkFlag.setAccessible(true); meizuFlags.setAccessible(true); int bit = darkFlag.getInt(null); int value = meizuFlags.getInt(e); if (dark) { value |= bit; } else { value &= ~bit; } meizuFlags.setInt(e, value); window.setAttributes(e); result = true; } catch (Exception var8) { Log.e("StatusBar", "darkIcon: failed"); } } return result; } /** * 设置MIUI6+的状态栏是否为darkMode,darkMode时候字体颜色及icon变黑 * http://dev.xiaomi.com/doc/p=4769/ */ public static boolean darkModeForMIUI6(Window window, boolean darkmode) { Class<? extends Window> clazz = window.getClass(); try { int darkModeFlag = 0; Class<?> layoutParams = Class.forName("android.view.MiuiWindowManager$LayoutParams"); Field field = layoutParams.getField("EXTRA_FLAG_STATUS_BAR_DARK_MODE"); darkModeFlag = field.getInt(layoutParams); Method extraFlagField = clazz.getMethod("setExtraFlags", int.class, int.class); extraFlagField.invoke(window, darkmode ? darkModeFlag : 0, darkModeFlag); return true; } catch (Exception e) { e.printStackTrace(); return false; } } /** 判断是否Flyme4以上 */ public static boolean isFlyme4Later() { return Build.FINGERPRINT.contains("Flyme_OS_4") || Build.VERSION.INCREMENTAL.contains("Flyme_OS_4") || Pattern.compile("Flyme OS [4|5]", Pattern.CASE_INSENSITIVE).matcher(Build.DISPLAY).find(); } /** 判断是否为MIUI6以上 */ public static boolean isMIUI6Later() { try { Class<?> clz = Class.forName("android.os.SystemProperties"); Method mtd = clz.getMethod("get", String.class); String val = (String) mtd.invoke(null, "ro.miui.ui.version.name"); val = val.replaceAll("[vV]", ""); int version = Integer.parseInt(val); return version >= 6; } catch (Exception e) { return false; } } //</editor-fold> /** 增加View的paddingTop,增加的值为状态栏高度 */ public static void setPadding(Context context, View view) { if (Build.VERSION.SDK_INT >= MIN_API) { view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context), view.getPaddingRight(), view.getPaddingBottom()); } } /** 增加View的paddingTop,增加的值为状态栏高度 (智能判断,并设置高度)*/ public static void setPaddingSmart(Context context, View view) { if (Build.VERSION.SDK_INT >= MIN_API) { ViewGroup.LayoutParams lp = view.getLayoutParams(); if (lp != null && lp.height > 0) { lp.height += getStatusBarHeight(context);//增高 } view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context), view.getPaddingRight(), view.getPaddingBottom()); } } /** 增加View的高度以及paddingTop,增加的值为状态栏高度.一般是在沉浸式全屏给ToolBar用的 */ public static void setHeightAndPadding(Context context, View view) { if (Build.VERSION.SDK_INT >= MIN_API) { ViewGroup.LayoutParams lp = view.getLayoutParams(); lp.height += getStatusBarHeight(context);//增高 view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context), view.getPaddingRight(), view.getPaddingBottom()); } } /** 增加View上边距(MarginTop)一般是给高度为 WARP_CONTENT 的小控件用的*/ public static void setMargin(Context context, View view) { if (Build.VERSION.SDK_INT >= MIN_API) { ViewGroup.LayoutParams lp = view.getLayoutParams(); if (lp instanceof ViewGroup.MarginLayoutParams) { ((ViewGroup.MarginLayoutParams) lp).topMargin += getStatusBarHeight(context);//增高 } view.setLayoutParams(lp); } } /** * 创建假的透明栏 */ public static void setTranslucentView(ViewGroup container, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { if (Build.VERSION.SDK_INT >= 19) { int mixtureColor = mixtureColor(color, alpha); View translucentView = container.findViewById(android.R.id.custom); if (translucentView == null && mixtureColor != 0) { translucentView = new View(container.getContext()); translucentView.setId(android.R.id.custom); ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight(container.getContext())); container.addView(translucentView, lp); } if (translucentView != null) { translucentView.setBackgroundColor(mixtureColor); } } } public static int mixtureColor(int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { int a = (color & 0xff000000) == 0 ? 0xff : color >>> 24; return (color & 0x00ffffff) | (((int) (a * alpha)) << 24); } /** 获取状态栏高度 */ public static int getStatusBarHeight(Context context) { int result = 24; int resId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resId > 0) { result = context.getResources().getDimensionPixelSize(resId); } else { result = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, result, Resources.getSystem().getDisplayMetrics()); } return result; } }
[ "827071810@qq.com" ]
827071810@qq.com
595eb4b1a43315a3bf3425471f8a149488d1c8a0
c6bec449ff2060d668efa2c2e188324951240c1f
/src/ua/nure/tur/db/dao/ReviewDAO.java
967d47249de377ed8297c30c8481622e4cae9d25
[]
no_license
Dmitriytur/project
2a18d9521ffae3eaba474d26085fc911d542a163
aa977e320db7691e251b77560a628b8af50708d7
refs/heads/master
2021-07-03T17:32:34.897737
2017-09-22T01:49:56
2017-09-22T01:49:56
103,834,920
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package ua.nure.tur.db.dao; import ua.nure.tur.entities.Review; import ua.nure.tur.exceptions.DataAccessException; import java.util.List; public interface ReviewDAO { List<Review> findForPeriodical(Long id) throws DataAccessException; void create(Review review) throws DataAccessException; int getAmountForPeriodical(long periodicalId); }
[ "dmitriy.tur.v@gmail.com" ]
dmitriy.tur.v@gmail.com
b3bba8fc7824c21c44920d5dd55b0bd23a8cbdac
cf8870973bf6d1c818df1fabd81efa3949fc0999
/src/main/java/br/com/centralerrors/user/service/impl/UserService.java
585efac05543aee4f312b1586d025600ca332e1a
[]
no_license
marcelosoliveira/projeto-central-erros
d9428b778f213887ba2919bd63c89f520a8110fe
69ddf33dd0c447052574104f8bd6217c23623cda
refs/heads/master
2023-06-05T07:56:16.862942
2021-06-25T20:19:26
2021-06-25T20:19:26
354,385,555
0
0
null
null
null
null
UTF-8
Java
false
false
1,830
java
package br.com.centralerrors.user.service.impl; import br.com.centralerrors.user.repository.UserRepository; import br.com.centralerrors.user.service.interfaces.UserServiceInterface; import br.com.centralerrors.user.model.User; import lombok.AllArgsConstructor; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import java.util.List; import java.util.Optional; @Service @AllArgsConstructor public class UserService implements UserDetailsService, UserServiceInterface { private UserRepository userRepository; @Override public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException { User user = Optional.ofNullable(this.userRepository.findByUserName(userName)) .orElseThrow(() -> new UsernameNotFoundException("Usuario inexistente ou senha invalida")); List<GrantedAuthority> authorityListAdmin = AuthorityUtils.createAuthorityList( "ROLE_USER", "ROLE_ADMIN"); List<GrantedAuthority> authorityListUser = AuthorityUtils.createAuthorityList( "ROLE_USER"); return new org.springframework.security.core.userdetails.User( user.getUserName(), user.getPassword(), user.getIsAdmin() ? authorityListAdmin : authorityListUser); } @Override public String passwordCrypto(String password) { return new BCryptPasswordEncoder().encode(password); } }
[ "msbobsk8@gmail.com" ]
msbobsk8@gmail.com
4f05fb54f08e39396bb21086b90a6bfc8e61f81e
056dc76d11f63051cb4135ab4a5991ae5baddf4d
/app/src/main/java/com/task/dawadoz/forecast/rest/syncControllers/AccountGeneral.java
902c7c9b750184569b0ad4ce7e842f99b5b636d4
[]
no_license
n4nabil/WeatherApi
cf014f0cfc32fb2e9ea6096f996ace5c79ee5dc2
d69466b89829728ffd07dff6838860f330770f92
refs/heads/master
2020-04-07T05:39:01.836133
2018-11-19T10:01:25
2018-11-19T10:01:25
158,104,076
0
0
null
null
null
null
UTF-8
Java
false
false
2,525
java
package com.task.dawadoz.forecast.rest.syncControllers; import android.accounts.Account; import android.accounts.AccountManager; import android.content.ContentResolver; import android.content.Context; import android.os.Bundle; import android.widget.Toast; import com.task.dawadoz.forecast.localDataProvider.provider.SampleContentProvider; public final class AccountGeneral { /** * This is the type of account we are using. i.e. we can specify our app or apps * to have different types, such as 'read-only', 'sync-only', & 'admin'. */ private static final String ACCOUNT_TYPE = "com.example.syncaccount"; /** * This is the name that appears in the Android 'Accounts' settings. */ private static final String ACCOUNT_NAME = "Example Sync"; /** * Gets the standard sync account for our app. * @return {@link Account} */ public static Account getAccount() { return new Account(ACCOUNT_NAME, ACCOUNT_TYPE); } /** * Creates the standard sync account for our app. * @param c {@link Context} */ public static void createSyncAccount(Context c) { // Flag to determine if this is a new account or not boolean created = false; // Get an account and the account manager Account account = getAccount(); AccountManager manager = (AccountManager)c.getSystemService(Context.ACCOUNT_SERVICE); // Attempt to explicitly create the account with no password or extra data if (manager.addAccountExplicitly(account, null, null)) { final String AUTHORITY = SampleContentProvider.AUTHORITY; final long SYNC_FREQUENCY = 60 * 60; // 1 hour (seconds) // Inform the system that this account supports sync ContentResolver.setIsSyncable(account, AUTHORITY, 1); // Inform the system that this account is eligible for auto sync when the network is up ContentResolver.setSyncAutomatically(account, AUTHORITY, true); // Recommend a schedule for automatic synchronization. The system may modify this based // on other scheduled syncs and network utilization. ContentResolver.addPeriodicSync(account, AUTHORITY, new Bundle(), SYNC_FREQUENCY); created = true; } // Force a sync if the account was just created if (created) { Toast.makeText(c, "Created", Toast.LENGTH_SHORT).show(); SyncAdapter.performSync(); } } }
[ "nabilamin717@gmail.com" ]
nabilamin717@gmail.com
210041fffd520e78573e5a5699f9e344a515a885
f4ad7a1ccda2633c5cbdf30768e07220bc5a1523
/SpringBoot/springboot-08-shrio/shiro-springboot/src/main/java/com/komorebi/service/UserService.java
ae8a37254767c27663070c8e9c2945c314a79dbc
[]
no_license
judelawlee/JavaWeb
ff967be69c98d560b30ec7c2be7bed86c6a6c2d8
9f7eb06aeb0a4c6cd4cb9a0902ef9c46c501ee47
refs/heads/master
2023-05-14T13:37:47.136035
2021-06-02T00:31:52
2021-06-02T00:31:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
142
java
package com.komorebi.service; import com.komorebi.pojo.User; public interface UserService { public User queryUserByName(String name); }
[ "240553516@qq.com" ]
240553516@qq.com
e25728404574a1ba43474677a6f3782b06e3ae23
9030e4a286aeca0dbcca0f6c2caa2587a8a4988c
/src/com/zcib/filter/LoginFilter.java
5201d0118e739961af4765c0eb7662a298dd77cd
[]
no_license
Hadoop-cpu/shop
f46554cbdbf8f386c096ac6d929d7b1651859e06
61d341ed4acaf1c637067cbfe86ff41b970d1694
refs/heads/master
2022-11-17T06:06:12.707826
2020-07-13T13:21:53
2020-07-13T13:21:53
279,304,155
0
0
null
null
null
null
UTF-8
Java
false
false
1,663
java
package com.zcib.filter; import java.io.IOException; import javax.servlet.DispatcherType; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.zcib.domain.User; @WebFilter(dispatcherTypes = { DispatcherType.REQUEST, DispatcherType.FORWARD } , urlPatterns = { "/home/*", "/person/*" }, servletNames = { "AddressServlet" }) public class LoginFilter implements Filter { public LoginFilter() { } public void destroy() { } public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { /* * 对会员登录进行登录 * 1.获取Session * 2.获取User对象 * 3.User对象为空,去登录 * 4.不为空,放行 * */ //1.获取Session HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; HttpSession session = req.getSession(); //2.获取User对象 User user = (User) session.getAttribute("user"); //3.User对象为空,去登录 if(user == null){ // session.setAttribute("msg", "请登录后再操作!"); res.sendRedirect(req.getContextPath()+"/login.jsp"); }else{ chain.doFilter(request, response);//4.不为空,放行 } } public void init(FilterConfig fConfig) throws ServletException { } }
[ "Hadoop_CPU@163.com" ]
Hadoop_CPU@163.com
4d66edab5fff191308e56d8914312adda997ee29
5bdc3f7fe0430b4c344e0c71d2ef557ad7a5a9a3
/app/src/main/java/hdo/com/andzq/adapter/RepairsListAdapter.java
05b267a4ae2d6a6e132db433a2a3f2d0225999c8
[]
no_license
WT2020/AndZQ
08cbb6d7ec5a69b6d753b610973dbc6e13bec5e7
e1f14010818b5e621340b8d1444fd00848d74928
refs/heads/master
2020-03-26T19:44:47.318515
2018-08-19T07:56:03
2018-08-19T07:56:03
145,283,386
0
0
null
null
null
null
UTF-8
Java
false
false
3,245
java
package hdo.com.andzq.adapter; 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.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.List; import hdo.com.andzq.R; import hdo.com.andzq.bean.MyRepairsListBean; import hdo.com.andzq.utils.LogUtils; import hdo.com.andzq.utils.TimeUtils; import hdo.com.andzq.utils.ToastUtils; /** * description 新建查询Adapter * author 陈锐 * version 1.0 * created 2017/4/5 * modified by 邓杰 增加显示数据 2017/4/21 */ public class RepairsListAdapter extends RecyclerView.Adapter<RepairsListAdapter.ViewHolder> { private OnRecyclerItemClick mOnRecyclerItemClick; private Context mContext; /** * 数据源 */ private List<MyRepairsListBean.MyRepairBean> list; public RepairsListAdapter(Context ctx, OnRecyclerItemClick mOnRecyclerItemClick) { mContext = ctx; this.mOnRecyclerItemClick = mOnRecyclerItemClick; list = new ArrayList<>(); } public List<MyRepairsListBean.MyRepairBean> getList() { return list; } public void setList(List<MyRepairsListBean.MyRepairBean> list) { this.list = list; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(mContext).inflate(R.layout.item_repairs_list, parent, false); return new RepairsListAdapter.ViewHolder(view); } @Override public void onBindViewHolder(ViewHolder holder, int position) { holder.setData(position); holder.itemView.setOnClickListener(v -> { if (mOnRecyclerItemClick != null) { mOnRecyclerItemClick.onItemClick(position); } }); } @Override public int getItemCount() { return list.size(); } class ViewHolder extends RecyclerView.ViewHolder { TextView tvTime, tvType, tvState; ViewHolder(View itemView) { super(itemView); tvTime = (TextView) itemView.findViewById(R.id.tv_repairs_time); tvType = (TextView) itemView.findViewById(R.id.tv_repairs_type); tvState = (TextView) itemView.findViewById(R.id.tv_deal_state); } public void setData(int position) { if (list != null && list.size() != 0) { MyRepairsListBean.MyRepairBean bean = list.get(position); //设置的申请时间 tvTime.setText(TimeUtils.Long2Time(bean.getApplyTime())); tvType.setText(mContext.getResources().getStringArray(R.array.description_presuppose)[Integer .parseInt(bean.getType())]); tvState.setText(getState(bean.getRstate()));//维修状态 } else { Toast.makeText(mContext, "暂无数据", Toast.LENGTH_SHORT).show(); } } } private String getState(int state) { return mContext.getResources().getStringArray(R.array.repairs_state)[state]; } public interface OnRecyclerItemClick { void onItemClick(int position); } }
[ "1786344375@qq.com" ]
1786344375@qq.com
f54d1d898addf96295bb2268b461a03c9d187b10
db97163ee30dd5f7d3f1e8f4bf83aea7e3e50d7b
/App_for_App/App/src/main/java/com/GravityDailyHorscope/LayOutone.java
592186e70a8f85da503540291767714f2759fcc7
[]
no_license
rahulyhg/Astro-5
f41a74835b9cf9698aa53f9770cb3fde5ba08936
793a9a5a533aa01237e6d09a962dfe3e69af40a2
refs/heads/master
2021-05-30T23:32:59.558494
2016-02-10T20:30:10
2016-02-10T20:30:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
477
java
package com.GravityDailyHorscope; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; public class LayOutone extends Fragment{ Button share1; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.tab_fragment_1, container, false); } }
[ "goyalpratiksha20@gmmail.com" ]
goyalpratiksha20@gmmail.com
3473790615ec2eb44104f59447621be5ca818611
52a0908222e29022d487087d9158241f2b627502
/src/main/java/com/yunos/rbac/service/auth/AuthService.java
7d87b278a0b708287b7ef1afe793f89a9e7b2d90
[]
no_license
Domain711/rbac
51a04664c58c00d2545e066abc82651a1bc12b6e
3ccd976067e49fa79069ef595bed4f0c15cd273a
refs/heads/master
2020-04-24T18:35:16.391669
2019-03-04T00:06:52
2019-03-04T00:06:52
172,184,553
0
0
null
null
null
null
UTF-8
Java
false
false
787
java
package com.yunos.rbac.service.auth; import com.yunos.rbac.entity.role.RoleEntity; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 权限管理service */ public interface AuthService { /** * 查询需要授权的角色 * * @return */ List<RoleEntity> queryAllRole(Integer page); /** * 获取已有权限 * * @param roleId * @return */ long[] queryExistsPerm(Integer roleId); /** * 保存权限信息 * * @param permission * @return */ int saveRolePermAuth(@Param("roleId") Long roleId, @Param("permission") String permission); /** * 删除角色原有权限 * * @param roleId * @return */ int delRolePermAuth(Long roleId); }
[ "691386631@qq.com" ]
691386631@qq.com
5eb51f92ef53ef85853b2ad6c46e2b8071a70fc8
7d53d903c7955459b63380480f173317ddabb102
/src/com/thunisoft/sswy/mobile/util/CollectionUtils.java
c7e587aba35b86f040d01d9ea013ed7157b9a2dd
[]
no_license
piaoxue85/helloyy2
94dc611fad74c0514babd2bd3d44c3f5c3b1023f
c6990d929b3cb1ff0b67f4f7f71e5dbd17cfeba9
refs/heads/master
2023-03-15T15:57:21.266363
2016-03-30T02:58:37
2016-03-30T02:58:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
460
java
package com.thunisoft.sswy.mobile.util; import java.util.Collection; /** * * @author wuxm * */ public class CollectionUtils { /** * * @param coll * @return */ public static boolean isEmpty(@SuppressWarnings("rawtypes") Collection coll) { return (coll == null || coll.isEmpty()); } /** * * @param coll * @return */ public static boolean isNotEmpty(@SuppressWarnings("rawtypes") Collection coll) { return !isEmpty(coll); } }
[ "yaozy861211@163.com" ]
yaozy861211@163.com
a59069c88bfb514cbd6ae7535b68fd8fea2a6b3d
e211a963916b15ab9aaaa1ec7c1b5a7f332f89dc
/bridge/src/main/java/com/klay/bridge/VayneQ.java
f802d57af3620a717edc1061688cf62779a7808d
[]
no_license
673679842/Klay-java-design-pattern
f320b842ea5b819792e4d3069ce641f5033206b2
675f8368a22185aa0205187cc4cb19ec4752646c
refs/heads/master
2020-04-10T04:21:18.657747
2018-12-17T03:07:53
2018-12-17T03:07:53
160,795,881
1
0
null
null
null
null
UTF-8
Java
false
false
165
java
package com.klay.bridge; public class VayneQ implements SkillQ { @Override public void play() { System.out.println("my Q is 闪避突袭"); } }
[ "kchen@seven.com" ]
kchen@seven.com
fa167b36e5bb00bda0935a215fca377ce429c4f0
47d37c1904fb1cc5232cd12909fd41600471c2a2
/app/src/main/java/com/devsaidur/saidur/playnearnadmin/ui/allusers/Account.java
aac9ce94e97821b63af31562d4f8c54599197f50
[]
no_license
SaidurRahmanfuad/Playnearnadmin
b6c01aafbafa156909ddd717a339005ef95bc1b4
a78a606d3d9742a61920260f8b6ad7ea1b4923cd
refs/heads/master
2023-08-03T10:25:38.957986
2021-09-13T07:43:24
2021-09-13T07:43:24
405,878,942
0
0
null
null
null
null
UTF-8
Java
false
false
643
java
package com.devsaidur.saidur.playnearnadmin.ui.allusers; public class Account { String current_bal; String wallet_bal; public Account(String current_bal, String wallet_bal) { this.current_bal = current_bal; this.wallet_bal = wallet_bal; } public Account() { } public String getCurrent_bal() { return current_bal; } public void setCurrent_bal(String current_bal) { this.current_bal = current_bal; } public String getWallet_bal() { return wallet_bal; } public void setWallet_bal(String wallet_bal) { this.wallet_bal = wallet_bal; } }
[ "devsaidur@gmail.com" ]
devsaidur@gmail.com
aa2ebb62173fa5a68aba4feabba2ab2173d20a1b
914a24f6713f204adac6bfd239110cf9c84371cf
/src/main/java/com/zhwk022/ftp/test/SHA256File.java
6f46370055313c4c461868080d468bd266304e34
[]
no_license
zhwk022/filebackup
53dfcb37ab0589b2e633ce49110f46db15f92cc9
f32467b917d7f90afd3f927ddb51f3d8aedc8d4b
refs/heads/master
2020-03-13T10:25:18.509242
2018-08-20T08:37:16
2018-08-20T08:37:16
131,083,256
2
0
null
null
null
null
UTF-8
Java
false
false
3,317
java
package com.zhwk022.ftp.test; import java.io.*; import java.math.BigInteger; import java.security.MessageDigest; import java.util.Properties; public class SHA256File { static String official_checksum = "23d5686ffe489e5a1af95253b153ce9d6f933e5dbabe14c494631234697a0e08"; public static void OnEncFile() { System.out.println("Getting file..."); // File file = new File("F:\\BaiduNetdiskDownload\\最后一战bl.zip"); File file = new File("J:\\ftp2test\\tools_r25.2.3-windows111111.zip"); if (file.exists()) { System.out.println("File got."); } else { System.err.println("File not got."); } System.out.print("Calculating SHA-256 checksum......"); String fileSHA256 = getFileSHA256(file); System.out.println("File's SHA-256 checksum is: "); System.out.println(fileSHA256); System.out.println(official_checksum + " --- the official checksum"); if (official_checksum.equals(fileSHA256)) { System.out.println("SHA-256 checksums are the same."); } else { System.err.println("SHA-256 checksums differ!!!!"); } } private static String getFileSHA256(File file) { if (!file.isFile()) { System.err.println("not file"); return null; } MessageDigest digest = null; FileInputStream in = null; byte buffer[] = new byte[1024]; int len; try { digest = MessageDigest.getInstance("SHA-256"); in = new FileInputStream(file); while ((len = in.read(buffer, 0, 1024)) != -1) { digest.update(buffer, 0, len); } in.close(); } catch (Exception e) { e.printStackTrace(); return null; } BigInteger bigInt = new BigInteger(1, digest.digest()); return bigInt.toString(16); } public static void main(String[] args) { // OnEncFile(); if(args.length<1){ System.out.println("参数的个数必须等于1"); } File file = new File(args[0]); if(!file.exists()){ System.out.println("文件不存在"); } String fileSHA256 = getFileSHA256(file); System.out.println("success:"+fileSHA256); } public static void generateSHA256PropertiesFile(File dir) { Properties properties = new Properties(); for(File file: dir.listFiles()){ if(file.isFile()){ System.out.println("Calculating SHA-256 checksum......"); properties.put(file.getName(),getFileSHA256(file)); System.out.println("Calculating SHA-256 checksum end"); } } BufferedWriter writer = null; try { String filePath = QuartzJdbcTest.FILECHECKSUMFILE; writer = new BufferedWriter (new OutputStreamWriter (new FileOutputStream(filePath),"UTF-8")); properties.store(writer, "filename=checksum"); }catch (Exception e){ throw new RuntimeException(e); }finally { if(writer!=null){ try { writer.close(); }catch (Exception e){ } } } } }
[ "zhwk022@126.com" ]
zhwk022@126.com
8ee0a1a8ccfd4e274590d72ce889392d099cd039
b97bc0706448623a59a7f11d07e4a151173b7378
/src/main/java/radian/tcmis/server7/client/swa/servlets/SWAScannerUpload.java
0207f21f1ed5f86ad7a2682df7ee44f2ea387dc7
[]
no_license
zafrul-ust/tcmISDev
576a93e2cbb35a8ffd275fdbdd73c1f9161040b5
71418732e5465bb52a0079c7e7e7cec423a1d3ed
refs/heads/master
2022-12-21T15:46:19.801950
2020-02-07T21:22:50
2020-02-07T21:22:50
241,601,201
0
0
null
2022-12-13T19:29:34
2020-02-19T11:08:43
Java
UTF-8
Java
false
false
1,178
java
package radian.tcmis.server7.client.swa.servlets; /** * Title: Your Product Name * Description: Your description * Copyright: Copyright (c) 1998 * Company: Your Company * @author Your Name * @version */ import radian.tcmis.server7.share.helpers.*; import radian.tcmis.server7.share.servlets.*; import radian.tcmis.server7.client.swa.dbObjs.*; import radian.tcmis.server7.client.swa.helpers.*; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class SWAScannerUpload extends HttpServlet { public void init(ServletConfig config) throws ServletException { super.init(config); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { SWATcmISDBModel db = null; try { //db = new SWATcmISDBModel(); db = new SWATcmISDBModel("SWA",(String)request.getHeader("logon-version")); ScannerUpload obj = new ScannerUpload((ServerResourceBundle) new SWAServerResourceBundle(),db); obj.doPost(request,response); } catch (Exception e){ e.printStackTrace(); } finally { db.close(); } } }
[ "julio.rivero@wescoair.com" ]
julio.rivero@wescoair.com
cc66b3302b73a13ed52323245169436d94766481
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/ss/sls/extn/dm/SS_SLS_EXTN_4830_LDM.java
b723c3171bf5df49718b4934acd05b8531f96791
[]
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
UHC
Java
false
false
3,999
java
/*************************************************************************************************** * 파일명 : .java * 기능 : * 작성일자 : * 작성자 : 심정보 ***************************************************************************************************/ /*************************************************************************************************** * 수정내역 : * 수정자 : * 수정일자 : * 백업 : ***************************************************************************************************/ package chosun.ciis.ss.sls.extn.dm; import java.sql.*; import oracle.jdbc.driver.*; import somo.framework.db.*; import somo.framework.util.*; import chosun.ciis.ss.sls.extn.ds.*; import chosun.ciis.ss.sls.extn.rec.*; /** * */ public class SS_SLS_EXTN_4830_LDM extends somo.framework.db.BaseDM implements java.io.Serializable{ public String bocd; public String valmm; public SS_SLS_EXTN_4830_LDM(){} public SS_SLS_EXTN_4830_LDM(String bocd, String valmm){ this.bocd = bocd; this.valmm = valmm; } public void setBocd(String bocd){ this.bocd = bocd; } public void setValmm(String valmm){ this.valmm = valmm; } public String getBocd(){ return this.bocd; } public String getValmm(){ return this.valmm; } public String getSQL(){ return "{ call CRMSAL_COM.SP_SS_SLS_EXTN_4830_L(? ,? ,? ,? ,?) }"; } public void setParams(CallableStatement cstmt, BaseDM bdm) throws SQLException{ SS_SLS_EXTN_4830_LDM dm = (SS_SLS_EXTN_4830_LDM)bdm; cstmt.registerOutParameter(1, Types.VARCHAR); cstmt.registerOutParameter(2, Types.VARCHAR); cstmt.setString(3, dm.bocd); cstmt.setString(4, dm.valmm); cstmt.registerOutParameter(5, OracleTypes.CURSOR); } public BaseDataSet createDataSetObject(){ return new chosun.ciis.ss.sls.extn.ds.SS_SLS_EXTN_4830_LDataSet(); } public void print(){ System.out.println("SQL = " + this.getSQL()); System.out.println("bocd = [" + getBocd() + "]"); System.out.println("valmm = [" + getValmm() + "]"); } } /*---------------------------------------------------------------------------------------------------- Web Tier에서 req.getParameter() 처리 및 결과확인 검사시 사용하십시오. String bocd = req.getParameter("bocd"); if( bocd == null){ System.out.println(this.toString+" : bocd is null" ); }else{ System.out.println(this.toString+" : bocd is "+bocd ); } String valmm = req.getParameter("valmm"); if( valmm == null){ System.out.println(this.toString+" : valmm is null" ); }else{ System.out.println(this.toString+" : valmm is "+valmm ); } ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 req.getParameter() 처리시 사용하십시오. String bocd = Util.checkString(req.getParameter("bocd")); String valmm = Util.checkString(req.getParameter("valmm")); ----------------------------------------------------------------------------------------------------*//*---------------------------------------------------------------------------------------------------- Web Tier에서 한글처리와 동시에 req.getParameter() 처리시 사용하십시오. String bocd = Util.Uni2Ksc(Util.checkString(req.getParameter("bocd"))); String valmm = Util.Uni2Ksc(Util.checkString(req.getParameter("valmm"))); ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 DM 파일의 변수를 설정시 사용하십시오. dm.setBocd(bocd); dm.setValmm(valmm); ----------------------------------------------------------------------------------------------------*/ /* 작성시간 : Thu May 26 14:55:06 KST 2016 */
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11
94dc7ef09a32bb005fe2a5686f02b5b07d88a418
d6abcce54cefbf6fbc46110649167d6c7cb8935d
/Client/tutorial/java/src/FileSystemService.java
2a9b73932f255e279e23d7754140ddea8da077eb
[ "Zlib", "MIT", "FSFAP", "Apache-2.0" ]
permissive
daniarherikurniawan/File_System_on_Apache_Thrift
e37a591f257a4602b3284333d18a51a11e27a26e
6c4772e15b9ef0d48ca673cbc34f1176d759f78e
refs/heads/master
2021-01-24T09:50:42.715914
2016-10-06T07:26:58
2016-10-06T07:26:58
70,125,433
0
0
null
null
null
null
UTF-8
Java
false
true
135,387
java
/** * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package file_system_viewer; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-06") public class FileSystemService { public interface Iface { public String DIR(String path) throws org.apache.thrift.TException; public String CREATEDIR(String path, String nama_dir) throws org.apache.thrift.TException; public String GETFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException; public String PUTFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException; } public interface AsyncIface { public void DIR(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void CREATEDIR(String path, String nama_dir, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void GETFILE(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void PUTFILE(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } public static class Client extends org.apache.thrift.TServiceClient implements Iface { public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> { public Factory() {} public Client getClient(org.apache.thrift.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { return new Client(iprot, oprot); } } public Client(org.apache.thrift.protocol.TProtocol prot) { super(prot, prot); } public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { super(iprot, oprot); } public String DIR(String path) throws org.apache.thrift.TException { send_DIR(path); return recv_DIR(); } public void send_DIR(String path) throws org.apache.thrift.TException { DIR_args args = new DIR_args(); args.setPath(path); sendBase("DIR", args); } public String recv_DIR() throws org.apache.thrift.TException { DIR_result result = new DIR_result(); receiveBase(result, "DIR"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "DIR failed: unknown result"); } public String CREATEDIR(String path, String nama_dir) throws org.apache.thrift.TException { send_CREATEDIR(path, nama_dir); return recv_CREATEDIR(); } public void send_CREATEDIR(String path, String nama_dir) throws org.apache.thrift.TException { CREATEDIR_args args = new CREATEDIR_args(); args.setPath(path); args.setNama_dir(nama_dir); sendBase("CREATEDIR", args); } public String recv_CREATEDIR() throws org.apache.thrift.TException { CREATEDIR_result result = new CREATEDIR_result(); receiveBase(result, "CREATEDIR"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CREATEDIR failed: unknown result"); } public String GETFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException { send_GETFILE(path, nama_file, path_lokal); return recv_GETFILE(); } public void send_GETFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException { GETFILE_args args = new GETFILE_args(); args.setPath(path); args.setNama_file(nama_file); args.setPath_lokal(path_lokal); sendBase("GETFILE", args); } public String recv_GETFILE() throws org.apache.thrift.TException { GETFILE_result result = new GETFILE_result(); receiveBase(result, "GETFILE"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GETFILE failed: unknown result"); } public String PUTFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException { send_PUTFILE(path, nama_file, path_lokal); return recv_PUTFILE(); } public void send_PUTFILE(String path, String nama_file, String path_lokal) throws org.apache.thrift.TException { PUTFILE_args args = new PUTFILE_args(); args.setPath(path); args.setNama_file(nama_file); args.setPath_lokal(path_lokal); sendBase("PUTFILE", args); } public String recv_PUTFILE() throws org.apache.thrift.TException { PUTFILE_result result = new PUTFILE_result(); receiveBase(result, "PUTFILE"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "PUTFILE failed: unknown result"); } } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { private org.apache.thrift.async.TAsyncClientManager clientManager; private org.apache.thrift.protocol.TProtocolFactory protocolFactory; public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void DIR(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); DIR_call method_call = new DIR_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class DIR_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public DIR_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("DIR", org.apache.thrift.protocol.TMessageType.CALL, 0)); DIR_args args = new DIR_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public String getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_DIR(); } } public void CREATEDIR(String path, String nama_dir, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CREATEDIR_call method_call = new CREATEDIR_call(path, nama_dir, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class CREATEDIR_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private String nama_dir; public CREATEDIR_call(String path, String nama_dir, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.nama_dir = nama_dir; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CREATEDIR", org.apache.thrift.protocol.TMessageType.CALL, 0)); CREATEDIR_args args = new CREATEDIR_args(); args.setPath(path); args.setNama_dir(nama_dir); args.write(prot); prot.writeMessageEnd(); } public String getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_CREATEDIR(); } } public void GETFILE(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GETFILE_call method_call = new GETFILE_call(path, nama_file, path_lokal, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class GETFILE_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private String nama_file; private String path_lokal; public GETFILE_call(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.nama_file = nama_file; this.path_lokal = path_lokal; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GETFILE", org.apache.thrift.protocol.TMessageType.CALL, 0)); GETFILE_args args = new GETFILE_args(); args.setPath(path); args.setNama_file(nama_file); args.setPath_lokal(path_lokal); args.write(prot); prot.writeMessageEnd(); } public String getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_GETFILE(); } } public void PUTFILE(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); PUTFILE_call method_call = new PUTFILE_call(path, nama_file, path_lokal, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class PUTFILE_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private String nama_file; private String path_lokal; public PUTFILE_call(String path, String nama_file, String path_lokal, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.nama_file = nama_file; this.path_lokal = path_lokal; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("PUTFILE", org.apache.thrift.protocol.TMessageType.CALL, 0)); PUTFILE_args args = new PUTFILE_args(); args.setPath(path); args.setNama_file(nama_file); args.setPath_lokal(path_lokal); args.write(prot); prot.writeMessageEnd(); } public String getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_PUTFILE(); } } } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>())); } protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { processMap.put("DIR", new DIR()); processMap.put("CREATEDIR", new CREATEDIR()); processMap.put("GETFILE", new GETFILE()); processMap.put("PUTFILE", new PUTFILE()); return processMap; } public static class DIR<I extends Iface> extends org.apache.thrift.ProcessFunction<I, DIR_args> { public DIR() { super("DIR"); } public DIR_args getEmptyArgsInstance() { return new DIR_args(); } protected boolean isOneway() { return false; } public DIR_result getResult(I iface, DIR_args args) throws org.apache.thrift.TException { DIR_result result = new DIR_result(); result.success = iface.DIR(args.path); return result; } } public static class CREATEDIR<I extends Iface> extends org.apache.thrift.ProcessFunction<I, CREATEDIR_args> { public CREATEDIR() { super("CREATEDIR"); } public CREATEDIR_args getEmptyArgsInstance() { return new CREATEDIR_args(); } protected boolean isOneway() { return false; } public CREATEDIR_result getResult(I iface, CREATEDIR_args args) throws org.apache.thrift.TException { CREATEDIR_result result = new CREATEDIR_result(); result.success = iface.CREATEDIR(args.path, args.nama_dir); return result; } } public static class GETFILE<I extends Iface> extends org.apache.thrift.ProcessFunction<I, GETFILE_args> { public GETFILE() { super("GETFILE"); } public GETFILE_args getEmptyArgsInstance() { return new GETFILE_args(); } protected boolean isOneway() { return false; } public GETFILE_result getResult(I iface, GETFILE_args args) throws org.apache.thrift.TException { GETFILE_result result = new GETFILE_result(); result.success = iface.GETFILE(args.path, args.nama_file, args.path_lokal); return result; } } public static class PUTFILE<I extends Iface> extends org.apache.thrift.ProcessFunction<I, PUTFILE_args> { public PUTFILE() { super("PUTFILE"); } public PUTFILE_args getEmptyArgsInstance() { return new PUTFILE_args(); } protected boolean isOneway() { return false; } public PUTFILE_result getResult(I iface, PUTFILE_args args) throws org.apache.thrift.TException { PUTFILE_result result = new PUTFILE_result(); result.success = iface.PUTFILE(args.path, args.nama_file, args.path_lokal); return result; } } } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>())); } protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { processMap.put("DIR", new DIR()); processMap.put("CREATEDIR", new CREATEDIR()); processMap.put("GETFILE", new GETFILE()); processMap.put("PUTFILE", new PUTFILE()); return processMap; } public static class DIR<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, DIR_args, String> { public DIR() { super("DIR"); } public DIR_args getEmptyArgsInstance() { return new DIR_args(); } public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<String>() { public void onComplete(String o) { DIR_result result = new DIR_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; DIR_result result = new DIR_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, DIR_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException { iface.DIR(args.path,resultHandler); } } public static class CREATEDIR<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, CREATEDIR_args, String> { public CREATEDIR() { super("CREATEDIR"); } public CREATEDIR_args getEmptyArgsInstance() { return new CREATEDIR_args(); } public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<String>() { public void onComplete(String o) { CREATEDIR_result result = new CREATEDIR_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; CREATEDIR_result result = new CREATEDIR_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, CREATEDIR_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException { iface.CREATEDIR(args.path, args.nama_dir,resultHandler); } } public static class GETFILE<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, GETFILE_args, String> { public GETFILE() { super("GETFILE"); } public GETFILE_args getEmptyArgsInstance() { return new GETFILE_args(); } public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<String>() { public void onComplete(String o) { GETFILE_result result = new GETFILE_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; GETFILE_result result = new GETFILE_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, GETFILE_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException { iface.GETFILE(args.path, args.nama_file, args.path_lokal,resultHandler); } } public static class PUTFILE<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, PUTFILE_args, String> { public PUTFILE() { super("PUTFILE"); } public PUTFILE_args getEmptyArgsInstance() { return new PUTFILE_args(); } public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<String>() { public void onComplete(String o) { PUTFILE_result result = new PUTFILE_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; PUTFILE_result result = new PUTFILE_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, PUTFILE_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException { iface.PUTFILE(args.path, args.nama_file, args.path_lokal,resultHandler); } } } public static class DIR_args implements org.apache.thrift.TBase<DIR_args, DIR_args._Fields>, java.io.Serializable, Cloneable, Comparable<DIR_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DIR_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new DIR_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new DIR_argsTupleSchemeFactory()); } public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DIR_args.class, metaDataMap); } public DIR_args() { } public DIR_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public DIR_args(DIR_args other) { if (other.isSetPath()) { this.path = other.path; } } public DIR_args deepCopy() { return new DIR_args(this); } @Override public void clear() { this.path = null; } public String getPath() { return this.path; } public DIR_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof DIR_args) return this.equals((DIR_args)that); return false; } public boolean equals(DIR_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); return list.hashCode(); } @Override public int compareTo(DIR_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("DIR_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class DIR_argsStandardSchemeFactory implements SchemeFactory { public DIR_argsStandardScheme getScheme() { return new DIR_argsStandardScheme(); } } private static class DIR_argsStandardScheme extends StandardScheme<DIR_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, DIR_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, DIR_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class DIR_argsTupleSchemeFactory implements SchemeFactory { public DIR_argsTupleScheme getScheme() { return new DIR_argsTupleScheme(); } } private static class DIR_argsTupleScheme extends TupleScheme<DIR_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, DIR_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, DIR_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class DIR_result implements org.apache.thrift.TBase<DIR_result, DIR_result._Fields>, java.io.Serializable, Cloneable, Comparable<DIR_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DIR_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new DIR_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new DIR_resultTupleSchemeFactory()); } public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DIR_result.class, metaDataMap); } public DIR_result() { } public DIR_result( String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public DIR_result(DIR_result other) { if (other.isSetSuccess()) { this.success = other.success; } } public DIR_result deepCopy() { return new DIR_result(this); } @Override public void clear() { this.success = null; } public String getSuccess() { return this.success; } public DIR_result setSuccess(String success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof DIR_result) return this.equals((DIR_result)that); return false; } public boolean equals(DIR_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(DIR_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("DIR_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class DIR_resultStandardSchemeFactory implements SchemeFactory { public DIR_resultStandardScheme getScheme() { return new DIR_resultStandardScheme(); } } private static class DIR_resultStandardScheme extends StandardScheme<DIR_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, DIR_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, DIR_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class DIR_resultTupleSchemeFactory implements SchemeFactory { public DIR_resultTupleScheme getScheme() { return new DIR_resultTupleScheme(); } } private static class DIR_resultTupleScheme extends TupleScheme<DIR_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, DIR_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, DIR_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } } } } public static class CREATEDIR_args implements org.apache.thrift.TBase<CREATEDIR_args, CREATEDIR_args._Fields>, java.io.Serializable, Cloneable, Comparable<CREATEDIR_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CREATEDIR_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField NAMA_DIR_FIELD_DESC = new org.apache.thrift.protocol.TField("nama_dir", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new CREATEDIR_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new CREATEDIR_argsTupleSchemeFactory()); } public String path; // required public String nama_dir; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"), NAMA_DIR((short)2, "nama_dir"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // NAMA_DIR return NAMA_DIR; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.NAMA_DIR, new org.apache.thrift.meta_data.FieldMetaData("nama_dir", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CREATEDIR_args.class, metaDataMap); } public CREATEDIR_args() { } public CREATEDIR_args( String path, String nama_dir) { this(); this.path = path; this.nama_dir = nama_dir; } /** * Performs a deep copy on <i>other</i>. */ public CREATEDIR_args(CREATEDIR_args other) { if (other.isSetPath()) { this.path = other.path; } if (other.isSetNama_dir()) { this.nama_dir = other.nama_dir; } } public CREATEDIR_args deepCopy() { return new CREATEDIR_args(this); } @Override public void clear() { this.path = null; this.nama_dir = null; } public String getPath() { return this.path; } public CREATEDIR_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public String getNama_dir() { return this.nama_dir; } public CREATEDIR_args setNama_dir(String nama_dir) { this.nama_dir = nama_dir; return this; } public void unsetNama_dir() { this.nama_dir = null; } /** Returns true if field nama_dir is set (has been assigned a value) and false otherwise */ public boolean isSetNama_dir() { return this.nama_dir != null; } public void setNama_dirIsSet(boolean value) { if (!value) { this.nama_dir = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case NAMA_DIR: if (value == null) { unsetNama_dir(); } else { setNama_dir((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case NAMA_DIR: return getNama_dir(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case NAMA_DIR: return isSetNama_dir(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof CREATEDIR_args) return this.equals((CREATEDIR_args)that); return false; } public boolean equals(CREATEDIR_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_nama_dir = true && this.isSetNama_dir(); boolean that_present_nama_dir = true && that.isSetNama_dir(); if (this_present_nama_dir || that_present_nama_dir) { if (!(this_present_nama_dir && that_present_nama_dir)) return false; if (!this.nama_dir.equals(that.nama_dir)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_nama_dir = true && (isSetNama_dir()); list.add(present_nama_dir); if (present_nama_dir) list.add(nama_dir); return list.hashCode(); } @Override public int compareTo(CREATEDIR_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetNama_dir()).compareTo(other.isSetNama_dir()); if (lastComparison != 0) { return lastComparison; } if (isSetNama_dir()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nama_dir, other.nama_dir); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("CREATEDIR_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("nama_dir:"); if (this.nama_dir == null) { sb.append("null"); } else { sb.append(this.nama_dir); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class CREATEDIR_argsStandardSchemeFactory implements SchemeFactory { public CREATEDIR_argsStandardScheme getScheme() { return new CREATEDIR_argsStandardScheme(); } } private static class CREATEDIR_argsStandardScheme extends StandardScheme<CREATEDIR_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, CREATEDIR_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NAMA_DIR if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.nama_dir = iprot.readString(); struct.setNama_dirIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, CREATEDIR_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.nama_dir != null) { oprot.writeFieldBegin(NAMA_DIR_FIELD_DESC); oprot.writeString(struct.nama_dir); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class CREATEDIR_argsTupleSchemeFactory implements SchemeFactory { public CREATEDIR_argsTupleScheme getScheme() { return new CREATEDIR_argsTupleScheme(); } } private static class CREATEDIR_argsTupleScheme extends TupleScheme<CREATEDIR_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CREATEDIR_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetNama_dir()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetNama_dir()) { oprot.writeString(struct.nama_dir); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, CREATEDIR_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.nama_dir = iprot.readString(); struct.setNama_dirIsSet(true); } } } } public static class CREATEDIR_result implements org.apache.thrift.TBase<CREATEDIR_result, CREATEDIR_result._Fields>, java.io.Serializable, Cloneable, Comparable<CREATEDIR_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CREATEDIR_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new CREATEDIR_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new CREATEDIR_resultTupleSchemeFactory()); } public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CREATEDIR_result.class, metaDataMap); } public CREATEDIR_result() { } public CREATEDIR_result( String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public CREATEDIR_result(CREATEDIR_result other) { if (other.isSetSuccess()) { this.success = other.success; } } public CREATEDIR_result deepCopy() { return new CREATEDIR_result(this); } @Override public void clear() { this.success = null; } public String getSuccess() { return this.success; } public CREATEDIR_result setSuccess(String success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof CREATEDIR_result) return this.equals((CREATEDIR_result)that); return false; } public boolean equals(CREATEDIR_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(CREATEDIR_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("CREATEDIR_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class CREATEDIR_resultStandardSchemeFactory implements SchemeFactory { public CREATEDIR_resultStandardScheme getScheme() { return new CREATEDIR_resultStandardScheme(); } } private static class CREATEDIR_resultStandardScheme extends StandardScheme<CREATEDIR_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, CREATEDIR_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, CREATEDIR_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class CREATEDIR_resultTupleSchemeFactory implements SchemeFactory { public CREATEDIR_resultTupleScheme getScheme() { return new CREATEDIR_resultTupleScheme(); } } private static class CREATEDIR_resultTupleScheme extends TupleScheme<CREATEDIR_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CREATEDIR_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, CREATEDIR_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } } } } public static class GETFILE_args implements org.apache.thrift.TBase<GETFILE_args, GETFILE_args._Fields>, java.io.Serializable, Cloneable, Comparable<GETFILE_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GETFILE_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField NAMA_FILE_FIELD_DESC = new org.apache.thrift.protocol.TField("nama_file", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField PATH_LOKAL_FIELD_DESC = new org.apache.thrift.protocol.TField("path_lokal", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new GETFILE_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new GETFILE_argsTupleSchemeFactory()); } public String path; // required public String nama_file; // required public String path_lokal; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"), NAMA_FILE((short)2, "nama_file"), PATH_LOKAL((short)3, "path_lokal"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // NAMA_FILE return NAMA_FILE; case 3: // PATH_LOKAL return PATH_LOKAL; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.NAMA_FILE, new org.apache.thrift.meta_data.FieldMetaData("nama_file", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PATH_LOKAL, new org.apache.thrift.meta_data.FieldMetaData("path_lokal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GETFILE_args.class, metaDataMap); } public GETFILE_args() { } public GETFILE_args( String path, String nama_file, String path_lokal) { this(); this.path = path; this.nama_file = nama_file; this.path_lokal = path_lokal; } /** * Performs a deep copy on <i>other</i>. */ public GETFILE_args(GETFILE_args other) { if (other.isSetPath()) { this.path = other.path; } if (other.isSetNama_file()) { this.nama_file = other.nama_file; } if (other.isSetPath_lokal()) { this.path_lokal = other.path_lokal; } } public GETFILE_args deepCopy() { return new GETFILE_args(this); } @Override public void clear() { this.path = null; this.nama_file = null; this.path_lokal = null; } public String getPath() { return this.path; } public GETFILE_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public String getNama_file() { return this.nama_file; } public GETFILE_args setNama_file(String nama_file) { this.nama_file = nama_file; return this; } public void unsetNama_file() { this.nama_file = null; } /** Returns true if field nama_file is set (has been assigned a value) and false otherwise */ public boolean isSetNama_file() { return this.nama_file != null; } public void setNama_fileIsSet(boolean value) { if (!value) { this.nama_file = null; } } public String getPath_lokal() { return this.path_lokal; } public GETFILE_args setPath_lokal(String path_lokal) { this.path_lokal = path_lokal; return this; } public void unsetPath_lokal() { this.path_lokal = null; } /** Returns true if field path_lokal is set (has been assigned a value) and false otherwise */ public boolean isSetPath_lokal() { return this.path_lokal != null; } public void setPath_lokalIsSet(boolean value) { if (!value) { this.path_lokal = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case NAMA_FILE: if (value == null) { unsetNama_file(); } else { setNama_file((String)value); } break; case PATH_LOKAL: if (value == null) { unsetPath_lokal(); } else { setPath_lokal((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case NAMA_FILE: return getNama_file(); case PATH_LOKAL: return getPath_lokal(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case NAMA_FILE: return isSetNama_file(); case PATH_LOKAL: return isSetPath_lokal(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof GETFILE_args) return this.equals((GETFILE_args)that); return false; } public boolean equals(GETFILE_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_nama_file = true && this.isSetNama_file(); boolean that_present_nama_file = true && that.isSetNama_file(); if (this_present_nama_file || that_present_nama_file) { if (!(this_present_nama_file && that_present_nama_file)) return false; if (!this.nama_file.equals(that.nama_file)) return false; } boolean this_present_path_lokal = true && this.isSetPath_lokal(); boolean that_present_path_lokal = true && that.isSetPath_lokal(); if (this_present_path_lokal || that_present_path_lokal) { if (!(this_present_path_lokal && that_present_path_lokal)) return false; if (!this.path_lokal.equals(that.path_lokal)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_nama_file = true && (isSetNama_file()); list.add(present_nama_file); if (present_nama_file) list.add(nama_file); boolean present_path_lokal = true && (isSetPath_lokal()); list.add(present_path_lokal); if (present_path_lokal) list.add(path_lokal); return list.hashCode(); } @Override public int compareTo(GETFILE_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetNama_file()).compareTo(other.isSetNama_file()); if (lastComparison != 0) { return lastComparison; } if (isSetNama_file()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nama_file, other.nama_file); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath_lokal()).compareTo(other.isSetPath_lokal()); if (lastComparison != 0) { return lastComparison; } if (isSetPath_lokal()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path_lokal, other.path_lokal); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("GETFILE_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("nama_file:"); if (this.nama_file == null) { sb.append("null"); } else { sb.append(this.nama_file); } first = false; if (!first) sb.append(", "); sb.append("path_lokal:"); if (this.path_lokal == null) { sb.append("null"); } else { sb.append(this.path_lokal); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class GETFILE_argsStandardSchemeFactory implements SchemeFactory { public GETFILE_argsStandardScheme getScheme() { return new GETFILE_argsStandardScheme(); } } private static class GETFILE_argsStandardScheme extends StandardScheme<GETFILE_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, GETFILE_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NAMA_FILE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.nama_file = iprot.readString(); struct.setNama_fileIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PATH_LOKAL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path_lokal = iprot.readString(); struct.setPath_lokalIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, GETFILE_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.nama_file != null) { oprot.writeFieldBegin(NAMA_FILE_FIELD_DESC); oprot.writeString(struct.nama_file); oprot.writeFieldEnd(); } if (struct.path_lokal != null) { oprot.writeFieldBegin(PATH_LOKAL_FIELD_DESC); oprot.writeString(struct.path_lokal); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class GETFILE_argsTupleSchemeFactory implements SchemeFactory { public GETFILE_argsTupleScheme getScheme() { return new GETFILE_argsTupleScheme(); } } private static class GETFILE_argsTupleScheme extends TupleScheme<GETFILE_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GETFILE_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetNama_file()) { optionals.set(1); } if (struct.isSetPath_lokal()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetNama_file()) { oprot.writeString(struct.nama_file); } if (struct.isSetPath_lokal()) { oprot.writeString(struct.path_lokal); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, GETFILE_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.nama_file = iprot.readString(); struct.setNama_fileIsSet(true); } if (incoming.get(2)) { struct.path_lokal = iprot.readString(); struct.setPath_lokalIsSet(true); } } } } public static class GETFILE_result implements org.apache.thrift.TBase<GETFILE_result, GETFILE_result._Fields>, java.io.Serializable, Cloneable, Comparable<GETFILE_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GETFILE_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new GETFILE_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new GETFILE_resultTupleSchemeFactory()); } public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GETFILE_result.class, metaDataMap); } public GETFILE_result() { } public GETFILE_result( String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public GETFILE_result(GETFILE_result other) { if (other.isSetSuccess()) { this.success = other.success; } } public GETFILE_result deepCopy() { return new GETFILE_result(this); } @Override public void clear() { this.success = null; } public String getSuccess() { return this.success; } public GETFILE_result setSuccess(String success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof GETFILE_result) return this.equals((GETFILE_result)that); return false; } public boolean equals(GETFILE_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(GETFILE_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("GETFILE_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class GETFILE_resultStandardSchemeFactory implements SchemeFactory { public GETFILE_resultStandardScheme getScheme() { return new GETFILE_resultStandardScheme(); } } private static class GETFILE_resultStandardScheme extends StandardScheme<GETFILE_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, GETFILE_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, GETFILE_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class GETFILE_resultTupleSchemeFactory implements SchemeFactory { public GETFILE_resultTupleScheme getScheme() { return new GETFILE_resultTupleScheme(); } } private static class GETFILE_resultTupleScheme extends TupleScheme<GETFILE_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GETFILE_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, GETFILE_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } } } } public static class PUTFILE_args implements org.apache.thrift.TBase<PUTFILE_args, PUTFILE_args._Fields>, java.io.Serializable, Cloneable, Comparable<PUTFILE_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PUTFILE_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField NAMA_FILE_FIELD_DESC = new org.apache.thrift.protocol.TField("nama_file", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField PATH_LOKAL_FIELD_DESC = new org.apache.thrift.protocol.TField("path_lokal", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new PUTFILE_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new PUTFILE_argsTupleSchemeFactory()); } public String path; // required public String nama_file; // required public String path_lokal; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"), NAMA_FILE((short)2, "nama_file"), PATH_LOKAL((short)3, "path_lokal"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // NAMA_FILE return NAMA_FILE; case 3: // PATH_LOKAL return PATH_LOKAL; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.NAMA_FILE, new org.apache.thrift.meta_data.FieldMetaData("nama_file", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PATH_LOKAL, new org.apache.thrift.meta_data.FieldMetaData("path_lokal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PUTFILE_args.class, metaDataMap); } public PUTFILE_args() { } public PUTFILE_args( String path, String nama_file, String path_lokal) { this(); this.path = path; this.nama_file = nama_file; this.path_lokal = path_lokal; } /** * Performs a deep copy on <i>other</i>. */ public PUTFILE_args(PUTFILE_args other) { if (other.isSetPath()) { this.path = other.path; } if (other.isSetNama_file()) { this.nama_file = other.nama_file; } if (other.isSetPath_lokal()) { this.path_lokal = other.path_lokal; } } public PUTFILE_args deepCopy() { return new PUTFILE_args(this); } @Override public void clear() { this.path = null; this.nama_file = null; this.path_lokal = null; } public String getPath() { return this.path; } public PUTFILE_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public String getNama_file() { return this.nama_file; } public PUTFILE_args setNama_file(String nama_file) { this.nama_file = nama_file; return this; } public void unsetNama_file() { this.nama_file = null; } /** Returns true if field nama_file is set (has been assigned a value) and false otherwise */ public boolean isSetNama_file() { return this.nama_file != null; } public void setNama_fileIsSet(boolean value) { if (!value) { this.nama_file = null; } } public String getPath_lokal() { return this.path_lokal; } public PUTFILE_args setPath_lokal(String path_lokal) { this.path_lokal = path_lokal; return this; } public void unsetPath_lokal() { this.path_lokal = null; } /** Returns true if field path_lokal is set (has been assigned a value) and false otherwise */ public boolean isSetPath_lokal() { return this.path_lokal != null; } public void setPath_lokalIsSet(boolean value) { if (!value) { this.path_lokal = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case NAMA_FILE: if (value == null) { unsetNama_file(); } else { setNama_file((String)value); } break; case PATH_LOKAL: if (value == null) { unsetPath_lokal(); } else { setPath_lokal((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case NAMA_FILE: return getNama_file(); case PATH_LOKAL: return getPath_lokal(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case NAMA_FILE: return isSetNama_file(); case PATH_LOKAL: return isSetPath_lokal(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof PUTFILE_args) return this.equals((PUTFILE_args)that); return false; } public boolean equals(PUTFILE_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_nama_file = true && this.isSetNama_file(); boolean that_present_nama_file = true && that.isSetNama_file(); if (this_present_nama_file || that_present_nama_file) { if (!(this_present_nama_file && that_present_nama_file)) return false; if (!this.nama_file.equals(that.nama_file)) return false; } boolean this_present_path_lokal = true && this.isSetPath_lokal(); boolean that_present_path_lokal = true && that.isSetPath_lokal(); if (this_present_path_lokal || that_present_path_lokal) { if (!(this_present_path_lokal && that_present_path_lokal)) return false; if (!this.path_lokal.equals(that.path_lokal)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_path = true && (isSetPath()); list.add(present_path); if (present_path) list.add(path); boolean present_nama_file = true && (isSetNama_file()); list.add(present_nama_file); if (present_nama_file) list.add(nama_file); boolean present_path_lokal = true && (isSetPath_lokal()); list.add(present_path_lokal); if (present_path_lokal) list.add(path_lokal); return list.hashCode(); } @Override public int compareTo(PUTFILE_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetNama_file()).compareTo(other.isSetNama_file()); if (lastComparison != 0) { return lastComparison; } if (isSetNama_file()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nama_file, other.nama_file); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath_lokal()).compareTo(other.isSetPath_lokal()); if (lastComparison != 0) { return lastComparison; } if (isSetPath_lokal()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path_lokal, other.path_lokal); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("PUTFILE_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("nama_file:"); if (this.nama_file == null) { sb.append("null"); } else { sb.append(this.nama_file); } first = false; if (!first) sb.append(", "); sb.append("path_lokal:"); if (this.path_lokal == null) { sb.append("null"); } else { sb.append(this.path_lokal); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class PUTFILE_argsStandardSchemeFactory implements SchemeFactory { public PUTFILE_argsStandardScheme getScheme() { return new PUTFILE_argsStandardScheme(); } } private static class PUTFILE_argsStandardScheme extends StandardScheme<PUTFILE_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, PUTFILE_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // NAMA_FILE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.nama_file = iprot.readString(); struct.setNama_fileIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PATH_LOKAL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path_lokal = iprot.readString(); struct.setPath_lokalIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, PUTFILE_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.nama_file != null) { oprot.writeFieldBegin(NAMA_FILE_FIELD_DESC); oprot.writeString(struct.nama_file); oprot.writeFieldEnd(); } if (struct.path_lokal != null) { oprot.writeFieldBegin(PATH_LOKAL_FIELD_DESC); oprot.writeString(struct.path_lokal); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class PUTFILE_argsTupleSchemeFactory implements SchemeFactory { public PUTFILE_argsTupleScheme getScheme() { return new PUTFILE_argsTupleScheme(); } } private static class PUTFILE_argsTupleScheme extends TupleScheme<PUTFILE_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, PUTFILE_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetNama_file()) { optionals.set(1); } if (struct.isSetPath_lokal()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetNama_file()) { oprot.writeString(struct.nama_file); } if (struct.isSetPath_lokal()) { oprot.writeString(struct.path_lokal); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, PUTFILE_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.nama_file = iprot.readString(); struct.setNama_fileIsSet(true); } if (incoming.get(2)) { struct.path_lokal = iprot.readString(); struct.setPath_lokalIsSet(true); } } } } public static class PUTFILE_result implements org.apache.thrift.TBase<PUTFILE_result, PUTFILE_result._Fields>, java.io.Serializable, Cloneable, Comparable<PUTFILE_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PUTFILE_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new PUTFILE_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new PUTFILE_resultTupleSchemeFactory()); } public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PUTFILE_result.class, metaDataMap); } public PUTFILE_result() { } public PUTFILE_result( String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public PUTFILE_result(PUTFILE_result other) { if (other.isSetSuccess()) { this.success = other.success; } } public PUTFILE_result deepCopy() { return new PUTFILE_result(this); } @Override public void clear() { this.success = null; } public String getSuccess() { return this.success; } public PUTFILE_result setSuccess(String success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof PUTFILE_result) return this.equals((PUTFILE_result)that); return false; } public boolean equals(PUTFILE_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(PUTFILE_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("PUTFILE_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class PUTFILE_resultStandardSchemeFactory implements SchemeFactory { public PUTFILE_resultStandardScheme getScheme() { return new PUTFILE_resultStandardScheme(); } } private static class PUTFILE_resultStandardScheme extends StandardScheme<PUTFILE_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, PUTFILE_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, PUTFILE_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class PUTFILE_resultTupleSchemeFactory implements SchemeFactory { public PUTFILE_resultTupleScheme getScheme() { return new PUTFILE_resultTupleScheme(); } } private static class PUTFILE_resultTupleScheme extends TupleScheme<PUTFILE_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, PUTFILE_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, PUTFILE_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } } } } }
[ "ddhhkk2@gmail.com" ]
ddhhkk2@gmail.com
6df14143551a79aac294877bb3745c2d51059844
519b53b6252afe41b81c93fef2c22480cbfb1123
/Tree/BinaryTreeLongestConsecutiveSequence.java
3ed030adf7e9a09f1b5d0affd03ac325fa88ea09
[]
no_license
AtefeMsb/LeetCode
66a489363a010beb80624e5d01331dc52c7ac2a9
95a686c028784c265d2dfde623cc58fb93a71c92
refs/heads/master
2022-07-11T09:44:04.816623
2022-06-08T19:35:20
2022-06-08T19:35:20
211,967,972
3
2
null
null
null
null
UTF-8
Java
false
false
966
java
/** * preorder DFS * O(n) */ class Solution { public int longestConsecutive(TreeNode root) { // to save the max length through all the recursive calls int[] max = new int[1]; dfs(root, max, 0, 0); return max[0]; } public void dfs(TreeNode root, int[] max, int curLength, int target) { // reach a leaf and need to return if (root == null) { return; } // if we found the next piece in sequence, add 1 to curLength if (root.val == target) { curLength++; // if we DID NOT find the next piece in sequence, reset the curLength to 1 } else { curLength = 1; } // update the max with the new curLength max[0] = Math.max(max[0], curLength); dfs(root.left, max, curLength, root.val + 1); dfs(root.right, max, curLength, root.val + 1); } }
[ "atefe.mosayebi@gmail.com" ]
atefe.mosayebi@gmail.com
58c361db9e809c104d772836858fe230542ceae6
f96f9bc3bf2aa39512dad20e5afc3ce43d5f61b4
/src/main/java/net/renfei/repository/entity/PostsDOExample.java
61024d439e998fb3ca6d31cf6a946d90b55f490a
[ "Apache-2.0" ]
permissive
khm915/www.renfei.net
89f3ab8e9ab9479c726a9280995870222b9b41ce
28801c55fa31f64c56cfe550652a17997d2fd205
refs/heads/master
2023-03-25T07:38:07.499291
2021-03-24T06:36:24
2021-03-24T06:37:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
34,266
java
package net.renfei.repository.entity; import java.util.ArrayList; import java.util.Date; import java.util.List; public class PostsDOExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public PostsDOExample() { oredCriteria = new ArrayList<>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Long value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Long value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Long value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Long value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Long value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Long value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Long> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Long> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Long value1, Long value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Long value1, Long value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andCategoryIdIsNull() { addCriterion("category_id is null"); return (Criteria) this; } public Criteria andCategoryIdIsNotNull() { addCriterion("category_id is not null"); return (Criteria) this; } public Criteria andCategoryIdEqualTo(Long value) { addCriterion("category_id =", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdNotEqualTo(Long value) { addCriterion("category_id <>", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdGreaterThan(Long value) { addCriterion("category_id >", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdGreaterThanOrEqualTo(Long value) { addCriterion("category_id >=", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdLessThan(Long value) { addCriterion("category_id <", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdLessThanOrEqualTo(Long value) { addCriterion("category_id <=", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdIn(List<Long> values) { addCriterion("category_id in", values, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdNotIn(List<Long> values) { addCriterion("category_id not in", values, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdBetween(Long value1, Long value2) { addCriterion("category_id between", value1, value2, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdNotBetween(Long value1, Long value2) { addCriterion("category_id not between", value1, value2, "categoryId"); return (Criteria) this; } public Criteria andIsOriginalIsNull() { addCriterion("is_original is null"); return (Criteria) this; } public Criteria andIsOriginalIsNotNull() { addCriterion("is_original is not null"); return (Criteria) this; } public Criteria andIsOriginalEqualTo(Boolean value) { addCriterion("is_original =", value, "isOriginal"); return (Criteria) this; } public Criteria andIsOriginalNotEqualTo(Boolean value) { addCriterion("is_original <>", value, "isOriginal"); return (Criteria) this; } public Criteria andIsOriginalGreaterThan(Boolean value) { addCriterion("is_original >", value, "isOriginal"); return (Criteria) this; } public Criteria andIsOriginalGreaterThanOrEqualTo(Boolean value) { addCriterion("is_original >=", value, "isOriginal"); return (Criteria) this; } public Criteria andIsOriginalLessThan(Boolean value) { addCriterion("is_original <", value, "isOriginal"); return (Criteria) this; } public Criteria andIsOriginalLessThanOrEqualTo(Boolean value) { addCriterion("is_original <=", value, "isOriginal"); return (Criteria) this; } public Criteria andIsOriginalIn(List<Boolean> values) { addCriterion("is_original in", values, "isOriginal"); return (Criteria) this; } public Criteria andIsOriginalNotIn(List<Boolean> values) { addCriterion("is_original not in", values, "isOriginal"); return (Criteria) this; } public Criteria andIsOriginalBetween(Boolean value1, Boolean value2) { addCriterion("is_original between", value1, value2, "isOriginal"); return (Criteria) this; } public Criteria andIsOriginalNotBetween(Boolean value1, Boolean value2) { addCriterion("is_original not between", value1, value2, "isOriginal"); return (Criteria) this; } public Criteria andViewsIsNull() { addCriterion("views is null"); return (Criteria) this; } public Criteria andViewsIsNotNull() { addCriterion("views is not null"); return (Criteria) this; } public Criteria andViewsEqualTo(Long value) { addCriterion("views =", value, "views"); return (Criteria) this; } public Criteria andViewsNotEqualTo(Long value) { addCriterion("views <>", value, "views"); return (Criteria) this; } public Criteria andViewsGreaterThan(Long value) { addCriterion("views >", value, "views"); return (Criteria) this; } public Criteria andViewsGreaterThanOrEqualTo(Long value) { addCriterion("views >=", value, "views"); return (Criteria) this; } public Criteria andViewsLessThan(Long value) { addCriterion("views <", value, "views"); return (Criteria) this; } public Criteria andViewsLessThanOrEqualTo(Long value) { addCriterion("views <=", value, "views"); return (Criteria) this; } public Criteria andViewsIn(List<Long> values) { addCriterion("views in", values, "views"); return (Criteria) this; } public Criteria andViewsNotIn(List<Long> values) { addCriterion("views not in", values, "views"); return (Criteria) this; } public Criteria andViewsBetween(Long value1, Long value2) { addCriterion("views between", value1, value2, "views"); return (Criteria) this; } public Criteria andViewsNotBetween(Long value1, Long value2) { addCriterion("views not between", value1, value2, "views"); return (Criteria) this; } public Criteria andThumbsUpIsNull() { addCriterion("thumbs_up is null"); return (Criteria) this; } public Criteria andThumbsUpIsNotNull() { addCriterion("thumbs_up is not null"); return (Criteria) this; } public Criteria andThumbsUpEqualTo(Long value) { addCriterion("thumbs_up =", value, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsUpNotEqualTo(Long value) { addCriterion("thumbs_up <>", value, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsUpGreaterThan(Long value) { addCriterion("thumbs_up >", value, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsUpGreaterThanOrEqualTo(Long value) { addCriterion("thumbs_up >=", value, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsUpLessThan(Long value) { addCriterion("thumbs_up <", value, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsUpLessThanOrEqualTo(Long value) { addCriterion("thumbs_up <=", value, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsUpIn(List<Long> values) { addCriterion("thumbs_up in", values, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsUpNotIn(List<Long> values) { addCriterion("thumbs_up not in", values, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsUpBetween(Long value1, Long value2) { addCriterion("thumbs_up between", value1, value2, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsUpNotBetween(Long value1, Long value2) { addCriterion("thumbs_up not between", value1, value2, "thumbsUp"); return (Criteria) this; } public Criteria andThumbsDownIsNull() { addCriterion("thumbs_down is null"); return (Criteria) this; } public Criteria andThumbsDownIsNotNull() { addCriterion("thumbs_down is not null"); return (Criteria) this; } public Criteria andThumbsDownEqualTo(Long value) { addCriterion("thumbs_down =", value, "thumbsDown"); return (Criteria) this; } public Criteria andThumbsDownNotEqualTo(Long value) { addCriterion("thumbs_down <>", value, "thumbsDown"); return (Criteria) this; } public Criteria andThumbsDownGreaterThan(Long value) { addCriterion("thumbs_down >", value, "thumbsDown"); return (Criteria) this; } public Criteria andThumbsDownGreaterThanOrEqualTo(Long value) { addCriterion("thumbs_down >=", value, "thumbsDown"); return (Criteria) this; } public Criteria andThumbsDownLessThan(Long value) { addCriterion("thumbs_down <", value, "thumbsDown"); return (Criteria) this; } public Criteria andThumbsDownLessThanOrEqualTo(Long value) { addCriterion("thumbs_down <=", value, "thumbsDown"); return (Criteria) this; } public Criteria andThumbsDownIn(List<Long> values) { addCriterion("thumbs_down in", values, "thumbsDown"); return (Criteria) this; } public Criteria andThumbsDownNotIn(List<Long> values) { addCriterion("thumbs_down not in", values, "thumbsDown"); return (Criteria) this; } public Criteria andThumbsDownBetween(Long value1, Long value2) { addCriterion("thumbs_down between", value1, value2, "thumbsDown"); return (Criteria) this; } public Criteria andThumbsDownNotBetween(Long value1, Long value2) { addCriterion("thumbs_down not between", value1, value2, "thumbsDown"); return (Criteria) this; } public Criteria andReleaseTimeIsNull() { addCriterion("release_time is null"); return (Criteria) this; } public Criteria andReleaseTimeIsNotNull() { addCriterion("release_time is not null"); return (Criteria) this; } public Criteria andReleaseTimeEqualTo(Date value) { addCriterion("release_time =", value, "releaseTime"); return (Criteria) this; } public Criteria andReleaseTimeNotEqualTo(Date value) { addCriterion("release_time <>", value, "releaseTime"); return (Criteria) this; } public Criteria andReleaseTimeGreaterThan(Date value) { addCriterion("release_time >", value, "releaseTime"); return (Criteria) this; } public Criteria andReleaseTimeGreaterThanOrEqualTo(Date value) { addCriterion("release_time >=", value, "releaseTime"); return (Criteria) this; } public Criteria andReleaseTimeLessThan(Date value) { addCriterion("release_time <", value, "releaseTime"); return (Criteria) this; } public Criteria andReleaseTimeLessThanOrEqualTo(Date value) { addCriterion("release_time <=", value, "releaseTime"); return (Criteria) this; } public Criteria andReleaseTimeIn(List<Date> values) { addCriterion("release_time in", values, "releaseTime"); return (Criteria) this; } public Criteria andReleaseTimeNotIn(List<Date> values) { addCriterion("release_time not in", values, "releaseTime"); return (Criteria) this; } public Criteria andReleaseTimeBetween(Date value1, Date value2) { addCriterion("release_time between", value1, value2, "releaseTime"); return (Criteria) this; } public Criteria andReleaseTimeNotBetween(Date value1, Date value2) { addCriterion("release_time not between", value1, value2, "releaseTime"); return (Criteria) this; } public Criteria andAddTimeIsNull() { addCriterion("add_time is null"); return (Criteria) this; } public Criteria andAddTimeIsNotNull() { addCriterion("add_time is not null"); return (Criteria) this; } public Criteria andAddTimeEqualTo(Date value) { addCriterion("add_time =", value, "addTime"); return (Criteria) this; } public Criteria andAddTimeNotEqualTo(Date value) { addCriterion("add_time <>", value, "addTime"); return (Criteria) this; } public Criteria andAddTimeGreaterThan(Date value) { addCriterion("add_time >", value, "addTime"); return (Criteria) this; } public Criteria andAddTimeGreaterThanOrEqualTo(Date value) { addCriterion("add_time >=", value, "addTime"); return (Criteria) this; } public Criteria andAddTimeLessThan(Date value) { addCriterion("add_time <", value, "addTime"); return (Criteria) this; } public Criteria andAddTimeLessThanOrEqualTo(Date value) { addCriterion("add_time <=", value, "addTime"); return (Criteria) this; } public Criteria andAddTimeIn(List<Date> values) { addCriterion("add_time in", values, "addTime"); return (Criteria) this; } public Criteria andAddTimeNotIn(List<Date> values) { addCriterion("add_time not in", values, "addTime"); return (Criteria) this; } public Criteria andAddTimeBetween(Date value1, Date value2) { addCriterion("add_time between", value1, value2, "addTime"); return (Criteria) this; } public Criteria andAddTimeNotBetween(Date value1, Date value2) { addCriterion("add_time not between", value1, value2, "addTime"); return (Criteria) this; } public Criteria andIsDeleteIsNull() { addCriterion("is_delete is null"); return (Criteria) this; } public Criteria andIsDeleteIsNotNull() { addCriterion("is_delete is not null"); return (Criteria) this; } public Criteria andIsDeleteEqualTo(Boolean value) { addCriterion("is_delete =", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteNotEqualTo(Boolean value) { addCriterion("is_delete <>", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteGreaterThan(Boolean value) { addCriterion("is_delete >", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteGreaterThanOrEqualTo(Boolean value) { addCriterion("is_delete >=", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteLessThan(Boolean value) { addCriterion("is_delete <", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteLessThanOrEqualTo(Boolean value) { addCriterion("is_delete <=", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteIn(List<Boolean> values) { addCriterion("is_delete in", values, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteNotIn(List<Boolean> values) { addCriterion("is_delete not in", values, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteBetween(Boolean value1, Boolean value2) { addCriterion("is_delete between", value1, value2, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteNotBetween(Boolean value1, Boolean value2) { addCriterion("is_delete not between", value1, value2, "isDelete"); return (Criteria) this; } public Criteria andIsCommentIsNull() { addCriterion("is_comment is null"); return (Criteria) this; } public Criteria andIsCommentIsNotNull() { addCriterion("is_comment is not null"); return (Criteria) this; } public Criteria andIsCommentEqualTo(Boolean value) { addCriterion("is_comment =", value, "isComment"); return (Criteria) this; } public Criteria andIsCommentNotEqualTo(Boolean value) { addCriterion("is_comment <>", value, "isComment"); return (Criteria) this; } public Criteria andIsCommentGreaterThan(Boolean value) { addCriterion("is_comment >", value, "isComment"); return (Criteria) this; } public Criteria andIsCommentGreaterThanOrEqualTo(Boolean value) { addCriterion("is_comment >=", value, "isComment"); return (Criteria) this; } public Criteria andIsCommentLessThan(Boolean value) { addCriterion("is_comment <", value, "isComment"); return (Criteria) this; } public Criteria andIsCommentLessThanOrEqualTo(Boolean value) { addCriterion("is_comment <=", value, "isComment"); return (Criteria) this; } public Criteria andIsCommentIn(List<Boolean> values) { addCriterion("is_comment in", values, "isComment"); return (Criteria) this; } public Criteria andIsCommentNotIn(List<Boolean> values) { addCriterion("is_comment not in", values, "isComment"); return (Criteria) this; } public Criteria andIsCommentBetween(Boolean value1, Boolean value2) { addCriterion("is_comment between", value1, value2, "isComment"); return (Criteria) this; } public Criteria andIsCommentNotBetween(Boolean value1, Boolean value2) { addCriterion("is_comment not between", value1, value2, "isComment"); return (Criteria) this; } public Criteria andAvgViewsIsNull() { addCriterion("avg_views is null"); return (Criteria) this; } public Criteria andAvgViewsIsNotNull() { addCriterion("avg_views is not null"); return (Criteria) this; } public Criteria andAvgViewsEqualTo(Double value) { addCriterion("avg_views =", value, "avgViews"); return (Criteria) this; } public Criteria andAvgViewsNotEqualTo(Double value) { addCriterion("avg_views <>", value, "avgViews"); return (Criteria) this; } public Criteria andAvgViewsGreaterThan(Double value) { addCriterion("avg_views >", value, "avgViews"); return (Criteria) this; } public Criteria andAvgViewsGreaterThanOrEqualTo(Double value) { addCriterion("avg_views >=", value, "avgViews"); return (Criteria) this; } public Criteria andAvgViewsLessThan(Double value) { addCriterion("avg_views <", value, "avgViews"); return (Criteria) this; } public Criteria andAvgViewsLessThanOrEqualTo(Double value) { addCriterion("avg_views <=", value, "avgViews"); return (Criteria) this; } public Criteria andAvgViewsIn(List<Double> values) { addCriterion("avg_views in", values, "avgViews"); return (Criteria) this; } public Criteria andAvgViewsNotIn(List<Double> values) { addCriterion("avg_views not in", values, "avgViews"); return (Criteria) this; } public Criteria andAvgViewsBetween(Double value1, Double value2) { addCriterion("avg_views between", value1, value2, "avgViews"); return (Criteria) this; } public Criteria andAvgViewsNotBetween(Double value1, Double value2) { addCriterion("avg_views not between", value1, value2, "avgViews"); return (Criteria) this; } public Criteria andAvgCommentIsNull() { addCriterion("avg_comment is null"); return (Criteria) this; } public Criteria andAvgCommentIsNotNull() { addCriterion("avg_comment is not null"); return (Criteria) this; } public Criteria andAvgCommentEqualTo(Double value) { addCriterion("avg_comment =", value, "avgComment"); return (Criteria) this; } public Criteria andAvgCommentNotEqualTo(Double value) { addCriterion("avg_comment <>", value, "avgComment"); return (Criteria) this; } public Criteria andAvgCommentGreaterThan(Double value) { addCriterion("avg_comment >", value, "avgComment"); return (Criteria) this; } public Criteria andAvgCommentGreaterThanOrEqualTo(Double value) { addCriterion("avg_comment >=", value, "avgComment"); return (Criteria) this; } public Criteria andAvgCommentLessThan(Double value) { addCriterion("avg_comment <", value, "avgComment"); return (Criteria) this; } public Criteria andAvgCommentLessThanOrEqualTo(Double value) { addCriterion("avg_comment <=", value, "avgComment"); return (Criteria) this; } public Criteria andAvgCommentIn(List<Double> values) { addCriterion("avg_comment in", values, "avgComment"); return (Criteria) this; } public Criteria andAvgCommentNotIn(List<Double> values) { addCriterion("avg_comment not in", values, "avgComment"); return (Criteria) this; } public Criteria andAvgCommentBetween(Double value1, Double value2) { addCriterion("avg_comment between", value1, value2, "avgComment"); return (Criteria) this; } public Criteria andAvgCommentNotBetween(Double value1, Double value2) { addCriterion("avg_comment not between", value1, value2, "avgComment"); return (Criteria) this; } public Criteria andPageRankIsNull() { addCriterion("page_rank is null"); return (Criteria) this; } public Criteria andPageRankIsNotNull() { addCriterion("page_rank is not null"); return (Criteria) this; } public Criteria andPageRankEqualTo(Double value) { addCriterion("page_rank =", value, "pageRank"); return (Criteria) this; } public Criteria andPageRankNotEqualTo(Double value) { addCriterion("page_rank <>", value, "pageRank"); return (Criteria) this; } public Criteria andPageRankGreaterThan(Double value) { addCriterion("page_rank >", value, "pageRank"); return (Criteria) this; } public Criteria andPageRankGreaterThanOrEqualTo(Double value) { addCriterion("page_rank >=", value, "pageRank"); return (Criteria) this; } public Criteria andPageRankLessThan(Double value) { addCriterion("page_rank <", value, "pageRank"); return (Criteria) this; } public Criteria andPageRankLessThanOrEqualTo(Double value) { addCriterion("page_rank <=", value, "pageRank"); return (Criteria) this; } public Criteria andPageRankIn(List<Double> values) { addCriterion("page_rank in", values, "pageRank"); return (Criteria) this; } public Criteria andPageRankNotIn(List<Double> values) { addCriterion("page_rank not in", values, "pageRank"); return (Criteria) this; } public Criteria andPageRankBetween(Double value1, Double value2) { addCriterion("page_rank between", value1, value2, "pageRank"); return (Criteria) this; } public Criteria andPageRankNotBetween(Double value1, Double value2) { addCriterion("page_rank not between", value1, value2, "pageRank"); return (Criteria) this; } public Criteria andPageRankUpdateTimeIsNull() { addCriterion("page_rank_update_time is null"); return (Criteria) this; } public Criteria andPageRankUpdateTimeIsNotNull() { addCriterion("page_rank_update_time is not null"); return (Criteria) this; } public Criteria andPageRankUpdateTimeEqualTo(Date value) { addCriterion("page_rank_update_time =", value, "pageRankUpdateTime"); return (Criteria) this; } public Criteria andPageRankUpdateTimeNotEqualTo(Date value) { addCriterion("page_rank_update_time <>", value, "pageRankUpdateTime"); return (Criteria) this; } public Criteria andPageRankUpdateTimeGreaterThan(Date value) { addCriterion("page_rank_update_time >", value, "pageRankUpdateTime"); return (Criteria) this; } public Criteria andPageRankUpdateTimeGreaterThanOrEqualTo(Date value) { addCriterion("page_rank_update_time >=", value, "pageRankUpdateTime"); return (Criteria) this; } public Criteria andPageRankUpdateTimeLessThan(Date value) { addCriterion("page_rank_update_time <", value, "pageRankUpdateTime"); return (Criteria) this; } public Criteria andPageRankUpdateTimeLessThanOrEqualTo(Date value) { addCriterion("page_rank_update_time <=", value, "pageRankUpdateTime"); return (Criteria) this; } public Criteria andPageRankUpdateTimeIn(List<Date> values) { addCriterion("page_rank_update_time in", values, "pageRankUpdateTime"); return (Criteria) this; } public Criteria andPageRankUpdateTimeNotIn(List<Date> values) { addCriterion("page_rank_update_time not in", values, "pageRankUpdateTime"); return (Criteria) this; } public Criteria andPageRankUpdateTimeBetween(Date value1, Date value2) { addCriterion("page_rank_update_time between", value1, value2, "pageRankUpdateTime"); return (Criteria) this; } public Criteria andPageRankUpdateTimeNotBetween(Date value1, Date value2) { addCriterion("page_rank_update_time not between", value1, value2, "pageRankUpdateTime"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "i@renfei.net" ]
i@renfei.net
e47c6511892258339d2e79759ba96e905ef787a8
12cde4336475f7001061f494cc14fae753a4171b
/quiz/src/quiz28/StringQuiz03.java
8f9d449dfeed6b54c0ad3d5fc8d8ac774674a631
[]
no_license
ahn1205/java
bed9adb521ee3eeaad1ab7dcd2db3b0873aa8c72
c638a17bc9c697f260d227254c73bc54fd5d12a2
refs/heads/master
2022-09-18T03:58:19.162734
2020-06-03T07:09:07
2020-06-03T07:09:07
269,015,240
0
0
null
null
null
null
UTF-8
Java
false
false
601
java
package quiz28; public class StringQuiz03 { public static void main(String[] args) { } public static String palindrome(String word) { // word = word.replace(" ", ""); // for(int i = 0; i < word.length() / 2 ; i++) { // // if(word.charAt(i) != word.charAt( word.length() -1 -i ) ) { // return "회문이 아닙니다"; // } // } // return "회문 입니다"; word = word.replace(" ", ""); StringBuffer sb = new StringBuffer(word); if(sb.reverse().toString().equals(word) ) { return "회문입니다"; } else { return "회문이 아닙니다"; } } }
[ "ahnsw1205@naver.com" ]
ahnsw1205@naver.com
bc62f328bdafcb91dfc71bc35474d294afdab502
6891eb2524b57128a17fd5bc0a0cfd0f485048c4
/src/com/mcxtzhang/Chapter4/TestInt2Char.java
b39c23dbadee72eaebe6f31af985175d826974c7
[ "MIT" ]
permissive
mcxtzhang/TJ-notes
d6a0594405ff5ffea0ea7b2c505300e47a25fe12
9454937b53403c70007ba9e0d32c3df61da8bac3
refs/heads/master
2020-05-23T08:01:53.213842
2019-01-22T09:39:44
2019-01-22T09:39:44
80,487,759
2
0
null
null
null
null
UTF-8
Java
false
false
491
java
package com.mcxtzhang.Chapter4; /** * Created by Administrator on 17-2-1. */ public class TestInt2Char { public static void main(String[] arg) { System.out.println('a'); System.out.println((char) 'a'); System.out.println((int) 'a'); System.out.println('a' + 26); System.out.println((char) ('a' + 26)); System.out.println((int) 'a' + 26); // a // a // 97 // 123 // { // 123 } }
[ "mcxtzhang@163.com" ]
mcxtzhang@163.com
1368e63b7f01526c5c423e28c169d1db11cc26f0
9e4b875853b5e71bb9c3d2346b6d7b5607d6a337
/app/src/main/java/com/mofanstore/base/BaseFragment.java
548ed8b20c60cff34e6f12ca2e8c2022c8c12e7b
[]
no_license
RenVeCf/mofanstore
18dcbce28c8b75445e965432f40148cc60d8902b
b69fec648451494c79e5eaed64875e8852cf9842
refs/heads/master
2020-08-03T13:18:42.860680
2019-09-30T03:10:55
2019-09-30T03:10:55
211,765,406
0
0
null
null
null
null
UTF-8
Java
false
false
2,287
java
package com.mofanstore.base; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import android.widget.Toast; import com.mofanstore.R; import butterknife.ButterKnife; public abstract class BaseFragment extends Fragment { /***封装toast对象**/ private static Toast toast; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(intiLayout(),null); ButterKnife.inject(this, view); return view; } /** * 绑定布局 * @return */ protected abstract int intiLayout(); @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); initView(); } /** * 初始化组件 */ protected abstract void initView(); @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); initData(); } /** * 设置数据等逻辑代码 */ protected abstract void initData(); /** * 显示长toast * @param msg */ public void toastLong(String msg){ View layout = LayoutInflater.from(getActivity()).inflate(R.layout.activity_toast, null); TextView nam_tos = (TextView) layout.findViewById(R.id.nam_tos); nam_tos.setText(msg); if (toast == null) { //context.getApplicationContext()取代context也是为了防止内存泄露 toast = new Toast(this.getActivity()); toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); toast.setDuration(Toast.LENGTH_SHORT); toast.setView(layout); toast.show(); } else { toast.setView(layout); toast.show(); } } @Override public void onDestroyView() { super.onDestroyView(); ButterKnife.reset(this); } }
[ "942685687@qq.com" ]
942685687@qq.com
04161f1645644865ad6cfac95ccb99d92a7c5431
90eb7a131e5b3dc79e2d1e1baeed171684ef6a22
/sources/p298d/p299a/p300a/p301a/p303y0/p391i/p398z/C7277h.java
933f52b9f2e1cf607b6bfc61563101587d6e2f46
[]
no_license
shalviraj/greenlens
1c6608dca75ec204e85fba3171995628d2ee8961
fe9f9b5a3ef4a18f91e12d3925e09745c51bf081
refs/heads/main
2023-04-20T13:50:14.619773
2021-04-26T15:45:11
2021-04-26T15:45:11
361,799,768
0
0
null
null
null
null
UTF-8
Java
false
false
2,151
java
package p298d.p299a.p300a.p301a.p303y0.p391i.p398z; import java.util.Collection; import java.util.Set; import p298d.p299a.p300a.p301a.p303y0.p304b.C6207k0; import p298d.p299a.p300a.p301a.p303y0.p304b.C6232q0; import p298d.p299a.p300a.p301a.p303y0.p312c.p313a.C6257b; import p298d.p299a.p300a.p301a.p303y0.p331f.C6717d; import p298d.p334t.C6800r; import p298d.p344x.p345b.C6862l; import p298d.p344x.p346c.C6888i; import p298d.p344x.p346c.C6890k; /* renamed from: d.a.a.a.y0.i.z.h */ public interface C7277h extends C7282j { /* renamed from: a */ public static final C7278a f14517a = C7278a.f14518a; /* renamed from: d.a.a.a.y0.i.z.h$a */ public static final class C7278a { /* renamed from: a */ public static final /* synthetic */ C7278a f14518a = new C7278a(); /* renamed from: b */ public static final C6862l<C6717d, Boolean> f14519b = C7279a.f14520g; /* renamed from: d.a.a.a.y0.i.z.h$a$a */ public static final class C7279a extends C6890k implements C6862l<C6717d, Boolean> { /* renamed from: g */ public static final C7279a f14520g = new C7279a(); public C7279a() { super(1); } public Object invoke(Object obj) { C6888i.m12438e((C6717d) obj, "it"); return Boolean.TRUE; } } } /* renamed from: d.a.a.a.y0.i.z.h$b */ public static final class C7280b extends C7281i { /* renamed from: b */ public static final C7280b f14521b = new C7280b(); public Set<C6717d> getClassifierNames() { return C6800r.f13715g; } public Set<C6717d> getFunctionNames() { return C6800r.f13715g; } public Set<C6717d> getVariableNames() { return C6800r.f13715g; } } Set<C6717d> getClassifierNames(); Collection<? extends C6232q0> getContributedFunctions(C6717d dVar, C6257b bVar); Collection<? extends C6207k0> getContributedVariables(C6717d dVar, C6257b bVar); Set<C6717d> getFunctionNames(); Set<C6717d> getVariableNames(); }
[ "73280944+shalviraj@users.noreply.github.com" ]
73280944+shalviraj@users.noreply.github.com
629a5b246d4ba25703dc4dd44f472e9f6fcc4f73
2a662cfdf91e0cded6b9d272cbcea8a2d4377d4c
/Matrix Client/src/main/java/com/jagex/Exception_Sub2.java
00d81e3199cdf040a38b7f40bd4e21f16dab3fbe
[]
no_license
primnoprotogen/718_RS_Build
38293df71eb08d0cc64bce5e19cc64b46172463a
84ddd7138d8ea7dede51814e62868696932ec303
refs/heads/master
2023-04-04T04:21:25.263022
2021-04-20T22:17:11
2021-04-20T22:17:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package com.jagex;/* Exception_Sub2 - Decompiled by JODE * Visit http://jode.sourceforge.net/ */ public class Exception_Sub2 extends Exception { public Exception_Sub2(String string) { super(string); } public static int method274(byte i) { try { return Class118.anInt1401 * 332512427; } catch (RuntimeException runtimeexception) { throw Class346.method4175(runtimeexception, new StringBuilder() .append("aet.s(").append(')').toString()); } } }
[ "jesseguerrero1991@gmail.com" ]
jesseguerrero1991@gmail.com
3490b12d57aeb7cacabf3d21586f4965dc6daf89
793de554237f32ac8fde405b9cfdadf420e00953
/frontend/Danbi/app/src/main/java/com/example/juhyang/danbi_watering_test/Weather_WeatherToday.java
2e46a7b4c46a9ef2391d1e9841d4701549d9f337
[]
no_license
danbi0518/danbi
1385ab29e760770d2e804fb2005fed3f24fa2721
64a64b825edad1a1ae5f7d04c6c979b04b0c6897
refs/heads/master
2021-01-10T12:47:53.325647
2016-02-20T02:14:46
2016-02-20T02:14:46
52,131,621
0
1
null
null
null
null
UTF-8
Java
false
false
1,837
java
package com.example.juhyang.danbi_watering_test; /** * Created by JuHyang on 2016-02-16. */ public class Weather_WeatherToday { int lat; int ion; int temprature; int cloudy; int rain; int snow; int humidity; double windSpeed; String city; String windDeg; String mainWeather; public void setLat(int lat) { this.lat = lat; } public void setIon(int ion) { this.ion = ion; } public void setTemprature(int t) { this.temprature = t; } public void setCloudy(int cloudy) { this.cloudy = cloudy; } public void setCity(String city) { this.city = city; } public void setRain(int rain) { this.rain = rain; } public void setHumidity(int humidity) { this.humidity = humidity; } public void setWindSpeed(double windSpeed) { this.windSpeed = windSpeed; } public void setWindDeg(String windDeg) { this.windDeg = windDeg; } public void setMainWeather(String mainWeather){ this.mainWeather = mainWeather; } public void setSnow(int snow){ this.snow = snow; } public int getLat() { return lat; } public int getIon() { return ion; } public int getTemprature() { return temprature; } public int getCloudy() { return cloudy; } public String getCity() { return city; } public int getRain() { return rain; } public int getHumidity() { return humidity; } public double getWindSpeed() { return windSpeed; } public String getWindDeg() { return windDeg; } public String getMainWeather(){ return mainWeather; } public int getSnow(){ return snow; } }
[ "creative_seed@naver.com" ]
creative_seed@naver.com
f8cdda10990e9bd4de5835071e902d72a55d5f5f
d00ea6603e9bc0486098411d54d1652807278059
/r3-activity/src/com/jfixby/r3/ui/red/activity/raster/RedTileInfo.java
00c3cd9725774dec8a016c6d74f9efa69e103967
[ "Apache-2.0" ]
permissive
JFixby/R3Red
792e56bde7bd1b9c2715626eda18afd004b431cb
5924b89b28c69bc695e601524402afcda9023fb6
refs/heads/master
2020-12-02T22:21:00.190273
2017-07-21T11:12:41
2017-07-21T11:12:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,111
java
package com.jfixby.r3.ui.red.activity.raster; import com.jfixby.r3.api.activity.raster.Raster; import com.jfixby.scarabei.api.floatn.Float2; import com.jfixby.scarabei.api.geometry.Geometry; import com.jfixby.scarabei.api.geometry.Rectangle; import com.jfixby.scarabei.api.math.Angle; import com.jfixby.scarabei.api.math.FloatMath; public class RedTileInfo { public Raster raster; public double top_left_x; public double top_left_y; public double bottom_right_x; public double bottom_right_y; final Float2 tmpA = Geometry.newFloat2(); final Float2 tmpB = Geometry.newFloat2(); final Float2 tmpC = Geometry.newFloat2(); final Float2 tmpD = Geometry.newFloat2(); @Override public String toString () { return "RedTileInfo [top_left_x=" + top_left_x + ", top_left_y=" + top_left_y + ", bottom_left_x=" + bottom_right_x + ", bottom_left_y=" + bottom_right_y + ", raster=" + raster + "]"; } final RedTileInfo tile = this; // boolean need_update = !false; final void update (final Rectangle shape, final Angle angle) { // if (!need_update) { // return; // } final Raster raster = tile.raster; final Rectangle tile_shape = raster.shape(); this.tmpA.setXY(tile.top_left_x, tile.top_left_y); this.tmpB.setXY(tile.bottom_right_x, tile.top_left_y); this.tmpC.setXY(tile.bottom_right_x, tile.bottom_right_y); this.tmpD.setXY(tile.top_left_x, tile.bottom_right_y); shape.toAbsolute(this.tmpA); shape.toAbsolute(this.tmpB); // shape.toAbsolute(tmpC); shape.toAbsolute(this.tmpD); final double distance_AB = FloatMath.component().distance(this.tmpA.getX(), this.tmpA.getY(), this.tmpB.getX(), this.tmpB.getY()); final double distance_AD = FloatMath.component().distance(this.tmpA.getX(), this.tmpA.getY(), this.tmpD.getX(), this.tmpD.getY()); tile_shape.setOriginRelative(0, 0); // tile_shape.setOriginRelative(0, 0); // tile_shape.getPosition().getX(); tile_shape.setWidth(distance_AB); tile_shape.setHeight(distance_AD); tile_shape.setPosition(tmpA); tile_shape.setRotation(angle); } }
[ "github@jfixby.com" ]
github@jfixby.com
7be4e410ce8c5f26d5d103486b7cbe5572dd995f
ad8bee4ff8566e02a6956d57d02997f69861b6e6
/src/main/java/com/example/demo/service/AreaService.java
e507c69f1f553dc9aa3e5b112ce307753f1ca7b9
[]
no_license
1303110335/spring-demo2
530ff580f1a04eae816acb51378563582d00f216
b5c84f03050c8cc932ee05c4dfc71bcd307d4bba
refs/heads/master
2020-03-14T22:45:09.061379
2018-05-02T09:25:57
2018-05-02T09:25:57
131,828,107
0
0
null
null
null
null
UTF-8
Java
false
false
282
java
package com.example.demo.service; import java.util.List; import com.example.demo.entity.Area; public interface AreaService { List<Area> getAreaList(); Area getAreaById(int areaId); boolean addArea(Area area); boolean modifyArea(Area area); boolean deleteArea(int areaId); }
[ "1303110335@qq.com" ]
1303110335@qq.com
8810baf7d57e5e76162bdbecf24e095c40945561
c6417ed9b83e7008b20c892d20884b1edb2bab0b
/src/main/java/com/ninjasparrow/app/repository/AuthorityRepository.java
224de8fe5d37561c1cb8d099d57572ca963be0dd
[]
no_license
prayatna-jain/ninjasparrow
7808f6b5bf340bcbc08339150f77ca0ddd948250
38e62d68c66b115f3493ac008addc519dff00677
refs/heads/main
2023-05-14T06:46:48.346004
2021-06-13T13:40:18
2021-06-13T13:40:18
376,509,606
0
0
null
null
null
null
UTF-8
Java
false
false
304
java
package com.ninjasparrow.app.repository; import com.ninjasparrow.app.domain.Authority; import org.springframework.data.jpa.repository.JpaRepository; /** * Spring Data JPA repository for the {@link Authority} entity. */ public interface AuthorityRepository extends JpaRepository<Authority, String> {}
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
96a49e25749bbbd32cc860fbcdaa8a98b720a03c
cedd2ed85d2008877295a1e13dfe0666c5256d85
/PrsonForm.java
e8a9b318f6fbd54d176a7569ddf1fb497ee6fc39
[]
no_license
amiraliarab/final
0f0d24a4668346de3cf98d0fccdd9ac4e71d2b63
640e09f6a32f23c1860f7feed3c88c139f8b40b7
refs/heads/master
2020-12-26T11:53:56.159679
2020-01-31T19:28:22
2020-01-31T19:28:22
237,500,738
0
0
null
null
null
null
UTF-8
Java
false
false
5,664
java
package Package; public class PrsonForm extends javax.swing.JFrame { static String name; static String family; static void main(String n, String f) { name = n; family = f; java.awt.EventQueue.invokeLater(new Runnable() { public void run() { PrsonForm obj = new PrsonForm(); obj.setLocationRelativeTo(null); obj.setVisible(true); } }); } public PrsonForm() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jButton1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jButton1.setText("کتاب"); jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton1MouseClicked(evt); } }); jButton2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jButton2.setText("امانات"); jButton2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton2MouseClicked(evt); } }); jButton3.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jButton3.setText("کارکنان"); jButton3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton3MouseClicked(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(30, 30, 30) .addComponent(jButton3) .addGap(74, 74, 74) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 82, Short.MAX_VALUE) .addComponent(jButton1) .addGap(59, 59, 59)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(37, 37, 37) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2) .addComponent(jButton3)) .addContainerGap(222, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked BookMang.main(name,family); }//GEN-LAST:event_jButton1MouseClicked private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked FormAmanat.main(name,family); }//GEN-LAST:event_jButton2MouseClicked private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked PrsonForm o =new PrsonForm(); o.setVisible(true); }//GEN-LAST:event_jButton3MouseClicked public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(PrsonForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(PrsonForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(PrsonForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(PrsonForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new PrsonForm().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; // End of variables declaration//GEN-END:variables }
[ "amiraliarabnejad@gmail.com" ]
amiraliarabnejad@gmail.com
08c65fc815c1624e0902e78198adb2a43f477bfc
9d36edf3310c3e9aac935d1a3b24426dce502fe9
/src/main/java/cn/sola97/bot/livenotification/commands/channel/ShowCmd.java
13c982af1e70756da79f61cbb483cde70b083b42
[]
no_license
sola97/LiveNotificationBot
ec9de787dc24175d400beafa786cc560cb6f42c5
a78adcc46cc079d6d447f88a5b6be22e519c93a8
refs/heads/master
2022-09-18T15:23:45.992809
2019-07-05T14:20:51
2019-07-05T14:20:51
184,382,560
1
1
null
2022-09-01T23:06:11
2019-05-01T07:23:54
Java
UTF-8
Java
false
false
27,057
java
package cn.sola97.bot.livenotification.commands.channel; import static cn.sola97.bot.livenotification.BotConfig.*; import com.jagrosh.jdautilities.command.CommandEvent; import com.jagrosh.jdautilities.commons.waiter.EventWaiter; import com.jagrosh.jdautilities.menu.Menu; import cn.sola97.bot.livenotification.Bot; import cn.sola97.bot.livenotification.commands.ChannelCommand; import cn.sola97.bot.livenotification.utils.ParseUtil; import net.dv8tion.jda.core.EmbedBuilder; import net.dv8tion.jda.core.MessageBuilder; import net.dv8tion.jda.core.entities.*; import net.dv8tion.jda.core.events.message.GenericMessageEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.events.message.react.MessageReactionAddEvent; import net.dv8tion.jda.core.exceptions.PermissionException; import net.dv8tion.jda.core.requests.RestAction; import net.dv8tion.jda.core.utils.Checks; import java.awt.*; import java.util.*; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.function.BiFunction; import java.util.function.Consumer; public class ShowCmd extends ChannelCommand { private final Paginator.Builder builder; public ShowCmd(Bot bot) { super(bot); this.name = "show"; this.help = "subscribe a streamer on TextChannel "; this.arguments = "[pagenum]"; this.aliases = new String[]{"list", "ls"}; builder = new Paginator.Builder() .setColumns(1) .setFinalAction(m -> { try { m.clearReactions().queue(); } catch (PermissionException ignore) { } }) .setText("") .waitOnSinglePage(true) .setBot(bot) .setEventWaiter(bot.getWaiter()) .setTimeout(1, TimeUnit.MINUTES); } @Override protected void execute(CommandEvent event) { int pagenum = 1; try { pagenum = Integer.parseInt(event.getArgs()); } catch (NumberFormatException ignore) { } // use Unirest to poll an API List<EmbedBuilder> items = bot.getObManager().getObserversEmbedBuilderByChannelId(event.getChannel().getId()); if (items.isEmpty()) { event.reply("您还没有订阅"); return; } builder.setItems(items) .setColor(event.getSelfMember().getColor()) .setUsers(event.getAuthor()); builder.build().paginate(event.getChannel(), pagenum); } } //魔改 com.jagrosh.jdautilities.menu.Paginator class Paginator extends Menu { private final BiFunction<Integer, Integer, Color> color; private final BiFunction<Integer, Integer, String> text; private final int columns; private final int itemsPerPage; private final boolean showPageNumbers; private final boolean numberItems; private final List<EmbedBuilder> embedBuilders; private final int pages; private final Consumer<Message> finalAction; private final boolean waitOnSinglePage; private final int bulkSkipNumber; private final boolean wrapPageEnds; private final String leftText; private final String rightText; private final Bot bot; private final boolean allowTextInput; Paginator(EventWaiter waiter, Set<User> users, Set<Role> roles, long timeout, TimeUnit unit, BiFunction<Integer, Integer, Color> color, BiFunction<Integer, Integer, String> text, Consumer<Message> finalAction, int columns, int itemsPerPage, boolean showPageNumbers, boolean numberItems, List<EmbedBuilder> items, boolean waitOnSinglePage, int bulkSkipNumber, boolean wrapPageEnds, String leftText, String rightText, boolean allowTextInput, Bot bot) { super(waiter, users, roles, timeout, unit); this.bot = bot; this.color = color; this.text = text; this.columns = columns; this.itemsPerPage = itemsPerPage; this.showPageNumbers = showPageNumbers; this.numberItems = numberItems; this.embedBuilders = items; this.pages = (int) Math.ceil((double) this.embedBuilders.size() / (double) itemsPerPage); this.finalAction = finalAction; this.waitOnSinglePage = waitOnSinglePage; this.bulkSkipNumber = bulkSkipNumber; this.wrapPageEnds = wrapPageEnds; this.leftText = leftText; this.rightText = rightText; this.allowTextInput = allowTextInput; } public void display(MessageChannel channel) { this.paginate((MessageChannel) channel, 1); } public void display(Message message) { this.paginate((Message) message, 1); } public void paginate(MessageChannel channel, int pageNum) { if (pageNum < 1) { pageNum = 1; } else if (pageNum > this.pages) { pageNum = this.pages; } Message msg = this.renderPageLoading(pageNum); this.initialize(channel.sendMessage(msg), pageNum); } public void paginate(Message message, int pageNum) { if (pageNum < 1) { pageNum = 1; } else if (pageNum > this.pages) { pageNum = this.pages; } Message msg = this.renderPage(pageNum); this.initialize(message.editMessage(msg), pageNum); } private void initialize(RestAction<Message> action, int pageNum) { action.queue((m) -> { if (this.pages > 1) { if (this.bulkSkipNumber > 1) { m.addReaction(BIG_LEFT).queue(); } m.addReaction(LEFT).queue(); m.addReaction(STOP).queue(); if (this.bulkSkipNumber > 1) { m.addReaction(RIGHT).queue(); } m.addReaction(this.bulkSkipNumber > 1 ? BIG_RIGHT : RIGHT).queue(); m.addReaction(SUBSCRIBE).queue(); m.addReaction(UNSUBSCRIBE).queue(); m.addReaction(MENTION).queue(); m.addReaction(REMOVE_MENTION).queue(); m.addReaction(CHANGE_MENTION_LEVEL).queue(); m.addReaction(CHANGE_MSG_LEVEL).queue(); m.addReaction(DELETE).queue((v) -> { m.editMessage(renderPage(pageNum)).queue(); this.pagination(m, pageNum); }, (t) -> { m.editMessage(renderPage(pageNum)).queue(); this.pagination(m, pageNum); }); } else if (this.waitOnSinglePage) { m.addReaction(STOP).queue(); m.addReaction(SUBSCRIBE).queue(); m.addReaction(UNSUBSCRIBE).queue(); m.addReaction(MENTION).queue(); m.addReaction(REMOVE_MENTION).queue(); m.addReaction(CHANGE_MENTION_LEVEL).queue(); m.addReaction(CHANGE_MSG_LEVEL).queue(); m.addReaction(DELETE).queue((v) -> { m.editMessage(renderPage(pageNum)).queue(); this.paginationWithoutTextInput(m, pageNum); }, (t) -> { m.editMessage(renderPage(pageNum)).queue(); this.paginationWithoutTextInput(m, pageNum); }); } else { this.finalAction.accept(m); } }); } private void pagination(Message message, int pageNum) { if (!this.allowTextInput && (this.leftText == null || this.rightText == null)) { this.paginationWithoutTextInput(message, pageNum); } else { this.paginationWithTextInput(message, pageNum); } } private void paginationWithTextInput(Message message, int pageNum) { this.waiter.waitForEvent(GenericMessageEvent.class, (event) -> { if (event instanceof MessageReactionAddEvent) { return this.checkReaction((MessageReactionAddEvent) event, message.getIdLong()); } else { if (event instanceof MessageReceivedEvent) { MessageReceivedEvent mre = (MessageReceivedEvent) event; if (!mre.getChannel().equals(message.getChannel())) { return false; } String rawContent = mre.getMessage().getContentRaw().trim(); if (this.leftText != null && this.rightText != null && (rawContent.equalsIgnoreCase(this.leftText) || rawContent.equalsIgnoreCase(this.rightText))) { return this.isValidUser(mre.getAuthor(), mre.getGuild()); } if (this.allowTextInput) { try { int i = Integer.parseInt(rawContent); if (1 <= i && i <= this.pages && i != pageNum) { return this.isValidUser(mre.getAuthor(), mre.getGuild()); } } catch (NumberFormatException var7) { } } } return false; } }, (event) -> { if (event instanceof MessageReactionAddEvent) { this.handleMessageReactionAddAction((MessageReactionAddEvent) event, message, pageNum); } else { MessageReceivedEvent mre = (MessageReceivedEvent) event; String rawContent = mre.getMessage().getContentRaw().trim(); int targetPage; if (this.leftText == null || !rawContent.equalsIgnoreCase(this.leftText) || 1 >= pageNum && !this.wrapPageEnds) { if (this.rightText == null || !rawContent.equalsIgnoreCase(this.rightText) || pageNum >= this.pages && !this.wrapPageEnds) { targetPage = Integer.parseInt(rawContent); } else { targetPage = pageNum + 1 > this.pages && this.wrapPageEnds ? 1 : pageNum + 1; } } else { targetPage = pageNum - 1 < 1 && this.wrapPageEnds ? this.pages : pageNum - 1; } message.editMessage(this.renderPage(targetPage)).queue((m) -> { this.pagination(m, targetPage); }); mre.getMessage().delete().queue((v) -> { }, (t) -> { }); } }, this.timeout, this.unit, () -> { this.finalAction.accept(message); }); } private void paginationWithoutTextInput(Message message, int pageNum) { this.waiter.waitForEvent(MessageReactionAddEvent.class, (event) -> { return this.checkReaction(event, message.getIdLong()); }, (event) -> { this.handleMessageReactionAddAction(event, message, pageNum); }, this.timeout, this.unit, () -> { this.finalAction.accept(message); }); } private boolean checkReaction(MessageReactionAddEvent event, long messageId) { if (event.getMessageIdLong() != messageId) { return false; } else { String emoji = event.getReactionEmote().getName(); switch (emoji) { case BIG_RIGHT: case BIG_LEFT: return this.bulkSkipNumber > 1 && this.isValidUser(event.getUser(), event.getGuild()); case LEFT: case RIGHT: case STOP: case SUBSCRIBE: case UNSUBSCRIBE: case MENTION: case DELETE: case REMOVE_MENTION: case CHANGE_MENTION_LEVEL: case CHANGE_MSG_LEVEL: return this.isValidUser(event.getUser(), event.getGuild()); default: return false; } } } private void handleMessageReactionAddAction(MessageReactionAddEvent event, Message message, int pageNum) { int newPageNum = pageNum; int i; String url1 = Optional.ofNullable(embedBuilders.get(pageNum - 1).build()).map(MessageEmbed::getAuthor).map(MessageEmbed.AuthorInfo::getUrl).orElse(""); String[] args = ParseUtil.parseUrl(url1); String emoji = event.getReaction().getReactionEmote().getName(); switch (emoji) { case LEFT: if (pageNum == 1 && this.wrapPageEnds) { newPageNum = this.pages + 1; } if (newPageNum > 1) { --newPageNum; } break; case RIGHT: if (pageNum == this.pages && this.wrapPageEnds) { newPageNum = 0; } if (newPageNum < this.pages) { ++newPageNum; } break; case BIG_LEFT: if (pageNum > 1 || this.wrapPageEnds) { for (i = 1; (newPageNum > 1 || this.wrapPageEnds) && i < this.bulkSkipNumber; ++i) { if (newPageNum == 1 && this.wrapPageEnds) { newPageNum = this.pages + 1; } --newPageNum; } } break; case BIG_RIGHT: if (pageNum < this.pages || this.wrapPageEnds) { for (i = 1; (newPageNum < this.pages || this.wrapPageEnds) && i < this.bulkSkipNumber; ++i) { if (newPageNum == this.pages && this.wrapPageEnds) { newPageNum = 0; } ++newPageNum; } } break; case SUBSCRIBE: if (args.length == 2) { switch (bot.getObManager().subscribe(event.getChannel().getId(), args[0], args[1])) { case SUCCESSED: EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll(); embedBuilders.set(pageNum - 1, mb); break; case ALREADY_SUBSCRIBED: break; case INVALID_USER: event.getChannel().sendMessage("订阅的用户**" + args[0] + "@" + args[1] + "**不存在").queue(); case FAILED: event.getChannel().sendMessage("订阅**" + args[0] + "@" + args[1] + "**失败").queue(); break; default: event.getChannel().sendMessage("订阅**" + args[0] + "@" + args[1] + "**结果未知").queue(); } } break; case UNSUBSCRIBE: if (args.length == 2) switch (bot.getObManager().unsubscribe(event.getChannel().getId(), args[0], args[1])) { case SUCCESSED: EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll(); embedBuilders.set(pageNum - 1, mb); break; case ALREADY_UNSUBSCRIBED: break; case FAILED: event.getChannel().sendMessage("取消订阅**" + args[0] + "@" + args[1] + "**失败").queue(); break; default: event.getChannel().sendMessage("取消订阅**" + args[0] + "@" + args[1] + "**结果未知").queue(); } break; case DELETE: if (args.length == 2) switch (bot.getObManager().deleteObserver(event.getChannel().getId(), args[0], args[1])) { case SUCCESSED: embedBuilders.set(newPageNum - 1, new EmbedBuilder().setDescription("deleted").addBlankField(false).addBlankField(false)); break; case ALREADY_DELETED: break; case FAILED: event.getChannel().sendMessage("删除**" + args[0] + "@" + args[1] + "**失败").queue(); break; default: event.getChannel().sendMessage("删除**" + args[0] + "@" + args[1] + "**结果未知").queue(); } break; case MENTION: if (args.length == 2) switch (bot.getObManager().addMention(event.getChannel().getId(), args[0], args[1], event.getUser().getAsMention())) { case SUCCESSED: EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll(); embedBuilders.set(pageNum - 1, mb); break; case OBSERVER_NOT_FOUND: event.getChannel().sendMessage("添加提醒**" + args[0] + "@" + args[1] + "**没有找到直播间").queue(); break; case ALREADY_EXISTS_MENTIONS: break; default: event.getChannel().sendMessage("添加提醒**" + args[0] + "@" + args[1] + "**结果未知").queue(); } break; case REMOVE_MENTION: if (args.length == 2) switch (bot.getObManager().removeMention(event.getChannel().getId(), args[0], args[1], event.getUser().getAsMention())) { case SUCCESSED: EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll(); embedBuilders.set(pageNum - 1, mb); break; case OBSERVER_NOT_FOUND: event.getChannel().sendMessage("添加提醒**" + args[0] + "@" + args[1] + "**没有找到直播间").queue(); break; case ALREADY_REMOVED_MENTIONS: break; default: event.getChannel().sendMessage("添加提醒**" + args[0] + "@" + args[1] + "**结果未知").queue(); } break; case CHANGE_MENTION_LEVEL: if(args.length==2) switch (bot.getObManager().changeMentionLevel(event.getChannel().getId(), args[0], args[1])){ case SUCCESSED: EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll(); embedBuilders.set(pageNum - 1, mb); break; case OBSERVER_NOT_FOUND: event.getChannel().sendMessage("要设置@提醒等级的**" + args[0] + "@" + args[1] + "**直播间不存在").queue(); break; default: event.getChannel().sendMessage("设置提醒等级结果未知").queue(); break; } break; case CHANGE_MSG_LEVEL: if(args.length==2) switch (bot.getObManager().changeMessageLevel(event.getChannel().getId(), args[0], args[1])){ case SUCCESSED: EmbedBuilder mb = bot.getObManager().getObserver(event.getChannel().getId(), args[0], args[1]).get().getEmbedBuilderShowAll(); embedBuilders.set(pageNum - 1, mb); break; case OBSERVER_NOT_FOUND: event.getChannel().sendMessage("要设置订阅等级的**" + args[0] + "@" + args[1] + "**直播间不存在").queue(); break; default: event.getChannel().sendMessage("设置订阅等级结果未知").queue(); break; } break; case STOP: this.finalAction.accept(message); return; } try { event.getReaction().removeReaction(event.getUser()).queue(); } catch (PermissionException var8) { } int finalNewPageNum = newPageNum; message.editMessage(this.renderPage(newPageNum)).queue((m) -> { this.pagination(m, finalNewPageNum); }); } private Message renderPage(int pageNum) { MessageBuilder mbuilder = new MessageBuilder(); EmbedBuilder emb = embedBuilders.get(pageNum - 1); mbuilder.setEmbed(emb.build()); mbuilder.setContent("Page " + pageNum + "/" + this.pages); return mbuilder.build(); } private Message renderPageLoading(int pageNum) { MessageBuilder mbuilder = new MessageBuilder(); EmbedBuilder emb = embedBuilders.get(pageNum - 1); mbuilder.setEmbed(emb.build()); mbuilder.setContent("\uD83D\uDEABLoading..."); return mbuilder.build(); } public static class Builder extends com.jagrosh.jdautilities.menu.Menu.Builder<Paginator.Builder, Paginator> { private BiFunction<Integer, Integer, Color> color = (page, pages) -> { return null; }; private BiFunction<Integer, Integer, String> text = (page, pages) -> { return null; }; private Consumer<Message> finalAction = (m) -> { m.delete().queue(); }; private int columns = 1; private int itemsPerPage = 1; private boolean showPageNumbers = true; private boolean numberItems = false; private boolean waitOnSinglePage = false; private int bulkSkipNumber = 1; private boolean wrapPageEnds = false; private String textToLeft = null; private String textToRight = null; private boolean allowTextInput = false; private Bot bot; private final List<EmbedBuilder> embedBuilders = new ArrayList<>(); public Builder() { } public Paginator build() { Checks.check(this.waiter != null, "Must set an EventWaiter"); Checks.check(!this.embedBuilders.isEmpty(), "Must include at least one item to paginate"); return new Paginator(this.waiter, this.users, this.roles, this.timeout, this.unit, this.color, this.text, this.finalAction, this.columns, this.itemsPerPage, this.showPageNumbers, this.numberItems, this.embedBuilders, this.waitOnSinglePage, this.bulkSkipNumber, this.wrapPageEnds, this.textToLeft, this.textToRight, this.allowTextInput, this.bot); } public Paginator.Builder setColor(Color color) { this.color = (i0, i1) -> { return color; }; return this; } public Paginator.Builder setColor(BiFunction<Integer, Integer, Color> colorBiFunction) { this.color = colorBiFunction; return this; } public Paginator.Builder setText(String text) { this.text = (i0, i1) -> { return text; }; return this; } public Paginator.Builder setText(BiFunction<Integer, Integer, String> textBiFunction) { this.text = textBiFunction; return this; } public Paginator.Builder setBot(Bot bot) { this.bot = bot; return this; } public Paginator.Builder setFinalAction(Consumer<Message> finalAction) { this.finalAction = finalAction; return this; } public Paginator.Builder setColumns(int columns) { if (columns >= 1 && columns <= 3) { this.columns = columns; return this; } else { throw new IllegalArgumentException("Only 1, 2, or 3 columns are supported"); } } public Paginator.Builder setItemsPerPage(int num) { throw new UnsupportedOperationException("只能显示一页"); } public Paginator.Builder useNumberedItems(boolean number) { this.numberItems = number; return this; } public Paginator.Builder waitOnSinglePage(boolean wait) { this.waitOnSinglePage = wait; return this; } public Paginator.Builder clearItems() { this.embedBuilders.clear(); return this; } public Paginator.Builder addItems(List<EmbedBuilder> items) { this.embedBuilders.addAll(items); return this; } public Paginator.Builder setItems(List<EmbedBuilder> items) { this.embedBuilders.clear(); this.embedBuilders.addAll(items); return this; } public Paginator.Builder setBulkSkipNumber(int bulkSkipNumber) { this.bulkSkipNumber = Math.max(bulkSkipNumber, 1); return this; } public Paginator.Builder wrapPageEnds(boolean wrapPageEnds) { this.wrapPageEnds = wrapPageEnds; return this; } public Paginator.Builder allowTextInput(boolean allowTextInput) { this.allowTextInput = allowTextInput; return this; } public Paginator.Builder setLeftRightText(String left, String right) { if (left != null && right != null) { this.textToLeft = left; this.textToRight = right; } else { this.textToLeft = null; this.textToRight = null; } return this; } } }
[ "sola97@qq.com" ]
sola97@qq.com
8bd4f0cdd0407e341f0ab192e3e9f13d902cb686
0dc7b5884df384709a2704a8bd7995058f039a4b
/tesuto-drools-services/tesuto-drools-common/src/main/java/org/ccctc/common/droolscommon/model/EngineDTO.java
64963fb677ae73400d90ab128764c56f43d66e3d
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "EPL-1.0" ]
permissive
apereo-tesuto/tesuto
b1672fc2ebbd4b5d4647ee15e3e4285c8e3dc0be
90ed26311b1baa15cd90d67bb55e7d4c613bdc53
refs/heads/master
2021-10-08T01:02:49.098929
2021-09-24T21:22:52
2021-09-24T21:22:52
218,090,150
4
3
Apache-2.0
2021-09-24T21:22:53
2019-10-28T16:08:04
null
UTF-8
Java
false
false
4,554
java
/******************************************************************************* * Copyright © 2019 by California Community Colleges Chancellor's Office * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ package org.ccctc.common.droolscommon.model; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.commons.lang3.StringUtils; import com.fasterxml.jackson.annotation.JsonFormat; public class EngineDTO { private String artifactId; private Set<String> categories; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm a z") private Date created; private String dataSource; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm a z") private Date edited; private Set<String> events; private String groupId; private String name; private String status; private String version; public void adjustValuesForStorage() { name = StringUtils.isBlank(name) ? null : name; dataSource = StringUtils.isBlank(dataSource) ? null : dataSource; groupId = StringUtils.isBlank(groupId) ? null : groupId; artifactId = StringUtils.isBlank(artifactId) ? null : artifactId; version = StringUtils.isBlank(version) ? null : version; status = StringUtils.isBlank(status) ? null : status; } public void adjustValuesForUI() { name = name == null ? "" : name; dataSource = dataSource == null ? "" : dataSource; groupId = groupId == null ? "" : groupId; artifactId = artifactId == null ? "" : artifactId; version = version == null ? "" : version; status = status == null ? "" : status; categories = categories == null ?new HashSet<String>() : categories; events = events == null ?new HashSet<String>() : events; } public String getArtifactId() { return artifactId; } public Set<String> getCategories() { return categories; } public Date getCreated() { return this.created; } public String getDataSource() { return dataSource; } public Date getEdited() { return this.edited; } public Set<String> getEvents() { return events; } public String getGroupId() { return groupId; } public String getName() { return name; } public String getStatus() { return status; } public String getVersion() { return version; } public EngineDTO setArtifactId(String artifactId) { this.artifactId = artifactId; return this; } public void setCategories(Set<String> categories) { this.categories = categories; } public void setCreated(Date created) { this.created = created; } public EngineDTO setDataSource(String dataSource) { this.dataSource = dataSource; return this; } public void setEdited(Date edited) { this.edited = edited; } public void setEvents(Set<String> events) { this.events = events; } public EngineDTO setGroupId(String groupId) { this.groupId = groupId; return this; } public EngineDTO setName(String name) { this.name = name; return this; } public void setStatus(String status) { this.status = status; } public EngineDTO setVersion(String version) { this.version = version; return this; } public String toString() { StringBuffer buf = new StringBuffer(); buf.append("name:[" + name + "]") .append(", dataSource:[" + dataSource + "]") .append(", groupId:[" + groupId + "]") .append(", artifactId:[" + artifactId + "]") .append(", version:[" + version + "]") .append(", status:[" + status + "]"); return buf.toString(); } }
[ "jstanley@unicon.net" ]
jstanley@unicon.net
0035ff673ce7c3015d12fa834e41d141e05662c7
34481cb8ebcd076eff9dfc7b51c5d9b58275cef4
/src/main/java/org/bian/dto/BQProductionExchangeInputModel.java
c3ce8895be29f85e7a242dd27f0d1962174fdf4f
[ "Apache-2.0" ]
permissive
bianapis/sd-product-deployment-v2
9aed0dd5e630b5d86130dc71d092e4c64ca67c24
a63b36a5ac11bf5b1be6ba2e5c5cae9c58a79e14
refs/heads/master
2020-07-22T20:04:05.814302
2019-09-12T10:46:59
2019-09-12T10:46:59
207,312,562
0
0
null
null
null
null
UTF-8
Java
false
false
3,106
java
package org.bian.dto; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.bian.dto.CRProductOrServiceDeploymentProjectExchangeInputModelProductOrServiceDeploymentProjectExchangeActionRequest; import javax.validation.Valid; /** * BQProductionExchangeInputModel */ public class BQProductionExchangeInputModel { private String productOrServiceDeploymentProjectInstanceReference = null; private String productionInstanceReference = null; private Object productionExchangeActionTaskRecord = null; private CRProductOrServiceDeploymentProjectExchangeInputModelProductOrServiceDeploymentProjectExchangeActionRequest productionExchangeActionRequest = null; /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to the parent Product Or Service Deployment Project instance * @return productOrServiceDeploymentProjectInstanceReference **/ public String getProductOrServiceDeploymentProjectInstanceReference() { return productOrServiceDeploymentProjectInstanceReference; } public void setProductOrServiceDeploymentProjectInstanceReference(String productOrServiceDeploymentProjectInstanceReference) { this.productOrServiceDeploymentProjectInstanceReference = productOrServiceDeploymentProjectInstanceReference; } /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to the Production instance * @return productionInstanceReference **/ public String getProductionInstanceReference() { return productionInstanceReference; } public void setProductionInstanceReference(String productionInstanceReference) { this.productionInstanceReference = productionInstanceReference; } /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The exchange service call consolidated processing record * @return productionExchangeActionTaskRecord **/ public Object getProductionExchangeActionTaskRecord() { return productionExchangeActionTaskRecord; } public void setProductionExchangeActionTaskRecord(Object productionExchangeActionTaskRecord) { this.productionExchangeActionTaskRecord = productionExchangeActionTaskRecord; } /** * Get productionExchangeActionRequest * @return productionExchangeActionRequest **/ public CRProductOrServiceDeploymentProjectExchangeInputModelProductOrServiceDeploymentProjectExchangeActionRequest getProductionExchangeActionRequest() { return productionExchangeActionRequest; } public void setProductionExchangeActionRequest(CRProductOrServiceDeploymentProjectExchangeInputModelProductOrServiceDeploymentProjectExchangeActionRequest productionExchangeActionRequest) { this.productionExchangeActionRequest = productionExchangeActionRequest; } }
[ "team1@bian.org" ]
team1@bian.org
e1a9c0a572cae936f897d9d33d135db6a9056f6c
edc6c677d5256fe1d4fb2b4617269829f8b5774c
/Stylrite/src/main/java/com/dao/GRNDao.java
b0021ae981732400637081f8ed2a272c8da1061a
[]
no_license
janhaveen/st1
12192ac7b149b197dbb53c761849d8d2ad6b0097
3606c56505de7ba5ecd6a4268370ce3ea4d6f294
refs/heads/master
2022-12-28T04:15:02.868127
2019-09-14T14:09:44
2019-09-14T14:09:44
208,449,442
0
0
null
2022-12-16T08:16:01
2019-09-14T14:08:52
JavaScript
UTF-8
Java
false
false
481
java
package com.dao; import java.util.List; import com.pojo.CreateBarCode; import com.pojo.GRN; import com.pojo.Order; import com.pojo.Product; import com.pojo.GRNItem; public interface GRNDao { public boolean addNewProduct(Product product); public boolean addNewGRNProduct(GRN grn); public boolean addNewGRNItem(GRNItem grnItem); public boolean addNewBarcode(CreateBarCode cBarCode); public List getAllGRNList(); public List getProductBasedBarcodeList(String grnId); }
[ "janhavee_narkar@effexway.com" ]
janhavee_narkar@effexway.com
d454fd5724815d6b51522c0ea6160acf61aa20c4
0ad97ad8013d56b8c8d249e3f9f45ea5338f5a65
/src/test/java/com/twitty/TwittyServerApplicationTests.java
03a2f4ba02135aa42cd41ff850b86dce98bf661e
[]
no_license
jiaguofang/twitty-server
8e5325f398c02b0f9530400d4f1bf2ff8b849cd6
9b915079e583d924f2f0306be12a7c79353fa8b5
refs/heads/master
2021-01-24T19:10:32.917671
2016-11-11T21:01:27
2016-11-11T21:01:27
73,433,837
0
0
null
null
null
null
UTF-8
Java
false
false
333
java
package com.twitty; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class TwittyServerApplicationTests { @Test public void contextLoads() { } }
[ "jiaguo.fang@capitalone.com" ]
jiaguo.fang@capitalone.com
a3f19e1c9ef331445e469f14bd9cb91548fd8c5b
9ffea92d95afee2f6e6fb21afaa8dd2aba6348d1
/src/main/java/org/futuredev/workbench/math/RelevantSearch.java
a22235aaee6e514cbbec217ccaeee9805e86cee6
[]
no_license
ImDeJay/Workbench
81ba74fc6943978f6160572947918f2eb2edb0c4
e28ba88e8284e811de61221e219d5b9229238c5d
refs/heads/master
2021-01-20T16:35:09.670772
2014-01-14T00:35:47
2014-01-14T00:35:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,462
java
package org.futuredev.workbench.math; import java.util.Arrays; import java.util.List; /** * A very basic relevancy booster for the QWERTY keyboard. * * For example, "block-craft" and "block-shift" * both have a Levenshtein distance of 3 from "block-swfrt", * but the user probably wants "block-shift", not "block-craft". * * @author afistofirony */ public class RelevantSearch { public RelevantSearch (String input, String... possibilities) { this (input, Arrays.asList(possibilities)); } public RelevantSearch (String input, List<String> possibilities) { } private int relevancy (String original, String a) { int dist = 0; Levenshtein lev = new Levenshtein(original.toLowerCase(), a.toLowerCase()); if (lev.getDistance() == 0) return 0; for (int i = 0; i < original.length() && i < a.length(); ++i) { Alphabet at = Alphabet.match(a.charAt(i)); Alphabet or = Alphabet.match(original.charAt(i)); if (at != or) dist += or.getDistance(at); } return 0; } enum Alphabet { A ('a', 'A', 1, 2), B ('b', 'B', 5, 3), C ('c', 'C', 3, 3), D ('d', 'D', 3, 2), E ('e', 'E', 3, 1), F ('f', 'F', 4, 2), G ('g', 'G', 5, 2), H ('h', 'H', 6, 2), I ('i', 'I', 8, 1), J ('j', 'J', 7, 2), K ('k', 'K', 8, 2), L ('l', 'L', 9, 2), M ('m', 'M', 7, 3), N ('n', 'N', 6, 3), O ('o', 'O', 9, 1), P ('p', 'P', 10, 1), Q ('q', 'Q', 1, 1), R ('r', 'R', 4, 1), S ('s', 'S', 2, 2), T ('t', 'T', 5, 1), U ('u', 'U', 7, 1), V ('v', 'V', 4, 3), W ('w', 'W', 2, 1), X ('x', 'X', 2, 3), Y ('y', 'Y', 6, 1), Z ('z', 'Z', 1, 3); final char lowercase, uppercase; final int x, y; Alphabet (char lc, char uc, int x, int y) { this.lowercase = lc; this.uppercase = uc; this.x = x; this.y = y; } public static Alphabet match (char value) { for (Alphabet a : Alphabet.values()) if (a.lowercase == value || a.uppercase == value) return a; return null; } public double getDistance (Alphabet other) { return Math.abs(Math.sqrt(x + y) - Math.sqrt(other.x - other.y)); } public double getDistance (char other) { return getDistance(match(other)); } } }
[ "afistofirony@gmail.com" ]
afistofirony@gmail.com
21dbe6647a970afad1b06929d747ba0ffca84c6d
d34361986f820a1316da9d0443643d1cb7996c52
/SGUWEB/src/ENTIDAD/cargoC.java
8b76ab0e3f4403aa0e040e891718a5aaeb0e1d1b
[]
no_license
michellOlano/SGUWEB
40cb65bc6074845bb94c04b8634ef9b37eb53fb2
fd0343fa30ea88452acddd9ff0a8d9fd38510a56
refs/heads/master
2021-05-15T17:01:07.120656
2017-10-19T15:34:19
2017-10-19T15:34:19
107,563,857
0
0
null
null
null
null
UTF-8
Java
false
false
1,359
java
package ENTIDAD; import java.io.Serializable; public class cargoC implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private int cargo; private String descripcion; private String abreviatura; private int estadoRegistro; public cargoC() { // TODO Auto-generated constructor stub } public cargoC( int cargo, String descripcion, String abreviatura, int estadoRegistro) { this.cargo=cargo; this.descripcion=descripcion; this.abreviatura= abreviatura; this.estadoRegistro=estadoRegistro; } public int getCargo() { return cargo; } public void setCargo(int cargo) { this.cargo = cargo; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public String getAbreviatura() { return abreviatura; } public void setAbreviatura(String abreviatura) { this.abreviatura = abreviatura; } public int getEstadoRegistro() { return estadoRegistro; } public void setEstadoRegistro(int estadoRegistro) { this.estadoRegistro = estadoRegistro; } }
[ "michell@michell-PC" ]
michell@michell-PC
7232337c80026cfd2e1414dac881cd0f77eb25e1
fb043628c7244036a16fdd444860ec4bba56b42d
/app/src/main/java/com/cyanbirds/momo/entity/ApkInfo.java
c5399f1c88be58ecf95f98ad8c1e865e7de5d4c0
[]
no_license
wybilold1999/MOProject
0827d50bf3f8a0bf0b8b608a115c4ffae71f0cc7
cad2ee4d0c773eb239c608a578d64f27b6832223
refs/heads/master
2021-01-21T10:19:00.589451
2017-09-28T07:43:12
2017-09-28T07:43:12
91,684,524
0
0
null
null
null
null
UTF-8
Java
false
false
449
java
package com.cyanbirds.momo.entity; import java.io.Serializable; /** * 作者:wangyb * 时间:2016/9/27 15:01 * 描述: */ public class ApkInfo implements Serializable { /**apk名字**/ public String apkName; /**apk大小**/ public String apkSize; /**apk价格**/ public String apkPrice; /**apk介绍**/ public String apkIntroduce; /**apk图片地址**/ public String apkImgUrl; /**apk下载地址**/ public String apkUrl; }
[ "wangyb@ecqun.com" ]
wangyb@ecqun.com
4b26ba45eabe4a823457dca7eb76091e3c27c3a8
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/20/20_a7d9c7c39a69c160d336e5377e969ed8b379474c/DetectorJDialog/20_a7d9c7c39a69c160d336e5377e969ed8b379474c_DetectorJDialog_s.java
da503d455fb3ac072cad7812242d6659366e24a2
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,140
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * DetectorJDialog.java * * Created on Feb 14, 2011, 9:48:28 AM */ package org.micromanager.conf; import java.lang.reflect.InvocationTargetException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.SwingUtilities; /** * * @author karlhoover */ public class DetectorJDialog extends javax.swing.JDialog { public boolean CancelRequest(){ return cancelRequest_; } public void ProgressText(final String t){ detectionTextPane_.setText(t); } public String ProgressText(){ return detectionTextPane_.getText(); } private boolean cancelRequest_; /** Creates new form DetectorJDialog */ public DetectorJDialog(java.awt.Dialog parent, boolean modal) { super(parent, modal); initComponents(); cancelRequest_ = false; } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { cancelButton_ = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); detectionTextPane_ = new javax.swing.JTextPane(); addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent evt) { formComponentShown(evt); } }); cancelButton_.setText("Cancel"); cancelButton_.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButton_ActionPerformed(evt); } }); jScrollPane2.setViewportView(detectionTextPane_); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(cancelButton_) .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 361, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 156, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(17, 17, 17) .add(cancelButton_) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void cancelButton_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButton_ActionPerformed System.out.print("cancelButton_ActionPerformed"); cancelRequest_ = true; }//GEN-LAST:event_cancelButton_ActionPerformed private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown cancelRequest_ = false; }//GEN-LAST:event_formComponentShown // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton cancelButton_; private javax.swing.JTextPane detectionTextPane_; private javax.swing.JScrollPane jScrollPane2; // End of variables declaration//GEN-END:variables }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
71c05115b5076b9be0b3411e07c1496ee17c068f
39813f3f72913172d1d68f9b4b4009368f027294
/java8/src/main/java/dev/o1c/modern/chacha20/ChaCha20.java
2d2a582d27da7df545feee2bf69b4e0b0805bdae
[ "ISC" ]
permissive
rucko24/o1c
88282ebcfa01b0472e92017975a9701b188515a3
b180abdb23906c5666b8a27c4e9b4cbe5f0cecae
refs/heads/main
2023-02-10T01:29:34.487308
2021-01-04T05:06:52
2021-01-04T05:06:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,158
java
/* * ISC License * * Copyright (c) 2021, Matt Sicker * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * SPDX-License-Identifier: ISC */ package dev.o1c.modern.chacha20; class ChaCha20 { /** * Performs an in-place ChaCha20 permutation on the provided state array. * * @param state length 16 array of internal state decoded from a little endian byte array */ static void permute(int[] state) { for (int i = 0; i < 10; i++) { columnRound(state); diagonalRound(state); } } private static void columnRound(int[] state) { quarterRound(state, 0, 4, 8, 12); quarterRound(state, 1, 5, 9, 13); quarterRound(state, 2, 6, 10, 14); quarterRound(state, 3, 7, 11, 15); } private static void diagonalRound(int[] state) { quarterRound(state, 0, 5, 10, 15); quarterRound(state, 1, 6, 11, 12); quarterRound(state, 2, 7, 8, 13); quarterRound(state, 3, 4, 9, 14); } private static void quarterRound(int[] state, int a, int b, int c, int d) { state[a] += state[b]; state[d] = Integer.rotateLeft(state[d] ^ state[a], 16); state[c] += state[d]; state[b] = Integer.rotateLeft(state[b] ^ state[c], 12); state[a] += state[b]; state[d] = Integer.rotateLeft(state[d] ^ state[a], 8); state[c] += state[d]; state[b] = Integer.rotateLeft(state[b] ^ state[c], 7); } }
[ "mattsicker@apache.org" ]
mattsicker@apache.org
66b14661ae6797a53f464524fdd794be60267fc2
4276b9d050ea4640f93fcb19b4a8d9a8951a195d
/src/main/java/course/api/topics/Topic.java
bce48955cbacc151a724614f2aafa184b1c8b8c3
[]
no_license
Abhishek55041/course.api
9af69888eeac1721c2758ca69b233ef6d45271db
6ac9474247c1198c15989d836f44f2805848a828
refs/heads/master
2021-04-06T06:24:22.757339
2018-03-15T01:14:33
2018-03-15T01:14:33
125,293,901
0
0
null
null
null
null
UTF-8
Java
false
false
647
java
package course.api.topics; public class Topic { private String id; private String name; private String description; public Topic() { } public Topic(String id, String name, String description) { super(); this.id = id; this.name = name; this.description = description; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
[ "abhishek.e.agarwal@capgemini.com" ]
abhishek.e.agarwal@capgemini.com
cb7b4f8f98c21b9697dc75c9d7ad9beef5824a8b
5ddb95f31c66aee1d4d6db8af28e4cd016e845c9
/security-browser/src/main/java/com/asule/security/BrowserSecurityConfig.java
400264f0bb483f51b3c7fe19ac2268d6a97e0051
[]
no_license
ausle/mysecurity
b5868ec2bed0da66e6dfb650a01849873562ad57
2c31496f3d967147500687b917c2def13ee8a917
refs/heads/master
2020-03-28T02:51:40.257177
2018-09-06T02:09:31
2018-09-06T02:09:31
147,601,497
0
0
null
null
null
null
UTF-8
Java
false
false
4,064
java
package com.asule.security; import com.asule.security.authenticate.mobile.SmsCodeAuthenticationSecurityConfig; import com.asule.security.handler.AsuleAuthenticationFailureHandler; import com.asule.security.handler.AsuleAuthenticationSuccessHandler; import com.asule.security.properties.BaseProperties; import com.asule.security.validate.filter.ValidateCodeFilter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl; import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; import org.springframework.social.security.SpringSocialConfigurer; import javax.sql.DataSource; @Configuration public class BrowserSecurityConfig extends WebSecurityConfigurerAdapter{ @Autowired private UserDetailsService userDetailsService; @Autowired private BaseProperties baseProperties; @Autowired private AsuleAuthenticationSuccessHandler successHandler; @Autowired private AsuleAuthenticationFailureHandler failureHandler; @Autowired private ValidateCodeFilter validateCodeFilter; @Autowired private DataSource dataSource; @Autowired private SmsCodeAuthenticationSecurityConfig smsCodeAuthenticationSecurityConfig; @Autowired private SpringSocialConfigurer springSocialConfigurer; // 配置tokenRepository @Bean public PersistentTokenRepository persistentTokenRepository() { JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl(); tokenRepository.setDataSource(dataSource); //会自动创建一张表来记录 token和username return tokenRepository; } @Override protected void configure(HttpSecurity http) throws Exception { //loginPage指定登录页面,loginProcessingUrl指定登录提交的表单要经过UsernamePasswordAuthenticationFilter过滤器处理 http.formLogin().loginPage("/authentication/require").loginProcessingUrl("/authentication/form") //验证通过和验证失败处理的handler .successHandler(successHandler).failureHandler(failureHandler) .and() //配置记住我功能。 .rememberMe() .tokenRepository(persistentTokenRepository())//配置tokenRepository .tokenValiditySeconds(baseProperties.getBrowser().getRememberMeSeconds())//记住我的时间 .userDetailsService(userDetailsService)//根据用户名获取用户信息需要的userDetail实现 .and() .addFilterBefore(validateCodeFilter,UsernamePasswordAuthenticationFilter.class) .userDetailsService(userDetailsService) .authorizeRequests() .antMatchers( SecurityConstants.DEFAULT_LOGIN_PROCESSING_URL_FORM, SecurityConstants.DEFAULT_LOGIN_PROCESSING_URL_MOBILE, SecurityConstants.DEFAULT_VALIDATE_CODE_URL_PREFIX+"/*", SecurityConstants.DEFAULT_LOGIN_URL, baseProperties.getBrowser().getLoginPage()).permitAll()//指定页面不需要认证 .anyRequest().authenticated()//任何请求都需要认证 .and() .csrf().disable()//csrf失效 .apply(smsCodeAuthenticationSecurityConfig)//往后添加一个smsCode配置 .and() .apply(springSocialConfigurer);//开启SocialAuthenticationFilter过滤器 } }
[ "distinctofwang@gmail.com" ]
distinctofwang@gmail.com
c1561c61ecfa548572e19e32ef16eec95625e725
df6d22421164340a3c29bb5bce015c9cefbda4f3
/src/hyFlow/edu/vt/rt/hyflow/benchmark/tm/bst2/$HY$_Proxy_Node.java
5211430d0e7be1346f5920de680419146b6c3e85
[]
no_license
junwhan/open_nesting
07926e351634eadc4115c138728df470c096aee9
65df45f7d878b6fbb83e2b8437616f83a45452a4
refs/heads/master
2020-04-21T00:59:02.286663
2014-01-02T02:47:32
2014-01-02T02:47:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,343
java
package edu.vt.rt.hyflow.benchmark.tm.bst2; import java.rmi.RMISecurityManager; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import aleph.comm.Address; import aleph.dir.DirectoryManager; import edu.vt.rt.hyflow.HyFlow; import edu.vt.rt.hyflow.core.dir.control.ControlFlowDirectory; import edu.vt.rt.hyflow.core.tm.control.ControlContext; import edu.vt.rt.hyflow.util.io.Logger; import edu.vt.rt.hyflow.util.network.Network; public class $HY$_Proxy_Node implements $HY$_INode{ private static final long serialVersionUID = 1L; DirectoryManager locator; public $HY$_Proxy_Node() throws RemoteException{ Logger.debug("Creating PROXY"); ((ControlFlowDirectory)HyFlow.getLocator()).addProxy(this); // Install Secrutiy Manager if (System.getSecurityManager() == null) System.setSecurityManager ( new RMISecurityManager() ); // Create objects registery int port = Network.getInstance().getPort()+1000; Registry registry = null; try { Logger.debug("Reg: " + port); registry = LocateRegistry.createRegistry(port); } catch (RemoteException e) { e.printStackTrace(); } // Remove old registered object try { UnicastRemoteObject.unexportObject(this, true); } catch (Exception e) { Logger.error("RMI unexporting"); } $HY$_INode stub = ($HY$_INode) UnicastRemoteObject.exportObject(this, 0); // Bind the remote object's stub in the registry registry.rebind(Node.class.getName(), stub); Logger.debug("RMI stub inited"); locator = HyFlow.getLocator(); } @Override public void setRightChild(Object id, ControlContext context, String rightId){ Address caller = ((ControlContext)context).getLastExecuter(); Network.linkDelay(true, caller); ControlContext.getNeighbors(context.getContextId()).add(caller); ((Node)locator.open(context, id, "w")).setRightChild(rightId, context); } @Override public String getRightChild(Object id, ControlContext context){ Address caller = ((ControlContext)context).getLastExecuter(); Network.linkDelay(true, caller); ControlContext.getNeighbors(context.getContextId()).add(caller); return ((Node)locator.open(context, id, "r")).getRightChild(context); } @Override public void setLeftChild(Object id, ControlContext context, String leftId){ Address caller = ((ControlContext)context).getLastExecuter(); Network.linkDelay(true, caller); ControlContext.getNeighbors(context.getContextId()).add(caller); ((Node)locator.open(context, id, "w")).setLeftChild(leftId, context); } @Override public String getLeftChild(Object id, ControlContext context){ Address caller = ((ControlContext)context).getLastExecuter(); Network.linkDelay(true, caller); ControlContext.getNeighbors(context.getContextId()).add(caller); return ((Node)locator.open(context, id, "r")).getLeftChild(context); } @Override public Integer getValue(Object id, ControlContext context){ Address caller = ((ControlContext)context).getLastExecuter(); Network.linkDelay(true, caller); ControlContext.getNeighbors(context.getContextId()).add(caller); return ((Node)locator.open(context, id, "r")).getValue(context); } }
[ "jkim@gojkim" ]
jkim@gojkim
1551d064c6a85ed43fc225a0bafa50b5359f2d0c
ae6b96cc42b1af55a44156a220feaa7698b58fea
/RestDocCore/src/main/java/cn/willingxyz/restdoc/core/parse/impl/JavaTypeInspector.java
ea3f12041ac8ffe3d6d0b15b42f67eee6027fe40
[]
no_license
zt1820057934/RestDoc
836c310c78458b54500d2a4d899a828ed7fc6634
7791fb816177e50c16756713041c5886e9dd86a6
refs/heads/master
2022-02-18T04:17:18.849814
2019-09-20T01:03:41
2019-09-20T01:14:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,304
java
package cn.willingxyz.restdoc.core.parse.impl; import cn.willingxyz.restdoc.core.parse.ITypeInspector; import lombok.var; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.net.URI; import java.net.URL; import java.time.*; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; /** * 判断java基本库中的类型。 * 该类应该放在最后一个做判断 */ public class JavaTypeInspector implements ITypeInspector { private List<Class> _simpleClass = new ArrayList<Class>(){{ add(Boolean.class); add(Byte.class); add(Short.class); add(Integer.class); add(Long.class); add(Double.class); add(Float.class); add(Character.class); add(CharSequence.class); add(Enum.class); add(Number.class); add(URI.class); add(URL.class); add(Locale.class); // 日期处理 add(Date.class); add(LocalDateTime.class); add(LocalDate.class); add(LocalTime.class); add(Year.class); add(YearMonth.class); add(MonthDay.class); add(Instant.class); }}; @Override public boolean isSimpleType(Type type) { if (type instanceof Class) { var clazz = (Class)type; for (var simpleClass : _simpleClass) { if (simpleClass.isAssignableFrom(clazz)) return true; } if (clazz.isPrimitive()) { return true; } } else if (type instanceof ParameterizedType) { return isSimpleType(((ParameterizedType) type).getRawType()); } return false; } @Override public boolean isCollection(Type type) { if (type instanceof Class) { var clazz = (Class)type; if (clazz.isArray()) { return true; } if (List.class.isAssignableFrom(clazz)) { return true; } } else if (type instanceof ParameterizedType) { return isCollection(((ParameterizedType) type).getRawType()); } return false; } @Override public Type getCollectionComponentType(Type type) { if (!isCollection(type)) throw new RuntimeException(type.getTypeName() + " is not collection"); if (type instanceof Class) { var clazz = (Class)type; if (clazz.isArray()) { return clazz.getComponentType(); } if (List.class.isAssignableFrom(clazz)) { } } else if (type instanceof ParameterizedType) { var parameterizedType = (ParameterizedType)type; if (List.class.isAssignableFrom((Class<?>) parameterizedType.getRawType())) { return parameterizedType.getActualTypeArguments()[0]; } } return Object.class; } @Override public boolean isSupport(Type type) { return true; } }
[ "sxswilling@163.com" ]
sxswilling@163.com
bab4f8ac6aa19030d23210b44d344a906dc43b76
91d6e8e7200b9973fc4468f648ff43324529ca61
/src/saxparser/SaxParserController.java
e577db18c978aab2780e454c31e610ef0f99cda6
[]
no_license
awwilhelm/javasax
59674f5ab42bc617b3971fc6bd63f16e8b01ec8a
59d8b7ff32c315c2f61002753886d7544f8daad0
refs/heads/master
2021-01-25T14:09:44.173875
2018-03-03T03:39:19
2018-03-03T03:39:19
123,655,895
0
0
null
null
null
null
UTF-8
Java
false
false
5,287
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 saxparser; import java.io.File; import java.io.PrintWriter; import java.io.StringWriter; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Alert; import javafx.scene.control.Label; import javafx.scene.control.MenuItem; import javafx.scene.control.TextArea; import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; import javafx.scene.layout.GridPane; import javafx.scene.layout.Priority; import javafx.stage.FileChooser; import javafx.stage.Stage; /** * * @author LeBorg */ public class SaxParserController implements Initializable { @FXML private TextArea textArea; @Override public void initialize(URL url, ResourceBundle rb) { // TODO } void printNodes(Nodes nodes) { for(int i = 0; i < nodes.getNodes().size(); i++) { //System.out.println(nodes.getNodes().get(i).getContent() + " " + nodes.getNodes().get(i).getIndentationCount()); System.out.println(tabs(nodes.getNodes().get(i).getIndentationCount()) + nodes.getNodes().get(i).getContent()); } } String tabs(int count) { String start=""; for(int i=0; i< count; i++) { start += "\t"; } return start; } @FXML private void handleOpen(ActionEvent event) { FileChooser fileChooser = new FileChooser(); File file = fileChooser.showOpenDialog(textArea.getScene().getWindow()); if (file != null) { try { Nodes nodes = NodeBuilder.load(file); for(int i = 0; i < nodes.getNodes().size(); i++) { //System.out.println(nodes.getNodes().get(i).getContent() + " " + nodes.getNodes().get(i).getIndentationCount()); textArea.appendText(tabs(nodes.getNodes().get(i).getIndentationCount()) + nodes.getNodes().get(i).getContent() + "\n"); } // Course course = NodeBuilder.load(file); // ArrayList<Student> students = course.getStudents(); // for (Student student : students) { // textArea.appendText(Integer.toString(student.getId()) + "\n"); // textArea.appendText(student.getPawprint() + "\n"); // textArea.appendText(student.getFirstName() + "\n"); // textArea.appendText(student.getLastName() + "\n"); // textArea.appendText(Double.toString(student.getGrade()) + "\n"); // textArea.appendText("-------------------------\n"); // } } catch (Exception ex) { displayExceptionAlert("Exception parsing XML file.", ex); } } } @FXML private void handleAbout(ActionEvent event) { displayAboutAlert(); } private void displayAboutAlert() { Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle("About"); alert.setHeaderText("XML DOM Parser Example"); alert.setContentText("This application was developed by Dale Musser for CS4330 at the University of Missouri."); TextArea textArea = new TextArea("This example illustrates how to parse XML using the DOM."); textArea.setEditable(false); textArea.setWrapText(true); textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMaxHeight(Double.MAX_VALUE); GridPane expContent = new GridPane(); expContent.setMaxWidth(Double.MAX_VALUE); expContent.add(textArea, 0, 0); alert.getDialogPane().setExpandableContent(expContent); alert.showAndWait(); } private void displayExceptionAlert(String message, Exception ex) { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("Exception Dialog"); alert.setHeaderText("Exception!"); alert.setContentText(message); // Create expandable Exception. StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); String exceptionText = sw.toString(); Label label = new Label("The exception stacktrace was:"); TextArea textArea = new TextArea(exceptionText); textArea.setEditable(false); textArea.setWrapText(true); textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); GridPane expContent = new GridPane(); expContent.setMaxWidth(Double.MAX_VALUE); expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); // Set expandable Exception into the dialog pane. alert.getDialogPane().setExpandableContent(expContent); alert.showAndWait(); } }
[ "awwilhelm2014@gmail.com" ]
awwilhelm2014@gmail.com
9959a81042bf111dd24c85626a2f5de7ae77b6aa
02e02d55532d6295b0110e3acdfc31b933d1099d
/ep-bva/src/main/java/training360/epbva/EpBvaApplication.java
6fe2c0103b8ee48e88d0deb57232b18a92a9d090
[]
no_license
Training360/almira
5c73a3adb06552dce6623a37cbd1c84c9d36239c
b3a52ac5b7b2023835b3b77fa57ab3c0a7548a7f
refs/heads/master
2022-12-03T17:42:46.860169
2020-10-08T08:48:44
2020-10-08T08:48:44
110,721,995
1
0
null
2022-11-16T08:56:04
2017-11-14T17:23:32
Rich Text Format
UTF-8
Java
false
false
2,928
java
package training360.epbva; import org.apache.cxf.Bus; import org.apache.cxf.jaxws.EndpointImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import training360.epbva.api.credit.CreditAssessmentEndpoint; import training360.epbva.api.triangle.TriangleEndpoint; import javax.xml.ws.Endpoint; import java.util.ArrayList; import java.util.List; @SpringBootApplication @RestController @RequestMapping("/api/") public class EpBvaApplication { public static void main(String[] args) { SpringApplication.run(EpBvaApplication.class, args); } @Autowired private Bus bus; @RequestMapping("/triangle") public TriangleAnswer triangle(@RequestBody Triangle triangle) { TriangleDecision triangleDecision = new TriangleDecision(); List<String> errors = triangleDecision.validate(triangle.getA(), triangle.getB(), triangle.getC()); if (!errors.isEmpty()) { return TriangleAnswer.error(errors); } else { return TriangleAnswer.typeOf(triangleDecision.calculateType(triangle.getA(), triangle.getB(), triangle.getC())); } } @RequestMapping("/credit-assessment") public CreditAssessmentAnswer creditAssessment(@RequestBody CreditAssessmentRequest creditAssessmentRequest) { CreditAssessment creditAssessment = new CreditAssessment(); List<String> errors = new ArrayList<>(); creditAssessment.isNumber(creditAssessmentRequest.getMortgage(), "jelzáloghitel összege", errors); creditAssessment.isNumber(creditAssessmentRequest.getValueOfTheProperty(), "ingatlan értéke", errors); if (!errors.isEmpty()) { return CreditAssessmentAnswer.error(errors); } int mortgage = Integer.parseInt(creditAssessmentRequest.getMortgage()); int valueOfProperty = Integer.parseInt(creditAssessmentRequest.getValueOfTheProperty()); creditAssessment.validate(mortgage, valueOfProperty, errors); if (!errors.isEmpty()) { return CreditAssessmentAnswer.error(errors); } return CreditAssessmentAnswer.workflowTypeOf(creditAssessment.calculateWorkflowType(mortgage, valueOfProperty)); } @Bean public Endpoint triangleEndpointEndpoint(TriangleEndpoint triangleEndpoint) { EndpointImpl endpoint = new EndpointImpl(bus, triangleEndpoint); endpoint.publish("/triangle"); return endpoint; } @Bean public Endpoint creditAssessmentEndpointEndpoint(CreditAssessmentEndpoint creditAssessmentEndpoint) { EndpointImpl endpoint = new EndpointImpl(bus, creditAssessmentEndpoint); endpoint.publish("/credit-assessment"); return endpoint; } }
[ "viczian.istvan@gmail.com" ]
viczian.istvan@gmail.com
3434388edd25cbe083488c1b69e16eb26d8a1828
db90da9d516ff4e406a5084be8e09ee813cddd2e
/src/main/java/com/demo/leetcode/回溯算法/Solution988.java
b722887c6835b2acf51b2c54bb1ad45391b833f8
[]
no_license
goog00/my-algorithm-exercise
106d7beace94c02ea44dda83a5d716a5198a563c
f5c4e762859826836f80373ace4d30cc0ebde13c
refs/heads/master
2022-11-22T10:11:51.214353
2020-07-09T09:54:42
2020-07-09T09:54:42
276,077,382
0
0
null
null
null
null
UTF-8
Java
false
false
1,865
java
package com.demo.leetcode.回溯算法; /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution988 { static String ans = "~"; public static String smallestFromLeaf(TreeNode root) { dfs(root,new StringBuilder()); return ans; } private static void dfs(TreeNode root,StringBuilder sb){ if(root == null){ return; } //数字直接转字符 sb.append((char)('a' + root.val)); if(root.left == null && root.right == null){ //第一次反转sb,获取从叶子节点到根节点顺序的字符串 sb.reverse(); String str = sb.toString(); //第二次反转sb,是把字符串的顺序变更回来,以便下次回溯时使用 sb.reverse(); if(str.compareTo(ans) < 0){ ans = str; } } dfs(root.left,sb); dfs(root.right,sb); //回溯,重置状态 sb.deleteCharAt(sb.length()-1); } public static void main(String[] args) { // [0,1,2,3,4,3,4] //[25,1,3,1,3,0,2] TreeNode treeNode25 = new TreeNode(25); TreeNode treeNode1 = new TreeNode(1); TreeNode treeNode3 = new TreeNode(3); TreeNode treeNode1_ = new TreeNode(1); TreeNode treeNode3_ = new TreeNode(3); TreeNode treeNode0 = new TreeNode(0); TreeNode treeNode2 = new TreeNode(2); treeNode25.left = treeNode1; treeNode25.right = treeNode3; treeNode1.left = treeNode1_; treeNode1.right = treeNode3_; treeNode3.left = treeNode0; treeNode3.right = treeNode2; String k = smallestFromLeaf(treeNode25); System.out.println(k); } }
[ "steng2009@163.com" ]
steng2009@163.com
ae4cef5c6465be80f5249819747cfa009e9ea33a
45ec8fbb45734eb30a45a31d43a8a0f7b3a8e07a
/RehearsalAssistant/src/urbanstew/RehearsalAssistant/RehearsalActivity.java
9dbd3f3b9379400913fd58d08b99283d8897f134
[]
no_license
TomkeyZhang/RehearsalAssistant
75fc6601ace032ebe3ae723b634df9caae173996
45148d38b6cfe0b023dd040e81811f4527a4f5df
refs/heads/master
2020-12-25T18:19:51.445675
2013-08-06T12:21:25
2013-08-06T12:21:25
11,923,268
4
0
null
null
null
null
UTF-8
Java
false
false
826
java
package urbanstew.RehearsalAssistant; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.MenuItem; public class RehearsalActivity extends Activity { public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); mSettingsMenuItem = menu.add(R.string.settings).setIcon(android.R.drawable.ic_menu_preferences); return true; } public boolean onOptionsItemSelected(MenuItem item) { if(item == mSettingsMenuItem) { startActivity(new Intent(getApplication(), SettingsActivity.class)); return true; } else return false; } public void onPlaybackStarted() { } protected MenuItem mSettingsMenuItem; }
[ "TomkeyZhang@gmail.com" ]
TomkeyZhang@gmail.com
bec4872b2c246ca0f9e6e9f0321f82c6d08483a7
6d60a8adbfdc498a28f3e3fef70366581aa0c5fd
/codebase/selected/1611093.java
7318f2eea068377328321b08d021767d3d84284c
[]
no_license
rayhan-ferdous/code2vec
14268adaf9022d140a47a88129634398cd23cf8f
c8ca68a7a1053d0d09087b14d4c79a189ac0cf00
refs/heads/master
2022-03-09T08:40:18.035781
2022-02-27T23:57:44
2022-02-27T23:57:44
140,347,552
0
1
null
null
null
null
UTF-8
Java
false
false
10,716
java
package uk.org.toot.midi.sequence; import java.beans.PropertyChangeSupport; import java.util.ArrayList; import java.util.List; import java.util.Hashtable; import javax.sound.midi.Track; import javax.sound.midi.MidiEvent; import javax.sound.midi.MidiMessage; import javax.sound.midi.InvalidMidiDataException; import uk.org.toot.midi.message.PitchMsg; import uk.org.toot.midi.sequence.edit.Transposable; import uk.org.toot.midi.sequence.edit.CutPasteable; import uk.org.toot.swingui.midiui.MidiColor; import static uk.org.toot.midi.message.MetaMsg.*; import static uk.org.toot.midi.message.NoteMsg.*; import static uk.org.toot.midi.misc.Controller.BANK_SELECT; public class MidiTrack extends BasicTrack implements Transposable, CutPasteable { /** @supplierCardinality 1 */ protected MidiSequence sequence; private int program = -1; private int bank = -1; private int channel = -1; private Hashtable<Object, Object> properties; private PropertyChangeSupport propertyChangeSupport; public MidiTrack(Track track, MidiSequence sequence) { super(track); this.sequence = sequence; parse(); updateHue(getTrackName()); } public Object clone() throws CloneNotSupportedException { throw new CloneNotSupportedException(); } public MidiSequence getSequence() { return sequence; } public PropertyChangeSupport getPropertyChangeSupport() { if (propertyChangeSupport == null) { propertyChangeSupport = new PropertyChangeSupport(this); } return propertyChangeSupport; } public boolean add(MidiEvent event) { if (super.add(event)) { parseEvent(event); return true; } return false; } private long delayTicks = 0L; public long getDelayTicks() { return delayTicks; } public void setDelayTicks(long ticks) { delayTicks = ticks; } public MidiEvent get(int index) { MidiEvent event = super.get(index); if (delayTicks == 0) return event; return new MidiEvent(event.getMessage(), event.getTick() + delayTicks); } public boolean isDrumTrack() { return channel == (10 - 1) || channel == (11 - 1); } public boolean isMarkerTrack() { return getTrackName().equals("Marker"); } public String propertyName(int type) { switch(type) { case TEXT: return "text"; case COPYRIGHT: return "copyright"; case TRACK_NAME: return "trackName"; case INSTRUMENT_NAME: return "instrumentName"; case LYRIC: return "lyric"; case MARKER: return "marker"; case CUE_POINT: return "cuepoint"; case DEVICE_NAME: return "deviceName"; } return null; } protected void setMetaName(int type, String name) throws InvalidMidiDataException { String oldName = getMetaName(type); super.setMetaName(type, name); getPropertyChangeSupport().firePropertyChange(propertyName(type), oldName, name); } public void setTrackName(String name) throws InvalidMidiDataException { updateHue(name); super.setTrackName(name); } protected void updateHue(String name) { float hue = isDrumTrack() ? MidiColor.getDrumHue(name) : MidiColor.getPitchedHue(name); putClientProperty("Hue", new Float(hue)); } public String getProgramName() { return "prg. " + program; } public int getProgram() { return this.program; } protected MidiEvent getFirstProgramEvent() { for (int i = 0; i < size() - 1; i++) { MidiEvent event = get(i); MidiMessage msg = event.getMessage(); if (isChannel(msg)) { if (getCommand(msg) == PROGRAM_CHANGE) { return event; } } } return null; } public void setProgram(int prg) { if (prg == program) return; MidiMessage m; try { MidiEvent e = getFirstProgramEvent(); if (e != null) { m = e.getMessage(); setData1(m, prg); remove(e); add(e); } else { m = createChannel(PROGRAM_CHANGE, channel, prg, 0); add(new MidiEvent(m, 0)); } int oldProgram = program; program = prg; getPropertyChangeSupport().firePropertyChange("Program", new Integer(oldProgram), new Integer(program)); } catch (InvalidMidiDataException ex) { ex.printStackTrace(); } } public int getBank() { return bank; } protected MidiEvent getFirstBankEvent() { for (int i = 0; i < size() - 1; i++) { MidiEvent event = get(i); MidiMessage msg = event.getMessage(); if (isChannel(msg)) { if (getCommand(msg) == CONTROL_CHANGE && getData1(msg) == BANK_SELECT) { return event; } } } return null; } public void setBank(int bank) { if (bank == this.bank) return; MidiMessage m; try { MidiEvent e = getFirstBankEvent(); if (e != null) { m = e.getMessage(); setData2(m, bank); } else { m = createChannel(CONTROL_CHANGE, channel, BANK_SELECT, bank); add(new MidiEvent(m, 0)); MidiEvent pce = getFirstProgramEvent(); if (pce != null) { remove(pce); add(pce); } } int oldBank = this.bank; this.bank = bank; getPropertyChangeSupport().firePropertyChange("Bank", new Integer(oldBank), new Integer(bank)); } catch (InvalidMidiDataException ex) { ex.printStackTrace(); } } public int getChannel() { return channel; } public void changeChannel(int channel) { for (int i = 0; i < size(); i++) { try { MidiEvent ev = get(i); MidiMessage msg = ev.getMessage(); if (isChannel(msg)) { int cmd = getCommand(msg); switch(cmd) { case CHANNEL_PRESSURE: case CONTROL_CHANGE: case NOTE_OFF: case NOTE_ON: case PITCH_BEND: case POLY_PRESSURE: case PROGRAM_CHANGE: setChannel(msg, channel); break; } } else if (isMeta(msg)) { byte[] bytes = getData(msg); if (getType(msg) == CHANNEL_PREFIX) { bytes[0] = (byte) channel; setData(msg, bytes, bytes.length); } } } catch (InvalidMidiDataException ex) { ex.printStackTrace(); } } } public boolean cut() { sequence.deleteTrack(this.getTrack()); return true; } public boolean paste() { sequence.addTrack(this); return true; } public boolean transpose(int semitones) { for (int i = 0; i < size(); i++) { try { MidiMessage msg = get(i).getMessage(); if (isPitch(msg)) { PitchMsg.transpose(msg, semitones); } } catch (InvalidMidiDataException ex) { ex.printStackTrace(); } } return true; } public List<MidiNote> getMatches(long startTick, int hiValue, long endTick, int loValue) { return getMatches((long) 0, startTick, hiValue, endTick, loValue); } public List<MidiNote> getMatches(long offsetTicks, long startTick, int hiValue, long endTick, int loValue) { ArrayList<MidiNote> matches = new ArrayList<MidiNote>(); for (int i = 0; i < size(); i++) { MidiEvent on = get(i); if (on.getTick() < (startTick - offsetTicks)) continue; if (on.getTick() > endTick) break; MidiMessage msg = on.getMessage(); if (isNote(msg)) { if (isOn(msg)) { int note = getPitch(msg); if ((loValue != -1 && note < loValue) || (hiValue != -1 && note > hiValue)) { continue; } for (int j = 1 + i; j < size(); j++) { MidiEvent off = get(j); MidiMessage m = off.getMessage(); if (!isNote(m)) continue; if (!isOff(m)) continue; if (getPitch(m) != note) continue; if (off.getTick() < startTick) break; matches.add(new MidiNote(on, off)); break; } } } } return matches; } protected void parse() { for (int i = 0; i < size(); i++) { parseEvent(get(i)); } } protected void parseEvent(MidiEvent ev) { MidiMessage msg = ev.getMessage(); if (isChannel(msg)) { int chan = uk.org.toot.midi.message.NoteMsg.getChannel(msg); if (this.channel < 0) { this.channel = chan; } else if (this.channel != chan) { System.err.println("Track " + getTrackName() + " has more than 1 channel!"); } switch(getCommand(msg)) { case PROGRAM_CHANGE: program = getData1(msg); break; case CONTROL_CHANGE: if (BANK_SELECT == getData1(msg)) { bank = getData2(msg); } break; } } } public Hashtable<Object, Object> getProperties() { if (properties == null) { properties = new Hashtable<Object, Object>(); } return properties; } public final Object getClientProperty(Object key) { return getProperties().get(key); } public void putClientProperty(Object key, Object value) { getProperties().put(key, value); } }
[ "aaponcseku@gmail.com" ]
aaponcseku@gmail.com
042098b812ed75ac0d25d5ed4add05e85c9e15ee
db2c49a189e13554e73713ed2a69ca887a2ad9f0
/org.orbit.component.runtime/src/org/orbit/component/runtime/tier4/missioncontrol/service/MissionControlService.java
6e2c3990031ada25de0c93cf46d2e277658a0e84
[]
no_license
EngineerBarsik/dev
fa501b6ff58e0b6b263d54d6e85c6d69a323f612
81715414de121e1d7cead7d4066d626b095816d6
refs/heads/master
2023-02-11T01:20:29.217287
2021-01-08T01:14:21
2021-01-08T01:14:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
985
java
package org.orbit.component.runtime.tier4.missioncontrol.service; import java.util.List; import org.orbit.component.runtime.model.missioncontrol.Mission; import org.origin.common.jdbc.ConnectionProvider; import org.origin.common.rest.server.ServerException; import org.origin.common.service.AccessTokenProvider; import org.origin.common.service.IWebService; /** * * @author <a href="mailto:yangyang4j@gmail.com">Yang Yang</a> * */ public interface MissionControlService extends IWebService, ConnectionProvider, AccessTokenProvider { List<Mission> getMissions(String typeId) throws ServerException; Mission getMission(String typeId, String name) throws ServerException; Mission createMission(String typeId, String name) throws ServerException; boolean startMission(String typeId, String name) throws ServerException; boolean stopMission(String typeId, String name) throws ServerException; boolean deleteMission(String typeId, String name) throws ServerException; }
[ "yangyang4cs@gmail.com" ]
yangyang4cs@gmail.com
0c217cd5017b15eb120265c80ffcbf5d2a0adb53
a937fca0fd7e8ea0414c7a8d724aabef8b15aa9d
/src/Controllers/Controller.java
6f3e3ac331ec52b960f1f694534d4720db3a8c29
[]
no_license
Fregoneti/Bot_Alertas
c30f41ffcf9bda477ca96ef1fad828775f8f6a3e
5b27c0bf647f44dc555f56aabc2a778d90b0c3b9
refs/heads/master
2023-04-19T11:34:42.096421
2021-05-14T07:49:42
2021-05-14T07:49:42
367,289,644
0
0
null
null
null
null
UTF-8
Java
false
false
6,385
java
package Controllers; import Dao.alertaDao; import Model.Alerta; import Utils.ConDB; import Utils.email; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Calendar; import java.util.List; public class Controller { private static final String USER_NAME = "comunicacion.rioma"; // GMail user name (just the part before "@gmail.com") private static final String PASSWORD = "Emete01rioma"; // GMail password private static String articulo; public static void controlar() throws SQLException, ClassNotFoundException { Connection con = ConDB.getCon(); Calendar c = Calendar.getInstance(); List<Alerta> alertaDia = alertaDao.getTodasAlertasDia(con); List<Alerta> alertaMes = alertaDao.getTodasAlertasMes(con); // List<Alerta> alertaAno = alertaDao.getTodasAlertasAno(con); //1 DE TODOS LOS MESES if (5 == (c.get(Calendar.DAY_OF_MONTH))) { System.out.println("Entro en day"); for (int i = 0; i < alertaDia.size(); i++) { stock(alertaMes.get(i)); oferta(alertaMes.get(i)); } } //LUNES if (5 == (c.get(Calendar.DAY_OF_WEEK))) { for (int i = 0; i <= alertaDia.size(); i++) { stock(alertaDia.get(i)); oferta(alertaDia.get(i)); } } } public static void stock(Alerta a) { double existencias = 0; Statement stmt; ResultSet rs; String subject = "Alerta de Stock"; String body; String[] correo; try { String consulta = "select xexistencia from imp.pl_existalm where xempresa_id = '" + a.getEmpresaID() + "' and xarticulo_id = '" + a.getArticulo_id() + "' and xalmacen_id = '" + a.getAlmacenID() + "'"; stmt = ConDB.getCon().createStatement(); rs = stmt.executeQuery(consulta); //INICIO DE INSERCIÓN FILAS while (rs.next()) { existencias = rs.getDouble(1); } } catch (SQLException | ClassNotFoundException ignored) { } articulo = ""; try { String consulta = "select xdescripcion from imp.pl_articulos where xarticulo_id= '" + a.getArticulo_id() + "'"; stmt = ConDB.getCon().createStatement(); rs = stmt.executeQuery(consulta); //INICIO DE INSERCIÓN FILAS while (rs.next()) { articulo = rs.getString(1); } } catch (SQLException | ClassNotFoundException ignored) { } switch (a.getCondicion()) { case ">": if (a.getCantidad() > existencias) { body = "Del articulo " + articulo + " con ID " + a.getArticulo_id() + " con " + existencias + " existencias, está por debajo de lo especificado '" + a.getCantidad() + "'"; correo = new String[]{a.getEmailTo()}; email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body); System.out.println("ENVIADO EMAIL"); } break; case "<": if (a.getCantidad() < existencias) { correo = new String[]{a.getEmailTo()}; body = "Del articulo " + articulo + " con ID " + a.getArticulo_id() + " con " + existencias + " existencias, está por encima de lo especificado '" + a.getCantidad() + "'"; email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body); System.out.println("ENVIADO EMAIL"); } break; case ">=": if (a.getCantidad() >= existencias) { correo = new String[]{a.getEmailTo()}; body = "Del articulo " + articulo + " con ID " + a.getArticulo_id() + " con " + existencias + " existencias, está por debajo o igual de lo especificado '" + a.getCantidad() + "'"; email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body); System.out.println("ENVIADO EMAIL"); } break; case "<=": if (a.getCantidad() <= existencias) { correo = new String[]{a.getEmailTo()}; body = "Del articulo " + articulo + " con ID " + a.getArticulo_id() + " con " + existencias + " existencias, está por encima o igual de lo especificado '" + a.getCantidad() + "'"; email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body); System.out.println("ENVIADO EMAIL"); } break; } } public static void oferta(Alerta a) { String oferta = ""; Statement stmt; ResultSet rs; String subject = "Alerta de Oferta"; String body; String[] correo; try { String consulta = "select p856_cod_abc from imp.pl_articulos where xempresa_id = '" + a.getEmpresaID() + "' and xarticulo_id = '" + a.getArticulo_id() + "'"; stmt = ConDB.getCon().createStatement(); rs = stmt.executeQuery(consulta); //INICIO DE INSERCIÓN FILAS while (rs.next()) { oferta = rs.getString(1); } } catch (SQLException | ClassNotFoundException ignored) { } articulo = ""; try { String consulta = "select xdescripcion from imp.pl_articulos where xarticulo_id= '" + a.getArticulo_id() + "'"; stmt = ConDB.getCon().createStatement(); rs = stmt.executeQuery(consulta); //INICIO DE INSERCIÓN FILAS while (rs.next()) { articulo = rs.getString(1); } } catch (SQLException | ClassNotFoundException ignored) { } switch (oferta) { case "O": case "DO": case "EO": body = "El articulo " + articulo + " con ID " + a.getArticulo_id() + "está en oferta "; correo = new String[]{a.getEmailTo()}; email.sendFromGMail(USER_NAME, PASSWORD, correo, subject, body); System.out.println("ENVIADO EMAIL"); break; } } }
[ "arresu.ca@gmail.com" ]
arresu.ca@gmail.com
d836d2424b30a80c8b3490116886febbbfe9987e
dcba15e74ec5e808840169399b5e8e32b81dd600
/app/src/main/java/app/lerner2/projects/my/lerner4/GameMech.java
00e4e3b709a923dcc0fe1da2a1f118d529297e05
[]
no_license
heizer23/Atoms
ff9a8660cb265b8d425661c9945346ef6ef8311f
f2837b8ce66d0d3c3935a765dae58d315eee7f3c
refs/heads/master
2020-05-30T18:20:26.320327
2019-07-28T15:45:52
2019-07-28T15:45:52
189,894,338
0
0
null
null
null
null
UTF-8
Java
false
false
221
java
package app.lerner2.projects.my.lerner4; public class GameMech { long tagesPunkte = 0; public GameMech(){ tagesPunkte = 12; } public long getTagesPunkte() { return tagesPunkte; } }
[ "p.remmecke@gmail.com" ]
p.remmecke@gmail.com
cdcd9d4f11dce3c48e46b66dad5d629f3f0d9eda
440728e853fb55f6c3b947dc811a1417c986fec2
/Game/src/test/java/com/bbz/sanguo/net/GameServerTest.java
9701e17341dc4540574ba9ded61d1ddc8b1b9537
[]
no_license
babizhu/MachineSanGuo
fcfba60d1c9676edc2f6805fae8ca436e918219a
e9801fdabc37e1d3c21c609b1fe4028bb8361b4f
refs/heads/master
2016-09-06T04:10:44.302097
2014-12-31T10:18:03
2014-12-31T10:18:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,341
java
package com.bbz.sanguo.net; import com.bbz.sanguo.lanch.ServerCfg; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; import org.junit.Test; public class GameServerTest{ @Test public void testDispatcherChange() throws Exception{ EventLoopGroup worker = new NioEventLoopGroup(); Bootstrap bootstrap = new Bootstrap(); try { bootstrap.group( worker ); bootstrap.channel( NioSocketChannel.class ); // bootstrap.channel( OioSocketChannel.class ); bootstrap.handler( new GameClientInitializer() ); Channel channel = bootstrap.connect( "localhost", ServerCfg.PORT ).sync().channel(); GameClientHandler handler = channel.pipeline().get( GameClientHandler.class ); for( int i = 0; i < 1; i++ ) { handler.missionShow(); handler.login( "bbz", "pass" ); handler.missionShow(); handler.login( "bbz", "pass" ); } } catch( Exception e ) { e.printStackTrace(); } finally { Thread.sleep( 1000000 ); worker.shutdownGracefully(); } } }
[ "liu_kun@msn.com" ]
liu_kun@msn.com
6ee1dc7c1c6cb8a63423fd0d8129692281d0610f
ff8bd7f0d1c2befa841bc834352c47d5ae080594
/src/main/java/pt/lisomatrix/Sockets/models/Absence.java
edfe4277ffcb637d717dee8be56af1c6f023f669
[]
no_license
Lisomatrix/StudenStats-Backend
7a33ff4a6bf5588351e271a84c07a05240ab7fa9
1f5a405f5021416b4c254fa796ea1d05a474e2f5
refs/heads/master
2021-08-25T18:01:04.276916
2019-09-28T09:38:52
2019-09-28T09:38:52
166,423,122
0
0
null
2021-08-02T17:18:58
2019-01-18T15:11:04
CSS
UTF-8
Java
false
false
2,818
java
package pt.lisomatrix.Sockets.models; import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; import javax.persistence.*; import java.io.Serializable; import java.util.Date; @Entity @Table(name = "absence") public class Absence implements Serializable { @Id @Column(name = "absence_id") @GeneratedValue(strategy = GenerationType.AUTO) private long absenceId; private Date date; @OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "student_id", nullable = false) private Student student; @OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "discipline_id", nullable = false) private Discipline discipline; @OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "lesson_id", nullable = false) private Lesson lesson; @OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "absenceType_id", nullable = false) private AbsenceType absenceType; @OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "module_id", nullable = false) private Module module; @Column(nullable = false) private boolean isJustifiable; @Column(nullable = false) private boolean isJustified; private boolean isRecuperated; public Module getModule() { return module; } public void setModule(Module module) { this.module = module; } public boolean isRecuperated() { return isRecuperated; } public void setRecuperated(boolean recuperated) { isRecuperated = recuperated; } public long getAbsenceId() { return absenceId; } public void setAbsenceId(long absenceId) { this.absenceId = absenceId; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public Student getStudent() { return student; } public void setStudent(Student student) { this.student = student; } public Discipline getDiscipline() { return discipline; } public void setDiscipline(Discipline discipline) { this.discipline = discipline; } public Lesson getLesson() { return lesson; } public void setLesson(Lesson lesson) { this.lesson = lesson; } public AbsenceType getAbsenceType() { return absenceType; } public void setAbsenceType(AbsenceType absenceType) { this.absenceType = absenceType; } public boolean isJustifiable() { return isJustifiable; } public void setJustifiable(boolean justifiable) { isJustifiable = justifiable; } public boolean isJustified() { return isJustified; } public void setJustified(boolean justified) { isJustified = justified; } }
[ "lisomati@hotmail.com" ]
lisomati@hotmail.com
0bd94f345cc5cdca370a8882d0d6b607c5a27a9f
bd3592781efb4b4bb9fb46c48d46680d76917d5b
/src/SameTree.java
7698c5f9410ac32533276d595c01144be1fd9036
[]
no_license
ChunChung/Leetcode
e7efefd108da53b09aa66295b1cfcfc974ccd5a2
b7c78fe3730ba9fb5c2ad98264129314c543ce2a
refs/heads/master
2021-01-18T23:22:18.538481
2018-10-25T15:51:17
2018-10-25T15:51:17
23,938,867
0
0
null
null
null
null
UTF-8
Java
false
false
690
java
public class SameTree { public static boolean isSameTree(TreeNode p, TreeNode q) { if(p == null && q == null) return true; else if (p == null) return false; else if (q == null) return false; if(p.val == q.val) { return isSameTree(p.left, q.left) && isSameTree(p.right, q.right); } return false; } static public void main(String argv[]) { TreeNode firstnode = new TreeNode(3); TreeNode second = new TreeNode(2); firstnode.left = second; second.left = new TreeNode(5); second.right = new TreeNode(2); if(isSameTree(firstnode, firstnode.left)) System.out.println("True"); } }
[ "chunchung@cs.nctu.edu.tw" ]
chunchung@cs.nctu.edu.tw
b43620726fa5fcc6e476edb5464aaf6a848a40cb
331fccf22ca45d63e363009dcc873da2147feafd
/BroadWeb/src/main/java/com/springbook/biz/common/AfterThrowingAdvice.java
2b816d20a42119805ed4e3472e7192f9ce4503cb
[]
no_license
cielKim/MVCs
50b87edb84dd6ce58a6696c194f75522706f92da
667d68622729cd3127d7095abd76eb69855db38f
refs/heads/master
2021-04-27T04:13:32.996602
2018-02-24T09:55:45
2018-02-24T09:55:45
122,727,388
0
0
null
null
null
null
UTF-8
Java
false
false
968
java
package com.springbook.biz.common; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.springframework.stereotype.Service; @Service @Aspect public class AfterThrowingAdvice { @AfterThrowing(pointcut="PointcutCommon.allPointcut()", throwing="exceptObj") public void exceptionLog(JoinPoint jp, Exception exceptObj) { String method = jp.getSignature().getName(); System.out.println(method + "()메소드 수행 중 예외 발생!"); if(exceptObj instanceof IllegalArgumentException) { System.out.println("부적합한 값이 입력되었습니다."); } else if(exceptObj instanceof NumberFormatException) { System.out.println("숫자 형식의 값이 아닙니다."); } else if(exceptObj instanceof Exception) { System.out.println("문제가 발생했습니다."); } } }
[ "user@192.168.219.102" ]
user@192.168.219.102
176ac6242e548615b5b4d1cf8928ee5a512398bc
6ba8be7fff3eeccbf1a5d1f10abd8522fe530099
/src/main/java/com/no3003/fatlonely/util/HttpUtil.java
cc77b934643f60cadda8d8f253f8131df0e25643
[]
no_license
LHH7049/FatLonely
71ccc7e0b0fe953fafcdb45f481109610fbb697a
2af68fcfbb20f9278e29eee6545f78178a62904e
refs/heads/master
2023-05-10T02:25:05.837967
2021-06-01T01:25:57
2021-06-01T01:25:57
361,995,658
0
0
null
null
null
null
UTF-8
Java
false
false
2,788
java
package com.no3003.fatlonely.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @Author: lz * @Date: 2021/5/11 10:31 */ public class HttpUtil { private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class); public static String getClientIpAddress(HttpServletRequest request) { String ip = request.getHeader("x-forwarded-for"); if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } if (ip == null) { return ""; } int pos = ip.indexOf(","); if (pos > 0) { String[] ipArray = ip.split(","); int i = 0; for (i = 0; i < ipArray.length; i++) { String ipSub = ipArray[i].trim(); if (!"unknown".equalsIgnoreCase(ipSub)) { ip = ipSub; break; } } if (i >= ipArray.length) { logger.warn("IP is full of 'unknown'"); ip = ipArray[i - 1].trim(); } } if (ip.length() <= 16) { return ip; } else { logger.warn("IP of length > 16 : " + ip); return ip.substring(0, 16); } } public static String getIP(){ HttpServletRequest request = getHttpServletRequest(); if (request != null){ return getClientIpAddress(request); } return ""; } public static void setCookieValue(HttpServletResponse response, String name, String value, int expire){ Cookie cookie = new Cookie(name, value); cookie.setMaxAge(expire); cookie.setSecure(false); cookie.setHttpOnly(true); cookie.setPath("/"); response.addCookie(cookie); } public static HttpServletRequest getHttpServletRequest(){ try { ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); if (attr == null) { return null; } return attr.getRequest(); } catch (Exception e) { return null; } } }
[ "704931253@qq.com" ]
704931253@qq.com
021466487911f3ecd1695fa63795ef79e4ff9f9f
b220f06f194e7d05a9b24fbb2b655e77fcdb9def
/app/src/main/java/br/com/faculdade/dao/DisciplinaDAO.java
eb246ed2069c5d7ee64d0735d2d336c82b83cb87
[]
no_license
cardoso010/Faculdade
8a2072a4f3f449695825158606c4fe46a68f9c57
70662a6a4e38e8c9bdad2ecea8fdd885f72d6d7e
refs/heads/master
2021-01-19T03:17:21.018627
2016-06-30T21:35:17
2016-06-30T21:35:17
62,342,908
0
0
null
null
null
null
UTF-8
Java
false
false
3,650
java
package br.com.faculdade.dao; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; import java.util.ArrayList; import java.util.List; import br.com.faculdade.models.Disciplina; /** * Created by cardoso on 26/04/16. */ public class DisciplinaDAO extends SQLiteOpenHelper{ private static final String DATABASE = "Faculdade"; private static final int VERSAO = 1; public DisciplinaDAO(Context context) { super(context, DATABASE, null, VERSAO); } public void salvar(Disciplina disciplina) { ContentValues values = new ContentValues(); values.put("nome", disciplina.getNome()); values.put("periodo", disciplina.getPeriodo()); values.put("primeira_prova", disciplina.getPrimeiraProva()); values.put("segunda_prova", disciplina.getSegundaProva()); values.put("primeiro_trabalho", disciplina.getPrimeiroTrabalho()); values.put("segundo_trabalho", disciplina.getSegundoTrabalho()); getWritableDatabase().insert("Disciplinas", null, values); } @Override public void onCreate(SQLiteDatabase db) { String ddl = "CREATE TABLE Disciplinas (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "nome TEXT UNIQUE NOT NULL," + "periodo INTEGER NOT NULL," + "primeira_prova REAL," + "segunda_prova REAL," + "primeiro_trabalho REAL," + "segundo_trabalho REAL);"; db.execSQL(ddl); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { String ddl = "DROP TABLE IF EXISTS Disciplinas"; db.execSQL(ddl); this.onCreate(db); } public List<Disciplina> getLista() { String[] colunas = {"id", "nome", "periodo", "primeira_prova", "segunda_prova", "primeiro_trabalho", "segundo_trabalho"}; Cursor cursor = getWritableDatabase().query("Disciplinas", colunas, null, null, null, null, null); ArrayList<Disciplina> disciplinas = new ArrayList<Disciplina>(); while (cursor.moveToNext()) { Disciplina disciplina = new Disciplina(); disciplina.setId(cursor.getInt(0)); disciplina.setNome(cursor.getString(1)); disciplina.setPeriodo(cursor.getInt(2)); disciplina.setPrimeiraProva(cursor.getFloat(3)); disciplina.setSegundaProva(cursor.getFloat(4)); disciplina.setPrimeiroTrabalho(cursor.getFloat(5)); disciplina.setSegundoTrabalho(cursor.getFloat(6)); disciplinas.add(disciplina); } return disciplinas; } public void deletar(Disciplina disciplina) { String[] args = {Integer.toString(disciplina.getId())}; getWritableDatabase().delete("Disciplinas", "id=?", args); } public void alterar(Disciplina disciplina) { ContentValues values = new ContentValues(); values.put("nome", disciplina.getNome()); values.put("periodo", disciplina.getPeriodo()); values.put("primeira_prova", disciplina.getPrimeiraProva()); values.put("segunda_prova", disciplina.getSegundaProva()); values.put("primeiro_trabalho", disciplina.getPrimeiroTrabalho()); values.put("segundo_trabalho", disciplina.getSegundoTrabalho()); String[] args = { String.valueOf(disciplina.getId()) }; getWritableDatabase().update("Disciplinas", values, "id=?", args); } }
[ "gabriel.cardoso010@gmail.com" ]
gabriel.cardoso010@gmail.com
53a2caec6dc7e89178d4a5d8ff6b5ca0bb96a644
4e9f0b12acf6b95c6229c4ca557d26723896b248
/restaurant/src/main/java/com/blibli/future/pos/restaurant/common/exception/NotFoundMapper.java
70999f5f69f73379b6163f152f104f3b954d5352
[]
no_license
kelvinikome/restaurant-pos-app
d92b58d19db9cd550f59690c2d15828bc05fc69a
1fd60e4f0891d58cdc7dc547fdf6f3afce3eaf7c
refs/heads/master
2020-04-20T03:06:11.239913
2018-01-05T16:44:25
2018-01-05T16:44:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
370
java
package com.blibli.future.pos.restaurant.common.exception; import javax.ws.rs.NotFoundException; import javax.ws.rs.core.Response; import javax.ws.rs.ext.Provider; @Provider public class NotFoundMapper extends BaseExceptionMapper<NotFoundException> { @Override public Integer getStatusCode() { return Response.Status.NOT_FOUND.getStatusCode(); } }
[ "13515097@std.stei.itb.ac.id" ]
13515097@std.stei.itb.ac.id
baf986ac7cebb35f252ceb26a43494163f42dd13
bb450bef04f1fab24a03858343f3e8fd9c5061ee
/tests/sources/local/tools/0_monitor/src/main/java/monitor/Matmul.java
e5014958c4bb79187132b2d1e507c8ce13596d0a
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
bsc-wdc/compss
c02b1c6a611ed50d5f75716d35bd8201889ae9d8
5f7a31436d0e6f5acbeb66fa36ab8aad18dc4092
refs/heads/stable
2023-08-16T02:51:46.073185
2023-08-04T21:43:31
2023-08-04T21:43:31
123,949,037
39
21
Apache-2.0
2022-07-05T04:08:53
2018-03-05T16:44:51
Java
UTF-8
Java
false
false
4,165
java
package monitor; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.util.StringTokenizer; public class Matmul { private static final int MSIZE = 8; private static final int BSIZE = 2; private double[][][] A; private double[][][] B; private double[][][] C; public static void main(String args[]) { // Get parameters if (args.length != 3) { System.out.println("[ERROR] Usage: matmul <Ain> <Bin> <Cout>"); System.exit(-1); } String fA = args[0]; String fB = args[1]; String fC = args[2]; System.out.println("[LOG] MSIZE parameter value = " + MSIZE); System.out.println("[LOG] BSIZE parameter value = " + BSIZE); // Run matmul app Matmul matmul = new Matmul(); matmul.Run(fA, fB); // Check result System.out.println("[LOG] Storing C matrix obtained"); matmul.storeMatrix(fC); System.out.println("[LOG] Main program finished. Result needs to be checked (result script)"); } private void Run(String fileA, String fileB) { // Load Matrices System.out.println("[LOG] Allocating A/B/C matrix space"); A = new double[MSIZE][MSIZE][BSIZE * BSIZE]; B = new double[MSIZE][MSIZE][BSIZE * BSIZE]; C = new double[MSIZE][MSIZE][BSIZE * BSIZE]; System.out.println("[LOG] Loading A Matrix from file"); loadMatrix(A, fileA); System.out.println("[LOG] Loading B Matrix from file"); loadMatrix(B, fileB); // Compute result System.out.println("[LOG] Computing Result"); for (int i = 0; i < MSIZE; i++) { for (int j = 0; j < MSIZE; j++) { for (int k = 0; k < MSIZE; k++) { MatmulImpl.multiplyAccumulative(A[i][k], B[k][j], C[i][j]); } } } } private void loadMatrix(double[][][] matrix, String fileName) { try { FileReader filereader = new FileReader(fileName); BufferedReader br = new BufferedReader(filereader); StringTokenizer tokens; String nextLine; for (int i = 0; i < MSIZE; ++i) { for (int j = 0; j < MSIZE; ++j) { nextLine = br.readLine(); tokens = new StringTokenizer(nextLine); for (int block = 0; block < BSIZE * BSIZE && tokens.hasMoreTokens(); ++block) { String value = tokens.nextToken(); matrix[i][j][block] = Double.parseDouble(value); } } nextLine = br.readLine(); } br.close(); filereader.close(); } catch (FileNotFoundException fnfe) { fnfe.printStackTrace(); System.exit(-1); } catch (IOException ioe) { ioe.printStackTrace(); System.exit(-1); } } private void storeMatrix(String fileName) { try { FileOutputStream fos = new FileOutputStream(fileName); for (int i = 0; i < MSIZE; ++i) { for (int j = 0; j < MSIZE; ++j) { for (int block = 0; block < BSIZE * BSIZE; ++block) { String value = String.valueOf(C[i][j][block]) + " "; fos.write(value.getBytes()); } fos.write("\n".getBytes()); } fos.write("\n".getBytes()); } fos.close(); } catch (IOException ioe) { ioe.printStackTrace(); System.exit(-1); } } @SuppressWarnings("unused") private void printMatrix(double[][][] matrix, String name) { System.out.println("MATRIX " + name); for (int i = 0; i < MSIZE; i++) { for (int j = 0; j < MSIZE; j++) { MatmulImpl.printBlock(matrix[i][j]); } System.out.println(""); } } }
[ "cramonco@9ab3861e-6c05-4e1b-b5ef-99af60850597" ]
cramonco@9ab3861e-6c05-4e1b-b5ef-99af60850597
737b769a540bf6979cc5fdfd4d96e271ba6ccf8f
69d720e74c8c5296cf823da69705825e0ac56973
/src/main/java/com/nadia/data/importers/excel/CombineToJson.java
cccc02d405b7b0bebbd62e84319a0a26e763349d
[]
no_license
ddolga/schooldata
df7f05f5c7d7185e3788a3085805558d00b5d9bd
28f5a54c5f0bb98c3289fd98ffca6ac62c421ea8
refs/heads/master
2020-04-06T06:56:35.597546
2016-08-15T23:44:00
2016-08-15T23:44:00
51,760,136
0
0
null
null
null
null
UTF-8
Java
false
false
3,181
java
package com.nadia.data.importers.excel; import com.nadia.data.api.CellProcessorInterface; import com.nadia.data.api.WorkbookProcessInterface; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.ss.usermodel.*; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.LinkedHashMap; import java.util.Map; public class CombineToJson implements WorkbookProcessInterface { Logger logger = LoggerFactory.getLogger(CombineToJson.class); private String[] readHeaderRow(Row row, CellProcessorInterface cellProcessor) { int size = row.getLastCellNum(); String[] fieldNames = new String[size]; for (int i = 0; i < size; i++) { Cell cell = row.getCell(i); String str = cellProcessor.processCell(cell); fieldNames[i] = str; } return fieldNames; } @Override public Workbook process(String inFileName, String outFileName, CellProcessorInterface cellProcessor,int limit) { String[] fieldNames = null; try { Workbook wb = WorkbookFactory.create(new File(inFileName)); logger.info("loaded: " + inFileName); JSONArray jsonArray = new JSONArray(); boolean isHeader = true; JSONObject line; int maxCol = 0; int rowCount = 0; boolean stop = false; for (Sheet sheet : wb) { for (Row row : sheet) { if (isHeader) { fieldNames = readHeaderRow(row, cellProcessor); maxCol = fieldNames.length; isHeader = false; } else { // line = new JSONObject(); Map map = new LinkedHashMap<String,String>(); boolean isEmpty = true; for (int i = 0; i < maxCol; i++) { Cell cell = row.getCell(i); String str = cellProcessor.processCell(cell); isEmpty = isEmpty && (str == null || str.isEmpty()); // line.put(fieldNames[i], str); map.put(fieldNames[i],str); } if (!isEmpty) { jsonArray.add(map); } rowCount++; if(limit > 0 && rowCount == limit){ stop = true; break; } } } if(stop) break; } wb.close(); FileWriter writer = new FileWriter(outFileName); jsonArray.writeJSONString(writer); writer.close(); return wb; } catch (IOException | InvalidFormatException e) { e.printStackTrace(); } return null; } }
[ "ddolgachev@omi.com" ]
ddolgachev@omi.com
45eb8c0c7b51e97261a00c6eaf06ad92d9e411a5
141141b446bec5af0963b8d5f15245cd0b8d7077
/Module2_Spring_Javacore_Database/blog_management/src/main/java/com/codegym/cms/model/Category.java
6724123e6e4c6336cd76b09c2fd27d516b481b7b
[]
no_license
ledinhquoc/LeDinhQuoc_CodeGymDaNang_C1119G1
41173126b8ef6524b85e581f32238544e7515db8
002d9359a1d4f474ad7e62d30c9eb29c8c6d71ce
refs/heads/master
2023-01-08T19:17:31.303670
2020-04-20T14:53:09
2020-04-20T14:53:09
223,861,203
0
0
null
2023-01-07T21:56:53
2019-11-25T04:31:12
CSS
UTF-8
Java
false
false
777
java
package com.codegym.cms.model; import javax.persistence.*; import java.util.List; @Entity @Table (name = "category") public class Category { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String name; @OneToMany(targetEntity = Post.class) private List<Post> postList; public Category() { } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Post> getPostList() { return postList; } public void setPostList(List<Post> postList) { this.postList = postList; } }
[ "elvisle93@gmail.com" ]
elvisle93@gmail.com
145fd86203d594623578a318af633f656afe7d85
68c1dd289d32853a8479d63d6f5bfec0ab22cbf1
/guns-film/src/main/java/com/stylefeng/guns/rest/modular/film/dao/CatDictRepository.java
cfe0951a9780fa2339752a65bd3514fbe5196eb7
[]
no_license
chenzhibin66/guns-film
e8bfc07eff2ae04439b5a5495cf6ead38c39aeaf
e41f7755283f87901cf646daa4b4bd23786d37f7
refs/heads/master
2022-12-10T15:01:34.604441
2020-05-10T14:32:14
2020-05-10T14:32:14
249,651,033
1
2
null
2022-12-06T00:45:19
2020-03-24T08:21:17
Java
UTF-8
Java
false
false
324
java
package com.stylefeng.guns.rest.modular.film.dao; import com.stylefeng.guns.rest.entity.CatDictDO; import com.baomidou.mybatisplus.mapper.BaseMapper; /** * <p> * 类型信息表 Mapper 接口 * </p> * * @author chenzhibin * @since 2020-03-31 */ public interface CatDictRepository extends BaseMapper<CatDictDO> { }
[ "calvinchen66@163.com" ]
calvinchen66@163.com
5ee65e1387c0a10ffed46131e5796d31037761c6
56d2ba474411e8add4286767c460f07077415b11
/amain/src/main/java/cn/itsite/amain/yicommunity/entity/bean/MainDeviceListBean.java
b387f32a7bcc15ee2eb2d07529c7de2e8dc4c341
[]
no_license
arjun512/YiCommunity3.0
d205759bbae64a1490747ac7a8fcb174a5bbd6de
0000c72efb143628bddab5939b734bdb81a5c3fd
refs/heads/master
2020-05-16T17:21:18.497970
2018-05-29T01:11:48
2018-05-29T01:11:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,615
java
package cn.itsite.amain.yicommunity.entity.bean; import java.io.Serializable; import java.util.List; import cn.itsite.abase.common.BaseBean; /** * Author: LiuJia on 2018/1/3 0003 15:36. * Email: liujia95me@126.com */ public class MainDeviceListBean extends BaseBean { private List<DataBean> data; public List<DataBean> getData() { return data; } public void setData(List<DataBean> data) { this.data = data; } public static class DataBean implements Serializable{ /** * defenseStatus : cancel * defenseStatusDes : 仅24小时模式的探测器处于防御状态,其他探测器处于未防御状态。 * fid : 08634f6c-8c39-4e79-9870-6fa14c4ff535 * isCurrent : 0 * isManager : 1 * isOnline : 0 * name : 网关 * no : G111EU6B1000754 * password : * residence : {"addr":"","addrDet":"","fid":"198d3131-2a76-42b5-8118-95ecd9369b71","name":""} * status : 0 */ private String defenseStatus; private String defenseStatusDes; private String fid; private int isCurrent; private int isManager; private int isOnline; private String name; private String no; private String password; private ResidenceBean residence; private int status; public String getDefenseStatus() { return defenseStatus; } public void setDefenseStatus(String defenseStatus) { this.defenseStatus = defenseStatus; } public String getDefenseStatusDes() { return defenseStatusDes; } public void setDefenseStatusDes(String defenseStatusDes) { this.defenseStatusDes = defenseStatusDes; } public String getFid() { return fid; } public void setFid(String fid) { this.fid = fid; } public int getIsCurrent() { return isCurrent; } public void setIsCurrent(int isCurrent) { this.isCurrent = isCurrent; } public int getIsManager() { return isManager; } public void setIsManager(int isManager) { this.isManager = isManager; } public int getIsOnline() { return isOnline; } public void setIsOnline(int isOnline) { this.isOnline = isOnline; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getNo() { return no; } public void setNo(String no) { this.no = no; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public ResidenceBean getResidence() { return residence; } public void setResidence(ResidenceBean residence) { this.residence = residence; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public static class ResidenceBean implements Serializable { /** * addr : * addrDet : * fid : 198d3131-2a76-42b5-8118-95ecd9369b71 * name : */ private String addr; private String addrDet; private String fid; private String name; public String getAddr() { return addr; } public void setAddr(String addr) { this.addr = addr; } public String getAddrDet() { return addrDet; } public void setAddrDet(String addrDet) { this.addrDet = addrDet; } public String getFid() { return fid; } public void setFid(String fid) { this.fid = fid; } public String getName() { return name; } public void setName(String name) { this.name = name; } } } }
[ "liujia@192.168.7.120" ]
liujia@192.168.7.120
17e85addd5230f43408491add1d4e97d1a53ad9b
74777ffa4616a589ca954fb83af747656ac26aee
/src/gaopei/Question155.java
0ebeae66347cbe2aab85a1890ea1e42f5ae90870
[]
no_license
gaoppp/LeetCode
84af767f43eb8aa46fdcf8dcd7c1add35bdad01f
2956dd0e03a33317a8f00cf17367614112613ea9
refs/heads/master
2023-01-02T11:21:45.166388
2020-11-02T14:30:54
2020-11-02T14:30:54
299,341,428
0
0
null
null
null
null
UTF-8
Java
false
false
1,426
java
package gaopei; import java.util.Stack; /** * 设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。 * <p> * push(x) —— 将元素 x 推入栈中。 * pop() —— 删除栈顶的元素。 * top() —— 获取栈顶元素。 * getMin() —— 检索栈中的最小元素。 */ public class Question155 { public static class MinStack { private Stack<Integer> data; private Stack<Integer> min; public MinStack() { data = new Stack<>(); min = new Stack<>(); } public void push(int x) { data.push(x); if (min.isEmpty() || x <= min.peek()) { min.push(x); } } public void pop() { if (data.pop().equals(min.peek())) { min.pop(); } } public int top() { return data.peek(); } public int getMin() { return min.peek(); } } public static void main(String[] args) { MinStack minStack = new MinStack(); minStack.push(-2); minStack.push(0); minStack.push(-2); System.out.println(minStack.getMin()); // --> 返回 -3. minStack.pop(); System.out.println(minStack.top()); // --> 返回 0. System.out.println(minStack.getMin()); // --> 返回 -2. } }
[ "pei.gao@qunarservers.com" ]
pei.gao@qunarservers.com
c944228f4d311b90eed3982c6d17229655197818
1490356148dd33654cf861c21a145dd7e63754d9
/src/main/java/com/JMS/JmsApplication.java
045f0f9a789d2140ba400c520e479b4e944dd5be
[]
no_license
ElviraHoward/JMS
9807d858f32bc402a1f287007e3dde3d1d79e7d0
ddba01ef5431c52e3085be3d89c64e2a2d6eec38
refs/heads/master
2020-03-16T01:22:05.721549
2018-06-04T09:28:02
2018-06-04T09:28:02
132,438,470
0
0
null
null
null
null
UTF-8
Java
false
false
6,995
java
package com.JMS; import com.JMS.jms.*; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.command.ActiveMQTopic; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter; import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter; import org.springframework.jms.annotation.EnableJms; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; import org.springframework.jms.config.JmsListenerContainerFactory; import org.springframework.jms.connection.CachingConnectionFactory; import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.listener.DefaultMessageListenerContainer; import org.springframework.jms.support.converter.MappingJackson2MessageConverter; import org.springframework.jms.support.converter.MessageConverter; import org.springframework.jms.support.converter.MessageType; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.JavaMailSenderImpl; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.view.xslt.XsltView; import org.springframework.web.servlet.view.xslt.XsltViewResolver; import javax.jms.ConnectionFactory; import javax.jms.Destination; import javax.validation.constraints.NotNull; import java.util.List; import java.util.Properties; @EnableJms @SpringBootApplication public class JmsApplication { @Bean public ViewResolver getXLTViewResolver() { final XsltViewResolver xsltViewResolver = new XsltViewResolver(); xsltViewResolver.setOrder(1); xsltViewResolver.setSourceKey("xmlSource"); xsltViewResolver.setViewClass(XsltView.class); xsltViewResolver.setViewNames("lists"); xsltViewResolver.setPrefix("/WEB-INF/xslt/"); xsltViewResolver.setSuffix(".xsl"); return xsltViewResolver; } @Bean public CustomObjectMapper customObjectMapper() { return new CustomObjectMapper(); } @Bean public MappingJackson2HttpMessageConverter customJackson2HttpMessageConverter() { return new MappingJackson2HttpMessageConverter(customObjectMapper()); } @Bean public JmsListenerContainerFactory<?> myFactory(ConnectionFactory connectionFactory, DefaultJmsListenerContainerFactoryConfigurer configurer) { DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); // This provides all boot's default to this factory, including the message converter configurer.configure(factory, connectionFactory); // You could still override some of Boot's default if necessary. return factory; } @Bean // Serialize message content to json using TextMessage public MessageConverter jacksonJmsMessageConverter() { MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter(); converter.setTargetType(MessageType.TEXT); converter.setTypeIdPropertyName("_type"); return converter; } @Bean public ActiveMQConnectionFactory amqConnectionFactory() { return new ActiveMQConnectionFactory("tcp://localhost:61616"); } @Bean public CachingConnectionFactory connectionFactory() { final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(amqConnectionFactory()); cachingConnectionFactory.setSessionCacheSize(10); return cachingConnectionFactory; } @Bean public ReceiveMessage getJmsDbMessageReceiver() { return new ReceiveMessage(); } @Bean public SMTPReceiver getJmsSMTPMessageReceiver() { return new SMTPReceiver(); } @Bean public ActiveMQTopic destination() { return new ActiveMQTopic("jms.topic"); } @NotNull private DefaultMessageListenerContainer getDefaultMessageListenerContainer(final ConnectionFactory connectionFactory, final Destination destination) { final DefaultMessageListenerContainer defaultMessageListenerContainer = new DefaultMessageListenerContainer(); defaultMessageListenerContainer.setConnectionFactory(connectionFactory); defaultMessageListenerContainer.setDestination(destination); return defaultMessageListenerContainer; } @Bean(name = "dbListenerContainer") @Autowired public DefaultMessageListenerContainer dbListenerContainer(final ConnectionFactory connectionFactory, final Destination destination) { final DefaultMessageListenerContainer defaultMessageListenerContainer = getDefaultMessageListenerContainer(connectionFactory, destination); defaultMessageListenerContainer.setMessageListener(getJmsDbMessageReceiver()); return defaultMessageListenerContainer; } @Bean(name = "emailListenerContainer") @Autowired public DefaultMessageListenerContainer emailListenerContainer(final ConnectionFactory connectionFactory, final Destination destination) { final DefaultMessageListenerContainer defaultMessageListenerContainer = getDefaultMessageListenerContainer(connectionFactory, destination); defaultMessageListenerContainer.setMessageListener(getJmsSMTPMessageReceiver()); return defaultMessageListenerContainer; } @Bean @Autowired public JmsTemplate jmsTemplate(final ConnectionFactory connectionFactory, final Destination destination) { final JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory); jmsTemplate.setDefaultDestination(destination); return jmsTemplate; } @Bean public JavaMailSender getJavaMailSender() { final JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); mailSender.setHost("smtp.gmail.com"); mailSender.setPort(587); mailSender.setUsername("elviravalo@gmail.com"); mailSender.setPassword("password"); final Properties props = mailSender.getJavaMailProperties(); props.put("mail.transport.protocol", "smtp"); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.debug", "true"); return mailSender; } @Bean public SimpleMailMessage templateChangesMessage() { final SimpleMailMessage message = new SimpleMailMessage(); message.setText("Hello! Due to your subscription to data changes, we notify you for it.\n%s\n"); return message; } @Bean public EmailService emailService() { return new EmailServiceImpl(); } @Bean public Sender messageSender() { return new Sender(); } public static void main(String[] args) { // Launch the application ConfigurableApplicationContext context = SpringApplication.run(JmsApplication.class, args); } }
[ "elviravalo@gmail.com" ]
elviravalo@gmail.com
362691b1a322ad3a6ba8f3a3f65e3225396c66a6
e578e1dd6f58db78a2c23c3e64ff0265b2fcfb8e
/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/s3guard/ITestS3GuardToolLocal.java
43cbe93330a757b08e3ff6fd31b084c3226be1cb
[ "LGPL-2.1-only", "LicenseRef-scancode-other-permissive", "EPL-1.0", "Classpath-exception-2.0", "CC-BY-3.0", "CC-BY-2.5", "GPL-2.0-only", "CC-PDDC", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-3-Clause", "GCC-exception-3.1", "CDDL-1.0", "MIT", "CDDL-1.1", "BSD-2-Clause-Views", "MPL-2.0", "AGPL-3.0-only", "LicenseRef-scancode-proprietary-license", "MPL-2.0-no-copyleft-exception", "LicenseRef-scancode-protobuf", "BSD-2-Clause", "LicenseRef-scancode-jdom", "LicenseRef-scancode-unknown-license-reference" ]
permissive
MSDS-ABLE/toposch
ca7c585f61738a262639bc07e27915b30b08221f
181977dae6953f8bca026cadd4722979e9ec0d43
refs/heads/master
2023-09-01T09:25:27.817000
2020-05-31T04:03:08
2020-05-31T04:03:08
267,599,209
5
0
Apache-2.0
2023-08-15T17:41:32
2020-05-28T13:35:50
Java
UTF-8
Java
false
false
8,497
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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.hadoop.fs.s3a.s3guard; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashSet; import java.util.Set; import java.util.concurrent.Callable; import org.junit.Test; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.s3a.S3AFileSystem; import org.apache.hadoop.fs.s3a.s3guard.S3GuardTool.Diff; import static org.apache.hadoop.fs.s3a.s3guard.S3GuardTool.*; import static org.apache.hadoop.test.LambdaTestUtils.intercept; /** * Test S3Guard related CLI commands against a LocalMetadataStore. */ public class ITestS3GuardToolLocal extends AbstractS3GuardToolTestBase { private static final String LOCAL_METADATA = "local://metadata"; @Override protected MetadataStore newMetadataStore() { return new LocalMetadataStore(); } @Test public void testImportCommand() throws Exception { S3AFileSystem fs = getFileSystem(); MetadataStore ms = getMetadataStore(); Path parent = path("test-import"); fs.mkdirs(parent); Path dir = new Path(parent, "a"); fs.mkdirs(dir); Path emptyDir = new Path(parent, "emptyDir"); fs.mkdirs(emptyDir); for (int i = 0; i < 10; i++) { String child = String.format("file-%d", i); try (FSDataOutputStream out = fs.create(new Path(dir, child))) { out.write(1); } } S3GuardTool.Import cmd = new S3GuardTool.Import(fs.getConf()); cmd.setStore(ms); exec(cmd, "import", parent.toString()); DirListingMetadata children = ms.listChildren(dir); assertEquals("Unexpected number of paths imported", 10, children .getListing().size()); assertEquals("Expected 2 items: empty directory and a parent directory", 2, ms.listChildren(parent).getListing().size()); // assertTrue(children.isAuthoritative()); } @Test public void testDiffCommand() throws Exception { S3AFileSystem fs = getFileSystem(); MetadataStore ms = getMetadataStore(); Set<Path> filesOnS3 = new HashSet<>(); // files on S3. Set<Path> filesOnMS = new HashSet<>(); // files on metadata store. Path testPath = path("test-diff"); mkdirs(testPath, true, true); Path msOnlyPath = new Path(testPath, "ms_only"); mkdirs(msOnlyPath, false, true); filesOnMS.add(msOnlyPath); for (int i = 0; i < 5; i++) { Path file = new Path(msOnlyPath, String.format("file-%d", i)); createFile(file, false, true); filesOnMS.add(file); } Path s3OnlyPath = new Path(testPath, "s3_only"); mkdirs(s3OnlyPath, true, false); filesOnS3.add(s3OnlyPath); for (int i = 0; i < 5; i++) { Path file = new Path(s3OnlyPath, String.format("file-%d", i)); createFile(file, true, false); filesOnS3.add(file); } ByteArrayOutputStream buf = new ByteArrayOutputStream(); Diff cmd = new Diff(fs.getConf()); cmd.setStore(ms); exec(cmd, buf, "diff", "-meta", LOCAL_METADATA, testPath.toString()); Set<Path> actualOnS3 = new HashSet<>(); Set<Path> actualOnMS = new HashSet<>(); boolean duplicates = false; try (BufferedReader reader = new BufferedReader(new InputStreamReader( new ByteArrayInputStream(buf.toByteArray())))) { String line; while ((line = reader.readLine()) != null) { String[] fields = line.split("\\s"); assertEquals("[" + line + "] does not have enough fields", 4, fields.length); String where = fields[0]; Path path = new Path(fields[3]); if (Diff.S3_PREFIX.equals(where)) { duplicates = duplicates || actualOnS3.contains(path); actualOnS3.add(path); } else if (Diff.MS_PREFIX.equals(where)) { duplicates = duplicates || actualOnMS.contains(path); actualOnMS.add(path); } else { fail("Unknown prefix: " + where); } } } String actualOut = buf.toString(); assertEquals("Mismatched metadata store outputs: " + actualOut, filesOnMS, actualOnMS); assertEquals("Mismatched s3 outputs: " + actualOut, filesOnS3, actualOnS3); assertFalse("Diff contained duplicates", duplicates); } @Test public void testDestroyBucketExistsButNoTable() throws Throwable { run(Destroy.NAME, "-meta", LOCAL_METADATA, getLandsatCSVFile()); } @Test public void testImportNoFilesystem() throws Throwable { final Import importer = new S3GuardTool.Import(getConfiguration()); importer.setStore(getMetadataStore()); intercept(IOException.class, new Callable<Integer>() { @Override public Integer call() throws Exception { return importer.run( new String[]{ "import", "-meta", LOCAL_METADATA, S3A_THIS_BUCKET_DOES_NOT_EXIST }); } }); } @Test public void testInfoBucketAndRegionNoFS() throws Throwable { intercept(FileNotFoundException.class, new Callable<Integer>() { @Override public Integer call() throws Exception { return run(BucketInfo.NAME, "-meta", LOCAL_METADATA, "-region", "any-region", S3A_THIS_BUCKET_DOES_NOT_EXIST); } }); } @Test public void testInitNegativeRead() throws Throwable { runToFailure(INVALID_ARGUMENT, Init.NAME, "-meta", LOCAL_METADATA, "-region", "eu-west-1", READ_FLAG, "-10"); } @Test public void testInit() throws Throwable { run(Init.NAME, "-meta", LOCAL_METADATA, "-region", "us-west-1"); } @Test public void testInitTwice() throws Throwable { run(Init.NAME, "-meta", LOCAL_METADATA, "-region", "us-west-1"); run(Init.NAME, "-meta", LOCAL_METADATA, "-region", "us-west-1"); } @Test public void testLandsatBucketUnguarded() throws Throwable { run(BucketInfo.NAME, "-" + BucketInfo.UNGUARDED_FLAG, getLandsatCSVFile()); } @Test public void testLandsatBucketRequireGuarded() throws Throwable { runToFailure(E_BAD_STATE, BucketInfo.NAME, "-" + BucketInfo.GUARDED_FLAG, ITestS3GuardToolLocal.this.getLandsatCSVFile()); } @Test public void testLandsatBucketRequireUnencrypted() throws Throwable { run(BucketInfo.NAME, "-" + BucketInfo.ENCRYPTION_FLAG, "none", getLandsatCSVFile()); } @Test public void testLandsatBucketRequireEncrypted() throws Throwable { runToFailure(E_BAD_STATE, BucketInfo.NAME, "-" + BucketInfo.ENCRYPTION_FLAG, "AES256", ITestS3GuardToolLocal.this.getLandsatCSVFile()); } @Test public void testStoreInfo() throws Throwable { S3GuardTool.BucketInfo cmd = new S3GuardTool.BucketInfo( getFileSystem().getConf()); cmd.setStore(getMetadataStore()); String output = exec(cmd, cmd.getName(), "-" + S3GuardTool.BucketInfo.GUARDED_FLAG, getFileSystem().getUri().toString()); LOG.info("Exec output=\n{}", output); } @Test public void testSetCapacity() throws Throwable { S3GuardTool cmd = new S3GuardTool.SetCapacity(getFileSystem().getConf()); cmd.setStore(getMetadataStore()); String output = exec(cmd, cmd.getName(), "-" + READ_FLAG, "100", "-" + WRITE_FLAG, "100", getFileSystem().getUri().toString()); LOG.info("Exec output=\n{}", output); } }
[ "zhujy@super01.ivic.org.cn" ]
zhujy@super01.ivic.org.cn
2094f9e8522261c5f569dff65e9478b1178b0df6
98d313cf373073d65f14b4870032e16e7d5466f0
/gradle-open-labs/example/src/main/java/se/molybden/Class7771.java
4a3a9d84d98b152cce8cf456c7e2bade056240e0
[]
no_license
Molybden/gradle-in-practice
30ac1477cc248a90c50949791028bc1cb7104b28
d7dcdecbb6d13d5b8f0ff4488740b64c3bbed5f3
refs/heads/master
2021-06-26T16:45:54.018388
2016-03-06T20:19:43
2016-03-06T20:19:43
24,554,562
0
0
null
null
null
null
UTF-8
Java
false
false
109
java
public class Class7771{ public void callMe(){ System.out.println("called"); } }
[ "jocce.nilsson@gmail.com" ]
jocce.nilsson@gmail.com
432a39cc744b1269879ce9d12159736bbae79ae4
8a4ad9f611b1067b3358fedb7b5b678d08a69502
/GraphTheory/tests/FloydWarshallSolverTest.java
acc371351f6d6e8a1e65536266189377125b8a79
[ "MIT" ]
permissive
mohdanishh/Algorithms
7686defb3e52589fa968492375c839dd1decdb66
f9ce60de1dcfdde41b39f411c5c2aa04ae0128ff
refs/heads/master
2021-04-26T23:20:39.146968
2018-03-02T05:12:30
2018-03-02T05:12:30
123,976,241
0
1
MIT
2018-03-05T20:42:46
2018-03-05T20:42:46
null
UTF-8
Java
false
false
6,852
java
import static com.google.common.truth.Truth.assertThat; import java.util.*; import org.junit.Before; import org.junit.Test; public class FloydWarshallSolverTest { static final double INF = Double.POSITIVE_INFINITY; static final double NEG_INF = Double.NEGATIVE_INFINITY; static double[][] matrix1, matrix2, matrix3; @Before public void setup() { matrix1 = new double[][] { { 0, INF, INF, INF, INF}, { 1, 0, 7, INF, INF}, {INF, 3, 0, INF, INF}, { 13, INF, 4, 0, INF}, {INF, INF, 3, 0, 0} }; matrix2 = new double[][] { { 0, 3, 1, 8, INF}, { 2, 0, 9, 4, INF}, {INF, INF, 0, INF, -2}, {INF, INF, 1, 0, INF}, {INF, INF, INF, 0, 0} }; matrix3 = new double[][] { { 0, 6, INF, 25, 3}, { 1, 0, 6, 1, 3}, { INF, 1, 0, 2, 3}, { 4, 4, 4, 0, INF}, { 4, 3, 5, INF, 0} }; } private static double[][] createMatrix(int n) { double[][] m = new double[n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { m[i][j] = Double.POSITIVE_INFINITY; m[i][i] = 0; } } return m; } private static void addRandomEdges(double[][] matrix, int count, boolean allowNegativeEdges) { int n = matrix.length; while(count-- > 0) { int i = (int)(Math.random() * n); int j = (int)(Math.random() * n); if (i == j) continue; int v = (int)(Math.random() * 100); // Allow negative edges but only very rarely since even one // negative edge can start an avalanche of negative cycles. if (allowNegativeEdges) v = (Math.random() > 0.005) ? v : -v; matrix[i][j] = v; } } @Test public void testDirectedGraph() { FloydWarshallSolver solver = new FloydWarshallSolver(matrix1); double[][] soln = solver.getApspMatrix(); assertThat(soln[0][0]).isEqualTo(0.0); assertThat(soln[1][0]).isEqualTo(1.0); assertThat(soln[1][1]).isEqualTo(0.0); assertThat(soln[1][2]).isEqualTo(7.0); assertThat(soln[2][0]).isEqualTo(4.0); assertThat(soln[2][1]).isEqualTo(3.0); assertThat(soln[2][2]).isEqualTo(0.0); assertThat(soln[3][0]).isEqualTo(8.0); assertThat(soln[3][1]).isEqualTo(7.0); assertThat(soln[3][2]).isEqualTo(4.0); assertThat(soln[3][3]).isEqualTo(0.0); assertThat(soln[4][0]).isEqualTo(7.0); assertThat(soln[4][1]).isEqualTo(6.0); assertThat(soln[4][2]).isEqualTo(3.0); assertThat(soln[4][3]).isEqualTo(0.0); assertThat(soln[4][4]).isEqualTo(0.0); } @Test public void testNegativeCycleGraph() { FloydWarshallSolver solver = new FloydWarshallSolver(matrix2); double[][] soln = solver.getApspMatrix(); assertThat(soln[0][0]).isEqualTo(0.0); assertThat(soln[0][1]).isEqualTo(3.0); assertThat(soln[0][2]).isEqualTo(NEG_INF); assertThat(soln[0][3]).isEqualTo(NEG_INF); assertThat(soln[0][4]).isEqualTo(NEG_INF); assertThat(soln[1][0]).isEqualTo(2.0); assertThat(soln[1][1]).isEqualTo(0.0); assertThat(soln[1][2]).isEqualTo(NEG_INF); assertThat(soln[1][3]).isEqualTo(NEG_INF); assertThat(soln[1][4]).isEqualTo(NEG_INF); assertThat(soln[2][2]).isEqualTo(NEG_INF); assertThat(soln[2][3]).isEqualTo(NEG_INF); assertThat(soln[2][4]).isEqualTo(NEG_INF); assertThat(soln[3][2]).isEqualTo(NEG_INF); assertThat(soln[3][3]).isEqualTo(NEG_INF); assertThat(soln[3][4]).isEqualTo(NEG_INF); assertThat(soln[4][2]).isEqualTo(NEG_INF); assertThat(soln[4][3]).isEqualTo(NEG_INF); assertThat(soln[4][4]).isEqualTo(NEG_INF); } @Test public void testApspAgainstBellmanFord_nonNegativeEdgeWeights() { final int TRAILS = 10; for (int n = 2; n <= 25; n++) { for (int trail = 1; trail <= TRAILS; trail++) { double[][] m = createMatrix(n); int numRandomEdges = Math.max(1, (int)(Math.random()*n*n)); addRandomEdges(m, numRandomEdges, false); double[][] fw = new FloydWarshallSolver(m).getApspMatrix(); for (int s = 0; s < n; s++) { double[] bf = new BellmanFordAdjacencyMatrix(s, m).getShortestPaths(); assertThat(bf).isEqualTo(fw[s]); } } } } @Test public void testApspAgainstBellmanFord_withNegativeEdgeWeights() { final int TRAILS = 10; for (int n = 2; n <= 25; n++) { for (int trail = 1; trail <= TRAILS; trail++) { double[][] m = createMatrix(n); int numRandomEdges = Math.max(1, (int)(Math.random()*n*n)); addRandomEdges(m, numRandomEdges, true); double[][] fw = new FloydWarshallSolver(m).getApspMatrix(); for (int s = 0; s < n; s++) { double[] bf = new BellmanFordAdjacencyMatrix(s, m).getShortestPaths(); assertThat(bf).isEqualTo(fw[s]); } } } } // Tests for a mismatch in how both algorithms detect the existence of // a negative cycle on the shortest path from s -> e. @Test public void testPathReconstructionBellmanFord_nonNegativeEdgeWeights() { final int TRAILS = 50; for (int n = 2; n <= 25; n++) { for (int trail = 1; trail <= TRAILS; trail++) { double[][] m = createMatrix(n); int numRandomEdges = Math.max(1, (int)(Math.random()*n*n)); addRandomEdges(m, numRandomEdges, true); FloydWarshallSolver fwSolver = new FloydWarshallSolver(m); fwSolver.solve(); for (int s = 0; s < n; s++) { BellmanFordAdjacencyMatrix bfSolver = new BellmanFordAdjacencyMatrix(s, m); for (int e = 0; e < n; e++) { // Make sure that if 'fwp' returns null that 'bfp' also returns null or // that if 'fwp' is not null that 'bfp' is also not null. List<Integer> fwp = fwSolver.reconstructShortestPath(s, e); List<Integer> bfp = bfSolver.reconstructShortestPath(e); if ((fwp == null) ^ (bfp == null)) { org.junit.Assert.fail("Mismatch."); } } } } } } @Test public void testSimpleNegativeCycleDetection() { int n = 3, s = 0, e = 2; double[][] m = createMatrix(n); m[0][1] = 100; m[0][2] = 5; m[1][2] = 0; m[1][1] = -1; // negative self loop. FloydWarshallSolver fw = new FloydWarshallSolver(m); List<Integer> fwPath = fw.reconstructShortestPath(s, e); assertThat(fwPath).isNull(); } @Test public void testNegativeCyclePropagation() { int n = 100, s = 0, e = n-1; double[][] m = createMatrix(n); for(int i = 1; i < n; i++) m[i-1][i] = 10; m[1][0] = -11; FloydWarshallSolver fw = new FloydWarshallSolver(m); List<Integer> fwPath = fw.reconstructShortestPath(s, e); assertThat(fwPath).isNull(); } }
[ "fisetwill@gmail.com" ]
fisetwill@gmail.com
f84c78606d5927c208cd0ab8121ee2ba7c03f4fa
cb5454f57111c5e6349072537de573ac23ca8cd8
/app/src/main/java/com/example/lee/finalproject/HelpInfo.java
48f3426af496a20bf2e9e1608d6999af537d031c
[]
no_license
praylee/FinalProject2
c2f2146c398b266a181b23e0c679214727c7fc1e
93b8d080514098a96deaff2bc0d4a88fa84bc83b
refs/heads/master
2020-03-25T07:19:17.748670
2018-08-04T18:26:36
2018-08-04T18:26:36
143,554,005
0
0
null
null
null
null
UTF-8
Java
false
false
314
java
package com.example.lee.finalproject; import android.os.Bundle; import android.app.Activity; public class HelpInfo extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_help_info); } }
[ "prayleee@gmail.com" ]
prayleee@gmail.com
2df0258378e9b5ccbeda2969ae3be71b3f98adfb
e9ab6bbc4c04b667b01351f6c68d1eafb30ee7b6
/Core/Common/FindElement.java
636ddc53baf9a52e006b8dce1f23707b63b126d8
[]
no_license
hunkbmt/autotest01
46e730c51828e0d5eac6300ad8a434eec072757b
d8bb115ed0d85a68f9ac40a463ef144e170ac18c
refs/heads/master
2023-06-02T11:11:38.995383
2021-06-17T14:54:16
2021-06-17T14:54:16
377,569,807
0
0
null
null
null
null
UTF-8
Java
false
false
654
java
package Common; import org.openqa.selenium.By; import org.openqa.selenium.support.How; public class FindElement { private How _type; private String _value; private By _by; public FindElement(How type, String value) { this._type = type; this._value = value; this._by = type.buildBy(value); } public How getType() { return _type; } public String getValue() { return _value; } public By setBy(By by) { return _by = by; } public By getBy() { return _by; } }
[ "vuphan9@gmail.com" ]
vuphan9@gmail.com
767718243ca2470722f6fd6984fe28491ba22b42
283c2daa0289407be992159e0352245aa7d71905
/src/main/java/edu/byu/cstaheli/cs478/toolkit/learner/LearnerData.java
1b471d2070befddeb941156a0d64c2851ee01dbc
[]
no_license
cache117/cs478-clustering
04a39af7391aa7f3ef65c275eb61d28cfbfd7017
bc5a2e8527f67b23322d277061b9e180a7f9e0f5
refs/heads/master
2021-06-14T10:14:34.982141
2017-04-05T03:07:48
2017-04-05T03:07:48
86,467,758
0
0
null
null
null
null
UTF-8
Java
false
false
1,013
java
package edu.byu.cstaheli.cs478.toolkit.learner; import edu.byu.cstaheli.cs478.toolkit.utility.ArgParser; import edu.byu.cstaheli.cs478.toolkit.utility.Matrix; import java.util.Random; /** * Created by cstaheli on 1/20/2017. */ public class LearnerData { private final Random rand; private final ArgParser parser; private final Matrix arffData; public LearnerData(Random rand, ArgParser parser, Matrix arffData) { this.rand = rand; this.parser = parser; this.arffData = arffData; } public Random getRandom() { return rand; } public Matrix getArffData() { return arffData; } public String getEvaluation() { return parser.getEvaluation(); } public String getEvalParameter() { return parser.getEvalParameter(); } public boolean isVerbose() { return parser.isVerbose(); } public boolean isNormalized() { return parser.isNormalized(); } }
[ "cache@byu.edu" ]
cache@byu.edu
4855a838662adbc66a13248945e08be6b1b9668b
92c3d8c1612e230f6459be042c33441a5cb22a42
/app/src/main/java/com/example/android/notes/DBHelper.java
53eb3ff192f7a105932811bbe60b691d6ba87c34
[]
no_license
Hoss3770/androidNotes
1c43d4aa47a28e34db7e66296cda1dde29f9551a
e8986cc3eb20b399528897ce37088c4ff772276f
refs/heads/master
2021-01-18T18:00:32.268491
2017-03-31T15:32:14
2017-03-31T15:32:14
86,834,427
1
0
null
null
null
null
UTF-8
Java
false
false
2,400
java
package com.example.android.notes; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.DatabaseUtils; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import java.util.ArrayList; import java.util.HashMap; public class DBHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME = "MyDBName.db"; public static final String NOTES_TABLE_NAME = "notes"; public static final String NOTES_COLUMN_ID = "id"; public static final String NOTES_COLUMN_TITLE = "title"; public static final String NOTES_COLUMN_TEXT = "text"; private HashMap hp; public DBHelper(Context context){ super(context,DATABASE_NAME,null,2); } @Override public void onCreate(SQLiteDatabase db){ db.execSQL("create table notes (id INTEGER PRIMARY KEY, title text,text text)"); } @Override public void onUpgrade(SQLiteDatabase db , int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS notes"); onCreate(db); } public boolean insertNote (String title, String text) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues note = new ContentValues(); note.put("title", title); note.put("text",text); db.insert("notes", null, note); return true; } public Cursor getData(int id) { SQLiteDatabase db = this.getReadableDatabase(); Cursor res = db.rawQuery("select * from notes where id = ? ", new String [] { Integer.toString(id)}); return res; } public int numberOfRows(){ SQLiteDatabase db = this.getReadableDatabase(); int numRows = (int) DatabaseUtils.queryNumEntries(db,NOTES_TABLE_NAME); return numRows; } public boolean updateNote(Integer id,String title,String text){ SQLiteDatabase db = this.getWritableDatabase(); ContentValues note = new ContentValues(); note.put("title",title); note.put("text",text); db.update("notes",note,"id = ?", new String [] {Integer.toString(id)}); return true; } public boolean deleteNote(Integer id){ SQLiteDatabase db = this.getReadableDatabase(); db.delete("notes","id = ?",new String []{Integer.toString(id)}); return true; } }
[ "hosskhalifa@gmail.com" ]
hosskhalifa@gmail.com
317aadfa4b1e5c82e30cd8b35c66239f3173afcb
5cefafafa516d374fd600caa54956a1de7e4ce7d
/oasis/web/OasisTags/src/java/dti/oasis/ows/util/impl/FilterViewElementDependencyImpl.java
c9cb2ef5a1b27ea4cb00c7e3f4069e11acf06e42
[]
no_license
TrellixVulnTeam/demo_L223
18c641c1d842c5c6a47e949595b5f507daa4aa55
87c9ece01ebdd918343ff0c119e9c462ad069a81
refs/heads/master
2023-03-16T00:32:08.023444
2019-04-08T15:46:48
2019-04-08T15:46:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,153
java
package dti.oasis.ows.util.impl; import dti.oasis.ows.util.FilterViewElement; import dti.oasis.ows.util.FilterViewElementDependency; import dti.oasis.util.LogUtils; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; /** * <p>(C) 2003 Delphi Technology, inc. (dti)</p> * Date: 4/19/2017 * * @author kshen */ /* * * Revision Date Revised By Description * --------------------------------------------------- * * --------------------------------------------------- */ public class FilterViewElementDependencyImpl implements FilterViewElementDependency { private final Logger l = LogUtils.getLogger(getClass()); public FilterViewElementDependencyImpl(String category) { m_category = category; m_elementDependencyMap = new HashMap<FilterViewElement, Set<FilterViewElement>>(); } @Override public Set<FilterViewElement> getDependencyElements(String filterType, String elementName) { if (l.isLoggable(Level.FINER)) { l.entering(getClass().getName(), "getDependencyElements", new Object[]{filterType, elementName}); } FilterViewElement filterViewElement = new FilterViewElement(filterType, elementName); Set<FilterViewElement> filterViewElements = m_elementDependencyMap.get(filterViewElement); if (l.isLoggable(Level.FINER)) { l.exiting(getClass().getName(), "getDependencyElements", filterViewElements); } return filterViewElements; } @Override public String getCategory() { return m_category; } public void setCategory(String category) { m_category = category; } public Map<FilterViewElement, Set<FilterViewElement>> getElementDependencyMap() { return m_elementDependencyMap; } public void setElementDependencyMap(Map<FilterViewElement, Set<FilterViewElement>> elementDependencyMap) { m_elementDependencyMap = elementDependencyMap; } private String m_category; private Map<FilterViewElement, Set<FilterViewElement>> m_elementDependencyMap; }
[ "athidevwork@gmail.com" ]
athidevwork@gmail.com
54dddb2f49df5c82507dc155cacaaa3be0b7e650
20a17d6f51d72c63b730d1ec3a57d93843381923
/src/hotel/exceptions/NotFoundException.java
96ebfd6522752f067aad89bd674e578334b37a86
[]
no_license
TanczaceKotki/hotel-manager
a3f10ae12b3e5486567e287b0da1170c17d222b0
c7035ab3f8f8b7cf0dad1db66119bf735df7f105
refs/heads/master
2021-01-10T15:10:32.828860
2015-12-14T11:13:03
2015-12-14T11:13:03
44,100,929
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package hotel.exceptions; public class NotFoundException extends Exception { public NotFoundException(String message) { super("Error: "+message); } }
[ "KZLukos@gmail.com" ]
KZLukos@gmail.com
af94486c53af20638e6f44f09daeef03584f9f7d
7b73756ba240202ea92f8f0c5c51c8343c0efa5f
/classes2/com/tencent/mobileqq/utils/kapalaiadapter/KapalaiAdapterUtil.java
ffd4d966011052d98021fd4a0d69c109c8d0f66f
[]
no_license
meeidol-luo/qooq
588a4ca6d8ad579b28dec66ec8084399fb0991ef
e723920ac555e99d5325b1d4024552383713c28d
refs/heads/master
2020-03-27T03:16:06.616300
2016-10-08T07:33:58
2016-10-08T07:33:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
23,929
java
package com.tencent.mobileqq.utils.kapalaiadapter; import android.app.Notification; import android.app.Notification.Builder; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.hardware.Camera; import android.hardware.Camera.Parameters; import android.os.Build; import android.os.Build.VERSION; import android.view.Window; import android.view.WindowManager.LayoutParams; import android.widget.EditText; import com.tencent.mobileqq.hotpatch.NotVerifyClass; import com.tencent.mobileqq.utils.kapalaiadapter.sdcardmountinforutil.SDCardMountInforUtil; import com.tencent.qphone.base.util.QLog; import com.tencent.util.VersionUtils; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import wea; public class KapalaiAdapterUtil { public int a; private DualSimManager a; private KapalaiAdapterUtil() { boolean bool = NotVerifyClass.DO_VERIFY_CLASS; this.jdField_a_of_type_ComTencentMobileqqUtilsKapalaiadapterDualSimManager = DualSimManager.a(); } public static KapalaiAdapterUtil a() { return wea.a; } private Camera b() { Object localObject2 = null; try { localObject1 = Camera.open(); Camera.Parameters localParameters; if ((localObject1 != null) && (localObject1 == null)) { break label57; } ((Camera)localObject1).release(); } catch (Exception localException1) { try { localParameters = ((Camera)localObject1).getParameters(); if (localParameters != null) { localParameters.set("video_input", "secondary"); ((Camera)localObject1).setParameters(localParameters); } return (Camera)localObject1; } catch (Exception localException2) { for (;;) { Object localObject1; } } localException1 = localException1; localObject1 = null; } localObject1 = localObject2; localException1.printStackTrace(); return (Camera)localObject1; } private Camera c() { Object localObject2 = null; try { localObject1 = Camera.open(); Camera.Parameters localParameters; if ((localObject1 != null) && (localObject1 == null)) { break label57; } ((Camera)localObject1).release(); } catch (Exception localException1) { try { localParameters = ((Camera)localObject1).getParameters(); if (localParameters != null) { localParameters.set("device", "/dev/video1"); ((Camera)localObject1).setParameters(localParameters); } return (Camera)localObject1; } catch (Exception localException2) { for (;;) { Object localObject1; } } localException1 = localException1; localObject1 = null; } localObject1 = localObject2; localException1.printStackTrace(); return (Camera)localObject1; } private Camera d() { Object localObject2 = null; try { localObject1 = Camera.open(); Method localMethod; if ((localObject1 != null) && (localObject1 == null)) { break label76; } ((Camera)localObject1).release(); } catch (Exception localException1) { try { localMethod = localObject1.getClass().getMethod("setSensorID", new Class[] { Integer.TYPE }); if (localMethod != null) { localMethod.invoke(localObject1, new Object[] { Integer.valueOf(1) }); } return (Camera)localObject1; } catch (Exception localException2) { for (;;) { Object localObject1; } } localException1 = localException1; localObject1 = null; } localObject1 = localObject2; localException1.printStackTrace(); return (Camera)localObject1; } private Camera e() { Camera localCamera = null; try { Class localClass = Class.forName("android.hardware.Camera"); Method localMethod = localClass.getMethod("setCurrentCamera", new Class[] { Integer.TYPE }); if (localMethod != null) { localMethod.invoke(localClass, new Object[] { Integer.valueOf(1) }); localCamera = Camera.open(); } return localCamera; } catch (Exception localException) { if (0 != 0) { throw new NullPointerException(); } localException.printStackTrace(); } return null; } private Camera f() { Camera localCamera = null; try { if (VersionUtils.c()) { localCamera = Camera.open(); } return localCamera; } catch (Exception localException) { if (0 != 0) { throw new NullPointerException(); } localException.printStackTrace(); } return null; } public int a() { return this.jdField_a_of_type_Int; } public Notification a(Context paramContext, int paramInt) { for (;;) { try { if (Build.VERSION.SDK_INT < 11) { paramContext = new Notification(paramInt, null, System.currentTimeMillis()); localObject = paramContext; if (paramContext == null) { localObject = new Notification(paramInt, null, System.currentTimeMillis()); } return (Notification)localObject; } paramContext = new Notification.Builder(paramContext); Object localObject = Class.forName("android.app.Notification$Builder").getDeclaredMethod("setInternalApp", new Class[] { Integer.TYPE }); if (localObject != null) { ((Method)localObject).invoke(paramContext, new Object[] { Integer.valueOf(1) }); if (Build.VERSION.SDK_INT >= 16) { paramContext = paramContext.build(); continue; } if ((Build.VERSION.SDK_INT < 16) && (Build.VERSION.SDK_INT >= 11)) { paramContext = paramContext.getNotification(); continue; return null; } } } catch (Exception paramContext) { if (QLog.isColorLevel()) { QLog.e("newNotificationForMeizu", 2, paramContext.getMessage()); } if (0 == 0) { return new Notification(paramInt, null, System.currentTimeMillis()); } } finally { if (0 == 0) { new Notification(paramInt, null, System.currentTimeMillis()); } } paramContext = null; } } /* Error */ public Notification a(Intent paramIntent, Bitmap paramBitmap, String paramString1, String paramString2, String paramString3, boolean paramBoolean, com.tencent.mobileqq.app.QQAppInterface paramQQAppInterface) { // Byte code: // 0: aload 7 // 2: invokevirtual 176 com/tencent/mobileqq/app/QQAppInterface:b ()Z // 5: istore 12 // 7: invokestatic 182 com/tencent/qphone/base/util/BaseApplication:getContext ()Lcom/tencent/qphone/base/util/BaseApplication; // 10: iconst_0 // 11: aload_1 // 12: ldc -73 // 14: invokestatic 189 android/app/PendingIntent:getActivity (Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent; // 17: astore 8 // 19: invokestatic 162 com/tencent/qphone/base/util/QLog:isColorLevel ()Z // 22: ifeq +29 -> 51 // 25: ldc -65 // 27: iconst_2 // 28: new 193 java/lang/StringBuilder // 31: dup // 32: invokespecial 194 java/lang/StringBuilder:<init> ()V // 35: ldc -60 // 37: invokevirtual 200 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; // 40: aload 8 // 42: invokevirtual 203 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder; // 45: invokevirtual 206 java/lang/StringBuilder:toString ()Ljava/lang/String; // 48: invokestatic 209 com/tencent/qphone/base/util/QLog:i (Ljava/lang/String;ILjava/lang/String;)V // 51: ldc -46 // 53: istore 11 // 55: aload_1 // 56: ldc -44 // 58: iconst_m1 // 59: invokevirtual 218 android/content/Intent:getIntExtra (Ljava/lang/String;I)I // 62: sipush 1008 // 65: if_icmpne +151 -> 216 // 68: getstatic 224 com/tencent/mobileqq/app/AppConstants:ae Ljava/lang/String; // 71: aload_1 // 72: ldc -30 // 74: invokevirtual 230 android/content/Intent:getStringExtra (Ljava/lang/String;)Ljava/lang/String; // 77: invokevirtual 236 java/lang/String:equals (Ljava/lang/Object;)Z // 80: ifeq +128 -> 208 // 83: iload 11 // 85: istore 10 // 87: aload_1 // 88: ldc -18 // 90: iconst_0 // 91: invokevirtual 242 android/content/Intent:getBooleanExtra (Ljava/lang/String;Z)Z // 94: ifeq +7 -> 101 // 97: ldc -13 // 99: istore 10 // 101: getstatic 127 android/os/Build$VERSION:SDK_INT I // 104: bipush 11 // 106: if_icmpge +196 -> 302 // 109: new 129 android/app/Notification // 112: dup // 113: iload 10 // 115: aload_3 // 116: invokestatic 135 java/lang/System:currentTimeMillis ()J // 119: invokespecial 138 android/app/Notification:<init> (ILjava/lang/CharSequence;J)V // 122: astore_1 // 123: aload_1 // 124: aload 8 // 126: putfield 247 android/app/Notification:contentIntent Landroid/app/PendingIntent; // 129: iload 12 // 131: ifeq +24 -> 155 // 134: aload_1 // 135: aload_1 // 136: getfield 250 android/app/Notification:flags I // 139: bipush 32 // 141: ior // 142: putfield 250 android/app/Notification:flags I // 145: aload_1 // 146: aload_1 // 147: getfield 250 android/app/Notification:flags I // 150: iconst_2 // 151: ior // 152: putfield 250 android/app/Notification:flags I // 155: invokestatic 182 com/tencent/qphone/base/util/BaseApplication:getContext ()Lcom/tencent/qphone/base/util/BaseApplication; // 158: aload 7 // 160: invokestatic 255 com/tencent/mobileqq/util/NotifyLightUtil:a (Landroid/content/Context;Lcom/tencent/common/app/AppInterface;)Z // 163: ifeq +43 -> 206 // 166: invokestatic 261 java/util/Calendar:getInstance ()Ljava/util/Calendar; // 169: bipush 11 // 171: invokevirtual 265 java/util/Calendar:get (I)I // 174: pop // 175: aload_1 // 176: aload_1 // 177: getfield 250 android/app/Notification:flags I // 180: iconst_1 // 181: ior // 182: putfield 250 android/app/Notification:flags I // 185: aload_1 // 186: ldc_w 266 // 189: putfield 269 android/app/Notification:ledARGB I // 192: aload_1 // 193: sipush 2000 // 196: putfield 272 android/app/Notification:ledOffMS I // 199: aload_1 // 200: sipush 2000 // 203: putfield 275 android/app/Notification:ledOnMS I // 206: aload_1 // 207: areturn // 208: ldc_w 276 // 211: istore 10 // 213: goto -126 -> 87 // 216: aload_1 // 217: ldc -44 // 219: iconst_m1 // 220: invokevirtual 218 android/content/Intent:getIntExtra (Ljava/lang/String;I)I // 223: sipush 1010 // 226: if_icmpne +29 -> 255 // 229: getstatic 279 com/tencent/mobileqq/app/AppConstants:aH Ljava/lang/String; // 232: invokestatic 282 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String; // 235: aload_1 // 236: ldc -30 // 238: invokevirtual 230 android/content/Intent:getStringExtra (Ljava/lang/String;)Ljava/lang/String; // 241: invokevirtual 236 java/lang/String:equals (Ljava/lang/Object;)Z // 244: ifeq +11 -> 255 // 247: ldc_w 283 // 250: istore 10 // 252: goto -165 -> 87 // 255: iload 11 // 257: istore 10 // 259: aload_1 // 260: ldc -44 // 262: iconst_m1 // 263: invokevirtual 218 android/content/Intent:getIntExtra (Ljava/lang/String;I)I // 266: sipush 1001 // 269: if_icmpne -182 -> 87 // 272: iload 11 // 274: istore 10 // 276: getstatic 286 com/tencent/mobileqq/app/AppConstants:ar Ljava/lang/String; // 279: invokestatic 282 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String; // 282: aload_1 // 283: ldc -30 // 285: invokevirtual 230 android/content/Intent:getStringExtra (Ljava/lang/String;)Ljava/lang/String; // 288: invokevirtual 236 java/lang/String:equals (Ljava/lang/Object;)Z // 291: ifeq -204 -> 87 // 294: ldc_w 287 // 297: istore 10 // 299: goto -212 -> 87 // 302: new 140 android/app/Notification$Builder // 305: dup // 306: invokestatic 182 com/tencent/qphone/base/util/BaseApplication:getContext ()Lcom/tencent/qphone/base/util/BaseApplication; // 309: invokespecial 143 android/app/Notification$Builder:<init> (Landroid/content/Context;)V // 312: iload 10 // 314: invokevirtual 291 android/app/Notification$Builder:setSmallIcon (I)Landroid/app/Notification$Builder; // 317: iconst_1 // 318: invokevirtual 295 android/app/Notification$Builder:setAutoCancel (Z)Landroid/app/Notification$Builder; // 321: invokestatic 135 java/lang/System:currentTimeMillis ()J // 324: invokevirtual 299 android/app/Notification$Builder:setWhen (J)Landroid/app/Notification$Builder; // 327: aload_3 // 328: invokevirtual 303 android/app/Notification$Builder:setTicker (Ljava/lang/CharSequence;)Landroid/app/Notification$Builder; // 331: astore_1 // 332: iload 12 // 334: ifeq +9 -> 343 // 337: aload_1 // 338: iconst_1 // 339: invokevirtual 306 android/app/Notification$Builder:setOngoing (Z)Landroid/app/Notification$Builder; // 342: pop // 343: ldc -111 // 345: invokestatic 107 java/lang/Class:forName (Ljava/lang/String;)Ljava/lang/Class; // 348: ldc -109 // 350: iconst_1 // 351: anewarray 80 java/lang/Class // 354: dup // 355: iconst_0 // 356: getstatic 86 java/lang/Integer:TYPE Ljava/lang/Class; // 359: aastore // 360: invokevirtual 150 java/lang/Class:getDeclaredMethod (Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; // 363: astore 9 // 365: aload 9 // 367: ifnull +21 -> 388 // 370: aload 9 // 372: aload_1 // 373: iconst_1 // 374: anewarray 4 java/lang/Object // 377: dup // 378: iconst_0 // 379: iconst_1 // 380: invokestatic 94 java/lang/Integer:valueOf (I)Ljava/lang/Integer; // 383: aastore // 384: invokevirtual 100 java/lang/reflect/Method:invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; // 387: pop // 388: invokestatic 182 com/tencent/qphone/base/util/BaseApplication:getContext ()Lcom/tencent/qphone/base/util/BaseApplication; // 391: aload 7 // 393: invokestatic 255 com/tencent/mobileqq/util/NotifyLightUtil:a (Landroid/content/Context;Lcom/tencent/common/app/AppInterface;)Z // 396: ifeq +26 -> 422 // 399: invokestatic 261 java/util/Calendar:getInstance ()Ljava/util/Calendar; // 402: bipush 11 // 404: invokevirtual 265 java/util/Calendar:get (I)I // 407: pop // 408: aload_1 // 409: ldc_w 266 // 412: sipush 2000 // 415: sipush 2000 // 418: invokevirtual 310 android/app/Notification$Builder:setLights (III)Landroid/app/Notification$Builder; // 421: pop // 422: iload 6 // 424: ifeq +55 -> 479 // 427: aload_2 // 428: ifnull +9 -> 437 // 431: aload_1 // 432: aload_2 // 433: invokevirtual 314 android/app/Notification$Builder:setLargeIcon (Landroid/graphics/Bitmap;)Landroid/app/Notification$Builder; // 436: pop // 437: aload_1 // 438: aload 4 // 440: invokevirtual 317 android/app/Notification$Builder:setContentTitle (Ljava/lang/CharSequence;)Landroid/app/Notification$Builder; // 443: aload 5 // 445: invokevirtual 320 android/app/Notification$Builder:setContentText (Ljava/lang/CharSequence;)Landroid/app/Notification$Builder; // 448: aload 8 // 450: invokevirtual 324 android/app/Notification$Builder:setContentIntent (Landroid/app/PendingIntent;)Landroid/app/Notification$Builder; // 453: pop // 454: getstatic 127 android/os/Build$VERSION:SDK_INT I // 457: bipush 16 // 459: if_icmplt +50 -> 509 // 462: aload_1 // 463: invokevirtual 154 android/app/Notification$Builder:build ()Landroid/app/Notification; // 466: astore_1 // 467: aload_1 // 468: areturn // 469: astore 9 // 471: aload 9 // 473: invokevirtual 66 java/lang/Exception:printStackTrace ()V // 476: goto -88 -> 388 // 479: aload_1 // 480: aload 4 // 482: invokevirtual 317 android/app/Notification$Builder:setContentTitle (Ljava/lang/CharSequence;)Landroid/app/Notification$Builder; // 485: aload 5 // 487: invokevirtual 320 android/app/Notification$Builder:setContentText (Ljava/lang/CharSequence;)Landroid/app/Notification$Builder; // 490: aload 8 // 492: invokevirtual 324 android/app/Notification$Builder:setContentIntent (Landroid/app/PendingIntent;)Landroid/app/Notification$Builder; // 495: pop // 496: aload_2 // 497: ifnull -43 -> 454 // 500: aload_1 // 501: aload_2 // 502: invokevirtual 314 android/app/Notification$Builder:setLargeIcon (Landroid/graphics/Bitmap;)Landroid/app/Notification$Builder; // 505: pop // 506: goto -52 -> 454 // 509: getstatic 127 android/os/Build$VERSION:SDK_INT I // 512: bipush 16 // 514: if_icmpge +16 -> 530 // 517: getstatic 127 android/os/Build$VERSION:SDK_INT I // 520: bipush 11 // 522: if_icmplt +8 -> 530 // 525: aload_1 // 526: invokevirtual 157 android/app/Notification$Builder:getNotification ()Landroid/app/Notification; // 529: areturn // 530: new 129 android/app/Notification // 533: dup // 534: iload 10 // 536: aload_3 // 537: invokestatic 135 java/lang/System:currentTimeMillis ()J // 540: invokespecial 138 android/app/Notification:<init> (ILjava/lang/CharSequence;J)V // 543: astore_1 // 544: aload_1 // 545: areturn // 546: astore_1 // 547: invokestatic 162 com/tencent/qphone/base/util/QLog:isColorLevel ()Z // 550: ifeq +14 -> 564 // 553: ldc_w 326 // 556: iconst_2 // 557: aload_1 // 558: invokevirtual 168 java/lang/Exception:getMessage ()Ljava/lang/String; // 561: invokestatic 171 com/tencent/qphone/base/util/QLog:e (Ljava/lang/String;ILjava/lang/String;)V // 564: new 129 android/app/Notification // 567: dup // 568: iload 10 // 570: aload_3 // 571: invokestatic 135 java/lang/System:currentTimeMillis ()J // 574: invokespecial 138 android/app/Notification:<init> (ILjava/lang/CharSequence;J)V // 577: areturn // Local variable table: // start length slot name signature // 0 578 0 this KapalaiAdapterUtil // 0 578 1 paramIntent Intent // 0 578 2 paramBitmap Bitmap // 0 578 3 paramString1 String // 0 578 4 paramString2 String // 0 578 5 paramString3 String // 0 578 6 paramBoolean boolean // 0 578 7 paramQQAppInterface com.tencent.mobileqq.app.QQAppInterface // 17 474 8 localPendingIntent android.app.PendingIntent // 363 8 9 localMethod Method // 469 3 9 localException Exception // 85 484 10 i int // 53 220 11 j int // 5 328 12 bool boolean // Exception table: // from to target type // 343 365 469 java/lang/Exception // 370 388 469 java/lang/Exception // 454 467 546 java/lang/Exception // 509 530 546 java/lang/Exception // 530 544 546 java/lang/Exception } public Intent a(Intent paramIntent) { paramIntent.putExtra(a(), Integer.parseInt(c())); return null; } public Bitmap a(Bitmap paramBitmap, int paramInt) { if (paramBitmap != null) { return Bitmap.createScaledBitmap(paramBitmap, paramInt, paramInt, true); } return null; } public Camera a() { Camera localCamera = null; if (Build.MANUFACTURER.equalsIgnoreCase("HTC")) { localCamera = b(); } do { return localCamera; if (Build.MANUFACTURER.equalsIgnoreCase("YuLong")) { return c(); } if (Build.MANUFACTURER.equalsIgnoreCase("HISENSE")) { return d(); } if (Build.MANUFACTURER.equalsIgnoreCase("HUAWEI")) { return e(); } } while (!Build.MANUFACTURER.equalsIgnoreCase("LENOVO")); return f(); } public String a() { return DualSimManager.a; } public String a(Camera.Parameters paramParameters) { String str = "off"; List localList = paramParameters.getSupportedFlashModes(); if (localList.contains("torch")) { paramParameters = "torch"; } do { return paramParameters; if (localList.contains("on")) { return "on"; } paramParameters = str; } while (!localList.contains("auto")); return "auto"; } public ArrayList a(Context paramContext) { ArrayList localArrayList1 = b(paramContext); if ((localArrayList1 == null) || (localArrayList1.size() < 1)) { return null; } ArrayList localArrayList2 = new ArrayList(); int i = 0; while (i < localArrayList1.size()) { String str = (String)localArrayList1.get(i); if (SDCardMountInforUtil.a(paramContext).a(str)) { localArrayList2.add(str); } i += 1; } return localArrayList2; } public void a(int paramInt) { this.jdField_a_of_type_Int = paramInt; } public void a(Intent paramIntent) { paramIntent.setFlags(337641472); } public void a(Window paramWindow) { paramWindow.setType(2004); } public void a(WindowManager.LayoutParams paramLayoutParams) { paramLayoutParams.screenBrightness = 0.035F; } public void a(EditText paramEditText) { if (paramEditText != null) { paramEditText.setSelection(this.jdField_a_of_type_Int); } } public boolean a() { return (!this.jdField_a_of_type_ComTencentMobileqqUtilsKapalaiadapterDualSimManager.a(0)) && (this.jdField_a_of_type_ComTencentMobileqqUtilsKapalaiadapterDualSimManager.a(1)); } public boolean a(int paramInt, String paramString1, String paramString2, ArrayList paramArrayList1, ArrayList paramArrayList2, ArrayList paramArrayList3) { return DualSimManager.a().a(paramInt, paramString1, paramString2, paramArrayList1, paramArrayList2, paramArrayList3); } public boolean a(Context paramContext, String paramString) { return SDCardMountInforUtil.a(paramContext).a(paramString); } public boolean a(Camera.Parameters paramParameters, Context paramContext) { return (paramParameters.getSupportedFlashModes() != null) && (paramContext.getPackageManager().hasSystemFeature("android.hardware.camera.flash")) && (paramParameters.getSupportedFlashModes().size() > 1); } public int b() { return 1; } public String b() { return DualSimManager.b; } public ArrayList b(Context paramContext) { return SDCardMountInforUtil.a(paramContext).a(); } public void b(Window paramWindow) { paramWindow.setType(2); } public String c() { return DualSimManager.c; } } /* Location: E:\apk\QQ_91\classes2-dex2jar.jar!\com\tencent\mobileqq\utils\kapalaiadapter\KapalaiAdapterUtil.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
18a2c47efb6e8eb598fce49debf04d36f0426641
af7345ca23f77ab44018d888fc2ebe554ff3e5b0
/Exam 2/src/Q4SnippetProblem.java
91ab6c7f968afa04950ae58833b42b69c15e3e95
[]
no_license
cbussen7/CPS150
10b9842869f4701f3fada611d8934fc05c2db372
00ddb70d9af3d2e0f787050623ba11d6479a18a2
refs/heads/main
2023-08-17T03:34:17.326603
2021-06-23T14:04:38
2021-06-23T14:04:38
379,623,434
0
0
null
null
null
null
UTF-8
Java
false
false
235
java
public class Q4SnippetProblem { public static void main(String [] args){ System.out.println("The value is: " + val()); } public static String val(){ String result = "candy"; return result; } }
[ "cbussen7@gmail.com" ]
cbussen7@gmail.com
327ffbfcae2c325dbad4de3f5a945b12c2c2c8e3
ca0fabe6f1f48281951796e715329d9e87c0ff8c
/com.icteam.loyalty.ui/src/com/icteam/loyalty/ui/control/NToM.java
75fc258970267cdbaa609f2f79e06e0ede9be69a
[]
no_license
Danipiario/com.icteam.loyalty
11ed58d3764798528c6949f51c3babaea087438f
f2bb4fb0e01552b336bcf860dd111862d8727316
refs/heads/master
2020-04-12T06:43:13.519169
2016-10-01T19:52:05
2016-10-01T19:52:05
60,277,192
0
0
null
null
null
null
UTF-8
Java
false
false
23,123
java
package com.icteam.loyalty.ui.control; import java.util.List; import org.eclipse.core.databinding.Binding; import org.eclipse.core.databinding.DataBindingContext; import org.eclipse.core.databinding.UpdateValueStrategy; import org.eclipse.core.databinding.beans.BeanProperties; import org.eclipse.core.databinding.beans.BeansObservables; import org.eclipse.core.databinding.beans.PojoObservables; import org.eclipse.core.databinding.beans.PojoProperties; import org.eclipse.core.databinding.observable.list.IObservableList; import org.eclipse.core.databinding.observable.map.IObservableMap; import org.eclipse.core.databinding.observable.value.IObservableValue; import org.eclipse.core.databinding.property.Properties; import org.eclipse.core.internal.databinding.BindingStatus; import org.eclipse.jface.databinding.swt.WidgetProperties; import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; import org.eclipse.jface.databinding.viewers.ViewerProperties; import org.eclipse.jface.internal.databinding.swt.WidgetGroupTextProperty; import org.eclipse.jface.viewers.IOpenListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.OpenEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.rap.rwt.RWT; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import com.icteam.loyalty.api.Messages; import com.icteam.loyalty.model.DtoListModel; import com.icteam.loyalty.model.DtoModel; import com.icteam.loyalty.model.interfaces.IDtoModel; import com.icteam.loyalty.model.interfaces.IModel; import com.icteam.loyalty.model.template.AbstractTemplate; import com.icteam.loyalty.ui.converter.ConvertableObservableMapLabelProvider; import com.icteam.loyalty.ui.converter.ObjectToBooleanConverter; import com.icteam.loyalty.ui.converter.TableInputToBooleanConverter; import com.icteam.loyalty.ui.interfaces.IBindedControl; import com.icteam.loyalty.ui.interfaces.IData; import com.icteam.loyalty.ui.interfaces.IModelProvider; import com.icteam.loyalty.ui.listener.DefaultSortSelectionListener; import com.icteam.loyalty.ui.listener.MapChangeListener; import com.icteam.loyalty.ui.model.NToMModel; import com.icteam.loyalty.ui.util.BinderUtils; import com.icteam.loyalty.ui.util.ControlUtils; import com.icteam.loyalty.ui.util.PropertyViewerComparator; import com.icteam.loyalty.ui.validator.RequiredListValidator; public class NToM<M extends IModel, S extends Object> extends Composite implements IBindedControl, IModelProvider<M, List<S>, NToMModel<M, S>> { private static final long serialVersionUID = -8536935429447636321L; enum Direction { TO_SRC, TO_DEST, ALL_TO_SRC, ALL_TO_DEST; } private DataBindingContext bindingContext; private NToMModel<M, S> modelProperty; private final TableViewer tableViewerSrc; private final TableViewer tableViewerDest; private final Button cmdAllToSrc; private final Button cmdToSrc; private final Button cmdToDest; private final Button cmdAllToDest; private Binding allSrcBinding; private Binding allDestBinding; private Binding srcBinding; private Binding destBinding; private final Group grpMain; private final Label lblDest; private RequiredListValidator<M, S> multiValidator; private final Label lblValidator; private final Label lblSrc; public NToM(Composite parent, int style) { super(parent, style | SWT.NO_FOCUS); setLayout(new GridLayout()); grpMain = new Group(this, SWT.NONE); grpMain.setLayout(new FormLayout()); grpMain.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 0, 0)); Composite controlArea = new Composite(grpMain, SWT.NONE); GridLayout gl_controlArea = new GridLayout(4, true); gl_controlArea.horizontalSpacing = 0; gl_controlArea.verticalSpacing = 0; gl_controlArea.marginWidth = 0; gl_controlArea.marginHeight = 0; controlArea.setLayout(gl_controlArea); FormData fd_controlArea = new FormData(); fd_controlArea.left = new FormAttachment(20); fd_controlArea.right = new FormAttachment(80); fd_controlArea.top = new FormAttachment(0); controlArea.setLayoutData(fd_controlArea); Composite composite = new Composite(controlArea, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); RowLayout rl_composite = new RowLayout(SWT.HORIZONTAL); rl_composite.wrap = false; rl_composite.pack = false; rl_composite.spacing = 0; rl_composite.marginTop = 0; rl_composite.marginRight = 0; rl_composite.marginLeft = 0; rl_composite.marginBottom = 0; rl_composite.justify = true; composite.setLayout(rl_composite); cmdAllToSrc = new Button(composite, SWT.NONE); cmdAllToSrc.setText("<<"); cmdAllToSrc.addSelectionListener(new SelectionAdapter() { private static final long serialVersionUID = 1L; @Override public void widgetSelected(SelectionEvent e) { moveElement(Direction.ALL_TO_SRC); } }); Composite composite_1 = new Composite(controlArea, SWT.NONE); composite_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); RowLayout rl_composite_1 = new RowLayout(SWT.HORIZONTAL); rl_composite_1.wrap = false; rl_composite_1.marginBottom = 0; rl_composite_1.marginLeft = 0; rl_composite_1.marginRight = 0; rl_composite_1.marginTop = 0; rl_composite_1.spacing = 0; rl_composite_1.pack = false; rl_composite_1.justify = true; composite_1.setLayout(rl_composite_1); cmdToSrc = new Button(composite_1, SWT.NONE); cmdToSrc.addSelectionListener(new SelectionAdapter() { private static final long serialVersionUID = 1L; @Override public void widgetSelected(SelectionEvent e) { moveElement(Direction.TO_SRC); } }); cmdToSrc.setText("<"); Composite composite_2 = new Composite(controlArea, SWT.NONE); composite_2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); RowLayout rl_composite_2 = new RowLayout(SWT.HORIZONTAL); rl_composite_2.marginBottom = 0; rl_composite_2.marginLeft = 0; rl_composite_2.marginRight = 0; rl_composite_2.marginTop = 0; rl_composite_2.pack = false; rl_composite_2.spacing = 0; rl_composite_2.wrap = false; rl_composite_2.justify = true; composite_2.setLayout(rl_composite_2); cmdToDest = new Button(composite_2, SWT.NONE); cmdToDest.setSize(20, 25); cmdToDest.setText(">"); cmdToDest.addSelectionListener(new SelectionAdapter() { private static final long serialVersionUID = 1L; @Override public void widgetSelected(SelectionEvent e) { moveElement(Direction.TO_DEST); } }); Composite composite_3 = new Composite(controlArea, SWT.NONE); composite_3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); RowLayout rl_composite_3 = new RowLayout(SWT.HORIZONTAL); rl_composite_3.marginBottom = 0; rl_composite_3.marginLeft = 0; rl_composite_3.marginRight = 0; rl_composite_3.marginTop = 0; rl_composite_3.spacing = 0; rl_composite_3.pack = false; rl_composite_3.wrap = false; rl_composite_3.justify = true; composite_3.setLayout(rl_composite_3); cmdAllToDest = new Button(composite_3, SWT.NONE); cmdAllToDest.setText(">>"); cmdAllToDest.addSelectionListener(new SelectionAdapter() { private static final long serialVersionUID = 1L; @Override public void widgetSelected(SelectionEvent e) { moveElement(Direction.ALL_TO_DEST); } }); SashForm sashForm = new SashForm(grpMain, SWT.NONE); FormData fd_sashForm = new FormData(); fd_sashForm.top = new FormAttachment(controlArea, 5); fd_sashForm.bottom = new FormAttachment(100); fd_sashForm.right = new FormAttachment(100); fd_sashForm.left = new FormAttachment(0); sashForm.setLayoutData(fd_sashForm); Composite compSrc = new Composite(sashForm, SWT.NONE); compSrc.setLayout(new FormLayout()); tableViewerSrc = new TableViewer(compSrc, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); Table tblSrc = tableViewerSrc.getTable(); FormData fd_tblSrc = new FormData(); fd_tblSrc.bottom = new FormAttachment(100); fd_tblSrc.right = new FormAttachment(100); fd_tblSrc.left = new FormAttachment(0); tblSrc.setLayoutData(fd_tblSrc); lblSrc = new Label(compSrc, SWT.CENTER); fd_tblSrc.top = new FormAttachment(lblSrc); FormData fd_lblSrc = new FormData(); fd_lblSrc.right = new FormAttachment(100); fd_lblSrc.left = new FormAttachment(0); lblSrc.setLayoutData(fd_lblSrc); lblSrc.setText(Messages.get().nToMSrcLabel); Composite compDest = new Composite(sashForm, SWT.NONE); compDest.setLayout(new FormLayout()); lblDest = new Label(compDest, SWT.CENTER); FormData fd_lblDest = new FormData(); fd_lblDest.right = new FormAttachment(100); fd_lblDest.left = new FormAttachment(0); lblDest.setLayoutData(fd_lblDest); lblDest.setText(Messages.get().nToMDestLabel); tableViewerDest = new TableViewer(compDest, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); Table tblDest = tableViewerDest.getTable(); FormData fd_tblDest = new FormData(); fd_tblDest.top = new FormAttachment(lblDest); fd_tblDest.bottom = new FormAttachment(100); fd_tblDest.right = new FormAttachment(100); fd_tblDest.left = new FormAttachment(0); tblDest.setLayoutData(fd_tblDest); lblValidator = new Label(compDest, SWT.NONE); FormData fd_lblNewLabel = new FormData(); fd_lblNewLabel.left = new FormAttachment(0); lblValidator.setLayoutData(fd_lblNewLabel); sashForm.setWeights(new int[] { 1, 1 }); } @Override public NToMModel<M, S> getModelProperty() { return modelProperty; } public void setModelProperty(M model, String property, List<S> srcList, String... propertyNames) { setModelProperty(model, property, srcList, propertyNames, propertyNames); } public void setModelProperty(M model, String property, List<S> srcList, String[] srcPropertyNames, String[] destPropertyNames) { modelProperty = new NToMModel<>(model, property, srcList, srcPropertyNames, destPropertyNames); initBinding(); } protected void initBinding() { if (bindingContext != null) { bindingContext.dispose(); } bindingContext = new DataBindingContext(); initCustomDataBindings(); initDataBindings(); } private void initCustomDataBindings() { if (modelProperty.isRequired()) { lblDest.setData(RWT.CUSTOM_VARIANT, "required"); } bindTable(tableViewerSrc, modelProperty.getSrcList(), modelProperty.getPropertyItemType(), modelProperty.getSrcPropertyNames()); bindTable(tableViewerDest, modelProperty.getPropertyValue(), modelProperty.getPropertyItemType(), modelProperty.getDestPropertyNames()); tableViewerSrc.addOpenListener(new IOpenListener() { @Override public void open(OpenEvent event) { moveElement(Direction.TO_DEST); } }); tableViewerDest.addOpenListener(new IOpenListener() { @Override public void open(OpenEvent event) { moveElement(Direction.TO_SRC); } }); } void moveElement(Direction direction) { S element = null; List<S> inputSrc = (List<S>) tableViewerSrc.getInput(); List<S> inputDest = (List<S>) tableViewerDest.getInput(); IStructuredSelection selectionSrc = (IStructuredSelection) tableViewerSrc.getSelection(); IStructuredSelection selectionDest = (IStructuredSelection) tableViewerDest.getSelection(); int selSrc = tableViewerSrc.getTable().getSelectionIndex(); int selDest = tableViewerDest.getTable().getSelectionIndex(); switch (direction) { case ALL_TO_SRC: for (S s : inputDest) { if (!inputSrc.contains(s)) { inputSrc.add(s); } } inputDest.clear(); tableViewerSrc.getTable().setSelection(0); break; case TO_SRC: element = (S) selectionDest.getFirstElement(); if (element != null) { inputDest.remove(element); if (!inputSrc.contains(element)) { inputSrc.add(element); } tableViewerSrc.setSelection(new StructuredSelection(element)); tableViewerDest.getTable().setSelection(Math.max(0, Math.min(selDest, inputDest.size() - 1))); } break; case TO_DEST: element = (S) selectionSrc.getFirstElement(); if (element != null) { inputSrc.remove(element); if (!inputDest.contains(element)) { inputDest.add(element); } tableViewerDest.setSelection(new StructuredSelection(element)); tableViewerSrc.getTable().setSelection(Math.max(0, Math.min(selSrc, inputSrc.size() - 1))); } break; case ALL_TO_DEST: for (S s : inputSrc) { if (!inputDest.contains(s)) { inputDest.add(s); } } inputSrc.clear(); tableViewerDest.getTable().setSelection(0); break; } multiValidator.forceRevalidate(); allSrcBinding.updateModelToTarget(); allDestBinding.updateModelToTarget(); srcBinding.updateModelToTarget(); destBinding.updateModelToTarget(); ControlUtils.refresh(tableViewerSrc); ControlUtils.refresh(tableViewerDest); modelProperty.setDirty(true); } protected void initDataBindings() { // IObservableValue observeTextLblControlObserveWidget = new WidgetGroupTextProperty().observe(grpMain); IObservableValue labelModelObserveValue = BeanProperties.value("label").observe(modelProperty); bindingContext.bindValue(observeTextLblControlObserveWidget, labelModelObserveValue, null, null); // IObservableValue observeEnabledCmdAllToSrcObserveWidget = WidgetProperties.enabled().observe(cmdAllToSrc); IObservableValue emptyDestModelObserveValue = PojoProperties.value("empty").observe(tableViewerDest.getInput()); UpdateValueStrategy updateValueStrategy = new UpdateValueStrategy(); updateValueStrategy.setConverter(new TableInputToBooleanConverter(tableViewerDest)); allSrcBinding = bindingContext.bindValue(observeEnabledCmdAllToSrcObserveWidget, emptyDestModelObserveValue, null, updateValueStrategy); // // IObservableValue observeEnabledCmdAllToDestObserveWidget = WidgetProperties.enabled().observe(cmdAllToDest); IObservableValue emptySrcModelObserveValue = PojoProperties.value("empty").observe(tableViewerSrc.getInput()); UpdateValueStrategy updateValueStrategy2 = new UpdateValueStrategy(); updateValueStrategy2.setConverter(new TableInputToBooleanConverter(tableViewerSrc)); allDestBinding = bindingContext.bindValue(observeEnabledCmdAllToDestObserveWidget, emptySrcModelObserveValue, null, updateValueStrategy2); // IObservableValue enabledCmdToDestObserveValue = WidgetProperties.enabled().observe(cmdToDest); IObservableValue selectionTableViewerSrcObserveValue = ViewerProperties.singleSelection().observe(tableViewerSrc); UpdateValueStrategy updateValueStrategy3 = new UpdateValueStrategy(); updateValueStrategy3.setConverter(new ObjectToBooleanConverter(modelProperty.getPropertyItemType())); srcBinding = bindingContext.bindValue(enabledCmdToDestObserveValue, selectionTableViewerSrcObserveValue, null, updateValueStrategy3); // IObservableValue observeEnabledCmdToSrcObserveWidget = WidgetProperties.enabled().observe(cmdToSrc); IObservableValue observeSingleSelectionTableViewer_1 = ViewerProperties.singleSelection().observe(tableViewerDest); UpdateValueStrategy updateValueStrategy4 = new UpdateValueStrategy(); updateValueStrategy4.setConverter(new ObjectToBooleanConverter(modelProperty.getPropertyItemType())); destBinding = bindingContext.bindValue(observeEnabledCmdToSrcObserveWidget, observeSingleSelectionTableViewer_1, null, updateValueStrategy4); // IObservableValue observeEnabledGrpMainObserveWidget = WidgetProperties.enabled().observe(grpMain); IObservableValue enabledModelObserveValue = BeanProperties.value("enabled").observe(modelProperty); bindingContext.bindValue(observeEnabledGrpMainObserveWidget, enabledModelObserveValue, null, null); // multiValidator = new RequiredListValidator<>(modelProperty, lblValidator, SWT.RIGHT | SWT.TOP); bindingContext.addValidationStatusProvider(multiValidator); } @Override public DataBindingContext getBindingContext() { return bindingContext; } @Override public void updateModelToTarget() { allSrcBinding.updateModelToTarget(); allDestBinding.updateModelToTarget(); srcBinding.updateModelToTarget(); destBinding.updateModelToTarget(); ControlUtils.refresh(tableViewerSrc); ControlUtils.refresh(tableViewerDest); } @Override public BindingStatus validate() { multiValidator.forceRevalidate(); return BinderUtils.validate(this); } public <R> void bindSelection(TableViewer tableViewer, List<R> model) { if (model instanceof DtoListModel) { IObservableValue observeTableViewerSelection = ViewerProperties.singleSelection().observe(tableViewer); IObservableValue selectedDtoObserveValue = BeanProperties.value("selectedDto").observe(model); UpdateValueStrategy noUpdateStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER); bindingContext.bindValue(observeTableViewerSelection, selectedDtoObserveValue, null, noUpdateStrategy); } if (model.size() > 0) { tableViewer.setSelection(new StructuredSelection(model.get(0))); } } private <R extends Object> void bindContent(TableViewer tableViewer, List<R> model, Class<R> beanClass, String... propertyNames) { ObservableListContentProvider listContentProvider = new ObservableListContentProvider(); IObservableMap[] observeMaps = null; if (IDtoModel.class.isAssignableFrom(beanClass)) { observeMaps = BeansObservables.observeMaps(listContentProvider.getKnownElements(), beanClass, propertyNames); } else { observeMaps = PojoObservables.observeMaps(listContentProvider.getKnownElements(), beanClass, propertyNames); } ConvertableObservableMapLabelProvider labelProvider = new ConvertableObservableMapLabelProvider(observeMaps); tableViewer.setLabelProvider(labelProvider); tableViewer.setContentProvider(listContentProvider); IObservableList selfList = Properties.selfList(beanClass).observe(model); tableViewer.setInput(selfList); for (IObservableMap observableMap : observeMaps) { observableMap.addMapChangeListener(new MapChangeListener(tableViewer)); } bindSelection(tableViewer, model); } private <R extends Object> void bindTable(TableViewer tableViewer, List<R> model, Class<R> beanClass, String[] propertyNames) { bindTableColumn(tableViewer, beanClass, propertyNames); bindContent(tableViewer, model, beanClass, propertyNames); ControlUtils.pack(tableViewer); } private static <T extends AbstractTemplate< ? >, D extends DtoModel> void bindTableColumn(TableViewer tableViewer, Class< ? extends Object> beanClass, String... propertyNames) { Table table = tableViewer.getTable(); table.setHeaderVisible(true); table.setLinesVisible(true); // for (TableColumn tableColumn : tableViewer.getTable().getColumns()) { // tableColumn.dispose(); // } // // tableViewer.getTable().removeAll(); tableViewer.setComparator(new PropertyViewerComparator()); for (String propertyName : propertyNames) { createTableColumn(tableViewer, beanClass, propertyName); } } protected static void createTableColumn(TableViewer tableViewer, Class< ? extends Object> beanClass, String propertyName) { for (TableColumn tableColumn : tableViewer.getTable().getColumns()) { String columnName = (String) tableColumn.getData(IData.COLUMN_NAME); if (propertyName.equals(columnName)) { return; } } TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); TableColumn tableColumn = tableViewerColumn.getColumn(); tableColumn.setData(IData.COLUMN_NAME, propertyName); tableColumn.addSelectionListener(new DefaultSortSelectionListener(tableViewer, beanClass, propertyName)); tableColumn.setMoveable(true); tableColumn.setResizable(true); tableColumn.addSelectionListener(new DefaultSortSelectionListener(tableViewer, beanClass, propertyName)); tableColumn.setText(Messages.get(beanClass, propertyName)); } }
[ "daniele.pirola@gmail.com" ]
daniele.pirola@gmail.com
39f0d229254ae75ea13904ac21f2014da831580a
078cc436e424031a1447f3d978dfc3f7ac32a317
/Java/Codigos/CaraySello.java
9549fffb02cd5e4819458b9ea6b25b4d8b444d67
[]
no_license
imgourav/codigosProgramacion
e3bb4f02ca82261fca3349503713d6e96b3e8e81
58c32a35b4205154f6a72d6d4065c86c2cd971f1
refs/heads/master
2022-12-23T05:37:33.240819
2020-10-01T02:13:46
2020-10-01T02:13:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
167
java
public void CaraySello(){ double a; a = Math.random(); if (a>=0.5){ System.out.println ("A"); }else{ System.out.println ("B"); } }
[ "juliancmorales10@gmail.com" ]
juliancmorales10@gmail.com
ca7bbd9bb01aee65300abd859de7ac18a10ff185
18f2fc77a61e8cbe4c38ae5b64b05b0347cd8507
/LAB_2/src/business/VitalSignsHistory.java
2e840c216c269fb118ce2cf0d56942d360e97877
[]
no_license
YashPandya2001/AED_ASSIGNMENT
82875ced4d739f5462a6893bb3b88aebe616f2f1
cea00bd945393d8d2f08c36d6f7d424c029bb06c
refs/heads/master
2020-07-30T06:06:30.954975
2019-09-22T08:43:20
2019-09-22T08:43:20
210,112,389
0
0
null
null
null
null
UTF-8
Java
false
false
940
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 business; import java.util.ArrayList; /** * * @author hp */ public class VitalSignsHistory { private ArrayList<VitalSigns> vitalSignsHistory; public VitalSignsHistory() { vitalSignsHistory=new ArrayList<VitalSigns>(); } public ArrayList<VitalSigns> getVitalSignsHistory() { return vitalSignsHistory; } public void setVitalSignsHistory(ArrayList<VitalSigns> vitalSignsHistory) { this.vitalSignsHistory = vitalSignsHistory; } public VitalSigns addVital() { VitalSigns vs=new VitalSigns(); vitalSignsHistory.add(vs); return vs; } public void removeVital(VitalSigns v) { vitalSignsHistory.remove(v); } }
[ "pandya.y@husky.neu.edu" ]
pandya.y@husky.neu.edu
a241b380144bf7872c253d3d18383c8a486b7124
ee2a51f827fd337e6dbb9b018f62cacd8e6399da
/Ch_2_5_Applications/Practise_2_5_01.java
c1ff5da590f615830767853830946d9c741955b5
[]
no_license
pengzhetech/Algorithms
97eab98283575fdef46ad06549dcb29993bea132
c379ff6de3a10dfb1818e84a9ea2516876958288
refs/heads/master
2022-08-16T18:04:59.992353
2022-07-21T16:17:42
2022-07-21T16:17:42
261,119,609
0
0
null
2020-05-04T08:31:22
2020-05-04T08:31:21
null
UTF-8
Java
false
false
293
java
package Ch_2_5_Applications; public class Practise_2_5_01 { public static void main(String[] args) { /* * 如果内存地址相等,那么这两个字符串肯定相等,因此无需比较 * 这样避免了多余的比较操作 * */ } }
[ "yangxiaohei321123@163.com" ]
yangxiaohei321123@163.com
fa6fd792ad6885ff0f01da42d6d15f300545bf9a
05fb5c7f434ced78d09271c04d7d2e290f3d4a5e
/guns-common-api/src/main/java/com/stylefeng/guns/rest/modular/cinema/CinemaServiceAPI.java
457ef509f5336096d3f7a375b1aea66c8dffe9ee
[ "Apache-2.0" ]
permissive
xiaofei20190625/project4_FilmTicketing
7bdd581711f23d1debeacc78a2c3185329b5cb20
58af1f80e5d2c63c50e8a0fab4291c8ee777c9c8
refs/heads/master
2022-10-28T02:29:10.668206
2020-05-09T09:43:30
2020-05-09T09:43:30
196,984,796
2
0
NOASSERTION
2022-10-12T20:29:17
2019-07-15T11:23:16
Java
UTF-8
Java
false
false
1,036
java
package com.stylefeng.guns.rest.modular.cinema; import com.baomidou.mybatisplus.plugins.Page; import com.stylefeng.guns.rest.modular.cinema.vo.*; import java.util.List; public interface CinemaServiceAPI { List<CinemaVo> getCinema(String brandId); //根据CinemaQueryVO查询影院列表 Page<CinemaVo> getCinemas(CinemaQueryVo cinemaQueryVo); CinemaInfo getFields(int cinemaId); List<FilmList> getFilmList(int cinemaId); //获取所有电源信息和对应放映场次信息 List<FilmList> getFilmInfoByCinemaId(int cinemaId); //根据条件获取品牌列表(除99以外其他数字都有效) List<BrandVo> getBrands(int brandId); //行政区域 List<AreaVo> getAreas(int areaId); //影厅类型 List<HallTypeVo> getHallTypes(int hallTypeId); //影院信息 CinemaInfo getCinemaInfoById(int cinemaId); //放映信息 HallInfoVo getFilmFieldInfo(int fieldId); //放映场次-->电源编号-->电影信息 FilmInfo getFilmInfoByFieldId(int fieldId); }
[ "ahtcmcq940603@163.com" ]
ahtcmcq940603@163.com
cccd5432dd1dad4296b4967678464f259810b171
7b1ace6eaa1b1d097c76f2a18fa94804fb544896
/bigdata-lab/hive/src/main/java/com/luogh/learning/lab/hive/HiveConnector.java
0e3c09db3a62ddd2363e32651d42a04218f0e071
[]
no_license
luoguohao/basecode-lab
b96152846e57a78887ece792a00eb21f70eaeb85
680298fedb805cc3f568ec65e5faedf8bbe4f49f
refs/heads/master
2022-06-25T07:39:54.722036
2020-03-22T14:29:37
2020-03-22T14:29:37
87,285,843
1
0
null
2022-06-21T00:49:27
2017-04-05T08:33:08
Java
UTF-8
Java
false
false
1,788
java
package com.luogh.learning.lab.hive; import java.util.List; import java.util.stream.Collectors; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.ql.metadata.Hive; import org.apache.hadoop.hive.ql.metadata.Table; import org.apache.hadoop.hive.serde2.objectinspector.StructField; public class HiveConnector { public static void main(String[] args) throws Exception { HiveConf hiveConf = new HiveConf(); hiveConf.set("hive.metastore.uris", "thrift://172.23.7.138:9083"); Table table = Hive.get(hiveConf).getTable("cdp", "c24_order"); System.out.println("input format : " + table.getTTable().getSd().getInputFormat()); System.out.println("location : " + table.getTTable().getSd().getLocation()); System.out.println("output format : " + table.getTTable().getSd().getOutputFormat()); System.out.println("skewedColNames : " + table.getTTable().getSd().getSkewedInfo().isSetSkewedColNames()); System.out.println("skewedColNames : " + String .join(",", table.getTTable().getSd().getSkewedInfo().getSkewedColNames())); List<FieldSchema> cols = table.getTTable().getSd().getCols(); for (FieldSchema col : cols) { System.out.println("colName:" + col.getName() + ", colType:" + col.getType()); } List<StructField> fields = table.getFields(); for (StructField field : fields) { System.out.println("fieldName:" + field.getFieldName() + ", fieldId:" + field.getFieldID() + ", fieldTypeCatalog:" + field.getFieldObjectInspector().getCategory().name() + ", field:" + field.getFieldObjectInspector().getTypeName()); } System.out.println(table.getSkewedColNames().stream().collect(Collectors.joining(","))); } }
[ "guohao.luo@tendcloud.com" ]
guohao.luo@tendcloud.com
737f7a7753ded9b9c6dfc0a582d31e92ab7266df
a259df255e7203787fa74704ed454f1bd5a4a76f
/src/main/java/com/jinchuangan/filter/SiteStatusFilter.java
4c331f5847c33ee0419c8d9f8fcb3ea950abbab9
[]
no_license
zhzhd/stock
c301022230a5684dfa9f3a29c8f907ee769db93a
6b635aecfdb319a13b683dd269b2047385861b28
refs/heads/master
2021-01-15T12:59:33.304765
2017-08-08T08:30:00
2017-08-08T08:30:00
99,665,098
1
0
null
null
null
null
UTF-8
Java
false
false
2,586
java
/* * * */ package com.jinchuangan.filter; import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.jinchuangan.Setting; import com.jinchuangan.util.SettingUtils; import org.springframework.stereotype.Component; import org.springframework.util.AntPathMatcher; import org.springframework.web.filter.OncePerRequestFilter; /** * Filter - 网站状态 * * * @version 1.0 */ @Component("siteStatusFilter") public class SiteStatusFilter extends OncePerRequestFilter { /** 默认忽略URL */ private static final String[] DEFAULT_IGNORE_URL_PATTERNS = new String[] { "/admin/**" }; /** 默认重定向URL */ private static final String DEFAULT_REDIRECT_URL = "/common/site_close.jhtml"; /** antPathMatcher */ private static AntPathMatcher antPathMatcher = new AntPathMatcher(); /** 忽略URL */ private String[] ignoreUrlPatterns = DEFAULT_IGNORE_URL_PATTERNS; /** 重定向URL */ private String redirectUrl = DEFAULT_REDIRECT_URL; @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { Setting setting = SettingUtils.get(); if (setting.getIsSiteEnabled()) { filterChain.doFilter(request, response); } else { String path = request.getServletPath(); if (path.equals(redirectUrl)) { filterChain.doFilter(request, response); return; } if (ignoreUrlPatterns != null) { for (String ignoreUrlPattern : ignoreUrlPatterns) { if (antPathMatcher.match(ignoreUrlPattern, path)) { filterChain.doFilter(request, response); return; } } } response.sendRedirect(request.getContextPath() + redirectUrl); } } /** * 获取忽略URL * * @return 忽略URL */ public String[] getIgnoreUrlPatterns() { return ignoreUrlPatterns; } /** * 设置忽略URL * * @param ignoreUrlPatterns * 忽略URL */ public void setIgnoreUrlPatterns(String[] ignoreUrlPatterns) { this.ignoreUrlPatterns = ignoreUrlPatterns; } /** * 获取重定向URL * * @return 重定向URL */ public String getRedirectUrl() { return redirectUrl; } /** * 设置重定向URL * * @param redirectUrl * 重定向URL */ public void setRedirectUrl(String redirectUrl) { this.redirectUrl = redirectUrl; } }
[ "562599006@qq.com" ]
562599006@qq.com
74312dd38f85a119110d75810593bc9655e1c6f6
471bbf2c662e49d840735a1d3a0cf0a22a76da71
/test-framework/src/main/java/org/neo4j/doc/test/rule/SuppressOutput.java
0c710d6c6e5c76dfd97d7a5e1ee4db94327b5060
[]
no_license
hugofirth/neo4j-documentation
42c7813a5fca0cccaed55645e1035f633a1fa99c
1a848a3c7d5074009b5169a3ffdf0bf46bf18fa3
refs/heads/3.5
2021-06-15T13:57:37.208294
2019-01-10T18:46:07
2019-01-10T18:47:22
166,789,789
0
0
null
2019-01-21T09:53:33
2019-01-21T09:53:29
null
UTF-8
Java
false
false
9,708
java
/* * Licensed to Neo4j under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Neo4j 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.neo4j.doc.test.rule; import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogManager; import java.util.logging.Logger; import java.util.logging.SimpleFormatter; import java.util.logging.StreamHandler; import static java.lang.System.lineSeparator; import static java.util.Arrays.asList; /** * Suppresses outputs such as System.out, System.err and java.util.logging for example when running a test. * It's also a {@link TestRule} which makes it fit in nicely in JUnit. * * The suppressing occurs visitor-style and if there's an exception in the code executed when being muted * all the logging that was temporarily muted will be resent to the peers as if they weren't muted to begin with. */ public final class SuppressOutput implements TestRule { private static final Suppressible java_util_logging = java_util_logging( new ByteArrayOutputStream(), null ); public static SuppressOutput suppress( Suppressible... suppressibles ) { return new SuppressOutput( suppressibles ); } public static SuppressOutput suppressAll() { return suppress( System.out, System.err, java_util_logging ); } public enum System implements Suppressible { out { @Override PrintStream replace( PrintStream replacement ) { PrintStream old = java.lang.System.out; java.lang.System.setOut( replacement ); return old; } }, err { @Override PrintStream replace( PrintStream replacement ) { PrintStream old = java.lang.System.err; java.lang.System.setErr( replacement ); return old; } }; @Override public Voice suppress() { final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); final PrintStream old = replace( new PrintStream( buffer ) ); return new Voice( this, buffer ) { @Override void restore( boolean failure ) throws IOException { replace( old ).flush(); if ( failure ) { old.write( buffer.toByteArray() ); } } }; } abstract PrintStream replace( PrintStream replacement ); } public static Suppressible java_util_logging( final ByteArrayOutputStream redirectTo, Level level ) { final Handler replacement = redirectTo == null ? null : new StreamHandler( redirectTo, new SimpleFormatter() ); if ( replacement != null && level != null ) { replacement.setLevel( level ); } return new Suppressible() { @Override public Voice suppress() { final Logger logger = LogManager.getLogManager().getLogger( "" ); final Level level = logger.getLevel(); final Handler[] handlers = logger.getHandlers(); for ( Handler handler : handlers ) { logger.removeHandler( handler ); } if ( replacement != null ) { logger.addHandler( replacement ); logger.setLevel( Level.ALL ); } return new Voice( this, redirectTo ) { @Override void restore( boolean failure ) { for ( Handler handler : handlers ) { logger.addHandler( handler ); } logger.setLevel( level ); if ( replacement != null ) { logger.removeHandler( replacement ); } } }; } }; } public <T> T call( Callable<T> callable ) throws Exception { voices = captureVoices(); boolean failure = true; try { T result = callable.call(); failure = false; return result; } finally { releaseVoices( voices, failure ); } } private final Suppressible[] suppressibles; private Voice[] voices; private SuppressOutput( Suppressible[] suppressibles ) { this.suppressibles = suppressibles; } public Voice[] getAllVoices() { return voices; } public Voice getOutputVoice() { return getVoice( System.out ); } public Voice getErrorVoice() { return getVoice( System.err ); } public Voice getVoice( Suppressible suppressible ) { for ( Voice voice : voices ) { if ( suppressible.equals( voice.getSuppressible() ) ) { return voice; } } return null; } @Override public Statement apply( final Statement base, Description description ) { return new Statement() { @Override public void evaluate() throws Throwable { voices = captureVoices(); boolean failure = true; try { base.evaluate(); failure = false; } finally { releaseVoices( voices, failure ); } } }; } public interface Suppressible { Voice suppress(); } public abstract static class Voice { private Suppressible suppressible; private ByteArrayOutputStream voiceStream; public Voice( Suppressible suppressible, ByteArrayOutputStream originalStream ) { this.suppressible = suppressible; this.voiceStream = originalStream; } public Suppressible getSuppressible() { return suppressible; } public boolean containsMessage( String message ) { return voiceStream.toString().contains( message ); } /** Get each line written to this voice since it was suppressed */ public List<String> lines() { return asList( toString().split( lineSeparator() ) ); } @Override public String toString() { try { return voiceStream.toString( StandardCharsets.UTF_8.name() ); } catch ( UnsupportedEncodingException e ) { throw new RuntimeException( e ); } } abstract void restore( boolean failure ) throws IOException; } Voice[] captureVoices() { Voice[] voices = new Voice[suppressibles.length]; boolean ok = false; try { for ( int i = 0; i < voices.length; i++ ) { voices[i] = suppressibles[i].suppress(); } ok = true; } finally { if ( !ok ) { releaseVoices( voices, false ); } } return voices; } void releaseVoices( Voice[] voices, boolean failure ) { List<Throwable> failures = null; try { failures = new ArrayList<>( voices.length ); } catch ( Throwable oom ) { // nothing we can do... } for ( Voice voice : voices ) { if ( voice != null ) { try { voice.restore( failure ); } catch ( Throwable exception ) { if ( failures != null ) { failures.add( exception ); } } } } if ( failures != null && !failures.isEmpty() ) { for ( Throwable exception : failures ) { exception.printStackTrace(); } } } }
[ "jonatan.jaderberg@neotechnology.com" ]
jonatan.jaderberg@neotechnology.com
6885d59aa5aeaeeb994d614f724c7664041836d3
bc4d17be4364683a82a10d7913c243c7dd43935d
/app/src/main/java/com/globe/hand/Main/Tab4Alarm/controllers/AlarmAdapter.java
ece510b31c2ae89d11ecc0ff013f37618c8d0242
[]
no_license
tkddn204/HAND
6008cbcf42890853107fd39dccf7352c3c79acdc
27c30fa8e8c3f7d3ee9a6172c76d42a59b87accf
refs/heads/master
2021-09-10T01:17:44.847370
2018-01-10T10:12:17
2018-01-10T10:12:17
126,024,896
1
1
null
null
null
null
UTF-8
Java
false
false
1,230
java
package com.globe.hand.Main.Tab4Alarm.controllers; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.ViewGroup; import com.globe.hand.R; import com.google.firebase.firestore.DocumentSnapshot; import java.util.List; /** * Created by baeminsu on 2017. 12. 26.. */ public class AlarmAdapter extends RecyclerView.Adapter<AlarmViewHolder> { private Context mContext; private List<DocumentSnapshot> notiSnapshotList; public AlarmAdapter(Context mContext, List<DocumentSnapshot> notiSnapshotList) { this.mContext = mContext; this.notiSnapshotList = notiSnapshotList; } @Override public AlarmViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new AlarmViewHolder(parent, R.layout.recycler_item_alarm, this); } @Override public void onBindViewHolder(AlarmViewHolder holder, int position) { holder.bindView(mContext, notiSnapshotList.get(position), position); } @Override public int getItemCount() { return notiSnapshotList.size(); } public void removeItem(int position) { notiSnapshotList.remove(position); notifyDataSetChanged(); } }
[ "alstn224@naver.com" ]
alstn224@naver.com
da4488ee4d593e4cab20b3f100e72c596b458727
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/35/35_5d1eb1775570f44c0f5cc327e6fe02eecb5ba85c/AlbumListController/35_5d1eb1775570f44c0f5cc327e6fe02eecb5ba85c_AlbumListController_s.java
d464556174a73708c88d0bf88fdf994eafcc195b
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
16,549
java
/* * Copyright (C) 2005-2009 Team XBMC * http://xbmc.org * * 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 2, 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 XBMC Remote; see the file license. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ package org.xbmc.android.remote.presentation.controller; import java.util.ArrayList; import org.xbmc.android.remote.R; import org.xbmc.android.remote.business.AbstractManager; import org.xbmc.android.remote.business.ManagerFactory; import org.xbmc.android.remote.presentation.activity.DialogFactory; import org.xbmc.android.remote.presentation.activity.ListActivity; import org.xbmc.android.remote.presentation.widget.ThreeLabelsItemView; import org.xbmc.android.util.ImportUtilities; import org.xbmc.api.business.DataResponse; import org.xbmc.api.business.IControlManager; import org.xbmc.api.business.IMusicManager; import org.xbmc.api.business.ISortableManager; import org.xbmc.api.object.Album; import org.xbmc.api.object.Artist; import org.xbmc.api.object.Genre; import org.xbmc.api.type.SortType; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.BitmapFactory; import android.view.ContextMenu; import android.view.Menu; import android.view.MenuItem; import android.view.SubMenu; import android.view.View; import android.view.ViewGroup; import android.view.ContextMenu.ContextMenuInfo; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.GridView; import android.widget.ListView; import android.widget.Toast; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; /** * TODO Once we move to 1.6+, waste the deprecated code. */ public class AlbumListController extends ListController implements IController { public static final int ITEM_CONTEXT_QUEUE = 1; public static final int ITEM_CONTEXT_PLAY = 2; public static final int ITEM_CONTEXT_INFO = 3; public static final int MENU_PLAY_ALL = 1; public static final int MENU_SORT = 2; public static final int MENU_SORT_BY_ARTIST_ASC = 21; public static final int MENU_SORT_BY_ARTIST_DESC = 22; public static final int MENU_SORT_BY_ALBUM_ASC = 23; public static final int MENU_SORT_BY_ALBUM_DESC = 24; public static final int MENU_SWITCH_VIEW = 3; private static final int VIEW_LIST = 1; private static final int VIEW_GRID = 2; private int mCurrentView = VIEW_LIST; private Artist mArtist; private Genre mGenre; private IMusicManager mMusicManager; private IControlManager mControlManager; private boolean mCompilationsOnly = false; private boolean mLoadCovers = false; private GridView mGrid = null; /** * Defines if only compilations should be listed. * @param co True if compilations only should be listed, false otherwise. */ public void setCompilationsOnly(boolean co) { mCompilationsOnly = co; } /** * If grid reference is set, albums can be displayed as wall view. * @param grid Reference to GridView */ public void setGrid(GridView grid) { mGrid = grid; } public void onCreate(Activity activity, ListView list) { mMusicManager = ManagerFactory.getMusicManager(this); mControlManager = ManagerFactory.getControlManager(this); ((ISortableManager)mMusicManager).setSortKey(AbstractManager.PREF_SORT_KEY_ALBUM); ((ISortableManager)mMusicManager).setPreferences(activity.getPreferences(Context.MODE_PRIVATE)); final String sdError = ImportUtilities.assertSdCard(); mLoadCovers = sdError == null; if (!isCreated()) { super.onCreate(activity, list); if (!mLoadCovers) { Toast toast = Toast.makeText(activity, sdError + " Displaying place holders only.", Toast.LENGTH_LONG); toast.show(); } mArtist = (Artist)mActivity.getIntent().getSerializableExtra(ListController.EXTRA_ARTIST); mGenre = (Genre)mActivity.getIntent().getSerializableExtra(ListController.EXTRA_GENRE); activity.registerForContextMenu(mList); mFallbackBitmap = BitmapFactory.decodeResource(activity.getResources(), R.drawable.icon_album_dark_big); setupIdleListener(); mList.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent nextActivity; final Album album = (Album)mList.getAdapter().getItem(((ThreeLabelsItemView)view).position); nextActivity = new Intent(view.getContext(), ListActivity.class); nextActivity.putExtra(ListController.EXTRA_LIST_CONTROLLER, new SongListController()); nextActivity.putExtra(ListController.EXTRA_ALBUM, album); mActivity.startActivity(nextActivity); } }); mList.setOnKeyListener(new ListControllerOnKeyListener<Album>()); fetch(); } } private void setAdapter(ArrayList<Album> value) { switch (mCurrentView) { case VIEW_LIST: mList.setAdapter(new AlbumAdapter(mActivity, value)); mList.setVisibility(View.VISIBLE); if (mGrid != null) { mGrid.setVisibility(View.GONE); } break; case VIEW_GRID: if (mGrid != null) { mGrid.setAdapter(new AlbumGridAdapter(mActivity, value)); mGrid.setVisibility(View.VISIBLE); mList.setVisibility(View.GONE); } else { mList.setVisibility(View.VISIBLE); mList.setAdapter(new AlbumAdapter(mActivity, value)); } break; } } public void updateLibrary() { final AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); builder.setMessage("Are you sure you want XBMC to rescan your music library?") .setCancelable(false) .setPositiveButton("Yes!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { mControlManager.updateLibrary(new DataResponse<Boolean>() { public void run() { final String message; if (value) { message = "Music library updated has been launched."; } else { message = "Error launching music library update."; } Toast toast = Toast.makeText(mActivity, message, Toast.LENGTH_SHORT); toast.show(); } }, "music"); } }) .setNegativeButton("Uh, no.", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); builder.create().show(); } private void fetch() { final Artist artist = mArtist; final Genre genre = mGenre; if (artist != null) { // albums of an artist setTitle(artist.name + " - Albums..."); showOnLoading(); mMusicManager.getAlbums(new DataResponse<ArrayList<Album>>() { public void run() { if (value.size() > 0) { setTitle(artist.name + " - Albums (" + value.size() + ")"); setAdapter(value); } else { setTitle(artist.name + " - Albums"); setNoDataMessage("No albums found.", R.drawable.icon_album_dark); } } }, artist); } else if (genre != null) { // albums of a genre setTitle(genre.name + " - Albums..."); showOnLoading(); mMusicManager.getAlbums(new DataResponse<ArrayList<Album>>() { public void run() { if (value.size() > 0) { setTitle(genre.name + " - Albums (" + value.size() + ")"); setAdapter(value); } else { setTitle(genre.name + " - Albums"); setNoDataMessage("No albums found.", R.drawable.icon_album_dark); } } }, genre); } else { if (mCompilationsOnly) { // compilations setTitle("Compilations..."); showOnLoading(); mMusicManager.getCompilations(new DataResponse<ArrayList<Album>>() { public void run() { if (value.size() > 0) { setTitle("Compilations (" + value.size() + ")"); setAdapter(value); } else { setTitle("Compilations"); setNoDataMessage("No compilations found.", R.drawable.icon_album_dark); } } }); } else { setTitle("Albums..."); // all albums showOnLoading(); mMusicManager.getAlbums(new DataResponse<ArrayList<Album>>() { public void run() { if (value.size() > 0) { setTitle("Albums (" + value.size() + ")"); setAdapter(value); } else { setTitle("Albums"); setNoDataMessage("No Albums found.", R.drawable.icon_album_dark); } } }); } } } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { final ThreeLabelsItemView view = (ThreeLabelsItemView)((AdapterContextMenuInfo)menuInfo).targetView; menu.setHeaderTitle(((Album)mList.getItemAtPosition(view.getPosition())).name); menu.add(0, ITEM_CONTEXT_QUEUE, 1, "Queue Album"); menu.add(0, ITEM_CONTEXT_PLAY, 2, "Play Album"); menu.add(0, ITEM_CONTEXT_INFO, 3, "View Details"); } public void onContextItemSelected(MenuItem item) { // final ThreeHolder<Album> holder = (ThreeHolder<Album>)((AdapterContextMenuInfo)item.getMenuInfo()).targetView.getTag(); // final Album album = holder.holderItem; final Album album = (Album)mList.getAdapter().getItem(((ThreeLabelsItemView)((AdapterContextMenuInfo)item.getMenuInfo()).targetView).position); switch (item.getItemId()) { case ITEM_CONTEXT_QUEUE: mMusicManager.addToPlaylist(new QueryResponse( mActivity, "Adding album \"" + album.name + "\" by " + album.artist + " to playlist...", "Error adding album!" ), album); break; case ITEM_CONTEXT_PLAY: mMusicManager.play(new QueryResponse( mActivity, "Playing album \"" + album.name + "\" by " + album.artist + "...", "Error playing album!", true ), album); break; case ITEM_CONTEXT_INFO: DialogFactory.getAlbumDetail(mMusicManager, mActivity, album).show(); break; default: return; } } @Override public void onCreateOptionsMenu(Menu menu) { if (mArtist != null || mGenre != null) { menu.add(0, MENU_PLAY_ALL, 0, "Play all").setIcon(R.drawable.menu_album); } SubMenu sortMenu = menu.addSubMenu(0, MENU_SORT, 0, "Sort").setIcon(R.drawable.menu_sort); sortMenu.add(2, MENU_SORT_BY_ALBUM_ASC, 0, "by Album ascending"); sortMenu.add(2, MENU_SORT_BY_ALBUM_DESC, 0, "by Album descending"); sortMenu.add(2, MENU_SORT_BY_ARTIST_ASC, 0, "by Artist ascending"); sortMenu.add(2, MENU_SORT_BY_ARTIST_DESC, 0, "by Artist descending"); // menu.add(0, MENU_SWITCH_VIEW, 0, "Switch view").setIcon(R.drawable.menu_view); } @Override public void onOptionsItemSelected(MenuItem item) { final SharedPreferences.Editor ed; switch (item.getItemId()) { case MENU_PLAY_ALL: final Artist artist = mArtist; final Genre genre = mGenre; if (artist != null && genre == null) { mMusicManager.play(new QueryResponse( mActivity, "Playing all albums by " + artist.name + "...", "Error playing songs!", true ), genre); } else if (genre != null && artist == null) { mMusicManager.play(new QueryResponse( mActivity, "Playing all albums of genre " + genre.name + "...", "Error playing songs!", true ), genre); } else if (genre != null && artist != null) { mMusicManager.play(new QueryResponse( mActivity, "Playing all songs of genre " + genre.name + " by " + artist.name + "...", "Error playing songs!", true ), artist, genre); } break; case MENU_SORT_BY_ALBUM_ASC: ed = mActivity.getPreferences(Context.MODE_PRIVATE).edit(); ed.putInt(AbstractManager.PREF_SORT_BY_PREFIX + AbstractManager.PREF_SORT_KEY_ALBUM, SortType.ALBUM); ed.putString(AbstractManager.PREF_SORT_ORDER_PREFIX + AbstractManager.PREF_SORT_KEY_ALBUM, SortType.ORDER_ASC); ed.commit(); fetch(); break; case MENU_SORT_BY_ALBUM_DESC: ed = mActivity.getPreferences(Context.MODE_PRIVATE).edit(); ed.putInt(AbstractManager.PREF_SORT_BY_PREFIX + AbstractManager.PREF_SORT_KEY_ALBUM, SortType.ALBUM); ed.putString(AbstractManager.PREF_SORT_ORDER_PREFIX + AbstractManager.PREF_SORT_KEY_ALBUM, SortType.ORDER_DESC); ed.commit(); fetch(); break; case MENU_SORT_BY_ARTIST_ASC: ed = mActivity.getPreferences(Context.MODE_PRIVATE).edit(); ed.putInt(AbstractManager.PREF_SORT_BY_PREFIX + AbstractManager.PREF_SORT_KEY_ALBUM, SortType.ARTIST); ed.putString(AbstractManager.PREF_SORT_ORDER_PREFIX + AbstractManager.PREF_SORT_KEY_ALBUM, SortType.ORDER_ASC); ed.commit(); fetch(); break; case MENU_SORT_BY_ARTIST_DESC: ed = mActivity.getPreferences(Context.MODE_PRIVATE).edit(); ed.putInt(AbstractManager.PREF_SORT_BY_PREFIX + AbstractManager.PREF_SORT_KEY_ALBUM, SortType.ARTIST); ed.putString(AbstractManager.PREF_SORT_ORDER_PREFIX + AbstractManager.PREF_SORT_KEY_ALBUM, SortType.ORDER_DESC); ed.commit(); fetch(); break; case MENU_SWITCH_VIEW: mCurrentView = (mCurrentView % 2) + 1; fetch(); break; } } private class AlbumAdapter extends ArrayAdapter<Album> { AlbumAdapter(Activity activity, ArrayList<Album> items) { super(activity, 0, items); } public View getView(int position, View convertView, ViewGroup parent) { final ThreeLabelsItemView view; if (convertView == null) { view = new ThreeLabelsItemView(mActivity, mMusicManager, parent.getWidth()); } else { view = (ThreeLabelsItemView)convertView; } final Album album = getItem(position); view.reset(); view.position = position; view.title = album.name; view.subtitle = album.artist; view.subsubtitle = album.year > 0 ? String.valueOf(album.year) : ""; if (mLoadCovers) { view.getResponse().load(album); } return view; } } private class AlbumGridAdapter extends ArrayAdapter<Album> { AlbumGridAdapter(Activity activity, ArrayList<Album> items) { super(activity, 0, items); } public View getView(int position, View convertView, ViewGroup parent) { /* final ImageView row; final OneHolder<Album> holder; if (convertView == null) { row = new ImageView(mActivity); holder = new OneHolder<Album>(row, null); row.setTag(holder); CrossFadeDrawable transition = new CrossFadeDrawable(mFallbackBitmap, null); transition.setCrossFadeEnabled(true); holder.transition = transition; holder.defaultCover = R.drawable.icon_album_big; } else { row = (ImageView)convertView; holder = (OneHolder<Album>)convertView.getTag(); } final Album album = getItem(position); holder.holderItem = album; holder.coverItem = album; holder.id = album.getCrc(); if (mLoadCovers) { row.setImageResource(R.drawable.icon_album_dark_big); holder.tempBind = true; mMusicManager.getCover(holder.getCoverDownloadHandler(mPostScrollLoader), album, ThumbSize.MEDIUM); } else { row.setImageResource(R.drawable.icon_album); }*/ return convertView/*row*/; } } public void onActivityPause() { if (mMusicManager != null) { mMusicManager.setController(null); mMusicManager.postActivity(); } if (mControlManager != null) { mControlManager.setController(null); } super.onActivityPause(); } public void onActivityResume(Activity activity) { super.onActivityResume(activity); if (mMusicManager != null) { mMusicManager.setController(this); } if (mControlManager != null) { mControlManager.setController(this); } } private static final long serialVersionUID = 1088971882661811256L; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4e8b469ba4bffb23ef7b53827b32cb653d3b76c3
1f162386869a0d29348d0d2451341c76d0dbb900
/src/main/java/com/peterstovka/universe/bricksbreaking/orm/Database.java
8e34c244eefdb4835e0007edb8782251331a5deb
[ "MIT" ]
permissive
ptrstovka/bricksbreaking
8939bc10a40db3e647f9baa42883cf6240dabf02
246d44f9d6dc317ba2fcf810ed6e7f259cbe57fb
refs/heads/master
2021-04-18T18:49:30.211659
2018-03-22T18:53:03
2018-03-22T18:53:03
126,150,186
0
0
null
null
null
null
UTF-8
Java
false
false
5,014
java
package com.peterstovka.universe.bricksbreaking.orm; import com.peterstovka.universe.BuildConfig; import java.sql.*; import java.util.List; import java.util.stream.Collectors; import static com.peterstovka.universe.bricksbreaking.foundation.Lists.collect; import static com.peterstovka.universe.bricksbreaking.foundation.Strings.f; public class Database { private static Database instance = null; private static Database testInstance = null; private String url; private String user; private String pass; private Database(String url, String user, String pass) { this.url = url; this.user = user; this.pass = pass; } private Connection connection; public static Database instance() { if (instance == null) { String url = BuildConfig.POSTGRE_DB_URL; String user = BuildConfig.POSTGRE_DB_USER; String pass = BuildConfig.POSTGRE_DB_PASS; instance = new Database(url, user, pass); } return instance; } public static Database test() { if (testInstance == null) { String url = BuildConfig.POSTGRE_TEST_DB_URL; String user = BuildConfig.POSTGRE_TEST_DB_USER; String pass = BuildConfig.POSTGRE_TEST_DB_PASS; testInstance = new Database(url, user, pass); } return testInstance; } public void open() { if (connection != null) { throw new DatabaseException("The database connection is already open."); } try { connection = DriverManager.getConnection(url, user, pass); } catch (SQLException e) { e.printStackTrace(); throw new DatabaseException(f("We could not connect to the [%s] with user [%s] and password [%s].", url, user, pass)); } } public void close() { if (connection == null) { throw new DatabaseException("The database connection is already closed."); } try { connection.close(); connection = null; } catch (SQLException e) { throw new DatabaseException("We could not close the connection."); } } private Connection getConnection() { if (connection == null) { throw new DatabaseException("The database connection must be open."); } return connection; } public void insert(Object model) { InsertStatement insertStatement = new InsertStatement(model); insertStatement.prepare(); PreparedStatement preparedStatement; try { preparedStatement = getConnection().prepareStatement(insertStatement.getStatement()); } catch (SQLException e) { throw new DatabaseException(f("Insert statement is not valid: [%s]", insertStatement.getStatement())); } ReflectionHelpers.bindParameters(preparedStatement, insertStatement.getParameters()); try { preparedStatement.execute(); } catch (SQLException e) { e.printStackTrace(); throw new DatabaseException("The INSERT statement could not be executed."); } } public SelectBuilder select(Class cls) { return new SelectBuilder(this, cls); } public void update(Object object, List<String> primaryKeys) { UpdateStatement statement = new UpdateStatement(object); statement.setKeys(primaryKeys); statement.prepare(); PreparedStatement preparedStatement = prepare(statement.getUpdate()); ReflectionHelpers.bindParameters(preparedStatement, statement.getParameters()); try { preparedStatement.execute(); } catch (SQLException e) { e.printStackTrace(); throw new DatabaseException("The UPDATE statement could not be executed."); } } public void truncate(Class... classes) { List<String> tables = collect(classes) .stream() .map(ReflectionHelpers::tableName) .collect(Collectors.toList()); truncate(tables); } public void truncate(String... tables) { truncate(collect(tables)); } private void truncate(List<String> tables) { TruncateStatement statement = new TruncateStatement(tables); statement.prepare(); try { Statement stmt = getConnection().createStatement(); stmt.executeUpdate(statement.getQuery()); } catch (SQLException e) { e.printStackTrace(); throw new DatabaseException("The TRUNCATE statement could not be executed."); } } protected PreparedStatement prepare(String statement) { try { return getConnection().prepareStatement(statement); } catch (SQLException e) { e.printStackTrace(); throw new DatabaseException(f("Insert statement is not valid: [%s]", statement)); } } }
[ "stovka.peter@gmail.com" ]
stovka.peter@gmail.com
967e1f3315152f74fa7c1667f3e9bfd03249cab3
32f38cd53372ba374c6dab6cc27af78f0a1b0190
/app/src/main/java/com/autonavi/jni/ae/gmap/gloverlay/GLOverlay.java
7cd54ce1d921afe6fddc0085d081cd67fa28ee04
[]
no_license
shuixi2013/AmapCode
9ea7aefb42e0413f348f238f0721c93245f4eac6
1a3a8d4dddfcc5439df8df570000cca12b15186a
refs/heads/master
2023-06-06T23:08:57.391040
2019-08-29T04:36:02
2019-08-29T04:36:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,814
java
package com.autonavi.jni.ae.gmap.gloverlay; import com.autonavi.ae.gmap.gloverlay.BaseMapOverlay; import com.autonavi.jni.ae.gmap.GLMapEngine; public abstract class GLOverlay { public static final int OverlayDrawEventTypeAll = -1; public static final int OverlayDrawEventTypeFinished = 1; public static final int OverlayDrawEventTypeNone = 0; protected boolean isNightStyle = false; protected int mCode; private OnDrawOverlayListener mDrawOverlayListener = null; protected int mEngineID; protected akq mGLMapView; protected boolean mIsInBundle = false; protected int mItemPriority = 0; protected long mNativeInstance = 0; private int mOverlayDrawObserverType = 0; public enum AnimationStatusType { AnimationStatusTypeNone(0), AnimationStatusTypeStart(1), AnimationStatusTypeDoing(2), AnimationStatusTypeNormalEnd(3), AnimationStatusTypeForceEnd(4), AnimationStatusTypeRemoved(5); private final int value; private AnimationStatusType(int i) { this.value = i; } public final int value() { return this.value; } public static AnimationStatusType valueOf(int i) { switch (i) { case 1: return AnimationStatusTypeStart; case 2: return AnimationStatusTypeDoing; case 3: return AnimationStatusTypeNormalEnd; case 4: return AnimationStatusTypeForceEnd; case 5: return AnimationStatusTypeRemoved; default: return AnimationStatusTypeNone; } } } public enum EAMapOverlayTpye { AMAPOVERLAY_POINT, AMAPOVERLAY_POLYLINE, AMAPOVERLAY_POLYGON, AMAPOVERLAY_NAVI, AMAPOVERLAY_GPS, AMAPOVERLAY_ARC, AMAPOVERLAY_ARROW, AMAPOVERLAY_VECTOR, AMAPOVERLAY_MODEL, AMAPOVERLAY_RCTROUTE, AMAPOVERLAY_ROUTE, AMAPOVERLAY_WATERWAVE, AMAPOVERLAY_PLANE, AMAPOVERLAY_RASTER, AMAPOVERLAY_SKELETON } public enum EOverlaySubType { ESubTypeMember(20180622); private int mValue; private EOverlaySubType(int i) { this.mValue = i; } public final int value() { return this.mValue; } } public interface OnDrawOverlayListener { void onProcessOverlayDrawEvent(OverlayDrawEvent overlayDrawEvent); } public static class OverlayAnimationEvent { public long mAnimationObject; public int mEngineID; public AnimationStatusType mStatus; public OverlayAnimationEvent(int i, int i2, long j) { this.mStatus = AnimationStatusType.valueOf(i); this.mEngineID = i2; this.mAnimationObject = j; } } public interface OverlayAnimationListener { void onProcessOverlayAnimationEvent(OverlayAnimationEvent overlayAnimationEvent); } public static class OverlayDrawEvent { int mEventType; GLOverlay mOverlay; public OverlayDrawEvent(GLOverlay gLOverlay, int i) { this.mOverlay = gLOverlay; this.mEventType = i; } public GLOverlay getOverlay() { return this.mOverlay; } public int getEventType() { return this.mEventType; } } private static native int nativeGetCount(long j); private static native float[] nativeGetDisplayScale(long j); private static native int nativeGetOverlayDrawObserverType(long j, GLOverlay gLOverlay); private static native int nativeGetOverlayPriority(long j); private static native int nativeGetSubType(long j); private static native int nativeGetType(long j); private static native boolean nativeIsClickable(long j); private static native boolean nativeIsVisible(long j); private static native void nativeRemoveAll(long j); private static native void nativeRemoveItem(long j, int i); private static native void nativeSetClickable(long j, boolean z); private static native void nativeSetMaxDisplayLevel(long j, float f); private static native void nativeSetMinDisplayLevel(long j, float f); private static native void nativeSetOverlayDrawObserver(long j, OnDrawOverlayListener onDrawOverlayListener, GLOverlay gLOverlay); private static native void nativeSetOverlayDrawObserverType(long j, int i, GLOverlay gLOverlay); private static native void nativeSetOverlayItemPriority(long j, int i); private static native void nativeSetOverlayOnTop(long j, boolean z); private static native void nativeSetOverlayPriority(long j, int i); private static native void nativeSetOverlayPriority(long j, int i, int i2); private static native void nativeSetOverlaySubType(long j, int i); private static native void nativeSetShownMaxCount(long j, int i); protected static native void nativeSetVisible(long j, boolean z); public void clearFocus() { } public GLOverlay(int i, akq akq, int i2) { this.mEngineID = i; this.mGLMapView = akq; this.mCode = i2; this.mNativeInstance = 0; this.mItemPriority = 0; } public long getNativeInstatnce() { return this.mNativeInstance; } public int getCode() { return this.mCode; } public int getType() { if (this.mNativeInstance == 0) { return -1; } return nativeGetType(this.mNativeInstance); } public int getSubType() { if (this.mNativeInstance == 0) { return -1; } return nativeGetSubType(this.mNativeInstance); } public void removeItem(int i) { if (this.mNativeInstance != 0) { nativeRemoveItem(this.mNativeInstance, i); } } public void removeAll() { if (this.mNativeInstance != 0) { nativeRemoveAll(this.mNativeInstance); if (this.mGLMapView != null) { this.mGLMapView.r(this.mGLMapView.d.getBelongToRenderDeviceId(this.mEngineID)); } } } public int getSize() { if (this.mNativeInstance == 0) { return 0; } return nativeGetCount(this.mNativeInstance); } public void setVisible(boolean z) { if (this.mNativeInstance != 0) { nativeSetVisible(this.mNativeInstance, z); this.mGLMapView.r(this.mGLMapView.d.getBelongToRenderDeviceId(this.mEngineID)); } } public boolean isVisible() { if (this.mNativeInstance == 0) { return false; } return nativeIsVisible(this.mNativeInstance); } public void setClickable(boolean z) { if (this.mNativeInstance != 0) { nativeSetClickable(this.mNativeInstance, z); } } public boolean isClickable() { if (this.mNativeInstance == 0) { return false; } return nativeIsClickable(this.mNativeInstance); } public boolean getIsInBundle() { return this.mIsInBundle; } public void setMaxCountShown(int i) { nativeSetShownMaxCount(this.mNativeInstance, i); } public void setOverlayOnTop(boolean z) { nativeSetOverlayOnTop(this.mNativeInstance, z); } public void setMinDisplayLevel(float f) { nativeSetMinDisplayLevel(this.mNativeInstance, f); } public void setMaxDisplayLevel(float f) { nativeSetMaxDisplayLevel(this.mNativeInstance, f); } public void setOverlayPriority(int i, int i2) { if (0 != this.mNativeInstance) { nativeSetOverlayPriority(this.mNativeInstance, i, i2); this.mGLMapView.p(this.mGLMapView.C(this.mEngineID)); } } public void setOverlayPriority(int i) { nativeSetOverlayPriority(this.mNativeInstance, i); GLOverlayBundle<BaseMapOverlay<?, ?>> s = this.mGLMapView.s(this.mEngineID); if (s != null) { s.sortOverlay(); } } public int getOverlayPriority() { return nativeGetOverlayPriority(this.mNativeInstance); } public void setOverlayItemPriority(int i) { this.mItemPriority = i; } /* access modifiers changed from: protected */ public void finalize() throws Throwable { releaseInstance(); super.finalize(); } public void releaseInstance() { setDrawOverlayListener(null); if (this.mNativeInstance != 0) { long j = this.mNativeInstance; this.mNativeInstance = 0; GLMapEngine.destoryOverlay(this.mEngineID, j); } } public float getMinDisplayLevel() { float[] displayScale = getDisplayScale(); if (displayScale == null || displayScale.length != 2) { return 0.0f; } return displayScale[0]; } public float getMaxDisplayLevel() { float[] displayScale = getDisplayScale(); if (displayScale == null || displayScale.length != 2) { return 0.0f; } return displayScale[1]; } public float[] getDisplayScale() { if (this.mNativeInstance == 0) { return null; } return nativeGetDisplayScale(this.mNativeInstance); } public void setSubType(EOverlaySubType eOverlaySubType) { if (this.mNativeInstance != 0) { nativeSetOverlaySubType(this.mNativeInstance, eOverlaySubType.value()); } } public void useNightStyle(boolean z) { this.isNightStyle = z; } public void setDrawOverlayListener(OnDrawOverlayListener onDrawOverlayListener) { this.mDrawOverlayListener = onDrawOverlayListener; if (this.mNativeInstance != 0) { nativeSetOverlayDrawObserver(this.mNativeInstance, this.mDrawOverlayListener, this); if (!(this.mOverlayDrawObserverType == 0 || this.mDrawOverlayListener == null)) { nativeSetOverlayDrawObserverType(this.mNativeInstance, this.mOverlayDrawObserverType, this); } } } public void setOverlayDrawObserverType(int i) { this.mOverlayDrawObserverType = i; if (this.mNativeInstance != 0) { nativeSetOverlayDrawObserverType(this.mNativeInstance, i, this); } } public int getOverlayDrawObserverType() { if (this.mNativeInstance == 0 || this.mDrawOverlayListener == null) { return this.mOverlayDrawObserverType; } return nativeGetOverlayDrawObserverType(this.mNativeInstance, this); } }
[ "hubert.yang@nf-3.com" ]
hubert.yang@nf-3.com
82364d4c58b98cb4d488f20044d1a64b29593676
ab6c0bc74dff2b522618ae4192b63ca879f3d07a
/utp-trade-ht/utp-sdk/utp-sdk-precard/src/main/java/cn/kingnet/utp/sdk/precard/dto/DownloadIndustryReconcileFileReqDTO.java
db0a454b0116bd16e802625053682ac9d70454de
[]
no_license
exyangbang/learngit
9669cb329c9686db96bd250a6ceceaf44f02e945
12c92df41a6b778a9db132c37dd136bedfd5b56f
refs/heads/master
2023-02-16T20:49:57.437363
2021-01-16T07:45:17
2021-01-16T07:45:17
330,107,905
0
0
null
null
null
null
UTF-8
Java
false
false
490
java
package cn.kingnet.utp.sdk.precard.dto; import cn.kingnet.utp.sdk.core.dto.BaseRequestDTO; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; /** * @Description * @Author WJH * @Date 2018年11月07日 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class DownloadIndustryReconcileFileReqDTO extends BaseRequestDTO { /** * 源文件清算日期对账日期 */ private String settleDate; }
[ "945288603@qq.com" ]
945288603@qq.com
40b7cb92b638defacb0adf09ce08dfdceec1c5ad
7a36817e7eabe8caebd670addba48726a904efa7
/edu/ucla/sspace/util/IteratorDecorator.java
a69369c719ce73e95f0be91917980c727776918c
[]
no_license
carolinemckinnon/Lex
1958f7a50e5d469efbb33f70e4e166220bc3548e
4fc78f209a22cd5b20e21f654a081d09bbeead6e
refs/heads/master
2021-01-19T20:57:33.441323
2017-04-18T04:49:43
2017-04-18T04:49:43
88,582,569
0
0
null
null
null
null
UTF-8
Java
false
false
662
java
package edu.ucla.sspace.util; import java.io.Serializable; import java.util.Iterator; public class IteratorDecorator<T> implements Iterator<T>, Serializable { private static final long serialVersionUID = 1L; private final Iterator<T> iter; protected T cur; public IteratorDecorator(Iterator<T> iter) { if (iter == null) throw new NullPointerException(); this.iter = iter; } public boolean hasNext() { return iter.hasNext(); } public T next() { cur = iter.next(); return cur; } public void remove() { cur = null; iter.remove(); } }
[ "carolinemckinnon@d-i184-49-48.staff.eduroam.uq.edu.au" ]
carolinemckinnon@d-i184-49-48.staff.eduroam.uq.edu.au
217bc0b5c7c2314bd40b160d432b47398e4fcbdc
9c874cb0e9682b220a2992ccb0341009a9753922
/src/main/java/asint/ClaseLexica.java
7cb02f4129d5ceb922d0d496614d34689c14bbc4
[]
no_license
b0r1s/JavaCompiler
8ffb8e8842dcba70beeb9d7de64e86e5180e80a7
d4bbcfcd0cb179798e2c573fbc1619b14cd7dc46
refs/heads/master
2023-07-05T17:55:40.193910
2021-08-14T06:24:33
2021-08-14T06:24:33
395,897,643
0
0
null
null
null
null
UTF-8
Java
false
false
2,222
java
//---------------------------------------------------- // The following code was generated by CUP v0.11b beta 20140220 // Tue Jun 16 01:39:03 CEST 2020 //---------------------------------------------------- package asint; /** CUP generated class containing symbol constants. */ public class ClaseLexica { /* terminals */ public static final int INTERROG = 38; public static final int MAS_MAS = 35; public static final int VALOR_DOUBLE = 10; public static final int POR = 31; public static final int CHAR = 11; public static final int VALOR_CHAR = 12; public static final int PAR_AP = 40; public static final int IDENTIF = 2; public static final int MENOS_MENOS = 36; public static final int DOUBLE = 9; public static final int DOS_PUNTOS = 39; public static final int INT = 7; public static final int FOR = 20; public static final int AND = 22; public static final int IGUAL = 37; public static final int CORCH_CI = 43; public static final int OR = 21; public static final int CLASS = 16; public static final int LLAVE_AP = 44; public static final int DIV = 32; public static final int VALOR_INT = 8; public static final int IF = 18; public static final int THIS = 3; public static final int EOF = 0; public static final int BOOLEAN = 4; public static final int RETURN = 17; public static final int TRUE = 5; public static final int PAR_CI = 41; public static final int NEW = 14; public static final int error = 1; public static final int COMA = 46; public static final int MENOS = 30; public static final int NULL = 15; public static final int MENOR = 25; public static final int MOD = 33; public static final int VOID = 13; public static final int DIST_COMP = 24; public static final int MAYOR = 27; public static final int ELSE = 19; public static final int PUNTO = 48; public static final int MAYOR_IGUAL = 28; public static final int LLAVE_CI = 45; public static final int IGUAL_COMP = 23; public static final int MENOR_IGUAL = 26; public static final int FALSE = 6; public static final int CORCH_AP = 42; public static final int NEGADO = 34; public static final int PYC = 47; public static final int MAS = 29; }
[ "boriscarballa98@gmail.com" ]
boriscarballa98@gmail.com