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
73a14c059bdc31bece633c90bab8bed63c8acbdc
1b1c6749437db05f7736271266c090cf24f3c3fd
/diozero-provider-mmap/src/main/java/com/diozero/internal/provider/mmap/MmapDigitalOutputDevice.java
a416844a0e6e13b41a104865688b21d7f8e20494
[ "MIT" ]
permissive
heeem321/diozero
c44a8121df5322838ae20144e514d788ca1b0693
c043b1295d2c1845e932b93493ef8f871ca0a0b5
refs/heads/master
2021-01-01T05:54:55.096060
2017-07-14T13:09:10
2017-07-14T13:09:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,773
java
package com.diozero.internal.provider.mmap; /* * #%L * Organisation: mattjlewis * Project: Device I/O Zero - High performance mmap GPIO control * Filename: MmapDigitalOutputDevice.java * * This file is part of the diozero project. More information about this project * can be found at http://www.diozero.com/ * %% * Copyright (C) 2016 - 2017 mattjlewis * %% * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * #L% */ import org.pmw.tinylog.Logger; import com.diozero.api.DeviceMode; import com.diozero.api.PinInfo; import com.diozero.internal.provider.AbstractDevice; import com.diozero.internal.provider.GpioDigitalOutputDeviceInterface; import com.diozero.util.RuntimeIOException; public class MmapDigitalOutputDevice extends AbstractDevice implements GpioDigitalOutputDeviceInterface { private MmapGpioInterface mmapGpio; private int gpio; MmapDigitalOutputDevice(MmapDeviceFactory deviceFactory, String key, PinInfo pinInfo, boolean initialValue) { super(key, deviceFactory); this.mmapGpio = deviceFactory.getMmapGpio(); this.gpio = pinInfo.getDeviceNumber(); mmapGpio.setMode(gpio, DeviceMode.DIGITAL_OUTPUT); mmapGpio.gpioWrite(gpio, initialValue); } @Override public int getGpio() { return gpio; } @Override public boolean getValue() throws RuntimeIOException { return mmapGpio.gpioRead(gpio); } @Override public void setValue(boolean value) throws RuntimeIOException { mmapGpio.gpioWrite(gpio, value); } @Override protected void closeDevice() { Logger.debug("closeDevice()"); // FIXME No GPIO close method? // TODO Revert to default input mode? // What do wiringPi / pigpio do? } }
[ "matthew.lewis@btinternet.com" ]
matthew.lewis@btinternet.com
17d145b0193ac8060f19dc070f31d1cdde9e4aa2
47034e7fcb058b3df4bf5928455951e5f455897e
/archive/mbeanclient/src/main/java/me/hatter/tools/mbeanclient/console/CommandLine.java
4beb0f6bed8ec98eb9a0a01819568c2efaece3e1
[]
no_license
KingBowser/hatter-source-code
2858a651bc557e3aacb4a07133450f62dc7a15c6
f10d4f0ec5f5adda1baa942e179f76301ebc328a
refs/heads/master
2021-01-01T06:49:52.889183
2015-03-21T17:00:28
2015-03-21T17:00:28
32,662,581
3
1
null
null
null
null
UTF-8
Java
false
false
3,163
java
package me.hatter.tools.mbeanclient.console; import java.util.HashMap; import java.util.Map; public class CommandLine { public static interface CommandHandle { CommandResult handle(ParsedCommand cmd); } public static enum CommandResult { SUCCESS, ERROR, PARSE_FAILED; } public static class ParsedCommand { private String raw; private String prefix; private String subCommand; public ParsedCommand(String raw, String prefix, String subCommand) { this.raw = raw; this.prefix = prefix; this.subCommand = subCommand; } public String getRaw() { return raw; } public void setRaw(String raw) { this.raw = raw; } public String getPrefix() { return prefix; } public void setPrefix(String prefix) { this.prefix = prefix; } public String getSubCommand() { return subCommand; } public void setSubCommand(String subCommand) { this.subCommand = subCommand; } } public CommandLine() { register("exit", new CommandHandle() { public CommandResult handle(ParsedCommand cmd) { System.out.println("Bye!"); System.exit(0); return CommandResult.SUCCESS; } }); register("help", new CommandHandle() { public CommandResult handle(ParsedCommand cmd) { System.out.println("Command list:"); for (String c : commandHandleMap.keySet()) { System.out.println(" " + c); } return CommandResult.SUCCESS; } }); } private Map<String, CommandHandle> commandHandleMap = new HashMap<String, CommandLine.CommandHandle>(); public void register(String prefix, CommandHandle handle) { commandHandleMap.put(prefix, handle); } public void start() { while (true) { System.out.print("java$ "); String cmd = System.console().readLine(); cmd = cmd.trim(); if (!cmd.isEmpty()) { ParsedCommand command = parseCommand(cmd); CommandHandle handle = commandHandleMap.get(command.getPrefix()); if (handle == null) { System.out.println("Unknow command!"); continue; } CommandResult result = handle.handle(command); if (result == CommandResult.PARSE_FAILED) { System.out.println("Unknow subcommand!"); } } } } public ParsedCommand parseCommand(String cmd) { int firstSpace = cmd.indexOf(' '); if (firstSpace < 0) { return new ParsedCommand(cmd, cmd, null); } String prefix = cmd.substring(0, firstSpace).toLowerCase().trim(); String subCommand = cmd.substring(firstSpace + 1); return new ParsedCommand(cmd, prefix, subCommand); } }
[ "jht5945@gmail.com@dd6f9e7e-b4fe-0bd6-ab9c-0ed876a8e821" ]
jht5945@gmail.com@dd6f9e7e-b4fe-0bd6-ab9c-0ed876a8e821
7ba2e6503b20e084620e185ed64d098e917e03ca
f28c3fae2b66f542a2d441b3950e960607d65ca3
/src/main/java/cz/cvut/fit/mi_mpr_dip/admission/validation/PrincipalValidator.java
123b243a2fa6bc8289e968557d5c7f692e45b94a
[]
no_license
janondrusek/MI-MPR-DIP-Admission
c4a642f9ee912e172338cba21ea931bfe1d6f910
761ee5c1c9905e3a8db1581178c8279b74b1553d
refs/heads/master
2021-10-12T00:23:31.524336
2012-11-10T14:03:24
2012-11-10T14:03:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,280
java
package cz.cvut.fit.mi_mpr_dip.admission.validation; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Required; import org.springframework.roo.addon.javabean.RooJavaBean; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.core.context.SecurityContextHolderStrategy; import cz.cvut.fit.mi_mpr_dip.admission.exception.BusinessException; @RooJavaBean public class PrincipalValidator { private SecurityContextHolderStrategy securityContextHolderStrategy; public void validatePrincipal(String username) { if (isNotEqual(getSecurityContextHolderStrategy().getContext().getAuthentication().getName(), username)) { throwBusinessException(HttpServletResponse.SC_FORBIDDEN, new AccessDeniedException("Access denied")); } } private void throwBusinessException(Integer code, Throwable t) { throw new BusinessException(code, t); } private boolean isNotEqual(String one, String two) { return !StringUtils.equals(one, two); } @Required public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) { this.securityContextHolderStrategy = securityContextHolderStrategy; } }
[ "ondrusek.jan@gmail.com" ]
ondrusek.jan@gmail.com
590e4a214165d1e0d9d9b55419c7fea6163e0152
aaf567b90800401f7ce20c884aeb64b4abe382dd
/app/src/main/java/com/sk/meikelai/activity/mine/PreviewActivity.java
573406e244248f6e8ea5636924757bd697ab95f5
[]
no_license
ljtianqi1986/applet-employee
2a41cb998d12f4dffcffe0c84ed64b6c6a0239ae
84a34f9d5f5c6a98e846731b5fd06cb0a6d276c8
refs/heads/master
2021-06-28T09:23:06.252652
2017-09-19T06:34:29
2017-09-19T06:34:29
104,036,046
1
0
null
null
null
null
UTF-8
Java
false
false
927
java
package com.sk.meikelai.activity.mine; import android.net.Uri; import android.os.Bundle; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.sk.meikelai.R; import com.sk.meikelai.activity.base.BaseActivity; import butterknife.BindView; import butterknife.OnClick; /** * Created by sk on 2017/8/4. */ public class PreviewActivity extends BaseActivity { @BindView(R.id.back) ImageView back; @BindView(R.id.preview_img) ImageView previewImg; private Uri uri; @Override protected int getContentView() { return R.layout.activity_preview; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); uri = getIntent().getParcelableExtra("uri"); Glide.with(mContext).load(uri).into(previewImg); } @OnClick(R.id.back) public void onViewClicked() { finish(); } }
[ "452966215@qq.com" ]
452966215@qq.com
e339c11d9ce5d1b2ceecbcc49e5de1d654a92f34
6b1694afaef3d9b78cc286a261d02015cf078ded
/src/com/zjxfood/application/MyApplication.java
b7ae08aee4d27c4c5226460445844fbc4c501c12
[]
no_license
twgdhz/ZjxssnnProject
ccf18a2b6ad8ce13f92ecf3868a67e708390c7be
bce015429423b12a1315d5ed2d20e18a31079ed4
refs/heads/master
2021-06-01T05:32:34.428952
2016-08-02T03:38:08
2016-08-02T03:38:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,954
java
package com.zjxfood.application; import android.app.Service; import android.os.Vibrator; import android.support.multidex.MultiDex; import android.support.multidex.MultiDexApplication; import android.widget.TextView; import com.baidu.location.LocationClient; import com.baidu.location.service.LocationService; import com.baidu.location.service.WriteLog; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.zjxfood.route.LocationApplication; public class MyApplication extends MultiDexApplication { public LocationClient mLocationClient; public LocationApplication.MyLocationListener mMyLocationListener; public TextView mLocationResult,logMsg; public TextView trigger,exit; public Vibrator mVibrator; public double latitude; public double longitude; public String mCityStr,mProvince; public static final String action = "main.location.broadcast"; public LocationService locationService; @Override public void onCreate() { super.onCreate(); MultiDex.install(this); ImageLoaderConfiguration configuration = ImageLoaderConfiguration .createDefault(this); ImageLoader.getInstance().init(configuration); // Thread.setDefaultUncaughtExceptionHandler(this); super.onCreate(); locationService = new LocationService(getApplicationContext()); mVibrator =(Vibrator)getApplicationContext().getSystemService(Service.VIBRATOR_SERVICE); WriteLog.getInstance().init(); // 初始化日志 // mLocationClient = new LocationClient(this.getApplicationContext()); // mMyLocationListener = new MyLocationListener(); // mLocationClient.registerLocationListener(mMyLocationListener); // mVibrator =(Vibrator)getApplicationContext().getSystemService(Service.VIBRATOR_SERVICE); } // /** // * 实现实时位置回调监听 // */ // public class MyLocationListener implements BDLocationListener { // // @Override // public void onReceiveLocation(BDLocation location) { // //Receive Location // StringBuffer sb = new StringBuffer(256); // sb.append("time : "); // sb.append(location.getTime()); // sb.append("\nerror code : "); // sb.append(location.getLocType()); // sb.append("\nlatitude : "); // sb.append(location.getLatitude()); // latitude = location.getLatitude(); // sb.append("\nlontitude : "); // sb.append(location.getLongitude()); // longitude = location.getLongitude(); // sb.append("\nradius : "); // sb.append(location.getRadius()); // if (location.getLocType() == BDLocation.TypeGpsLocation){// GPS定位结果 // sb.append("\nspeed : "); // sb.append(location.getSpeed());// 单位:公里每小时 // sb.append("\nsatellite : "); // sb.append(location.getSatelliteNumber()); // sb.append("\nheight : "); // sb.append(location.getAltitude());// 单位:米 // sb.append("\ndirection : "); // sb.append(location.getDirection()); // sb.append("\naddr : "); // sb.append(location.getAddrStr()); // sb.append("\ndescribe : "); // sb.append("gps定位成功"); // // } else if (location.getLocType() == BDLocation.TypeNetWorkLocation){// 网络定位结果 // sb.append("\naddr : "); // sb.append(location.getAddrStr()); // mCityStr = location.getCity(); // mProvince = location.getProvince(); // //运营商信息 // sb.append("\noperationers : "); // sb.append(location.getOperators()); // sb.append("\ndescribe : "); // sb.append("网络定位成功"); // } else if (location.getLocType() == BDLocation.TypeOffLineLocation) {// 离线定位结果 // sb.append("\ndescribe : "); // sb.append("离线定位成功,离线定位结果也是有效的"); // } else if (location.getLocType() == BDLocation.TypeServerError) { // sb.append("\ndescribe : "); // sb.append("服务端网络定位失败,可以反馈IMEI号和大体定位时间到loc-bugs@baidu.com,会有人追查原因"); // } else if (location.getLocType() == BDLocation.TypeNetWorkException) { // sb.append("\ndescribe : "); // sb.append("网络不同导致定位失败,请检查网络是否通畅"); // } else if (location.getLocType() == BDLocation.TypeCriteriaException) { // sb.append("\ndescribe : "); // sb.append("无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机"); // } // // logMsg(sb.toString()); // Log.i("BaiduLocationApiDem", sb.toString()); // // mLocationClient.setEnableGpsRealTimeTransfer(true); // } // } // // // /** // * 显示请求字符串 // * @param str // */ // public void logMsg(String str) { // try { // if (mLocationResult != null) // mLocationResult.setText(str); // Constants.lat = latitude; // Constants.longt = longitude; // Intent intent = new Intent(action); // intent.putExtra("data", "2"); // intent.putExtra("province", mProvince); // intent.putExtra("city", mCityStr); // sendBroadcast(intent); // Log.i("定位成功", "latitude="+latitude+"=====longitude="+longitude+"====city"+mCityStr); // } catch (Exception e) { // e.printStackTrace(); // } // } }
[ "236543611@qq.com" ]
236543611@qq.com
1a8aea7d004a93d5c766b067ea9cdb3198af10f9
1df764cf55b611a943d27e225dc717cbe30499b7
/src/main/java/com/javax0/jdsl/analyzers/NoExecutorListAnalyzer.java
3971529390b2c6ffc57e37189a09f24957d32c87
[ "Apache-2.0" ]
permissive
verhas/jdsl
6fc97c0955b4ca4832e9d692e3a516a50390dfaa
d5c0f0795c7285bb950c5068d9d01a6a3789f406
refs/heads/master
2022-11-12T12:10:43.318195
2022-10-24T10:53:09
2022-10-24T10:53:09
15,189,297
4
2
null
2015-06-21T07:56:41
2013-12-14T17:11:44
Java
UTF-8
Java
false
false
1,080
java
package com.javax0.jdsl.analyzers; import java.util.List; /** * This list analyzer has no executor. In addition to that the list of the * underlying analyzers can be fetched from the analyzer and thus these lists * can be flattened when such an analyzer is a member of a list. * <p> * This feature is used by the method * {@link com.javax0.jdsl.GrammarDefinition#list(Analyzer...)} when there are keyword * lists in the argument. This type of list analyzer is returned by the method * {@link com.javax0.jdsl.GrammarDefinition#kw(String...)} when there are more than one * arguments, and having that passed to the method {@code list()} the latter one * is able to flatten it to a single list. This way * * <pre> * list( kw("A","B"), kw("C") ) * </pre> * * will have the same result as * * <pre> * list( kw("A"),kw("B"),kw("C") ) * </pre> * * */ public class NoExecutorListAnalyzer extends ListAnalyzer { public NoExecutorListAnalyzer() { super(null); } @Override public List<Analyzer> getAnalyzerList() { return super.getAnalyzerList(); } }
[ "peter@verhas.com" ]
peter@verhas.com
eb58c41e523a570b1f377dc8571e05cc14f19cb1
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/view/MediaBanner$$ExternalSyntheticLambda0.java
1bec417bd1f249b22579b50060ae5cfddb3076f6
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
482
java
package com.tencent.mm.view; import android.os.Message; import com.tencent.mm.sdk.platformtools.MMHandler.Callback; public final class MediaBanner$$ExternalSyntheticLambda0 implements MMHandler.Callback { public final boolean handleMessage(Message arg1) {} } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes3.jar * Qualified Name: com.tencent.mm.view.MediaBanner..ExternalSyntheticLambda0 * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
fbc3c676142a9d4e5dd29f0ccdc1ff7dfe017800
1b2b9187aeaf76452116b0e1d09cf405648cfddc
/src/com/syntax/class07/WhileDoWhile.java
fed39ab2ee08dbf28fa6d3c2f83c8f79dad98cf9
[]
no_license
satasoy6/JavaBasics
2e93f7b3bc111dd2258cdd7897a0b1cc93550330
c8ff4ce7709393d32c6c13accf42cc519de42b70
refs/heads/master
2021-04-10T00:06:52.388111
2020-06-16T19:18:38
2020-06-16T19:18:38
248,894,715
0
0
null
null
null
null
UTF-8
Java
false
false
404
java
package com.syntax.class07; public class WhileDoWhile { public static void main(String[] args) { //hello 5 times int num=1; while(num<=5) { System.out.println("Hello"); num++; } System.out.println("----------Using do while loop------------"); //hello 5 times int num1=1; do { System.out.println("Hello"); num1++; }while (num1<=5); } }
[ "atasoyseyma@yahoo.com" ]
atasoyseyma@yahoo.com
4bb1d0d20fb7203f462cec0b6064a5065c4d528d
f128faaf396d547183a8c1d640276409a1896b7c
/07architect-stage-6-kafka/collector/src/main/java/com/bfxy/collector/util/FastJsonConvertUtil.java
e25d9a169048f0356c5c27685ee006e0868dd3a8
[]
no_license
wjphappy90/JiaGou
0708a2c4d2cf0a1fda4a46f09e728cf855a938dc
367fc5e7101cb42d99686027494bb15f73558147
refs/heads/master
2023-01-05T22:04:59.604537
2020-10-28T12:15:34
2020-10-28T12:15:34
307,754,947
1
1
null
null
null
null
UTF-8
Java
false
false
4,213
java
package com.bfxy.collector.util; import java.util.ArrayList; import java.util.List; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.serializer.SerializerFeature; import lombok.extern.slf4j.Slf4j; /** * $FastJsonConvertUtil * @author hezhuo.bai * @since 2019年1月15日 下午4:53:28 */ @Slf4j public class FastJsonConvertUtil { private static final SerializerFeature[] featuresWithNullValue = { SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullBooleanAsFalse, SerializerFeature.WriteNullListAsEmpty, SerializerFeature.WriteNullNumberAsZero, SerializerFeature.WriteNullStringAsEmpty }; /** * <B>方法名称:</B>将JSON字符串转换为实体对象<BR> * <B>概要说明:</B>将JSON字符串转换为实体对象<BR> * @author hezhuo.bai * @since 2019年1月15日 下午4:53:49 * @param data JSON字符串 * @param clzss 转换对象 * @return T */ public static <T> T convertJSONToObject(String data, Class<T> clzss) { try { T t = JSON.parseObject(data, clzss); return t; } catch (Exception e) { log.error("convertJSONToObject Exception", e); return null; } } /** * <B>方法名称:</B>将JSONObject对象转换为实体对象<BR> * <B>概要说明:</B>将JSONObject对象转换为实体对象<BR> * @author hezhuo.bai * @since 2019年1月15日 下午4:54:32 * @param data JSONObject对象 * @param clzss 转换对象 * @return T */ public static <T> T convertJSONToObject(JSONObject data, Class<T> clzss) { try { T t = JSONObject.toJavaObject(data, clzss); return t; } catch (Exception e) { log.error("convertJSONToObject Exception", e); return null; } } /** * <B>方法名称:</B>将JSON字符串数组转为List集合对象<BR> * <B>概要说明:</B>将JSON字符串数组转为List集合对象<BR> * @author hezhuo.bai * @since 2019年1月15日 下午4:54:50 * @param data JSON字符串数组 * @param clzss 转换对象 * @return List<T>集合对象 */ public static <T> List<T> convertJSONToArray(String data, Class<T> clzss) { try { List<T> t = JSON.parseArray(data, clzss); return t; } catch (Exception e) { log.error("convertJSONToArray Exception", e); return null; } } /** * <B>方法名称:</B>将List<JSONObject>转为List集合对象<BR> * <B>概要说明:</B>将List<JSONObject>转为List集合对象<BR> * @author hezhuo.bai * @since 2019年1月15日 下午4:55:11 * @param data List<JSONObject> * @param clzss 转换对象 * @return List<T>集合对象 */ public static <T> List<T> convertJSONToArray(List<JSONObject> data, Class<T> clzss) { try { List<T> t = new ArrayList<T>(); for (JSONObject jsonObject : data) { t.add(convertJSONToObject(jsonObject, clzss)); } return t; } catch (Exception e) { log.error("convertJSONToArray Exception", e); return null; } } /** * <B>方法名称:</B>将对象转为JSON字符串<BR> * <B>概要说明:</B>将对象转为JSON字符串<BR> * @author hezhuo.bai * @since 2019年1月15日 下午4:55:41 * @param obj 任意对象 * @return JSON字符串 */ public static String convertObjectToJSON(Object obj) { try { String text = JSON.toJSONString(obj); return text; } catch (Exception e) { log.error("convertObjectToJSON Exception", e); return null; } } /** * <B>方法名称:</B>将对象转为JSONObject对象<BR> * <B>概要说明:</B>将对象转为JSONObject对象<BR> * @author hezhuo.bai * @since 2019年1月15日 下午4:55:55 * @param obj 任意对象 * @return JSONObject对象 */ public static JSONObject convertObjectToJSONObject(Object obj){ try { JSONObject jsonObject = (JSONObject) JSONObject.toJSON(obj); return jsonObject; } catch (Exception e) { log.error("convertObjectToJSONObject Exception", e); return null; } } public static String convertObjectToJSONWithNullValue(Object obj) { try { String text = JSON.toJSONString(obj, featuresWithNullValue); return text; } catch (Exception e) { log.error("convertObjectToJSONWithNullValue Exception", e); return null; } } }
[ "981146457@qq.com" ]
981146457@qq.com
5e1fafe2663460f8aee0eee6f3a834b189bb3614
d3e12da1c9bde98c0dbeeaa07ca08650fd421e64
/src/com/star72/cmsmain/cms/action/admin/assist/CmsAdvertisingSpaceAct.java
f1d1645ca635f898facfc2025ae49202c08a6bbf
[]
no_license
nextflower/star72
6117e695664cdca6d27cb0aee69ddc0e75b8bdda
add264b1e3fba536fdd52f5001abc4cf3d68c697
refs/heads/master
2021-01-23T19:47:01.014843
2015-05-18T11:31:01
2015-05-18T11:31:01
27,357,450
0
0
null
null
null
null
UTF-8
Java
false
false
6,062
java
package com.star72.cmsmain.cms.action.admin.assist; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.json.JSONException; import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import com.star72.cmsmain.cms.entity.assist.CmsAdvertisingSpace; import com.star72.cmsmain.cms.manager.assist.CmsAdvertisingSpaceMng; import com.star72.cmsmain.common.web.ResponseUtils; import com.star72.cmsmain.core.entity.CmsSite; import com.star72.cmsmain.core.manager.CmsLogMng; import com.star72.cmsmain.core.web.WebErrors; import com.star72.cmsmain.core.web.util.CmsUtils; @Controller public class CmsAdvertisingSpaceAct { private static final Logger log = LoggerFactory .getLogger(CmsAdvertisingSpaceAct.class); @RequiresPermissions("advertising_space:v_list") @RequestMapping("/advertising_space/v_list.do") public String list(Integer pageNo, HttpServletRequest request, ModelMap model) { CmsSite site = CmsUtils.getSite(request); List<CmsAdvertisingSpace> list = manager.getList(site.getId()); model.addAttribute("list", list); return "advertising_space/list"; } @RequiresPermissions("advertising_space:v_add") @RequestMapping("/advertising_space/v_add.do") public String add(ModelMap model) { return "advertising_space/add"; } @RequiresPermissions("advertising_space:v_edit") @RequestMapping("/advertising_space/v_edit.do") public String edit(Integer id, Integer pageNo, HttpServletRequest request, ModelMap model) { WebErrors errors = validateEdit(id, request); if (errors.hasErrors()) { return errors.showErrorPage(model); } model.addAttribute("cmsAdvertisingSpace", manager.findById(id)); model.addAttribute("pageNo", pageNo); return "advertising_space/edit"; } @RequiresPermissions("advertising_space:v_ajax_edit") @RequestMapping("/advertising_space/v_ajax_edit.do") public void ajaxEdit(Integer id, HttpServletRequest request,HttpServletResponse response, ModelMap model) throws JSONException { JSONObject object = new JSONObject(); CmsAdvertisingSpace space=manager.findById(id); if(space!=null){ object.put("id", space.getId()); object.put("name", space.getName()); object.put("description", space.getDescription()); object.put("enabled", space.getEnabled()); } ResponseUtils.renderJson(response, object.toString()); } @RequiresPermissions("advertising_space:o_save") @RequestMapping("/advertising_space/o_save.do") public String save(CmsAdvertisingSpace bean, HttpServletRequest request, ModelMap model) { WebErrors errors = validateSave(bean, request); if (errors.hasErrors()) { return errors.showErrorPage(model); } bean = manager.save(bean); log.info("save CmsAdvertisingSpace id={}", bean.getId()); cmsLogMng.operating(request, "cmsAdvertisingSpace.log.save", "id=" + bean.getId() + ";name=" + bean.getName()); return "redirect:v_list.do"; } @RequiresPermissions("advertising_space:o_update") @RequestMapping("/advertising_space/o_update.do") public String update(CmsAdvertisingSpace bean, Integer pageNo, HttpServletRequest request, ModelMap model) { WebErrors errors = validateUpdate(bean.getId(), request); if (errors.hasErrors()) { return errors.showErrorPage(model); } bean = manager.update(bean); log.info("update CmsAdvertisingSpace id={}.", bean.getId()); cmsLogMng.operating(request, "cmsAdvertisingSpace.log.update", "id=" + bean.getId() + ";name=" + bean.getName()); return list(pageNo, request, model); } @RequiresPermissions("advertising_space:o_delete") @RequestMapping("/advertising_space/o_delete.do") public String delete(Integer[] ids, Integer pageNo, HttpServletRequest request, ModelMap model) { WebErrors errors = validateDelete(ids, request); if (errors.hasErrors()) { return errors.showErrorPage(model); } CmsAdvertisingSpace[] beans = manager.deleteByIds(ids); for (CmsAdvertisingSpace bean : beans) { log.info("delete CmsAdvertisingSpace id={}", bean.getId()); cmsLogMng.operating(request, "cmsAdvertisingSpace.log.delete", "id=" + bean.getId() + ";name=" + bean.getName()); } return list(pageNo, request, model); } private WebErrors validateSave(CmsAdvertisingSpace bean, HttpServletRequest request) { WebErrors errors = WebErrors.create(request); CmsSite site = CmsUtils.getSite(request); bean.setSite(site); return errors; } private WebErrors validateEdit(Integer id, HttpServletRequest request) { WebErrors errors = WebErrors.create(request); CmsSite site = CmsUtils.getSite(request); if (vldExist(id, site.getId(), errors)) { return errors; } return errors; } private WebErrors validateUpdate(Integer id, HttpServletRequest request) { WebErrors errors = WebErrors.create(request); CmsSite site = CmsUtils.getSite(request); if (vldExist(id, site.getId(), errors)) { return errors; } return errors; } private WebErrors validateDelete(Integer[] ids, HttpServletRequest request) { WebErrors errors = WebErrors.create(request); CmsSite site = CmsUtils.getSite(request); if (errors.ifEmpty(ids, "ids")) { return errors; } for (Integer id : ids) { vldExist(id, site.getId(), errors); } return errors; } private boolean vldExist(Integer id, Integer siteId, WebErrors errors) { if (errors.ifNull(id, "id")) { return true; } CmsAdvertisingSpace entity = manager.findById(id); if (errors.ifNotExist(entity, CmsAdvertisingSpace.class, id)) { return true; } if (!entity.getSite().getId().equals(siteId)) { errors.notInSite(CmsAdvertisingSpace.class, id); return true; } return false; } @Autowired private CmsLogMng cmsLogMng; @Autowired private CmsAdvertisingSpaceMng manager; }
[ "dv3333@163.com" ]
dv3333@163.com
bb67e329a61b5807924f67aa4bf1d85b4f75009a
a8ecc1424182200da5769f361ea6cc6496a0db79
/app/src/main/java/com/footballcitymobileandroid/Controller/Club/ChallengeAlreadyMatchList.java
4576a292b4976269caaa61dbdb043f0ed875c8d1
[]
no_license
tempest1/FootballCityMobileAndroid
c74cdf9c4ffd43866efd4717d172a4513ae10b4e
d44d74659d295392660a60d1f72f76b4bd7f9ad6
refs/heads/master
2020-05-30T08:44:57.736963
2016-09-22T07:37:09
2016-09-22T07:37:09
68,896,455
1
0
null
null
null
null
UTF-8
Java
false
false
4,900
java
package com.footballcitymobileandroid.Controller.Club; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; import com.footballcitymobileandroid.BLL.Adapter.ClubAdapter.AlreadyMatchAdapter; import com.footballcitymobileandroid.BLL.Util.Pull.PullToRefreshLayout; import com.footballcitymobileandroid.Controller.Base.MainApplication; import com.footballcitymobileandroid.Controller.TestData.MatchNormal; import com.footballcitymobileandroid.DAL.Data.LogUtil.LogUtils; import com.footballcitymobileandroid.Entity.ClubEntity.club.ClubList; import com.footballcitymobileandroid.Entity.GymkhanaEntity.Arena1.AranaMatchs; import com.footballcitymobileandroid.R; import java.io.Serializable; import java.util.List; /** * Created by zhoudi on 16/6/1. */ public class ChallengeAlreadyMatchList extends Activity implements View.OnClickListener,PullToRefreshLayout.OnRefreshListener{ private Button detail_back; private ListView list; private AlreadyMatchAdapter adapter; TextView detail_title_center; List<AranaMatchs> aranaMatchses; ClubList clubList; private PullToRefreshLayout layout; private static int currentState = PullToRefreshLayout.PULL_REFRESH; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.matchinfo_list); init(); } private void init() { aranaMatchses=(List<AranaMatchs>) getIntent().getSerializableExtra("AranaMatchs"); clubList= (ClubList) getIntent().getSerializableExtra("clublist"); list=(ListView)findViewById(R.id.pull_list); if (clubList==null) { LogUtils.e("clubList=null"); } if (aranaMatchses!=null) { adapter = new AlreadyMatchAdapter(this, aranaMatchses,clubList); list.setAdapter(adapter); LogUtils.e(""); }else { LogUtils.e("null"); } list.setOnItemClickListener(info_click); detail_back=(Button) findViewById(R.id.detail_back); detail_back.setOnClickListener(this); detail_title_center=(TextView)findViewById(R.id.detail_title_center); detail_title_center.setText("待开始比赛"); layout = (PullToRefreshLayout) findViewById(R.id.refresh_view); layout.setOnRefreshListener(this); MainApplication.runDelay(layout); } private AdapterView.OnItemClickListener info_click = new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { AranaMatchs matchNormal=(AranaMatchs) adapterView.getAdapter().getItem(position); // LogUtils.e(clubTest.getClubname()); showInfoDetail(matchNormal); } }; private void showInfoDetail(AranaMatchs data) { Intent intent=new Intent(); intent.setClass(this, ChallengeMatchSigns.class); Bundle bundle = new Bundle(); // intent.setClass(this, NormalMathMeun.class); // Bundle bundle = new Bundle(); bundle.putSerializable("AranaMatchs", data); //需要适配 bundle.putSerializable("clublist",clubList); intent.putExtras(bundle); startActivity(intent); overridePendingTransition(R.anim.in_from_right, R.anim.out_from_left); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.detail_back: this.finish(); overridePendingTransition(R.anim.in_from_left,R.anim.out_from_right); break; } } @Override public void onBackPressed() { super.onBackPressed(); overridePendingTransition(R.anim.in_from_left, R.anim.out_from_right); } /** * 刷新操作 * * @param pullToRefreshLayout */ @Override public void onRefresh(PullToRefreshLayout pullToRefreshLayout) { currentState = PullToRefreshLayout.PULL_REFRESH; // appAction.loadCard(CMD_CARD_LIST, pagination, pageNum, frunm.getTimestamp(), Params.CARD_LIST_URL, this); layout.loadmoreFinish(PullToRefreshLayout.SUCCEED); } /** * 加载操作 * * @param pullToRefreshLayout */ @Override public void onLoadMore(PullToRefreshLayout pullToRefreshLayout) { currentState = PullToRefreshLayout.PULL_LOAD; // pagination ++; // appAction.loadCard(CMD_CARD_LIST, pagination, pageNum, frunm.getTimestamp(), Params.CARD_LIST_URL, this); //layout.loadmoreFinish(PullToRefreshLayout.FAIL); layout.loadmoreFinish(PullToRefreshLayout.SUCCEED); } }
[ "505675592@qq.com" ]
505675592@qq.com
d09ed52c1ee7380c6414e6885f8fc1dcb177e1df
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-quickbi-public/src/main/java/com/aliyuncs/quickbi_public/model/v20200730/QueryDataServiceRequest.java
ab9af3b6c775c4dbe249e64f5e26a79c2a74dee2
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
2,154
java
/* * 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.aliyuncs.quickbi_public.model.v20200730; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.quickbi_public.Endpoint; /** * @author auto create * @version */ public class QueryDataServiceRequest extends RpcAcsRequest<QueryDataServiceResponse> { private String returnFields; private String conditions; private String apiId; public QueryDataServiceRequest() { super("quickbi-public", "2020-07-30", "QueryDataService", "quickbi"); setMethod(MethodType.POST); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getReturnFields() { return this.returnFields; } public void setReturnFields(String returnFields) { this.returnFields = returnFields; if(returnFields != null){ putQueryParameter("ReturnFields", returnFields); } } public String getConditions() { return this.conditions; } public void setConditions(String conditions) { this.conditions = conditions; if(conditions != null){ putQueryParameter("Conditions", conditions); } } public String getApiId() { return this.apiId; } public void setApiId(String apiId) { this.apiId = apiId; if(apiId != null){ putQueryParameter("ApiId", apiId); } } @Override public Class<QueryDataServiceResponse> getResponseClass() { return QueryDataServiceResponse.class; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
e1edfe7eec2b62cce7af3579a402c966fe251e2e
92f10c41bad09bee05acbcb952095c31ba41c57b
/app/src/main/java/io/github/alula/ohmygod/MainActivity6942.java
5ceb979abe924a6d64eaaeacd5af75d2eb9cd837
[]
no_license
alula/10000-activities
bb25be9aead3d3d2ea9f9ef8d1da4c8dff1a7c62
f7e8de658c3684035e566788693726f250170d98
refs/heads/master
2022-07-30T05:54:54.783531
2022-01-29T19:53:04
2022-01-29T19:53:04
453,501,018
16
0
null
null
null
null
UTF-8
Java
false
false
339
java
package io.github.alula.ohmygod; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity6942 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "6276139+alula@users.noreply.github.com" ]
6276139+alula@users.noreply.github.com
092ed6ed51b1b703304e06eff22f305534bb86af
ee00cea819879bd97b681b0ce0d0569aea5fc5f7
/efcs/src/main/java/com/wxzd/efcs/business/application/service/FmProcedureAppService.java
7ee813be8c046e02be65631918de66591ea50c17
[]
no_license
developTiger/sy-efcs
3eb2c17b3f3a32c842b5201ac484647cdff142ab
8952145e05a2ba66fb3838198beff7cf8486dc06
refs/heads/master
2020-12-03T09:26:19.250381
2017-06-28T02:43:13
2017-06-28T02:43:13
95,620,688
0
0
null
null
null
null
UTF-8
Java
false
false
800
java
package com.wxzd.efcs.business.application.service; import com.wxzd.efcs.business.application.dtos.FmProcedureDto; import com.wxzd.efcs.business.application.querys.FmProcedureExQuery; import com.wxzd.gaia.common.base.core.result.PageResult; import java.util.List; import java.util.UUID; /** * Created by LYK on 2017/4/27 * 出入库表单 */ public interface FmProcedureAppService { /** * 根据ID查询 * * @return */ FmProcedureDto getById(UUID id); /** * 分页查询 * @param exQuery * @return */ PageResult<FmProcedureDto> getFmProcedurePaged(FmProcedureExQuery exQuery); /** * 不分页查询 * @param exQuery * @return */ List<FmProcedureDto> getFmProcedureList(FmProcedureExQuery exQuery); }
[ "1366812446@qq.com" ]
1366812446@qq.com
0a4190ab40651bdf27d27348beedeea291ddcfe0
3617e6fbda9d9db61d20cc6acbdf7c124af4e34f
/src/main/java/com/varaprasadps/no10/a2022/design1/kadiyalu4/NimbuConversion.java
f623e6015ea70ced8bae9bbf91d291c1bcbe0e75
[]
no_license
SrinivasSilks/DesignMixer
940560d43a20387f0cae59f80e7af52e03920667
2fe5dcbf3bff280c42faa9c721c2daca728076e9
refs/heads/master
2023-07-08T06:19:01.937400
2023-06-30T14:45:34
2023-06-30T14:45:34
126,555,308
0
0
null
null
null
null
UTF-8
Java
false
false
2,708
java
package com.varaprasadps.no10.a2022.design1.kadiyalu4; import com.varaprasadps.image.*; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.LinkedList; import java.util.List; public class NimbuConversion { public static void main(final String[] args) throws IOException { String out = "z-data/out/10/a2022/design1/kadiyalubroc4/kbroc-nimbu-%s-%s.bmp"; BufferedImage body = HorizontalRepeatGenerator.get(3, ImageIO.read(new File("z-data/in/10/a2022/design1/brocade3/gold.bmp"))); int width = body.getWidth(); BufferedImage right = EmptyGenerator.get(width, 400); BufferedImage left = EmptyGenerator.get(width, 400); List<BufferedImage> inputBIs = new LinkedList<>(); inputBIs.add(EmptyGenerator.get(width, 32)); //mispick inputBIs.add(CutLayoutGenerator.get(AchuLayoutGenerator.get(width, 4), 2).get(0)); //kadiyalu inputBIs.add(EmptyGenerator.get(width, 2)); //achu inputBIs.add(EmptyGenerator.get(width, 8)); //left inputBIs.add(VerticalFlipGenerator.get(left)); //locking inputBIs.add(EmptyGenerator.get(width, 2)); inputBIs.add(PlainGenerator.get(width, 2)); //body inputBIs.add(body); inputBIs.add(body); //locking inputBIs.add(PlainGenerator.get(width, 2)); inputBIs.add(EmptyGenerator.get(width, 2)); //right inputBIs.add(right); //box inputBIs.add(EmptyGenerator.get(width, 1)); inputBIs.add(EmptyGenerator.get(width, 1)); //mispick inputBIs.add(ReverseGenerator.get(CutLayoutGenerator.get(AchuLayoutGenerator.get(width, 4), 2).get(0))); //kadiyalu inputBIs.add(EmptyGenerator.get(width, 2)); //achu inputBIs.add(EmptyGenerator.get(width, 6)); int repeatWidth = 0; int repeatHeight = 0; for (BufferedImage bi : inputBIs) { displayPixels(bi); repeatWidth = bi.getWidth(); repeatHeight += bi.getHeight(); } BufferedImage bi = ReverseGenerator.get(AddLayoutGenerator.get(repeatWidth, repeatHeight, inputBIs)); displayPixels(bi); saveBMP(bi, String.format(out, repeatWidth, repeatHeight)); } private static void displayPixels(BufferedImage fileOne) { System.out.println(String.format("Width : %s, Height : %s", fileOne.getWidth(), fileOne.getHeight())); } private static void saveBMP(final BufferedImage bi, final String path) throws IOException { ImageIO.write(bi, "bmp", new File(path)); } }
[ "poppu.vara@gmail.com" ]
poppu.vara@gmail.com
bbbb4642da4f3353e7b7eeca4ac1e4b2d8fd730c
63f579466b611ead556cb7a257d846fc88d582ed
/XDRValidator/src/main/java/org/hl7/v3/ProcessingID.java
24a276479eb5e0ae65b8c49e45120df4e1bcde46
[]
no_license
svalluripalli/soap
14f47b711d63d4890de22a9f915aed1bef755e0b
37d7ea683d610ab05477a1fdb4e329b5feb05381
refs/heads/master
2021-01-18T20:42:09.095152
2014-05-07T21:16:36
2014-05-07T21:16:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,103
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.05.07 at 05:07:17 PM EDT // package org.hl7.v3; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ProcessingID. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="ProcessingID"> * &lt;restriction base="{urn:hl7-org:v3}cs"> * &lt;enumeration value="D"/> * &lt;enumeration value="P"/> * &lt;enumeration value="T"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "ProcessingID") @XmlEnum public enum ProcessingID { D, P, T; public String value() { return name(); } public static ProcessingID fromValue(String v) { return valueOf(v); } }
[ "konkapv@NCI-01874632-L.nci.nih.gov" ]
konkapv@NCI-01874632-L.nci.nih.gov
894f8209ec833ff32960d2315f20fd4e589e071c
96003631a4d3e95e941e50eb9acef9cec181a19a
/src/MinHeap.java
eb9b5fdea9a90aeaa8be7b515986a0b7e5d5724f
[]
no_license
caojing-github/leet-code
b9d105f60e1894b81917ec6794b4710fd9bada8b
830113ba88018692b38d1cda0b80c1518b95e164
refs/heads/master
2020-09-03T00:09:54.173472
2020-06-11T06:59:03
2020-06-11T06:59:03
219,337,642
0
0
null
null
null
null
UTF-8
Java
false
false
2,396
java
/** * 最小堆 https://blog.csdn.net/DWL0208/article/details/77938258 */ @SuppressWarnings("all") public class MinHeap { // 使用数组存储堆中的数据 private int[] data; public MinHeap(int[] data) { this.data = data; bulidHeap(); } /** * 建立最小堆 */ private void bulidHeap() { // 下标小于等于i的节点拥有子节点 for (int i = (data.length) / 2 - 1; i >= 0; i--) { change(i); } } /** * 根据父节点判断是否 * 与左右孩子交换 */ private void change(int i) { int temp = 0; int left = left(i); int right = right(i); // 存在右节点则存在左节点 if (right < data.length) { // 拿到左右孩子中小的下标 temp = min(left, right); if (data[i] > data[temp]) { swap(i, temp); // 如果和子节点发生交换,则要对子节点的左右孩子进行调整 change(temp); } // 不存在右节点但存在左节点,则左节点无孩子节点 } else if (left < data.length) { // 孩子节点大于父节点,直接交换位置 if (data[i] > data[left]) { swap(i, left); } } } /** * 获取两个节点中较小的节点的下标 */ private int min(int i, int j) { if (data[i] >= data[j]) { return j; } return i; } /** * 根据父节点下标获取 * 左孩子节点下标 */ private int left(int i) { return ((i + 1) << 1) - 1; } /** * 根据父节点下标获取 * 右孩子节点下标 */ private int right(int i) { // 左移1位相当于乘2 return (i + 1) << 1; } /** * 根据下标交换数组中的位置 */ private void swap(int i, int j) { int temp = data[i]; data[i] = data[j]; data[j] = temp; } /** * 重置堆顶 */ public void newRoot(int root) { data[0] = root; change(0); } /** * 获取堆顶 */ public int getRoot() { return data[0]; } /** * 获取堆数据 */ public int[] getData() { return data; } }
[ "caojing0229@foxmail.com" ]
caojing0229@foxmail.com
ba41aeaae5305725ce8c672419676ee550a9167e
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
/aliyun-java-sdk-pairecservice/src/main/java/com/aliyuncs/pairecservice/model/v20221213/GetLayerResponse.java
6d6fdd4e8954cd81f3063c0647ca4176b1f608f6
[ "Apache-2.0" ]
permissive
aliyun/aliyun-openapi-java-sdk
a263fa08e261f12d45586d1b3ad8a6609bba0e91
e19239808ad2298d32dda77db29a6d809e4f7add
refs/heads/master
2023-09-03T12:28:09.765286
2023-09-01T09:03:00
2023-09-01T09:03:00
39,555,898
1,542
1,317
NOASSERTION
2023-09-14T07:27:05
2015-07-23T08:41:13
Java
UTF-8
Java
false
false
1,992
java
/* * 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.aliyuncs.pairecservice.model.v20221213; import com.aliyuncs.AcsResponse; import com.aliyuncs.pairecservice.transform.v20221213.GetLayerResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetLayerResponse extends AcsResponse { private String requestId; private String laboratoryId; private String sceneId; private String name; private String description; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getLaboratoryId() { return this.laboratoryId; } public void setLaboratoryId(String laboratoryId) { this.laboratoryId = laboratoryId; } public String getSceneId() { return this.sceneId; } public void setSceneId(String sceneId) { this.sceneId = sceneId; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } @Override public GetLayerResponse getInstance(UnmarshallerContext context) { return GetLayerResponseUnmarshaller.unmarshall(this, context); } @Override public boolean checkShowJsonItemName() { return false; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
26bfdb80b81bfc7eb2187d24be41506c75d087da
dea93f1f79daeb67915de7d2b5731b7ecdf8db05
/app/src/main/java/com/canplay/medical/mvp/adapter/MedicalDetailAdapter.java
9ad52945e1161e1b9fe28280a6130f31d995072d
[]
no_license
Meikostar/Medical_app
f00dcf8b59e68ad3d82524976fbd90d399e6084b
41efedb83a16469b9d74a65338180fefb03cf287
refs/heads/master
2021-04-12T05:21:41.797781
2018-04-24T11:58:14
2018-04-24T11:58:14
125,848,184
1
1
null
null
null
null
UTF-8
Java
false
false
2,066
java
package com.canplay.medical.mvp.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.canplay.medical.R; import com.canplay.medical.bean.Euip; import java.util.List; public class MedicalDetailAdapter extends BaseAdapter { private Context mContext; private List<Euip> list; private int type=0;//1是用药记录item public MedicalDetailAdapter(Context mContext) { this.mContext = mContext; } public interface ItemCliks{ void getItem(Euip menu, int type);//type 1表示点击事件2 表示长按事件 } private ItemCliks listener; public void setClickListener(ItemCliks listener){ this.listener=listener; } public void setData(List<Euip> list){ this.list=list; notifyDataSetChanged(); } public void setType(int type){ this.type=type; } @Override public int getCount() { return list!=null?list.size():5; } @Override public Object getItem(int position) { return list.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(final int position, View view, ViewGroup parent) { ResultViewHolder holder; if (view == null){ holder = new ResultViewHolder(); view = LayoutInflater.from(mContext).inflate(R.layout.item_medical_detail, parent, false); holder.name= (TextView) view.findViewById(R.id.tv_name); holder.tv_detail= (TextView) view.findViewById(R.id.tv_detail); view.setTag(holder); }else{ holder = (ResultViewHolder) view.getTag(); } return view; } public class ResultViewHolder{ TextView name; TextView tvNumber; TextView tv_detail; } }
[ "admin" ]
admin
3429fb1e0631447b52c5d5a17b06d77594828671
6c84838e69ae075244700f6c67f87292dcfa0991
/src/main/java/interfacedefaultmethods/print/ColoredPage.java
b06a8d5aad0445877d2bae0f6f5d42039531b5fa
[]
no_license
vkrisztianx86/training-solutions
e4fca2d35dd3cfd37572de9eef52b972f2f0385a
1f775a631979b51430f1f84f9689e9cbbe015e9e
refs/heads/master
2023-05-26T10:19:33.137529
2021-06-08T11:41:55
2021-06-08T11:41:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
461
java
package interfacedefaultmethods.print; public class ColoredPage { private String page; private String color; public ColoredPage(String page, String color) { this.page = page; this.color = color; } public ColoredPage(String page) { this.page = page; this.color = Printable.BLACK; } public String getPage() { return page; } public String getColor() { return color; } }
[ "lippaitamas1021@gmail.com" ]
lippaitamas1021@gmail.com
73d976a3fde8371876483ebbd9700695fae8d88b
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava18/Foo666.java
b7eae63d13876a6781dabb71a3bd85ea05b12f18
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package applicationModulepackageJava18; public class Foo666 { public void foo0() { new applicationModulepackageJava18.Foo665().foo5(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
835f5812c249a2a491583a11878002382dc294d2
10a689229d6889f86bf6c4ad106caa433379bb49
/trunk/ihouse/ihouse/src/com/manyi/ihouse/entity/hims/HouseImageFile.java
36f87834fc88f55eb5f01f6bce235a564c2da986
[]
no_license
sanrentai/manyi
d9e64224bc18846410c4a986c3f2b4ee229b2a2e
c4c92f4dde1671027ff726ba6bbe6021421cd469
refs/heads/master
2020-03-12T19:30:47.242536
2015-04-10T08:40:20
2015-04-10T08:40:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,758
java
package com.manyi.ihouse.entity.hims; import static javax.persistence.GenerationType.TABLE; import java.io.Serializable; import javax.persistence.Cacheable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Index; import javax.persistence.Table; import javax.persistence.TableGenerator; import lombok.Data; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; @Entity @Table(indexes = { @Index(name = "id", columnList = "id"), @Index(name = "houseId", columnList = "houseId") }) @Data public class HouseImageFile implements Serializable { private static final long serialVersionUID = 1L; @Id @Column(columnDefinition = "INT UNSIGNED") @GeneratedValue(strategy = TABLE, generator = "HouseImageFile") @TableGenerator(name = "HouseImageFile", allocationSize = 1) private int id; private Long houseId; private String type;// 类型:卧室bedroom、客厅livingRoom、卫生间wc、、、EntityUtils.HouseResourceType private String description;// 描述 主卧、次卧1、次卧2、门牌1、阳台、外景、、、EntityUtils.HouseResourceType private String imgExtensionName;// 图片扩展名称 private String imgKey;// 阿里云存储的key private String thumbnailKey;// 阿里云存储的key ; 图片缩略图 private int orderId;// 呈现图片的顺序 EntityUtils.HouseResourceType 中第一列 private int bdTaskId; //bd人员任务id, 默认0 private int userTaskId; // 中介(经纪人)看房任务id, 默认0 private int enable;// 是否可用标识,1可用 0 不可用 ,任务可用,图片就可用 }
[ "zhangxiongcai337@gmail.com" ]
zhangxiongcai337@gmail.com
bd19414453bfbc601a30f1041e5d0285b22d5dd8
fe9e1e526d2a103a023d01d907bef329569c1066
/disconnect-highcharts/src/main/java/com/github/fluorumlabs/disconnect/highcharts/PlotSmaStatesHoverHaloOptions.java
eaff151cfafd7426beaa2e2d6b00095822acf735
[ "Apache-2.0" ]
permissive
Heap-leak/disconnect-project
0a7946b4c79ec25cb6a602ebb220a64b90f0db94
04f6d77d4db3c385bcbeb5b701c97bd411540059
refs/heads/master
2022-11-14T05:23:30.074640
2020-04-29T14:14:47
2020-04-29T14:14:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,322
java
package com.github.fluorumlabs.disconnect.highcharts; import javax.annotation.Nullable; import js.lang.Any; import org.teavm.jso.JSProperty; /** * (Highcharts, Highstock) Options for the halo appearing around the hovered * point in line- type series as well as outside the hovered slice in pie * charts. By default the halo is filled by the current point or series color * with an opacity of 0.25. The halo can be disabled by setting the <code>halo</code> * option to <code>false</code>. * * In styled mode, the halo is styled with the <code>.highcharts-halo</code> class, with * colors inherited from <code>.highcharts-color-{n}</code>. * * @see <a href="https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo">https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo</a> * @see <a href="https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo">https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo</a> * */ public interface PlotSmaStatesHoverHaloOptions extends Any { /** * (Highcharts, Highstock) A collection of SVG attributes to override the * appearance of the halo, for example <code>fill</code>, <code>stroke</code> and <code>stroke-width</code>. * * @see <a href="https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.attributes">https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.attributes</a> * @see <a href="https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.attributes">https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.attributes</a> * * @implspec attributes?: SVGAttributes; * */ @JSProperty("attributes") @Nullable SVGAttributes getAttributes(); /** * (Highcharts, Highstock) A collection of SVG attributes to override the * appearance of the halo, for example <code>fill</code>, <code>stroke</code> and <code>stroke-width</code>. * * @see <a href="https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.attributes">https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.attributes</a> * @see <a href="https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.attributes">https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.attributes</a> * * @implspec attributes?: SVGAttributes; * */ @JSProperty("attributes") void setAttributes(SVGAttributes value); /** * (Highcharts, Highstock) Opacity for the halo unless a specific fill is * overridden using the <code>attributes</code> setting. Note that Highcharts is only * able to apply opacity to colors of hex or rgb(a) formats. * * @see <a href="https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.opacity">https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.opacity</a> * @see <a href="https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.opacity">https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.opacity</a> * * @implspec opacity?: number; * */ @JSProperty("opacity") double getOpacity(); /** * (Highcharts, Highstock) Opacity for the halo unless a specific fill is * overridden using the <code>attributes</code> setting. Note that Highcharts is only * able to apply opacity to colors of hex or rgb(a) formats. * * @see <a href="https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.opacity">https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.opacity</a> * @see <a href="https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.opacity">https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.opacity</a> * * @implspec opacity?: number; * */ @JSProperty("opacity") void setOpacity(double value); /** * (Highcharts, Highstock) The pixel size of the halo. For point markers * this is the radius of the halo. For pie slices it is the width of the * halo outside the slice. For bubbles it defaults to 5 and is the width of * the halo outside the bubble. * * @see <a href="https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.size">https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.size</a> * @see <a href="https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.size">https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.size</a> * * @implspec size?: number; * */ @JSProperty("size") double getSize(); /** * (Highcharts, Highstock) The pixel size of the halo. For point markers * this is the radius of the halo. For pie slices it is the width of the * halo outside the slice. For bubbles it defaults to 5 and is the width of * the halo outside the bubble. * * @see <a href="https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.size">https://api.highcharts.com/highcharts/plotOptions.sma.states.hover.halo.size</a> * @see <a href="https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.size">https://api.highcharts.com/highstock/plotOptions.sma.states.hover.halo.size</a> * * @implspec size?: number; * */ @JSProperty("size") void setSize(double value); }
[ "fluorumlabs@users.noreply.github.com" ]
fluorumlabs@users.noreply.github.com
19fed957911f63ca5ac7a7bdf89c63b8c78fb99c
9683569af72561f725e77977929ea7b57897ab64
/Jsp-master/Ch08/src/main/java/service/WelcomeService.java
11ba04c01751b28165032ea4098c6c04dd78b5da
[]
no_license
HJCHOI910828/emergency
61da559ccbfad7e78548f15f1c02c2736bd83148
331d9ffa2fe5cf7fd2383cfb8fa44402368c9694
refs/heads/master
2023-06-26T20:41:34.006819
2021-07-30T06:25:23
2021-07-30T06:25:23
390,955,121
0
0
null
null
null
null
UTF-8
Java
false
false
292
java
package service; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class WelcomeService implements CommonService { @Override public String requestProc(HttpServletRequest req, HttpServletResponse resp) { return "/welcome.jsp"; } }
[ "hungry44therock@gmail.com" ]
hungry44therock@gmail.com
15243c399a975224ec334e094777568e7c176a90
674fea179263e115e7e3946cfae8b07b9ebb14de
/src/main/java/com/hyd/cache/caches/redis/RedisAdapter.java
3ea87fe37fd2c5c5f56ed0eb6fc0cd86edc51152
[ "Apache-2.0" ]
permissive
yiding-he/hydrogen-cache
7d10f45f9be36069ba3db1c60c91b9696fa4f65d
2b1664a86d8a4556e24f1e898be3ce58af2b2bfc
refs/heads/3.1.0
2022-01-30T12:41:47.941358
2020-11-10T03:06:03
2020-11-10T03:06:03
169,236,114
1
0
Apache-2.0
2020-11-10T02:50:41
2019-02-05T12:17:21
null
UTF-8
Java
false
false
4,872
java
package com.hyd.cache.caches.redis; import com.hyd.cache.CacheAdapter; import com.hyd.cache.CacheConfiguration; import com.hyd.cache.Element; import com.hyd.cache.serialization.Serializer; import com.hyd.cache.serialization.SerializerFactory; import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisShardInfo; import redis.clients.jedis.ShardedJedis; import redis.clients.jedis.ShardedJedisPool; import java.util.List; import java.util.stream.Collectors; /** * created at 2015/3/16 * * @author Yiding */ public class RedisAdapter implements CacheAdapter { private final RedisConfiguration configuration; private final ShardedJedisPool shardedJedisPool; public RedisAdapter(RedisConfiguration configuration) { this.configuration = configuration; shardedJedisPool = new ShardedJedisPool(new JedisPoolConfig(), createShardInfoList(configuration)); } private List<JedisShardInfo> createShardInfoList(RedisConfiguration c) { return c.getServers().stream() .map(addr -> { JedisShardInfo shardInfo = new JedisShardInfo(addr.getHost(), addr.getPort()); shardInfo.setPassword(addr.getPassword()); return shardInfo; }) .collect(Collectors.toList()); } private Object deserialize(byte[] bytes) { byte tag = bytes[0]; Serializer serializer = SerializerFactory.getSerializer(tag); return serializer.deserialize(bytes); } private <T> Element<T> deserialize(byte[] bytes, Class<T> type) { byte tag = bytes[0]; Serializer serializer = SerializerFactory.getSerializer(tag); return serializer.deserialize(bytes, type); } private byte[] serialize(Object o) { byte tag = configuration.getSerializeMethod(); Serializer serializer = SerializerFactory.getSerializer(tag); return serializer.serialize(o); } @Override public CacheConfiguration getConfiguration() { return configuration; } private <T> T withJedis(JedisExecutor<T> executor) { try (ShardedJedis jedis = shardedJedisPool.getResource()) { return executor.execute(jedis); } } //////////////////////////////////////////////////////////////// @Override public Object get(final String key) { return withJedis(jedis -> { if (configuration.getTimeToIdleSeconds() > 0) { jedis.expire(key, configuration.getTimeToIdleSeconds()); } byte[] bytes = jedis.get(key.getBytes()); if (bytes == null) { return null; } else { return deserialize(bytes); } }); } @Override public <T> Element<T> get(String key, Class<T> type) { return withJedis(jedis -> { if (configuration.getTimeToIdleSeconds() > 0) { jedis.expire(key, configuration.getTimeToIdleSeconds()); } byte[] bytes = jedis.get(key.getBytes()); if (bytes == null) { return null; } else { return deserialize(bytes, type); } }); } @Override public void touch(final String key) { withJedis((JedisExecutor<Void>) jedis -> { if (configuration.getTimeToIdleSeconds() > 0) { jedis.expire(key, configuration.getTimeToIdleSeconds()); } return null; }); } //////////////////////////////////////////////////////////////// @Override public void put(final String key, final Object value, final boolean forever) { withJedis((JedisExecutor<Void>) jedis -> { byte[] bytes = serialize(value); if (forever) { jedis.set(key.getBytes(), bytes); } else { int ttl = configuration.getTimeToLiveSeconds(); jedis.setex(key.getBytes(), ttl, bytes); } return null; }); } @Override public void put(final String key, final Object value, final int timeToLiveSeconds) { withJedis((JedisExecutor<Void>) jedis -> { jedis.setex(key.getBytes(), timeToLiveSeconds, serialize(value)); return null; }); } @Override public void delete(final String key) { withJedis((JedisExecutor<Void>) jedis -> { jedis.del(key.getBytes()); return null; }); } @Override public void clear() { throw new UnsupportedOperationException("clear is not supported by redis."); } @Override public void dispose() { this.shardedJedisPool.close(); } private interface JedisExecutor<T> { T execute(ShardedJedis jedis); } }
[ "yiding.he@gmail.com" ]
yiding.he@gmail.com
32bf0cc96a7d9b2f869950000b1a6958d00b97db
89bedf3e111cdfd7b80f39b2eca3791a0dda276f
/argouml-app-v0.24/org/argouml/pattern/cognitive/critics/CrConsiderSingleton.java
6ecdcb8dfe524255440f122952322c87affb35ce
[ "LicenseRef-scancode-other-permissive", "BSD-3-Clause" ]
permissive
TheProjecter/plea-spl
b80b622fcf4dee6a73ae72db4fc7f4826bef0549
c28b308160c6ef8e68440d90a7710bff270f22c3
refs/heads/master
2020-05-28T14:14:30.727459
2014-10-03T18:43:35
2014-10-03T18:43:35
42,946,066
0
0
null
null
null
null
UTF-8
Java
false
false
5,957
java
//#if defined(COGNITIVE) //@#$LPS-COGNITIVE:GranularityType:Package // $Id: CrConsiderSingleton.java 11783 2007-01-10 08:17:30Z linus $ // Copyright (c) 1996-2006 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice // and this paragraph appear in all copies. This software program and // documentation are copyrighted by The Regents of the University of // California. The software program and documentation are supplied "AS // IS", without any accompanying services from The Regents. The Regents // does not warrant that the operation of the program will be // uninterrupted or error-free. The end-user understands that the program // was developed for research purposes and is advised not to rely // exclusively on the program for any reason. IN NO EVENT SHALL THE // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. package org.argouml.pattern.cognitive.critics; import java.util.Iterator; import org.argouml.cognitive.Designer; import org.argouml.cognitive.ToDoItem; import org.argouml.model.Model; import org.argouml.uml.cognitive.UMLDecision; import org.argouml.uml.cognitive.critics.CrUML; /** * A critic to detect when a class can never have more than one instance (of * itself of any subclasses), and thus whether it is suitable for declaration * as a Singleton (with stereotype &laquo;Singleton&raquo;.<p> * * @see the ArgoUML User Manual: Consider Using Singleton Pattern for Class * * @author jrobbins */ public class CrConsiderSingleton extends CrUML { /** * Constructor for the critic.<p> * * Sets up the resource name, which will allow headline and description * to be found for the current locale. Provides a design issue category * (PATTERNS), sets a priority for any to-do items (LOW) and adds triggers * for metaclasses "stereotype", "structuralFeature" and * "associationEnd". */ public CrConsiderSingleton() { setupHeadAndDesc(); addSupportedDecision(UMLDecision.PATTERNS); setPriority(ToDoItem.LOW_PRIORITY); // These may not actually make any difference at present (the code // behind addTrigger needs more work). addTrigger("stereotype"); addTrigger("structuralFeature"); addTrigger("associationEnd"); } /** * The trigger for the critic.<p> * * First check we are already a Singleton.<p> * * Otherwise plausible candidates for the Singleton design pattern are * classes with no instance variables (i.e. non-static attributes) and no * outgoing associations.<p> * * @param dm the {@link java.lang.Object Object} to be checked against * the critic. * * @param dsgr the {@link org.argouml.cognitive.Designer Designer} * creating the model. Not used, this is for future * development of ArgoUML. * * @return {@link #PROBLEM_FOUND PROBLEM_FOUND} if the critic is * triggered, otherwise {@link #NO_PROBLEM NO_PROBLEM}. */ public boolean predicate2(Object dm, Designer dsgr) { // Only look at classes... if (!(Model.getFacade().isAClass(dm))) { return NO_PROBLEM; } // and not association classes if (Model.getFacade().isAAssociationClass(dm)) { return NO_PROBLEM; } // with a name... if (Model.getFacade().getName(dm) == null || "".equals(Model.getFacade().getName(dm))) { return NO_PROBLEM; } // ... and not incompletely imported if (!(Model.getFacade().isPrimaryObject(dm))) { return NO_PROBLEM; } // abstract classes are hardly ever singletons if (Model.getFacade().isAbstract(dm)) { return NO_PROBLEM; } // Check for Singleton stereotype, uninitialised instance variables and // outgoing associations, as per JavaDoc above. if (Model.getFacade().isSingleton(dm)) { return NO_PROBLEM; } if (Model.getFacade().isUtility(dm)) { return NO_PROBLEM; } // If there is an attribute with instance scope => no problem Iterator iter = Model.getFacade().getAttributes(dm).iterator(); while (iter.hasNext()) { if (Model.getFacade().isInstanceScope(iter.next())) { return NO_PROBLEM; } } // If there is an outgoing association => no problem Iterator ends = Model.getFacade().getAssociationEnds(dm).iterator(); while (ends.hasNext()) { Iterator otherends = Model.getFacade() .getOtherAssociationEnds(ends.next()).iterator(); while (otherends.hasNext()) { if (Model.getFacade().isNavigable(otherends.next())) { return NO_PROBLEM; } } } return PROBLEM_FOUND; } /** * The UID. */ private static final long serialVersionUID = -178026888698499288L; } /* end class CrConsiderSingleton */ //#endif
[ "demost@gmail.com" ]
demost@gmail.com
f1c9385459e4abe6ec5f189ea0aad4d2178faaa2
63489b9d7f48b5f95dd7823f1ee0e81beb88aba4
/artrade/src/main/java/com/unionpay/mobile/android/nocard/views/bf.java
7fe5119ed5e837914d7d964ce7a1c21b17c8f6eb
[]
no_license
h4x0r139/MyApplication
7f7b7b65c160cad5af5baa5727163fae5d26a2bb
b71648d2963761efdfdf66de72075e590781c835
refs/heads/master
2020-05-21T14:55:31.488110
2019-05-28T11:29:45
2019-05-28T11:29:45
63,512,880
5
0
null
null
null
null
UTF-8
Java
false
false
488
java
package com.unionpay.mobile.android.nocard.views; import android.view.View; import android.view.View.OnClickListener; final class bf implements View.OnClickListener { bf(bc.a parama, String paramString) { } public final void onClick(View paramView) { this.b.a.a("", this.a); } } /* Location: D:\yinxm\Android\work\拍卖\apktool\artrade\classes_dex2jar.jar * Qualified Name: com.unionpay.mobile.android.nocard.views.bf * JD-Core Version: 0.6.2 */
[ "h4x0r_001@163.com" ]
h4x0r_001@163.com
057873dfd079103825ec2dfec81a1a734dbf0f8c
cf996ddd521f1a1da7b56935e24db4b457397882
/app/src/main/java/com/example/mvvm_recycler_suggested_retrofit/view/MainActivity.java
e9bd78cc61447a7c638416f90ebdccfea26a372f
[]
no_license
mosayeb-masoumi/MVVM_recycler_suggested_retrofit
36951f1504ceae0075bf68578350098b037c560e
df34c3768928d01583b8831f93b21cb367e95ed1
refs/heads/master
2020-05-29T21:52:07.416990
2019-05-30T10:48:52
2019-05-30T10:48:52
189,396,663
0
0
null
null
null
null
UTF-8
Java
false
false
838
java
package com.example.mvvm_recycler_suggested_retrofit.view; import android.databinding.DataBindingUtil; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.example.mvvm_recycler_suggested_retrofit.R; import com.example.mvvm_recycler_suggested_retrofit.databinding.ActivityMainBinding; import com.example.mvvm_recycler_suggested_retrofit.viewmodel.UserViewModel; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.activity_main); ActivityMainBinding mainBinding = DataBindingUtil.setContentView(this,R.layout.activity_main); UserViewModel userViewModel = new UserViewModel(this); mainBinding.setUser(userViewModel); } }
[ "mosayeb.masoumi.co@gmail.com" ]
mosayeb.masoumi.co@gmail.com
2fbce767e731247f423186d86071c5ebf1fa74a7
1e983d378e4321d29e678610f70171cf9e46731d
/Week_03/java/medium3/TreeNode.java
8b7f6e1f1d654e499b6758911d59f30f9e86c5c9
[]
no_license
yoshino1984/algorithm009-class01
b2221a410a7d3b82898ffe930468d253f7a18e32
aea70ced74eec61ed61d62241c6ff14a6e93f5f7
refs/heads/master
2022-11-27T22:24:52.428375
2020-08-02T12:48:18
2020-08-02T12:48:18
264,697,084
0
0
null
2020-05-17T15:23:56
2020-05-17T15:23:55
null
UTF-8
Java
false
false
216
java
package medium3; /** * Definition for a binary tree node. */ public class TreeNode { public int val; public TreeNode left; public TreeNode right; public TreeNode(int x) { val = x; } }
[ "wx18868831926@gmail.com" ]
wx18868831926@gmail.com
53fb89a7162637adbff73ce5f1078671049eaedf
c9c80eaaa6ad8e24357a9ee58aeac74345fef73a
/Prefetching-Library/android_prefetching_lib/src/main/java/nl/vu/cs/s2group/nappa/handler/activity/session/FetchSessionDataRunnable.java
f344ae2992957109db4fc08a852ee0c42433bd71
[ "MIT" ]
permissive
S2-group/NAPPA
48fc3043d115424f70d5aa87db3c3081514ef4ac
f15381a16f3a0e9eb8f8ea87a0c34410ad402e67
refs/heads/master
2021-06-24T17:35:08.133528
2020-11-09T08:36:52
2020-11-09T08:36:52
170,844,730
6
9
MIT
2020-12-06T14:26:10
2019-02-15T10:12:31
Java
UTF-8
Java
false
false
2,307
java
package nl.vu.cs.s2group.nappa.handler.activity.session; import android.os.Handler; import android.os.Looper; import android.util.Log; import androidx.lifecycle.LiveData; import java.util.List; import nl.vu.cs.s2group.nappa.graph.ActivityNode; import nl.vu.cs.s2group.nappa.handler.SessionBasedSelectQueryType; import nl.vu.cs.s2group.nappa.room.NappaDB; import nl.vu.cs.s2group.nappa.room.dao.SessionDao; import nl.vu.cs.s2group.nappa.room.data.SessionData; /** * Defines a runnable to fetch in the database a object containing the {@link SessionData} * for the provided node. The data contains the count of Source --> Destination edge * visits. After fetching the data, this handler will register the LiveData object * for the provide node to ensure consistency with the database. */ public class FetchSessionDataRunnable implements Runnable { private static final String LOG_TAG = FetchSessionDataRunnable.class.getSimpleName(); ActivityNode activity; SessionBasedSelectQueryType queryType; int lastNSessions; public FetchSessionDataRunnable(ActivityNode activity, SessionBasedSelectQueryType queryType, int lastNSessions) { this.activity = activity; this.queryType = queryType; this.lastNSessions = lastNSessions; } @Override public void run() { LiveData<List<SessionDao.SessionAggregate>> sessionDataList; Log.d(LOG_TAG, activity.getActivitySimpleName() + " Fetching session data for " + queryType); switch (queryType) { case ALL_SESSIONS: sessionDataList = NappaDB.getInstance() .sessionDao() .getCountForActivitySource(activity.getActivityId()); break; case LAST_N_SESSIONS_FROM_ENTITY_SESSION: case LAST_N_SESSIONS_FROM_QUERIED_ENTITY: sessionDataList = NappaDB.getInstance() .sessionDao() .getCountForActivitySource(activity.getActivityId(), lastNSessions); break; default: throw new IllegalArgumentException("Unknown query type " + queryType); } new Handler(Looper.getMainLooper()).post(() -> activity.setListSessionAggregateLiveData(sessionDataList)); } }
[ "sshann95@outlook.com" ]
sshann95@outlook.com
bcabdce8983cb9ccc79399940bfd900e7e8cc3bb
68e4676b246cfef371a0de908fd3922f56b881d0
/alipay-sdk-master/src/main/java/com/alipay/api/domain/AntMerchantExpandMapplyorderQueryModel.java
b7f4fe5b5ec535ec0b2de33bd08653596d5669c4
[ "Apache-2.0" ]
permissive
everLuck666/BoruiSystem
c66872ac965df2c6d833c7b529c1f76805d5cb05
7e19e43e8bb42420e87398dcd737f80904611a56
refs/heads/master
2023-03-29T12:08:07.978557
2021-03-22T03:12:23
2021-03-22T03:12:23
335,288,821
0
0
null
null
null
null
UTF-8
Java
false
false
596
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 商户入驻单查询接口 * * @author auto create * @since 1.0, 2016-07-28 23:35:07 */ public class AntMerchantExpandMapplyorderQueryModel extends AlipayObject { private static final long serialVersionUID = 4643456679886563162L; /** * 支付宝端商户入驻申请单据号 */ @ApiField("order_no") private String orderNo; public String getOrderNo() { return this.orderNo; } public void setOrderNo(String orderNo) { this.orderNo = orderNo; } }
[ "49854860+DFRUfO@users.noreply.github.com" ]
49854860+DFRUfO@users.noreply.github.com
5e2463375f0420a28d46f1b8f249fa5776d4700d
211ec31a7f09435b4c5d491139a2831c98e0f69c
/BestarProject/Widget/src/com/huoqiu/widget/pullrefresh/RotateLoadingLayout.java
c1cabe0b5ead312c0438fa5fe8207f12edf373b2
[ "Apache-2.0" ]
permissive
bestarandyan/ShoppingMall
6e8ac0ee3a5ae7a91541d04b1fba8d2d1496875c
ee93b393b982bdfe77d26182a2317f2c439c12fc
refs/heads/master
2021-01-01T05:49:52.010094
2015-01-23T10:29:59
2015-01-23T10:29:59
29,727,539
2
1
null
null
null
null
UTF-8
Java
false
false
3,481
java
/******************************************************************************* * Copyright 2011, 2012 Chris Banes. * * 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.huoqiu.widget.pullrefresh; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Matrix; import android.graphics.drawable.Drawable; import android.view.animation.Animation; import android.view.animation.RotateAnimation; import android.widget.ImageView.ScaleType; import com.huoqiu.widget.R; import com.huoqiu.widget.pullrefresh.PullToRefreshBase.Mode; import com.huoqiu.widget.pullrefresh.PullToRefreshBase.Orientation; public class RotateLoadingLayout extends LoadingLayout { static final int ROTATION_ANIMATION_DURATION = 1200; private final Animation mRotateAnimation; private final Matrix mHeaderImageMatrix; private float mRotationPivotX, mRotationPivotY; private final boolean mRotateDrawableWhilePulling; public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) { super(context, mode, scrollDirection, attrs); mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true); mHeaderImage.setScaleType(ScaleType.MATRIX); mHeaderImageMatrix = new Matrix(); mHeaderImage.setImageMatrix(mHeaderImageMatrix); mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR); mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION); mRotateAnimation.setRepeatCount(Animation.INFINITE); mRotateAnimation.setRepeatMode(Animation.RESTART); } public void onLoadingDrawableSet(Drawable imageDrawable) { if (null != imageDrawable) { mRotationPivotX = Math.round(imageDrawable.getIntrinsicWidth() / 2f); mRotationPivotY = Math.round(imageDrawable.getIntrinsicHeight() / 2f); } } protected void onPullImpl(float scaleOfLayout) { float angle; if (mRotateDrawableWhilePulling) { angle = scaleOfLayout * 90f; } else { angle = Math.max(0f, Math.min(180f, scaleOfLayout * 360f - 180f)); } mHeaderImageMatrix.setRotate(angle, mRotationPivotX, mRotationPivotY); mHeaderImage.setImageMatrix(mHeaderImageMatrix); } @Override protected void refreshingImpl() { mHeaderImage.startAnimation(mRotateAnimation); } @Override protected void resetImpl() { mHeaderImage.clearAnimation(); resetImageRotation(); } private void resetImageRotation() { if (null != mHeaderImageMatrix) { mHeaderImageMatrix.reset(); mHeaderImage.setImageMatrix(mHeaderImageMatrix); } } @Override protected void pullToRefreshImpl() { // NO-OP } @Override protected void releaseToRefreshImpl() { // NO-OP } @Override protected int getDefaultDrawableResId() { return R.drawable.default_ptr_rotate; } }
[ "2238985517@qq.com" ]
2238985517@qq.com
40958e07d1102418bd1a313e9405c4c0c1a05ff1
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a112/A112030Test.java
8fa1f787a34de3dad859eff30c154d8616c7b261
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a112; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A112030Test extends AbstractSequenceTest { }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
49f33db31aa8236ae6cb762b2ff3f22ccb6c3f03
93249ac332c0f24bf7642caa21f27058ba99189b
/applications/plugins/org.csstudio.archive.reader/src/org/csstudio/archive/reader/ArchiveRepository.java
7f8e1612c669230c7ce7815c04eeb74ddc9b0962
[]
no_license
crispd/cs-studio
0678abd0db40f024fbae4420eeda87983f109382
32dd49d1eb744329dc1083b4ba30b65155000ffd
refs/heads/master
2021-01-17T23:59:55.878433
2014-06-20T17:55:02
2014-06-20T17:55:02
21,135,201
1
0
null
null
null
null
UTF-8
Java
false
false
4,002
java
/******************************************************************************* * Copyright (c) 2010 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are 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 ******************************************************************************/ package org.csstudio.archive.reader; import java.util.HashMap; import java.util.Map; import java.util.Set; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.RegistryFactory; /** Factory class that locates {@link ArchiveReader} implementations * from the Eclipse registry based on URLs. * * @author Kay Kasemir * @author Jan Hatje, Albert Kagarmanov: Previous org.csstudio.archive.ArchiveImplementationRegistry */ @SuppressWarnings("nls") public class ArchiveRepository { /** ID of the extension point that implementing plugins use. */ private static final String EXTENSION_ID = "org.csstudio.archive.reader.ArchiveReader"; //$NON-NLS-1$ /** Singleton instance */ private static ArchiveRepository instance = null; /** ArchiveReader implementations found in extension registry mapped by prefix */ final private static Map<String, ArchiveReaderFactory> reader_factories = new HashMap<String, ArchiveReaderFactory>(); /** @return Singleton instance of the ArchiveRepository * @throws Exception on error */ public static ArchiveRepository getInstance() throws Exception { if (instance == null) instance = new ArchiveRepository(); return instance; } /** Initialize from Eclipse plugin registry. * @throws Exception on error */ private ArchiveRepository() throws Exception { final IExtensionRegistry registry = RegistryFactory.getRegistry(); if (registry == null) throw new Exception("Not running as plugin"); final IConfigurationElement[] configs = registry.getConfigurationElementsFor(EXTENSION_ID); // Need at least one implementation if (configs.length < 1) throw new Exception("No extensions to " + EXTENSION_ID + " found"); for (IConfigurationElement config : configs) { // final String plugin = config.getContributor().getName(); // final String name = config.getAttribute("name"); final String prefix = config.getAttribute("prefix"); // System.out.println(plugin + " provides '" + name + // "', prefix '" + prefix + "'"); final ArchiveReaderFactory factory = (ArchiveReaderFactory)config.createExecutableExtension("class"); reader_factories.put(prefix, factory); } } /** Only meant for tests, not public API * @return Supported URL prefixes */ public String [] getSupportedPrefixes() { final Set<String> keys = reader_factories.keySet(); return keys.toArray(new String[keys.size()]); } /** Create archive reader for URL * @param url Archive URL * @return ArchiveReader for given URL * @throws Exception on error (no suitable reader, or internal error) */ public ArchiveReader getArchiveReader(final String url) throws Exception { // Determine prefix final int delim = url.indexOf(':'); if (delim < 0) throw new Exception("Missing prefix in URL " + url); final String prefix = url.substring(0, delim); // Locate implementation for that prefix final ArchiveReaderFactory factory = reader_factories.get(prefix); if (factory == null) throw new Exception("Unkown archive reader URL " + url); return factory.getArchiveReader(url); } }
[ "kasemirk@ornl.gov" ]
kasemirk@ornl.gov
023e70bfc97a230e95f59c35321cffe4a97e170f
84daf19073e34bd72dbad758b99efe8fba1387ed
/muck-parent/muck-service/src/main/java/com/muck/advice/LoggerAdvice.java
6fb95cc92345849170402e7a81badc4133c7bd7c
[]
no_license
gk1996TZ/gk1996TZ.github.io
359f0328474cb8a6e783d03967c03aaac6302900
3739e38e18159bf6fb8f780d162c68178a330d57
refs/heads/master
2020-04-01T17:20:08.275143
2018-11-01T08:34:34
2018-11-01T08:35:00
153,423,909
1
0
null
null
null
null
UTF-8
Java
false
false
4,052
java
package com.muck.advice; import java.lang.reflect.Method; import java.util.Date; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.beans.factory.annotation.Autowired; import com.muck.annotation.Logger; import com.muck.domain.Log; import com.muck.domain.Manager; import com.muck.exception.base.BizException; import com.muck.handler.IdTypeHandler; import com.muck.service.LogService; import com.muck.utils.ArrayUtils; import com.muck.utils.DateUtils; /** * @Description: 日志切面 * @version: v1.0.0 * @author: 展昭 * @date: 2018年4月28日 下午3:41:03 */ public class LoggerAdvice { @Autowired private LogService logService; @Autowired private HttpSession session; /** * @Description: 保存记录日志 * @author: 展昭 * @date: 2018年4月28日 下午3:41:51 */ public Object recordLog(ProceedingJoinPoint pjp) throws Throwable { // 首先获取要捕获的方法签名 MethodSignature methodSignature = (MethodSignature) pjp.getSignature(); // 获取方法 Method targetMethod = methodSignature.getMethod(); // 判断此方法是否存在Logger注解 Logger logger = targetMethod.getAnnotation(Logger.class); if(logger == null){ // 为空表示不存在则直接放行 return pjp.proceed(); }else{ // 如果不为空则表示存在,存在则意味着要进行日志处理 // 第一步、创建日志 Log log = new Log(); // 设置操作时间 log.setOperatorTime(new Date()); // 设置操作模块 log.setOperatorModel(logger.operatorModel()); try { // 2、设置操作人的信息,从session中获取操作人信息 if(session != null){ Manager manager = (Manager)session.getAttribute("manager"); if(manager != null){ String phone = manager.getManagerPhone(); log.setOperatorId(IdTypeHandler.decode(manager.getId())); log.setOperatorName(manager.getManagerName()); log.setOperatorPhone(phone); log.setOperatorAccount(phone == null ? "" : phone); } } // 3、操作类型 String type = pjp.getSignature().getName(); log.setOperatorType(type + "("+logger.operatorDesc()+")"); // 4、操作的参数 Object[] params = pjp.getArgs(); if(params!=null && params.length > 0){ for(int i = 0 ; i < params.length ; i++){ Object param = params[i]; if(param instanceof HttpServletRequest || param instanceof HttpServletResponse){ params[i] = null; } } log.setOperatorParams(ArrayUtils.array2str(params)); } // 5、设置描述说明 log.setMemo(setMemo(log)); // 6、调用目标方法 Object ret = pjp.proceed(); // 7、设置操作反馈结果 log.setOperatorResult("success"); // 8、设置操作结果信息 if(ret != null){ log.setOperatorResultMsg(ret.toString()); } return ret; }catch (Throwable e) { // 如果有异常,则设置异常信息,这种异常是我们系统的异常 log.setOperatorResult("failure"); // 设置操作反馈结果 if(e instanceof BizException){ BizException ex = (BizException)e; log.setOperatorResultMsg(ex.getStatusCode().getMessage()); }else{ log.setOperatorResultMsg(e.getMessage()); // 设置操作结果信息 } throw e; }finally{ // 不管成功与否,都要保存日志 logService.save(log); } } } // 设置备注信息 private String setMemo(Log log){ // 账号 String account = log.getOperatorAccount(); // 格式化日期 String date = DateUtils.formatDate(log.getOperatorTime(), null); // 操作 String type = log.getOperatorType(); log.setCreatedTime(log.getOperatorTime()); log.setUpdatedTime(log.getOperatorTime()); return account + " 账号在 " + date + " 操作了 " + log.getOperatorModel() + " 模块中的 " + type + " 操作"; } }
[ "gk1996dd@163.com" ]
gk1996dd@163.com
984f7b4ebfc699be4fe8683e47601d6163d14737
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/30/30_d314a27185384c894c07e8737fb8472e1637657c/ToolMenu/30_d314a27185384c894c07e8737fb8472e1637657c_ToolMenu_s.java
27742d27e5925f42faeca1033ebccbba45e08ee2
[]
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,855
java
package editor.window; import java.util.ArrayList; import de.matthiasmann.twl.Button; import de.matthiasmann.twl.DialogLayout; import de.matthiasmann.twl.DialogLayout.Group; import editor.action_listener.ActionEvent; import editor.action_listener.ActionListener; import engine.window.components.Window; import engine.window.components.WindowList; public class ToolMenu extends Window implements ActionListener { private ArrayList<ActionListener> action_listeners; private Button file_window; private Button palette_window; private Button grid_window; private Button perspective_window; private Button layer_window; private Button mirror_window; private Button color_window; private WindowList windows; public ToolMenu(WindowList windows) { this.windows = windows; action_listeners = new ArrayList<ActionListener>(); setTitle("Tool Menu"); createMenu(); createButtonCallbacks(); setSize(300, 150); } public void createMenu() { // Create the layout and button instances DialogLayout layout = new DialogLayout(); file_window = new Button("File"); file_window.setTheme("file_window"); palette_window = new Button("Colors"); palette_window.setTheme("palette_window"); grid_window = new Button("DrawSpace"); grid_window.setTheme("grid_window"); perspective_window = new Button("Perspective"); perspective_window.setTheme("perspective_window"); layer_window = new Button("Layer"); layer_window.setTheme("file_window"); mirror_window = new Button("Mirror"); mirror_window.setTheme("mirror_window"); color_window = new Button("Color"); color_window.setTheme("color_window"); file_window.setSize(200, 30); palette_window.setSize(200, 30); grid_window.setSize(200, 30); perspective_window.setSize(200, 30); layer_window.setSize(200, 30); mirror_window.setSize(200, 30); color_window.setSize(200, 30); // !!!EXAMPLE OF DIALOG LAYOUT!!!// // Sequential groups are like a Swing boxlayout and just lists from top // to bottom // Parallel groups align each start and size and can be cascaded // // Group for holding the Horizontal alignment of the buttons Group button_hgroup = layout .createSequentialGroup() .addGap() // Keeps all the buttons in a single vertical line as opposed to // staggering // left to right per row .addGroup(layout.createParallelGroup( file_window, palette_window, grid_window, perspective_window, layer_window, mirror_window, color_window) ) .addGap(); // Group for holding the Vertical alignment of the buttons Group button_vgroup = layout.createSequentialGroup() .addGap() // Add each widget without forming a group so that they rest one // under the other .addWidget(file_window) .addWidget(palette_window) .addWidget(grid_window) .addWidget(perspective_window) .addWidget(layer_window) .addWidget(mirror_window) .addWidget(color_window); // All Dialog layout groups must have both a HorizontalGroup and // VerticalGroup // Otherwise "incomplete" exception is thrown and layout is not applied layout.setHorizontalGroup(button_hgroup); layout.setVerticalGroup(button_vgroup); // Make sure to add the layout to the frame add(layout); } private void createButtonCallbacks() { file_window.addCallback(new Runnable() { @Override public void run() { windows.getByName("file_window").setVisible(true); } }); palette_window.addCallback(new Runnable() { @Override public void run() { windows.getByName("palette_window").setVisible(true); } }); grid_window.addCallback(new Runnable() { @Override public void run() { windows.getByName("grid_window").setVisible(true); } }); perspective_window.addCallback(new Runnable() { @Override public void run() { windows.getByName("perspective_window").setVisible(true); } }); layer_window.addCallback(new Runnable() { @Override public void run() { windows.getByName("layer_window").setVisible(true); } }); mirror_window.addCallback(new Runnable() { @Override public void run() { windows.getByName("mirror_window").setVisible(true); } }); color_window.addCallback(new Runnable() { @Override public void run() { windows.getByName("color_window").setVisible(true); } }); } /*Public Callback methods*/ public void addActionListener(ActionListener listener) { action_listeners.add(listener); } private void fireActionEvent() { for (ActionListener ae : action_listeners) { ae.actionPerformed(new ActionEvent(this)); } } @Override public void actionPerformed(ActionEvent e) { fireActionEvent(); } /*End Public Callback methods*/ }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
297042b7ade75d09ba64977729da602a6d4f2458
16be4b5d7b111dae18a4117b0dcf434cf44e4215
/src/main/java/q700/Q689_MaximumSumOf3NonOverlappingSubarrays.java
1be0b85cd28344c3be2261ef47a83d50c74772c8
[ "MIT" ]
permissive
sunxuia/leetcode-solution-java
a3d8d680fabc014216ef9837d119b02acde923b5
2794f83c9e80574f051c00b8a24c6a307bccb6c5
refs/heads/master
2022-11-12T13:31:04.464274
2022-11-09T14:20:28
2022-11-09T14:20:28
219,247,361
1
0
MIT
2020-10-26T10:55:12
2019-11-03T03:43:25
Java
UTF-8
Java
false
false
3,421
java
package q700; import org.junit.runner.RunWith; import util.runner.Answer; import util.runner.LeetCodeRunner; import util.runner.TestData; import util.runner.data.DataExpectation; /** * https://leetcode.com/problems/maximum-sum-of-3-non-overlapping-subarrays/ * * In a given array nums of positive integers, find three non-overlapping subarrays with maximum sum. * * Each subarray will be of size k, and we want to maximize the sum of all 3*k entries. * * Return the result as a list of indices representing the starting position of each interval (0-indexed). If there * are multiple answers, return the lexicographically smallest one. * * Example: * * Input: [1,2,1,2,6,7,5,1], 2 * Output: [0, 3, 5] * Explanation: Subarrays [1, 2], [2, 6], [7, 5] correspond to the starting indices [0, 3, 5]. * We could have also taken [2, 1], but an answer of [1, 3, 5] would be lexicographically larger. * * * * Note: * * nums.length will be between 1 and 20000. * nums[i] will be between 1 and 65535. * k will be between 1 and floor(nums.length / 3). */ @RunWith(LeetCodeRunner.class) public class Q689_MaximumSumOf3NonOverlappingSubarrays { // https://www.cnblogs.com/grandyang/p/8453386.html // 遍历选择中间的区间, 然后从左右选择. @Answer public int[] maxSumOfThreeSubarrays(int[] nums, int k) { final int n = nums.length; int[] sums = new int[n + 1]; for (int i = 0; i < n; i++) { sums[i + 1] = sums[i] + nums[i]; } // kSums[i] 表示 [i, i + k) 区间元素的总和 int[] kSums = new int[n - k + 1]; for (int i = 0; i <= n - k; i++) { kSums[i] = sums[i + k] - sums[i]; } // left[i] 表示在区间[0, i) 范围内长度为k 且和最大的子数组的起始位置 int[] left = new int[n - 2 * k + 1]; int best = 0; for (int i = k; i <= n - 2 * k; i++) { best = kSums[i - k] > kSums[best] ? i - k : best; left[i] = best; } // right[i] 表示在区间 [i, n) 范围内长度为k 且和最大的子数组的起始位置 int[] right = new int[n - k + 1]; best = n - k; for (int i = n - k; i >= 2 * k; i--) { best = kSums[i] >= kSums[best] ? i : best; right[i] = best; } // 遍历数组, 选择中间的区间 int[] res = new int[3]; int max = 0; for (int i = k; i <= n - 2 * k; i++) { int sum = kSums[left[i]] + kSums[i] + kSums[right[i + k]]; if (max < sum) { max = sum; res[0] = left[i]; res[1] = i; res[2] = right[i + k]; } } return res; } @TestData public DataExpectation example = DataExpectation .createWith(new int[]{1, 2, 1, 2, 6, 7, 5, 1}, 2).expect(new int[]{0, 3, 5}); @TestData public DataExpectation normal1 = DataExpectation .createWith(new int[]{9, 8, 7, 6, 2, 2, 2, 2}, 2).expect(new int[]{0, 2, 4}); @TestData public DataExpectation normal2 = DataExpectation .createWith(new int[]{7, 13, 20, 19, 19, 2, 10, 1, 1, 19}, 3).expect(new int[]{1, 4, 7}); @TestData public DataExpectation normal3 = DataExpectation .createWith(new int[]{20, 18, 9, 2, 14, 1, 10, 3, 11, 18}, 3).expect(new int[]{0, 4, 7}); }
[ "ntsunxu@163.com" ]
ntsunxu@163.com
14259899e1677767ac641ab963c22baf0b03184c
c0fe21b86f141256c85ab82c6ff3acc56b73d3db
/iotcore/src/main/java/com/jdcloud/sdk/service/iotcore/model/QueryDeviceDetailResponse.java
b81ffa3c44f53d6539f75859e5fbee00a94ac6af
[ "Apache-2.0" ]
permissive
jdcloud-api/jdcloud-sdk-java
3fec9cf552693520f07b43a1e445954de60e34a0
bcebe28306c4ccc5b2b793e1a5848b0aac21b910
refs/heads/master
2023-07-25T07:03:36.682248
2023-07-25T06:54:39
2023-07-25T06:54:39
126,275,669
47
61
Apache-2.0
2023-09-07T08:41:24
2018-03-22T03:41:41
Java
UTF-8
Java
false
false
1,065
java
/* * Copyright 2018 JDCLOUD.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. * * DeviceInfo * device管理模块 * * OpenAPI spec version: v2 * Contact: * * NOTE: This class is auto generated by the jdcloud code generator program. */ package com.jdcloud.sdk.service.iotcore.model; import com.jdcloud.sdk.service.JdcloudResponse; /** * 查询设备详情 */ public class QueryDeviceDetailResponse extends JdcloudResponse<QueryDeviceDetailResult> implements java.io.Serializable { private static final long serialVersionUID = 1L; }
[ "tancong@jd.com" ]
tancong@jd.com
3e5515f0e41c915bffb04ee819d846c60062d5ec
0031716e70b380c4564a9ba506df3c01673e4dc5
/app/src/main/java/com/alipay/sdk/protocol/b.java
10594fcedc6947573a002627fea2622ddf93aa27
[]
no_license
sridhar191986/DouBanYueDu
fc08c583f4ef53bb293f967de2a2772eb5b55719
fd126db0e3ed684f27a498eda7eaedb06e6c396c
refs/heads/master
2020-09-07T14:32:40.823864
2016-02-18T10:22:58
2016-02-18T10:22:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,266
java
package com.alipay.sdk.protocol; import android.text.TextUtils; import com.alipay.sdk.cons.a; import com.alipay.sdk.cons.c; import com.douban.book.reader.constant.Constants; import com.sina.weibo.sdk.register.mobile.SelectCountryActivity; import io.realm.internal.Table; import org.json.JSONObject; public final class b { String a; String b; String c; String d; String e; boolean f; boolean g; boolean h; String i; String j; String k; JSONObject l; private b(String str) { this.g = true; this.h = true; this.a = str; } private JSONObject b() { return this.l; } private String c() { return this.k; } private String d() { return this.i; } private String e() { return this.j; } private static b a(JSONObject jSONObject) { String str; String str2; String str3; String str4; boolean z; String str5 = null; boolean z2 = true; if (jSONObject == null || !jSONObject.has(SelectCountryActivity.EXTRA_COUNTRY_NAME)) { str = null; } else { str = jSONObject.optString(SelectCountryActivity.EXTRA_COUNTRY_NAME); } if (jSONObject == null || !jSONObject.has(c.f)) { str2 = null; } else { str2 = jSONObject.optString(c.f); } if (jSONObject == null || !jSONObject.has(c.g)) { str3 = null; } else { str3 = jSONObject.optString(c.g); } if (jSONObject == null || !jSONObject.has(c.h)) { str4 = null; } else { str4 = jSONObject.optString(c.h); } if (jSONObject != null && jSONObject.has(c.i)) { str5 = jSONObject.optString(c.i); } if (jSONObject == null || !jSONObject.has(c.j)) { z = true; } else { z = jSONObject.optBoolean(c.j, true); } boolean z3 = (jSONObject == null || !jSONObject.has(Constants.API_SCHEME)) ? true : !jSONObject.optBoolean(Constants.API_SCHEME); if (jSONObject != null && jSONObject.has(c.k)) { z2 = jSONObject.optBoolean(c.k); } String str6 = Table.STRING_DEFAULT_VALUE; if (jSONObject != null && jSONObject.has(c.l)) { str6 = jSONObject.optString(c.l); } String str7 = Table.STRING_DEFAULT_VALUE; if (jSONObject != null && jSONObject.has(c.m)) { str7 = jSONObject.optString(c.m); } String str8 = Table.STRING_DEFAULT_VALUE; if (jSONObject != null && jSONObject.has(c.n)) { str8 = jSONObject.optString(c.n); } return a(str, str2, str3, str4, str5, z, z3, z2, str6, str7, str8, jSONObject); } public static b a(JSONObject jSONObject, String str) { String str2 = null; boolean z = true; JSONObject optJSONObject = jSONObject.optJSONObject(str); String optString = (optJSONObject == null || !optJSONObject.has(SelectCountryActivity.EXTRA_COUNTRY_NAME)) ? null : optJSONObject.optString(SelectCountryActivity.EXTRA_COUNTRY_NAME); String optString2 = (optJSONObject == null || !optJSONObject.has(c.f)) ? null : optJSONObject.optString(c.f); String optString3 = (optJSONObject == null || !optJSONObject.has(c.g)) ? null : optJSONObject.optString(c.g); String optString4 = (optJSONObject == null || !optJSONObject.has(c.h)) ? null : optJSONObject.optString(c.h); if (optJSONObject != null && optJSONObject.has(c.i)) { str2 = optJSONObject.optString(c.i); } boolean optBoolean = (optJSONObject == null || !optJSONObject.has(c.j)) ? true : optJSONObject.optBoolean(c.j, true); boolean z2 = (optJSONObject == null || !optJSONObject.has(Constants.API_SCHEME)) ? true : !optJSONObject.optBoolean(Constants.API_SCHEME); if (optJSONObject != null && optJSONObject.has(c.k)) { z = optJSONObject.optBoolean(c.k); } String str3 = Table.STRING_DEFAULT_VALUE; if (optJSONObject != null && optJSONObject.has(c.l)) { str3 = optJSONObject.optString(c.l); } String str4 = Table.STRING_DEFAULT_VALUE; if (optJSONObject != null && optJSONObject.has(c.m)) { str4 = optJSONObject.optString(c.m); } String str5 = Table.STRING_DEFAULT_VALUE; if (optJSONObject != null && optJSONObject.has(c.n)) { str5 = optJSONObject.optString(c.n); } return a(optString, optString2, optString3, optString4, str2, optBoolean, z2, z, str3, str4, str5, optJSONObject); } private static b a(String str, String str2, String str3, String str4, String str5, boolean z, boolean z2, boolean z3, String str6, String str7, String str8, JSONObject jSONObject) { String str9 = null; if (TextUtils.isEmpty(str)) { return null; } b bVar = new b(str); bVar.a = str; if (!TextUtils.isEmpty(str2)) { str9 = str2.trim(); } bVar.b = str9; bVar.c = str3; bVar.d = str4; bVar.e = str5; bVar.f = z; bVar.g = z2; bVar.h = z3; bVar.i = str6; bVar.j = str7; bVar.k = str8; bVar.l = jSONObject; return bVar; } private static b a(String str, a aVar) { return a(str, aVar.i, aVar.j, aVar.k, aVar.l, aVar.m, aVar.n, aVar.o, aVar.p, aVar.q, aVar.r, aVar.s); } private String f() { return this.a; } private String g() { if (TextUtils.isEmpty(this.b)) { this.b = a.b; } return this.b; } private String h() { return this.c; } public final JSONObject a() { try { return new JSONObject(this.c); } catch (Exception e) { return null; } } private String i() { return this.d; } private String j() { return this.e; } private boolean k() { return this.f; } private boolean l() { return this.g; } private boolean m() { return this.h; } }
[ "blankeeee@gmail.com" ]
blankeeee@gmail.com
6dbbe2bb9a98937ddb406bfc4455830f17f5a4a6
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/24/org/apache/commons/math3/analysis/function/Gaussian_Gaussian_89.java
ba4e21d6b4a90524d4a039b6387aa6f33b5362dc
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
518
java
org apach common math3 analysi function href http wikipedia org wiki gaussian function gaussian function version gaussian univari differenti univariatedifferenti differenti univari function differentiableunivariatefunct normal gaussian unit standard deviat gaussian
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
78ce3ec4db8478ce1488a9ddca7d5b1b8a801405
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.qqlite/assets/exlibs.1.jar/classes.jar/fek.java
1a52a76aeba19351283a6938f9686b0ee18bf186
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
741
java
import android.os.Parcel; import android.os.Parcelable.Creator; import com.tencent.open.agent.datamodel.Friend; public final class fek implements Parcelable.Creator { public Friend a(Parcel paramParcel) { Friend localFriend = new Friend(); localFriend.a = paramParcel.readString(); localFriend.b = paramParcel.readString(); localFriend.c = paramParcel.readString(); localFriend.d = paramParcel.readString(); return localFriend; } public Friend[] a(int paramInt) { return new Friend[paramInt]; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.qqlite\assets\exlibs.1.jar\classes.jar * Qualified Name: fek * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
7ace457d60838439bf025f194ff19ffc298ac2f8
bfefd5fbaebef9b6ed1d146b2ad897a8c14458b3
/protocolEngine/src/main/java/cn/com/swain/support/protocolEngine/task/AbsSocketDataTask.java
4bb6481301763c962b40ec1ef803c87a1838907a
[]
no_license
GuoqiangSun/CommonLibrary
1ec15dca1b800d2d12af069a4f02f8f392587e27
dc13aba6f180e768769c77cd0604b6d9d47886b7
refs/heads/master
2021-07-24T12:43:42.555735
2020-04-16T08:11:41
2020-04-16T08:11:41
146,692,957
2
0
null
null
null
null
UTF-8
Java
false
false
745
java
package cn.com.swain.support.protocolEngine.task; import cn.com.swain.support.protocolEngine.datagram.SocketDataArray; /** * author: Guoqiang_Sun * date : 2018/4/9 0009 * desc : */ public abstract class AbsSocketDataTask extends AbsProtocolTask<SocketDataArray, SocketDataArray> { public AbsSocketDataTask() { } @Override protected SocketDataArray onBackgroundTask(SocketDataArray mParams) { doTask(mParams); return mParams; } @Override protected void onPostExecute(SocketDataArray mResult) { super.onPostExecute(mResult); if (mResult != null) { mResult.setISUnUsed(); } } protected abstract void doTask(SocketDataArray mSocketDataArray); }
[ "2481288068@qq.com" ]
2481288068@qq.com
95f2210c375366fd8a75579b6d5c7902840c3073
2f57e8c430fce1bfecf5345ac9b53bab1e2deb9c
/jtransc-rt/src/java/util/regex/Matcher.java
9395524233f7ec5cb7a35fae145a4ec4aa7b28b1
[ "Apache-2.0" ]
permissive
GMadorell/jtransc
35f10c90b4ba58105a0ac56e579c3e1073db4f40
8298d6a74903842e5027a44bbd98b2c74e33c927
refs/heads/master
2021-01-14T10:23:37.171690
2016-03-06T19:39:41
2016-03-06T19:39:41
53,316,788
0
0
null
2016-03-07T10:27:53
2016-03-07T10:27:53
null
UTF-8
Java
false
false
5,333
java
/* * Copyright 2016 Carlos Ballesteros Velasco * * 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 java.util.regex; import jtransc.annotation.haxe.HaxeAddMembers; import jtransc.annotation.haxe.HaxeMethodBody; @HaxeAddMembers({ "public var _ereg:EReg;", "public var _matches:Bool;", "public var _offset:Int = 0;", "public var _matchPos:Int = 0;", "public var _matchLen:Int = 0;", "public function _find() {\n" + "\tvar r = this._ereg;\n" + "\tthis._matches = r.matchSub(this.text._str, this._offset);\n" + "\tif (this._matches) {\n" + "\t\tvar rpos = r.matchedPos();\n" + "\t\tthis._matchPos = rpos.pos;\n" + "\t\tthis._matchLen = rpos.len;\n" + "\t\tthis._offset = rpos.pos + rpos.len;\n" + "\t} else {\n" + "\t\tthis._matchPos = 0;\n" + "\t\tthis._matchLen = 0;\n" + "\t}\n" + "\treturn this._matches;\n" + "}" //public static final int UNIX_LINES = 0x01; //public static final int CASE_INSENSITIVE = 0x02; //public static final int COMMENTS = 0x04; //public static final int MULTILINE = 0x08; //public static final int LITERAL = 0x10; //public static final int DOTALL = 0x20; //public static final int UNICODE_CASE = 0x40; //public static final int CANON_EQ = 0x80; //public static final int UNICODE_CHARACTER_CLASS = 0x100; //i case insensitive matching //g global replace or split, see below //m multiline matching, ^ and $ represent the beginning and end of a line //s the dot . will also match newlines (Neko, C++, PHP, Flash and Java targets only) //u use UTF-8 matching (Neko and C++ targets only) }) public final class Matcher implements MatchResult { private Pattern parent; private String pattern; private int flags; private String text; Matcher(Pattern parent, CharSequence text) { this.parent = parent; this.pattern = parent.pattern(); this.flags = parent.flags(); this.text = text.toString(); _init(); } @HaxeMethodBody( "var opts = '';\n" + "if ((this.flags & 0x02) != 0) opts += 'i';\n" + "if ((this.flags & 0x08) != 0) opts += 'm';\n" + //"if ((this.flags & 0x20) != 0) opts += 's';\n" + // dotall default on javascript "this._ereg = new EReg(this.pattern._str, opts);\n" + "this._matches = this._ereg.match(this.text._str);" ) private void _init() { } public Pattern pattern() { return this.parent; } public MatchResult toMatchResult() { return this; } native public Matcher usePattern(Pattern newPattern); native public Matcher reset(); public Matcher reset(CharSequence input) { this.text = input.toString(); this.reset(); return this; } @HaxeMethodBody("return this._matchPos;") native public int start(); public int start(int group) { if (group == 0) return start(); throw new Error("No implemented Matcher.start(int group) with group != 0"); } native public int start(String name); @HaxeMethodBody("return this._matchPos + this._matchLen;") native public int end(); public int end(int group) { if (group == 0) return end(); throw new Error("No implemented Matcher.end(int group) with group != 0"); } native public int end(String name); @HaxeMethodBody("return HaxeNatives.str(this._ereg.matched(0));") native public String group(); @HaxeMethodBody("return HaxeNatives.str(this._ereg.matched(p0));") native public String group(int group); native public String group(String name); native public int groupCount(); @HaxeMethodBody("return this._matches;") native public boolean matches(); @HaxeMethodBody("return _find();") native public boolean find(); @HaxeMethodBody("this._offset = p0; return _find();") native public boolean find(int start); native public boolean lookingAt(); native public static String quoteReplacement(String s); native public Matcher appendReplacement(StringBuffer sb, String replacement); native public StringBuffer appendTail(StringBuffer sb); native public String replaceAll(String replacement); native public String replaceFirst(String replacement); native public Matcher region(int start, int end); native public int regionStart(); native public int regionEnd(); native public boolean hasTransparentBounds(); native public Matcher useTransparentBounds(boolean b); native public boolean hasAnchoringBounds(); native public Matcher useAnchoringBounds(boolean b); native public String toString(); native public boolean hitEnd(); native public boolean requireEnd(); }
[ "soywiz@gmail.com" ]
soywiz@gmail.com
58531d4153ccdd055026b9fae726a8d112b4b23e
23060ad2adeb62cf3bfe8cec07c21bce9c8c7b63
/modules/flowable5-camel-test/src/test/java/org/activiti/camel/revisited/ParallelProcessRevisitedTest.java
331781aa30bd64e91a830ea125c816c15dff449f
[ "Apache-2.0" ]
permissive
motorina0/flowable-engine
2f469cd856a7164a70434b23daf48c8b155b0b03
0753345a80d97bcfaa00f942ae21a21430c443d8
refs/heads/master
2020-07-26T23:15:59.942151
2017-01-20T12:58:55
2017-01-20T12:58:55
73,711,118
0
0
null
2016-11-14T14:42:53
2016-11-14T14:12:36
Java
UTF-8
Java
false
false
1,949
java
/* 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.activiti.camel.revisited; import org.activiti.spring.impl.test.SpringFlowableTestCase; import org.apache.camel.CamelContext; import org.apache.camel.builder.RouteBuilder; import org.flowable.engine.runtime.ProcessInstance; import org.flowable.engine.test.Deployment; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; @ContextConfiguration("classpath:generic-camel-flowable-context.xml") public class ParallelProcessRevisitedTest extends SpringFlowableTestCase { @Autowired protected CamelContext camelContext; public void setUp() throws Exception { camelContext.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("activiti:parallelCamelProcessRevisited:serviceTaskAsync1").to("bean:sleepBean?method=sleep"); from("activiti:parallelCamelProcessRevisited:serviceTaskAsync2").to("bean:sleepBean?method=sleep"); } }); } @Deployment(resources = { "process/revisited/parallel-revisited.bpmn20.xml" }) public void testRunProcess() throws Exception { ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("parallelCamelProcessRevisited"); Thread.sleep(4000); assertEquals(0, runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.getId()).count()); } }
[ "tijs.rademakers@gmail.com" ]
tijs.rademakers@gmail.com
b0e905d10b29ce7cf278a0d322cec046adf4f44b
240b4e94ffebceb66d9812728a84fa4f95739303
/ch18/src/sec04/exam10_FileOutputStream/FileOutputStreamExample.java
3cab0d6a0a37b0beedfc4bcb95411b5e0288db1c
[]
no_license
optical3mild/ezen-Java_Lecture
b90bee06a71bfb8acd42c07914536e6cbcebe1b8
6c6e57b5cc80ab6d7970b899ecc80c358453656e
refs/heads/master
2020-04-28T19:51:35.634854
2019-05-28T08:51:26
2019-05-28T08:51:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
735
java
package sec04.exam10_FileOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; public class FileOutputStreamExample { public static void main(String[] args) throws Exception { String originalFileName = "C:/Users/Public/Pictures/Sample Pictures/Lighthouse.jpg"; String targetFileName = "c:/temp/Lighthouse.jpg"; FileInputStream fis = new FileInputStream(originalFileName); FileOutputStream fos = new FileOutputStream(targetFileName); int readByteNo; byte[] readBytes = new byte[100]; while((readByteNo = fis.read(readBytes)) != -1) { fos.write(readBytes,0,readByteNo); } fos.flush(); fos.close(); fis.close(); System.out.println("복사가 잘 되었습니다"); } }
[ "chupa.pal.chad@gmail.com" ]
chupa.pal.chad@gmail.com
ce48ec433cdcaec3ca75880c51a5d848f2043770
41f4f1fd29561eb376deb9aee44a1c2227af87f9
/bus-health/src/main/java/org/aoju/bus/health/linux/hardware/LinuxGlobalMemory.java
40c89767523fcf1be8712a4e935da54dfdf81058
[ "MIT" ]
permissive
learn-knowlege/bus
ddde17b3fa84fdf909d11d3ece9214ba21da902d
25f2e1cafed7c1a2a483d5e168b6c415a8f25fad
refs/heads/master
2023-01-14T09:54:33.479981
2020-10-13T10:37:35
2020-10-13T10:37:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,151
java
/********************************************************************************* * * * The MIT License (MIT) * * * * Copyright (c) 2015-2020 aoju.org OSHI and other contributors. * * * * Permission is hereby granted, free of charge, to any person obtaining a copy * * of this software and associated documentation files (the "Software"), to deal * * in the Software without restriction, including without limitation the rights * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included in * * all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * * THE SOFTWARE. * ********************************************************************************/ package org.aoju.bus.health.linux.hardware; import org.aoju.bus.core.annotation.ThreadSafe; import org.aoju.bus.core.lang.RegEx; import org.aoju.bus.core.lang.tuple.Pair; import org.aoju.bus.core.toolkit.FileKit; import org.aoju.bus.health.Builder; import org.aoju.bus.health.Executor; import org.aoju.bus.health.Memoize; import org.aoju.bus.health.builtin.hardware.AbstractGlobalMemory; import org.aoju.bus.health.builtin.hardware.VirtualMemory; import org.aoju.bus.health.linux.ProcPath; import java.util.List; import java.util.function.Supplier; /** * Memory obtained by /proc/meminfo and sysinfo.totalram * * @author Kimi Liu * @version 6.1.1 * @since JDK 1.8+ */ @ThreadSafe final class LinuxGlobalMemory extends AbstractGlobalMemory { public static final long PAGE_SIZE = Builder .parseLongOrDefault(Executor.getFirstAnswer("getconf PAGE_SIZE"), 4096L); private final Supplier<Pair<Long, Long>> availTotal = Memoize.memoize(LinuxGlobalMemory::readMemInfo, Memoize.defaultExpiration()); private final Supplier<VirtualMemory> vm = Memoize.memoize(this::createVirtualMemory); /** * Updates instance variables from reading /proc/meminfo. While most of the * information is available in the sysinfo structure, the most accurate * calculation of MemAvailable is only available from reading this pseudo-file. * The maintainers of the Linux Kernel have indicated this location will be kept * up to date if the calculation changes: see * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/? * id=34e431b0ae398fc54ea69ff85ec700722c9da773 * <p> * Internally, reading /proc/meminfo is faster than sysinfo because it only * spends time populating the memory components of the sysinfo structure. */ private static Pair<Long, Long> readMemInfo() { long memFree = 0L; long activeFile = 0L; long inactiveFile = 0L; long sReclaimable = 0L; long memTotal = 0L; long memAvailable; List<String> procMemInfo = FileKit.readLines(ProcPath.MEMINFO); for (String checkLine : procMemInfo) { String[] memorySplit = RegEx.SPACES.split(checkLine, 2); if (memorySplit.length > 1) { switch (memorySplit[0]) { case "MemTotal:": memTotal = Builder.parseDecimalMemorySizeToBinary(memorySplit[1]); break; case "MemAvailable:": memAvailable = Builder.parseDecimalMemorySizeToBinary(memorySplit[1]); // We're done! return Pair.of(memAvailable, memTotal); case "MemFree:": memFree = Builder.parseDecimalMemorySizeToBinary(memorySplit[1]); break; case "Active(file):": activeFile = Builder.parseDecimalMemorySizeToBinary(memorySplit[1]); break; case "Inactive(file):": inactiveFile = Builder.parseDecimalMemorySizeToBinary(memorySplit[1]); break; case "SReclaimable:": sReclaimable = Builder.parseDecimalMemorySizeToBinary(memorySplit[1]); break; default: // do nothing with other lines break; } } } // We didn't find MemAvailable so we estimate from other fields return Pair.of(memFree + activeFile + inactiveFile + sReclaimable, memTotal); } @Override public long getAvailable() { return availTotal.get().getLeft(); } @Override public long getTotal() { return availTotal.get().getRight(); } @Override public long getPageSize() { return PAGE_SIZE; } @Override public VirtualMemory getVirtualMemory() { return vm.get(); } private VirtualMemory createVirtualMemory() { return new LinuxVirtualMemory(this); } }
[ "839536@qq.com" ]
839536@qq.com
6a2763a00cfe13b11764d58c11c374810d82e0c3
68349c585289cc3ef81998d79a67607eb6bb7520
/app/src/main/java/com/wd/winddots/mvp/widget/adapter/rv/PointsAdapter.java
125b060b23c9ed22ae40d9a2e8bc77d28d03f67a
[]
no_license
BooksCup/WindDots
9b0feb141724618a8aa93d30f13442d9507de5f4
d72cd0d1a17f97ae8dee85d7debdef2a30596a3d
refs/heads/master
2023-04-03T08:55:54.076503
2021-04-08T06:02:41
2021-04-08T06:02:41
340,230,253
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package com.wd.winddots.mvp.widget.adapter.rv; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import com.wd.winddots.R; import com.wd.winddots.bean.resp.PointsListBean; import java.util.List; import androidx.annotation.Nullable; public class PointsAdapter extends BaseQuickAdapter<PointsListBean, BaseViewHolder> { public PointsAdapter(int layoutResId, @Nullable List<PointsListBean> data) { super(layoutResId, data); } @Override protected void convert(BaseViewHolder helper, PointsListBean item) { helper.setText(R.id.item_points_time,item.getCreateTime()); } }
[ "812809680@qq.com" ]
812809680@qq.com
d215841c1e67676a8b2777798c4c371abc84cb69
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/spoon/learning/3414/MatchingScanner.java
d56cd417fe155aaad9fe01dbc020861b093de888
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,224
java
/** * Copyright (C) 2006-2018 INRIA and contributors * Spoon - http://spoon.gforge.inria.fr/ * * This software is governed by the CeCILL-C License under French law and * abiding by the rules of distribution of free software. You can use, modify * and/or redistribute the software under the terms of the CeCILL-C license as * circulated by CEA, CNRS and INRIA at http://www.cecill.info. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details. * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ package spoon.pattern.internal.matcher; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; import spoon.SpoonException; import spoon.pattern.Match; import spoon.pattern.internal.node.ListOfNodes; import spoon.reflect.declaration.CtElement; import spoon.reflect.meta.ContainerKind; import spoon.reflect.path.CtRole; import spoon.reflect.visitor.EarlyTerminatingScanner; import spoon.reflect.visitor.chain.CtConsumer; import spoon.support.util.ImmutableMapImpl; /** * Represents a Match of TemplateMatcher */ public class MatchingScanner extends EarlyTerminatingScanner<Void> { private final ListOfNodes pattern; private CtConsumer<? super Match> matchConsumer; public MatchingScanner(ListOfNodes pattern, CtConsumer<? super Match> matchConsumer) { this.pattern = pattern; this.matchConsumer = matchConsumer; } @Override public void scan(CtRole role, CtElement element) { //This is called only for elements which are in single value attribute. Like `CtType#superClass` if (searchMatchInList(role, Collections.singletonList(element), false) == 0) { super.scan(role, element); } } @Override public void scan(CtRole role, Collection<? extends CtElement> elements) { if (elements == null) { return; } if (elements instanceof List<?>) { searchMatchInList(role, (List<? extends CtElement>) elements, true); } else if (elements instanceof Set<?>) { searchMatchInSet(role, (Set<? extends CtElement>) elements); } else { throw new SpoonException("Unexpected Collection type " + elements.getClass()); } } private int searchMatchInList(CtRole role, List<? extends CtElement> list, boolean scanChildren) { int matchCount = 0; if (!list.isEmpty()) { TobeMatched tobeMatched = TobeMatched.create( new ImmutableMapImpl(), ContainerKind.LIST, list); while (tobeMatched.hasTargets()){ TobeMatched nextTobeMatched = pattern.matchAllWith(tobeMatched); if (nextTobeMatched != null) { List<?> matchedTargets = tobeMatched.getMatchedTargets(nextTobeMatched); if (!matchedTargets.isEmpty()) { matchCount++; //send information about match to client matchConsumer.accept(new Match(matchedTargets, nextTobeMatched.getParameters())); //do not scan children of matched elements. They already matched, so we must not scan them again //use targets of last match together with new parameters for next match tobeMatched = nextTobeMatched.copyAndSetParams(new ImmutableMapImpl()); continue; } //else the template matches nothing. Understand it as no match in this context } if (scanChildren) { //scan children of each not matched element too super.scan(role, tobeMatched.getTargets().get(0)); } //try match with sub list starting on second element tobeMatched = tobeMatched.removeTarget(0); } } return matchCount; } private void searchMatchInSet(CtRole role, Set<? extends CtElement> set) { if (!set.isEmpty()) { //copy targets, because it might be modified by call of matchConsumer, when refactoring spoon model //use List, because Spoon uses Sets with predictable order - so keep the order TobeMatched tobeMatched = TobeMatched.create( new ImmutableMapImpl(), ContainerKind.SET, set); while (tobeMatched.hasTargets()) { TobeMatched nextTobeMatched = pattern.matchAllWith(tobeMatched); if (nextTobeMatched != null) { List<?> matchedTargets = tobeMatched.getMatchedTargets(nextTobeMatched); if (!matchedTargets.isEmpty()) { //send information about match to client matchConsumer.accept(new Match(matchedTargets, nextTobeMatched.getParameters())); //do not scan children of matched elements. They already matched, so we must not scan them again tobeMatched = nextTobeMatched; //we have found a match. Try next match continue; } //else the template matches nothing. Understand it as no more match in this context } //there was no match. Do not try it again break; } //scan remaining not matched items of the Set for (Object object : tobeMatched.getTargets()) { //scan children of each not matched element too super.scan(role, object); } } } @Override public void scan(CtRole role, Map<String, ? extends CtElement> elements) { // TODO Auto-generated method stub super.scan(role, elements); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
da1bd05875dfb5341c994a6c5679776d05799bcc
821b1befccc702f939c67a843f728d1a7b7d9ca8
/src/main/java/design_patterns/_02_behavioral/_01_chain_of_responsibility/_01_basic_implementation/Question.java
0d33a8a591c9ca0bdb474b196de5ac193e823d62
[]
no_license
sahwar/JavaMethodsProgramming
d96a2d941111eb6e5cf8160bbd13f40db09c3c5b
fa5d90fbf8d622c254998ae33e66eb80c18f106c
refs/heads/master
2021-05-31T13:51:22.495705
2016-04-07T21:33:07
2016-04-07T21:33:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
570
java
package design_patterns._02_behavioral._01_chain_of_responsibility._01_basic_implementation; public class Question implements BaseInterface { private String message = ""; private SubTask parent = null; public Question(SubTask parent, String message) { this.parent = parent; this.message = message; } public String handleRequest() { System.out.println("message in Question: " + message); if (parent == null) { return message; } else { return parent.handleRequest(); } } }
[ "dmytro.burdyga@gmail.com" ]
dmytro.burdyga@gmail.com
a0831d22f7ca5e0b17e70c31326a714012db0eb4
dddbc98625203127ffc5190b25a013334b7ec690
/commons/com.b2international.commons.base/src/com/b2international/commons/console/CustomConsoleDevice.java
c69394b571411205b4ab780107821ec12f0628e3
[ "LicenseRef-scancode-free-unknown", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain", "EPL-1.0" ]
permissive
IHTSDO/snow-owl
55fdcd5966fba335d5226c52002405334c17d0db
90c17b806956ad15cdc66649aa4e193bad21ff46
refs/heads/master
2021-01-19T06:25:04.680073
2019-08-09T09:26:27
2019-08-09T09:26:27
32,463,362
12
1
Apache-2.0
2019-05-23T08:55:43
2015-03-18T14:22:29
Java
UTF-8
Java
false
false
2,191
java
/* * Copyright 2011-2015 B2i Healthcare Pte Ltd, http://b2i.sg * * 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.b2international.commons.console; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Reader; /** * */ /*default*/public class CustomConsoleDevice implements IConsoleDevice { private final BufferedReader reader; private final PrintWriter writer; CustomConsoleDevice(final InputStream is, final OutputStream os) { this.reader = new BufferedReader(new InputStreamReader(is)); this.writer = new PrintWriter(os, false); } /* (non-Javadoc) * @see com.b2international.commons.console.IConsoleDevice#printf(java.lang.String, java.lang.Object[]) */ @Override public IConsoleDevice printf(final String fmt, final Object... params) { writer.printf(fmt, params); return this; } /* (non-Javadoc) * @see com.b2international.commons.console.IConsoleDevice#readLine() */ @Override public String readLine() { try { return reader.readLine(); } catch (final Exception e) { throw new RuntimeException(e); } } /* (non-Javadoc) * @see com.b2international.commons.console.IConsoleDevice#readPassword() */ @Override public char[] readPassword() { return readLine().toCharArray(); } /* (non-Javadoc) * @see com.b2international.commons.console.IConsoleDevice#reader() */ @Override public Reader reader() { return reader; } /* (non-Javadoc) * @see com.b2international.commons.console.IConsoleDevice#writer() */ @Override public PrintWriter writer() { return writer; } }
[ "bbanfai@b2international.com" ]
bbanfai@b2international.com
29001e7712896c24bf4709dd01da21952bd629ed
410c3edff13b40190e3ef38aa60a42a4efc4ad67
/app/src/main/java/io/vproxy/app/app/cmd/handle/param/QueueHandle.java
18dd9491e448812e107d6d044e56dbc55b1a8209
[ "MIT" ]
permissive
wkgcass/vproxy
f3d783531688676932f60f3df57e89ddabf3f720
6c891d43d6b9f2d2980a7d4feee124b054fbfdb5
refs/heads/dev
2023-08-09T04:03:10.839390
2023-07-31T08:28:56
2023-08-04T12:04:11
166,255,932
129
53
MIT
2022-09-15T08:35:53
2019-01-17T16:14:58
Java
UTF-8
Java
false
false
730
java
package io.vproxy.app.app.cmd.handle.param; import io.vproxy.app.app.cmd.Command; import io.vproxy.app.app.cmd.Param; import io.vproxy.base.util.exception.XException; public class QueueHandle { private QueueHandle() { } public static void check(Command cmd) throws XException { int q; try { q = get(cmd); } catch (Throwable t) { throw new XException("invalid " + Param.queue.fullname + ": not an integer"); } if (q < 0) { throw new XException("invalid " + Param.queue.fullname + ": queue id cannot be negative"); } } public static int get(Command cmd) { return Integer.parseInt(cmd.args.get(Param.queue)); } }
[ "wkgcass@hotmail.com" ]
wkgcass@hotmail.com
8ae19840fa3e2f0901f82ee5f95ea8126beb3814
38933bae7638a11fef6836475fef0d73e14c89b5
/magma-func-supp/src/main/java/eu/lunisolar/magma/func/supp/opt/OptFltBase.java
dbd4add7eff73cb4b1991f33e52220b0055c1749
[ "Apache-2.0" ]
permissive
lunisolar/magma
b50ed45ce2f52daa5c598e4760c1e662efbbc0d4
41d3db2491db950685fe403c934cfa71f516c7dd
refs/heads/master
2023-08-03T10:13:20.113127
2023-07-24T15:01:49
2023-07-24T15:01:49
29,874,142
5
0
Apache-2.0
2023-05-09T18:25:01
2015-01-26T18:03:44
Java
UTF-8
Java
false
false
3,809
java
/* * This file is part of "lunisolar-magma". * * (C) Copyright 2014-2023 Lunisolar (http://lunisolar.eu/). * * 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 eu.lunisolar.magma.func.supp.opt; import javax.annotation.Nonnull; // NOSONAR import javax.annotation.Nullable; // NOSONAR import javax.annotation.concurrent.ThreadSafe; // NOSONAR import java.util.*; // NOSONAR import eu.lunisolar.magma.basics.*; // NOSONAR import eu.lunisolar.magma.basics.builder.*; // NOSONAR import eu.lunisolar.magma.basics.exceptions.*; // NOSONAR import eu.lunisolar.magma.basics.meta.*; // NOSONAR import eu.lunisolar.magma.basics.meta.aType.*; // NOSONAR import eu.lunisolar.magma.basics.meta.functional.*; // NOSONAR import eu.lunisolar.magma.basics.meta.functional.type.*; // NOSONAR import eu.lunisolar.magma.basics.meta.functional.domain.*; // NOSONAR import eu.lunisolar.magma.func.*; // NOSONAR import eu.lunisolar.magma.func.supp.*; // NOSONAR import eu.lunisolar.magma.func.tuple.*; // NOSONAR import eu.lunisolar.magma.basics.fluent.*; //NOSONAR import eu.lunisolar.magma.func.action.*; // NOSONAR import eu.lunisolar.magma.func.consumer.*; // NOSONAR import eu.lunisolar.magma.func.consumer.primitives.*; // NOSONAR import eu.lunisolar.magma.func.consumer.primitives.bi.*; // NOSONAR import eu.lunisolar.magma.func.consumer.primitives.obj.*; // NOSONAR import eu.lunisolar.magma.func.consumer.primitives.tri.*; // NOSONAR import eu.lunisolar.magma.func.function.*; // NOSONAR import eu.lunisolar.magma.func.function.conversion.*; // NOSONAR import eu.lunisolar.magma.func.function.from.*; // NOSONAR import eu.lunisolar.magma.func.function.to.*; // NOSONAR import eu.lunisolar.magma.func.operator.binary.*; // NOSONAR import eu.lunisolar.magma.func.operator.ternary.*; // NOSONAR import eu.lunisolar.magma.func.operator.unary.*; // NOSONAR import eu.lunisolar.magma.func.predicate.*; // NOSONAR import eu.lunisolar.magma.func.supplier.*; // NOSONAR public abstract class OptFltBase<SELF extends OptFltBase<SELF>> implements OptFltTrait<SELF> { protected final float value; protected final boolean isPresent; protected OptFltBase() { this.value = 0f; this.isPresent = false; } protected OptFltBase(float value) { this.value = value; this.isPresent = true; } public final float get() { LLogicalOperator.throwIfNot(isPresent, Is::True, X::noSuchElement, "No value present."); return value; } public final boolean isPresent() { return isPresent; } public final boolean isVoid() { return !isPresent; } // <editor-fold desc="equals/hashcode/toString"> public boolean equals(Object obj) { if (this == obj) { return true; } if (!(this.getClass().isInstance(obj))) { return false; } OptFltBase other = (OptFltBase) obj; return (isPresent() && other.isPresent()) ? value() == other.value() : isPresent() == other.isPresent(); } public int hashCode() { return isPresent() ? Float.hashCode(value()) : 0; } public String toString() { if (!isPresent()) { return new StringBuilder().append(getClass().getSimpleName()).append(".empty").toString(); } var v = value(); var sb = new StringBuilder().append(getClass().getSimpleName()).append("["); ToStr.toSb(sb, v); return sb.append("]").toString(); } // </editor-fold> }
[ "open@lunisolar.eu" ]
open@lunisolar.eu
5452f371228f49b14ed1074504ffa99385567e96
c38dfc7172c161112aad28a809ed9a1aadd0c4ea
/architecture-testing/src/test/java/com/acme/architecture/testing/example/archunit/rule/other/ExampleOtherArchitectureRule.java
aa9618dbac35864aaadebe79fd2f28dd624b1eeb
[ "MIT" ]
permissive
vjmadrid/workspace-java-architecture-lab
d48909ab869a1c11273c0ea4054b37118f4d0146
04a733becafc1c7cb9e3e2f4aef80db4dc32cdf3
refs/heads/master
2022-11-24T13:18:44.791704
2021-02-14T10:43:30
2021-02-14T10:43:30
173,009,295
0
0
MIT
2022-11-15T23:30:11
2019-02-27T23:59:23
Java
UTF-8
Java
false
false
787
java
package com.acme.architecture.testing.example.archunit.rule.other; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; import com.acme.architecture.testing.archunit.constant.TechnologyArchUnitNameConstant; import com.acme.architecture.testing.archunit.constant.TechnologyArchUnitPackageConstant; import com.tngtech.archunit.junit.ArchTest; import com.tngtech.archunit.lang.ArchRule; public class ExampleOtherArchitectureRule { @ArchTest public static final ArchRule example_classes_should_be_public = classes() .that().resideInAPackage(TechnologyArchUnitPackageConstant.RESIDE_FINAL_PACKAGE_ARCHUNIT_RULE_CLASS) .and().haveSimpleNameEndingWith(TechnologyArchUnitNameConstant.SUFFIX_NAME_ARCHUNIT_RULE_CLASS) .should().bePublic(); }
[ "vjmadrid@atsistemas.com" ]
vjmadrid@atsistemas.com
81e5dff7b90d6ea75cb43f63601fba2883408ee8
9a6ea6087367965359d644665b8d244982d1b8b6
/src/main/java/X/C73443Xi.java
d332f3eeaaa0b109b7b91c6979413a0ddee1ba80
[]
no_license
technocode/com.wa_2.21.2
a3dd842758ff54f207f1640531374d3da132b1d2
3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9
refs/heads/master
2023-02-12T11:20:28.666116
2021-01-14T10:22:21
2021-01-14T10:22:21
329,578,591
2
1
null
null
null
null
UTF-8
Java
false
false
1,476
java
package X; import android.content.Context; import com.whatsapp.util.Log; /* renamed from: X.3Xi reason: invalid class name and case insensitive filesystem */ public class C73443Xi extends AbstractC68463Dh { public final /* synthetic */ C73453Xj A00; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public C73443Xi(C73453Xj r1, Context context, AnonymousClass02M r3, AnonymousClass04j r4, AnonymousClass0GP r5) { super(context, r3, r4, r5); this.A00 = r1; } @Override // X.AbstractC68463Dh public void A01(C61072sS r3) { this.A00.A07.A00(new C61072sS()); } @Override // X.AbstractC68463Dh public void A02(C61072sS r3) { this.A00.A07.A00(new C61072sS()); } @Override // X.AbstractC68463Dh public void A03(AnonymousClass0M5 r5) { try { AnonymousClass0M5 A0E = r5.A0E("account"); C61072sS A002 = C61072sS.A00(A0E); if (A002 != null) { this.A00.A07.A00(A002); return; } C74733bP r2 = new C74733bP(); r2.A01(0, A0E.A0E("merchant")); C43771yv r22 = (C43771yv) r2.A03(); this.A00.A06.A01().A01(r22, new C68633Dy(this, r22)); } catch (AnonymousClass1XC unused) { Log.e("PAY: BrazilMerchantRegAction/regMerchant: invalid response message"); this.A00.A07.A00(new C61072sS()); } } }
[ "madeinborneo@gmail.com" ]
madeinborneo@gmail.com
3ae71a675e46cbb4cee08dc67cc8ab3ee0c68d59
35348f6624d46a1941ea7e286af37bb794bee5b7
/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slghpatexpress/SubExpression.java
66de63ff6ed3762db8ee6155fdc70497ef852065
[ "Apache-2.0", "GPL-1.0-or-later", "GPL-3.0-only", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "LicenseRef-scancode-unknown-license-reference" ]
permissive
StarCrossPortal/ghidracraft
7af6257c63a2bb7684e4c2ad763a6ada23297fa3
a960e81ff6144ec8834e187f5097dfcf64758e18
refs/heads/master
2023-08-23T20:17:26.250961
2021-10-22T00:53:49
2021-10-22T00:53:49
359,644,138
80
19
Apache-2.0
2021-10-20T03:59:55
2021-04-20T01:14:29
Java
UTF-8
Java
false
false
1,655
java
/* ### * IP: GHIDRA * REVIEWED: YES * * 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 ghidra.pcodeCPort.slghpatexpress; import generic.stl.VectorSTL; import ghidra.pcodeCPort.context.ParserWalker; import ghidra.pcodeCPort.utils.MutableInt; import ghidra.sleigh.grammar.Location; import java.io.PrintStream; public class SubExpression extends BinaryExpression { public SubExpression(Location location) { super(location); } // For use with restoreXml public SubExpression(Location location, PatternExpression l, PatternExpression r) { super(location, l, r); } @Override public long getValue(ParserWalker pos) { long leftval = getLeft().getValue(pos); long rightval = getRight().getValue(pos); return leftval - rightval; } @Override public long getSubValue(VectorSTL<Long> replace, MutableInt listpos) { long leftval = getLeft().getSubValue(replace, listpos); // Must be left first long rightval = getRight().getSubValue(replace, listpos); return leftval - rightval; } @Override public void saveXml(PrintStream s) { s.append("<sub_exp>\n"); super.saveXml(s); s.append("</sub_exp>\n"); } }
[ "46821332+nsadeveloper789@users.noreply.github.com" ]
46821332+nsadeveloper789@users.noreply.github.com
aac248c7d8da99beebd222babf65b53e653a4db5
d244ba116183d9a9052770b4ab1467e336fe1881
/skysail.server/src/main/java/de/twenty11/skysail/server/core/restlet/SkysailServerResource2.java
99b0652fd381e45497c8a4e4dea2542565f97036
[]
no_license
evandor/skysail-server-old
310f7e19d5fcee4eeede8f756d4c5e8f9d5853d4
54342cbf519d45cd6b9bb01262e0364faa133d10
refs/heads/master
2021-03-27T12:48:08.205013
2013-10-22T05:51:49
2013-10-22T05:51:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,575
java
package de.twenty11.skysail.server.core.restlet; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentMap; import org.codehaus.jackson.annotate.JsonIgnore; import org.json.JSONException; import org.json.JSONObject; import org.restlet.data.Reference; import org.restlet.resource.ResourceException; import org.restlet.resource.ServerResource; import de.twenty11.skysail.common.commands.Command; import de.twenty11.skysail.common.navigation.LinkedPage; import de.twenty11.skysail.server.restlet.SkysailApplication; /** * */ @Deprecated public abstract class SkysailServerResource2<T> extends ServerResource { public static final String CONTEXT_COMMANDS = "de.twenty11.skysail.server.restlet.SkysailServerResource2.commands"; public static final String CONTEXT_LINKED_PAGES = "de.twenty11.skysail.server.restlet.SkysailServerResource2.linkedPages"; /** short message to be passed to the client. */ private String message = ""; /** the payload. */ private T skysailData; /** The description of "self". */ private volatile String description; private volatile String name; @Override protected void doInit() throws ResourceException { if (getContext() != null) { getContext().getAttributes().put(CONTEXT_COMMANDS, new HashMap<String, Command>()); getContext().getAttributes().put(CONTEXT_LINKED_PAGES, new ArrayList<LinkedPage>()); } } /** * Reasoning: not overwriting those two (overloaded) methods gives me a jackson deserialization issue. I need to * define which method I want to be ignored by jackson. * * @see org.restlet.resource.ServerResource#setLocationRef(org.restlet.data.Reference) */ @JsonIgnore @Override public void setLocationRef(Reference locationRef) { super.setLocationRef(locationRef); } @Override public void setLocationRef(String locationUri) { super.setLocationRef(locationUri); } public void setMessage(String message) { this.message = message; } public String getMessage() { return message; } protected String getParent() { if (getRequest() == null) return null; if (getRequest().getOriginalRef() == null) return null; if (getRequest().getOriginalRef().getParentRef() == null) return null; return getRequest().getOriginalRef().getParentRef().toString(); } public T getSkysailData() { return skysailData; } public void setSkysailData(T skysailData) { this.skysailData = skysailData; } protected String determineValue(JSONObject jsonObject, String key) throws JSONException { if (jsonObject.isNull(key)) return null; return jsonObject.getString(key); } // === // Self describing stuff // === protected String getResourcePath() { Reference ref = new Reference(getRequest().getRootRef(), getRequest().getResourceRef()); return ref.getRemainingPart(); } public void setDescription(String description) { this.description = description; } public void setName(String name) { this.name = name; } public String getName() { return name; } public String getDescription() { return description; } protected void registerCommand(String key, Command command) { @SuppressWarnings("unchecked") Map<String, Command> commands = (Map<String, Command>) getContext().getAttributes().get(CONTEXT_COMMANDS); if (commands == null) { commands = new HashMap<String, Command>(); } commands.put(key, command); ConcurrentMap<String, Object> attributes = getContext().getAttributes(); attributes.put(CONTEXT_COMMANDS, commands); } @SuppressWarnings("unchecked") public Map<String, Command> getCommands() { if (getContext() == null) { return Collections.emptyMap(); } ConcurrentMap<String, Object> attributes = getContext().getAttributes(); if (attributes.get(CONTEXT_COMMANDS) == null) { return Collections.emptyMap(); } return Collections.unmodifiableMap((Map<String, Command>) attributes.get(CONTEXT_COMMANDS)); } protected Command getCommand(String key) { @SuppressWarnings("unchecked") Map<String, Command> commands = (Map<String, Command>) getContext().getAttributes().get(CONTEXT_COMMANDS); if (commands == null) { return null; } return commands.get(key); } protected void registerLinkedPage(LinkedPage page) { // TODO check this: seems to be needed in tests only (ResourceTestWithUnguardedApplication) // Exapmle: UsersResourceTest.empty_repository_returns_list_with_zero_entities if (getContext() == null) { return; } @SuppressWarnings("unchecked") List<LinkedPage> pages = (List<LinkedPage>) getContext().getAttributes().get(CONTEXT_LINKED_PAGES); if (pages == null) { pages = new ArrayList<LinkedPage>(); } pages.add(page); ConcurrentMap<String, Object> attributes = getContext().getAttributes(); attributes.put(CONTEXT_LINKED_PAGES, pages); } protected LinkedPage addResourceLink(final String linkText, final Class<? extends ServerResource> sr) { LinkedPage linkedPage = new LinkedPage() { @Override public boolean applicable() { return true; } @Override public String getHref() { return ((SkysailApplication) getApplication()).getLinkTo(getRootRef(), sr); } @Override public String getLinkText() { return linkText; } }; registerLinkedPage(linkedPage); return linkedPage; } @SuppressWarnings("unchecked") public List<LinkedPage> getLinkedPages() { if (getContext() == null) { return Collections.emptyList(); } ConcurrentMap<String, Object> attributes = getContext().getAttributes(); if (attributes.get(CONTEXT_LINKED_PAGES) == null) { return Collections.emptyList(); } return Collections.unmodifiableList((List<LinkedPage>) attributes.get(CONTEXT_LINKED_PAGES)); } }
[ "evandor@gmail.com" ]
evandor@gmail.com
4c96033474a7012c761add0741402c9a4a93aaab
54685166c5b7f8cd47b1ceba5ee585dc3d47c66f
/boot-starter-parent/boot-starter-api/src/main/java/com/jr/basic/api/ApiAutoConfiguration.java
bdee31f03ff7456d55e644a6f299bf54b19ce4ca
[]
no_license
kgezhiwang00/SpringForAll
7225deb594602a73ed36e197206659e9684c5318
19bdfa0ace5401bfc3eb0bc5a8c247aa4347d943
refs/heads/master
2020-04-01T13:16:44.184609
2018-11-01T01:05:52
2018-11-01T01:05:52
153,245,222
0
0
null
null
null
null
UTF-8
Java
false
false
2,419
java
// // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower decompiler) // package com.jr.basic.api; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @ConditionalOnProperty( name = {"app.api.enable"}, havingValue = "true" ) @Configuration @AutoConfigureAfter({MetaAutoConfiguration.class}) public class ApiAutoConfiguration { public ApiAutoConfiguration() { } @Bean public SysApiManagerService apiDefineScan() { return new SysApiManagerServiceImpl(); } @Bean public GraphQLController grqphqlController() { return new GraphQLController(); } @Bean public ServiceUtils serviceUtils() { return new ServiceUtils(); } @Bean public ControllerExceptionHandler controlerHandler() { return new ControllerExceptionHandler(); } @Bean public DomainListFetcher domainListFetcher() { return new DomainListFetcher(); } @Bean public DomainCountFetcher domainCountFetcher() { return new DomainCountFetcher(); } @Bean public DomainLoadFetcher domainLoadFetcher() { return new DomainLoadFetcher(); } @Bean public DomainCreateFetcher domainCreateFetcher() { return new DomainCreateFetcher(); } @Bean public DomainUpdateFetcher domainUpdateFetcher() { return new DomainUpdateFetcher(); } @Bean public DomainDeleteFetcher domainDeleteFetcher() { return new DomainDeleteFetcher(); } @Bean public DomainImportFetcher domainImportFetcher() { return new DomainImportFetcher(); } @Bean public DomainAggregateFetcher domainAggregateFetcher() { return new DomainAggregateFetcher(); } @Bean public DomainFieldVisibility domainFieldVisibility() { return new DomainFieldVisibility(); } @Bean public GraphQLConfig graphQLConfig() { return new GraphQLConfig(); } @Bean @ConditionalOnProperty( name = {"application.api.security"}, havingValue = "true", matchIfMissing = false ) public ServiceAspect securityAspect() { return new ServiceAspect(); } }
[ "1" ]
1
78dde15611c78ea59d841332f020ef1933ff39f9
0b93651bf4c4be26f820702985bd41089026e681
/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201802/mcm/ManagedCustomerService.java
c80421ce71336c976e6c9dde3995afb6449d808b
[ "Apache-2.0" ]
permissive
cmcewen-postmedia/googleads-java-lib
adf36ccaf717ab486e982b09d69922ddd09183e1
75724b4a363dff96e3cc57b7ffc443f9897a9da9
refs/heads/master
2021-10-08T16:50:38.364367
2018-12-14T22:10:58
2018-12-14T22:10:58
106,611,378
0
0
Apache-2.0
2018-12-14T22:10:59
2017-10-11T21:26:49
Java
UTF-8
Java
false
false
1,329
java
// Copyright 2018 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * ManagedCustomerService.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.adwords.axis.v201802.mcm; public interface ManagedCustomerService extends javax.xml.rpc.Service { public java.lang.String getManagedCustomerServiceInterfacePortAddress(); public com.google.api.ads.adwords.axis.v201802.mcm.ManagedCustomerServiceInterface getManagedCustomerServiceInterfacePort() throws javax.xml.rpc.ServiceException; public com.google.api.ads.adwords.axis.v201802.mcm.ManagedCustomerServiceInterface getManagedCustomerServiceInterfacePort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; }
[ "jradcliff@users.noreply.github.com" ]
jradcliff@users.noreply.github.com
1521500677d3733853d1cba472f5d3eb1308cb6d
e6dd80edb5930366f0ac1fcf19ade9b8721c43f4
/src/main/java/org/ashish/ns/micro/security/oauth2/UaaSignatureVerifierClient.java
0010e659e0a71d4c739f49b920e549f322de87c4
[]
no_license
ashgupta1489/ns-micro-app
503cfb3bffb7a6c2081f28fa8e474ab13eb62e73
e8e55149697540a3512c57271e144da130b669b2
refs/heads/master
2020-04-07T06:21:25.361890
2018-11-18T22:15:04
2018-11-18T22:15:04
158,131,689
0
0
null
2018-11-18T22:15:05
2018-11-18T22:08:46
Java
UTF-8
Java
false
false
2,620
java
package org.ashish.ns.micro.security.oauth2; import org.ashish.ns.micro.config.oauth2.OAuth2Properties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.security.jwt.crypto.sign.RsaVerifier; import org.springframework.security.jwt.crypto.sign.SignatureVerifier; import org.springframework.security.oauth2.common.exceptions.InvalidClientException; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; import java.util.Map; /** * Client fetching the public key from UAA to create a SignatureVerifier. */ @Component public class UaaSignatureVerifierClient implements OAuth2SignatureVerifierClient { private final Logger log = LoggerFactory.getLogger(UaaSignatureVerifierClient.class); private final RestTemplate restTemplate; protected final OAuth2Properties oAuth2Properties; public UaaSignatureVerifierClient(DiscoveryClient discoveryClient, @Qualifier("loadBalancedRestTemplate") RestTemplate restTemplate, OAuth2Properties oAuth2Properties) { this.restTemplate = restTemplate; this.oAuth2Properties = oAuth2Properties; // Load available UAA servers discoveryClient.getServices(); } /** * Fetches the public key from the UAA. * * @return the public key used to verify JWT tokens; or null. */ @Override public SignatureVerifier getSignatureVerifier() throws Exception { try { HttpEntity<Void> request = new HttpEntity<Void>(new HttpHeaders()); String key = (String) restTemplate .exchange(getPublicKeyEndpoint(), HttpMethod.GET, request, Map.class).getBody() .get("value"); return new RsaVerifier(key); } catch (IllegalStateException ex) { log.warn("could not contact UAA to get public key"); return null; } } /** Returns the configured endpoint URI to retrieve the public key. */ private String getPublicKeyEndpoint() { String tokenEndpointUrl = oAuth2Properties.getSignatureVerification().getPublicKeyEndpointUri(); if (tokenEndpointUrl == null) { throw new InvalidClientException("no token endpoint configured in application properties"); } return tokenEndpointUrl; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
769fee60bfc84b5ff3c5a9758cc63eb130979f58
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/35/35_c5b4db35d13250e752823aebe226dc582660888b/SingleStringScannableWriter/35_c5b4db35d13250e752823aebe226dc582660888b_SingleStringScannableWriter_t.java
ef9415ce01689bf7236a2a315859eddd475383b5
[]
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,924
java
/*- * Copyright © 2013 Diamond Light Source Ltd. * * This file is part of GDA. * * GDA is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 as published by the Free * Software Foundation. * * GDA is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along * with GDA. If not, see <http://www.gnu.org/licenses/>. */ package gda.data.scan.datawriter.scannablewriter; import gda.data.scan.datawriter.SelfCreatingLink; import gda.device.DeviceException; import gda.device.Scannable; import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collection; import java.util.Vector; import org.apache.commons.lang.ArrayUtils; import org.nexusformat.NeXusFileInterface; import org.nexusformat.NexusException; import org.nexusformat.NexusFile; public class SingleStringScannableWriter extends SimpleSingleScannableWriter { // private static final Logger logger = LoggerFactory.getLogger(SimpleSingleScannableWriter.class); int stringlength; int rank; @Override protected Collection<SelfCreatingLink> makeComponent(NeXusFileInterface file, int[] dim, String path, String scannableName, String componentName, Object pos, String unit) throws NexusException { String name = enterLocation(file, path); stringlength = 127; byte[] slab = ArrayUtils.add(pos.toString().getBytes(Charset.forName("UTF-8")),(byte) 0); if (Arrays.equals(dim, new int[] {1})) { stringlength = slab.length; } else if (slab.length > (stringlength - 10)) { stringlength = slab.length+10; } dim = minusonedimfordim(dim); if (dim[dim.length-1] == 1) { dim[dim.length-1] = stringlength; } else { dim = ArrayUtils.add(dim, stringlength); } rank = dim.length; file.makedata(name, NexusFile.NX_CHAR, rank, dim); file.opendata(name); file.putattr("local_name", String.format("%s.%s", scannableName, componentName).getBytes(), NexusFile.NX_CHAR); file.putslab(slab, nulldimfordim(dim), onedimfordim(dim)); file.closedata(); leaveLocation(file); return new Vector<SelfCreatingLink>(); } @Override protected Object getComponentSlab(Scannable s, Object position, int i) throws DeviceException { return ArrayUtils.add(position.toString().getBytes(Charset.forName("UTF-8")),(byte) 0); } @Override protected int[] onedimfordim(int[] dim) { int[] onedimfordim = super.onedimfordim(dim); if (onedimfordim.length < rank) return ArrayUtils.add(onedimfordim, stringlength); onedimfordim[onedimfordim.length-1] = stringlength; return onedimfordim; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
5dfa9be9e17d8e1845cfb12c6feef45afac04055
385e3414ccb7458bbd3cec326320f11819decc7b
/frameworks/opt/telephony/src/java/com/huawei/android/telephony/TelephonyManagerCustEx.java
44870fb888687481cca66658d50f208b3ff85930
[]
no_license
carlos22211/Tango_AL813
14de7f2693c3045b9d3c0cb52017ba2bb6e6b28f
b50b1b7491dc9c5e6b92c2d94503635c43e93200
refs/heads/master
2020-03-28T08:09:11.127995
2017-06-26T05:05:29
2017-06-26T05:05:29
147,947,860
1
0
null
2018-09-08T15:55:46
2018-09-08T15:55:45
null
UTF-8
Java
false
false
7,641
java
package com.huawei.android.telephony; //////////////////////////zhouguanghui check LTE on or off import android.util.Log; import com.android.internal.telecom.ITelecomService; import com.android.internal.telephony.IPhoneSubInfo; import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.ITelephonyRegistry; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.RILConstants; import com.android.internal.telephony.TelephonyProperties; import android.os.RemoteException; import android.content.Context; import android.os.ServiceManager; import com.android.internal.telephony.Phone; import android.provider.Settings; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.telephony.RadioAccessFamily; import com.android.internal.telephony.PhoneFactory; ////////////////////////////END zgh /** * Addon for the class {@link android.telephony.TelephonyManager} * <p> * * @see android.telephony.TelephonyManager */ public class TelephonyManagerCustEx { private static final String LOG_TAG = "xionghaifeng"; /* * Network mode. * This value can be either a state, an action can also be. * * MODE_LTE_OFF_EX: shut down the LTE mode. * MODE_LTETDD_ONLY_EX: LTE ONLY mode. * MODE_LTE_AND_AUTO_EX: shut down LTE ONLY mode, but LTE is open. * MODE_ERROR_EX: exception mode. * * @see #setDataSettingMode(DataSettingModeTypeEx) * @see #getDataSettingMode() */ public enum DataSettingModeTypeEx { MODE_LTE_OFF_EX, MODE_LTETDD_ONLY_EX, MODE_LTE_AND_AUTO_EX, MODE_ERROR_EX, }; /* * Set the network mode that modem will work in. * * @param dataMode Network mode. * * @see #DataSettingModeTypeEx */ public static void setDataSettingMode(DataSettingModeTypeEx dataMode) { //throw new NoExtAPIException("method not supported."); } /* * Get the network mode that modem is working in. * * @see #DataSettingModeTypeEx */ public static DataSettingModeTypeEx getDataSettingMode() { //throw new NoExtAPIException("method not supported."); return DataSettingModeTypeEx.MODE_LTE_AND_AUTO_EX; } /* BEGIN PN: DTS2014072606694, Added by liugaolong 00273199, 2014/8/5 */ /** * Set LTE service enable or disable. * * @param sub Card slot * @param ablitiy Enable LTE service or not. 1: enable, 0: disable. * * @see com.huawei.telephony.HuaweiTelephonyManager#setLteServiceAbility(int) */ public static void setLteServiceAbility(int sub, int ability) throws RemoteException{ boolean isLteOnOrOff = (ability == 1) ? true : false; Log.i(LOG_TAG,"isLteOnOrOff >> " + isLteOnOrOff); //SubscriptionManager.setLteServiceAbilityEx(isLteOnOrOff); dianxin SubscriptionManager.setLteServiceAbilityExTwo(isLteOnOrOff,sub); } /////////////////////////////////////////////zhouguanghui check LTE on or off /** Network type is unknown */ public static final int NETWORK_TYPE_UNKNOWN = 0; /** Current network is GPRS */ public static final int NETWORK_TYPE_GPRS = 1; /** Current network is EDGE */ public static final int NETWORK_TYPE_EDGE = 2; /** Current network is UMTS */ public static final int NETWORK_TYPE_UMTS = 3; /** Current network is CDMA: Either IS95A or IS95B*/ public static final int NETWORK_TYPE_CDMA = 4; /** Current network is EVDO revision 0*/ public static final int NETWORK_TYPE_EVDO_0 = 5; /** Current network is EVDO revision A*/ public static final int NETWORK_TYPE_EVDO_A = 6; /** Current network is 1xRTT*/ public static final int NETWORK_TYPE_1xRTT = 7; /** Current network is HSDPA */ public static final int NETWORK_TYPE_HSDPA = 8; /** Current network is HSUPA */ public static final int NETWORK_TYPE_HSUPA = 9; /** Current network is HSPA */ public static final int NETWORK_TYPE_HSPA = 10; /** Current network is iDen */ public static final int NETWORK_TYPE_IDEN = 11; /** Current network is EVDO revision B*/ public static final int NETWORK_TYPE_EVDO_B = 12; /** Current network is LTE */ public static final int NETWORK_TYPE_LTE = 13; /** Current network is eHRPD */ public static final int NETWORK_TYPE_EHRPD = 14; /** Current network is HSPA+ */ public static final int NETWORK_TYPE_HSPAP = 15; /** Current network is GSM {@hide} */ public static final int NETWORK_TYPE_GSM = 16; /** * Returns a constant indicating the radio technology (network type) * currently in use on the device for a subscription. * @return the network type * * @param subId for which network type is returned * * @see #NETWORK_TYPE_UNKNOWN * @see #NETWORK_TYPE_GPRS * @see #NETWORK_TYPE_EDGE * @see #NETWORK_TYPE_UMTS * @see #NETWORK_TYPE_HSDPA * @see #NETWORK_TYPE_HSUPA * @see #NETWORK_TYPE_HSPA * @see #NETWORK_TYPE_CDMA * @see #NETWORK_TYPE_EVDO_0 * @see #NETWORK_TYPE_EVDO_A * @see #NETWORK_TYPE_EVDO_B * @see #NETWORK_TYPE_1xRTT * @see #NETWORK_TYPE_IDEN * @see #NETWORK_TYPE_LTE * @see #NETWORK_TYPE_EHRPD * @see #NETWORK_TYPE_HSPAP */ /** {@hide} */ public static int getNetworkType(int subId) { try { ITelephony telephony = getITelephony(); if (telephony != null) { Log.i(LOG_TAG,"telephony is not null === >>> " + telephony.getNetworkTypeForSubscriber(subId)); return telephony.getNetworkTypeForSubscriber(subId); } else { Log.i(LOG_TAG,"telephony is not null === >>> " + NETWORK_TYPE_UNKNOWN); // This can happen when the ITelephony interface is not up yet. return NETWORK_TYPE_UNKNOWN; } } catch(RemoteException ex) { // This shouldn't happen in the normal case return NETWORK_TYPE_UNKNOWN; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return NETWORK_TYPE_UNKNOWN; } } /** * @hide */ private static ITelephony getITelephony() { return ITelephony.Stub.asInterface(ServiceManager.getService(Context.TELEPHONY_SERVICE)); } ///////////////////////////////////////////////////END zgh /** * Check network mode is LTE on or not. * * @param sub Card slot * @param nwMode Network mode. * * @return int Wether LTE service on or off. * 1: LTE service on * 0: LTE service off * * @see com.huawei.telephony.HuaweiTelephonyManager#checkLteServiceAbiltiy(int) * @see com.huawei.telephony.HuaweiTelephonyManager#getLteServiceAbility() */ public static int checkLteServiceAbiltiy(int sub, int nwMode) { //write value to DB, first it is on; return SubscriptionManager.getLteServiceAbiltiy(sub); /* /////////////////////////////////////zhouguanghui for check LTE on or off int[] subId = SubscriptionManager.getSubId(sub); int networkType = getNetworkType(subId[0]); if(networkType == NETWORK_TYPE_LTE){ networkType = 1; }else{ networkType = 0; } Log.i("MingYue","check LTE on or off networkType = >> " + networkType); return networkType; ////////////////////////////////END zgh //return 1; //throw new NoExtAPIException("method not supported.");*/ } /* END PN: DTS2014072606694, Added by liugaolong 00273199, 2014/8/5 */ }
[ "zhangjinqiang@huaqin.com" ]
zhangjinqiang@huaqin.com
6330e16deed022306a1cc58187492e429d02c3da
2e300850a4a52cf8612f5aadfaa045b278b0ef22
/src/com/viewpagerindicator/IconPageIndicator.java
5717159fe307645304a9bbe32a99b9677e45a2f8
[]
no_license
TripNRaVeR/android_packages_apps_Music
56466e5ec1dec3bf1f0141a38daca53c6428383c
57f19c0deedaee69dfd8ed218d70303b66cf3b49
HEAD
2016-09-03T07:21:09.183353
2013-12-29T23:41:01
2013-12-29T23:41:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,514
java
/* * Copyright (C) 2011 The Android Open Source Project * Copyright (C) 2012 Jake Wharton * * 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.viewpagerindicator; import android.content.Context; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.widget.HorizontalScrollView; import android.widget.ImageView; import static android.view.ViewGroup.LayoutParams.FILL_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import com.andrew.music.R; /** * This widget implements the dynamic action bar tab behavior that can change * across different configurations or circumstances. */ public class IconPageIndicator extends HorizontalScrollView implements PageIndicator { private final IcsLinearLayout mIconsLayout; private ViewPager mViewPager; private OnPageChangeListener mListener; private Runnable mIconSelector; private int mSelectedIndex; public IconPageIndicator(Context context) { this(context, null); } public IconPageIndicator(Context context, AttributeSet attrs) { super(context, attrs); setHorizontalScrollBarEnabled(false); mIconsLayout = new IcsLinearLayout(context, R.attr.vpiIconPageIndicatorStyle); addView(mIconsLayout, new LayoutParams(WRAP_CONTENT, FILL_PARENT, Gravity.CENTER)); } private void animateToIcon(final int position) { final View iconView = mIconsLayout.getChildAt(position); if (mIconSelector != null) { removeCallbacks(mIconSelector); } mIconSelector = new Runnable() { public void run() { final int scrollPos = iconView.getLeft() - (getWidth() - iconView.getWidth()) / 2; smoothScrollTo(scrollPos, 0); mIconSelector = null; } }; post(mIconSelector); } @Override public void onAttachedToWindow() { super.onAttachedToWindow(); if (mIconSelector != null) { // Re-post the selector we saved post(mIconSelector); } } @Override public void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mIconSelector != null) { removeCallbacks(mIconSelector); } } @Override public void onPageScrollStateChanged(int arg0) { if (mListener != null) { mListener.onPageScrollStateChanged(arg0); } } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { if (mListener != null) { mListener.onPageScrolled(arg0, arg1, arg2); } } @Override public void onPageSelected(int arg0) { setCurrentItem(arg0); if (mListener != null) { mListener.onPageSelected(arg0); } } @Override public void setViewPager(ViewPager view) { if (mViewPager == view) { return; } if (mViewPager != null) { mViewPager.setOnPageChangeListener(null); } PagerAdapter adapter = view.getAdapter(); if (adapter == null) { throw new IllegalStateException("ViewPager does not have adapter instance."); } mViewPager = view; view.setOnPageChangeListener(this); notifyDataSetChanged(); } public void notifyDataSetChanged() { mIconsLayout.removeAllViews(); IconPagerAdapter iconAdapter = (IconPagerAdapter) mViewPager.getAdapter(); int count = iconAdapter.getCount(); for (int i = 0; i < count; i++) { ImageView view = new ImageView(getContext(), null, R.attr.vpiIconPageIndicatorStyle); view.setImageResource(iconAdapter.getIconResId(i)); mIconsLayout.addView(view); } if (mSelectedIndex > count) { mSelectedIndex = count - 1; } setCurrentItem(mSelectedIndex); requestLayout(); } @Override public void setViewPager(ViewPager view, int initialPosition) { setViewPager(view); setCurrentItem(initialPosition); } @Override public void setCurrentItem(int item) { if (mViewPager == null) { throw new IllegalStateException("ViewPager has not been bound."); } mSelectedIndex = item; mViewPager.setCurrentItem(item); int tabCount = mIconsLayout.getChildCount(); for (int i = 0; i < tabCount; i++) { View child = mIconsLayout.getChildAt(i); boolean isSelected = (i == item); child.setSelected(isSelected); if (isSelected) { animateToIcon(item); } } } @Override public void setOnPageChangeListener(OnPageChangeListener listener) { mListener = listener; } }
[ "noerialexeew@live.nl" ]
noerialexeew@live.nl
5a54b6448eb53671bbe08d087af4420c141e6daa
efb4b7a540466dab32e57c38a5b39b8278800df7
/gateway-zuul/src/main/java/com/zuul/gatewayzuul/config/SwaggerConfig.java
5d04eaf06d9ff232d5c24f10c6523a03665cc15a
[]
no_license
zuyunbo/paas
33f387e255272849730b68d0f3a02f121f74ef79
9e79d01d0986bf5fabd617a3db9b32481cd3507a
refs/heads/master
2022-06-25T07:58:02.548021
2020-06-10T09:35:27
2020-06-10T09:35:27
232,992,073
2
1
null
2022-06-17T02:51:48
2020-01-10T07:37:01
Java
UTF-8
Java
false
false
928
java
package com.zuul.gatewayzuul.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; /** * swagger文档 * * @author 2u * */ @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket docket() { return new Docket(DocumentationType.SWAGGER_2).groupName("网关swagger接口文档") .apiInfo(new ApiInfoBuilder().title("网关swagger接口文档") .contact(new Contact("2u", "", "qdzuyunbo@gmail.com")).version("1.0").build()) .select().paths(PathSelectors.any()).build(); } }
[ "12345678" ]
12345678
694f7bdb25057b0e729792d5036aa57d9c0d1d4e
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/webview/ui/tools/video/samelayer/j$$ExternalSyntheticLambda5.java
488b62ccaa91c6876e88ceab90f0acc18328d525
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
482
java
package com.tencent.mm.plugin.webview.ui.tools.video.samelayer; import com.tencent.mm.plugin.appbrand.jsapi.video.e.g.f; public final class j$$ExternalSyntheticLambda5 implements g.f { public final void onHitPreload(Boolean arg1) {} } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes8.jar * Qualified Name: com.tencent.mm.plugin.webview.ui.tools.video.samelayer.j..ExternalSyntheticLambda5 * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
e0d41d1b2edfa443e3607c8e5c6ce4a72b346d22
ce3305c86d18898a7609f0f685b5df02c6a7c899
/payment/src/main/java/org/killbill/billing/payment/core/sm/ChargebackOperation.java
c3d02357afea9471529b147f17a50b14067fecd0
[ "Apache-2.0" ]
permissive
agilee/killbill
c23cb9d2cf8ad592bb9a7789be005b49e808e4ac
260b24a5b3b3b389176912ccb608577f213733ac
refs/heads/master
2021-01-16T20:07:01.612307
2014-07-02T00:54:03
2014-07-02T00:54:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,956
java
/* * Copyright 2014 Groupon, Inc * Copyright 2014 The Billing Project, LLC * * The Billing Project 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.killbill.billing.payment.core.sm; import org.killbill.automaton.OperationResult; import org.killbill.billing.payment.api.PaymentApiException; import org.killbill.billing.payment.api.TransactionType; import org.killbill.billing.payment.dispatcher.PluginDispatcher; import org.killbill.billing.payment.plugin.api.PaymentPluginApiException; import org.killbill.billing.payment.plugin.api.PaymentPluginStatus; import org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin; import org.killbill.billing.payment.provider.DefaultNoOpPaymentInfoPlugin; import org.killbill.commons.locker.GlobalLocker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ChargebackOperation extends DirectPaymentOperation { private final Logger logger = LoggerFactory.getLogger(ChargebackOperation.class); public ChargebackOperation(final DirectPaymentAutomatonDAOHelper daoHelper, final GlobalLocker locker, final PluginDispatcher<OperationResult> paymentPluginDispatcher, final DirectPaymentStateContext directPaymentStateContext) throws PaymentApiException { super(daoHelper, locker, paymentPluginDispatcher, directPaymentStateContext); } @Override protected PaymentTransactionInfoPlugin doCallSpecificOperationCallback() throws PaymentPluginApiException { logger.debug("Starting CHARGEBACK for payment {} ({} {})", directPaymentStateContext.getDirectPaymentId(), directPaymentStateContext.getAmount(), directPaymentStateContext.getCurrency()); return new DefaultNoOpPaymentInfoPlugin( directPaymentStateContext.getDirectPaymentId(), directPaymentStateContext.getTransactionPaymentId(), TransactionType.CHARGEBACK, directPaymentStateContext.getAmount(), directPaymentStateContext.getCurrency(), null, null, PaymentPluginStatus.PROCESSED, null); } }
[ "sbrossier@groupon.com" ]
sbrossier@groupon.com
13c1b9064a969099387a96380dcb5e84a32baaac
c8e0a34b423517b18718dd8142268d066c33651b
/core/src/main/java/com/axellience/vuegwt/core/client/component/ComponentJavaPrototype.java
233cd91c5e6b82e830a2e86e89ef68785c71cb1b
[ "MIT" ]
permissive
fishinhouse/vue-gwt
2caf8f78dde506dbe5e8b7e60d13f60e5445b1b7
3cfd9348f1b0d621d6c9b9016c9a1b089b348163
refs/heads/master
2020-03-07T13:12:02.219394
2018-03-28T17:46:27
2018-03-28T17:46:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.axellience.vuegwt.core.client.component; import jsinterop.annotations.JsPackage; import jsinterop.annotations.JsType; import jsinterop.base.JsPropertyMap; /** * @author Adrien Baron */ @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") public class ComponentJavaPrototype<T extends VueComponent> implements JsPropertyMap { }
[ "adrien.baron@axellience.com" ]
adrien.baron@axellience.com
7ec8299434e4ecfc141e7de697afa9b458047a1a
e89fdd336ef07f755260d96c38e945c247b57db8
/visallo/web/plugins/ingest-cloud-s3/src/main/java/org/visallo/web/ingest/cloud/s3/authentication/SessionAuthProvider.java
83d8a5ea54e03181c70514e23bb46f8064e23f90
[ "Apache-2.0" ]
permissive
pppguru/react-meta
badb4e78bfaaa9ca93884ac7d631a5d3fc188ca4
f99d34e4ebbd1afed557b06361dde3e04c3de5f3
refs/heads/master
2020-03-14T16:38:31.093667
2018-05-01T10:46:08
2018-05-01T10:46:08
131,702,126
0
0
null
null
null
null
UTF-8
Java
false
false
574
java
package org.visallo.web.ingest.cloud.s3.authentication; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicSessionCredentials; import org.json.JSONObject; public class SessionAuthProvider implements AuthProvider { @Override public AWSCredentials getCredentials(JSONObject credentials) { String accessKey = credentials.optString("accessKey"); String secret = credentials.optString("secret"); String token = credentials.optString("token"); return new BasicSessionCredentials(accessKey, secret, token); } }
[ "luisantonio_vera@yahoo.com" ]
luisantonio_vera@yahoo.com
fbc673bab962a393cfa0072a813410bc0c5c431a
95e944448000c08dd3d6915abb468767c9f29d3c
/sources/android/support/p022v4/view/C0996w.java
dfb08967dcd19d0b15e4fca1d867b4bb7607337f
[]
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
1,179
java
package android.support.p022v4.view; import android.os.Build.VERSION; import android.view.ViewGroup; import com.zhiliaoapp.musically.df_live_zego_link.R; /* renamed from: android.support.v4.view.w */ public final class C0996w { /* renamed from: b */ public static int m4264b(ViewGroup viewGroup) { if (VERSION.SDK_INT >= 21) { return viewGroup.getNestedScrollAxes(); } return ((C0981m) viewGroup).getNestedScrollAxes(); } /* renamed from: a */ public static boolean m4263a(ViewGroup viewGroup) { if (VERSION.SDK_INT >= 21) { return viewGroup.isTransitionGroup(); } Boolean bool = (Boolean) viewGroup.getTag(R.id.dg_); if ((bool == null || !bool.booleanValue()) && viewGroup.getBackground() == null && C0991u.m4241t(viewGroup) == null) { return false; } return true; } /* renamed from: a */ public static void m4262a(ViewGroup viewGroup, boolean z) { if (VERSION.SDK_INT >= 21) { viewGroup.setTransitionGroup(false); } else { viewGroup.setTag(R.id.dg_, Boolean.valueOf(false)); } } }
[ "65450641+Xyzdesk@users.noreply.github.com" ]
65450641+Xyzdesk@users.noreply.github.com
b23b575904bb040c8130565b0f28c2b27517b8b6
3fc503bed9e8ba2f8c49ebf7783bcdaa78951ba8
/TRAVACC_R5/ndcfacades/src/de/hybris/platform/ndcfacades/ndc/PersonBudgetType.java
58f353ab76796d81c524fba124fa82762bab4ae8
[]
no_license
RabeS/model-T
3e64b2dfcbcf638bc872ae443e2cdfeef4378e29
bee93c489e3a2034b83ba331e874ccf2c5ff10a9
refs/heads/master
2021-07-01T02:13:15.818439
2020-09-05T08:33:43
2020-09-05T08:33:43
147,307,585
0
0
null
null
null
null
UTF-8
Java
false
false
2,759
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2017.02.07 at 04:46:04 PM GMT // package de.hybris.platform.ndcfacades.ndc; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * A data type for PER PERSON BUDGET Qualifier. * * <p>Java class for PersonBudgetType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="PersonBudgetType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Amount"> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.iata.org/IATA/EDIST>CurrencyAmountOptType"> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PersonBudgetType", propOrder = { "amount" }) public class PersonBudgetType { @XmlElement(name = "Amount", required = true) protected PersonBudgetType.Amount amount; /** * Gets the value of the amount property. * * @return * possible object is * {@link PersonBudgetType.Amount } * */ public PersonBudgetType.Amount getAmount() { return amount; } /** * Sets the value of the amount property. * * @param value * allowed object is * {@link PersonBudgetType.Amount } * */ public void setAmount(PersonBudgetType.Amount value) { this.amount = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;simpleContent> * &lt;extension base="&lt;http://www.iata.org/IATA/EDIST>CurrencyAmountOptType"> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class Amount extends CurrencyAmountOptType { } }
[ "sebastian.rulik@gmail.com" ]
sebastian.rulik@gmail.com
f3bc319d4c2ff179e56f84907a20663130bc3b69
ed0e9bfa93c1077b1e4af2fd0ed452bebb596afc
/BankSystem/src/com/jxau/bank/view/InquiryFrame.java
324d29e43760dfff6f705aab48185cf2454fe843
[]
no_license
wzyyxx/springboot_shiro
fa4c1b4fa4a9bfba0ef045a5365bb011b8df5fce
826c4bf203209700e4c1cb1c2cba8418e90ccea8
refs/heads/master
2023-04-22T09:19:35.317149
2019-11-20T03:17:16
2019-11-20T03:17:16
null
0
0
null
null
null
null
GB18030
Java
false
false
1,527
java
package com.jxau.bank.view; import com.jxau.bank.model.UserBean; import javax.swing.*; public class InquiryFrame extends JFrame { JLabel jlb1, jlb2; //标签 JTextField jtf1,jtf2; //文本框 JPanel jp1,jp2,jp3; //面板 UserBean user = new UserBean(); public void inquiryFrame(double money, String loginName){ //标签信息 jlb1 = new JLabel(" 姓名"); jlb2 = new JLabel(" 余额"); jtf1 = new JTextField(13); jtf1.setEditable(false); jtf2 = new JTextField(13); jtf2.setEditable(false); jp1 = new JPanel(); jp2 = new JPanel(); jp1.add(jlb1); jp1.add(jtf1); jp2.add(jlb2); jp2.add(jtf2); //设置布局 this.setTitle("查询余额"); this.setLayout(null); //采用空布局 jp1.setBounds(-10, 40, 300, 50); //-别问我为什么-10 因为 界面好看一点啊 jp2.setBounds(-10, 110, 300, 50); //将JPane加入JFrame中 this.add(jp1); this.add(jp2); this.setSize(300, 300); //设置窗体大小 this.setLocationRelativeTo(null);//在屏幕中间显示(居中显示) this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); //设置仅关闭当前窗口 this.setVisible(true); //设置可见 this.setResizable(false); //设置不可拉伸大小 jtf1.setText(loginName); //将信息显示在文本框中 jtf2.setText(money + ""); } }
[ "admin@163.com" ]
admin@163.com
2537f29814efdb14e2d800a993904047845c224b
f0ec508f4b480d8d5399a2880e4cbb0533fc2fc1
/com.gzedu.xlims.service/src/main/java/com/gzedu/xlims/service/organization/GjtStudyCenterAuditService.java
8798ad9d9956d712df496fe00e0e9f738aa32b9d
[]
no_license
lizm335/MyLizm
a327bd4d08a33c79e9b6ef97144d63dae7114a52
1bcca82395b54d431fb26817e61a294f9d7dd867
refs/heads/master
2020-03-11T17:25:25.687426
2018-04-19T03:10:28
2018-04-19T03:10:28
130,146,458
3
0
null
null
null
null
UTF-8
Java
false
false
541
java
/** * Copyright(c) 2016 版权所有:广州远程教育中心 www.eenet.com */ package com.gzedu.xlims.service.organization; import java.util.List; import com.gzedu.xlims.pojo.GjtStudyCenterAudit; /** * * 功能说明:学习中心审核 * * @author 张伟文 zhangeweiwen@eenet.com * @Date 2017年8月15日 * @version 3.0 * */ public interface GjtStudyCenterAuditService { List<GjtStudyCenterAudit> queryByIncidentId(String orgId); boolean update(GjtStudyCenterAudit item); boolean save(GjtStudyCenterAudit item); }
[ "lizengming@eenet.com" ]
lizengming@eenet.com
2be615ccddaf5616c16c400b6a627993e7bc03e7
feb18dfa7f3285b0096f5963a7e5656e649ef36b
/shop-app/shop-app-webmvc/src/main/java/fr/training/samples/spring/shop/ShopAppWebmvcApplication.java
d4bfe9c1c90b395f9657425f55a886f7f1e25827
[]
no_license
bnasslahsen/spring-training-sol
522af164e99e69e12932929a5036b7a49af6b79d
776612166ec0e607b7ca2e41dc328d9832c6b8f3
refs/heads/master
2023-08-26T07:24:53.369815
2021-10-15T21:09:56
2021-10-15T21:09:56
415,925,427
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package fr.training.samples.spring.shop; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ShopAppWebmvcApplication { public static void main(String[] args) { SpringApplication.run(ShopAppWebmvcApplication.class, args); } }
[ "badr.nasslahsen@gmail.com" ]
badr.nasslahsen@gmail.com
8afe648e69e91389cdedad87f04f89ba77394c0b
b2f07f3e27b2162b5ee6896814f96c59c2c17405
/org/omg/DynamicAny/DynEnumOperations.java
9b7ae9714bc381ea3bf1b020b241e1a576c80eb1
[]
no_license
weiju-xi/RT-JAR-CODE
e33d4ccd9306d9e63029ddb0c145e620921d2dbd
d5b2590518ffb83596a3aa3849249cf871ab6d4e
refs/heads/master
2021-09-08T02:36:06.675911
2018-03-06T05:27:49
2018-03-06T05:27:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
562
java
package org.omg.DynamicAny; import org.omg.DynamicAny.DynAnyPackage.InvalidValue; public abstract interface DynEnumOperations extends DynAnyOperations { public abstract String get_as_string(); public abstract void set_as_string(String paramString) throws InvalidValue; public abstract int get_as_ulong(); public abstract void set_as_ulong(int paramInt) throws InvalidValue; } /* Location: C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar * Qualified Name: org.omg.DynamicAny.DynEnumOperations * JD-Core Version: 0.6.2 */
[ "yuexiahandao@gmail.com" ]
yuexiahandao@gmail.com
71c9b5316734ca80403937d3c58e6e74c9e8ac9d
faddd3950f7bbfcb2774fc473ddfac3eca74fbaf
/rife_v1_remaining/src/framework/com/uwyn/rife/engine/ElementDeployer.java
435edd03a480878ea739856fbbb15128349ebc07
[]
no_license
wangbo15/rife
d4b392f6577e998f12a8b6e529886487ca9ed320
399468a4c6929f0f32ad2fc15906b89cfae0e1c1
refs/heads/master
2020-04-13T14:24:13.894322
2013-07-01T23:02:50
2013-07-01T23:02:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,553
java
/* * Copyright 2001-2008 Geert Bevin (gbevin[remove] at uwyn dot com) * Licensed under the Apache License, Version 2.0 (the "License") * $Id: ElementDeployer.java 3918 2008-04-14 17:35:35Z gbevin $ */ package com.uwyn.rife.engine; import com.uwyn.rife.engine.exceptions.EngineException; /** * Classes that are responsible for deploying elements have to extend this * abstract class. * <p>After {@link ElementSupport#setDeploymentClass registering} the * <code>ElementDeployer</code> class with <code>ElementSupport</code>, an * instance of this class will be created when the element is deployed within * a site. The instance's {@link #deploy()} method will be called. * <p>Element deployers are handy if you need to setup element-specific * resources for all instances of the element's implementation. * * @author Geert Bevin (gbevin[remove] at uwyn dot com) * @version $Revision: 3918 $ * @see ElementSupport#setDeploymentClass * @since 1.0 */ public abstract class ElementDeployer { private ElementInfo mElementInfo = null; final void setElementInfo(ElementInfo elementInfo) { mElementInfo = elementInfo; } /** * Retrieves the declaration information about the element that is being * deployed. * * @return the declaration information of the deployed element * @since 1.0 */ public final ElementInfo getElementInfo() { return mElementInfo; } /** * This method is executed when the deployment should be performed. * * @since 1.0 */ public abstract void deploy() throws EngineException; }
[ "gbevin@uwyn.com" ]
gbevin@uwyn.com
514f7b7a49f82956eb22dffba4c09e118dd4c4c7
eeef4b40ee870fe8f3a9dc0264ccb9ecf24d7d8e
/api/src/main/java/org/openmrs/module/esaudereports/reporting/cohort/evaluator/DateCalculationCohortDefinitionEvaluator.java
c5d6183e718b5b93daa4097d15d48f674764e0a5
[]
no_license
esaude/esaude-reports
2d40391c2c3e0c35ec2765a7e03093d69721f588
40fb41dfd0e5acde2024682a865731afe9c3e9ec
refs/heads/master
2021-01-01T19:12:04.001121
2018-04-23T13:14:58
2018-04-23T13:14:58
98,530,554
0
2
null
2018-04-23T11:04:40
2017-07-27T11:59:40
Java
UTF-8
Java
false
false
3,196
java
/** * The contents of this file are subject to the OpenMRS Public License * Version 1.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://license.openmrs.org * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * Copyright (C) OpenMRS, LLC. All Rights Reserved. */ package org.openmrs.module.esaudereports.reporting.cohort.evaluator; import org.openmrs.Cohort; import org.openmrs.annotation.Handler; import org.openmrs.calculation.result.CalculationResult; import org.openmrs.calculation.result.CalculationResultMap; import org.openmrs.module.esaudereports.reporting.cohort.definition.DateCalculationCohortDefinition; import org.openmrs.module.reporting.cohort.EvaluatedCohort; import org.openmrs.module.reporting.cohort.definition.CohortDefinition; import org.openmrs.module.reporting.evaluation.EvaluationContext; import org.openmrs.module.reporting.evaluation.EvaluationException; import org.openmrs.util.OpenmrsUtil; import java.util.Date; import java.util.HashSet; import java.util.Map; import java.util.Set; /** * Created by Nicholas Ingosi on 6/22/17. Evaluator for calculation based cohorts */ @Handler(supports = DateCalculationCohortDefinition.class, order = 10) public class DateCalculationCohortDefinitionEvaluator extends CalculationCohortDefinitionEvaluator { /** * @see org.openmrs.module.reporting.cohort.definition.evaluator.CohortDefinitionEvaluator#evaluate(org.openmrs.module.reporting.cohort.definition.CohortDefinition, * org.openmrs.module.reporting.evaluation.EvaluationContext) */ @Override public EvaluatedCohort evaluate(CohortDefinition cohortDefinition, EvaluationContext context) throws EvaluationException { CalculationResultMap map = doCalculation(cohortDefinition, context); DateCalculationCohortDefinition cd = (DateCalculationCohortDefinition) cohortDefinition; Set<Integer> passing = datesWithinRange(map, cd.getOnOrAfter(), cd.getOnOrBefore()); return new EvaluatedCohort(new Cohort(passing), cohortDefinition, context); } /** * Extracts patients from a calculation result map with date results in the given range * * @param results the calculation result map * @param minDateInclusive the minimum date (inclusive) * @param maxDateInclusive the maximum date (inclusive) * @return the extracted patient ids */ protected static Set<Integer> datesWithinRange(CalculationResultMap results, Date minDateInclusive, Date maxDateInclusive) { Set<Integer> ret = new HashSet<Integer>(); for (Map.Entry<Integer, CalculationResult> e : results.entrySet()) { Date result = null; try { result = e.getValue().asType(Date.class); } catch (Exception ex) { // pass } if (result != null) { if (OpenmrsUtil.compareWithNullAsEarliest(result, minDateInclusive) >= 0 && OpenmrsUtil.compareWithNullAsLatest(result, maxDateInclusive) <= 0) { ret.add(e.getKey()); } } } return ret; } }
[ "nicotwendelee@gmail.com" ]
nicotwendelee@gmail.com
062e96175afc7d10822baaff3b6ac5719451fed7
96337505231af6e7c10a86ac20c0ec33e9efc426
/org.archstudio.xadl3.implementation/src/org/archstudio/xadl3/implementation_3_0/util/Implementation_3_0ResourceImpl.java
13c4e3cbc95f2cd5a3d1e23740efe838a73cd1fa
[]
no_license
azurewer/ArchStudio5
d39f9e12d1ea5695fe5396db04ab0b1f0f7ba509
f82608599dae1a1eed3341b876eb3ea995c12730
refs/heads/master
2021-01-20T07:13:38.814265
2017-05-17T08:22:59
2017-05-17T08:22:59
89,980,306
0
0
null
2017-05-02T01:52:16
2017-05-02T01:52:15
null
UTF-8
Java
false
false
710
java
/** */ package org.archstudio.xadl3.implementation_3_0.util; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; /** * <!-- begin-user-doc --> The <b>Resource </b> associated with the package. <!-- end-user-doc --> * * @see org.archstudio.xadl3.implementation_3_0.util.Implementation_3_0ResourceFactoryImpl * @generated */ public class Implementation_3_0ResourceImpl extends XMLResourceImpl { /** * Creates an instance of the resource. <!-- begin-user-doc --> <!-- end-user-doc --> * * @param uri the URI of the new resource. * @generated */ public Implementation_3_0ResourceImpl(URI uri) { super(uri); } } // Implementation_3_0ResourceImpl
[ "sahendrickson@gmail.com" ]
sahendrickson@gmail.com
a6e29ea5fb5ddaa39674dbc20ecf485318418c5e
41589b12242fd642cb7bde960a8a4ca7a61dad66
/teams/fibbyBot10/behaviors/FactoryBehavior.java
ef8225d394bda601b29e3457edb58f17fc4c346f
[]
no_license
Cixelyn/bcode2011
8e51e467b67b9ce3d9cf1160d9bd0e9f20114f96
eccb2c011565c46db942b3f38eb3098b414c154c
refs/heads/master
2022-11-05T12:52:17.671674
2011-01-27T04:49:12
2011-01-27T04:49:12
275,731,519
0
0
null
null
null
null
UTF-8
Java
false
false
3,188
java
package fibbyBot10.behaviors; import fibbyBot10.*; import battlecode.common.*; public class FactoryBehavior extends Behavior { FactoryBuildOrder obj = FactoryBuildOrder.WAIT_FOR_DOCK; MapLocation unitDock; Robot rFront; int tanksBuilt = 0; public FactoryBehavior(RobotPlayer player) { super(player); } public void run() throws Exception { Utility.setIndicator(myPlayer, 0, myPlayer.myRC.getDirection().toString()); switch ( obj ) { case WAIT_FOR_DOCK: Utility.setIndicator(myPlayer, 1, "WAIT_FOR_DOCK"); if ( unitDock != null ) { while ( myPlayer.myMotor.isActive() ) myPlayer.sleep(); if ( myPlayer.myRC.getLocation().distanceSquaredTo(unitDock) <= ComponentType.FACTORY.range ) { myPlayer.myMotor.setDirection(myPlayer.myRC.getLocation().directionTo(unitDock)); obj = FactoryBuildOrder.SLEEP; } } return; case SLEEP: Utility.setIndicator(myPlayer, 1, "SLEEP"); Utility.setIndicator(myPlayer, 2, ""); myPlayer.myRC.turnOff(); return; case BUILD_TANKS: Utility.setIndicator(myPlayer, 1, "BUILD_TANKS"); Utility.setIndicator(myPlayer, 2, "Building tank " + Integer.toString(tanksBuilt) + "."); rFront = (Robot)myPlayer.mySensor.senseObjectAtLocation(myPlayer.myRC.getLocation().add(myPlayer.myRC.getDirection()), RobotLevel.ON_GROUND); while ( rFront != null || myPlayer.myBuilder.isActive() || myPlayer.myRC.getTeamResources() < Chassis.BUILDING.cost + ComponentType.RECYCLER.cost + Constants.RESERVE + 5 || myPlayer.myRC.getTeamResources() < myPlayer.myLastRes + Chassis.MEDIUM.upkeep + Chassis.BUILDING.upkeep ) { myPlayer.sleep(); rFront = (Robot)myPlayer.mySensor.senseObjectAtLocation(myPlayer.myRC.getLocation().add(myPlayer.myRC.getDirection()), RobotLevel.ON_GROUND); } Utility.buildChassis(myPlayer, myPlayer.myRC.getDirection(), Chassis.MEDIUM); Utility.buildComponent(myPlayer, myPlayer.myRC.getDirection(), ComponentType.RAILGUN, RobotLevel.ON_GROUND); Utility.buildComponent(myPlayer, myPlayer.myRC.getDirection(), ComponentType.MEDIC, RobotLevel.ON_GROUND); tanksBuilt++; return; case PAUSE_TANKS: Utility.setIndicator(myPlayer, 1, "PAUSE_TANKS"); Utility.setIndicator(myPlayer, 2, "Pausing tank " + Integer.toString(tanksBuilt) + "."); return; } } public String toString() { return "FactoryBehavior"; } public void newComponentCallback(ComponentController[] components) { } public void newMessageCallback(MsgType t, Message msg) { if ( t == MsgType.MSG_SEND_DOCK ) unitDock = msg.locations[Messenger.firstData]; if ( t == MsgType.MSG_STOP_TANKS ) obj = FactoryBuildOrder.PAUSE_TANKS; if ( t == MsgType.MSG_START_TANKS ) obj = FactoryBuildOrder.BUILD_TANKS; } public void onWakeupCallback(int lastActiveRound) { obj = FactoryBuildOrder.BUILD_TANKS; } public void onDamageCallback(double damageTaken) { } }
[ "51144+Cixelyn@users.noreply.github.com" ]
51144+Cixelyn@users.noreply.github.com
4a95d9f18897881620d2d3a2503c44112c3a303d
0ac3db7e3a7f1b408f5f8f34bf911b1c7e7a4289
/src/bone/server/server/clientpackets/C_Door.java
b3bd053dd320caa877693e40599aa5d33f683047
[]
no_license
zajako/lineage-jimin
4d56ad288d4417dca92bc824f2d1b484992702e3
d8148ac99ad0b5530be3c22e6d7a5db80bbf2e5e
refs/heads/master
2021-01-10T00:57:46.449401
2011-10-05T22:32:33
2011-10-05T22:32:33
46,512,502
0
2
null
null
null
null
UHC
Java
false
false
6,492
java
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */ package bone.server.server.clientpackets; import java.util.Random; import server.LineageClient; import bone.server.server.ActionCodes; import bone.server.server.datatables.HouseTable; import bone.server.server.model.L1Clan; import bone.server.server.model.L1World; import bone.server.server.model.Instance.L1DoorInstance; import bone.server.server.model.Instance.L1ItemInstance; import bone.server.server.model.Instance.L1PcInstance; import bone.server.server.model.item.L1ItemId; import bone.server.server.serverpackets.S_ServerMessage; import bone.server.server.templates.L1House; import bone.server.server.utils.L1SpawnUtil; // Referenced classes of package bone.server.server.clientpackets: // ClientBasePacket, C_Door public class C_Door extends ClientBasePacket { private static final String C_DOOR = "[C] C_Door"; private static Random _random = new Random(); public C_Door(byte abyte0[], LineageClient client) throws Exception { super(abyte0); @SuppressWarnings("unused") int locX = readH(); @SuppressWarnings("unused") int locY = readH(); int objectId = readD(); L1PcInstance pc = client.getActiveChar(); L1DoorInstance door = (L1DoorInstance)L1World.getInstance().findObject(objectId); //System.out.println("현재 문 번호 : "+door.getDoorId()); if (door.getDoorId() == 7200 || door.getDoorId() == 7300 || door.getDoorId() == 7510 || door.getDoorId() == 7511 || door.getDoorId() == 7520 || door.getDoorId() == 7530 || door.getDoorId() == 7540 || door.getDoorId() == 7550){ return; } if ((door.getDoorId() >= 5000 && door.getDoorId() <= 5009)) { return; } if (door != null && !isExistKeeper(pc, door.getKeeperId())) { if(door.getDoorId() == 113){ if(pc.getInventory().checkItem(40163)){ pc.getInventory().consumeItem(40163, 1); }else{ return; } } if(door.getDoorId() == 125){ if(pc.getInventory().checkItem(40313)){ pc.getInventory().consumeItem(40313, 1); }else{ return; } } if(door.getDoorId() >= 7100 && door.getDoorId() < 8000){ if(pc.getInventory().checkItem(L1ItemId.ANTCATALYST, 1)){ antEgg(pc, door, door.getMapId()); return; }else{ return; } } if(door.getDoorId() >= 8001 && door.getDoorId() <= 8010){ if(pc.getInventory().checkItem(L1ItemId.GIRANCAVE_BOXKEY, 1)){ giranCaveBox(pc, door); return; }else{ return; } } if (door.getOpenStatus() == ActionCodes.ACTION_Open) { door.close(); } else if (door.getOpenStatus() == ActionCodes.ACTION_Close) { door.open(); } } } private void giranCaveBox(L1PcInstance pc, L1DoorInstance door) { int ran = _random.nextInt(100) + 1; L1ItemInstance item = null; if (door.getOpenStatus() == ActionCodes.ACTION_Close){ pc.getInventory().consumeItem(L1ItemId.GIRANCAVE_BOXKEY, 1); door.open(); if (ran >= 0 && ran <= 60){ item = pc.getInventory().storeItem(40308, 10000); pc.sendPackets(new S_ServerMessage(403, item.getLogName())); }else if(ran >= 61 && ran <= 70){ item = pc.getInventory().storeItem(40308, 30000); pc.sendPackets(new S_ServerMessage(403, item.getLogName())); }else if(ran >= 71 && ran <= 75){ item = pc.getInventory().storeItem(40308, 50000); pc.sendPackets(new S_ServerMessage(403, item.getLogName())); }else if(ran >= 76 && ran <=80){ item = pc.getInventory().storeItem(40308, 100000); pc.sendPackets(new S_ServerMessage(403, item.getLogName())); }else if(ran >= 81 && ran <=90){ item = pc.getInventory().storeItem(40074, 5); pc.sendPackets(new S_ServerMessage(403, item.getLogName())); }else if(ran >= 91 && ran <=100){ item = pc.getInventory().storeItem(40087, 5); pc.sendPackets(new S_ServerMessage(403, item.getLogName())); } } } private void antEgg(L1PcInstance pc, L1DoorInstance door, short mapid) { int ran = _random.nextInt(100) + 1; int[] mobid = {45946, 45947, 45948, 45949, 45950, 45951, 45115, 45190}; int[] itemLow = {148, 52, 20149, 20115, 20231, 40053 }; int[] itemMiddle = { 40087, 40074 }; int[] itemHigh = {64, 140087, 140074 }; L1ItemInstance item = null; if (door.getOpenStatus() == ActionCodes.ACTION_Close){ pc.getInventory().consumeItem(L1ItemId.ANTCATALYST, 1); door.open(); if (ran >= 0 && ran < 40){ L1SpawnUtil.spawn(pc, mobid[ran % mobid.length], 0, 300000, false); }else if (ran >= 40 && ran < 95){ item = pc.getInventory().storeItem(itemLow[ran % itemLow.length], 1); pc.sendPackets(new S_ServerMessage(403, item.getName())); }else if ((ran >= 95 && ran <= 99) && (mapid >= 541 && mapid <= 543)){ item = pc.getInventory().storeItem(itemMiddle[ran % itemMiddle.length], 1); pc.sendPackets(new S_ServerMessage(403, item.getName())); }else if ((ran == 100) && (mapid >= 541 && mapid <= 543)){ item = pc.getInventory().storeItem(itemHigh[ran % itemHigh.length], 1); pc.sendPackets(new S_ServerMessage(403, item.getName())); }else { L1SpawnUtil.spawn(pc, mobid[ran % mobid.length], 0, 300000, false); } } } private boolean isExistKeeper(L1PcInstance pc, int keeperId) { if (keeperId == 0) { return false; } L1Clan clan = L1World.getInstance().getClan(pc.getClanname()); if (clan != null) { int houseId = clan.getHouseId(); if (houseId != 0) { L1House house = HouseTable.getInstance().getHouseTable(houseId); if (keeperId == house.getKeeperId()) { return false; } } } return true; } @Override public String getType() { return C_DOOR; } }
[ "wlals1978@nate.com" ]
wlals1978@nate.com
d9c4eb5d76070823ee6e929e8ac1fec4906b5ac7
9573f936174ccbcda704e1b83d596a3f093f727c
/OPERAcraft New/temp/src/minecraft_server/net/minecraft/src/CommandGameMode.java
385b581e61562da27912fa604557471ebe09fc15
[]
no_license
operacraft/Minecraft
17466d8538be6253f4d689926d177614c6accf5b
89c4012b11cf5fa118cd5e63b0f51d03ee1ddc09
refs/heads/master
2021-01-10T05:54:10.056575
2016-02-24T15:54:29
2016-02-24T15:54:49
51,405,369
1
2
null
null
null
null
UTF-8
Java
false
false
2,686
java
package net.minecraft.src; import java.util.List; import net.minecraft.server.MinecraftServer; import net.minecraft.src.CommandBase; import net.minecraft.src.EntityPlayerMP; import net.minecraft.src.EnumGameType; import net.minecraft.src.ICommandSender; import net.minecraft.src.StatCollector; import net.minecraft.src.WorldSettings; import net.minecraft.src.WrongUsageException; public class CommandGameMode extends CommandBase { public String func_71517_b() { return "gamemode"; } public int func_82362_a() { return 2; } public String func_71518_a(ICommandSender p_71518_1_) { return p_71518_1_.func_70004_a("commands.gamemode.usage", new Object[0]); } public void func_71515_b(ICommandSender p_71515_1_, String[] p_71515_2_) { if(p_71515_2_.length > 0) { EnumGameType var3 = this.func_71539_b(p_71515_1_, p_71515_2_[0]); EntityPlayerMP var4 = p_71515_2_.length >= 2?func_82359_c(p_71515_1_, p_71515_2_[1]):func_71521_c(p_71515_1_); var4.func_71033_a(var3); var4.field_70143_R = 0.0F; String var5 = StatCollector.func_74838_a("gameMode." + var3.func_77149_b()); if(var4 != p_71515_1_) { func_71524_a(p_71515_1_, 1, "commands.gamemode.success.other", new Object[]{var4.func_70023_ak(), var5}); } else { func_71524_a(p_71515_1_, 1, "commands.gamemode.success.self", new Object[]{var5}); } } else { throw new WrongUsageException("commands.gamemode.usage", new Object[0]); } } protected EnumGameType func_71539_b(ICommandSender p_71539_1_, String p_71539_2_) { return !p_71539_2_.equalsIgnoreCase(EnumGameType.SURVIVAL.func_77149_b()) && !p_71539_2_.equalsIgnoreCase("s")?(!p_71539_2_.equalsIgnoreCase(EnumGameType.CREATIVE.func_77149_b()) && !p_71539_2_.equalsIgnoreCase("c")?(!p_71539_2_.equalsIgnoreCase(EnumGameType.ADVENTURE.func_77149_b()) && !p_71539_2_.equalsIgnoreCase("a")?WorldSettings.func_77161_a(func_71532_a(p_71539_1_, p_71539_2_, 0, EnumGameType.values().length - 2)):EnumGameType.ADVENTURE):EnumGameType.CREATIVE):EnumGameType.SURVIVAL; } public List func_71516_a(ICommandSender p_71516_1_, String[] p_71516_2_) { return p_71516_2_.length == 1?func_71530_a(p_71516_2_, new String[]{"survival", "creative", "adventure"}):(p_71516_2_.length == 2?func_71530_a(p_71516_2_, this.func_71538_c()):null); } protected String[] func_71538_c() { return MinecraftServer.func_71276_C().func_71213_z(); } public boolean func_82358_a(String[] p_82358_1_, int p_82358_2_) { return p_82358_2_ == 1; } }
[ "operacraft@googlegroups.com" ]
operacraft@googlegroups.com
a4cb499a3461d207e1a2207adec236df6aa4ead3
8ae12e614deeda5a2ba8ecad3422b5f5da76eeb0
/src/main/java/com/google/devtools/build/lib/remote/logging/LoggingInterceptor.java
bf1b393ecbc9e9d75c810cbb25aea7914328818b
[ "Apache-2.0" ]
permissive
dilbrent/bazel
c3372b0a994ae9fe939620b307a4ae70d2b786ff
7b73c5f6abc9e9b574849f760873252ee987e184
refs/heads/master
2020-03-22T03:16:33.241314
2018-08-09T12:17:29
2018-08-09T12:18:55
139,422,574
2
0
Apache-2.0
2018-07-02T09:39:10
2018-07-02T09:39:08
null
UTF-8
Java
false
false
6,237
java
// Copyright 2018 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.lib.remote.logging; import com.google.bytestream.ByteStreamGrpc; import com.google.devtools.build.lib.clock.Clock; import com.google.devtools.build.lib.remote.logging.RemoteExecutionLog.LogEntry; import com.google.devtools.build.lib.remote.util.TracingMetadataUtils; import com.google.devtools.build.lib.util.io.AsynchronousFileOutputStream; import com.google.devtools.remoteexecution.v1test.ActionCacheGrpc; import com.google.devtools.remoteexecution.v1test.ContentAddressableStorageGrpc; import com.google.devtools.remoteexecution.v1test.ExecutionGrpc; import com.google.devtools.remoteexecution.v1test.RequestMetadata; import com.google.protobuf.Timestamp; import com.google.watcher.v1.WatcherGrpc; import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; import io.grpc.ClientInterceptor; import io.grpc.ForwardingClientCall; import io.grpc.ForwardingClientCallListener; import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; import java.time.Instant; import javax.annotation.Nullable; /** Client interceptor for logging details of certain gRPC calls. */ public class LoggingInterceptor implements ClientInterceptor { private final AsynchronousFileOutputStream rpcLogFile; private final Clock clock; /** Constructs a LoggingInterceptor which logs RPC calls to the given file. */ public LoggingInterceptor(AsynchronousFileOutputStream rpcLogFile, Clock clock) { this.rpcLogFile = rpcLogFile; this.clock = clock; } /** * Returns a {@link LoggingHandler} to handle logging details for the specified method. If there * is no handler for the given method, returns {@code null}. * * @param method Method to return handler for. */ @SuppressWarnings("rawtypes") protected <ReqT, RespT> @Nullable LoggingHandler selectHandler( MethodDescriptor<ReqT, RespT> method) { if (method == ExecutionGrpc.getExecuteMethod()) { return new ExecuteHandler(); } else if (method == WatcherGrpc.getWatchMethod()) { return new WatchHandler(); } else if (method == ActionCacheGrpc.getGetActionResultMethod()) { return new GetActionResultHandler(); } else if (method == ContentAddressableStorageGrpc.getFindMissingBlobsMethod()) { return new FindMissingBlobsHandler(); } else if (method == ByteStreamGrpc.getReadMethod()) { return new ReadHandler(); } else if (method == ByteStreamGrpc.getWriteMethod()) { return new WriteHandler(); } return null; } @Override public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall( MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, Channel next) { ClientCall<ReqT, RespT> call = next.newCall(method, callOptions); LoggingHandler<ReqT, RespT> handler = selectHandler(method); if (handler != null) { return new LoggingForwardingCall<>(call, handler, method); } else { return call; } } /** Get current time as a Timestamp. */ private Timestamp getCurrentTimestamp() { Instant time = Instant.ofEpochMilli(clock.currentTimeMillis()); return Timestamp.newBuilder() .setSeconds(time.getEpochSecond()) .setNanos(time.getNano()) .build(); } /** * Wraps client call to log call details by building a {@link LogEntry} and writing it to the RPC * log file. */ private class LoggingForwardingCall<ReqT, RespT> extends ForwardingClientCall.SimpleForwardingClientCall<ReqT, RespT> { private final LoggingHandler<ReqT, RespT> handler; private final LogEntry.Builder entryBuilder; protected LoggingForwardingCall( ClientCall<ReqT, RespT> delegate, LoggingHandler<ReqT, RespT> handler, MethodDescriptor<ReqT, RespT> method) { super(delegate); this.handler = handler; this.entryBuilder = LogEntry.newBuilder().setMethodName(method.getFullMethodName()); } @Override public void start(Listener<RespT> responseListener, Metadata headers) { entryBuilder.setStartTime(getCurrentTimestamp()); RequestMetadata metadata = TracingMetadataUtils.requestMetadataFromHeaders(headers); if (metadata != null) { entryBuilder.setMetadata(metadata); } super.start( new ForwardingClientCallListener.SimpleForwardingClientCallListener<RespT>( responseListener) { @Override public void onMessage(RespT message) { handler.handleResp(message); super.onMessage(message); } @Override public void onClose(Status status, Metadata trailers) { entryBuilder.setEndTime(getCurrentTimestamp()); entryBuilder.setStatus(makeStatusProto(status)); entryBuilder.setDetails(handler.getDetails()); rpcLogFile.write(entryBuilder.build()); super.onClose(status, trailers); } }, headers); } @Override public void sendMessage(ReqT message) { handler.handleReq(message); super.sendMessage(message); } } /** Converts io.grpc.Status to com.google.rpc.Status proto for logging. */ private static com.google.rpc.Status makeStatusProto(Status status) { String message = ""; if (status.getCause() != null) { message = status.getCause().toString(); } else if (status.getDescription() != null) { message = status.getDescription(); } return com.google.rpc.Status.newBuilder() .setCode(status.getCode().value()) .setMessage(message) .build(); } }
[ "copybara-piper@google.com" ]
copybara-piper@google.com
3c2ba4403580666924327038e4aa8cc56dfe9e92
f6d0cd5de41515273b1ea0c3ccfddcfd71961608
/app/src/main/java/com/example/apple/scrolldemo/recycle/ding/DingAdapter.java
1f21d926dac964a56b1d58be225a718963e471e8
[]
no_license
crazyzhangxl/ScrollDemo
0d38da9abb4eceee0039027a7f84554d9f1425f6
cabb83d75f3504214269a589ce5285bab5f7bc3b
refs/heads/master
2020-04-04T18:42:17.590571
2019-11-26T01:05:18
2019-11-26T01:05:18
156,174,952
10
0
null
null
null
null
UTF-8
Java
false
false
3,515
java
package com.example.apple.scrolldemo.recycle.ding; import android.content.Context; import android.support.annotation.NonNull; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.ViewGroup; import com.example.apple.scrolldemo.R; import com.example.apple.scrolldemo.recycle.base.ZxlRecyclerAdapter; import java.util.List; /** * Created by apple on 2019-11-14. * description: */ public class DingAdapter extends ZxlRecyclerAdapter<DingBean,DingBaseViewHolder> { private static final int TYPE_TITLE = 1; private static final int TYPE_ICON = 2; public DingAdapter(List<DingBean> list, Context context) { super(list, context); } @NonNull @Override public DingBaseViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { // 根据类型进行数据返回 switch (i){ case TYPE_TITLE: return new DingTitleViewHolder(LayoutInflater.from(getContext()).inflate(R.layout.multi_item_head,viewGroup,false)); case TYPE_ICON: return new DingIconViewHolder(LayoutInflater.from(getContext()).inflate(R.layout.multi_item_inner,viewGroup,false)); default: return new DingTitleViewHolder(LayoutInflater.from(getContext()).inflate(R.layout.multi_item_head,viewGroup,false)); } } @Override public void onBindViewHolder(@NonNull DingBaseViewHolder dingBaseViewHolder, int i) { DingBean dingBean = getList().get(i); // 传入数据以及position dingBaseViewHolder.onBind(dingBean,i); } @Override public int getItemViewType(int position) { String category = getList().get(position).getCategory(); if (TextUtils.isEmpty(category)){ return TYPE_TITLE; } return TYPE_ICON; } @Override public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) { super.onAttachedToRecyclerView(recyclerView); RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager(); if (layoutManager instanceof GridLayoutManager){ final GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager; gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { @Override public int getSpanSize(int i) { // 注意这里是添加头部尾部的情况哦.... int itemViewType; if (getZxlHeadWithFooterAdapter() != null){ if ( i == 0){ return gridLayoutManager.getSpanCount(); }else if (i -1 == getItemCount()){ return gridLayoutManager.getSpanCount(); } itemViewType = getItemViewType(i-1); }else { itemViewType = getItemViewType(i); } switch (itemViewType){ case TYPE_TITLE: return gridLayoutManager.getSpanCount(); case TYPE_ICON: return 1; default: return gridLayoutManager.getSpanCount(); } } } ); } } }
[ "542813132@qq.com" ]
542813132@qq.com
a5a63c3649d4f2987f94e68993f14e9813399cd6
31e50022d4c02739ae9f83a9d5139b21f1e00bee
/plugins/org.wso2.developerstudio.visualdatamapper.diagram/src/org/wso2/developerstudio/datamapper/diagram/edit/commands/ContainsCreateCommand.java
e023f667ef16ddb16d4e3cdb6d264a0a8ef96ea9
[ "Apache-2.0" ]
permissive
wso2/devstudio-tooling-esb
d5ebc45a73e7c6090e230f0cb262dbfff5478b7d
a4004db3d576ce9e8f963a031d073508acbe8974
refs/heads/master
2023-06-28T18:28:44.267350
2021-01-04T06:46:30
2021-01-04T06:46:30
51,583,372
41
90
Apache-2.0
2021-03-09T05:02:56
2016-02-12T11:25:57
Java
UTF-8
Java
false
false
2,630
java
package org.wso2.developerstudio.datamapper.diagram.edit.commands; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.emf.ecore.EObject; import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.type.core.IElementType; import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; import org.eclipse.gmf.runtime.notation.View; import org.wso2.developerstudio.datamapper.Contains; import org.wso2.developerstudio.datamapper.DataMapperFactory; import org.wso2.developerstudio.datamapper.DataMapperRoot; /** * @generated */ public class ContainsCreateCommand extends EditElementCommand { /** * @generated */ public ContainsCreateCommand(CreateElementRequest req) { super(req.getLabel(), null, req); } /** * FIXME: replace with setElementToEdit() * @generated */ protected EObject getElementToEdit() { EObject container = ((CreateElementRequest) getRequest()).getContainer(); if (container instanceof View) { container = ((View) container).getElement(); } return container; } /** * @generated */ public boolean canExecute() { return true; } /** * @generated */ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { Contains newElement = DataMapperFactory.eINSTANCE.createContains(); DataMapperRoot owner = (DataMapperRoot) getElementToEdit(); owner.getOperators().add(newElement); doConfigure(newElement, monitor, info); ((CreateElementRequest) getRequest()).setNewElement(newElement); return CommandResult.newOKCommandResult(newElement); } /** * @generated */ protected void doConfigure(Contains newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IElementType elementType = ((CreateElementRequest) getRequest()).getElementType(); ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType); configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext()); configureRequest.addParameters(getRequest().getParameters()); ICommand configureCommand = elementType.getEditCommand(configureRequest); if (configureCommand != null && configureCommand.canExecute()) { configureCommand.execute(monitor, info); } } }
[ "erandacr@gmail.com" ]
erandacr@gmail.com
66c83079b71f6500f292da52227fac107470beea
641a2a3df717dbb5949f74956f326636ad6a2015
/imooc-security-authorize/src/main/java/com/imooc/security/rbac/service/impl/AdminServiceImpl.java
123967fa6d80b9e1084cef0e92d9293200151a31
[]
no_license
kawayildp/spring-security-learing-example
a12800e533d738e8bf1264817defe838ddee75fb
a48518f382dbc57627e130f70f7d5ddac7c10420
refs/heads/master
2020-04-29T18:44:08.615730
2019-03-18T17:02:00
2019-03-18T17:02:00
176,332,227
2
1
null
null
null
null
UTF-8
Java
false
false
3,519
java
/** * */ package com.imooc.security.rbac.service.impl; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.imooc.security.rbac.domain.Admin; import com.imooc.security.rbac.domain.RoleAdmin; import com.imooc.security.rbac.dto.AdminCondition; import com.imooc.security.rbac.dto.AdminInfo; import com.imooc.security.rbac.repository.AdminRepository; import com.imooc.security.rbac.repository.RoleAdminRepository; import com.imooc.security.rbac.repository.RoleRepository; import com.imooc.security.rbac.repository.spec.AdminSpec; import com.imooc.security.rbac.repository.support.QueryResultConverter; import com.imooc.security.rbac.service.AdminService; /** * @author zhailiang * */ @Service @Transactional public class AdminServiceImpl implements AdminService { @Autowired private AdminRepository adminRepository; @Autowired private RoleRepository roleRepository; @Autowired private RoleAdminRepository roleAdminRepository; @Autowired private PasswordEncoder passwordEncoder; /* (non-Javadoc) * @see com.imooc.security.rbac.service.AdminService#create(com.imooc.security.rbac.dto.AdminInfo) */ @Override public AdminInfo create(AdminInfo adminInfo) { Admin admin = new Admin(); BeanUtils.copyProperties(adminInfo, admin); admin.setPassword(passwordEncoder.encode("123456")); adminRepository.save(admin); adminInfo.setId(admin.getId()); createRoleAdmin(adminInfo, admin); return adminInfo; } /* (non-Javadoc) * @see com.imooc.security.rbac.service.AdminService#update(com.imooc.security.rbac.dto.AdminInfo) */ @Override public AdminInfo update(AdminInfo adminInfo) { Admin admin = adminRepository.findOne(adminInfo.getId()); BeanUtils.copyProperties(adminInfo, admin); createRoleAdmin(adminInfo, admin); return adminInfo; } /** * 创建角色用户关系数据。 * @param adminInfo * @param admin */ private void createRoleAdmin(AdminInfo adminInfo, Admin admin) { if(CollectionUtils.isNotEmpty(admin.getRoles())){ roleAdminRepository.delete(admin.getRoles()); } RoleAdmin roleAdmin = new RoleAdmin(); roleAdmin.setRole(roleRepository.getOne(adminInfo.getRoleId())); roleAdmin.setAdmin(admin); roleAdminRepository.save(roleAdmin); } /* (non-Javadoc) * @see com.imooc.security.rbac.service.AdminService#delete(java.lang.Long) */ @Override public void delete(Long id) { adminRepository.delete(id); } /* (non-Javadoc) * @see com.imooc.security.rbac.service.AdminService#getInfo(java.lang.Long) */ @Override public AdminInfo getInfo(Long id) { Admin admin = adminRepository.findOne(id); AdminInfo info = new AdminInfo(); BeanUtils.copyProperties(admin, info); return info; } /* (non-Javadoc) * @see com.imooc.security.rbac.service.AdminService#query(com.imooc.security.rbac.dto.AdminInfo, org.springframework.data.domain.Pageable) */ @Override public Page<AdminInfo> query(AdminCondition condition, Pageable pageable) { Page<Admin> admins = adminRepository.findAll(new AdminSpec(condition), pageable); return QueryResultConverter.convert(admins, AdminInfo.class, pageable); } }
[ "tony@gmail.com" ]
tony@gmail.com
6b4c4a74d93d3941fab4d43b5e8a0302f9980594
48a0e5e050c172cd225928a710e3be63398ad6ab
/java-basic/src/main/java/ch19/g/Test01.java
47ab2ed43d0e59c0284b50ad08a0f486543458e6
[]
no_license
jeonminhee/bitcamp-java-2018-12
ce38011132a00580ee7b9a398ce9e47f21b1af8b
a1b5f8befc1c531baf6c238c94a44206b48f8d94
refs/heads/master
2020-04-14T04:57:57.565700
2019-05-19T06:32:27
2019-05-19T06:32:27
163,650,679
0
0
null
null
null
null
UTF-8
Java
false
false
580
java
// File 필터 적용 전 package ch19.g; import java.io.File; public class Test01 { public static void main(String[] args) { // File 클래스 : 파일이나 디렉토리 정보를 다루는 도구(클래스)이다. File dir = new File("./"); // 이클립스에서 실행하면 ./는 프로젝트 디렉토리를 가리킨다. // 프로젝트 디렉토리에 있는 모든 파일이나 디렉토리를 검색하여 이름을 출력한다. String[] names = dir.list(); for(String name : names) { System.out.println(name); } } }
[ "yycel1357@naver.com" ]
yycel1357@naver.com
d0237fa0628e3db834601eba6b578b2d1e8ee001
a6a8708a196ff4056e94382acf51ebd9edf77ad6
/order-service-provider/src/main/java/com/erui/order/service/impl/DeliverConsignPaymentServiceImpl.java
c11f89622d4c6a3614c1b6cc9f9f3e2bc67f7d6b
[]
no_license
codeherofromchina/erui-order
eb5d8db5b1a9ef11638952b5cf5d5248140f58e1
8e28e6e38633131fd22cb7f39c0e7631a84104cc
refs/heads/master
2022-06-22T18:01:49.328290
2019-10-17T03:45:36
2019-10-17T03:45:36
213,706,201
0
1
null
2022-06-17T02:34:55
2019-10-08T17:19:50
Java
UTF-8
Java
false
false
6,214
java
package com.erui.order.service.impl; import com.erui.order.common.pojo.DeliverConsignPaymentInfo; import com.erui.order.common.pojo.UserInfo; import com.erui.order.common.util.ThreadLocalUtil; import com.erui.order.mapper.DeliverConsignPaymentMapper; import com.erui.order.model.entity.DeliverConsignPayment; import com.erui.order.model.entity.DeliverConsignPaymentExample; import com.erui.order.service.DeliverConsignPaymentService; import com.erui.order.service.util.DeliverConsignPaymentFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; import java.util.stream.Collectors; @Service @Transactional public class DeliverConsignPaymentServiceImpl implements DeliverConsignPaymentService { private static Logger LOGGER = LoggerFactory.getLogger(DeliverConsignPaymentServiceImpl.class); @Autowired private DeliverConsignPaymentMapper deliverConsignPaymentMapper; @Override public int insertOnDuplicateIdUpdate(Long deliverConsignId, List<DeliverConsignPaymentInfo> deliverConsignPaymentInfos) throws Exception { if (deliverConsignId == null) { throw new Exception("订舱ID错误"); } List<DeliverConsignPayment> deliverConsignPaymentList = listByDeliverConsignId02(deliverConsignId); Set<Long> deliverConsignPaymentIds = deliverConsignPaymentList.stream().map(DeliverConsignPayment::getId).collect(Collectors.toSet()); int updateNum = 0; for (DeliverConsignPaymentInfo deliverConsignPaymentInfo : deliverConsignPaymentInfos) { Long id = deliverConsignPaymentInfo.getId(); if (id == null) { updateNum += insert(deliverConsignId, deliverConsignPaymentInfo); } else if (deliverConsignPaymentIds.remove(id)) { // 更新操作 updateNum += updateById(id, deliverConsignPaymentInfo); } else { // 抛出异常,不是给定业务数据 throw new Exception("采购合同商品错误"); } } if (deliverConsignPaymentIds.size() > 0) { delete(deliverConsignPaymentIds.toArray(new Long[deliverConsignPaymentIds.size()])); } return updateNum; } @Override public int insert(Long deliverConsignId, List<DeliverConsignPaymentInfo> DeliverConsignPaymentList) { int insertNum = 0; for (DeliverConsignPaymentInfo deliverConsignPaymentInfo : DeliverConsignPaymentList) { insertNum += insert(deliverConsignId, deliverConsignPaymentInfo); } return insertNum; } @Override public int insert(Long deliverConsignId, DeliverConsignPaymentInfo deliverConsignPaymentInfo) { DeliverConsignPayment deliverConsignPayment = DeliverConsignPaymentFactory.deliverConsignPayment(deliverConsignPaymentInfo); UserInfo userInfo = ThreadLocalUtil.getUserInfo(); deliverConsignPayment.setDeliverConsignId(deliverConsignId); if (userInfo != null) { deliverConsignPayment.setCreateUserId(userInfo.getId()); } deliverConsignPayment.setCreateTime(new Date()); deliverConsignPayment.setDeleteFlag(Boolean.FALSE); return deliverConsignPaymentMapper.insert(deliverConsignPayment); } /** * 删除采购合同商品 * 设置附件的删除标志位为true * * @param ids */ @Override public void delete(Long... ids) { if (ids == null || ids.length == 0) { return; } List<Long> idList = Arrays.asList(ids); DeliverConsignPaymentExample example = new DeliverConsignPaymentExample(); example.createCriteria().andIdIn(idList); DeliverConsignPayment DeliverConsignPaymentSelective = new DeliverConsignPayment(); UserInfo userInfo = ThreadLocalUtil.getUserInfo(); if (userInfo != null) { DeliverConsignPaymentSelective.setUpdateUserId(userInfo.getId()); } DeliverConsignPaymentSelective.setDeleteFlag(Boolean.TRUE); DeliverConsignPaymentSelective.setDeleteTime(new Date()); deliverConsignPaymentMapper.updateByExampleSelective(DeliverConsignPaymentSelective, example); } @Override public int updateById(Long id, DeliverConsignPaymentInfo deliverConsignPaymentInfo) throws Exception { DeliverConsignPayment deliverConsignPayment = deliverConsignPaymentMapper.selectByPrimaryKey(id); if (deliverConsignPayment == null) { throw new Exception("订舱付款不存在"); } DeliverConsignPayment deliverConsignPaymentSelective = DeliverConsignPaymentFactory.deliverConsignPayment(deliverConsignPaymentInfo); deliverConsignPaymentSelective.setId(id); deliverConsignPaymentSelective.setUpdateTime(new Date()); UserInfo userInfo = ThreadLocalUtil.getUserInfo(); if (userInfo != null) { deliverConsignPaymentSelective.setUpdateUserId(userInfo.getId()); } return deliverConsignPaymentMapper.updateByPrimaryKeySelective(deliverConsignPaymentSelective); } @Override public List<DeliverConsignPaymentInfo> listByDeliverConsignId(Long deliverConsignId) { List<DeliverConsignPayment> DeliverConsignPaymentList = listByDeliverConsignId02(deliverConsignId); return DeliverConsignPaymentFactory.deliverConsignPaymentInfo(DeliverConsignPaymentList); } private List<DeliverConsignPayment> listByDeliverConsignId02(Long deliverConsignId) { DeliverConsignPaymentExample example = new DeliverConsignPaymentExample(); example.createCriteria().andDeliverConsignIdEqualTo(deliverConsignId) .andDeleteFlagEqualTo(Boolean.FALSE); List<DeliverConsignPayment> DeliverConsignPaymentList = deliverConsignPaymentMapper.selectByExample(example); if (DeliverConsignPaymentList == null) { DeliverConsignPaymentList = new ArrayList<>(); } return DeliverConsignPaymentList; } }
[ "wangxiaodan@sheyuan.com" ]
wangxiaodan@sheyuan.com
9e671ac13ddc21eeca6af6dac04ab6cce7e0aab5
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/apache/kafka/clients/consumer/ConsumerConfigTest.java
4fe893088a811b1745ba47cd20198a9946b09a62
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
5,339
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.kafka.clients.consumer; import ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG; import ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG; import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.apache.kafka.common.serialization.ByteArrayDeserializer; import org.apache.kafka.common.serialization.Deserializer; import org.apache.kafka.common.serialization.StringDeserializer; import org.junit.Assert; import org.junit.Test; public class ConsumerConfigTest { private final Deserializer keyDeserializer = new ByteArrayDeserializer(); private final Deserializer valueDeserializer = new StringDeserializer(); private final String keyDeserializerClassName = keyDeserializer.getClass().getName(); private final String valueDeserializerClassName = valueDeserializer.getClass().getName(); private final Object keyDeserializerClass = keyDeserializer.getClass(); private final Object valueDeserializerClass = valueDeserializer.getClass(); @Test public void testDeserializerToPropertyConfig() { Properties properties = new Properties(); properties.setProperty(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializerClassName); properties.setProperty(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializerClassName); Properties newProperties = ConsumerConfig.addDeserializerToConfig(properties, null, null); Assert.assertEquals(newProperties.get(KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClassName); Assert.assertEquals(newProperties.get(VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClassName); properties.clear(); properties.setProperty(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializerClassName); newProperties = ConsumerConfig.addDeserializerToConfig(properties, keyDeserializer, null); Assert.assertEquals(newProperties.get(KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClassName); Assert.assertEquals(newProperties.get(VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClassName); properties.clear(); properties.setProperty(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializerClassName); newProperties = ConsumerConfig.addDeserializerToConfig(properties, null, valueDeserializer); Assert.assertEquals(newProperties.get(KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClassName); Assert.assertEquals(newProperties.get(VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClassName); properties.clear(); newProperties = ConsumerConfig.addDeserializerToConfig(properties, keyDeserializer, valueDeserializer); Assert.assertEquals(newProperties.get(KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClassName); Assert.assertEquals(newProperties.get(VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClassName); } @Test public void testDeserializerToMapConfig() { Map<String, Object> configs = new HashMap<>(); configs.put(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializerClass); configs.put(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializerClass); Map<String, Object> newConfigs = ConsumerConfig.addDeserializerToConfig(configs, null, null); Assert.assertEquals(newConfigs.get(KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClass); Assert.assertEquals(newConfigs.get(VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClass); configs.clear(); configs.put(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializerClass); newConfigs = ConsumerConfig.addDeserializerToConfig(configs, keyDeserializer, null); Assert.assertEquals(newConfigs.get(KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClass); Assert.assertEquals(newConfigs.get(VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClass); configs.clear(); configs.put(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializerClass); newConfigs = ConsumerConfig.addDeserializerToConfig(configs, null, valueDeserializer); Assert.assertEquals(newConfigs.get(KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClass); Assert.assertEquals(newConfigs.get(VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClass); configs.clear(); newConfigs = ConsumerConfig.addDeserializerToConfig(configs, keyDeserializer, valueDeserializer); Assert.assertEquals(newConfigs.get(KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClass); Assert.assertEquals(newConfigs.get(VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClass); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
905ba1c83de2686b099d11d74150cbbf5a18cc8a
104b421e536d1667a70f234ec61864f9278137c4
/code/org/apache/james/mime4j/codec/CodecUtil.java
819361d614573984f38921d17b2f24274c86a9bf
[]
no_license
AshwiniVijayaKumar/Chrome-Cars
f2e61347c7416d37dae228dfeaa58c3845c66090
6a5e824ad5889f0e29d1aa31f7a35b1f6894f089
refs/heads/master
2021-01-15T11:07:57.050989
2016-05-13T05:01:09
2016-05-13T05:01:09
58,521,050
1
0
null
2016-05-11T06:51:56
2016-05-11T06:51:56
null
UTF-8
Java
false
false
1,856
java
package org.apache.james.mime4j.codec; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class CodecUtil { static final int DEFAULT_ENCODING_BUFFER_SIZE = 1024; public static void copy(InputStream paramInputStream, OutputStream paramOutputStream) throws IOException { byte[] arrayOfByte = new byte['Ѐ']; for (;;) { int i = paramInputStream.read(arrayOfByte); if (-1 == i) { break; } paramOutputStream.write(arrayOfByte, 0, i); } } public static void encodeBase64(InputStream paramInputStream, OutputStream paramOutputStream) throws IOException { paramOutputStream = new Base64OutputStream(paramOutputStream); copy(paramInputStream, paramOutputStream); paramOutputStream.close(); } public static void encodeQuotedPrintable(InputStream paramInputStream, OutputStream paramOutputStream) throws IOException { new QuotedPrintableEncoder(1024, false).encode(paramInputStream, paramOutputStream); } public static void encodeQuotedPrintableBinary(InputStream paramInputStream, OutputStream paramOutputStream) throws IOException { new QuotedPrintableEncoder(1024, true).encode(paramInputStream, paramOutputStream); } public static OutputStream wrapBase64(OutputStream paramOutputStream) throws IOException { return new Base64OutputStream(paramOutputStream); } public static OutputStream wrapQuotedPrintable(OutputStream paramOutputStream, boolean paramBoolean) throws IOException { return new QuotedPrintableOutputStream(paramOutputStream, paramBoolean); } } /* Location: C:\Users\ADMIN\Desktop\foss\dex2jar-2.0\classes-dex2jar.jar!\org\apache\james\mime4j\codec\CodecUtil.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "ASH ABHI" ]
ASH ABHI
51b277fb4b1209a68a306c3f3643c27c0e2edb79
26a02ec11fac41a4e1b691c8f257d150633b930d
/xml-impl/src/main/java/consulo/xml/lang/html/HtmlSurroundDescriptor.java
6df641df9342093d46206ed49d7e96802e8aba1a
[ "Apache-2.0" ]
permissive
consulo/consulo-xml
cb04cb6099417a5bbadc8f727015cffe033921ac
44a7832705cd7dbc1d98fa49834a41938e917dde
refs/heads/master
2023-08-31T06:54:20.530658
2023-08-31T06:17:13
2023-08-31T06:17:13
13,677,344
1
1
Apache-2.0
2023-01-01T16:41:13
2013-10-18T12:21:25
Java
UTF-8
Java
false
false
453
java
package consulo.xml.lang.html; import consulo.annotation.component.ExtensionImpl; import consulo.language.Language; import consulo.xml.lang.base.XmlBasedSurroundDescriptor; import javax.annotation.Nonnull; /** * @author VISTALL * @since 02-Aug-22 */ @ExtensionImpl(id = "html-xml") public class HtmlSurroundDescriptor extends XmlBasedSurroundDescriptor { @Nonnull @Override public Language getLanguage() { return HTMLLanguage.INSTANCE; } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
7ddcc1316ff85e43ea37c130742ebe5505010466
ab59063ff2ae941b876324070d8f8e8165cef960
/chunking_text_file/40authors/golangpkg/master/FileDeleter.java
a71251e9b56d00f485e21de336ce567335349d66
[]
no_license
gpoorvi92/author_class
f7c26f46f1ca9608a8c98fb18fc74a544cf99c36
b079ef0a477a2868140d77c4b32c317d4492725e
refs/heads/master
2020-04-01T18:01:54.665333
2018-12-10T14:55:11
2018-12-10T14:55:11
153,466,983
1
0
null
2018-10-17T14:44:56
2018-10-17T14:03:04
Java
UTF-8
Java
false
false
3,783
java
package com.am.jlfu.staticstate; import java.io.File; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import org.apache.commons.io.FileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; /** * Takes care of deleting the files. * * @author antoinem * */ @Component public class FileDeleter implements Runnable { private static final Logger log = LoggerFactory.getLogger(FileDeleter.class); /** The executor */ private ScheduledThreadPoolExecutor executor = (ScheduledThreadPoolExecutor) Executors.newScheduledThreadPool(1); @PostConstruct private void start() { executor.schedule(this, 10, TimeUnit.SECONDS); } /** * List of the files to delete. */ private List<File> files = Lists.newArrayList(); @Override public void run() { // extract all the files to an immutable list ImmutableList<File> copyOf; synchronized (this.files) { copyOf = ImmutableList.copyOf(this.files); } // log boolean weHaveFilesToDelete = !copyOf.isEmpty(); if (weHaveFilesToDelete) { log.debug(copyOf.size() + " files to delete"); } // and create a new list List<File> successfullyDeletedFiles = Lists.newArrayList(); // delete them for (File file : copyOf) { if (delete(file)) { successfullyDeletedFiles.add(file); log.debug(file + " successfully deleted."); } else { log.debug(file + " not deleted, rescheduled for deletion."); } } // all the files have been processed // remove the deleted files from queue synchronized (this.files) { Iterables.removeAll(this.files, successfullyDeletedFiles); } // log if (weHaveFilesToDelete) { log.debug(successfullyDeletedFiles.size() + " deleted files"); } // and reschedule start(); } /** * @param file * @return true if the file has been deleted, false otherwise. */ private boolean delete(File file) { try { // if file exists if (file.exists()) { // if it is a file if (file.isFile()) { // delete it return file.delete(); } // otherwise, if it is a directoy else if (file.isDirectory()) { FileUtils.deleteDirectory(file); return true; } // if its none of them, we cannot delete them so we assume its deleted. else { return true; } } // if does not exist, we can remove it from list else { return true; } } // if we have an exception catch (Exception e) { log.error(file + " deletion exception: " + e.getMessage()); // the file has not been deleted return false; } } public void deleteFile(File... file) { deleteFiles(Arrays.asList(file)); } public void deleteFiles(Collection<File> files) { synchronized (this.files) { this.files.addAll(files); } } /** * Returns true if the specified file is scheduled for deletion * * @param file * @return */ public boolean deletionQueueContains(File file) { synchronized (this.files) { return files.contains(file); } } @PreDestroy private void destroy() throws InterruptedException { log.debug("destroying executor"); executor.shutdown(); if (!executor.awaitTermination(1, TimeUnit.MINUTES)) { log.error("executor timed out"); List<Runnable> shutdownNow = executor.shutdownNow(); for (Runnable runnable : shutdownNow) { log.error(runnable + "has not been terminated"); } } } }
[ "gpoorvi92@gmail.com" ]
gpoorvi92@gmail.com
216f1569b5ee783b1318699a75693a2940a1a487
122287275ec1666cc27a6b6d06bab4f8b1c4ff33
/LimeTB-1.1.0/source/common/src/main/java/fi/hut/ics/lime/common/aspect/components/AspectMethod.java
caebf1f408a326438df5e506b0e24024fcf4ef4c
[ "MIT" ]
permissive
NJUCWL/symbolic_tools
f036691918b147019c99584efb4dcbe1228ae6c0
669f549b0a97045de4cd95b1df43de93b1462e45
refs/heads/main
2023-05-09T12:00:57.836897
2021-06-01T13:34:40
2021-06-01T13:34:40
370,017,201
2
0
null
null
null
null
UTF-8
Java
false
false
2,617
java
package fi.hut.ics.lime.common.aspect.components; import java.util.LinkedList; import java.util.List; import fi.hut.ics.lime.common.aspect.components.CodeFragment; import fi.hut.ics.lime.common.sourcecode.Visibility; /** * Simple class for representing methods in aspects. * @author jalampin * */ public class AspectMethod { protected final String name; protected Visibility visibility; protected String returnType; protected List<String> argList; protected CodeFragment body; /** * Creates a new method of the given name. The method * is of void type by default. * @param name name of the method. * @param visibility the visibility of the method, e. g. PUBLIC, * PROTECTED, DEFAULT or PRIVATE in Java, STATIC or NONSTATIC in C */ public AspectMethod(String name, Visibility visibility) { this.visibility = visibility; returnType = "void"; argList = new LinkedList<String>(); body = new CodeFragment(); this.name = name; } /** * Getter for the method body. * @return body of the method */ public CodeFragment getBody() { return body; } /** * Getter for the method name. * @return name of the method. */ public String getName() { return name; } /** * Getter for the return type of the method * @return return type of the method as a String. */ public String getReturnType() { return returnType; } /** * Getter for the visibility of the method. * @return visibility of the method. */ public Visibility getVisibility() { return visibility; } /** * Adds a new parameter to the method, e.g., * m.addArgument("int i"); * @param o argument type and name to be added. * @return true; */ public boolean addArgument(String o) { return argList.add(o); } /** * @return the arguments associated with this method as a * List of Strings */ public List<String> getArguments() { return this.argList; } /** * Setter for the return type of the method. * @param returnType return type of the method as a String. */ public void setReturnType(String returnType) { this.returnType = returnType; } /** * Setter for the visibility of the method. * @param visibility new visibility for the method. */ public void setVisibility(Visibility visibility) { this.visibility = visibility; } /** * Adds code to the beginning of the method. * @param code the code to be added. */ public void addBegin(String code) { body.addBegin(code); } /** * Adds code to the end of the method. * @param code the code to be added. */ public void addEnd(String code) { body.addEnd(code); } }
[ "48467952+NJUCWL@users.noreply.github.com" ]
48467952+NJUCWL@users.noreply.github.com
7caa63f76d5051c3171e2d687e40ab83e8c3f232
689cdf772da9f871beee7099ab21cd244005bfb2
/classes/com/payeco/android/plugin/util/PayecoKeyBoard.java
a530921281f7e78fbe988718bb8ee12ce52d2fe6
[]
no_license
waterwitness/dazhihui
9353fd5e22821cb5026921ce22d02ca53af381dc
ad1f5a966ddd92bc2ac8c886eb2060d20cf610b3
refs/heads/master
2020-05-29T08:54:50.751842
2016-10-08T08:09:46
2016-10-08T08:09:46
70,314,359
2
4
null
null
null
null
UTF-8
Java
false
false
4,648
java
package com.payeco.android.plugin.util; import android.app.Activity; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.PopupWindow; import android.widget.RadioGroup; import android.widget.RelativeLayout; import java.util.Random; public class PayecoKeyBoard extends PopupWindow { public static final int KEYBOARD_ALL = 0; public static final int KEYBOARD_CHARACTER = 2; public static final int KEYBOARD_DIGIT = 1; public static final int KEYBOARD_MAXLENGTH_UNLIMITED = -1; public static final int KEYBOARD_SYMBOL = 3; private static Resources a; private static String b; private Button cA; private Button cB; private int cC = 0; private int cD = -1; private View.OnClickListener cE = new f(this); private Activity cx; private View cy; private Button cz; private PayecoKeyBoard(Activity paramActivity, Button paramButton, View paramView, int paramInt1, int paramInt2) { super(paramView, -1, -2, true); this.cx = paramActivity; a = paramActivity.getResources(); b = this.cx.getPackageName(); this.cy = paramView; this.cz = paramButton; this.cC = paramInt1; this.cD = paramInt2; ((RelativeLayout)this.cy.findViewById(a.getIdentifier("payeco_keyboardLayout", "id", b))).setOnKeyListener(new g(this)); this.cA = ((Button)this.cy.findViewById(a.getIdentifier("payeco_keyboard_password", "id", b))); paramActivity = this.cz.getText(); if (paramActivity != null) { this.cA.setText(paramActivity); } this.cB = ((Button)this.cy.findViewById(a.getIdentifier("payeco_confirm_keyboard", "id", b))); this.cB.setOnClickListener(new h(this)); paramActivity = (RadioGroup)this.cy.findViewById(a.getIdentifier("payeco_keyboard_type", "id", b)); paramInt1 = a.getIdentifier("payeco_digit_keyboard", "id", b); paramInt2 = a.getIdentifier("payeco_character_keyboard", "id", b); int i = a.getIdentifier("payeco_symbol_keyboard", "id", b); a.getIdentifier("payeco_confirm_keyboard", "id", b); paramActivity.setOnCheckedChangeListener(new i(this, paramInt1, paramInt2, i)); if (this.cC == 1) { paramActivity.check(paramInt1); paramActivity.setVisibility(8); return; } if (this.cC == 2) { paramActivity.check(paramInt2); paramActivity.setVisibility(8); return; } if (this.cC == 3) { paramActivity.check(i); paramActivity.setVisibility(8); return; } paramActivity.check(paramInt1); } private static int[] l() { int[] arrayOfInt1 = new int[10]; int[] arrayOfInt2 = new int[10]; arrayOfInt2[1] = 1; arrayOfInt2[2] = 2; arrayOfInt2[3] = 3; arrayOfInt2[4] = 4; arrayOfInt2[5] = 5; arrayOfInt2[6] = 6; arrayOfInt2[7] = 7; arrayOfInt2[8] = 8; arrayOfInt2[9] = 9; Random localRandom = new Random(); int i = 0; for (;;) { if (i >= arrayOfInt2.length) { return arrayOfInt1; } int j = localRandom.nextInt(arrayOfInt2.length - i); arrayOfInt1[i] = arrayOfInt2[j]; arrayOfInt2[j] = arrayOfInt2[(arrayOfInt2.length - 1 - i)]; i += 1; } } public static PayecoKeyBoard popPayecoKeyboard(Activity paramActivity, View paramView, Button paramButton, int paramInt1, int paramInt2) { InputMethodManager localInputMethodManager = (InputMethodManager)paramActivity.getSystemService("input_method"); View localView = paramActivity.getCurrentFocus(); if ((localView != null) && (localInputMethodManager.isActive())) { localInputMethodManager.hideSoftInputFromWindow(localView.getWindowToken(), 2); } paramActivity = new PayecoKeyBoard(paramActivity, paramButton, ((LayoutInflater)paramActivity.getSystemService("layout_inflater")).inflate(paramActivity.getResources().getIdentifier("payeco_keyboard", "layout", paramActivity.getPackageName()), null), paramInt1, paramInt2); paramActivity.setBackgroundDrawable(new BitmapDrawable()); paramActivity.update(); paramActivity.showAtLocation(paramView, 80, 0, 0); return paramActivity; } public void dismiss() { super.dismiss(); } public CharSequence getPasswordText() { return this.cA.getText(); } } /* Location: E:\apk\dazhihui2\classes-dex2jar.jar!\com\payeco\android\plugin\util\PayecoKeyBoard.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
f089342481b391389f2a7dca796aec03f4a336a0
11b9a30ada6672f428c8292937dec7ce9f35c71b
/src/main/java/com/sun/org/apache/bcel/internal/generic/GotoInstruction.java
05294c1af24264ffce8e62fe12eb07e02c88b15d
[]
no_license
bogle-zhao/jdk8
5b0a3978526723b3952a0c5d7221a3686039910b
8a66f021a824acfb48962721a20d27553523350d
refs/heads/master
2022-12-13T10:44:17.426522
2020-09-27T13:37:00
2020-09-27T13:37:00
299,039,533
0
0
null
null
null
null
UTF-8
Java
false
false
5,596
java
/***** Lobxxx Translate Finished ******/ /* * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package com.sun.org.apache.bcel.internal.generic; /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" and * "Apache BCEL" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * "Apache BCEL", nor may "Apache" appear in their name, without * prior written permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * <p> *  Apache软件许可证,版本1.1 * *  版权所有(c)2001 Apache软件基金会。版权所有。 * *  如果满足以下条件,则允许重新分发和使用源代码和二进制形式(带或不带修改): * *  1.源代码的再分发必须保留上述版权声明,此条件列表和以下免责声明。 * *  2.二进制形式的再分发必须在分发所提供的文档和/或其他材料中复制上述版权声明,此条件列表和以下免责声明。 * *  3.包含在重新分发中的最终用户文档(如果有)必须包括以下声明:"本产品包括由Apache Software Foundation(http://www.apache.org/)开发的软件。 * 或者,如果此类第三方确认通常出现,则此确认可能出现在软件本身中。 * *  4.未经事先书面许可,不得使用名称"Apache"和"Apache Software Foundation"和"Apache BCEL"来认可或推广从本软件衍生的产品。 * 如需书面许可,请联系apache@apache.org。 * */ /** * Super class for GOTO * * <p> * 未经Apache软件基金会事先书面许可,从本软件衍生的产品可能不会被称为"Apache","Apache BCEL",也不可能出现在他们的名字中。 * *  本软件按"原样"提供,任何明示或默示的保证,包括但不限于适销性和特定用途适用性的默示保证。 * 在任何情况下,APACHE软件基金会或其捐赠者均不对任何直接,间接,偶发,特殊,惩罚性或后果性损害(包括但不限于替代商品或服务的采购,使用,数据丢失或利润或业务中断),无论是由于任何责任推理原因,无论是 * 在合同,严格责任或侵权(包括疏忽或其他方式)中,以任何方式使用本软件,即使已被告知此类软件的可能性损伤。 *  本软件按"原样"提供,任何明示或默示的保证,包括但不限于适销性和特定用途适用性的默示保证。 * ================================================== ==================。 * * * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> */ public abstract class GotoInstruction extends BranchInstruction implements UnconditionalBranch { GotoInstruction(short opcode, InstructionHandle target) { super(opcode, target); } /** * Empty constructor needed for the Class.newInstance() statement in * Instruction.readInstruction(). Not to be used otherwise. * <p> *  该软件包括许多个人代表Apache软件基金会所做的自愿捐款。有关Apache Software Foundation的更多信息,请参阅<http://www.apache.org/>。 * */ GotoInstruction(){} }
[ "zhaobo@MacBook-Pro.local" ]
zhaobo@MacBook-Pro.local
09e675b6762ac862dcc1cf0b6fddaaa2ce21361d
fe02f3a48cd516469abce09fff7255e50279dbbb
/parallel-tasks-exec-framework/src/main/java/com/asksunny/tasks/PartitionedTaskContext.java
43ba9698a0618bde9f6cfb6b1b95d9bad5725f33
[ "MIT" ]
permissive
devsunny/app-galleries
149cd74d04f2547093e20c34ddaf86be289e2cce
98aed1b18031ded93056ad12bda5b2c62c40a85b
refs/heads/master
2022-12-21T05:20:40.210246
2018-09-20T01:40:20
2018-09-20T01:40:20
21,674,470
0
1
MIT
2022-12-16T06:42:58
2014-07-10T01:20:03
Java
UTF-8
Java
false
false
1,336
java
package com.asksunny.tasks; import java.util.HashMap; import java.util.UUID; public class PartitionedTaskContext extends HashMap<String, String> { /** * */ private static final long serialVersionUID = 1L; private final String parallelTaskGuid = null; private String className; private String[] cliArgs = new String[] {}; private final String taskGuid = UUID.randomUUID().toString(); private int partitionSequence; private int totalPartitions; public PartitionedTaskContext() { super(); } public void init(String[] cliArgs) { if (cliArgs != null) { this.cliArgs = cliArgs; } } public String[] getCliArgs() { return cliArgs; } public String getTaskGuid() { return taskGuid; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public int getPartitionSequence() { return partitionSequence; } public void setPartitionSequence(int partitionSequence) { this.partitionSequence = partitionSequence; } public int getTotalPartitions() { return totalPartitions; } public void setTotalPartitions(int totalPartitions) { this.totalPartitions = totalPartitions; } public String getParallelTaskGuid() { return parallelTaskGuid; } }
[ "sunnyliu2@gmail.com" ]
sunnyliu2@gmail.com
1d49302bd7f03cfcd0958f9d98bb03bdeda544e1
7a95102e197d59a625e936aafcbf671d87908e2a
/Rto_app/RTO_Application/src/main/java/com/transport/rto/resource/services/impl/VechileSummaryServiceImpl.java
b1da98001bde533baa9cd61bd36d7838bf0e99a3
[]
no_license
satishyr/SpringBootSaiSir
31216c05dd47874bf243caf91a9459432ac40be3
ac0f9f3082802741f8e0fb4f57890468ef46a332
refs/heads/master
2021-01-02T15:43:38.535453
2020-02-11T06:04:17
2020-02-11T06:04:17
239,687,920
0
0
null
null
null
null
UTF-8
Java
false
false
2,366
java
package com.transport.rto.resource.services.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.transport.rto.model.VehicleDetails; import com.transport.rto.model.VehicleOwnerAddress; import com.transport.rto.model.VehicleOwnerDetails; import com.transport.rto.model.VehicleRegistrationDtls; import com.transport.rto.resource.binding.VehicleSummary; import com.transport.rto.resource.services.VehicleSummaryServices; import com.transport.rto.services.VchlRegistrationDetailsService; import com.transport.rto.services.VehicleDetailsService; import com.transport.rto.services.VehicleOwnerAddressService; import com.transport.rto.services.VehicleOwnerDetailsService; /** * * This is the implementation for Rest Service provide service to rest resource * @author Rituraj * */ @Service public class VechileSummaryServiceImpl implements VehicleSummaryServices{ /** * Autowiring or inject the vhclRegservice to get registration details */ @Autowired private VchlRegistrationDetailsService vhclRegservice; /** * Autowiring or inject the vhclDetailService to get vehicle Details */ @Autowired private VehicleDetailsService vhclDetailService; /** * Autowiring or inject the vhclOwnerDtls to get vehicle Owner details */ @Autowired private VehicleOwnerDetailsService vhclOwnerDtls; /** * Autowiring or inject the vhclAddrDts to get vehicle Owner Address details */ @Autowired private VehicleOwnerAddressService vhclAddrDts; /** * Overide that service class method to other four model service and collect all data * and set in the Vehicle summary class */ @Override public VehicleSummary findVehicleDetails(String regNum) { VehicleSummary summary=new VehicleSummary(); VehicleRegistrationDtls vechicleData = vhclRegservice.findbyRegNum(regNum); Integer vhclOwnerid = vechicleData.getDtlsEntity().getVhclOwnerid(); VehicleDetails vehicleDetails = vhclDetailService.findVehicleByOwnerId(vhclOwnerid); VehicleOwnerDetails ownerDetails = vhclOwnerDtls.findById(vhclOwnerid); VehicleOwnerAddress address = vhclAddrDts.findAddrbyOwnerId(vhclOwnerid); summary.setOwnerDetails(ownerDetails); summary.setVhclDtls(vehicleDetails); summary.setOwnerAddr(address); summary.setRegDlts(vechicleData); return summary; } }
[ "y.satishkumar34@gmail.com" ]
y.satishkumar34@gmail.com
f6e0d094cac1cd7cada534b3cf5ee014465941d9
5e2f704e893a7546491c3eb97b8d07117380afad
/e3-order-web/src/main/java/com/jisen/e3mall/order/interceptor/LoginInterceptor.java
5275521d1eee9f71b5bae44ecd6ee39ab439e4c2
[]
no_license
qq289736032/e3
786a1b8dd08e9fb9c3cd30fe5da916af6ac8478f
02805d3b9aa43d47eed58bae82e65350fa5cf177
refs/heads/master
2021-08-20T05:50:37.989239
2017-11-28T09:52:03
2017-11-28T09:52:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,811
java
package com.jisen.e3mall.order.interceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import com.jisen.e3mall.cart.service.CartService; import com.jisen.e3mall.common.utils.CookieUtils; import com.jisen.e3mall.common.utils.E3Result; import com.jisen.e3mall.common.utils.JsonUtils; import com.jisen.e3mall.pojo.TbItem; import com.jisen.e3mall.pojo.TbUser; import com.jisen.e3mall.sso.service.TokenService; public class LoginInterceptor implements HandlerInterceptor { @Value("${SSO_URL}") private String SSO_URL; @Autowired private TokenService tokenService; @Autowired private CartService cartService; public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object arg2) throws Exception { //从cookie中取token String token = CookieUtils.getCookieValue(request, "token"); //判断token中是否存在 if(StringUtils.isBlank(token)){ //如果token不存在,未登录状态,跳转到sso系统页面,用户登录成功后跳转到当前请求URL response.sendRedirect(SSO_URL+"/page/login?redirect="+request.getRequestURL()); return false; } //如果token存在需要调用sso系统的服务,根据token取用户信息 E3Result e3Result = tokenService.getUserByToken(token); //如果取不到,用户登录已过期,需要登录 if(e3Result.getStatus()!=200){ //如果token不存在,未登录状态,跳转到sso系统页面,用户登录成功后跳转到当前请求URL response.sendRedirect(SSO_URL+"/page/login?redirect="+request.getRequestURL()); return false; } //如果取到用户信息,是登录状态,需要把用户信息写入request TbUser user = (TbUser) e3Result.getData(); request.setAttribute("user", user); //判断cookie中是否有购物车信息,如果有就合并到服务端 String json = CookieUtils.getCookieValue(request, "cart",true); if(StringUtils.isNotBlank(json)){ //合并购物车 cartService.mergeCart(user.getId(), JsonUtils.jsonToList(json, TbItem.class)); } //方行 return true; } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object arg2, Exception arg3) throws Exception { // TODO Auto-generated method stub } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object arg2, ModelAndView arg3) throws Exception { // TODO Auto-generated method stub } }
[ "289736032@qq.com" ]
289736032@qq.com
f38373160ea8ba5bfb5b94b0ef8b4ce71a969984
b1b77bb1ed47586f96d8f2554a65bcbd0c7162cc
/NETFLIX/staash/staash-core/src/main/java/com/netflix/paas/dao/DaoProvider.java
d27d1208e69afccc3afd771929dacb61be37d55e
[]
no_license
DanHefrman/stuff
b3624d7089909972ee806211666374a261c02d08
b98a5c80cfe7041d8908dcfd4230cf065c17f3f6
refs/heads/master
2023-07-10T09:47:04.780112
2021-08-13T09:55:17
2021-08-13T09:55:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,293
java
/******************************************************************************* * /*** * * * * Copyright 2013 Netflix, Inc. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * * ******************************************************************************/ package com.netflix.paas.dao; import java.util.Map; import org.apache.commons.configuration.AbstractConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.google.inject.Inject; import com.netflix.paas.exceptions.NotFoundException; /** * Return an implementation of a DAO by schemaName and type. The schema name makes is possible * to have separates daos for the same type. * * @author elandau */ public class DaoProvider { private static final Logger LOG = LoggerFactory.getLogger(DaoProvider.class); private static final String DAO_TYPE_FORMAT = "com.netflix.paas.schema.%s.type"; private final Map<String, DaoSchemaProvider> schemaTypes; private final Map<String, DaoSchema> schemas; private final AbstractConfiguration configuration; @Inject public DaoProvider(Map<String, DaoSchemaProvider> schemaTypes, AbstractConfiguration configuration) { this.schemaTypes = schemaTypes; this.schemas = Maps.newHashMap(); this.configuration = configuration; } public <T> Dao<T> getDao(String schemaName, Class<T> type) throws NotFoundException { return getDao(new DaoKey<T>(schemaName, type)); } public synchronized <T> Dao<T> getDao(DaoKey<T> key) throws NotFoundException { return getSchema(key.getSchema()).getDao(key.getType()); } public synchronized DaoSchema getSchema(String schemaName) throws NotFoundException { DaoSchema schema = schemas.get(schemaName); if (schema == null) { String propertyName = String.format(DAO_TYPE_FORMAT, schemaName.toLowerCase()); String daoType = configuration.getString(propertyName); Preconditions.checkNotNull(daoType, "No DaoType specified for " + schemaName + " (" + propertyName + ")"); DaoSchemaProvider provider = schemaTypes.get(daoType); if (provider == null) { LOG.warn("Unable to find DaoManager for schema " + schemaName + "(" + daoType + ")"); throw new NotFoundException(DaoSchemaProvider.class, daoType); } schema = provider.getSchema(schemaName); schemas.put(schemaName, schema); LOG.info("Created DaoSchema for " + schemaName); } return schema; } }
[ "bryan.guner@gmail.com" ]
bryan.guner@gmail.com
cbf27598dc26269098eb8c10f5b2a9c0eaf0b5ff
e3c7db733b85f2b7a25ec829bd85b80d994a5494
/domain-accounts/src/main/java/vn/vmg/ptdv/hola/account/core/DeviceToken.java
d13b10602baa2259a56d5b284ec9d5c67d38e3b2
[]
no_license
HoangHieuBK/Holaship
c15cc1c47367ede4de4d7bac12850b2201d85c98
c49f0dcf82f5886080e024fa3802d628e4808ea8
refs/heads/master
2022-12-31T00:04:20.974666
2020-10-15T06:26:52
2020-10-15T06:26:52
304,214,124
0
0
null
null
null
null
UTF-8
Java
false
false
696
java
package vn.vmg.ptdv.hola.account.core; import lombok.Data; @Data public class DeviceToken { private String uniqueToken; private String type; private String MAC; private Boolean active; public DeviceToken() { } public DeviceToken(Boolean active) { this.active = active; } public DeviceToken(String uniqueToken){ this.uniqueToken = uniqueToken; } public DeviceToken withUniqueToken(String deviceToken) { this.uniqueToken = deviceToken; return this; } public void isActive(DeviceToken deviceToken) { active = this.uniqueToken == null || !this.uniqueToken.equals(deviceToken.getUniqueToken()); } }
[ "hoanghieubk1996@gmail.com" ]
hoanghieubk1996@gmail.com
a9ea9f5911b077ed2e81b65507e8ac5e27b8a334
08a69a94bc136b53f9ccf0a10df7be60b472f324
/src/main/java/it/algos/springvaadin/service/IAService.java
2454eddad5b68760c6f8cc949c9025ad4a21fdec
[]
no_license
algos-soft/springvaadin
009a5600444280b7780d206002a0164679e2e5e0
99df63c86ab0b44f26f32ef7331ba80b61c6d0c3
refs/heads/master
2021-07-21T06:31:50.401010
2018-03-09T14:10:19
2018-03-09T14:10:19
93,712,658
0
0
null
null
null
null
UTF-8
Java
false
false
4,888
java
package it.algos.springvaadin.service; import it.algos.springvaadin.entity.AEntity; import it.algos.springvaadin.enumeration.EATypeButton; import java.lang.reflect.Field; import java.util.List; /** * Project springvaadin * Created by Algos * User: gac * Date: ven, 08-dic-2017 * Time: 07:36 */ public interface IAService { /** * Returns the number of entities available. * * @return the number of entities */ public int count(); /** * Retrieves an entity by its id. * * @param id must not be {@literal null}. * * @return the entity with the given id or {@literal null} if none found * * @throws IllegalArgumentException if {@code id} is {@literal null} */ public AEntity find(String id); /** * Returns all entities of the type. * <p> * Senza filtri * Ordinati per ID * <p> * Methods of this library return Iterable<T>, while the rest of my code expects Collection<T> * L'annotation standard di JPA prevede un ritorno di tipo Iterable, mentre noi usiamo List * Eseguo qui la conversione, che rimane trasparente al resto del programma * * @return all entities */ public List<? extends AEntity> findAll(); /** * Colonne visibili (e ordinate) nella Grid * Sovrascrivibile * La colonna key ID normalmente non si visualizza * 1) Se questo metodo viene sovrascritto, si utilizza la lista della sottoclasse specifica (con o senza ID) * 2) Se la classe AEntity->@AIList(columns = ...) prevede una lista specifica, usa quella lista (con o senza ID) * 3) Se non trova AEntity->@AIList, usa tutti i campi della AEntity (senza ID) * 4) Se trova AEntity->@AIList(showsID = true), questo viene aggiunto, indipendentemente dalla lista * 5) Vengono visualizzati anche i campi delle superclassi della classe AEntity * Ad esempio: company della classe ACompanyEntity * * @return lista di fields visibili nella Grid */ public List<Field> getListFields(); /** * Fields visibili (e ordinati) nel Form * Sovrascrivibile * Il campo key ID normalmente non viene visualizzato * 1) Se questo metodo viene sovrascritto, si utilizza la lista della sottoclasse specifica (con o senza ID) * 2) Se la classe AEntity->@AIForm(fields = ...) prevede una lista specifica, usa quella lista (con o senza ID) * 3) Se non trova AEntity->@AIForm, usa tutti i campi della AEntity (senza ID) * 4) Se trova AEntity->@AIForm(showsID = true), questo viene aggiunto, indipendentemente dalla lista * 5) Vengono visualizzati anche i campi delle superclassi della classe AEntity * Ad esempio: company della classe ACompanyEntity * * @return lista di fields visibili nel Form */ public List<Field> getFormFields(); /** * Lista di bottoni presenti nella toolbar (footer) della view AList * Legge la enumeration indicata nella @Annotation della AEntity * * @return lista (type) di bottoni visibili nella toolbar della view AList */ public List<EATypeButton> getListTypeButtons(); /** * Lista di bottoni presenti nella toolbar (footer) della view AForm * Legge la enumeration indicata nella @Annotation della AEntity * * @return lista (type) di bottoni visibili nella toolbar della view AForm */ public List<EATypeButton> getFormTypeButtons(); /** * Creazione in memoria di una nuova entity che NON viene salvata * Eventuali regolazioni iniziali delle property * Senza properties per compatibilità con la superclasse * * @return la nuova entity appena creata (non salvata) */ public AEntity newEntity(); /** * Saves a given entity. * Use the returned instance for further operations * as the save operation might have changed the entity instance completely. * * @param entityBean to be saved * * @return the saved entity */ public AEntity save(AEntity entityBean) ; /** * Saves a given entity. * Use the returned instance for further operations * as the save operation might have changed the entity instance completely. * * @param oldBean previus state * @param modifiedBean to be saved * * @return the saved entity */ public AEntity save(AEntity oldBean, AEntity modifiedBean) throws Exception; /** * Deletes a given entity. * * @param entityBean must not be null * * @return true, se la entity è stata effettivamente cancellata * * @throws IllegalArgumentException in case the given entity is {@literal null}. */ public boolean delete(AEntity entityBean); /** * Deletes all entities of the collection. */ public boolean deleteAll(); }// end of interface
[ "gac@algos.it" ]
gac@algos.it
9c70c368b507d6f8e1ccadd2c58244660e654290
e84fe87c58a3c14b99931a5b8249901dd65b164e
/src/test/java/io/r2dbc/postgresql/util/ByteBufUtilsTest.java
999977d82cc76c1f0751c6f912aed46b59dcd6de
[ "Apache-2.0" ]
permissive
Squiry/r2dbc-postgresql
34fe1601ee267cda5bf963d90afbb5584dca8411
1737dd74781c1be6165868750dee3c54bab2a29a
refs/heads/master
2021-07-17T02:51:11.493584
2020-02-28T08:34:03
2020-02-28T08:34:03
168,195,625
1
2
Apache-2.0
2019-01-29T17:19:18
2019-01-29T17:19:17
null
UTF-8
Java
false
false
1,163
java
/* * Copyright 2019-2020 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 * * https://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 io.r2dbc.postgresql.util; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import org.junit.jupiter.api.Test; import java.nio.ByteBuffer; import static org.assertj.core.api.Assertions.assertThat; final class ByteBufUtilsTest { @Test void shouldCopyByteBuffer() { ByteBuf source = Unpooled.wrappedBuffer("hello-world".getBytes()); ByteBuffer byteBuffer = ByteBufferUtils.toByteBuffer(source); assertThat(byteBuffer).isEqualTo(ByteBuffer.wrap("hello-world".getBytes())); } }
[ "mpaluch@pivotal.io" ]
mpaluch@pivotal.io
bb8d59814b68e0a11aec690bc6154f855764888d
d71fc6f733e494f35f1ea855f25c5e830efea632
/extension/core/fabric3-monitor-impl/src/main/java/org/fabric3/monitor/impl/writer/LongTimestampWriter.java
ef150b02e298b3569621081c9b8a09de3b71f09c
[ "Apache-2.0" ]
permissive
carecon/fabric3-core
d92ba6aa847386ee491d16f7802619ee1f65f493
14a6c6cd5d7d3cabf92e670ac89432a5f522c518
refs/heads/master
2020-04-02T19:54:51.148466
2018-12-06T19:56:50
2018-12-06T19:56:50
154,750,871
0
0
null
2018-10-25T23:39:54
2018-10-25T23:39:54
null
UTF-8
Java
false
false
4,519
java
/* * Fabric3 * Copyright (c) 2009-2015 Metaform Systems * * 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.fabric3.monitor.impl.writer; import org.fabric3.monitor.spi.buffer.ResizableByteBuffer; /** * Writes a long timestamp as a series of characters without allocating objects. */ public class LongTimestampWriter implements TimestampWriter { private static final String MIN_VALUE = "-9223372036854775808"; final static char[] DigitTens = {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '4', '4', '4', '4', '4', '4', '4', '4', '4', '4', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '6', '6', '6', '6', '6', '6', '6', '6', '6', '6', '7', '7', '7', '7', '7', '7', '7', '7', '7', '7', '8', '8', '8', '8', '8', '8', '8', '8', '8', '8', '9', '9', '9', '9', '9', '9', '9', '9', '9', '9',}; final static char[] DigitOnes = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',}; final static char[] digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; public int write(long value, ResizableByteBuffer buffer) { if (value == Long.MIN_VALUE) { CharSequenceWriter.write(MIN_VALUE, buffer); return MIN_VALUE.length(); } int start = buffer.position(); int size = (value < 0) ? stringSize(-value) + 1 : stringSize(value); int index = size + start; //char[] buf = new char[size]; getChars(value, index, buffer); buffer.position(index); return size; } void getChars(long i, int index, ResizableByteBuffer buffer) { long q; int r; int charPos = index; char sign = 0; if (i < 0) { sign = '-'; i = -i; } while (i > Integer.MAX_VALUE) { q = i / 100; // really: r = i - (q * 100); r = (int) (i - ((q << 6) + (q << 5) + (q << 2))); i = q; buffer.put(--charPos, (byte) DigitOnes[r]); buffer.put(--charPos, (byte) DigitTens[r]); } int q2; int i2 = (int) i; while (i2 >= 65536) { q2 = i2 / 100; // really: r = i2 - (q * 100); r = i2 - ((q2 << 6) + (q2 << 5) + (q2 << 2)); i2 = q2; buffer.put(--charPos, (byte) DigitOnes[r]); buffer.put(--charPos, (byte) DigitTens[r]); } for (; ; ) { q2 = (i2 * 52429) >>> (16 + 3); r = i2 - ((q2 << 3) + (q2 << 1)); buffer.put(--charPos, (byte) digits[r]); i2 = q2; if (i2 == 0) { break; } } if (sign != 0) { buffer.put(--charPos, (byte) sign); } } static int stringSize(long x) { long p = 10; for (int i = 1; i < 19; i++) { if (x < p) { return i; } p = 10 * p; } return 19; } }
[ "jim.marino@gmail.com" ]
jim.marino@gmail.com