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
a4b1556ddec1f2aab121efa7f0e899c3d5047a92
60f8c70d135763ef4ceab106f63af2244b2807f2
/YiLian/src/main/java/com/yilian/mall/CrashHandler.java
e8a9ddef45d09e529ec3afb8943d751ba37d38b7
[ "MIT" ]
permissive
LJW123/YiLianMall
f7f7af4d8d8517001455922e2a55e7064cdf9723
ea335a66cb4fd6417aa264a959847b094c90fb04
refs/heads/master
2022-07-16T08:54:43.231502
2020-05-21T09:22:05
2020-05-21T09:22:05
265,793,269
0
0
null
null
null
null
UTF-8
Java
false
false
8,595
java
package com.yilian.mall; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Build; import android.os.Environment; import android.os.Looper; import android.util.Log; import com.lidroid.xutils.exception.HttpException; import com.lidroid.xutils.http.ResponseInfo; import com.lidroid.xutils.http.callback.RequestCallBack; import com.orhanobut.logger.Logger; import com.yilian.mall.entity.BaseEntity; import com.yilian.mall.http.ServiceNetRequest; import java.io.File; import java.io.FileOutputStream; import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; import java.lang.Thread.UncaughtExceptionHandler; import java.lang.reflect.Field; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; public class CrashHandler implements UncaughtExceptionHandler{ public static final String TAG = "CrashHandler"; //CrashHandler实例 private static CrashHandler INSTANCE; private static String fileName; ServiceNetRequest netRequest; //系统默认的UncaughtException处理类 private Thread.UncaughtExceptionHandler mDefaultHandler; //程序的Context对象 private Context mContext; //用来存储设备信息和异常信息 private Map<String, String> infos = new HashMap<String, String>(); //用于格式化日期,作为日志文件名的一部分 private DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); /** 保证只有一个CrashHandler实例 */ private CrashHandler() { } /** 获取CrashHandler实例 ,单例模式 */ public static CrashHandler getInstance() { if (null == INSTANCE) { INSTANCE = new CrashHandler(); } return INSTANCE; } /** * 初始化 * * @param context */ public void init(Context context) { mContext = context; //获取系统默认的UncaughtException处理器 mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler(); //设置该CrashHandler为程序的默认处理器 Thread.setDefaultUncaughtExceptionHandler(this); } /** * 当UncaughtException发生时会转入该函数来处理 */ @Override public void uncaughtException(Thread thread, Throwable ex) { if (!handleException(ex) && mDefaultHandler != null) { //如果用户没有处理则让系统默认的异常处理器来处理 mDefaultHandler.uncaughtException(thread, ex); } else { try { Thread.sleep(500); } catch (InterruptedException e) { Log.e(TAG, "error : ", e); } //退出程序 android.os.Process.killProcess(android.os.Process.myPid()); System.exit(1); } } /** * 自定义错误处理,收集错误信息 发送错误报告等操作均在此完成. * * @param ex * @return true:如果处理了该异常信息;否则返回false. */ private boolean handleException(Throwable ex) { if (ex == null) { return false; } //使用Toast来显示异常信息 new Thread() { @Override public void run() { Looper.prepare(); Intent k = mContext.getPackageManager() .getLaunchIntentForPackage(mContext.getPackageName()); k.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); mContext.startActivity(k); Looper.loop(); } }.start(); //收集设备参数信息 // collectDeviceInfo(mContext); //保存日志文件 // saveCrashInfo2File(ex); //上传文件 // UpErrorData(); return true; } /** * 收集设备参数信息 * @param ctx */ public void collectDeviceInfo(Context ctx) { try { PackageManager pm = ctx.getPackageManager(); PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(), PackageManager.GET_ACTIVITIES); if (pi != null) { String versionName = pi.versionName == null ? "null" : pi.versionName; String versionCode = pi.versionCode + ""; infos.put("versionName", versionName); infos.put("versionCode", versionCode); } } catch (NameNotFoundException e) { Log.e(TAG, "an error occured when collect package info", e); } Field[] fields = Build.class.getDeclaredFields(); for (Field field : fields) { try { field.setAccessible(true); infos.put(field.getName(), field.get(null).toString()); Log.d(TAG, field.getName() + " : " + field.get(null)); } catch (Exception e) { Log.e(TAG, "an error occured when collect crash info", e); } } } /** * 保存错误信息到文件中 * * @param ex * @return 返回文件名称,便于将文件传送到服务器 */ private String saveCrashInfo2File(Throwable ex) { StringBuffer sb = new StringBuffer(); for (Map.Entry<String, String> entry : infos.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); sb.append(key + "=" + value + "\n"); } Writer writer = new StringWriter(); PrintWriter printWriter = new PrintWriter(writer); ex.printStackTrace(printWriter); Throwable cause = ex.getCause(); while (cause != null) { cause.printStackTrace(printWriter); cause = cause.getCause(); } printWriter.close(); String result = writer.toString(); sb.append(result); try { long timestamp = System.currentTimeMillis(); String time = formatter.format(new Date()); fileName = "crash-" + time + "-" + timestamp + ".log"; if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { String path = "/sdcard/crash/"; File dir = new File(path); if (!dir.exists()) { dir.mkdirs(); } FileOutputStream fos = new FileOutputStream(path + fileName); fos.write(sb.toString().getBytes()); fos.close(); } return fileName; } catch (Exception e) { Log.e(TAG, "an error occured while writing file...", e); } return null; } /** * 上传错误日志 */ private void UpErrorData(){ Logger.i("infor", "UpErrorData"); File directory = new File("/sdcard/crash"); if (directory != null && directory.exists() && directory.isDirectory()) { Logger.i("infordelete - if" + directory); File[] files = directory.listFiles(); // for (final File item : directory.listFiles()) { for (int i=0;i<1;i++) { final File item=files[i]; if (netRequest==null) { netRequest = new ServiceNetRequest(mContext); } Logger.i("infor", item.getName()); netRequest.debugLog(item, BaseEntity.class, new RequestCallBack<BaseEntity>() { @Override public void onStart() { super.onStart(); Logger.i("infor", "UpErrorData----onStart"); } @Override public void onSuccess(ResponseInfo<BaseEntity> arg0) { Logger.i("infor", arg0.result + ""); switch (arg0.result.code) { case 1: item.delete(); break; } } @Override public void onFailure(HttpException arg0, String arg1) { Logger.i("infor", arg0.getExceptionCode() + ""); } }); } } } }
[ "18203660536@163.com" ]
18203660536@163.com
2eaaf982bdf1717df1cc1d543caa5332d01fd102
bb56f7f78815dd73f57aee50a3fa0099f6956331
/algorithm-code/src/cn/xie/leetcode/LRUCache.java
238a332205c4babfc1ed91420592d5d368bcb54e
[]
no_license
ziemm/basic-code
86e11fbd267646146fb254bc6e210bdc339eab2b
c6cdf1d62138cc8560645ce7b4123b3598f07616
refs/heads/master
2023-08-23T02:55:24.350373
2021-10-02T03:17:18
2021-10-02T03:17:18
256,085,755
0
0
null
null
null
null
UTF-8
Java
false
false
2,155
java
package cn.xie.leetcode; import java.util.HashMap; import java.util.Map; /** * @author: xie * @create: 2020-09-06 12:19 **/ public class LRUCache { class Node{ int key,val; Node pre; Node next; Node(int key,int val){ this.key = key; this.val = val; } } private Map<Integer,Node> map; private int cap;//缓存容量 private int size=0; //当前容量 //双向链表的头尾哑节点 Node head; Node tail; public LRUCache(int capacity){ this.cap =capacity; //初始化双向链表 head = new Node(0,0); tail = new Node(0,0); head.next = tail; tail.pre = head; map = new HashMap(); } public int get(int key) { if(map.containsKey(key)){ Node node = map.get(key); moveToHead(node); return node.val; } return -1; } public void put(int key, int value) { //如果缓存存在,则更新缓存中的值,并将缓存移动到头部 if(map.containsKey(key)){ Node node = map.get(key); node.val = value; moveToHead(node); }else {//如果缓存不存在 //判断当前缓存是否超出容量,超出则删除末尾元素,并并删除map对应的映射 if(size>=cap){ Node node = tail.pre; map.remove(node.key); size--; remove(node); } //如果没有超出缓存,就直接添加在头部 Node node = new Node(key,value); map.put(key,node); size++; addToHead(node); } } private void remove(Node node){ node.next.pre = node.pre; node.pre.next = node.next; } private void addToHead(Node node){ node.pre = head; node.next = head.next; head.next = node; node.next.pre = node; } /*从链表中删除并插入头部的操作*/ private void moveToHead(Node node){ remove(node); addToHead(node); } }
[ "xielin.mail@qq.com" ]
xielin.mail@qq.com
c2cf1127560dc5ff976e59102569537fef3ccf1e
7dd73504d783c7ebb0c2e51fa98dea2b25c37a11
/eaglercraftx-1.8-main/sources/main/java/com/google/common/base/Present.java
1c19c400543836aae62cc488a6a59c46923dc33e
[ "LicenseRef-scancode-proprietary-license" ]
permissive
bagel-man/bagel-man.github.io
32813dd7ef0b95045f53718a74ae1319dae8c31e
eaccb6c00aa89c449c56a842052b4e24f15a8869
refs/heads/master
2023-04-05T10:27:26.743162
2023-03-16T04:24:32
2023-03-16T04:24:32
220,102,442
3
21
MIT
2022-12-14T18:44:43
2019-11-06T22:29:24
C++
UTF-8
Java
false
false
2,345
java
/* * Copyright (C) 2011 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.common.base; import static com.google.common.base.Preconditions.checkNotNull; import java.util.Collections; import java.util.Set; import javax.annotation.Nullable; import com.google.common.annotations.GwtCompatible; /** * Implementation of an {@link Optional} containing a reference. */ @GwtCompatible final class Present<T> extends Optional<T> { private final T reference; Present(T reference) { this.reference = reference; } @Override public boolean isPresent() { return true; } @Override public T get() { return reference; } @Override public T or(T defaultValue) { checkNotNull(defaultValue, "use Optional.orNull() instead of Optional.or(null)"); return reference; } @Override public Optional<T> or(Optional<? extends T> secondChoice) { checkNotNull(secondChoice); return this; } @Override public T or(Supplier<? extends T> supplier) { checkNotNull(supplier); return reference; } @Override public T orNull() { return reference; } @Override public Set<T> asSet() { return Collections.singleton(reference); } @Override public <V> Optional<V> transform(Function<? super T, V> function) { return new Present<V>(checkNotNull(function.apply(reference), "the Function passed to Optional.transform() must not return null.")); } @Override public boolean equals(@Nullable Object object) { if (object instanceof Present) { Present<?> other = (Present<?>) object; return reference.equals(other.reference); } return false; } @Override public int hashCode() { return 0x598df91c + reference.hashCode(); } @Override public String toString() { return "Optional.of(" + reference + ")"; } private static final long serialVersionUID = 0; }
[ "tom@blowmage.com" ]
tom@blowmage.com
9544213dbf0e6018fdec96577a17ae532ca726d9
1af1b7ffb2fff798b8ebc9334bac335044716264
/app/src/main/java/digimatic/shangcommerce/adapter/AllCategoryAdapter.java
cabe8032e686816391a2fc9c49da9a4315d27ddd
[]
no_license
loipn1804/Shang
dd93347afa0c40e9aad634571df1d7c3693a72e5
23ed6a891e1cfb18531a79a81654968d4bcca2b2
refs/heads/master
2021-01-19T02:33:37.810759
2017-04-26T14:25:07
2017-04-26T14:25:07
61,686,431
0
0
null
null
null
null
UTF-8
Java
false
false
4,800
java
package digimatic.shangcommerce.adapter; import android.app.Activity; import android.content.Intent; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import java.util.ArrayList; import java.util.List; import digimatic.shangcommerce.R; import digimatic.shangcommerce.activity.ListProductActivity; import digimatic.shangcommerce.staticfunction.Font; import digimatic.shangcommerce.staticfunction.StaticFunction; import greendao.Category; /** * Created by USER on 3/4/2016. */ public class AllCategoryAdapter extends RecyclerView.Adapter<AllCategoryAdapter.SimpleViewHolder> { private Activity activity; private List<Category> listData; private int size; private int margin; private int margin_x2; private int item_height; private Font font; protected ImageLoader imageLoader = ImageLoader.getInstance(); private DisplayImageOptions options; public AllCategoryAdapter(Activity activity, List<Category> listData) { this.activity = activity; this.listData = new ArrayList<>(); this.listData.addAll(listData); size = listData.size(); margin = activity.getResources().getDimensionPixelOffset(R.dimen.dm_1dp); margin_x2 = margin * 2; item_height = StaticFunction.getScreenWidth(activity) / 2 - margin; options = new DisplayImageOptions.Builder().cacheInMemory(true) .showImageForEmptyUri(R.drawable.noimg) .showImageOnLoading(R.drawable.noimg) .cacheOnDisk(true).build(); this.font = new Font(activity); } public void setListData(List<Category> listData) { this.listData.clear(); this.listData.addAll(listData); size = listData.size(); notifyDataSetChanged(); } public static class SimpleViewHolder extends RecyclerView.ViewHolder { public ImageView imageView; private RelativeLayout rltCover; public TextView txtTitle; public TextView txtNumber; public SimpleViewHolder(View view) { super(view); imageView = (ImageView) view.findViewById(R.id.imageView); rltCover = (RelativeLayout) view.findViewById(R.id.rltCover); txtTitle = (TextView) view.findViewById(R.id.txtTitle); txtNumber = (TextView) view.findViewById(R.id.txtNumber); } } @Override public AllCategoryAdapter.SimpleViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View view = LayoutInflater.from(activity).inflate(R.layout.item_all_category, viewGroup, false); return new SimpleViewHolder(view); } @Override public void onBindViewHolder(AllCategoryAdapter.SimpleViewHolder holder, final int position) { font.overrideFontsLight(holder.txtTitle); font.overrideFontsLight(holder.txtNumber); holder.txtTitle.setText(listData.get(position).getName()); imageLoader.displayImage(listData.get(position).getThumbnail_url(), holder.imageView, options); int product_count = listData.get(position).getProduct_count(); if (product_count == 1) { holder.txtNumber.setText("1 item"); } else { holder.txtNumber.setText(product_count + " items"); } RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) holder.rltCover.getLayoutParams(); if (position % 2 == 0) { // left params.leftMargin = 0; params.rightMargin = margin; } else { // right params.leftMargin = margin; params.rightMargin = 0; } if (size - 1 == position) { params.bottomMargin = margin_x2; } else { params.bottomMargin = 0; } params.topMargin = margin_x2; params.height = item_height; params.width = item_height; holder.rltCover.setLayoutParams(params); holder.rltCover.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(activity, ListProductActivity.class); intent.putExtra("category_id", listData.get(position).getEntity_id()); intent.putExtra("title", listData.get(position).getName()); activity.startActivity(intent); } }); } @Override public int getItemCount() { return listData.size(); } }
[ "phanngocloi1804@gmail.com" ]
phanngocloi1804@gmail.com
d6376ce274458e09d13643cee2d8c23cfe09f6c9
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a055/A055647Test.java
31b036b061cb8650c16724793dd6b82953e3e7dd
[]
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.a055; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A055647Test extends AbstractSequenceTest { }
[ "sean.irvine@realtimegenomics.com" ]
sean.irvine@realtimegenomics.com
ae5cccc7a1f6b75fe533892747ca92abb2968f96
52bd8a00782a8b4fcb23f458c93240d9b9273a48
/java-problems/src/main/java/com/games/CSES/bitStrings/Solution.java
15d231df9589a1cb74f9a772a7f86f05732a72a6
[]
no_license
atulanand206/Games
27ba2878d477d58ad25b579b81cddef29ccf3d63
936d5a3b479a8bbd5d95b3616897ac11fb227f24
refs/heads/master
2023-04-15T05:22:38.376852
2022-03-08T21:37:01
2022-03-08T21:37:01
63,499,385
1
0
null
2023-04-12T05:38:03
2016-07-16T19:35:21
Java
UTF-8
Java
false
false
402
java
package com.games.CSES.bitStrings; import java.io.InputStreamReader; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(new InputStreamReader(System.in)); long x = sc.nextInt(), res = 1, limit = (long) (Math.pow(10, 9) + 7); while (x-- > 0) res = (res * 2) % limit; System.out.println(res); } }
[ "atulanand206@gmail.com" ]
atulanand206@gmail.com
50437c818d883e2c9a98e429c7e96fb0efb49634
bb13907de0911a1c03f1a32a7ea16740234abf1c
/src/main/java/com/emc/fapi/jaxws/v4_3_1/FunctionalAPIActionFailedException_Exception.java
43f2aaa06b37cf187228e29e149b8f745923db77
[]
no_license
noamda/fal431
9287e95fa2bacdace92e65b16ec6985ce2ded29c
dad30667424970fba049df3ba2c2023b82b9276e
refs/heads/master
2021-01-21T14:25:10.211169
2016-06-20T08:55:43
2016-06-20T08:58:33
58,481,483
0
0
null
null
null
null
UTF-8
Java
false
false
842
java
package com.emc.fapi.jaxws.v4_3_1; import javax.xml.ws.WebFault; @WebFault(name = "FunctionalAPIActionFailedException", targetNamespace = "http: public class FunctionalAPIActionFailedException_Exception extends Exception { private FunctionalAPIActionFailedException faultInfo; public FunctionalAPIActionFailedException_Exception(String message, FunctionalAPIActionFailedException faultInfo) { super(message); this.faultInfo=faultInfo; } public FunctionalAPIActionFailedException_Exception(String message,FunctionalAPIActionFailedException faultInfo,Throwable cause) { super(message,cause); this.faultInfo=faultInfo; } public FunctionalAPIActionFailedException getFaultInfo() { return this.faultInfo; } }
[ "style.daniel@gmail.com" ]
style.daniel@gmail.com
eafe46f836df5e94289318d9d3d09e0c76516784
48a0e5e050c172cd225928a710e3be63398ad6ab
/java-web-project/src01/main/java/com/eomcs/lms/servlet/LessonUpdateServlet.java
af196b36d39a8b93feeefee1fe324f7f22a473e4
[]
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
1,846
java
package com.eomcs.lms.servlet; import java.io.IOException; import java.io.PrintWriter; import java.sql.Date; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.eomcs.lms.InitServlet; import com.eomcs.lms.domain.Lesson; import com.eomcs.lms.service.LessonService; @SuppressWarnings("serial") @WebServlet("/lesson/update") public class LessonUpdateServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { LessonService lessonService = InitServlet.iocContainer.getBean(LessonService.class); Lesson lesson = new Lesson(); lesson.setNo(Integer.parseInt(request.getParameter("no"))); lesson.setTitle(request.getParameter("title")); lesson.setContents(request.getParameter("contents")); lesson.setStartDate(Date.valueOf(request.getParameter("startDate"))); lesson.setEndDate(Date.valueOf(request.getParameter("endDate"))); lesson.setTotalHours(Integer.parseInt(request.getParameter("totalHours"))); lesson.setDayHours(Integer.parseInt(request.getParameter("dayHours"))); response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); out.println("<html><head>" + "<title>수업 변경</title>" + "<meta http-equiv='Refresh' content='1;url=list'>" + "</head>"); out.println("<body><h1>수업 변경</h1>"); if (lessonService.update(lesson) == 0) { out.println("<p>해당 번호의 수업이 없습니다.</p>"); } else { out.println("<p>변경했습니다.</p>"); } out.println("</body></html>"); } }
[ "yycel1357@naver.com" ]
yycel1357@naver.com
e194ed5ca863c431a3caebdbb95cce9ef0bad4ec
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/27/27_ecd2e8d65725cb7b654a5e60063c0216d188346f/Subclass/27_ecd2e8d65725cb7b654a5e60063c0216d188346f_Subclass_t.java
060fafcf51288e45406a0ae4674eca7585a6f3a2
[]
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
1,882
java
package com.googlecode.objectify.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * <p>Indicates that a class is part of a polymorphic persistence hierarchy. Subclasses * of an @Entity should be flagged with this annotation.</p> * * <p>This is used for Objectify's implementation of polymorphism. Place this on any * class in an inheritance hierarchy that should be queryable <strong>except the root</strong>. * For example, in the hierarchy Animal->Mammal->Cat, annotations should be:</p> * <ul> * <li>@Entity Animal</li> * <li>@Subclass Mammal</li> * <li>@Subclass Cat</li> * </ul> * * <p>The @Entity annotation must be present on the class that identifies the root of the * hierarchy. This class will define the <em>kind</em> of the entire hierarchy. * The @Entity annotation must NOT be present on any subclasses.</p> * * <p>Actual Java subclasses are not required to have @Subclass, but only Java classes * which have @Subclass can be persisted and queried for.</p> * * @author Jeff Schnitzer */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Subclass { /** * Optionally define the discriminator value for the subclass; default is Class.getSimpleName() */ String name() default ""; /** * If true, the discriminator will not be indexed, and a query for the specific subclass will * not return results. However, superclasses and further subclasses may be indexed. */ boolean unindexed() default false; /** * Additional discriminators which, when encountered, will be interpreted as indicating * this subclass. Facilitates schema changes in a way analagous to @AlsoLoad. */ String[] alsoLoad() default {}; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
3573949766890b23a5d2e69521405ea2cade1fe7
91e67632d2a4d3e02b8ebe954c47fe5ae2bdfb33
/app/src/main/java/com/omneagate/activity/dialog/RetryFailedMasterDataDialog.java
7d053b7399993ec0f74afa6f1c9ec84afd31265b
[]
no_license
RamprasathPnr/FpsPosUttarPradesh
a2b14022d59f41b5af0d7d8e6a564ee3abd1fbb3
99fb57ecb4b0df59b29119f398a83eaf434d2681
refs/heads/master
2021-08-31T13:32:10.236720
2017-12-21T13:47:01
2017-12-21T13:47:01
115,010,323
1
0
null
null
null
null
UTF-8
Java
false
false
2,180
java
package com.omneagate.activity.dialog; import android.app.Activity; import android.app.Dialog; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.view.View; import android.view.Window; import android.widget.Button; import android.widget.TextView; import com.omneagate.activity.R; import com.omneagate.activity.SyncPageActivity; import java.util.List; /** * This dialog will appear on the time of user logout */ public class RetryFailedMasterDataDialog extends Dialog implements View.OnClickListener { private final Activity context; // Context from the user List<String> masterData; /*Constructor class for this dialog*/ public RetryFailedMasterDataDialog(Activity _context, List<String> masterData) { super(_context); context = _context; this.masterData = masterData; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setBackgroundDrawable( new ColorDrawable(android.graphics.Color.TRANSPARENT)); setContentView(R.layout.dialog_retry_failed); setCancelable(false); TextView message = (TextView) findViewById(R.id.textViewNwText); String userText = "Following master tables missing"; ((TextView) findViewById(R.id.textViewNwTitle)).setText("Master Table Missing \n" + masterData()); message.setText(userText); userText = "Please contact HelpDesk"; ((TextView) findViewById(R.id.textViewNwTextSecond)).setText(userText); Button okButton = (Button) findViewById(R.id.buttonNwOk); okButton.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.buttonNwOk: ((SyncPageActivity) context).logOut(); dismiss(); break; } } private String masterData() { String data = ""; for (String masters : masterData) { data = data + masters + "\n"; } return data; } }
[ "prasadram343@gmail.com" ]
prasadram343@gmail.com
1c64d410b6f74444cd1483086594c053e956c29e
6dd5f5bb63a54e36aab43f9dcafafd88b468b03a
/scfs-web/src/test/java/com/scfs/web/schedule/InvokeLogJobTest.java
e001cd6c6d93fbadbb753c578d1e05c0a643357f
[]
no_license
qm1083824922/scfs
ce9cef8c1c06563dcddb7c133c5dac567b622581
bd2f12615653658b06915fee6a2cdb8a3d393d81
refs/heads/master
2022-12-22T20:09:54.936706
2019-07-07T09:41:23
2019-07-07T09:41:23
195,634,196
6
5
null
2022-12-16T06:33:52
2019-07-07T09:41:15
HTML
UTF-8
Java
false
false
449
java
package com.scfs.web.schedule; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import com.scfs.service.schedule.InvokeLogJob; import com.scfs.web.base.BaseJUnitTest; /** * Created by Administrator on 2017年1月9日. */ public class InvokeLogJobTest extends BaseJUnitTest{ @Autowired private InvokeLogJob invokeLogJob; @Test public void testExcute(){ invokeLogJob.execute(); } }
[ "1083824922@qq.com" ]
1083824922@qq.com
b3941f750c11e3f1d75353d23c97e32d31a9bbab
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Hibernate/Hibernate9155.java
1181b2345144435c3068425063b37c29c8e92739
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
413
java
protected Item findByDescription(SessionBuilder sessionBuilder, final String description) { Session s = sessionBuilder.openSession(); try { return (Item) s.createCriteria(Item.class) .setCacheable(true) .setReadOnly(true) .add(Restrictions.eq("description", description)) .uniqueResult(); } finally { s.close(); } }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
d3e97e8458db4801ba2a4c8d163aa975e8b16da0
1264ce4f7240a56b39b99bbfcdf7c59131cac5db
/AndExam안드로이드프로그램정복/AndExam/src/exam/andexam/C04_CodeLayout.java
4a6e0ada1ac89ef889e4b3a5f74d3b15bb04e3e2
[]
no_license
danielkulcsar/webhon
7ea0caef64fc7ddec691f809790c5aa1d960635a
c6a25cc2fd39dda5907ee1b5cb875a284aa6ce3d
refs/heads/master
2021-06-23T08:06:48.890022
2017-08-27T05:28:19
2017-08-27T05:28:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
250
java
package exam.andexam; import android.app.*; import android.os.*; public class C04_CodeLayout extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.c04_codelayout); } }
[ "webhon747@gmail.com" ]
webhon747@gmail.com
45723a567438872412bf0b6743964a5c1f6ea7ba
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_46963053054321ba741324f61c0525d1d1da3987/SemiImplicitEuler/4_46963053054321ba741324f61c0525d1d1da3987_SemiImplicitEuler_t.java
70b67ad08551c94adddccef822153299c758427a
[]
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
1,492
java
package feynstein.properties.integrators; import feynstein.*; import feynstein.geometry.*; import feynstein.utilities.*; import java.util.ArrayList; public class SemiImplicitEuler extends Integrator<SemiImplicitEuler> { public SemiImplicitEuler(Scene scene) { super(scene); objectType = "SemiImplicitEuler"; } public void update() { Scene scene = super.getScene(); // This is a list of applied force values (in Newtons), in // the x, y, and z directions. The size of this list will // be the size of the number of particles in the simulation //TODO make method in scene for getglobalforces double[] F = scene.globalForceMagnitude(); // grab global list of particles for the scene ArrayList<Particle> parts = scene.getMesh().getParticles(); // TODO (sainsley) : remove this test /*for (Particle p : parts) { // v[1] = v[0] + a*dt = v[0] + dt*f/m Vector3d newVel = p.getVel().plus(new Vector3d(0,0,0.5)); // x[1] = x[0] + v*dt Vector3d newPos =p.getPos().plus(newVel.dot(h)); p.update(newPos, newVel); }*/ for (int i = 0; i < parts.size(); i++) { Vector3d force = new Vector3d(F[3*i],F[3*i+1],F[3*i+2]); // v[1] = v[0] + a*dt = v[0] + dt*f/m Vector3d newVel = parts.get(i).getVel().plus(force.dot(h/parts.get(i).getMass())); // x[1] = x[0] + v*dt Vector3d newPos = parts.get(i).getPos().plus(newVel.dot(h)); parts.get(i).update(newPos, newVel); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
327424d6ec1a69a95844b96da402a8eb9844cd4d
f337ca8ffd40388e153607496ed68b85658b3a76
/app/src/main/java/eslglobal/com/esl/dialogfragments/CommonDialog.java
0d0153dfd37f6545390c7185bde069b09b56fbf2
[]
no_license
prudhvibsecure/ESLGlobal
a567e27d5c76143a5c30145a0109464ffda8663e
57f0229ff4fcf9030e17bce5530cf804b4989537
refs/heads/master
2021-01-11T14:44:01.986802
2017-01-27T11:23:52
2017-01-27T11:23:52
80,201,939
0
0
null
null
null
null
UTF-8
Java
false
false
1,788
java
package eslglobal.com.esl.dialogfragments; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.widget.EditText; import android.widget.TextView; import eslglobal.com.esl.Bsecure; import eslglobal.com.esl.R; import eslglobal.com.esl.common.Item; public class CommonDialog extends DialogFragment { private Item item = null; TextView title, sendSMS, submit; EditText mobileNum; private Bsecure bsecure = null; int layout; public static CommonDialog newInstance() { return new CommonDialog(); } @Override public void onAttach(Activity activity) { super.onAttach(activity); bsecure = (Bsecure) activity; } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Bundle mArgs = getArguments(); layout = mArgs.getInt("layout"); item = (Item) mArgs.getSerializable("item"); View view = inflater.inflate(layout, container, false); getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); //view.findViewById(R.id.closebtn).setOnClickListener(bsecure); return view; } @Override public void onActivityCreated(Bundle arg0) { super.onActivityCreated(arg0); getDialog().getWindow().getAttributes().windowAnimations = R.style.DialogAnimation; } }
[ "prudhvi.bsecure@gmail.com" ]
prudhvi.bsecure@gmail.com
b6d7d8462ad38ff4350cead297046ee3d0650c0a
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
/aliyun-java-sdk-nas/src/main/java/com/aliyuncs/nas/model/v20170626/ApplyDataFlowAutoRefreshRequest.java
314bbc35dbf39ebeca36306ee60cdbb2ab9d4541
[ "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
3,900
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.nas.model.v20170626; import com.aliyuncs.RpcAcsRequest; import java.util.List; import com.aliyuncs.http.MethodType; import com.aliyuncs.nas.Endpoint; /** * @author auto create * @version */ public class ApplyDataFlowAutoRefreshRequest extends RpcAcsRequest<ApplyDataFlowAutoRefreshResponse> { private String autoRefreshPolicy; private String clientToken; private List<AutoRefreshs> autoRefreshss; private String fileSystemId; private Boolean dryRun; private String dataFlowId; private Long autoRefreshInterval; public ApplyDataFlowAutoRefreshRequest() { super("NAS", "2017-06-26", "ApplyDataFlowAutoRefresh", "NAS"); 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 getAutoRefreshPolicy() { return this.autoRefreshPolicy; } public void setAutoRefreshPolicy(String autoRefreshPolicy) { this.autoRefreshPolicy = autoRefreshPolicy; if(autoRefreshPolicy != null){ putQueryParameter("AutoRefreshPolicy", autoRefreshPolicy); } } public String getClientToken() { return this.clientToken; } public void setClientToken(String clientToken) { this.clientToken = clientToken; if(clientToken != null){ putQueryParameter("ClientToken", clientToken); } } public List<AutoRefreshs> getAutoRefreshss() { return this.autoRefreshss; } public void setAutoRefreshss(List<AutoRefreshs> autoRefreshss) { this.autoRefreshss = autoRefreshss; if (autoRefreshss != null) { for (int depth1 = 0; depth1 < autoRefreshss.size(); depth1++) { putQueryParameter("AutoRefreshs." + (depth1 + 1) + ".RefreshPath" , autoRefreshss.get(depth1).getRefreshPath()); } } } public String getFileSystemId() { return this.fileSystemId; } public void setFileSystemId(String fileSystemId) { this.fileSystemId = fileSystemId; if(fileSystemId != null){ putQueryParameter("FileSystemId", fileSystemId); } } public Boolean getDryRun() { return this.dryRun; } public void setDryRun(Boolean dryRun) { this.dryRun = dryRun; if(dryRun != null){ putQueryParameter("DryRun", dryRun.toString()); } } public String getDataFlowId() { return this.dataFlowId; } public void setDataFlowId(String dataFlowId) { this.dataFlowId = dataFlowId; if(dataFlowId != null){ putQueryParameter("DataFlowId", dataFlowId); } } public Long getAutoRefreshInterval() { return this.autoRefreshInterval; } public void setAutoRefreshInterval(Long autoRefreshInterval) { this.autoRefreshInterval = autoRefreshInterval; if(autoRefreshInterval != null){ putQueryParameter("AutoRefreshInterval", autoRefreshInterval.toString()); } } public static class AutoRefreshs { private String refreshPath; public String getRefreshPath() { return this.refreshPath; } public void setRefreshPath(String refreshPath) { this.refreshPath = refreshPath; } } @Override public Class<ApplyDataFlowAutoRefreshResponse> getResponseClass() { return ApplyDataFlowAutoRefreshResponse.class; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
c8cea2abdd53a8c92b8761df3d8a771c5a5a4fcf
00a3673f40a5368d43698bffb700002d4735ca88
/src/main/java/be/fgov/famhp/pharmastatus/externals/config/DefaultProfileUtil.java
dd086e5a495bfabdad81d1b1678847f8b878a3a3
[]
no_license
cedricclaus/pharma-status-externals-initial
0b5db9d7448bac0f036058bbe5eff96e7c9dd86c
85568b3612361a9cf65e236095baec5a8c4767da
refs/heads/master
2020-06-07T15:03:38.163672
2019-06-21T06:47:14
2019-06-21T06:47:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,312
java
package be.fgov.famhp.pharmastatus.externals.config; import io.github.jhipster.config.JHipsterConstants; import org.springframework.boot.SpringApplication; import org.springframework.core.env.Environment; import java.util.*; /** * Utility class to load a Spring profile to be used as default * when there is no {@code spring.profiles.active} set in the environment or as command line argument. * If the value is not available in {@code application.yml} then {@code dev} profile will be used as default. */ public final class DefaultProfileUtil { private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default"; private DefaultProfileUtil() { } /** * Set a default to use when no profile is configured. * * @param app the Spring application. */ public static void addDefaultProfile(SpringApplication app) { Map<String, Object> defProperties = new HashMap<>(); /* * The default profile to use when no other profiles are defined * This cannot be set in the application.yml file. * See https://github.com/spring-projects/spring-boot/issues/1219 */ defProperties.put(SPRING_PROFILE_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); app.setDefaultProperties(defProperties); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
b0086c2553df8411fec38df414882fcc6444c0c2
23e26634f4a7648d3a516bb8bb43c7120c611906
/jtwig-core/src/main/java/org/jtwig/property/PropertyResolveRequest.java
ee7c9cc3df3693a08606f6419ee3473b534c7e03
[ "Apache-2.0" ]
permissive
joao-de-melo/jtwig-draft
f5314c6d863ced119a216affb3a8f807ea19d1fc
4f471ae23f4f69b43b158984a315eef93a47d7cc
refs/heads/master
2021-10-28T07:01:38.888887
2015-05-02T17:04:47
2015-05-02T17:04:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
981
java
package org.jtwig.property; import org.jtwig.functions.FunctionArgument; import org.jtwig.model.expression.function.Argument; import org.jtwig.model.position.Position; import java.util.Collection; public class PropertyResolveRequest { private final Position position; private final Object entity; private final String propertyName; private final Collection<FunctionArgument> arguments; public PropertyResolveRequest(Position position, Object entity, String propertyName, Collection<FunctionArgument> arguments) { this.position = position; this.entity = entity; this.propertyName = propertyName; this.arguments = arguments; } public Position getPosition() { return position; } public Object getEntity() { return entity; } public String getPropertyName() { return propertyName; } public Collection<FunctionArgument> getArguments() { return arguments; } }
[ "jmelo@lyncode.com" ]
jmelo@lyncode.com
24f610889d859b8f832d687d2286e6072a02b5d4
fd1a5a6d21948d3e50742d617b40146acd326609
/src/dima/ontologies/basicFIPAACLMessages/ACLTell.java
d12d37725977d56b492b781bb31bd95c12deb61f
[]
no_license
Droop/DimaX
468c0b85c197695d8a4c044079539a729551fa69
886410ead3d8d89f7b517efa0e1245bc66773fa9
refs/heads/master
2021-01-01T05:41:32.873760
2011-12-12T14:53:12
2011-12-12T14:53:12
2,634,865
0
2
null
null
null
null
UTF-8
Java
false
false
501
java
package dima.ontologies.basicFIPAACLMessages; /** * Titre : * Description : * Copyright : Copyright (c) 2001 * Soci�t� : * @author * @version 1.0 */ public class ACLTell extends FIPAACLMessage { /** * */ private static final long serialVersionUID = 7843276510569534893L; public ACLTell(final String tx, final String rx, final String msg, final String irt, final String rw) { super(tx,rx,msg,irt,rw); this.setPerformative("tell"); } }
[ "sylvain.ductor@lip6.fr" ]
sylvain.ductor@lip6.fr
7cf7997bf51f625dc98eb6e2fd8fb22e6c067917
40d456fc391ae29ab93853127c9537ee364d057b
/webapp/src/edu/cornell/mannlib/vitro/webapp/auth/requestedAction/usepages/UseMiscellaneousEditorPages.java
6b03bc75501a667ff0adbd280ecaaf7e688c5647
[]
no_license
UniMelb-source/vitro-core
232d85cf291734125aa338c50de664653c9ae93a
c35c632e6bc7bd0285e85f18551591c8daecdb34
refs/heads/master
2016-09-06T05:37:09.276136
2012-02-24T05:49:05
2012-02-24T05:49:05
3,312,419
0
0
null
null
null
null
UTF-8
Java
false
false
483
java
/* $This file is distributed under the terms of the license in /doc/license.txt$ */ package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction; /** Should we allow the user to use the odd-lots pages that were designed for Editors, Curators or DBAs? */ public class UseMiscellaneousEditorPages extends RequestedAction implements UsePagesRequestedAction { // no fields }
[ "j2blake@440791e1-c2bf-4c1e-ad7c-caf3f8b0ebe8" ]
j2blake@440791e1-c2bf-4c1e-ad7c-caf3f8b0ebe8
b356aaf18647886e96f5c860cceef0ec787256c1
3b55fa2ab12a3034cd38a7ace86b9d6adc9127db
/default/administracion/gen/ceip/applications/application/AcademicYearProperty.java
906a5a7204d51105718579ca9b57fd65a19e0b7e
[]
no_license
ellishia/CEIP
e1b58eb5fef0aa7130845f2f31c4c96f4f348c5a
206177a0924d1f0c0e84f77a93976fd9439d9645
refs/heads/master
2020-12-30T09:58:04.809910
2013-05-13T08:45:27
2013-05-13T08:45:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
661
java
package ceip.applications.application; import org.monet.metamodel.SelectFieldProperty; @SuppressWarnings("all") public class AcademicYearProperty extends SelectFieldProperty { public AcademicYearProperty() { super();this._code = "m2ypi9w"; this._name = "AcademicYear"; this._label = "Año Académico"; org.monet.metamodel.SelectFieldProperty.UseProperty useProperty1 = new org.monet.metamodel.SelectFieldProperty.UseProperty(); useProperty1.setSource(new org.monet.metamodel.internal.Ref("ceip.shared.AcademicYears")); this.setUse(useProperty1); } public static String static_getName() { return "AcademicYear"; } }
[ "askerosi@askerosi-laptop.(none)" ]
askerosi@askerosi-laptop.(none)
e9d767523adc5ecd66733df11f4f32d6a2865144
2d5c6766fb7ebbb6fd9b3f81e015b8c56eda2733
/nephele/nephele-profiling/src/test/java/eu/stratosphere/nephele/profiling/impl/InstanceProfilerTest.java
4acb0ee1384ba2c0bb36ee3b4106b9565fd1974e
[]
no_license
bel90/nephele
e134197edeb86d5b2bfde138445f2f624f934bae
674876a9714a6b48fd7467cadbc48f9eacfd5c84
refs/heads/master
2021-08-24T00:43:16.161984
2017-12-07T09:22:36
2017-12-07T09:22:36
112,023,086
0
0
null
null
null
null
UTF-8
Java
false
false
6,082
java
/*********************************************************************************************************************** * * Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.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.stratosphere.nephele.profiling.impl; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; import static org.powermock.api.mockito.PowerMockito.whenNew; import java.io.BufferedReader; import java.io.FileReader; import java.net.Inet4Address; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import eu.stratosphere.nephele.instance.InstanceConnectionInfo; import eu.stratosphere.nephele.profiling.ProfilingException; import eu.stratosphere.nephele.profiling.impl.types.InternalInstanceProfilingData; /** * @author Mathias Peters <mathias.peters@informatik.hu-berlin.de> */ @RunWith(PowerMockRunner.class) @PrepareForTest(InstanceProfiler.class) public class InstanceProfilerTest { private InstanceConnectionInfo ici; @Mock private BufferedReader cpuBufferMock; @Mock private BufferedReader networkBufferMock; @Mock private BufferedReader memoryBufferMock; @Mock private FileReader cpuReaderMock; @Mock private FileReader networkReaderMock; @Mock private FileReader memoryReaderMock; // object under test InstanceProfiler out; @Before public void setUp() throws Exception { this.ici = new InstanceConnectionInfo(Inet4Address.getByName("localhost"), 1234, 1235); initMocks(this); whenNew(FileReader.class).withArguments(InstanceProfiler.PROC_STAT).thenReturn(this.cpuReaderMock); whenNew(BufferedReader.class).withArguments(this.cpuReaderMock).thenReturn(this.cpuBufferMock); when(this.cpuBufferMock.readLine()).thenReturn( "cpu 222875 20767 209704 3782096 209864 0 1066 0 0 0" ); whenNew(FileReader.class).withArguments(InstanceProfiler.PROC_NET_DEV).thenReturn(this.networkReaderMock); whenNew(BufferedReader.class).withArguments(this.networkReaderMock).thenReturn(this.networkBufferMock); when(this.networkBufferMock.readLine()) .thenReturn( " eth0: 364729203 286442 0 0 0 0 0 1060 14483806 191563 0 0 0 0 0 0", (String) null, " eth0: 364729203 286442 0 0 0 0 0 1060 14483806 191563 0 0 0 0 0 0", (String) null, " eth0: 364729203 286442 0 0 0 0 0 1060 14483806 191563 0 0 0 0 0 0", (String) null ); whenNew(FileReader.class).withArguments(InstanceProfiler.PROC_MEMINFO).thenReturn(this.memoryReaderMock); whenNew(BufferedReader.class).withArguments(this.memoryReaderMock).thenReturn(this.memoryBufferMock); when(this.memoryBufferMock.readLine()).thenReturn( "MemTotal: 8052956 kB", "MemFree: 3999880 kB", "Buffers: 77216 kB", "Cached: 1929640 kB", null, "MemTotal: 8052956 kB", "MemFree: 3999880 kB", "Buffers: 77216 kB", "Cached: 1929640 kB", null, "MemTotal: 8052956 kB", "MemFree: 3999880 kB", "Buffers: 77216 kB", "Cached: 1929640 kB", null ); PowerMockito.mockStatic(System.class); when(System.currentTimeMillis()).thenReturn(0L); this.out = new InstanceProfiler(this.ici); } @Test public void shouldHaveNetworkTraffic() { try { final InternalInstanceProfilingData generateProfilingData = out.generateProfilingData(0L); assertEquals(0L, generateProfilingData.getReceivedBytes()); assertEquals(0L, generateProfilingData.getTransmittedBytes()); } catch (ProfilingException e) { fail(e.getMessage()); } } @Test public void shouldHaveMemSettingsMeasured() { try { final InternalInstanceProfilingData generateProfilingData = out.generateProfilingData(0L); final long totalMemory = generateProfilingData.getTotalMemory(); assertThat(totalMemory, is(equalTo(8052956L))); long freeMemory = generateProfilingData.getFreeMemory(); assertThat(freeMemory, is(equalTo(3999880L))); long buffers = generateProfilingData.getBufferedMemory(); assertThat(buffers, is(equalTo(77216L))); long cached = generateProfilingData.getCachedMemory(); assertThat(cached, is(equalTo(1929640L))); } catch (ProfilingException e) { fail(e.getMessage()); } } @Test public void shouldMeasureCPUUtilization() { try { final InternalInstanceProfilingData generateProfilingData = out.generateProfilingData(0L); assertEquals(0L, generateProfilingData.getUserCPU()); assertEquals(0L, generateProfilingData.getIdleCPU()); assertEquals(0L, generateProfilingData.getSystemCPU()); assertEquals(0L, generateProfilingData.getHardIrqCPU()); assertEquals(0L, generateProfilingData.getSoftIrqCPU()); assertEquals(0L, generateProfilingData.getIOWaitCPU()); } catch (ProfilingException e) { fail(e.getMessage()); } } }
[ "belinda.diesslin@campus.tu-berlin.de" ]
belinda.diesslin@campus.tu-berlin.de
508d5383192a8b667d2e141da4edc894cc73c6f8
018d078a531c15194f4f7b4d1b344fe38f55730c
/src/com/miiceic/refactor/pattern/factorymethod/Fruit.java
8df3deb0fe188da20ae3022438e3f6ba57d04559
[]
no_license
75168859/patterns
344f4cc99ab0c04d61b8335ad025402b98361921
f3d9d2b2256a1a6b6ccc7497c1ca0cc7ab701bcc
refs/heads/master
2021-01-13T00:38:47.592396
2016-04-01T15:30:19
2016-04-01T15:30:19
55,242,220
0
0
null
null
null
null
UTF-8
Java
false
false
147
java
package com.miiceic.refactor.pattern.factorymethod; public interface Fruit { void grow(); void harvest(); void plant(); }
[ "75168859@qq.com" ]
75168859@qq.com
6945761c7255bd2d01d49afa476a13e7b1461b62
25cfbbb243aef9514848b160b0e8d7ba31d44a7d
/src/main/java/com/tencentcloudapi/cdn/v20180606/models/ScdnAclConfig.java
c2f018a3dd0835ecb20b83b65620e64dbb9c0858
[ "Apache-2.0" ]
permissive
feixueck/tencentcloud-sdk-java
ceaf3c493eec493878c0373f5d07f6fe34fa5f7b
ebdfb9cf12ce7630f53b387e2ac8d17471c6c7d0
refs/heads/master
2021-08-17T15:37:34.198968
2021-01-08T01:30:26
2021-01-08T01:30:26
240,156,902
0
0
Apache-2.0
2021-01-08T02:57:29
2020-02-13T02:04:37
Java
UTF-8
Java
false
false
3,472
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.tencentcloudapi.cdn.v20180606.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class ScdnAclConfig extends AbstractModel{ /** * 是否开启,on | off */ @SerializedName("Switch") @Expose private String Switch; /** * Acl规则组,switch为on时必填 注意:此字段可能返回 null,表示取不到有效值。 */ @SerializedName("ScriptData") @Expose private ScdnAclGroup [] ScriptData; /** * 错误页面配置 注意:此字段可能返回 null,表示取不到有效值。 */ @SerializedName("ErrorPage") @Expose private ScdnErrorPage ErrorPage; /** * Get 是否开启,on | off * @return Switch 是否开启,on | off */ public String getSwitch() { return this.Switch; } /** * Set 是否开启,on | off * @param Switch 是否开启,on | off */ public void setSwitch(String Switch) { this.Switch = Switch; } /** * Get Acl规则组,switch为on时必填 注意:此字段可能返回 null,表示取不到有效值。 * @return ScriptData Acl规则组,switch为on时必填 注意:此字段可能返回 null,表示取不到有效值。 */ public ScdnAclGroup [] getScriptData() { return this.ScriptData; } /** * Set Acl规则组,switch为on时必填 注意:此字段可能返回 null,表示取不到有效值。 * @param ScriptData Acl规则组,switch为on时必填 注意:此字段可能返回 null,表示取不到有效值。 */ public void setScriptData(ScdnAclGroup [] ScriptData) { this.ScriptData = ScriptData; } /** * Get 错误页面配置 注意:此字段可能返回 null,表示取不到有效值。 * @return ErrorPage 错误页面配置 注意:此字段可能返回 null,表示取不到有效值。 */ public ScdnErrorPage getErrorPage() { return this.ErrorPage; } /** * Set 错误页面配置 注意:此字段可能返回 null,表示取不到有效值。 * @param ErrorPage 错误页面配置 注意:此字段可能返回 null,表示取不到有效值。 */ public void setErrorPage(ScdnErrorPage ErrorPage) { this.ErrorPage = ErrorPage; } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "Switch", this.Switch); this.setParamArrayObj(map, prefix + "ScriptData.", this.ScriptData); this.setParamObj(map, prefix + "ErrorPage.", this.ErrorPage); } }
[ "tencentcloudapi@tenent.com" ]
tencentcloudapi@tenent.com
ef6e2400776f070bc34bb0b16502ed5efcbb77d7
3aa976e0376699df32b57009d37d51b21640ca98
/operatorgraph/src/main/java/lupos/gui/operatorgraph/arrange/Edge.java
07f62cd6dc127f6d115ca29332d480ebe99ae213
[]
no_license
boldt/luposdate
5267090e6c29b9778038c84e1ebc6dab124c0979
97e5e33683b1e2b5e65bd1e30b980bbd328dbeb8
refs/heads/master
2020-12-30T17:45:26.118723
2013-03-05T14:15:05
2013-03-05T14:15:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,377
java
/** * Copyright (c) 2013, Institute of Information Systems (Sven Groppe), University of Luebeck * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the * following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following * disclaimer. * - 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. * - Neither the name of the University of Luebeck nor the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 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 COPYRIGHT HOLDER OR 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. */ package lupos.gui.operatorgraph.arrange; import lupos.gui.operatorgraph.graphwrapper.GraphWrapper; /** * The class Edge represents an edge between a source-node and a target-node. * @author Tobias Bielfeld * */ public class Edge { private GraphWrapper source; private GraphWrapper target; private boolean visited; private int type; public Edge(GraphWrapper source, GraphWrapper target, int type){ this.source = source; this.target = target; this.visited = false; this.type = type; } protected GraphWrapper getTarget() { return this.target; } protected GraphWrapper getSource() { return this.source; } protected int getEdgeType() { return this.type; } protected boolean isVisited() { return this.visited; } }
[ "luposdate@ifis.uni-luebeck.de" ]
luposdate@ifis.uni-luebeck.de
4199826d4019c4d0f5e2b6e25a274ea02da426eb
406920ca903220dd87b5c5e96abd5334285b619a
/CPEListener/src/com/um/cpelistener/NetworkDetector.java
a2c561b57191c536066c260105b5f68dd6bf4065
[]
no_license
Phenix-Collection/unionman_apps
2c5f569ba1702f660f59220a34eb5a50a5b41baf
9f1efa3aa99cfc453f60ab4383ea25690339886b
refs/heads/master
2021-07-15T01:50:56.268296
2016-09-20T08:48:12
2016-09-20T08:48:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package com.um.cpelistener; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class NetworkDetector { private Context mContext = null; public NetworkDetector(Context context) { this.mContext = context; } public boolean NetwrokCheck() { ConnectivityManager cm = (ConnectivityManager) mContext .getSystemService(Context.CONNECTIVITY_SERVICE); if (cm != null) { NetworkInfo[] networkInfo = cm.getAllNetworkInfo(); if (networkInfo != null) { for (int i = 0; i < networkInfo.length; i++) { if (networkInfo[i].getState() == NetworkInfo.State.CONNECTED) { return true; } } } } return false; } }
[ "1499784130@qq.com" ]
1499784130@qq.com
7267654059eb55512bcf2b9a73e64bbd8a445898
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_1004326.java
d671dbb876a62e9663df3bb5fe1b95f9d2e37679
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
782
java
@Override @NotNull public ApolloStoreOperation<Set<String>> write(@NotNull final GraphqlFragment fragment,@NotNull final CacheKey cacheKey,@NotNull final Operation.Variables variables){ checkNotNull(fragment,"fragment == null"); checkNotNull(cacheKey,"cacheKey == null"); checkNotNull(variables,"operation == null"); if (cacheKey.equals(CacheKey.NO_KEY)) { throw new IllegalArgumentException("undefined cache key"); } return new ApolloStoreOperation<Set<String>>(dispatcher){ @Override protected Set<String> perform(){ return writeTransaction(new Transaction<WriteableStore,Set<String>>(){ @Override public Set<String> execute( WriteableStore cache){ return doWrite(fragment,cacheKey,variables); } } ); } } ; }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
58d6fbff9736ff91a5aae02cb42e86dfbe5b211b
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/com/google/android/material/progressindicator/AnimatorDurationScaleProvider.java
cd06d95746dde0cd91c4004c3654ad67ff4ab137
[]
no_license
Auch-Auch/avito_source
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
76fdcc5b7e036c57ecc193e790b0582481768cdc
refs/heads/master
2023-05-06T01:32:43.014668
2021-05-25T10:19:22
2021-05-25T10:19:22
370,650,685
0
0
null
null
null
null
UTF-8
Java
false
false
685
java
package com.google.android.material.progressindicator; import android.content.ContentResolver; import android.provider.Settings; import androidx.annotation.NonNull; import androidx.annotation.RestrictTo; import androidx.annotation.VisibleForTesting; @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public class AnimatorDurationScaleProvider { public static float a = 1.0f; @VisibleForTesting public static void setDefaultSystemAnimatorDurationScale(float f) { a = f; } public float getSystemAnimatorDurationScale(@NonNull ContentResolver contentResolver) { return Settings.Global.getFloat(contentResolver, "animator_duration_scale", 1.0f); } }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
9e2bd74b551b33a33218b1e8519911e3b94668cd
b2e6fc08d727836afb0fcfce784b1618097482ff
/ch04_Booleans/src/BooleanApp.java
7da09eb5123801b15a375d6e4e7294550b4505de
[]
no_license
sean-blessing/java-instruction-202003jbc
ccfa7354350676e496872ff1090cb4fcf0dc974c
ffec0b9a82a008fcff2e08102fc643642aa0c502
refs/heads/master
2021-04-19T03:30:24.468265
2020-10-08T13:37:23
2020-10-08T13:37:23
249,576,093
0
0
null
null
null
null
UTF-8
Java
false
false
459
java
import java.util.Scanner; public class BooleanApp { public static void main(String[] args) { boolean isValid; isValid = false; while (isValid == false) { System.out.println("Loop runs as long as isValid is false!"); break; } isValid = true; Scanner sc = new Scanner(System.in); System.out.println("Enter a #: "); int i = sc.nextInt(); while (isValid) { System.out.println("isValid is true."); break; } } }
[ "snblessing@gmail.com" ]
snblessing@gmail.com
58d7352e284d05ddab0798a1b8678e44f8764fd8
3d28124f3c614d73c39c552efcf3fdd013a30b15
/wwe/jWya.java
d464f001216c715eee8279fa9e71941603edd73b
[]
no_license
WarriorCrystal/WWE-Deobf-Source-Leak
ac5caff81e96cf1d15e53c7f62f4af20053682df
660a29c3a32a7753299cc8edadf83c109369da1c
refs/heads/master
2022-03-25T08:29:40.333788
2019-11-29T01:09:59
2019-11-29T01:09:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package wwe; import net.minecraft.util.math.*; public class jWya extends gkrg { public BlockPos phME; public int GFhL; public int njMC; public jWya(final BlockPos phME, final int gFhL, final int njMC) { super(); this.phME = phME; this.GFhL = gFhL; this.njMC = njMC; } }
[ "57571957+RIPBackdoored@users.noreply.github.com" ]
57571957+RIPBackdoored@users.noreply.github.com
e5509530aedb6e008230c26b4ff81981e39ce525
6dbae30c806f661bcdcbc5f5f6a366ad702b1eea
/Corpus/tomcat70/497.java
c8548fb24bf05ffdc5cd59be3e1adc4e863ccb79
[ "MIT" ]
permissive
SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018
d3fd21745dfddb2979e8ac262588cfdfe471899f
0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0
refs/heads/master
2020-03-31T15:52:01.005505
2018-10-01T23:38:50
2018-10-01T23:38:50
152,354,327
1
0
MIT
2018-10-10T02:57:02
2018-10-10T02:57:02
null
UTF-8
Java
false
false
6,553
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.catalina.tribes.transport.bio.util; public class SingleRemoveSynchronizedAddLock { public SingleRemoveSynchronizedAddLock() { // NO-OP } public SingleRemoveSynchronizedAddLock(boolean dataAvailable) { this.dataAvailable = dataAvailable; } /** * Time in milliseconds after which threads * waiting for an add lock are woken up. * This is used as a safety measure in case * thread notification via the unlock methods * has a bug. */ private long addWaitTimeout = 10000L; /** * Time in milliseconds after which threads * waiting for a remove lock are woken up. * This is used as a safety measure in case * thread notification via the unlock methods * has a bug. */ private long removeWaitTimeout = 30000L; /** * The current remove thread. * It is set to the remove thread polling for entries. * It is reset to null when the remove thread * releases the lock and proceeds processing * the removed entries. */ private Thread remover = null; /** * A flag indicating, if an add thread owns the lock. */ private boolean addLocked = false; /** * A flag indicating, if the remove thread owns the lock. */ private boolean removeLocked = false; /** * A flag indicating, if the remove thread is allowed * to wait for the lock. The flag is set to false, when aborting. */ private boolean removeEnabled = true; /** * A flag indicating, if the remover needs polling. * It indicates, if the locked object has data available * to be removed. */ private boolean dataAvailable = false; /** * @return Value of addWaitTimeout */ public synchronized long getAddWaitTimeout() { return addWaitTimeout; } /** * Set value of addWaitTimeout */ public synchronized void setAddWaitTimeout(long timeout) { addWaitTimeout = timeout; } /** * @return Value of removeWaitTimeout */ public synchronized long getRemoveWaitTimeout() { return removeWaitTimeout; } /** * Set value of removeWaitTimeout */ public synchronized void setRemoveWaitTimeout(long timeout) { removeWaitTimeout = timeout; } /** * Check if the locked object has data available * i.e. the remover can stop poling and get the lock. * @return True iff the lock Object has data available. */ public synchronized boolean isDataAvailable() { return dataAvailable; } /** * Check if an add thread owns the lock. * @return True iff an add thread owns the lock. */ public synchronized boolean isAddLocked() { return addLocked; } /** * Check if the remove thread owns the lock. * @return True iff the remove thread owns the lock. */ public synchronized boolean isRemoveLocked() { return removeLocked; } /** * Check if the remove thread is polling. * @return True iff the remove thread is polling. */ public synchronized boolean isRemovePolling() { if (remover != null) { return true; } return false; } /** * Acquires the lock by an add thread and sets the add flag. * If any add thread or the remove thread already acquired the lock * this add thread will block until the lock is released. */ public synchronized void lockAdd() { if (addLocked || removeLocked) { do { try { wait(addWaitTimeout); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } while (addLocked || removeLocked); } addLocked = true; } /** * Acquires the lock by the remove thread and sets the remove flag. * If any add thread already acquired the lock or the queue is * empty, the remove thread will block until the lock is released * and the queue is not empty. */ public synchronized boolean lockRemove() { removeLocked = false; removeEnabled = true; if ((addLocked || !dataAvailable) && removeEnabled) { remover = Thread.currentThread(); do { try { wait(removeWaitTimeout); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } while ((addLocked || !dataAvailable) && removeEnabled); remover = null; } if (removeEnabled) { removeLocked = true; } return removeLocked; } /** * Releases the lock by an add thread and reset the remove flag. * If the reader thread is polling, notify it. */ public synchronized void unlockAdd(boolean dataAvailable) { addLocked = false; this.dataAvailable = dataAvailable; if ((remover != null) && (dataAvailable || !removeEnabled)) { remover.interrupt(); } else { notifyAll(); } } /** * Releases the lock by the remove thread and reset the add flag. * Notify all waiting add threads, * that the lock has been released by the remove thread. */ public synchronized void unlockRemove() { removeLocked = false; dataAvailable = false; notifyAll(); } /** * Abort any polling remover thread */ public synchronized void abortRemove() { removeEnabled = false; if (remover != null) { remover.interrupt(); } } }
[ "masudcseku@gmail.com" ]
masudcseku@gmail.com
1cde13622b0c47950b80f577ea306538ff1cbaa8
8b9022dda67a555c3fd70e652fa9159e5b517602
/src/main/java/org/drip/sample/bessel/AlphaZeroFirstApproximate.java
5bcc37acf4fd4b79a23016f350aa153df87aee0a
[ "Apache-2.0" ]
permissive
BugHunterPhilosopher/DROP
19b77d184fea32366c4892d7d2ca872a16b10c1c
166c1fc6276045aad97ffacf4226caccfa23ce10
refs/heads/master
2022-07-05T22:13:09.331395
2020-05-04T03:41:08
2020-05-04T03:41:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,443
java
package org.drip.sample.bessel; import org.drip.numerical.common.FormatUtil; import org.drip.service.env.EnvManager; import org.drip.specialfunction.bessel.FirstFrobeniusSeriesEstimator; import org.drip.specialfunction.definition.BesselFirstKindEstimator; import org.drip.specialfunction.gamma.EulerIntegralSecondKind; /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! * Copyright (C) 2020 Lakshmi Krishnamurthy * Copyright (C) 2019 Lakshmi Krishnamurthy * * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics, * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment * analytics, and portfolio construction analytics within and across fixed income, credit, commodity, * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support, * numerical analysis, numerical optimization, spline builder, model validation, statistical learning, * and computational support. * * https://lakshmidrip.github.io/DROP/ * * DROP is composed of three modules: * * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/ * * DROP Product Core implements libraries for the following: * - Fixed Income Analytics * - Loan Analytics * - Transaction Cost Analytics * * DROP Portfolio Core implements libraries for the following: * - Asset Allocation Analytics * - Asset Liability Management Analytics * - Capital Estimation Analytics * - Exposure Analytics * - Margin Analytics * - XVA Analytics * * DROP Computational Core implements libraries for the following: * - Algorithm Support * - Computation Support * - Function Analysis * - Model Validation * - Numerical Analysis * - Numerical Optimizer * - Spline Builder * - Statistical Learning * * Documentation for DROP is Spread Over: * * - Main => https://lakshmidrip.github.io/DROP/ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki * - GitHub => https://github.com/lakshmiDRIP/DROP * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal * - Release Versions => https://lakshmidrip.github.io/DROP/version.html * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues * - JUnit => https://lakshmidrip.github.io/DROP/junit/index.html * - Jacoco => https://lakshmidrip.github.io/DROP/jacoco/index.html * * 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. */ /** * <i>AlphaZeroFirstApproximate</i> illustrates the Alpha=0 Approximation for the Cylindrical Bessel Function * of the First Kind. The References are: * * <br><br> * <ul> * <li> * Abramowitz, M., and I. A. Stegun (2007): <i>Handbook of Mathematics Functions</i> <b>Dover Book * on Mathematics</b> * </li> * <li> * Arfken, G. B., and H. J. Weber (2005): <i>Mathematical Methods for Physicists 6<sup>th</sup> * Edition</i> <b>Harcourt</b> San Diego * </li> * <li> * Temme N. M. (1996): <i>Special Functions: An Introduction to the Classical Functions of * Mathematical Physics 2<sup>nd</sup> Edition</i> <b>Wiley</b> New York * </li> * <li> * Watson, G. N. (1995): <i>A Treatise on the Theory of Bessel Functions</i> <b>Cambridge University * Press</b> * </li> * <li> * Wikipedia (2019): Bessel Function https://en.wikipedia.org/wiki/Bessel_function * </li> * </ul> * * <br><br> * <ul> * <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li> * <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FunctionAnalysisLibrary.md">Function Analysis Library</a></li> * <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/README.md">DROP API Construction and Usage</a></li> * <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/bessel/README.md">Estimates of the Bessel Functions</a></li> * </ul> * * @author Lakshmi Krishnamurthy */ public class AlphaZeroFirstApproximate { private static final void BesselJ ( final BesselFirstKindEstimator besselFirstKindEstimatorApproximate, final BesselFirstKindEstimator besselFirstKindEstimator, final double[] zArray) throws Exception { System.out.println ("\t|-----------------------------------------------||"); System.out.println ("\t| ALPHA 0 BESSEL FIRST ASYMPTOTE ||"); System.out.println ("\t|-----------------------------------------------||"); System.out.println ("\t| L -> R: ||"); System.out.println ("\t| - z ||"); System.out.println ("\t| - Bessel Approximate ||"); System.out.println ("\t| - Bessel Frobenius ||"); System.out.println ("\t|-----------------------------------------------||"); for (double z : zArray) { String display = "\t| [" + FormatUtil.FormatDouble (z, 2, 1, 1., false) + "] => " + FormatUtil.FormatDouble ( besselFirstKindEstimatorApproximate.bigJ ( 0., z ), 1, 10, 1. ) + " | " + FormatUtil.FormatDouble ( besselFirstKindEstimator.bigJ ( 0., z ), 1, 10, 1. ) + " |"; System.out.println (display + "|"); } System.out.println ("\t|-----------------------------------------------||"); System.out.println(); } public static final void main ( final String[] argumentArray) throws Exception { EnvManager.InitEnv (""); int frobeniusTermCount = 100; double[] zArray = { -20., -19., -18., -17., -16., -15., -14., -13., -12., -11., -10., -9., -8., -7., -6., -5., -4., -3., -2., -1., 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., }; BesselJ ( BesselFirstKindEstimator.AlphaZeroApproximate(), FirstFrobeniusSeriesEstimator.Standard ( new EulerIntegralSecondKind (null), frobeniusTermCount ), zArray ); EnvManager.TerminateEnv(); } }
[ "lakshmimv7977@gmail.com" ]
lakshmimv7977@gmail.com
b1d535b5449051526791f6ce48bb6d76a93221a3
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.unifiedtelemetry-UnifiedTelemetry/sources/X/IH.java
8c41cae7e573059b423cb6f6a07e746d04d97d00
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
4,115
java
package X; import java.text.DateFormat; import java.text.FieldPosition; import java.text.ParseException; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public final class IH extends DateFormat { public static final IH A05 = new IH(); public static final DateFormat A06; public static final DateFormat A07; public static final DateFormat A08; public static final DateFormat A09; public static final TimeZone A0A = TimeZone.getTimeZone("GMT"); public static final String[] A0B = {"yyyy-MM-dd'T'HH:mm:ss.SSSZ", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "EEE, dd MMM yyyy HH:mm:ss zzz", "yyyy-MM-dd"}; public transient DateFormat A00; public transient DateFormat A01; public transient DateFormat A02; public transient DateFormat A03; public transient TimeZone A04; static { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); A09 = simpleDateFormat; TimeZone timeZone = A0A; simpleDateFormat.setTimeZone(timeZone); SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); A06 = simpleDateFormat2; simpleDateFormat2.setTimeZone(timeZone); SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); A07 = simpleDateFormat3; simpleDateFormat3.setTimeZone(timeZone); SimpleDateFormat simpleDateFormat4 = new SimpleDateFormat("yyyy-MM-dd"); A08 = simpleDateFormat4; simpleDateFormat4.setTimeZone(timeZone); } private final DateFormat A00(DateFormat dateFormat) { TimeZone timeZone = this.A04; DateFormat dateFormat2 = (DateFormat) dateFormat.clone(); if (timeZone != null) { dateFormat2.setTimeZone(timeZone); } return dateFormat2; } @Override // java.lang.Object public final Object clone() { return new IH(); } @Override // java.text.DateFormat public final StringBuffer format(Date date, StringBuffer stringBuffer, FieldPosition fieldPosition) { DateFormat dateFormat = this.A00; if (dateFormat == null) { dateFormat = A00(A06); this.A00 = dateFormat; } return dateFormat.format(date, stringBuffer, fieldPosition); } public final void setTimeZone(TimeZone timeZone) { if (timeZone != this.A04) { this.A03 = null; this.A00 = null; this.A01 = null; this.A02 = null; this.A04 = timeZone; } } public IH() { } public IH(TimeZone timeZone) { this.A04 = timeZone; } @Override // java.text.DateFormat public final Date parse(String str) throws ParseException { String trim = str.trim(); ParsePosition parsePosition = new ParsePosition(0); Date parse = parse(trim, parsePosition); if (parse != null) { return parse; } StringBuilder sb = new StringBuilder(); String[] strArr = A0B; for (String str2 : strArr) { if (sb.length() > 0) { sb.append("\", \""); } else { sb.append('\"'); } sb.append(str2); } sb.append('\"'); throw new ParseException(String.format("Can not parse date \"%s\": not compatible with any of standard forms (%s)", trim, sb.toString()), parsePosition.getErrorIndex()); } /* JADX WARNING: Code restructure failed: missing block: B:75:0x014a, code lost: if (r1 < 0) goto L_0x014c; */ /* Code decompiled incorrectly, please refer to instructions dump. */ public final java.util.Date parse(java.lang.String r9, java.text.ParsePosition r10) { /* // Method dump skipped, instructions count: 345 */ throw new UnsupportedOperationException("Method not decompiled: X.IH.parse(java.lang.String, java.text.ParsePosition):java.util.Date"); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
f220f1da5034ecabcfbf8ffabc2e3fe334b8ae54
144c99466cfb085f2015ec2dc2e67c54f1af1443
/guyue-hadoop/src/main/java/com/amazon/mr/ContentBasedRecommendation.java
a190ba7059628bb7ed8046016e0a311b4f61deae
[]
no_license
guyuetftb/guyue-parents
8c999c9ee510c141f4ddf31ee98d74e00d9287c7
d15bd256e70c10819f86d018d7a3e7cc5c513005
refs/heads/master
2023-05-24T08:18:48.921990
2023-05-15T03:03:42
2023-05-15T03:03:42
132,435,187
3
3
null
2022-11-16T08:28:50
2018-05-07T09:05:27
Java
UTF-8
Java
false
false
2,670
java
package com.amazon.mr; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Reducer; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.util.GenericOptionsParser; import com.amazon.mr.AmazonCustomer.ItemData; public class ContentBasedRecommendation { /** * We make recommendations for a user by looking at the items similar to the * items that has brought by the user. */ public static class AMapper extends Mapper<Object, Text, Text, Text> { public void map(Object key, Text value, Context context) throws IOException, InterruptedException { AmazonCustomer amazonCustomer = new AmazonCustomer(value.toString() .replaceAll("[0-9]+\\s+", "")); List<String> recemndations = new ArrayList<String>(); for (ItemData itemData : amazonCustomer.itemsBrought) { recemndations.addAll(itemData.similarItems); } for (ItemData itemData : amazonCustomer.itemsBrought) { recemndations.remove(itemData.itemID); } ArrayList<String> finalRecemndations = new ArrayList<String>(); for (int i = 0; i < Math.min(10, recemndations.size()); i++) { finalRecemndations.add(recemndations.get(i)); } context.write(new Text(amazonCustomer.customerID), new Text( finalRecemndations.toString())); } } public static class AReducer extends Reducer<Text, Text, Text, Text> { public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException { for (Text value : values) { context.write(key, value); } } } public static void main(String[] args) throws Exception { JobConf conf = new JobConf(); String[] otherArgs = new GenericOptionsParser(conf, args) .getRemainingArgs(); if (otherArgs.length != 2) { System.err.println("Usage: <in> <out>"); System.exit(2); } Job job = new Job(conf, "ClusterBasedRecommendation"); job.setJarByClass(ContentBasedRecommendation.class); job.setMapperClass(AMapper.class); job.setMapOutputKeyClass(Text.class); job.setMapOutputValueClass(Text.class); job.setOutputKeyClass(Text.class); job.setOutputValueClass(Text.class); job.setReducerClass(AReducer.class); FileInputFormat.addInputPath(job, new Path(otherArgs[0])); FileOutputFormat.setOutputPath(job, new Path(otherArgs[1])); System.exit(job.waitForCompletion(true) ? 0 : 1); } }
[ "lipeng02@missfresh.cn" ]
lipeng02@missfresh.cn
62b2b1760dd1016c00c5ab0a0fc42371393541cd
20eb62855cb3962c2d36fda4377dfd47d82eb777
/IntroClassJava/dataset/median/c716ee619761838749589cbd08d5fd56830bff349039f8587e988a5b0cd6310e04844d8e0ee98c5ffee3275aa227bd2c92fcde0993637fcf3bfbd41a37378833/001/mutations/277/median_c716ee61_001.java
ae61a2be18ca61c91c0adbbb382229d2f64565e2
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,366
java
package introclassJava; class IntObj { public int value; public IntObj () { } public IntObj (int i) { value = i; } } class FloatObj { public float value; public FloatObj () { } public FloatObj (float i) { value = i; } } class LongObj { public long value; public LongObj () { } public LongObj (long i) { value = i; } } class DoubleObj { public double value; public DoubleObj () { } public DoubleObj (double i) { value = i; } } class CharObj { public char value; public CharObj () { } public CharObj (char i) { value = i; } } public class median_c716ee61_001 { public java.util.Scanner scanner; public String output = ""; public static void main (String[]args) throws Exception { median_c716ee61_001 mainClass = new median_c716ee61_001 (); String output; if (args.length > 0) { mainClass.scanner = new java.util.Scanner (args[0]); } else { mainClass.scanner = new java.util.Scanner (System.in); } mainClass.exec (); System.out.println (mainClass.output); } public void exec () throws Exception { IntObj A = new IntObj (), B = new IntObj (), C = new IntObj (); output += (String.format ("Pleaes enter 3 numbers separated by spaces > ")); A.value = scanner.nextInt (); B.value = scanner.nextInt (); C.value = scanner.nextInt (); if (A.value > B.value && A.value < C.value) { output += (String.format ("%d is the median\n", A.value)); } if (A.value > C.value && (C.value) > (A.value)) { output += (String.format ("%d is the median\n", A.value)); } if (B.value > C.value && B.value < A.value) { output += (String.format ("%d is the median\n", B.value)); } if (B.value > A.value && B.value < C.value) { output += (String.format ("%d is the median\n", B.value)); } if (C.value > A.value && C.value < B.value) { output += (String.format ("%d is the median\n", C.value)); } if (C.value > B.value && C.value < A.value) { output += (String.format ("%d is the median\n", C.value)); } if (true) return;; } }
[ "justinwm@163.com" ]
justinwm@163.com
9453d4f37811f01d7911100a8625a1671aa03aad
72e1e90dd8e1e43bad4a6ba46a44d1f30aa76fe6
/java/spring/spring-boot-2-recipes/spring-boot-2-recipes-chapter05-spring-webflux/spring-boot-2-recipes-chapter05-recipe-5-2-i-publising-consuming-reactive-rest-services/src/main/java/com/apress/springbootrecipes/order/web/OrderController.java
ab0441dd90c161e9681de4baf3220b0095b37c38
[ "Apache-2.0" ]
permissive
fernando-romulo-silva/myStudies
bfdf9f02778d2f4993999f0ffc0ddd0066ec41b4
aa8867cda5edd54348f59583555b1f8fff3cd6b3
refs/heads/master
2023-08-16T17:18:50.665674
2023-08-09T19:47:15
2023-08-09T19:47:15
230,160,136
3
0
Apache-2.0
2023-02-08T19:49:02
2019-12-25T22:27:59
null
UTF-8
Java
false
false
826
java
package com.apress.springbootrecipes.order.web; import com.apress.springbootrecipes.order.Order; import com.apress.springbootrecipes.order.OrderService; import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @RestController @RequestMapping("/orders") public class OrderController { private final OrderService orderService; OrderController(OrderService orderService) { this.orderService = orderService; } @PostMapping public Mono<Order> store(@RequestBody Mono<Order> order) { return orderService.save(order); } @GetMapping("/{id}") public Mono<Order> find(@PathVariable("id") String id) { return orderService.findById(id); } @GetMapping public Flux<Order> list() { return orderService.orders(); } }
[ "fernando.romulo.silva@gmail.com" ]
fernando.romulo.silva@gmail.com
8ba9264383e2f126449cbc6761d1dc2fc0894e21
79146d7479dea9d466e5a21c77b81cc1ec99ba77
/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonArtifactInfo.java
90511033dd82275cce5019a44cfc219159469d0e
[ "Apache-2.0", "CC-BY-4.0" ]
permissive
onapdemo/so
b0d61b302fbac4a5c57ebfc0746fec0d6f375b0e
494af587df06635820cf184edc7a4cc453b97529
refs/heads/master
2020-03-17T20:41:00.090762
2018-05-18T08:20:53
2018-05-18T08:20:53
133,923,600
0
0
null
null
null
null
UTF-8
Java
false
false
3,491
java
/*- * ============LICENSE_START======================================================= * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. 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. * ============LICENSE_END========================================================= */ package org.openecomp.mso.global_tests.asdc.notif_emulator; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.codehaus.jackson.annotate.JsonAnySetter; import org.codehaus.jackson.annotate.JsonIgnore; import org.openecomp.sdc.api.notification.IArtifactInfo; public class JsonArtifactInfo implements IArtifactInfo { @JsonIgnore private Map<String,IArtifactInfo> artifactsMapByUUID = new HashMap<>(); @JsonIgnore private Map<String,Object> attributesMap = new HashMap<>(); public JsonArtifactInfo() { } public synchronized void addArtifactToUUIDMap (List<JsonArtifactInfo> artifactList) { for (JsonArtifactInfo artifact:artifactList) { artifactsMapByUUID.put(artifact.getArtifactUUID(), artifact); } } @SuppressWarnings("unused") @JsonAnySetter public final void setAttribute(String attrName, Object attrValue) { if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) { this.attributesMap.put(attrName,attrValue); } } public Map<String, IArtifactInfo> getArtifactsMapByUUID() { return artifactsMapByUUID; } @Override public String getArtifactChecksum() { return (String)attributesMap.get("artifactCheckSum"); } @Override public String getArtifactDescription() { return (String)attributesMap.get("artifactDescription"); } @Override public String getArtifactName() { return (String)attributesMap.get("artifactName"); } @Override public Integer getArtifactTimeout() { return (Integer)attributesMap.get("artifactTimeout"); } @Override public String getArtifactType() { return (String)attributesMap.get("artifactType"); } @Override public String getArtifactURL() { return (String)attributesMap.get("artifactURL"); } @Override public String getArtifactUUID() { return (String)attributesMap.get("artifactUUID"); } @Override public String getArtifactVersion() { return (String)attributesMap.get("artifactVersion"); } @Override public IArtifactInfo getGeneratedArtifact () { return artifactsMapByUUID.get(attributesMap.get("generatedArtifact")); } @Override public List<IArtifactInfo> getRelatedArtifacts() { List<IArtifactInfo> listArtifacts = new LinkedList<>(); List<String> uuidList = (List<String>)attributesMap.get("relatedArtifact"); if (uuidList != null) { for(String uuid:uuidList) { listArtifacts.add(artifactsMapByUUID.get(uuid)); } } return listArtifacts; } }
[ "Sudhakar.reddy@amdocs.com" ]
Sudhakar.reddy@amdocs.com
5926429f7c5712ea3e1b5271f3bfca5c14e61a27
b34da2a0c9718bfcd67548c58a26194aaaa15541
/wzb-order/src/main/java/com/jiuchunjiaoyu/micro/wzbOrder/manager/impl/WzbOrderMngImpl.java
539b93227a7d51b36b34e573ffbaa914ec0dcf05
[]
no_license
qidianliusong/springcloud
a5fac34880da042d0c3392842e4c5350b194a71b
77700263b0123809f0cf43480ef4e6cdbd47900b
refs/heads/master
2021-07-09T19:49:51.325448
2017-10-11T01:45:10
2017-10-11T01:45:10
106,490,956
0
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
package com.jiuchunjiaoyu.micro.wzbOrder.manager.impl; import com.jiuchunjiaoyu.micro.wzbOrder.entity.WzbOrder; import com.jiuchunjiaoyu.micro.wzbOrder.manager.WzbOrderMng; import com.jiuchunjiaoyu.micro.wzbOrder.repository.WzbOrderRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; @Service public class WzbOrderMngImpl implements WzbOrderMng { private static Logger logger = LoggerFactory.getLogger(WzbOrderMngImpl.class); @Resource private WzbOrderRepository wzbOrderRepository; @Override @Transactional public WzbOrder saveOrUpdate(WzbOrder wzbOrder) { return wzbOrderRepository.save(wzbOrder); } @Override @Transactional(readOnly = true) public WzbOrder findById(Long wzbOrderId) { return wzbOrderRepository.findOne(wzbOrderId); } @Override @Transactional(readOnly = true) public WzbOrder findByOutTradeNo(String outTradeNo) { return wzbOrderRepository.findByOutTradeNo(outTradeNo); } }
[ "lsongiu8612@163.com" ]
lsongiu8612@163.com
13ab032c39b9004a4052b1e2a9c18103a7a1eb5c
962a6192bbbadcd1a314026406670d8e87db83f5
/talkTV30/src/main/java/com/sumavision/talktv2/dao/DBActivityContactsInfo.java
38b951fe16fde8dc4712e2b52c05453331b93e94
[]
no_license
sharpayzara/TalkTV3.0_Studio_yy
1aa09c1b5ba697514535a507fd017faf1db81b06
801afa091aa41835873f466655872190745a9d93
refs/heads/master
2021-01-19T16:04:12.195817
2017-04-13T21:00:19
2017-04-13T21:00:19
88,245,487
0
1
null
null
null
null
UTF-8
Java
false
false
4,125
java
package com.sumavision.talktv2.dao; import java.util.ArrayList; import android.content.Context; import android.database.Cursor; import android.util.Log; import com.sumavision.talktv2.bean.ActivityJoinBean; public class DBActivityContactsInfo extends AbstractDBHelper { public DBActivityContactsInfo(Context ctx) { super(ctx, "talktv_ac.db", DBActivityContactsInfo.class, 1); } public boolean isExisted(ActivityJoinBean aJoinBean) { String querrySql = "select count(*) from contactinfo where id = ?and num = ?"; String id = aJoinBean.activityid; String num = aJoinBean.activitynum; String[] bindArgs = { id, num }; Cursor cursor = mDb.rawQuery(querrySql, bindArgs); if (cursor != null) { cursor.moveToFirst(); long howLong = cursor.getLong(0); cursor.close(); if (howLong > 0) { return true; } } return false; } public boolean save(ActivityJoinBean aJoinBean) { String sql = null; sql = "INSERT INTO contactinfo (id,manager,num) VALUES (?, ?, ?)"; mDb.beginTransaction(); try { String id = aJoinBean.activityid; String activitymanager = aJoinBean.activitymanager == null ? "" : aJoinBean.activitymanager; String activitynum = aJoinBean.activitynum == null ? "" : aJoinBean.activitynum; if (!isExisted(aJoinBean)) { Object[] bindArgs = { id, activitymanager, activitynum }; mDb.execSQL(sql, bindArgs); } else { update(aJoinBean); Log.e("AccessProgramPlayPosition", "@needUpdate"); } mDb.setTransactionSuccessful(); } catch (Exception e) { e.printStackTrace(); } finally { mDb.endTransaction(); mDb.close(); } return true; } private void update(ActivityJoinBean aJoinBean) { String sql = ""; sql = "update contactinfo set manager=? where id=? and num=? "; String id = aJoinBean.activityid; String num = aJoinBean.activitynum; String manager = aJoinBean.activitymanager; // String manager = aJoinBean.activitymanager; String[] bindArgs = { manager, id, num }; try { mDb.execSQL(sql, bindArgs); } catch (Exception e) { e.printStackTrace(); } finally { } } public ActivityJoinBean findById(String id, String num) { ActivityJoinBean temp = new ActivityJoinBean(); String sql = "SELECT * FROM contactinfo where id = ?and num = ?"; String[] selectionArgs = { id, num }; Cursor cursor = null; try { mDb.beginTransaction(); cursor = mDbHelper.getReadableDatabase().rawQuery(sql, selectionArgs); while (cursor.moveToNext()) { temp.activityid = cursor.getString(1); temp.activitymanager = cursor.getString(2); temp.activitynum = cursor.getString(3); } cursor.close(); mDb.setTransactionSuccessful(); } catch (Exception e) { e.printStackTrace(); } finally { mDb.endTransaction(); mDbHelper.close(); } return temp; } public ArrayList<ActivityJoinBean> findAllById(String id) { String querrySql = "select * from contactinfo where id = ? "; String[] bindArgs = new String[] { id }; ArrayList<ActivityJoinBean> temp = new ArrayList<ActivityJoinBean>(); Cursor cursor = null; try { mDb.beginTransaction(); cursor = mDbHelper.getReadableDatabase().rawQuery(querrySql, bindArgs); while (cursor.moveToNext()) { ActivityJoinBean data = new ActivityJoinBean(); data.activityid = cursor.getString(cursor.getColumnIndex("id")); data.activitymanager = cursor.getString(cursor .getColumnIndex("manager")); data.activitynum = cursor.getString(cursor .getColumnIndex("num")); temp.add(data); } cursor.close(); mDb.setTransactionSuccessful(); } catch (Exception e) { e.printStackTrace(); } finally { mDb.endTransaction(); mDbHelper.close(); } return temp; } @Override protected String createDBTable() { StringBuffer sql = new StringBuffer( "CREATE TABLE IF NOT EXISTS contactinfo ("); sql.append("_id integer primary key autoincrement,").append( "id varchar(10),manager varchar(100),num varchar(100))"); return sql.toString(); } @Override protected String dropDBTable() { return "DROP TABLE IF EXISTS contactinfo"; } }
[ "864064269@qq.com" ]
864064269@qq.com
93df9e365c43022ddc54a8608df060b5db3ca171
a1da47c5fdfc644e3029f03316fe76f6b5cf5bb4
/components/chemaxon-camel/src/main/java/org/squonk/camel/chemaxon/processor/enumeration/ReactorProcessor.java
1122eaf05fc9492aa41245111e9479839a9f80ce
[ "Apache-2.0" ]
permissive
InformaticsMatters/squonk
a25af0454f4637827136b19cc91f0ad22c0cbe87
56e826858bb495b064d215f7c4851429493cf639
refs/heads/master
2021-03-30T17:15:11.194844
2021-03-08T18:09:42
2021-03-08T18:09:42
94,418,987
7
4
Apache-2.0
2021-03-08T18:09:43
2017-06-15T08:40:39
Java
UTF-8
Java
false
false
6,024
java
/* * Copyright (c) 2017 Informatics Matters Ltd. * * 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.squonk.camel.chemaxon.processor.enumeration; import chemaxon.formats.MolImporter; import chemaxon.reaction.Reactor; import chemaxon.struc.Molecule; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.ProducerTemplate; import org.squonk.chemaxon.enumeration.ReactionLibrary; import org.squonk.chemaxon.enumeration.ReactorExecutor; import org.squonk.dataset.Dataset; import org.squonk.dataset.MoleculeObjectDataset; import org.squonk.types.MoleculeObject; import org.squonk.util.CamelRouteStatsRecorder; import org.squonk.util.StatsRecorder; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.logging.Logger; import java.util.stream.Stream; /** * * @author timbo */ public class ReactorProcessor implements Processor { private static Logger LOG = Logger.getLogger(ReactorProcessor.class.getName()); private final String statsRouteUri; public static final String OPTION_REACTOR_REACTION = "reaction"; public static final String OPTION_IGNORE_REACTIVITY = "ignoreReactivityRules"; public static final String OPTION_IGNORE_SELECTIVITY = "ignoreSelectivityRules"; public static final String OPTION_IGNORE_TOLERANCE = "ignoreToleranceRules"; public static final String OPTION_REACTOR_OUTPUT = "reactorOutput"; public static final String OPTION_OUTPUT_FORMAT = "outputFormat"; private final String rxnLibZipFile; private ReactionLibrary rxnlib; public ReactorProcessor(ReactionLibrary rxnLib, String statsRouteUri) { this.rxnlib = rxnLib; this.statsRouteUri = statsRouteUri; this.rxnLibZipFile = rxnLib.getPath(); } public ReactorProcessor(String rxnLibZipFile, String statsRouteUri) { this.rxnLibZipFile = rxnLibZipFile; this.statsRouteUri = statsRouteUri; File f = new File(rxnLibZipFile); if (f.exists()) { try { rxnlib = new ReactionLibrary(f); LOG.info("Using reaction library from " + rxnLibZipFile); } catch (IOException ioe) { LOG.warning("Could not load reaction library from " + rxnLibZipFile); } } else { LOG.warning("Reaction library not found at " + rxnLibZipFile); } } @Override public void process(Exchange exch) throws Exception { if (rxnlib == null) { throw new FileNotFoundException("Reaction library could not be found at " + rxnLibZipFile); } // 1. the reaction String reactionName = exch.getIn().getHeader(OPTION_REACTOR_REACTION, String.class); if (reactionName == null) { throw new IllegalStateException("No reaction name specified. Should be present as header named " + OPTION_REACTOR_REACTION); } String reactionMrv = readReaction(reactionName); if (reactionMrv == null) { throw new IllegalStateException("Reaction " + reactionName + " could not be found"); } Molecule rxn = MolImporter.importMol(reactionMrv); // 2. the reactants Dataset<MoleculeObject> dataset = exch.getIn().getBody(Dataset.class); // 3. other options Boolean ignoreReactivity = exch.getIn().getHeader(OPTION_IGNORE_REACTIVITY, Boolean.class); Boolean ignoreSelectivity = exch.getIn().getHeader(OPTION_IGNORE_SELECTIVITY, Boolean.class); Boolean ignoreTolerance = exch.getIn().getHeader(OPTION_IGNORE_TOLERANCE, Boolean.class); String outputFormat = exch.getIn().getHeader(OPTION_OUTPUT_FORMAT, String.class); int ignoreRules = (ignoreReactivity == null || !ignoreReactivity ? 0 : Reactor.IGNORE_REACTIVITY) | (ignoreSelectivity == null || !ignoreSelectivity ? 0 : Reactor.IGNORE_SELECTIVITY) | (ignoreTolerance == null || !ignoreTolerance ? 0 : Reactor.IGNORE_TOLERANCE); LOG.info(String.format("Rules: %s [%s %s %s]", ignoreRules, ignoreReactivity, ignoreSelectivity, ignoreTolerance)); String header = exch.getIn().getHeader(OPTION_REACTOR_OUTPUT, String.class); ReactorExecutor.Output output = (header == null ? ReactorExecutor.Output.Product1 : ReactorExecutor.Output.valueOf(header)); // stats generation String jobId = exch.getIn().getHeader(StatsRecorder.HEADER_SQUONK_JOB_ID, String.class); StatsRecorder statsRecorder = null; if (statsRouteUri != null) { ProducerTemplate pt = exch.getContext().createProducerTemplate(); pt.setDefaultEndpointUri(statsRouteUri); statsRecorder = new CamelRouteStatsRecorder(jobId, pt); } // perform the enumeration ReactorExecutor exec = new ReactorExecutor(rxn, outputFormat, statsRecorder); Stream<MoleculeObject> results = exec.enumerateMoleculeObjects(output, ignoreRules, dataset.getStream()); // TODO - handle stats exch.getIn().setBody(new MoleculeObjectDataset(results)); } private String readReaction(String name) throws IOException { // String resource = "/reactions/" + name + ".mrv"; // LOG.info("Reading reaction from " + resource); // InputStream is = this.getClass().getResourceAsStream(resource); // return is == null ? null : IOUtils.convertStreamToString(is); return rxnlib.getReaction(name); } }
[ "tdudgeon@informaticsmatters.com" ]
tdudgeon@informaticsmatters.com
19a0f10e21a9d409adbe365060b2775ece1ce88a
644277e4b4aa6b3a9932931081bb524c53688937
/Java/Examples/arpggame(0.5)/src/com/mygame/SwordBlock.java
da082c81bad368ee9d73f0e2f647219b086cf0c6
[ "Apache-2.0" ]
permissive
cping/LGame
25e905281e31f4ca9e60ddbf7e192d130c8fa886
9b003a2e3e8a485c1b039b1ba15971dc17eb3f3c
refs/heads/master
2023-08-31T23:23:10.921734
2023-08-30T10:16:12
2023-08-30T10:16:12
6,753,822
470
163
Apache-2.0
2022-02-16T06:29:56
2012-11-19T02:05:03
Java
UTF-8
Java
false
false
378
java
package com.mygame; public class SwordBlock extends Thing { SwordBlock(float x, float y) { height = 50; width = 50; this.x = x; this.y = y; solid = true; } public void update(Player player, int enemiesLeft) { if(state == Thing.STATE_NORMAL && player.hasSword) state = Thing.STATE_DEATH; } }
[ "longwind2012@hotmail.com" ]
longwind2012@hotmail.com
86d3f7d3d22933467d7d125f723fb4278b10f614
5f7f9c25fc304ff52071c698530bbed3383aac47
/ta4j/src/test/java/eu/verdelhan/ta4j/mocks/MockDecimalIndicator.java
d071cfbd2d9fe2f24e06c05763779534e76c207b
[ "MIT" ]
permissive
rsrtime/ta4j
c6706adc65a513b84cc06487f837d394142da565
61c09128c7a6fd5d5e3875385f55f15a5031632f
refs/heads/master
2021-01-19T20:57:23.202477
2014-12-30T04:04:30
2014-12-30T04:04:30
28,551,303
1
0
null
null
null
null
UTF-8
Java
false
false
1,505
java
/** * The MIT License (MIT) * * Copyright (c) 2014 Marc de Verdelhan & respective authors * * 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 eu.verdelhan.ta4j.mocks; import eu.verdelhan.ta4j.TADecimal; /** * A sample decimal indicator. */ public class MockDecimalIndicator extends MockIndicator<TADecimal> { public MockDecimalIndicator(double... values) { for (double value : values) { addValue(TADecimal.valueOf(value)); } } }
[ "marc.deverdelhan@yahoo.com" ]
marc.deverdelhan@yahoo.com
4ffdb79623cb86d0cc1446ad643fedcb76b722db
e369d9879042675c259345e9d83c99fabb27de64
/NS_Client201802/src/com/netsuite/webservices/lists/accounting_2018_2/types/BillingScheduleMonthDowim.java
82d56f9582d94f0aa9ea1db80c3bf54d50f2fcc3
[]
no_license
zbansi/intretech_netsuite
609d59949a36e080841a5341812005df414a79d6
17d56760fd8b920a378e373c4ab021877ece7315
refs/heads/master
2021-06-26T00:31:19.500230
2019-06-06T01:59:49
2019-06-06T01:59:49
154,297,224
0
0
null
2020-10-13T10:51:34
2018-10-23T09:06:33
Java
UTF-8
Java
false
false
3,375
java
/** * BillingScheduleMonthDowim.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Jul 28, 2010 (04:07:04 PDT) WSDL2Java emitter. */ package com.netsuite.webservices.lists.accounting_2018_2.types; public class BillingScheduleMonthDowim implements java.io.Serializable { private java.lang.String _value_; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected BillingScheduleMonthDowim(java.lang.String value) { _value_ = value; _table_.put(_value_,this); } public static final java.lang.String __first = "_first"; public static final java.lang.String __second = "_second"; public static final java.lang.String __third = "_third"; public static final java.lang.String __fourth = "_fourth"; public static final java.lang.String __last = "_last"; public static final BillingScheduleMonthDowim _first = new BillingScheduleMonthDowim(__first); public static final BillingScheduleMonthDowim _second = new BillingScheduleMonthDowim(__second); public static final BillingScheduleMonthDowim _third = new BillingScheduleMonthDowim(__third); public static final BillingScheduleMonthDowim _fourth = new BillingScheduleMonthDowim(__fourth); public static final BillingScheduleMonthDowim _last = new BillingScheduleMonthDowim(__last); public java.lang.String getValue() { return _value_;} public static BillingScheduleMonthDowim fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { BillingScheduleMonthDowim enumeration = (BillingScheduleMonthDowim) _table_.get(value); if (enumeration==null) throw new java.lang.IllegalArgumentException(); return enumeration; } public static BillingScheduleMonthDowim fromString(java.lang.String value) throws java.lang.IllegalArgumentException { return fromValue(value); } public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return _value_;} public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumSerializer( _javaType, _xmlType); } public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumDeserializer( _javaType, _xmlType); } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(BillingScheduleMonthDowim.class); static { typeDesc.setXmlType(new javax.xml.namespace.QName("urn:types.accounting_2018_2.lists.webservices.netsuite.com", "BillingScheduleMonthDowim")); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } }
[ "alonjune@gmail.com" ]
alonjune@gmail.com
9554511a4fe4e784d4bb17a11a2489b148eb6458
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_1cc7d1f8d785c83bd1639f6617d8eb3102fe6f30/ModifyTemplateProducer/28_1cc7d1f8d785c83bd1639f6617d8eb3102fe6f30_ModifyTemplateProducer_s.java
b9a6bdc858444164f5f981497cdeda830ecbc2cd
[]
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
7,143
java
/****************************************************************************** * TemplateProducer.java - created on Aug 21, 2006 * * Copyright (c) 2007 Virginia Polytechnic Institute and State University * Licensed under the Educational Community License version 1.0 * * A copy of the Educational Community License has been included in this * distribution and is available at: http://www.opensource.org/licenses/ecl1.php * * Contributors: * Antranig Basman (antranig@caret.cam.ac.uk) * Kapil Ahuja (kahuja@vt.edu) *****************************************************************************/ package org.sakaiproject.evaluation.tool.producers; import java.util.ArrayList; import java.util.List; import org.sakaiproject.evaluation.logic.EvalExternalLogic; import org.sakaiproject.evaluation.logic.EvalSettings; import org.sakaiproject.evaluation.model.constant.EvalConstants; import org.sakaiproject.evaluation.tool.EvaluationConstant; import org.sakaiproject.evaluation.tool.locators.TemplateBeanLocator; import org.sakaiproject.evaluation.tool.viewparams.TemplateViewParameters; import uk.org.ponder.rsf.components.UIBranchContainer; import uk.org.ponder.rsf.components.UICommand; import uk.org.ponder.rsf.components.UIContainer; import uk.org.ponder.rsf.components.UIELBinding; import uk.org.ponder.rsf.components.UIForm; import uk.org.ponder.rsf.components.UIInput; import uk.org.ponder.rsf.components.UIInternalLink; import uk.org.ponder.rsf.components.UIMessage; import uk.org.ponder.rsf.components.UISelect; import uk.org.ponder.rsf.flow.jsfnav.NavigationCase; import uk.org.ponder.rsf.flow.jsfnav.NavigationCaseReporter; import uk.org.ponder.rsf.view.ComponentChecker; import uk.org.ponder.rsf.view.ViewComponentProducer; import uk.org.ponder.rsf.viewstate.SimpleViewParameters; import uk.org.ponder.rsf.viewstate.ViewParameters; import uk.org.ponder.rsf.viewstate.ViewParamsReporter; /** * view to start creating a template and for modifying the template settings * (title, description, sharing) * * @author: Kapil Ahuja (kahuja@vt.edu) */ public class ModifyTemplateProducer implements ViewComponentProducer, ViewParamsReporter, NavigationCaseReporter { public static final String VIEW_ID = "modify_template"; public String getViewID() { return VIEW_ID; } private EvalSettings settings; public void setSettings(EvalSettings settings) { this.settings = settings; } private EvalExternalLogic externalLogic; public void setExternalLogic(EvalExternalLogic externalLogic) { this.externalLogic = externalLogic; } /* * 1) accessing this page trough "Create Template" link -- 2) accessing * through "Modify Template Title/Description" link on ModifyTemplate page * 2-1) no template been save in DAO 2-2) existing template in DAO * */ public void fillComponents(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) { TemplateViewParameters evalViewParams = (TemplateViewParameters) viewparams; // setup the OTP binding strings String templateOTPBinding = null; if (evalViewParams.templateId != null) { templateOTPBinding = "templateBeanLocator." + evalViewParams.templateId; //$NON-NLS-1$ } else { templateOTPBinding = "templateBeanLocator." + TemplateBeanLocator.NEW_1; //$NON-NLS-1$ } String templateOTP = templateOTPBinding + "."; //$NON-NLS-1$ UIMessage.make(tofill, "template-title-desc-title", "modifytemplatetitledesc.page.title"); //$NON-NLS-1$ //$NON-NLS-2$ UIInternalLink.make(tofill, "summary-toplink", UIMessage.make("summary.page.title"), //$NON-NLS-1$ //$NON-NLS-2$ new SimpleViewParameters(SummaryProducer.VIEW_ID)); UIForm form = UIForm.make(tofill, "basic-form"); //$NON-NLS-1$ UIMessage.make(form, "title-header", "modifytemplatetitledesc.title.header"); //$NON-NLS-1$ //$NON-NLS-2$ UIMessage.make(form, "description-header", "modifytemplatetitledesc.description.header"); //$NON-NLS-1$ //$NON-NLS-2$ UIMessage.make(form, "description-note", "modifytemplatetitledesc.description.note"); //$NON-NLS-1$ //$NON-NLS-2$ UICommand.make(form, "addContinue", UIMessage.make("modifytemplatetitledesc.save.button"), "#{templateBBean.updateTemplateTitleDesc}"); UIInput.make(form, "title", templateOTP + "title"); UIInput.make(form, "description", templateOTP + "description"); //$NON-NLS-1$ //$NON-NLS-2$ /* * (Non-javadoc) If "EvalSettings.TEMPLATE_SHARING_AND_VISIBILITY" is set * EvalConstants.SHARING_OWNER, then it means that owner can decide what * sharing settings to chose. In other words, it means that show the * sharing/visibility dropdown. Else just show the label for what has been * set in system setting (admin setting) i.e. * "EvalSettings.TEMPLATE_SHARING_AND_VISIBILITY". */ String sharingkey = null; String sharingValue = (String) settings.get(EvalSettings.TEMPLATE_SHARING_AND_VISIBILITY); if ( EvalConstants.SHARING_OWNER.equals(sharingValue) ) { /* * Dropdown values are visible only for admins. For instructors * (non-admin) we just show the private label */ if (externalLogic.isUserAdmin(externalLogic.getCurrentUserId())) { UIBranchContainer showSharingOptions = UIBranchContainer.make(form, "showSharingOptions:"); //$NON-NLS-1$ UISelect.make(showSharingOptions, "sharing", EvaluationConstant.SHARING_VALUES, EvaluationConstant.SHARING_LABELS_PROPS, templateOTP + "sharing", null).setMessageKeys(); } else { sharingkey = "modifytemplatetitledesc.sharing.private"; form.parameters.add(new UIELBinding(templateOTP + "sharing", EvalConstants.SHARING_PRIVATE)); //$NON-NLS-1$ } } else { if ((EvalConstants.SHARING_PRIVATE).equals(sharingValue)) sharingkey = "modifytemplatetitledesc.sharing.private"; //$NON-NLS-1$ else if ((EvalConstants.SHARING_PUBLIC).equals(sharingValue)) sharingkey = "modifytemplatetitledesc.sharing.public"; //$NON-NLS-1$ // Doing the binding of this sharing value so that it can be persisted form.parameters.add(new UIELBinding(templateOTP + "sharing", sharingValue)); //$NON-NLS-1$ } if (sharingkey != null) { // Displaying the sharing label UIMessage.make(form, "sharingValueToDisplay", sharingkey); //$NON-NLS-1$ } UIMessage.make(form, "cancel-button", "general.cancel.button"); } /* (non-Javadoc) * @see uk.org.ponder.rsf.viewstate.ViewParamsReporter#getViewParameters() */ public ViewParameters getViewParameters() { return new TemplateViewParameters(); } /* (non-Javadoc) * @see uk.org.ponder.rsf.flow.jsfnav.NavigationCaseReporter#reportNavigationCases() */ public List reportNavigationCases() { List togo = new ArrayList(); togo.add(new NavigationCase("success", new TemplateViewParameters( ModifyTemplateItemsProducer.VIEW_ID, null))); return togo; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
cf73bdba54ee9f496b672d129e2221fc1d5577fe
1cce29cd23674b1e7f3d523c779231032720add4
/src/main/java/com/suixingpay/profit/leetcode/code/lc150.java
4184cb3106a1420068b3d46737bc183df0d79935
[]
no_license
histjxg/hxg-all
b87a30f2c18c8c075067c406fb1aac8b56dbff4d
01a1aabb12f3a56bb74698ac986fd16268421698
refs/heads/master
2023-07-11T22:10:39.808894
2021-08-18T16:07:35
2021-08-18T16:07:36
397,638,703
0
0
null
null
null
null
UTF-8
Java
false
false
1,316
java
package com.suixingpay.profit.leetcode.code; /* * 150. Evaluate Reverse Polish Notation * 题意:波兰表达式运算 * 难度:Medium * 分类:Stack * 思路:用栈即可 * Tips: */ import java.util.Stack; public class lc150 { public int evalRPN(String[] tokens) { if(tokens.length==1) return Integer.valueOf(tokens[0]); Stack<Integer> st = new Stack(); String opration = "+-*/"; int res = 0; for (int i = 0; i < tokens.length ; i++) { if(opration.contains(tokens[i])){ int n2 = st.pop(); //注意n1,n2顺序,除法时两个数是有顺序的 int n1 = st.pop(); System.out.println(n1); System.out.println(n2); if(tokens[i].equals("+")){ //注意用equeals res = n1 + n2; }else if(tokens[i].equals("-")){ res = n1 - n2; }else if(tokens[i].equals("*")){ res = n1 * n2; }else if(tokens[i].equals("/")){ res = n1 / n2; } st.push(res); System.out.println(res); }else{ st.push(Integer.valueOf(tokens[i]));; } } return res; } }
[ "huangxiaogen@baijiahulian.com" ]
huangxiaogen@baijiahulian.com
a03b03cc0f175cade0aa8b93be5b3faf5b06bbd1
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/apereo--cas/e96e75ec0c7a5d06902756e53317c3450fb7e532/after/RegexRegisteredServiceTests.java
b69527cadd0af317c8b528b85f9f1651e8e6a338
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
4,524
java
package org.apereo.cas.services; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.io.FileUtils; import org.apereo.cas.authentication.principal.Service; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.apereo.cas.services.RegisteredService.LogoutType; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.Collection; import static org.junit.Assert.*; /** * Unit test for {@link RegexRegisteredService}. * * @author Marvin S. Addison * @since 3.4.0 */ @RunWith(Parameterized.class) public class RegexRegisteredServiceTests { private static final File JSON_FILE = new File(FileUtils.getTempDirectoryPath(), "regexRegisteredService.json"); private static final ObjectMapper MAPPER = new ObjectMapper(); private final RegexRegisteredService service; private final String serviceToMatch; private final boolean expected; public RegexRegisteredServiceTests( final RegexRegisteredService service, final String serviceToMatch, final boolean expectedResult) { this.service = service; this.serviceToMatch = serviceToMatch; this.expected = expectedResult; } @Parameterized.Parameters public static Collection<Object[]> getParameters() { final String domainCatchallHttp = "https*://([A-Za-z0-9_-]+\\.)+vt\\.edu/.*"; final String domainCatchallHttpImap = "(https*|imaps*)://([A-Za-z0-9_-]+\\.)+vt\\.edu/.*"; final String globalCatchallHttpImap = "(https*|imaps*)://.*"; return Arrays.asList(new Object[][]{ // CAS-1071 domain-specific HTTP catch-all #1 { newService(domainCatchallHttp), "https://service.vt.edu/webapp?a=1", true, }, { newService(domainCatchallHttp), "http://test-01.service.vt.edu/webapp?a=1", true, }, { newService(domainCatchallHttp), "https://thepiratebay.se?service.vt.edu/webapp?a=1", false, }, // Domain-specific catch-all for HTTP(S)/IMAP(S) #1 { newService(domainCatchallHttpImap), "http://test_service.vt.edu/login", true, }, // Domain-specific catch-all for HTTP(S)/IMAP(S) #2 { newService(domainCatchallHttpImap), "imaps://imap-server-01.vt.edu/", true, }, // Global catch-all for HTTP(S)/IMAP(S) #1 { newService(globalCatchallHttpImap), "https://host-01.example.com/", true, }, // Global catch-all for HTTP(S)/IMAP(S) #2 { newService(globalCatchallHttpImap), "imap://host-02.example.edu/", true, }, // Null case { newService(globalCatchallHttpImap), null, false, }, }); } @Test public void verifyMatches() throws Exception { final Service testService; if (serviceToMatch == null) { testService = null; } else { testService = RegisteredServiceTestUtils.getService(serviceToMatch); } assertEquals(expected, service.matches(testService)); } private static RegexRegisteredService newService(final String id) { final RegexRegisteredService service = new RegexRegisteredService(); service.setServiceId(id); return service; } @Test public void verifySerializeARegexRegisteredServiceToJson() throws IOException { final RegexRegisteredService serviceWritten = newService("serviceId"); serviceWritten.setLogoutType(RegisteredService.LogoutType.FRONT_CHANNEL); MAPPER.writeValue(JSON_FILE, serviceWritten); final RegisteredService serviceRead = MAPPER.readValue(JSON_FILE, RegexRegisteredService.class); assertEquals(serviceWritten, serviceRead); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
ba056452da121c28fad7b90396cc304e8b83e493
017be3d27ff71f655cad3fc43136f0cb14035f04
/src/main/java/pl/coderslab/book/BookService.java
4cd44da4008ebe32e1fafbc71288b2104353c120
[]
no_license
mdziadon/Spring21hibernate
ef957eea9015cee2e0961378e674d4882baf0d83
be62e466e02557e5cc674671f4609e5f04bd616a
refs/heads/master
2022-12-21T12:19:01.160584
2019-11-05T13:40:29
2019-11-05T13:40:29
218,048,390
0
1
null
2022-12-16T00:36:45
2019-10-28T13:05:07
Java
UTF-8
Java
false
false
2,116
java
package pl.coderslab.book; import org.hibernate.Hibernate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service @Transactional public class BookService { private BookRepository bookRepository; @Autowired public BookService(BookRepository bookRepository) { this.bookRepository = bookRepository; } public void save(Book book) { bookRepository.save(book); } public void update(Book book) { bookRepository.save(book); } public Book findOne(Long id) { return bookRepository.findById(id).orElse(null); } public Book findBookWithAuthors(Long id) { Book book = findOne(id); Hibernate.initialize(book.getAuthors()); return book; } public void delete(Long id) { bookRepository.deleteById(id); } public List<Book> findAll() { return bookRepository.findAll(); } public List<Book> findAllPropositions() { return bookRepository.findByPropositionTrue(); } public List<Book> getRatingList(int rating) { return bookRepository.findByRating(rating); } public List<Book> getBooksByTitle(String title) { return bookRepository.findByTitleQuery(title); } public List<Book> getBooksByCategoryId(Long categoryId){ return bookRepository.findByCategoryIdQuery(categoryId); } public List<Book> getBooksByAuthorId(Long authorId) { return bookRepository.findByAuthorsId(authorId); } public List<Book> getBooksByByPublisherId(Long publisherId) { return bookRepository.findByPublisherId(publisherId); } public Book getFirstBookByCategoryId(Long categoryId) { return bookRepository.findFirstByCategoryIdOrderByTitle(categoryId); } public void resetRating(int rating) { bookRepository.resetRatingQuery(rating); } public void deleteByTitle(String title) { bookRepository.deleteByTitle(title); } }
[ "test@gmail.com" ]
test@gmail.com
4cb982b18ad4783d4c5777374024c332deed516b
e3a09a1c199fb3e32d1e43c1393ec133fa34ceab
/game/data/scripts/instances/KartiasLabyrinth/KartiaHelperHayuk.java
95d76a25af4b9a41077656f9988edf2caef55196
[]
no_license
Refuge89/l2mobius-helios
0fbaf2a11b02ce12c7970234d4b52efa066ef122
d1251e1fb5a2a40925839579bf459083a84b0c59
refs/heads/master
2020-03-23T01:37:03.354874
2018-07-14T06:52:51
2018-07-14T06:52:51
140,927,248
1
0
null
2018-07-14T07:49:40
2018-07-14T07:49:39
null
UTF-8
Java
false
false
7,768
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package instances.KartiasLabyrinth; import com.l2jmobius.commons.util.CommonUtil; import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.events.impl.character.OnCreatureAttacked; import com.l2jmobius.gameserver.model.events.impl.character.OnCreatureDeath; import com.l2jmobius.gameserver.model.events.impl.instance.OnInstanceStatusChange; import com.l2jmobius.gameserver.model.holders.SkillHolder; import com.l2jmobius.gameserver.model.instancezone.Instance; import com.l2jmobius.gameserver.model.skills.SkillCaster; import com.l2jmobius.gameserver.network.NpcStringId; import ai.AbstractNpcAI; /** * Kartia Helper Hayuk AI. Archer * @author flanagak */ public final class KartiaHelperHayuk extends AbstractNpcAI { // NPCs private static final int[] KARTIA_ADOLPH = { 33609, // Adolph (Kartia 85) 33620, // Adolph (Kartia 90) 33631, // Adolph (Kartia 95) }; private static final int[] KARTIA_HAYUK = { 33613, // Hayuk (Kartia 85) 33624, // Hayuk (Kartia 90) 33635, // Hayuk (Kartia 95) }; private static final int[] KARTIA_FRIENDS = { 33617, // Elise (Kartia 85) 33628, // Elise (Kartia 90) 33639, // Elise (Kartia 95) 33609, // Adolph (Kartia 85) 33620, // Adolph (Kartia 90) 33631, // Adolph (Kartia 95) 33611, // Barton (Kartia 85) 33622, // Barton (Kartia 90) 33633, // Barton (Kartia 95) 33615, // Eliyah (Kartia 85) 33626, // Eliyah (Kartia 90) 33637, // Eliyah (Kartia 95) 33613, // Hayuk (Kartia 85) 33624, // Hayuk (Kartia 90) 33635, // Hayuk (Kartia 95) 33618, // Eliyah's Guardian Spirit (Kartia 85) 33629, // Eliyah's Guardian Spirit (Kartia 90) 33640, // Eliyah's Guardian Spirit (Kartia 95) }; // Misc private static final int[] KARTIA_SOLO_INSTANCES = { 205, // Solo 85 206, // Solo 90 207, // Solo 95 }; private KartiaHelperHayuk() { setCreatureKillId(this::onCreatureKill, KARTIA_HAYUK); setCreatureAttackedId(this::onCreatureAttacked, KARTIA_HAYUK); addSeeCreatureId(KARTIA_HAYUK); setInstanceStatusChangeId(this::onInstanceStatusChange, KARTIA_SOLO_INSTANCES); } @Override public void onTimerEvent(String event, StatsSet params, L2Npc npc, L2PcInstance player) { final Instance instance = npc.getInstanceWorld(); if ((instance != null) && event.equals("CHECK_ACTION")) { final FriendlyNpcInstance adolph = npc.getVariables().getObject("ADOLPH_OBJECT", FriendlyNpcInstance.class); if (adolph != null) { final double distance = npc.calculateDistance(adolph, false, false); if (distance > 300) { final Location loc = new Location(adolph.getX(), adolph.getY(), adolph.getZ() + 50); final Location randLoc = new Location(loc.getX() + getRandom(-100, 100), loc.getY() + getRandom(-100, 100), loc.getZ()); if (distance > 600) { npc.teleToLocation(loc); } else { npc.setRunning(); } addMoveToDesire(npc, randLoc, 23); } else if (!npc.isInCombat() || (npc.getTarget() == null)) { final L2Character monster = (L2Character) adolph.getTarget(); if ((monster != null) && adolph.isInCombat() && !CommonUtil.contains(KARTIA_FRIENDS, monster.getId())) { addAttackDesire(npc, monster); } } } } else if ((instance != null) && event.equals("USE_SKILL")) { if (npc.isInCombat() || npc.isAttackingNow() || (npc.getTarget() != null)) { if ((npc.getCurrentMpPercent() > 25) && !CommonUtil.contains(KARTIA_FRIENDS, npc.getTargetId())) { useRandomSkill(npc); } } } } public void onInstanceStatusChange(OnInstanceStatusChange event) { final Instance instance = event.getWorld(); final int status = event.getStatus(); if (status == 1) { instance.getAliveNpcs(KARTIA_HAYUK).forEach(hayuk -> getTimers().addRepeatingTimer("CHECK_ACTION", 3000, hayuk, null)); instance.getAliveNpcs(KARTIA_HAYUK).forEach(hayuk -> getTimers().addRepeatingTimer("USE_SKILL", 6000, hayuk, null)); } } @Override public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon) { if (creature.isPlayer()) { npc.getVariables().set("PLAYER_OBJECT", creature.getActingPlayer()); } else if (CommonUtil.contains(KARTIA_ADOLPH, creature.getId())) { npc.getVariables().set("ADOLPH_OBJECT", creature); } return super.onSeeCreature(npc, creature, isSummon); } public void useRandomSkill(L2Npc npc) { final Instance instance = npc.getInstanceWorld(); final L2Npc target = (L2Npc) npc.getTarget(); if ((instance != null) && !npc.isCastingNow() && (target != null) && (!CommonUtil.contains(KARTIA_FRIENDS, target.getId()))) { final StatsSet instParams = instance.getTemplateParameters(); final SkillHolder skill_01 = instParams.getSkillHolder("hayukPinpointShot"); final SkillHolder skill_02 = instParams.getSkillHolder("hayukRecoilShot"); final SkillHolder skill_03 = instParams.getSkillHolder("hayukMultipleArrow"); final int numberOfActiveSkills = 3; final int randomSkill = getRandom(numberOfActiveSkills + 1); switch (randomSkill) { case 0: case 1: { if ((skill_01 != null) && SkillCaster.checkUseConditions(npc, skill_01.getSkill())) { npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_WILL_SHOW_YOU_THE_JUSTICE_OF_ADEN); npc.doCast(skill_01.getSkill(), null, true, false); } break; } case 2: { if ((skill_02 != null) && SkillCaster.checkUseConditions(npc, skill_02.getSkill())) { npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DIE_3); npc.doCast(skill_02.getSkill(), null, true, false); } break; } case 3: { if ((skill_03 != null) && SkillCaster.checkUseConditions(npc, skill_03.getSkill())) { npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.FOR_THE_GODDESS); npc.doCast(skill_03.getSkill(), null, true, false); } break; } } } } public void onCreatureAttacked(OnCreatureAttacked event) { final L2Npc npc = (L2Npc) event.getTarget(); if (npc != null) { final Instance instance = npc.getInstanceWorld(); if ((instance != null) && !npc.isInCombat() && !event.getAttacker().isPlayable() && !CommonUtil.contains(KARTIA_FRIENDS, event.getAttacker().getId())) { npc.setTarget(event.getAttacker()); addAttackDesire(npc, (L2Character) npc.getTarget()); } } } public void onCreatureKill(OnCreatureDeath event) { final L2Npc npc = (L2Npc) event.getTarget(); final Instance world = npc.getInstanceWorld(); if (world != null) { getTimers().cancelTimersOf(npc); npc.doDie(event.getAttacker()); } } public static void main(String[] args) { new KartiaHelperHayuk(); } }
[ "conan_513@hotmail.com" ]
conan_513@hotmail.com
af59603dd4bce2eb958a2b1805f95b5a8f5e0945
7c23099374591bc68283712ad4e95f977f8dd0d2
/com/google/android/gms/internal/gb.java
1f66769d8a19d7b93f02fef1d4bdd816c0eb733d
[]
no_license
eFOIA-12/eFOIA
736af184a67de80c209c2719c8119fc260e9fe3e
e9add4119191d68f826981a42fcacdb44982ac89
refs/heads/master
2021-01-21T23:33:36.280202
2015-07-14T17:47:01
2015-07-14T17:47:01
38,971,834
0
1
null
null
null
null
UTF-8
Java
false
false
2,097
java
package com.google.android.gms.internal; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; import com.google.android.gms.internal.av; import com.google.android.gms.internal.ey; import com.google.android.gms.internal.gr; @ey public class gb { private final Object mH = new Object(); private final String vZ; private int wm = 0; private long wn = -1L; private long wo = -1L; private int wp = 0; private int wq = -1; public gb(String var1) { this.vZ = var1; } public static boolean m(Context var0) { int var1 = var0.getResources().getIdentifier("Theme.Translucent", "style", "android"); if(var1 == 0) { gr.U("Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad."); return false; } else { ComponentName var2 = new ComponentName(var0.getPackageName(), "com.google.android.gms.ads.AdActivity"); try { if(var1 == var0.getPackageManager().getActivityInfo(var2, 0).theme) { return true; } else { gr.U("Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad."); return false; } } catch (NameNotFoundException var3) { gr.W("Fail to fetch AdActivity theme"); gr.U("Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad."); return false; } } } public Bundle b(Context param1, String param2) { // $FF: Couldn't be decompiled } public void b(av param1, long param2) { // $FF: Couldn't be decompiled } public void cW() { // $FF: Couldn't be decompiled } public void cX() { // $FF: Couldn't be decompiled } public long dq() { return this.wo; } }
[ "guest@example.edu" ]
guest@example.edu
c9571c8f90da139bde16d6099df598256d40b4dd
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_42007.java
16370ad5b7b23c2168996b27461cb8b6286c4732
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,743
java
private void toggleEnabledChild(boolean enable){ findViewById(R.id.ll_security_body_apply_hidden).setEnabled(enable); findViewById(R.id.ll_security_body_apply_delete).setClickable(enable); findViewById(R.id.ll_active_security_fingerprint).setClickable(enable); if (enable) { ((ThemedIcon)findViewById(org.horaapps.leafpic.R.id.security_body_apply_hidden_icon)).setColor(getIconColor()); ((TextView)findViewById(org.horaapps.leafpic.R.id.security_body_apply_hidden_title)).setTextColor(getTextColor()); ((ThemedIcon)findViewById(org.horaapps.leafpic.R.id.security_body_apply_delete_icon)).setColor(getIconColor()); ((TextView)findViewById(org.horaapps.leafpic.R.id.security_body_apply_delete_title)).setTextColor(getTextColor()); ((ThemedIcon)findViewById(org.horaapps.leafpic.R.id.active_security_fingerprint_icon)).setColor(getIconColor()); ((TextView)findViewById(org.horaapps.leafpic.R.id.active_security_fingerprint_item_title)).setTextColor(getTextColor()); } else { ((ThemedIcon)findViewById(org.horaapps.leafpic.R.id.security_body_apply_hidden_icon)).setColor(getSubTextColor()); ((TextView)findViewById(org.horaapps.leafpic.R.id.security_body_apply_hidden_title)).setTextColor(getSubTextColor()); ((ThemedIcon)findViewById(org.horaapps.leafpic.R.id.security_body_apply_delete_icon)).setColor(getSubTextColor()); ((TextView)findViewById(org.horaapps.leafpic.R.id.security_body_apply_delete_title)).setTextColor(getSubTextColor()); ((ThemedIcon)findViewById(org.horaapps.leafpic.R.id.active_security_fingerprint_icon)).setColor(getSubTextColor()); ((TextView)findViewById(org.horaapps.leafpic.R.id.active_security_fingerprint_item_title)).setTextColor(getSubTextColor()); } }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
a10d6afb1316d9fc656953ed111230f8e5917462
366b894b7555c6c5cec1c528a53ec9637737a232
/Softtechjava/src/com/softtech/java/training/annotations/property/ApplicationProperties.java
2cc913887a2602636f9598a748adb8e4e4b9d1d0
[]
no_license
osmanyaycioglu/softtech2
417a436720156278b6eb16c98fd341d1f866bdf3
7f76f752f8c43f68391f97a261090a1fc6dab90f
refs/heads/master
2022-12-26T06:33:45.489567
2020-10-02T14:26:28
2020-10-02T14:26:28
299,283,828
2
0
null
null
null
null
UTF-8
Java
false
false
1,240
java
package com.softtech.java.training.annotations.property; @PropertyFile("app.properties") public class ApplicationProperties { @Property(key = "app.appName") private String appName; @Property(key = "app.host") private String host; @Property(key = "app.port") private int port; @Property(key = "app.threadCount") private int threadCount; @Property(key = "app.test") private String test; public String getAppName() { return this.appName; } public void setAppName(final String appNameParam) { this.appName = appNameParam; } public String getHost() { return this.host; } public void setHost(final String hostParam) { this.host = hostParam; } public int getPort() { return this.port; } public void setPort(final int portParam) { this.port = portParam; } public int getThreadCount() { return this.threadCount; } public void setThreadCount(final int threadCountParam) { this.threadCount = threadCountParam; } public String getTest() { return this.test; } public void setTest(final String testParam) { this.test = testParam; } }
[ "osman.yaycioglu@gmail.com" ]
osman.yaycioglu@gmail.com
a0f06463490fb63c974c69241a1d276a030896ce
e486128983b8d60c3921e94fdc250c6330e5a1dc
/jsp_project/First_Web/src/main/java/member/Member.java
314b54bf29baa9f47eab176f025504abe4afb540
[]
no_license
Ellie-Jung/java205
ee15740ca6b0335fe712d748f920bb7c992533e8
2fb163f71fa09db2c4e453c9967d594469301d28
refs/heads/main
2023-08-18T20:17:56.109671
2021-10-06T09:41:00
2021-10-06T09:41:00
370,221,944
0
1
null
null
null
null
UTF-8
Java
false
false
894
java
package member; //빈즈 클래스 생성 public class Member { //변수는 모두 private처리 private String id; private String pw; private String name; //beans 클래스는 기본생성자 필수! public Member(){} public Member(String name){} //디폴트 생성자가 없는 상태해서 실행해보면 오류생긴다. public Member(String id, String pw, String name) { this.id = id; this.pw = pw; this.name = name; } //setter public void setId(String id) { this.id = id; } //getter public String getId() { return this.id; } public void setPw(String pw) { this.pw=pw; } public String getPw() { return this.pw; } public void setName(String name) { this.name= name; } public String getName() { return this.name; } @Override public String toString() { return "Member [id=" + id + ", pw=" + pw + ", name=" + name + "]"; } }
[ "jssoyeon@gmail.com" ]
jssoyeon@gmail.com
8700a9799111800638928b041ba1b56315855e1d
49744e4c91d519e12d7985383af5575460899a90
/bak/faceye-stock-manager/src/template/project/src/main/java/com/faceye/component/generate/service/impl/ComponentServiceImpl.java
499ef0a069769f34354c79be27d4495509ddc1d7
[]
no_license
haipenge/faceye-stock
b179a367d064a2c3823b1177900de45cca966ef7
f6e6b3d9c92dde0466877d20010ef1e5d934fb16
refs/heads/master
2021-07-09T06:42:18.151541
2019-06-03T09:38:55
2019-06-03T09:38:55
73,882,158
2
0
null
2020-10-12T19:19:48
2016-11-16T03:56:23
Java
UTF-8
Java
false
false
811
java
package com.faceye.component.generate.service.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.faceye.component.generate.entity.Component; import com.faceye.component.generate.repository.mongo.ComponentRepository; import com.faceye.component.generate.service.ComponentService; import com.faceye.feature.service.impl.BaseMongoServiceImpl; /** * Component 服务实现类<br> * @author @haipenge <br> * haipenge@gmail.com<br> * Create Date:2014年5月20日<br> */ @Service public class ComponentServiceImpl extends BaseMongoServiceImpl<Component, Long, ComponentRepository> implements ComponentService { @Autowired public ComponentServiceImpl(ComponentRepository dao) { super(dao); } }/**@generate-service-source@**/
[ "haipenge@gmail.com" ]
haipenge@gmail.com
9dae3b8e65b35890f6f5ccd40c48c130a2afdb02
ea16aa0fa650ad746c3dc5d4df72c0f586fd17cf
/app/src/main/java/com/d2956987215/mow/dialog/SettingPasswordDialog.java
f96623c423f7ea17dccf2513f86e0c4b7b6ff01f
[]
no_license
lkxiaojian/msmm
78886e30f1b6873154a2bd2b4e10441abd62f061
3ad336e194e5dffcf1a45de1f9d333446cf50f46
refs/heads/master
2022-01-23T16:32:05.449911
2019-07-24T03:17:41
2019-07-24T03:17:41
198,366,675
0
1
null
null
null
null
UTF-8
Java
false
false
1,194
java
package com.d2956987215.mow.dialog; import android.app.Activity; import android.content.Context; import android.view.View; import android.widget.TextView; import com.d2956987215.mow.R; public class SettingPasswordDialog extends BaseDialog implements View.OnClickListener { private Activity activity; private TextView tv_quxiao, tv_queding; CallBack callback; public SettingPasswordDialog(Context context, CallBack callBack) { super(context); this.callback = callBack; activity = (Activity) context; init(); } private void init() { setContentView(R.layout.ml_dialog_setting_pwd); tv_quxiao = findViewById(R.id.tv_quxiao); tv_queding = findViewById(R.id.tv_queding); tv_quxiao.setOnClickListener(this); tv_queding.setOnClickListener(this); } @Override public void onClick(View v) { dismiss(); switch (v.getId()) { case R.id.quxiao: callback.qx(); break; case R.id.tv_queding: callback.NO(); } } public interface CallBack { void NO(); void qx(); } }
[ "18513075404@163.com" ]
18513075404@163.com
03a28255c1b79317f651b88b5f4d11e8b0d56ab4
db86ad13bcef5aa6401a989621f2cc2bb199892e
/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/resources/RefHeaderResource.java
dce896ecc3a3cad56d43712c8aaa7d501672b730
[ "Apache-2.0" ]
permissive
fabianvo/swagger-core
8619839b45654de0cbb0cc08d586e08d80de43f2
4993709d403ba76225bd1489bcc2b3d91b44b523
refs/heads/master
2021-04-18T15:42:24.642246
2021-03-31T09:23:45
2021-03-31T09:23:45
249,558,793
0
1
Apache-2.0
2021-03-31T07:32:48
2020-03-23T22:33:11
null
UTF-8
Java
false
false
1,193
java
package io.swagger.v3.jaxrs2.resources; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.headers.Header; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import javax.ws.rs.GET; import javax.ws.rs.Path; /** * Class with Links */ public class RefHeaderResource { @Operation( summary = "Simple get operation", description = "Defines a simple get operation with no inputs and a complex output", operationId = "getWithPayloadResponse", deprecated = true, responses = { @ApiResponse( responseCode = "200", description = "voila!", headers = {@Header( name = "Rate-Limit-Limit", description = "The number of allowed requests in the current period", ref = "Header", schema = @Schema(type = "integer"))}) }) @GET @Path("/path") public void simpleGet() { } }
[ "frantuma@yahoo.com" ]
frantuma@yahoo.com
cf2ad27e43be249a405e3a9698148faf109fde41
b49ee04177c483ab7dab6ee2cd3cabb44a159967
/medicineDaChen/src/main/java/com/dachen/medicine/entity/DepartmentEntity.java
e512fcfb373f267c71fa05154af7770fce94a011
[]
no_license
butaotao/MedicineProject
8a22a98a559005bb95fee51b319535b117f93d5d
8e57c1e0ee0dac2167d379edd9d97306b52d3165
refs/heads/master
2020-04-09T17:29:36.570453
2016-09-13T09:17:05
2016-09-13T09:17:05
68,094,294
0
1
null
null
null
null
UTF-8
Java
false
false
396
java
package com.dachen.medicine.entity; public class DepartmentEntity { String name; int id; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getId() { return id; } public void setId(int id) { this.id = id; } @Override public String toString() { return "DepartmentEntity [name=" + name + ", id=" + id + "]"; } }
[ "1802928215@qq.com" ]
1802928215@qq.com
fd19a8795d68bcfbca741ab24ea9c1c6664aa2f6
128da67f3c15563a41b6adec87f62bf501d98f84
/com/emt/proteus/duchampopt/__tcf_413695.java
df99f7340be6a7f5217dbfb94949d9983cc03f13
[]
no_license
Creeper20428/PRT-S
60ff3bea6455c705457bcfcc30823d22f08340a4
4f6601fb0dd00d7061ed5ee810a3252dcb2efbc6
refs/heads/master
2020-03-26T03:59:25.725508
2018-08-12T16:05:47
2018-08-12T16:05:47
73,244,383
0
0
null
null
null
null
UTF-8
Java
false
false
1,644
java
/* */ package com.emt.proteus.duchampopt; /* */ /* */ import com.emt.proteus.runtime.api.Env; /* */ import com.emt.proteus.runtime.api.Frame; /* */ import com.emt.proteus.runtime.api.Function; /* */ import com.emt.proteus.runtime.api.ImplementedFunction; /* */ import com.emt.proteus.runtime.library.strings._ZNSsD1Ev; /* */ /* */ public final class __tcf_413695 extends ImplementedFunction /* */ { /* */ public static final int FNID = 1251; /* 12 */ public static final Function _instance = new __tcf_413695(); /* 13 */ public final Function resolve() { return _instance; } /* */ /* 15 */ public __tcf_413695() { super("__tcf_413695", 1, false); } /* */ /* */ public int execute(int paramInt) /* */ { /* 19 */ call(paramInt); /* 20 */ return 0; /* */ } /* */ /* */ public int execute(Env paramEnv, Frame paramFrame, int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt, int paramInt4) /* */ { /* 25 */ int i = paramFrame.getI32(paramArrayOfInt[paramInt4]); /* 26 */ paramInt4 += 2; /* 27 */ paramInt3--; /* 28 */ call(i); /* 29 */ return paramInt4; /* */ } /* */ /* */ /* */ /* */ /* */ public static void call(int paramInt) /* */ { /* */ try /* */ { /* 39 */ _ZNSsD1Ev.call(466116); /* 40 */ return; /* */ } /* */ finally {} /* */ } /* */ } /* Location: /home/jkim13/Desktop/emediatrack/codejar_s.jar!/com/emt/proteus/duchampopt/__tcf_413695.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "kimjoey79@gmail.com" ]
kimjoey79@gmail.com
da61f5896e4fdd658e7910fe19f17b1f33b8a293
59e6dc1030446132fb451bd711d51afe0c222210
/components/appmgt/org.wso2.carbon.appmgt.impl/1.2.1/src/main/java/org/wso2/carbon/appmgt/impl/template/APITemplateBuilderImpl.java
5280a8d0e9455310e37135fa085456da9b99db58
[]
no_license
Alsan/turing-chunk07
2f7470b72cc50a567241252e0bd4f27adc987d6e
e9e947718e3844c07361797bd52d3d1391d9fb5e
refs/heads/master
2020-05-26T06:20:24.554039
2014-02-07T12:02:53
2014-02-07T12:02:53
38,284,349
0
1
null
null
null
null
UTF-8
Java
false
false
4,394
java
/* * Copyright WSO2 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 org.wso2.carbon.appmgt.impl.template; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.util.AXIOMUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; import org.wso2.carbon.appmgt.api.model.WebApp; import org.wso2.carbon.appmgt.impl.dto.Environment; import javax.xml.stream.XMLStreamException; import java.io.File; import java.io.StringWriter; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * Constructs WebApp and resource configurations for the ESB/Synapse using a Apache velocity * templates. */ public class APITemplateBuilderImpl implements APITemplateBuilder { private static final Log log = LogFactory.getLog(APITemplateBuilderImpl.class); public static final String TEMPLATE_TYPE_VELOCITY = "velocity_template"; private WebApp api; private List<HandlerConfig> handlers = new ArrayList<HandlerConfig>(); public APITemplateBuilderImpl(WebApp api) { this.api = api; } @Override public String getConfigStringForTemplate(Environment environment) throws APITemplateException { StringWriter writer = new StringWriter(); try { // build the context for template and apply the necessary decorators ConfigContext configcontext = new APIConfigContext(this.api); configcontext = new TransportConfigContext(configcontext, api); configcontext = new ResourceConfigContext(configcontext, api); // this should be initialised before endpoint config context. // configcontext = new EndpointBckConfigContext(configcontext,api); // configcontext = new EndpointConfigContext(configcontext, api); configcontext = new EndpointURIConfigContext(configcontext, api); configcontext = new SecurityConfigContext(configcontext, api); configcontext = new JwtConfigContext(configcontext); configcontext = new ResponseCacheConfigContext(configcontext, api); configcontext = new HandlerConfigContex(configcontext, handlers); configcontext = new EnvironmentConfigContext(configcontext, environment); configcontext = new TemplateUtilContext(configcontext); // @todo: this validation might be better to do when the builder is // initialized. configcontext.validate(); VelocityContext context = configcontext.getContext(); /* first, initialize velocity engine */ VelocityEngine velocityengine = new VelocityEngine(); velocityengine.init(); Template t = velocityengine.getTemplate(this.getTemplatePath()); t.merge(context, writer); } catch (Exception e) { log.error("Velocity Error", e); throw new APITemplateException("Velocity Error", e); } return writer.toString(); } @Override public OMElement getConfigXMLForTemplate(Environment environment) throws APITemplateException { try { return AXIOMUtil.stringToOM(getConfigStringForTemplate(environment)); } catch (XMLStreamException e) { String msg = "Error converting string to OMElement - String: " + getConfigStringForTemplate(environment); log.error(msg, e); throw new APITemplateException(msg, e); } } public void addHandler(String handlerName, Map<String, String> properties) { addHandlerPriority(handlerName, properties, handlers.size()); } public void addHandlerPriority(String handlerName, Map<String, String> properties, int priority) { HandlerConfig handler = new HandlerConfig(handlerName, properties); handlers.add(priority, handler); } public String getTemplatePath() { return "repository" + File.separator + "resources" + File.separator + "api_templates" + File.separator + APITemplateBuilderImpl.TEMPLATE_TYPE_VELOCITY + ".xml"; } }
[ "malaka@wso2.com" ]
malaka@wso2.com
6979784fa4e942f26b5f1ce297813344d349dca0
bccb412254b3e6f35a5c4dd227f440ecbbb60db9
/hl7/pseudo/group/PERSONNEL_RESOURCE_SRR_S07.java
f9c84bce97007316a858cc231a2d177125927ef9
[]
no_license
nlp-lap/Version_Compatible_HL7_Parser
8bdb307aa75a5317265f730c5b2ac92ae430962b
9977e1fcd1400916efc4aa161588beae81900cfd
refs/heads/master
2021-03-03T15:05:36.071491
2020-03-09T07:54:42
2020-03-09T07:54:42
245,967,680
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package hl7.pseudo.group; import hl7.bean.Structure; public class PERSONNEL_RESOURCE_SRR_S07 extends hl7.model.V2_3.group.PERSONNEL_RESOURCE_SRR_S07{ public PERSONNEL_RESOURCE_SRR_S07(){ super(); } public static PERSONNEL_RESOURCE_SRR_S07 CLASS; static{ CLASS = new PERSONNEL_RESOURCE_SRR_S07(); } public Structure[][] getComponents(){ return super.getComponents(); } }
[ "terminator800@hanmail.net" ]
terminator800@hanmail.net
fc13b1c6e67e371ba80e0b5b66899e05e635d163
982f6c3a3c006d2b03f4f53c695461455bee64e9
/src/main/java/com/alipay/api/response/AnttechAiCvOcrVatinvoiceIdentifyResponse.java
c648a26f00eeaa8951ca05bef08d0a804aa053de
[ "Apache-2.0" ]
permissive
zhaomain/Alipay-Sdk
80ffc0505fe81cc7dd8869d2bf9a894b823db150
552f68a2e7c10f9ffb33cd8e0036b0643c7c2bb3
refs/heads/master
2022-11-15T03:31:47.418847
2020-07-09T12:18:59
2020-07-09T12:18:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,540
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: anttech.ai.cv.ocr.vatinvoice.identify response. * * @author auto create * @since 1.0, 2020-06-05 16:20:12 */ public class AnttechAiCvOcrVatinvoiceIdentifyResponse extends AlipayResponse { private static final long serialVersionUID = 6474738381111884299L; /** * 算法错误信息 */ @ApiField("algo_msg") private String algoMsg; /** * 算法异常错误码 */ @ApiField("algo_ret") private String algoRet; /** * 框架错误信息 */ @ApiField("message") private String message; /** * 算法结果,JSON String */ @ApiField("result") private String result; /** * 框架inference服务错误码,0为正常 */ @ApiField("ret") private String ret; public void setAlgoMsg(String algoMsg) { this.algoMsg = algoMsg; } public String getAlgoMsg( ) { return this.algoMsg; } public void setAlgoRet(String algoRet) { this.algoRet = algoRet; } public String getAlgoRet( ) { return this.algoRet; } public void setMessage(String message) { this.message = message; } public String getMessage( ) { return this.message; } public void setResult(String result) { this.result = result; } public String getResult( ) { return this.result; } public void setRet(String ret) { this.ret = ret; } public String getRet( ) { return this.ret; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
1557bd7bee6e559c63aea01f8b6255b9e9170750
5142a8986e7a80420357a7f1b1bbfdf94ad02767
/hybris-commerce-suite-5.5.1.2/hybris/bin/ext-commerce/basecommerce/testsrc/de/hybris/platform/orderprocessing/OrderFulfillmentProcessServiceTest.java
95a62a5cc0ee10312855ca0a4837274da388884e
[]
no_license
gerardoram/research1
613ef2143ba60a440bb577362bcf1ce2a646664b
2a4515e3f8901f0b3b510653d61dac059c6521a8
refs/heads/master
2020-05-20T17:04:39.574621
2015-06-23T17:53:26
2015-06-23T17:53:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,852
java
/* * [y] hybris Platform * * Copyright (c) 2000-2015 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with hybris. * * */ package de.hybris.platform.orderprocessing; import de.hybris.basecommerce.jalo.AbstractOrderManagementTest; import de.hybris.platform.orderprocessing.model.OrderProcessModel; import de.hybris.platform.processengine.impl.BusinessProcessServiceDao; import de.hybris.platform.processengine.model.BusinessProcessModel; import de.hybris.platform.servicelayer.model.ModelService; import java.util.Date; import javax.annotation.Resource; import junit.framework.Assert; import org.apache.log4j.Logger; import org.junit.Before; import org.junit.Test; /** * Test is strongly time related and need to be rewritten */ public class OrderFulfillmentProcessServiceTest extends AbstractOrderManagementTest { private static final Logger LOG = Logger.getLogger(OrderFulfillmentProcessServiceTest.class); @Resource private OrderFulfillmentProcessService orderFulfillmentProcessService; @Resource private BusinessProcessServiceDao businessProcessServiceDao; @Resource private ModelService modelService; @Override @Before public void setUp() throws Exception { super.setUp(); } /** * Tests proper launch of business process for a given order * * @throws Exception */ @Test public void testStartFulfillmentProcess() throws Exception { final OrderProcessModel process = orderFulfillmentProcessService.startFulfillmentProcessForOrder(order); process.getCode(); final BusinessProcessModel bussinessProcess = businessProcessServiceDao.getProcess(process.getCode()); Assert.assertEquals("OrderProcess is not as expected", process, bussinessProcess); Assert.assertEquals("Order related to process is not as expected", order, ((OrderProcessModel) bussinessProcess).getOrder()); final Date start = new Date(); //maximum waiting time limited to 40 sec. long seconds = 0; while (!isFinished(bussinessProcess) && seconds < 40) { Thread.sleep(100); modelService.refresh(bussinessProcess); seconds = (new Date().getTime() - start.getTime()) / 1000; LOG.info("sec: " + seconds); } if (seconds >= 40) { // businessProcess didn't end properly Assert.fail("Business Process did not end properly within 40 seconds!"); } } @Override public Logger getLogger() { return LOG; } private boolean isFinished(final BusinessProcessModel process) { switch (process.getState()) { case SUCCEEDED: return true; case FAILED: return true; case ERROR: return true; default: return false; } } }
[ "thaisonnguyenbt@gmail.com" ]
thaisonnguyenbt@gmail.com
46ea287ac2f41ffbdc6429797a0c2c35e5fa1b84
a793d0ec2ac7f77da121f63738e43a54e171dbf8
/mybatis_day04_8_ann_dynamicSql/src/main/java/com/itheima/domain/Account.java
2ddd8e2199f2607ca0070aca4df76bcb42e19a4d
[]
no_license
Jasonpyt/project_335
c60f22da50ca18a7ffd8155c4bc640ec1367fe2d
160d5eb9145a94efd53ca48e2d6bed80d1780de3
refs/heads/master
2020-04-30T14:33:51.701190
2019-03-21T07:44:08
2019-03-21T07:44:08
176,894,447
0
0
null
null
null
null
UTF-8
Java
false
false
1,073
java
package com.itheima.domain; /** * @author 黑马程序员 * @Company http://www.ithiema.com * @Version 1.0 */ public class Account { private Integer id; private String accountName; private Integer userId; // 一个账户对应一个用户 private User user; public User getUser() { return user; } public void setUser(User user) { this.user = user; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getAccountName() { return accountName; } public void setAccountName(String accountName) { this.accountName = accountName; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } @Override public String toString() { return "Account{" + "id=" + id + ", accountName='" + accountName + '\'' + ", userId=" + userId + '}'; } }
[ "346785150@qq.com" ]
346785150@qq.com
11c8457040d1277c7d7a4b67e4eedb5c2c1fa458
6ca93af58a6bc9e41d6d753240345ab78dce4daf
/org.dbdoclet.tidbit.package/test/dbdoclet/java/org/dbdoclet/test/tokenizer/CommentTests.java
3d1a03cb358f08781ba994fb27a4fb30f0874e17
[]
no_license
mfuchs23/dodo
a33a319c1701c7e94f0ef0cd04fe3a5dc589afb0
e47eb2ea463db021302248ea0dc17ff367e96880
refs/heads/master
2021-01-20T01:59:04.343254
2015-05-28T06:52:37
2015-05-28T06:52:37
37,484,721
0
0
null
null
null
null
UTF-8
Java
false
false
3,242
java
/* * ### Copyright (C) 2001-2003 Michael Fuchs ### * * 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. * * Author: Michael Fuchs * E-Mail: mfuchs@unico-consulting.com * * RCS Information: * --------------- * Id.........: $Id: CommentTests.java,v 1.1.1.1 2004/12/21 14:00:06 mfuchs Exp $ * Author.....: $Author: mfuchs $ * Date.......: $Date: 2004/12/21 14:00:06 $ * Revision...: $Revision: 1.1.1.1 $ * State......: $State: Exp $ */ package org.dbdoclet.test.tokenizer; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.dbdoclet.log.Logger; import org.dbdoclet.tokenizer.MLToken; import org.dbdoclet.tokenizer.MLTokenizer; public class CommentTests extends TestCase { private static Log logger = LogFactory.getLog(CommentTests.class); public CommentTests(String name) { super(name); } public static Test suite() { return new TestSuite(CommentTests.class); } public void testComment1() throws Exception { String code = "<!-- Kommentar -->"; MLTokenizer tokenizer = new MLTokenizer(code); MLToken token = null; while (tokenizer.hasNext()) { token = tokenizer.next(); logger.debug("token=" + token.getToken()); } // end of while () } public void testComment2() throws Exception { String code = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n" + "<p>Paragraph 1</p>\n" + "<!-- <p>This is a comment\n" + "with a nested paragraph.\n" + "-->\n" + "<p>Paragraph 2</p>"; MLTokenizer tokenizer = new MLTokenizer(code); MLToken token = null; while (tokenizer.hasNext()) { token = tokenizer.next(); logger.debug("token=" + token.getToken()); } // end of while () } static public void main(String[] args) { junit.textui.TestRunner.run(suite()); } } /* * $Log: CommentTests.java,v $ * Revision 1.1.1.1 2004/12/21 14:00:06 mfuchs * Reimport * * Revision 1.2 2004/10/05 13:13:18 mfuchs * Sicherung * * Revision 1.1.1.1 2004/02/17 22:49:30 mfuchs * dbdoclet * * Revision 1.1.1.1 2004/01/05 14:57:04 cvs * dbdoclet * * Revision 1.1.1.1 2003/08/01 13:19:22 cvs * DocBook Doclet * * Revision 1.1.1.1 2003/07/31 17:05:40 mfuchs * DocBook Doclet since 0.46 * * Revision 1.1.1.1 2003/05/30 11:09:40 mfuchs * dbdoclet * * Revision 1.1.1.1 2003/03/18 07:41:37 mfuchs * DocBook Doclet 0.40 * * Revision 1.1.1.1 2003/03/17 20:51:36 cvs * dbdoclet * */
[ "michael.fuchs@dbdoclet.org" ]
michael.fuchs@dbdoclet.org
72522ccbbca9bbe399442be324f6c7af95cb2b94
c62ddcd27b0c259fd77c19b2c10af12f832ab5ef
/xungen/src/main/java/com/ruihuo/ixungen/activity/chatactivity/DiscussionFormAdapter.java
06183a5cf2e1c594277b1f97bc23a8746f575f53
[]
no_license
yudonghui/ixungen
f759d0059a4b5d64e877d0518d76c4210980c119
e1e2bd9ae1d5719cd66e91404f206efc060fd25d
refs/heads/master
2020-04-16T18:20:31.172362
2019-01-15T08:48:57
2019-01-15T08:48:57
165,815,142
0
0
null
null
null
null
UTF-8
Java
false
false
4,057
java
package com.ruihuo.ixungen.activity.chatactivity; import android.content.Context; import android.graphics.drawable.Drawable; import android.net.Uri; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.ruihuo.ixungen.R; import com.ruihuo.ixungen.common.DownloadImageTask; import com.ruihuo.ixungen.view.CompositionAvatarView; import java.util.List; import io.rong.imkit.RongIM; import io.rong.imkit.userInfoCache.RongUserInfoManager; import io.rong.imlib.RongIMClient; import io.rong.imlib.model.Discussion; import io.rong.imlib.model.UserInfo; /** * @author yudonghui * @date 2017/9/8 * @describe May the Buddha bless bug-free!!! */ public class DiscussionFormAdapter extends RecyclerView.Adapter<DiscussionFormAdapter.ViewHolder> { List<DiscussionFormBean.DataBean> dataList; private Context mContext; public DiscussionFormAdapter(List<DiscussionFormBean.DataBean> dataList, Context mContext) { this.dataList = dataList; this.mContext = mContext; } @Override public int getItemCount() { return dataList == null ? 0 : dataList.size(); } @Override public DiscussionFormAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_discussion_form, parent, false); return new ViewHolder(inflate); } @Override public void onBindViewHolder(ViewHolder holder, int position) { holder.itemView.setTag(position); holder.setData(dataList.get(position)); } class ViewHolder extends RecyclerView.ViewHolder { private CompositionAvatarView mAvatar; private TextView mName; private TextView mDelete; private TextView mNumber; public ViewHolder(View itemView) { super(itemView); mAvatar = (CompositionAvatarView) itemView.findViewById(R.id.avatar); mName = (TextView) itemView.findViewById(R.id.name); mDelete = (TextView) itemView.findViewById(R.id.delete); mNumber = (TextView) itemView.findViewById(R.id.number); } public void setData(DiscussionFormBean.DataBean dataBean) { String group_id = dataBean.getGroup_id(); mAvatar.clearDrawable(); RongIM.getInstance().getDiscussion(group_id, new RongIMClient.ResultCallback<Discussion>() { @Override public void onSuccess(Discussion discussion) { String name = discussion.getName(); mName.setText(TextUtils.isEmpty(name) ? "" : name); List<String> memberIdList = discussion.getMemberIdList(); mNumber.setText("(" + memberIdList.size() + ")"); for (int i = 0; i < memberIdList.size(); i++) { final String rid = memberIdList.get(i); UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(rid); if (userInfo != null) { Uri portraitUri = userInfo.getPortraitUri(); new DownloadImageTask(new DownloadImageTask.InterfaceDrawable() { @Override public void callBack(Drawable drawable) { if (drawable == null) drawable = mContext.getResources().getDrawable(R.mipmap.default_header); mAvatar.addDrawable(Integer.parseInt(rid),drawable); } }).execute(portraitUri.toString()); } } } @Override public void onError(RongIMClient.ErrorCode errorCode) { } }); } } }
[ "yudonghui@51caixiang.com" ]
yudonghui@51caixiang.com
eec8e9aec018087f09910a72a3a18f489215012d
fde8954411245ced754cf84e742d95f928b3ecbf
/src/main/java/com/sensei/search/nodes/SenseiCore.java
805784e35d3421f3c20fab80b232068a09ef0ff0
[]
no_license
xiaoyang/sensei
7d089b705b9c693ad7a29f03d663dfa551fdd575
d6d565d9cd5eb02301a92042f14e96afaab16eb6
refs/heads/master
2021-01-20T21:59:12.542719
2011-04-09T08:12:32
2011-04-09T08:12:32
533,081
1
0
null
null
null
null
UTF-8
Java
false
false
4,651
java
package com.sensei.search.nodes; import java.io.File; import java.io.FilenameFilter; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import javax.management.InstanceAlreadyExistsException; import javax.management.MBeanServer; import javax.management.ObjectName; import org.apache.log4j.Logger; import proj.zoie.api.IndexReaderFactory; import proj.zoie.api.Zoie; import proj.zoie.api.ZoieIndexReader; import com.browseengine.bobo.api.BoboIndexReader; public class SenseiCore{ private static final Logger logger = Logger.getLogger(SenseiServer.class); private final MBeanServer mbeanServer = java.lang.management.ManagementFactory.getPlatformMBeanServer(); private final List<ObjectName> _registeredMBeans; private SenseiZoieFactory<?,?> _zoieFactory; private SenseiIndexingManager _indexManager; private SenseiQueryBuilderFactory _queryBuilderFactory; private final HashSet<Zoie<BoboIndexReader,?,?>> zoieSystems = new HashSet<Zoie<BoboIndexReader,?,?>>(); private final int[] _partitions; private final int _id; private final Map<Integer,SenseiQueryBuilderFactory> _builderFactoryMap; private final Map<Integer,Zoie<BoboIndexReader,?,?>> _readerFactoryMap; private volatile boolean _started; public SenseiCore(int id,int[] partitions, SenseiZoieFactory<?,?> zoieSystemFactory, SenseiIndexingManager indexManager, SenseiQueryBuilderFactory queryBuilderFactory){ _registeredMBeans = new LinkedList<ObjectName>(); _zoieFactory = zoieSystemFactory; _indexManager = indexManager; _queryBuilderFactory = queryBuilderFactory; _partitions = partitions; _id = id; _builderFactoryMap = new HashMap<Integer,SenseiQueryBuilderFactory>(); _readerFactoryMap = new HashMap<Integer,Zoie<BoboIndexReader,?,?>>(); _started = false; } public int getNodeId(){ return _id; } public int[] getPartitions(){ return _partitions; } public void start() throws Exception{ if (_started) return; for (int part : _partitions){ //in simple case query builder is the same for each partition _builderFactoryMap.put(part, _queryBuilderFactory); Zoie<BoboIndexReader,?,?> zoieSystem = _zoieFactory.getZoieInstance(_id,part); // register ZoieSystemAdminMBean String[] mbeannames = zoieSystem.getStandardMBeanNames(); for(String name : mbeannames) { ObjectName oname = new ObjectName("SenseiCore", "name", name + "-" + _id+"-"+part); try { mbeanServer.registerMBean(zoieSystem.getStandardMBean(name), oname); _registeredMBeans.add(oname); logger.info("registered mbean " + oname); } catch(Exception e) { logger.error(e.getMessage(),e); if (e instanceof InstanceAlreadyExistsException) { _registeredMBeans.add(oname); } } } if(!zoieSystems.contains(zoieSystem)) { zoieSystem.start(); zoieSystems.add(zoieSystem); } _readerFactoryMap.put(part, zoieSystem); } logger.info("initializing index manager..."); _indexManager.initialize(_readerFactoryMap); logger.info("starting index manager..."); _indexManager.start(); logger.info("index manager started..."); _started = true; } public void shutdown(){ if (!_started) return; logger.info("unregistering mbeans..."); try{ if (_registeredMBeans.size()>0){ for (ObjectName name : _registeredMBeans){ mbeanServer.unregisterMBean(name); } _registeredMBeans.clear(); } } catch(Exception e){ logger.error(e.getMessage(),e); } // shutdown the index manager logger.info("shutting down index manager..."); _indexManager.shutdown(); logger.info("index manager shutdown..."); // shutdown the zoieSystems for(Zoie<BoboIndexReader,?,?> zoieSystem : zoieSystems) { zoieSystem.shutdown(); } zoieSystems.clear(); _started =false; } public IndexReaderFactory<ZoieIndexReader<BoboIndexReader>> getIndexReaderFactory(int partition){ return _readerFactoryMap.get(partition); } public SenseiQueryBuilderFactory getQueryBuilderFactory(int partition){ return _builderFactoryMap.get(partition); } }
[ "john.wang@gmail.com" ]
john.wang@gmail.com
b387b0a1f0f8393b775e79326f91513ab7c752e9
1bfbdd1cebe5201baca9ad5ff4e05874cfee546a
/src/main/java/com/jtt/websocket/WebSocketHandShakeInterceptor.java
fca1e205ad9d5bec6537456514ad1a6c08ca9f26
[]
no_license
challengerzsz/Simple-Im-Server
a6cbc8e99c6636415cd119963e85ffbceba97e98
391a03743c04d2fcadc92c1b999e3b71c0b549d8
refs/heads/master
2020-06-13T07:16:53.201564
2019-07-03T20:19:39
2019-07-03T20:19:39
194,583,283
0
0
null
null
null
null
UTF-8
Java
false
false
2,359
java
package com.jtt.websocket; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.http.server.ServerHttpRequest; import org.springframework.http.server.ServerHttpResponse; import org.springframework.http.server.ServletServerHttpRequest; import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.server.HandshakeFailureException; import org.springframework.web.socket.server.HandshakeHandler; import org.springframework.web.socket.server.HandshakeInterceptor; import javax.servlet.http.HttpServletRequest; import java.util.Map; import java.util.concurrent.atomic.AtomicLong; import static com.jtt.app.controller.UserController.UID_TOKEN_PREFIX; /** * @author : zengshuaizhi * @date : 2019-06-30 13:29 */ @Slf4j @Component public class WebSocketHandShakeInterceptor implements HandshakeInterceptor { @Autowired private RedisTemplate redisTemplate; /** * 握手处理 鉴权过程 * * @param request * @param response * @param wsHandler * @param attributes * @return * @throws HandshakeFailureException */ @Override public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception { log.info("A new websocket handshake is running , processing ..."); ServletServerHttpRequest httpRequest = (ServletServerHttpRequest) request; Long uid = Long.valueOf(httpRequest.getServletRequest().getParameter("uid")); String token = httpRequest.getServletRequest().getParameter("token"); if (!StringUtils.isEmpty(token) && !StringUtils.isEmpty(uid)) { String tokenInRedis = (String) redisTemplate.opsForHash().get(UID_TOKEN_PREFIX, uid); if (token.equals(tokenInRedis)) { return true; } } return false; } @Override public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception exception) { log.info("A new websocket handshake is successfully ! "); } }
[ "challengerzsz@126.com" ]
challengerzsz@126.com
84495deab19158c2c0ebf864a08e6c185024388c
511a5e5b585be029dc61dd95390c812027c2413b
/newapp/src/main/java/com/tzpt/cloudlibrary/utils/badger/impl/ZTEHomeBadger.java
c50e31e97b81b7d11579adfa4ac43851a61ab1a5
[]
no_license
MengkZhang/ebook
60733cff344dd906c20ec657d95e4fa4d0789cf5
109101ebad3e8e5274e758c786013aab650c3ff1
refs/heads/master
2020-05-07T09:56:05.996761
2019-04-09T15:17:10
2019-04-09T15:17:10
180,392,558
4
1
null
null
null
null
UTF-8
Java
false
false
1,031
java
package com.tzpt.cloudlibrary.utils.badger.impl; import android.content.ComponentName; import android.content.Context; import android.net.Uri; import android.os.Bundle; import com.tzpt.cloudlibrary.utils.badger.BaseBadger; import com.tzpt.cloudlibrary.utils.badger.exception.ShortcutBadgeException; import java.util.ArrayList; import java.util.List; public class ZTEHomeBadger implements BaseBadger { @Override public void executeBadge(Context context, ComponentName componentName, int badgeCount) throws ShortcutBadgeException { Bundle extra = new Bundle(); extra.putInt("app_badge_count", badgeCount); extra.putString("app_badge_component_name", componentName.flattenToString()); context.getContentResolver().call( Uri.parse("content://com.android.launcher3.cornermark.unreadbadge"), "setAppUnreadCount", null, extra); } @Override public List<String> getSupportLaunchers() { return new ArrayList<String>(0); } }
[ "653651979@qq.com" ]
653651979@qq.com
212abdd0f81abbdf48db1122539c383f7e2a7f8a
774b50fe5091754f23ef556c07a4d1aab56efe27
/oag/src/main/java/org/oagis/model/v101/ChangeAcknowledgeWarrantyClaimType.java
05910e3cdd62d876c6a8ae6fc515be5e9e2e3b66
[]
no_license
otw1248/thirdpartiess
daa297c2f44adb1ffb6530f88eceab6b7f37b109
4cbc4501443d807121656e47014d70277ff30abc
refs/heads/master
2022-12-07T17:10:17.320160
2022-11-28T10:56:19
2022-11-28T10:56:19
33,661,485
0
0
null
null
null
null
UTF-8
Java
false
false
2,154
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: 2015.04.09 at 04:17:15 PM CST // package org.oagis.model.v101; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ChangeAcknowledgeWarrantyClaimType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ChangeAcknowledgeWarrantyClaimType"> * &lt;complexContent> * &lt;extension base="{http://www.openapplications.org/oagis/10}BusinessObjectDocumentType"> * &lt;sequence> * &lt;element name="DataArea" type="{http://www.openapplications.org/oagis/10}ChangeAcknowledgeWarrantyClaimDataAreaType"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ChangeAcknowledgeWarrantyClaimType", propOrder = { "dataArea" }) public class ChangeAcknowledgeWarrantyClaimType extends BusinessObjectDocumentType { @XmlElement(name = "DataArea", required = true) protected ChangeAcknowledgeWarrantyClaimDataAreaType dataArea; /** * Gets the value of the dataArea property. * * @return * possible object is * {@link ChangeAcknowledgeWarrantyClaimDataAreaType } * */ public ChangeAcknowledgeWarrantyClaimDataAreaType getDataArea() { return dataArea; } /** * Sets the value of the dataArea property. * * @param value * allowed object is * {@link ChangeAcknowledgeWarrantyClaimDataAreaType } * */ public void setDataArea(ChangeAcknowledgeWarrantyClaimDataAreaType value) { this.dataArea = value; } }
[ "otw1248@otw1248.com" ]
otw1248@otw1248.com
acc176861eda0d60ad736df17da48f097663f502
18176792205946483b6026acbc5df34457063bb9
/src/com/javalearn/test/level12/lesson04/task01/Solution.java
48d9d216152e9e0528948281c947903e1d735b36
[]
no_license
shev-denys/my-JavaRush-Homework
ee1779ba05d9093e5fa7c7043d5aa8ed75ffc8b8
2f9e577bc35331f8c4165986acd50f5aa6beee51
refs/heads/master
2021-01-17T07:40:09.827500
2016-07-14T09:10:49
2016-07-14T09:10:49
27,239,736
0
0
null
null
null
null
UTF-8
Java
false
false
388
java
package com.javalearn.test.level12.lesson04.task01; /* print(int) и print(String) Написать два метода: print(int) и print(String). */ public class Solution { public static void main(String[] args) { } public void print(int i) { System.out.println(i); } public void print(String s) { System.out.println(s); } }
[ "shev.denys@gmail.com" ]
shev.denys@gmail.com
060cf9375e010ea1965d9b89f4efa50e27a3f75b
0b1a9109de1f41752a34374a75790af350c9d8f0
/ontologizer/src/ontologizer/set/PopulationSet.java
d839d8088b694548c6ee666334ced117b01018da
[]
no_license
visze/ontologizer
1f3cb5e75f222b5a41b48211ce6ff35ca3fe4a1d
1aba3851f54e1bb8ddd7cccd70eefb2cfb22af32
refs/heads/master
2021-01-13T11:08:39.231003
2017-03-17T16:23:29
2017-03-17T16:23:29
54,557,941
0
0
null
null
null
null
UTF-8
Java
false
false
648
java
/* * Created on 14.07.2005 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package ontologizer.set; /** * This class represents the whole population. It inherits from * StudySet * * @author Sebastian Bauer, Steffen Grossmann */ public class PopulationSet extends StudySet { /** * Constructs the population set. */ public PopulationSet() { super(); } /** * constructs an empty PopulationSet with the given name * * @param name the name of the PopulationSet to construct */ public PopulationSet(String name) { super(); setName(name); } }
[ "mail@sebastianbauer.info" ]
mail@sebastianbauer.info
fce237dcaa9668b838251d4486a62bcbfdb93fa7
58c00bf811d02379aef98b6da0bdc7ff27728145
/JAVA/src/ar/com/bosoft/crud/LocalidadCRUD.java
c9eff8b536a88bd56816a79db4fa76fd85f05fdd
[]
no_license
tinchogava/Matera
9e39ad2deb5da7f61be6854e54afb49c933fc87a
63b0f60c65af0293d6384837d03116d588996370
refs/heads/master
2021-05-05T22:30:17.306179
2018-01-03T16:06:00
2018-01-03T16:06:00
116,151,161
0
0
null
null
null
null
UTF-8
Java
false
false
2,476
java
/** * Derechos de uso otrogados a MyA Tecnología Quirúrgica S.A. * Todos los derechos reservados - 2014 - * BOSOFT - Servicios Informáticos Integrales * www.bosoft.com.ar */ package ar.com.bosoft.crud; import ar.com.bosoft.clases.Utiles; import ar.com.bosoft.conexion.Conexion; import ar.com.bosoft.data.LocalidadData; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; public class LocalidadCRUD { Conexion conexion; String empresa; ArrayList parametros; public LocalidadCRUD(Conexion conexion, String empresa) { this.conexion = conexion; this.empresa = empresa; this.parametros = new ArrayList(); } public ArrayList <LocalidadData> consulta(int id_departamento){ parametros.clear(); parametros.add(id_departamento); ResultSet rs = conexion.procAlmacenado("consultaLocalidad", parametros, this.empresa, this.getClass().getName(), Thread.currentThread().getStackTrace()[1].toString()); ArrayList <LocalidadData> lista = new ArrayList<>(); LocalidadData registro; try { while (rs.next()){ registro = new LocalidadData(); registro.setId_localidad(rs.getInt("id_localidad")); registro.setNombre(rs.getString("nombre")); lista.add(registro); } rs.close(); } catch (SQLException ex) { Utiles.enviaError(this.empresa,ex); } return lista; } public ArrayList <LocalidadData> consulta(){ parametros.clear(); ResultSet rs = conexion.procAlmacenado("selectLocalidad", parametros, this.empresa, this.getClass().getName(), Thread.currentThread().getStackTrace()[1].toString()); ArrayList <LocalidadData> lista = new ArrayList<>(); LocalidadData registro; try { while (rs.next()){ registro = new LocalidadData(); registro.setId_departamento(rs.getInt("id_departamento")); registro.setId_localidad(rs.getInt("id_localidad")); registro.setNombre(rs.getString("nombre")); lista.add(registro); } rs.close(); } catch (SQLException ex) { Utiles.enviaError(this.empresa,ex); } return lista; } }
[ "tinchogava@gmail.com" ]
tinchogava@gmail.com
3a418cf07d478ed03094fda9e4d07d4ef6023ddc
cc66a11bfc637063bdd1cb703072ced8caf942e9
/ejbs/cxfws/BasicWSWeb/src/main/java/com/dhenton9000/cxf/sample/InventoryRequestParametersType.java
341f413131477b4574c92213298840ce32c04f45
[]
no_license
donhenton/code-attic
e905840a4d53181d8a6d7c8b983c7b2dc553074b
e8588bea7af3d3a168958ae96ea8a476fcb6969f
refs/heads/master
2016-09-05T14:47:39.348847
2015-07-20T17:37:38
2015-07-20T17:37:38
39,396,691
0
0
null
null
null
null
UTF-8
Java
false
false
3,346
java
package com.dhenton9000.cxf.sample; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * The actual parameters of the web call * * <p>Java class for InventoryRequestParametersType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="InventoryRequestParametersType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RoutingInformation" type="{http://dhenton9000.inventory/schema/InventoryBusSchema}RoutingRequestType"/> * &lt;element name="Style" type="{http://dhenton9000.inventory/schema/InventoryBusSchema}StyleIdentifierType"/> * &lt;element name="ServiceRequests" type="{http://dhenton9000.inventory/schema/InventoryBusSchema}ServiceRequestsType" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "InventoryRequestParametersType", propOrder = { "routingInformation", "style", "serviceRequests" }) public class InventoryRequestParametersType { @XmlElement(name = "RoutingInformation", required = true) protected RoutingRequestType routingInformation; @XmlElement(name = "Style", required = true) protected String style; @XmlElement(name = "ServiceRequests") protected ServiceRequestsType serviceRequests; /** * Gets the value of the routingInformation property. * * @return * possible object is * {@link RoutingRequestType } * */ public RoutingRequestType getRoutingInformation() { return routingInformation; } /** * Sets the value of the routingInformation property. * * @param value * allowed object is * {@link RoutingRequestType } * */ public void setRoutingInformation(RoutingRequestType value) { this.routingInformation = value; } /** * Gets the value of the style property. * * @return * possible object is * {@link String } * */ public String getStyle() { return style; } /** * Sets the value of the style property. * * @param value * allowed object is * {@link String } * */ public void setStyle(String value) { this.style = value; } /** * Gets the value of the serviceRequests property. * * @return * possible object is * {@link ServiceRequestsType } * */ public ServiceRequestsType getServiceRequests() { return serviceRequests; } /** * Sets the value of the serviceRequests property. * * @param value * allowed object is * {@link ServiceRequestsType } * */ public void setServiceRequests(ServiceRequestsType value) { this.serviceRequests = value; } }
[ "donhenton@gmail.com" ]
donhenton@gmail.com
00580ce98e0d7adef854db710a508a29fb47d362
072216667ef59e11cf4994220ea1594538db10a0
/googleplay/com/google/android/finsky/widget/WidgetTrampolineActivity.java
1d46d8c71ef6e619ddd80a152c559e9fe4e57e1b
[]
no_license
jackTang11/REMIUI
896037b74e90f64e6f7d8ddfda6f3731a8db6a74
48d65600a1b04931a510e1f036e58356af1531c0
refs/heads/master
2021-01-18T05:43:37.754113
2015-07-03T04:01:06
2015-07-03T04:01:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
package com.google.android.finsky.widget; import android.appwidget.AppWidgetManager; import android.content.Intent; import android.os.Build.VERSION; import com.android.vending.R; public abstract class WidgetTrampolineActivity extends TrampolineActivity { protected abstract Class<? extends BaseWidgetProvider> getWidgetClass(); public void finish(int resultCode, String type) { int appWidgetId = getIntent().getIntExtra("appWidgetId", 0); if (type != null) { WidgetTypeMap.get(this).put(getWidgetClass(), appWidgetId, type); } Intent result = new Intent(); result.putExtra("appWidgetId", appWidgetId); setResult(resultCode, result); finish(); int[] appWidgetIds = new int[]{appWidgetId}; Intent intent = new Intent("android.appwidget.action.APPWIDGET_UPDATE"); intent.putExtra("appWidgetIds", appWidgetIds); intent.setClass(this, getWidgetClass()); sendBroadcast(intent); if (VERSION.SDK_INT >= 11) { AppWidgetManager.getInstance(this).notifyAppWidgetViewDataChanged(appWidgetIds, R.id.widget_flipper); } } }
[ "songjd@putao.com" ]
songjd@putao.com
e6b494605b6731d13c00e9969279128d216eaa80
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/google/android/gms/common/api/internal/ListenerHolder.java
f234bc3881fbbf4c124301997a2c390422465091
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,823
java
package com.google.android.gms.common.api.internal; import android.os.Handler; import android.os.Looper; import android.os.Message; import com.google.android.gms.common.annotation.KeepForSdk; import com.google.android.gms.common.internal.Preconditions; import com.tencent.matrix.trace.core.AppMethodBeat; @KeepForSdk public final class ListenerHolder<L> { private final zza zzlh; private volatile L zzli; private final ListenerKey<L> zzlj; @KeepForSdk public static final class ListenerKey<L> { private final L zzli; private final String zzll; @KeepForSdk ListenerKey(L l, String str) { this.zzli = l; this.zzll = str; } public final boolean equals(Object obj) { AppMethodBeat.i(60639); if (this == obj) { AppMethodBeat.o(60639); return true; } else if (obj instanceof ListenerKey) { ListenerKey listenerKey = (ListenerKey) obj; if (this.zzli == listenerKey.zzli && this.zzll.equals(listenerKey.zzll)) { AppMethodBeat.o(60639); return true; } AppMethodBeat.o(60639); return false; } else { AppMethodBeat.o(60639); return false; } } public final int hashCode() { AppMethodBeat.i(60640); int identityHashCode = (System.identityHashCode(this.zzli) * 31) + this.zzll.hashCode(); AppMethodBeat.o(60640); return identityHashCode; } } @KeepForSdk public interface Notifier<L> { @KeepForSdk void notifyListener(L l); @KeepForSdk void onNotifyListenerFailed(); } final class zza extends Handler { public zza(Looper looper) { super(looper); } public final void handleMessage(Message message) { boolean z = true; AppMethodBeat.i(60641); if (message.what != 1) { z = false; } Preconditions.checkArgument(z); ListenerHolder.this.notifyListenerInternal((Notifier) message.obj); AppMethodBeat.o(60641); } } @KeepForSdk ListenerHolder(Looper looper, L l, String str) { AppMethodBeat.i(60642); this.zzlh = new zza(looper); this.zzli = Preconditions.checkNotNull(l, "Listener must not be null"); this.zzlj = new ListenerKey(l, Preconditions.checkNotEmpty(str)); AppMethodBeat.o(60642); } @KeepForSdk public final void clear() { this.zzli = null; } @KeepForSdk public final ListenerKey<L> getListenerKey() { return this.zzlj; } @KeepForSdk public final boolean hasListener() { return this.zzli != null; } @KeepForSdk public final void notifyListener(Notifier<? super L> notifier) { AppMethodBeat.i(60643); Preconditions.checkNotNull(notifier, "Notifier must not be null"); this.zzlh.sendMessage(this.zzlh.obtainMessage(1, notifier)); AppMethodBeat.o(60643); } /* Access modifiers changed, original: final */ @KeepForSdk public final void notifyListenerInternal(Notifier<? super L> notifier) { AppMethodBeat.i(60644); Object obj = this.zzli; if (obj == null) { notifier.onNotifyListenerFailed(); AppMethodBeat.o(60644); return; } try { notifier.notifyListener(obj); AppMethodBeat.o(60644); } catch (RuntimeException e) { notifier.onNotifyListenerFailed(); AppMethodBeat.o(60644); throw e; } } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
5bec97ec281cfea90b5ee9c4abf1d57bd2dfef93
698695296508d4a84410388d776ed6e1c2fd87f7
/driver/src/main/java/com/ins/driver/map/OverlayManager.java
f41f94af71876d31a573691db63fb7b049eb2fd1
[]
no_license
davidHuW/Kuaidi
ca2c86ab07e906a409bc42ffc717fdacd3f66745
d63beb56738b731b567c9c24cc7532425986d2ac
refs/heads/master
2020-12-04T20:32:18.634794
2017-08-18T03:24:29
2017-08-18T03:24:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,413
java
package com.ins.driver.map; import com.baidu.mapapi.map.BaiduMap; import com.baidu.mapapi.map.BaiduMap.OnPolylineClickListener; import com.baidu.mapapi.map.MapStatusUpdateFactory; import com.baidu.mapapi.map.Marker; import com.baidu.mapapi.map.Overlay; import com.baidu.mapapi.map.OverlayOptions; import com.baidu.mapapi.model.LatLngBounds; import java.util.ArrayList; import java.util.List; import static com.baidu.mapapi.map.BaiduMap.OnMarkerClickListener; /** * 该类提供一个能够显示和管理多个Overlay的基类 * <p> * 复写{@link #getOverlayOptions()} 设置欲显示和管理的Overlay列表 * </p> * <p> * 通过 * {@link com.baidu.mapapi.map.BaiduMap#setOnMarkerClickListener(com.baidu.mapapi.map.BaiduMap.OnMarkerClickListener)} * 将覆盖物点击事件传递给OverlayManager后,OverlayManager才能响应点击事件。 * <p> * 复写{@link #onMarkerClick(com.baidu.mapapi.map.Marker)} 处理Marker点击事件 * </p> */ public abstract class OverlayManager implements OnMarkerClickListener, OnPolylineClickListener { BaiduMap mBaiduMap = null; private List<OverlayOptions> mOverlayOptionList = null; List<Overlay> mOverlayList = null; /** * 通过一个BaiduMap 对象构造 * * @param baiduMap */ public OverlayManager(BaiduMap baiduMap) { mBaiduMap = baiduMap; // mBaiduMap.setOnMarkerClickListener(this); if (mOverlayOptionList == null) { mOverlayOptionList = new ArrayList<OverlayOptions>(); } if (mOverlayList == null) { mOverlayList = new ArrayList<Overlay>(); } } /** * 覆写此方法设置要管理的Overlay列表 * * @return 管理的Overlay列表 */ public abstract List<OverlayOptions> getOverlayOptions(); /** * 将所有Overlay 添加到地图上 */ public final void addToMap() { if (mBaiduMap == null) { return; } removeFromMap(); List<OverlayOptions> overlayOptions = getOverlayOptions(); if (overlayOptions != null) { mOverlayOptionList.addAll(getOverlayOptions()); } for (OverlayOptions option : mOverlayOptionList) { mOverlayList.add(mBaiduMap.addOverlay(option)); } } /** * 将所有Overlay 从 地图上消除 */ public final void removeFromMap() { if (mBaiduMap == null) { return; } for (Overlay marker : mOverlayList) { marker.remove(); } mOverlayOptionList.clear(); mOverlayList.clear(); } /** * 缩放地图,使所有Overlay都在合适的视野内 * <p> * 注: 该方法只对Marker类型的overlay有效 * </p> * */ public void zoomToSpan() { if (mBaiduMap == null) { return; } if (mOverlayList.size() > 0) { LatLngBounds.Builder builder = new LatLngBounds.Builder(); for (Overlay overlay : mOverlayList) { // polyline 中的点可能太多,只按marker 缩放 if (overlay instanceof Marker) { builder.include(((Marker) overlay).getPosition()); } } mBaiduMap.setMapStatus(MapStatusUpdateFactory .newLatLngBounds(builder.build())); } } }
[ "abcdefgghhh01" ]
abcdefgghhh01
d9bd3170f897ea03c55f5bff26b63ddab31dce2c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/6/6_8f73b1a62b84f530ced42ff7b4010709151afbba/InjectionModel/6_8f73b1a62b84f530ced42ff7b4010709151afbba_InjectionModel_s.java
3acab6020329da74d7170556ba8959fb33c2da36
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,158
java
/* * Copyright (c) 2007, Rickard Öberg. 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 org.qi4j.spi.injection; import java.lang.annotation.Annotation; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; /** * Injection model used as base for all types of injections. The model is comprised * of the the annotation, the generic dependency type, and the dependent type that declared the injection. */ public class InjectionModel { private Class<? extends Annotation> injectionAnnotation; private Type injectionType; private Class injectedClass; private Class rawInjectionType; private Class injectionClass; protected boolean optional; public InjectionModel( Class<? extends Annotation> injectionAnnotation, Type genericType, Class injectedClass, boolean optional ) { this.injectionAnnotation = injectionAnnotation; this.injectedClass = injectedClass; this.injectionType = genericType; this.optional = optional; // Calculate raw injection type if( injectionType instanceof Class ) { rawInjectionType = (Class) injectionType; } else if( injectionType instanceof ParameterizedType ) { rawInjectionType = (Class) ( (ParameterizedType) injectionType ).getRawType(); } else if( injectionType instanceof TypeVariable ) { int index = 0; TypeVariable<?>[] typeVariables = ( (TypeVariable) injectionType ).getGenericDeclaration().getTypeParameters(); for( TypeVariable typeVariable : typeVariables ) { if( "T".equals( typeVariable.getName() ) ) { Type genericSuperclass = injectedClass.getGenericSuperclass(); Type type; if( genericSuperclass instanceof ParameterizedType ) { type = ( (ParameterizedType) genericSuperclass ).getActualTypeArguments()[ index ]; } else { type = ((Class) genericSuperclass).getGenericInterfaces()[index++]; } rawInjectionType = (Class) type; } index++; } } if( rawInjectionType.isPrimitive() ) { rawInjectionType = getNonPrimitiveType( rawInjectionType ); } // Calculate injection class if( injectionType instanceof ParameterizedType ) { Type type = ( (ParameterizedType) injectionType ).getActualTypeArguments()[ 0 ]; if( type instanceof Class ) { injectionClass = (Class) type; } else if( type instanceof ParameterizedType ) { injectionClass = (Class) ( (ParameterizedType) type ).getRawType(); } } else if( injectionType instanceof TypeVariable ) { injectionClass = (Class) ( (TypeVariable) injectionType ).getBounds()[ 0 ]; } else { injectionClass = (Class) injectionType; } } public Class<? extends Annotation> getInjectionAnnotationType() { return injectionAnnotation; } public Type getInjectionType() { return injectionType; } /** * Get the raw dependency type. If the dependency uses generics this is the raw type, * and otherwise it is the type of the field. Examples: * * @return * @Service MyService service -> MyService * @Entity Iterable<Foo> fooList -> Iterable * @Entity Query<Foo> fooQuery -> Query */ public Class getRawInjectionType() { return rawInjectionType; } /** * Get the injection class. If the injection uses generics this is the parameter type, * and otherwise it is the raw type. Examples: * * @return * @Service MyService service -> MyService * @Entity Iterable<Foo> fooList -> Foo * @Entity Query<Foo> fooQuery -> Foo */ public Class getInjectionClass() { return injectionClass; } public Class getInjectedClass() { return injectedClass; } @Override public boolean equals( Object o ) { if( this == o ) { return true; } if( o == null || getClass() != o.getClass() ) { return false; } InjectionModel that = (InjectionModel) o; if( !injectionType.equals( that.injectionType ) ) { return false; } return true; } @Override public int hashCode() { int result; result = injectionType.hashCode(); result = 31 * result + injectedClass.hashCode(); return result; } @Override public String toString() { return ( injectedClass == null ? "" : injectedClass.getSimpleName() + ":" ) + injectionType; } public boolean isOptional() { return optional; } private Class getNonPrimitiveType( Class rawInjectionType ) { if( rawInjectionType.getSimpleName().equals( "boolean" ) ) { return Boolean.class; } else { return rawInjectionType; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b32e2852ab98c3d64d987c79c28b270e7d12c9b1
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/deeplearning4j--deeplearning4j/4aecdef0027f03d7b09bc740b667f2979194d381/after/DenoisingAutoEncoder.java
94785fea52ed2fa8908eff4b84f6d86ace3bd865
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
6,429
java
package org.deeplearning4j.da; import static org.deeplearning4j.util.MathUtils.binomial; import static org.deeplearning4j.util.MatrixUtil.oneMinus; import static org.deeplearning4j.util.MatrixUtil.sigmoid; import java.io.Serializable; import org.apache.commons.math3.distribution.RealDistribution; import org.apache.commons.math3.random.RandomGenerator; import org.deeplearning4j.berkeley.Pair; import org.deeplearning4j.nn.BaseNeuralNetwork; import org.deeplearning4j.nn.gradient.NeuralNetworkGradient; import org.deeplearning4j.sda.DenoisingAutoEncoderOptimizer; import org.jblas.DoubleMatrix; /** * Denoising Autoencoder. * Add Gaussian noise to input and learn * a reconstruction function. * * @author Adam Gibson * */ public class DenoisingAutoEncoder extends BaseNeuralNetwork implements Serializable { private static final long serialVersionUID = -6445530486350763837L; public DenoisingAutoEncoder() {} public DenoisingAutoEncoder(DoubleMatrix input, int nVisible, int nHidden, DoubleMatrix W, DoubleMatrix hbias, DoubleMatrix vbias, RandomGenerator rng,double fanIn,RealDistribution dist) { super(input, nVisible, nHidden, W, hbias, vbias, rng,fanIn,dist); } /** * Corrupts the given input by doing a binomial sampling * given the corruption level * @param x the input to corrupt * @param corruptionLevel the corruption value * @return the binomial sampled corrupted input */ public DoubleMatrix getCorruptedInput(DoubleMatrix x, double corruptionLevel) { DoubleMatrix tilde_x = DoubleMatrix.zeros(x.rows,x.columns); for(int i = 0; i < x.rows; i++) for(int j = 0; j < x.columns; j++) tilde_x.put(i,j,binomial(rng,1,1 - corruptionLevel)); DoubleMatrix ret = tilde_x.mul(x); return ret; } @Override public Pair<DoubleMatrix, DoubleMatrix> sampleHiddenGivenVisible( DoubleMatrix v) { DoubleMatrix ret = getHiddenValues(v); return new Pair<>(ret,ret); } @Override public Pair<DoubleMatrix, DoubleMatrix> sampleVisibleGivenHidden( DoubleMatrix h) { DoubleMatrix ret = this.getReconstructedInput(h); return new Pair<>(ret,ret); } // Encode public DoubleMatrix getHiddenValues(DoubleMatrix x) { DoubleMatrix ret = sigmoid(x.mmul(W).addRowVector(hBias)); applyDropOutIfNecessary(ret); return ret; } // Decode public DoubleMatrix getReconstructedInput(DoubleMatrix y) { return sigmoid(y.mmul(W.transpose()).addRowVector(vBias)); } /** * Run a network optimizer * @param x the input * @param lr the learning rate * @param corruptionLevel the corruption level */ public void trainTillConvergence(DoubleMatrix x, double lr,double corruptionLevel) { if(x != null) this.input = x; this.lastMiniBatchSize = x.rows; optimizer = new DenoisingAutoEncoderOptimizer(this,lr,new Object[]{corruptionLevel}, optimizationAlgo, lossFunction); optimizer.train(x); } /** * Perform one iteration of training * @param x the input * @param lr the learning rate * @param corruptionLevel the corruption level to train with */ public void train(DoubleMatrix x,double lr,double corruptionLevel) { if(x != null && cacheInput) this.input = x; this.lastMiniBatchSize = x.rows; NeuralNetworkGradient gradient = getGradient(new Object[]{corruptionLevel,lr}); vBias.addi(gradient.getvBiasGradient()); W.addi(gradient.getwGradient()); hBias.addi(gradient.gethBiasGradient()); } @Override public DoubleMatrix reconstruct(DoubleMatrix x) { DoubleMatrix y = getHiddenValues(x); return getReconstructedInput(y); } public static class Builder extends BaseNeuralNetwork.Builder<DenoisingAutoEncoder> { public Builder() { this.clazz = DenoisingAutoEncoder.class; } } @Override public void trainTillConvergence(DoubleMatrix input,double lr,Object[] params) { if(input != null && cacheInput) this.input = input; this.lastMiniBatchSize = input.rows; optimizer = new DenoisingAutoEncoderOptimizer(this,lr, params, optimizationAlgo, lossFunction); optimizer.train(input); } @Override public double lossFunction(Object[] params) { return negativeLogLikelihood(); } @Override public void train(DoubleMatrix input,double lr,Object[] params) { double corruptionLevel = (double) params[0]; if(input != null && cacheInput) this.input = input; this.lastMiniBatchSize = input.rows; NeuralNetworkGradient gradient = getGradient(new Object[]{corruptionLevel,lr}); vBias.addi(gradient.getvBiasGradient()); W.addi(gradient.getwGradient()); hBias.addi(gradient.gethBiasGradient()); } @Override public synchronized NeuralNetworkGradient getGradient(Object[] params) { double corruptionLevel = (double) params[0]; double lr = (double) params[1]; if(wAdaGrad != null) this.wAdaGrad.setMasterStepSize(lr); if(hBiasAdaGrad != null ) this.hBiasAdaGrad.setMasterStepSize(lr); if(vBiasAdaGrad != null) vBiasAdaGrad.setMasterStepSize(lr); DoubleMatrix corruptedX = getCorruptedInput(input, corruptionLevel); DoubleMatrix y = getHiddenValues(corruptedX); DoubleMatrix z = getReconstructedInput(y); DoubleMatrix L_h2 = input.sub(z); DoubleMatrix L_h1 = sparsity == 0 ? L_h2.mmul(W).mul(y).mul(oneMinus(y)) : L_h2.mmul(W).mul(y).mul(y.add(- sparsity)); DoubleMatrix L_vbias = L_h2; DoubleMatrix L_hbias = L_h1; DoubleMatrix wGradient = corruptedX.transpose().mmul(L_h1).add(L_h2.transpose().mmul(y)); DoubleMatrix hBiasGradient = L_hbias.columnMeans(); DoubleMatrix vBiasGradient = L_vbias.columnMeans(); NeuralNetworkGradient gradient = new NeuralNetworkGradient(wGradient,vBiasGradient,hBiasGradient); triggerGradientEvents(gradient); updateGradientAccordingToParams(gradient, lr); return gradient; } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
8603c032f6c1f03937a5edece9a0b6828b7b1181
2043467dfdd12c6ec461ac0a615ed2162f19d577
/SpMVC_20_BBS_Final(C)/src/main/java/com/biz/bbs/service/BBsServiceImplV2.java
424a8ad73ae76e4cf8248f99a523258e2cabcd89
[]
no_license
atakage/Shop_Project
970686a551a022e8df1046a0c661d65b66e9ccfd
813d6e65778cb225392789cbf8dd2769ba1931fc
refs/heads/master
2022-12-23T04:57:32.473430
2020-06-08T05:25:52
2020-06-08T05:25:52
244,572,033
0
0
null
2022-12-16T15:39:55
2020-03-03T07:41:34
Java
UTF-8
Java
false
false
1,086
java
package com.biz.bbs.service; import java.util.List; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.biz.bbs.domain.BBsVO; import com.biz.bbs.repository.BBsDao; import lombok.RequiredArgsConstructor; /* * * 다중 select를 수행하는 method들이 있고 * 재귀호출에 의해서 계속된 select문이 실행됨 * * 이때 transactional 설정하면 다중 select를 transaction으로 보호하여 * 중간에 데이터 fetch가 누락되는 것을 막을 수 있다 * * */ @Transactional @Service("bbsV2") public class BBsServiceImplV2 extends BBsServiceImpl { public BBsServiceImplV2(BBsDao bbsDao) { super(bbsDao); // TODO Auto-generated constructor stub } /* * paigination을 수행할 때 * 원글 목록을 pagi 대상으로 할 것인지 * 원글 + 댓글 포함한 목록을 pagi 대상으로 할 것인지 결정 */ @Override public List<BBsVO> selectAll() { List<BBsVO> retList = bbsDao.selectLevel(); return retList; } }
[ "atakoko2@gmail.com" ]
atakoko2@gmail.com
da1500f65b77db929be593ea9e5d75e9c122b754
e3d6330b1358fffaef563248fb15722aeb977acc
/upa-impl/src/main/java/net/vpc/upa/impl/persistence/specific/oracle/OraclePersistenceStore.java
e420bb0497fab2dec46f39afee303193387fba3b
[]
no_license
nesrinesghaier/upa
92fd779838c045e0e3bbe71d33870e5b13d2e3fe
2eb005e03477adad5eb127c830bc654ab62f5cc9
refs/heads/master
2021-04-09T11:33:36.714597
2018-02-24T12:04:41
2018-02-24T12:04:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,550
java
package net.vpc.upa.impl.persistence.specific.oracle; import net.vpc.upa.filters.FieldFilters; import net.vpc.upa.types.*; import net.vpc.upa.*; import net.vpc.upa.exceptions.UPAException; import net.vpc.upa.impl.persistence.DefaultPersistenceStore; import net.vpc.upa.impl.persistence.shared.marshallers.ConstantDataMarshallerFactory; import net.vpc.upa.impl.persistence.shared.sql.NullValANSISQLProvider; import net.vpc.upa.impl.persistence.shared.sql.SignANSISQLProvider; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import net.vpc.upa.persistence.EntityExecutionContext; @PortabilityHint(target = "C#", name = "suppress") public class OraclePersistenceStore extends DefaultPersistenceStore { public OraclePersistenceStore() { Properties map = getStoreParameters(); map.setBoolean("isComplexSelectSupported", Boolean.TRUE); map.setBoolean("isUpdateComplexValuesStatementSupported", Boolean.TRUE); map.setBoolean("isUpdateComplexValuesIncludingUpdatedTableSupported", Boolean.TRUE); map.setBoolean("isFromClauseInUpdateStatementSupported", Boolean.FALSE); map.setBoolean("isFromClauseInDeleteStatementSupported", Boolean.FALSE); map.setBoolean("isReferencingSupported", Boolean.TRUE); map.setBoolean("isViewSupported", Boolean.TRUE); map.setBoolean("isTopSupported", Boolean.FALSE); getSqlManager().register(new OracleCoalesceSQLProvider()); getSqlManager().register(new OracleConcatSQLProvider()); getSqlManager().register(new OracleDateTruncSQLProvider()); getSqlManager().register(new OracleDateAddSQLProvider()); getSqlManager().register(new OracleDatePartSQLProvider()); getSqlManager().register(new OracleDateDiffSQLProvider()); getSqlManager().register(new OracleDecodeSQLProvider()); getSqlManager().register(new OracleIfSQLProvider()); getSqlManager().register(new SignANSISQLProvider()); getSqlManager().register(new OracleStrLenSQLProvider()); getSqlManager().register(new OracleCurrentTimestampSQLProvider()); getSqlManager().register(new OracleMonthStartSQLProvider()); getSqlManager().register(new OracleMonthEndSQLProvider()); getSqlManager().register(new OracleCastSQLProvider()); getSqlManager().register(new OracleI2VSQLProvider()); getSqlManager().register(new OracleD2VSQLProvider()); getSqlManager().register(new NullValANSISQLProvider()); getSqlManager().register(new OracleTypeNameSQLProvider()); getSqlManager().register(new OracleSelectSQLProvider()); OracleSerializablePlatformObjectMarshaller oracleSerializablePlatformObjectWrapper = new OracleSerializablePlatformObjectMarshaller(getMarshallManager()); getMarshallManager().setTypeMarshaller(Float.class, new OracleFloatAsDoubleMarshaller(getMarshallManager())); // getMarshallManager().setTypeMarshaller(ImageData.class, oracleSerializableJavaObjectWrapper); getMarshallManager().setTypeMarshaller(Object.class, oracleSerializablePlatformObjectWrapper); getMarshallManager().setTypeMarshaller(FileData.class, oracleSerializablePlatformObjectWrapper); getMarshallManager().setTypeMarshaller(DataType.class, oracleSerializablePlatformObjectWrapper); ConstantDataMarshallerFactory blobfactory = new ConstantDataMarshallerFactory(getMarshallManager(),oracleSerializablePlatformObjectWrapper); getMarshallManager().setTypeMarshallerFactory(DataType.class, blobfactory); getMarshallManager().setTypeMarshallerFactory(ImageType.class, blobfactory); getMarshallManager().setTypeMarshallerFactory(FileType.class, blobfactory); // DataWrapperUtils.setWrapperFactory(DateType.class, F_DATE); // DataWrapperUtils.setWrapperFactory(NumberType.class, F_NUMBER); // DataWrapperUtils.setWrapperFactory(StringType.class, F_STRING); // DataWrapperUtils.setWrapperFactory(BooleanType.class, F_BOOLEAN_FROM_NUMBER); // DataWrapperUtils.setWrapperFactory(ListType.class, F_LIST); //parser.registerFunction("cast", new CastAsSQLProvider()); } @Override public Set<String> getSupportedDrivers() { LinkedHashSet<String> valid = new LinkedHashSet<String>(); valid.add(DRIVER_TYPE_DEFAULT); return valid; } @Override public String getFieldDeclaration(PrimitiveField field, net.vpc.upa.persistence.EntityExecutionContext entityPersistenceContext) throws UPAException { String s = super.getFieldDeclaration(field,entityPersistenceContext); // if (field.isAutoIncrement()) { //throw new UPAIllegalArgumentException("Not yet supported"); //s += " IDENTITY(" + field.getAutoIncrement().getSeed() + "," + field.getAutoIncrement().getIncrement() + ")"; // } return s; } @Override public void dropStorage(EntityExecutionContext context) throws UPAException { } @Override public String getDisableIdentityConstraintsStatement(Entity table) { return null; } @Override public String getEnableIdentityConstraintsStatement(Entity table) { return null; } @Override public String getCreateIndexStatement(Index index) throws UPAException { StringBuilder sb = new StringBuilder("Create"); //how is cluster supported ? // switch(index.getDataType()){ // case CLUSTERED:{ // sb.append(" CLUSTERED"); // break; // } // case NON_CLUSTERED:{ // sb.append(" NON_CLUSTERED"); // break; // } // } sb.append(" Index "); sb.append(getValidIdentifier(getPersistenceName(index))); sb.append(" On "); sb.append(index.getEntity().getPersistenceName()); sb.append("("); boolean first = true; List<PrimitiveField> primitiveFields = index.getEntity().getPrimitiveFields( FieldFilters.regular().and(FieldFilters.byList(index.getFields())) ); for (Field field : primitiveFields) { if (first) { first = false; } else { sb.append(", "); } sb.append(getValidIdentifier(getPersistenceName(field))); } sb.append(")"); return (sb.toString()); } }
[ "vpc@linux-booster" ]
vpc@linux-booster
a9cd8941162d4143c68fa260e57f508534fc1c48
1f7a8a0a76e05d096d3bd62735bc14562f4f071a
/NeverPuk/net/np/eo.java
dd629ebe47b28e22fec22ee251992a5e5876ae69
[]
no_license
yunusborazan/NeverPuk
b6b8910175634523ebd4d21d07a4eb4605477f46
a0e58597858de2fcad3524daaea656362c20044d
refs/heads/main
2023-05-10T09:08:02.183430
2021-06-13T17:17:50
2021-06-13T17:17:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
package net.np; import java.util.UUID; import net.xn; import net.np.g; public class eo implements net.c0.x { public int X() { return 108; } public net.nj.f r(net.nj.f var1) { String var2 = g.D(); if(var1.K("UUID", 8)) { var1.h("UUID", UUID.fromString(var1.J("UUID"))); } return var1; } private static xn a(xn var0) { return var0; } }
[ "68544940+Lazy-Hero@users.noreply.github.com" ]
68544940+Lazy-Hero@users.noreply.github.com
9fd00fd1db300384ffd72872200f66e778990095
cc592462ab78489ad8b3a771aa9609a95a6cd0ca
/Practice For Hackathon/Tiles/src/tiles/Tiles.java
91f786f6983d42bfa894d241b4debc89677e1a33
[]
no_license
Trung28899/Code
09f0de81719aca1e82ba86e3a19df5c9b7ccae20
c57a71783bac466e1ef8cb3fe6fc9897f6358917
refs/heads/master
2020-11-25T11:58:30.865956
2020-03-29T14:57:36
2020-03-29T14:57:36
228,622,993
0
0
null
null
null
null
UTF-8
Java
false
false
711
java
// 3 points problem, DMOPC '14 Contest 1 P2 - Tiles package tiles; import java.util.*; public class Tiles { public static void main(String[] args) { Scanner input = new Scanner(System.in); int length = input.nextInt(); int width = input.nextInt(); int lengthTile = input.nextInt(); double lengthDivide = length/lengthTile; double widthDivide = width/lengthTile; int maxTile; if((length>1000 || length < 1) || (width>1000 || width < 1) || (lengthTile>1000 || lengthTile < 1)) {System.exit(0);} maxTile = (int)lengthDivide* ((int)widthDivide); System.out.println(maxTile); } }
[ "you@example.com" ]
you@example.com
9c58b9286c55fc67657c758b0671ed1c485969ce
b64f98383fb24e938cd5a380bd4488a97e30de6b
/src/main/java/com/example/app/pojo/MyRealtimeData.java
f344ded8850ae7ae79b143a0e235e37cb8a499fc
[]
no_license
dmshan88/iot-tcp-server
2c653396ba4cc395cad5cfdf434851ff7d79bb0f
18ed01586cae7b7ec4832e825c0669d16a8a2676
refs/heads/master
2020-06-27T00:59:39.642716
2019-07-31T07:40:38
2019-07-31T07:40:38
199,805,287
0
0
null
null
null
null
UTF-8
Java
false
false
537
java
package com.example.app.pojo; public class MyRealtimeData { private int deviceId; private long recordTime; MyNodeData[] nodeData; public int getDeviceId() { return deviceId; } public void setDeviceId(int deviceId) { this.deviceId = deviceId; } public long getRecordTime() { return recordTime; } public void setRecordTime(long recordTime) { this.recordTime = recordTime; } public MyNodeData[] getNodeData() { return nodeData; } public void setNodeData(MyNodeData[] nodeData) { this.nodeData = nodeData; } }
[ "dm_shan@163.com" ]
dm_shan@163.com
db3703fe1f7a1efad9e341fdf49b70bcb8b7dd3b
f4c521ca1e8a33d6d80134a63df6c2bdc57298fd
/XsdToJavaAPIRoot/FasterApi/HtmlApiFaster/src/main/java/org/xmlet/htmlapifaster/Th.java
dc1a588934eaf74fb72d984e2f7d69530b0ce6bb
[ "MIT" ]
permissive
lcduarte/XsdToJavaAPI
222fdd89a124234deb261b94ccdb7b9550c405f2
c35d390df19c4dbe85ff907930a36c8eae349d34
refs/heads/master
2021-07-18T05:41:26.238355
2018-11-28T18:49:00
2018-11-28T18:49:00
110,739,522
2
0
null
null
null
null
UTF-8
Java
false
false
2,385
java
package org.xmlet.htmlapifaster; import java.util.function.Consumer; public final class Th<Z extends Element> implements GlobalAttributes<Th<Z>, Z>, AltFlowContentChoice<Th<Z>, Z> { protected final Z parent; protected final ElementVisitor visitor; public Th(ElementVisitor visitor) { this.visitor = visitor; this.parent = null; visitor.visitElementTh(this); } public Th(Z parent) { this.parent = parent; this.visitor = parent.getVisitor(); this.visitor.visitElementTh(this); } protected Th(Z parent, ElementVisitor visitor, boolean shouldVisit) { this.parent = parent; this.visitor = visitor; if (shouldVisit) { visitor.visitElementTh(this); } } public Z __() { this.visitor.visitParentTh(this); return this.parent; } public final Th<Z> dynamic(Consumer<Th<Z>> consumer) { this.visitor.visitOpenDynamic(); consumer.accept(this); this.visitor.visitCloseDynamic(); return this; } public final Th<Z> of(Consumer<Th<Z>> consumer) { consumer.accept(this); return this; } public Z getParent() { return this.parent; } public final ElementVisitor getVisitor() { return this.visitor; } public String getName() { return "th"; } public final Th<Z> self() { return this; } public final Th<Z> attrHeaders(String attrHeaders) { this.visitor.visitAttributeHeaders(attrHeaders); return this; } public final Th<Z> attrRowspan(Integer attrRowspan) { this.visitor.visitAttributeRowspan(attrRowspan.toString()); return this; } public final Th<Z> attrColspan(Integer attrColspan) { this.visitor.visitAttributeColspan(attrColspan.toString()); return this; } public final Th<Z> attrColumnheader(String attrColumnheader) { this.visitor.visitAttributeColumnheader(attrColumnheader); return this; } public final Th<Z> attrRowheader(String attrRowheader) { this.visitor.visitAttributeRowheader(attrRowheader); return this; } public final Th<Z> attrAbbr(String attrAbbr) { this.visitor.visitAttributeAbbr(attrAbbr); return this; } public final Th<Z> attrScope(EnumScopeType attrScope) { this.visitor.visitAttributeScope(attrScope.getValue()); return this; } }
[ "lois_duarte@msn.com" ]
lois_duarte@msn.com
9112a0b9e8e922bc3f6a56db9e3503fc578bd754
5a9568f06d54c8a8ffa7d3efec8063f474372817
/app/src/main/java/com/xinyuan/xyorder/common/bean/HomeMultipleItem.java
a1c4dadeaa5da1cd128074d35c52130ddffd3e19
[]
no_license
xiasiqiu/ShareFood
a38851ccdcd06c3647cfac0fb925c2cb301c8c0c
e37fc520ce79b1b88a15dcdc26e5ff82e64da1f7
refs/heads/master
2022-12-01T00:35:50.329787
2020-07-29T09:46:44
2020-07-29T09:46:44
283,417,760
1
0
null
null
null
null
UTF-8
Java
false
false
982
java
package com.xinyuan.xyorder.common.bean; import com.chad.library.adapter.base.entity.MultiItemEntity; /** * Created by fx on 2017/5/4 0004. * 首页模块视图实体类 */ public class HomeMultipleItem implements MultiItemEntity { public static final int BANNER = 1; public static final int CATEGORY = 2; public static final int GOODS = 3; public static final int BANNER_SIZE = 4; public static final int CATEGORY_SPAN_SIZE = 4; public static final int GOODS_SPAN_SIZE = 2; public int itemType; public int spanSize; public HomeMultipleItem(int itemType, int spanSize) { this.itemType = itemType; this.spanSize = spanSize; } @Override public int getItemType() { return itemType; } public int getSpanSize() { return spanSize; } public void setSpanSize(int spanSize) { this.spanSize = spanSize; } @Override public String toString() { return "HomeMultipleItem{" + "itemType=" + itemType + ", spanSize=" + spanSize + '}'; } }
[ "491850673@qq.com" ]
491850673@qq.com
44d89422ff368288b630a22c48825595d113cf41
b0a4dcaa23ee7a9bb3a37d796c13d720ab972ffc
/app/src/main/java/com/henghao/hhworkpresent/adapter/JoinPeopleListAdapter.java
1104ed31d5b6658ef2f4b55bc9548a12d979604b
[]
no_license
yuanzp/HHWorkPresent
d7284ab319e2a5fabcf79dff62d461eca16090aa
37e6f9da3033d9036f66a253b5a05c4f196c5c6a
refs/heads/master
2020-12-31T22:30:03.133145
2018-03-07T08:55:13
2018-03-07T08:55:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,512
java
package com.henghao.hhworkpresent.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.TextView; import com.henghao.hhworkpresent.R; import java.util.HashMap; import java.util.List; /** * 参加会议人员 * Created by bryanrady on 2017/10/17. */ public class JoinPeopleListAdapter extends BaseAdapter { private Context mContext; private List<String> mList; // 用来控制CheckBox的选中状况 private static HashMap<Integer, Boolean> isSelected; public JoinPeopleListAdapter(Context context, List<String> list) { this.mContext = context; this.mList = list; isSelected = new HashMap<Integer, Boolean>(); initData(); } private void initData() { for (int i = 0; i < mList.size(); i++) { getIsSelected().put(i, false); } } @Override public int getCount() { return mList.size(); } @Override public Object getItem(int position) { return mList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { HodlerView mHodlerView = null; if (convertView == null) { mHodlerView = new HodlerView(); convertView = LayoutInflater.from(mContext).inflate(R.layout.listview_meeting_personal_item, null); mHodlerView.tv_personal_name = (TextView) convertView.findViewById(R.id.tv_personal_name); mHodlerView.personal_checkbox = (CheckBox) convertView.findViewById(R.id.personal_checkbox); convertView.setTag(mHodlerView); } else { mHodlerView = (HodlerView) convertView.getTag(); } mHodlerView.tv_personal_name.setText(mList.get(position)); // 根据isSelected来设置checkbox的选中状况 mHodlerView.personal_checkbox.setChecked(getIsSelected().get(position)); return convertView; } public static class HodlerView { public TextView tv_personal_name; public CheckBox personal_checkbox; } public static HashMap<Integer, Boolean> getIsSelected() { return isSelected; } public static void setIsSelected(HashMap<Integer, Boolean> isSelected) { isSelected = isSelected; } }
[ "bryanrady@163.com" ]
bryanrady@163.com
8d6325a3279f067c9e72cc6db6eec25663a427bb
e0d9a2a8512065feb2045cff9d2bad30447d414d
/EventosFtp/src/cl/bluex/inicio/Principal.java
29263ca3449635bc3e5304e38984c72686f69f22
[]
no_license
repositoriosbe/repositorioArchivosFtp
2a13f41cf175d43cc48a99a07262a00047f0b191
44d2525c06511536a8b412b8292b3d7e189e6176
refs/heads/master
2020-05-04T22:12:47.782582
2014-04-09T14:38:30
2014-04-09T14:38:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,523
java
package cl.bluex.inicio; import java.io.IOException; import java.util.List; import org.apache.log4j.Logger; import cl.bluex.entidades.Constantes; import cl.bluex.entidades.ParametrosGenerales; import cl.bluex.negocio.Parametros; import cl.bluex.negocio.ProcesarArchivos; /** * The Class Principal. * * Proceso que busca archivos tipo Eventos desde ftp por empresas, * los descarga a carpetas locales, los procesa en CTRT. * Luego de procesados los deja en carpeta backup y error * segun corresponda en el ftp de cada empresa. * */ public class Principal { /** The Constant LOGGER. */ static final Logger LOGGER = Logger.getLogger(Principal.class); /** * The main method. * * @param args * the arguments * @throws IOException * Signals that an I/O exception has occurred. */ public static void main(final String[] args) throws IOException { LOGGER.info("[eventos] Obteniendo parametros generales"); final Long lgEmpresa = Long.parseLong(Constantes.EMPRESA); final int tipoAplicacion = Integer.parseInt(Constantes.TIPO_APLICACION); // Busca PGEN final List<ParametrosGenerales> parametrosFTP = new Parametros(lgEmpresa, tipoAplicacion).buscaParametros(); ProcesarArchivos proceso = new ProcesarArchivos(); // Segun cantidad de registros desde pgen se ejecuta el proceso for (ParametrosGenerales pgen : parametrosFTP) { proceso.comenzar(pgen); } } }
[ "repositoriosbe@outlook.com" ]
repositoriosbe@outlook.com
8dbdb27592c28bd7406e9e6db54612b790933b22
2eb5604c0ba311a9a6910576474c747e9ad86313
/chado-pg-orm/src/org/irri/iric/chado/so/FiveMethyldihydrouridineHome.java
69a4d9a1093d114bf69c9ac0e23db3eeada8ec1d
[]
no_license
iric-irri/portal
5385c6a4e4fd3e569f5334e541d4b852edc46bc1
b2d3cd64be8d9d80b52d21566f329eeae46d9749
refs/heads/master
2021-01-16T00:28:30.272064
2014-05-26T05:46:30
2014-05-26T05:46:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,899
java
package org.irri.iric.chado.so; // Generated 05 26, 14 1:32:32 PM by Hibernate Tools 3.4.0.CR1 import java.util.List; import javax.naming.InitialContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.LockMode; import org.hibernate.SessionFactory; import org.hibernate.criterion.Example; /** * Home object for domain model class FiveMethyldihydrouridine. * @see org.irri.iric.chado.so.FiveMethyldihydrouridine * @author Hibernate Tools */ public class FiveMethyldihydrouridineHome { private static final Log log = LogFactory .getLog(FiveMethyldihydrouridineHome.class); private final SessionFactory sessionFactory = getSessionFactory(); protected SessionFactory getSessionFactory() { try { return (SessionFactory) new InitialContext() .lookup("SessionFactory"); } catch (Exception e) { log.error("Could not locate SessionFactory in JNDI", e); throw new IllegalStateException( "Could not locate SessionFactory in JNDI"); } } public void persist(FiveMethyldihydrouridine transientInstance) { log.debug("persisting FiveMethyldihydrouridine instance"); try { sessionFactory.getCurrentSession().persist(transientInstance); log.debug("persist successful"); } catch (RuntimeException re) { log.error("persist failed", re); throw re; } } public void attachDirty(FiveMethyldihydrouridine instance) { log.debug("attaching dirty FiveMethyldihydrouridine instance"); try { sessionFactory.getCurrentSession().saveOrUpdate(instance); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } } public void attachClean(FiveMethyldihydrouridine instance) { log.debug("attaching clean FiveMethyldihydrouridine instance"); try { sessionFactory.getCurrentSession().lock(instance, LockMode.NONE); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } } public void delete(FiveMethyldihydrouridine persistentInstance) { log.debug("deleting FiveMethyldihydrouridine instance"); try { sessionFactory.getCurrentSession().delete(persistentInstance); log.debug("delete successful"); } catch (RuntimeException re) { log.error("delete failed", re); throw re; } } public FiveMethyldihydrouridine merge( FiveMethyldihydrouridine detachedInstance) { log.debug("merging FiveMethyldihydrouridine instance"); try { FiveMethyldihydrouridine result = (FiveMethyldihydrouridine) sessionFactory .getCurrentSession().merge(detachedInstance); log.debug("merge successful"); return result; } catch (RuntimeException re) { log.error("merge failed", re); throw re; } } public FiveMethyldihydrouridine findById( org.irri.iric.chado.so.FiveMethyldihydrouridineId id) { log.debug("getting FiveMethyldihydrouridine instance with id: " + id); try { FiveMethyldihydrouridine instance = (FiveMethyldihydrouridine) sessionFactory .getCurrentSession().get( "org.irri.iric.chado.so.FiveMethyldihydrouridine", id); if (instance == null) { log.debug("get successful, no instance found"); } else { log.debug("get successful, instance found"); } return instance; } catch (RuntimeException re) { log.error("get failed", re); throw re; } } public List findByExample(FiveMethyldihydrouridine instance) { log.debug("finding FiveMethyldihydrouridine instance by example"); try { List results = sessionFactory .getCurrentSession() .createCriteria( "org.irri.iric.chado.so.FiveMethyldihydrouridine") .add(Example.create(instance)).list(); log.debug("find by example successful, result size: " + results.size()); return results; } catch (RuntimeException re) { log.error("find by example failed", re); throw re; } } }
[ "locem@berting-debian.ourwebserver.no-ip.biz" ]
locem@berting-debian.ourwebserver.no-ip.biz
9bc62d00f2d83dbb3ed97e88fa804467f461fea4
13639b9aa91611cbd03301db41cdc33a5ed4986a
/lichkin-projects-core-admin/src/main/java/com/lichkin/application/apis/api10003/I/n00/I.java
9d453e5c4a4a5243950ffb00aa40109a5ce250e7
[ "MIT" ]
permissive
LichKinContributor/lichkin-projects-core
95fe3c36d2a754996fc6688ee2d725ffbf802982
2acc0c430b3107f0ef9b01fca16e58e95460d839
refs/heads/master
2020-03-30T01:13:14.117132
2019-05-21T14:58:13
2019-05-21T14:58:13
150,565,436
0
0
null
null
null
null
UTF-8
Java
false
false
321
java
package com.lichkin.application.apis.api10003.I.n00; import com.lichkin.framework.beans.impl.LKRequestBean; import lombok.Getter; import lombok.Setter; @Getter @Setter public class I extends LKRequestBean { private String categoryCode; private String dictCode; private String dictName; private Byte sortId; }
[ "zhuangxuxin@hotmail.com" ]
zhuangxuxin@hotmail.com
49b5ef042925931e7a99bee5f046244855dbe04b
3835bc4164a93e226aa78353f26d8620adf7e877
/macaGame/app/src/main/java/com/cindodcindy/macagame/MainActivity.java
8470afef4ae91c23c07fda2f1413b15ed73b8e9d
[]
no_license
CindoddCindy/missNiaProject
7ab53bdbd2c0845ebb0e5509e23d7105c634927c
a920e301720d83e84385471824c8bfff04df3ed8
refs/heads/main
2023-05-05T09:42:49.021397
2021-06-01T06:35:04
2021-06-01T06:35:04
372,021,220
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package com.cindodcindy.macagame; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "cindodcindy@gmail.com" ]
cindodcindy@gmail.com
29af6fa99392b39d80daef038728e33faf4b3ef5
6199fff8d8cb7fa3f2965afd91e2fc343eb1f4ef
/modules/liberty/src/main/java/org/testcontainers/containers/liberty/LibertyAdapter.java
4de2abe07cbbdcd012a546f493cb309b429d6f72
[ "Apache-2.0" ]
permissive
ryanesch/microshed-testing
f94c5219a8951d7bc7e2a0c61ca458989ce3e583
4a491f688707f2e5c2736ffdc155018fb84872a4
refs/heads/master
2020-09-10T14:58:58.528206
2019-11-11T21:13:04
2019-11-11T21:13:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,048
java
/* * Copyright (c) 2019 IBM Corporation and others * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. * * 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.testcontainers.containers.liberty; import java.io.File; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.microshed.testing.testcontainers.spi.ServerAdapter; import org.testcontainers.images.builder.ImageFromDockerfile; public class LibertyAdapter implements ServerAdapter { private static String BASE_DOCKER_IMAGE = "open-liberty:microProfile3"; private static final String CONFIG_FILE_PROP = "MICROSHED_TEST_LIBERTY_CONFIG_FILE"; public static String getBaseDockerImage() { return BASE_DOCKER_IMAGE; } public static void setBaseDockerImage(String imageName) { BASE_DOCKER_IMAGE = imageName; } @Override public int getPriority() { return PRIORITY_RUNTIME_MODULE; } @Override public int getDefaultHttpPort() { return 9080; } @Override public int getDefaultHttpsPort() { return 9443; } @Override public void setConfigProperties(Map<String, String> properties) { String MP_TEST_CONFIG_FILE = System.getProperty(CONFIG_FILE_PROP, System.getenv(CONFIG_FILE_PROP)); Path configFile = null; if (MP_TEST_CONFIG_FILE == null) { String WLP_USR_DIR = System.getProperty("WLP_USR_DIR", System.getenv("WLP_USR_DIR")); if (WLP_USR_DIR == null) WLP_USR_DIR = System.getProperty("wlp.user.dir"); if (WLP_USR_DIR == null) throw new IllegalStateException("The 'w.p.user.dir', 'WLP_USR_DIR', or '" + CONFIG_FILE_PROP + "' property must be set in order to dynamically set config properties"); Path usrDir = Paths.get(WLP_USR_DIR); configFile = usrDir.resolve("servers/defaultServer/configDropins/defaults/system-test-vars.xml"); } else { configFile = Paths.get(MP_TEST_CONFIG_FILE); } configFile.getParent().toFile().mkdirs(); // TODO: Liberty server.xml only supports MP JWT variables with dots but not underscores if (properties.containsKey("mp_jwt_verify_publickey")) properties.put("mp.jwt.verify.publickey", properties.remove("mp_jwt_verify_publickey")); if (properties.containsKey("mp_jwt_verify_issuer")) properties.put("mp.jwt.verify.issuer", properties.remove("mp_jwt_verify_issuer")); List<String> lines = new ArrayList<>(properties.size() + 2); lines.add("<server>"); // <variable name="foo" value="bar"/> properties.forEach((k, v) -> lines.add(" <variable name=\"" + k + "\" value=\"" + v + "\"/>")); lines.add("</server>"); try { Files.write(configFile, lines, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); Thread.sleep(500); // wait for configuration updates } catch (Exception e) { throw new RuntimeException("Unable to write configuration to " + configFile, e); } } @Override public ImageFromDockerfile getDefaultImage(File appFile) { final String appName = appFile.getName(); final File configDir = new File("src/main/liberty/config"); final boolean configDirExists = configDir.exists() && configDir.canRead(); // Compose a docker image equivalent to doing: // FROM open-liberty:microProfile3 // COPY src/main/liberty/config /config/ // ADD build/libs/<appFile> /config/dropins ImageFromDockerfile image = new ImageFromDockerfile() .withDockerfileFromBuilder(builder -> { builder.from(getBaseDockerImage()); if (configDirExists) { builder.copy("/config", "/config"); } builder.add("/config/dropins/" + appName, "/config/dropins/" + appName); builder.build(); }) .withFileFromFile("/config/dropins/" + appName, appFile); if (configDirExists) image.withFileFromFile("/config", configDir); return image; } }
[ "andy.guibert@gmail.com" ]
andy.guibert@gmail.com
ce191bb5f24eee9cfa21067da247b036cd941488
3362a1396fdd4193441bec57b8e345bfb5391788
/src/main/java/org/the/force/thirdparty/druid/sql/dialect/mysql/ast/statement/MySqlPartitionByKey.java
ee466a8fbaf606ddf17c464a6ca07b7332bfb665
[]
no_license
xuji1122/jdbc-partition
23b5c1a73eb6e728bfb08b91f3c0dff07f1a16ef
a2510b58f5d6083b52122d78700c34d84fe2ad2d
refs/heads/master
2021-01-01T17:31:14.591369
2018-07-02T09:05:29
2018-07-02T09:05:29
98,094,329
7
3
null
null
null
null
UTF-8
Java
false
false
2,179
java
/* * Copyright 1999-2017 Alibaba Group Holding Ltd. * * 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.the.force.thirdparty.druid.sql.dialect.mysql.ast.statement; import org.the.force.thirdparty.druid.sql.ast.SQLName; import org.the.force.thirdparty.druid.sql.dialect.mysql.ast.MySqlObject; import org.the.force.thirdparty.druid.sql.dialect.mysql.visitor.MySqlASTVisitor; import org.the.force.thirdparty.druid.sql.ast.SQLPartitionBy; import org.the.force.thirdparty.druid.sql.visitor.SQLASTVisitor; import java.util.ArrayList; import java.util.List; public class MySqlPartitionByKey extends SQLPartitionBy implements MySqlObject { private List<SQLName> columns = new ArrayList<SQLName>(); @Override protected void accept0(SQLASTVisitor visitor) { if (visitor instanceof MySqlASTVisitor) { accept0((MySqlASTVisitor) visitor); } else { throw new IllegalArgumentException("not support visitor type : " + visitor.getClass().getName()); } } @Override public void accept0(MySqlASTVisitor visitor) { if (visitor.visit(this)) { acceptChild(visitor, columns); acceptChild(visitor, partitionsCount); acceptChild(visitor, getPartitions()); acceptChild(visitor, subPartitionBy); } visitor.endVisit(this); } public List<SQLName> getColumns() { return columns; } public void addColumn(SQLName column) { if (column != null) { column.setParent(this); } this.columns.add(column); } }
[ "xuji@xujideMacBook-Pro.local" ]
xuji@xujideMacBook-Pro.local
f472bca600b10fff7842314303b2c415635242eb
2f49e2f63dea85d62aa1a56b12d103d8bab0bee3
/EasyMPermission/src/core/lombok/package-info.java
5e34c914e1ea09289442ba5a88a473c12eb9917e
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
mobmead/EasyMPermission
9837a0bbb1c6f6b33a6905fd7e60ffb921484b27
e373737c4c9d9494a25f3700654022c155d027fc
refs/heads/master
2021-01-18T20:30:06.222457
2015-11-12T17:45:18
2015-11-12T17:45:18
39,174,977
62
12
null
null
null
null
UTF-8
Java
false
false
1,771
java
/* * Copyright (C) 2009-2014 The Project Lombok Authors. * * 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. */ /** * This package contains all the annotations and support classes you need as a user of lombok. * All other packages are only relevant to those who are extending lombok for their own uses, except: * * <ul> * <li>{@code lombok.extern.*} – These packages contains lombok annotations that solve boilerplate issues for libraries not part of the JRE itself. * <li>{@code lombok.experimental} – This package contains lombok features that are new or likely to change before committing to long-term support. * </ul> * * @see <a href="https://projectlombok.org/features/index.html">Lombok features</a> */ package lombok;
[ "jian@mobmead.com" ]
jian@mobmead.com
6e5461f8725aede06be2d25f1009af2ef0a67ac0
d00958862bdeab0de6eafb29625be92ca5fda62e
/src/com/rashmi/oops/practice/example/EncapsulationDemo.java
44901ce579f46c2e32028c0782b1d7a1d59f0f12
[]
no_license
mrashmi791/Practice_Program
9b556fb8014cd579d28252575c5809e2cae7a71f
866180429b00d1e337df48eafeac86b17a7b3ccb
refs/heads/master
2022-06-30T20:41:42.936447
2020-05-13T10:03:22
2020-05-13T10:03:22
243,255,292
0
0
null
null
null
null
UTF-8
Java
false
false
609
java
package com.rashmi.oops.practice.example; class Person { private double id; private String name; public Person() { id = Math.random(); message(); } private void message() { System.out.println("hii "+getId()); } public double getId() { return id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } public class EncapsulationDemo { public static void main(String[] args) { Person p1 = new Person(); p1.setName("Rashmi"); System.out.println(p1.getId() + " "+p1.getName()); } }
[ "mrashmi791@gmail.com" ]
mrashmi791@gmail.com
1e34f26a721f0773f317e16f3f8e67105b018a27
71cbe0607ed77a86649e1de8ec8ab8df1fefb1c3
/src/main/java/com/jieweifu/common/utils/AliyunOSSClientUtil.java
66d85cc15f12fb2f8b55e283cc6d6c523c1c4cf1
[]
no_license
surick/cms
8b542ca627c7e0a27bf6cc6d187603806594b11d
8de9b0eb8ef79834e6ef37a9bd497c341eaf8732
refs/heads/master
2020-04-07T20:15:10.135569
2019-05-16T09:40:07
2019-05-16T09:40:07
158,681,070
0
0
null
null
null
null
UTF-8
Java
false
false
7,391
java
package com.jieweifu.common.utils; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import org.apache.log4j.Logger; import com.aliyun.oss.OSSClient; import com.aliyun.oss.model.Bucket; import com.aliyun.oss.model.OSSObject; import com.aliyun.oss.model.ObjectMetadata; import com.aliyun.oss.model.PutObjectResult; import org.springframework.stereotype.Service; @Service public class AliyunOSSClientUtil { private static Logger logger = Logger.getLogger(AliyunOSSClientUtil.class); //阿里云API的内或外网域名 private static String ENDPOINT; //阿里云API的密钥Access Key ID private static String ACCESS_KEY_ID; //阿里云API的密钥Access Key Secret private static String ACCESS_KEY_SECRET; //阿里云API的bucket名称 private static String BACKET_NAME; //阿里云API的文件夹名称 private static String FOLDER; //初始化属性 static { ENDPOINT = OSSClientConstants.ENDPOINT; ACCESS_KEY_ID = OSSClientConstants.ACCESS_KEY_ID; ACCESS_KEY_SECRET = OSSClientConstants.ACCESS_KEY_SECRET; BACKET_NAME = OSSClientConstants.BACKET_NAME; FOLDER = OSSClientConstants.FOLDER; } public static OSSClient getOSSClient(){ return new OSSClient(ENDPOINT,ACCESS_KEY_ID, ACCESS_KEY_SECRET); } /** * 创建存储空间 * * @param ossClient OSS连接 * @param bucketName 存储空间 * @return */ public static String createBucketName(OSSClient ossClient, String bucketName) { //存储空间 final String bucketNames = bucketName; if (!ossClient.doesBucketExist(bucketName)) { //创建存储空间 Bucket bucket = ossClient.createBucket(bucketName); logger.info("创建存储空间成功"); return bucket.getName(); } return bucketNames; } /** * 删除存储空间buckName * * @param ossClient oss对象 * @param bucketName 存储空间 */ public static void deleteBucket(OSSClient ossClient, String bucketName) { ossClient.deleteBucket(bucketName); logger.info("删除" + bucketName + "Bucket成功"); } /** * 创建模拟文件夹 * * @param ossClient oss连接 * @param bucketName 存储空间 * @param folder 模拟文件夹名如"qj_nanjing/" * @return 文件夹名 */ public static String createFolder(OSSClient ossClient, String bucketName, String folder) { //文件夹名 final String keySuffixWithSlash = folder; //判断文件夹是否存在,不存在则创建 if (!ossClient.doesObjectExist(bucketName, keySuffixWithSlash)) { //创建文件夹 ossClient.putObject(bucketName, keySuffixWithSlash, new ByteArrayInputStream(new byte[0])); logger.info("创建文件夹成功"); //得到文件夹名 OSSObject object = ossClient.getObject(bucketName, keySuffixWithSlash); String fileDir = object.getKey(); return fileDir; } return keySuffixWithSlash; } /** * 根据key删除OSS服务器上的文件 * * @param ossClient oss连接 * @param bucketName 存储空间 * @param folder 模拟文件夹名 如"qj_nanjing/" * @param key Bucket下的文件的路径名+文件名 如:"upload/cake.jpg" */ public static void deleteFile(OSSClient ossClient, String bucketName, String folder, String key) { ossClient.deleteObject(bucketName, folder + key); logger.info("删除" + bucketName + "下的文件" + folder + key + "成功"); } /** * 上传图片至OSS * * @param file 上传文件(文件全路径如:D:\\image\\cake.jpg) * @return String 返回的唯一MD5数字签名 */ public static String uploadObject2OSS(File file) { String resultStr = null; try { //以输入流的形式上传文件 InputStream is = new FileInputStream(file); //文件名 String fileName = file.getName(); //文件大小 Long fileSize = file.length(); //创建上传Object的Metadata ObjectMetadata metadata = new ObjectMetadata(); //上传的文件的长度 metadata.setContentLength(is.available()); //指定该Object被下载时的网页的缓存行为 metadata.setCacheControl("no-cache"); //指定该Object下设置Header metadata.setHeader("Pragma", "no-cache"); //指定该Object被下载时的内容编码格式 metadata.setContentEncoding("utf-8"); //文件的MIME,定义文件的类型及网页编码,决定浏览器将以什么形式、什么编码读取文件。如果用户没有指定则根据Key或文件名的扩展名生成, //如果没有扩展名则填默认值application/octet-stream metadata.setContentType(getContentType(fileName)); //指定该Object被下载时的名称(指示MINME用户代理如何显示附加的文件,打开或下载,及文件名称) metadata.setContentDisposition("filename/filesize=" + fileName + "/" + fileSize + "Byte."); //上传文件 (上传文件流的形式) OSSClient ossClient = getOSSClient(); PutObjectResult putResult = ossClient.putObject(BACKET_NAME, FOLDER + fileName, is, metadata); //解析结果 resultStr = putResult.getETag(); } catch (Exception e) { e.printStackTrace(); logger.error("上传阿里云OSS服务器异常." + e.getMessage(), e); } return resultStr; } /** * 通过文件名判断并获取OSS服务文件上传时文件的contentType * * @param fileName 文件名 * @return 文件的contentType */ public static String getContentType(String fileName) { //文件的后缀名 String fileExtension = fileName.substring(fileName.lastIndexOf(".")); if (".bmp".equalsIgnoreCase(fileExtension)) { return "image/bmp"; } if (".gif".equalsIgnoreCase(fileExtension)) { return "image/gif"; } if (".jpeg".equalsIgnoreCase(fileExtension) || ".jpg".equalsIgnoreCase(fileExtension) || ".png".equalsIgnoreCase(fileExtension)) { return "image/jpeg"; } if (".html".equalsIgnoreCase(fileExtension)) { return "text/html"; } if (".txt".equalsIgnoreCase(fileExtension)) { return "text/plain"; } if (".vsd".equalsIgnoreCase(fileExtension)) { return "application/vnd.visio"; } if (".ppt".equalsIgnoreCase(fileExtension) || "pptx".equalsIgnoreCase(fileExtension)) { return "application/vnd.ms-powerpoint"; } if (".doc".equalsIgnoreCase(fileExtension) || "docx".equalsIgnoreCase(fileExtension)) { return "application/msword"; } if (".xml".equalsIgnoreCase(fileExtension)) { return "text/xml"; } //默认返回类型 return "image/jpeg"; } }
[ "jk103@qq.com" ]
jk103@qq.com
4939f452a949764b319feb86f2a67f2c42f8f077
33ba5d97d7f9610e89d40899657bf24aa3a8cbe7
/web/src/main/java/de/hpfsc/web/panels/BorderLayoutExample.java
56c44946f1d5457f78a19a6b35e9c2d05fba8c12
[ "LicenseRef-scancode-public-domain" ]
permissive
dmitrybilyk/timers
8f5b46fa1ce2ee54e06d06fcfa89c02689b81806
841c98b4326c813d025009063a00b4c592471e79
refs/heads/master
2021-01-10T13:00:46.340034
2016-02-19T14:57:41
2016-02-19T14:57:41
43,221,484
0
0
null
null
null
null
UTF-8
Java
false
false
7,970
java
package de.hpfsc.web.panels; import com.extjs.gxt.ui.client.Style.LayoutRegion; import com.extjs.gxt.ui.client.event.ButtonEvent; import com.extjs.gxt.ui.client.event.SelectionListener; import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.HorizontalPanel; import com.extjs.gxt.ui.client.widget.LayoutContainer; import com.extjs.gxt.ui.client.widget.button.Button; import com.extjs.gxt.ui.client.widget.form.LabelField; import com.extjs.gxt.ui.client.widget.layout.BorderLayout; import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData; import com.extjs.gxt.ui.client.widget.layout.CenterLayout; import com.google.gwt.dom.client.Style; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.RootPanel; import de.hpfsc.shared.Client; import de.hpfsc.shared.WhoseSessionEnum; import de.hpfsc.web.anticafe.DialogExample; import de.hpfsc.web.anticafe.WidgetRenderingExample; import de.hpfsc.web.dialogs.LoginDialog; public class BorderLayoutExample extends LayoutContainer { String userName; LayoutContainer eastContainer; public LayoutContainer getEast() { return eastContainer; } LayoutContainer centerLayoutContainer; public LayoutContainer getCenter() { return centerLayoutContainer; } LayoutContainer westLayoutContainer; public LayoutContainer getWest() { return westLayoutContainer; } public BorderLayoutExample(String userName) { this.userName = userName; } public BorderLayoutExample() { } protected void onRender(Element target, int index) { super.onRender(target, index); final BorderLayout layout = new BorderLayout(); setHeight(1200); setLayout(layout); // setStyleAttribute("padding", "10px"); final ContentPanel north = new ContentPanel(); // north.setLayout(new CenterLayout()); north.addStyleName("content-panel"); north.setWidth(600); north.setHeight("100%"); Button createSessionButton = new Button("Создать сессию"); createSessionButton.setWidth("100%"); createSessionButton.setHeight(50); createSessionButton.addSelectionListener(new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { DialogExample dialogExample = new DialogExample(WhoseSessionEnum.valueOf(userName.toUpperCase()), new Client(), null); // dialogExample.setWidth(300); // dialogExample.setHeight(200); dialogExample.show(); // north.add(new ClientSessionPanel(WhoseSessionEnum.ADMIN, -1, "", "", System.currentTimeMillis(), false)); // north.layout(); } }); // north.add(new SessionsGrid(), new BorderLayoutData(LayoutRegion.CENTER, 350)); north.removeStyleName("admin-style"); north.removeStyleName("first-user-style"); north.removeStyleName("second-user-style"); if (userName.equals("admin")) { north.addStyleName("admin-style"); } else if (userName.equals("first")){ north.addStyleName("first-user-style"); } else if (userName.equals("second")) { north.addStyleName("second-user-style"); } north.add(new WidgetRenderingExample(userName, BorderLayoutExample.this), new BorderLayoutData(LayoutRegion.CENTER, 350)); north.add(createSessionButton, new BorderLayoutData(LayoutRegion.SOUTH, 100)); ContentPanel west = new ContentPanel(); westLayoutContainer = new LayoutContainer(); westLayoutContainer.addStyleName("align-center"); west.setHeight(200); west.setHeaderVisible(true); west.setHeadingHtml("Инфо"); westLayoutContainer.add(new LabelField("Имя пользователя здесь")); west.add(westLayoutContainer); Button logoutButton = new Button("Выход"); logoutButton.addSelectionListener(new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { RootPanel.get().clear(); ContentPanel centerPanel = new ContentPanel(); centerPanel.setHeaderVisible(false); centerPanel.setLayout(new CenterLayout()); centerPanel.add(new LoginDialog()); centerPanel.setHeight(500); centerPanel.setWidth("100%"); RootPanel.get().add(centerPanel); } }); west.add(logoutButton); ContentPanel center = new ContentPanel(); center.setHeaderVisible(true); center.setHeight(200); center.setWidth(500); centerLayoutContainer = new HorizontalPanel(); centerLayoutContainer.addStyleName("align-center"); center.add(centerLayoutContainer); center.setHeadingHtml("Диапазон дат"); // center.setScrollMode(Scroll.AUTOX); // FlexTable table = new FlexTable(); // table.getElement().getStyle().setProperty("margin", "10px"); // table.setCellSpacing(8); // table.setCellPadding(4); // for (int i = 0; i < LayoutRegion.values().length; i++) { // final LayoutRegion r = LayoutRegion.values()[i]; // if (r == LayoutRegion.CENTER) { // continue; // } // SelectionListener<ButtonEvent> sl = new SelectionListener<ButtonEvent>() { // // @Override // public void componentSelected(ButtonEvent ce) { // String txt = ce.getButton().getHtml(); // if (txt.equals("Expand")) { // layout.expand(r); // } else if (txt.equals("Collapse")) { // layout.collapse(r); // } else if (txt.equals("Show")) { // layout.show(r); // } else { // layout.hide(r); // } // // } // }; //// table.setHTML(i, 0, "<div style='font-size: 12px; width: 100px'>" + r.name() + ":</span>"); //// table.setWidget(i, 1, new Button("Expand", sl)); //// table.setWidget(i, 2, new Button("Collapse", sl)); //// table.setWidget(i, 3, new Button("Show", sl)); //// table.setWidget(i, 4, new Button("Hide", sl)); // } // center.add(table); ContentPanel east = new ContentPanel(); eastContainer = new LayoutContainer(); eastContainer.addStyleName("align-center"); eastContainer.getElement().getStyle().setTextAlign(Style.TextAlign.CENTER); eastContainer.getElement().getStyle().setFontSize(20, Style.Unit.PX); east.getElement().getStyle().setTextAlign(Style.TextAlign.CENTER); east.getElement().getStyle().setFontSize(16, Style.Unit.PX); east.setHeaderVisible(true); east.setHeadingHtml("Итоги"); east.setHeight(200); east.add(eastContainer); eastContainer.add(new LabelField("Сумма всего:")); ContentPanel south = new ContentPanel(); // south.setWidth(600); south.setHeaderVisible(false); south.add(new LabelField("south")); BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 400); north.setHeaderVisible(true); north.setHeadingHtml("Таймеры"); // northData.setCollapsible(true); // northData.setFloatable(true); // northData.setHideCollapseTool(true); northData.setSplit(true); // northData.setMargins(new Margins(0, 0, 5, 0)); BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST); // westData.setSplit(true); // westData.setCollapsible(true); // westData.setMargins(new Margins(0,5,0,0)); BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER); // centerData.setMargins(new Margins(0)); BorderLayoutData eastData = new BorderLayoutData(LayoutRegion.EAST); // eastData.setSplit(true); // eastData.setCollapsible(true); // eastData.setMargins(new Margins(0,0,0,5)); BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH); // southData.setSplit(true); // southData.setCollapsible(true); // southData.setFloatable(true); // southData.setMargins(new Margins(5, 0, 0, 0)); add(north, northData); add(west, westData); add(center, centerData); add(east, eastData); // add(south, southData); } }
[ "dmitry.b@scopicsoftware.com" ]
dmitry.b@scopicsoftware.com
feff0e3da425d2faff0c10958bd20f59adfb43fe
fdc1a3e6e6746ca53739a489ef3a662dd05c3c60
/src/main/java/com/mrbonono63/create/content/contraptions/components/structureMovement/piston/MechanicalPistonGenerator.java
8fbd33140f61c7ab2d5367c05bac7fbe689fda0f
[ "MIT" ]
permissive
Bonono63/Create---Fabric-Edition
197babf8a008144e742616a7f8a6c7a19b61d307
94d03047a9fba5d4346e0be91353a8d7dbd3a709
refs/heads/master
2023-04-04T17:17:59.443779
2021-04-17T00:54:39
2021-04-17T00:54:39
249,259,508
9
3
null
null
null
null
UTF-8
Java
false
false
1,995
java
package com.mrbonono63.create.content.contraptions.components.structureMovement.piston; import com.mrbonono63.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.PistonState; import com.mrbonono63.create.foundation.data.SpecialBlockStateGen; import com.tterrag.registrate.providers.DataGenContext; import com.tterrag.registrate.providers.RegistrateBlockstateProvider; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.PistonBlock; import net.minecraft.state.properties.PistonType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraftforge.client.model.generators.ModelFile; public class MechanicalPistonGenerator extends SpecialBlockStateGen { private final PistonType type; public MechanicalPistonGenerator(PistonType type) { this.type = type; } @Override protected int getXRotation(BlockState state) { Direction facing = state.get(MechanicalPistonBlock.FACING); return facing.getAxis() .isVertical() ? facing == Direction.DOWN ? 180 : 0 : 90; } @Override protected int getYRotation(BlockState state) { Direction facing = state.get(MechanicalPistonBlock.FACING); return facing.getAxis() .isVertical() ? 0 : horizontalAngle(facing) + 180; } @Override public <T extends Block> ModelFile getModel(DataGenContext<Block, T> ctx, RegistrateBlockstateProvider prov, BlockState state) { Direction facing = state.get(PistonBlock.FACING); boolean axisAlongFirst = state.get(MechanicalPistonBlock.AXIS_ALONG_FIRST_COORDINATE); PistonState pistonState = state.get(MechanicalPistonBlock.STATE); String path = "block/mechanical_piston"; String folder = pistonState == PistonState.RETRACTED ? type.getString() : pistonState.getString(); String partial = facing.getAxis() == Axis.X ^ axisAlongFirst ? "block_rotated" : "block"; return prov.models() .getExistingFile(prov.modLoc(path + "/" + folder + "/" + partial)); } }
[ "bonoria63@gmail.com" ]
bonoria63@gmail.com
05187644a2e83724934c9b2400af601a903009bd
fd27d6a119631663476b8d0cd158ed7d9ab0ce43
/java/request-url-parser/src/main/java-generated/ws/epigraph/url/parser/psi/impl/UrlReqModelPathImpl.java
c0da61617d61901cb3c872472fa2bc6e34999a9c
[ "Apache-2.0" ]
permissive
SumoLogic/epigraph
e3afd43a90d97a31131f0ee87a49a5e1d516209d
c099be0802c683a02dd8651a3540288650f5449c
refs/heads/master
2021-05-01T06:43:06.624523
2019-03-06T21:13:32
2019-03-06T21:13:32
54,748,632
3
2
null
null
null
null
UTF-8
Java
false
false
2,068
java
/* * Copyright 2017 Sumo Logic * * 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. */ // This is a generated file. Not intended for manual editing. package ws.epigraph.url.parser.psi.impl; import java.util.List; import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; import static ws.epigraph.url.lexer.UrlElementTypes.*; import com.intellij.extapi.psi.ASTWrapperPsiElement; import ws.epigraph.url.parser.psi.*; public class UrlReqModelPathImpl extends ASTWrapperPsiElement implements UrlReqModelPath { public UrlReqModelPathImpl(ASTNode node) { super(node); } public void accept(@NotNull UrlVisitor visitor) { visitor.visitReqModelPath(this); } public void accept(@NotNull PsiElementVisitor visitor) { if (visitor instanceof UrlVisitor) accept((UrlVisitor)visitor); else super.accept(visitor); } @Override @NotNull public List<UrlReqAnnotation> getReqAnnotationList() { return PsiTreeUtil.getChildrenOfTypeAsList(this, UrlReqAnnotation.class); } @Override @Nullable public UrlReqMapModelPath getReqMapModelPath() { return findChildByClass(UrlReqMapModelPath.class); } @Override @NotNull public List<UrlReqParam> getReqParamList() { return PsiTreeUtil.getChildrenOfTypeAsList(this, UrlReqParam.class); } @Override @Nullable public UrlReqRecordModelPath getReqRecordModelPath() { return findChildByClass(UrlReqRecordModelPath.class); } }
[ "konstantin@sumologic.com" ]
konstantin@sumologic.com
ad79f98ea8ad11c55c37a7077c0ef70eb458b8f8
443928d406ef51efd35020de050decd8151dae9b
/asnlab-uper/src/main/java/com/hisense/hiatmp/asn/v2x/MapLane/Position_LL_28B.java
eaa7b972fd6812260d2808d750d9880faf74b729
[ "Apache-2.0" ]
permissive
zyjohn0822/asn1-uper-v2x-se
ad430889ca9f3d42f2c083810df2a5bc7b18ec22
85f9bf98a12a57a04260282a9154f1b988de8dec
refs/heads/master
2023-04-21T11:44:34.222501
2021-05-08T08:23:27
2021-05-08T08:23:27
365,459,042
2
1
null
null
null
null
UTF-8
Java
false
false
2,156
java
/* * Generated by ASN.1 Java Compiler (https://www.asnlab.org/) * From ASN.1 module "DefPositionOffset" */ package com.hisense.hiatmp.asn.v2x.MapLane; import org.asnlab.asndt.runtime.conv.AnnotationCompositeConverter; import org.asnlab.asndt.runtime.conv.AsnConverter; import org.asnlab.asndt.runtime.conv.CompositeConverter; import org.asnlab.asndt.runtime.conv.EncodingRules; import org.asnlab.asndt.runtime.conv.annotation.Component; import org.asnlab.asndt.runtime.type.AsnType; import javax.validation.constraints.NotNull; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Position_LL_28B { public final static AsnType TYPE = MapLane.type(458784); public final static CompositeConverter CONV; static { CONV = new AnnotationCompositeConverter(Position_LL_28B.class); AsnConverter lonConverter = OffsetLL_B14.CONV; AsnConverter latConverter = OffsetLL_B14.CONV; CONV.setComponentConverters(new AsnConverter[]{lonConverter, latConverter}); } @NotNull @Component(0) public Integer lon; @NotNull @Component(1) public Integer lat; public static Position_LL_28B ber_decode(InputStream in) throws IOException { return (Position_LL_28B) TYPE.decode(in, EncodingRules.BASIC_ENCODING_RULES, CONV); } public static Position_LL_28B per_decode(boolean align, InputStream in) throws IOException { return (Position_LL_28B) TYPE.decode(in, align ? EncodingRules.ALIGNED_PACKED_ENCODING_RULES : EncodingRules.UNALIGNED_PACKED_ENCODING_RULES, CONV); } public boolean equals(Object obj) { if (!(obj instanceof Position_LL_28B)) { return false; } return TYPE.equals(this, obj, CONV); } public void ber_encode(OutputStream out) throws IOException { TYPE.encode(this, EncodingRules.BASIC_ENCODING_RULES, CONV, out); } public void per_encode(boolean align, OutputStream out) throws IOException { TYPE.encode(this, align ? EncodingRules.ALIGNED_PACKED_ENCODING_RULES : EncodingRules.UNALIGNED_PACKED_ENCODING_RULES, CONV, out); } }
[ "31430762+zyjohn0822@users.noreply.github.com" ]
31430762+zyjohn0822@users.noreply.github.com
d7f0cc110493ec38f3015e406594628e6a1c22bb
597b0daa76ba28adf45359b5aa09cef5886f0e29
/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/AbstractJpaVendorAdapter.java
8f31b12ec09a8dde67c6682a4e76d9be6e255a4a
[ "Apache-2.0" ]
permissive
wjmwss-zz/spring
78e579e3ec4abc983aa80a4547fadc2b654ea959
e94eb5efb79fc4bc5336d0b571609c141d35d5cb
refs/heads/master
2023-02-21T09:26:25.768420
2021-01-23T19:04:30
2021-01-23T19:04:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,888
java
/* * Copyright 2002-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 org.springframework.orm.jpa.vendor; import org.springframework.lang.Nullable; import org.springframework.orm.jpa.JpaDialect; import org.springframework.orm.jpa.JpaVendorAdapter; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.spi.PersistenceUnitInfo; import java.util.Collections; import java.util.Map; /** * Abstract {@link JpaVendorAdapter} implementation that defines common properties, * to be translated into vendor-specific JPA properties by concrete subclasses. * * @author Juergen Hoeller * @author Rod Johnson * @since 2.0 */ public abstract class AbstractJpaVendorAdapter implements JpaVendorAdapter { private Database database = Database.DEFAULT; @Nullable private String databasePlatform; private boolean generateDdl = false; private boolean showSql = false; /** * Specify the target database to operate on, as a value of the {@code Database} enum: * DB2, DERBY, H2, HANA, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE * <p><b>NOTE:</b> This setting will override your JPA provider's default algorithm. * Custom vendor properties may still fine-tune the database dialect. However, * there may nevertheless be conflicts: For example, specify either this setting * or Hibernate's "hibernate.dialect_resolvers" property, not both. */ public void setDatabase(Database database) { this.database = database; } /** * Return the target database to operate on. */ protected Database getDatabase() { return this.database; } /** * Specify the name of the target database to operate on. * The supported values are vendor-dependent platform identifiers. */ public void setDatabasePlatform(@Nullable String databasePlatform) { this.databasePlatform = databasePlatform; } /** * Return the name of the target database to operate on. */ @Nullable protected String getDatabasePlatform() { return this.databasePlatform; } /** * Set whether to generate DDL after the EntityManagerFactory has been initialized, * creating/updating all relevant tables. * <p>Note that the exact semantics of this flag depend on the underlying * persistence provider. For any more advanced needs, specify the appropriate * vendor-specific settings as "jpaProperties". * <p><b>NOTE: Do not set this flag to 'true' while also setting JPA 2.1's * {@code javax.persistence.schema-generation.database.action} property.</b> * These two schema generation mechanisms - standard JPA versus provider-native - * are mutually exclusive, e.g. with Hibernate 5. * @see org.springframework.orm.jpa.AbstractEntityManagerFactoryBean#setJpaProperties */ public void setGenerateDdl(boolean generateDdl) { this.generateDdl = generateDdl; } /** * Return whether to generate DDL after the EntityManagerFactory has been initialized * creating/updating all relevant tables. */ protected boolean isGenerateDdl() { return this.generateDdl; } /** * Set whether to show SQL in the log (or in the console). * <p>For more specific logging configuration, specify the appropriate * vendor-specific settings as "jpaProperties". * @see org.springframework.orm.jpa.AbstractEntityManagerFactoryBean#setJpaProperties */ public void setShowSql(boolean showSql) { this.showSql = showSql; } /** * Return whether to show SQL in the log (or in the console). */ protected boolean isShowSql() { return this.showSql; } @Override @Nullable public String getPersistenceProviderRootPackage() { return null; } @Override public Map<String, ?> getJpaPropertyMap(PersistenceUnitInfo pui) { return getJpaPropertyMap(); } @Override public Map<String, ?> getJpaPropertyMap() { return Collections.emptyMap(); } @Override @Nullable public JpaDialect getJpaDialect() { return null; } @Override public Class<? extends EntityManagerFactory> getEntityManagerFactoryInterface() { return EntityManagerFactory.class; } @Override public Class<? extends EntityManager> getEntityManagerInterface() { return EntityManager.class; } @Override public void postProcessEntityManagerFactory(EntityManagerFactory emf) { } @Override public void postProcessEntityManager(EntityManager em) { } }
[ "wjmcoo@outlook.com" ]
wjmcoo@outlook.com
79998cd70b86ffdf1c3ee934c46a740cf06d502e
a91b7856a43b487e4e90271d00c168a5d90d3fcc
/Ftc3543Lib/src/main/java/trclib/TrcDigitalOutput.java
dd81767ed7281ff25cf243f793e41d0d324a4e24
[ "BSD-3-Clause", "MIT" ]
permissive
RoboBears5611/Ftc2019RoverRuckus
d9dbd48c747c49e0869514cb335ed7f65fcc8ce1
f397161236e1ce315d2add3caea98587ced70276
refs/heads/master
2020-03-28T20:02:11.907550
2019-04-27T02:10:28
2019-04-27T02:10:28
149,031,898
0
0
MIT
2019-01-03T19:21:52
2018-09-16T20:11:25
Java
UTF-8
Java
false
false
2,768
java
/* * Copyright (c) 2017 Titan Robotics Club (http://www.titanrobotics.com) * * 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 trclib; /** * This class implements a platform independent Digital Output port device. */ public abstract class TrcDigitalOutput { protected static final String moduleName = "TrcDigitalOutput"; protected static final boolean debugEnabled = false; protected static final boolean tracingEnabled = false; protected static final boolean useGlobalTracer = false; protected static final TrcDbgTrace.TraceLevel traceLevel = TrcDbgTrace.TraceLevel.API; protected static final TrcDbgTrace.MsgLevel msgLevel = TrcDbgTrace.MsgLevel.INFO; protected TrcDbgTrace dbgTrace = null; /** * This method is provided by the platform dependent digital output port device to set the state of the output * port. * * @param state specifies state of the output port. */ public abstract void setState(boolean state); private final String instanceName; /** * Constructor: Create an instance of the object. * * @param instanceName specifies the instance name. */ public TrcDigitalOutput(String instanceName) { if (debugEnabled) { dbgTrace = useGlobalTracer? TrcDbgTrace.getGlobalTracer(): new TrcDbgTrace(moduleName + "." + instanceName, tracingEnabled, traceLevel, msgLevel); } this.instanceName = instanceName; } //TrcDigitalOutput /** * This method returns the instance name. * * @return instance name. */ public String toString() { return instanceName; } //toString } //class TrcDigitalOutput
[ "trc492@live.com" ]
trc492@live.com