blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
f8571febdc6b33978e137393c6cdacf9e5316351
4e53569b84e430534b6cf501b6b1ce9a7b996180
/melone/src/main/java/com/tjhx/dao/jpa/account/PermissionJpaDao.java
27fe8b8b99c065ac35bc1cc1fa38fc5e74082768
[]
no_license
hebei8267/meloneehr
3010a437acda3416d42d743b4f64da715860bb8b
0eebd817082296a00862919812f259c9a80c7f14
refs/heads/master
2021-01-23T19:38:36.021189
2014-01-12T05:02:31
2014-01-12T05:02:31
32,136,383
1
0
null
null
null
null
UTF-8
Java
false
false
1,170
java
package com.tjhx.dao.jpa.account; import java.util.List; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; import com.tjhx.entity.account.Permission; //Repository<T, ID>----可能暴露了你不希望暴露给业务层的方法。比如某些接口你只希望提供增加的操作而不希望提供删除的方法 //CrudRepository<T, ID>----自动为域对象创建增删改查方法 //PagingAndSortingRepository<T, ID>----在 CrudRepository 基础上新增了两个与分页有关的方法 //JpaRepository<T, ID>----JpaRepository 是继承自 PagingAndSortingRepository 的针对 JPA 技术提供的接口,它在父接口的基础上,提供了其他一些方法,比如 flush(),saveAndFlush(),deleteInBatch() 等 /** * 资源访问权限JpaDao */ public interface PermissionJpaDao extends CrudRepository<Permission, Integer> { @Query("select perm from Permission perm left join perm.role role where role.name = :roleName") public List<Permission> findPermissionByRoleName(@Param("roleName") String roleName); }
[ "hebei198267@gmail.com@30b3abd0-cf4e-0410-978e-df9001e6a3d7" ]
hebei198267@gmail.com@30b3abd0-cf4e-0410-978e-df9001e6a3d7
57eda19e8783f1c7e4d71ee4886fc971580115b2
419fe034a0a028eab7da60864a5b3289c6630ba0
/deprecated/UltimateAndroidGradle/ultimateandroiduianimation/src/main/java/com/marshalchen/common/uimodule/niftymodaldialogeffects/effects/NewsPaper.java
d834177e539d722f7c8b8844fa92c968c2a75ba9
[ "Apache-2.0" ]
permissive
netstu/UltimateAndroid
bcf1ba2d55f22a9c9eb74f975a15b429b3ce683f
5abd6794e1bbc885e83600df532436b83a21b6e3
refs/heads/master
2023-02-28T19:59:52.727390
2019-04-04T07:50:18
2019-04-04T07:50:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
728
java
package com.marshalchen.common.uimodule.niftymodaldialogeffects.effects; import android.view.View; import com.nineoldandroids.animation.ObjectAnimator; /** * Created by lee on 2014/7/31. */ public class NewsPaper extends BaseEffects{ @Override protected void setupAnimation(View view) { getAnimatorSet().playTogether( ObjectAnimator.ofFloat(view, "rotation", 1080,720,360,0).setDuration(mDuration), ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration*3/2), ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.5f, 1).setDuration(mDuration), ObjectAnimator.ofFloat(view,"scaleY",0.1f,0.5f,1).setDuration(mDuration) ); } }
[ "cymcsg@gmail.com" ]
cymcsg@gmail.com
9373fabed5a83d375937add97da22cc6741a971e
8980782c811965902419ca459a5cdb525c171e42
/frame-shiro-support/src/main/java/com/lvmoney/shiro/init/AfterStartupInit.java
34d67858bc1f4045a1b426d84c463dfabd111642
[]
no_license
magicyork/frame
c0b21dae259c6e21459faf3373b87bc2c618e2a9
fd09e0edec7abfdd4e02ae50c0d538db05d50ca9
refs/heads/master
2020-07-07T18:38:06.976917
2019-08-05T03:43:53
2019-08-05T03:43:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,560
java
package com.lvmoney.shiro.init;/** * 描述: * 包名:com.lvmoney.jwt.annotation * 版本信息: 版本1.0 * 日期:2019/2/22 * Copyright xxxx科技有限公司 */ import com.lvmoney.shiro.annotations.ShiroResouce; import com.lvmoney.shiro.ro.ShiroServerRo; import com.lvmoney.shiro.service.ShiroRedisService; import com.lvmoney.shiro.vo.SysServiceDataVo; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition; import org.springframework.web.servlet.mvc.method.RequestMappingInfo; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * @describe: * @author: lvmoney /xxxx科技有限公司 * @version:v1.0 2018年10月30日 下午3:29:38 */ @Service public class AfterStartupInit implements InitializingBean { @Autowired private RequestMappingHandlerMapping requestMappingHandlerMapping; @Autowired ShiroRedisService shiroRedisService; @Override public void afterPropertiesSet() throws Exception { List<SysServiceDataVo> shiroServerData = new ArrayList<SysServiceDataVo>(); shiroRedisService.deleteShiroServerData(); Map<RequestMappingInfo, HandlerMethod> map = requestMappingHandlerMapping.getHandlerMethods(); for (Map.Entry<RequestMappingInfo, HandlerMethod> m : map.entrySet()) { SysServiceDataVo sysServiceDataVo = new SysServiceDataVo(); RequestMappingInfo info = m.getKey(); HandlerMethod handlerMethod = m.getValue(); PatternsRequestCondition p = info.getPatternsCondition(); for (String url : p.getPatterns()) { sysServiceDataVo.setUri(url); } Method method = handlerMethod.getMethod(); if (method.isAnnotationPresent(ShiroResouce.class)) { ShiroResouce shiroResouce = method.getAnnotation(ShiroResouce.class); sysServiceDataVo.setDescrption(shiroResouce.descrption()); } shiroServerData.add(sysServiceDataVo); } ShiroServerRo shiroServerRo = new ShiroServerRo(); shiroServerRo.setSysServiceDataVoList(shiroServerData); shiroRedisService.saveShiroServerData(shiroServerRo); } }
[ "xmangl1990728" ]
xmangl1990728
808173419e8d69a8f431e99215ac3b88fc0a22b3
154a6d740e3070e13d6fde685727213bb2e833db
/app/src/main/java/ar/com/brasseur/afipandroid/ioc/AfipApplicationComponent.java
74ac7733651a92db1ed66d914e674bb67051e16b
[ "Apache-2.0" ]
permissive
NibiruOS/afip-android-demo
5a9069c9fc2a25dce20df1e81de474e632a055e1
8cfc82b131bab0f8eb8063565c9f0c2cafe493b9
refs/heads/master
2020-03-30T23:52:03.985005
2018-10-15T16:49:10
2018-10-15T19:42:43
151,716,478
0
0
null
null
null
null
UTF-8
Java
false
false
733
java
package ar.com.brasseur.afipandroid.ioc; import javax.inject.Singleton; import ar.com.brasseur.afipandroid.AfipApplication; import dagger.Component; import dagger.android.AndroidInjector; import dagger.android.support.AndroidSupportInjectionModule; @Singleton @Component(modules = { AndroidSupportInjectionModule.class, AndroidModule.class, ActivityModule.class, ApplicationModule.class, BusinessModule.class, DatabaseModule.class, ServiceModule.class, ParametrosActivityModule.class, SettingsActivityModule.class, }) public interface AfipApplicationComponent extends AndroidInjector<AfipApplication> { void inject(AfipApplication application); }
[ "lbrasseur@gmail.com" ]
lbrasseur@gmail.com
bffb527647f01d394964539a4e7f4c3fc590ee25
97aac7aa73a5fcf5b10cf084dc8622616663e5c6
/src/main/java/io/github/nucleuspowered/nucleus/modules/mute/commands/VoiceCommand.java
c3c27f34390bd8c5fb4de2ec0e2f5e9acdd9e61a
[ "MIT" ]
permissive
Dirt-Craft/Nucleus
5f5ebbcd523ac0712c8e580b63bf472fcfd961ef
7d140ebf6b100162834df80e947735ad6bc09383
refs/heads/master
2021-08-18T09:48:08.191641
2021-06-13T10:33:16
2021-06-13T10:33:16
191,478,397
0
0
MIT
2021-06-13T10:33:31
2019-06-12T01:55:13
Java
UTF-8
Java
false
false
4,653
java
/* * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file * at the root of this project for more details. */ package io.github.nucleuspowered.nucleus.modules.mute.commands; import io.github.nucleuspowered.nucleus.Nucleus; import io.github.nucleuspowered.nucleus.internal.annotations.RunAsync; import io.github.nucleuspowered.nucleus.internal.annotations.command.NoModifiers; import io.github.nucleuspowered.nucleus.internal.annotations.command.Permissions; import io.github.nucleuspowered.nucleus.internal.annotations.command.RegisterCommand; import io.github.nucleuspowered.nucleus.internal.command.AbstractCommand; import io.github.nucleuspowered.nucleus.internal.command.NucleusParameters; import io.github.nucleuspowered.nucleus.internal.permissions.PermissionInformation; import io.github.nucleuspowered.nucleus.internal.permissions.SuggestedLevel; import io.github.nucleuspowered.nucleus.modules.mute.services.MuteHandler; import io.github.nucleuspowered.nucleus.util.PermissionMessageChannel; import org.spongepowered.api.command.CommandResult; import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.command.args.CommandContext; import org.spongepowered.api.command.args.CommandElement; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.event.cause.Cause; import org.spongepowered.api.text.channel.MutableMessageChannel; import org.spongepowered.api.util.annotation.NonnullByDefault; import java.util.Map; import java.util.UUID; @RunAsync @NoModifiers @Permissions(prefix = "globalmute") @RegisterCommand("voice") @NonnullByDefault public class VoiceCommand extends AbstractCommand<CommandSource> { private final MuteHandler muteHandler = getServiceUnchecked(MuteHandler.class); @Override protected Map<String, PermissionInformation> permissionSuffixesToRegister() { Map<String, PermissionInformation> m = super.permissionSuffixesToRegister(); m.put("auto", PermissionInformation.getWithTranslation("permission.voice.auto", SuggestedLevel.ADMIN)); m.put("notify", PermissionInformation.getWithTranslation("permission.voice.notify", SuggestedLevel.ADMIN)); return m; } @Override public CommandElement[] getArguments() { return new CommandElement[] { NucleusParameters.ONE_PLAYER, NucleusParameters.OPTIONAL_ONE_TRUE_FALSE }; } @Override public CommandResult executeCommand(CommandSource src, CommandContext args, Cause cause) { if (!this.muteHandler.isGlobalMuteEnabled()) { src.sendMessage(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.voice.globaloff")); return CommandResult.empty(); } Player pl = args.<Player>getOne(NucleusParameters.Keys.PLAYER).get(); if (this.permissions.testSuffix(pl, "auto")) { src.sendMessage(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.voice.autovoice", pl.getName())); return CommandResult.empty(); } boolean turnOn = args.<Boolean>getOne(NucleusParameters.Keys.BOOL).orElse(!this.muteHandler.isVoiced(pl.getUniqueId())); UUID voice = pl.getUniqueId(); if (turnOn == this.muteHandler.isVoiced(voice)) { if (turnOn) { src.sendMessage(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.voice.alreadyvoiced", pl.getName())); } else { src.sendMessage(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.voice.alreadynotvoiced", pl.getName())); } return CommandResult.empty(); } MutableMessageChannel mmc = new PermissionMessageChannel(this.permissions.getPermissionWithSuffix("notify")).asMutable(); mmc.addMember(src); if (turnOn) { this.muteHandler.addVoice(pl.getUniqueId()); mmc.send(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.voice.voiced.source", pl.getName())); pl.sendMessage(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.voice.voiced.target")); } else { this.muteHandler.removeVoice(pl.getUniqueId()); mmc.send(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.voice.voiced.source", pl.getName())); pl.sendMessage(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.voice.voiced.target")); } return CommandResult.success(); } }
[ "git@drnaylor.co.uk" ]
git@drnaylor.co.uk
8674fa29d1e7f9c5114a6503028d4bf4b3510abf
5c9785491ca90f3ea94c82e162b385b1bb9373c4
/app/src/main/java/com/example/android/mydbab/userfrags/fragA.java
48db3c8250ecd7873116ac0422ee704948c4a99b
[]
no_license
yoisef/MyDbab
8cd903b7e36f784686adebf6283cd2d442db79b4
6182c997c329c56cf81cd460ab57d6978b08b5de
refs/heads/master
2020-03-18T23:00:52.937802
2018-05-30T02:43:21
2018-05-30T02:43:21
135,378,174
0
0
null
null
null
null
UTF-8
Java
false
false
605
java
package com.example.android.mydbab.userfrags; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.example.android.mydbab.R; public class fragA extends Fragment { @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fraga,container,false); } }
[ "test@test.test" ]
test@test.test
965b782f0492880a4431530fb5179f97f8d6e532
84714ec1201114756324e4dca8f3730736f032a4
/src/main/java/org/minimalj/util/LoggingRuntimeException.java
5d7450e1e79b0d0542f954421e2b0168ed21e418
[ "Apache-2.0" ]
permissive
BrunoEberhard/minimal-j
5e896f244bcce11dbac5b4b2612814b877332fa2
6173c9ace6dcfc4232f31c47cc8286352a12a4ca
refs/heads/master
2023-08-29T02:45:08.860372
2023-07-08T04:55:34
2023-07-08T04:55:34
33,410,104
19
4
Apache-2.0
2023-07-08T04:55:35
2015-04-04T15:27:40
Java
UTF-8
Java
false
false
341
java
package org.minimalj.util; import java.util.logging.Level; import java.util.logging.Logger; public class LoggingRuntimeException extends RuntimeException { private static final long serialVersionUID = 1L; public LoggingRuntimeException(Exception x, Logger logger, String text) { super(text); logger.log(Level.SEVERE, text, x); } }
[ "bruno.eberhard@pop.ch" ]
bruno.eberhard@pop.ch
705ca24ffd08ace9a703c5ebdd675312afe0b731
ad64a14fac1f0d740ccf74a59aba8d2b4e85298c
/linkwee-supermarket/src/main/java/com/linkwee/api/request/sm/AddRequestRecordRequest.java
17d6d140c43c15f25cf55601fa4f41f70fc38a25
[]
no_license
zhangjiayin/supermarket
f7715aa3fdd2bf202a29c8683bc9322b06429b63
6c37c7041b5e1e32152e80564e7ea4aff7128097
refs/heads/master
2020-06-10T16:57:09.556486
2018-10-30T07:03:15
2018-10-30T07:03:15
193,682,975
0
1
null
2019-06-25T10:03:03
2019-06-25T10:03:03
null
UTF-8
Java
false
false
2,078
java
package com.linkwee.api.request.sm; import javax.validation.constraints.NotNull; public class AddRequestRecordRequest { /** *用户编码 */ private String userId; /** *请求路径 */ @NotNull(message="请求路径不能为空") private String requestUrl; /** *请求路径说明 */ @NotNull(message="请求路径说明不能为空") private String requestUrlRemark; /** *设备id */ private String deviceId; /** *设备详情 */ private String deviceDetail; /** *设备分辨率 */ private String deviceResolution; /** *手机系统版本号 */ private String systemVersion; /** *app版本号 */ private String appversion; public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getRequestUrl() { return requestUrl; } public void setRequestUrl(String requestUrl) { this.requestUrl = requestUrl; } public String getRequestUrlRemark() { return requestUrlRemark; } public void setRequestUrlRemark(String requestUrlRemark) { this.requestUrlRemark = requestUrlRemark; } public String getDeviceId() { return deviceId; } public void setDeviceId(String deviceId) { this.deviceId = deviceId; } public String getDeviceDetail() { return deviceDetail; } public void setDeviceDetail(String deviceDetail) { this.deviceDetail = deviceDetail; } public String getDeviceResolution() { return deviceResolution; } public void setDeviceResolution(String deviceResolution) { this.deviceResolution = deviceResolution; } public String getSystemVersion() { return systemVersion; } public void setSystemVersion(String systemVersion) { this.systemVersion = systemVersion; } public String getAppversion() { return appversion; } public void setAppversion(String appversion) { this.appversion = appversion; } }
[ "liqimoon@qq.com" ]
liqimoon@qq.com
34c0b702b49afeea5f6abc252724434df90eb52f
cff2f4931d6f0abca33d37d3d2e731908da5a150
/java-ocpjp/src/kyocoolcool/ch03/Test.java
ca295e0ea65d261ba764abad37bcdb590417796a
[]
no_license
kyocoolcool/java-tutorial
66f58d4c7d376ae9e7fa7a1b101eaa306c4eab3d
97a86477617ece81fa9e7d265b8857f7aa226416
refs/heads/master
2021-07-12T23:01:18.714658
2020-09-11T06:31:56
2020-09-11T06:31:56
204,008,117
0
0
null
null
null
null
UTF-8
Java
false
false
724
java
package kyocoolcool.ch03; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * @author Chris Chen https://kyocoolcool.com * @version 1.0 * @className Test * @description * @date 2020/6/23 3:48 PM **/ public class Test { public static void main(String[] args) { String[] strs = {"aaa", "bbb"}; final List<String> list = Arrays.asList(strs); System.out.println(list); list.set(1, "test"); System.out.println(list); strs[0] = "ccc"; System.out.println(list); final String[] s = (String[]) list.toArray(); list.remove(0); final ArrayList<String> list1 = new ArrayList(); list1.add("1"); } }
[ "kyocoolcool@hotmail.com" ]
kyocoolcool@hotmail.com
d4a24f2000f51a601ec1595395c68e3ccd8158e3
6ef4869c6bc2ce2e77b422242e347819f6a5f665
/devices/google/Pixel 2/29/QPP6.190730.005/src/okhttp/com/android/okhttp/HttpsHandler.java
ce04a9188cc7626d26e7a183cc96ef9c92371ab0
[]
no_license
hacking-android/frameworks
40e40396bb2edacccabf8a920fa5722b021fb060
943f0b4d46f72532a419fb6171e40d1c93984c8e
refs/heads/master
2020-07-03T19:32:28.876703
2019-08-13T03:31:06
2019-08-13T03:31:06
202,017,534
2
0
null
2019-08-13T03:33:19
2019-08-12T22:19:30
Java
UTF-8
Java
false
false
2,267
java
/* * Decompiled with CFR 0.145. */ package com.android.okhttp; import com.android.okhttp.CertificatePinner; import com.android.okhttp.ConfigAwareConnectionPool; import com.android.okhttp.ConnectionPool; import com.android.okhttp.ConnectionSpec; import com.android.okhttp.ConnectionSpecs; import com.android.okhttp.HttpHandler; import com.android.okhttp.OkHttpClient; import com.android.okhttp.OkUrlFactories; import com.android.okhttp.OkUrlFactory; import com.android.okhttp.Protocol; import java.net.Proxy; import java.util.Collections; import java.util.List; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; public final class HttpsHandler extends HttpHandler { private static final List<Protocol> HTTP_1_1_ONLY; private static final ConnectionSpec TLS_CONNECTION_SPEC; private final ConfigAwareConnectionPool configAwareConnectionPool = ConfigAwareConnectionPool.getInstance(); static { TLS_CONNECTION_SPEC = ConnectionSpecs.builder(true).allEnabledCipherSuites().allEnabledTlsVersions().supportsTlsExtensions(true).build(); HTTP_1_1_ONLY = Collections.singletonList(Protocol.HTTP_1_1); } public static OkUrlFactory createHttpsOkUrlFactory(Proxy object) { object = HttpHandler.createHttpOkUrlFactory((Proxy)object); OkUrlFactories.setUrlFilter((OkUrlFactory)object, null); OkHttpClient okHttpClient = ((OkUrlFactory)object).client(); okHttpClient.setProtocols(HTTP_1_1_ONLY); okHttpClient.setConnectionSpecs(Collections.singletonList(TLS_CONNECTION_SPEC)); okHttpClient.setCertificatePinner(CertificatePinner.DEFAULT); ((OkUrlFactory)object).client().setHostnameVerifier(HttpsURLConnection.getDefaultHostnameVerifier()); okHttpClient.setSslSocketFactory(HttpsURLConnection.getDefaultSSLSocketFactory()); return object; } @Override protected int getDefaultPort() { return 443; } @Override protected OkUrlFactory newOkUrlFactory(Proxy object) { object = HttpsHandler.createHttpsOkUrlFactory((Proxy)object); ((OkUrlFactory)object).client().setConnectionPool(this.configAwareConnectionPool.get()); return object; } }
[ "me@paulo.costa.nom.br" ]
me@paulo.costa.nom.br
8b20944d7f70693ca6f48867c98ac8a2c17ad1d1
320a43287196b09eb160137a33a22312e6677c6a
/cf-forgot-spring/cf-dependency-injection/src/main/java/org/geekbang/thinking/in/spring/dependency/injection/AnnotationDependencySetterInjectionDemo.java
b7b692ef0a5d958be6a7e7d4047106ede10518f0
[]
no_license
yangzw137/cf-forgot-java
050a389069d5da0b294f2511755798e68ebd9a8a
7b23eefaa1e58790eef81367779b6eece2f94ecb
refs/heads/master
2023-05-14T05:44:43.899461
2021-06-06T03:05:58
2021-06-06T03:05:58
287,706,495
0
2
null
null
null
null
UTF-8
Java
false
false
1,328
java
package org.geekbang.thinking.in.spring.dependency.injection; import org.geekbang.thinking.in.spring.ioc.overview.domain.User; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; /** * Description: * <p> * @date 2020/9/13 * @since */ public class AnnotationDependencySetterInjectionDemo { public static void main(String[] args) { AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(); XmlBeanDefinitionReader xmlBeanDefinitionReader = new XmlBeanDefinitionReader(applicationContext); String location = "classpath:/META-INF/dependency-lookup-context.xml"; xmlBeanDefinitionReader.loadBeanDefinitions(location); applicationContext.register(AnnotationDependencySetterInjectionDemo.class); applicationContext.refresh(); UserHolder userHolder = applicationContext.getBean(UserHolder.class); System.out.println("userHolder: " + userHolder); applicationContext.close(); } @Bean public UserHolder userHolder(User user) { UserHolder userHolder = new UserHolder(); userHolder.setUser(user); return userHolder; } }
[ "yangzhiwei@jd.com" ]
yangzhiwei@jd.com
50b9d3000c51c0eb6e9e602588cb48c41b165ad3
1d32aa38e4e0e0c93fbb0cc259bc3ab3b1385afc
/app/src/main/java/com/bigpumpkin/app/ddng_android/adapter/Order_Adapter.java
2e829cb4394f58c49f99b5df9a8395969be41500
[]
no_license
GuYou957641694/ddng_android
196df72fde36a64108a3cbb6fe980a3a256f1d86
70ff91b03001db3c3a69d63ab86a89ade013115c
refs/heads/master
2020-07-11T16:07:17.255963
2019-12-12T03:01:59
2019-12-12T03:01:59
204,591,311
0
0
null
null
null
null
UTF-8
Java
false
false
3,514
java
package com.bigpumpkin.app.ddng_android.adapter; import android.content.Context; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import com.bigpumpkin.app.ddng_android.R; import com.bigpumpkin.app.ddng_android.bean.Collections_Bean; import com.bigpumpkin.app.ddng_android.bean.Order_Bean; import com.bigpumpkin.app.ddng_android.config.Urls; import com.bumptech.glide.Glide; import java.util.List; public class Order_Adapter extends RecyclerView.Adapter<Order_Adapter.MyViewHolder> { private List<Order_Bean.DataBean.ListBean> dataBean; private Context context; public Order_Adapter(List<Order_Bean.DataBean.ListBean> dataBean, Context context) { this.dataBean = dataBean; this.context = context; } @NonNull @Override public MyViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { //获取相应的布局 View view = LayoutInflater.from(context).inflate(R.layout.grow_item, viewGroup, false); final Order_Adapter.MyViewHolder holder = new Order_Adapter.MyViewHolder(view); return holder; } @Override public void onBindViewHolder(@NonNull MyViewHolder myViewHolder, final int i) { if (dataBean != null) { Glide.with(context).load(Urls.BASEURL + dataBean.get(i).getImg_pic()).into(myViewHolder.pic); myViewHolder.name.setText(dataBean.get(i).getTitle()); myViewHolder.varieties.setText(dataBean.get(i).getCp_title()); myViewHolder.price.setText("拼单人数:" + dataBean.get(i).getNum() + "人"); myViewHolder.ctime.setText("拼单价格:" + dataBean.get(i).getAmount() + "元"); myViewHolder.etime.setVisibility(View.GONE); myViewHolder.type.setVisibility(View.GONE); //查看信息 myViewHolder.details.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (listener != null) { listener.onClick(i); } } }); } } @Override public int getItemCount() { return dataBean.size(); } public class MyViewHolder extends RecyclerView.ViewHolder { private final ImageView pic; private final TextView name, varieties, price, ctime, etime, type; private final Button details, information; public MyViewHolder(@NonNull View itemView) { super(itemView); pic = itemView.findViewById(R.id.pic); name = itemView.findViewById(R.id.name); varieties = itemView.findViewById(R.id.varieties); price = itemView.findViewById(R.id.price); ctime = itemView.findViewById(R.id.ctime); etime = itemView.findViewById(R.id.etime); type = itemView.findViewById(R.id.type); details = itemView.findViewById(R.id.details); information = itemView.findViewById(R.id.information); } } public interface OnItemClickListener { void onClick(int position); } private OnItemClickListener listener; public void setOnItemClickListener(OnItemClickListener listener) { this.listener = listener; } }
[ "j957641694@163.com" ]
j957641694@163.com
a1f6df98d79a06a93cb1e7524620ef8672b60920
92225460ebca1bb6a594d77b6559b3629b7a94fa
/src/com/kingdee/eas/fdc/sellhouse/app/RoomSignContractControllerLocalHome.java
357668046bcde36d4287007c1739cf851cf3365b
[]
no_license
yangfan0725/sd
45182d34575381be3bbdd55f3f68854a6900a362
39ebad6e2eb76286d551a9e21967f3f5dc4880da
refs/heads/master
2023-04-29T01:56:43.770005
2023-04-24T05:41:13
2023-04-24T05:41:13
512,073,641
0
1
null
null
null
null
UTF-8
Java
false
false
244
java
package com.kingdee.eas.fdc.sellhouse.app; import javax.ejb.*; import java.rmi.RemoteException; public interface RoomSignContractControllerLocalHome extends EJBLocalHome { RoomSignContractControllerLocal create() throws CreateException; }
[ "yfsmile@qq.com" ]
yfsmile@qq.com
2bdf9998a563f8d1b2d1bd2835bc1a4fd418ba83
8afb5afd38548c631f6f9536846039ef6cb297b9
/_OVERFLOW/Resource-Store/01_Questions/_JAVASCRIPT/leetcode-javascript/hashing/SubstringConcatenationOfWords.java
1c23716efb4ae976713af99a6faa61892116a8d3
[ "MIT" ]
permissive
bgoonz/UsefulResourceRepo2.0
d87588ffd668bb498f7787b896cc7b20d83ce0ad
2cb4b45dd14a230aa0e800042e893f8dfb23beda
refs/heads/master
2023-03-17T01:22:05.254751
2022-08-11T03:18:22
2022-08-11T03:18:22
382,628,698
10
12
MIT
2022-10-10T14:13:54
2021-07-03T13:58:52
null
UTF-8
Java
false
false
2,818
java
package hashing; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by gouthamvidyapradhan on 02/03/2019 You are given a string, s, and a list of words, * words, that are all of the same length. Find all starting indices of substring(s) in s that is a * concatenation of each word in words exactly once and without any intervening characters. * * <p>Example 1: * * <p>Input: s = "barfoothefoobarman", words = ["foo","bar"] Output: [0,9] Explanation: Substrings * starting at index 0 and 9 are "barfoor" and "foobar" respectively. The output order does not * matter, returning [9,0] is fine too. Example 2: * * <p>Input: s = "wordgoodgoodgoodbestword", words = ["word","good","best","word"] Output: [] * * <p>Solution: General idea is to do the following 1. Calculate the word count for the given array * of words and store this in a HashMap. 2. For every substring (substring of s) of length * (words[0].length() * words.length) split this into words of length words[0].length and calculate * the word frequency for the split words. If the word frequency matches the word frequency of the * given original word list then add the starting index of this substring into the result array. * * <p>A small optimization is to break the substring match as soon as you find out that the word * formed from the substring is not part of the original given word list or if the frequency of the * word exceeds the frequency of the original word count. */ public class SubstringConcatenationOfWords { /** * Main method * * @param args */ public static void main(String[] args) { String[] words = {"word", "good", "best", "word"}; System.out.println( new SubstringConcatenationOfWords().findSubstring("wordgoodgoodgoodbestword", words)); } public List<Integer> findSubstring(String s, String[] words) { if (words.length == 0) return new ArrayList<>(); int wLen = words[0].length(); int sLen = wLen * words.length; List<Integer> result = new ArrayList<>(); if (sLen > s.length()) return result; Map<String, Integer> countMap = new HashMap<>(); for (String w : words) { countMap.putIfAbsent(w, 0); countMap.put(w, countMap.get(w) + 1); } for (int k = 0; (s.length() - k) >= sLen; k++) { Map<String, Integer> subSMap = new HashMap<>(); int i = k; for (int j = i + wLen; (i - k) < sLen; i = j, j += wLen) { String subS = s.substring(i, j); subSMap.putIfAbsent(subS, 0); subSMap.put(subS, subSMap.get(subS) + 1); if (!countMap.containsKey(subS) || subSMap.get(subS) > countMap.get(subS)) { break; } } if ((i - k) >= sLen) { result.add(k); } } return result; } }
[ "bryan.guner@gmail.com" ]
bryan.guner@gmail.com
524d41b4a5d3eb231a67a6eae7c1b5fc2d5ab181
dbbcd5bfd69da5df90c64db7c5c30829df762f6b
/PosicaoAppApiTempo/src/main/java/br/com/mobi7/posicaoapp/api/tempo/models/Tempo.java
ed17628625ad266645a493c51af10b009abd5cf6
[]
no_license
opiagile/mobi7
6c9140a59c53a51f61e4d59704fe01a103126b6f
27aa4831b05ede724cc9676dc4126d68b6ef3c01
refs/heads/main
2023-08-22T20:38:09.619501
2021-09-13T22:18:54
2021-09-13T22:18:54
404,541,805
0
0
null
null
null
null
UTF-8
Java
false
false
807
java
package br.com.mobi7.posicaoapp.api.tempo.models; public class Tempo { private String placa; private String pontoInteresse; private Long tempo; public Tempo(String placa, String pontoInteresse, Long tempo) { this.placa = placa; this.pontoInteresse = pontoInteresse; this.tempo = tempo; } public Tempo() { } public String getPlaca() { return placa; } public void setPlaca(String placa) { this.placa = placa; } public String getPontoInteresse() { return pontoInteresse; } public void setPontoInteresse(String pontoInteresse) { this.pontoInteresse = pontoInteresse; } public Long getTempo() { return tempo; } public void setTempo(Long tempo) { this.tempo = tempo; } }
[ "francisco@opiagile.com" ]
francisco@opiagile.com
e4d019ec98c3c1cb7fcee3806e4251e74a4404c9
d528fe4f3aa3a7eca7c5ba4e0aee43421e60857f
/src/xsgzgl/gygl/cwfpgl/CwfpglNewService.java
b7d5b428457937fc99ef14edad7d9179134d0fa8
[]
no_license
gxlioper/xajd
81bd19a7c4b9f2d1a41a23295497b6de0dae4169
b7d4237acf7d6ffeca1c4a5a6717594ca55f1673
refs/heads/master
2022-03-06T15:49:34.004924
2019-11-19T07:43:25
2019-11-19T07:43:25
null
0
0
null
null
null
null
GB18030
Java
false
false
5,741
java
package xsgzgl.gygl.cwfpgl; import com.zfsoft.xgxt.base.service.impl.SuperServiceImpl; import org.springframework.util.CollectionUtils; import xgxt.form.User; import java.util.*; import java.util.regex.Pattern; /** * @描述:TODO * @作者:WANCHEN * @日期: */ public class CwfpglNewService extends SuperServiceImpl<CwfpglForm,CwfpglNewDao> { public List<HashMap<String,String>> searchList(CwfpglForm t, User user) throws Exception { if("xy".equals(t.getFpfs())){ return dao.getPageList(t,user); } else { return dao.getSybjList(t,user); } } //年级下拉框 public List<HashMap<String,String>> getNjList(){ return dao.getNjList(); } //年级下拉框(书院分配用) public List<HashMap<String,String>> getNjListForSy(){ return dao.getNjListForSy(); } //学院下拉框 public List<HashMap<String,String>> getXyListByNj(String nj){ return dao.getXyListByNj(nj); } //获取书院下拉框 public List<HashMap<String,String>> getSyListByNj(String nj){ return dao.getSyListByNj(nj); } //专业下拉框 public List<HashMap<String,String>> getZyListByNjXy(String nj,String xy){ return dao.getZyListByNjXy(nj,xy); } //班级下拉框 public List<HashMap<String,String>> getBjListByNjXyZy(String nj,String xy,String zy){ return dao.getBjListByNjXyZy(nj, xy, zy); } //获取行政班级下拉框(书院分配用) public List<HashMap<String,String>> getBjListByNjSy(String nj,String sy){ return dao.getBjListByNjSy(nj, sy); } //获取当前班级已分配统计表格信息 public List<HashMap<String,String>> getYfpTjXx(String nj,String xy,String zy,String bj){ return dao.getYfpTjXx(nj, xy, zy, bj); } //获取当前班级已分配统计表格信息(书院分配用) public List<HashMap<String,String>> getYfpTjXxForSy(String nj,String sy,String bj){ return dao.getYfpTjXxForSy(nj, sy, bj); } //获取当前班级已分配统计信息 public HashMap<String,String> getBjTjXx(String nj,String xydm,String zydm,String zybj){ return dao.getBjTjXx(nj,xydm,zydm,zybj); } //获取当前班级已分配统计信息(书院分配用) public HashMap<String,String> getBjTjXxForSy(String nj,String sydm,String bjdm){ return dao.getBjTjXxForSy(nj,sydm,bjdm); } //获取楼层 public List<HashMap<String,String>> getLdLc(String lddm,String qsxb,User user){ return dao.getLcxx(lddm, qsxb, user); } //更具楼层获取寝室床位信息 public Map<String,List<HashMap<String,String>>> getQscw(String key,User user){ String[] lddmAndCh = key.split("@!!!"); //床位 List<HashMap<String,String>> cwList = dao.getQsCw(lddmAndCh[0], lddmAndCh[1], user); return this.groupBy(cwList); } //学院分配保存 public boolean save(CwfpglForm t,User user) throws Exception { List<String> cwList = this.cwcl(t,user); return dao.save(t,cwList); } //书院分配保存 public boolean saveForSy(CwfpglForm t,User user) throws Exception { List<String> cwList = this.cwcl(t,user); return dao.saveForSy(t,cwList); } //清空分配 public boolean qkFp(CwfpglForm t) throws Exception { return dao.qkFp(t); } private List<String> cwcl(CwfpglForm t,User user) throws Exception { String lddmkey = t.getLddmkey(); String[] lcKey = t.getLcKey(); String[] cwKey = t.getCwIds(); //因为床位不是画面打开就加载的,如果不点击暂开按钮,是没有床位的 //在这种场合下有三种case:1.只有楼层key;2.只有床位key;3.同时都有 List<String> cwList; if(lcKey != null && cwKey == null){ cwList = dao.getCw(lddmkey,lcKey,user); } else if(lcKey == null && cwKey != null){ cwList = Arrays.asList(cwKey); } else { List<String> lcs = new ArrayList<String>(); //找出选中楼层中没有选中床位的楼层 boolean mark; for(String lc : lcKey){ mark = true; for(String cw : cwKey){//cw : lc@!!!qsh@!!!cwh String[] s = cw.split("@!!!"); if(s[0].equals(lc)){ mark = false; break; } } if(mark){ lcs.add(lc); } } //根据楼层查询床位 cwList = dao.getCw(lddmkey,lcs.toArray(new String[lcs.size()]),user); //查询的床位和页面提交的数据合并 cwList.addAll(Arrays.asList(cwKey)); } return cwList; } private Map<String,List<HashMap<String,String>>> groupBy(List<HashMap<String,String>> cwList){ //按寝室分组 Map<String,List<HashMap<String,String>>> qsMap = new LinkedHashMap<String, List<HashMap<String, String>>>(); List<HashMap<String,String>> listCw; for(HashMap<String,String> cw : cwList){ String qskey = cw.get("ch") + cw.get("qsh"); if(qsMap.containsKey(qskey)){ qsMap.get(qskey).add(cw); } else { listCw = new ArrayList<HashMap<String, String>>(); listCw.add(cw); qsMap.put(qskey,listCw); } } return qsMap; } }
[ "1398796456@qq.com" ]
1398796456@qq.com
8d43f6f76006d75d35312d8f7ab302cbdc2ffa20
b511684052910867af4c32068042b5c7a9d92908
/MDSE-master/3/3_Submission/Group1_xtextAssignment/org.xtext.example.mydsl.ui/src-gen/org/xtext/example/mydsl/validation/MyDslValidatorConfigurationBlock.java
8c22252d38b7a6b6e2db5b7146ffc8398d22e8c0
[]
no_license
hchuphal/Chalmers_GU
5e000e8346e669754a1ae675a65b04d5daa81645
68831e266a599fd429dbdf254f9ace7ce0a0c30a
refs/heads/master
2023-01-19T14:29:20.006127
2019-12-01T00:00:53
2019-12-01T00:00:53
225,082,667
1
0
null
2023-01-09T12:05:50
2019-11-30T23:29:22
Java
UTF-8
Java
false
false
1,131
java
/* * generated by Xtext 2.16.0 */ package org.xtext.example.mydsl.validation; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.swt.widgets.Composite; import org.eclipse.xtext.ui.validation.AbstractValidatorConfigurationBlock; @SuppressWarnings("restriction") public class MyDslValidatorConfigurationBlock extends AbstractValidatorConfigurationBlock { protected static final String SETTINGS_SECTION_NAME = "MyDsl"; @Override protected void fillSettingsPage(Composite composite, int nColumns, int defaultIndent) { addComboBox(MyDslConfigurableIssueCodesProvider.DEPRECATED_MODEL_PART, "Deprecated Model Part", composite, defaultIndent); } @Override public void dispose() { storeSectionExpansionStates(getDialogSettings()); super.dispose(); } @Override protected IDialogSettings getDialogSettings() { IDialogSettings dialogSettings = super.getDialogSettings(); IDialogSettings section = dialogSettings.getSection(SETTINGS_SECTION_NAME); if (section == null) { return dialogSettings.addNewSection(SETTINGS_SECTION_NAME); } return section; } }
[ "himanshu.chuphal07@gmail.com" ]
himanshu.chuphal07@gmail.com
e83f57fea2e57043391a8bed9d51649783e6d4de
5979994b215fabe125cd756559ef2166c7df7519
/aimir-fep/src/main/java/com/aimir/fep/meter/parser/Mk6NTable/ConfigurationEventChannel.java
3adf719858efbc8e83ea835f98e6176fcddf7a42
[]
no_license
TechTinkerer42/Haiti
91c45cb1b784c9afc61bf60d43e1d5623aeba888
debaea96056d1d4611b79bd846af8f7484b93e6e
refs/heads/master
2023-04-28T23:39:43.176592
2021-05-03T10:49:42
2021-05-03T10:49:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,167
java
package com.aimir.fep.meter.parser.Mk6NTable; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.aimir.fep.util.DataFormat; public class ConfigurationEventChannel implements java.io.Serializable{ private static final long serialVersionUID = 4055922252649471016L; private static Log log = LogFactory.getLog(ConfigurationLPChannel.class); private static final int OFF_CH_REG=0; private static final int OFF_CH_SIZE=4; private static final int OFF_CH_TYPE=6; private static final int OFF_CH_UNIT=7; private static final int OFF_CH_RECORD_OFFSET=8; private static final int LEN_CH_REG=4; private static final int LEN_CH_SIZE=2; private static final int LEN_CH_TYPE=1; private static final int LEN_CH_UNIT=1; private static final int LEN_CH_RECORD_OFFSET=2; byte[] rawData; int ch_reg; int ch_size; int ch_type; int ch_unit; int ch_record_offset; int ch_scaling; float ch_scaling_factor; public ConfigurationEventChannel(byte[] rawData) { this.rawData = rawData; } public int getCh_size() { try { ch_size=DataFormat.hex2unsigned16(DataFormat.select(rawData, OFF_CH_SIZE, LEN_CH_SIZE)); } catch (Exception e) { log.error("Error get Ch Size->"+e.getMessage()); } return ch_size; } public int getCh_type() { ch_type=DataFormat.hex2unsigned8(rawData[OFF_CH_TYPE]); return ch_type; } public char getCh_type_char() { return (char)DataFormat.hex2unsigned8(rawData[OFF_CH_TYPE]); } public int getCh_unit() { ch_unit=DataFormat.hex2unsigned8(rawData[OFF_CH_UNIT]); return ch_unit; } public String getCh_unit_Str() { String unitStr=""; switch(getCh_unit()){ case 'A': unitStr="Amps";break; case 'D': unitStr="Angle in degrees";break; case 'H': unitStr="Hz";break; case 'M': unitStr="Minutes";break; case 'N': unitStr="No unit";break; case 'P': unitStr="Percent";break; case 'Q': unitStr="Power Factor";break; case 'R': unitStr="Vars";break; case 'S': unitStr="VA";break; case 'T': unitStr="Seconds";break; case 'U': unitStr="Unknown";break; case 'V': unitStr="Volts";break; case 'W': unitStr="Watts";break; case 'X': unitStr="Wh";break; case 'Y': unitStr="Varh";break; case 'Z': unitStr="Vah";break; } return unitStr; } /** * Constructs a <code>String</code> with all attributes * in name = value format. * * @return a <code>String</code> representation * of this object. */ public String toString() { StringBuffer retValue = new StringBuffer(); retValue.append("ConfigurationEventChannel [ ") .append("ch_reg = ").append(this.ch_reg).append('\n') .append("ch_size = ").append(this.ch_size).append('\n') .append("ch_type = ").append(this.ch_type).append('\n') .append("ch_unit = ").append(this.ch_unit).append('\n') .append("ch_record_offset = ").append(this.ch_record_offset).append('\n') .append("ch_scaling = ").append(this.ch_scaling).append('\n') .append("ch_scaling_factor = ").append(this.ch_scaling_factor).append('\n') .append(" ]"); return retValue.toString(); } }
[ "marsr0913@nuritelecom.com" ]
marsr0913@nuritelecom.com
4e03eeb16368ad50891e0e628acc49e74ea59229
9a12fd0ddaf1d131a5280ec8bb49f2e3484ac39d
/MonthMoNi/src/main/java/com/example/cart/okhttp/AbstractUiCallBack_Cart.java
57d5c59330375d902d9bb54476c93577bfa354ad
[]
no_license
1657895829/ReViewApp
7d33b529b28da68aac22f5207e627bb595dbcf4d
30b424f5b38ca09b58c515243f3edc7cc23aa1ad
refs/heads/master
2020-03-14T06:23:14.165736
2018-05-03T12:58:14
2018-05-03T12:58:14
131,482,886
1
0
null
null
null
null
UTF-8
Java
false
false
1,874
java
package com.example.cart.okhttp; import android.os.Handler; import android.os.Looper; import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; import java.io.IOException; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import okhttp3.Call; import okhttp3.Callback; import okhttp3.Response; /** * * Okhttp 单例 范型的封装 */ public abstract class AbstractUiCallBack_Cart<T> implements Callback { /** * 成功回调 * @param t */ public abstract void success(T t); /** * 失败回调 * @param e */ public abstract void failure(Exception e); private Handler handler = null ; private Class clazz ; public AbstractUiCallBack_Cart(){ handler = new Handler(Looper.getMainLooper()); // 得到的是一个 AbstractUiCallBack<T> 的Type Type type = getClass().getGenericSuperclass() ; // 得到的是T的实际Type Type[] arr = ((ParameterizedType)type).getActualTypeArguments() ; clazz = (Class) arr[0] ; } @Override public void onFailure(Call call, IOException e) { failure(e); } @Override public void onResponse(Call call, Response response) throws IOException { try { String result = response.body().string(); System.out.println("result = " + result); Gson gson = new Gson(); final T t = (T) gson.fromJson(result,clazz); handler.post(new Runnable() { @Override public void run() { success(t); } }); } catch (IOException e) { e.printStackTrace(); failure(e); } catch (JsonSyntaxException e) { e.printStackTrace(); failure(e); } } }
[ "1657895829@qq.com" ]
1657895829@qq.com
5a07a940f280fce83ab7e875d9d5b6da92368117
5edfe5bb8cde144a020dd7436f1bed6cef5e2aa8
/src/com/java/campus/Solution26.java
a2bfd442c837d660587a17df52ed8a8f9d38173a
[]
no_license
yw3388/Data_Structure
abb479c97905565bf15c5e6bb538332b014361e0
a6e43cde760b08baf0815217a04244df2a1abaf4
refs/heads/master
2022-02-12T20:13:23.918302
2019-08-15T07:36:12
2019-08-15T07:36:12
null
0
0
null
null
null
null
GB18030
Java
false
false
1,785
java
package com.java.campus; import java.util.Scanner; import java.util.Stack; /** * 有K种颜色的小球(K<=10),每种小球有若干个,总数小于100个。 * 现在有一个小盒子,能放N个小球(N<=8),现在要从这些小球里挑出N个小球,放满盒子。 想知道有哪些挑选方式。注:每种颜色的小球之间没有差别。 * * 请按数字递增顺序输出挑选小球的所有方式。 * * 如有3种颜色,每种颜色小球的个数分别为a:1,b:2,c:3,挑出3个小球的挑法有: 003,012,021,102,111,120 * * * 输入描述: * * 第一行两个数字K N,分别表示小球种类数目和挑选的小球个数 第二行开始为每种小球的数目,共N行数据 * * * 输出描述: 输出所有可行的挑选方案,按升序排列 * * 输入例子1: 3 3 1 2 3 * * 输出例子1: 003 012 021 102 111 120 * * @author WangShuaiJie * */ public class Solution26 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int k = sc.nextInt(); int n = sc.nextInt(); int[] nums = new int[k]; for (int i = 0; i < k; i++) { nums[i] = sc.nextInt(); } Stack<String> stack = new Stack<String>(); helper(nums, n, 0, stack, ""); while (!stack.isEmpty()) { System.out.println(stack.pop()); } } } private static void helper(int[] nums, int target, int index, Stack<String> stack, String string) { if (index == nums.length && target == 0) { stack.push(string); return; } int nextTarget = 0; for (int i = Math.min(target, nums[index]); i >= 0; i--) { nextTarget = target - i; helper(nums, nextTarget, index + 1, stack, string + "i"); } } }
[ "2283613941@qq.com" ]
2283613941@qq.com
1047b21021f7b7c9dbd8031edd13e1e975d3f478
79890d6ab25e6cb31bad2f9d6c394a1cc46ada0c
/struts_crm2/src/cn/itheima/web/action/CustomerAction.java
5f70e752865490dd499d6fda22b5c423051184d8
[]
no_license
PandyYang/SSM-SSH
d748bd5fd9c3eece121091bb16276ac421e316f3
74d591007e6a5d13d6b88d29ab9443532f73a21e
refs/heads/master
2020-04-23T20:06:46.525177
2019-04-05T00:08:34
2019-04-05T00:08:34
171,428,461
0
0
null
null
null
null
UTF-8
Java
false
false
1,827
java
package cn.itheima.web.action; import java.util.List; import org.apache.commons.lang3.StringUtils; import org.apache.struts2.ServletActionContext; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Restrictions; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven; import cn.itheima.domain.Customer; import cn.itheima.service.CustomerService; import cn.itheima.service.impl.CustomerServiceImpl; public class CustomerAction extends ActionSupport implements ModelDriven<Customer> { private CustomerService cs = new CustomerServiceImpl(); private Customer customer = new Customer(); public String list() throws Exception { //1 接受参数 String cust_name = ServletActionContext.getRequest().getParameter("cust_name"); //2 创建离线查询对象 DetachedCriteria dc =DetachedCriteria.forClass(Customer.class); //3 判断参数拼装条件 if(StringUtils.isNotBlank(cust_name)){ dc.add(Restrictions.like("cust_name", "%"+cust_name+"%")); } //4 调用Service将离线对象传递 List<Customer> list = cs.getAll(dc); //5 将返回的list放入request域.转发到list.jsp显示 /* * HttpServletRequest request = ServletActionContext.getRequest(); request.setattribute("user",user); 页面取值:${requestScope.user.name}、${requestScope.user.sex} */ //ServletActionContext.getRequest().setAttribute("list", list); //1.放到栈顶 //2.放到actionContext ActionContext.getContext().put("list", list); return "list"; } //添加客户 public String add() throws Exception { //1 调用Service cs.save(customer); //2 重定向到列表action方法 return "toList"; } @Override public Customer getModel() { return customer; } }
[ "fry227662112@gmail.com" ]
fry227662112@gmail.com
f0f3ba5be869eae03a545ba8561aad23938b10c7
2c9e0541ed8a22bcdc81ae2f9610a118f62c4c4d
/harmony/java/trunk/classlib/modules/auth/src/main/java/common/org/apache/harmony/auth/internal/kerberos/v5/KerberosErrorMessage.java
bf92cb752577d889a0e7b280d66f49b2305594e8
[]
no_license
JetBrains/jdk8u_tests
774de7dffd513fd61458b4f7c26edd7924c7f1a5
263c74f1842954bae0b34ec3703ad35668b3ffa2
refs/heads/master
2023-08-07T17:57:58.511814
2017-03-20T08:13:25
2017-03-20T08:16:11
70,048,797
11
9
null
null
null
null
UTF-8
Java
false
false
5,462
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.harmony.auth.internal.kerberos.v5; import java.io.IOException; import java.util.Date; import org.apache.harmony.security.asn1.ASN1Any; import org.apache.harmony.security.asn1.ASN1Constants; import org.apache.harmony.security.asn1.ASN1Explicit; import org.apache.harmony.security.asn1.ASN1Integer; import org.apache.harmony.security.asn1.ASN1OctetString; import org.apache.harmony.security.asn1.ASN1Sequence; import org.apache.harmony.security.asn1.ASN1StringType; import org.apache.harmony.security.asn1.ASN1Type; import org.apache.harmony.security.asn1.BerInputStream; import org.apache.harmony.security.asn1.DerInputStream; import org.apache.harmony.auth.internal.nls.Messages; /** * Kerberos Error Message type. * * @see http://www.ietf.org/rfc/rfc4120.txt */ public class KerberosErrorMessage { private Date ctime; private int cusec; private Date stime; private int susec; private int errorCode; private String crealm; private PrincipalName cname; private String realm; private PrincipalName sname; private String etext; public KerberosErrorMessage() { } public static KerberosErrorMessage decode(DerInputStream in) throws IOException { return (KerberosErrorMessage) ASN1.decode(in); } public Date getCtime() { return ctime; } public int getCusec() { return cusec; } public Date getStime() { return stime; } public int getSusec() { return susec; } public int getErrorCode() { return errorCode; } public String getCrealm() { return crealm; } public PrincipalName getCname() { return cname; } public String getRealm() { return realm; } public PrincipalName getSname() { return sname; } public String getEtext() { return etext; } private static final ASN1Sequence KRB_ERROR = new ASN1Sequence(new ASN1Type[] { new ASN1Explicit(0, ASN1Any.getInstance()), // TODO:ignored new ASN1Explicit(1, ASN1Any.getInstance()), // TODO: ignored new ASN1Explicit(2, KerberosTime.getASN1()),// ctime // TODO should we define Microseconds type? new ASN1Explicit(3, ASN1Integer.getInstance()), // cusec new ASN1Explicit(4, KerberosTime.getASN1()),// stime // TODO should we define Microseconds type? new ASN1Explicit(5, ASN1Integer.getInstance()), // susec // TODO should we define Int32 type? new ASN1Explicit(6, ASN1Integer.getInstance()),// error-code // TODO should we define Realm type? new ASN1Explicit(7, ASN1StringType.GENERALSTRING),// crealm new ASN1Explicit(8, PrincipalName.ASN1),// cname // TODO should we define Realm type? new ASN1Explicit(9, ASN1StringType.GENERALSTRING),// realm new ASN1Explicit(10, PrincipalName.ASN1),// sname // TODO should we define KerberosString type? new ASN1Explicit(11, ASN1StringType.GENERALSTRING),// e-text // TODO: ignored new ASN1Explicit(12, ASN1OctetString.getInstance()),// e-data }) { { setOptional(2);// ctime setOptional(3);// cusec setOptional(7);// crealm setOptional(8);// cname setOptional(11);// e-text setOptional(12);// e-data } @Override protected Object getDecodedObject(BerInputStream in) throws IOException { Object[] values = (Object[]) in.content; KerberosErrorMessage message = new KerberosErrorMessage(); message.ctime = (Date) values[2]; if (values[3] != null) { message.cusec = ASN1Integer.toIntValue(values[3]); } message.stime = (Date) values[4]; message.susec = ASN1Integer.toIntValue(values[5]); message.errorCode = ASN1Integer.toIntValue(values[6]); message.crealm = (String) values[7]; message.cname = (PrincipalName) values[8]; message.realm = (String) values[9]; message.sname = (PrincipalName) values[10]; message.etext = (String) values[11]; return message; } @Override protected void getValues(Object object, Object[] values) { throw new RuntimeException(Messages.getString("auth.64")); } }; public static final ASN1Explicit ASN1 = new ASN1Explicit(ASN1Constants.CLASS_APPLICATION, 30, KRB_ERROR); }
[ "vitaly.provodin@jetbrains.com" ]
vitaly.provodin@jetbrains.com
2826a3932a71b22846af98302ed4589d82b49c64
dc41402f8bbd71b98b531d08a1e9c886d429cc65
/src/test/java/com/norconex/commons/lang/exec/SystemCommandTest.java
ee701cbea03c29102215dbedaed4d13aa45fc97e
[ "Apache-2.0" ]
permissive
Norconex/commons-lang
7c9edbd53531bbed8ff75e4ecd265da9ad2055bf
682b2c8eb358ed9b38ea3306cc8b796be6dc9c98
refs/heads/master
2023-08-18T04:57:54.144140
2023-08-14T06:01:55
2023-08-14T06:01:55
8,322,624
14
12
Apache-2.0
2023-08-15T16:41:14
2013-02-20T21:29:51
Java
UTF-8
Java
false
false
7,841
java
/* Copyright 2017-2022 Norconex 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.norconex.commons.lang.exec; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.HashMap; import java.util.Map; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import com.norconex.commons.lang.io.InputStreamLineListener; class SystemCommandTest { public static final String IN_FILE_PATH = "/exec/sample-input.txt"; public static final String EXPECTED_OUT_FILE_PATH = "/exec/expected-output.txt"; @TempDir static Path tempFolder; @Test void testInFileOutFile() throws IOException, SystemCommandException { var inFile = inputAsFile(); var outFile = newTempFile(); var cmd = ExternalApp.newSystemCommand( ExternalApp.TYPE_INFILE_OUTFILE, inFile, outFile); var l = addEnvAndListener(cmd); cmd.execute(); Assertions.assertEquals( expectedOutputAsString(), fileAsString(outFile)); Assertions.assertTrue( l.capturedThemAll(), "Listener missed some output."); } @Test void testInFileStdout() throws IOException, SystemCommandException { var inFile = inputAsFile(); var cmd = ExternalApp.newSystemCommand( ExternalApp.TYPE_INFILE_STDOUT, inFile); var l = addEnvAndListener(cmd); cmd.execute(); Assertions.assertEquals(expectedOutputAsString(), l.getStdoutContent()); Assertions.assertTrue( l.capturedThemAll(), "Listener missed some output."); } @Test void testStdinOutFile() throws IOException, SystemCommandException { var input = inputAsStream(); var outFile = newTempFile(); var cmd = ExternalApp.newSystemCommand( ExternalApp.TYPE_STDIN_OUTFILE, outFile); var l = addEnvAndListener(cmd); cmd.execute(input); input.close(); Assertions.assertEquals(expectedOutputAsString(), fileAsString(outFile)); Assertions.assertTrue( l.capturedThemAll(), "Listener missed some output."); } @Test void testStdinStdout() throws IOException, SystemCommandException { var input = inputAsStream(); var cmd = ExternalApp.newSystemCommand( ExternalApp.TYPE_STDIN_STDOUT); var l = addEnvAndListener(cmd); cmd.execute(input); input.close(); Assertions.assertEquals(expectedOutputAsString(), l.getStdoutContent()); Assertions.assertTrue( l.capturedThemAll(), "Listener missed some output."); } @Test void testDefaultsNullErrors() { var cmd = new SystemCommand("blah"); var l = addEnvAndListener(cmd); assertThat(cmd.getOutputListeners()).hasSize(1); assertThat(cmd.getErrorListeners()).hasSize(1); cmd.removeOutputListener(l); cmd.removeErrorListener(l); assertThat(cmd.getOutputListeners()).isEmpty(); assertThat(cmd.getOutputListeners()).isEmpty(); assertThat(cmd.getCommand()[0]).isEqualTo("blah"); assertThat(cmd.getWorkdir()).isNull(); assertThat(cmd.getEnvironmentVariables()).containsOnly( entry(ExternalApp.ENV_STDOUT_BEFORE, ExternalApp.ENV_STDOUT_BEFORE), entry(ExternalApp.ENV_STDOUT_AFTER, ExternalApp.ENV_STDOUT_AFTER), entry(ExternalApp.ENV_STDERR_BEFORE, ExternalApp.ENV_STDERR_BEFORE), entry(ExternalApp.ENV_STDERR_AFTER, ExternalApp.ENV_STDERR_AFTER) ); assertThat(cmd.isRunning()).isFalse(); assertDoesNotThrow(() -> cmd.abort()); assertThat(SystemCommand.escape("ha \"ha\" 'ha'")) .containsExactly("ha", "ha", "ha"); assertThat(SystemCommand.escape("ha ha", "\"ha\"", "'ha'")) .containsExactly("\"ha ha\"", "\"ha\"", "'ha'"); } private File inputAsFile() throws IOException { var inFile = newTempFile(); FileUtils.copyInputStreamToFile( getClass().getResourceAsStream(IN_FILE_PATH), inFile); return inFile; } private InputStream inputAsStream() { return getClass().getResourceAsStream(IN_FILE_PATH); } private String fileAsString(File file) throws IOException { return FileUtils.readFileToString(file, StandardCharsets.UTF_8).trim(); } private String expectedOutputAsString() throws IOException { return IOUtils.toString(getClass().getResourceAsStream( EXPECTED_OUT_FILE_PATH), StandardCharsets.UTF_8); } private File newTempFile() throws IOException { var file = Files.createTempFile( tempFolder, "SystemCommandTest", null).toFile(); if (!file.exists()) { // Just making sure it exists FileUtils.touch(file); } return file; } private ExternalAppListener addEnvAndListener(SystemCommand cmd) { Map<String, String> envs = new HashMap<>(); envs.put(ExternalApp.ENV_STDOUT_BEFORE, ExternalApp.ENV_STDOUT_BEFORE); envs.put(ExternalApp.ENV_STDOUT_AFTER, ExternalApp.ENV_STDOUT_AFTER); envs.put(ExternalApp.ENV_STDERR_BEFORE, ExternalApp.ENV_STDERR_BEFORE); envs.put(ExternalApp.ENV_STDERR_AFTER, ExternalApp.ENV_STDERR_AFTER); cmd.setEnvironmentVariables(envs); var l = new ExternalAppListener(); cmd.addErrorListener(l); cmd.addOutputListener(l); return l; } class ExternalAppListener extends InputStreamLineListener { private boolean stdoutBefore = false; private boolean stdoutAfter = false; private boolean stderrBefore = false; private boolean stderrAfter = false; private StringBuilder b = new StringBuilder(); @Override public void lineStreamed(String type, String line) { if ("STDOUT".equals(type)) { if (ExternalApp.ENV_STDOUT_BEFORE.equals(line)) { stdoutBefore = true; } else if (ExternalApp.ENV_STDOUT_AFTER.equals(line)) { stdoutAfter = true; } else { if (b.length() > 0) { b.append('\n'); } b.append(line); } } else if ("STDERR".equals(type)) { if (ExternalApp.ENV_STDERR_BEFORE.equals(line)) { stderrBefore = true; } else if (ExternalApp.ENV_STDERR_AFTER.equals(line)) { stderrAfter = true; } } } public boolean capturedThemAll() { return stdoutBefore && stdoutAfter && stderrBefore && stderrAfter; } public String getStdoutContent() { return b.toString(); } } }
[ "pascal.essiembre@norconex.com" ]
pascal.essiembre@norconex.com
c83f2b5658cc5f62594f869edf0f0c1108ceca54
952789d549bf98b84ffc02cb895f38c95b85e12c
/V_1.x/branch/SpagoBI-2.0-Exp/SpagoBI/src/it/eng/spagobi/workflow/publishers/CompleteOrRejectActivityPublisher.java
acafc514afffd4d6d6a01141fcd4d81d56d60d9a
[]
no_license
emtee40/testingazuan
de6342378258fcd4e7cbb3133bb7eed0ebfebeee
f3bd91014e1b43f2538194a5eb4e92081d2ac3ae
refs/heads/master
2020-03-26T08:42:50.873491
2015-01-09T16:17:08
2015-01-09T16:17:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
434
java
package it.eng.spagobi.workflow.publishers; import it.eng.spago.base.RequestContainer; import it.eng.spago.base.ResponseContainer; import it.eng.spago.presentation.PublisherDispatcherIFace; public class CompleteOrRejectActivityPublisher implements PublisherDispatcherIFace { public String getPublisherName(RequestContainer arg0, ResponseContainer arg1) { // TODO Auto-generated method stub return null; } }
[ "fiscato@99afaf0d-6903-0410-885a-c66a8bbb5f81" ]
fiscato@99afaf0d-6903-0410-885a-c66a8bbb5f81
635c3c72a7b6e083f47838aaab9e56d8c3cb0d92
014247d8738fc08dcab36330aeb4a81672717c4e
/src/main/java/com/ippon/leanagile/domain/Authority.java
7f11f313c27727b85dbe14a9461c3513efa4a392
[]
no_license
BulkSecurityGeneratorProject/leanagile
999d6a9150090ed56cbe27e629ccaa501a9f7d17
e81f67da9ff48ee504db2fea2b5a5e19bbae12b0
refs/heads/master
2022-12-10T07:36:14.411874
2018-05-16T15:09:42
2018-05-16T15:09:42
296,543,080
0
0
null
2020-09-18T07:12:44
2020-09-18T07:12:43
null
UTF-8
Java
false
false
1,457
java
package com.ippon.leanagile.domain; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Column; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; /** * An authority (a security role) used by Spring Security. */ @Entity @Table(name = "jhi_authority") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Authority implements Serializable { private static final long serialVersionUID = 1L; @NotNull @Size(max = 50) @Id @Column(length = 50) private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Authority authority = (Authority) o; return !(name != null ? !name.equals(authority.name) : authority.name != null); } @Override public int hashCode() { return name != null ? name.hashCode() : 0; } @Override public String toString() { return "Authority{" + "name='" + name + '\'' + "}"; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
476d1489c9e89368a87827412f1f50ffedfbfe4b
e3162d976b3a665717b9a75c503281e501ec1b1a
/src/main/java/com/alipay/api/response/AlipaySocialBaseChatGroupsQueryResponse.java
45cab8e32821eb83ba7e14ee504d491e1af7f737
[ "Apache-2.0" ]
permissive
sunandy3/alipay-sdk-java-all
16b14f3729864d74846585796a28d858c40decf8
30e6af80cffc0d2392133457925dc5e9ee44cbac
refs/heads/master
2020-07-30T14:07:34.040692
2019-09-20T09:35:20
2019-09-20T09:35:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,312
java
package com.alipay.api.response; import java.util.List; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; import com.alipay.api.domain.GroupInfo; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.social.base.chat.groups.query response. * * @author auto create * @since 1.0, 2019-01-07 20:51:15 */ public class AlipaySocialBaseChatGroupsQueryResponse extends AlipayResponse { private static final long serialVersionUID = 7247254767992421641L; /** * 群信息列表 */ @ApiListField("group_infos") @ApiField("group_info") private List<GroupInfo> groupInfos; /** * 是否有更多 */ @ApiField("has_more") private Boolean hasMore; /** * 同步的key,下一次分页获取使用 */ @ApiField("last_key") private Long lastKey; public void setGroupInfos(List<GroupInfo> groupInfos) { this.groupInfos = groupInfos; } public List<GroupInfo> getGroupInfos( ) { return this.groupInfos; } public void setHasMore(Boolean hasMore) { this.hasMore = hasMore; } public Boolean getHasMore( ) { return this.hasMore; } public void setLastKey(Long lastKey) { this.lastKey = lastKey; } public Long getLastKey( ) { return this.lastKey; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
551f8137f111c0682274238afeac9a522f1ddcf4
416d2845de8d1a082c5b35aab5d4f91d70079391
/zhihuijiayuan/app/src/main/java/tendency/hz/zhihuijiayuan/view/user/AccessRecordActivity.java
62a295766a19e7003a8ab0ec4b12e5bc5cf2b198
[]
no_license
justtory521/zhihuijiayuan
e66b36c594570945a2406388e1d3045a9a96e105
e8cd3b00a9293f2989f9af3cc1712b4a236466bb
refs/heads/master
2022-04-14T09:42:53.685575
2019-11-29T03:43:18
2019-11-29T03:43:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,868
java
package tendency.hz.zhihuijiayuan.view.user; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import tendency.hz.zhihuijiayuan.R; import tendency.hz.zhihuijiayuan.bean.AccessRecordBean; import tendency.hz.zhihuijiayuan.bean.User; import tendency.hz.zhihuijiayuan.bean.base.Field; import tendency.hz.zhihuijiayuan.bean.base.NetCode; import tendency.hz.zhihuijiayuan.presenter.PersonalPrenImpl; import tendency.hz.zhihuijiayuan.presenter.prenInter.PersonalPrenInter; import tendency.hz.zhihuijiayuan.units.DateUtils; import tendency.hz.zhihuijiayuan.units.ViewUnits; import tendency.hz.zhihuijiayuan.view.BaseActivity; import tendency.hz.zhihuijiayuan.view.viewInter.AllViewInter; /** * Author:Libin on 2019/5/15 18:59 * Email:1993911441@qq.com * Describe:评估记录 */ public class AccessRecordActivity extends BaseActivity implements AllViewInter { @BindView(R.id.rv_access_record) RecyclerView rvAccessRecord; @BindView(R.id.srl_access_record) SmartRefreshLayout srlAccessRecord; @BindView(R.id.view_status_bar) View viewStatusBar; @BindView(R.id.tv_title_name) TextView tvTitleName; @BindView(R.id.iv_title_back) ImageView ivTitleBack; @BindView(R.id.ll_title) LinearLayout llTitle; //当前页 private int page = 1; //当前页 private int pageSize = 10; //刷新 private boolean isRefresh; //加载更多 private boolean isLoadMore; private PersonalPrenInter mPersonalPrenInter; private User mUser; private BaseQuickAdapter<AccessRecordBean.DataBeanX.DataBean, BaseViewHolder> adapter; private List<AccessRecordBean.DataBeanX.DataBean> dataList = new ArrayList<>(); @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_access_record); ButterKnife.bind(this); ViewUnits.getInstance().showLoading(this, "加载中"); mPersonalPrenInter = new PersonalPrenImpl(this); mPersonalPrenInter.getPersonalInfo(NetCode.Personal.getPersonalInfo); mPersonalPrenInter.getCreditHistory(NetCode.Personal.getCreditHistory, pageSize, page); initView(); } private void initView() { ViewUnits.getInstance().setTitleHeight(viewStatusBar); tvTitleName.setText("评估记录"); rvAccessRecord.setLayoutManager(new LinearLayoutManager(this)); adapter = new BaseQuickAdapter<AccessRecordBean.DataBeanX.DataBean, BaseViewHolder>(R.layout.rv_access_record_item, dataList) { @Override protected void convert(BaseViewHolder helper, AccessRecordBean.DataBeanX.DataBean item) { helper.setText(R.id.tv_current_score, "本月智慧分:" + item.getCreditIntegral()); String createTime = item.getCreateTime(); String time = ""; if (createTime != null) { if (createTime.contains("T")) { time = DateUtils.formatTime(Field.DateType.year_month_day, Field.DateType.year_month, createTime.split("T")[0]); } else { time = DateUtils.formatTime(Field.DateType.standard_time_format, Field.DateType.year_month, createTime); } } helper.setText(R.id.tv_current_month, "评估时间:" + time); } }; rvAccessRecord.setAdapter(adapter); rvAccessRecord.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager(); if (layoutManager != null) { int position = layoutManager.findFirstCompletelyVisibleItemPosition(); if (position > 0) { llTitle.setBackgroundResource(R.color.colorPrimary); } else { llTitle.setBackground(null); } } } }); srlAccessRecord.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() { @Override public void onLoadMore(@NonNull RefreshLayout refreshLayout) { isLoadMore = true; page++; mPersonalPrenInter.getCreditHistory(NetCode.Personal.getCreditHistory, pageSize, page); } @Override public void onRefresh(@NonNull RefreshLayout refreshLayout) { isRefresh = true; page = 1; mPersonalPrenInter.getCreditHistory(NetCode.Personal.getCreditHistory, pageSize, page); } }); } @Override public void onSuccessed(int what, Object object) { super.onSuccessed(what, object); switch (what) { case NetCode.Personal.getPersonalInfo: mUser = (User) object; addHeader(); break; case NetCode.Personal.getCreditHistory: List<AccessRecordBean.DataBeanX.DataBean> list = (List<AccessRecordBean.DataBeanX.DataBean>) object; if (isRefresh) { srlAccessRecord.finishRefresh(); isRefresh = false; dataList.clear(); } else if (isLoadMore) { srlAccessRecord.finishLoadMore(); } else { dataList.clear(); ViewUnits.getInstance().missLoading(); } if (list != null && list.size() > 0) { dataList.addAll(list); } else { if (isLoadMore) { page--; srlAccessRecord.finishLoadMoreWithNoMoreData(); isLoadMore = false; } } adapter.notifyDataSetChanged(); break; } } private void addHeader() { View view = LayoutInflater.from(this).inflate(R.layout.rv_access_record_header, null); TextView tvTotalScore = view.findViewById(R.id.tv_record_total_score); TextView tvLastTime = view.findViewById(R.id.tv_record_last_time); tvTotalScore.setText("智慧分:" + mUser.getCreditScore()); tvLastTime.setText("更新时间:" + DateUtils.formatTime(Field.DateType.standard_time_format, Field.DateType.year_month, mUser.getPreviousCreditTime())); adapter.addHeaderView(view); adapter.notifyDataSetChanged(); } @Override public void onFailed(int what, Object object) { super.onFailed(what, object); ViewUnits.getInstance().missLoading(); ViewUnits.getInstance().showToast(object.toString()); } @OnClick(R.id.iv_title_back) public void onViewClicked() { finish(); } }
[ "1993911441@qq.com" ]
1993911441@qq.com
4bf65b0594afc4ee805fa93b81162776fda4f64b
7e713646a0619267b421aafa41a9afeeaf7a0108
/src/main/java/com/gdztyy/inca/service/impl/BmsSaContodocServiceImpl.java
8c831cfcf4f3c84dd8016029bc53f1c054df0bec
[]
no_license
liutaota/ipl
4757e35d1100ca892f2137b690ee4b43b908dc19
9d53b9044ba56b6ea65f1347a779d4b66e075bea
refs/heads/master
2023-03-21T11:28:42.663574
2021-03-05T08:49:33
2021-03-05T08:49:33
344,747,852
0
0
null
null
null
null
UTF-8
Java
false
false
530
java
package com.gdztyy.inca.service.impl; import com.gdztyy.inca.entity.BmsSaContodoc; import com.gdztyy.inca.mapper.BmsSaContodocMapper; import com.gdztyy.inca.service.IBmsSaContodocService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 服务实现类 * </p> * * @author peiqy * @since 2020-08-18 */ @Service public class BmsSaContodocServiceImpl extends ServiceImpl<BmsSaContodocMapper, BmsSaContodoc> implements IBmsSaContodocService { }
[ "liutao@qq.com" ]
liutao@qq.com
7122604815582d49915e84accbb35b27acb64c5e
3095fc8a2028f217db63b5686989f42888b692e6
/VtigerFramework/src/com/vtiger/opportunity/SearchOpportunityNoByNotEqualOptionWithInvalidCharacterTc_44.java
ac6480d751cf8c169a349078b68a23e8fa5448b2
[]
no_license
jagdalemanoj7/MyFirstProject
38adf30350fb7183fc5ee642636ed008f2e07a77
a3da8f16b56ea8bfd047b34578992440ff12514c
refs/heads/master
2020-09-11T05:13:52.327250
2019-11-15T16:15:18
2019-11-15T16:15:18
221,950,042
0
0
null
null
null
null
UTF-8
Java
false
false
3,161
java
package com.vtiger.opportunity; import java.util.NoSuchElementException; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.Reporter; import org.testng.annotations.Test; import com.vtiger.GenericLib.BaseClass; /** * Search the Opportunity No Using Not Equal Option With an Invalid Character. * @author admin * */ public class SearchOpportunityNoByNotEqualOptionWithInvalidCharacterTc_44 extends BaseClass{ @Test public void SearchOpportunityNoByNotEqualOptionWithInvalidCharacterNameTc_44Test() { /* Login into application using url login to CRM with valid data */ /* navigate to opportunity & click.*/ Actions a=new Actions(dr); WebDriverWait wait1=new WebDriverWait(dr, 20); try { WebElement opportunity = wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("(//a[text()='Opportunities'])[1]"))); a.moveToElement(opportunity).perform(); opportunity.click(); } catch(NoSuchElementException ex) { } Reporter.log("Navigated to opportunity & clicked successfully.. ",true); /* click in go to advance search icon.*/ WebDriverWait wait2 = new WebDriverWait(dr, 20); try { WebElement advance =wait1.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//a[text()='Go to Advanced Search']"))); advance.click(); } catch(NoSuchElementException ex) { } Reporter.log("Clicked on advance search icon succesfully..",true); /* select opportunity name from dropdown list*/ WebElement name = dr.findElement(By.id("fcol0")); Select s=new Select(name); s.selectByVisibleText("Opportunity No"); Reporter.log("Opportunity no selected from dropdown list succesfully..",true); /* select equals to option from another dropdown box*/ WebElement type = dr.findElement(By.id("fop0")); Select s1=new Select(type); //s.selectByValue("n"); s1.selectByVisibleText("not equal to"); Reporter.log("Search option selected from dropdown list succesfully..",true); /* enter any valid name of opportunity related to into text box*/ WebDriverWait wait5 = new WebDriverWait(dr, 20); try{ WebElement input = wait5.until(ExpectedConditions.visibilityOfElementLocated(By.id("fval0"))); input.sendKeys("Marvel corp"); } catch(NoSuchElementException ex) { } Reporter.log("Opportunity character name entered in textbox",true); /* click on search now button*/ dr.findElement(By.xpath("(//input[@value=' Search Now '])[2]")).click(); Reporter.log("Search now button clicked..",true); /* logout and close browser.*/ } } // not equal to Marvel corp
[ "admin@admin-PC" ]
admin@admin-PC
53e78aa0733e6e1f1afab88fed97bb0048f4ad1b
179c1e140217fbfc75d08b0a648286f9bcdd5fe1
/spring-basic/src/test/java/org/seefly/springbasic/Test1.java
8817f4ae0b726db3ab6b0b9c165dcd62d41b4ce9
[]
no_license
gitdoit/learning-springboot
3dd9591553733b3055b4ea729f0027d1bc15635e
064684c7acfe176856432f38cdcb652837991775
refs/heads/master
2023-06-23T16:56:57.722712
2022-11-13T12:40:53
2022-11-13T12:40:53
206,306,631
2
2
null
2023-06-20T18:33:11
2019-09-04T11:47:17
Java
UTF-8
Java
false
false
314
java
package org.seefly.springbasic; import org.junit.Test; import java.util.HashMap; import java.util.Map; /** * @author liujianxin * @date 2019-05-08 21:31 */ public class Test1 { @Test public void test1(){ HashMap<String,String> map = new HashMap<>(); map.put("sfd","sfd"); } }
[ "seefly@vip.qq.com" ]
seefly@vip.qq.com
cb3bd8b7646cbedb886fdd7cfc569dd7b53c69b6
c8f865d7d08fa4b70897b86dbfe73ed20752086c
/src/main/java/com/redhat/gpe/salesforce/dto/JobTypeEnum.java
741759084fd349a375b98254753252ba5da5301f
[]
no_license
samueltauil/sfintegration
c9da36733c7f0f06b3fa2793febf7b7acc6f660a
717c085c1103e5c5fa924cc1217fbb8c35afe804
refs/heads/master
2020-12-31T04:28:52.847294
2016-01-29T05:35:00
2016-01-29T05:35:00
50,638,201
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
/* * Salesforce DTO generated by camel-salesforce-maven-plugin * Generated on: Fri Jan 29 00:57:07 BRST 2016 */ package com.redhat.gpe.salesforce.dto; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonValue; /** * Salesforce Enumeration DTO for picklist JobType */ public enum JobTypeEnum { // 1 _1("1"), // 3 _3("3"), // 4 _4("4"), // 7 _7("7"), // 8 _8("8"), // 9 _9("9"), // A A("A"); final String value; private JobTypeEnum(String value) { this.value = value; } @JsonValue public String value() { return this.value; } @JsonCreator public static JobTypeEnum fromValue(String value) { for (JobTypeEnum e : JobTypeEnum.values()) { if (e.value.equals(value)) { return e; } } throw new IllegalArgumentException(value); } }
[ "samueltauil@gmail.com" ]
samueltauil@gmail.com
208f72d04900ad93eb2a5b2aad0cd6f327245662
814a1cca586530680170598ed4217792d869c1bf
/src/main/java/com/matez/wildnature/world/gen/structures/nature/woods/willow/pointy_willow_2.java
5714789f61f3db233f52802e56c9991d1415660b
[ "Apache-2.0" ]
permissive
dither001/WNDev1.14.4
ce5cd9ad82ce65e93bf923fc84a79aed389466cd
effb84616610bb7081754dab84e5738e96ce120b
refs/heads/master
2022-11-09T02:52:49.815667
2020-07-03T15:26:27
2020-07-03T15:26:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,988
java
package com.matez.wildnature.world.gen.structures.nature.woods.willow; import com.matez.wildnature.Main; import com.matez.wildnature.world.gen.structures.nature.SchemFeature; import com.mojang.datafixers.Dynamic; import net.minecraft.util.math.BlockPos; import net.minecraft.block.BlockState; import net.minecraft.world.gen.feature.NoFeatureConfig; import java.util.Set; import java.util.function.Function; public class pointy_willow_2 extends SchemFeature { public pointy_willow_2(Function<Dynamic<?>, ? extends NoFeatureConfig> config, boolean doBlockNofityOnPlace) { super(config, doBlockNofityOnPlace); Main.treesList.add(this); } public pointy_willow_2(Function<Dynamic<?>, ? extends NoFeatureConfig> config, boolean doBlockNofityOnPlace, BlockState log, BlockState leaves) { super(config, doBlockNofityOnPlace); Main.treesList.add(this); LOG = log; LEAVES =leaves; } @Override public Set<BlockPos> setBlocks() { Block(0,7,-3,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(0,6,-2,"wildnature:willow_branch[down=false,east=false,north=false,south=true,up=true,waterlogged=false,west=false]"); Block(0,7,-2,"wildnature:willow_branch[down=true,east=false,north=true,south=true,up=false,waterlogged=false,west=false]"); Block(0,9,-2,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(0,11,-2,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(1,11,-2,"wildnature:willow_leaves[distance=2,persistent=true]"); Block(0,1,-1,"wildnature:willow_log[axis=y]"); Block(0,2,-1,"wildnature:willow_log[axis=y]"); Block(0,3,-1,"wildnature:willow_log[axis=y]"); Block(-1,6,-1,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(0,6,-1,"wildnature:willow_branch[down=false,east=false,north=true,south=true,up=true,waterlogged=false,west=true]"); Block(-2,7,-1,"wildnature:willow_branch[down=false,east=false,north=false,south=true,up=true,waterlogged=false,west=false]"); Block(0,7,-1,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(1,7,-1,"wildnature:willow_leaves[distance=2,persistent=true]"); Block(-3,8,-1,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(-2,8,-1,"wildnature:willow_branch[down=true,east=false,north=false,south=false,up=true,waterlogged=false,west=true]"); Block(-3,9,-1,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(-2,9,-1,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(0,9,-1,"wildnature:willow_log[axis=y]"); Block(1,9,-1,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(0,10,-1,"wildnature:willow_log[axis=y]"); Block(1,10,-1,"wildnature:willow_branch[down=true,east=true,north=false,south=false,up=true,waterlogged=false,west=true]"); Block(2,10,-1,"wildnature:willow_branch[down=false,east=false,north=false,south=true,up=true,waterlogged=false,west=true]"); Block(0,11,-1,"wildnature:willow_log[axis=y]"); Block(1,11,-1,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(2,11,-1,"wildnature:willow_leaves[distance=2,persistent=true]"); Block(0,12,-1,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(-1,1,0,"wildnature:willow_log[axis=y]"); Block(0,1,0,"wildnature:willow_log[axis=y]"); Block(1,1,0,"wildnature:willow_log[axis=y]"); Block(0,2,0,"wildnature:willow_log[axis=y]"); Block(0,3,0,"wildnature:willow_log[axis=y]"); Block(0,4,0,"wildnature:willow_log[axis=y]"); Block(1,4,0,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(0,5,0,"wildnature:willow_log[axis=y]"); Block(0,6,0,"wildnature:willow_log[axis=y]"); Block(1,6,0,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(-2,7,0,"wildnature:willow_branch[down=false,east=true,north=true,south=false,up=false,waterlogged=false,west=false]"); Block(-1,7,0,"wildnature:willow_branch[down=false,east=true,north=false,south=false,up=true,waterlogged=false,west=true]"); Block(0,7,0,"wildnature:willow_log[axis=y]"); Block(1,7,0,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(-1,8,0,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(0,8,0,"wildnature:willow_log[axis=y]"); Block(0,9,0,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(2,10,0,"wildnature:willow_branch[down=false,east=true,north=true,south=true,up=true,waterlogged=false,west=false]"); Block(3,10,0,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(0,11,0,"wildnature:willow_leaves[distance=1,persistent=true]"); Block(2,11,0,"wildnature:willow_branch[down=true,east=false,north=true,south=true,up=false,waterlogged=false,west=false]"); Block(0,1,1,"wildnature:willow_log[axis=y]"); Block(0,2,1,"wildnature:willow_log[axis=y]"); Block(0,5,1,"wildnature:willow_branch[down=false,east=true,north=true,south=false,up=false,waterlogged=false,west=false]"); Block(1,5,1,"wildnature:willow_branch[down=false,east=false,north=false,south=false,up=true,waterlogged=false,west=true]"); Block(1,6,1,"wildnature:willow_branch[down=true,east=false,north=true,south=false,up=false,waterlogged=false,west=false]"); Block(0,8,1,"wildnature:willow_branch[down=false,east=false,north=true,south=false,up=true,waterlogged=false,west=false]"); Block(0,9,1,"wildnature:willow_branch[down=true,east=true,north=true,south=true,up=false,waterlogged=false,west=false]"); Block(1,9,1,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(2,9,1,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(2,10,1,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(2,11,1,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(0,9,2,"wildnature:willow_branch[down=false,east=true,north=true,south=false,up=true,waterlogged=false,west=false]"); Block(1,9,2,"wildnature:willow_leaves[distance=7,persistent=true]"); Block(0,10,2,"wildnature:willow_leaves[distance=7,persistent=true]"); // wildnature mod // created by matez // all rights reserved // http://bit.ly/wildnature-mod return super.setBlocks(); } }
[ "xmati.zamojski@gmail.com" ]
xmati.zamojski@gmail.com
a403f0ddfc2e8b5840870c75997a221063dc4dc5
5a940a1f038e03869a0934ebb3d684731face903
/src/main/java/com/mossle/auth/web/AccessBatchController.java
0723283b89b6317f056daab1ece62448ff32a209
[]
no_license
zhiqinghuang/SmartPlatform
3a92f2b59fed40665396e5c2de80392ed51cab97
995e13d57989ec505c730a39ffff38c23342f178
refs/heads/master
2022-12-23T08:46:40.881068
2020-12-04T03:32:54
2020-12-04T03:32:54
45,810,484
0
1
null
2022-12-16T01:17:38
2015-11-09T02:35:55
JavaScript
UTF-8
Java
false
false
2,733
java
package com.mossle.auth.web; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.mossle.api.tenant.TenantHolder; import com.mossle.auth.persistence.domain.Access; import com.mossle.auth.persistence.manager.AccessManager; import com.mossle.auth.service.AuthService; import com.mossle.core.spring.MessageHelper; import com.mossle.spi.auth.ResourcePublisher; @Controller @RequestMapping("auth") public class AccessBatchController { private AccessManager accessManager; private AuthService authService; private MessageHelper messageHelper; private ResourcePublisher resourcePublisher; private TenantHolder tenantHolder; @RequestMapping("access-batch-list") public String list() { return "auth/access-batch-list"; } @RequestMapping("access-batch-input") public String input(@RequestParam("type") String type, Model model) { String hql = "from Access where type=? and tenantId=? order by priority"; List<Access> accesses = accessManager.find(hql, type, tenantHolder.getTenantId()); StringBuilder buff = new StringBuilder(); for (Access access : accesses) { String value = access.getValue(); String permStr = ""; if (access.getPerm() != null) { permStr = access.getPerm().getCode(); } buff.append(value).append(",").append(permStr).append("\n"); } String text = buff.toString(); model.addAttribute("text", text); model.addAttribute("type", type); return "auth/access-batch-input"; } @RequestMapping("access-batch-save") public String save(@RequestParam("text") String text, @RequestParam("type") String type, RedirectAttributes redirectAttributes) { authService.batchSaveAccess(text, type, tenantHolder.getTenantId()); messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功"); resourcePublisher.publish(); return "redirect:/auth/access-list.do"; } @Resource public void setAccessManager(AccessManager accessManager) { this.accessManager = accessManager; } @Resource public void setAuthService(AuthService authService) { this.authService = authService; } @Resource public void setMessageHelper(MessageHelper messageHelper) { this.messageHelper = messageHelper; } @Resource public void setResourcePublisher(ResourcePublisher resourcePublisher) { this.resourcePublisher = resourcePublisher; } @Resource public void setTenantHolder(TenantHolder tenantHolder) { this.tenantHolder = tenantHolder; } } //need to confirm
[ "beahuang@hotmail.com" ]
beahuang@hotmail.com
e24d36b3c9506b6af82b5f568c2b81b0e4188ea1
746572ba552f7d52e8b5a0e752a1d6eb899842b9
/JDK8Source/src/main/java/java/nio/ByteBufferAsLongBufferL.java
1addc494b0dd0f98a93ddcedd00ffa8ea84a416e
[]
no_license
lobinary/Lobinary
fde035d3ce6780a20a5a808b5d4357604ed70054
8de466228bf893b72c7771e153607674b6024709
refs/heads/master
2022-02-27T05:02:04.208763
2022-01-20T07:01:28
2022-01-20T07:01:28
26,812,634
7
5
null
null
null
null
UTF-8
Java
false
false
3,520
java
/***** Lobxxx Translate Finished ******/ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ // -- This file was mechanically generated: Do not edit! -- // package java.nio; class ByteBufferAsLongBufferL // package-private extends LongBuffer { protected final ByteBuffer bb; protected final int offset; ByteBufferAsLongBufferL(ByteBuffer bb) { // package-private super(-1, 0, bb.remaining() >> 3, bb.remaining() >> 3); this.bb = bb; // enforce limit == capacity int cap = this.capacity(); this.limit(cap); int pos = this.position(); assert (pos <= cap); offset = pos; } ByteBufferAsLongBufferL(ByteBuffer bb, int mark, int pos, int lim, int cap, int off) { super(mark, pos, lim, cap); this.bb = bb; offset = off; } public LongBuffer slice() { int pos = this.position(); int lim = this.limit(); assert (pos <= lim); int rem = (pos <= lim ? lim - pos : 0); int off = (pos << 3) + offset; assert (off >= 0); return new ByteBufferAsLongBufferL(bb, -1, 0, rem, rem, off); } public LongBuffer duplicate() { return new ByteBufferAsLongBufferL(bb, this.markValue(), this.position(), this.limit(), this.capacity(), offset); } public LongBuffer asReadOnlyBuffer() { return new ByteBufferAsLongBufferRL(bb, this.markValue(), this.position(), this.limit(), this.capacity(), offset); } protected int ix(int i) { return (i << 3) + offset; } public long get() { return Bits.getLongL(bb, ix(nextGetIndex())); } public long get(int i) { return Bits.getLongL(bb, ix(checkIndex(i))); } public LongBuffer put(long x) { Bits.putLongL(bb, ix(nextPutIndex()), x); return this; } public LongBuffer put(int i, long x) { Bits.putLongL(bb, ix(checkIndex(i)), x); return this; } public LongBuffer compact() { int pos = position(); int lim = limit(); assert (pos <= lim); int rem = (pos <= lim ? lim - pos : 0); ByteBuffer db = bb.duplicate(); db.limit(ix(lim)); db.position(ix(0)); ByteBuffer sb = db.slice(); sb.position(pos << 3); sb.compact(); position(rem); limit(capacity()); discardMark(); return this; } public boolean isDirect() { return bb.isDirect(); } public boolean isReadOnly() { return false; } public ByteOrder order() { return ByteOrder.LITTLE_ENDIAN; } }
[ "919515134@qq.com" ]
919515134@qq.com
35a0529cc39e7ebc506a06a9bf8829bcb61fe0e7
2904db9983dd67906ac195e23d279e876bc954e2
/app/src/main/java/com/cyanbirds/yljy/ui/widget/WrapperLinearLayoutManager.java
2605db36acc0e1ea0a137e2397f2f11354f52065
[]
no_license
wybilold1999/YLProject
d85b8e2f1cd5151698d60733f61b79c7ddf48fa5
2e0c044d8c28eb9363431f7362e3ea1223630a7c
refs/heads/master
2020-03-11T10:05:04.785323
2018-04-19T06:17:31
2018-04-19T06:17:31
87,953,566
0
0
null
null
null
null
UTF-8
Java
false
false
1,029
java
package com.cyanbirds.yljy.ui.widget; import android.content.Context; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; /** * Created by wangyb on 2017/5/18. * 描述: */ public class WrapperLinearLayoutManager extends LinearLayoutManager { public WrapperLinearLayoutManager(Context context) { super(context); } public WrapperLinearLayoutManager(Context context, int orientation, boolean reverseLayout) { super(context, orientation, reverseLayout); } public WrapperLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } @Override public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) { try { super.onLayoutChildren(recycler, state); } catch (IndexOutOfBoundsException e) { e.printStackTrace(); } } }
[ "395044952@qq.com" ]
395044952@qq.com
3807da3cc36209875a14b8939a4e6242154bb6f2
97ee281b5817ae1a10120fbcfa9718b71efbddfe
/modules/mp/src/main/java/com/berg/mp/service/mp/ActivityQRCodeService.java
1fb6debd519e4b5ee37e2f8b916774b3a9c0d176
[]
no_license
BoGeManger/berg-wx-mp
ce7e7222e3a86cc61b2c7714aec2df1c2fde114d
c3e0a7a22886e79d695ef4ef959eeae1e7aea579
refs/heads/main
2023-03-31T02:19:03.444796
2021-04-08T11:23:37
2021-04-08T11:23:37
313,799,803
1
0
null
null
null
null
UTF-8
Java
false
false
278
java
package com.berg.mp.service.mp; import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; public interface ActivityQRCodeService { String getKeyReply(WxMpXmlMessage wxMpXmlMessage, String appId, String event); }
[ "664120843@qq.com" ]
664120843@qq.com
21dabe7f9112b2616243e564513e192917c93e78
4e84c9dbc699cfdf090a2872a7e2bdf79b9dc971
/fanweHybridLive/src/main/java/com/fanwe/auction/activity/AuctionCreateEmptyActivity.java
a1e49bece03ee8fe5a9abd8eb795c8d3f3b87b6d
[]
no_license
nickoo123/FanweLive11
d994f5b6d36a0dd7ac06858f8c78239bfca629a4
2cecccf5c6795c4492f6c9d213d6cf27b6188dd4
refs/heads/master
2023-03-19T18:17:29.493984
2020-03-20T08:50:41
2020-03-20T08:50:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,175
java
package com.fanwe.auction.activity; import android.os.Bundle; import android.view.ViewGroup; import com.fanwe.auction.appview.AuctionRealGoodsView; import com.fanwe.auction.appview.AuctionVirtualGoodsView; import com.fanwe.hybrid.activity.BaseActivity; import com.fanwe.live.R; /** * Created by shibx on 2016/8/5. */ public class AuctionCreateEmptyActivity extends BaseActivity { private AuctionVirtualGoodsView mVirtualGoodsView;//新增虚拟竞拍视图 private AuctionRealGoodsView mRealGoodsView;//新增实物竞拍视图 /** * 设置商品类型(int) 1为实体商品 0为虚拟商品 */ public static final String EXTRA_VIEW_FLAG = "extra_view_flag"; /** * 设置商品ID */ public static final String EXTRA_ID = "extra_id"; public static final String EXTRA_MODEL = "extra_model"; private int mFlag; //全屏参数 private ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); private String id; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act_empty_ll_content); getExtraData(); init(); } private void getExtraData() { Bundle bundle = getIntent().getExtras(); if (bundle != null) { mFlag = bundle.getInt(EXTRA_VIEW_FLAG); id = bundle.getString(EXTRA_ID); } } private void init() { addView(); } private void addView() { if (mFlag == 1) { mRealGoodsView = new AuctionRealGoodsView(this); mRealGoodsView.requestData(id); mRealGoodsView.setLayoutParams(layoutParams); replaceView(R.id.ll_content, mRealGoodsView); } else { mVirtualGoodsView = new AuctionVirtualGoodsView(this); mVirtualGoodsView.setLayoutParams(layoutParams); replaceView(R.id.ll_content, mVirtualGoodsView); } } }
[ "zq090428" ]
zq090428
0d2ec61a277090e394b69b07cfa1e81dd53b0281
062fa4f7f890198a53ad03ee849c10b4a0cc8826
/classes-dex2jar_source_from_jdcore/android/support/v7/widget/d.java
cc545b128d4982b42a521860776833a54c19753c
[]
no_license
Biu-G/combostuck
e721e24015379f6bfa4f4222ff49a5826e5b1991
57fed26a45e238f36ba056b3960ff05f882eb55f
refs/heads/master
2020-07-03T21:30:07.489769
2019-11-06T17:27:47
2019-11-06T17:27:47
202,056,117
0
0
null
null
null
null
UTF-8
Java
false
false
4,110
java
package android.support.v7.widget; import android.content.res.ColorStateList; import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.os.Build.VERSION; import android.support.annotation.NonNull; import android.support.v4.view.ViewCompat; import android.support.v7.appcompat.R.styleable; import android.util.AttributeSet; import android.view.View; class d { private final View a; private final AppCompatDrawableManager b; private int c = -1; private ad d; private ad e; private ad f; d(View paramView) { a = paramView; b = AppCompatDrawableManager.get(); } private boolean b(@NonNull Drawable paramDrawable) { if (f == null) { f = new ad(); } ad localAd = f; localAd.a(); Object localObject = ViewCompat.getBackgroundTintList(a); if (localObject != null) { d = true; a = ((ColorStateList)localObject); } localObject = ViewCompat.getBackgroundTintMode(a); if (localObject != null) { c = true; b = ((PorterDuff.Mode)localObject); } if ((!d) && (!c)) { return false; } AppCompatDrawableManager.a(paramDrawable, localAd, a.getDrawableState()); return true; } private boolean d() { int i = Build.VERSION.SDK_INT; boolean bool = false; if (i > 21) { if (d != null) { bool = true; } return bool; } return i == 21; } ColorStateList a() { if (e != null) { return e.a; } return null; } void a(int paramInt) { c = paramInt; ColorStateList localColorStateList; if (b != null) { localColorStateList = b.a(a.getContext(), paramInt); } else { localColorStateList = null; } b(localColorStateList); c(); } void a(ColorStateList paramColorStateList) { if (e == null) { e = new ad(); } e.a = paramColorStateList; e.d = true; c(); } void a(PorterDuff.Mode paramMode) { if (e == null) { e = new ad(); } e.b = paramMode; e.c = true; c(); } void a(Drawable paramDrawable) { c = -1; b(null); c(); } void a(AttributeSet paramAttributeSet, int paramInt) { paramAttributeSet = TintTypedArray.obtainStyledAttributes(a.getContext(), paramAttributeSet, R.styleable.ViewBackgroundHelper, paramInt, 0); try { if (paramAttributeSet.hasValue(R.styleable.ViewBackgroundHelper_android_background)) { c = paramAttributeSet.getResourceId(R.styleable.ViewBackgroundHelper_android_background, -1); ColorStateList localColorStateList = b.a(a.getContext(), c); if (localColorStateList != null) { b(localColorStateList); } } if (paramAttributeSet.hasValue(R.styleable.ViewBackgroundHelper_backgroundTint)) { ViewCompat.setBackgroundTintList(a, paramAttributeSet.getColorStateList(R.styleable.ViewBackgroundHelper_backgroundTint)); } if (paramAttributeSet.hasValue(R.styleable.ViewBackgroundHelper_backgroundTintMode)) { ViewCompat.setBackgroundTintMode(a, DrawableUtils.parseTintMode(paramAttributeSet.getInt(R.styleable.ViewBackgroundHelper_backgroundTintMode, -1), null)); } return; } finally { paramAttributeSet.recycle(); } } PorterDuff.Mode b() { if (e != null) { return e.b; } return null; } void b(ColorStateList paramColorStateList) { if (paramColorStateList != null) { if (d == null) { d = new ad(); } d.a = paramColorStateList; d.d = true; } else { d = null; } c(); } void c() { Drawable localDrawable = a.getBackground(); if (localDrawable != null) { if ((d()) && (b(localDrawable))) { return; } if (e != null) { AppCompatDrawableManager.a(localDrawable, e, a.getDrawableState()); return; } if (d != null) { AppCompatDrawableManager.a(localDrawable, d, a.getDrawableState()); } } } }
[ "htlzkahsy@gmail.com" ]
htlzkahsy@gmail.com
faff33656025c4d3d19d04359745d9e7dce74411
cad4f947dbb6f1ef7f6d531aaf725ec4b8c7986e
/arcusApp/app/src/main/java/arcus/app/subsystems/lawnandgarden/zoneorder/IrrigationZoneListDataProvider.java
cb9d7320b9a9cd8e6879adb7a003d5436e490bca
[ "Apache-2.0" ]
permissive
pupper68k/arcusandroid
324e3abbd2f3e789431c7dcac1d495c262702179
50e0a6d71609bf404353da80d8e620584cc818d3
refs/heads/master
2020-07-28T17:23:04.035283
2019-02-28T17:52:25
2019-02-28T17:52:25
209,477,977
0
0
Apache-2.0
2019-09-19T06:24:01
2019-09-19T06:24:00
null
UTF-8
Java
false
false
3,810
java
/* * Copyright 2019 Arcus Project. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package arcus.app.subsystems.lawnandgarden.zoneorder; import android.content.Context; import android.support.annotation.NonNull; import arcus.app.R; import arcus.app.dashboard.settings.model.DraggableListDataProvider; import arcus.app.subsystems.lawnandgarden.models.IrrigationZoneInfo; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class IrrigationZoneListDataProvider implements DraggableListDataProvider { @NonNull List<IrrigationZoneListItemModel> irrigationZoneModelList = new ArrayList<>(); boolean bShowEnabledItemsOnly = true; public IrrigationZoneListDataProvider(@NonNull Context context, @NonNull ArrayList<IrrigationZoneInfo> zones) { for(IrrigationZoneInfo info : zones) { IrrigationZoneCard card = new IrrigationZoneCard(info.getDisplayName(), info.getZoneDisplay(), R.drawable.irrigation_zone_small, 0, info.getZoneId(), info.getDuration()); IrrigationZoneListItemModel data = new IrrigationZoneListItemModel(card.getTitle(), card); data.setEnabled(info.isVisible()); irrigationZoneModelList.add(data); } } @Override public int getCount() { if(bShowEnabledItemsOnly) { return getOrderedVisibleItems().size(); } return irrigationZoneModelList.size(); } public void setShowEnabledItemsOnly(boolean bShowEnabledItemsOnly) { this.bShowEnabledItemsOnly = bShowEnabledItemsOnly; } @Override public IrrigationZoneListItemModel getItem(int index) { if(bShowEnabledItemsOnly) { return getOrderedVisibleItems().get(index); } return irrigationZoneModelList.get(index); } @Override public void removeItem(int position) { // Nothing to do; items not removable } @Override public void moveItem(int fromPosition, int toPosition) { IrrigationZoneListItemModel data = irrigationZoneModelList.remove(fromPosition); irrigationZoneModelList.add(toPosition, data); } @NonNull public Set<IrrigationZoneCard> getVisibleItems() { Set<IrrigationZoneCard> visibleCards = new HashSet<>(); for (IrrigationZoneListItemModel thisModel : irrigationZoneModelList) { if (thisModel.isEnabled()) { visibleCards.add(thisModel.getIrrigationZoneCard()); } } return visibleCards; } @NonNull public List<IrrigationZoneListItemModel> getOrderedVisibleItems() { List<IrrigationZoneListItemModel> visibleCards = new ArrayList<>(); for (IrrigationZoneListItemModel thisModel : irrigationZoneModelList) { if (thisModel.isEnabled()) { visibleCards.add(thisModel); } } return visibleCards; } @NonNull public List<IrrigationZoneCard> getOrderedListOfItems() { List<IrrigationZoneCard> orderedList = new ArrayList<>(); for (IrrigationZoneListItemModel thisModel : irrigationZoneModelList) { orderedList.add(thisModel.getIrrigationZoneCard()); } return orderedList; } }
[ "b@yoyo.com" ]
b@yoyo.com
8aa77ba5832e784fbd59b57cc72e6f4ad1a66b03
6e63f7d4f8fd2f0530e05b91be6301b92c79dec4
/DIT952/Exercises/vetej/src/DIT952/polygon/RotatedPolygon.java
48fb2fe0fb9b089c3cde6010b60d95ca36438122
[]
no_license
ketric/DIT952
6c43b3cd58dfcbb0ac3f3db4c125e6a9e7c66842
1a8841f89fa1bce136250458d0121c83c9390772
refs/heads/master
2020-03-19T00:21:47.218341
2018-05-30T17:27:20
2018-05-30T17:27:20
82,115,275
0
0
null
null
null
null
UTF-8
Java
false
false
1,328
java
package DIT952.polygon; import java.awt.*; import java.util.List; /** * Created by Niklas on 2016-02-28. */ class RotatedPolygon extends AbstractPolygon implements IPolygon { private AbstractPolygon base; private double radians; RotatedPolygon(AbstractPolygon base, double radians) { this.base = base; this.radians = radians; } @Override public IPolygon translate(int x, int y) { return new TranslatedPolygon(this, x, y); } @Override public IPolygon rotate(double radians) { this.radians = radians; return this; } @Override public IPolygon scale(double x, double y) { return new ScaledPolygon(this, x, y); } @Override public List<Point> getPoints() { return getPointsWithBase(base); } @Override protected void manipulatePoint(Point center, Point p) { rotatePoint(center, p, this.radians); } //Rotates the point around the centre point private static void rotatePoint(Point center, Point point, double alpha) { double newX = center.x + (point.x - center.x) * Math.cos(alpha) - (point.y - center.y) * Math.sin(alpha); double newY = center.y + (point.x - center.x) * Math.sin(alpha) + (point.y - center.y) * Math.cos(alpha); point.x = (int) newX; point.y = (int) newY; } @Override public Point getCenterPoint() { return base.getCenterPoint(); } }
[ "kennyle1996@hotmail.com" ]
kennyle1996@hotmail.com
01e7a64897a85285deee51239c30bf89067c8160
c156bf50086becbca180f9c1c9fbfcef7f5dc42c
/src/main/java/com/waterelephant/service/impl/BwXjbkContactRegionServiceImpl.java
99b3194dda7e400bc011558e845e49a1e372fd57
[]
no_license
zhanght86/beadwalletloanapp
9e3def26370efd327dade99694006a6e8b18a48f
66d0ae7b0861f40a75b8228e3a3b67009a1cf7b8
refs/heads/master
2020-12-02T15:01:55.982023
2019-11-20T09:27:24
2019-11-20T09:27:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,131
java
/// ****************************************************************************** // * Copyright (C) 2016 Wuhan Medical union Co.Ltd All Rights Reserved. // * 本软件为武汉水象科技有限公司开发研制。 未经本公司正式书面同意,其他任何个人、 // * 团体不得使用、复制、修改或发布本软件. // *****************************************************************************/ // package com.waterelephant.service.impl; // // import com.waterelephant.entity.BwXjbkContactRegion; // import com.waterelephant.service.BaseService; // import com.waterelephant.service.BwXjbkContactRegionService; // import org.springframework.stereotype.Service; // // import java.util.List; // /// ** // * Module:(code:xjbk001) // * <p> // * BwXjbkContactRegionServiceImpl.java // * // * @author zhangchong // * @version 1.0 // * @description: <描述> // * @since JDK 1.8 // */ // @Service // public class BwXjbkContactRegionServiceImpl extends BaseService<BwXjbkContactRegion, Long> implements /// BwXjbkContactRegionService { // // /** // * @see com.waterelephant.service.BwXjbkContactRegionService#findByAttr(com.waterelephant.entity.BwXjbkContactRegion) // */ // @Override // public List<BwXjbkContactRegion> findByAttr(BwXjbkContactRegion bwXjbkContactRegion) { // return mapper.select(bwXjbkContactRegion); // } // // /** // * @see com.waterelephant.service.BwXjbkContactRegionService#save(com.waterelephant.entity.BwXjbkContactRegion) // */ // @Override // public int save(BwXjbkContactRegion bwXjbkContactRegion) { // return mapper.insert(bwXjbkContactRegion); // } // // /** // * @see com.waterelephant.service.BwXjbkContactRegionService#update(com.waterelephant.entity.BwXjbkContactRegion) // */ // @Override // public int update(BwXjbkContactRegion bwXjbkContactRegion) { // return mapper.updateByPrimaryKey(bwXjbkContactRegion); // } // // /** // * @see com.waterelephant.service.BwXjbkContactRegionService#del(com.waterelephant.entity.BwXjbkContactRegion) // */ // @Override // public int del(BwXjbkContactRegion bwXjbkContactRegion) { // return mapper.delete(bwXjbkContactRegion); // } // // }
[ "wurenbiao@beadwallet.com" ]
wurenbiao@beadwallet.com
d7630ec23571bef70ac9d33fec3cea8d13908548
e6d716fde932045d076ab18553203e2210c7bc44
/bluesky-pentaho-kettle/engine/src/main/java/org/pentaho/di/trans/steps/excelinput/staxpoi/StaxPoiWorkbook.java
0c3ceff5ed861d6a250fd49be67c188a6ed0837f
[]
no_license
BlueCodeBoy/bluesky
d04032e6c0ce87a18bcbc037191ca20d03aa133e
6fc672455b6047979527da9ba8e3fc220d5cee37
refs/heads/master
2020-04-18T10:47:20.434313
2019-01-25T03:30:47
2019-01-25T03:30:47
167,478,568
6
0
null
null
null
null
UTF-8
Java
false
false
6,164
java
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2015 by Pentaho : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ /** * Author = Shailesh Ahuja */ package org.pentaho.di.trans.steps.excelinput.staxpoi; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.xssf.eventusermodel.XSSFReader; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.logging.KettleLogStore; import org.pentaho.di.core.logging.LogChannelInterface; import org.pentaho.di.core.spreadsheet.KSheet; import org.pentaho.di.core.spreadsheet.KWorkbook; /** * Streaming reader for XLSX files.<br> * Does not open XLS. */ public class StaxPoiWorkbook implements KWorkbook { private static final String RELATION_NS_URI = "http://schemas.openxmlformats.org/officeDocument/2006/relationships"; private LogChannelInterface log; private XSSFReader reader; // maintain the mapping of the sheet name to its ID private Map<String, String> sheetNameIDMap; // sheet names in order private String[] sheetNames; // mapping of the sheet object with its ID/Name private Map<String, StaxPoiSheet> openSheetsMap; private OPCPackage opcpkg; protected StaxPoiWorkbook() { openSheetsMap = new HashMap<String, StaxPoiSheet>(); this.log = KettleLogStore.getLogChannelInterfaceFactory().create( this ); } public StaxPoiWorkbook( String filename, String encoding ) throws KettleException { this(); try { opcpkg = OPCPackage.open( filename ); openFile( opcpkg, encoding ); } catch ( Exception e ) { throw new KettleException( e ); } } public StaxPoiWorkbook( InputStream inputStream, String encoding ) throws KettleException { this(); try { opcpkg = OPCPackage.open( inputStream ); openFile( opcpkg, encoding ); } catch ( Exception e ) { throw new KettleException( e ); } } private void openFile( OPCPackage pkg, String encoding ) throws KettleException { InputStream workbookData = null; XMLStreamReader workbookReader = null; try { reader = new XSSFReader( pkg ); sheetNameIDMap = new LinkedHashMap<String, String>(); workbookData = reader.getWorkbookData(); XMLInputFactory factory = XMLInputFactory.newInstance(); workbookReader = factory.createXMLStreamReader( workbookData ); while ( workbookReader.hasNext() ) { if ( workbookReader.next() == XMLStreamConstants.START_ELEMENT && workbookReader.getLocalName().equals( "sheet" ) ) { String sheetName = workbookReader.getAttributeValue( null, "name" ); String sheetID = workbookReader.getAttributeValue( RELATION_NS_URI, "id" ); sheetNameIDMap.put( sheetName, sheetID ); } } sheetNames = new String[ sheetNameIDMap.size() ]; int i = 0; for ( String sheetName : sheetNameIDMap.keySet() ) { sheetNames[i++] = sheetName; } } catch ( Exception e ) { throw new KettleException( e ); } finally { if ( workbookReader != null ) { try { workbookReader.close(); } catch ( XMLStreamException e ) { throw new KettleException( e ); } } if ( workbookData != null ) { try { workbookData.close(); } catch ( IOException e ) { throw new KettleException( e ); } } } } @Override /** * return the same sheet if it already is created otherwise instantiate a new one */ public KSheet getSheet( String sheetName ) { String sheetID = sheetNameIDMap.get( sheetName ); if ( sheetID == null ) { return null; } StaxPoiSheet sheet = openSheetsMap.get( sheetID ); if ( sheet == null ) { try { sheet = new StaxPoiSheet( reader, sheetName, sheetID ); openSheetsMap.put( sheetID, sheet ); } catch ( Exception e ) { log.logError( sheetName, e ); } } return sheet; } @Override public String[] getSheetNames() { String[] sheets = new String[sheetNameIDMap.size()]; return sheetNameIDMap.keySet().toArray( sheets ); } @Override public void close() { // close all the sheets for ( StaxPoiSheet sheet : openSheetsMap.values() ) { try { sheet.close(); } catch ( IOException e ) { log.logError( "Could not close workbook", e ); } catch ( XMLStreamException e ) { log.logError( "Could not close xmlstream", e ); } } if ( opcpkg != null ) { //We should not save change in xlsx because it is input step. opcpkg.revert(); } } @Override public int getNumberOfSheets() { return sheetNameIDMap.size(); } @Override public KSheet getSheet( int sheetNr ) { if ( sheetNr >= 0 && sheetNr < sheetNames.length ) { return getSheet( sheetNames[sheetNr] ); } return null; } @Override public String getSheetName( int sheetNr ) { if ( sheetNr >= 0 && sheetNr < sheetNames.length ) { return sheetNames[sheetNr]; } return null; } }
[ "pp@gmail.com" ]
pp@gmail.com
716fccf60577086ba9561493c974c58400a736f5
806d98680bfd318fe5d8e65d08628ec75729faca
/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/ext/history/AgentChatHistory.java
12db396a825ac50ca448bfabd859f2cf80fbbfc0
[ "Apache-2.0" ]
permissive
AdarshMaurya/Smack
f21df5428d8fca5701b28a24b27217030bffe221
5fd07110ba9771c7bbb859612f2f82bff0d9f49a
refs/heads/master
2020-05-18T09:51:37.423628
2019-04-30T22:46:06
2019-04-30T22:46:06
184,337,343
0
0
Apache-2.0
2019-04-30T22:01:13
2019-04-30T22:01:12
null
UTF-8
Java
false
false
5,805
java
/** * * Copyright 2003-2007 Jive Software. * * 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.jivesoftware.smackx.workgroup.ext.history; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.List; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.XmlEnvironment; import org.jivesoftware.smack.provider.IQProvider; import org.jxmpp.jid.EntityBareJid; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /** * IQ provider used to retrieve individual agent information. Each chat session can be mapped * to one or more jids and therefore retrievable. */ public class AgentChatHistory extends IQ { /** * Element name of the stanza extension. */ public static final String ELEMENT_NAME = "chat-sessions"; /** * Namespace of the stanza extension. */ public static final String NAMESPACE = "http://jivesoftware.com/protocol/workgroup"; private EntityBareJid agentJID; private int maxSessions; private long startDate; private final List<AgentChatSession> agentChatSessions = new ArrayList<>(); public AgentChatHistory(EntityBareJid agentJID, int maxSessions, Date startDate) { this(); this.agentJID = agentJID; this.maxSessions = maxSessions; this.startDate = startDate.getTime(); } public AgentChatHistory(EntityBareJid agentJID, int maxSessions) { this(); this.agentJID = agentJID; this.maxSessions = maxSessions; this.startDate = 0; } public AgentChatHistory() { super(ELEMENT_NAME, NAMESPACE); } public void addChatSession(AgentChatSession chatSession) { agentChatSessions.add(chatSession); } public Collection<AgentChatSession> getAgentChatSessions() { return agentChatSessions; } @Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder buf) { buf.append(" agentJID=\"" + agentJID + "\""); buf.append(" maxSessions=\"" + maxSessions + "\""); buf.append(" startDate=\"" + startDate + "\""); buf.setEmptyElement(); return buf; } /** * Stanza extension provider for AgentHistory packets. */ public static class InternalProvider extends IQProvider<AgentChatHistory> { @Override public AgentChatHistory parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException { if (parser.getEventType() != XmlPullParser.START_TAG) { throw new IllegalStateException("Parser not in proper position, or bad XML."); } AgentChatHistory agentChatHistory = new AgentChatHistory(); boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG && "chat-session".equals(parser.getName())) { agentChatHistory.addChatSession(parseChatSetting(parser)); } else if (eventType == XmlPullParser.END_TAG && ELEMENT_NAME.equals(parser.getName())) { done = true; } } return agentChatHistory; } private AgentChatSession parseChatSetting(XmlPullParser parser) throws XmlPullParserException, IOException { boolean done = false; Date date = null; long duration = 0; String visitorsName = null; String visitorsEmail = null; String sessionID = null; String question = null; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG && "date".equals(parser.getName())) { String dateStr = parser.nextText(); long l = Long.valueOf(dateStr).longValue(); date = new Date(l); } else if (eventType == XmlPullParser.START_TAG && "duration".equals(parser.getName())) { duration = Long.valueOf(parser.nextText()).longValue(); } else if (eventType == XmlPullParser.START_TAG && "visitorsName".equals(parser.getName())) { visitorsName = parser.nextText(); } else if (eventType == XmlPullParser.START_TAG && "visitorsEmail".equals(parser.getName())) { visitorsEmail = parser.nextText(); } else if (eventType == XmlPullParser.START_TAG && "sessionID".equals(parser.getName())) { sessionID = parser.nextText(); } else if (eventType == XmlPullParser.START_TAG && "question".equals(parser.getName())) { question = parser.nextText(); } else if (eventType == XmlPullParser.END_TAG && "chat-session".equals(parser.getName())) { done = true; } } return new AgentChatSession(date, duration, visitorsName, visitorsEmail, sessionID, question); } } }
[ "flo@geekplace.eu" ]
flo@geekplace.eu
473d434f4ef3287b72dc0128489838899bce54c4
0aead8aca67985d9ec7ba261d5e5ab8eb323722f
/tw-paas-service-saas/src/main/java/cn/com/tw/saas/serv/common/utils/cons/RegExp.java
a5e87457946077d7921c9a411b204d5819c62cc0
[]
no_license
automsen/psiot
34a9bbd848d402402fcde3643c6c692525b1904c
09cb88b62d33aa9a00f5b6a93e4d5733909d9f92
refs/heads/master
2021-04-05T13:39:16.119031
2018-10-23T17:55:50
2018-10-23T17:55:50
124,536,605
2
4
null
null
null
null
UTF-8
Java
false
false
1,611
java
package cn.com.tw.saas.serv.common.utils.cons; /** * 常用正则表达式 * @author admin * */ public class RegExp { /** * 大于0的数 */ public static String mathExp="^(?!(0[0-9]{0,}$))[0-9]{1,}[.]{0,}[0-9]{0,}$"; /** * 数字字母下划线 */ public static String houseExp="^[0-9a-zA-Z_]+$"; /** * 姓名的校验,只允许中文,英文,和数字^ /^[\u4e00-\u9fa5_a-zA-Z0-9]+$/ */ public static String nameExp="^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]+$"; /** * 整数 */ public static String integerExp = "^\\d+$"; /** * 正整数 */ public static String positiveIntegerExp = "^[1-9][0-9]*$"; /** * 小数 */ public static String decimalExp = "^([0-9]{1,}[.][0-9]*)$"; /** * 整数或小数 */ public static String numberExp = "^[0-9]+([.]{1}[0-9]+){0,1}$"; /** * 手机号 */ public static String phoneExp = "^1[3-9]\\d{9}$"; /** * 字母数字下划线和横杠,匹配特殊字符~, */ public static String wordNumberUnderlineRungExp = "^[\\w-~]+$"; //"^(([A-Z]|[a-z]|[0-9])+)+((~|-|)+)+(([A-Z]|[a-z]|[0-9])+)+((~|-|)+)+(([A-Z]|[a-z]|[0-9])+)$"; //"^(([A-Z]|[a-z]|[0-9])+)+((~|-|)+)+(([A-Z]|[a-z]|[0-9])+)$"; // public static String wordNumberUnderlineRungExp = "^(([A-Z]|[a-z]|[0-9])+)+((~|-|)+)+(([A-Z]|[a-z]|[0-9])+)+((~|-|)+)+(([A-Z]|[a-z]|[0-9])+)+((~|-|)+)+(([A-Z]|[a-z]|[0-9])+)$"; /** * 字母数字下划线横杠~,除字母数字其它均不可为头尾 */ public static String roomNumberExp = "^(?!_|-|~)[\\w-~]+(?<!_|-|~)$"; }
[ "283381448@qq.com" ]
283381448@qq.com
93e5dee5023eec1048e9eda1d021ddd3178af0d4
2a13e40d091af2877fdfba93834b3fe69ffe273f
/src/main/java/net/gy/SwiftFrameWork/MVP/View/context/IContext.java
5b415ea3894f70f5cc9d84813f9014ccc481cd58
[]
no_license
SwiftOSSite/SwiftFrameWork
5517bc6c386ad470e24df427c39c43abf8f4ee36
84cc0294ec3f7f9c8d205dcb66da069ed889732e
refs/heads/gy
2020-04-05T18:57:05.366093
2016-08-31T09:05:20
2016-08-31T09:05:20
67,022,414
1
0
null
2016-08-31T09:13:57
2016-08-31T09:13:56
null
UTF-8
Java
false
false
230
java
package net.gy.SwiftFrameWork.MVP.View.context; import net.gy.SwiftFrameWork.MVP.Presenter.Presenter; /** * Created by gy on 2016/3/2. */ public interface IContext<T extends Presenter> { public T getPresent(); }
[ "939543405@qq.com" ]
939543405@qq.com
10e20a4cff7274794166497e5f65ba67ad48ed18
2d3ab742d830ea30b702c186d61d34cf8c324183
/algo/algoexpert/src/main/java/todo/java/algo/algoexpert/linkedlist/RemoveKthNodeFromEnd.java
7bf34208bb4a535bf19880443e8cb2f11829a55a
[ "MIT" ]
permissive
jianchengwang/todo-java
39893627fc9e1250b50c41f34a2b13c90d98de2c
0b697590fd7f08027844c00abb352c2fddc18175
refs/heads/main
2023-08-28T03:30:20.723137
2023-08-01T07:16:50
2023-08-01T07:16:50
175,554,847
1
0
MIT
2023-06-14T22:34:00
2019-03-14T05:34:19
Java
UTF-8
Java
false
false
1,350
java
package todo.java.algo.algoexpert.linkedlist; /** * 移除链表距离尾巴第k个节点 * easy * link: https://www.algoexpert.io/questions/Remove%20Kth%20Node%20From%20End * * simple input * head = 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 * k = 4 * * simple output * * 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 7 -> 8 -> 9 * */ public class RemoveKthNodeFromEnd { public static void main(String[] args) { } // O(n) time | O(1) space public static void solution(LinkedList head, int k) { int counter = 1; LinkedList first = head; LinkedList second = head; while(counter <= k) { second = second.next; counter++; System.out.println("counter:" + counter); } if(second == null) { System.out.println("remove head value:" + head.value); head.value = head.next.value; head.next = head.next.next; return; } while(second.next != null) { second = second.next; first = first.next; } System.out.println("first:" + first.value); first.next = first.next.next; } static class LinkedList { int value; LinkedList next = null; public LinkedList(int value) { this.value = value; } } }
[ "jiancheng_wang@yahoo.com" ]
jiancheng_wang@yahoo.com
0177aafc58983a07af809ce93a1f109b0e859b49
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_83b434267f2b0ba43173866be99c7cce48348675/Study/34_83b434267f2b0ba43173866be99c7cce48348675_Study_s.java
b7a5e101d5498f7905b9bebe07582ab82e5d4f8b
[]
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
2,013
java
package models; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Set; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import play.db.jpa.GenericModel; import ext.JavaExtensions; @Entity //@NamedNativeQuery(name = "nativeSQL", query = "select * from study", resultClass = Study.class) public class Study extends GenericModel { @Id public long pk; public String study_id; public String study_desc; public Date study_datetime; public String study_custom1; public Date created_time; @ManyToOne @JoinColumn(name="patient_fk") public Patient patient; @OneToMany(mappedBy = "study") public Set<Series> series; @OneToMany(mappedBy = "study") public Set<ProjectAssociation> projectAssociations; public ProjectAssociation getProjectAssociation(String username) { return ProjectAssociation.find("select projectAssociation from Project project, in(project.projectAssociations) projectAssociation where project.person.username = ? and projectAssociation.study = ?", username, this).first(); } public String toDownloadString(String username) { String string = String.format("%s_%s", new SimpleDateFormat("yyyyMMddHHmm").format(study_datetime), pk); ProjectAssociation projectAssociation = getProjectAssociation(username); if (projectAssociation != null) { string = String.format("%s_%s", string, projectAssociation.project.name); if (projectAssociation.participationID != null && !projectAssociation.participationID.isEmpty()) { string = String.format("%s_%s", string, projectAssociation.participationID); } } return string.replaceAll("\\W+", ""); } public String toClipboardString() { return String.format("%s on %s", patient.pat_name == null ? "" : JavaExtensions.formatAsName(patient.pat_name), study_datetime == null ? "" : JavaExtensions.format(study_datetime)); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
e57aa7059dd778db25530fa38d13f5978ef51a4e
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE369_Divide_by_Zero/CWE369_Divide_by_Zero__int_getParameter_Servlet_divide_61b.java
22e642f19a67699e24bceba583ef724f1d7f48b1
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
2,672
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE369_Divide_by_Zero__int_getParameter_Servlet_divide_61b.java Label Definition File: CWE369_Divide_by_Zero__int.label.xml Template File: sources-sinks-61b.tmpl.java */ /* * @description * CWE: 369 Divide by zero * BadSource: getParameter_Servlet Read data from a querystring using getParameter() * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: divide * GoodSink: Check for zero before dividing * BadSink : Dividing by a value that may be zero * Flow Variant: 61 Data flow: data returned from one method to another in different classes in the same package * * */ package testcases.CWE369_Divide_by_Zero; import testcasesupport.*; import java.sql.*; import javax.servlet.http.*; import java.security.SecureRandom; import javax.servlet.http.*; import java.util.logging.Level; import java.util.logging.Logger; public class CWE369_Divide_by_Zero__int_getParameter_Servlet_divide_61b { public int bad_source(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ /* POTENTIAL FLAW: Read data from a querystring using getParameter() */ { String s_data = request.getParameter("name"); try { data = Integer.parseInt(s_data.trim()); } catch(NumberFormatException nfe) { IO.logger.log(Level.WARNING, "Number format exception reading data from parameter 'name'", nfe); } } return data; } /* goodG2B() - use goodsource and badsink */ public int goodG2B_source(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; return data; } /* goodB2G() - use badsource and goodsink */ public int goodB2G_source(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ /* POTENTIAL FLAW: Read data from a querystring using getParameter() */ { String s_data = request.getParameter("name"); try { data = Integer.parseInt(s_data.trim()); } catch(NumberFormatException nfe) { IO.logger.log(Level.WARNING, "Number format exception reading data from parameter 'name'", nfe); } } return data; } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
8aef911eb8f523e7a2416a735e30bffb23edf6dc
a5721d03524d9094f344bdc12746ca3b5579bc04
/lyyt-server/src/main/java/net/cdsunrise/hy/lyyt/enums/DataSourceUnitEnum.java
0e591cf3fd85c75acaacc7db0c29b47b44c0f0d2
[]
no_license
yesewenrou/test
2aeaa0ea09842eeed2b0e589895b4f00319bf13b
992a70bed383f5574e4cc0db539dd764d984e5c6
refs/heads/master
2023-02-16T21:02:59.801518
2021-01-20T02:31:17
2021-01-20T02:31:17
327,574,246
0
0
null
null
null
null
UTF-8
Java
false
false
1,386
java
package net.cdsunrise.hy.lyyt.enums; import java.util.Arrays; import java.util.Collections; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; /** * 数据源(相关单位)枚举 */ public enum DataSourceUnitEnum { /** 气象局*/ QXJ(1,"气象局"), STHJJ(2,"生态环境局"), WJJ(3,"卫建局"), JDGLJ(4,"监督管理局"), GAJ(5,"公安局"), JTYSGLJ(6,"交通运输管理局"), STSJPT(7,"省厅数据平台"), WLSJ(8,"网络数据"), JQSJ(9,"景区数据"), WHLYJ(10,"文化旅游局"), SSJPT(11,"市数据平台"), ZJSB(12,"自建设备"), ; private Integer index; private String name; private static final Map<Integer, DataSourceUnitEnum> INDEX_MAP = Collections.unmodifiableMap(Arrays.stream(DataSourceUnitEnum.values()).collect(Collectors.toMap(DataSourceUnitEnum::getIndex,Function.identity()))); public Integer getIndex() { return index; } public String getName() { return name; } DataSourceUnitEnum(Integer index, String name) { this.index = index; this.name = name; } public static Map<Integer, DataSourceUnitEnum> getIndexMap() { return INDEX_MAP; } public static boolean isIndexExist(Integer index){ return getIndexMap().containsKey(index); } }
[ "896586757@qq.com" ]
896586757@qq.com
acd46ff37c8c62e9df0adbe344e4fe25cc1a5fac
f0d25d83176909b18b9989e6fe34c414590c3599
/app/src/main/java/com/google/android/gms/internal/zzavs.java
f233043d6623fbdfa02f1b714929ca8100795297
[]
no_license
lycfr/lq
e8dd702263e6565486bea92f05cd93e45ef8defc
123914e7c0d45956184dc908e87f63870e46aa2e
refs/heads/master
2022-04-07T18:16:31.660038
2020-02-23T03:09:18
2020-02-23T03:09:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,483
java
package com.google.android.gms.internal; import android.app.Activity; import android.view.View; import com.google.android.gms.R; import com.google.android.gms.cast.MediaInfo; import com.google.android.gms.cast.MediaTrack; import com.google.android.gms.cast.framework.CastSession; import com.google.android.gms.cast.framework.media.RemoteMediaClient; import com.google.android.gms.cast.framework.media.uicontroller.UIController; import java.lang.ref.WeakReference; import java.util.Iterator; import java.util.List; public final class zzavs extends UIController { private final View mView; /* access modifiers changed from: private */ public final WeakReference<Activity> zzavm; private final String zzavn; private final String zzavo; private final View.OnClickListener zzavp = new zzavt(this); public zzavs(View view, Activity activity) { this.mView = view; this.zzavn = activity.getString(R.string.cast_closed_captions); this.zzavo = activity.getString(R.string.cast_closed_captions_unavailable); this.zzavm = new WeakReference<>(activity); } private final void zzok() { boolean z; int i; RemoteMediaClient remoteMediaClient = getRemoteMediaClient(); if (remoteMediaClient != null && remoteMediaClient.hasMediaSession()) { MediaInfo mediaInfo = remoteMediaClient.getMediaInfo(); if (mediaInfo != null) { List<MediaTrack> mediaTracks = mediaInfo.getMediaTracks(); if (mediaTracks != null && !mediaTracks.isEmpty()) { Iterator<MediaTrack> it = mediaTracks.iterator(); int i2 = 0; while (true) { if (!it.hasNext()) { break; } MediaTrack next = it.next(); if (next.getType() == 2) { i = i2 + 1; if (i > 1) { z = true; break; } } else if (next.getType() == 1) { z = true; break; } else { i = i2; } i2 = i; } } else { z = false; if (z && !remoteMediaClient.isPlayingAd()) { this.mView.setEnabled(true); this.mView.setContentDescription(this.zzavn); return; } } } z = false; this.mView.setEnabled(true); this.mView.setContentDescription(this.zzavn); return; } this.mView.setEnabled(false); this.mView.setContentDescription(this.zzavo); } public final void onMediaStatusUpdated() { zzok(); } public final void onSendingRemoteMediaRequest() { this.mView.setEnabled(false); } public final void onSessionConnected(CastSession castSession) { super.onSessionConnected(castSession); this.mView.setOnClickListener(this.zzavp); zzok(); } public final void onSessionEnded() { this.mView.setOnClickListener((View.OnClickListener) null); super.onSessionEnded(); } }
[ "quyenlm.vn@gmail.com" ]
quyenlm.vn@gmail.com
81e62b4f99ff1f21dc8795a709e96d08e12eb0bb
e59b853b28a02d4417296064ba6b7594bb2decb0
/src/test/java/com/liujun/search/engine/collect/operation/filequeue/TestFileQueueManager.java
d508bd8ec827a256785e3eb731fc8b9fd1a2bd5e
[]
no_license
miloluojia/searchEngine
b68c61177e10f9a20bda2a1c7a97a57d37096f43
a8b3efa5ec9a2fa3b917ffe499b497c66b49eefa
refs/heads/master
2023-04-22T05:56:24.891316
2021-12-24T05:59:55
2021-12-24T05:59:55
265,804,839
0
0
null
2020-05-21T09:14:55
2020-05-21T09:14:54
null
UTF-8
Java
false
false
715
java
package com.liujun.search.engine.collect.operation.filequeue; import com.liujun.search.engine.collect.constant.WebEntryEnum; import org.junit.Assert; import org.junit.Test; /** * 文件管理队列的实现,即实现第个入口一个对象的操作 * * @author liujun * @version 0.0.1 * @date 2019/03/22 */ public class TestFileQueueManager { @Test public void testGetInstance() { FileQueue sohoQueue = FileQueueManager.INSTANCE.getFileQueue(WebEntryEnum.SOHO); Assert.assertNotNull(sohoQueue); FileQueue sohoQueueComp2 = FileQueueManager.INSTANCE.getFileQueue(WebEntryEnum.SOHO); // 检查获取的对象是否为同一个 Assert.assertEquals(sohoQueueComp2, sohoQueue); } }
[ "422134235@qq.com" ]
422134235@qq.com
48258765e23c3198f6494a8e7fa4306a9f8e54bb
34f1eb7e458d64379eff85d8daea46d20e881047
/app/src/main/java/com/rain/zhihui_community/http/SerializableOkHttpCookies.java
5e99655192ddc3873750f947dfa9cd6f4a515a77
[]
no_license
ywen8/ZhiHuiCommunity
69f94d1558a64964563557a99f1f55b3e55ee3af
38af7d7d50a068b22570aca54e7ad401a491e751
refs/heads/master
2021-09-05T15:07:13.952523
2018-01-29T04:55:06
2018-01-29T04:55:06
119,333,611
0
0
null
null
null
null
UTF-8
Java
false
false
2,350
java
package com.rain.zhihui_community.http; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import okhttp3.Cookie; /** * Created by Administrator on 2017/6/13 0013. */ public class SerializableOkHttpCookies implements Serializable { private transient final Cookie cookies ; private transient Cookie clientCookies; public SerializableOkHttpCookies(Cookie cookies) { this.cookies = cookies; } public Cookie getCookies(){ Cookie beatCookies = cookies; if(clientCookies != null){ beatCookies = clientCookies; } return beatCookies; } /** * * @param out * @throws IOException */ private void writeObject(ObjectOutputStream out) throws IOException { out.writeObject(cookies.name()); out.writeObject(cookies.value()); out.writeLong(cookies.expiresAt()); out.writeObject(cookies.domain()); out.writeObject(cookies.path()); out.writeBoolean(cookies.secure()); out.writeBoolean(cookies.httpOnly()); out.writeBoolean(cookies.hostOnly()); out.writeBoolean(cookies.persistent()); } /** * * @param in * @throws IOException */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { String name = (String) in.readObject(); String value = (String) in.readObject(); long expiresAt = in.readLong(); String domain = (String) in.readObject(); String path = (String) in.readObject(); boolean secure = in.readBoolean(); boolean httpOnly = in.readBoolean(); boolean hostOnly = in.readBoolean(); boolean persistent = in.readBoolean(); Cookie.Builder builder = new Cookie.Builder(); builder = builder.name(name); builder = builder.value(value); builder = builder.expiresAt(expiresAt); builder = hostOnly ? builder.hostOnlyDomain(domain) : builder.domain(domain); builder = builder.path(path); builder = secure ? builder.secure() : builder; builder = httpOnly ? builder.httpOnly() : builder; clientCookies =builder.build(); } }
[ "381226310@qq.com" ]
381226310@qq.com
1ea67ec96a80298bc17e47b074a7e5453f151ec0
8d17f4ba30ca9b272654f0502aac17b7d348e2fc
/log-processor/src/main/java/core/log/service/StatService.java
da63d44ee0d1bb617a2f9c37b29429a2002d21e1
[ "Apache-2.0" ]
permissive
Albertsss/core-ng-project
a2776edd8a01993804a1b304f07336f7054f4912
3458c87cb9f8bf0e4f3f99d50297e42b27bf4f58
refs/heads/master
2020-04-05T20:58:13.809388
2018-11-07T15:55:02
2018-11-07T15:55:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,142
java
package core.log.service; import core.framework.inject.Inject; import core.framework.internal.log.message.StatMessage; import core.framework.search.BulkIndexRequest; import core.framework.search.ElasticSearchType; import core.framework.search.IndexRequest; import core.framework.util.Maps; import core.log.domain.StatDocument; import java.time.LocalDate; import java.util.List; import java.util.Map; /** * @author neo */ public class StatService { @Inject IndexService indexService; @Inject ElasticSearchType<StatDocument> statType; public void index(List<StatMessage> messages) { index(messages, LocalDate.now()); } public void index(StatMessage message) { index(message.id, stat(message), LocalDate.now()); } void index(List<StatMessage> messages, LocalDate now) { if (messages.size() <= 5) { // use single index in quiet time for (StatMessage message : messages) { index(message.id, stat(message), now); } } else { Map<String, StatDocument> stats = Maps.newHashMapWithExpectedSize(messages.size()); for (StatMessage message : messages) { stats.put(message.id, stat(message)); } index(stats, now); } } private void index(Map<String, StatDocument> stats, LocalDate now) { BulkIndexRequest<StatDocument> request = new BulkIndexRequest<>(); request.index = indexService.indexName("stat", now); request.sources = stats; statType.bulkIndex(request); } private void index(String id, StatDocument stat, LocalDate now) { IndexRequest<StatDocument> request = new IndexRequest<>(); request.index = indexService.indexName("stat", now); request.id = id; request.source = stat; statType.index(request); } private StatDocument stat(StatMessage message) { var stat = new StatDocument(); stat.date = message.date; stat.app = message.app; stat.serverIP = message.serverIP; stat.stats = message.stats; return stat; } }
[ "neowu.us@gmail.com" ]
neowu.us@gmail.com
f7a22083b6c4ba5e790112744bb98abd1d73211a
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/MATH-78b-2-6-Single_Objective_GGA-IntegrationSingleObjective-BasicBlockCoverage/org/apache/commons/math/analysis/solvers/BrentSolver_ESTest.java
b9d38c9bee9091eb4a376a9773b590a90a8b1c65
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
1,131
java
/* * This file was automatically generated by EvoSuite * Sat May 16 22:54:31 UTC 2020 */ package org.apache.commons.math.analysis.solvers; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.apache.commons.math.analysis.Expm1Function; import org.apache.commons.math.analysis.solvers.BrentSolver; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class BrentSolver_ESTest extends BrentSolver_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { double double0 = (-1.0033818495903357); double double1 = (-3253.78518); Expm1Function expm1Function0 = new Expm1Function(); BrentSolver brentSolver0 = new BrentSolver(expm1Function0); expm1Function0.derivative(); expm1Function0.derivative(); double double2 = 1.0; brentSolver0.clearResult(); // Undeclared exception! brentSolver0.solve(1.0, 1221.253903); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
9f120a0714ec3c934d03df80f8dc955b2f24c94d
8e8f4c806e9e188afe49ad07db3bc21d361622fb
/src/main/java/com/hx/blog_v2/service/interf/message/MessageService.java
2169c2422e186b62fc93def550469ce23937115f
[]
no_license
LSL-Git/HXBlog_V2.0
6e5f166f0a375401d9245c7b6c7d5547e7e96e35
af73616c87a5a1804ebf2dd6d2b77c0c256aa075
refs/heads/master
2020-03-28T19:27:08.399431
2018-08-04T10:03:14
2018-08-04T10:03:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,259
java
package com.hx.blog_v2.service.interf.message; import com.hx.blog_v2.domain.form.common.BeanIdForm; import com.hx.blog_v2.domain.form.message.MessageSaveForm; import com.hx.blog_v2.domain.form.message.MessageSearchForm; import com.hx.blog_v2.domain.po.message.MessagePO; import com.hx.blog_v2.domain.vo.message.MessageVO; import com.hx.blog_v2.service.interf.BaseService; import com.hx.common.interf.common.Page; import com.hx.common.interf.common.Result; /** * MessageService * * @author Jerry.X.He <970655147@qq.com> * @version 1.0 * @date 5/20/2017 11:48 AM */ public interface MessageService extends BaseService<MessagePO> { /** * 增加一个 消息 * * @return result * @author Jerry.X.He * @date 5/20/2017 6:21 PM * @since 1.0 */ Result add(MessageSaveForm params); /** * 搜索符合的条件的消息列表 * * @return result * @author Jerry.X.He * @date 5/20/2017 6:21 PM * @since 1.0 */ Result list(MessageSearchForm params, Page<MessageVO> page); /** * 查询未读消息列表 * * @return result * @author Jerry.X.He * @date 5/20/2017 6:21 PM * @since 1.0 */ Result unread(); /** * 搜索符合的条件的消息列表 * * @return result * @author Jerry.X.He * @date 5/20/2017 6:21 PM * @since 1.0 */ Result adminList(MessageSearchForm params, Page<MessageVO> page); /** * 更新给定的消息 * * @return result * @author Jerry.X.He * @date 5/20/2017 6:21 PM * @since 1.0 */ Result update(MessageSaveForm params); /** * 将给定的消息 标记为 已读 * * @return result * @author Jerry.X.He * @date 5/20/2017 6:21 PM * @since 1.0 */ Result markConsumed(BeanIdForm params); /** * 将给定所有的的消息 标记为 已读 * * @return result * @author Jerry.X.He * @date 5/20/2017 6:21 PM * @since 1.0 */ Result markAllConsumed(); /** * 移除给定的消息 * * @return result * @author Jerry.X.He * @date 5/20/2017 6:21 PM * @since 1.0 */ Result remove(BeanIdForm params); }
[ "970655147@qq.com" ]
970655147@qq.com
1ed720afbb0328b7e994ba02cd2aea4fe715b9fd
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_2d2eb61e2478c0871ba4e4556c8b7beee7c546ad/ValidationTestDoIt/16_2d2eb61e2478c0871ba4e4556c8b7beee7c546ad_ValidationTestDoIt_s.java
6db246096543e8e779c2d12d1613ab16c6606a05
[]
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
3,805
java
/* * Created on Feb 27, 2004 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */ package org.vfny.geoserver.action.validation; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.geotools.data.DataStore; import org.geotools.data.FeatureSource; import org.geotools.validation.ValidationProcessor; import org.geotools.validation.ValidationResults; import org.vfny.geoserver.action.ConfigAction; import org.vfny.geoserver.config.DataConfig; import org.vfny.geoserver.config.DataStoreConfig; import org.vfny.geoserver.config.validation.TestSuiteConfig; import org.vfny.geoserver.config.validation.ValidationConfig; import org.vfny.geoserver.global.GeoValidator; import org.vfny.geoserver.global.UserContainer; import com.vividsolutions.jts.geom.Envelope; /** * ValidationTestDoIt purpose. * <p> * Description of ValidationTestDoIt ... * </p> * * @author dzwiers, Refractions Research, Inc. * @author $Author: sploreg $ (last modification) * @version $Id: ValidationTestDoIt.java,v 1.10 2004/06/29 11:32:01 sploreg Exp $ */ public class ValidationTestDoIt extends ConfigAction { public ActionForward execute(ActionMapping mapping, ActionForm incomingForm, UserContainer user, HttpServletRequest request, HttpServletResponse response) { boolean stopThread = false; String parameter = mapping.getParameter(); if (parameter != null && parameter.equals("stop")) { stopThread = true; } //Checks to see if previous Validation has even finished executing yet. Thread oldThread = (Thread) request.getSession().getAttribute(ValidationRunnable.KEY); if (oldThread != null && oldThread.isAlive()) { //OldThread has not finished execution; Shouldn't start a new one. //Alternatively, we could wait. if (stopThread == true) { oldThread.stop(); //This is decprecated, but is there another way to stop a Runnable? } } else { ServletContext context = this.getServlet().getServletContext(); ValidationConfig validationConfig = (ValidationConfig) context.getAttribute(ValidationConfig.CONFIG_KEY); TestSuiteConfig suiteConfig = (TestSuiteConfig) request.getSession().getAttribute(TestSuiteConfig.CURRENTLY_SELECTED_KEY); Map plugins = new HashMap(); Map testSuites = new HashMap(); validationConfig.toDTO(plugins,testSuites); // return by ref. try { ValidationRunnable testThread = new ValidationRunnable( testSuites, plugins, getDataConfig(), context, request); //TODO grab the TestValidationResults from testThread // ie. TestValidationResults results = testThread.results; Thread thread = new Thread(testThread); thread.start(); request.getSession().setAttribute(ValidationRunnable.KEY, thread); } catch (Exception erp){ ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.cannotRunValidation",erp)); saveErrors(request, errors); } } return mapping.findForward("config.validation.displayResults"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
2c525a4595b7f0848d8d2a6ccade5eab584e9bd8
86a4f4a2dc3f38c0b3188d994950f4c79f036484
/src/android/support/design/widget/FloatingActionButton$Behavior$1.java
ef5fd8f8eefe21f22debb808bf09952aa6175a5e
[]
no_license
reverseengineeringer/com.cbs.app
8f6f3532f119898bfcb6d7ddfeb465eae44d5cd4
7e588f7156f36177b0ff8f7dc13151c451a65051
refs/heads/master
2021-01-10T05:08:31.000287
2016-03-19T20:39:17
2016-03-19T20:39:17
54,283,808
0
0
null
null
null
null
UTF-8
Java
false
false
532
java
package android.support.design.widget; import android.support.v4.view.ViewCompat; final class FloatingActionButton$Behavior$1 implements q.c { FloatingActionButton$Behavior$1(FloatingActionButton.Behavior paramBehavior, FloatingActionButton paramFloatingActionButton) {} public final void a(q paramq) { ViewCompat.setTranslationY(a, paramq.d()); } } /* Location: * Qualified Name: android.support.design.widget.FloatingActionButton.Behavior.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
2c2679e997fd4c67c70f18553d463617ea9896a6
95e944448000c08dd3d6915abb468767c9f29d3c
/sources/com/p280ss/android/ugc/aweme/i18n/language/initial/InitialChooseLanguageDialog.java
db0535aace3a20feffdce46991e248dcb224cadf
[]
no_license
xrealm/tiktok-src
261b1faaf7b39d64bb7cb4106dc1a35963bd6868
90f305b5f981d39cfb313d75ab231326c9fca597
refs/heads/master
2022-11-12T06:43:07.401661
2020-07-04T20:21:12
2020-07-04T20:21:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,463
java
package com.p280ss.android.ugc.aweme.i18n.language.initial; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.Color; import android.os.Handler; import android.support.p029v7.widget.RecyclerView; import android.support.p029v7.widget.RecyclerView.C1272h; import android.view.KeyEvent; import butterknife.ButterKnife; import com.bytedance.common.utility.C9738o; import com.bytedance.ies.ugc.appcontext.C6399b; import com.p280ss.android.ugc.aweme.app.p305g.C22984d; import com.p280ss.android.ugc.aweme.base.p1062f.C23336d; import com.p280ss.android.ugc.aweme.base.p308ui.RecyclerItemDecoration; import com.p280ss.android.ugc.aweme.base.utils.C23486n; import com.p280ss.android.ugc.aweme.common.C6907h; import com.p280ss.android.ugc.aweme.framework.services.ServiceManager; import com.p280ss.android.ugc.aweme.language.C7120e; import com.p280ss.android.ugc.aweme.language.I18nManagerService; import com.p280ss.android.ugc.aweme.video.C43316v; import com.p280ss.android.ugc.aweme.views.C43374j; import com.p280ss.android.ugc.aweme.views.WrapLinearLayoutManager; import com.zhiliaoapp.musically.df_live_zego_link.R; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; /* renamed from: com.ss.android.ugc.aweme.i18n.language.initial.InitialChooseLanguageDialog */ public class InitialChooseLanguageDialog extends C43374j { /* renamed from: a */ private Handler f80073a; /* renamed from: b */ private boolean f80074b; RecyclerView mLanguageList; /* renamed from: a */ static final /* synthetic */ boolean m99561a(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { return i == 84; } /* renamed from: c */ public final void mo73992c() { this.f112344h = (int) C9738o.m28708b(C6399b.m19921a(), 280.0f); } /* access modifiers changed from: 0000 */ /* renamed from: a */ public final /* synthetic */ void mo71375a() { if (isShowing()) { if (C43316v.m137450K().mo104916o()) { C43316v.m137450K().mo104948x(); this.f80074b = true; return; } m99562b(); } } public void dismiss() { super.dismiss(); if (this.f80074b) { C43316v.m137450K().mo104946v(); this.f80074b = false; } } /* renamed from: b */ private void m99562b() { if (C43316v.m137450K().mo104916o()) { C43316v.m137450K().mo104948x(); this.f80074b = true; return; } this.f80073a.postDelayed(new C30480b(this), 1000); } /* access modifiers changed from: 0000 */ public void cancelClick() { ((C30489i) C23336d.m76560a(getContext(), C30489i.class)).mo60442b(3); C6907h.m21524a("choose_language_popup", (Map) new C22984d().mo59973a("enter_from", "homepage_hot").mo59973a("language_type", "cancel").f60753a); dismiss(); } public void onWindowFocusChanged(boolean z) { super.onWindowFocusChanged(z); if (z) { m99562b(); } } public InitialChooseLanguageDialog(Context context, String[] strArr) { super(context, (int) R.style.uu, false, true); setContentView(R.layout.kf); ButterKnife.bind((Dialog) this); setCancelable(false); setCanceledOnTouchOutside(false); setOnKeyListener(C30479a.f80083a); ArrayList arrayList = new ArrayList(); Map localeMap = ((I18nManagerService) ServiceManager.get().getService(I18nManagerService.class)).getLocaleMap(); HashMap hashMap = new HashMap(); for (C7120e eVar : localeMap.values()) { hashMap.put(eVar.mo18530a(), eVar); } for (String str : strArr) { C7120e eVar2 = (C7120e) hashMap.get(str); if (eVar2 != null) { arrayList.add(eVar2); } } this.mLanguageList.setLayoutManager(new WrapLinearLayoutManager(context)); this.mLanguageList.mo5525a((C1272h) new RecyclerItemDecoration(1, C23486n.m77122a(0.5d), Color.parseColor("#20161823"))); this.mLanguageList.setAdapter(new InitialChooseLanguageDialogAdapter(context, arrayList, this)); this.f80073a = new Handler(); C6907h.m21524a("show_language_popup", (Map) new C22984d().mo59973a("enter_from", "homepage_hot").f60753a); } }
[ "65450641+Xyzdesk@users.noreply.github.com" ]
65450641+Xyzdesk@users.noreply.github.com
3dc0ad4d7c35300e9c8670b50cc68bcc82f06236
896683aaf6dd5d4c092175a2141a0f15404fcd38
/JavaPracticeGit/src/thread/chapter3/s1/section10/multiProduceSingleConsume/MyStack.java
a957c6d0917ceb2ccdcccac120c711ad5ffb1e59
[]
no_license
WoodZzzzz/java
3d776d35ff81f681c8a2d63c78a816de976b560e
26d68157636a0c51303eb6417fce0f932d97a4f9
refs/heads/master
2020-03-08T07:25:03.830889
2018-08-31T10:59:26
2018-08-31T10:59:26
127,993,812
1
0
null
null
null
null
GB18030
Java
false
false
1,188
java
package thread.chapter3.s1.section10.multiProduceSingleConsume; import java.util.ArrayList; import java.util.List; public class MyStack { private List list = new ArrayList(); /** * * @描述: 入栈 * @作者: Zhouwj * @创建日期: 2017年10月10日 下午5:39:31 */ public synchronized void push() { try { while (list.size() == 1) { System.out.println("thread " + Thread.currentThread().getName() + " 呈wait状态"); this.wait(); } list.add(Thread.currentThread().getName() +" str " + Math.random()); this.notifyAll(); System.out.println("push size = " + list.size()); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public synchronized String pop() { String returnValue = ""; try { while (list.size() == 0) { System.out.println("thread " + Thread.currentThread().getName() + " 呈wait状态"); this.wait(); } returnValue = "" + list.get(0); list.remove(0); this.notifyAll(); System.out.println("pop = " + list.size()); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return returnValue; } }
[ "772005736@qq.com" ]
772005736@qq.com
96dcb1105137afd691ca81813844dd2928a60e74
77410b5a01cc54a23eb54c77e9d593631f336495
/weixin4j-server/src/main/java/com/foxinmy/weixin4j/interceptor/WeixinMessageInterceptor.java
599a8a88ac088d6703b522d87519a5b3f8af6f7c
[ "Apache-2.0" ]
permissive
haoqicherish/weixin4j
76bab835042e5833604ae72236843ca8190ed430
df9ef56bad47b92f9f9a9176ffcb2a9f85a9d5a0
refs/heads/master
2020-05-31T17:55:38.143621
2017-06-07T09:18:12
2017-06-07T09:18:12
94,042,592
1
0
null
2017-06-12T01:15:21
2017-06-12T01:15:20
null
UTF-8
Java
false
false
2,188
java
package com.foxinmy.weixin4j.interceptor; import io.netty.channel.ChannelHandlerContext; import com.foxinmy.weixin4j.exception.WeixinException; import com.foxinmy.weixin4j.handler.WeixinMessageHandler; import com.foxinmy.weixin4j.request.WeixinMessage; import com.foxinmy.weixin4j.request.WeixinRequest; import com.foxinmy.weixin4j.response.WeixinResponse; /** * 微信消息拦截器 * * @className WeixinMessageInterceptor * @author jinyu(foxinmy@gmail.com) * @date 2015年5月7日 * @since JDK 1.6 * @see MessageInterceptorAdapter */ public interface WeixinMessageInterceptor { /** * 执行handler前 * * @param context * 通道环境 * @param request * 微信请求 * @param message * 微信消息 * @param handler * 消息处理器 * @return 返回true执行下一个拦截器 * @throws WeixinException */ boolean preHandle(ChannelHandlerContext context, WeixinRequest request, WeixinMessage message, WeixinMessageHandler handler) throws WeixinException; /** * 执行handler后 * * @param context * 通道环境 * @param request * 微信请求 * @param response * 微信响应 * @param message * 微信消息 * @param handler * 消息处理器 * @throws WeixinException */ void postHandle(ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler) throws WeixinException; /** * 全部执行后 * * @param context * 通道环境 * @param request * 微信请求 * @param message * 微信消息 * @param handler * 消息处理器 * @param exception * 执行异常 * @throws WeixinException */ void afterCompletion(ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler, Exception exception) throws WeixinException; /** * 用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高 * * @return 权重 */ int weight(); }
[ "foxinmy@gmail.com" ]
foxinmy@gmail.com
53aa1cf5cbb022b1d2a3f6afad41a71d1f47904f
7864deb90f15318e2a0ac08bae943f6716ca3a35
/shop-order/src/main/java/quick/pager/shop/order/aop/OperationLogAspect.java
55cb922f0819968d374fc21dd58ca4332255ac87
[ "MIT" ]
permissive
hhy5277/spring-cloud-shop
0d5cb28b3a8ef81d1f2d5f82d72af6b2e6e92cc6
2a56846b57a83a9a4d6240cb3ad0e43fdf197f22
refs/heads/master
2020-05-02T10:57:15.724740
2019-03-13T08:36:17
2019-03-13T08:36:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,328
java
package quick.pager.shop.order.aop; import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; import quick.pager.common.response.Response; /** * Service 层请求日志拦截<br /> * 只处理入参与响应的参数 * * @author siguiyang */ @Component @Aspect @Slf4j public class OperationLogAspect { @Around("execution(* quick.pager.shop.order.service.*.doService(..))") public Response doOperation(ProceedingJoinPoint pjp) throws Throwable { log.info("========================================================================================"); Object[] args = pjp.getArgs(); Object target = pjp.getTarget(); // service 层有入参 if (args.length > 0) { log.info("== {}.doService INVOKER SERVICE PARAMS : {} ", target.getClass().getName(), JSON.toJSONString(args[0])); } Response result = (Response) pjp.proceed(); log.info("= SERVICE RESPONSE : {}", JSON.toJSONString(result)); log.info("========================================================================================"); return (Response) pjp.proceed(); } }
[ "siguiyang1992@outlook.com" ]
siguiyang1992@outlook.com
6ca22ac5e899309714a96de5a5f096ea75842c4e
711ce1f7c0cd12ef336e86499718a047e18e437a
/src/chapter7/overloadconst/OverloadConst.java
129c9c7753939eb16dc6de9b9bc0e512ab75ca50
[]
no_license
Lomovskoy/Java-The-Complete-Reference-Tenth-Edition
5e5d45b9bcf768bc4551d31c756eacd3997b3d5a
a26b61ae79f269c7930a6abede3eefbb3b1f75a5
refs/heads/master
2021-08-22T14:09:50.827130
2020-05-05T16:41:15
2020-05-05T16:41:15
179,799,027
1
0
null
null
null
null
UTF-8
Java
false
false
1,103
java
package chapter7.overloadconst; /** * Программа демонстрирующая, использвания * класса Box с перегруженными контрукторами. * * @author Ломовской К.Ю. * @since 02.05.2019 */ class OverloadConst { public static void main(String[] args) { // Создание паралелепипеда используя разные конструктогры Box myBox1 = new Box(10, 20, 15); Box myBox2 = new Box(); Box myCube = new Box(7); double vol; // Получаем объем первого паралелепипеда vol = myBox1.volume(); System.out.println("Объем myBox1 = " + vol); // Получаем объем второго паралелепипеда vol = myBox2.volume(); System.out.println("Объем myBox2 = " + vol); // Получаем объем третьего паралелепипеда vol = myCube.volume(); System.out.println("Объем myCube = " + vol); } }
[ "lomovskoy.kirill@yandex.ru" ]
lomovskoy.kirill@yandex.ru
86d0f4f01d24b3ac85856ed95872197058df17aa
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/18/18_835d9f5028d25c69dddcdee82c0115fa19e647e3/PSound2/18_835d9f5028d25c69dddcdee82c0115fa19e647e3_PSound2_t.java
a6e24bc9b2dd507747935285331980e9aecf9b0c
[]
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
6,665
java
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* Part of the Processing project - http://processing.org Copyright (c) 2005 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package processing.core; import java.io.*; import java.lang.reflect.*; import javax.sound.sampled.*; /** * Java 1.3 audio loader and player. * <P> * This will eventually be merged back into PSound, so you shouldn't * create new PSound2 objects from scratch, only open them directly * from a PApplet using loadSound(). * <PRE> * useful info about how to do all this stuff, munged together * for this class: http://javaalmanac.com/egs/javax.sound.sampled/pkg.html * </PRE> */ public class PSound2 extends PSound { Clip clip; FloatControl gainControl; public PSound2(PApplet iparent, InputStream input) { this.parent = iparent; try { AudioInputStream ais = AudioSystem.getAudioInputStream(input); // At present, ALAW and ULAW encodings must be converted // to PCM_SIGNED before it can be played AudioFormat format = ais.getFormat(); if (format.getEncoding() != AudioFormat.Encoding.PCM_SIGNED) { // *** this code appears as though it may just be faulty *** format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, format.getSampleRate(), format.getSampleSizeInBits()*2, format.getChannels(), format.getFrameSize()*2, format.getFrameRate(), true); // big endian ais = AudioSystem.getAudioInputStream(format, ais); //} else { //System.out.println("no conversion necessary"); } int frameLength = (int) ais.getFrameLength(); int frameSize = format.getFrameSize(); DataLine.Info info = new DataLine.Info(Clip.class, ais.getFormat(), frameLength * frameSize); clip = (Clip) AudioSystem.getLine(info); // seems that you can't make more than one of these try { gainControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN); } catch (Exception e) { System.err.println("Couldn't get gain control for this .wav file"); e.printStackTrace(); } // This method does not return until completely loaded clip.open(ais); // determining when a sample is done // Add a listener for line events /* clip.addLineListener(new LineListener() { public void update(LineEvent evt) { if (evt.getType() == LineEvent.Type.STOP) { } } }); */ parent.registerDispose(this); try { soundEventMethod = parent.getClass().getMethod("soundEvent", new Class[] { PSound.class }); // if we're here, then it means that there's a method for it clip.addLineListener(new LineListener() { public void update(LineEvent event) { if (event.getType() == LineEvent.Type.STOP) { try { soundEventMethod.invoke(parent, new Object[] { PSound2.this }); } catch (Exception e) { System.err.println("error, disabling soundEvent()"); e.printStackTrace(); soundEventMethod = null; } } } }); } catch (Exception e) { // no such method, or an error.. which is fine, just ignore } } catch (Exception e) { error("<init>", e); } } public void play() { clip.start(); } /** * either sets repeat flag, or begins playing (and sets) */ public void loop() { clip.loop(Clip.LOOP_CONTINUOUSLY); } /** * ala java 1.3 loop docs: * "any current looping should cease and playback should * continue to the end of the clip." */ public void noLoop() { clip.loop(0); } // Play and repeat for a certain number of times //int numberOfPlays = 3; //clip.loop(numberOfPlays-1); public void pause() { clip.stop(); } /** * Stops the audio and rewinds to the beginning. */ public void stop() { // clip may become null in the midst of this method //if (clip != null) clip.stop(); //if (clip != null) clip.setFramePosition(0); clip.stop(); clip.setFramePosition(0); } /** * This is registered externally so that the host applet * will kill off the playback thread. */ public void dispose() { stop(); clip = null; } /** * current position inside the clip (in seconds, just like video) */ public float time() { return (float) (clip.getMicrosecondPosition()/1000000.0d); } /** * duration of the clip in seconds */ public float duration() { return (float) (clip.getBufferSize() / (clip.getFormat().getFrameSize() * clip.getFormat().getFrameRate())); } /** * Set the volume with a value from 0 (off) to 1 (loudest). */ public void volume(float v) { // ranges 0..1 if (gainControl != null) { float dB = (float)(Math.log(v)/Math.log(10.0)*20.0); gainControl.setValue(dB); } else { System.err.println("Cannot set the volume for this sound."); } } /** * General error reporting, all corraled here just in case * I think of something slightly more intelligent to do. */ protected void error(String where, Exception e) { parent.die("Error inside PSound2." + where + "()", e); //e.printStackTrace(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
6902eb8438a512eaf8630dd2bed03b88d031d3e3
40ef286adedfda556e75c87fbe84bea4cd3b2700
/第一章_算法分析/Practise_1_4_02.java
440b7a935cca086f02f77ca6889676547d339ebe
[]
no_license
swidy360/Algorithms_4
8ee14570a32a3c62a4974a4859a4e3d097150071
c51dc53366b7e174db3aac9674a7cf6576b20a71
refs/heads/master
2021-09-02T14:55:09.140020
2018-01-03T09:35:04
2018-01-03T09:35:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,259
java
package 第一章_算法分析; import edu.princeton.cs.algs4.StdOut; public class Practise_1_4_02 { /* * 思路 : * * 对于 int 型的溢出,我们只需要将运算数中的某一个提升为 long, * 那么结果就会被提升为 long int 型的溢出也就被正确处理了 * */ static class ThreeSum { /* * 正确处理溢出 */ public static int correctCount(int[] a) { int N = a.length; int cnt = 0; for (int i = 0; i < N; i++) for (int j = i + 1; j < N; j++) for (int k = j + 1; k < N; k++) if ((long)a[i] + a[j] + a[k] == 0) cnt++; return cnt; } /* * 不处理溢出 */ public static int buggyCount(int[] a) { int N = a.length; int cnt = 0; for (int i = 0; i < N; i++) for (int j = i + 1; j < N; j++) for (int k = j + 1; k < N; k++) if (a[i] + a[j] + a[k] == 0) cnt++; return cnt; } } public static void main(String[] args) { int[] arr = new int[] { Integer.MIN_VALUE, Integer.MIN_VALUE, 0}; StdOut.println("正确处理溢出 :" + ThreeSum.correctCount(arr)); StdOut.println("不处理溢出 : " + ThreeSum.buggyCount(arr)); } // output /* * 正确处理溢出 :0 不处理溢出 : 1 */ }
[ "yangxiaohei321123@163.com" ]
yangxiaohei321123@163.com
7dbd8ed4208809261476b6d1559e5772e90f785c
2bf30c31677494a379831352befde4a5e3d8ed19
/vipr-portal/com.iwave.isa.content/src/java/com/emc/sa/service/vipr/block/UnexportSnapshotService.java
0bbfea2c58486ef08843c3eba1f41b815786ba64
[]
no_license
dennywangdengyu/coprhd-controller
fed783054a4970c5f891e83d696a4e1e8364c424
116c905ae2728131e19631844eecf49566e46db9
refs/heads/master
2020-12-30T22:43:41.462865
2015-07-23T18:09:30
2015-07-23T18:09:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
812
java
/* * Copyright 2012-2015 iWave Software LLC * All Rights Reserved */ package com.emc.sa.service.vipr.block; import static com.emc.sa.service.ServiceParams.EXPORT; import static com.emc.sa.service.ServiceParams.PROJECT; import static com.emc.sa.service.ServiceParams.SNAPSHOT; import java.net.URI; import com.emc.sa.engine.bind.Param; import com.emc.sa.engine.service.Service; import com.emc.sa.service.vipr.ViPRService; @Service("UnexportSnapshot") public class UnexportSnapshotService extends ViPRService { @Param(PROJECT) protected URI projectId; @Param(SNAPSHOT) protected URI snapshotId; @Param(EXPORT) protected URI exportId; @Override public void execute() throws Exception { BlockStorageUtils.removeBlockResourceFromExport(snapshotId, exportId); } }
[ "review-coprhd@coprhd.org" ]
review-coprhd@coprhd.org
8903e87c46aa5c9bc58100c1c24b98f2ff6ad11f
e8fc19f6301ceddebe1c76b29dbf6753f4d63da8
/AutomationFramework/src/com/inflectra/spirateam/mylyn/core/internal/services/soap/IImportExportProjectRetrieveUserMembershipServiceFaultMessageFaultFaultMessage.java
1d007c451ae26cc0dbb445389330505d94458842
[]
no_license
ravinder1414/AutomationFrameworkUpdated
524b91f29400dd1c906cc6b06a56b06ff8e6fc55
0cf3e56fc9b6b5a4bac47d0a7c7e424a49c9845a
refs/heads/master
2021-07-02T22:31:46.280362
2017-09-22T04:28:38
2017-09-22T04:28:38
104,431,215
0
1
null
null
null
null
UTF-8
Java
false
false
1,431
java
package com.inflectra.spirateam.mylyn.core.internal.services.soap; import javax.xml.ws.WebFault; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.6 in JDK 6 * Generated source version: 2.1 * */ @WebFault(name = "ServiceFaultMessage", targetNamespace = "http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v3_0") public class IImportExportProjectRetrieveUserMembershipServiceFaultMessageFaultFaultMessage extends Exception { /** * Java type that goes as soapenv:Fault detail element. * */ private ServiceFaultMessage faultInfo; /** * * @param message * @param faultInfo */ public IImportExportProjectRetrieveUserMembershipServiceFaultMessageFaultFaultMessage(String message, ServiceFaultMessage faultInfo) { super(message); this.faultInfo = faultInfo; } /** * * @param message * @param faultInfo * @param cause */ public IImportExportProjectRetrieveUserMembershipServiceFaultMessageFaultFaultMessage(String message, ServiceFaultMessage faultInfo, Throwable cause) { super(message, cause); this.faultInfo = faultInfo; } /** * * @return * returns fault bean: com.inflectra.spirateam.mylyn.core.internal.services.soap.ServiceFaultMessage */ public ServiceFaultMessage getFaultInfo() { return faultInfo; } }
[ "kumarravinder4141@gmail.com" ]
kumarravinder4141@gmail.com
0f36a7d0cdcbc1b169bdbc9ad91f2b2821792431
6e20475873bd8ef9af996cc2634138b79b0226b5
/09-JPA-MapeamentoAvancado-Exercicio/src/br/com/fiap/entity/Conta.java
ab01e36decb273052d417c2e282306c760d9cd53
[]
no_license
echaves1/2TDSA-Enterprise
c94f7773c6eb13edd39d6aeafc6782e77c0a3ea6
0c89deab1442d45d76a433b65be5e59afa5fc237
refs/heads/master
2021-01-19T23:40:09.969386
2017-05-04T14:57:45
2017-05-04T14:57:45
89,002,740
0
0
null
null
null
null
UTF-8
Java
false
false
1,885
java
package br.com.fiap.entity; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; @Entity @Table(name="TB_CONTA") @IdClass(ContaPK.class) @Inheritance(strategy=InheritanceType.JOINED) public class Conta { @Id @SequenceGenerator(name="seqName", sequenceName="SEQ_TB_CONTA", allocationSize=1) @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seqName") @Column(name="CD_CODIGO", nullable=false) private int codigo; @Column(name="NR_CONTAA", nullable=false) private double numeroConta; @Column(name="VL_SALDO", nullable=false) private double saldo; @Id @ManyToOne(cascade=CascadeType.PERSIST) @JoinColumn(name="NR_AGENCIA") private Agencia agencia; public Conta() { super(); // TODO Auto-generated constructor stub } public Conta(int codigo, double numeroConta, double saldo, Agencia agencia) { super(); this.codigo = codigo; this.numeroConta = numeroConta; this.saldo = saldo; this.agencia = agencia; } public int getCodigo() { return codigo; } public void setCodigo(int codigo) { this.codigo = codigo; } public double getNumeroConta() { return numeroConta; } public void setNumeroConta(double numeroConta) { this.numeroConta = numeroConta; } public double getSaldo() { return saldo; } public void setSaldo(double saldo) { this.saldo = saldo; } public Agencia getAgencia() { return agencia; } public void setAgencia(Agencia agencia) { this.agencia = agencia; } }
[ "logonrm@fiap.com.br" ]
logonrm@fiap.com.br
29a904a8bf1b94bd57b06af4d7c262a48c64615e
ac4989151b57a7247dae71b4adca2f70d3382dc0
/hsweb-web-bean/src/main/java/org/hsweb/web/bean/po/history/History.java
6d66ced2c46d6477175e43d104d5200a52dae655
[]
no_license
zhaoyang0501/hsweb-framework
2daff498601dad8eceb1b0ad34bd6654f056137a
6f4a12ba027452fe6ff7d0084ffd21bad4f7d394
refs/heads/master
2021-01-18T00:52:45.581073
2016-04-30T13:36:00
2016-04-30T13:36:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,670
java
package org.hsweb.web.bean.po.history; import org.hsweb.web.bean.po.GenericPo; import org.webbuilder.utils.common.MD5; import java.util.Date; import java.util.UUID; /** * 操作历史记录 * Created by zhouhao on 16-4-22. */ public class History extends GenericPo<String> { /** * 记录类型 */ private String type; /** * 说明 */ private String describe; /** * 操作数据的主键名称 */ private String primary_key_name; /** * 操作数据的主键值 */ private String primary_key_value; /** * 操作前记录 */ private String change_before; /** * 操作后记录 */ private String change_after; /** * 创建日期 */ private Date create_date; /** * 创建人主键 */ private String creator_id; public History() { } public History(String type) { this.type = type; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getDescribe() { return describe; } public void setDescribe(String describe) { this.describe = describe; } public String getPrimary_key_name() { return primary_key_name; } public void setPrimary_key_name(String primary_key_name) { this.primary_key_name = primary_key_name; } public String getPrimary_key_value() { return primary_key_value; } public void setPrimary_key_value(String primary_key_value) { this.primary_key_value = primary_key_value; } public String getChange_before() { return change_before; } public void setChange_before(String change_before) { this.change_before = change_before; } public String getChange_after() { return change_after; } public void setChange_after(String change_after) { this.change_after = change_after; } public Date getCreate_date() { return create_date; } public void setCreate_date(Date create_date) { this.create_date = create_date; } public String getCreator_id() { return creator_id; } public void setCreator_id(String creator_id) { this.creator_id = creator_id; } public static History newInstace(String type) { History history = new History(type); history.setU_id(MD5.encode(UUID.randomUUID().toString().concat(String.valueOf(Math.random())))); history.setCreate_date(new Date()); history.setCreator_id("_sys"); return history; } }
[ "zh.sqy@qq.com" ]
zh.sqy@qq.com
7c81bd06d41a5bd4f26a8c6170669672272cb3c0
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/22/22_3ec91439e01c7333e6f87027a45c1177e418bf40/JsfJspLongResourceBundlePropertyNamesTest/22_3ec91439e01c7333e6f87027a45c1177e418bf40_JsfJspLongResourceBundlePropertyNamesTest_t.java
d067749674af5610549c318088d109b692961da6
[]
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
5,379
java
/******************************************************************************* * Copyright (c) 2011 Red Hat, Inc. * Distributed under license by Red Hat, Inc. All rights reserved. * This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat, Inc. - initial API and implementation ******************************************************************************/ package org.jboss.tools.jsf.jsp.ca.test; import java.util.List; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.core.resources.IncrementalProjectBuilder; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.jboss.tools.common.base.test.contentassist.CATestUtil; import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal; import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase; import org.jboss.tools.test.util.JobUtils; import org.jboss.tools.test.util.ProjectImportTestSetup; /** * The JUnit test cases for https://issues.jboss.org/browse/JBIDE-9414 issue * * @author Victor V. Rubezhny * */ public class JsfJspLongResourceBundlePropertyNamesTest extends ContentAssistantTestCase { private static final String PROJECT_NAME = "CAForCompositeComponentTest"; private static final String PAGE_NAME = "WebContent/pages/greetingLong.xhtml"; private static final String PROPOSAL_TO_APPLY_STRING = "['org.jboss.long.named.Property']"; private static final String PREFIX_STRING = "#{msg."; private static final String ATTR_PREFIX_STRING = "h:outputText"; private static final String NOT_CLOSED_ATTR_PREFIX_STRING = "h:outputLabel"; private static final String TEXT_PREFIX_STRING = "<ui:define name=\"body\""; private static final String COMPARE_STRING = "#{msg['org.jboss.long.named.Property']"; private static final String NOT_CLOSED_COMPARE_STRING = "#{msg['org.jboss.long.named.Property']}\""; public void setUp() throws Exception { project = ProjectImportTestSetup.loadProject(PROJECT_NAME); project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor()); } public static Test suite() { return new TestSuite(JsfJspLongResourceBundlePropertyNamesTest.class); } @SuppressWarnings("restriction") private void doTestLongResourceBundlePropertyNames(String tagName, String prefix, String proposalToApply, String compareString) { // Find start of <ui:composition> tag String documentContent = document.get(); int start = (documentContent == null ? -1 : documentContent.indexOf(tagName)); assertFalse("Required node '" + tagName + "' not found in document", (start == -1)); start = documentContent.indexOf(prefix, start); int offsetToTest = start + prefix.length(); assertTrue("Cannot find the starting point in the test file \"" + PAGE_NAME + "\"", (start != -1)); String documentContentToCompare = documentContent.substring(0, start) + compareString + documentContent.substring(start + prefix.length()); JobUtils.waitForIdle(); List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant, viewer, offsetToTest); assertTrue("Content Assistant returned no proposals", (res != null && res.size() > 0)); boolean bPropoosalToApplyFound = false; for (ICompletionProposal p : res) { if (!(p instanceof AutoContentAssistantProposal)) continue; AutoContentAssistantProposal proposal = (AutoContentAssistantProposal)p; String proposalString = proposal.getDisplayString(); if (proposalToApply.equals(proposalString)) { bPropoosalToApplyFound = true; proposal.apply(document); break; } } assertTrue("The proposal to apply not found.", bPropoosalToApplyFound); try { JobUtils.waitForIdle(); } catch (Exception e) { e.printStackTrace(); assertTrue("Waiting for the jobs to complete has failed.", false); } String documentUpdatedContent = document.get(); assertTrue("The proposal replacement is failed.", documentContentToCompare.equals(documentUpdatedContent)); } public void _testJstJspLongResourceBundlePropertyNamesInTagAttributeValue() { assertNotNull("Test project '" + PROJECT_NAME + "' is not prepared", project); openEditor(PAGE_NAME); try { doTestLongResourceBundlePropertyNames(ATTR_PREFIX_STRING, PREFIX_STRING, PROPOSAL_TO_APPLY_STRING, COMPARE_STRING); } finally { closeEditor(); } } public void testJstJspLongResourceBundlePropertyNamesInNotClosedTagAttributeValue() { assertNotNull("Test project '" + PROJECT_NAME + "' is not prepared", project); openEditor(PAGE_NAME); try { doTestLongResourceBundlePropertyNames(NOT_CLOSED_ATTR_PREFIX_STRING, PREFIX_STRING, PROPOSAL_TO_APPLY_STRING, NOT_CLOSED_COMPARE_STRING); } finally { closeEditor(); } } public void _testJstJspLongResourceBundlePropertyNamesInText() { assertNotNull("Test project '" + PROJECT_NAME + "' is not prepared", project); openEditor(PAGE_NAME); try { doTestLongResourceBundlePropertyNames(TEXT_PREFIX_STRING, PREFIX_STRING, PROPOSAL_TO_APPLY_STRING, COMPARE_STRING); } finally { closeEditor(); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
3b95ae2aa67248ecd9b105db144239c128a9f83c
9d864f5a053b29d931b4c2b4f773e13291189d27
/src/kernel/kernel-impl/src/main/java/org/sakaiproject/user/impl/AuthnCacheWatcher.java
2d601c4415d73eee3059ef5e6c18b53ed5222264
[]
no_license
kyeddlapalli/sakai-cle
b1bd1e4431d8d96b6b650bfe9454eacd3e7042b2
1f06c7ac69c7cbe731c8d175d557313d0fb34900
refs/heads/master
2021-01-18T10:57:25.449065
2014-01-12T21:18:15
2014-01-12T21:18:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,248
java
/********************************************************************************** * $URL: https://source.sakaiproject.org/svn/kernel/trunk/kernel-impl/src/main/java/org/sakaiproject/user/impl/AuthnCacheWatcher.java $ * $Id: AuthnCacheWatcher.java 105077 2012-02-24 22:54:29Z ottenhoff@longsight.com $ *********************************************************************************** * * Copyright (c) 2005, 2006, 2007, 2008 Sakai Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ECL-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.sakaiproject.user.impl; import java.util.Observable; import java.util.Observer; import net.sf.ehcache.Cache; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.sakaiproject.entity.api.EntityManager; import org.sakaiproject.entity.api.Reference; import org.sakaiproject.event.api.Event; import org.sakaiproject.event.api.EventTrackingService; import org.sakaiproject.user.api.UserDirectoryService; import org.sakaiproject.user.api.UserNotDefinedException; /** * This observer watches for user.add and user.upd events to invalidate the Authn cache * * @author dhorwitz * */ public class AuthnCacheWatcher implements Observer { private static final Log log = LogFactory.getLog(AuthnCacheWatcher.class); private AuthenticationCache authenticationCache; private UserDirectoryService userDirectoryService; private EventTrackingService eventTrackingService; private EntityManager entityManager; //Copied from DbUserService as they are private private static final String EIDCACHE = "eid:"; private static final String IDCACHE = "id:"; private Cache userCache = null; public void setUserCache(Cache userCache) { this.userCache = userCache; } public void setEntityManager(EntityManager entityManager) { this.entityManager = entityManager; } public void setEventTrackingService(EventTrackingService eventTrackingService) { this.eventTrackingService = eventTrackingService; } public void setAuthenticationCache(AuthenticationCache authenticationCache) { this.authenticationCache = authenticationCache; } public void setUserDirectoryService(UserDirectoryService userDirectoryService) { this.userDirectoryService = userDirectoryService; } public void init() { log.info("init()"); eventTrackingService.addObserver(this); } public void destroy() { eventTrackingService.deleteObserver(this); } public void update(Observable arg0, Object arg) { // arg is Event if (!(arg instanceof Event)) return; Event event = (Event) arg; // check the event function against the functions we have notifications watching for String function = event.getEvent(); //we err on the side of caution here in checking all events that might invalidate the data in the cache -DH if (UserDirectoryService.SECURE_ADD_USER.equals(function) || UserDirectoryService.SECURE_UPDATE_USER_OWN_PASSWORD.equals(function) || UserDirectoryService.SECURE_UPDATE_USER_ANY.equals(function) || UserDirectoryService.SECURE_UPDATE_USER_OWN.equals(function)) { //we need the userId Reference ref = entityManager.newReference(event.getResource()); // look for group reference. Need to replace it with parent site reference String refId = ref.getId(); try { String eid = userDirectoryService.getUserEid(refId); log.debug("removing " + eid + " from cache"); authenticationCache.removeAuthentification(eid); userCache.remove(EIDCACHE + eid); userCache.remove(IDCACHE + refId); } catch (UserNotDefinedException e) { //not sure how we'd end up here log.warn(e); } } } }
[ "noah@botimer.net" ]
noah@botimer.net
9c52ac36153025ae603838a84a343a3ee8f93d57
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-481-63-16-NSGA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/internal/security/authorization/DefaultAuthorExecutor_ESTest.java
350dfe764073bd4330d0c5c4b1b7aae667519903
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
594
java
/* * This file was automatically generated by EvoSuite * Thu Apr 02 11:16:56 UTC 2020 */ package com.xpn.xwiki.internal.security.authorization; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class DefaultAuthorExecutor_ESTest extends DefaultAuthorExecutor_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
236fea6508aa2aa568f91af5130785e0b24580de
995f73d30450a6dce6bc7145d89344b4ad6e0622
/P40_HarmonyOS_2.0.0_Developer_Beta1/src/main/java/com/android/internal/os/IHwZygoteEx.java
2281b9e88b5047e25b40acfee518be1e0101d842
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
package com.android.internal.os; import android.net.LocalSocket; import java.io.BufferedReader; import java.io.DataOutputStream; public interface IHwZygoteEx { void handlePreloadApp(String str); ZygoteArguments preloadApplication(String str, BufferedReader bufferedReader, DataOutputStream dataOutputStream, LocalSocket localSocket); }
[ "dstmath@163.com" ]
dstmath@163.com
0b16cc041249ed461df282a16566158a1a56b59c
08945e7ed2157b674aa99cd33318b2f0f70b6d51
/MavenProject/src/test/java/suite/MavenProject/LoginTest2.java
ab087fc9c05597110a7af31c7cffdd8b18d6cd51
[]
no_license
nagarjunreddykasu/seleniumonline
356ce7c02ccd72cf0b00ecb256fece7eb38b19cd
7ca5db51d16554c27f519f37cf2b9ccbecb97fbe
refs/heads/master
2023-06-16T18:57:12.490681
2021-07-12T10:51:17
2021-07-12T10:51:17
333,145,937
0
0
null
null
null
null
UTF-8
Java
false
false
6,689
java
package suite.MavenProject; import java.io.IOException; import java.util.Map; import org.testng.Assert; import org.testng.SkipException; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import base.Log; import base.Reusable; import base.Setup; import pages.LoginPage2; public class LoginTest2 { String sheet_TestCases; String sheet_TestData; String className; LoginPage2 loginPage; @BeforeClass @Parameters({"browser", "url" }) public void beforeClass(String browser, String url) throws IOException { className = this.getClass().getSimpleName(); loginPage=new LoginPage2(); sheet_TestCases = loginPage.sheet_TestCases; sheet_TestData = loginPage.sheet_TestData; Reusable.launchApp(browser, url); } //Verify the page title in Login page @Test public void TC_Login_01() throws Exception{ String testcaseID=Reusable.getMethodName(); boolean isSkip = false; try{ isSkip=Reusable.isSkip(loginPage.xlLogin, sheet_TestCases, testcaseID); if (isSkip) { throw new SkipException("Skip this Test Case"); } String description=loginPage.getTCDescription(loginPage.xlLogin, sheet_TestCases, testcaseID); Setup.extentTest=Setup.reports.createTest(description); Setup.extentTest.assignCategory(className); int rowNum=loginPage.xlLogin.getRowNum(sheet_TestData, testcaseID); String expectedTitle=loginPage.xlLogin.getCellData(sheet_TestData, "TestData1", rowNum); String actualTitle=Reusable.getTitle(); //Assert.assertEquals(expectedTitle, actualTitle); if(actualTitle.equals(expectedTitle)){ System.out.println("Actual and Expected Page titles are Equal..."); Log.info("Actual and Expected Page titles are Equal..."); loginPage.xlLogin.setCellData(sheet_TestCases, testcaseID, "Result", "PASS"); } else{ Log.error("Actual and Expected Page titles are NOT Equal"); loginPage.xlLogin.setCellData(sheet_TestCases, testcaseID, "Result", "FAIL"); throw new Exception("Actual and Expected Page titles are NOT Equal"); } } catch(Exception e){ if(isSkip){ loginPage.xlLogin.setCellData(sheet_TestCases, testcaseID, "Result", "SKIP"); } throw e; } } //Verify the validation messages when clicking on Sign In button without entering user name and password @Test public void TC_Login_02() throws Exception{ String testcaseID=Reusable.getMethodName(); boolean isSkip = false; Map<String,String> testdata; try{ isSkip = Reusable.isSkip(loginPage.xlLogin, sheet_TestCases, testcaseID); if (isSkip) { throw new SkipException("Skip this Test Case"); } String description=loginPage.getTCDescription(loginPage.xlLogin, sheet_TestCases, testcaseID); Setup.extentTest=Setup.reports.createTest(description); Setup.extentTest.assignCategory(className); Reusable.click(loginPage.prop.getProperty("btnLogin")); String actualErrUserName=Reusable.getText(loginPage.errorUserName); String actualErrPassword=Reusable.getText(loginPage.errorPassword); testdata=loginPage.getTestData(loginPage.xlLogin, sheet_TestData, testcaseID); String expectedErrUserName=testdata.get("TestData1"); String expectedErrPassword=testdata.get("TestData2"); Assert.assertEquals(actualErrUserName, expectedErrUserName); Assert.assertEquals(actualErrPassword, expectedErrPassword); Reusable.setResultInExcel(loginPage.xlLogin, sheet_TestCases, testcaseID, "PASS"); } catch(Exception e){ if(isSkip){ Reusable.setResultInExcel(loginPage.xlLogin, sheet_TestCases, testcaseID, "SKIP"); } else{ Reusable.setResultInExcel(loginPage.xlLogin, sheet_TestCases, testcaseID, "FAIL"); } throw e; } } //Verify the validation message when clicking on Sign In button without entering valid user name @Test public void TC_Login_03() throws Exception{ String testcaseID=Reusable.getMethodName(); boolean isSkip = false; Map<String,String> testdata; try{ isSkip = Reusable.isSkip(loginPage.xlLogin, sheet_TestCases, testcaseID); if (isSkip) { throw new SkipException("Skip this Test Case"); } String description=loginPage.getTCDescription(loginPage.xlLogin, sheet_TestCases, testcaseID); Setup.extentTest=Setup.reports.createTest(description); Setup.extentTest.assignCategory(className); testdata=loginPage.getTestData(loginPage.xlLogin, sheet_TestData, testcaseID); String username=testdata.get("UserName"); String password=testdata.get("Password"); Reusable.sendKeys(loginPage.username,username); Reusable.sendKeys(loginPage.password,password); Reusable.click(loginPage.btnLogin); String expectedMsg=testdata.get("TestData1"); Assert.assertEquals(Reusable.getText(loginPage.errorUserPassword),expectedMsg); Reusable.setResultInExcel(loginPage.xlLogin, sheet_TestCases, testcaseID, "PASS"); } catch(Exception e){ if(isSkip){ Reusable.setResultInExcel(loginPage.xlLogin, sheet_TestCases, testcaseID, "SKIP"); } else{ Reusable.setResultInExcel(loginPage.xlLogin, sheet_TestCases, testcaseID, "FAIL"); } throw e; } } //Verify the validation message when clicking on Sign In button without entering valid password @Test public void TC_Login_04() throws Exception{ String testcaseID=Reusable.getMethodName(); boolean isSkip = false; Map<String,String> testdata; try{ isSkip = Reusable.isSkip(loginPage.xlLogin, sheet_TestCases, testcaseID); if (isSkip) { throw new SkipException("Skip this Test Case"); } String description=loginPage.getTCDescription(loginPage.xlLogin, sheet_TestCases, testcaseID); Setup.extentTest=Setup.reports.createTest(description); Setup.extentTest.assignCategory(className); testdata=loginPage.getTestData(loginPage.xlLogin, sheet_TestData, testcaseID); Reusable.clear(loginPage.username); String username=testdata.get("UserName"); String password=testdata.get("Password"); Reusable.sendKeys(loginPage.username,username); Reusable.sendKeys(loginPage.password,password); Reusable.click(loginPage.btnLogin); String expectedMsg=testdata.get("TestData1"); Assert.assertEquals(Reusable.getText(loginPage.errorUserPassword),expectedMsg); Reusable.setResultInExcel(loginPage.xlLogin, sheet_TestCases, testcaseID, "PASS"); } catch(Exception e){ if(isSkip){ Reusable.setResultInExcel(loginPage.xlLogin, sheet_TestCases, testcaseID, "SKIP"); } else{ Reusable.setResultInExcel(loginPage.xlLogin, sheet_TestCases, testcaseID, "FAIL"); } throw e; } } @AfterClass public void afterClass(){ Reusable.close(); } }
[ "nagarjun.sdet@gmail.com" ]
nagarjun.sdet@gmail.com
63f75a2660e0eb16ee4f8fcf728bcf81c60e1971
de3eb812d5d91cbc5b81e852fc32e25e8dcca05f
/tags/2.2.1-r1696/CruxCompiler/src/br/com/sysmap/crux/tools/compile/CruxCompilerTask.java
0b424db0f4fa44a246844e37dcf77969092b706e
[]
no_license
svn2github/crux-framework
7dd52a951587d4635112987301c88db23325c427
58bcb4821752b405a209cfc21fb83e3bf528727b
refs/heads/master
2016-09-06T13:33:41.975737
2015-01-22T08:03:25
2015-01-22T08:03:25
13,135,398
0
0
null
null
null
null
UTF-8
Java
false
false
2,121
java
/* * Copyright 2009 Sysmap Solutions Software e Consultoria Ltda. * * 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 br.com.sysmap.crux.tools.compile; import java.io.File; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import org.apache.tools.ant.taskdefs.Java; import org.apache.tools.ant.types.DirSet; /** * * @author Thiago da Rosa de Bustamante <code>tr_bustamante@yahoo.com.br</code> */ public class CruxCompilerTask extends AbstractCruxCompilerTask { private List<DirSet> dirsets = new ArrayList<DirSet>(); public void addDirset(DirSet dirset) { dirsets.add(dirset); } /** * Gets the list of directories that will be compiled * @return */ protected List<File> getInputFiles() throws Exception { List<File> files = new LinkedList<File>(); for (DirSet fs : dirsets) { files.add(fs.getDir()); } return files; } /** * @param javatask * @throws Exception */ @Override protected void addCompilerParameters(Java javatask) throws Exception { List<File> inputFiles = getInputFiles(); StringBuilder pagesDirs = new StringBuilder(); boolean needsComma = false; for (File file : inputFiles) { if (needsComma) { pagesDirs.append(","); } needsComma = true; pagesDirs.append(file.getCanonicalPath()); } if (pagesDirs.length() > 0) { javatask.createArg().setValue("cruxPagesDir"); javatask.createArg().setValue(pagesDirs.toString()); } super.addCompilerParameters(javatask); } }
[ "tr_bustamante@yahoo.com.br@a5d2bbaa-053c-11de-b17c-0f1ef23b492c" ]
tr_bustamante@yahoo.com.br@a5d2bbaa-053c-11de-b17c-0f1ef23b492c
befdde3583c7445cd12896b22dfc32685e11b622
7fb10d87ef9eda8a2b0b39f5ec876f02d08cd621
/java-source-example/jdk8u40-source/resource/org/omg/IOP/CodecFactoryHelper.java
539a4b4bea93d47b4129e1f6c65e6a788918d0f7
[]
no_license
SexCastException/java
77873efe81a8f2495356a5c33b97996993e121c4
7997885a3e2c62423d886978016a1ce02d39e44b
refs/heads/master
2022-05-09T13:42:12.379628
2022-04-14T06:29:32
2022-04-14T06:29:32
190,780,380
0
0
null
2022-04-14T06:29:33
2019-06-07T17:02:54
Java
UTF-8
Java
false
false
2,254
java
package org.omg.IOP; /** * org/omg/IOP/CodecFactoryHelper.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/re/workspace/8-2-build-owindows-i586-cygwin/jdk8u40/2855/corba/src/share/classes/org/omg/PortableInterceptor/IOP.idl * Tuesday, February 10, 2015 10:08:00 PM PST */ /** * <code>Codecs</code> are obtained from the <code>CodecFactory</code>. * The <code>CodecFactory</code> is obtained through a call to * <code>ORB.resolve_initial_references( "CodecFactory" )</code>. */ abstract public class CodecFactoryHelper { private static String _id = "IDL:omg.org/IOP/CodecFactory:1.0"; public static void insert (org.omg.CORBA.Any a, org.omg.IOP.CodecFactory that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static org.omg.IOP.CodecFactory extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.IOP.CodecFactoryHelper.id (), "CodecFactory"); } return __typeCode; } public static String id () { return _id; } public static org.omg.IOP.CodecFactory read (org.omg.CORBA.portable.InputStream istream) { throw new org.omg.CORBA.MARSHAL (); } public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.IOP.CodecFactory value) { throw new org.omg.CORBA.MARSHAL (); } public static org.omg.IOP.CodecFactory narrow (org.omg.CORBA.Object obj) { if (obj == null) return null; else if (obj instanceof org.omg.IOP.CodecFactory) return (org.omg.IOP.CodecFactory)obj; else throw new org.omg.CORBA.BAD_PARAM (); } public static org.omg.IOP.CodecFactory unchecked_narrow (org.omg.CORBA.Object obj) { if (obj == null) return null; else if (obj instanceof org.omg.IOP.CodecFactory) return (org.omg.IOP.CodecFactory)obj; else throw new org.omg.CORBA.BAD_PARAM (); } }
[ "pyh@qq.com" ]
pyh@qq.com
9617dc05900b4d63cb65dac9592bd688da9dee1a
ae81a3523d058a3463d16bd0683b46c91873b5ea
/src/main/java/lesson7/touragency/country/service/CountryService.java
67a3f1bdeb93c1c1e7a48561f129cedd2dad7251
[]
no_license
soignera/JavaCore
b6f87e4382d27232ebe1f55ad2970fe197927fe1
70933e925bad8710a889ca09bbbcc02d40dad507
refs/heads/master
2020-04-25T10:22:01.787953
2019-04-22T22:53:27
2019-04-22T22:53:27
172,707,015
1
0
null
null
null
null
UTF-8
Java
false
false
416
java
package lesson7.touragency.country.service; import touragency.common.business.service.BaseService; import touragency.country.domain.Country; import touragency.country.search.CountrySearchCondition; public interface CountryService extends BaseService { void add(Country country); Country findById(Long id); void delete(Country country); Country[] search(CountrySearchCondition searchCondition); }
[ "askasoignera@gmail.com" ]
askasoignera@gmail.com
e2a3aeebde7f30239718164c9daac615114ac295
9088666a58617364f7c7f918460008260cddc910
/java/xnkj/backstage/src/main/java/com/liaoin/backstage/Ueditor/define/ActionMap.java
370c08cdf6e98eff9324aee456b0e188c1aeca6b
[]
no_license
cqwu729/201804-xnkjxm
2378c31d1c01004a461b64849aa435a035eb7bec
9c85f096db2d957dde1ffae135f4a8f164671c22
refs/heads/master
2020-04-11T11:47:50.593901
2018-12-14T09:12:28
2018-12-14T09:12:28
161,759,777
2
1
null
null
null
null
UTF-8
Java
false
false
1,158
java
package com.liaoin.backstage.Ueditor.define; import java.util.HashMap; import java.util.Map; /** * 定义请求action类型 * @author hancong03@baidu.com * */ @SuppressWarnings("serial") public final class ActionMap { public static final Map<String, Integer> mapping; // 获取配置请求 public static final int CONFIG = 0; public static final int UPLOAD_IMAGE = 1; public static final int UPLOAD_SCRAWL = 2; public static final int UPLOAD_VIDEO = 3; public static final int UPLOAD_FILE = 4; public static final int CATCH_IMAGE = 5; public static final int LIST_FILE = 6; public static final int LIST_IMAGE = 7; static { mapping = new HashMap<String, Integer>(){{ put( "config", ActionMap.CONFIG ); put( "uploadimage", ActionMap.UPLOAD_IMAGE ); put( "uploadscrawl", ActionMap.UPLOAD_SCRAWL ); put( "uploadvideo", ActionMap.UPLOAD_VIDEO ); put( "uploadfile", ActionMap.UPLOAD_FILE ); put( "catchimage", ActionMap.CATCH_IMAGE ); put( "listfile", ActionMap.LIST_FILE ); put( "listimage", ActionMap.LIST_IMAGE ); }}; } public static int getType ( String key ) { return ActionMap.mapping.get( key ); } }
[ "997342977@qq.com" ]
997342977@qq.com
7706c6d85bb16645daa10b2411e2be84619be576
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_7093a9fe0b309eb1ec22b56eb43e7854d134e1f2/ManifestTest/2_7093a9fe0b309eb1ec22b56eb43e7854d134e1f2_ManifestTest_s.java
c9d37e4eef4c6f92043089a4f7d651a5ff71cd63
[]
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,932
java
package org.plovr; import java.io.File; import java.util.Collection; import java.util.List; import junit.framework.TestCase; import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.javascript.jscomp.JSSourceFile; /** * {@link ManifestTest} is a unit test for {@link Manifest}. * * @author bolinfest@gmail.com (Michael Bolin) */ public class ManifestTest extends TestCase { /** Converts a {@link JSSourceFile} to its name. */ private static Function<JSSourceFile, String> JS_SOURCE_FILE_TO_NAME = new Function<JSSourceFile, String>() { @Override public String apply(JSSourceFile jsSourceFile) { return jsSourceFile.getName(); } }; /** Converts a {@link JsInput} to its name. */ private static Function<JsInput, String> JS_INPUT_TO_NAME = new Function<JsInput, String>() { @Override public String apply(JsInput jsInput) { return jsInput.getName(); } }; public void testSimpleManifest() throws CompilationException { File closureLibraryDirectory = new File("../closure-library/closure/goog/"); final List<File> dependencies = ImmutableList.of(); String path = "test/org/plovr/example.js"; File testFile = new File(path); JsSourceFile requiredInput = new JsSourceFile(path, testFile); final List<File> externs = ImmutableList.of(); final boolean customExternsOnly = false; Manifest manifest = new Manifest( closureLibraryDirectory, dependencies, ImmutableList.<JsInput>of(requiredInput), externs, customExternsOnly); final ModuleConfig moduleConfig = null; Compilation compilerArguments = manifest.getCompilerArguments(moduleConfig); List<JSSourceFile> inputs = compilerArguments.getInputs(); List<String> expectedNames = ImmutableList.copyOf( new String[] { "base.js", "/goog/debug/error.js", "/goog/string/string.js", "/goog/asserts/asserts.js", "/goog/array/array.js", "/goog/debug/entrypointregistry.js", "/goog/debug/errorhandlerweakdep.js", "/goog/useragent/useragent.js", "/goog/events/browserfeature.js", "/goog/disposable/disposable.js", "/goog/events/event.js", "/goog/events/eventtype.js", "/goog/reflect/reflect.js", "/goog/events/browserevent.js", "/goog/events/eventwrapper.js", "/goog/events/listener.js", "/goog/structs/simplepool.js", "/goog/useragent/jscript.js", "/goog/events/pools.js", "/goog/object/object.js", "/goog/events/events.js", "test/org/plovr/example.js" } ); assertEquals(expectedNames, Lists.transform(inputs, JS_SOURCE_FILE_TO_NAME)); } public void testCompilationOrder() throws CompilationException { File closureLibraryDirectory = new File("../closure-library/closure/goog/"); final List<File> dependencies = ImmutableList.of(); final List<File> externs = ImmutableList.of(); final boolean customExternsOnly = false; // Set up a set of files so that there's a dependency loop of // a -> b -> c -> a DummyJsInput a, b, c; a = new DummyJsInput("a", "", ImmutableList.of("a"), ImmutableList.of("b")); b = new DummyJsInput("b", "", ImmutableList.of("b"), ImmutableList.of("c")); c = new DummyJsInput("c", "", ImmutableList.of("c"), ImmutableList.of("a")); Manifest manifest = new Manifest( closureLibraryDirectory, dependencies, ImmutableList.<JsInput>of(a, b, c), externs, customExternsOnly); List<JsInput> order; try { order = manifest.getInputsInCompilationOrder(); fail("Got order for unorderable inputs: " + order); } catch (CircularDependencyException e) { Collection<JsInput> circularDepdenency = e.getCircularDependency(); assertEquals(ImmutableList.copyOf(circularDepdenency), ImmutableList.of(a, b, c)); } // Now adjust c so that it no longer creates a loop c = new DummyJsInput("c", "", ImmutableList.of("c"), null); manifest = new Manifest( closureLibraryDirectory, dependencies, ImmutableList.<JsInput>of(a, b, c), externs, customExternsOnly); order = manifest.getInputsInCompilationOrder(); List<String> expectedNames = ImmutableList.of("base.js", "c", "b", "a"); assertEquals(expectedNames, Lists.transform(order, JS_INPUT_TO_NAME)); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
34d46c865182c38f14c04a9e40f8c488e39222a3
ebb1ac96c6f70bd22dde5a3f8ebec91e10b46cb6
/src/test/java/com/luo/ibatis/submitted/column_prefix/Phone.java
d44ff160cfdcc2f525975d50cc7d36ae56c27b43
[]
no_license
RononoaZoro/customize-mybatis
025cca308329dc2914acfebc3b577dc8d2f54e47
9f6d8321ea4396050573c3db385f60e3b234983e
refs/heads/master
2023-06-15T09:23:12.396807
2021-07-13T07:12:15
2021-07-13T07:12:15
375,922,905
0
0
null
null
null
null
UTF-8
Java
false
false
1,159
java
/** * Copyright 2009-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.luo.ibatis.submitted.column_prefix; public class Phone { private Integer id; private String phone; private String areaCode; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getAreaCode() { return areaCode; } public void setAreaCode(String areaCode) { this.areaCode = areaCode; } }
[ "luoxz@akulaku.com" ]
luoxz@akulaku.com
132d3c29a92e5a50a5da3cedc244f864d03421b7
c71140cde8034e35faf2f67e85710611797ad49b
/server/src/main/java/com/thoughtworks/go/server/security/GoLogoutFilter.java
5ac550f1dc5d788cf767e16ff6ec8464e7517ddc
[ "Apache-2.0" ]
permissive
cburgmer/gocd
0c3cc7e2acdb62a5668247f50d533366f1be5395
4db1ab38e0ee0b84bad87f532d25440eebc36c18
refs/heads/master
2020-03-10T14:16:20.613357
2018-04-13T15:38:31
2018-04-16T03:56:44
129,422,106
0
0
Apache-2.0
2018-04-13T15:38:53
2018-04-13T15:38:53
null
UTF-8
Java
false
false
2,252
java
/*************************GO-LICENSE-START********************************* * Copyright 2014 ThoughtWorks, 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. *************************GO-LICENSE-END***********************************/ package com.thoughtworks.go.server.security; import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.thoughtworks.go.server.service.SecurityService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.ui.FilterChainOrder; import org.springframework.security.ui.SpringSecurityFilter; import org.springframework.security.ui.logout.LogoutFilter; import org.springframework.security.ui.logout.LogoutHandler; public class GoLogoutFilter extends SpringSecurityFilter { private final SecurityService securityService; private final String logoutUrl; private final LogoutHandler[] handlers; @Autowired public GoLogoutFilter(SecurityService securityService, String logoutUrl, LogoutHandler[] handlers) { this.securityService = securityService; this.logoutUrl = logoutUrl; this.handlers = handlers; } @Override protected void doFilterHttp(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { LogoutFilter logoutFilter = new LogoutFilter(securityService.logoutSuccessUrl(), handlers); logoutFilter.setFilterProcessesUrl(logoutUrl); logoutFilter.doFilterHttp(request, response, chain); } public int getOrder() { return FilterChainOrder.LOGOUT_FILTER; } }
[ "godev@thoughtworks.com" ]
godev@thoughtworks.com
e2a66dcabced9ceb7c653f07c30b6bb02b9db019
2f37b98f4ea627721b8cc63087b93737cf5e8834
/app/src/main/java/com/lunioussky/orirea/ui/adapter/BoredPicAdapter.java
f6d49875388ac6b7191f70e8d950eb5ccaf57767
[]
no_license
lunious/OriRea
f1627542cd6719a01b6fa29f6a35698fe34b9c81
3d5c3d2c41ec71bef4ec8c17d279db00cfd3a05f
refs/heads/master
2021-05-11T20:23:12.665224
2018-01-14T14:52:55
2018-01-14T14:52:55
117,434,618
0
0
null
null
null
null
UTF-8
Java
false
false
6,880
java
package com.lunioussky.orirea.ui.adapter; import android.app.Activity; import android.graphics.drawable.Drawable; import android.support.annotation.Nullable; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import com.bumptech.glide.request.target.DrawableImageViewTarget; import com.bumptech.glide.request.transition.Transition; import com.chad.library.adapter.base.BaseMultiItemQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import com.lunioussky.orirea.OriApp; import com.lunioussky.orirea.R; import com.lunioussky.orirea.bean.JdDetailBean; import com.lunioussky.orirea.ui.jandan.ImageBrowseActivity; import com.lunioussky.orirea.utils.ContextUtils; import com.lunioussky.orirea.utils.DateUtil; import com.lunioussky.orirea.utils.ImageLoaderUtil; import com.lunioussky.orirea.utils.ShareUtils; import com.lunioussky.orirea.widget.MultiImageView; import com.lunioussky.orirea.widget.ShowMaxImageView; import java.util.List; /** * desc: . * author: Will . * date: 2017/9/27 . */ public class BoredPicAdapter extends BaseMultiItemQuickAdapter<JdDetailBean.CommentsBean, BaseViewHolder> { private static final String TAG = "BoredPicAdapter"; private Activity mContext; public BoredPicAdapter(Activity context, @Nullable List<JdDetailBean.CommentsBean> data) { super(data); addItemType(JdDetailBean.CommentsBean.TYPE_MULTIPLE, R.layout.item_jandan_pic); addItemType(JdDetailBean.CommentsBean.TYPE_SINGLE, R.layout.item_jandan_pic_single); this.mContext = context; } @Override protected void convert(final BaseViewHolder viewHolder, final JdDetailBean.CommentsBean commentsBean) { viewHolder.setText(R.id.tv_author, commentsBean.getComment_author()); if (!TextUtils.isEmpty(commentsBean.getComment_agent())){ if (commentsBean.getComment_agent().contains("Android")) { viewHolder.setText(R.id.tv_from, "来自 Android 客户端"); viewHolder.setVisible(R.id.tv_from, true); } else { viewHolder.setVisible(R.id.tv_from, false); } }else { viewHolder.setVisible(R.id.tv_from, false); } viewHolder.setText(R.id.tv_time, DateUtil.getTimestampString(DateUtil.string2Date(commentsBean.getComment_date(), "yyyy-MM-dd HH:mm:ss"))); if (TextUtils.isEmpty(commentsBean.getText_content())) { viewHolder.setVisible(R.id.tv_content, false); } else { viewHolder.setVisible(R.id.tv_content, true); String content = commentsBean.getText_content().replace(" ", "").replace("\r", "").replace("\n", ""); viewHolder.setText(R.id.tv_content, content); Log.i(TAG, "convert: author=" + commentsBean.getComment_author() + " content= " + commentsBean.getText_content()); } viewHolder.setVisible(R.id.img_gif, commentsBean.getPics().get(0).contains("gif")); viewHolder.setVisible(R.id.progress, commentsBean.getPics().get(0).contains("gif")); viewHolder.setText(R.id.tv_like, commentsBean.getVote_negative()); viewHolder.setText(R.id.tv_unlike, commentsBean.getVote_positive()); viewHolder.setText(R.id.tv_comment_count, commentsBean.getSub_comment_count()); viewHolder.addOnClickListener(R.id.img_share); switch (viewHolder.getItemViewType()) { case JdDetailBean.CommentsBean.TYPE_MULTIPLE: MultiImageView multiImageView = viewHolder.getView(R.id.img); viewHolder.setVisible(R.id.img_gif, false); multiImageView.setList(commentsBean.getPics()); multiImageView.setOnItemClickListener(new MultiImageView.OnItemClickListener() { @Override public void onItemClick(View view, int position) { String[] imageUrls = new String[commentsBean.getPics().size()]; for (int i = 0; i < commentsBean.getPics().size(); i++) { imageUrls[i] = commentsBean.getPics().get(i); } ImageBrowseActivity.launch(mContext, imageUrls, position); } }); viewHolder.getView(R.id.img_share).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ShareUtils.shareSingleImage(mContext, commentsBean.getPics().get(0)); } }); break; case JdDetailBean.CommentsBean.TYPE_SINGLE: ShowMaxImageView imageView = viewHolder.getView(R.id.img); imageView.getLayoutParams().height = ContextUtils.dip2px(OriApp.getContext(), 250); imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String[] imageUrls = new String[commentsBean.getPics().size()]; imageUrls[0] = commentsBean.getPics().get(0); ImageBrowseActivity.launch(mContext, imageUrls, 0); } }); ImageLoaderUtil.LoadImage(mContext, commentsBean.getPics().get(0), new DrawableImageViewTarget((ImageView) viewHolder.getView(R.id.img)) { @Override public void onResourceReady(Drawable resource, @Nullable Transition<? super Drawable> transition) { super.onResourceReady(resource, transition); int pmWidth = ContextUtils.getSreenWidth(OriApp.getContext()); int pmHeight = ContextUtils.getSreenHeight(OriApp.getContext()); float sal = (float) pmHeight / pmWidth; int actualHeight = (int) Math.ceil(sal * resource.getIntrinsicWidth()); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, actualHeight); viewHolder.getView(R.id.img).setLayoutParams(params); viewHolder.setVisible(R.id.img_gif, false); } }); viewHolder.getView(R.id.img_share).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ShareUtils.shareText(mContext, "http://jandan.net/pic/"); } }); break; } } }
[ "1164503275@qq.com" ]
1164503275@qq.com
d4741fd3988d069a8d5bebe09ccc4a318e42db0d
20591524b55c1ce671fd325cbe41bd9958fc6bbd
/batch/src/main/java/com/rongdu/loans/constant/TableSchema.java
6b3ac2489d5ef34d4830cfb9481ae8ce02b7c306
[]
no_license
ybak/loans-suniu
7659387eab42612fce7c0fa80181f2a2106db6e1
b8ab9bfa5ad8be38dc42c0e02b73179b11a491d5
refs/heads/master
2021-03-24T01:00:17.702884
2019-09-25T15:28:35
2019-09-25T15:28:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
137
java
package com.rongdu.loans.constant; public class TableSchema { public static final String SCHEMA_NAME = "YCLOANS_20140928"; }
[ "tiramisuy18@163.com" ]
tiramisuy18@163.com
7ad0a397f7ff5cb86c0a6fee4ae5929e5daf7635
47074239415381aefe6286ab11049bd27b5de2eb
/3. Automatically Generated Test Data/JHD.TemplateMethod/TemplateMethod_ChangeConnectionHandle_67.java
ed71562f17ecb5adeba713b6a32b7bcdd9191a21
[ "CC-BY-4.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Megre/Dataset4SparT-ETA
c9c3611b143a0d1b1d5180603c5684313686921a
6165ed6ffb63c9c74522ca77e5d4edde7369376c
refs/heads/master
2021-06-25T22:37:13.843086
2021-04-03T16:37:36
2021-04-03T16:37:36
225,321,687
6
0
null
null
null
null
UTF-8
Java
false
false
333
java
package test.auto; public class TemplateMethod_ChangeConnectionHandle_67 { public static void main(String[] args) throws java.lang.Exception { CH.ifa.draw.standard.ChangeConnectionHandle abstractClass = new CH.ifa.draw.standard.ChangeConnectionStartHandle(new CH.ifa.draw.figures.EllipseFigure()); abstractClass.source(); } }
[ "renhao.x@seu.edu.cn" ]
renhao.x@seu.edu.cn
4b987e624fbebfd6f4b6a8997aebdcfbde54908d
fc4b196567b8e0363adad4a11a11640194385ebb
/variable_tree/androidAppModule2/src/main/java/androidAppModule2packageJava0/Foo0.java
a35659ebfe8334339c720318709257085113cf34
[]
no_license
MaTriXy/android-projects
8c9e93233bfff6661c51d55438224883518f8c5b
53faf79ca3f39b16e48ddbd35a4a11470ed5fd03
refs/heads/master
2020-04-10T12:27:35.232439
2018-10-31T21:18:30
2018-10-31T21:18:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
587
java
package androidAppModule2packageJava0; public class Foo0 { public void foo0() { final Runnable anything = () -> System.out.println("anything"); new androidAppModule6packageJava0.Foo4().foo3(); new androidAppModule7packageJava0.Foo4().foo3(); } public void foo1() { final Runnable anything = () -> System.out.println("anything"); foo0(); } public void foo2() { final Runnable anything = () -> System.out.println("anything"); foo1(); } public void foo3() { final Runnable anything = () -> System.out.println("anything"); foo2(); } }
[ "jingwen@google.com" ]
jingwen@google.com
5a5c733d1ff82147ea1750096a25e0e4c5f14407
860b94cec0d511aee74fce97f5248dd64315108d
/exchange/Bean/MySoldItemBean.java
b533e987434b970bb61a0b0d6fcf7434b86b365f
[ "MIT" ]
permissive
guixiaoyuan/workspace
3dbd9061bc94b474f8d2e661ae0cb3a4f16295cb
b10141970ffc7c4ec7a1605abfcf9bbce17992e2
refs/heads/master
2020-12-09T16:18:35.502815
2016-08-23T00:14:01
2016-08-23T00:14:01
41,332,580
0
0
null
null
null
null
UTF-8
Java
false
false
3,848
java
package com.deeal.exchange.Bean; import android.content.Context; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; /** * Created by Sunqiyong on 2015/7/15. */ public class MySoldItemBean { private String imv_goods = "";//商品图片 private String name_goods = "";//商品名 private String price_goods = "";//商品价格 private String condition_goods = "";//商品的交易状态 private String contact_buy = "";//买家的ID private String old_price = ""; private String orderID; private String buyerID; private String merchandiseID; public MySoldItemBean() { } public String getImv_goods() { return imv_goods; } public void setImv_goods(String imv_goods) { this.imv_goods = imv_goods; } public String getName_goods() { return name_goods; } public void setName_goods(String name_goods) { this.name_goods = name_goods; } public String getPrice_goods() { return price_goods; } public void setPrice_goods(String price_goods) { this.price_goods = price_goods; } public String getCondition_goods() { return condition_goods; } public void setCondition_goods(String condition_goods) { this.condition_goods = condition_goods; } public String getcontact_buy() { return contact_buy; } public void setcontact_buy(String contact_buy) { this.contact_buy = contact_buy; } /** * 解析我卖的商品的列表信息json * * @param json_data 需要解析的商品json * @return 返回一个MySoldItemBean的集合,每一个MySoldItemBean类,表示一个商品订单 */ public ArrayList<MySoldItemBean> parseSearchjson(String json_data) { ArrayList<MySoldItemBean> items = new ArrayList<MySoldItemBean>(); try { JSONObject jsonObject = new JSONObject(json_data); if (jsonObject.getString("status").equals("SUCCESS")) { JSONArray data = new JSONArray(jsonObject.getString("data")); for (int i = 0; i < data.length(); i++) { JSONObject json = data.getJSONObject(i); MySoldItemBean item = new MySoldItemBean(); JSONArray mivs = new JSONArray(json.getString("imgPath")); item.setOrderID(json.getString("orderID")); item.setImv_goods(mivs.getString(0)); item.setName_goods(json.getString("info")); item.setOld_price(json.getString("oldPrice")); item.setPrice_goods(json.getString("currentPrice")); item.setCondition_goods(json.getString("orderState")); item.setcontact_buy(json.getString("merchandiseID")); item.setBuyerID(json.getString("buyerID")); item.setMerchandiseID(json.getString("merchandiseID")); items.add(item); } } } catch (JSONException e) { e.printStackTrace(); } return items; } public String getOld_price() { return old_price; } public void setOld_price(String old_price) { this.old_price = old_price; } public String getOrderID() { return orderID; } public void setOrderID(String orderID) { this.orderID = orderID; } public String getBuyerID() { return buyerID; } public void setBuyerID(String buyerID) { this.buyerID = buyerID; } public String getMerchandiseID() { return merchandiseID; } public void setMerchandiseID(String merchandiseID) { this.merchandiseID = merchandiseID; } }
[ "463316523@qq.com" ]
463316523@qq.com
45bc69bf0349fd49583eb47769680ab79852d033
10c69747a1c9c3e51b8498a7e1055ff50ee5f1a7
/20190131_Algorithm/Friday_Exam/src/ProductManager.java
3f2d005aba8242046fe6e2d4c9d1720a866361dd
[]
no_license
hyungju2/SSAFY_JavaPractice
edad2436fc0b6da76dd3bb9bcec6ef4030564714
781aa85b3c6c7b49b075850da0991f8a21ddc78d
refs/heads/master
2022-01-19T23:20:31.492660
2019-05-10T07:18:58
2019-05-10T07:18:58
166,316,436
1
0
null
null
null
null
UTF-8
Java
false
false
2,251
java
import java.io.DataOutputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class ProductManager implements ProductIMgr { List<Product> list = new ArrayList<>(); Scanner sc = new Scanner(System.in); private ProductManager() { } // 생성자 private 1. private static ProductManager instance; // field는 static으로. public static ProductManager getInstance() { if (instance == null) { instance = new ProductManager(); } return instance; } // 객체 생성 메소드는 public,static으로. public void add(Product s) throws ExsitException { for(Product p: list) { if(p.getPname().equals(s.getPname())) throw new ExsitException(); } list.add(s); } public List<Product> search() { return list; } public Product search(int pcode) throws Error { Product temp = new Product(); for (Product p : list) { if (p.getPcode() == pcode) return p; } throw new Error(); } // pcode search public void update(int pcode) { int index = 0; System.out.println("변경하실 상품명과 가격을 입력하세요"); String name = sc.next(); int price = sc.nextInt(); for (Product p : list) { if (p.getPcode() == pcode) { list.get(index).setPname(name); list.get(index).setPrice(price); } index++; } } // update public void delete(int pcode) { int index = 0; for (Product p : list) { if (p.getPcode() == pcode) { break; } index++; } list.remove(index); } // delete public void save(String file) throws Exception { FileOutputStream fos = new FileOutputStream("product.dat"); ObjectOutputStream oos = new ObjectOutputStream(fos); for (Product p : list) { oos.writeObject(p); } oos.close(); fos.close(); } public void load(String file) { try { FileInputStream fis = new FileInputStream(file); ObjectInputStream ois = new ObjectInputStream(fis); for (Product pd; (pd = (Product)ois.readObject())!= null;) { add(pd); } } catch (Exception e) { } } }
[ "huisam@naver.com" ]
huisam@naver.com
ab32db7be9ae3eff7de6f5bb39f3a232bdae0b4d
f989811ecac30258de6455e57ff4a567f6c23a3f
/common-lib/src/main/java/com/example/common/async/AsyncManager.java
7e74f077ecb2e0c598e4cae4f0b62b6138a257ec
[ "Apache-2.0" ]
permissive
xinlc/springcloud-microservices-template
ab00fdfe3cbb0e7034bd9cf501c80df8a3298ba4
eae392a57f406c3665f1d41d818d5ec4b6e66312
refs/heads/master
2022-06-26T06:30:39.464728
2020-08-04T05:23:17
2020-08-04T05:23:17
252,953,965
1
0
Apache-2.0
2022-06-21T03:59:50
2020-04-04T09:11:55
Java
UTF-8
Java
false
false
1,111
java
package com.example.common.async; import com.example.common.config.ThreadPoolConfig; import com.example.common.utils.SpringUtil; import com.example.common.utils.ThreadsUtil; import java.util.TimerTask; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; /** * 异步任务管理器 * * @author Leo * @date 2020.04.12 */ public class AsyncManager { /** * 操作延迟10毫秒 */ private final int OPERATE_DELAY_TIME = 10; /** * 异步操作任务调度线程池 */ private ScheduledExecutorService executor = SpringUtil.getBean(ThreadPoolConfig.SCHEDULED_EXECUTOR_SERVICE_NAME); /** * 单例模式 */ private AsyncManager() { } private static AsyncManager me; static { me = new AsyncManager(); } public static AsyncManager me() { return me; } /** * 执行任务 * * @param task 任务 */ public void execute(TimerTask task) { executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); } /** * 停止任务线程池 */ public void shutdown() { ThreadsUtil.shutdownAndAwaitTermination(executor); } }
[ "xinlichao2016@gmail.com" ]
xinlichao2016@gmail.com
16d2b06790b29f2c8bc29166279a1dd55ad3144e
ac82c09fd704b2288cef8342bde6d66f200eeb0d
/projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/covariance/HistoricalCovarianceCalculator.java
25d57468a131419091454f5bcc925e8fe4a08b2c
[ "Apache-2.0" ]
permissive
cobaltblueocean/OG-Platform
88f1a6a94f76d7f589fb8fbacb3f26502835d7bb
9b78891139503d8c6aecdeadc4d583b23a0cc0f2
refs/heads/master
2021-08-26T00:44:27.315546
2018-02-23T20:12:08
2018-02-23T20:12:08
241,467,299
0
2
Apache-2.0
2021-08-02T17:20:41
2020-02-18T21:05:35
Java
UTF-8
Java
false
false
1,891
java
/** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.financial.covariance; import java.util.Iterator; import com.opengamma.timeseries.DoubleTimeSeries; import com.opengamma.util.ArgumentChecker; /** * Calculates the historical covariance of two return series. The covariance is * given by: * $$ * \begin{eqnarray*} * \frac{1}{n(n-1)}\sum\limits_{i=1}^n (x_i - \overline{x})(y_i - \overline{y}) * \end{eqnarray*} * $$ * where $x$ is the first return series, $y$ is the second return series and * $n$ is the number of data points. */ public class HistoricalCovarianceCalculator extends CovarianceCalculator { /** * Given two price time series, calculates their covariance * @param ts An array of price time series * @return The covariance of the price series * @throws IllegalArgumentException If the time series array is null; if the length of the time series array is not two; if the dates of the time series do not coincide. */ @Override public Double evaluate(final DoubleTimeSeries<?>... ts) { ArgumentChecker.notNull(ts, "time series array"); ArgumentChecker.isTrue(ts.length == 2, "must have two time series"); testTimeSeries(ts[0], ts[1]); final DoubleTimeSeries<?> returnTS1 = ts[0]; final DoubleTimeSeries<?> returnTS2 = ts[1]; final int n = returnTS1.size(); double xyMean = 0; double xMean = 0; double yMean = 0; final Iterator<Double> iter1 = returnTS1.valuesIterator(); final Iterator<Double> iter2 = returnTS2.valuesIterator(); double x, y; while (iter1.hasNext()) { x = iter1.next(); y = iter2.next(); xyMean += x * y; xMean += x; yMean += y; } xyMean /= n - 1; xMean /= n; yMean /= n; return xyMean - xMean * yMean; } }
[ "cobaltblue.ocean@gmail.com" ]
cobaltblue.ocean@gmail.com
d9dcdf34c5ba970143505d86a4bddaf2dfbbaede
39bef83f3a903f49344b907870feb10a3302e6e4
/Android Studio Projects/bf.io.openshop/src/com/google/android/gms/measurement/R$color.java
84c732b66c0844c3703aacf50650138095103037
[]
no_license
Killaker/Android
456acf38bc79030aff7610f5b7f5c1334a49f334
52a1a709a80778ec11b42dfe9dc1a4e755593812
refs/heads/master
2021-08-19T06:20:26.551947
2017-11-24T22:27:19
2017-11-24T22:27:19
111,960,738
0
0
null
null
null
null
UTF-8
Java
false
false
1,812
java
package com.google.android.gms.measurement; public static final class color { public static final int common_action_bar_splitter = 2131558450; public static final int common_google_signin_btn_text_dark = 2131558548; public static final int common_google_signin_btn_text_dark_default = 2131558451; public static final int common_google_signin_btn_text_dark_disabled = 2131558452; public static final int common_google_signin_btn_text_dark_focused = 2131558453; public static final int common_google_signin_btn_text_dark_pressed = 2131558454; public static final int common_google_signin_btn_text_light = 2131558549; public static final int common_google_signin_btn_text_light_default = 2131558455; public static final int common_google_signin_btn_text_light_disabled = 2131558456; public static final int common_google_signin_btn_text_light_focused = 2131558457; public static final int common_google_signin_btn_text_light_pressed = 2131558458; public static final int common_plus_signin_btn_text_dark = 2131558550; public static final int common_plus_signin_btn_text_dark_default = 2131558459; public static final int common_plus_signin_btn_text_dark_disabled = 2131558460; public static final int common_plus_signin_btn_text_dark_focused = 2131558461; public static final int common_plus_signin_btn_text_dark_pressed = 2131558462; public static final int common_plus_signin_btn_text_light = 2131558551; public static final int common_plus_signin_btn_text_light_default = 2131558463; public static final int common_plus_signin_btn_text_light_disabled = 2131558464; public static final int common_plus_signin_btn_text_light_focused = 2131558465; public static final int common_plus_signin_btn_text_light_pressed = 2131558466; }
[ "ema1986ct@gmail.com" ]
ema1986ct@gmail.com
bcafab2e4150f9feadaa5a9b83f6355fcd4220a2
d5d3ff3359c234c010ae84ff40755394b209724e
/Clients/RCP/Core/plugins/gov.pnnl.cat.core.resources/src/gov/pnnl/cat/core/resources/security/Group.java
bdfc613eb78e754452d7cea81d717bf6576b6639
[]
no_license
purohitsumit/velo
59f58f60f926d22af270e14c6362b26d9a3b3d59
bd5ee6b395b2f48e1d8db613d92f567c55f9e736
refs/heads/master
2020-05-03T05:36:07.610106
2018-10-31T22:14:43
2018-10-31T22:14:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,394
java
/******************************************************************************* * . * Velo 1.0 * ---------------------------------------------------------- * * Pacific Northwest National Laboratory * Richland, WA 99352 * * Copyright (c) 2013 * Pacific Northwest National Laboratory * Battelle Memorial Institute * * Velo is an open-source collaborative content management * and job execution environment * distributed under the terms of the * Educational Community License (ECL) 2.0 * A copy of the license is included with this distribution * in the LICENSE.TXT file * * ACKNOWLEDGMENT * -------------- * * This software and its documentation were developed at Pacific * Northwest National Laboratory, a multiprogram national * laboratory, operated for the U.S. Department of Energy by * Battelle under Contract Number DE-AC05-76RL01830. ******************************************************************************/ package gov.pnnl.cat.core.resources.security; import org.eclipse.core.internal.runtime.AdapterManager; import org.eclipse.core.runtime.IAdaptable; /** */ public class Group extends GroupImpl implements IAdaptable { //ZCG: copied from eclipse's PlatformObject class since we can only extend one class /** * Returns an object which is an instance of the given class * associated with this object. Returns <code>null</code> if * no such object can be found. * <p> * This implementation of the method declared by <code>IAdaptable</code> * passes the request along to the platform's adapter manager; roughly * <code>Platform.getAdapterManager().getAdapter(this, adapter)</code>. * Subclasses may override this method (however, if they do so, they * should invoke the method on their superclass to ensure that the * Platform's adapter manager is consulted). * </p> * * @param adapter the class to adapt to * @return the adapted object or <code>null</code> * @see IAdaptable#getAdapter(Class) */ public Object getAdapter(Class adapter) { return AdapterManager.getDefault().getAdapter(this, adapter); } }
[ "timothy.stavenger@pnnl.gov" ]
timothy.stavenger@pnnl.gov
43577f4ace527a049590799b3bc68d520a7afc36
275f942c6dbc2f58b54a56da0ad58c9c94641d21
/SDI/chat-multicast/sender.java
5d1012c3bc8a78348db52c5c07bd630023e8c734
[]
no_license
GuilhermeUtech/UDESC
2cab8979ea600eea55cc721b5cefdb39737f38b7
c51c8af3cbb976c2737a2d5093aef2638552216d
refs/heads/master
2021-05-18T14:32:59.532809
2020-03-30T11:30:32
2020-03-30T11:30:32
251,282,964
0
0
null
null
null
null
UTF-8
Java
false
false
911
java
import java.io.*; import java.net.*; public class Sender{ final int PORT = 8888; socket = new DatagramSocket(); /*Socket usado para enviar socket.send()*/ String mensagem; int contador = -1; byte[] buffer; public static void main(String[] args){ while(true){ contador++; mensagem = "Mensagem: BLABLA " + contador; /*transformar a mensagem em bytes*/ buffer = mensagem.getBytes(); /*representação de endereço ip com InetAdress, o endereço IP que eu coloquei foi por causa do tutorial, não sei o que tem que por ali ainda*/ InetAddres enderecoIP = InetAddres.getByName("224.0.0.2"); DatagramSocket pacoteSaida = new DatagramSocket(buffer, buffer.length, endereço, PORT); /*Datagrama criado com o conteúdo em bytes da saida, o tamanho do conteúdo, o endereço ip e a porta*/ socket.send(pacoteSaida); System.out.println("Conteúdo saida: " mensagem); } } }
[ "=" ]
=
7caba8fccb099a0f2731e0db33614cfb797ea208
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
/ast_results/nikclayton_android-squeezer/Squeezer/src/main/java/uk/org/ngo/squeezer/Squeezer.java
3680a248f2d36f076b2cdc5a50c71b32127ac3eb
[]
no_license
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
0564143d92f8024ff5fa6b659c2baebf827582b1
refs/heads/master
2020-07-13T13:53:40.297493
2019-01-11T11:51:18
2019-01-11T11:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
605
java
// isComment package uk.org.ngo.squeezer; import android.app.Application; import android.content.Context; import com.crashlytics.android.Crashlytics; import io.fabric.sdk.android.Fabric; public class isClassOrIsInterface extends Application { private static Squeezer isVariable; public isConstructor() { isNameExpr = this; } public static Context isMethod() { return isNameExpr; } @Override public void isMethod() { super.isMethod(); if (isNameExpr.isMethod()) { isNameExpr.isMethod(this, new Crashlytics()); } } }
[ "matheus@melsolucoes.net" ]
matheus@melsolucoes.net
2915cc84de72f330509edd1babf55fda9273cdea
79e4c59c86b8e5d3462ffd130406f5129603163e
/pactyw/src/main/java/com/hch/platform/pactyw/modules/actyw/tool/process/gnodcmd/IGnode.java
5962fdbee5ed060e53a7bae198aafb2d369d2b3e
[]
no_license
SchuckBeta/h-platform
fe29f2676bcb53d811c5091898753ea1d84bbfe6
7f66899f413d92ca2a40dc2e6257421375b42dbb
refs/heads/master
2021-09-01T19:35:45.594711
2017-12-28T12:42:12
2017-12-28T12:42:12
115,348,261
0
0
null
null
null
null
UTF-8
Java
false
false
1,586
java
package com.oseasy.initiate.modules.actyw.tool.process.gnodcmd; import java.util.List; import com.oseasy.initiate.modules.actyw.tool.process.cmd.ActYwRstatus; import com.oseasy.initiate.modules.actyw.tool.process.vo.GnodeType; /** * 节点实体. * @author chenhao * */ public interface IGnode<T> { /** * 获取节点类型. * @return GnodeType */ public GnodeType getGnodeType(); /** * 前置节点初始化. * @return T */ public ActYwRstatus<T> initPreGnode(T gnode); /** * 后置节点初始化. * @return T */ public ActYwRstatus<T> initNextGnode(T gnode); /** * 前置业务节点初始化. * @return T */ public ActYwRstatus<T> initPreFunGnode(T gnode); /** * 后置业务节点初始化. * @return T */ public ActYwRstatus<T> initNextFunGnode(T gnode); /** * 当前节点初始化. * @return T */ public ActYwRstatus<T> initCurrentGnode(T gnode); /** * 父节点初始化. * @return T */ public ActYwRstatus<T> initParentGnode(T gnode); /** * 所有前置节点. * @return T */ public ActYwRstatus<T> initPreGnodes(T gnode); /** * 所有后置节点. * @return T */ public ActYwRstatus<T> initNextGnodes(T gnode); /** * 所有前置节点. * @return T */ public List<ActYwRstatus<T>> initPreFunGnodes(T gnode); /** * 所有后置节点. * @return T */ public List<ActYwRstatus<T>> initNextFunGnodes(T gnode); /** * 所有子节点. * @return T */ public List<ActYwRstatus<T>> initChildGnodes(T gnode); }
[ "13580366759@163.com" ]
13580366759@163.com
8c10f42220be4d8986143235c4f79b945128b856
a52d6bb42e75ef0678cfcd291e5696a9e358fc4d
/af_webapp/src/main/java/org/kuali/kfs/module/endow/web/struts/EndowmentReportBaseAction.java
2ae76e1c18d71cceeea9868bdca40fe37693825a
[]
no_license
Ariah-Group/Finance
894e39cfeda8f6fdb4f48a4917045c0bc50050c5
ca49930ca456799f99aad57e1e974453d8fe479d
refs/heads/master
2021-01-21T12:11:40.987504
2016-03-24T14:22:40
2016-03-24T14:22:40
26,879,430
0
0
null
null
null
null
UTF-8
Java
false
false
1,962
java
/* * Copyright 2011 The Kuali Foundation. * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * 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.kuali.kfs.module.endow.web.struts; import java.util.Arrays; import java.util.List; import org.apache.commons.lang.StringUtils; import org.kuali.rice.kns.web.struts.action.KualiAction; public abstract class EndowmentReportBaseAction extends KualiAction { protected final char KEMID_SEPERATOR = '&'; protected final char OTHER_CRITERIA_SEPERATOR = ','; public final String ERROR_REPORT_KEMID_WITH_OTHER_CRITERIA = "The use of the KEMID as a selection criterion cannot be used in combination with any orther selection criteria."; public final String ERROR_REPORT_ENDING_DATE_NOT_GREATER_THAN_BEGINNING_DATE = "The ending date must be greater than the beginning date."; public final String ERROR_BOTH_BEGINNING_AND_ENDING_DATE_REQUIRED = "Both Beginning Date and Ending Date are required."; /** * Parses the string value, which can include wild cards or separators * * @param valueString * @param separater * @return */ public List<String> parseValueString(String valueString, char separater) { List<String> values = null; if (StringUtils.isNotBlank(valueString)) { values = Arrays.asList(StringUtils.split(valueString.trim().toUpperCase(), separater)); } return values; } }
[ "code@ariahgroup.org" ]
code@ariahgroup.org
4e45cc1f2aa297a1f40f11b3a6bcd46171453ee4
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
/tags/2008-01-18/seasar2-2.4.21/seasar2/s2-extension/src/main/java/org/seasar/extension/jdbc/BatchHandler.java
9f281ab069144f5168ffd0c8ac60a8997a3ba499
[ "Apache-2.0" ]
permissive
svn2github/s2container
54ca27cf0c1200a93e1cb88884eb8226a9be677d
625adc6c4e1396654a7297d00ec206c077a78696
refs/heads/master
2020-06-04T17:15:02.140847
2013-08-09T09:38:15
2013-08-09T09:38:15
10,850,644
0
1
null
null
null
null
UTF-8
Java
false
false
2,139
java
/* * Copyright 2004-2008 the Seasar Foundation and the Others. * * 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.seasar.extension.jdbc; import java.util.List; import org.seasar.framework.exception.SQLRuntimeException; /** * 一つのSQLに複数のパラメータを適用してバッチ実行するためのインターフェースです。 * <p> * バッチ実行された各SQLが挿入/更新/削除した行数の配列を取得する場合は{@link ReturningRowsBatchHandler}を使用してください。 * </p> * * @author higa * @see ReturningRowsBatchHandler */ public interface BatchHandler { /** * 一つのSQLに複数のパラメータを適用してバッチ実行します。 * * @param list * バッチ実行する各SQLに渡されるパラメータの配列からなるリスト * @return バッチ実行した数 * @throws SQLRuntimeException * SQL例外が発生した場合 */ int execute(List list) throws SQLRuntimeException; /** * 一つのSQLに複数のパラメータを適用してバッチ実行します。 * * @param list * バッチ実行する各SQLに渡されるパラメータの配列からなるリスト * @param argTypes * パラメータのタイプの配列 * @return バッチ実行した数 * @throws SQLRuntimeException * SQL例外が発生した場合 */ int execute(List list, Class[] argTypes) throws SQLRuntimeException; }
[ "koichik@319488c0-e101-0410-93bc-b5e51f62721a" ]
koichik@319488c0-e101-0410-93bc-b5e51f62721a
267e214f1cd2c49fed622f077b02c879885c7472
929d704f27615532f68566055f10fb37a51df554
/drylining/src/main/java/com/app/drylining/adapter/RecentlyAddedJobAdepter.java
a1ca09e0de16438e3d27f523f28273fb59d44761
[]
no_license
saubhagyamapps/drylining-final
5d9fce6fe7e058a70d7565d185393bc670721b81
cbf4c17b92558959e19e29b9789d76482ea0ea82
refs/heads/master
2021-10-15T23:01:42.841159
2019-02-06T10:29:57
2019-02-06T10:29:57
167,315,768
0
0
null
null
null
null
UTF-8
Java
false
false
7,690
java
package com.app.drylining.adapter; import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.app.drylining.R; import com.app.drylining.custom.AppDebugLog; import com.app.drylining.custom.ItemClickListener; import com.app.drylining.data.ApplicationData; import com.app.drylining.data.Offer; import com.app.drylining.model.RecentlyAddedJobModel; import com.app.drylining.ui.AddedOfferDetailActivity; import com.app.drylining.ui.SearchedOfferDetailActivity; import java.util.ArrayList; import java.util.List; public class RecentlyAddedJobAdepter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private ApplicationData appData; private static final int ITEM = 0; private static final int LOADING = 1; RecentlyAddedJobModel.ResultBean result; private List<RecentlyAddedJobModel.ResultBean> dataBean; private Context mContext; private boolean isLoadingAdded = false; public RecentlyAddedJobAdepter(Context mContext) { appData = ApplicationData.getSharedInstance(); this.mContext = mContext; dataBean = new ArrayList<>(); } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { RecyclerView.ViewHolder viewHolder = null; LayoutInflater inflater = LayoutInflater.from(parent.getContext()); switch (viewType) { case ITEM: viewHolder = getViewHolder(parent, inflater); break; case LOADING: View v2 = inflater.inflate(R.layout.item_progress, parent, false); viewHolder = new LoadingVH(v2); break; } return viewHolder; } @NonNull private RecyclerView.ViewHolder getViewHolder(ViewGroup parent, LayoutInflater inflater) { RecyclerView.ViewHolder viewHolder; View v1 = inflater.inflate(R.layout.cell_searched_offers, parent, false); viewHolder = new MovieVH(v1); return viewHolder; } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { result = dataBean.get(position); switch (getItemViewType(position)) { case ITEM: final MovieVH movieVH = (MovieVH) holder; // movieVH.txtQoutes.setText(result.getQuotes()); //Offer offer = arrayList.get(position); movieVH.txtNotifications.setVisibility(View.VISIBLE); if (result != null) { movieVH.mainLayout.setTag(result); movieVH.txtOfferName.setText(result.getName()); movieVH.txtRoomType.setText(result.getWork_type()); movieVH.txtPrice.setText(result.getCurrency_type() + " " + result.getPrice()); movieVH.txtCity.setText(result.getPostcity()); movieVH.txtInterested.setText(result.getMy_state()); if (result.getConversation_count() > 0) { // holder.txtNotifications.setText(String.valueOf(offer.getConversations())); if (0 > 0) { movieVH.imgMsgIcon.setImageResource(R.drawable.ic_mail_dark); movieVH.txtNotifications.setTextColor(mContext.getResources().getColor(R.color.black)); } else { movieVH.imgMsgIcon.setImageResource(R.drawable.ic_mail_gray_cc); movieVH.txtNotifications.setTextColor(mContext.getResources().getColor(R.color.color_gray_99)); } } else { movieVH.txtNotifications.setVisibility(View.GONE); movieVH.imgMsgIcon.setVisibility(View.GONE); } movieVH.mainLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ClickJob(dataBean.get(position)); } }); } break; case LOADING: break; } } private void ClickJob(RecentlyAddedJobModel.ResultBean resultBean) { // Offer offer = (Offer) view.getTag(); // int offerId = offer.getId(); if (resultBean.getUser_id().equals(appData.getUserId())) { Intent intent = new Intent(mContext, AddedOfferDetailActivity.class); intent.putExtra("OfferID", resultBean.getId()); intent.putExtra("BackActivityName", "SearchAcivity"); AppDebugLog.println("Search OfferID" + resultBean.getId()); mContext.startActivity(intent); } else { Intent intent = new Intent(mContext, SearchedOfferDetailActivity.class); intent.putExtra("OfferID", resultBean.getId()); intent.putExtra("BackActivityName", "SearchAcivity"); AppDebugLog.println("Search OfferID" + resultBean.getId()); mContext.startActivity(intent); } } @Override public int getItemCount() { return dataBean == null ? 0 : dataBean.size(); } @Override public int getItemViewType(int position) { return (position == dataBean.size() - 1 && isLoadingAdded) ? LOADING : ITEM; } public void add(RecentlyAddedJobModel.ResultBean r) { dataBean.add(r); notifyItemInserted(dataBean.size() - 1); } public void addAll(List<RecentlyAddedJobModel.ResultBean> Results) { for (RecentlyAddedJobModel.ResultBean result : Results) { add(result); } } public void addLoadingFooter() { isLoadingAdded = true; add(new RecentlyAddedJobModel.ResultBean()); } public void removeLoadingFooter() { isLoadingAdded = false; int position = dataBean.size() - 1; RecentlyAddedJobModel.ResultBean result = getItem(position); if (result != null) { dataBean.remove(position); notifyItemRemoved(position); } } public RecentlyAddedJobModel.ResultBean getItem(int position) { return dataBean.get(position); } protected class MovieVH extends RecyclerView.ViewHolder { private ItemClickListener clickListener; private RelativeLayout mainLayout; private TextView txtOfferName, txtRoomType, txtPrice, txtCity, txtInterested, txtNotifications; private ImageView propertyImage, imgMsgIcon; public MovieVH(View v) { super(v); mainLayout = (RelativeLayout) v.findViewById(R.id.mainLayout); txtOfferName = (TextView) v.findViewById(R.id.offer_name); txtRoomType = (TextView) v.findViewById(R.id.txt_offer_type); txtPrice = (TextView) v.findViewById(R.id.txt_price); txtCity = (TextView) v.findViewById(R.id.txt_city); txtInterested = (TextView) v.findViewById(R.id.txt_interest); txtNotifications = (TextView) v.findViewById(R.id.txt_notification); imgMsgIcon = (ImageView) v.findViewById(R.id.img_msg_marker); } } protected class LoadingVH extends RecyclerView.ViewHolder { public LoadingVH(View itemView) { super(itemView); } } }
[ "keshuvodedara@gmail.com" ]
keshuvodedara@gmail.com
e1fdc98696c994688370ff3c14b1f86442e0cf90
104021100d30ecfd355fbb19e969b93dff30dd10
/src/test/java/com/u2ware/springfield/controller/test1/SpringfieldPaginationTest.java
86ec99d958d7045a1c6103aa33d9d6a6c1b3d0e5
[ "Apache-2.0" ]
permissive
12bme/springfield
d3364a9f4d618ed6c1718b8f7b3d16f8d7f07508
9c229107ae8b430ebdf65cea62ab508a605c5ffd
refs/heads/master
2021-01-25T00:47:19.582206
2015-10-20T04:23:59
2015-10-20T04:23:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,313
java
package com.u2ware.springfield.controller.test1; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import com.u2ware.springfield.AbstractContextWebmvcTestRoot; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration @WebAppConfiguration public class SpringfieldPaginationTest extends AbstractContextWebmvcTestRoot{ @Test public void test() throws Exception{ this.mockMvc.perform(get("/controller/test1") //.param("model_query_pageable.pageEnable", "false") .param("model_query_pageable.pageNumber", "0") .param("model_query_pageable.pageSize", "1") .param("model_query_pageable.pageSort", "age,desc") .param("model_query_pageable.pageSort", "name") //.param("model_query_pageable.sort.dir", "desc") ) .andDo(print()) .andExpect(status().isOk()); } }
[ "u2waremanager@gmail.com" ]
u2waremanager@gmail.com
c08ed7289f1dac52bbfaa0c24aca15d2f623fbb9
fa2d84d1fd00ee5ffd0cb85808dce6f0d909d204
/zava/src/main/java/hdgl/db/store/impl/hdfs/HdfsGraphStore.java
b51b84b5cfaa34611c13ec34f92821f900fccf04
[]
no_license
hbwzhsh/tutorials
8ad70095fa9c4a5d3f2ca27a98afe404a1e0101c
02d0f97da44e71f3fd47def8010611796efce3e8
refs/heads/master
2021-01-18T00:58:05.822652
2015-05-29T08:28:26
2015-05-29T08:28:26
36,609,864
1
0
null
2015-05-31T15:42:17
2015-05-31T15:42:17
null
UTF-8
Java
false
false
7,823
java
package hdgl.db.store.impl.hdfs; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.Comparator; import java.util.HashSet; import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.BlockLocation; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import hdgl.db.conf.GraphConf; import hdgl.db.graph.Edge; import hdgl.db.graph.HGraphIds; import hdgl.db.graph.Vertex; import hdgl.db.store.GraphStore; import hdgl.db.store.HConf; import hdgl.db.store.impl.hdfs.mapreduce.EdgeInputStream; import hdgl.db.store.impl.hdfs.mapreduce.FSDataInputStreamPool; import hdgl.db.store.impl.hdfs.mapreduce.HEdge; import hdgl.db.store.impl.hdfs.mapreduce.HFullPseudoEdge; import hdgl.db.store.impl.hdfs.mapreduce.HPseudoVertex; import hdgl.db.store.impl.hdfs.mapreduce.HVertex; import hdgl.db.store.impl.hdfs.mapreduce.Parameter; import hdgl.db.store.impl.hdfs.mapreduce.VertexInputStream; import hdgl.util.NetHelper; import hdgl.util.StringHelper; public class HdfsGraphStore implements GraphStore { static class PrefixPathFilter implements PathFilter{ String prefix; public PrefixPathFilter(String prefix) { super(); this.prefix = prefix; } @Override public boolean accept(Path path) { return path.getName().startsWith(prefix); } } static class SuffixComparator implements Comparator<FileStatus>{ public static final SuffixComparator I = new SuffixComparator(); @Override public int compare(FileStatus o1, FileStatus o2) { return o1.getPath().getName().compareTo(o2.getPath().getName()); } } //vertex fixed length file FileStatus[] v_f; //vertex vary length file FileStatus[] v_v; //edge fixed length file FileStatus[] e_f; //edge vary length file FileStatus[] e_v; FileSystem fs; Configuration conf; int vtrunkSize; int etrunkSize; long vcount; long ecount; long vcountPerBlock; long ecountPerBlock; public HdfsGraphStore(Configuration conf) throws IOException{ this.conf = conf; String root = GraphConf.getPersistentGraphRoot(conf); fs = HConf.getFileSystem(conf); vtrunkSize = GraphConf.getVertexTrunkSize(conf); etrunkSize = GraphConf.getEdgeTrunkSize(conf); Path rootPath = new Path(root); v_f = fs.listStatus(rootPath, new PrefixPathFilter(Parameter.VERTEX_REGULAR_FILE_NAME)); v_v = fs.listStatus(rootPath, new PrefixPathFilter(Parameter.VERTEX_IRREGULAR_FILE_NAME)); e_f = fs.listStatus(rootPath, new PrefixPathFilter(Parameter.EDGE_REGULAR_FILE_NAME)); e_v = fs.listStatus(rootPath, new PrefixPathFilter(Parameter.EDGE_IRREGULAR_FILE_NAME)); Arrays.sort(v_f, 0, v_f.length, SuffixComparator.I); Arrays.sort(v_v, 0, v_v.length, SuffixComparator.I); Arrays.sort(e_f, 0, e_f.length, SuffixComparator.I); Arrays.sort(e_v, 0, e_v.length, SuffixComparator.I); long len=0; for(FileStatus f:v_f){ len+=f.getLen(); } vcount = len/vtrunkSize; len=0; for(FileStatus f:e_f){ len+=f.getLen(); } ecount = len/etrunkSize; } public InputStream getVertexData(long id) throws IOException { VertexInputStream eis = new VertexInputStream(id, conf); return eis; // long seekPos = (id - 1) * vtrunkSize; // return new JumpInputStream(v_f, v_v, seekPos, vtrunkSize, fs); } public InputStream getEdgeData(long id) throws IOException { EdgeInputStream eis = new EdgeInputStream(id, conf); return eis; //long seekpos = (-id - 1) * etrunkSize; //return new JumpInputStream(e_f, e_v, seekpos, etrunkSize, fs); } public hdgl.db.graph.Vertex parseVertex(long id) throws IOException { VertexInputStream vis = null; try{ vis = (VertexInputStream)getVertexData(id); HVertex v = new HVertex(-vis.readInt(), "", this); int outNum, edge, vertex, inNum, num; outNum = vis.readInt(); inNum = vis.readInt(); for (int i = 0; i < outNum; i++) { edge = -vis.readInt(); vertex = -vis.readInt(); v.addOutEdge(edge, vertex); } for (int i = 0; i < inNum; i++) { edge = -vis.readInt(); vertex = -vis.readInt(); v.addInEdge(edge, vertex); } num = vis.readInt(); int len; for (int i = 0; i < num; i++) { len = vis.readInt(); byte[] b = new byte[len]; String key = null, value = null; if (len == vis.read(b)) { key = new String(b); } len = vis.readInt(); b = new byte[len]; if (len == vis.read(b)) { value = new String(b); } if (!(key.length() == 0)) { if (key.compareTo("type") == 0) { v.setType(new String(StringHelper.stringToBytes(value))); } else { v.addLabel(key, StringHelper.stringToBytes(value)); } } } return v; }finally{ if(vis!=null){ vis.close(); } } } public hdgl.db.graph.Edge parseEdge(long id) throws IOException { EdgeInputStream eis = null; try{ eis = (EdgeInputStream)getEdgeData(id); int eid, v1, v2; eid = -eis.readInt(); v1 = -eis.readInt(); v2 = -eis.readInt(); HEdge e = new HEdge(eid, "", v1, v2, this); int num; num = eis.readInt(); int len; for (int i = 0; i < num; i++) { len = eis.readInt(); byte[] b = new byte[len]; String key = null, value = null; if (len == eis.read(b)) { key = new String(b); } len = eis.readInt(); b = new byte[len]; if (len == eis.read(b)) { value = new String(b); } if (!(key.length() == 0)) { if (key.compareTo("type") == 0) { e.setType(new String(StringHelper.stringToBytes(value))); } else { e.addLabel(key, StringHelper.stringToBytes(value)); } } } return e; }finally{ if(eis!=null){ eis.close(); } } } @Override public String[] bestPlacesForVertex(long vId) throws IOException { vId = HGraphIds.extractEntityId(vId); long offset= vId * vtrunkSize; int nthfile=0; while (v_f[nthfile].getLen()<offset) { offset -= v_f[nthfile].getLen(); nthfile++; if(nthfile>=v_f.length){ return new String[0]; } } BlockLocation[] locs = fs.getFileBlockLocations(v_f[nthfile], offset, vtrunkSize); Set<String> hosts=new HashSet<String>(); for(BlockLocation loc:locs){ for(String host:loc.getHosts()){ hosts.add(host.equals("localhost")?NetHelper.getMyHostName():host); } } return hosts.toArray(new String[0]); } @Override public String[] bestPlacesForEdge(long entityId) throws IOException { entityId = HGraphIds.extractEntityId(entityId); long offset= entityId * etrunkSize; int nthfile=0; while (e_f[nthfile].getLen()<offset) { offset -= e_f[nthfile].getLen(); nthfile++; if(nthfile>=e_f.length){ return new String[0]; } } BlockLocation[] locs = fs.getFileBlockLocations(e_f[nthfile], offset, etrunkSize); Set<String> hosts = new HashSet<String>(); for(BlockLocation loc:locs){ for(String host:loc.getHosts()){ hosts.add(host); } } return hosts.toArray(new String[0]); } @Override public long getVertexCount() throws IOException { return vcount; } @Override public long getEdgeCount() throws IOException { return ecount; } @Override public long getVertexCountPerBlock() throws IOException { return v_f[0].getBlockSize()/vtrunkSize; } @Override public long getEdgeCountPerBlock() throws IOException { return e_f[0].getBlockSize()/etrunkSize; } @Override public void close() { try{ fs.close(); FSDataInputStreamPool.close(); }catch(Exception ex){ } } @Override public Vertex getVertex(long id) throws IOException { return new HPseudoVertex(id, this); } @Override public Edge getEdge(long id) throws IOException { return new HFullPseudoEdge(id, this); } }
[ "zqhxuyuan@gmail.com" ]
zqhxuyuan@gmail.com
655fc8c5957072f929102c86d9af03729e03c071
fec55270c9b8b54bdb19ac7bdc19b7d709f355eb
/src/menuTypeTableManager.java
38d12f730cdcc9b62ba816bb40a81ffff349a8af
[]
no_license
aschilders/Order-Entry-System
63119bfa465a405e06804c5717be5fd66c5f6890
46d2f4f2199afe4012f90ed7f6d3b3dcf9c4d791
refs/heads/master
2020-11-28T12:12:40.854704
2019-12-23T19:20:29
2019-12-23T19:20:29
229,809,937
0
0
null
null
null
null
UTF-8
Java
false
false
3,955
java
import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class menuTypeTableManager { // create a named constant for the DB URL we use to access our db using JDBC public final String DB_URL = "jdbc:ucanaccess://childers_milestone.accdb" ; // field to hold a pointer to our db connection private static Connection conn; public menuTypeTableManager() throws SQLException { conn = DriverManager.getConnection(DB_URL); } // select recrods based on a search criteria entered by the user. // this search/select will be parameterized based on values user enters // ADD POSITIONS/COMBO BOX public static ResultSet selectUsers(String strCategory) throws SQLException { // since we have a number (dblHR) that cannot search correctly using the like commane, // this variable will be used to hold the addon variable if necessary // create the SQL statement, note how we concatenate the strAddOn whether we need it or not // Not needed for strings since the like command finds all results when the search field blank // week 12 String ourSQLSelect = "SELECT" + " m.menutypekey AS ID, " + " m.menutype AS Category " + "FROM menutype m " + "WHERE " + " menutype LIKE ?"; // create our prepared statement PreparedStatement prepStmt = conn.prepareStatement(ourSQLSelect); // our prepared statement had placeholders (?) we need to fill in in order to execute our query prepStmt.setString(1, "%" + strCategory + "%" ); // execute the query ResultSet userResults = prepStmt.executeQuery(); return userResults; } public static ResultSet selectUpdate(int catID) throws SQLException { // create sql statement to select a record based on the passed in intID String ourSQLSelect = "SELECT" + " menutypekey AS ID , " + " menutype AS Category " + " FROM menutype " + " WHERE menutypekey = ? "; // create a prepared statement PreparedStatement prepStmt = conn.prepareStatement(ourSQLSelect); // insert the variables to our prepstmt prepStmt.setInt(1, catID); ResultSet userResults = prepStmt.executeQuery(); return userResults; } public int insertRecord(String strCategory) throws SQLException { // this method allows us to insert a record into our usertable in testdb int rows = 0; String ourSQLInsert = "INSERT INTO menutype " + " (menutype) " + " VALUES ( ?) " ; // create a prepared statement object PreparedStatement prepStmt = conn.prepareStatement(ourSQLInsert); // pass parameters to our prepared statement prepStmt prepStmt.setString( 1, strCategory); // execute the insert rows = prepStmt.executeUpdate(); prepStmt.close(); return rows; } public int updateRecord (String strCategory, int catID) throws SQLException { int rows = 0; String ourSQLUpdate = "UPDATE menutype " + " SET " + " menutype = ? " + " WHERE menutypekey = ? "; // create a prepared statement PreparedStatement prepStmt = conn.prepareStatement(ourSQLUpdate); // set our parms prepStmt.setString( 1, strCategory); prepStmt.setInt(2, catID); // execute the insert rows = prepStmt.executeUpdate(); prepStmt.close(); return rows; } public int deleteRecord(int catID) throws SQLException { // variable to hold rows affected int rows = 0; // build our delete statement String ourSQLDelete = "DELETE FROM menutype " + "WHERE menutypekey = ? " ; // prepare our statment PreparedStatement prepStmt = conn.prepareStatement(ourSQLDelete); // set our parms prepStmt.setInt(1, catID); // get rows from delete rows = prepStmt.executeUpdate(); prepStmt.close(); // return the number of rows affected return rows; } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
5fa301a5a9a32c3a49b9bfe529dbfb13aae8197b
1275e4b98a8dbd61053ebeee6433719248bff988
/src/main/java/com/flea/modules/report/pojo/CatalogueReport.java
e6fcdcb9456688d14fe54a507d1d8a185e6ceab7
[]
no_license
zmiraclej/LibraryOMS
98c480dc5d0ea8617826a3e08b98b06f2aa443bc
c3ffa73b7a33ec93fecdc7c068c5655305d3a06b
refs/heads/master
2021-05-10T21:30:37.158091
2018-01-20T09:46:31
2018-01-20T09:52:20
118,229,684
0
0
null
null
null
null
UTF-8
Java
false
false
2,192
java
package com.flea.modules.report.pojo; import java.io.Serializable; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Date; /** * 藏书、编目统计视图 * @author wq * */ public class CatalogueReport implements Serializable { /** * */ private static final long serialVersionUID = 4979435552981022398L; // 馆号 private String hallCode; // 官名 private String name; // 日期 private Date catalogueDate; // 单号 private String catalogueCode; // 册数 private BigInteger count; // 码洋 private double price; // 操作员 private String userName; // 集合总数 private String sumNumber; // 身份证号 private String idCard; public String getIdCard() { return idCard; } public void setIdCard(String idCard) { this.idCard = idCard; } public String getSumNumber() { return sumNumber; } public void setSumNumber(String sumNumber) { this.sumNumber = sumNumber; } public Date getCatalogueDate() { return catalogueDate; } public void setCatalogueDate(Date catalogueDate) { this.catalogueDate = catalogueDate; } public String getCatalogueCode() { return catalogueCode; } public void setCatalogueCode(String catalogueCode) { this.catalogueCode = catalogueCode; } public String getHallCode() { return hallCode; } public void setHallCode(String hallCode) { this.hallCode = hallCode; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getPrice() { return price; } public void setPrice(Double price) { if (price == null) { price = (double) 0; } this.price = price; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public BigInteger getCount() { return count; } public void setCount(BigInteger count) { this.count = count; } @Override public String toString() { return "CatalogueReport [hallCode=" + hallCode + ", name=" + name + ", catalogueDate=" + catalogueDate + ", catalogueCode=" + catalogueCode + ", count=" + count + ", price=" + price + ", userName=" + userName + ", sumNumber=" + sumNumber + "]"; } }
[ "3507373533@qq.com" ]
3507373533@qq.com