blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
3b695cb8e271935e6ab0261567cf2f43a241d2d9
1f367e3c67ecd45ccf460b387b88eb05b5a705c6
/app/src/main/java/com/gwh/customview/view/MyViewPager.java
7c31aef9a97e34637ae9c428360335954152d1bd
[]
no_license
androidgwh/CustomFlowLayout
f3b7e8ce170c8492040b1db608dc85c2d28b4855
f0c389c721c40936aa65163a0924847a61f6f5cc
refs/heads/master
2020-12-10T03:38:01.808987
2020-01-13T08:26:06
2020-01-13T08:26:06
233,491,921
1
0
null
null
null
null
UTF-8
Java
false
false
7,930
java
package com.gwh.customview.view; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.Scroller; import com.gwh.customview.R; /** * Created by JoJo on 2018/8/14. * wechat:18510829974 * description:自定义ViewPager */ public class MyViewPager extends ViewGroup { private static final String TAG = "MyViewPager"; private Context mContext; private int[] images = {R.mipmap.a, R.mipmap.b, R.mipmap.a}; private GestureDetector mGestureDetector; private Scroller mScroller; private int position; private int scrollX; private int startX; private int startY; public MyViewPager(Context context) { super(context); this.mContext = context; init(); } public MyViewPager(Context context, AttributeSet attrs) { super(context, attrs); this.mContext = context; init(); } public MyViewPager(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); this.mContext = context; init(); } private void init() { // for (int i = 0; i < images.length; i++) { // ImageView iv = new ImageView(getContext()); // iv.setBackgroundResource(images[i]); // this.addView(iv); // } // //由于ViewGroup默认只测量下面一层的子View(所以我们直接在ViewGroup里面添加ImageView是可以直接显示出来的),所以基本自定义ViewGroup都会要重写onMeasure方法,否则无法测量第一层View(这里是ScrollView)中的view,无法正常显示里面的内容。 // View testView = View.inflate(mContext, R.layout.test_viewpager_scrollview, null); // addView(testView, 2); mGestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() { @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { //相对滑动:X方向滑动多少距离,view就跟着滑动多少距离 scrollBy((int) distanceX, 0); Log.e(TAG, "onScroll " + distanceX); return super.onScroll(e1, e2, distanceX, distanceY); } }); mScroller = new Scroller(mContext); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { //如果是view:触发view的测量;如果是ViewGroup,触发测量ViewGroup中的子view getChildAt(i).measure(widthMeasureSpec, heightMeasureSpec); } } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { // 如果左右滑动, 就需要拦截, 上下滑动,不需要拦截 switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: startX = (int) ev.getX(); startY = (int) ev.getY(); mGestureDetector.onTouchEvent(ev); Log.e(TAG, "onInterceptTouchEvent ACTION_DOWN"); // return true; break; case MotionEvent.ACTION_MOVE: int endX = (int) ev.getX(); int endY = (int) ev.getY(); int dx = endX - startX; int dy = endY - startY; Log.e(TAG, "onInterceptTouchEvent ACTION_MOVE " + dx + " " + dy); if (Math.abs(dx) > Math.abs(dy)) { // 左右滑动 return true;// 中断事件传递, 不允许孩子响应事件了, 由父控件处理 } break; default: break; } return false;// 不拦截事件,优先传递给孩子(也就是ScrollView,让它正常处理上下滑动事件)处理 } @Override public boolean onTouchEvent(MotionEvent event) { //将触摸事件传递手势识别器 mGestureDetector.onTouchEvent(event); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: Log.e(TAG, "onTouchEvent ACTION_DOWN"); break; case MotionEvent.ACTION_MOVE: scrollX = getScrollX();//相对于初始位置滑动的距离 //你滑动的距离加上屏幕的一半,除以屏幕宽度,就是当前图片显示的pos.如果你滑动距离超过了屏幕的一半,这个pos就加1 position = (getScrollX() + getWidth() / 2) / getWidth(); //屏蔽边界值:postion在0~images.length-1范围内 if (position >= images.length) { position = images.length - 1 + 1; } if (position < 0) { position = 0; } if (mOnPageScrollListener != null) { Log.e("TAG", "offset=" + (float) (getScrollX() * 1.0 / ((1) * getWidth()))); mOnPageScrollListener.onPageScrolled((float) (getScrollX() * 1.0 / (getWidth())), position); } Log.e(TAG, "onTouchEvent ACTION_MOVE =" + scrollX + " 位置: " + position); break; case MotionEvent.ACTION_UP: //绝对滑动,直接滑到指定的x,y的位置,较迟钝 // scrollTo(position * getWidth(), 0); // Log.e("TAG", "水平方向回弹滑动的距离=" + (-(scrollX - position * getWidth()))); //滚动,startX, startY为开始滚动的位置,dx,dy为滚动的偏移量 mScroller.startScroll(scrollX, 0, -(scrollX - position * getWidth()), 0); invalidate();//使用invalidate这个方法会有执行一个回调方法computeScroll,我们来重写这个方法 if (mOnPageScrollListener != null) { mOnPageScrollListener.onPageSelected(position); } Log.e(TAG, "onTouchEvent ACTION_UP "); break; } return true; } /** * 其实Scroller的原理就是用ScrollTo来一段一段的进行,最后看上去跟自然的一样,必须使用postInvalidate, * 这样才会一直回调computeScroll这个方法,直到滑动结束。 */ @Override public void computeScroll() { if (mScroller.computeScrollOffset()) { scrollTo(mScroller.getCurrX(), 0); Log.e(TAG, "computeScroll " + mScroller.getCurrX()); postInvalidate(); if (mOnPageScrollListener != null) { Log.e(TAG, "offset=" + (float) (getScrollX() * 1.0 / (getWidth()))); mOnPageScrollListener.onPageScrolled((float) (mScroller.getCurrX() * 1.0 / ((1) * getWidth())), position); } } } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View childView = getChildAt(i); childView.layout(i * getWidth(), t, (i + 1) * getWidth(), b); } } public interface OnPageScrollListener { /** * @param offsetPercent offsetPercent:getScrollX滑动的距离占屏幕宽度的百分比 * @param position */ void onPageScrolled(float offsetPercent, int position); void onPageSelected(int position); } private OnPageScrollListener mOnPageScrollListener; public void setOnPageScrollListener(OnPageScrollListener onPageScrollListener) { this.mOnPageScrollListener = onPageScrollListener; } }
[ "guowenhui@aerozhonghuan.com" ]
guowenhui@aerozhonghuan.com
ee954f568d2402bd6d4eb2581673104e091bb657
1442a7a6e9fae99eb5ac3954bd47da5363f18884
/AndroidDemos/app/src/main/java/com/jzhung/demos/utils/ScreenSwitchUtils.java
5177b88129369a163729aad46e5a4652276721a7
[]
no_license
jxzhung/AndroidCodes
dbbf805902d49ed5f53ac198aaf05eb49cd2970c
ac5e70981bdb3c61586a41688d63d2dfc5e27853
refs/heads/master
2020-12-30T17:10:54.683360
2017-07-14T07:02:16
2017-07-14T07:02:16
91,061,911
0
0
null
null
null
null
UTF-8
Java
false
false
6,333
java
package com.jzhung.demos.utils; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Handler; import android.os.Message; import android.util.Log; /** * Created by Jzhung on 2017/6/20. */ public class ScreenSwitchUtils { private static final String TAG = ScreenSwitchUtils.class.getSimpleName(); public static final int OR_BOTTOM_ON_BOTTOM = 0; public static final int OR_RIGHT_ON_BOTTOM = 1; public static final int OR_TOP_ON_BOTTOM = 2; public static final int OR_LEFT_ON_BOTTOM = 3; private volatile static ScreenSwitchUtils mInstance; private SensorManager sm; private OrientationSensorListener listener; private Sensor sensor; private ScreenOrChangeListener mScreenOrChangeListener; private int currentOrientation; private Handler mHandler = new Handler() { public void handleMessage(Message msg) { switch (msg.what) { case 888: int orientation = msg.arg1; Log.d(TAG, "handleMessage: orientation:" + orientation); if (orientation > 45 && orientation < 135) { if (currentOrientation != 1) { Log.e("test", "右向下"); if (mScreenOrChangeListener != null) { mScreenOrChangeListener.onOrientationChange(OR_RIGHT_ON_BOTTOM); } currentOrientation = 1; } } else if (orientation > 135 && orientation < 225) { if (currentOrientation != 2) { Log.e("test", "顶部向下"); if (mScreenOrChangeListener != null) { mScreenOrChangeListener.onOrientationChange(OR_TOP_ON_BOTTOM); } currentOrientation = 2; } } else if (orientation > 225 && orientation < 315) { if (currentOrientation != 3) { Log.e("test", "左向下 切换成横屏"); if (mScreenOrChangeListener != null) { mScreenOrChangeListener.onOrientationChange(OR_LEFT_ON_BOTTOM); } currentOrientation = 3; } } else if ((orientation > 315 && orientation < 360) || (orientation > 0 && orientation < 45)) { if (currentOrientation != 0) { Log.e("test", "正常 切换成竖屏"); if (mScreenOrChangeListener != null) { mScreenOrChangeListener.onOrientationChange(OR_BOTTOM_ON_BOTTOM); } currentOrientation = 0; } } break; default: break; } } }; public interface ScreenOrChangeListener { void onOrientationChange(int orientation); } /** * 返回ScreenSwitchUtils单例 **/ public static ScreenSwitchUtils init(Context context) { if (mInstance == null) { synchronized (ScreenSwitchUtils.class) { if (mInstance == null) { mInstance = new ScreenSwitchUtils(context); } } } return mInstance; } private ScreenSwitchUtils(Context context) { Log.d(TAG, "init orientation listener."); // 注册重力感应器,监听屏幕旋转 sm = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE); sensor = sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); listener = new OrientationSensorListener(mHandler); } /** * 开始监听 */ public void start() { Log.d(TAG, "start orientation listener."); sm.registerListener(listener, sensor, SensorManager.SENSOR_DELAY_UI); } /** * 停止监听 */ public void stop() { Log.d(TAG, "stop orientation listener."); sm.unregisterListener(listener); } /** * 重力感应监听者 */ public class OrientationSensorListener implements SensorEventListener { private static final int _DATA_X = 0; private static final int _DATA_Y = 1; private static final int _DATA_Z = 2; public static final int ORIENTATION_UNKNOWN = -1; private Handler rotateHandler; public OrientationSensorListener(Handler handler) { rotateHandler = handler; } public void onAccuracyChanged(Sensor arg0, int arg1) { } public void onSensorChanged(SensorEvent event) { float[] values = event.values; int orientation = ORIENTATION_UNKNOWN; float X = -values[_DATA_X]; float Y = -values[_DATA_Y]; float Z = -values[_DATA_Z]; float magnitude = X * X + Y * Y; // Don't trust the angle if the magnitude is small compared to the y // value if (magnitude * 4 >= Z * Z) { // 屏幕旋转时 float OneEightyOverPi = 57.29577957855f; float angle = (float) Math.atan2(-Y, X) * OneEightyOverPi; orientation = 90 - Math.round(angle); // normalize to 0 - 359 range while (orientation >= 360) { orientation -= 360; } while (orientation < 0) { orientation += 360; } } if (rotateHandler != null) { rotateHandler.obtainMessage(888, orientation, 0).sendToTarget(); } } } public ScreenOrChangeListener getScreenOrChangeListener() { return mScreenOrChangeListener; } public void setScreenOrChangeListener(ScreenOrChangeListener screenOrChangeListener) { mScreenOrChangeListener = screenOrChangeListener; } }
[ "i@jzhung.com" ]
i@jzhung.com
ab5ed3b590f36d32d5c4e18f8946724a9dccbaa7
a1a94bff1b1cc748e8234e721d752878f05df9ba
/src/main/java/com/parking/manager/web/beans/GetBillOutputConverter.java
b9b1c45f6e3587879065d1825ee17fa21495dfcf
[]
no_license
myousstools/parkingapi
c815fdafd281aa4dca95919809dfc599928a9ca2
65b83062a0ae7c4b3dcc5ce04f69f197d7cd8bc2
refs/heads/master
2022-07-07T00:17:21.915216
2019-08-22T11:17:46
2019-08-22T15:03:01
203,678,959
0
0
null
2022-06-17T22:20:52
2019-08-21T23:28:50
Java
UTF-8
Java
false
false
1,109
java
package com.parking.manager.web.beans; import com.parking.manager.dao.entity.Bill; /** * The type Get bill output converter. */ public final class GetBillOutputConverter { private GetBillOutputConverter() { } /** * Convert get bill output. * * @param bill the bill * @return the get bill output */ public static GetBillOutput convert(Bill bill) { GetBillOutput result = new GetBillOutput(); result.setBill(new BillOutput()); result.getBill().setAmount(bill.getAmount()); result.getBill().setCurrencyCode(bill.getCurrencyCode()); result.getBill().setCarPlateNumber(bill.getSlotAssignment().getCarPlateNumber()); result.getBill().setProrated(bill.getFare().isProrated()); result.getBill().setStartDateTime(bill.getSlotAssignment().getStartDateTime()); result.getBill().setEndDateTime(bill.getSlotAssignment().getEndDateTime()); result.getBill().setBillNumber(bill.getId()); result.getBill().setSlotNumber(bill.getSlotAssignment().getSlot().getNumber()); result.getBill().setPaymentStatus(bill.getPaymentStatus()); return result; } }
[ "Mehdi.YOUSSEF@amadeus.com" ]
Mehdi.YOUSSEF@amadeus.com
f9ec2272cb50bda2b9855e2f7974ecc7f79060eb
59348a44b6b73e5a136a118409f5f3358f5a3762
/app/src/main/java/com/ewintory/udacity/popularmovies/data/repository/GenresRepositoryImpl.java
d7a70748d080cbb8f007d21814ce5ed9ca423a8a
[ "Apache-2.0" ]
permissive
ahmadzakimubarok/udacity-popular-movies
b0f10396a8bcf521e3dac1dfe8dd15496f749073
52c95eaddd75632564012af459a9330ee84ddb4a
refs/heads/master
2020-04-13T03:09:29.851865
2015-08-16T22:25:11
2015-08-16T22:25:11
162,923,486
0
1
NOASSERTION
2018-12-23T20:58:21
2018-12-23T20:58:21
null
UTF-8
Java
false
false
1,637
java
/* * Copyright 2015. Emin Yahyayev * * 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.ewintory.udacity.popularmovies.data.repository; import com.ewintory.udacity.popularmovies.data.api.MoviesApi; import com.ewintory.udacity.popularmovies.data.model.Genre; import com.ewintory.udacity.popularmovies.data.provider.MoviesContract; import com.squareup.sqlbrite.BriteContentResolver; import java.util.Map; import rx.Observable; import rx.schedulers.Schedulers; final class GenresRepositoryImpl implements GenresRepository { private final MoviesApi mMoviesApi; private final BriteContentResolver mBriteContentResolver; public GenresRepositoryImpl(MoviesApi moviesApi, BriteContentResolver briteContentResolver) { mMoviesApi = moviesApi; mBriteContentResolver = briteContentResolver; } @Override public Observable<Map<Integer, Genre>> genres() { return mBriteContentResolver.createQuery(MoviesContract.Genres.CONTENT_URI, Genre.PROJECTION, null, null, null, true) .map(Genre.PROJECTION_MAP) .subscribeOn(Schedulers.io()); } }
[ "ewintory@gmail.com" ]
ewintory@gmail.com
5a4b493343feed9ecb69506bbf327896fc345a31
70581a79cb6f2e660b70d6d6c92f13ed6174183b
/src/java/servlets/ValidaNombreArticulo.java
dc8bc470a4980985d06cc00c42d321e9e31f06f5
[]
no_license
filhip12/Inventsys
247710aa1dad3bd5b852ebc32276ac667f082cf5
3f48a354aa9cfa4d69efd05a28033b03d9873818
refs/heads/master
2016-09-05T22:34:15.629225
2015-03-02T13:16:25
2015-03-02T13:16:25
31,542,251
0
0
null
null
null
null
UTF-8
Java
false
false
3,206
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package servlets; import controller.InventariosController; import java.io.IOException; import java.io.PrintWriter; import java.util.List; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author pipo */ @WebServlet(name = "ValidaNombreArticulo", urlPatterns = {"/ValidaNombreArticulo"}) public class ValidaNombreArticulo extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { /* TODO output your page here. You may use following sample code. */ out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet ValidaNombreArticulo</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet ValidaNombreArticulo at " + "no data" + "</h1>"); out.println("</body>"); out.println("</html>"); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "pipehernandez7@gmail.com" ]
pipehernandez7@gmail.com
e0600afcb01b1ec5c65d59b8f0feea1ceef09fe6
8370108b5a536bb46f5f5d6a22bc1ef24e161953
/src/main/java/com/journaldev/util/JavaSplitString.java
cf5d71bc22c4dc8cbca58ac241b4567eebc44835
[]
no_license
kittyGit/Test
c5bfa7842179e5b300621bf5b3b65ad8d055af18
6833a7d40536cdb936babde8f9db880cdd089b64
refs/heads/master
2020-12-24T13:20:28.353450
2015-05-10T06:19:45
2015-05-10T06:19:45
27,660,030
0
0
null
null
null
null
UTF-8
Java
false
false
750
java
package com.journaldev.util; import java.util.Arrays; public class JavaSplitString { public static void main(String[] args) { //分割方式1 String line="i am Kitty"; String[] names=line.split(" "); //将输入字符串分割成指定具体数量的String数组 String[] twoName=line.split(" ",2); System.out.println("String split with delimiter"+Arrays.toString(names)); System.out.println("String split into two"+Arrays.toString(twoName)); System.out.println("_______________________________________"); //分割方式2 String myName="i|am|Kitty"; String[] splitString=myName.split("\\|"); System.out.println("String split with special character"+Arrays.toString(splitString)); } }
[ "lo-gan@qq.com" ]
lo-gan@qq.com
6cb48d5f57af711a518f168a5e6b9dd760b8e7c6
e93d012ff58af18c9e978d4a686bbb366eb18539
/03.개발/ver 0.5/gen/com/facebook/android/R.java
8d0f58836a133f9467644ce185356fc6ad756dc5
[]
no_license
mobileJAX/Mobile1
0432596fc7b1bfeb069c8d7e292b519c7dbd4136
b9ef47332dcf42cd4dc74f20eece895cd4e344c9
refs/heads/master
2021-01-22T13:37:39.655863
2014-06-23T05:30:22
2014-06-23T05:30:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
13,686
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.facebook.android; public final class R { public static final class attr { public static final int confirm_logout = 0x7f01000c; public static final int done_button_background = 0x7f010006; public static final int done_button_text = 0x7f010004; public static final int extra_fields = 0x7f010001; public static final int fetch_user_info = 0x7f01000d; public static final int is_cropped = 0x7f010011; public static final int login_text = 0x7f01000e; public static final int logout_text = 0x7f01000f; public static final int multi_select = 0x7f010007; public static final int preset_size = 0x7f010010; public static final int radius_in_meters = 0x7f010008; public static final int results_limit = 0x7f010009; public static final int search_text = 0x7f01000a; public static final int show_pictures = 0x7f010000; public static final int show_search_box = 0x7f01000b; public static final int show_title_bar = 0x7f010002; public static final int title_bar_background = 0x7f010005; public static final int title_text = 0x7f010003; } public static final class color { public static final int com_facebook_blue = 0x7f060002; public static final int com_facebook_loginview_text_color = 0x7f060006; public static final int com_facebook_picker_search_bar_background = 0x7f060000; public static final int com_facebook_picker_search_bar_text = 0x7f060001; public static final int com_facebook_usersettingsfragment_connected_shadow_color = 0x7f060004; public static final int com_facebook_usersettingsfragment_connected_text_color = 0x7f060003; public static final int com_facebook_usersettingsfragment_not_connected_text_color = 0x7f060005; } public static final class dimen { public static final int com_facebook_loginview_compound_drawable_padding = 0x7f050008; public static final int com_facebook_loginview_padding_bottom = 0x7f050007; public static final int com_facebook_loginview_padding_left = 0x7f050004; public static final int com_facebook_loginview_padding_right = 0x7f050005; public static final int com_facebook_loginview_padding_top = 0x7f050006; public static final int com_facebook_loginview_text_size = 0x7f050009; public static final int com_facebook_picker_divider_width = 0x7f050001; public static final int com_facebook_picker_place_image_size = 0x7f050000; public static final int com_facebook_profilepictureview_preset_size_large = 0x7f05000c; public static final int com_facebook_profilepictureview_preset_size_normal = 0x7f05000b; public static final int com_facebook_profilepictureview_preset_size_small = 0x7f05000a; public static final int com_facebook_tooltip_horizontal_padding = 0x7f05000d; public static final int com_facebook_usersettingsfragment_profile_picture_height = 0x7f050003; public static final int com_facebook_usersettingsfragment_profile_picture_width = 0x7f050002; } public static final class drawable { public static final int com_facebook_button_blue = 0x7f020002; public static final int com_facebook_button_blue_focused = 0x7f020003; public static final int com_facebook_button_blue_normal = 0x7f020004; public static final int com_facebook_button_blue_pressed = 0x7f020005; public static final int com_facebook_button_check = 0x7f020006; public static final int com_facebook_button_check_off = 0x7f020007; public static final int com_facebook_button_check_on = 0x7f020008; public static final int com_facebook_button_grey_focused = 0x7f020009; public static final int com_facebook_button_grey_normal = 0x7f02000a; public static final int com_facebook_button_grey_pressed = 0x7f02000b; public static final int com_facebook_close = 0x7f02000c; public static final int com_facebook_inverse_icon = 0x7f02000d; public static final int com_facebook_list_divider = 0x7f02000e; public static final int com_facebook_list_section_header_background = 0x7f02000f; public static final int com_facebook_loginbutton_silver = 0x7f020010; public static final int com_facebook_logo = 0x7f020011; public static final int com_facebook_picker_default_separator_color = 0x7f02007a; public static final int com_facebook_picker_item_background = 0x7f020012; public static final int com_facebook_picker_list_focused = 0x7f020013; public static final int com_facebook_picker_list_longpressed = 0x7f020014; public static final int com_facebook_picker_list_pressed = 0x7f020015; public static final int com_facebook_picker_list_selector = 0x7f020016; public static final int com_facebook_picker_list_selector_background_transition = 0x7f020017; public static final int com_facebook_picker_list_selector_disabled = 0x7f020018; public static final int com_facebook_picker_magnifier = 0x7f020019; public static final int com_facebook_picker_top_button = 0x7f02001a; public static final int com_facebook_place_default_icon = 0x7f02001b; public static final int com_facebook_profile_default_icon = 0x7f02001c; public static final int com_facebook_profile_picture_blank_portrait = 0x7f02001d; public static final int com_facebook_profile_picture_blank_square = 0x7f02001e; public static final int com_facebook_tooltip_black_background = 0x7f02001f; public static final int com_facebook_tooltip_black_bottomnub = 0x7f020020; public static final int com_facebook_tooltip_black_topnub = 0x7f020021; public static final int com_facebook_tooltip_black_xout = 0x7f020022; public static final int com_facebook_tooltip_blue_background = 0x7f020023; public static final int com_facebook_tooltip_blue_bottomnub = 0x7f020024; public static final int com_facebook_tooltip_blue_topnub = 0x7f020025; public static final int com_facebook_tooltip_blue_xout = 0x7f020026; public static final int com_facebook_top_background = 0x7f020027; public static final int com_facebook_top_button = 0x7f020028; public static final int com_facebook_usersettingsfragment_background_gradient = 0x7f020029; } public static final class id { public static final int com_facebook_body_frame = 0x7f040049; public static final int com_facebook_button_xout = 0x7f04004b; public static final int com_facebook_login_activity_progress_bar = 0x7f040039; public static final int com_facebook_picker_activity_circle = 0x7f040038; public static final int com_facebook_picker_checkbox = 0x7f04003b; public static final int com_facebook_picker_checkbox_stub = 0x7f04003f; public static final int com_facebook_picker_divider = 0x7f040043; public static final int com_facebook_picker_done_button = 0x7f040042; public static final int com_facebook_picker_image = 0x7f04003c; public static final int com_facebook_picker_list_section_header = 0x7f040040; public static final int com_facebook_picker_list_view = 0x7f040037; public static final int com_facebook_picker_profile_pic_stub = 0x7f04003d; public static final int com_facebook_picker_row_activity_circle = 0x7f04003a; public static final int com_facebook_picker_search_text = 0x7f040048; public static final int com_facebook_picker_title = 0x7f04003e; public static final int com_facebook_picker_title_bar = 0x7f040045; public static final int com_facebook_picker_title_bar_stub = 0x7f040044; public static final int com_facebook_picker_top_bar = 0x7f040041; public static final int com_facebook_search_bar_view = 0x7f040047; public static final int com_facebook_tooltip_bubble_view_bottom_pointer = 0x7f04004d; public static final int com_facebook_tooltip_bubble_view_text_body = 0x7f04004c; public static final int com_facebook_tooltip_bubble_view_top_pointer = 0x7f04004a; public static final int com_facebook_usersettingsfragment_login_button = 0x7f040050; public static final int com_facebook_usersettingsfragment_logo_image = 0x7f04004e; public static final int com_facebook_usersettingsfragment_profile_name = 0x7f04004f; public static final int large = 0x7f040002; public static final int normal = 0x7f040001; public static final int picker_subtitle = 0x7f040046; public static final int small = 0x7f040000; } public static final class layout { public static final int com_facebook_friendpickerfragment = 0x7f030009; public static final int com_facebook_login_activity_layout = 0x7f03000a; public static final int com_facebook_picker_activity_circle_row = 0x7f03000b; public static final int com_facebook_picker_checkbox = 0x7f03000c; public static final int com_facebook_picker_image = 0x7f03000d; public static final int com_facebook_picker_list_row = 0x7f03000e; public static final int com_facebook_picker_list_section_header = 0x7f03000f; public static final int com_facebook_picker_search_box = 0x7f030010; public static final int com_facebook_picker_title_bar = 0x7f030011; public static final int com_facebook_picker_title_bar_stub = 0x7f030012; public static final int com_facebook_placepickerfragment = 0x7f030013; public static final int com_facebook_placepickerfragment_list_row = 0x7f030014; public static final int com_facebook_search_bar_layout = 0x7f030015; public static final int com_facebook_tooltip_bubble = 0x7f030016; public static final int com_facebook_usersettingsfragment = 0x7f030017; } public static final class string { public static final int com_facebook_choose_friends = 0x7f07000f; public static final int com_facebook_dialogloginactivity_ok_button = 0x7f070000; public static final int com_facebook_internet_permission_error_message = 0x7f070013; public static final int com_facebook_internet_permission_error_title = 0x7f070012; public static final int com_facebook_loading = 0x7f070011; public static final int com_facebook_loginview_cancel_action = 0x7f070006; public static final int com_facebook_loginview_log_in_button = 0x7f070002; public static final int com_facebook_loginview_log_out_action = 0x7f070005; public static final int com_facebook_loginview_log_out_button = 0x7f070001; public static final int com_facebook_loginview_logged_in_as = 0x7f070003; public static final int com_facebook_loginview_logged_in_using_facebook = 0x7f070004; public static final int com_facebook_logo_content_description = 0x7f070007; public static final int com_facebook_nearby = 0x7f070010; public static final int com_facebook_picker_done_button_text = 0x7f07000e; public static final int com_facebook_placepicker_subtitle_catetory_only_format = 0x7f07000c; public static final int com_facebook_placepicker_subtitle_format = 0x7f07000b; public static final int com_facebook_placepicker_subtitle_were_here_only_format = 0x7f07000d; public static final int com_facebook_requesterror_password_changed = 0x7f070016; public static final int com_facebook_requesterror_permissions = 0x7f070018; public static final int com_facebook_requesterror_reconnect = 0x7f070017; public static final int com_facebook_requesterror_relogin = 0x7f070015; public static final int com_facebook_requesterror_web_login = 0x7f070014; public static final int com_facebook_tooltip_default = 0x7f070019; public static final int com_facebook_usersettingsfragment_log_in_button = 0x7f070008; public static final int com_facebook_usersettingsfragment_logged_in = 0x7f070009; public static final int com_facebook_usersettingsfragment_not_logged_in = 0x7f07000a; } public static final class style { public static final int com_facebook_loginview_default_style = 0x7f080000; public static final int com_facebook_loginview_silver_style = 0x7f080001; public static final int tooltip_bubble_text = 0x7f080002; } public static final class styleable { public static final int[] com_facebook_friend_picker_fragment = { 0x7f010007 }; public static final int com_facebook_friend_picker_fragment_multi_select = 0; public static final int[] com_facebook_login_view = { 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f }; public static final int com_facebook_login_view_confirm_logout = 0; public static final int com_facebook_login_view_fetch_user_info = 1; public static final int com_facebook_login_view_login_text = 2; public static final int com_facebook_login_view_logout_text = 3; public static final int[] com_facebook_picker_fragment = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006 }; public static final int com_facebook_picker_fragment_done_button_background = 6; public static final int com_facebook_picker_fragment_done_button_text = 4; public static final int com_facebook_picker_fragment_extra_fields = 1; public static final int com_facebook_picker_fragment_show_pictures = 0; public static final int com_facebook_picker_fragment_show_title_bar = 2; public static final int com_facebook_picker_fragment_title_bar_background = 5; public static final int com_facebook_picker_fragment_title_text = 3; public static final int[] com_facebook_place_picker_fragment = { 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b }; public static final int com_facebook_place_picker_fragment_radius_in_meters = 0; public static final int com_facebook_place_picker_fragment_results_limit = 1; public static final int com_facebook_place_picker_fragment_search_text = 2; public static final int com_facebook_place_picker_fragment_show_search_box = 3; public static final int[] com_facebook_profile_picture_view = { 0x7f010010, 0x7f010011 }; public static final int com_facebook_profile_picture_view_is_cropped = 1; public static final int com_facebook_profile_picture_view_preset_size = 0; } }
[ "euna@naver.com" ]
euna@naver.com
ace4519e0d79b9f5c0d5170aabbf5224101c4877
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/linkedmall-20220531/src/main/java/com/aliyun/linkedmall20220531/models/QueryOrderDetail4DistributionResponse.java
03951c17a1633380e8a99015ae84dced93adb097
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
1,514
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.linkedmall20220531.models; import com.aliyun.tea.*; public class QueryOrderDetail4DistributionResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("statusCode") @Validation(required = true) public Integer statusCode; @NameInMap("body") @Validation(required = true) public QueryOrderDetail4DistributionResponseBody body; public static QueryOrderDetail4DistributionResponse build(java.util.Map<String, ?> map) throws Exception { QueryOrderDetail4DistributionResponse self = new QueryOrderDetail4DistributionResponse(); return TeaModel.build(map, self); } public QueryOrderDetail4DistributionResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public QueryOrderDetail4DistributionResponse setStatusCode(Integer statusCode) { this.statusCode = statusCode; return this; } public Integer getStatusCode() { return this.statusCode; } public QueryOrderDetail4DistributionResponse setBody(QueryOrderDetail4DistributionResponseBody body) { this.body = body; return this; } public QueryOrderDetail4DistributionResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
d4dbe80bf67c599d84aef313c095067fba894a6a
1b085c70b9d34f0223469da35de6f527a41edfe7
/ObtenerParque/src/com/telefonica/services/WS4/ConsultaSSDTO.java
1996fabc92c19de50e8fd231102d4808f4d763a1
[]
no_license
EquipoV/Ofertador
4b4484dc2d936493968260df7976cfac2f48df50
78b358b61b497d2df1839391d5263b3f0a369e2c
refs/heads/master
2021-01-19T11:03:37.991564
2014-08-12T10:36:32
2014-08-12T10:36:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,642
java
/** * ConsultaSSDTO.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.telefonica.services.WS4; public class ConsultaSSDTO implements java.io.Serializable { private java.lang.String numeroCelular; public ConsultaSSDTO() { } public ConsultaSSDTO( java.lang.String numeroCelular) { this.numeroCelular = numeroCelular; } /** * Gets the numeroCelular value for this ConsultaSSDTO. * * @return numeroCelular */ public java.lang.String getNumeroCelular() { return numeroCelular; } /** * Sets the numeroCelular value for this ConsultaSSDTO. * * @param numeroCelular */ public void setNumeroCelular(java.lang.String numeroCelular) { this.numeroCelular = numeroCelular; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof ConsultaSSDTO)) return false; ConsultaSSDTO other = (ConsultaSSDTO) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.numeroCelular==null && other.getNumeroCelular()==null) || (this.numeroCelular!=null && this.numeroCelular.equals(other.getNumeroCelular()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getNumeroCelular() != null) { _hashCode += getNumeroCelular().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(ConsultaSSDTO.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://WS4.services.telefonica.com", "ConsultaSSDTO")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("numeroCelular"); elemField.setXmlName(new javax.xml.namespace.QName("http://WS4.services.telefonica.com", "numeroCelular")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(true); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ 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.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ 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.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
[ "esteban.contreras@veris.cl" ]
esteban.contreras@veris.cl
66a176de5a0bba8b53f4d5df45e655c2de315aee
4aa90348abcb2119011728dc067afd501f275374
/app/src/main/java/com/tencent/mm/ui/base/MMViewPager$h$1.java
b831ffd13a8ac37bc6f8033ff2ef7377bd980ca7
[]
no_license
jambestwick/HackWechat
0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6
6a34899c8bfd50d19e5a5ec36a58218598172a6b
refs/heads/master
2022-01-27T12:48:43.446804
2021-12-29T10:36:30
2021-12-29T10:36:30
249,366,791
0
0
null
2020-03-23T07:48:32
2020-03-23T07:48:32
null
UTF-8
Java
false
false
1,053
java
package com.tencent.mm.ui.base; import com.tencent.mm.ui.base.MMViewPager.h; class MMViewPager$h$1 implements Runnable { final /* synthetic */ h yeL; MMViewPager$h$1(h hVar) { this.yeL = hVar; } public final void run() { MMViewPager.a(this.yeL.yeI).getImageMatrix().getValues(this.yeL.mVx); float f = this.yeL.mVx[2]; float scale = MMViewPager.a(this.yeL.yeI).getScale() * ((float) MMViewPager.a(this.yeL.yeI).imageWidth); if (scale < ((float) MMViewPager.b(this.yeL.yeI))) { scale = (((float) MMViewPager.b(this.yeL.yeI)) / 2.0f) - (scale / 2.0f); } else { scale = 0.0f; } scale -= f; if (scale >= 0.0f) { this.yeL.fdb = true; } else if (Math.abs(scale) <= 5.0f) { this.yeL.fdb = true; } else { scale = (-((float) (((double) Math.abs(scale)) - Math.pow(Math.sqrt((double) Math.abs(scale)) - 1.0d, 2.0d)))) * 2.0f; } MMViewPager.a(this.yeL.yeI).K(scale, 0.0f); } }
[ "malin.myemail@163.com" ]
malin.myemail@163.com
133629ac056af455e365a31964b31a267dccd46a
35e169ed98a293a9466d294b0f828220e39410ba
/src/main/java/ru/itpark/propertysearchweb/comparator/SearchMinComparator.java
0330f7059732348f66021a4ac321269c599042aa
[]
no_license
ITParkSergeyKolupaev/07.PropertySearchWeb
07eb7d7cfdce72c68797365be0109916a4d46603
713128aea99bb6e120ac37c4b032893483a113a9
refs/heads/master
2020-04-15T06:44:07.062742
2019-01-16T18:08:35
2019-01-16T18:08:35
164,471,144
0
0
null
null
null
null
UTF-8
Java
false
false
352
java
package ru.itpark.propertysearchweb.comparator; import ru.itpark.propertysearchweb.domain.House; import java.io.Serializable; import java.util.Comparator; public class SearchMinComparator implements Comparator<House>, Serializable { @Override public int compare(House o1, House o2) { return o1.getPrice() - o2.getPrice(); } }
[ "prog.forall.lang@gmail.com" ]
prog.forall.lang@gmail.com
8757545f1badf81da2962ae3ad41edcaeffaefc9
d21d26e73cda751b23b210c70621a427b20153e3
/app/src/main/java/org/seraph/mvprxjavaretrofit/ui/module/main/MainActivityContract.java
0ab3ce808ef608e3be9538e1f80054ac7271739e
[]
no_license
wherego/RxjavaRetrofitMvp
eecfb53218340ec902d086a4b701c70299e530f8
5e67fffe21c81bbaa1e9d75b2fa7bd45989a4850
refs/heads/master
2021-01-20T14:15:17.555982
2017-04-20T07:39:57
2017-04-20T07:39:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
717
java
package org.seraph.mvprxjavaretrofit.ui.module.main; import org.seraph.mvprxjavaretrofit.ui.module.base.IBasePresenter; import org.seraph.mvprxjavaretrofit.ui.module.base.IBaseView; import org.seraph.mvprxjavaretrofit.utlis.FragmentController; /** * main契约类 * date:2017/4/6 15:11 * author:xiongj * mail:417753393@qq.com **/ interface MainActivityContract { interface View extends IBaseView { void setTitle(String title); FragmentController getFragmentController(); void showToast(String str); void finish(); } interface Presenter extends IBasePresenter<View> { void setSelectedFragment(int page); void onBackPressed(); } }
[ "41753393@qq.com" ]
41753393@qq.com
809dc6cf2b5a62d3d3095a10344beb6402c3e30b
13685693a25c13ea388dcc6a0e94fcb72e9a27f8
/src/org/example/sleepy/About.java
b439735b5458388b19a286a9ed3ef8ea7ce3613e
[]
no_license
danboy/sleepy
bd391011fa83d60884738086cda7cd9e0f51bbbe
f997584e0e484a90d0811f6e7a04e124d6bac828
refs/heads/master
2021-10-10T04:00:42.313241
2008-12-28T00:10:30
2008-12-28T00:10:30
97,304
1
3
null
2021-10-01T00:31:18
2008-12-27T22:36:57
Java
UTF-8
Java
false
false
277
java
package org.example.sleepy; import android.app.Activity; import android.os.Bundle; public class About extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.about); } }
[ "dan@zooey.(none)" ]
dan@zooey.(none)
c50f5667cc1704374dace17a97f61bc37591db81
45913538a4a35a136f4a7a49a2c9143ff0e1c3f3
/src/main/java/experiment/explorer/bandit/BanditExplorer.java
2682945ba7b29ff421f4ee171cfd7ecc8fb0b814
[]
no_license
cincheo/jPerturb-experiments
909cc1e0c985640f7fddd68a3e0d13972f5323a1
5a56c6330db05d83ebd52fc5bfd2cc2695060dee
refs/heads/master
2021-01-15T22:04:18.376145
2016-06-17T15:14:51
2016-06-17T15:14:51
61,470,258
1
0
null
2016-06-19T08:02:12
2016-06-19T08:02:11
null
UTF-8
Java
false
false
8,296
java
package experiment.explorer.bandit; import experiment.*; import experiment.exploration.Exploration; import experiment.exploration.IntegerExplorationPlusOne; import experiment.explorer.Explorer; import perturbation.PerturbationEngine; import perturbation.enactor.NCallEnactorImpl; import perturbation.location.PerturbationLocation; import perturbation.log.LoggerImpl; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.concurrent.*; /** * Created by bdanglot on 06/06/16. */ public class BanditExplorer implements Explorer { private final String name = "Bandit"; private Logger logger; private Exploration exploration; private List<PerturbationLocation> arms; private Policy policyLocation; private Budget budget; private Manager manager; private int lap; private Random random; private List<Integer> filter; public BanditExplorer(Exploration exploration, Manager manager, Policy policyLocation, Budget budget) { this.manager = manager; this.random = new Random(23); this.exploration = exploration; this.arms = this.manager.getLocations(); this.policyLocation = policyLocation; this.budget = budget; this.lap = 0; this.filter = new ArrayList<>(); this.initLogger(); } @Override public void run() { this.arms.forEach(location -> location.setPerturbator(this.exploration.getPerturbators().get(0))); while (this.budget.shouldRun()) { int armSelected = this.policyLocation.selectArm(); this.pullArm(armSelected); this.filterLocation(); } this.log(); } private void filterLocation() { for (int i = 0; i < this.arms.size(); i++) { if (PerturbationEngine.loggers.get("filterLocation").getCalls(this.arms.get(i)) == 0) this.filter.add(i); } PerturbationEngine.loggers.get("filterLocation").reset(); this.policyLocation.filter(filter); this.arms.forEach(PerturbationEngine.loggers.get("filterLocation")::logOn); } private void pullArm(int indexArm) { int nbCallRef = this.runReference(this.lap, this.arms.get(indexArm)); if (nbCallRef == 0) { this.filter.add(indexArm); this.policyLocation.filter(filter);//TODO The Time Budget should not take this reference run in account imo. } else { this.arms.get(indexArm).setEnactor(new NCallEnactorImpl(this.random.nextInt(nbCallRef), this.arms.get(indexArm))); PerturbationEngine.loggers.get(this.name).logOn(this.arms.get(indexArm)); Tuple result = run(this.lap); this.logger.log(indexArm, 0, 0, 0, result, this.name); PerturbationEngine.loggers.get(this.name).reset(); this.policyLocation.update(indexArm, (int)result.get(0)); this.lap++; } } private Tuple run(int indexOfTask) { Tuple result = new Tuple(3); ExecutorService executor = Executors.newSingleThreadExecutor(); try { Callable instanceRunner = this.manager.getCallable(this.manager.getTask(indexOfTask)); Future future = executor.submit(instanceRunner); try { Object output = (future.get(Main.numberOfSecondsToWait, TimeUnit.SECONDS)); boolean assertion = this.manager.getOracle().assertPerturbation(this.manager.getTask(indexOfTask), output); executor.shutdownNow(); if (assertion) result.set(0, 1); // success else result.set(1, 1); // failures return result; } catch (TimeoutException e) { future.cancel(true); result.set(2, 1); // error computation time System.err.println("Time out!"); executor.shutdownNow(); this.manager.stop(); return result; } } catch (Exception | Error e) { result.set(2, 1); executor.shutdownNow(); this.manager.stop(); return result; } finally { executor.shutdown(); } } @Override public int runReference(int indexOfTask, PerturbationLocation location) { PerturbationEngine.loggers.get(this.name).logOn(location); this.run(indexOfTask); int currentNbCall = PerturbationEngine.loggers.get(this.name).getCalls(location); PerturbationEngine.loggers.get(this.name).reset(); return currentNbCall; } @Override public void initLogger() { this.logger = new Logger(this.manager, this.manager.getLocations().size(), this.manager.getIndexTask().size(), this.exploration.getPerturbators().size()); PerturbationEngine.loggers.put(name, new LoggerImpl()); PerturbationEngine.loggers.put("filterLocation", new LoggerImpl()); this.logger = new Logger(this.manager, this.manager.getLocations().size(), 1, 1); this.arms.forEach(PerturbationEngine.loggers.get("filterLocation")::logOn); } @Override public void log() { String path = "results/" + this.manager.getName() + "/" + this.exploration.getName() + "_" + this.name; Tuple[][][][] result = this.logger.getResults(); try { FileWriter writer = new FileWriter(path + "_policy.txt", false); writer.write(this.policyLocation.log()); writer.close(); String format = "%-15s %-15s %-15s %-15s %-15s %-15s %-20s"; writer = new FileWriter(path + "_data_graph_analysis.txt", false); writer.write("Bandit exploration\n"); writer.write(this.policyLocation.toString()); writer.write(this.budget.toString()); writer.write(this.manager.getHeader()); writer.write(String.format(format, "IndexLoc", "#Perturbations", "#Success", "#Failure", "#Exception", "#Call", "%Success") + "\n"); for (int i = 0; i < result.length; i++) { if (result[i][0][0][0].get(4) != 0) { writer.write(String.format(format, this.arms.get(i).getLocationIndex(), result[i][0][0][0].get(4), result[i][0][0][0].get(0), result[i][0][0][0].get(1), result[i][0][0][0].get(2), result[i][0][0][0].get(3), result[i][0][0][0].get(4) == 0 ? "NaN" : Util.getStringPerc(result[i][0][0][0].get(0), result[i][0][0][0].total(3))) + "\n"); } } writer.close(); } catch (IOException e) { } } public static void run(Manager manager, String[] args) { int currentIndex; Budget budget = null; Policy policy= null; //TODO add more than one exploration Exploration exploration = new IntegerExplorationPlusOne(); manager.getLocations(exploration.getType()); if ((currentIndex = Main.getIndexOfOption("-budget", args)) != -1) { switch (args[currentIndex+1]) { case "time": budget = new TimeBudget(Integer.parseInt(args[currentIndex+2])); break; case "lap": budget = new LapBudget(Integer.parseInt(args[currentIndex+2])); break; default: budget = new TimeBudget(5000 * 60); } } if ((currentIndex = Main.getIndexOfOption("-policy", args)) != -1) { switch (args[currentIndex+1]) { case "eps": policy = new EpsilonGreedyPolicy(manager.getLocations().size(), 0.80D); break; case "ucb": default: policy = new UCBPolicy(manager.getLocations().size(), 23); break; } } Explorer explorer = new BanditExplorer(exploration, manager, policy, budget); explorer.run(); manager.stop(); System.exit(1); } }
[ "bdanglot@gmail.com" ]
bdanglot@gmail.com
67487d7042a21064e76b4fbff9061795ae599891
07b7fa6ee3f5ec309b1e79a1b803e966e4db82ed
/src/main/java/com/pdgj/manager/exception/ErrorConstant.java
4b01903fd884e5fddb4088ddf17a60dc2625faab
[]
no_license
YuShun33798/pdgjTest
7433d2fba6876da6bd84f8df90c335ce7af37406
92409730966a38abed92450de5da39eb4dfc2638
refs/heads/master
2023-01-30T15:20:27.222218
2020-12-10T01:57:42
2020-12-10T01:57:42
314,181,483
0
0
null
null
null
null
UTF-8
Java
false
false
1,393
java
package com.pdgj.manager.exception; import com.google.common.collect.Maps; import java.util.Map; /** * 版权所有:2017-美库网 * 类名称:com.base.exception.ErrorConstant * 创建人:曙光 * 创建时间:2017年4月6日 下午4:38:29 * * @version V1.0 */ public class ErrorConstant { public final static Map<Integer, String> messageMap = Maps.newHashMap(); /**初始化状态码与文字说明 * 后期 可以初始化 数据库字典中 ,管理平台可以管理return msg * */ static { messageMap.put(200, "操作成功"); messageMap.put(100, "操作失败"); messageMap.put(400, "Bad Request"); messageMap.put(401, "NotAuthorization"); messageMap.put(404, "Not Found"); messageMap.put(405, "Method Not Allowed"); messageMap.put(406, "Not Acceptable"); messageMap.put(500, "Internal Server Error"); messageMap.put(1000, "[服务器]运行时异常"); messageMap.put(1001, "[服务器]空值异常"); messageMap.put(1002, "[服务器]数据类型转换异常"); } /** * 错误参数 */ public static void throwIllegalArgsError(int code) { throw new ApiErrorException(code); } public static void throwIllegalArgsError(int code, Map<String, String> keys) { throw new ApiErrorException(code, keys); } }
[ "13914733798@126.com" ]
13914733798@126.com
83c8711403dec4a74c88b57f84f841ac677ee534
a84f4062b935a8709a3f7c99faaee22af73bfc69
/src/com/ps/springm1/model/SavingAccount.java
bc31b4dc7920a6b643e8617c22b76b59455d77dd
[]
no_license
siddharthcurious/Spring-MVC-DI-XML-firstApp
32b5ba732fb62582883a6c439cc84c20a4182442
ada1bff3f1851b1920da95815b5c543f2601816b
refs/heads/master
2020-07-17T17:33:22.337620
2019-09-03T11:39:28
2019-09-03T11:39:28
206,062,937
0
0
null
null
null
null
UTF-8
Java
false
false
445
java
package com.ps.springm1.model; import com.ps.springm1.Account; import com.ps.springm1.Card; public class SavingAccount implements Account { private Card atmCard; public SavingAccount(Card card) { this.atmCard = card; } @Override public String createAccount() { return "Saving Account created successfully"; } @Override public String cardDetails() { // TODO Auto-generated method stub return atmCard.cardDetails(); } }
[ "siddharth.curious@gmail.com" ]
siddharth.curious@gmail.com
93ecc71c4ca3ce207d09be02e0ee74a49834e1fe
8dada3d10bce2cc5dfd105fd092585cd7069bba0
/src/com/framework/exception/UnknownEquipmentException.java
0535eff76c8e975bfb5d330812bf67b6ce973f28
[]
no_license
miguelfoko/SensorFramework
5d50b6d9f976444875a58359db6e0fed947850b9
97d6ff7b9bfd567525d651845e3119381c71a473
refs/heads/master
2020-06-10T21:02:43.364572
2019-06-25T16:50:28
2019-06-25T16:50:28
193,746,477
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
package com.framework.exception; public class UnknownEquipmentException extends Exception { /** * */ private static final long serialVersionUID = 1L; }
[ "miguelfoko@gmail.com" ]
miguelfoko@gmail.com
d17d7812c3f1a04b8d5092143f630e53c6ec72e3
d2781f4b33d71b57222d9636fa6e4536238ce4f1
/jbehave-eclipse-plugin/src/org/jbehave/eclipse/step/StepCandidate.java
1ba0de692be988398b450028064ac1006899969b
[ "BSD-3-Clause" ]
permissive
Arnauld/jbehave-ide
9b7fb10a5110be1c68a73dd57251f46d9d160584
c04f87907958dc8ed9b81e5541d3a208250f9020
refs/heads/master
2021-01-17T06:57:09.421458
2012-06-25T12:21:00
2012-06-25T12:21:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,261
java
package org.jbehave.eclipse.step; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import org.apache.commons.lang.StringUtils; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.jbehave.core.parsers.RegexPrefixCapturingPatternParser; import org.jbehave.core.parsers.StepMatcher; import org.jbehave.core.parsers.StepPatternParser; import org.jbehave.core.steps.StepType; import org.jbehave.eclipse.JBehaveProject; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; /** * A StepCandidate is associated to a JDT IMethod and IAnnotation that can be * matched to a textual step. It plays an analogous role to the JBehave Core * StepCandidate. */ public class StepCandidate { private final LocalizedStepSupport localizedSupport; private final String parameterPrefix; public final IMethod method; public final IAnnotation annotation; public final StepType stepType; public final String stepPattern; private ParametrizedStep parametrizedStep; public final Integer priority; public StepCandidate(LocalizedStepSupport localizedSupport, String parameterPrefix, IMethod method, IAnnotation annotation, StepType stepType, String stepPattern, Integer priority) { this.localizedSupport = localizedSupport; this.parameterPrefix = parameterPrefix; this.method = method; this.annotation = annotation; this.stepType = stepType; this.stepPattern = stepPattern; this.priority = (priority == null) ? Integer.valueOf(0) : priority .intValue(); } public float weightOf(String input) { return getParametrizedStep().weightOf(input); } public ParametrizedStep getParametrizedStep() { if (parametrizedStep == null) { parametrizedStep = new ParametrizedStep(stepPattern, parameterPrefix); } return parametrizedStep; } public boolean hasParameters() { return getParametrizedStep().getParameterCount() > 0; } public boolean isTypeEqualTo(String searchedType) { return StringUtils.equalsIgnoreCase(searchedType, stepType.name()); } public String fullStep() { return typeWord() + " " + stepPattern; } public String typeWord() { switch (stepType) { case WHEN: return localizedSupport.lWhen(false); case THEN: return localizedSupport.lThen(false); case GIVEN: default: return localizedSupport.lGiven(false); } } public boolean matches(String step) { return getMatcher(stepType, stepPattern).matches(step); } public String toString() { StringBuilder builder = new StringBuilder(); builder.append("[").append(stepType).append("]").append(stepPattern) .append(", "); if (method == null) { builder.append("n/a"); } else { IType classFile = method.getDeclaringType(); if (classFile != null) builder.append(classFile.getElementName()); else builder.append("<type-unknown>"); builder.append('#').append(method.getElementName()); try { Integer prio = JBehaveProject.getValue( annotation.getMemberValuePairs(), "priority"); if (prio != null && prio.intValue() != 0) { builder.append(", priority ").append(prio); } } catch (JavaModelException e) { } } return builder.toString(); } private static StepPatternParser stepParser = new RegexPrefixCapturingPatternParser(); private static Cache<String, StepMatcher> matcherCache = CacheBuilder .newBuilder().concurrencyLevel(4).weakKeys().maximumSize(50) .expireAfterWrite(10 * 60, TimeUnit.SECONDS) .build(new CacheLoader<String, StepMatcher>() { public StepMatcher load(String key) throws Exception { int indexOf = key.indexOf('/'); StepType stepType = StepType.valueOf(key.substring(0, indexOf)); String stepPattern = key.substring(indexOf + 1); return stepParser.parseStep(stepType, stepPattern); } }); private StepMatcher getMatcher(StepType stepType, String stepPattern) { try { String key = stepType.name() + "/" + stepPattern; return matcherCache.get(key); } catch (ExecutionException e) { // rely on parse return stepParser.parseStep(stepType, stepPattern); } } }
[ "mauro.talevi@aquilonia.org" ]
mauro.talevi@aquilonia.org
60f13804f65e12d037f1fda6b5a0e008ce400894
541048645b5e87153d4ff42c92d98eae51528089
/back/series/src/main/java/com/sofka/series/dto/RecomendarCategoriaDTO.java
f9fc3cf576883b6cb0b4a3feacd619fd1ff6c530
[]
no_license
FrankOrtegon/Heroku-FireBase
ea599857db84a47567844cedd0f6d412ea9e52ed
7e8a4636b91800fca19c96eaadd8c880d356449d
refs/heads/master
2023-06-27T12:49:04.310020
2021-07-18T04:26:03
2021-07-18T04:26:03
386,428,031
0
0
null
null
null
null
UTF-8
Java
false
false
541
java
package com.sofka.series.dto; import java.util.List; public class RecomendarCategoriaDTO { private String categoria; private List<SerieDTO> seriesCategoria; public String getCategoria() { return categoria; } public void setCategoria(String categoria) { this.categoria = categoria; } public List<SerieDTO> getSeriesCategoria() { return seriesCategoria; } public void setSeriesCategoria(List<SerieDTO> seriesCategoria) { this.seriesCategoria = seriesCategoria; } }
[ "frank.ortegon01@gmail.com" ]
frank.ortegon01@gmail.com
987c58add82a3c835c86027a850209af6f2f3036
f66926bd465ecc7fc26171dfb7a451a8845a9a53
/src/main/java/org/sky/x/design/pattern/strategy/IStrategy.java
e2cbd9feba51f642706789e23d2232e05d9e9f79
[ "Apache-2.0" ]
permissive
eclipsky/xtools
d3622b219fea07dc25c81a518745fc596354af72
de995c12f681fb65c30019048012437e8b68358b
refs/heads/master
2020-05-02T19:59:05.150401
2014-11-16T09:06:31
2014-11-16T09:06:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
491
java
package org.sky.x.design.pattern.strategy; /** *************************************************************** * <p> * @DESCRIPTION : 首先定一个策略接口,这是诸葛亮老人家给赵云的三个锦囊妙计的接口 * @AUTHOR : andy.meng@xiu.com * @DATE :Oct 25, 2012 9:34:10 AM * </p> **************************************************************** */ public interface IStrategy { // 每个锦囊妙计都是一个可执行的算法 public void operate(); }
[ "smingxie@gmail.com" ]
smingxie@gmail.com
ef6af0613fd1d4ee7cb7e80738877b29a6ee145b
dbbe74de597aeea15d39a4a2df8709406a08ce3d
/core/src/com/runner/screens/GameOverScreen.java
e9c99abb8127eb7304c064ba313b074c6f99aff2
[]
no_license
oCocha/ItsAMe
cd20534d4adeb6823ecab72c6eb92ac35da3fe9b
af7b3851d89fb35d09b7115586295812bcfde0ac
refs/heads/master
2020-03-19T14:06:05.139180
2016-12-14T23:33:35
2016-12-14T23:33:35
75,058,992
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
package com.runner.screens; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.utils.viewport.FitViewport; import com.badlogic.gdx.utils.viewport.Viewport; import com.runner.utils.Constants; /** * Created by bob on 22.11.16. */ public class GameOverScreen extends AbstractScreen{ private OrthographicCamera camera; private Viewport viewport; TextureRegion gameover; SpriteBatch batch; float time = 0; public GameOverScreen(Game game){ super(game); gameover = new TextureRegion(new Texture(Gdx.files.internal(Constants.GAMEOVER_IMAGE_PATH))); batch = new SpriteBatch(); //batch.getProjectionMatrix().setToOrtho2D(0, 0, title.getRegionWidth(), title.getRegionHeight()); camera = new OrthographicCamera(); viewport = new FitViewport(Constants.APP_WIDTH, Constants.APP_HEIGTH, camera); viewport.apply(); camera.position.set(camera.viewportWidth / 2, camera.viewportHeight / 2, 0); camera.update(); } @Override public void show(){ } @Override public void render(float delta) { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); camera.update(); batch.setProjectionMatrix(camera.combined); batch.begin(); batch.draw(gameover, 0, 0); batch.end(); time += delta; if(time > 1){ if(Gdx.input.isKeyPressed(Input.Keys.ANY_KEY) || Gdx.input.justTouched()){ game.setScreen(new MainMenu(game)); } } } @Override public void resize(int width, int height) { viewport.update(width, height); camera.position.set(camera.viewportWidth / 2, camera.viewportHeight / 2, 0); camera.update(); } @Override public void hide(){ Gdx.app.debug("Cubify", "dispose gameover"); batch.dispose(); gameover.getTexture().dispose(); } }
[ "jayjay93@gmx.de" ]
jayjay93@gmx.de
8a6c569fdcf41276df1cdbe43c60d99f12a2948e
86204f02fccd160335a513ddf7e68c8130a57202
/dynamic-support/src/main/java/com/pranavpandey/android/dynamic/support/recyclerview/adapter/DynamicTypeBinderAdapter.java
daa818cdcbfb35b0b87504dc48d8da76e815cc32
[ "Apache-2.0" ]
permissive
H4NG-MAN/dynamic-support
a93b108ea30636e6740fae463d35cfc3833c94f7
94fb5c2225df1fac801bfdd375d2ce55cedd98d6
refs/heads/master
2021-01-04T15:36:04.131812
2020-02-14T23:01:02
2020-02-14T23:01:02
240,613,183
1
0
Apache-2.0
2020-02-14T23:00:32
2020-02-14T23:00:31
null
UTF-8
Java
false
false
4,911
java
package com.pranavpandey.android.dynamic.support.recyclerview.adapter; import androidx.annotation.NonNull; import com.pranavpandey.android.dynamic.support.recyclerview.binder.DynamicRecyclerViewBinder; import java.util.HashMap; import java.util.Map; /** * A recycler view adapter to display different type of {@link VB} * inside a recycler view. */ public abstract class DynamicTypeBinderAdapter<E extends Enum<E>, VB extends DynamicRecyclerViewBinder> extends DynamicBinderAdapter<VB> { /** * Default item type {@code enums} for this adapter. */ public enum ItemViewType { /** * Enum for the type empty. */ EMPTY, /** * Enum for the type section header. */ HEADER, /** * Enum for the type item. */ ITEM, /** * Enum for the type divider. */ DIVIDER } /** * Map to hold the data binders. */ private Map<E, VB> mDataBinderMap = new HashMap<>(); @Override public int getItemCount() { int itemCount = 0; for (VB binder : mDataBinderMap.values()) { itemCount += binder.getItemCount(); } return itemCount; } @Override public int getItemViewType(int position) { return getEnumFromPosition(position).ordinal(); } @Override public VB getDataBinder(int viewType) { return getDataBinderBinder(getEnumFromOrdinal(viewType)); } @Override public int getPosition(@NonNull VB binder, int binderPosition) { E targetViewType = getEnumFromBinder(binder); for (int i = 0, count = getItemCount(); i < count; i++) { if (targetViewType == getEnumFromPosition(i)) { binderPosition--; if (binderPosition < 0) { return i; } } } return getItemCount(); } @Override public int getBinderPosition(int position) { E targetViewType = getEnumFromPosition(position); int binderPosition = -1; for (int i = 0; i <= position; i++) { if (targetViewType == getEnumFromPosition(i)) { binderPosition++; } } if (binderPosition == -1) { throw new IllegalArgumentException("Binder does not exists in the adapter."); } return binderPosition; } @Override public void notifyBinderItemRangeChanged(@NonNull VB binder, int positionStart, int itemCount) { for (int i = positionStart; i <= itemCount; i++) { notifyItemChanged(getPosition(binder, i)); } } @Override public void notifyBinderItemRangeInserted(@NonNull VB binder, int positionStart, int itemCount) { for (int i = positionStart; i <= itemCount; i++) { notifyItemInserted(getPosition(binder, i)); } } @Override public void notifyBinderItemRangeRemoved(@NonNull VB binder, int positionStart, int itemCount) { for (int i = positionStart; i <= itemCount; i++) { notifyItemRemoved(getPosition(binder, i)); } } /** * Get the item type enum associated with position the position. * * @param position The position to get the corresponding {@code enum}. * * @return The {@code enum} corresponding to the given position. */ public abstract E getEnumFromPosition(int position); /** * Get the item type enum according to the ordinal. * * @param ordinal The ordinal to get the corresponding {@code enum}. * * @return The {@code enum} corresponding to the given ordinal. */ public abstract E getEnumFromOrdinal(int ordinal); public E getEnumFromBinder(VB binder) { for (Map.Entry<E, VB> entry : mDataBinderMap.entrySet()) { if (entry.getValue().equals(binder)) { return entry.getKey(); } } throw new IllegalArgumentException("Invalid data binder."); } /** * Returns the dynamic data binder according to the supplied {@code enum}. * * @param e The data binder enum. * * @return The dynamic data binder according to the supplied {@code enum}. */ public VB getDataBinderBinder(E e) { return mDataBinderMap.get(e); } /** * Get the map to hold the data binders. * * @return The map to hold the data binders. */ public @NonNull Map<E, VB> getDataBinderMap() { return mDataBinderMap; } /** * Add data binders to display in this adapter. * * @param e The data binder enum. * @param binder The data binder to be added in this adapter. */ public void putDataBinder(E e, VB binder) { mDataBinderMap.put(e, binder); } }
[ "pranavpande92@gmail.com" ]
pranavpande92@gmail.com
c1878039b99f7932276109eca78aaf1ff0512e27
fe1a4596edaa1547515321903ceda7a313c27633
/Agro/src/main/java/com/agro/lk/demo/security/CustomUserDetails.java
a73a610b6805258d572e6d0c87e865ecbabdfd3b
[]
no_license
Hemanthanet/gittest
7d5954d4caaed8a0996f2b68acc9a21627a45f34
24f8ec5c84f90b6701eb64ce9f4a21176ce7ca0d
refs/heads/master
2023-06-25T14:32:31.412411
2021-07-22T03:13:13
2021-07-22T03:13:13
388,257,159
0
0
null
null
null
null
UTF-8
Java
false
false
1,110
java
package com.agro.lk.demo.security; import com.agro.lk.demo.users.User; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import java.util.Collection; public class CustomUserDetails implements UserDetails{ private User user; public CustomUserDetails(User user) { this.user = user; } @Override public Collection<? extends GrantedAuthority> getAuthorities() { return null; } @Override public String getPassword() { return user.getPassword(); } @Override public String getUsername() { return user.getEmail(); } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } public String getFullName() { return user.getFirstName() + " " + user.getLastName(); } }
[ "hemanthanet@gmail.com" ]
hemanthanet@gmail.com
c5ca73c92e9ee2b4bd18b86ec68de83782788289
da6c10ecbee1a3f9679a5352ddb2aa370c3bfedf
/src/edu/cnm/deepdive/cards/model/Pile.java
d0a70d416542d64db9eca7a3479b58b5caa034a2
[]
no_license
Andpatten/cards-model
bf4c000710a8bb729a729207eb6016e2b6588f99
ce23b955db890df14dada2bbadccdef2d06753bf
refs/heads/master
2020-08-04T01:21:21.011197
2019-09-30T21:51:55
2019-09-30T21:51:55
211,951,625
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package edu.cnm.deepdive.cards.model; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.NoSuchElementException; public class Pile implements Iterable<Card> { private final List<Card> cards; public Pile() { cards = new LinkedList<>(); } public void add(Card card) { cards.add(card); } public void clear() { cards.clear(); } public int size() { return cards.size(); } public Card deal() { if (cards.isEmpty()) { throw new NoSuchElementException(); } return cards.remove(0); } @Override public String toString() { return cards.toString(); } @Override public Iterator<Card> iterator() { return cards.iterator(); } }
[ "andpatten@gmail.com" ]
andpatten@gmail.com
52e1703f1f0b7b417540ea807663158707cb3afb
043951f04ddb6c8df3f397fac4e0f940d8e919d8
/source/boy-learning-designpattern/src/main/java/bugmakers/club/dp/creational/seq5/prototype/structural/javaclone/JavaConcretePrototype.java
15498304a7679f966e8e1cc2faeb4d6a9bb1a470
[]
no_license
shamexln/boy-design-pattern
05b3c4e133b3207527a25fac134ccf8d93fb8f5d
2a4835442d477021f555272fd3033cad987dc94f
refs/heads/master
2021-09-12T13:06:50.423787
2018-04-17T02:42:24
2018-04-17T02:42:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
490
java
package bugmakers.club.dp.creational.seq5.prototype.structural.javaclone; /** * @Description: * @Author: Bruce * @Datetime: 2018/3/7 16:13 */ public class JavaConcretePrototype implements Cloneable { @Override public JavaConcretePrototype clone() { Object object = null; try { object = super.clone(); } catch (CloneNotSupportedException e) { e.printStackTrace(); } return (JavaConcretePrototype) object; } }
[ "oiiopro@live.cn" ]
oiiopro@live.cn
7ac80dc90278352f4fdb6c1a7de7802e38b8fc8c
f18d65356e89a2a5f7e363c72e6dfa842a8fe31b
/demo-mopub/src/main/java/toro/demo/mopub/DemoListAdapter.java
aeb5d1e6f2609adac2bf71040904253de3404593
[ "Apache-2.0" ]
permissive
shanto462/toro
c339ae3340fa4ba89507005996da3c2c360a9ee2
8c4ef5998def82b6ac530d8512fdd54d191da0af
refs/heads/dev-v3
2020-05-02T06:51:08.600632
2019-01-18T12:32:39
2019-01-18T12:32:39
177,804,804
0
0
NOASSERTION
2019-04-22T09:18:39
2019-03-26T14:26:53
Java
UTF-8
Java
false
false
4,721
java
/* * Copyright (c) 2018 Nam Nguyen, nam@ene.im * * 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 toro.demo.mopub; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.ViewGroup; import im.ene.toro.CacheManager; import im.ene.toro.PlayerSelector; import im.ene.toro.ToroPlayer; import im.ene.toro.ToroUtil; import im.ene.toro.exoplayer.ui.PlayerView; import im.ene.toro.exoplayer.ui.ToroControlView; import im.ene.toro.widget.Container; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; /** * This Adapter introduces 2 practices for Toro: * * 1. Acts as a {@link CacheManager}. The implementation is trivial. * 2. Acts as a {@link PlayerSelector} and minds the 'UI interaction'. * The background is: the {@link VideoViewHolder} has a {@link PlayerView} by default, in which * a {@link ToroControlView} is available. User can interact to that widget to play/pause/change * volume for a playback. If a playback is paused by User, we should not start it automatically. * * To be able to do this, we keep track of the player position that User has manually paused, * and use the ability of {@link PlayerSelector} to disallow it to start automatically, until * User manually do it again. Right now it caches only one position, but the implementation for * many should be trivial. * * @author eneim (2018/03/13). */ public class DemoListAdapter // extends RecyclerView.Adapter<BaseViewHolder> // implements PlayerSelector, CacheManager { private static final int TYPE_TEXT = 10; private static final int TYPE_VIDEO = 30; DemoListAdapter(PlayerSelector origin) { this.origin = ToroUtil.checkNotNull(origin); } DemoListAdapter() { this(PlayerSelector.DEFAULT); } private LayoutInflater inflater; @NonNull @Override public BaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { if (inflater == null || inflater.getContext() != parent.getContext()) { inflater = LayoutInflater.from(parent.getContext()); } return viewType == TYPE_VIDEO ? // new UiAwareVideoViewHolder(this, parent, inflater, R.layout.view_holder_video) : new TextViewHolder(parent, inflater, R.layout.view_holder_text); } @Override public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) { // Boolean.TRUE --> if holder is a TextViewHolder, then show both Text and Photo. // Boolean.FALSE --> if holder is a TextViewHolder, then show only Text. holder.bind(position % 5 == 0 ? Boolean.TRUE : Boolean.FALSE); } @Override public int getItemCount() { return Integer.MAX_VALUE; } @Override public int getItemViewType(int position) { return position % 4 == 1 ? TYPE_VIDEO : TYPE_TEXT; } /// PlayerSelector implementation @SuppressWarnings("WeakerAccess") // final PlayerSelector origin; // Keep a cache of the Playback order that is manually paused by User. // So that if User scroll to it again, it will not start play. // Value will be updated by the ViewHolder. final AtomicInteger lastUserPause = new AtomicInteger(-1); @NonNull @Override public Collection<ToroPlayer> select(@NonNull Container container, @NonNull List<ToroPlayer> items) { Collection<ToroPlayer> originalResult = origin.select(container, items); ArrayList<ToroPlayer> result = new ArrayList<>(originalResult); if (lastUserPause.get() >= 0) { for (Iterator<ToroPlayer> it = result.iterator(); it.hasNext(); ) { if (it.next().getPlayerOrder() == lastUserPause.get()) { it.remove(); break; } } } return result; } @NonNull @Override public PlayerSelector reverse() { return origin.reverse(); } /// CacheManager implementation @Nullable @Override public Object getKeyForOrder(int order) { return order; } @Nullable @Override public Integer getOrderForKey(@NonNull Object key) { return key instanceof Integer ? (Integer) key : null; } }
[ "mr.nguyenhoainam@gmail.com" ]
mr.nguyenhoainam@gmail.com
7ad00d6e3c94bed3f5dece13c61097fc46fe4c5d
f08d5380d60ec7c7e9e93f011c1d325e2ef360eb
/day14/代码/changgou/changgou-parent/changgou-service/changgou-service-seckill/src/main/java/com/changgou/seckill/controller/SeckillGoodsController.java
540e3285a761263b1c965fd4ccff0b3e566c4cb6
[]
no_license
RobodLee/changgou_datum
5234314d2cdaf251f36fb42ea180d4e3b75a21c3
4af02f7ee7570387b47b134e8252dd24255448ec
refs/heads/master
2022-12-10T08:56:48.169450
2020-09-09T05:38:01
2020-09-09T05:40:47
294,010,279
12
8
null
null
null
null
UTF-8
Java
false
false
5,285
java
package com.changgou.seckill.controller; import com.changgou.seckill.pojo.SeckillGoods; import com.changgou.seckill.service.SeckillGoodsService; import com.github.pagehelper.PageInfo; import entity.DateUtil; import entity.Result; import entity.StatusCode; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Date; import java.util.List; /**** * @Author:admin * @Description: * @Date 2019/6/14 0:18 *****/ @RestController @RequestMapping("/seckillGoods") @CrossOrigin public class SeckillGoodsController { @Autowired private SeckillGoodsService seckillGoodsService; /*** * SeckillGoods分页条件搜索实现 * @param seckillGoods * @param page * @param size * @return */ @PostMapping(value = "/search/{page}/{size}") public Result<PageInfo> findPage(@RequestBody(required = false) SeckillGoods seckillGoods, @PathVariable int page, @PathVariable int size) { //调用SeckillGoodsService实现分页条件查询SeckillGoods PageInfo<SeckillGoods> pageInfo = seckillGoodsService.findPage(seckillGoods, page, size); return new Result(true, StatusCode.OK, "查询成功", pageInfo); } /*** * SeckillGoods分页搜索实现 * @param page:当前页 * @param size:每页显示多少条 * @return */ @GetMapping(value = "/search/{page}/{size}") public Result<PageInfo> findPage(@PathVariable int page, @PathVariable int size) { //调用SeckillGoodsService实现分页查询SeckillGoods PageInfo<SeckillGoods> pageInfo = seckillGoodsService.findPage(page, size); return new Result<PageInfo>(true, StatusCode.OK, "查询成功", pageInfo); } /*** * 多条件搜索品牌数据 * @param seckillGoods * @return */ @PostMapping(value = "/search") public Result<List<SeckillGoods>> findList(@RequestBody(required = false) SeckillGoods seckillGoods) { //调用SeckillGoodsService实现条件查询SeckillGoods List<SeckillGoods> list = seckillGoodsService.findList(seckillGoods); return new Result<List<SeckillGoods>>(true, StatusCode.OK, "查询成功", list); } /*** * 根据ID删除品牌数据 * @param id * @return */ @DeleteMapping(value = "/{id}") public Result delete(@PathVariable Long id) { //调用SeckillGoodsService实现根据主键删除 seckillGoodsService.delete(id); return new Result(true, StatusCode.OK, "删除成功"); } /*** * 修改SeckillGoods数据 * @param seckillGoods * @param id * @return */ @PutMapping(value = "/{id}") public Result update(@RequestBody SeckillGoods seckillGoods, @PathVariable Long id) { //设置主键值 seckillGoods.setId(id); //调用SeckillGoodsService实现修改SeckillGoods seckillGoodsService.update(seckillGoods); return new Result(true, StatusCode.OK, "修改成功"); } /*** * 新增SeckillGoods数据 * @param seckillGoods * @return */ @PostMapping public Result add(@RequestBody SeckillGoods seckillGoods) { //调用SeckillGoodsService实现添加SeckillGoods seckillGoodsService.add(seckillGoods); return new Result(true, StatusCode.OK, "添加成功"); } /*** * 根据ID查询SeckillGoods数据 * @param id * @return */ @GetMapping("/{id}") public Result<SeckillGoods> findById(@PathVariable Long id) { //调用SeckillGoodsService实现根据主键查询SeckillGoods SeckillGoods seckillGoods = seckillGoodsService.findById(id); return new Result<SeckillGoods>(true, StatusCode.OK, "查询成功", seckillGoods); } /*** * 查询SeckillGoods全部数据 * @return */ @GetMapping public Result<List<SeckillGoods>> findAll() { //调用SeckillGoodsService实现查询所有SeckillGoods List<SeckillGoods> list = seckillGoodsService.findAll(); return new Result<List<SeckillGoods>>(true, StatusCode.OK, "查询成功", list); } /** * 获取当前的时间基准的5个时间段 * @return */ @GetMapping("/menus") public List<Date> datemenus() { List<Date> dateMenus = DateUtil.getDateMenus(); for (Date date : dateMenus) { System.out.println(date); } return dateMenus; } /** * 根据时间段(2019090516) 查询该时间段的所有的秒杀的商品 * @param time * @return */ @RequestMapping("/list") public List<SeckillGoods> list(String time){ List<SeckillGoods> seckillGoodsList = seckillGoodsService.list(time); for (SeckillGoods seckillGoods : seckillGoodsList) { System.out.println("id是:"+seckillGoods.getId()); } return seckillGoodsList; } /** * 根据时间段 和秒杀商品的ID 获取商的数据 * @param time * @param id * @return */ @GetMapping("/one") public SeckillGoods one(String time,Long id){ SeckillGoods seckillGoods = seckillGoodsService.one(time,id); return seckillGoods; } }
[ "robodlee@gmail.com" ]
robodlee@gmail.com
a2db47988a43afe05242c7c1eed10e4cd71fe204
d7c5121237c705b5847e374974b39f47fae13e10
/airspan.netspan/src/main/java/Netspan/NBI_15_2/Statistics/BsIbBaseTermDataRawGetResponse.java
d9d6c672edb01441e2e6ec2e769431283c1c3320
[]
no_license
AirspanNetworks/SWITModules
8ae768e0b864fa57dcb17168d015f6585d4455aa
7089a4b6456621a3abd601cc4592d4b52a948b57
refs/heads/master
2022-11-24T11:20:29.041478
2020-08-09T07:20:03
2020-08-09T07:20:03
184,545,627
1
0
null
2022-11-16T12:35:12
2019-05-02T08:21:55
Java
UTF-8
Java
false
false
1,957
java
package Netspan.NBI_15_2.Statistics; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="BsIbBaseTermDataRawGetResult" type="{http://Airspan.Netspan.WebServices}StatsBsIbBaseTermDataResponse" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "bsIbBaseTermDataRawGetResult" }) @XmlRootElement(name = "BsIbBaseTermDataRawGetResponse") public class BsIbBaseTermDataRawGetResponse { @XmlElement(name = "BsIbBaseTermDataRawGetResult") protected StatsBsIbBaseTermDataResponse bsIbBaseTermDataRawGetResult; /** * Gets the value of the bsIbBaseTermDataRawGetResult property. * * @return * possible object is * {@link StatsBsIbBaseTermDataResponse } * */ public StatsBsIbBaseTermDataResponse getBsIbBaseTermDataRawGetResult() { return bsIbBaseTermDataRawGetResult; } /** * Sets the value of the bsIbBaseTermDataRawGetResult property. * * @param value * allowed object is * {@link StatsBsIbBaseTermDataResponse } * */ public void setBsIbBaseTermDataRawGetResult(StatsBsIbBaseTermDataResponse value) { this.bsIbBaseTermDataRawGetResult = value; } }
[ "dshalom@airspan.com" ]
dshalom@airspan.com
0667bf03dd22cb2637c88fccc9f8b843425e99cc
431816188985fa5c378cb7dcdd0793f1f7c53232
/app/src/main/java/com/tunieapps/ojucam/camera/CameraEngine.java
a801cf8a10eb671c5f5ce8ca8f64d07e0b403680
[]
no_license
mowenli/OjuCam
37214e2f17f6a15f328491fee1a1fb0bfbb44a5f
fe12730147a76faad3e281121eb9833c68ed9eca
refs/heads/master
2023-03-01T14:33:20.578777
2021-02-09T09:09:58
2021-02-09T09:09:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,605
java
package com.tunieapps.ojucam.camera; import android.graphics.ImageFormat; import android.graphics.SurfaceTexture; import android.hardware.Camera; import android.util.Log; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; public class CameraEngine implements Camera.PreviewCallback { private Camera camera; private Camera.Parameters mParams; private boolean cameraOpened; private FrameListener frameUpdateListener; private byte[] mBuffer; //frameWidth=size.height Camera.Size previewSize; int bufferSize; private static final double preferredRatio=16.0/9; private int frameWidth; private int frameHeight; public CameraEngine(){ } public void open() { try { camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT); mParams = camera.getParameters(); List<Camera.Size> supportedPictureSizesList=mParams.getSupportedPictureSizes(); List<Camera.Size> supportedVideoSizesList=mParams.getSupportedVideoSizes(); List<Camera.Size> supportedPreviewSizesList=mParams.getSupportedPreviewSizes(); // Logger.logCameraSizes(supportedPictureSizesList); // Logger.logCameraSizes(supportedVideoSizesList); //Logger.logCameraSizes(supportedPreviewSizesList); previewSize=choosePreferredSize(supportedPreviewSizesList,preferredRatio); Camera.Size photoSize=choosePreferredSize(supportedPictureSizesList,preferredRatio); frameHeight=previewSize.width; frameWidth=previewSize.height; // Log.d(TAG, "openCamera: choose preview size"+previewSize.height+"x"+previewSize.width); mParams.setPreviewSize(frameHeight,frameWidth); mParams.setPictureSize(photoSize.width,photoSize.height); // Log.d(TAG, "openCamera: choose photo size"+photoSize.height+"x"+photoSize.width); //mParams.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); bufferSize = frameWidth*frameHeight; bufferSize = bufferSize * ImageFormat.getBitsPerPixel(mParams.getPreviewFormat()) / 8; if (mBuffer==null || mBuffer.length!=bufferSize) mBuffer = new byte[bufferSize]; // mFrameChain[0].init(size); // mFrameChain[1].init(size); camera.addCallbackBuffer(mBuffer); camera.setParameters(mParams); cameraOpened=true; camera.setPreviewCallback(this); cameraOpened = true; }catch (Exception exc){ exc.printStackTrace(); cameraOpened = false; } } public boolean isCameraOpened() { return cameraOpened; } public void startPreview(SurfaceTexture surfaceTexture){ try { camera.setPreviewTexture(surfaceTexture); } catch (IOException e) { e.printStackTrace(); } camera.startPreview(); } private static Camera.Size choosePreferredSize(List<Camera.Size> sizes, double aspectRatio) { List<Camera.Size> options = new ArrayList<>(); for (Camera.Size option : sizes) { if(option.width==1280 && option.height==720) return option; if (Math.abs((int)(option.height * aspectRatio)-option.width)<10) { options.add(option); } } if (options.size() > 0) { return Collections.max(options, new CompareSizesByArea()); } else { return sizes.get(sizes.size()-1); } } static class CompareSizesByArea implements Comparator<Camera.Size> { @Override public int compare(Camera.Size lhs, Camera.Size rhs) { // We cast here to ensure the multiplications won't overflow return Long.signum((long) lhs.width * lhs.height - (long) rhs.width * rhs.height); } } public void stopPreview(){ camera.stopPreview(); } public void close(){ camera.release(); camera.setPreviewCallback(null); cameraOpened = false; } public void setFrameUpdateListener(FrameListener frameUpdateListener) { this.frameUpdateListener = frameUpdateListener; } @Override public void onPreviewFrame(byte[] data, Camera camera) { frameUpdateListener.previewFrame(data,bufferSize,camera.getParameters().getPreviewSize().width, camera.getParameters().getPreviewSize().height); } }
[ "cetydistjoy@gmail.com" ]
cetydistjoy@gmail.com
d7ef97f9fd7ebeb4da9775302114b9b4e45c2f89
1f19aec2ecfd756934898cf0ad2758ee18d9eca2
/u-1/u-12/u-11-112/u-11-112-f2116.java
d0bf0e59374931f251da91c62b15f77cde26cde7
[]
no_license
apertureatf/perftest
f6c6e69efad59265197f43af5072aa7af8393a34
584257a0c1ada22e5486052c11395858a87b20d5
refs/heads/master
2020-06-07T17:52:51.172890
2019-06-21T18:53:01
2019-06-21T18:53:01
193,039,805
0
0
null
null
null
null
UTF-8
Java
false
false
105
java
mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117 418804280342
[ "jenkins@khan.paloaltonetworks.local" ]
jenkins@khan.paloaltonetworks.local
a6243cfc7c6a9aa952539e051f8511c6e6c1ff8c
7d37366a71beb26addc6b5e7dac22cfc99bceff6
/ExtremeManager/src/com/nxa/controller/CheckController.java
18803c943d191ceab5aee4ccaa2e7ecfbb78def0
[]
no_license
AirAnYv/ExtremeManager
6041c00a26d5edeb58d9f56f3a63c4be91c720ad
1e74db79603d2b8a4947dd96dbafd1605980d492
refs/heads/master
2020-08-01T17:38:59.224323
2019-09-26T10:53:20
2019-09-26T10:53:20
211,063,372
0
0
null
null
null
null
GB18030
Java
false
false
1,391
java
package com.nxa.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import com.nxa.bean.Check; import com.nxa.service.CheckService; import com.nxa.service.RoomService; import com.nxa.tool.UtilTool; @Controller public class CheckController { @Autowired private CheckService checkService; @Autowired private RoomService roomService; @RequestMapping("/checkin") public String addCheckIn(Check ci){ String Name = UtilTool.getGBK(ci.getName()); String oiName = UtilTool.getGBK(ci.getOiName()); String ciMark = UtilTool.getGBK(ci.getCiMark()); ci.setName(Name); ci.setOiName(oiName); ci.setCiMark(ciMark); checkService.addCheckIn(ci); return "menu"; } @RequestMapping("/checkout") public String modifyCheck(Check ci){ checkService.CheckOut(ci); return "menu"; } @RequestMapping("/querycino") public String queryciNo(Integer ciNo,Model model){ Check check = checkService.querycino(ciNo); long day = UtilTool.getDate(check.getCiDateTime())+1; //这里写每日多少钱 double money = roomService.getRoomPrice(check.getRoomNo())*day; model.addAttribute("querycino",check); model.addAttribute("money",money); model.addAttribute("day",day); return "checkout"; } }
[ "1120256128@qq.com" ]
1120256128@qq.com
da32d015c5ad70aee49f1378af93bb6c495ad8ee
e2463f4a85f16b8a8af1c62414196e107d420b82
/records/test/guestTest/PersonTest.java
b435a582d232e8894e4f7bca69e6287cce69d141
[]
no_license
navyasrib/java
4f150f66b422dd79ea2b5d04c5dcf7c54acca6e2
b47494562c4538fcbb5040053d4ab8e12ecdf382
refs/heads/master
2021-01-10T07:02:07.328196
2016-03-15T12:02:17
2016-03-15T12:02:17
52,342,685
0
0
null
null
null
null
UTF-8
Java
false
false
1,065
java
package guestTest; import guest.Person; import org.junit.Before; import org.junit.Test; import personDetails.*; import java.util.*; import static org.junit.Assert.assertEquals; public class PersonTest { Name name; Age age; Gender gender; Address address; @Before public void setUp() throws Exception { name = new Name("Chaitanya", "Ram"); age = new Age(12); gender = new Gender("male"); City city = new City("Jamshedpur"); State state = new State("Jharkhand"); Country country = new Country("India"); address = new Address(city, state, country); } @Test public void testShouldGiveTheFirstNameOfPerson() throws Exception { Person person = new Person(name, gender, age, address); assertEquals("Chaitanya",person.getFirstName()); } @Test public void testShouldGiveTheLastNameOfPerson() throws Exception { Person person = new Person(name, gender, age, address); assertEquals("Ram",person.getLastName()); } }
[ "basava@thoughtworks.com" ]
basava@thoughtworks.com
ae69c5a1b5b1b1f8efd221a9d14a9916e4343267
bfdf5095a4c5d058dab0a9b95ad58f4aed72a6be
/src/com/gfg/ds/binarytree/intro/Node.java
6e6ce997907aa691459aa5c018ca9cde317baf8f
[]
no_license
sivajik/DSandAlgorithms
9fb822506315f1b93ae279f1edba47b87b2d107c
a972e6c0b0f6991e0000b66a941ab113a09829fc
refs/heads/master
2022-07-16T17:39:54.314720
2022-05-25T20:37:33
2022-05-25T20:37:33
229,936,402
1
0
null
null
null
null
UTF-8
Java
false
false
97
java
package com.gfg.ds.binarytree.intro; public class Node { Node left; Node right; int value; }
[ "sivaji_kondapalli@yahoo.com" ]
sivaji_kondapalli@yahoo.com
3a1dd0a01f4cc82463b079fe17271b4849df9a4b
a2bacfd8fc9183fc0713473e82515f9bde8fb58c
/src/main/java/com/pjh/share/domain/group/GroupRepository.java
ed1c7227881125f637263fe28c171620d246d9fb
[]
no_license
pjh37/pjh-springboot-webservice
0f2af51d9bb2982b0176df6750da04b25262a71c
d249b8d9fd6e9656a6350015ea8fbac3c9287f5f
refs/heads/master
2023-01-06T10:26:09.672844
2020-11-04T15:48:38
2020-11-04T15:48:38
265,007,322
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
package com.pjh.share.domain.group; import com.pjh.share.domain.video.Video; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import java.util.List; public interface GroupRepository extends JpaRepository<Group,Long> { }
[ "37110261+pjh37@users.noreply.github.com" ]
37110261+pjh37@users.noreply.github.com
b1df596d3248ffbafa1e90c4acec6bfc9d277895
b2bf80088d8cae13b06095325cf6787c84a84132
/src/ifDecisionStatement/homework.java
c5ee3854ac1550c1183e47b45617a898cf6978aa
[]
no_license
yalman1/new-java
6844d5aca45a8bd09ca3eec1781fcf887f2c6a5b
ed83f0106fd6cfcf79619b45f8924432558a19c1
refs/heads/master
2020-12-27T09:19:23.594222
2020-05-18T23:15:46
2020-05-18T23:15:46
237,848,164
0
0
null
null
null
null
UTF-8
Java
false
false
2,175
java
package ifDecisionStatement; import java.util.Scanner; public class homework { public static void main(String[] args) { Scanner myScan =new Scanner (System.in); String ID1 = "123"; String ID2 = "124"; String ID3 = "125"; String ID4 = "126"; String ID5 = "127"; float price1 = 2.49f ; float price2 = 4.79f ; float price3 = 1.65f ; float price4 = 7.88f ; float price5 = 0.99f ; System.out.println("what is Id1 number"); int item1 = myScan.nextInt(); System.out.println("what is quantity1"); int quantity1 = myScan.nextInt(); System.out.println("what is Id2 number"); int item2 = myScan.nextInt(); System.out.println("what is quantity2"); int quantity2 = myScan.nextInt(); System.out.println("what is Id3 number"); int item3 = myScan.nextInt(); System.out.println("what is quantity3"); int quantity3 = myScan.nextInt(); System.out.println("what is Id4 number"); int item4 = myScan.nextInt(); System.out.println("what is quantity4"); int quantity4 = myScan.nextInt(); System.out.println("what is Id5 number"); int item5 = myScan.nextInt(); System.out.println("what is quantity5"); int quantity5 = myScan.nextInt(); System.out.println("itemID" + " "+"quantity"+ " "+"Price"); System.out.println("_____________________________________________________"); if (item1 ==123); System.out.println(ID1 + "\t\t" + quantity1+"\t\t"+"$"+(quantity1*price1)); if (item2 ==124); System.out.println(ID2 +"\t\t"+ quantity2+"\t\t"+ "$"+(quantity2*price2)); if (item1 ==125); System.out.println(ID3 +"\t\t"+ quantity3+"\t\t" + "$"+(quantity3*price3)); if (item1 ==126); System.out.println(ID4 +"\t\t"+ quantity4+"\t\t" + "$" + (quantity4*price4)); if (item1 ==127); System.out.println(ID5 +"\t\t"+ quantity5+"\t\t" + "$"+(quantity5*price5)); System.out.println("\t\tTotal: "+ "$"+(price1+price2+price3+price4+price5)); } }
[ "dyalman@na.edu" ]
dyalman@na.edu
5d6767538ae7db8cd45df91a1693cec1e32e673d
00f2475b4f8fb88f8b44884acce9779a5bea1e86
/src/main/java/com/yang/Replay.java
e4d40bd8223535fc9887137cf314a613ba38cb79
[]
no_license
JamzYang/cobbler
f2d812aa6246ccd1dad28813f651758fb8235622
8991197cddb00c9f8a4cb1a79fe5df36ead0a1a4
refs/heads/master
2022-09-29T08:53:37.394144
2021-03-27T16:35:49
2021-03-27T16:35:49
249,740,472
0
0
null
2022-09-01T23:22:11
2020-03-24T15:09:37
Java
UTF-8
Java
false
false
1,595
java
package com.yang; /** * @author yang * Date 2020/3/24 23:03 */ public class Replay { private String ctime; private String user_name_real; private String uid; private String id; private String content; private String utype; private String comment_id; private String user_name; public Replay() { } public String getCtime() { return ctime; } public void setCtime(String ctime) { this.ctime = ctime; } public String getUser_name_real() { return user_name_real; } public void setUser_name_real(String user_name_real) { this.user_name_real = user_name_real; } public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getUtype() { return utype; } public void setUtype(String utype) { this.utype = utype; } public String getComment_id() { return comment_id; } public void setComment_id(String comment_id) { this.comment_id = comment_id; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } }
[ "yangshen727@163.com" ]
yangshen727@163.com
74c6ca33898430bd97c996a980cf27c6c0484e5e
e4333ceedfb2c11ce64bfcae291a7906e5d0c8f3
/eppdev-code-generator/src/main/java/cn/eppdev/codegenerator/manager/web/SchemaController.java
4fa2d629c970afb63349d3894569909d996213e8
[]
no_license
jinlong-hao/eppdev-jee
2338d7288d633cbe1b45421a8312abe56fc7fcef
1ff6c15d046c1a34e07f123f0de682cd255aedee
refs/heads/master
2021-07-24T05:36:15.049191
2017-11-03T16:22:27
2017-11-03T16:22:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,568
java
/* * FileName: SchemaController.java * Author: fan.hao fan.hao@eppdev.cn * Date: 2017-11-03 */ package cn.eppdev.codegenerator.manager.web; import cn.eppdev.codegenerator.manager.entity.EppdevTable; import cn.eppdev.codegenerator.manager.service.SchemaService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import java.io.IOException; import java.util.List; /** * @author fan.hao */ @Controller public class SchemaController { static Logger logger = LoggerFactory.getLogger(SchemaController.class); @Autowired SchemaService schemaService; @RequestMapping("/init") public String init(RedirectAttributes redirectAttributes) { try { schemaService.init(); redirectAttributes.addFlashAttribute("message", "加载成功"); } catch (IOException e) { logger.error("Error: {}\n{}", e.getMessage(), e.getStackTrace()); e.printStackTrace(); redirectAttributes.addFlashAttribute("message", "出错:" + e.getMessage()); } return "redirect:/table/"; } @RequestMapping("/loadSchema") public String loadExistsSchema(RedirectAttributes redirectAttributes) { try { schemaService.updateTableInfo(); redirectAttributes.addFlashAttribute("message", "加载成功"); } catch (Exception e) { logger.error("Error: {}\n{}", e.getMessage(), e.getStackTrace()); e.printStackTrace(); redirectAttributes.addFlashAttribute("message", "出错:" + e.getMessage()); } return "redirect:/table/"; } @RequestMapping("/generateSource/{versionId}") public String generateSourceFiles(RedirectAttributes redirectAttributes, @PathVariable("versionId") String versionId) { try { schemaService.generateSource(versionId); redirectAttributes.addFlashAttribute("message", "生成成功"); } catch (Exception e) { logger.error("Error: {}\n{}", e.getMessage(), e.getStackTrace()); e.printStackTrace(); redirectAttributes.addFlashAttribute("message", "出错:" + e.getMessage()); } return "redirect:/table/"; } }
[ "fan.hao@eppdev.cn" ]
fan.hao@eppdev.cn
bc2dd3edb634945c9bd4ca20f23caafdbbb47a32
b4493419485490a99785ffb5ded9e0806a533426
/archive/proto/test/src/com/arsdigita/tools/junit/framework/BaseTestCase.java
b337ae2d961cd2cc4af79cf7af963c63b459464a
[]
no_license
BackupTheBerlios/myrian-svn
11b6704a34689251c835cc1d6b21295c4312e2e5
65c1acb69e37f146bfece618b8812b0760bdcae5
refs/heads/master
2021-01-01T06:44:46.948808
2004-10-19T20:03:43
2004-10-19T20:03:43
40,823,082
0
0
null
null
null
null
UTF-8
Java
false
false
2,296
java
/* * Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved. * * The contents of this file are subject to the CCM Public * License (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.redhat.com/licenses/ccmpl.html * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * */ package com.arsdigita.tools.junit.framework; import junit.framework.*; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; import com.arsdigita.kernel.TestHelper; import org.apache.log4j.Logger; import java.util.Locale; public abstract class BaseTestCase extends TestCase { private static Logger s_log = Logger.getLogger(BaseTestCase.class.getName()); /** * Constructs a test case with the given name. */ public BaseTestCase(String name) { super(name); } /** * Runs the bare test sequence. * @exception Throwable if any exception is thrown */ public void runBare() throws Throwable { baseSetUp(); try { try { setUp(); runTest(); } catch(Throwable t) { try { tearDown(); } catch (Throwable t2) { System.err.println ( "Error in teardown: " ); t2.printStackTrace ( System.err ); } throw t; } tearDown(); } finally { baseTearDown (); } } protected void baseSetUp() { s_log.warn (this.getClass().getName() + "." + getName() + " started"); Session sess = SessionManager.getSession(); sess.getTransactionContext().beginTxn(); TestHelper.setLocale(Locale.ENGLISH); } protected void baseTearDown() { Session sess = SessionManager.getSession(); if (sess.getTransactionContext().inTxn()) { sess.getTransactionContext().abortTxn(); } s_log.info (this.getClass().getName() + " finished"); } }
[ "dennis@0c4ed275-74e5-0310-b0c6-b6ea092b5e81" ]
dennis@0c4ed275-74e5-0310-b0c6-b6ea092b5e81
995a695ed7f5f52ae821cb3cbed6b80ab6aa117a
e76a98f7448cefb9712c5fc4d7e99e7eac433b8f
/caracteristicas-da-linguagem/src/main/java/one/innovation/digital/usuario/SuperUsuario.java
76e547b5ed214dbea4c378c2124bd5a29f9101c1
[]
no_license
felipem0ta/furry-potato
a41df3a0e365b6ab6a9d1395fef822f475ddb6db
fda38df3c579c106a3e6bb0eabbc459be906ff30
refs/heads/master
2022-09-19T15:13:47.431849
2022-08-17T15:54:57
2022-08-17T15:54:57
92,781,140
0
0
null
null
null
null
UTF-8
Java
false
false
367
java
package one.innovation.digital.usuario; public class SuperUsuario { private String login; private String senha; String nome; public SuperUsuario(final String login, final String senha){ this.login = login; this.senha = senha; } public String getLogin() {return login;} public String getSenha() {return senha;} }
[ "felipesantana.mota@gmail.com" ]
felipesantana.mota@gmail.com
5bd09eaa6285d757750982f596e797dadb258609
fbf712817c60e2d0a0206b8540316a51f1068caf
/Src/tourDeFrancia/Tour.java
42fdb3bca4c14909d5acd91bf9c91409e210aa77
[]
no_license
juancamilopr/POO
c77dc42f27acdfa28675aea3ed86fbb5435d789e
59516d2589f1ae097a7bffdd9c0800d67b722632
refs/heads/master
2023-04-09T03:44:29.475886
2021-04-10T03:24:15
2021-04-10T03:24:15
340,187,817
0
0
null
null
null
null
UTF-8
Java
false
false
992
java
package tourDeFrancia; import java.util.ArrayList; public class Tour { private String verEquiposDelTour; private String resultadoDeEtapa; public ArrayList<Corredor> corredoresDeUnEquipos; public ArrayList<Tabla> tablaDePosiciones; public Tour(String nombreDelTour, double distanciaDelTour) { this.verEquiposDelTour = verEquiposDelTour; this.resultadoDeEtapa = resultadoDeEtapa; this.corredoresDeUnEquipos = new ArrayList<Corredor>(); this.tablaDePosiciones = new ArrayList<Tabla>(); } public String verEquiposDelTour() { return verEquiposDelTour; } public String resultadoDeEtapa() { return resultadoDeEtapa; } public ArrayList<Equipo> getcorredoresDeUnEquipos() { return corredoresDeUnEquipos; } public ArrayList<Tabla> gettablaDePosiciones() { return tablaDePosiciones; } }
[ "juan.patino4242@uco.net.co" ]
juan.patino4242@uco.net.co
b3140d080f19ad40fcc6b2f92d6d73f31330d0da
8e1a1fcf11a38c74310963b86571efb6a8a2e818
/app/src/main/java/com/fgtit/onepass/MenuActivity.java
3b1e70b4b805abcbf92a089d44eee2055ada0c2d
[]
no_license
maurice40/Finger-Print-Attentance
05f1f9b2eb3d992b4b5697df75e4466e447f60e1
4b06435a768ad457293e80dc9ccf921bd71ca274
refs/heads/master
2020-05-27T10:25:17.994836
2019-11-29T16:06:38
2019-11-29T16:06:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,766
java
package com.fgtit.onepass; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.SimpleAdapter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class MenuActivity extends Activity { private ListView listView; private List<Map<String, Object>> mData; @SuppressLint("NewApi") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_menu); this.getActionBar().setDisplayHomeAsUpEnabled(true); listView = (ListView) findViewById(R.id.listView1); SimpleAdapter adapter = new SimpleAdapter(this, getData(), R.layout.listview_menuitem, new String[]{"title", "info", "img"}, new int[]{R.id.title, R.id.info, R.id.img}); listView.setAdapter(adapter); listView.setOnItemClickListener(new ListView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int pos, long id) { //Map<String, Object> item = (Map<String, Object>)parent.getItemAtPosition(pos); switch (pos) { case 0: { Intent intent = new Intent(MenuActivity.this, RecordsActivity.class); startActivity(intent); overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left); } break; case 1: { Intent intent = new Intent(MenuActivity.this, EmployeesActivity.class); startActivity(intent); overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left); } break; /* case 2: { Intent intent = new Intent(MenuActivity.this, UtilitiesActivity.class); startActivity(intent); overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left); } break;*/ case 2: { Intent intent = new Intent(MenuActivity.this, SystemActivity.class); startActivity(intent); overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left); } break; case 3: { Intent intent = new Intent(MenuActivity.this, AboutActivity.class); startActivity(intent); overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left); } break; } } }); } private List<Map<String, Object>> getData() { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); Map<String, Object> map = new HashMap<String, Object>(); map = new HashMap<String, Object>(); map.put("title", getString(R.string.txt_title_01)); map.put("info", getString(R.string.txt_info_01)); map.put("img", R.drawable.view_details); list.add(map); map = new HashMap<String, Object>(); map.put("title", getString(R.string.txt_title_02)); map.put("info", getString(R.string.txt_info_02)); map.put("img", R.drawable.group); list.add(map); /* map = new HashMap<String, Object>(); map.put("title", getString(R.string.txt_title_03)); map.put("info", getString(R.string.txt_info_03)); map.put("img", R.drawable.reload); list.add(map);*/ map = new HashMap<String, Object>(); map.put("title", getString(R.string.txt_title_04)); map.put("info", getString(R.string.txt_info_04)); map.put("img", R.drawable.engineering); list.add(map); map = new HashMap<String, Object>(); map.put("title", getString(R.string.txt_title_05)); map.put("info", getString(R.string.txt_info_05)); map.put("img", R.drawable.about); list.add(map); mData = list; return list; } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.system, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); switch (id) { case android.R.id.home: this.setResult(1); this.finish(); return true; case R.id.action_settings: Intent intent = new Intent(this, SettingsActivity.class); startActivity(intent); return true; } return super.onOptionsItemSelected(item); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) { this.setResult(1); this.finish(); return true; } return super.onKeyDown(keyCode, event); } }
[ "musabiremam0@gmail.com" ]
musabiremam0@gmail.com
e4cbf726b7a08e771046094bcfc495e5cb68c515
b480825a2f726254769fb902bc22506ba357a2db
/DZ/DZ4/bugFixing1/bugFixing/src/main/java/com/bugs/null_pointer_exceptions/ArrayTest2.java
9be7252371664c35dfc24f239b4ef74dfd6a806a
[]
no_license
Oleggithub/firstProjectJavaEE
865168979e91fdfea2f94113146f977c98a513ae
c4eea6cb479b0d322b3e44425d6b978ba4be2cc2
refs/heads/master
2020-12-24T09:16:58.877085
2016-12-26T06:59:53
2016-12-26T06:59:53
73,300,401
0
0
null
null
null
null
UTF-8
Java
false
false
578
java
package com.bugs.null_pointer_exceptions; import java.util.Arrays; public class ArrayTest2 { public static void main(String[] args) { int[][] matrix = new int[5][]; for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[i].length; i++) { matrix[i][j] = 1; } } //implements yours output according to the next style for(int[] matrix_ : matrix){ System.out.println(Arrays.toString(matrix_)); } } } /* [1] [1, 1] [1, 1, 1] [1, 1, 1, 1] [1, 1, 1, 1, 1] */
[ "F:\\Work\\D\\mail" ]
F:\Work\D\mail
b2587529dbd5cf83ac3b5ac22f7153a80020e69d
5406551c13426d1738e2e3574f1f2f62173cac80
/app/src/main/java/com/kubaspatny/startupanimation/JSONUtil/Message.java
87666ff9d320ebd8b09f2b496237b1ba1cb589e1
[]
no_license
kubaspatny/nuntius-android
621ece723afc3288f6c27204d32debd6a332b03b
b1494c2d7e90fab90583027a0ceaca44939b014f
refs/heads/master
2021-01-17T17:20:22.188462
2014-09-22T16:33:21
2014-09-22T16:33:21
23,937,357
0
0
null
null
null
null
UTF-8
Java
false
false
1,285
java
package com.kubaspatny.startupanimation.JSONUtil; import org.joda.time.DateTime; /** * Created by Kuba on 11/9/2014. */ public class Message { private Long id; private String mMessageBody; private DateTime mMessageTimestamp; private String timestampString; public Message() { } public Message(Long id, String mMessageBody, DateTime mMessageTimestamp, String timestampString) { this.id = id; this.mMessageBody = mMessageBody; this.mMessageTimestamp = mMessageTimestamp; this.timestampString = timestampString; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getmMessageBody() { return mMessageBody; } public void setmMessageBody(String mMessageBody) { this.mMessageBody = mMessageBody; } public DateTime getmMessageTimestamp() { return mMessageTimestamp; } public void setmMessageTimestamp(DateTime mMessageTimestamp) { this.mMessageTimestamp = mMessageTimestamp; } public String getTimestampString() { return timestampString; } public void setTimestampString(String timestampString) { this.timestampString = timestampString; } }
[ "spatnjak@fel.cvut.cz" ]
spatnjak@fel.cvut.cz
8f98d0001ee3498ae427d6b2d1c77cd8d5356866
2a67ffc24a6ac9cbe0d712cce3a25faa9431f315
/miao-sha-order-service/src/main/java/com/geekq/miaosha/order/mq/MiaoShaMessage.java
ead14785c7243643e949d9e48e396184373602ec
[]
no_license
zhangchuan1210/cloud-miao-sha
08a890acf1e575ee79facf99b595606c684c91fe
649055aa696c00b3204074335c18913ca4ccf00b
refs/heads/main
2023-07-07T13:53:00.635994
2021-08-06T04:29:11
2021-08-06T04:29:11
371,232,198
1
0
null
null
null
null
UTF-8
Java
false
false
409
java
package com.geekq.miaosha.order.mq; import com.geekq.miaosha.common.biz.entity.MiaoshaUser; public class MiaoShaMessage { private MiaoshaUser user; private long goodsId; public MiaoshaUser getUser() { return user; } public void setUser(MiaoshaUser user) { this.user = user; } public long getGoodsId() { return goodsId; } public void setGoodsId(long goodsId) { this.goodsId = goodsId; } }
[ "1004300749@qq.com" ]
1004300749@qq.com
b54f4cd36b970548f67a3863236262d16415008f
86b15e240094fa61a10a6251cd7a2bf4c8c0f218
/app/src/main/java/khaliliyoussef/booklisting/utils/NetworkUtil.java
5d8eddfe77507b9e568a008868c1dde605604ca9
[]
no_license
KhalilIYoussef/BookListing
ba7d4adb09e5789436a98488db898bafe2c46f7e
f6627b3aa9ab4d0f5ed2d9e823c02006dc87d3d6
refs/heads/master
2021-07-06T11:48:42.824197
2017-09-29T02:36:02
2017-09-29T02:36:02
105,216,323
0
0
null
null
null
null
UTF-8
Java
false
false
5,809
java
package khaliliyoussef.booklisting.utils; import android.text.TextUtils; import android.util.Log; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; import khaliliyoussef.booklisting.model.Book; /** * Created by khalil on the 28/09/2017. */ public final class NetworkUtil { private static final String LOG_TAG = NetworkUtil.class.getSimpleName(); private NetworkUtil() { } public static List<Book> fetchBookList(String requestUrl) { URL url = createUrl(requestUrl); String jsonResponse = null; try { jsonResponse = makeHttpRequest(url); } catch (IOException e) { Log.e(LOG_TAG, "Problem making the HTTP request.", e); } List<Book> books = extractFeatureFromJson(jsonResponse); return books; } private static URL createUrl(String stringUrl) { URL url = null; try { url = new URL(stringUrl); } catch (MalformedURLException e) { Log.e(LOG_TAG, "Error with creating URL ", e); } return url; } private static String makeHttpRequest(URL url) throws IOException { String jsonResponse = ""; if (url == null) { return jsonResponse; } HttpURLConnection urlConnection = null; InputStream inputStream = null; try { urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setReadTimeout(10000 /* milliseconds */); urlConnection.setConnectTimeout(15000 /* milliseconds */); urlConnection.setRequestMethod("GET"); urlConnection.connect(); if (urlConnection.getResponseCode() == HttpURLConnection.HTTP_OK) { inputStream = urlConnection.getInputStream(); jsonResponse = readFromStream(inputStream); } else { Log.e(LOG_TAG, "Error response code: " + urlConnection.getResponseCode()); } } catch (IOException e) { Log.e(LOG_TAG, "Problem retrieving the book JSON results.", e); } finally { if (urlConnection != null) { urlConnection.disconnect(); } if (inputStream != null) { inputStream.close(); } } return jsonResponse; } private static String readFromStream(InputStream inputStream) throws IOException { StringBuilder output = new StringBuilder(); if (inputStream != null) { InputStreamReader inputStreamReader = new InputStreamReader(inputStream, Charset.forName("UTF-8")); BufferedReader reader = new BufferedReader(inputStreamReader); String line = reader.readLine(); while (line != null) { output.append(line); line = reader.readLine(); } } return output.toString(); } private static List<Book> extractFeatureFromJson(String bookJSON) { if (TextUtils.isEmpty(bookJSON)) { return null; } List<Book> books = new ArrayList<>(); try { JSONObject baseJsonResponse = new JSONObject(bookJSON); JSONArray itemsArray = baseJsonResponse.getJSONArray("items"); for (int i = 0; i < itemsArray.length(); i++) { JSONObject currentBook = itemsArray.getJSONObject(i); JSONObject volumeInfo = currentBook.getJSONObject("volumeInfo"); String thumbnail = "N/A"; if (volumeInfo.has("thumbnail")) { JSONObject imageLinks = volumeInfo.getJSONObject("imageLinks"); if (imageLinks.has("thumbnail")) { thumbnail = imageLinks.getString("thumbnail"); } else { thumbnail = "No Image"; } } String title = volumeInfo.getString("title"); JSONArray authorsArray; StringBuilder authors = new StringBuilder(); if (volumeInfo.has("authors")) { authorsArray = volumeInfo.getJSONArray("authors"); for (int n = 0; n < authorsArray.length(); n++) { authors.append(System.getProperty("line.separator")); authors.append(authorsArray.getString(n)); } } else { authors.append("No Author"); } String publisher; if (volumeInfo.has("publisher")) { publisher = volumeInfo.getString("publisher"); } else { publisher = "No editor"; } String pageCount; if (volumeInfo.has("pageCount")) { pageCount = volumeInfo.getString("pageCount"); } else { pageCount = "No page"; } String url = null; if (volumeInfo.has("infoLink")) { url = volumeInfo.getString("infoLink"); } Book book = new Book(thumbnail, title, authors, publisher, pageCount, url); books.add(book); } } catch (JSONException e) { Log.e(LOG_TAG, "Problem parsing the book JSON results", e); } return books; } }
[ "khalilibrahim865@gmail.com" ]
khalilibrahim865@gmail.com
68e8a98a00b30a7cc8d6b29ac2a0655115735371
043fb596e15fb76236282a23713a47974ee93a69
/src/main/java/codemining/cpp/codeutils/CppASTAnnotatedTokenizer.java
b0993704de46b92afcfe95b4f16d6f3fdf31b951
[ "BSD-3-Clause" ]
permissive
mast-group/codemining-core
529163fc75a342f92b27bafac0f0cb28ef02a6dd
f3da52ca18c71b7ffbd8dcaa3548f86f8b49d36b
refs/heads/master
2020-05-30T14:27:51.990335
2018-06-05T00:40:11
2018-06-05T00:40:11
28,141,213
21
11
BSD-3-Clause
2018-06-05T00:40:12
2014-12-17T14:44:30
Java
UTF-8
Java
false
false
824
java
/** * */ package codemining.cpp.codeutils; import codemining.languagetools.ITokenizer; /** * A C++ AST Annotated Tokenizer * * @author Miltos Allamanis <m.allamanis@ed.ac.uk> * */ public class CppASTAnnotatedTokenizer extends AbstractCdtASTAnnotatedTokenizer { private static final long serialVersionUID = -8016456170070671980L; /** * */ public CppASTAnnotatedTokenizer() { super(CppASTExtractor.class, ""); } /** * @param base */ public CppASTAnnotatedTokenizer(final ITokenizer base) { super(base, CppASTExtractor.class, ""); } public CppASTAnnotatedTokenizer(final ITokenizer base, final String codeBasePath) { super(base, CppASTExtractor.class, codeBasePath); } public CppASTAnnotatedTokenizer(final String codeBasePath) { super(CppASTExtractor.class, codeBasePath); } }
[ "m.allamanis@ed.ac.uk" ]
m.allamanis@ed.ac.uk
9ead7a466b368a7abe3f0831ce4c8b0b55c34a54
0b63c6615c9ca11ab998346162c8161e07710cf7
/EmpresaDirectorio/src/modelo/Empresa.java
e7e1527d50f8b6982cccaccbc1c8479daf27c8ec
[]
no_license
LeandroReto/POO
3d8d97607b71414614d28d41ec8ba40137353609
5b8e613cbbcbabddec5f987a27674c0343c92efb
refs/heads/main
2023-05-13T00:24:40.313023
2021-06-07T13:10:30
2021-06-07T13:10:30
371,044,248
0
0
null
null
null
null
UTF-8
Java
false
false
2,077
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package modelo; import java.util.ArrayList; import java.util.List; /** * * @author jaslyn */ public class Empresa { private long id; private String nombre; private List<Cliente> listadoCliente; private List<Empleado> listadoEmpleado; private List<Directivo> listaDirectivo; public Empresa(long id, String nombre) { this.id = id; this.nombre = nombre; this.listadoCliente=new ArrayList(); this.listadoEmpleado=new ArrayList(); this.listaDirectivo=new ArrayList(); } public Empresa(long id, String nombre, List<Cliente> listadoCliente, List<Empleado> listadoEmpleado,List<Directivo> listaDirectivo) { this.id = id; this.nombre = nombre; this.listadoCliente = listadoCliente; this.listadoEmpleado = listadoEmpleado; this.listaDirectivo=listaDirectivo; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public List<Cliente> getListadoCliente() { return listadoCliente; } public void setListadoCliente(List<Cliente> listadoCliente) { this.listadoCliente = listadoCliente; } public List<Empleado> getListadoEmpleado() { return listadoEmpleado; } public void setListadoEmpleado(List<Empleado> listadoEmpleado) { this.listadoEmpleado = listadoEmpleado; } public List<Directivo> getListaDirectivo() { return listaDirectivo; } public void setListaDirectivo(List<Directivo> listaDirectivo) { this.listaDirectivo = listaDirectivo; } @Override public String toString() { return "Empresa{" + "id=" + id + ", nombre=" + nombre + '}'; } }
[ "jaslyn@Air-von-Jaslyn.customer.leucom.ch" ]
jaslyn@Air-von-Jaslyn.customer.leucom.ch
f1cce67e479c1607a13859d578e3692a4046d521
12fa8a6c8ca6b9ca60645418328be68c0544bfb7
/app/src/main/java/com/kmd/myapp2/model/AppDatabase.java
a558dfd3909c43f15b4747ec98cc3b1d17babdce
[]
no_license
kaythararama/MyApp2
504dee0b2d360aa61b9ad003f464b17f18897fea
a814c74a224f174a0543947fec818f92a3ff4ff0
refs/heads/master
2022-12-22T02:37:44.088616
2020-09-25T14:11:26
2020-09-25T14:11:26
298,458,601
0
0
null
null
null
null
UTF-8
Java
false
false
250
java
package com.kmd.myapp2.model; import androidx.room.Database; import androidx.room.RoomDatabase; @Database(entities = {MyTest.class}, version = 1) public abstract class AppDatabase extends RoomDatabase { public abstract MyTestDao myTestDao(); }
[ "kaythararama@gmail.com" ]
kaythararama@gmail.com
014e299c139ce32d60841832778bf5792a7a2991
3612d462e7692bf43035b342df6f13ba81023ca3
/src/main/java/com/edu/school/courses/service/group/GroupService.java
72750f73fbc10dfe9bae7be20bee784827aea98b
[]
no_license
NxtGenSchool/course-service
86c2af19bc9232362d7277701879decabfd60a9c
bebe75016c611428af967065848bec739eca5dd0
refs/heads/master
2021-07-13T13:09:32.456982
2019-11-16T18:23:25
2019-11-16T18:23:25
221,737,374
0
0
null
2019-11-27T21:59:21
2019-11-14T16:10:08
Java
UTF-8
Java
false
false
784
java
package com.edu.school.courses.service.group; import com.edu.school.courses.Repository.group.GroupRepository; import com.edu.school.courses.model.group.Group; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class GroupService { private GroupRepository groupRepository; @Autowired public GroupService(GroupRepository groupRepository) { this.groupRepository = groupRepository; } public Group createGroup() { return groupRepository.save(new Group()); } public Group getGroup(Long groupId) { return groupRepository.getOne(groupId); } public List<Group> getAllGroup() { return groupRepository.findAll(); } }
[ "shubham.suresh.singh@gmail.com" ]
shubham.suresh.singh@gmail.com
5c082187b87851c4231fac019a4c4820ca8800fa
58f5d8b77a20132078283e74fd06be0c75458a69
/jxen-tables-api/src/main/java/com/github/jxen/tables/api/TableConfig.java
f891622dd5593fd225cd804edacfa6835f833950
[ "Apache-2.0" ]
permissive
jxen/jxen-tables
227a242045628e8f8f0005597c084de55eaed7b0
fbf2d22e143f219dca7aa4fb4a735ca9620f3116
refs/heads/master
2022-12-25T17:15:36.274361
2020-01-08T16:47:45
2020-01-08T16:47:45
227,428,368
0
0
Apache-2.0
2022-12-14T20:43:20
2019-12-11T17:59:32
Java
UTF-8
Java
false
false
1,328
java
package com.github.jxen.tables.api; /** * {@code TableConfig} class is used for mapping between Java Bean properties and columns of table. * * @author Denis Murashev * * @param <T> Java Bean type * @param <U> Table header type * * @since Tables 0.1 */ public class TableConfig<T, U> { private final Mapping<T> data; private final Mapping<U> header; private final int index; /** * @param data table data mapping * @param header table header mapping * @param index table index */ public TableConfig(Mapping<T> data, Mapping<U> header, int index) { this.data = data; this.header = header; this.index = index; } /** * @param data table data mapping * @param header table header mapping */ public TableConfig(Mapping<T> data, Mapping<U> header) { this(data, header, 0); } /** * @param data table data mapping * @param index table index */ public TableConfig(Mapping<T> data, int index) { this(data, null, index); } /** * @param data table data mapping */ public TableConfig(Mapping<T> data) { this(data, null); } /** * @return the data */ public Mapping<T> getData() { return data; } /** * @return the header */ public Mapping<U> getHeader() { return header; } /** * @return the index */ public int getIndex() { return index; } }
[ "murashev@mail.ru" ]
murashev@mail.ru
4f26d5c2f1d43bec9c78edb89188c13968a7aac3
366c7d0a87f622c5f8cfa67f42f41de018f5e15d
/src/main/java/test/nv/printserv/model/JobRequestList.java
de3353015081685ef47ebce67be93a33ac0227c7
[]
no_license
nullptr0x000000/printserv
66165c8e9d0be77dc0d56eb6b0f978fcfc0df3fd
0f8df408f4e34709829225c96df61498cc75832e
refs/heads/master
2020-05-03T10:21:27.245384
2019-04-03T09:02:27
2019-04-03T09:02:27
178,577,267
0
0
null
null
null
null
UTF-8
Java
false
false
1,515
java
package test.nv.printserv.model; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @XmlRootElement(name = "jobs") @XmlAccessorType(XmlAccessType.NONE) public class JobRequestList { @XmlElement(name = "job") public ArrayList<JobRequest> jobRequestList = new ArrayList<>(); public ArrayList<JobRequest> getJobRequestList() { return jobRequestList; } public List<Map<String,Integer>> countAmountForEachUser() { List<Map<String,Integer>> answerMapList = new ArrayList<>(); for(JobRequest jobRequest : getJobRequestList()) { boolean userExists = false; int count = 0; for (Map answerMap : answerMapList) if (answerMap.containsKey(jobRequest.getUser())) { userExists = true; break; } if (userExists) continue; for(JobRequest job : getJobRequestList()) if (jobRequest.getUser().equals(job.getUser())) count += job.getAmount(); final int amount = count; answerMapList.add(new HashMap<String, Integer>(){{put(jobRequest.getUser(), amount);}}); } return answerMapList; } }
[ "lugidas@mail.ru" ]
lugidas@mail.ru
14e6bd9173778fb0caaa541e4d1aec51c0a0bed5
ca2ecc4e1cb4695055de555f2ad4dc377209d377
/src/main/java/com/baizhi/service/BannerService.java
f80cbff2d9c8735ffcbf004270afe5fd2a767c3d
[]
no_license
a1853616/cmfz_yl
b16f975b2f709473e1c9b7c419db39370845e2c1
5c78aabc5d366598c1cb58ba381f1fbf7965193f
refs/heads/master
2022-06-26T23:11:27.565909
2019-11-08T03:52:42
2019-11-08T03:52:42
220,125,906
0
0
null
2019-11-07T01:43:00
2019-11-07T01:36:00
JavaScript
UTF-8
Java
false
false
464
java
package com.baizhi.service; import com.baizhi.entity.Banner; import org.apache.ibatis.session.RowBounds; import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Map; public interface BannerService { //查所有 Map<String,Object>findAll(Integer page,Integer rows ); //添加 String add(Banner banner); //修改 void edit(Banner banner); //删除 void del(String id, HttpServletRequest request); }
[ "a1353373@163.com" ]
a1353373@163.com
2b2fb5341f0b2ee5a735c61156b24604eaff7ee0
037f760934326b86a0ab42350122d36d8343a9fa
/src/main/java/com/xm/service/apiimpl/pc/fmcs/wwt/dto/WwtbDataRetDTO.java
1238027058160fb89917adef6e2f08bd339b8983
[]
no_license
keriths/xiongmao
a8d3d99c6beda97c1443fe70edfff791a4d35246
04c617b6033f434f1c5bae7f9fcf493381d0bac6
refs/heads/master
2022-12-22T02:38:40.960123
2019-01-28T23:51:17
2019-01-28T23:51:17
107,290,226
0
0
null
2022-12-16T02:45:00
2017-10-17T15:45:33
HTML
UTF-8
Java
false
false
553
java
package com.xm.service.apiimpl.pc.fmcs.wwt.dto; import com.xm.platform.annotations.ApiResultFieldDesc; import com.xm.service.dto.BaseRetDTO; import java.util.List; /** * Created by wanghsuna on 2017/11/30. */ public class WwtbDataRetDTO extends BaseRetDTO{ @ApiResultFieldDesc(desc = "返回数据集合") private List<WwtbData> wwtbDataList; public List<WwtbData> getWwtbDataList() { return wwtbDataList; } public void setWwtbDataList(List<WwtbData> wwtbDataList) { this.wwtbDataList = wwtbDataList; } }
[ "1668940681@qq.com" ]
1668940681@qq.com
4a3b59201b96ec6b15c8f43e002d38394cfec617
f4bc3b86a49b19f46837d947f1c74438440c6bd7
/src/main/java/com/facebook/cucumber_project/framework/helper/Logger/LoggerHelper.java
080daf7c7314f3d044683969c74c07a3c371e5c6
[]
no_license
ChoudhuryIqbal/CucumberFrameWork
774ba7244fd3784ffadd157f803ac96b7bb9f2e0
3a3027aeab9434b9e1b1bb51306e2cb9932cff6b
refs/heads/master
2021-01-23T17:56:05.809608
2017-09-10T20:00:20
2017-09-10T20:00:20
102,782,287
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
package com.facebook.cucumber_project.framework.helper.Logger; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; @SuppressWarnings("rawtypes") public class LoggerHelper { private static boolean root = false; public static Logger getLogger(Class clas){ if (root) { return Logger.getLogger(clas); } PropertyConfigurator.configure(com.facebook.cucumber_project.framework.util.ResourceHelper.getResourcePath("/src/main/resources/configfile/log4j.properties")); root = true; return Logger.getLogger(clas); } }
[ "iqbalchoudhury2@gmail.com" ]
iqbalchoudhury2@gmail.com
c1faca3da1af6cd8841cec78a2cff3a455c9f2ab
1eee9c3c9dd15c143a3d0fed9e2bc8c38ea740a6
/src/Manager/BookingSystemManager.java
a220d7b1a6669fcf0c2a7c99bde370281225c5af
[]
no_license
GitAirline/GitAirline
b6f6c44f2c74119b8e4b806a34401dda7d841e32
6544723780859008d3f3e39e45b92e37c1e6e3fe
refs/heads/master
2021-01-20T19:26:17.826818
2016-07-15T08:02:37
2016-07-15T08:02:37
63,048,547
0
1
null
2016-07-14T12:03:12
2016-07-11T07:59:01
null
UTF-8
Java
false
false
3,816
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Manager; import Data.AeroplaneInterface; import Data.Aeroplane; import Data.FoodItem; import Data.Menus; import Data.Person; import Data.Seat; import Data.SeatInterface; import Data.SeatStatus; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; /** * * @author User */ public class BookingSystemManager implements ManagerInterface { BookingSystem bookingSystem = new BookingSystem(); @Override public ArrayList<String> getReadyFlights() { List<? extends AeroplaneInterface> list = bookingSystem.getFlights(); ArrayList<String> readyFlights = new ArrayList<>(); for(AeroplaneInterface ai : list) { if(ai.isReady()) { readyFlights.add(ai.getFlightNo()); } } return readyFlights; } @Override public boolean removeAeroplane(String flightNo) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void addAeroplane() { bookingSystem.addAeroplane(); } @Override public void addAeroplane(Menus menu) { bookingSystem.addAeroplane(menu); } @Override public ArrayList<Seat> getFirstClassSeats(String flightNo){ //public List<? extends SeatInterface> getFirstClassSeats(String flightNo) { ArrayList<Aeroplane> list = bookingSystem.getFlights(); for(Aeroplane ai : list) { if(ai.getFlightNo().equals(flightNo)) { return ai.getFirstClassSeats(); } } // should throw exception return null; } @Override public ArrayList<Seat> getEconomyClassSeats(String flightNo) { //public List<? extends SeatInterface> getEconomySeats(String flightNo) { ArrayList<Aeroplane> list = bookingSystem.getFlights(); //List<? extends AeroplaneInterface> list = bookingSystem.getFlights(); for (Aeroplane ai : list) { if (ai.getFlightNo().equals(flightNo)) { return ai.getEconomySeats(); } } // should throw exception return null; } @Override public boolean reserveFlight(String flightNo, String seatNo, Person person, ArrayList<FoodItem> food) { return bookingSystem.reserveFlight(flightNo, seatNo, person, food); } public LinkedHashMap<String, Double> readProfitLog() throws IOException { LinkedHashMap<String,Double> mymap= new LinkedHashMap<>(); String entity; double profit; try { BufferedReader readFile = new BufferedReader(new FileReader("C:\\Users\\Win10 Sucks\\Documents\\GA-Profit-Logger.txt")); StringBuilder sb = new StringBuilder(); String output=readFile.readLine(); while (output!= null){ int i=output.indexOf(" "); profit=Double.parseDouble(output.substring(0,i)); entity=output.substring(i+1,output.length()); mymap.put(entity, profit); output=readFile.readLine(); } } catch (FileNotFoundException ex) {} catch (IOException ex) { } return mymap; } }
[ "User@BFZ7J32" ]
User@BFZ7J32
7bbfba4dbb49d8357aec222977a02c338ae9c167
ed2d7df948b3dd425c024c246be0b84d3e7f0c5f
/src/com/zack/basic/GarbageCollection.java
ab52660f6838765c2863603cf3e755cde65c4e91
[]
no_license
zhoukang0107/JavaBasic
3d6f20e5eebeacbe4101940a8114937258b55ce6
ba4638525e5de81d035d1f46e137d0f19660f024
refs/heads/master
2021-01-20T12:49:14.314587
2018-03-16T10:31:05
2018-03-16T10:31:05
101,724,478
0
0
null
2017-11-22T08:04:59
2017-08-29T05:59:39
Java
UTF-8
Java
false
false
304
java
package com.zack.basic; /** * 获取当前虚拟机使用哪种垃圾收集策略 * java -XX:+PrintCommandLineFlags -version * windows: java -XX:+PrintFlagsFinal -version |FINDSTR /i ":" * Linux:java -XX:+PrintFlagsFinal -version | grep : * * * * * * * */ public class GarbageCollection { }
[ "zhoukang@baofeng.com" ]
zhoukang@baofeng.com
dc7edcc410f8615001ee19f34aaf1d54cc02ddca
f87809f4a3c8c731319e7c999cc090a0eaaae32c
/springcoreassignment/src/main/java/com/covalense/springcoreassignment/bean/Hp.java
bcc2a94ecd87d22f08087fe9a5fdfd4444d468dd
[]
no_license
ssaha7866/ELF-06Jun19-Covalense-SusmitaS
6d237efbf4d3a5c7de9b69b5f279bf479ffbd177
ac7bff6f352bafb7d833fcb09ddeb940a03acd92
refs/heads/master
2022-12-22T10:35:04.260832
2019-08-24T12:04:37
2019-08-24T12:04:37
192,526,659
0
0
null
null
null
null
UTF-8
Java
false
false
729
java
package com.covalense.springcoreassignment.bean; import org.springframework.beans.factory.annotation.Autowired; import com.covalense.springcoreassignment.interfaces.Laptop; import com.covalense.springcoreassignment.interfaces.StorageDevice; import lombok.Data; import lombok.extern.java.Log; @Data @Log public class Hp implements Laptop { String brand; String color; double cost; double weight; int ram; String os; @Autowired StorageDevice device; public void display() { } public void process() { } public void showSpecification() { log.info("" + getBrand()); log.info("" + getColor()); log.info("" + getCost()); log.info("" + getRam()); log.info("" + getWeight()); log.info("" + getOs()); } }
[ "ssaha7866@gmail.com" ]
ssaha7866@gmail.com
a6dd47640ff50625b33ba85a9e7725a52d8dc686
257bd63361aa846ffdacdc15edaecf84c6364e78
/wsou/myshop/src/my/shop/product/ProductBean.java
637be12282aaf89728ee199efd97600207166ed6
[]
no_license
gom4851/hcjeon
86dcfd05ce47a13d066f13fe187d6a63142fb9fe
59a00ca9499f30e50127bb16eb510553e88ace43
refs/heads/master
2020-06-04T23:16:08.632278
2019-01-15T09:54:08
2019-01-15T09:54:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
904
java
package my.shop.product; public class ProductBean { private int no; private String name, price, detail, sdate, stock, image; public int getNo() { return no; } public void setNo(int no) { this.no = no; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getDetail() { return detail; } public void setDetail(String detail) { this.detail = detail; } public String getSdate() { return sdate; } public void setSdate(String sdate) { this.sdate = sdate; } public String getStock() { return stock; } public void setStock(String stock) { this.stock = stock; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } }
[ "wer104@naver.com" ]
wer104@naver.com
13aeccee0d1dcd990ce1d507feeb4ecd0a17280f
1e4788f838d7a703f6f15f80e230b08d889682e6
/dist/game/data/scripts/quests/Q087_SagaOfEvasSaint/Q087_SagaOfEvasSaint.java
724559690ff91f28011e1adef4b2e57343978d11
[]
no_license
pr1vetdruk/l2jspace-c6-interlude
fbc5f0bea9fcf38c92172df15bde16ebb667fcdd
e0f701d4d87642887a3173a181de2037517f606d
refs/heads/master
2023-07-14T13:32:16.250915
2021-08-30T08:31:55
2021-08-30T08:31:55
340,645,976
0
0
null
null
null
null
UTF-8
Java
false
false
4,265
java
/* * This file is part of the L2jSpace 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 quests.Q087_SagaOfEvasSaint; import quests.SagasSuperClass; /** * @author Emperorc */ public class Q087_SagaOfEvasSaint extends SagasSuperClass { public Q087_SagaOfEvasSaint() { super(87, "Saga of Eva's Saint"); _npc = new int[] { 30191, 31626, 31588, 31280, 31620, 31646, 31649, 31653, 31654, 31655, 31657, 31280 }; _items = new int[] { 7080, 7524, 7081, 7502, 7285, 7316, 7347, 7378, 7409, 7440, 7088, 0 }; _mob = new int[] { 27266, 27236, 27276 }; _classId = new int[] { 105 }; _prevClass = new int[] { 0x1e }; _x = new int[] { 164650, 46087, 46066 }; _y = new int[] { -74121, -36372, -36396 }; _z = new int[] { -2871, -1685, -1685 }; _text = new String[] { "PLAYERNAME! Pursued to here! However, I jumped out of the Banshouren boundaries! You look at the giant as the sign of power!", "... Oh ... good! So it was ... let's begin!", "I do not have the patience ..! I have been a giant force ...! Cough chatter ah ah ah!", "Paying homage to those who disrupt the orderly will be PLAYERNAME's death!", "Now, my soul freed from the shackles of the millennium, Halixia, to the back side I come ...", "Why do you interfere others' battles?", "This is a waste of time.. Say goodbye...!", "...That is the enemy", "...Goodness! PLAYERNAME you are still looking?", "PLAYERNAME ... Not just to whom the victory. Only personnel involved in the fighting are eligible to share in the victory.", "Your sword is not an ornament. Don't you think, PLAYERNAME?", "Goodness! I no longer sense a battle there now.", "let...", "Only engaged in the battle to bar their choice. Perhaps you should regret.", "The human nation was foolish to try and fight a giant's strength.", "Must...Retreat... Too...Strong.", "PLAYERNAME. Defeat...by...retaining...and...Mo...Hacker", "....! Fight...Defeat...It...Fight...Defeat...It..." }; registerNPCs(); } }
[ "somsin@bryansk.softlab.ru" ]
somsin@bryansk.softlab.ru
3e84f88fd60a2dfa42060a3593e547037921fbd0
ea668373c844642f99571a90113af0f552f1901a
/src/Tugas.java
a402732707c2f8ef7f0de9cc5e61f752aa8a5c45
[]
no_license
pritanrf/tugas-bab3-constructor
cc3fc8934b889d188e0d72fee0fc6cae31f8e378
983ae42eea75c0e3f14955be27afd315e1100068
refs/heads/master
2020-12-06T20:35:55.594457
2016-03-19T16:14:39
2016-03-19T16:14:39
54,271,283
0
0
null
2016-03-19T14:55:21
2016-03-19T14:55:21
null
UTF-8
Java
false
false
9,991
java
package overloading; public class Tugas { private int nik [] = {101, 102, 103, 104, 105, 106, 107, 108, 109, 110}; private String nama[] = {"Paijo", "Lala", "Lulu", "Sabar", "Sule", "Paiman", "Ponimin", "Sutiman", "Raja", "Harry"}; private int gajiPokok [] = {2000, 1750, 2150, 1500, 2500, 1500, 2000, 1500, 1000, 2250}; private int tunjangan [] = {1000, 900, 1000, 750, 850, 350, 1000, 1250, 1000, 1000}; private int bonus [] = {500, 500, 300, 600, 500, 450, 500, 500, 500, 200}; private int denda [] = {200, 200, 375, 200,300, 250, 200, 300, 200, 200}; public void get(){ System.out.println("---------------------------------------------"); System.out.println(" DATA KARYAWAN"); System.out.println("============================================="); System.out.printf("%s%10s%15s%15s%10s%10s\n","NIK", "Nama", "Gaji Pokok", "Tunjangan", "Bonus", "Denda"); for (int i=0; i<nik.length; i++){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } System.out.println(""); System.out.println(""); System.out.println(""); } public void get (int id){ System.out.println("---------------------------------------------"); System.out.println(" DATA KARYAWAN BERDASARKAN ID"); System.out.println("=============================================="); System.out.printf("%s%10s%15s%15s%10s%10s\n","NIK", "Nama", "Gaji Pokok", "Tunjangan", "Bonus", "Denda"); for (int i=0; i<nik.length; i++){ if (nik[i]==id){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } System.out.println(""); System.out.println(""); System.out.println(""); } public void get(String columnName, int value){ System.out.println("---------------------------------------------"); System.out.println(" DATA KARYAWAN BERDASARKAN "+columnName+" "+value); System.out.println("=============================================="); if (columnName.equalsIgnoreCase("gaji pokok")){ for (int i=0; i<nik.length; i++){ if (gajiPokok[i]==value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("tunjangan")){ for (int i=0; i<nik.length; i++){ if (tunjangan[i]==value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("bonus")){ for (int i=0; i<nik.length; i++){ if (bonus[i]==value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("denda")){ for (int i=0; i<nik.length; i++){ if (denda[i]==value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } System.out.println(""); System.out.println(""); System.out.println(""); } public void get(String columnName, String oper, int value){ System.out.println("-----------------------------------------------"); System.out.println(" DATA KARYAWAN BERDASARKAN "+columnName+" "+oper+" "+value); System.out.println("==============================================="); System.out.printf("%s%10s%15s%15s%10s%10s\n","NIK", "Nama", "Gaji Pokok", "Tunjangan", "Bonus", "Denda"); switch (oper){ case "<=": if (columnName.equalsIgnoreCase("gaji pokok")){ for (int i=0; i<nik.length; i++){ if (gajiPokok[i]<=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("tunjangan")){ for (int i=0; i<nik.length; i++){ if (tunjangan[i]<=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("bonus")){ for (int i=0; i<nik.length; i++){ if (bonus[i]<=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("denda")){ for (int i=0; i<nik.length; i++){ if (denda[i]<=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } }break; case ">=": if (columnName.equalsIgnoreCase("gaji pokok")){ for (int i=0; i<nik.length; i++){ if (gajiPokok[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("tunjangan")){ for (int i=0; i<nik.length; i++){ if (tunjangan[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("bonus")){ for (int i=0; i<nik.length; i++){ if (bonus[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("denda")){ for (int i=0; i<nik.length; i++){ if (denda[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } }break; case "<": if (columnName.equalsIgnoreCase("gaji pokok")){ for (int i=0; i<nik.length; i++){ if (gajiPokok[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("tunjangan")){ for (int i=0; i<nik.length; i++){ if (tunjangan[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("bonus")){ for (int i=0; i<nik.length; i++){ if (bonus[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("denda")){ for (int i=0; i<nik.length; i++){ if (denda[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } }break; case ">": if (columnName.equalsIgnoreCase("gaji pokok")){ for (int i=0; i<nik.length; i++){ if (gajiPokok[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("tunjangan")){ for (int i=0; i<nik.length; i++){ if (tunjangan[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("bonus")){ for (int i=0; i<nik.length; i++){ if (bonus[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } } else if (columnName.equalsIgnoreCase("denda")){ for (int i=0; i<nik.length; i++){ if (denda[i]>=value){ System.out.printf("%d%10s%15d%15d%10d%10d\n",nik[i],nama[i],gajiPokok[i],tunjangan[i],bonus[i],denda[i]); } } }break; } System.out.println(""); System.out.println(""); System.out.println(""); } }
[ "pritafaridiani@yahoo.co.id" ]
pritafaridiani@yahoo.co.id
c16953035b87ef465284fb5906f67443d2c86e36
0e48fdfc3efb12e59c3b2aecf3d97f72d6a4714f
/app/src/main/java/com/example/aml/quizexample/DroidTermsExampleContract.java
e7322ed2633d54eac41196ecd2b662cc2a9014e0
[]
no_license
Amlsakr/QuizExample
653d348a7022aa3c9d89b769a44e0c641e0397b6
d6a688382fc7443819a80230863125f216256f5a
refs/heads/master
2020-03-10T04:46:36.900612
2018-04-12T06:02:14
2018-04-12T06:02:14
129,201,049
0
0
null
null
null
null
UTF-8
Java
false
false
1,449
java
package com.example.aml.quizexample; import android.content.ContentResolver; import android.content.ContentUris; import android.net.Uri; import android.provider.BaseColumns; /** * Created by aml on 11/04/18. */ public class DroidTermsExampleContract implements BaseColumns { public static final String CONTENT_AUTHORITY = "com.example.udacity.droidtermsexample"; public static final Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY); public static final String PATH_TERMS = "terms" ; public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(PATH_TERMS).build(); public static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE + "/" + CONTENT_AUTHORITY +"/" +PATH_TERMS ; public static final int DATBASE_VERSION = 1 ; public static final String DATBASE_TABLE = "term_entries"; public static final String DATABASE_NAME = "terms"; public static final String COLUMN_WORD = "word"; public static final String COLUMN_DEFINITION = "definition"; public static final String[] COLUMNS = {_ID , COLUMN_WORD , COLUMN_DEFINITION}; public static final int COLUMN_INDEX_ID = 0 ; public static final int COLUMN_INDEX_WORD = 1 ; public static final int COLUMN_INDEX_DEFINITION = 2 ; public static Uri buildTermUriWithId (long id) { return ContentUris.withAppendedId(CONTENT_URI , id) ; } }
[ "amlsakr9@gmail.com" ]
amlsakr9@gmail.com
2ab1a724478f459f91de9f968c392f9548964051
5e4ecb92f1fc30924fb75cb4010b901465245e58
/Hibernate/T7/03梁凯杰/上机作业/HBT07/src/com/qhit/lh/g4/lkj/t7/dao/impl/DaseDaoImpl.java
4d4e753c516b91014fd6b27e7dc2a4311b524ed8
[]
no_license
1787418735/163G4G
413ad4d3119370126a8648473c481683f07c4b27
232867ec5da12ab439a7e060e7e084d9cb4d070a
refs/heads/master
2021-09-09T14:26:39.388603
2018-03-17T02:12:37
2018-03-17T02:12:37
111,653,946
0
0
null
2017-11-22T08:01:44
2017-11-22T08:01:44
null
UTF-8
Java
false
false
3,481
java
/** * */ package com.qhit.lh.g4.lkj.t7.dao.impl; import java.io.Serializable; import java.util.List; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.Query; import com.qhit.lh.g4.lkj.t7.bean.Dept; import com.qhit.lh.g4.lkj.t7.bean.Emp; import com.qhit.lh.g4.lkj.t7.dao.DaseDao; import com.qhit.lh.g4.lkj.t7.util.HibernateSessionFactory; /** * @author 梁凯杰 *TODO *2017年12月20日下午4:42:46 */ public class DaseDaoImpl implements DaseDao { @Override public void add(Object obj) { // TODO Auto-generated method stub //获取session对象 Session session = HibernateSessionFactory.getSession(); //开启 Hibernate事务 Transaction tx = session.beginTransaction(); //操作对象 session.save(obj); //提交事务 tx.commit(); //关闭session HibernateSessionFactory.closeSession(); } @Override public void update(Object obj) { // TODO Auto-generated method stub //获取session对象 Session session = HibernateSessionFactory.getSession(); //开启 Hibernate事务 Transaction tx = session.beginTransaction(); //操作对象 obj = session.get(obj.getClass(), session); session.save(obj); //提交事务 tx.commit(); //关闭session HibernateSessionFactory.closeSession(); } @Override public void delete(Object obj) { // TODO Auto-generated method stub //获取session对象 Session session = HibernateSessionFactory.getSession(); //开启 Hibernate事务 Transaction tx = session.beginTransaction(); //操作对象 session.save(obj); //提交事务 tx.commit(); //关闭session HibernateSessionFactory.closeSession(); } @Override public List<Object> query(String fromStr) { // TODO Auto-generated method stub //获取session对象 Session session = HibernateSessionFactory.getSession(); //开启 Hibernate事务 Transaction tx = session.beginTransaction(); Query query = session.createQuery(fromStr); //查询 List<Object> list = query.list(); //提交事务 tx.commit(); //关闭session HibernateSessionFactory.closeSession(); return null; } /* (non-Javadoc) * @see com.qhit.lh.g4.lkj.t7.dao.DaseDao#getObjectById(java.lang.Class, java.io.Serializable) */ @Override public Object getObjectById(Class clazz, Serializable id) { // TODO Auto-generated method stub // TODO Auto-generated method stub //获取session对象 Session session = HibernateSessionFactory.getSession(); //开启 Hibernate事务 Transaction tx = session.beginTransaction(); //操作对象 Object obj = session.get(clazz,id); //提交事务 tx.commit(); //关闭session HibernateSessionFactory.closeSession(); return obj; } /* (non-Javadoc) * @see com.qhit.lh.g4.lkj.t7.dao.DaseDao#GetEmpByName(java.lang.String) */ @Override public List<Emp> getEmpByName(String name) { // TODO Auto-generated method stub Session session = HibernateSessionFactory.getSession(); String hql = "select e form Emp e where e.ename like : name"; Query query = session.createQuery(hql); query.setString("name", name); return query.list(); } /* (non-Javadoc) * @see com.qhit.lh.g4.lkj.t7.dao.DaseDao#getObjects(java.lang.Object) */ @Override public List<Dept> getObjects(Object object) { // TODO Auto-generated method stub return null; } }
[ "1441224146@qq.com" ]
1441224146@qq.com
94ed3d77b47479d6cde4849ed8436e8e252cf19b
11288d796bc9128e754afbe53c8ef01495e6440a
/java/controller/exceptions/NotEnoughResourcesException.java
0cbae79012a065f2b12495f6fb839186470a4372
[]
no_license
flaviodipalo/MagnifiJ
4ae4f541d128ac7db741904fdc52d066cd71aa91
57679d177300d466b4d577e677355bca12a5de08
refs/heads/master
2020-09-04T05:00:47.088196
2019-11-05T05:27:48
2019-11-05T05:27:48
219,660,693
0
0
null
null
null
null
UTF-8
Java
false
false
296
java
package controller.exceptions; /** * This exception is thrown if there are not enough resources to made the action */ public class NotEnoughResourcesException extends Exception { public NotEnoughResourcesException(){ super("you have not enough resources for this action"); } }
[ "flavio.dipalo@gmail.com" ]
flavio.dipalo@gmail.com
4e6ad45dd90e52a636d8a3f997a6bbf50045369e
4fdf8ef10d615aae63b08752c5575c3ca8533cc6
/src/main/java/com/he/attend/common/JsonResult.java
ecbe0bd4b705edff2c5e05231a1071dc8d3c7656
[]
no_license
Ahhhnnn/attend
d583d17adb56ee49d07f0bf6d182df024ce7c908
c01141bbf3e02a8d6a171b23f2c16181a70e16c2
refs/heads/master
2022-07-08T11:10:35.946773
2020-04-06T09:48:23
2020-04-06T09:48:23
166,176,234
0
1
null
2022-06-17T02:51:49
2019-01-17T06:56:13
JavaScript
UTF-8
Java
false
false
1,632
java
package com.he.attend.common; import java.util.HashMap; /** * 返回结果对象 * * @author wangfan * @date 2017-6-10 上午10:10:07 */ public class JsonResult extends HashMap<String, Object> { private static final long serialVersionUID = 1L; private JsonResult() { } /** * 返回成功 */ public static JsonResult ok() { return ok("操作成功"); } /** * 返回成功 */ public static JsonResult ok(String message) { return ok(200, message); } /** * 返回成功 */ public static JsonResult ok(int code, String message) { JsonResult jsonResult = new JsonResult(); jsonResult.put("code", code); jsonResult.put("msg", message); return jsonResult; } /** * 返回失败 */ public static JsonResult error() { return error("操作失败"); } /** * 返回失败 */ public static JsonResult error(String messag) { return error(500, messag); } /** * 返回失败 */ public static JsonResult error(int code, String message) { return ok(code, message); } /** * 设置code */ public JsonResult setCode(int code) { super.put("code", code); return this; } /** * 设置message */ public JsonResult setMessage(String message) { super.put("msg", message); return this; } /** * 放入object */ @Override public JsonResult put(String key, Object object) { super.put(key, object); return this; } }
[ "36215241+Ahhhnnn@users.noreply.github.com" ]
36215241+Ahhhnnn@users.noreply.github.com
00e7b78bc63a2f07eccdb84852eee0af7b811d35
a21ad1ed2e2e2214b1e0af75fd4a3e28b2217baf
/src/main/java/com/bohdan/app/web/rest/errors/InvalidPasswordException.java
0ca1d6e886b18e844b0415b8c77cee20b94be0a1
[]
no_license
Bohdankm22/hackathonProject
04f407b95b99af0deb6a02424fd8ba0b820b8cbf
317a5788317d0d064a93344d37b38f7c2ab82dbe
refs/heads/master
2021-04-18T18:32:28.588684
2018-03-24T13:04:23
2018-03-24T13:04:23
126,599,900
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
package com.bohdan.app.web.rest.errors; import org.zalando.problem.AbstractThrowableProblem; import org.zalando.problem.Status; public class InvalidPasswordException extends AbstractThrowableProblem { public InvalidPasswordException() { super(ErrorConstants.INVALID_PASSWORD_TYPE, "Incorrect password", Status.BAD_REQUEST); } }
[ "bohdansharipov@gmail.com" ]
bohdansharipov@gmail.com
8de0b65a5e0551434411008f65cebb508b1ca1d8
b4c7f8f673913201e1267d2fbd2fb144b1ba87fb
/clinica/src/main/java/mz/ciuem/uclinica/service/impl/parametro/EstudanteServiceImpl.java
0d6de14435c071b283386ad15a1da2ed78b56498
[]
no_license
miguelmanjate/uClinica
401201884edf11e481b399b74f02b461a3d6c2f4
2104a60285f7038b13e2101fd3c434e923706813
refs/heads/master
2020-03-15T12:32:53.144759
2018-09-01T13:19:59
2018-09-01T13:19:59
132,146,555
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
package mz.ciuem.uclinica.service.impl.parametro; import org.springframework.stereotype.Service; import mz.ciuem.uclinica.entity.parametro.Estudante; import mz.ciuem.uclinica.service.impl.GenericServiceImpl; import mz.ciuem.uclinica.service.parametro.EstudanteService; @Service("estudanteService") public class EstudanteServiceImpl extends GenericServiceImpl<Estudante> implements EstudanteService { }
[ "miguelmmanjate@gmail.com" ]
miguelmmanjate@gmail.com
3dcd9bd1ad0eb086203c0e8cbade59aa7ce3c160
ff9c7da162859f34430e5485b06fb5af17c54f60
/src/com/reqman/filter/AuthorizationFilter.java
2005680028411dc40e72e08bfbc2d9c84828bd02
[]
no_license
hemantraghav012/git-testing-123
2018b5a4d026906968c71a62ab119bdbcad8e300
a13709b3988749a76139091e20b812dd81a91fbd
refs/heads/master
2020-03-25T02:29:45.452377
2018-08-04T09:13:51
2018-08-04T09:13:51
143,292,283
0
4
null
2018-08-04T09:13:52
2018-08-02T12:33:58
Java
UTF-8
Java
false
false
1,990
java
package com.reqman.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @WebFilter(filterName = "AuthFilter", urlPatterns = { "*.xhtml" }) public class AuthorizationFilter implements Filter { public AuthorizationFilter() { } @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { HttpServletRequest reqt = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; HttpSession ses = reqt.getSession(false); String reqURI = reqt.getRequestURI(); if (reqURI.indexOf("/index.xhtml") >= 0 || (ses != null && ses.getAttribute("username") != null) || reqURI.indexOf("/public/") >= 0 || reqURI.contains("javax.faces.resource")) { chain.doFilter(request, response); } else if(reqURI.indexOf("/login.xhtml") >=0 || (ses != null && ses.getAttribute("username") != null) || reqURI.indexOf("/public/") >= 0 || reqURI.contains("javax.faces.resource")) { chain.doFilter(request, response); } else if(reqURI.indexOf("/register.xhtml") >=0 || (ses != null && ses.getAttribute("username") != null) || reqURI.indexOf("/public/") >= 0 || reqURI.contains("javax.faces.resource")) { chain.doFilter(request, response); } else { resp.sendRedirect(reqt.getContextPath() + "/faces/index.xhtml"); } } catch (Exception e) { System.out.println(e.getMessage()); } } @Override public void destroy() { } }
[ "kaizensystech@gmail.com" ]
kaizensystech@gmail.com
b19d144b9b4fbf08a3dd5d1b011a7811974eaa30
a5d01febfd8d45a61f815b6f5ed447e25fad4959
/Source Code/5.27.0/sources/com/iqoption/app/-$$Lambda$IQApp$2$wb4il6o036zHk_pttwwNAoKalGg.java
c850a6a49da25ad7152bbe694766d3a987f8b96e
[]
no_license
kkagill/Decompiler-IQ-Option
7fe5911f90ed2490687f5d216cb2940f07b57194
c2a9dbbe79a959aa1ab8bb7a89c735e8f9dbc5a6
refs/heads/master
2020-09-14T20:44:49.115289
2019-11-04T06:58:55
2019-11-04T06:58:55
223,236,327
1
0
null
2019-11-21T18:17:17
2019-11-21T18:17:16
null
UTF-8
Java
false
false
509
java
package com.iqoption.app; import com.google.common.base.n; import com.iqoption.app.IQApp.AnonymousClass2; /* compiled from: lambda */ public final /* synthetic */ class -$$Lambda$IQApp$2$wb4il6o036zHk_pttwwNAoKalGg implements n { private final /* synthetic */ AnonymousClass2 f$0; public /* synthetic */ -$$Lambda$IQApp$2$wb4il6o036zHk_pttwwNAoKalGg(AnonymousClass2 anonymousClass2) { this.f$0 = anonymousClass2; } public final Object get() { return this.f$0.EX(); } }
[ "yihsun1992@gmail.com" ]
yihsun1992@gmail.com
f0953158d2a4d499aebf78a6183ec9bd74f0d59e
c33aec869dac900a293716e9b13ec8acceb7d5a0
/supermarket/src/java/org/aly/hlx/dao/UserinfoDao.java
bc27265521580ac5d26359d2caeefecca7b29a40
[]
no_license
yuanhangs/mvnLesson
b85ff848e59e9494ed9d72a4d6e1a9feafa1575b
494cd6a39d38aa911220e50b59c43e19c38d3991
refs/heads/master
2023-01-22T15:10:39.529418
2020-12-03T07:44:16
2020-12-03T07:44:16
318,114,554
0
0
null
null
null
null
UTF-8
Java
false
false
528
java
package org.aly.hlx.dao; import org.aly.hlx.entity.UserInfo; import java.util.List; public interface UserinfoDao { //登录 UserInfo isLogin(UserInfo userInfo) throws Exception; //添加 int add(UserInfo userInfo)throws Exception; //删除 int del(String id) throws Exception; //修改 int update(UserInfo userInfo) throws Exception; //根据ID查询 UserInfo findById(String id)throws Exception; //查询所有(2) List<UserInfo> all(Object... param) throws Exception; }
[ "444012836@qq.com" ]
444012836@qq.com
45c2b32b6fcb6cc9106e3384269a1ce797679137
3fe383525b2dcd3f9a405c5105a4562983c7f7fa
/jenabean/jpa4jena/src/test/java/test/jpa/MusicGenre.java
b8f7ef7699957934e3d61fea31bdc1c1e7bf69e2
[ "Apache-2.0" ]
permissive
william-vw/mlod
7e013d999878a1fcd16e4add94e62626a16875a5
20d67f8790ef24527d2e0baff4b5dd053b5ab621
refs/heads/master
2023-07-25T12:35:00.658936
2022-03-02T16:03:55
2022-03-02T16:03:55
253,907,808
0
0
Apache-2.0
2023-07-23T11:15:08
2020-04-07T20:44:36
HTML
UTF-8
Java
false
false
242
java
package test.jpa; import java.net.URI; import javax.persistence.Entity; import javax.persistence.Id; import thewebsemantic.Namespace; @Entity @Namespace("http://example.org/") public class MusicGenre { @Id URI id; String description; }
[ "william.van.woensel@gmail.com" ]
william.van.woensel@gmail.com
8c6daae238545addb4b6d4bcd799dee2bf429e25
3b34e776db44880ad43eb27a9f1af40a1a925fc8
/app/src/main/java/com/example/dell/growup/main/characters/CharacterAdapter.java
8d72a5d176ef4e8509931ccc1ae9107873fc65fd
[]
no_license
youqibing/Grow-upPro
0e143ea04e64fa0a87bfa9713291d9e9a7221bec
60fac2f598bb5b431f3b48500c732b6efdce10fd
refs/heads/master
2021-01-23T17:03:45.335028
2019-02-25T07:30:58
2019-02-25T07:30:58
102,754,468
0
0
null
null
null
null
UTF-8
Java
false
false
5,255
java
package com.example.dell.growup.main.characters; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.example.dell.growup.R; import com.example.dell.growup.network.result.CharactersResult; import com.example.dell.growupbase.base.Adapter.BaseAdapter; import java.util.List; /** * Created by dell on 2017/10/10. */ public class CharacterAdapter extends BaseAdapter { private List<CharactersResult.CharacterList> characterLists; private List<CharactersResult.HeaderList> headerLists; private List<CharactersResult.BottomList> bottomLists; public CharacterAdapter(Context ctx) { super(ctx); characterLists = new CharacterData().getCharacter(); headerLists = new CharacterData().getHeaderList(); bottomLists = new CharacterData().getBottomList(); mHeaderCount = headerLists.size(); mBottomCount = bottomLists.size(); } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { super.onBindViewHolder(holder, position); if(holder instanceof HeaderViewHoder){ switch (headerLists.get(position).getImg()){ case "froest": ((HeaderViewHoder)holder).background_img.setImageResource(R.mipmap.froest_cut); break; } ((HeaderViewHoder)holder).title_tx.setText(headerLists.get(position).getText()); }else if(holder instanceof ContentViewHolder){ Log.e("test",(position - headerLists.size())+""); switch (characterLists.get(position - headerLists.size()).getImage()){ case "wuming": ((ContentViewHolder)holder).background_img.setImageResource(R.mipmap.wuming); break; case "alixiya": ((ContentViewHolder)holder).background_img.setImageResource(R.mipmap.alixiya); break; } ((ContentViewHolder)holder).description.setText( characterLists.get(position - headerLists.size()).getDescribe()); }else if(holder instanceof BottomViewHolder){ if(bottomLists.get(position - headerLists.size() -characterLists.size()).getImg().equals("")){ ((BottomViewHolder)holder).background_img.setVisibility(View.GONE); } ((BottomViewHolder)holder).title_tx.setText( bottomLists.get(position - headerLists.size() -characterLists.size()).getText()); } } @Override protected int getContentItemCount() { return characterLists.size(); } @Override protected RecyclerView.ViewHolder onCreateHeaderView(ViewGroup parent) { return new HeaderViewHoder(mLayoutImflater.inflate(R.layout.item_image, parent, false)); } @Override protected RecyclerView.ViewHolder onCreateContentView(ViewGroup parent) { return new ContentViewHolder(mLayoutImflater.inflate(R.layout.item_character, parent, false)); } @Override protected RecyclerView.ViewHolder onCreateBottomView(ViewGroup parent) { return new BottomViewHolder(mLayoutImflater.inflate(R.layout.item_image, parent, false)); } private static class HeaderViewHoder extends RecyclerView.ViewHolder implements View.OnClickListener{ ImageView background_img; TextView title_tx; public HeaderViewHoder(View itemView) { super(itemView); background_img = (ImageView)itemView.findViewById(R.id.image_view); title_tx = (TextView)itemView.findViewById(R.id.text_view); itemView.setOnClickListener(this); } @Override public void onClick(View v) { } } private static class ContentViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{ ImageView background_img; TextView title_tx; TextView description; ContentViewHolder(View itemView) { super(itemView); background_img = (ImageView)itemView.findViewById(R.id.iv_background); title_tx = (TextView)itemView.findViewById(R.id.tv_title); description = (TextView)itemView.findViewById(R.id.tv_description); itemView.setOnClickListener(this); } @Override public void onClick(View v) { } } private static class BottomViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{ ImageView background_img; TextView title_tx; BottomViewHolder(View itemView) { super(itemView); background_img = (ImageView)itemView.findViewById(R.id.image_view); title_tx = (TextView)itemView.findViewById(R.id.text_view); itemView.setOnClickListener(this); } @Override public void onClick(View v) { } } }
[ "ranger@bingyan.net" ]
ranger@bingyan.net
5dce13c5ecec13568769daf8ba15840c52632f4e
f0568343ecd32379a6a2d598bda93fa419847584
/modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201402/cm/EntityNotFound.java
6ef20ef7f917e5dc50607ff868386d76d94ada57
[ "Apache-2.0" ]
permissive
frankzwang/googleads-java-lib
bd098b7b61622bd50352ccca815c4de15c45a545
0cf942d2558754589a12b4d9daa5902d7499e43f
refs/heads/master
2021-01-20T23:20:53.380875
2014-07-02T19:14:30
2014-07-02T19:14:30
21,526,492
1
0
null
null
null
null
UTF-8
Java
false
false
1,658
java
package com.google.api.ads.adwords.jaxws.v201402.cm; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * * An id did not correspond to an entity, or it referred to an entity which does not belong to the * customer. * * * <p>Java class for EntityNotFound complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="EntityNotFound"> * &lt;complexContent> * &lt;extension base="{https://adwords.google.com/api/adwords/cm/v201402}ApiError"> * &lt;sequence> * &lt;element name="reason" type="{https://adwords.google.com/api/adwords/cm/v201402}EntityNotFound.Reason" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EntityNotFound", propOrder = { "reason" }) public class EntityNotFound extends ApiError { protected EntityNotFoundReason reason; /** * Gets the value of the reason property. * * @return * possible object is * {@link EntityNotFoundReason } * */ public EntityNotFoundReason getReason() { return reason; } /** * Sets the value of the reason property. * * @param value * allowed object is * {@link EntityNotFoundReason } * */ public void setReason(EntityNotFoundReason value) { this.reason = value; } }
[ "jradcliff@google.com" ]
jradcliff@google.com
d4f20846156bbb893a6f4eee91a08fac9bf15fc4
a33d042537789ef419cd0fb9c9282315f6d8390f
/src/main/java/com/bionic/edu/transfer/TransferMoney.java
15f004a8d6b3ec61d11af9796a0d65e6127a037f
[]
no_license
ffwATL/P211GetMerchant
7de134b322db4d35f113249fbc4363cdedfa54d7
ba4ccb32628ccad540a6435df032fe993e171e57
refs/heads/master
2021-01-10T11:27:44.734660
2016-09-16T11:04:47
2016-09-16T11:04:47
47,396,294
0
0
null
null
null
null
UTF-8
Java
false
false
1,141
java
package com.bionic.edu.transfer; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import java.sql.Timestamp; @Entity public class TransferMoney { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private int merchantId; private int payListId; private double sumSent; private Timestamp dt; public int getId() { return id; } public void setId(int id) { this.id = id; } public int getMerchantId() { return merchantId; } public void setMerchantId(int merchantId) { this.merchantId = merchantId; } public int getPayListId() { return payListId; } public void setPayListId(int payListId) { this.payListId = payListId; } public double getSumSent() { return sumSent; } public void setSumSent(double sumSent) { this.sumSent = sumSent; } public Timestamp getDt() { return dt; } public void setDt(Timestamp dt) { this.dt = dt; } }
[ "4else@i.ua" ]
4else@i.ua
ea9dd7e0b1283de5730ceeb7eb3a66873eca393a
99a700a1d256fb513882344e5ceed3b2a7c5a976
/spring-aop-1/src/main/java/com/study/spring/domain/User.java
51f7106a0817a4005bfae894d7eb1ee0857a34c8
[]
no_license
AppleLing/mygit
1665ef65110ac5c0521f10cff915917b65ee9b00
c8b9fd71097b8695b30b05cef9405323c6b8cea0
refs/heads/master
2022-12-19T20:58:45.767928
2019-07-18T06:54:08
2019-07-18T06:54:08
141,683,547
0
0
null
2022-12-16T03:35:15
2018-07-20T08:11:09
Java
UTF-8
Java
false
false
580
java
package com.study.spring.domain; import java.io.Serializable; public class User implements Serializable { private Integer id; private String name; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return "User{" + "id=" + id + ", name='" + name + '\'' + '}'; } }
[ "359010377@qq.com" ]
359010377@qq.com
41858a261fb3877ec3d1e7a6362f72c69ddcc356
004832e529873885f1559eb8c864384b3e1cda3f
/java/lineage2/gameserver/network/clientpackets/RequestCommissionBuyInfo.java
78d4e0979d4fa3cc57f5944ad97c3fc7f0a9c43f
[]
no_license
wks1222/mobius-source
02323e79316eabd4ce7e5b29f8cd5749c930d098
325a49fa23035f4d529e5a34b809b83c68d19cad
refs/heads/master
2021-01-10T02:22:17.746138
2015-01-17T20:08:13
2015-01-17T20:08:13
36,601,733
1
0
null
null
null
null
UTF-8
Java
false
false
1,427
java
/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package lineage2.gameserver.network.clientpackets; import lineage2.gameserver.instancemanager.commission.CommissionShopManager; import lineage2.gameserver.model.Player; /** * @author Mobius * @version $Revision: 1.0 $ */ public class RequestCommissionBuyInfo extends L2GameClientPacket { private long auctionId; private int exItemType; /** * Method readImpl. */ @Override protected void readImpl() { auctionId = readQ(); exItemType = readD(); } /** * Method runImpl. */ @Override protected void runImpl() { Player player = getClient().getActiveChar(); if (player == null) { return; } CommissionShopManager.getInstance().showCommissionBuyInfo(player, auctionId, exItemType); } }
[ "mobius@cyber-wizard.com" ]
mobius@cyber-wizard.com
6401b410cde259e17810805eca0fecbba8932f35
5920532e9a0377a779cb7525b394928e8504ce81
/practica5/Fecha.java
1438de21c31fbc95013231a97e874b0e7d4738b3
[]
no_license
kodemakerDor/Java_programming
d1cf2aa161e6c09d7e09eb7a594a8c8edf63cb66
c80a1a11a962ff9be5cf5cf24c07f90c19b1ec5e
refs/heads/master
2021-12-22T11:22:30.744139
2017-10-12T19:30:31
2017-10-12T19:30:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,707
java
package practica5; /* * Clase Fecha * Autor: Angeles Junco */ public class Fecha { private int mes; private int dia; private int anio; public Fecha(int dia, int mes, int anio) { if (mes <= 0 || mes >12) { this.mes = 1; this.dia = 1; } else { this.mes = mes; if (dia <= 0 || dia > diasDelMes(mes)) this.dia = 1; else this.dia = dia; } this.anio = anio; } public Fecha(Fecha f){ this.dia = f.dia; this.mes = f.mes; this.anio = f.anio; } public int getDia () { return this.dia; } public int getMes () { return this.mes; } public int getAnio () { return this.anio; } public void setDia(int dia) { if (dia >= 1 && dia <= diasDelMes(this.mes)) this.dia = dia; } public void setMes(int mes) { if (mes >= 1 && mes <= 12 && this.dia <= diasDelMes(mes)) this.mes = mes; } public void setAnio(int anio) { this.anio = anio; } @Override public String toString() { return this.dia + " / " + this.mes + " / " + this.anio; } public boolean esMenorQue(Fecha f) { if (this.anio > f.anio) return true; if (this.mes > f.mes && f.anio == this.anio) return true; if (this.dia > f.dia && this.mes == f.mes && f.anio == this.anio) return true; return false; } private int diasDelMes(int mes){ switch (mes) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31; case 2: return 28; case 4: case 6: case 9: case 11: return 30; } return 0; } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
af01c94fea9375408dde8899312e82a6b649f17b
7feea917627c60424cc22621fc7436e845c5f996
/projects/anyframe-flex-query-pi/src/main/java/org/anyframe/plugin/flex/query/dept/service/DeptService.java
11f0fc8175fa562c0a811c4f9b542cdaa17ddbbb
[]
no_license
anyframejava/anyframe-flex-query
824dde8dcf1034c96fd0486d46d455ff7bfef6f8
88b46ef87fcb40ec505bd3567c10788c3e14363e
refs/heads/master
2021-01-24T08:00:06.797903
2018-04-06T05:31:30
2018-04-06T05:31:30
93,368,017
0
1
null
null
null
null
UTF-8
Java
false
false
1,266
java
/* * Copyright 2008-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.anyframe.plugin.flex.query.dept.service; import java.util.List; import java.util.Map; import org.anyframe.pagination.Page; import org.anyframe.plugin.flex.query.domain.Dept; import org.anyframe.plugin.flex.query.domain.SearchVO; public interface DeptService { Page getPagingList(SearchVO searchVO) throws Exception; List<Dept> getTree(SearchVO searchVO) throws Exception; int create(Dept dept) throws Exception; int update(Dept dept) throws Exception; int remove(Dept dept) throws Exception; Map<String, Integer> saveAll(List<Dept> list) throws Exception; List<Dept> getList(SearchVO searchVO) throws Exception; }
[ "anyframe@samsung.com" ]
anyframe@samsung.com
cc2c7bc32f9d09430bec5eca91e3311d86fd33e8
201f8a7b88327fbea9605e1c12f898334ad54429
/src/main/java/com/markose/etrade/account/Account.java
0a49067ad96cb9f5a75783271026b67aa7f91fdb
[]
no_license
matthewmarkose/etrade-library
10b0fcc274405a10c45aedc89fe0a748a680b3e9
261f901ae54355cbe6a84f9d6d429f3a0160e87d
refs/heads/main
2023-09-02T08:37:28.947644
2021-11-08T02:40:25
2021-11-08T02:40:25
389,814,736
0
0
null
null
null
null
UTF-8
Java
false
false
1,680
java
package com.markose.etrade.account; public final class Account { private String accountId; private String accountIdKey; private String accountMode; private String accountDesc; private String accountName; private String accountType; private String institutionType; private String accountStatus; private int closedDate; public String getAccountId() { return accountId; } public void setAccountId(String accountId) { this.accountId = accountId; } public String getAccountIdKey() { return accountIdKey; } public void setAccountIdKey(String accountIdKey) { this.accountIdKey = accountIdKey; } public String getAccountMode() { return accountMode; } public void setAccountMode(String accountMode) { this.accountMode = accountMode; } public String getAccountDesc() { return accountDesc; } public void setAccountDesc(String accountDesc) { this.accountDesc = accountDesc; } public String getAccountName() { return accountName; } public void setAccountName(String accountName) { this.accountName = accountName; } public String getAccountType() { return accountType; } public void setAccountType(String accountType) { this.accountType = accountType; } public String getInstitutionType() { return institutionType; } public void setInstitutionType(String institutionType) { this.institutionType = institutionType; } public String getAccountStatus() { return accountStatus; } public void setAccountStatus(String accountStatus) { this.accountStatus = accountStatus; } public int getClosedDate() { return closedDate; } public void setClosedDate(int closedDate) { this.closedDate = closedDate; } }
[ "matt.markose@gmail.com" ]
matt.markose@gmail.com
bd43b01af7a670cbc86ee7d5f9e0154cab1c74f6
18ae7f67a749a5cfed36163b750f0caf1f514dcf
/src/main/java/com/onshape/api/responses/FeatureStudiosCreateFeatureStudioResponse.java
0d83c43da7412cb87de982a9a78ceb48ef850654
[ "MIT" ]
permissive
Change2improve/java-client
d936d35d20d8dbb192d2470f096d06babd034b65
5da89caf8c678342376b67eafd6a0fba6289a41a
refs/heads/master
2020-04-11T05:50:54.304309
2018-11-01T14:31:47
2018-11-01T14:31:47
161,561,752
0
0
null
null
null
null
UTF-8
Java
false
false
3,926
java
// The MIT License (MIT) // // Copyright (c) 2018 - Present Onshape Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // package com.onshape.api.responses; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.onshape.api.Onshape; import java.lang.Override; import java.lang.String; import java.util.Map; import javax.validation.constraints.NotNull; /** * Response object for createFeatureStudio API endpoint. * &copy; 2018 Onshape Inc. */ @JsonIgnoreProperties( ignoreUnknown = true ) public final class FeatureStudiosCreateFeatureStudioResponse { /** * Element name */ @JsonProperty("name") @NotNull String name; /** * Element ID */ @JsonProperty("id") @NotNull String id; /** * Element type (for example, &quot;PARTSTUDIO&quot;) */ @JsonProperty("elementType") @NotNull String elementType; /** * Onshape internal use */ @JsonProperty("type") @NotNull String type; /** * Length units, for Part Studio elements only */ @JsonProperty("lengthUnits") @NotNull String lengthUnits; /** * Angle units, for Part Studio elements only */ @JsonProperty("angleUnits") @NotNull String angleUnits; /** * Thumbnail information */ @JsonProperty("thumbnailInfo") @NotNull Map thumbnailInfo; /** * Onshape internal use */ @JsonProperty("thumbnails") @NotNull Map thumbnails; /** * Get Element name * * @return Element name * */ public final String getName() { return this.name; } /** * Get Element ID * * @return Element ID * */ public final String getId() { return this.id; } /** * Get Element type (for example, &quot;PARTSTUDIO&quot;) * * @return Element type (for example, &quot;PARTSTUDIO&quot;) * */ public final String getElementType() { return this.elementType; } /** * Get Onshape internal use * * @return Onshape internal use * */ public final String getType() { return this.type; } /** * Get Length units, for Part Studio elements only * * @return Length units, for Part Studio elements only * */ public final String getLengthUnits() { return this.lengthUnits; } /** * Get Angle units, for Part Studio elements only * * @return Angle units, for Part Studio elements only * */ public final String getAngleUnits() { return this.angleUnits; } /** * Get Thumbnail information * * @return Thumbnail information * */ public final Map getThumbnailInfo() { return this.thumbnailInfo; } /** * Get Onshape internal use * * @return Onshape internal use * */ public final Map getThumbnails() { return this.thumbnails; } @Override public String toString() { return Onshape.toString(this); } }
[ "peter.harman@deltatheta.com" ]
peter.harman@deltatheta.com
294f34681b0622df4f6753051ba2d27f90176582
d40d260e454f2e7e44dafdad6bfa67913ab94b8a
/app/src/main/java/com/example/mobilogarage/Garages.java
33d703dac9b4159bd681ff9bf3a5f76be8bbe3f2
[]
no_license
AMONYSANDRA/MobiloGarage
16a62b9decb66b7225fc20eec0303d0cc9e0c6ef
2d985ac8ce33048d7efe4bc950c65086fbdd1769
refs/heads/master
2020-05-04T17:17:06.983696
2019-03-27T08:38:07
2019-03-27T08:38:07
174,521,835
0
0
null
null
null
null
UTF-8
Java
false
false
924
java
package com.example.mobilogarage; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; public class Garages extends AppCompatActivity { public void fade(View view) { ImageView gar = (ImageView) findViewById(R.id.garage1); ImageView garr = (ImageView) findViewById(R.id.garge2); ImageView garrr = (ImageView) findViewById(R.id.garage3); gar.animate().rotationBy(360).scaleX(0.5f).scaleY(0.5f).scaleX(0.5f).alpha(1).setDuration(2000); garr.animate().rotationBy(360).scaleX(0.5f).scaleY(0.5f).alpha(1).setDuration(2000); garrr.animate().rotationBy(360).scaleX(0.5f).scaleY(0.5f).alpha(1).setDuration(2000); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_garages); } }
[ "nyande20@gmail.com" ]
nyande20@gmail.com
97bed9d80d145de80a23404d9269c51b9bdfbb19
8d6d39728ee0749ffce108d76072c6d9e22f040f
/src/main/java/de/userservice/VO/Department.java
00620402c54f1d590786aee5adbc77a62d9dc47b
[]
no_license
AIRAT1/user-service
40f51c67ab4cba59aeeb119ea2c4c5445be4d14d
d07af2a8b074c5f96a9b1ba50ebdc203b068a7e7
refs/heads/master
2023-03-09T23:07:28.115804
2021-02-22T05:38:37
2021-02-22T05:38:37
339,818,190
0
0
null
null
null
null
UTF-8
Java
false
false
328
java
package de.userservice.VO; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor public class Department { private Long departmentId; private String departmentName; private String departmentAddress; private String departmentCode; }
[ "ayrat1@mail.ru" ]
ayrat1@mail.ru
23e1eb197acbbc921b0e2c3c838e29f36c537278
f26f6d6a2c6832075a538991c2093f9cdbd10937
/pig-gateway/src/main/java/com/github/pig/gateway/component/listener/GroovyLoadInitListener.java
bf9df723698472bf48cf9d031e65962da1698ab6
[ "MIT" ]
permissive
MarkRen1990/pig_bak_2018_12
933117a26ac9c01f6419495e687359ed4c0be4ed
127529431dd83c01654f1f7ac9b28b0ceb4d8feb
refs/heads/master
2020-04-28T20:09:49.640687
2019-03-14T02:49:25
2019-03-14T02:49:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,289
java
/* * Copyright (c) 2018-2025, lengleng 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 pig4cloud.com developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: lengleng (wangiegie@gmail.com) */ package com.github.pig.gateway.component.listener; import com.netflix.zuul.FilterFileManager; import com.netflix.zuul.FilterLoader; import com.netflix.zuul.groovy.GroovyCompiler; import com.netflix.zuul.groovy.GroovyFileFilter; import com.netflix.zuul.monitoring.MonitoringHelper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.embedded.EmbeddedServletContainerInitializedEvent; import org.springframework.context.event.EventListener; import org.springframework.stereotype.Component; /** * @author lengleng * @date 2018/11/15 * <p> * 动态filter 初始化配置 */ @Slf4j @Component @ConditionalOnProperty("zuul.groovy.path") public class GroovyLoadInitListener { @Value("${zuul.groovy.path}") private String groovyPath; @EventListener(value = {EmbeddedServletContainerInitializedEvent.class}) public void init() { MonitoringHelper.initMocks(); FilterLoader.getInstance().setCompiler(new GroovyCompiler()); FilterFileManager.setFilenameFilter(new GroovyFileFilter()); try { FilterFileManager.init(10, groovyPath); } catch (Exception e) { log.error("初始化网关Groovy 文件失败 {}", e); } log.warn("初始化网关Groovy 文件成功"); } }
[ "renyongke@xianlai-inc.com" ]
renyongke@xianlai-inc.com
d5acff03dc0c2d25cdd13c3945af0828a17fb12e
44e3a96ec52b7ab4fe75fd937b409fedc497ca54
/TaskAllocationSim/src/drcl/sim/event/SESimulatorOld.java
f0b78da5226adbcb9f0201041637b35af91f41fa
[]
no_license
kaist-dmlab/MTA
e5213f0ead31ae131fedfe710daa04fc7053e573
db626d40c0a07680a7c3c8cd302c3a70d7ea17c0
refs/heads/master
2020-11-28T19:02:50.344186
2019-12-24T09:20:48
2019-12-24T09:20:48
229,897,796
17
1
null
null
null
null
UTF-8
Java
false
false
11,833
java
// @(#)SESimulatorOld.java 9/2002 // Copyright (c) 1998-2002, Distributed Real-time Computing Lab (DRCL) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // 3. Neither the name of "DRCL" 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 REGENTS 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 drcl.sim.event; import java.util.*; import java.beans.*; import drcl.comp.*; import drcl.util.queue.*; /** * This is the previous version of the sequential event simulation engine. * Refer to {@link SESimulator} for the complete implementation. */ public class SESimulatorOld extends drcl.comp.ACARuntime { SEThreadOld mainThread; // statistics protected long startTime = 0; // to calculate "grab rate" protected long ltime = 0; // current time in long (ms) protected double time = 0.0; // current time in double (s) to record the time when pool is suspended. boolean suspended = false; /** Used to store tasks. */ protected FIFOQueue qReady = new FIFOQueue(); // "ready" queue //protected Queue qWaiting = new SimpleQueue(); // "waiting" queue //protected Queue qWaiting = new CalendarQueue(); // "waiting" queue protected TreeMapQueue qWaiting = new TreeMapQueue(); // "waiting" queue int threadcount = 0; int maxlength = 0; // max occupancy in waiting queue in history long totalNumEvents = 0; static int RUNTIME_COUNTER = 0; public SESimulatorOld() { this("SESimOld"); } public SESimulatorOld(String name_) { super(name_); //mainThread = new SEWorkerThread("WK_ " + name_); // this is necessary for ForkManager to work correctly... setTimeScale(Double.POSITIVE_INFINITY); } // void ___TASK_MANAGEMENT___() {} // /** * The only way to trigger new tasks to be executed. */ protected synchronized void newTask(Task task_, WorkerThread currentThread_) { if (resetting || task_ == null) return; // to figure in the processing delay in the runtime if (task_.getTime() > time) { if (debug) println(Thread.currentThread().getName() + " to waiting-queue:" + task_); qWaiting.enqueue(task_.getTime(), task_); if (logenabled) { if (tf == null) _openlog(); try { tf.write(("+ " + task_.getTime() + "\t\t" + qWaiting.getLength() + "\n").toCharArray()); tf.flush(); } catch (Exception e_){} } if (maxlength < qWaiting.getLength()) maxlength = qWaiting.getLength(); } else { if (debug) println(Thread.currentThread().getName() + " to ready-queue:" + task_); qReady.enqueue(task_); } if (state == State_INACTIVE) startNewThread(); } /** Returns the current thread context. */ protected WorkerThread getThread() { return mainThread; } synchronized void startNewThread() { //mainThread = new SEThreadOld("WK_" + name + threadcount); if (debug) { if (Thread.currentThread() instanceof SEThreadOld) System.out.println("startNewThread(): called by " + Thread.currentThread() + ", " + ((SEThreadOld)Thread.currentThread())._currentContext()); else System.out.println("startNewThread(): called by " + Thread.currentThread()); } mainThread = new SEThreadOld("WK" + threadcount); mainThread.runtime = mainThread.aruntime = this; mainThread.start(); if (threadcount == 0) { startTime = System.currentTimeMillis(); } setState(State_RUNNING); threadcount ++; } /** Returns a task to be executed. */ synchronized Task getTask() { boolean jump_ = false; if (qReady.isEmpty()) { qWaiting.dequeueTransfer(qReady); jump_ = true; } if (qReady.isEmpty()) return null; Task t_ = (Task)qReady.dequeue(); if (jump_) { time = t_.getTime(); if (debug) println(Thread.currentThread().getName() + "from waiting-queue, <TIME_JUMP>:" + t_); } else { if (debug) println(Thread.currentThread().getName() + "from ready-queue:" + t_); } return t_; } // private void ___PROPERTIES___() {} // public synchronized String info() { return s_info2(); } /** Synchronized version of {@link #s_info()}. */ public synchronized String ss_info() { return s_info(); } // Returns general info of this runtime. String s_info2() { long numberOfArrivalEvents_ = getNumberOfArrivalEvents(); StringBuffer sb_ = new StringBuffer(toString()); if (state != State_INACTIVE && state != State_SUSPENDED) ltime = System.currentTimeMillis() - startTime; sb_.append(" --- State:" + state + "\n"); sb_.append("# of events: " + numberOfArrivalEvents_ + "\n"); sb_.append("Event processing rate: " + _getEventRate(numberOfArrivalEvents_) + "(#/s)\n"); if (resetting) sb_.append("Resetting...\n"); sb_.append("Time: " + time + "\n"); sb_.append("Wall time elapsed: "); sb_.append(((double)ltime / 1000.0) + " sec.\n"); return sb_.toString(); } public String s_info() { long numberOfArrivalEvents_ = getNumberOfArrivalEvents(); StringBuffer sb_ = new StringBuffer(toString()); if (state != State_INACTIVE && state != State_SUSPENDED) ltime = System.currentTimeMillis() - startTime; sb_.append(" --- State:" + state); if (resetting) sb_.append(", Resetting..."); sb_.append("\n"); sb_.append("# of events: " + numberOfArrivalEvents_ + "\n"); sb_.append("Event request rate: " + _getEventRate(numberOfArrivalEvents_) + "(#/s)\n"); sb_.append("Time: " + time + "\n"); sb_.append("Wall time elapsed: "); sb_.append(((double)ltime / 1000.0) + " sec.\n"); sb_.append("#Tasks_queued: " + qReady.getLength() + "\n"); sb_.append("#Future tasks: " + qWaiting.getLength() + ", maxlength=" + maxlength + "\n"); sb_.append("#threads created: " + threadcount + "\n"); sb_.append("Main_thread: " + (mainThread == null? "null": mainThread._toString()) + "\n"); return sb_.toString(); } public SEThreadOld getMainThread() { return mainThread; } /** Asynchronous version of {@link #diag()}. */ public String a_info(boolean listWaitingTasks_) { StringBuffer sb_ = new StringBuffer(s_info()); if (listWaitingTasks_) { sb_.append("Task queue: " + (qReady.isEmpty()? "empty.\n": "\n" + qReady.info())); sb_.append("Future task queue: " + (qWaiting.isEmpty()? "empty.\n": "\n" + qWaiting.info())); } return sb_.toString(); } /** Returns information of the task queue. */ public String tasks() { return "Task queue: " + (qReady == null || qReady.isEmpty()? "<empty>.\n": "\n" + qReady.info()); } /** Forces to reset this runtime. */ public void forceReset() { resetting = false; reset(); } // public void ___PROFILE___() {} // public long getNumberOfArrivalEvents() { if (mainThread == null)// || suspended) return totalNumEvents; else return totalNumEvents + mainThread.totalNumEvents; } public double getEventRate() { return _getEventRate(getNumberOfArrivalEvents()); } protected double _getEventRate(long numArrivals_) { if (state == State_SUSPENDED || state == State_INACTIVE) return (double)numArrivals_ / ltime * 1000.0; else return (double)numArrivals_ / (System.currentTimeMillis() - startTime) * 1000.0; } // void ___EXECUTION_CONTROL___() {} // /** Asynchronized version of getTime(), for diagnosis. */ protected double _getTime() { return time; } protected synchronized void _stop(boolean block_) { if (suspended) return; ltime = System.currentTimeMillis() - startTime; suspended = true; // wait until mainThread is through if (block_ && mainThread != null) try { this.wait(); } catch (Exception e_) { e_.printStackTrace(); drcl.Debug.fatalError(e_.toString()); } setState(State_SUSPENDED); } public synchronized void resume() { if (!suspended) return; suspended = false; setState(State_RUNNING); startTime = System.currentTimeMillis() - ltime; if (mainThread == null) startNewThread(); else this.notify(); // notify mainThread to continue } public synchronized void reset() { if (resetting) return; resetting = true; if (mainThread != null) { mainThread.runtime = null; if (suspended) this.notify(); // notify mainThread to continue // wait until mainThread is through try { this.wait(); } catch (Exception e_) { e_.printStackTrace(); drcl.Debug.fatalError(e_.toString()); } } setState(State_INACTIVE); totalNumEvents = 0; startTime = 0; ltime = 0; time = 0.0; qReady.reset(); qWaiting.reset(); mainThread = null; resetting = suspended = false; maxlength = 0; threadcount = 0; } // called by mainThread when no more task to do void threadRetired() { if (debug) println(mainThread + " RETIRED"); totalNumEvents += mainThread.totalNumEvents; mainThread.totalNumEvents = 0; // no more task mainThread = null; ltime = System.currentTimeMillis() - startTime; setState(State_INACTIVE); } public long getWallTimeElapsed() { if (state != State_INACTIVE && !suspended) ltime = System.currentTimeMillis() - startTime; return ltime; } public String t_info() { return t_info(""); } protected String t_info(String prefix_) { if (state != State_INACTIVE && state != State_SUSPENDED) ltime = System.currentTimeMillis() - startTime; StringBuffer sb_ = new StringBuffer(); sb_.append(prefix_ + "timeScale = " + (timeScale/1.0e3) + " (wall time/virtual time)\n"); sb_.append(prefix_ + "1.0/timeScale = " + (timeScaleReciprocal*1.0e3) + " (virtual time/wall time)\n"); sb_.append(prefix_ + "startTime = " + startTime + "\n"); sb_.append(prefix_ + "ltime = " + ltime + "\n"); sb_.append(prefix_ + "currentTime = " + time + "\n"); return sb_.toString(); } protected void setState(String new_) { if (state == new_) return; // notify listeners if (vStateListener != null) notifyStateListeners(new PropertyChangeEvent(this, "State", state, new_)); if (debug) println(Thread.currentThread().getName() + " " + state + " --> " + new_); state = new_; } // private void ___TRACE___() {} // public void println(String msg_) { //drcl.Debug.debug("SIMDEBUG | " + this + "," + time + "," // + mainThread + (msg_ == null? "": "| " + msg_) + "\n"); drcl.Debug.debug("SIMDEBUG | " + time + (msg_ == null? "": "| " + msg_) + "\n"); } protected void off(ACATimer handle_) { qWaiting.remove(handle_.getTime(), handle_); } public Object getEventQueue() { return qWaiting; } }
[ "prosopher@gmail.com" ]
prosopher@gmail.com
5549602715a563d2fe6c9740cbd2e601bb4bc0e4
c4a43b94783494dfeeba1bdffd0039479cc80667
/app/src/main/java/com/quest/organdonor/ui/home/HomeFragment.java
c72abd744c80119bbd67d20650e1f0ada9edeef6
[]
no_license
evansmwenda/OrganDonor-MySQL
e84567c18095788809b308421e7097b99f6d82ef
25ce9394bf2127f63f06688657ab58b1c525cc5b
refs/heads/master
2020-09-09T00:29:28.248008
2019-11-25T09:59:02
2019-11-25T09:59:02
221,289,065
0
0
null
null
null
null
UTF-8
Java
false
false
3,084
java
package com.quest.organdonor.ui.home; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.Nullable; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.quest.organdonor.adapters.MyAdapter; import com.quest.organdonor.R; import com.quest.organdonor.ui.home.pojo.Message; import java.util.List; public class HomeFragment extends Fragment { private HomeViewModel homeViewModel; private RecyclerView recyclerView; private RecyclerView.Adapter mAdapter; private RecyclerView.LayoutManager layoutManager; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { homeViewModel = ViewModelProviders.of(this).get(HomeViewModel.class); View root = inflater.inflate(R.layout.fragment_home, container, false); return root; } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); final TextView textView = view.findViewById(R.id.text_home); recyclerView =view.findViewById(R.id.recyclerView); // use this setting to improve performance if you know that changes // in content do not change the layout size of the RecyclerView recyclerView.setHasFixedSize(true); // use a linear layout manager layoutManager = new LinearLayoutManager(getActivity()); recyclerView.setLayoutManager(layoutManager); // use this setting to improve performance if you know that changes // in content do not change the layout size of the RecyclerView recyclerView.setHasFixedSize(true); // // specify an adapter (see also next example) // mAdapter = new MyAdapter(this,); // recyclerView.setAdapter(mAdapter); homeViewModel.getText().observe(this, new Observer<String>() { @Override public void onChanged(@Nullable String s) { textView.setText(s); } }); homeViewModel.getProducts().observe(this, new Observer<List<Message>>() { @Override public void onChanged(List<Message> messages) { Log.d("mwenda", "onChanged: "+messages.toString()); Toast.makeText(getActivity(), "data fetched"+messages.get(0).toString(), Toast.LENGTH_SHORT).show(); // specify an adapter (see also next example) mAdapter = new MyAdapter(getActivity(),messages); recyclerView.setAdapter(mAdapter); } }); } //add code to display recycler view with its items }
[ "evansmwenda.em@gmail.com" ]
evansmwenda.em@gmail.com
20d792963a240f58470f3d452a3d9d9501fff404
91a5525ef31f30875c076dc55cdf3b324293f16c
/src/main/java/com/changhomework/PropertiesUtil.java
fbe72c09f567ce76c950ae9589114bc6039d9cfe
[]
no_license
higaochang/GW
9ec4fdd4847abcb8047da78dd228984599413504
dd70993ea460f69d0aeabc6d5973cee586a65512
refs/heads/main
2023-08-12T02:21:33.408299
2021-09-14T13:54:45
2021-09-14T13:54:45
374,625,162
0
0
null
null
null
null
UTF-8
Java
false
false
2,330
java
package com.changhomework; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; import java.util.Properties; public class PropertiesUtil { private static Logger logger = LoggerFactory.getLogger(PropertiesUtil.class); private static Map<String, PropertiesUtil> propsMap; Properties properties; public static synchronized PropertiesUtil getInstance(String propName) { if (propsMap == null) { propsMap = new HashMap<String, PropertiesUtil>(); } PropertiesUtil instance = propsMap.get(propName); if (instance == null) { instance = new PropertiesUtil(propName); propsMap.put(propName, instance); } return instance; } private PropertiesUtil(String propName) { ClassLoader classLoader = PropertiesUtil.class.getClassLoader(); InputStream inStream = classLoader.getResourceAsStream(propName); properties = new Properties(); try { properties.load(inStream); } catch (IOException e) { throw new RuntimeException("There's no resource file named [" + propName + "]", e); } } public String getProperty(String key) { return properties.getProperty(key); } public String getProperty(String key, String defaultValue) { return properties.getProperty(key, defaultValue); } public int getInt(String key) { return Integer.valueOf(getProperty(key)); } public int getInt(String key, int defaultValue) { return getProperty(key) == null ? defaultValue : Integer.valueOf(getProperty(key)); } public long getLong(String key) { return Long.valueOf(getProperty(key)); } public long getLong(String key, long defaultValue) { return getProperty(key) == null ? defaultValue : Long.valueOf(getProperty(key)); } public boolean getBoolean(String key) { return Boolean.parseBoolean(getProperty(key)); } public boolean getBoolean(String key, boolean defaultValue) { return getProperty(key) == null ? defaultValue : Boolean.parseBoolean(getProperty(key)); } public Properties getProperties() { return properties; } }
[ "higaochang@gmail.com" ]
higaochang@gmail.com
7e84080c10f46fc626f984587d31838a51fd3abd
44028da605c47faa614ea0ad454caba6b9a9858c
/src/main/medium/JumpGame.java
e559693ffbb806896d539c10b2ba936dc871af62
[]
no_license
aist2/LeetCode
f1876946476bdf4e6586519c37058cf98b4e26b3
e8ad3b34fa7028352fd9a82b29f5780a1d0f9c77
refs/heads/master
2021-01-01T03:36:42.217412
2017-05-12T07:48:04
2017-05-12T07:48:04
57,613,337
0
0
null
null
null
null
UTF-8
Java
false
false
1,127
java
package medium; public class JumpGame { // public static boolean canJump(int[] nums) { // if (nums.length <= 1) return true; // int idx = 0; // int step; // while (idx < nums.length) { // step = nums[idx]; // for (;step > 0; step--) { // if (idx+step >= nums.length || nums[idx+step] != 0){ // idx += step; // break; // } // } // if (step == 0) // return false; // } // return true; // } public static boolean canJump(int[] nums) { return canJump2(nums); } public static boolean canJump2(int[] nums) { int max = 0; for (int i = 0; i<nums.length; i++){ if (i>max) return false; max = Math.max(i + nums[i], max); } return true; } public static boolean canJump1(int[] nums) { return canJump(nums, 0); } private static boolean canJump(int[] nums, int idx) { if (idx>=nums.length-1) return true; if (nums[idx] == 0) return false; int step = nums[idx]; for (;step > 0; step--) { boolean res = canJump(nums, idx+step); if (res) return true; else continue; } return false; } }
[ "eric_lee.06@hotmail.com" ]
eric_lee.06@hotmail.com
9a0e7367c2f91f302e81b8d57d9a2fb9da46ac4b
6bae1b32c287810efc76dece47b2fde0b5665b6c
/crud/src/main/java/com/thiagobelini/crud/config/MessageConfig.java
4a80fe6a9549647c52bacaae82617ff40cc7bcb6
[]
no_license
thibelini/curso-microservicos-java-udemy
5c4681f8b8ede878a2b82a48ed73a4baadc902e4
0922150e09bdee972b0fd412792d1e0aedd2cef2
refs/heads/master
2023-08-28T09:41:45.554646
2021-10-13T23:43:43
2021-10-13T23:43:43
416,877,377
1
0
null
null
null
null
UTF-8
Java
false
false
825
java
package com.thiagobelini.crud.config; import org.springframework.amqp.core.Exchange; import org.springframework.amqp.core.ExchangeBuilder; import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; import org.springframework.amqp.support.converter.MessageConverter; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class MessageConfig { @Value("${crud.rabbitmq.exchange}") String exchange; @Bean public Exchange declareExchange(){ return ExchangeBuilder.directExchange(exchange).durable(true).build(); } @Bean public MessageConverter jsonMessageConverter(){ return new Jackson2JsonMessageConverter(); } }
[ "vsm.thiagobelini@gmail.com" ]
vsm.thiagobelini@gmail.com
d8238c912211bd99d52d9e7e584f5669e8b523f3
75f590394911287638cd5f9aa39a6f0a66b41fd8
/src/conexion/OpUniversidad.java
1563acb3829ace05b7123f982f5d11a26d2796b7
[]
no_license
BeFede/tpi-dsi
93f8592f559d818bac710d582354c57f982fc23a
044404fe40d5d45e5e7910e88c5b223955cdc9f3
refs/heads/master
2020-05-30T19:10:35.524641
2016-09-27T00:58:23
2016-09-27T00:58:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,510
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package conexion; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import tpidsi.grupoinvestigacion.Facultad; /** * * @author Genaro F */ public class OpUniversidad { private OpInvestigador op = new OpInvestigador(); public Facultad[] obtenerFacultades() { Facultad[] facultades = null; Conectar op = new Conectar(); Connection conexion = op.getConection(); String qcat = "SELECT id FROM facultad"; //nombre, universidad PreparedStatement ps3; ResultSet rs3; int contador = 0, id_f; try { ps3 = conexion.prepareStatement(qcat); rs3 = ps3.executeQuery(); Conectar cd = new Conectar(); Statement s = cd.getConection().createStatement(); ResultSet r = s.executeQuery("SELECT COUNT(*) AS rowcount FROM facultad"); r.next(); int size = r.getInt("rowcount"); r.close(); if (rs3.next()) { facultades = new Facultad[size]; id_f = rs3.getInt("id"); facultades[contador] = this.op.buscarFacultad(id_f); } } catch (SQLException e) { } return facultades; } }
[ "gensnw5@gmail.com" ]
gensnw5@gmail.com
19bcd1bad496ea921e2f7892b6be56cfd2cd075a
d99e41044051b6ac1c309b0aa132a923ad78a990
/src/leetcode2/math/middle/T50_myPow.java
612f21c23425f412a951fa09f0a067523e62fc73
[]
no_license
ShawFengZ/swordToOffer
e1696485aee8a74f6fc778e6f4b4355314e5836c
b7be1fa1ae9f0a512e81b908482bf696903b43ec
refs/heads/master
2020-03-28T01:07:39.116842
2020-03-13T15:16:10
2020-03-13T15:16:10
147,478,768
0
0
null
null
null
null
UTF-8
Java
false
false
1,142
java
package leetcode2.math.middle; public class T50_myPow { /** * 实现 pow(x, n) ,即计算 x 的 n 次幂函数。 * */ private static double myPow(double x, int n) { if (x == 0) { return 0; } if (n == 1) { return x; } if (n == -1) { return 1/x; } if (n == 0) { return 1; } boolean flag = true; if (n < 0) { flag = false; n = -n; } double res = 0.0; if (n % 2 == 0) { res = myPow(x, n/2) * myPow(x, n/2); } else { res = x * myPow(x, n/2) * myPow(x, n/2); } return flag?res:1/res; } /** * 精简写法 * */ private static double myPow2(double x, int n) { double res = 1.0; for (int i=n; i != 0; i /= 2) { if (i % 2 != 0) { res *= 2; } x *= x; } return n <0?1/res:res; } public static void main(String[] args) { double v = myPow(2, -2); System.out.println(v); } }
[ "xiaofengz5@163.com" ]
xiaofengz5@163.com
96a0ef09ba60a255c8bdfd678a5585d9d1b78b72
757c6c0ee9a763d99e73825c171a6d4587f1f09b
/app/src/main/java/my/edu/tarc/assignment/AdminHome.java
e26ec4dcb22484bfdb8ebd0ba05544283a29cffe
[]
no_license
yeesin97/excelloan
39cbd54655164db4e9cf729e19f787c38c1031e2
29103b5da773f90a7b05d5138469028cc624b9f7
refs/heads/master
2021-09-03T14:40:45.469136
2018-01-09T21:13:34
2018-01-09T21:13:34
116,497,710
0
0
null
null
null
null
UTF-8
Java
false
false
2,315
java
package my.edu.tarc.assignment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; /** * Created by User on 02/01/2018. */ public class AdminHome extends Fragment { public AdminHome(){ } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_admin_home, container, false); ImageButton imgBtnProfile = (ImageButton)view.findViewById(R.id.imageButtonAProfile); ImageButton imgBtnCustProfile = (ImageButton)view.findViewById(R.id.imageButtonACustProfile); ImageButton imgBtnReport = (ImageButton)view.findViewById(R.id.imageButtonAReport); ImageButton imgBtnLoan = (ImageButton)view.findViewById(R.id.imageButtonALoan); imgBtnProfile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AdminProfileFragment apf = new AdminProfileFragment(); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.frame_container, apf); ft.addToBackStack(null); ft.commit(); } }); imgBtnCustProfile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ProfileFragment pf = new ProfileFragment(); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.frame_container, pf); ft.addToBackStack(null); ft.commit(); } }); imgBtnReport.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); imgBtnLoan.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); getActivity().setTitle("Home"); return view; } }
[ "ongys-pa15@student.tarc.edu.my" ]
ongys-pa15@student.tarc.edu.my
28e3db7582bcb9f40ce311ebc2522200e6d7fd35
d3179d6c5ff59e4d5ccc43d0862073603c8035db
/View/app/src/main/java/com/example/panupong/view/MainActivity.java
e1d49d32f5eb01e1ec806b349a77030e54262903
[]
no_license
PanupongDeve/OneDayMiracleExam
6cfb4ad4ecec20d43f4f31919d73c3cabc7badfc
2ef1af5a4b4d65c5f22e856098adb0e78f7ff2a2
refs/heads/master
2020-03-15T03:51:58.550699
2018-05-04T02:53:52
2018-05-04T02:53:52
131,952,679
0
0
null
null
null
null
UTF-8
Java
false
false
1,818
java
package com.example.panupong.view; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.CheckBox; import android.widget.RadioButton; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView tvOutput; Tools tools = new Tools(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tvOutput = (TextView) findViewById(R.id.tvOutput); } public void onCheckboxClicked(View view) { boolean checked = ((CheckBox) view).isChecked(); switch (view.getId()) { case R.id.checkbox_meat: if (checked) { tvOutput.setText(tools.putMeat()); System.out.println("Put some meat on the sandwich"); } else { tvOutput.setText(tools.removeMeat()); System.out.println("Remove the meat"); } break; case R.id.checkbox_cheese: if (checked) { tvOutput.setText(tools.showCheese()); } else { tvOutput.setText(tools.removeCheese()); } } } public void onRadioButtonClicked(View view) { boolean checked = ((RadioButton) view).isChecked(); switch (view.getId()) { case R.id.radio_pirates: if(checked) tvOutput.setText(tools.showPirates()); break; case R.id.radio_ninjas: if(checked) tvOutput.setText(tools.showNinja()); break; } } }
[ "5635512110@psu.ac.th" ]
5635512110@psu.ac.th
ff462c7ad015e7bee8ddcbbeb81c6e348e11f45b
50150e229bf595e0c21aca18f0f17c243a43a8a7
/src/main/java/talentwize/pages/TimesheetConfigurations_Task.java
5a3a4afd218a72dbfd386a3758736c88388f64f5
[]
no_license
JohnTo88/Wize_L-D
4d8c7f5ed350f9f92878902b1e8ab6811f6c95e3
0037ca96065129c4ff9dde3f30aa5b8896d3838c
refs/heads/master
2023-04-28T20:07:48.832750
2019-09-19T08:53:19
2019-09-19T08:53:19
209,505,934
0
0
null
2023-04-14T17:49:14
2019-09-19T08:48:05
Java
UTF-8
Java
false
false
4,386
java
package talentwize.pages; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import controller.WebActions; public class TimesheetConfigurations_Task extends WebActions { public TimesheetConfigurations_Task(WebDriver _driver) { super(_driver); } By btnCopyTasks = By.xpath("//button[contains(.,'Copy Tasks')]"); By btnAddTask = By.xpath("//button[contains(.,'Add Task')]"); By txtSearchTask = By.xpath("//input[@placeholder='Search tasks...']"); By linkEdit = By.xpath("(//span[@ng-click='fn_on_name($index, item)'])[1]"); By icoDelete = By.xpath("//i[@class='icon icon-bin']"); By icoArrow = By.xpath("//span[@class='icon icon-arrow-down3']"); By optCheckAll = By.xpath("//a[contains(.,'Check AllUncheck All')]"); By btnYes = By.xpath("//button[contains(.,'Yes')]"); By msgDeleteSuccess = By.xpath("//span[@class='message-content'][contains(.,'Task deleted successfully!')]"); By msgAddSuccess = By.xpath("//span[@class='message-content'][contains(.,'Task added successfully!')]"); By msgEditSuccess = By.xpath("//span[@class='message-content'][contains(.,'Update task successfully!')]"); By msgCloneSuccess = By.xpath("//span[@class='message-content'][contains(.,'Tasks clones successfully!')]"); By msgImportSucces = By.xpath("//span[@class='message-content'][contains(.,'Import Successful')]"); By btnImport = By.xpath("//button[contains(.,'Import')]"); public void clickBtnCopyTasks() { waitForElementClickable(10, btnCopyTasks); clickByJavaScript(btnCopyTasks); } public void clickBtnImport() { waitForElementClickable(10, btnImport); clickByJavaScript(btnImport); } public void clickBtnAddTask() { waitForElementClickable(10, btnAddTask); clickByJavaScript(btnAddTask); } public void clickLinkEdit() { waitForElementClickable(10, linkEdit); clickByJavaScript(linkEdit); } public void fillTxtSearchTask(String Task) { sleep(5); waitForElementClickable(10, txtSearchTask); goTextOn(txtSearchTask, Task); } public void deleteTasks() { waitForElementClickable(5,icoArrow); clickByJavaScript(icoArrow); waitForElementClickable(5,optCheckAll); clickByJavaScript(optCheckAll); waitForElementClickable(5,icoDelete); clickByJavaScript(icoDelete); waitForElementClickable(5,btnYes); clickByJavaScript(btnYes); } public boolean isBtnCopyTasksDisplayed() { try { if (driver.findElement(btnCopyTasks).isDisplayed() == true) { return true; } else { return false; } } catch (Exception e) { return false; } } public boolean isBtnAddTaskDisplayed() { try { if (driver.findElement(btnAddTask).isDisplayed() == true) { return true; } else { return false; } } catch (Exception e) { return false; } } public boolean isLinkEditDisplayed() { try { if (driver.findElement(linkEdit).isDisplayed() == true) { return true; } else { return false; } } catch (Exception e) { return false; } } public boolean isIcoDeleteDisplayed() { try { if (driver.findElement(icoDelete).isDisplayed() == true) { return true; } else { return false; } } catch (Exception e) { return false; } } public boolean isMsgAddSuccessDisplayed() { try { if (driver.findElement(msgAddSuccess).isDisplayed() == true) { return true; } else { return false; } } catch (Exception e) { return false; } } public boolean isMsgEditSuccessDisplayed() { try { if (driver.findElement(msgEditSuccess).isDisplayed() == true) { return true; } else { return false; } } catch (Exception e) { return false; } } public boolean isMsgDeleteSuccessDisplayed() { try { if (driver.findElement(msgDeleteSuccess).isDisplayed() == true) { return true; } else { return false; } } catch (Exception e) { return false; } } public boolean isMsgCloneSuccessDisplayed() { try { if (driver.findElement(msgCloneSuccess).isDisplayed() == true) { return true; } else { return false; } } catch (Exception e) { return false; } } public boolean isMsgImportSuccessDisplayed() { try { waitForElementPresent(25,msgImportSucces); if (driver.findElement(msgImportSucces).isDisplayed() == true) { return true; } else { return false; } } catch (Exception e) { return false; } } }
[ "39041380+JohnTo88@users.noreply.github.com" ]
39041380+JohnTo88@users.noreply.github.com
f073446888e2ad275eea4abc91496920f2396cc1
615f4b1cede90b59c528a97e2f3a5ef7524ca10b
/LanguageTrainer/app/src/main/java/nz/ac/op/paffjj1student/languagetrainer/Question.java
b4150f03608521fa79c04f50ee40cb4f94c3f340
[]
no_license
JoshuaJamesPaff/IN721_Mobile_paffjj1
4439f140560dd3f520292461436957003f0a9bff
5ccb5d44d9dc0d01f40913453389915a14479465
refs/heads/master
2021-01-18T22:33:11.531607
2016-05-19T02:55:04
2016-05-19T02:55:04
51,886,724
0
0
null
null
null
null
UTF-8
Java
false
false
712
java
package nz.ac.op.paffjj1student.languagetrainer; public class Question { private int imgID; private String noun; private String answer; public Question(int imgID, String noun, String answer){ this.setImgID(imgID); this.setNoun(noun); this.setAnswer(answer); } public int getImgID() { return imgID; } public void setImgID(int imgID) { this.imgID = imgID; } public String getNoun() { return noun; } public void setNoun(String noun) { this.noun = noun; } public String getAnswer() { return answer; } public void setAnswer(String answer) { this.answer = answer; } }
[ "joshuapaff@hotmail.com" ]
joshuapaff@hotmail.com
6f2ec860b9c4ebe2d9e51db0571f4dacd65718ad
beda939f133cfb20738f05673a914aacb848a0a1
/src/main/java/com/futhead/java/streaming/KafkaWordCount.java
8856f6c806e2a9f8c428dbb98f433151e5bf39a9
[]
no_license
futheads/spark-study
3dd22e5f34fea32f906d3ff77b196f56ecdcd8c1
4c50a8f35f3677388da7db398d1cb3d5b391c018
refs/heads/master
2021-01-01T05:54:26.386527
2018-08-12T09:51:18
2018-08-12T09:51:18
97,301,018
0
1
null
null
null
null
UTF-8
Java
false
false
695
java
package com.futhead.java.streaming; import org.apache.commons.collections.map.HashedMap; import org.apache.spark.SparkConf; import org.apache.spark.streaming.Duration; import org.apache.spark.streaming.api.java.JavaStreamingContext; import java.util.Map; /** * Created by futhead on 17-7-26. */ public class KafkaWordCount { public static void main(String[] args) { SparkConf sparkConf = new SparkConf().setAppName("KafkaWordCount").setMaster("local[2]"); JavaStreamingContext jsc = new JavaStreamingContext(sparkConf, new Duration(2000)); Map<String, Integer> topicMap = new HashedMap(); topicMap.put("topicA", 1); } }
[ "futhead@163.com" ]
futhead@163.com
bc3802cef19c65a5fa939d1ff8b3d6a762972173
67f2a9eb7c449ab3a9ddf5044602cba45feacee2
/modules/jaxb-xml-binding/geotk-xml-ols/src/main/java/org/geotoolkit/ols/xml/v121/AngleType.java
042ed9f9c04c5c9519d3bd70a63093c49e6fb0dd
[]
no_license
lvvi/geotoolkit
f01deb47de18ffd591852922e7f432f5f615f2b7
5f02a6e9cd236ec37cb041f8f35cbab283278cea
refs/heads/master
2020-12-31T02:14:55.570737
2016-04-25T20:57:14
2016-04-25T20:57:14
58,119,390
1
0
null
2016-05-05T09:18:34
2016-05-05T09:18:34
null
UTF-8
Java
false
false
2,238
java
/* * Geotoolkit - An Open Source Java GIS Toolkit * http://www.geotoolkit.org * * (C) 2011, Geomatys * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotoolkit.ols.xml.v121; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * This type is used as a unit of measure for ADTs only, it's not used by the GML3 geometry. This will be a point for future work of harmonization. * * <p>Java class for AngleType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AngleType"> * &lt;complexContent> * &lt;extension base="{http://www.opengis.net/xls}AbstractMeasureType"> * &lt;attribute name="uom" type="{http://www.w3.org/2001/XMLSchema}string" fixed="DecimalDegrees" /> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AngleType") public class AngleType extends AbstractMeasureType { @XmlAttribute private String uom; /** * Gets the value of the uom property. * * @return * possible object is * {@link String } * */ public String getUom() { if (uom == null) { return "DecimalDegrees"; } else { return uom; } } /** * Sets the value of the uom property. * * @param value * allowed object is * {@link String } * */ public void setUom(String value) { this.uom = value; } }
[ "guilhem.legal@geomatys.fr" ]
guilhem.legal@geomatys.fr
a60dee2d92f6276382c0cfc01d79675ece1f2cc6
78f06ae81ebab441166c4e68cfd662c8b372cb48
/vwill/app/src/main/java/com/xykj/vwill/PermissionActivity.java
5a19bf612d28306430880dea0710d5339436a232
[]
no_license
Lebron-Liu/Basketballl
32ba41db8f4099078a5a14d3001eac1a5dd668ba
f1f46a8b536f514953085e40b87fcbe685a58057
refs/heads/master
2020-03-27T06:07:40.168195
2018-08-25T09:30:48
2018-08-25T09:30:48
146,080,786
1
0
null
null
null
null
UTF-8
Java
false
false
6,764
java
package com.xykj.vwill; import android.app.Activity; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.provider.Settings; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.app.AppOpsManagerCompat; import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.view.View; import android.view.Window; import java.util.Arrays; import java.util.List; /** * 申请授权的Activity(1、可以进入设置打开或者关闭权限,2、直接使用授权申请方法来申请) * github PermissionGrant */ public class PermissionActivity extends Activity { private static final int REQUEST_SETTINGS = 1; private static final int REQUEST_PERMISSION = 2; private String[] permissions; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent it = getIntent(); if (it == null || !it.hasExtra("permissions")) { finish(); return; } permissions = it.getStringArrayExtra("permissions"); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_permission); findViewById(R.id.btn_setting).setOnClickListener(btnClick); findViewById(R.id.btn_grant).setOnClickListener(btnClick); } /** * 启动授权界面 * * @param context * @param requestCode * @param permissions */ public static void startPermissionActivity(Activity context, int requestCode, String... permissions) { Intent it = new Intent(context, PermissionActivity.class); it.putExtra("permissions", permissions); context.startActivityForResult(it, requestCode); } private View.OnClickListener btnClick = new View.OnClickListener() { @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_setting: //进入设置打开权限 Intent it = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); //配置跳转要查看的应用的包名 packege:com.xykj.filemanager it.setData(Uri.parse("package:" + getApplication().getPackageName())); startActivityForResult(it, REQUEST_SETTINGS); break; case R.id.btn_grant: //使用申请授权方法 ActivityCompat.requestPermissions(PermissionActivity.this, permissions, REQUEST_PERMISSION); break; } } }; //授权结果 @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == REQUEST_PERMISSION) { int deniedIndex = getFirstDeniedIndex(grantResults); if (deniedIndex != -1) { //用户拒绝 //检测是否有必要跟用户说明为什么要申请这个权限,如果拒绝了会有什么结果 if (ActivityCompat.shouldShowRequestPermissionRationale(PermissionActivity.this, permissions[deniedIndex])) { //解释一下 AlertDialog.Builder b = new AlertDialog.Builder(PermissionActivity.this); b.setTitle("警告") .setMessage("不授权将影响应用的正常使用,是否需要重新授权?") .setPositiveButton("是", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ActivityCompat.requestPermissions(PermissionActivity.this, PermissionActivity.this.permissions, REQUEST_PERMISSION); } }).setNegativeButton("否", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }); b.show(); } } else { setResult(RESULT_OK); finish(); } } } private int getFirstDeniedIndex(int[] grantResults) { int len = grantResults.length; for (int i = 0; i < len; i++) { if (grantResults[i] != PackageManager.PERMISSION_GRANTED) { return i; } } return -1; } /** * 检测是否授权 * * @param context * @param permissions * @return */ public static boolean isGrantedPermission(Context context, String... permissions) { return isGrantedPermission(context, Arrays.asList(permissions)); } /** * 检测是否授权 * * @param context * @param permissions * @return */ public static boolean isGrantedPermission(Context context, List<String> permissions) { if (Build.VERSION.SDK_INT < 23) { return true; } int size = permissions.size(); for (int i = 0; i < size; i++) { String name = permissions.get(i); //一个个的检测授权情况,如果发现了其中某一个未授权,返回false表示检测授权失败 int code = ActivityCompat.checkSelfPermission(context, name); if (code == PackageManager.PERMISSION_DENIED) { return false; } String op = AppOpsManagerCompat.permissionToOp(name); if (TextUtils.isEmpty(op)) { continue; } code = AppOpsManagerCompat.noteProxyOp(context, op, context.getApplicationContext().getPackageName()); if (code != AppOpsManagerCompat.MODE_ALLOWED) { return false; } } return true; } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_SETTINGS) { if (isGrantedPermission(PermissionActivity.this, permissions)) { setResult(RESULT_OK); } else { setResult(RESULT_CANCELED); } finish(); } } }
[ "1666251039@qq.com" ]
1666251039@qq.com
18b75cbd147ba274802a120c25d3e44d2b28c4b1
69169c3d849e42a09d9106943c915c87bfebfe50
/src/main/java/com/ruge/test/多线程/demo03_线程的比较/Thread线程卖票未同步.java
9690ef7782c64e380fc1d5a40a1dde6d276af6ca
[]
no_license
13298899809/ruge-base
aa1c5df81a3f86fc202c6fc46787dea12f6868c3
5ec51dac00453ebc53b9a5b11af5ec63800f4d75
refs/heads/master
2020-03-17T08:24:22.563969
2018-06-25T07:14:27
2018-06-25T07:14:27
132,352,286
0
0
null
null
null
null
UTF-8
Java
false
false
980
java
package com.ruge.test.多线程.demo03_线程的比较; /** * 爱丽丝、如歌 创建于 2018/6/18 13:38 * 说明: */ public class Thread线程卖票未同步 extends Thread { /** * 一共有100张火车票 */ private int count = 100; @Override public void run() { while (count > 0) { count--; System.out.println(Thread.currentThread().getName()+"卖了一张票,剩余 "+count+" 张"); } } public static void main(String[] args) { /** * 创建三个线程 模拟窗口卖票 */ Thread线程卖票未同步 t1 = new Thread线程卖票未同步(); Thread线程卖票未同步 t2 = new Thread线程卖票未同步(); Thread线程卖票未同步 t3 = new Thread线程卖票未同步(); t1.setName("窗口1"); t2.setName("窗口2"); t3.setName("窗口3"); t1.start(); t2.start(); t3.start(); } }
[ "wujian1345528755" ]
wujian1345528755
d7fbe9c793263876063d0bdc76eef8dba9464975
2594da516e53f945a11ad1df7d7f0fcb2f13f89f
/src/vista/panelControl/diagUnidadInvestigacion.java
e87f7a85d7257bee02f2b3b76fd14e2ddd7a4a1a
[]
no_license
victornavelino/ProyectoUno
09da12cd987ea7056597031fa4ff9bd6803eb1e1
25810c88f3cef31b285a97b3caeb366b790d1c1d
refs/heads/master
2021-06-04T03:02:13.867648
2019-09-25T23:03:21
2019-09-25T23:03:21
91,569,169
0
1
null
null
null
null
UTF-8
Java
false
false
7,212
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * diagUnidadInvestigacionAlta.java * * Created on 03/07/2011, 11:07:21 */ package vista.panelControl; import facade.UnidadInvestigacionFacade; import entidades.proyecto.UnidadInvestigacion; /** * * @author carlos */ public class diagUnidadInvestigacion extends javax.swing.JDialog { private UnidadInvestigacion unidadInvestigacion; private String tipoOperacion; /** Creates new form diagUnidadInvestigacionAlta */ public diagUnidadInvestigacion(java.awt.Frame parent, boolean modal, String tipoOperacion) { super(parent, modal); this.tipoOperacion = tipoOperacion; initComponents(); inicializarComponentes(); } public diagUnidadInvestigacion(java.awt.Frame parent, boolean modal, String tipoOperacion, UnidadInvestigacion unidadInvestigacion) { super(parent, modal); this.tipoOperacion = tipoOperacion; this.unidadInvestigacion = unidadInvestigacion; initComponents(); inicializarComponentes(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel2 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); tfDescripcion = new javax.swing.JTextField(); jButton2 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel3.setText("Descripción"); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tfDescripcion, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(tfDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jButton2.setText("Aceptar"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(117, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(114, 114, 114)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton2) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed aceptar(); }//GEN-LAST:event_jButton2ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { diagUnidadInvestigacion dialog = new diagUnidadInvestigacion(new javax.swing.JFrame(), true, new String()); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel3; private javax.swing.JPanel jPanel2; private javax.swing.JTextField tfDescripcion; // End of variables declaration//GEN-END:variables private void inicializarComponentes() { if (tipoOperacion.equals("Alta")) { tfDescripcion.setText(""); tfDescripcion.requestFocus(); } else if (tipoOperacion.equals("Consulta")) { tfDescripcion.setText(unidadInvestigacion.toString()); tfDescripcion.setEditable(false); } else if (tipoOperacion.equals("Modificación")) { tfDescripcion.setText(unidadInvestigacion.toString()); } } private void aceptar() { if (tipoOperacion.equals("Alta")) { unidadInvestigacion = new UnidadInvestigacion(); unidadInvestigacion.setDescripcion(tfDescripcion.getText()); UnidadInvestigacionFacade.getInstance().alta(unidadInvestigacion); } else if (tipoOperacion.equals("Modificación")) { unidadInvestigacion.setDescripcion(tfDescripcion.getText()); UnidadInvestigacionFacade.getInstance().modificar(unidadInvestigacion); } this.dispose(); } public UnidadInvestigacion getUnidadInvestigacionCreada() { return unidadInvestigacion; } }
[ "hugo@HUGON" ]
hugo@HUGON
6ce5d04d8dd7247f50f0408efe52d29dcf22a732
7b5745c12d9dd1641dfc0bfa533928a0e299b637
/app/src/main/java/com/tchristofferson/stocksimulation/core/TimeFrame.java
9780584edc2bba24ba6bf1efab8e65b607fdc98a
[]
no_license
tchristofferson/Stock-Simulation
ebc1e0be96e94f5bf62fdc822fe913f1440c902a
259aa32672c221ad3f108cb0c1ead0f69318daa1
refs/heads/main
2023-07-15T15:53:58.297241
2021-08-29T21:38:42
2021-08-29T21:38:42
388,282,882
0
0
null
null
null
null
UTF-8
Java
false
false
399
java
package com.tchristofferson.stocksimulation.core; public enum TimeFrame { LATEST("latest"), ONE_DAY("5dm"), ONE_WEEK("5d"), ONE_MONTH("1m"), THREE_MONTHS("3m"), ONE_YEAR("1y"), FIVE_YEARS("5y"); private final String value; TimeFrame(String value) { this.value = value; } @Override public String toString() { return value; } }
[ "longleadtrc@gmail.com" ]
longleadtrc@gmail.com
0386f3014fba576b3d17b50c9f28283f8e8400f4
a0bce4561779f03e4a03a870bc778ba2ed660a62
/app/src/main/java/com/hanhanxiaochong/zhongxiangchuanmei/bean/base/PostRequestApi.java
39b8de843f14c70b76d39d45153cfb9c7878030c
[]
no_license
hanhanxiaochong/zhongxiangchuanmei
3e44a902ae2c82c283a69e0bca9403ba8726f22a
cb48beabc0eee74236feace4f73c670290f78304
refs/heads/master
2020-03-17T00:18:31.377592
2018-05-12T03:46:24
2018-05-12T03:46:24
133,111,469
0
0
null
null
null
null
UTF-8
Java
false
false
887
java
package com.hanhanxiaochong.zhongxiangchuanmei.bean.base; import com.hanhanxiaochong.zhongxiangchuanmei.config.HttpPostService; import com.wzgiceman.rxretrofitlibrary.retrofit_rx.Api.BaseApi; import retrofit2.Retrofit; import rx.Observable; /** * Author : 贾桐 * E-mail : 653773284@qq.com * Time : 2017/10/16. * Desc : */ public class PostRequestApi extends BaseApi { private String json; private String mMethod; public String getJson() { return json; } public void setJson(String json) { this.json = json; } public PostRequestApi(String method){ this.mMethod = method; setMothed(mMethod); } @Override public Observable getObservable(Retrofit retrofit) { HttpPostService service = retrofit.create(HttpPostService.class); return service.postConection(mMethod, getJson()); } }
[ "653773284@qq.com" ]
653773284@qq.com