blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
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
689M
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
131 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
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
0813cd2fc534ff274267161cfa28dd0253ce3d79
79761d46e01b747421cbd8089536223b0a943a38
/src/test/java/com/reactivejava/reactiveprogramming/ReactiveProgrammingTutorialApplicationTests.java
154b14b2475e6314967dea784e21c4b554df7817
[]
no_license
rathore90/Reactive-Programming-in-JAVA
dd5ec1adce9fc3bf7e6b26c1b2fb68e3bc43677b
9aa8d831983425b047dfeae5b3373e5cf845df2b
refs/heads/master
2023-07-01T12:57:07.852281
2021-08-03T21:45:42
2021-08-03T21:45:42
392,463,004
0
0
null
null
null
null
UTF-8
Java
false
false
249
java
package com.reactivejava.reactiveprogramming; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ReactiveProgrammingTutorialApplicationTests { @Test void contextLoads() { } }
[ "pardeep@sweetlegs.ca" ]
pardeep@sweetlegs.ca
f4116e3337ccf5f0c3f07ce55d70eb25d5db7e4b
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/g/a/nt$a.java
220f2a1d8a744409a5775cc745653553c0204172
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
886
java
package com.tencent.mm.g.a; import android.content.Context; import com.tencent.mm.protocal.b.a.d; import com.tencent.mm.protocal.protobuf.aar; import com.tencent.mm.protocal.protobuf.abf; import com.tencent.mm.storage.bi; import java.util.List; public final class nt$a { public String cAN; public aar cAv; public cl cJy; public String cKa; public abf cKb; public int cKc = 0; public bi cKd; public List<bi> cKe; public String cKf; public String cKg; public d cKh; public Context context; public long cvx = 0L; public String desc; public String thumbPath; public String title; public String toUser; public int type = 0; } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes7-dex2jar.jar * Qualified Name: com.tencent.mm.g.a.nt.a * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
43a6fa8f19ebd571b57c24c529173f578a9fefd0
2bd90916781296214d8391bf98d1604410f850d9
/Codigo/Servidor-MarioParty/src/main/java/game/MiniJuego.java
53d2bb9e06c3f393177fe5ca1c333376d580f883
[]
no_license
cinferdu/Gizmo
c40fcad902b54ada0307ed68f811c6b090ac4330
c5f4c69fdda018963dc2a9f8a3f2103d12b64414
refs/heads/master
2023-06-08T20:12:09.637171
2019-11-30T12:18:14
2019-11-30T12:18:14
208,466,770
0
0
null
2023-05-23T20:18:12
2019-09-14T16:13:30
Java
UTF-8
Java
false
false
587
java
package game; public class MiniJuego { private String nombre; private String instrucciones; private int limiteTiempo; public MiniJuego() { super(); } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getInstrucciones() { return instrucciones; } public void setInstrucciones(String instrucciones) { this.instrucciones = instrucciones; } public int getLimiteTiempo() { return limiteTiempo; } public void setLimiteTiempo(int limiteTiempo) { this.limiteTiempo = limiteTiempo; } }
[ "corvalanmatiasj@gmail.com" ]
corvalanmatiasj@gmail.com
6a3a8d4205dd0f9b0d98a1cfa35ce147c6c2142c
8b1b0ba47d05259119e2b8ee9665597ffa9b65d5
/app/src/test/java/com/tianxin/tianxin/ExampleUnitTest.java
698bcccbb5e16e90e63d00b2ae01b6c1c8f15ecd
[]
no_license
jiligulu001/Tianxin
640aeaf12e53e9b8e1ea24e78f1460c67e0600b7
2353f797fa3f900831197a63eb30820438341743
refs/heads/master
2020-04-05T13:40:08.085797
2017-08-29T06:58:32
2017-08-29T06:58:32
94,953,412
0
0
null
null
null
null
UTF-8
Java
false
false
326
java
package com.tianxin.tianxin; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "bu@Bu-MacBook-Pro.local" ]
bu@Bu-MacBook-Pro.local
9c343920d79e9825d871067d42c3335d486c4582
f85902a4f5ef675d7e9ea16256e18e6875ad9bba
/src/com/ejerciciosarregloshome/app/SumaInversaVectores.java
94fba845e3729724595272cdc056d08150cf7cb7
[]
no_license
DevUrielMC/EjerciciosArreglosHome
690c59325af667417be08ee8011e15377204319a
247184000063995b4aa72f1c30e284e67354beda
refs/heads/master
2020-08-14T17:41:25.409600
2019-10-16T02:26:19
2019-10-16T02:26:19
215,209,569
0
0
null
null
null
null
UTF-8
Java
false
false
864
java
package com.ejerciciosarregloshome.app; import java.util.Random; public class SumaInversaVectores { public static void main(String[] args) { int suma=0; int numerosGenerados=0; Random randomValores = new Random(); int [] miArreglo =new int [10]; for(int i=0;i<miArreglo.length;i++) { int n= randomValores.nextInt(10); miArreglo[i]= n; System.out.println(miArreglo[i]); } System.out.println(" _______"); int [] miArreglo2 =new int [10]; for(int j=0;j<miArreglo2.length;j++) { int n= randomValores.nextInt(10); miArreglo2[j]= n; System.out.println(miArreglo2[j]); } int []miArreglo3 =new int[10]; for (int i=0;i<miArreglo3.length;i++) { miArreglo3[i] = miArreglo[i] + miArreglo2[i]; System.out.println(miArreglo[i]+"+ "+miArreglo2[i]+"= "+miArreglo3[i]); } } }
[ "urimarcervantes.95@gmail.com" ]
urimarcervantes.95@gmail.com
41398d69a4650e8ca5d44ba7493a214c28b64bed
7124355dd52369290b4063834ba16a4d67ae17c9
/src/main/java/week2/LeadCreation1.java
fb3d91411b06b030e27d6aeb614eb11283c0ee4d
[]
no_license
karthick029/Backup
b4ecc93e2daa393a44ac448ef95e4478ebb80a78
f1add762688ddf204deaea5aed78a99a449e4a8e
refs/heads/master
2020-03-25T23:23:53.285863
2018-08-11T13:13:49
2018-08-11T13:13:49
144,273,003
0
0
null
null
null
null
UTF-8
Java
false
false
2,299
java
package week2; import java.util.List; import org.apache.poi.util.SystemOutLogger; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.Select; public class LeadCreation1 { public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub System.setProperty("Webdriver.chrome.driver","C:\\Program Files (x86)\\Google\\Chrome\\Application"); ChromeDriver driver = new ChromeDriver () ; driver.get("http://leaftaps.com/opentaps"); driver.manage().window().maximize(); driver.findElementById("username").sendKeys("DemoSalesManager"); driver.findElementById("password").sendKeys("crmsfa"); driver.findElementByClassName("decorativeSubmit").click(); Thread.sleep(5000); driver.findElementByLinkText("CRM/SFA").click(); driver.findElementByLinkText("Create Lead").click(); driver.findElementById("createLeadForm_companyName").sendKeys("Testleaf"); driver.findElementById("createLeadForm_firstName").sendKeys("kart"); driver.findElementById("createLeadForm_lastName").sendKeys("hick"); // source drop down WebElement source = driver.findElementById("createLeadForm_dataSourceId"); Select sdd =new Select(source); List<WebElement> alloptions = sdd.getOptions(); for(WebElement eachoptions:alloptions) { System.out.println(eachoptions.getText()); } int count = alloptions.size(); sdd.selectByIndex(count-1); //marketing dropdown WebElement marketingCampaignId = driver.findElementById("createLeadForm_marketingCampaignId"); Select mdd =new Select (marketingCampaignId); List<WebElement> alloption =mdd.getOptions(); for (WebElement marketingoptions : alloption) { System.out.println(marketingoptions.getText()); }int count1 = alloption.size(); mdd.selectByIndex(count1-3); // driver.findElementByClassName("smallSubmit").click(); //driver.findElementByLinkText("Delete").click(); // driver.findElementByPartialLinkText("ext-safari").click(); } }
[ "kavin@LAPTOP-P5LSKAKC" ]
kavin@LAPTOP-P5LSKAKC
13422b079166ff72119004971ed7c0318c2ddfb1
07ba32b430893e7f1806cd9a076fd45fac7e2040
/app/src/main/java/com/hktstudio/music/adapters/AdapterViewPagerPlaySong.java
218857f4957916013787785dc305fb878d7ecf24
[]
no_license
hiep1097/Music
b4fa9e19508e87f54d068e63bfcbd8fe326ee3da
5a4cb1ba321b62e54102592aa77c8c9603700299
refs/heads/master
2020-03-07T09:34:25.873804
2018-08-10T17:21:12
2018-08-10T17:21:12
127,411,094
0
0
null
null
null
null
UTF-8
Java
false
false
1,873
java
package com.hktstudio.music.adapters; import android.content.Context; import android.graphics.drawable.Drawable; import android.support.v4.view.PagerAdapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.SeekBar; import android.widget.TextView; import com.hktstudio.music.R; import com.hktstudio.music.activities.MainActivity; import com.hktstudio.music.models.Song; import java.util.ArrayList; import java.util.List; /** * Created by HOANG on 3/27/2018. */ public class AdapterViewPagerPlaySong extends PagerAdapter { private Context context; private List<Song> list; public AdapterViewPagerPlaySong(Context context, List<Song> list) { this.context = context; this.list = list; } @Override public int getCount() { return list.size(); } @Override public Object instantiateItem(ViewGroup container, int position) { View itemView = LayoutInflater.from(context).inflate(R.layout.item_playsong,container,false); ImageView image_Song; TextView tv_Song, tv_Artist; image_Song = itemView.findViewById(R.id.image_Song); tv_Song = itemView.findViewById(R.id.tv_Song); tv_Artist = itemView.findViewById(R.id.tv_Artist); image_Song.setImageDrawable(Drawable.createFromPath(list.get(position).getAlbum_art())); tv_Song.setText(list.get(position).getName()); tv_Artist.setText(list.get(position).getArtist()); container.addView(itemView); return itemView; } @Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView((View) object); } @Override public boolean isViewFromObject(View view, Object object) { return view == object; } }
[ "hoanghiep1097@gmail.com" ]
hoanghiep1097@gmail.com
05f705bc50c701dc3b454075dfa0c8f665c94eed
af44c523f2b3d975908a2ba94acd00e0ca6d1538
/pluginSDK/src/com/baidu/music/plugin/service/ProxyIntentService.java
ee5d601e913be5d2b69cc36e7f626e703e040dd8
[]
no_license
Jarlene/PluginSDK
d97878e2384c1aa5fa60ee805b1fd879f0db9659
8c165a61346c1fa70a97a41e846947a52c0ae0f5
refs/heads/master
2021-01-10T16:33:49.197539
2016-02-23T04:30:15
2016-02-23T04:30:15
49,116,802
3
3
null
null
null
null
UTF-8
Java
false
false
1,374
java
package com.baidu.music.plugin.service; import android.app.IntentService; import android.content.Intent; import com.baidu.music.plugin.activity.ProxyActivity; import com.baidu.music.plugin.activity.ProxyFragmentActivity; import com.baidu.music.plugin.clientlog.LogUtil; import com.baidu.music.plugin.utils.PluginUtils; /** * Created by Jarlene on 5/21 0021 */ public class ProxyIntentService extends IntentService{ private static final String TAG = "ProxyIntentService"; public ProxyIntentService() { super("ProxyIntentService"); // TODO Auto-generated constructor stub } @Override protected void onHandleIntent(Intent intent) { // TODO Auto-generated method stub if (intent == null) { return; } String action = intent.getAction(); LogUtil.d(TAG, "onHandleIntent, action:" + action); if (PluginUtils.PLUGIN_ACTION_LAUNCH.equals(action)) { Intent activityIntent = new Intent(intent); activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); int type = intent.getIntExtra(PluginUtils.PLUGIN_PROXYCLASS_TYPE, -1); if (type == 0) { activityIntent.setClass(getApplication(),ProxyActivity.class); } else if (type == 1) { activityIntent.setClass(getApplication(),ProxyFragmentActivity.class); } else { activityIntent.setClass(getApplication(),ProxyActivity.class); } startActivity(activityIntent); } } }
[ "378389165@qq.com" ]
378389165@qq.com
fec1be553ca21a9e080b184ebc4d05f7efaed832
4e589da6541b273387e8c632c3e55cbecf1d7669
/app/src/test/java/education/elhazent/com/mysubmission/ui/tvshow/TvShowViewModelTest.java
bfee8112538238da0f52aae353903b12813b09e9
[]
no_license
elhazent/Submission-Jetpack-1
6430f9dc3c050524839bae35142e575683730f8c
1e67338773b6501e1fa286f8eda49efbfb726f4d
refs/heads/master
2020-07-01T19:46:26.984426
2019-08-08T14:43:32
2019-08-08T14:43:32
201,277,933
0
0
null
null
null
null
UTF-8
Java
false
false
665
java
package education.elhazent.com.mysubmission.ui.tvshow; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.util.List; import education.elhazent.com.mysubmission.model.MoviesEntity; import static org.junit.Assert.*; public class TvShowViewModelTest { private TvShowViewModel viewModel; @Before public void setUp() { viewModel = new TvShowViewModel(); } @After public void tearDown() { } @Test public void getTvShow() { List<MoviesEntity> tvshowEntities = viewModel.getTvShow(); assertNotNull(tvshowEntities); assertEquals(20, tvshowEntities.size()); } }
[ "meeannawwaf007@gmail.com" ]
meeannawwaf007@gmail.com
c160626be24a5ea0759f9e2e0eb5a7f05ee32b86
7540ef14e231ffc3b536efbce4062f9ef9291ac1
/src/tesis/invenapp/controller/ListadoController.java
7b6aab7e3905d05e307dc640a21f669538f4791b
[]
no_license
EduardoDuran/InvenApp
df3ce475158e9b386012790a7091b9b2e285ae64
777c980c6cfc275cd105bac75c27dbe1a7c9ea11
refs/heads/master
2020-09-24T11:47:03.870563
2014-09-23T03:26:31
2014-09-23T03:26:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package tesis.invenapp.controller; import java.util.List; import tesis.invenapp.ListadoProductos; import tesis.invenapp.db.DbHelper; import tesis.invenapp.modelo.Producto; public class ListadoController { DbHelper db; public ListadoController(ListadoProductos listadoProductos) { db = new DbHelper(listadoProductos); } public List<Producto> getListProduct() { return db.getAllProducts(); } }
[ "xavieras1@gmail.com" ]
xavieras1@gmail.com
7ac16759cf1a9763d95c02a8ddfc8cbd618995bc
04cad4adb7decf2c1cfe13d46f6500dfde0df25e
/puzzlepix/src/com/rjb/utils/GAnalyticsTracker.java
8ff0fdcb189c834a46a131f4b62ff4c04ef4ee1c
[]
no_license
rbrettap/RJBAndroid
2d37819a478fbba8257be3d21b763a3d6b75df60
ff0e76ec5df87a21aecd72b70d681d4ffb80be3b
refs/heads/master
2020-04-10T21:32:02.475619
2013-06-17T16:22:13
2013-06-17T16:22:13
10,691,967
0
0
null
null
null
null
UTF-8
Java
false
false
8,988
java
/** * */ package com.rjb.utils; import android.content.Context; import android.util.Log; import com.rjb.Enums; import com.rjb.Enums.GAnalytics; import com.rjb.Enums.GAnalyticsAction; import com.rjb.service.Logger; import com.google.android.apps.analytics.GoogleAnalyticsTracker; /** * @author alpha * */ public class GAnalyticsTracker { protected GoogleAnalyticsTracker _tracker; protected Context context; private static final Logger logger = new Logger(GAnalyticsTracker.class); private final String DEVICE_PLATFORM = "Platform"; private final String STORY_VIEW_HIT = "Story View Hit"; private final String CATEGORY_HIT ="Category Hit"; private final String LOCAL_LOCATION_HIT = "Local Location Hit"; private final String LOCAL_SOURCE_HIT = "Local Source Hit"; private final String CUSTOMIZE_FCLICK_HIT = "Customize FrontPage Click Hit"; private final String CUSTOMIZE_FSAVE_HIT = "Customize FrontPage Save Hit"; private final String CUSTOMIZE_TCLICK_HIT = "Customize Tabs Click Hit"; private final String CUSTOMIZE_TSAVE_HIT = "Customize Tabs Save Hit "; private final String SHARE_STORY_HIT = "Share Story Hit"; private final String SAVED_STORY_HIT = "Saved Story Hit"; private final String STORY_SOURCE_FRONT_HIT ="Story Accessed From Front Page"; private final String STORY_SOURCE_CATEGORY_HIT = "Story Accessed From Category Option"; private final String STORY_SOURCE_SWIPE_HIT = "Story Accessed From Swipe Gesture"; private final String VIDEO_HIT = "Video Hit"; private final String PHOTO_HIT ="Photo Hit"; public GAnalyticsTracker(final String analyticsKey, final Context context) { GAThreadPool.run(new Runnable() { @Override public void run() { try { Log.i(GAnalyticsTracker.class.getSimpleName(), "initTracker"); initTracker(analyticsKey, context); } catch (Exception e) { Log.e(GAnalyticsTracker.class.getSimpleName(), null, e); } } }); } private void initTracker(String analyticsKey, Context context) { GoogleAnalyticsTracker tr = GoogleAnalyticsTracker.getInstance(); try { tr.start(analyticsKey, context); setTracker(tr); } catch (Exception e) { //This happened once. Tracker needs a bigger review: https://touchtrack.co/r/1tgqu3k Log.e(GAnalyticsTracker.class.getSimpleName(), null, e); } } private synchronized GoogleAnalyticsTracker getTracker() { return _tracker; } private synchronized void setTracker(GoogleAnalyticsTracker _tracker) { this._tracker = _tracker; } public synchronized void dispatchTracking(final GAnalyticsAction action, final GAnalytics type, final String value) { GAThreadPool.run(new Runnable() { @Override public void run() { try { Log.i(GAnalyticsTracker.class.getSimpleName(), "dispatchTrackingInternal("+ action.toString() +", "+ type.toString() +", "+ value +")"); dispatchTrackingInternal(action, type, value); } catch (Exception e) { Log.e(GAnalyticsTracker.class.getSimpleName(), null, e); } } }); } private void dispatchTrackingInternal(GAnalyticsAction action, GAnalytics type, String value) { try{ switch(type){ case EVENT: dispatchEventTracker(action, value); break; case PAGEVIEW: dispatchPageViewTracker(action, value); break; } } catch(Throwable t){ Log.e(getClass().getSimpleName(), null, t); } } private void dispatchPageViewTracker(GAnalyticsAction action, String value){ switch(action){ case STORY_VIEW: logger.i("tracking storyView = " +value); GoogleAnalyticsTracker tr = getTracker(); if(tr == null) return; tr.setCustomVar(1,STORY_VIEW_HIT,value,1); tr.trackPageView(value); tr.dispatch(); break; default: logger.i("Invalid GAnalyticsAction " +value +" no action taken"); } } private void dispatchEventTracker(GAnalyticsAction action, String value){ GoogleAnalyticsTracker tracker = getTracker(); if(tracker == null) return; switch(action){ case PLATFORM: logger.i("tracking platform = " +value); if(value != null){ tracker.trackEvent(DEVICE_PLATFORM,value,"platformEvent",101); tracker.dispatch(); } break; case CATEGORY: logger.i("tracking category = " +value); if(value != null){ tracker.trackEvent(CATEGORY_HIT,value,"categoryEvent",102); tracker.dispatch(); } break; case LOCAL_LOCATION: logger.i("Local Location = " +value); if(value != null){ tracker.trackEvent(LOCAL_LOCATION_HIT,value,"localLocationEvent",103); tracker.dispatch(); } break; case LOCAL_SOURCE: logger.i("Local Source = " +value); if(value != null){ tracker.trackEvent(LOCAL_SOURCE_HIT,value,"localSourceEvent",104); tracker.dispatch(); } break; case CUSTOMIZE_FCLICK: logger.i("Customize Front Page Click = " +value); if(value != null){ tracker.trackEvent(CUSTOMIZE_FCLICK_HIT,value,"customizeFrontPageClickEvent",105); tracker.dispatch(); } break; case CUSTOMIZE_FSAVE: logger.i("Customize Front Page Save = " +value); if(value != null){ tracker.trackEvent(CUSTOMIZE_FSAVE_HIT,value,"customizeFrontPageSaveEvent",106); tracker.dispatch(); } break; case CUSTOMIZE_TCLICK: logger.i("Customize Custom Tabs Click = " +value); if(value != null){ tracker.trackEvent(CUSTOMIZE_TCLICK_HIT,value,"customizeCustomTabsClickEvent",107); tracker.dispatch(); } break; case CUSTOMIZE_TSAVE: logger.i("Customize Custom Tabs Save = " +value); if(value != null){ tracker.trackEvent(CUSTOMIZE_TSAVE_HIT,value,"customizeCustomTabsSaveEvent",108); tracker.dispatch(); } break; case SAVED_STORY: logger.i("Saved Story = " +value); if(value != null){ tracker.trackEvent(SAVED_STORY_HIT,value,"saveStoryEvent",109); tracker.dispatch(); } break; case SHARE_STORY: logger.i("Share Story = " +value); if(value != null){ tracker.trackEvent(SHARE_STORY_HIT,value,"shareStoryEvent",110); tracker.dispatch(); } break; case STORY_SOURCE_FRONT: logger.i("Article Accessed From FrontPage = " +value); if(value != null){ tracker.trackEvent(STORY_SOURCE_FRONT_HIT,value,"storySourceFrontPageEvent",111); tracker.dispatch(); } break; case STORY_SOURCE_CATEGORY: logger.i("Article Accessed From Category = " +value); if(value != null){ tracker.trackEvent(STORY_SOURCE_CATEGORY_HIT,value,"storySourceCategoryEvent",112); tracker.dispatch(); } break; case STORY_SOURCE_SWIPE: logger.i("Article Accessed From Swipe Gesture = " +value); if(value != null){ tracker.trackEvent(STORY_SOURCE_SWIPE_HIT,value,"storySourceSwipeGestureEvent",113); tracker.dispatch(); } break; case PHOTO: logger.i("tracking photo = " +value); if(value != null){ tracker.trackEvent(PHOTO_HIT,value,"photoEvent",114); tracker.dispatch(); } break; case VIDEO: logger.i("tracking video = " +value); if(value != null){ tracker.trackEvent(VIDEO_HIT,value,"videoEvent",115); tracker.dispatch(); } break; default: logger.i("Invalid GAnalyticsAction dispatch Ignored"); } } public synchronized void stop() { GAThreadPool.run(new Runnable() { @Override public void run() { try { Log.i(GAnalyticsTracker.class.getSimpleName(), "stop"); GoogleAnalyticsTracker tracker = getTracker(); if(tracker == null) return; tracker.stop(); } catch (Exception e) { Log.e(GAnalyticsTracker.class.getSimpleName(), null, e); } } }); } private static class GAThreadPool { private static SimpleThreadPoolProcessor pool = new SimpleThreadPoolProcessor(3); public static void run(Runnable runnable) { pool.addRunnable(runnable); } } }
[ "rich@flurry.com" ]
rich@flurry.com
a94f32e29b9bfa518075b1a08a0018c9cf9f77e3
429940c4537799f2adee8986d1926faa3be9ecc6
/src/com/esotericsoftware/kryo/util/IntArray.java
cea9e21d1d6076147d123ef20fe2e10c717f2d7a
[ "BSD-3-Clause" ]
permissive
kevinKaiF/kryo
fd25913dc751734031f94ea78d52ea2d50a9dd8d
7d765a8ca3ace913d979d53507026ec9b4de7d65
refs/heads/master
2020-03-06T20:56:11.752392
2018-03-28T03:09:35
2018-03-28T03:09:35
127,066,218
2
0
BSD-3-Clause
2018-03-28T01:29:13
2018-03-28T01:29:12
null
UTF-8
Java
false
false
9,075
java
/* Copyright (c) 2008, Nathan Sweet * 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 Esoteric Software nor the names of its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.esotericsoftware.kryo.util; import java.util.Arrays; /** A resizable, ordered or unordered int array. Avoids the boxing that occurs with ArrayList<Integer>. If unordered, this class * avoids a memory copy when removing elements (the last element is moved to the removed element's position). * @author Nathan Sweet */ public class IntArray { public int[] items; public int size; public boolean ordered; /** Creates an ordered array with a capacity of 16. */ public IntArray () { this(true, 16); } /** Creates an ordered array with the specified capacity. */ public IntArray (int capacity) { this(true, capacity); } /** @param ordered If false, methods that remove elements may change the order of other elements in the array, which avoids a * memory copy. * @param capacity Any elements added beyond this will cause the backing array to be grown. */ public IntArray (boolean ordered, int capacity) { this.ordered = ordered; items = new int[capacity]; } /** Creates a new array containing the elements in the specific array. The new array will be ordered if the specific array is * ordered. The capacity is set to the number of elements, so any subsequent elements added will cause the backing array to be * grown. */ public IntArray (IntArray array) { this.ordered = array.ordered; size = array.size; items = new int[size]; System.arraycopy(array.items, 0, items, 0, size); } /** Creates a new ordered array containing the elements in the specified array. The capacity is set to the number of elements, * so any subsequent elements added will cause the backing array to be grown. */ public IntArray (int[] array) { this(true, array); } /** Creates a new array containing the elements in the specified array. The capacity is set to the number of elements, so any * subsequent elements added will cause the backing array to be grown. * @param ordered If false, methods that remove elements may change the order of other elements in the array, which avoids a * memory copy. */ public IntArray (boolean ordered, int[] array) { this(ordered, array.length); size = array.length; System.arraycopy(array, 0, items, 0, size); } public void add (int value) { int[] items = this.items; if (size == items.length) items = resize(Math.max(8, (int)(size * 1.75f))); items[size++] = value; } public void addAll (IntArray array) { addAll(array, 0, array.size); } public void addAll (IntArray array, int offset, int length) { if (offset + length > array.size) throw new IllegalArgumentException("offset + length must be <= size: " + offset + " + " + length + " <= " + array.size); addAll(array.items, offset, length); } public void addAll (int[] array) { addAll(array, 0, array.length); } public void addAll (int[] array, int offset, int length) { int[] items = this.items; int sizeNeeded = size + length - offset; if (sizeNeeded >= items.length) items = resize(Math.max(8, (int)(sizeNeeded * 1.75f))); System.arraycopy(array, offset, items, size, length); size += length; } public int get (int index) { if (index >= size) throw new IndexOutOfBoundsException(String.valueOf(index)); return items[index]; } public void set (int index, int value) { if (index >= size) throw new IndexOutOfBoundsException(String.valueOf(index)); items[index] = value; } public void insert (int index, int value) { int[] items = this.items; if (size == items.length) items = resize(Math.max(8, (int)(size * 1.75f))); if (ordered) System.arraycopy(items, index, items, index + 1, size - index); else items[size] = items[index]; size++; items[index] = value; } public void swap (int first, int second) { if (first >= size) throw new IndexOutOfBoundsException(String.valueOf(first)); if (second >= size) throw new IndexOutOfBoundsException(String.valueOf(second)); int[] items = this.items; int firstValue = items[first]; items[first] = items[second]; items[second] = firstValue; } public boolean contains (int value) { int i = size - 1; int[] items = this.items; while (i >= 0) if (items[i--] == value) return true; return false; } public int indexOf (int value) { int[] items = this.items; for (int i = 0, n = size; i < n; i++) if (items[i] == value) return i; return -1; } public boolean removeValue (int value) { int[] items = this.items; for (int i = 0, n = size; i < n; i++) { if (items[i] == value) { removeIndex(i); return true; } } return false; } /** Removes and returns the item at the specified index. */ public int removeIndex (int index) { if (index >= size) throw new IndexOutOfBoundsException(String.valueOf(index)); int[] items = this.items; int value = items[index]; size--; if (ordered) System.arraycopy(items, index + 1, items, index, size - index); else items[index] = items[size]; return value; } /** Removes and returns the last item. */ public int pop () { return items[--size]; } /** Returns the last item. */ public int peek () { return items[size - 1]; } public void clear () { size = 0; } /** Reduces the size of the backing array to the size of the actual items. This is useful to release memory when many items * have been removed, or if it is known that more items will not be added. */ public void shrink () { resize(size); } /** Increases the size of the backing array to acommodate the specified number of additional items. Useful before adding many * items to avoid multiple backing array resizes. * @return {@link #items} */ public int[] ensureCapacity (int additionalCapacity) { int sizeNeeded = size + additionalCapacity; if (sizeNeeded >= items.length) resize(Math.max(8, sizeNeeded)); return items; } protected int[] resize (int newSize) { int[] newItems = new int[newSize]; int[] items = this.items; System.arraycopy(items, 0, newItems, 0, Math.min(items.length, newItems.length)); this.items = newItems; return newItems; } public void sort () { Arrays.sort(items, 0, size); } public void reverse () { for (int i = 0, lastIndex = size - 1, n = size / 2; i < n; i++) { int ii = lastIndex - i; int temp = items[i]; items[i] = items[ii]; items[ii] = temp; } } /** Reduces the size of the array to the specified size. If the array is already smaller than the specified size, no action is * taken. */ public void truncate (int newSize) { if (size > newSize) size = newSize; } public int[] toArray () { int[] array = new int[size]; System.arraycopy(items, 0, array, 0, size); return array; } public String toString () { if (size == 0) return "[]"; int[] items = this.items; StringBuilder buffer = new StringBuilder(32); buffer.append('['); buffer.append(items[0]); for (int i = 1; i < size; i++) { buffer.append(", "); buffer.append(items[i]); } buffer.append(']'); return buffer.toString(); } public String toString (String separator) { if (size == 0) return ""; int[] items = this.items; StringBuilder buffer = new StringBuilder(32); buffer.append(items[0]); for (int i = 1; i < size; i++) { buffer.append(separator); buffer.append(items[i]); } return buffer.toString(); } }
[ "nathan.sweet@gmail.com" ]
nathan.sweet@gmail.com
63f1308d81a6591b27309ea4c0e0512cebacc9ab
f007a434988947897557585edc8f5267837fec15
/URICode/src/beginner/four/ColumninArray.java
b4efa2def24415e55a4233c80af556a5c7ca1534
[]
no_license
GuanchangXiao/URICode
4e4ac8d002069283654856ba54267c7809d90182
9884b51138e29c2e8eb2b1c92dd018ef4eb1e351
refs/heads/master
2020-03-26T07:53:29.797965
2018-08-21T08:48:40
2018-08-21T08:48:40
144,676,265
2
0
null
null
null
null
UTF-8
Java
false
false
566
java
package beginner.four; import java.util.Scanner; public class ColumninArray { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); String c = scanner.next(); double sum=0,avg=0; for(int i=0;i<12;i++){ for(int j=0;j<12;j++){ double x = scanner.nextDouble(); if(n==j) sum+=x; } } avg = sum/12; if(c.equals("S")) System.out.printf("%.1f\n",sum); if(c.equals("M")) System.out.printf("%.1f\n",avg); } }
[ "822102408@qq.com" ]
822102408@qq.com
9d990289dc6e6e2e53dc878211777f4eacbfb523
18deb2a617b048a25d688c71a730ebc84d065c45
/Assignment1/Question1.java
6418fe535d422ed6b57d9803b9662ae66f570479
[]
no_license
PemaZangmo12190069/Assignment
35f2608933c14e3abfeb7359193b0cf5ac6f1be6
59ab5d2057e6a6dfd8f668d5cdedf6b1d8f5c309
refs/heads/master
2023-01-20T09:45:53.163049
2020-11-29T17:37:04
2020-11-29T17:37:04
301,175,216
0
0
null
null
null
null
UTF-8
Java
false
false
2,149
java
import java.util.*; public class Question1{ double one_over_four = 0.25; double three_over_four = 0.75; int size = 4; static int a; int remove; int top = 0; static double length; static int Array[]; public Question1(){ Array = new int[size]; } //which takes a generic variable as a parameter and adds the element to the dynamic array. public void add(int e){ Array[top] = e; top++; } //this function does not take a parameter.When called pop deletes the last element in the dynamic array. public void pop(){ top--; remove = Array[top]; Array[top] = 0; int count = 0; for (int i = 0; i < Array[i]; i++) { count++; } a = count; length = (double)a/size; System.out.println("Remove Element " + remove); } //this function takes one integer parameter. When called resize changes the size of the array public void resize(){ if (length == one_over_four) { int newArray[] = new int[(size/2)*2]; for (int i = 0; i < Array.length; i++) { newArray[i] =Array[i]; } Array = newArray; size = size/2; for (int n : newArray) { System.out.println(n + " "); } } else if (length == three_over_four) { int newArray[] = new int[size*2]; for (int i = 0; i < Array.length; i++) { newArray[i] = Array[i]; } size = size * 2; Array = newArray; for (int j : newArray) { System.out.println(j + " "); } System.out.println(); } else { System.out.println("ArrayIndexOutOfBoundRange"); } } //Does not take ay parameter and returns the number of elements present in the dynamic array. public int size(){ return size; } //Does not take any parameter and returns the string representation of the dynamic array. public String toString(){ String s = Arrays.toString(Array); return s; } public static void main(String[] args) { Question1 obj = new Question1(); obj.add(1); obj.add(2); obj.add(3); obj.add(4); obj.pop(); obj.resize(); System.out.println("toString " + obj.toString()); System.out.println("The number of elements in the new Array is " + a); System.out.println("The size of the new Array is " + obj.size()); } }
[ "12190069.gcit@rub.edu.bt" ]
12190069.gcit@rub.edu.bt
29b64ed9ea38de14c98c139d10243457a1adc791
f9865347ab8b87d1fa46e234c3239bf8e664c2e4
/src/Code/AST/Node/ExprNode/BinaryExprNode.java
0e786cb8462373b54ec3d3df5e497c16a1ec8bcc
[]
no_license
TianBoyu/Mlang_Compiler
ddc29df1ca98b77f7e65624fb4a4e5f49e400aec
c33fffbe6dd38665e373106c69263b3ffed6d8da
refs/heads/master
2020-03-09T01:01:58.075822
2018-06-08T11:13:33
2018-06-08T11:13:33
128,503,270
1
0
null
null
null
null
UTF-8
Java
false
false
888
java
package Code.AST.Node.ExprNode; import Code.AST.Tools.BinaryOp; import Code.AST.Tools.Position; import Code.IR.IRTraversal; import Code.IR.IRUnit.Oprands.IntegerValue; import Code.SemanticCheck.ASTTraversal; public class BinaryExprNode extends ExprNode { public BinaryExprNode(Position _pos, ExprNode _lhs, ExprNode _rhs, BinaryOp _op) { super(_pos); lhs = _lhs; rhs = _rhs; op = _op; } public BinaryOp getOp() { return op; } public ExprNode getLhs() { return lhs; } public ExprNode getRhs() { return rhs; } private ExprNode lhs, rhs; private BinaryOp op; @Override public void accept(ASTTraversal visitor) { visitor.visit(this); } @Override public IntegerValue accept(IRTraversal visitor) { return visitor.visit(this); } }
[ "1012143610@qq.com" ]
1012143610@qq.com
c359c9ce020b3f5eb2e5653be47813590e4c2c6a
96f8d42c474f8dd42ecc6811b6e555363f168d3e
/budejie/sources/com/qq/e/comm/a.java
b8c1307dd31dda4c20ac8a11eb0329096b9349ef
[]
no_license
aheadlcx/analyzeApk
050b261595cecc85790558a02d79739a789ae3a3
25cecc394dde4ed7d4971baf0e9504dcb7fabaca
refs/heads/master
2020-03-10T10:24:49.773318
2018-04-13T09:44:45
2018-04-13T09:44:45
129,332,351
6
2
null
null
null
null
UTF-8
Java
false
false
18,648
java
package com.qq.e.comm; import android.content.Context; import android.content.Intent; import android.content.res.AssetManager; import com.ali.auth.third.core.rpc.protocol.RpcException.ErrorCode; import com.qq.e.comm.constants.Constants.PLUGIN; import com.qq.e.comm.constants.CustomPkgConstants; import com.qq.e.comm.managers.plugin.PM; import com.qq.e.comm.managers.setting.SM; import com.qq.e.comm.managers.status.APPStatus; import com.qq.e.comm.managers.status.DeviceStatus; import com.qq.e.comm.managers.status.SDKStatus; import com.qq.e.comm.util.AdError; import com.qq.e.comm.util.FileUtil; import com.qq.e.comm.util.GDTLogger; import com.qq.e.comm.util.StringUtil; import com.tencent.smtt.sdk.TbsReaderView.ReaderCallback; import com.umeng.analytics.pro.x; import com.umeng.update.UpdateConfig; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; import java.util.Map.Entry; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; import org.json.JSONException; import org.json.JSONObject; public class a { private String a; private com.qq.e.comm.managers.setting.a b; public a(String str, com.qq.e.comm.managers.setting.a aVar) { this.a = str; this.b = aVar; } public static AdError a(int i) { switch (i) { case 300: case 2001: return new AdError(2001, "初始化错误"); case 301: case 200101: return new AdError(2001, "初始化错误,详细码:200101"); case 302: case 200102: return new AdError(2001, "初始化错误,详细码:200102"); case 303: case 200103: return new AdError(2001, "初始化错误,详细码:200103"); case 400: case 403: case ErrorCode.SERVER_REQUESTDATAMISSED /*3001*/: return new AdError(ErrorCode.SERVER_REQUESTDATAMISSED, "网络异常"); case 404: case 4011: return new AdError(4011, "开屏广告拉取超时"); case 405: case 5007: return new AdError(5007, "资源加载错误"); case 406: case ReaderCallback.READER_PDF_LIST /*5008*/: return new AdError(ReaderCallback.READER_PDF_LIST, "图片加载错误"); case 500: case ErrorCode.SERVER_CREATEPROXYERROR /*4003*/: return new AdError(ErrorCode.SERVER_CREATEPROXYERROR, "广告位错误"); case 501: case ReaderCallback.SEARCH_SELECT_TEXT /*5004*/: return new AdError(ReaderCallback.SEARCH_SELECT_TEXT, "没有广告"); case 502: case ReaderCallback.HIDDEN_BAR /*5001*/: return new AdError(ReaderCallback.HIDDEN_BAR, "服务端数据错误"); case 600: case 4004: return new AdError(4004, "开屏广告容器不可见"); case 601: case 3003: return new AdError(3003, "网络类型错误,当前设备的网络类型不符合开屏广告的加载条件"); case 602: case ErrorCode.SERVER_REMOTEACCESSEXCEPTION /*4002*/: return new AdError(ErrorCode.SERVER_REMOTEACCESSEXCEPTION, "Manifest文件中Activity/Service/Permission的声明有问题"); case 603: case 200201: return new AdError(2002, "内部错误,详细码:200201"); case 604: case 200202: return new AdError(2002, "内部错误,详细码:200202"); case 606: case 4005: return new AdError(4005, "开屏广告容器的高度低于400dp"); case 607: case 4006: return new AdError(4006, "原生广告接口调用顺序错误,调用点击接口前未调用曝光接口"); case 608: case 4009: return new AdError(4009, "开屏广告的自定义跳过按钮尺寸小于3x3dp"); case 700: case ReaderCallback.SHOW_BAR /*5002*/: return new AdError(ReaderCallback.SHOW_BAR, "视频素材下载错误"); case 701: case ReaderCallback.COPY_SELECT_TEXT /*5003*/: return new AdError(ReaderCallback.COPY_SELECT_TEXT, "视频素材播放错误"); case 800: return new AdError(4012, "内容接口调用顺序错误,调用点击接口前未调用曝光接口"); case 2002: return new AdError(2002, "内部错误"); case ErrorCode.SERVER_REQUESTTIMEOUT /*4001*/: return new AdError(ErrorCode.SERVER_REQUESTTIMEOUT, "传入的参数有错误"); case 4008: return new AdError(4008, "设备方向不适合展示广告"); case ReaderCallback.READER_TOAST /*5005*/: case 109506: return new AdError(ReaderCallback.READER_TOAST, "广告请求量或者消耗等超过日限额,请明天再请求广告"); case ReaderCallback.SHOW_DIALOG /*5006*/: case 107030: return new AdError(ReaderCallback.SHOW_DIALOG, "包名校验错误,当前App的包名和广点通移动联盟官网注册的媒体包名不一致,因此无广告返回"); case ReaderCallback.READER_PPT_PLAY_MODEL /*5009*/: case 109507: return new AdError(ReaderCallback.READER_PPT_PLAY_MODEL, "广告请求量或者消耗等超过小时限额,请一小时后再请求广告"); case 107034: return new AdError(ReaderCallback.READER_TXT_READING_MODEL, "广告样式校验失败,请检查广告位与接口使用是否一致"); case 107035: return new AdError(4013, "使用支持视频素材的原生模板广告位前,请升级您的SDK"); case 400101: return new AdError(ErrorCode.SERVER_REQUESTTIMEOUT, "传入的参数有错误,详细码:" + i); case 400102: return new AdError(ErrorCode.SERVER_REQUESTTIMEOUT, "传入的参数有错误,详细码:" + i); case 400103: return new AdError(ErrorCode.SERVER_REQUESTTIMEOUT, "传入的参数有错误,详细码:" + i); case 400104: return new AdError(ErrorCode.SERVER_REQUESTTIMEOUT, "传入的参数有错误,详细码:" + i); default: return new AdError(ErrorCode.SERVER_SERVICENOTFOUND, "未知错误,详细码:" + i); } } public static JSONObject a(PM pm) throws JSONException { JSONObject jSONObject = new JSONObject(); jSONObject.putOpt("sdkv", SDKStatus.getSDKVersion()); jSONObject.putOpt("pv", Integer.valueOf(pm.getPluginVersion())); return jSONObject; } public static JSONObject a(SM sm) throws JSONException { JSONObject jSONObject = new JSONObject(); if (sm != null) { jSONObject.putOpt("suid", sm.getSuid()); jSONObject.putOpt("sid", sm.getSid()); } return jSONObject; } public static JSONObject a(APPStatus aPPStatus) throws JSONException { JSONObject jSONObject = new JSONObject(); if (aPPStatus != null) { jSONObject.putOpt(com.alipay.sdk.sys.a.i, aPPStatus.getAPPName()); jSONObject.putOpt("appkey", aPPStatus.getAPPID()); jSONObject.putOpt("appv", aPPStatus.getAPPVersion()); jSONObject.putOpt("appn", aPPStatus.getAPPRealName()); } return jSONObject; } public static JSONObject a(DeviceStatus deviceStatus) throws JSONException { JSONObject jSONObject = new JSONObject(); if (deviceStatus != null) { jSONObject.putOpt("so", deviceStatus.getScreenOrientation()); jSONObject.putOpt("dn", deviceStatus.getDataNet()); jSONObject.putOpt(x.ae, deviceStatus.getLat()); jSONObject.putOpt(x.af, deviceStatus.getLng()); for (Entry entry : deviceStatus.getLacAndCeilId().entrySet()) { jSONObject.putOpt((String) entry.getKey(), entry.getValue()); } } return jSONObject; } public static boolean a(Context context) { try { if (b(context)) { if (a(context, Class.forName(CustomPkgConstants.getADActivityName()))) { if (b(context, Class.forName(CustomPkgConstants.getDownLoadServiceName()))) { return true; } } } return false; } catch (Throwable th) { GDTLogger.e("Exception While check SDK Env", th); return false; } } public static boolean a(Context context, File file, File file2) { AssetManager assets = context.getAssets(); try { if (Arrays.binarySearch(assets.list(CustomPkgConstants.getAssetPluginDir()), CustomPkgConstants.getAssetPluginName()) < 0) { return false; } String str = CustomPkgConstants.getAssetPluginDir() + File.separator + CustomPkgConstants.getAssetPluginName(); StringUtil.writeTo("559#####" + PLUGIN.ASSET_PLUGIN_SIG, file2); if (StringUtil.isEmpty(CustomPkgConstants.getAssetPluginXorKey())) { return FileUtil.copyTo(assets.open(str), file); } InputStream open = assets.open(str); OutputStream fileOutputStream = new FileOutputStream(file); byte[] bytes = CustomPkgConstants.getAssetPluginXorKey().getBytes(); byte[] bArr = new byte[1024]; int length = bytes.length; int i = 0; int i2 = 0; while (true) { int read = open.read(bArr); if (read > 0) { int i3 = 0; while (i3 < read) { int i4 = i + 1; if (i >= 64) { i = i2 + 1; bArr[i3] = (byte) (bytes[i2 % length] ^ bArr[i3]); } else { i = i2; } i3++; i2 = i; i = i4; } fileOutputStream.write(bArr, 0, read); } else { open.close(); fileOutputStream.close(); return true; } } } catch (Throwable th) { GDTLogger.report("Exception while init default plugin manager", th); return false; } } private static boolean a(Context context, Class<?>... clsArr) { int i = 0; while (i <= 0) { try { Intent intent = new Intent(); intent.setClass(context, clsArr[0]); if (context.getPackageManager().resolveActivity(intent, 65536) == null) { GDTLogger.e(String.format("Activity[%s] is required in AndroidManifest.xml", new Object[]{clsArr[0].getName()})); return false; } i++; } catch (Throwable th) { GDTLogger.e("Exception while checking required activities", th); return false; } } return true; } public static byte[] a(byte[] bArr) { Exception e; Throwable th; byte[] bArr2 = null; if (bArr == null || bArr.length == 0) { return bArr; } OutputStream byteArrayOutputStream = new ByteArrayOutputStream(); GZIPOutputStream gZIPOutputStream; try { gZIPOutputStream = new GZIPOutputStream(byteArrayOutputStream); try { gZIPOutputStream.write(bArr); gZIPOutputStream.finish(); bArr2 = byteArrayOutputStream.toByteArray(); try { gZIPOutputStream.close(); byteArrayOutputStream.close(); return bArr2; } catch (Exception e2) { e2.printStackTrace(); return bArr2; } } catch (Exception e3) { e2 = e3; try { e2.printStackTrace(); if (gZIPOutputStream != null) { try { gZIPOutputStream.close(); } catch (Exception e22) { e22.printStackTrace(); return bArr2; } } byteArrayOutputStream.close(); return bArr2; } catch (Throwable th2) { th = th2; if (gZIPOutputStream != null) { try { gZIPOutputStream.close(); } catch (Exception e222) { e222.printStackTrace(); throw th; } } byteArrayOutputStream.close(); throw th; } } } catch (Exception e4) { e222 = e4; gZIPOutputStream = bArr2; e222.printStackTrace(); if (gZIPOutputStream != null) { gZIPOutputStream.close(); } byteArrayOutputStream.close(); return bArr2; } catch (Throwable th3) { gZIPOutputStream = bArr2; th = th3; if (gZIPOutputStream != null) { gZIPOutputStream.close(); } byteArrayOutputStream.close(); throw th; } } private static boolean b(Context context) { String[] strArr = new String[]{UpdateConfig.h, UpdateConfig.g, "android.permission.ACCESS_WIFI_STATE", "android.permission.READ_PHONE_STATE", UpdateConfig.f}; int i = 0; while (i < 5) { try { if (context.checkCallingOrSelfPermission(strArr[i]) == -1) { GDTLogger.e(String.format("Permission %s is required in AndroidManifest.xml", new Object[]{strArr[i]})); return false; } i++; } catch (Throwable th) { GDTLogger.e("Check required Permissions error", th); return false; } } return true; } private static boolean b(Context context, Class<?>... clsArr) { int i = 0; while (i <= 0) { try { Class cls = clsArr[0]; Intent intent = new Intent(); intent.setClass(context, cls); if (context.getPackageManager().resolveService(intent, 65536) == null) { GDTLogger.e(String.format("Service[%s] is required in AndroidManifest.xml", new Object[]{cls.getName()})); return false; } i++; } catch (Throwable th) { GDTLogger.e("Exception while checking required services", th); return false; } } return true; } public static byte[] b(byte[] bArr) { Exception e; Throwable th; byte[] bArr2 = null; if (bArr == null || bArr.length == 0) { return bArr; } InputStream byteArrayInputStream = new ByteArrayInputStream(bArr); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); byte[] bArr3 = new byte[1024]; GZIPInputStream gZIPInputStream; try { gZIPInputStream = new GZIPInputStream(byteArrayInputStream); while (true) { try { int read = gZIPInputStream.read(bArr3); if (read != -1) { byteArrayOutputStream.write(bArr3, 0, read); } else { byteArrayOutputStream.flush(); bArr2 = byteArrayOutputStream.toByteArray(); try { gZIPInputStream.close(); byteArrayInputStream.close(); byteArrayOutputStream.close(); return bArr2; } catch (Exception e2) { e2.printStackTrace(); return bArr2; } } } catch (Exception e3) { e2 = e3; } } } catch (Exception e4) { e2 = e4; gZIPInputStream = bArr2; try { e2.printStackTrace(); if (gZIPInputStream != null) { try { gZIPInputStream.close(); } catch (Exception e22) { e22.printStackTrace(); return bArr2; } } byteArrayInputStream.close(); byteArrayOutputStream.close(); return bArr2; } catch (Throwable th2) { th = th2; if (gZIPInputStream != null) { try { gZIPInputStream.close(); } catch (Exception e222) { e222.printStackTrace(); throw th; } } byteArrayInputStream.close(); byteArrayOutputStream.close(); throw th; } } catch (Throwable th3) { gZIPInputStream = bArr2; th = th3; if (gZIPInputStream != null) { gZIPInputStream.close(); } byteArrayInputStream.close(); byteArrayOutputStream.close(); throw th; } } public String a() { return this.a; } public com.qq.e.comm.managers.setting.a b() { return this.b; } }
[ "aheadlcxzhang@gmail.com" ]
aheadlcxzhang@gmail.com
13b808e16a54f3c8265111225d9130c1cb2370a8
bc896d6f88cd9d356e2bf32c20b6b4dd860498aa
/src/test/java/com/cg/mylinkedlist/LinkedListTest.java
76eb7dccf8cb2e7f0570645c675fac95c9ae2dab
[]
no_license
NCSaketh/MyLinkedList
63df9f7d0d89f8c21834ff718366cf4a2cd63017
101399ab0cb725b32fbe0ff957f980cf85cc97b5
refs/heads/main
2023-01-06T05:53:22.894828
2020-10-21T20:18:29
2020-10-21T20:18:29
305,482,586
0
0
null
null
null
null
UTF-8
Java
false
false
950
java
package com.cg.mylinkedlist; import org.junit.Assert; import org.junit.Test; public class LinkedListTest { MyLinkedList ll =new MyLinkedList(); @Test public void WhenSearchElementFound() { ll.append(56); ll.append(30); ll.append(70); Assert.assertTrue(ll.search(30)); } @Test public void WhenSearchElementNotFound() { ll.append(56); ll.append(30); ll.append(70); Assert.assertFalse(ll.search(15)); } @Test public void InsertElementAfterElement() { ll.append(56); ll.append(30); ll.append(70); ll.Insert(30, 40); Assert.assertTrue(ll.search(40)); } @Test public void DeleteElement() { ll.append(56); ll.append(30); ll.append(40); ll.append(70); ll.delete(40); Assert.assertFalse(ll.search(40)); Assert.assertEquals(ll.size(),3); } }
[ "nc.saketh1@gmail.com" ]
nc.saketh1@gmail.com
59a4b9c7a3002d3379a116c9fcf8df2f41104e6f
c1a4878e597758f621c09a10eff994ff5c72251e
/Project Defenses/nordgymproject/src/main/java/nordgym/service/SolariumSubscriptionServiceImpl.java
172e2a5d6f17590cd0f8c7591a217384335c5aa1
[]
no_license
nike799/Java-Frameworks-Spring
644eb285ffaa417972ebec721cbeb0e890710730
f8d49a8303c9829e4890a7a3ab9a65d288633be6
refs/heads/master
2020-04-26T08:18:30.743259
2019-03-28T16:01:34
2019-03-28T16:01:34
173,419,405
0
0
null
null
null
null
UTF-8
Java
false
false
171
java
package nordgym.service; import org.springframework.stereotype.Service; @Service public class SolariumSubscriptionServiceImpl implements SolariumSubscriptionService { }
[ "nagrozdanov@gmail.com" ]
nagrozdanov@gmail.com
2a3f3febc7fe61a1c3a2d13dc6e4a3f6a76f5b79
969bc6c5623a6596055e5aa07c663f1a670090d1
/src/main/java/cn/cns/jdbctemplatetutorial/JdbcTemplateTutorialApplication.java
d38017393ceb67e308a2c6eaad12b0ae37c8e9c2
[]
no_license
cnsapril/java-jdbc-tutorial
9cc34219f900532cd2352911b82629ebda139729
0e7df1cc30f78629c301189f694e9e81ec2bf24e
refs/heads/master
2020-03-28T10:54:47.856879
2018-09-10T13:20:03
2018-09-10T13:20:03
148,158,307
0
0
null
null
null
null
UTF-8
Java
false
false
686
java
package cn.cns.jdbctemplatetutorial; import cn.cns.jdbctemplatetutorial.dao.RuleValueDao; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext; @SpringBootApplication public class JdbcTemplateTutorialApplication { public static void main(String[] args) { ConfigurableApplicationContext ctx = SpringApplication.run(JdbcTemplateTutorialApplication.class, args); RuleValueDao ruleValueDao = ctx.getBeanFactory().getBean(RuleValueDao.class); boolean isInvalid = ruleValueDao.isLEOUInvalid("0036", "12345"); System.out.println(isInvalid); } }
[ "cnsapril@gmail.com" ]
cnsapril@gmail.com
ebe08a9b700e0f150d8f2e2c0778f270a93b5cbc
6a9d71c030e2ca83133e4b7fdb38c30ba697df7a
/shiro_system/src/main/java/com/example/polly/sys/spring/SpringCacheManagerWrapper.java
e1f066733a9db41eab627b9338d943bd6760c58e
[]
no_license
zhouxiantao1/shiro_system
4c6f98fb0f5d9f23b608958864997bb699c452af
ad87107cced1a0e5a85d1be32d239d62cc10edc6
refs/heads/master
2021-10-28T08:45:45.047618
2019-04-23T05:51:41
2019-04-23T05:51:41
107,916,771
0
0
null
null
null
null
UTF-8
Java
false
false
3,643
java
/** * Copyright (c) 2005-2012 https://github.com/zhangkaitao * * Licensed under the Apache License, Version 2.0 (the "License"); */ package com.example.polly.sys.spring; import net.sf.ehcache.Ehcache; import org.apache.shiro.cache.Cache; import org.apache.shiro.cache.CacheException; import org.apache.shiro.cache.CacheManager; import org.apache.shiro.util.CollectionUtils; import org.springframework.cache.support.SimpleValueWrapper; import java.util.*; /** * 包装Spring cache抽象 * <p>User: Zhang Kaitao * <p>Date: 13-3-23 上午8:26 * <p>Version: 1.0 */ public class SpringCacheManagerWrapper implements CacheManager { private org.springframework.cache.CacheManager cacheManager; /** * 设置spring cache manager * * @param cacheManager */ public void setCacheManager(org.springframework.cache.CacheManager cacheManager) { this.cacheManager = cacheManager; } public <K, V> Cache<K, V> getCache(String name) throws CacheException { org.springframework.cache.Cache springCache = cacheManager.getCache(name); return new SpringCacheWrapper(springCache); } static class SpringCacheWrapper implements Cache { private org.springframework.cache.Cache springCache; SpringCacheWrapper(org.springframework.cache.Cache springCache) { this.springCache = springCache; } public Object get(Object key) throws CacheException { Object value = springCache.get(key); if (value instanceof SimpleValueWrapper) { return ((SimpleValueWrapper) value).get(); } return value; } public Object put(Object key, Object value) throws CacheException { springCache.put(key, value); return value; } public Object remove(Object key) throws CacheException { springCache.evict(key); return null; } public void clear() throws CacheException { springCache.clear(); } public int size() { if(springCache.getNativeCache() instanceof Ehcache) { Ehcache ehcache = (Ehcache) springCache.getNativeCache(); return ehcache.getSize(); } throw new UnsupportedOperationException("invoke spring cache abstract size method not supported"); } public Set keys() { if(springCache.getNativeCache() instanceof Ehcache) { Ehcache ehcache = (Ehcache) springCache.getNativeCache(); return new HashSet(ehcache.getKeys()); } throw new UnsupportedOperationException("invoke spring cache abstract keys method not supported"); } public Collection values() { if(springCache.getNativeCache() instanceof Ehcache) { Ehcache ehcache = (Ehcache) springCache.getNativeCache(); List keys = ehcache.getKeys(); if (!CollectionUtils.isEmpty(keys)) { List values = new ArrayList(keys.size()); for (Object key : keys) { Object value = get(key); if (value != null) { values.add(value); } } return Collections.unmodifiableList(values); } else { return Collections.emptyList(); } } throw new UnsupportedOperationException("invoke spring cache abstract values method not supported"); } } }
[ "zhouxiantao@masget.com" ]
zhouxiantao@masget.com
96c310f3afd6ce3d3a820c94e689c896b1a43d17
0954505eb1859a04badcebec50a9780bf8ac3cc3
/soul-common/src/main/java/org/dromara/soul/common/enums/WafEnum.java
8b4aad298f6c65cc936ffc3e241f70b112e9d332
[ "Apache-2.0" ]
permissive
zkstudio/soul
22eddf2f21baffe7a1e7f23d2ea4ee10abd24bd7
fa5e56521d605680782f55e3fe017fe52ae6dc73
refs/heads/master
2020-12-05T19:49:49.262405
2020-08-17T05:32:32
2020-08-17T05:32:32
232,229,291
1
0
Apache-2.0
2020-08-17T05:32:34
2020-01-07T02:49:33
null
UTF-8
Java
false
false
1,225
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.dromara.soul.common.enums; import lombok.Getter; import lombok.RequiredArgsConstructor; /** * WafEnum. * * @author xiaoyu(Myth) */ @RequiredArgsConstructor @Getter public enum WafEnum { /** * Reject waf enum. */ REJECT(0, "reject"), /** * Allow waf enum. */ ALLOW(1, "allow"); private final int code; private final String name; }
[ "549477611@qq.com" ]
549477611@qq.com
ffedc59f8db2301ba5d05e570b1a77c70a0dfee5
488f894a30a6b51f76d31a28e81d880631218c36
/src/com/H2TFC/H2T_DMS_EMPLOYEE/models/Feedback.java
71e50a37fcbf4e0704e0ed1530d3208d7c97e4db
[]
no_license
quangminhlk1994/H2T_DMS_EMPLOYEE
005d42be96354e6fa1a7e2f1efc1b729e363bf18
5b2363b5bf2627faa9ff6229fae1045d7c43588a
refs/heads/master
2021-01-16T20:50:09.011191
2015-05-17T22:03:47
2015-05-17T22:03:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,647
java
package com.H2TFC.H2T_DMS_EMPLOYEE.models; import com.parse.ParseClassName; import com.parse.ParseObject; import com.parse.ParseQuery; /* * Copyright (C) 2015 H2TFC Team, LLC * thanhduongpham4293@gmail.com * nhatnang93@gmail.com * buithienduy93@gmail.com * All rights reserved */ @ParseClassName("Feedback") public class Feedback extends ParseObject { public static final String MOI_TAO = "MOI_TAO"; public static final String DANG_XEM_XET = "DANG_XEM_XET"; public static final String DA_XU_LY = "DA_XU_LY"; public void setTitle(String title) { put("title",title); } public String getTitle() { return getString("title"); } public void setDescription(String description) { put("description",description); } public String getDescription() { return getString("description"); } public void setStoreId(String storeId) { put("storeId",storeId); } public String getStoreId() { return getString("storeId"); } public void setStatus(String status) { put("status",status); } public String getStatus() { return getString("status"); } public static ParseQuery<Feedback> getQuery() { return ParseQuery.getQuery(Feedback.class); } public String getEmployeeId() { return getString("employee_id"); } public void setEmployeeId(String employeeId) { put("employee_id",employeeId); } public String getManagerId() { return getString("manager_id"); } public void setManagerId(String managerId) { put("manager_id",managerId); } }
[ "noobny2@gmail.com" ]
noobny2@gmail.com
041f44f5579ea1eed70fbe3be767d43779690ec0
28121b1314f6e365f895fffb6ebbaf1ecbc7694c
/capstone-android/app/src/main/java/org/coursera/capstone/android/fragment/DoctorPatientDetailsFragment.java
ec75d40293af134434a9361344f3bbac0b964e6b
[ "MIT" ]
permissive
karmats/capstone
c3fd109ef226f62113170c892cbff41aa59300f3
e8524f7511f50b34e56c848dacfda3af196ebbf9
refs/heads/master
2021-01-22T06:44:11.050973
2015-10-12T20:58:52
2015-10-12T20:58:52
25,123,594
0
0
null
null
null
null
UTF-8
Java
false
false
6,859
java
package org.coursera.capstone.android.fragment; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.view.PagerTabStrip; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import org.coursera.capstone.android.R; import org.coursera.capstone.android.animation.ScalePageTransformer; import org.coursera.capstone.android.parcelable.CheckInResponse; import org.coursera.capstone.android.parcelable.PainMedication; import org.coursera.capstone.android.parcelable.Patient; import java.util.ArrayList; import java.util.List; import java.util.Locale; public class DoctorPatientDetailsFragment extends Fragment { private static String PATIENT_PARAM = "patient_param"; private static String PAIN_MEDICATIONS_PARAM = "pain_medications_param"; private static String CHECK_INS_PARAM = "check_ins_param"; private static String DOCTOR_PATIENTS_PARAM = "doctor_patients_param"; private Patient mPatient; private ArrayList<PainMedication> mAllPainMedications; private ArrayList<CheckInResponse> mCheckIns; private ArrayList<Patient> mDoctorPatients; SectionsPagerAdapter mSectionsPagerAdapter; /** * The {@link ViewPager} that will host the section contents. */ ViewPager mViewPager; public static DoctorPatientDetailsFragment newInstance(Patient patient, ArrayList<PainMedication> painMedications, ArrayList<CheckInResponse> checkIns, ArrayList<Patient> doctorPatients) { DoctorPatientDetailsFragment fragment = new DoctorPatientDetailsFragment(); Bundle args = new Bundle(); args.putParcelable(PATIENT_PARAM, patient); args.putParcelableArrayList(PAIN_MEDICATIONS_PARAM, painMedications); args.putParcelableArrayList(CHECK_INS_PARAM, checkIns); args.putParcelableArrayList(DOCTOR_PATIENTS_PARAM, doctorPatients); fragment.setArguments(args); return fragment; } public DoctorPatientDetailsFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mPatient = getArguments().getParcelable(PATIENT_PARAM); mAllPainMedications = getArguments().getParcelableArrayList(PAIN_MEDICATIONS_PARAM); mCheckIns = getArguments().getParcelableArrayList(CHECK_INS_PARAM); mDoctorPatients = getArguments().getParcelableArrayList(DOCTOR_PATIENTS_PARAM); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreate(savedInstanceState); View v = inflater.inflate(R.layout.activity_doctor_patient_details_fragment, container, false); // Create the adapter that will return a fragment for each of the three // primary sections of the activity. mSectionsPagerAdapter = new SectionsPagerAdapter(getActivity().getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) v.findViewById(R.id.pager); mViewPager.setAdapter(mSectionsPagerAdapter); mViewPager.setPageTransformer(false, new ScalePageTransformer()); PagerTabStrip pagerTabStrip = (PagerTabStrip) v.findViewById(R.id.pager_title_strip); pagerTabStrip.setTabIndicatorColor(getResources().getColor(R.color.pager_tab_indicator)); TextView patientName = (TextView) v.findViewById(R.id.doctor_patient_details_name); patientName.setText(mPatient.getFirstName() + " " + mPatient.getLastName()); // Check if the latest check-in has alerts List<String> latestCheckInAlerts = mCheckIns.size() > 0 ? mCheckIns.get(0).getAlerts() : null; if (latestCheckInAlerts != null && !latestCheckInAlerts.isEmpty()) { String alertString = ""; for (String alert : latestCheckInAlerts) { alertString += alert + "\n"; } TextView statusTitle = (TextView) v.findViewById(R.id.doctor_patient_status_title); statusTitle.setText(getString(R.string.doctor_patient_status_alert_title)); TextView statusText = (TextView) v.findViewById(R.id.doctor_patient_status_text); statusText.setText(alertString); ImageView statusImage = (ImageView) v.findViewById(R.id.doctor_patient_status_icon); statusImage.setImageResource(R.drawable.ic_alert); } return v; } /** * A {@link FragmentPagerAdapter} that returns a fragment corresponding to * one of the sections/tabs/pages. */ public class SectionsPagerAdapter extends FragmentStatePagerAdapter { private static final int TOTAL_PAGES = 2; private static final int CHECK_IN_PAGE = 0; private static final int MEDICATIONS_PAGE = 1; private ListCheckInsFragment mCheckInsFragment; private UpdateMedicationsFragment mMedicationsFragment; public SectionsPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { // getItem is called to instantiate the fragment for the given page. switch (position) { case CHECK_IN_PAGE: if (mCheckInsFragment == null) { mCheckInsFragment = ListCheckInsFragment.newInstance(mCheckIns); } return mCheckInsFragment; case MEDICATIONS_PAGE: if (mMedicationsFragment == null) { mMedicationsFragment = UpdateMedicationsFragment.newInstance(mPatient, mAllPainMedications, mDoctorPatients.contains(mPatient)); } return mMedicationsFragment; default: return null; } } @Override public int getCount() { return TOTAL_PAGES; } @Override public CharSequence getPageTitle(int position) { Locale l = Locale.getDefault(); switch (position) { case CHECK_IN_PAGE: return getString(R.string.doctor_patient_check_ins_title).toUpperCase(l); case MEDICATIONS_PAGE: return getString(R.string.doctor_patient_medications_title).toUpperCase(l); } return null; } } }
[ "karmats@gmail.com" ]
karmats@gmail.com
ceeb37a7ef893de06fffd54a4c57790a4f26f353
e60d7652bacb7a2cff2c40f60b5544b2fb9aab10
/target/generated-sources/entity-codegen/extensions/pc/internal/domain/policy/impl/WCRatingStepExtInternal.java
f25aa2a9d3aa3da0fb153db1f6ff1d717c187522
[]
no_license
ezsaidi/configuration
19fa3bf70982529e5cdf5d7f3d99eb7b0d7971d5
e22a485d1f5376005c72fd073a474fa685fcf6a6
refs/heads/master
2022-04-12T05:15:58.490259
2018-07-11T00:18:50
2018-07-11T00:18:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package extensions.pc.internal.domain.policy.impl; import extensions.pc.internal.domain.policy.gen.WCRatingStepExtInternalStubI; import extensions.pc.policy.entity.WCRatingStepExt; public interface WCRatingStepExtInternal extends WCRatingStepExtInternalStubI, WCRatingStepExt { }
[ "riteshvishu@hotmail.com" ]
riteshvishu@hotmail.com
e7b08af7ad6d77f6ff35478bd49ed03769c74a6b
806195b596b8c3bfabb79c3320fb001f486badc7
/src/main/com/kenshinji/Lesson4/PermCheck.java
ce9f5ac71d340beb2f630ca609bd98787023b1f9
[ "MIT" ]
permissive
kenshinji/CodilitySolutions
6e18d04c6f361babff50487f572fdd75559164f0
2ca12d5b0fafe5f1d936e1bd72a2c576dda8ec75
refs/heads/master
2021-10-29T12:11:23.142514
2021-10-16T14:23:43
2021-10-16T14:23:43
39,059,878
4
1
MIT
2021-10-16T14:23:44
2015-07-14T07:13:01
Java
UTF-8
Java
false
false
1,632
java
package com.kenshinji.Lesson4; /* * A non-empty zero-indexed array A consisting of N integers is given. * A permutation is a sequence containing each element from 1 to N once, and only once. * For example, array A such that: * A[0] = 4 * A[1] = 1 * A[2] = 3 * A[3] = 2 * is a permutation, but array A such that: * A[0] = 4 * A[1] = 1 * A[2] = 3 * is not a permutation, because value 2 is missing. * The goal is to check whether array A is a permutation. * Write a function: * class Solution { public int solution(int[] A); } * that, given a zero-indexed array A, returns 1 if array A is a permutation and 0 if it is not. * For example, given array A such that: * A[0] = 4 * A[1] = 1 * A[2] = 3 * A[3] = 2 * the function should return 1. * Given array A such that: * * A[0] = 4 * A[1] = 1 * A[2] = 3 * the function should return 0. * Assume that: * N is an integer within the range [1..100,000]; * each element of array A is an integer within the range [1..1,000,000,000]. * Complexity: * expected worst-case time complexity is O(N); * expected worst-case space complexity is O(N), beyond input storage (not counting the storage required for input arguments). * Elements of input arrays can be modified. */ public class PermCheck { public static int solution(int[] A) { boolean[] countArray = new boolean[A.length]; for (int i = 0; i < A.length; i++) { if (A[i] - 1 < A.length) countArray[A[i] - 1] = true; } for (int i = 0; i < countArray.length; i++) { if (countArray[i] == false) return 0; } return 1; } }
[ "gundam0083ster@gmail.com" ]
gundam0083ster@gmail.com
0e6e6fbd5e04540a301619bf9c8493eb21b47447
f7905aef52db2ffdcc0117782e74ac5122c0ed3d
/src/test/java/com/vodafone/crud/service/DataServicesImplTestReal.java
766132651c03f1d0ba8f8b09e7fe75d07ce4bec6
[]
no_license
tkgeeth/Restful_Service
cfab28ba257c88677ddcd6f9e8f9dadd1e2ee2e5
683f423ebbc941791401618f0e2f251ef9686e07
refs/heads/master
2023-04-14T02:19:53.681702
2023-04-01T21:22:58
2023-04-01T21:22:58
39,765,023
4
5
null
2023-04-01T21:22:59
2015-07-27T09:03:40
Java
UTF-8
Java
false
false
2,187
java
/** * */ package com.vodafone.crud.service; import static org.junit.Assert.assertNotNull; import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.web.context.WebApplicationContext; import com.vodafone.crud.dto.CustomerDto; /** * @author Geeth * */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath:spring-config.xml"}) @WebAppConfiguration public class DataServicesImplTestReal { @Autowired protected WebApplicationContext webApplicationContext; @Autowired private DataServices dataServices; @Test public void addEntityTest() { CustomerDto dto = new CustomerDto(); dto.setName("ABC11"); dto.setAddress("Address11"); dto.setPhoneNumber("324324343411"); try { dto=dataServices.addEntity(dto); System.out.println(dto.toString()); assertNotNull(dto); } catch (Exception e) { e.printStackTrace(); assert(false); } } @Test public void updateEntityTest() { CustomerDto dto = new CustomerDto(); dto.setId(1); dto.setName("ABC"); dto.setAddress("Address"); dto.setPhoneNumber("3243243434"); try { dataServices.updateEntity(dto); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Test public void deleteEntityTest() { try { dataServices.deleteEntity(3); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Test public void getEntityListTest() { try { List<CustomerDto> list =dataServices.getEntityList(); for(CustomerDto dto:list){ System.out.println(dto.getId()); System.out.println(dto.getName()); System.out.println(dto.getAddress()); System.out.println(dto.getPhoneNumber()); System.out.println("**************************"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "geethlochana@gmail.com" ]
geethlochana@gmail.com
5a3fab8a1f34dca4737514e88c4a346ce381f8b7
395bff0929bfce7b3ec8ca776c60c37e58f47320
/app/src/main/java/com/example/denis/lab4ejercicio3/delActivity.java
2cab5bb5bf46fc998bb8968273b9a85c63884f3a
[]
no_license
DenisPerdomo/Lab4Ejercicio3
b27ebe082e40ffe7379f3e8a6e1bf1ab6691dcdb
617fc8e7b6e7fcf9591143a601d2fccd8330c11e
refs/heads/master
2021-01-20T11:41:54.317452
2017-03-16T23:48:14
2017-03-16T23:48:14
85,251,710
0
0
null
null
null
null
UTF-8
Java
false
false
1,282
java
package com.example.denis.lab4ejercicio3; import android.database.sqlite.SQLiteDatabase; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.Toast; public class delActivity extends AppCompatActivity { private EditText etCod; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_del); etCod = (EditText) findViewById(R.id.etCod); } public void del (View v){ AdminSQLiteOpenHelper admin = new AdminSQLiteOpenHelper(this, "administracion", null, 1); SQLiteDatabase bd = admin.getWritableDatabase(); String id = etCod.getText().toString(); int num = bd.delete("articulos", "codigo="+id, null); bd.close(); etCod.setText(""); if (num == 1){ Toast.makeText(this, "Se ha eliminado el articulo código = "+id, Toast.LENGTH_SHORT).show(); }else{ Toast.makeText(this, "No existe el articulo con codigo "+id, Toast.LENGTH_SHORT).show(); } } public void clean (View v){ etCod.setText(""); } public void back (View v){ finish(); } }
[ "denis.perdomo.p@gmail.com" ]
denis.perdomo.p@gmail.com
7099b682c47c149aaff500a319b15663190aa8ec
4dfe3838dd12d3b059601c29fd18e7bfcb036fd0
/src/main/java/com/emc/procheck/rule/model/RuleManager.java
60d9dce491e502e60f311fbf843e1987b57974c2
[]
no_license
vamcily/proactive_healthcheck
ed77d5134b51fa9e01b274177c1b5485f581ef4d
b3dffd088dacd63f250c9daaeafcd7a127fcb5e0
refs/heads/master
2020-03-30T07:39:03.332703
2016-05-17T09:21:59
2016-05-17T09:21:59
57,112,955
1
0
null
2016-05-17T09:22:00
2016-04-26T08:53:05
Java
UTF-8
Java
false
false
5,356
java
/** * */ package com.emc.procheck.rule.model; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.codehaus.jackson.map.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.emc.procheck.config.CommonHealthCheckConfig; import com.emc.procheck.postgres.multitenancy.TenantService; import com.emc.procheck.rule.service.RuleResultService; import com.emc.procheck.storage.model.Event; import com.emc.procheck.storage.service.EventService; /** * @author Eric Wu * */ @Component public class RuleManager { private final static Logger logger = LoggerFactory.getLogger(RuleManager.class); @Autowired private RuleFactory ruleFactory; @Autowired private CommonHealthCheckConfig hcConfig; @Autowired private TenantService tenantService; @Autowired private EventService eventService; @Autowired private RuleResultService ruleResultService; private final String HEALTH_SCORE_FILE = "/health_tree.json"; public RuleManager() { } public List<IRule> getRules() { return ruleFactory.getRules(); } public List<RuleResult> runRulesBySn(String sn) { String systemKey = null; Event event = eventService.findLatestBySerialNumber(sn); if (event != null) systemKey = event.getSystemKey(); logger.debug("Got the latest systemKey[" + systemKey + "] by sn[" + sn + "]"); List<RuleResult> results = runRulesBySystemKey(systemKey); StorageComponent comp = constructHealthComponent(sn); event.setScore(comp.getScore()); eventService.save(event); return results; } public List<RuleResult> runRulesBySystemKey(String systemKey) { if (systemKey == null) { logger.error("Ignored healthcheck because systemKey is null."); return null; } String tenant = tenantService.getCurrentTenant(); List<IRule> rules = ruleFactory.getRules(); ExecutorService executorService = Executors.newCachedThreadPool(); for (IRule rule : rules) { executorService.submit(new Runnable() { @Override public void run() { tenantService.setCurrentTenant(tenant); rule.check(systemKey); } }); } try { logger.info("Wait all task completion and shutdown executor."); executorService.shutdown(); executorService.awaitTermination(hcConfig.getRuleTimeout(), TimeUnit.MINUTES); } catch (InterruptedException e) { logger.error("Tasks interrupted", e); } finally { if (!executorService.isTerminated()) { logger.error("Cancel non-finished tasks"); executorService.shutdownNow(); } logger.info("Shutdown finished"); } // Persist rule result List<RuleResult> results = new ArrayList<RuleResult>(); for (IRule rule : rules) { ruleResultService.save(rule.getResult()); results.add(rule.getResult()); } return results; } public StorageComponent constructHealthComponent(String serialNumber) { StorageComponent comp = loadHealthComponent(); loadHealthCheckResult(comp, serialNumber); return comp; } public StorageComponent loadHealthComponent() { ObjectMapper objectMapper = new ObjectMapper(); StorageComponent comp = null; URL htConfig = getClass().getResource(HEALTH_SCORE_FILE); if (htConfig == null) { logger.error("Cannot load health tree " + HEALTH_SCORE_FILE); } File htFile; try { htFile = new File(htConfig.toURI()); InputStream htStream = new FileInputStream(htFile); comp = objectMapper.readValue(htStream, StorageComponent.class); } catch (Exception e) { logger.error("Failed to load health tree config.", e); } return comp; } private void loadHealthCheckResult(StorageComponent component, String serialNumber) { if (component.getChildren() == null) { loadRuleResult(component, serialNumber); return; } double score = 0; for(StorageComponent child : component.getChildren()) { loadHealthCheckResult(child, serialNumber); score += child.getScore() * child.getWeight(); if (child.getActions() != null) { component.addActions(child.getActions()); } } component.setScore((int) score); } private void loadRuleResult(StorageComponent component, String serialNumber) { // We only have rules for Software now, use default value in json file if ( !"Software".equals(component.getName()) && !"Disk".equals(component.getName()) ) { return; } List<RuleResult> results = ruleResultService.findLatestRuleResults(component.getName(), serialNumber); double score = 0; double totalWeight = 0; for (RuleResult result : results) { score += result.getScore() * result.getWeight(); totalWeight += result.getWeight(); if (result.getActions() != null) { component.addActions(result.getActions()); } } /* * In case the summarized rule weight is not 1.0 considering * - The rules are selectable so we would only have a sub-set of rules * - New rules could be added without affecting weight of exising rules */ score /= totalWeight; component.setScore((int)score); } }
[ "vamcily@gmail.com" ]
vamcily@gmail.com
20ba1b3335072113b5874c10300001d71251fde7
fb5bfb5b4cf7a118cb858490953e69517d8060a4
/src/ch21/ex40/exercise/ReaderWriterMap.java
2eac172820a8a839fe3335146efbfa9b1fb6b607
[]
no_license
v777779/jbook
573dd1e4e3847ed51c9b6b66d2b098bf8eb58af5
09fc56a27e9aed797327f01ea955bdf1815d0d54
refs/heads/master
2021-09-19T08:14:16.299382
2018-07-25T14:03:12
2018-07-25T14:03:12
86,017,001
0
0
null
null
null
null
UTF-8
Java
false
false
1,340
java
package ch21.ex40.exercise; import lib.generate.GenRnd; import lib.generate.GenSeq; import lib.utils.MapData; import java.util.HashMap; import java.util.Map; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; /** * Vadim Voronov * Created: 14-May-17. * email: vadim.v.voronov@gmail.com */ public class ReaderWriterMap<K,V> { private HashMap<K,V> lockedMap; private ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true); public ReaderWriterMap(int size) { this.lockedMap = new HashMap<K, V>((Map)MapData.get(new GenSeq.GenInt(),new GenRnd.GenInt(),size)); } public V set(K key, V value) { Lock wlock = lock.writeLock(); // новый writeLock на запись wlock.lock(); try { return lockedMap.put(key,value); } finally { wlock.unlock(); } } public V get(K key) { Lock rlock = lock.readLock(); // новый readLock на запись rlock.lock(); try { if (lock.getReadLockCount() > 1) { System.out.println(lock.getReadLockCount()); // несколько задач получают readLock() } return lockedMap.get(key); } finally { rlock.unlock(); } } }
[ "vadim.v.voronov@gmail.com" ]
vadim.v.voronov@gmail.com
d5cfeca1b21bdd0cebe0b1f8c1b3319ce3c31ae1
5ae03054a00e1c0301762545eaecbbc0008cd6ae
/Week_05/learn-spring-data-jdbc/src/main/java/learn/spring/data/jdbc/JdbcDemo.java
82a8b0ab0bf4a9aa01ac855b0f82855209230acb
[]
no_license
ykthree/JAVA-000
4c8bf04dd6b93b6c6bd333f3dde67ca1853469b2
0c5300a90330f940aba80133bc4c317c9ffc236e
refs/heads/main
2023-02-26T14:57:58.892705
2021-02-05T13:20:07
2021-02-05T13:20:07
303,141,299
3
0
null
2020-10-11T14:38:45
2020-10-11T14:38:45
null
UTF-8
Java
false
false
6,016
java
package learn.spring.data.jdbc; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Repository; import javax.annotation.PostConstruct; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; /** * 使用原生 JDBC 操作数据库 * * @author ykthree * 2020/11/17 21:09 */ @Repository @Slf4j public class JdbcDemo { @Value("${spring.datasource.driver}") private String driver; @Value("${spring.datasource.url}") private String url; @Value("${spring.datasource.username}") private String username; @Value("${spring.datasource.password}") private String password; @PostConstruct private void init() { try { Class.forName(driver); } catch (ClassNotFoundException e) { e.printStackTrace(); } } /** * 根据 ID 查询 * * @param id id * @return Foo */ public Foo selectById(int id) { Foo foo = null; // 查询语句 String selectSql = "SELECT ID, NAME FROM FOO WHERE ID = ?"; try ( Connection connection = DriverManager.getConnection(url, username, password); PreparedStatement prepareStatement = connection.prepareStatement(selectSql); ) { prepareStatement.setInt(1, id); try (ResultSet resultSet = prepareStatement.executeQuery()) { while (resultSet.next()) { foo = new Foo(); foo.setId(resultSet.getInt(1)); foo.setName(resultSet.getString(2)); } } } catch (SQLException e) { e.printStackTrace(); } return foo; } /** * 根据 ID 删除 Foo * * @param id id */ public void deleteById(int id) { // 删除语句 String deleteSql = "DELETE FROM FOO WHERE ID = ?"; try ( Connection connection = DriverManager.getConnection(url, username, password); PreparedStatement prepareStatement = connection.prepareStatement(deleteSql); ) { prepareStatement.setInt(1, id); prepareStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } /** * 新增 Foo * * @param foo Foo */ public void insert(Foo foo) { if (foo == null) { return; } // 新增语句 String insertSql = "INSERT INTO FOO(ID, NAME) VALUES(?, ?)"; try ( Connection connection = DriverManager.getConnection(url, username, password); PreparedStatement prepareStatement = connection.prepareStatement(insertSql); ) { prepareStatement.setInt(1, foo.getId()); prepareStatement.setString(2, foo.getName()); prepareStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } /** * 更新 Foo * * @param foo Name */ public void update(Foo foo) { if (foo == null) { return; } // 更新语句 String updateSql = "UPDATE FOO SET NAME = ? WHERE ID = ?"; try ( Connection connection = DriverManager.getConnection(url, username, password); PreparedStatement prepareStatement = connection.prepareStatement(updateSql); ) { prepareStatement.setString(1, foo.getName()); prepareStatement.setInt(2, foo.getId()); prepareStatement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } /** * 批量新增 Foo * * @param fooList Foo 列表 */ public void batchInsert(List<Foo> fooList) { if (fooList == null || fooList.isEmpty()) { return; } // 新增语句 String insertSql = "INSERT INTO FOO(ID, NAME) VALUES(?, ?)"; try ( Connection connection = DriverManager.getConnection(url, username, password); PreparedStatement prepareStatement = connection.prepareStatement(insertSql); ) { // 关闭自动提交 connection.setAutoCommit(false); for (Foo foo : fooList) { prepareStatement.setInt(1, foo.getId()); prepareStatement.setString(2, foo.getName()); prepareStatement.addBatch(); } prepareStatement.executeBatch(); connection.commit(); } catch (SQLException e) { e.printStackTrace(); } } /** * rollback * * @param fooList fooList */ public void batchInsertWithTransaction(List<Foo> fooList) { if (fooList == null || fooList.isEmpty()) { return; } // 新增语句 String insertSql = "INSERT INTO FOO(ID, NAME) VALUES(?, ?)"; try ( Connection connection = DriverManager.getConnection(url, username, password); PreparedStatement prepareStatement = connection.prepareStatement(insertSql); ) { // 关闭自动提交 connection.setAutoCommit(false); try { for (Foo foo : fooList) { prepareStatement.setInt(1, foo.getId()); prepareStatement.setString(2, foo.getName()); prepareStatement.addBatch(); } prepareStatement.executeBatch(); connection.commit(); } catch (SQLException e) { log.error("数据新增错误", e); connection.rollback(); } } catch (SQLException e) { e.printStackTrace(); } } }
[ "ykthree@outlook.com" ]
ykthree@outlook.com
5733298d4f04a6776736839a18567b052d4de54e
4fd8191a8e26a87bf221b3c14fa4af9fa2147d52
/core-app/src/main/java/com/myautoconfiguration/coreapp/CoreAppApplication.java
1d2d143843f705d8f4d79bae144438ec0b3d8bfb
[]
no_license
WilliamEvan/my-learning
a1537755b975faa01c369048dab7b07dd6e48a43
b1379acb74df0826c61cbf024442794bbefb2726
refs/heads/master
2022-11-22T22:49:18.481511
2020-07-27T05:45:29
2020-07-27T05:45:29
277,263,634
1
0
null
null
null
null
UTF-8
Java
false
false
326
java
package com.myautoconfiguration.coreapp; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class CoreAppApplication { public static void main(String[] args) { SpringApplication.run(CoreAppApplication.class, args); } }
[ "49153689+496943@users.noreply.github.com" ]
49153689+496943@users.noreply.github.com
428b167d69ca5ebb90c7d7ed3023d071efe8ef3a
2f7ecc75bc13ef9e49ca1994a84c4400053b08c9
/src/com/javarush/test/level08/lesson11/bonus02/Solution.java
98ce35a8fb622d08ebdf3567e2cadeeeaaf1b1d0
[]
no_license
BogdanKartawcew/JavaRushHomeWork
d47574392db5c4720245dec08d8ea0b896138402
70bf310ed564293c1855a2650197bff74dce2271
refs/heads/master
2021-01-01T20:22:06.234055
2018-01-30T19:58:33
2018-01-30T19:58:33
80,110,449
1
0
null
null
null
null
UTF-8
Java
false
false
1,568
java
package com.javarush.test.level08.lesson11.bonus02; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; /* Нужно добавить в программу новую функциональность Задача: Программа определяет, какая семья (фамилию) живёт в доме с указанным номером. Новая задача: Программа должна работать не с номерами домов, а с городами: Пример ввода: Москва Ивановы Киев Петровы Лондон Абрамовичи Лондон Пример вывода: Абрамовичи */ public class Solution { public static void main(String[] args) throws IOException {BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); HashMap<String, String> map = new HashMap<String, String>(); while (true) { String city = reader.readLine(); if (city.equals(""))break; String lastname = reader.readLine(); if (lastname.equals("")) break; else { map.put(city, lastname); } } String vvid = reader.readLine(); for(Map.Entry<String, String> pair : map.entrySet()){ if(vvid.equals(pair.getKey())) System.out.println(pair.getValue()); else continue; } } }
[ "kartawcew.b@gmail.com" ]
kartawcew.b@gmail.com
720b4dfd4cdd9dd930374e643389bb2f16c7f337
b926dbf63f7273d81e999983f5ef7cc6d05d30bc
/src/element/ScoreComparator.java
e0c479a021a847e5f823847c8cac8f89c3636b4a
[]
no_license
lroyyy/mineSweeper
5a0c9164eb7e19832d080ba766e9b3f49a242240
7035b9995d617e7e18afdc5b9d391c1ecf9c634e
refs/heads/master
2022-06-01T18:30:25.684650
2020-04-27T13:51:31
2020-04-27T13:51:31
259,336,513
0
0
null
null
null
null
GB18030
Java
false
false
622
java
package element; import java.util.Comparator; /** * @author zhengfei.fjhg * <p> * 排序规则:<br> * 达成时间相同,耗时小的大 */ public class ScoreComparator implements Comparator<Score> { @Override public int compare(Score s1, Score s2) { if (s1.getConsumingTime() < s2.getConsumingTime()) { return -1; } else if (s1.getConsumingTime() > s2.getConsumingTime()) { return 1; } else { if (s1.getDate().compareTo(s2.getDate()) < 0) { return -1; } else if (s1.getDate().compareTo(s2.getDate()) > 0) { return 1; } else { return 0; } } } }
[ "lroy@163.com" ]
lroy@163.com
cb4f1a29de455b3d6ebc16670c78d47e2d891ded
b58698c622504f5028ae29c7b728acc8b3cf8e45
/src/test/java/ucf/assignments/importfilesTest.java
0902254833ea3878abf0dc09e1274108741e20aa
[]
no_license
goodwinalexjr/goodwin-cop3330-assignment4part2
29b46592b5eeb62a55c7a0fe87d9d2fc2484f8c0
9cca0afcb261d83c34b37ea016bb024455703e62
refs/heads/master
2023-06-13T06:05:28.165264
2021-07-12T03:08:58
2021-07-12T03:08:58
385,026,091
0
0
null
null
null
null
UTF-8
Java
false
false
241
java
/* * UCF COP3330 Summer 2021 Assignment 4 Solution * Copyright 2021 Alex Goodwin */ package ucf.assignments; import static org.junit.jupiter.api.Assertions.*; class importfilesTest { //assert that the import is in the new list }
[ "goodwinalexjr@knights.ucf.edu" ]
goodwinalexjr@knights.ucf.edu
3964b0fa78520d8869ea46ed85528f55822bee59
c203fb43c1ef0eb1eb6ee3c1ce61956cdd63c1c2
/ProjectAndroid/app/src/main/java/com/exampleandroiddemottest/petagramrecyclerview/fragment/IFragment_DetallePets.java
103c510b20e8c5c9cb3dd7d74bd5ebfc91b7932d
[]
no_license
michaeljav/Curso4Sem3Asig2Final
0f70192e6fa72ea6ef4a142a8d38f246680a9017
93da473e4674fb5bff6c420e62ae26c51dfa54b4
refs/heads/master
2020-03-27T16:27:07.058878
2018-08-30T17:43:57
2018-08-30T17:43:57
146,783,699
0
0
null
null
null
null
UTF-8
Java
false
false
594
java
package com.exampleandroiddemottest.petagramrecyclerview.fragment; import com.exampleandroiddemottest.petagramrecyclerview.adapter.PetsAdapter; import com.exampleandroiddemottest.petagramrecyclerview.pojo.Mascota; import com.mikhaellopez.circularimageview.CircularImageView; import java.util.ArrayList; public interface IFragment_DetallePets { public void generarLinearLayoutGrid(); public void imagenCircular(CircularImageView civ); public PetsAdapter crearAdaptador(ArrayList<Mascota> pets); public void inicializarOSetAdapterAlRecyclerView(PetsAdapter petsAdapter); }
[ "michaeljaviermota@gmail.com" ]
michaeljaviermota@gmail.com
8fa59f95b15836287aa2f6007001790d2000ea0c
f9d45a0e6b64ded98d3a56ec8e0ce5eb25d5cdb8
/jshop/filters/ConvolutionFilter.java
a35eaf2ca33be0bef9fdaf92eca05d1f54a0c789
[]
no_license
tilli/jshop
1ba3d2ffd6eac3540b070bc7b5b3aa8b8f90aa47
6b036d6e8ae514182e1df2f2d607a3e5b84cc117
refs/heads/master
2016-09-06T10:07:05.638482
2011-11-04T16:48:00
2011-11-04T16:48:00
2,710,627
0
0
null
null
null
null
UTF-8
Java
false
false
7,769
java
package jshop.filters; import jshop.filters.kernel.Kernel; /** * Image filter which performs convolution operations. Not finished, borders are * not working correctly * * @see Kernel * @author Timo Ohtonen */ // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.BCF4D770-AE1E-F88B-A0C6-863627F3912E] // </editor-fold> public class ConvolutionFilter extends ImageDataCollector { // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.B64594EA-964F-CDF8-E04D-0105EBFFB690] // </editor-fold> private static final long serialVersionUID = 4251934204332522879L; // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.A0139A0E-E758-B486-C182-5E6EA2A2F6AD] // </editor-fold> private Kernel kernel; // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.EB38D330-C2B2-14FB-856C-391BB3E79C97] // </editor-fold> private int hints = 0; /** * Extends the edges with the value in the border */ // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.D07634F3-CE70-10A5-6A8D-1658B8358494] // </editor-fold> public static final int EXTEND_EDGES = 0; /** * Mirrors the extended edges from the image */ // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.15C5D3E8-B506-08DA-72B0-E4C7FD230372] // </editor-fold> public static final int MIRROR_EDGES = 1; /** * Performs no operation to the edges */ // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.1FF4B27F-2B99-17DB-7ECC-012C74F69666] // </editor-fold> public static final int FORGET_EDGES = 2; /** * Sets the edges to 0 */ // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.12567C8E-A74F-0AB7-1C0F-1C72A50F9D98] // </editor-fold> public static final int ZERO_EDGES = 3; /** * Creates an empty <code>ConvolutionFilter</code> */ // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.A824CBE3-FE4D-1CC7-0BC5-2E33F04CD8FB] // </editor-fold> public ConvolutionFilter() { kernel = new Kernel(); } /** * Creates a <code>ConvolutionFilter</code> with specified * <code>Kernel</code> * @param kernel */ // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.089E4EE5-AC1C-8FE7-DA8C-9BF834CE4F98] // </editor-fold> public ConvolutionFilter(Kernel kernel) { this.kernel = kernel; } /** * Sets a new <code>Kernel</code> * @param kernel */ // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.871A4830-C498-0C14-A6AC-806C91090901] // </editor-fold> public void setKernel(Kernel kernel) { this.kernel = kernel; } /** * Gets the <code>Kernel</code> * @return */ // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.9B11BA8F-A0DA-AA8C-32F3-8DE7CC6365BB] // </editor-fold> public Kernel getKernel() { return kernel; } /** * Sets the hints. This affects operations near the border. * * @param h */ @Override // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.1A9D855A-8690-8922-FABE-34C1A7192E8B] // </editor-fold> public void setHints(int h) { hints = h; } /** * Performs the filtering * * @param data * @param height * @param width */ @Override // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.1B5E3FFB-364D-5BFC-4B1E-28793F066ACB] // </editor-fold> protected void filterData(int[] data, int width, int height) { hints = FORGET_EDGES; int kw = kernel.getWidth(); int kh = kernel.getHeight(); int kx = kernel.getOriginX(); int ky = kernel.getOriginY(); int roff = kernel.getOffset1(); int goff = kernel.getOffset2(); int boff = kernel.getOffset3(); int diff = ky * width + kx; int[] kdata = kernel.getData(); int div = kernel.getDivider(); int[] row = new int[width]; int borderx = width - kx - 1, bordery = height - ky - 1; for (int y = ky; y < bordery; y++) { for (int x = kx; x < borderx; x++) { int red = 0, gre = 0, blu = 0; int index = y * width + x; for (int dy = 0; dy < kw; dy++) { for (int dx = 0; dx < kh; dx++) { int dind = dy * kw + dx; int tind = index - diff + dy * width + dx; red += kdata[dind] * ((data[tind] >> 16) & 0xff); gre += kdata[dind] * ((data[tind] >> 8) & 0xff); blu += kdata[dind] * (data[tind] & 0xff); } } red = (red / div + roff); gre = (gre / div + goff); blu = (blu / div + boff); red = red > 255 ? 255 : red < 0 ? 0 : red; gre = gre > 255 ? 255 : gre < 0 ? 0 : gre; blu = blu > 255 ? 255 : blu < 0 ? 0 : blu; row[x] = (data[index] & 0xff000000) | (red << 16) | (gre << 8) | blu; } passToConsumer(0, y, width, 1, row, 0, width); } if (hints == ZERO_EDGES) { for (int x = 0; x < width; x++) { row[x] = 0xff000000; } int[] col = new int[height - kh]; for (int i = 0; i < col.length; i++) { col[i] = 0xff000000; } for (int y = 0; y < ky; y++) { passToConsumer(0, y, width, 1, row, 0, width); } for (int y = height - (kh - ky); y < height; y++) { passToConsumer(0, y, width, 1, row, 0, width); } for (int x = 0; x < kx; x++) { passToConsumer(x, ky, 1, height - kh, col, 0, 1); } for (int x = width - (kw - kx); x < width; x++) { passToConsumer(x, ky, 1, height - kh, col, 0, 1); } } else if (hints == FORGET_EDGES) { int[] col = new int[height - kh]; for (int y = 0; y < ky; y++) { System.arraycopy(data, y * width, row, 0, width); passToConsumer(0, y, width, 1, row, 0, width); } for (int y = height - (kh - ky); y < height; y++) { System.arraycopy(data, y * width, row, 0, width); passToConsumer(0, y, width, 1, row, 0, width); } for (int x = 0; x < kx; x++) { for (int y = ky, dy = 0; y < height - (kh - ky); y++, dy++) { col[dy] = data[y * width + x]; } passToConsumer(x, ky, 1, height - kh, col, 0, 1); } for (int x = width - (kw - kx); x < width; x++) { for (int y = ky, dy = 0; y < height - (kh - ky); y++, dy++) { col[dy] = data[y * width + x]; } passToConsumer(x, ky, 1, height - kh, col, 0, 1); } } } } // End ConvolutionFilter
[ "timo.strommer@gmail.com" ]
timo.strommer@gmail.com
607b7a4071e525e49185ff7d43f75d525dec96d5
73b7ba9569f95df12c7c5ae23d767a867dbcf6cb
/src/leetcode/tree/problem662.java
da7d4fca95fb4443d4e27c6f271dd1f30f9aef70
[]
no_license
zhaozhongyu/leetcode-solution
0e54884cbe1436264d46bbd35fa939f893a5e367
1ba15577bafba492120d6bc0520d74d6a51e7969
refs/heads/master
2022-02-15T03:19:35.302085
2022-01-24T07:20:43
2022-01-24T07:20:43
88,062,036
0
0
null
null
null
null
UTF-8
Java
false
false
2,466
java
package leetcode.tree; import java.util.LinkedList; import java.util.Stack; public class problem662 { /** * 给定一个二叉树,编写一个函数来获取这个树的最大宽度。树的宽度是所有层中的最大宽度。这个二叉树与满二叉树(full binary tree)结构相同,但一些节点为空。 * * 每一层的宽度被定义为两个端点(该层最左和最右的非空节点,两端点间的null节点也计入长度)之间的长度。 * */ public int widthOfBinaryTree(TreeNode root) { if (root == null) return 0; if (root.left == null && root.right == null) return 1; LinkedList<TreeNode> list = new LinkedList<>(); list.push(root); int width = 1; int num = 1; // 当前这层的剩余节点数 int temp = 0; // 下一层 while (!list.isEmpty()) { for (int i = 0; i < num; i++) { TreeNode node = list.pollFirst(); if (temp != 0) { if (node!= null && node.left != null) { list.addLast(node.left); } else { list.addLast(null); } if (node != null && node.right != null ) { list.addLast(node.right); } else { list.addLast(null); } temp += 2; } else { if (node != null && node.left != null) { list.addLast(node.left); temp ++; } if (node != null && node.right != null) { list.addLast(node.right); temp ++; } else if (temp!= 0) { list.addLast(null); temp ++; } } } while (!list.isEmpty() && list.peekLast() == null) { list.pollLast(); } temp = list.size(); width = Math.max(width, temp); num = temp; temp = 0; } return width; } public static void main(String[] args) { Integer [] nums = new Integer[]{1,3,2,5,3,null,9}; TreeNode node = TreeNode.createTreeNode(nums); new problem662().widthOfBinaryTree(node); } }
[ "whuzhaozhongyu@foxmail.com" ]
whuzhaozhongyu@foxmail.com
028ea3b5d76e5c535839db38939ac5059cc2066f
141a965ad17f63e9995de6073a99a9fbc8383b08
/LogIn/src/com/kms/dao/BaseDao.java
75a69583b7f4a826de03b5fc7bc2687cc72b3eca
[]
no_license
GochenRyan/short_semester
439398215830fd5d6de518c92925116ff6aa3551
9504a9966a3cc7db07a7aa200f3940f963c45162
refs/heads/master
2021-06-22T15:41:50.646023
2017-07-17T13:56:07
2017-07-17T13:56:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
801
java
package com.kms.dao; import java.sql.DriverManager; import java.sql.SQLException; import com.mysql.jdbc.Connection; public class BaseDao { private static final String DriverName = "com.mysql.jdbc.Driver"; private static final String url = "jdbc:mysql://127.0.0.1:3306/test"; private static final String user = "root"; private static final String password = "root"; static { try { Class.forName(DriverName); }catch(ClassNotFoundException e) { System.err.println("加载驱动失败:"+e.getMessage()); } } public Connection getConnection() { try { Connection connection = (Connection) DriverManager.getConnection(url, user, password); return connection; } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } }
[ "jongkhurun@gmail.com" ]
jongkhurun@gmail.com
e4d5732221e8b440b2d5a38e2b4c6f51421d4c66
d67286fb381f17af9ba1986dc92d6281536ba9a4
/spalg/src/main/java/com/kt/spalgorithm/alg/order/AlgPSTN.java
8e2917f52b79d33f8e13f66a053b2a90ca9b1156
[]
no_license
vegazhou/billing-crm
88fe3424ff4b8dda5aebaa6a69e663a41057ed85
c916343552eede46d81bc0ca7bbcc583b7bf73da
refs/heads/master
2021-08-23T14:45:09.625689
2017-12-05T08:22:05
2017-12-05T08:22:18
113,152,631
1
0
null
null
null
null
UTF-8
Java
false
false
1,330
java
package com.kt.spalgorithm.alg.order; import com.kt.biz.model.order.OrderBean; import com.kt.spalgorithm.alg.Alg; import com.kt.spalgorithm.model.payload.AudioPayload; import com.kt.spalgorithm.model.payload.WbxPayload; /** * Created by Vega Zhou on 2016/3/25. */ public class AlgPSTN extends Alg { @Override public void start(OrderBean order, WbxPayload initialState) { AudioPayload audioPayload = initialState.getAudioPayload(); audioPayload.setIsCallInTollFreeEnabled(true); audioPayload.setIsCallInTollEnabled(true); audioPayload.setIsCallInGlobalEnabled(true); audioPayload.setIsCallBackEnabled(true); audioPayload.setIsCallBackInternationalEnabled(false); // audioPayload.setIsCloudConnectedAudioEnabled(true); initialState.setAudioPayload(audioPayload); } @Override public void terminate(OrderBean order, WbxPayload initialState) { AudioPayload audioPayload = initialState.getAudioPayload(); audioPayload.setIsCallInTollFreeEnabled(false); audioPayload.setIsCallInTollEnabled(false); audioPayload.setIsCallInGlobalEnabled(false); audioPayload.setIsCallBackEnabled(false); audioPayload.setIsCallBackInternationalEnabled(false); initialState.setAudioPayload(audioPayload); } }
[ "weijia.zhou@tcl.com" ]
weijia.zhou@tcl.com
a46b421237fff6ad75487489d7abeebc904326b4
2d30c5cba6d2f79b9522ead97559656a27227605
/dueroslib/src/main/java/atu/com/dueroslib/http/callback/DcsCallback.java
f4e8ba59a1d182dda39459d5a19105f1f2cbfcba
[]
no_license
DituLin/WeatherApp
43049eae5383db24ad5b22b5905672ddd9dc6f82
dfe74191c8976fe905380898fe68c3cf9008259e
refs/heads/master
2021-01-19T14:46:19.066236
2017-08-21T07:27:27
2017-08-21T07:27:27
100,921,456
0
0
null
null
null
null
UTF-8
Java
false
false
2,187
java
/* * Copyright (c) 2017 Baidu, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package atu.com.dueroslib.http.callback; import okhttp3.Call; import okhttp3.Request; import okhttp3.Response; /** * 网络回调基类 * <p> * Created by zhangyan42@baidu.com on 2017/6/2. */ public abstract class DcsCallback<T> { /** * UI线程 * * @param request 请求 * @param id 请求id */ public void onBefore(Request request, int id) { } /** * UI线程 * * @param id 请求id */ public void onAfter(int id) { } public static DcsCallback backDefaultCallBack = new DcsCallback() { @Override public Object parseNetworkResponse(Response response, int id) throws Exception { return null; } @Override public void onError(Call call, Exception e, int id) { } @Override public void onResponse(Object response, int id) { } }; public boolean validateResponse(Response response, int id) { return response.isSuccessful(); } /** * 非UI线程 * * @param response response */ public abstract T parseNetworkResponse(Response response, int id) throws Exception; /** * 错误处理,UI线程 * * @param call call * @param e e 错误异常信息 * @param id id 请求id */ public abstract void onError(Call call, Exception e, int id); /** * 数据回调,UI线程 * * @param response response * @param id id */ public abstract void onResponse(T response, int id); }
[ "linditu@nicigo.com" ]
linditu@nicigo.com
8a7069c45ff8baa2f07442ce6025fb4ff6cdecab
ae9efe033a18c3d4a0915bceda7be2b3b00ae571
/jambeth/jambeth-log/src/main/java/com/koch/ambeth/log/LogLevel.java
6753717e2b04e2babb229391b4e0119b3a5719d5
[ "Apache-2.0" ]
permissive
Dennis-Koch/ambeth
0902d321ccd15f6dc62ebb5e245e18187b913165
8552b210b8b37d3d8f66bdac2e094bf23c8b5fda
refs/heads/develop
2022-11-10T00:40:00.744551
2017-10-27T05:35:20
2017-10-27T05:35:20
88,013,592
0
4
Apache-2.0
2022-09-22T18:02:18
2017-04-12T05:36:00
Java
UTF-8
Java
false
false
707
java
package com.koch.ambeth.log; /*- * #%L * jambeth-log * %% * Copyright (C) 2017 Koch Softwaredevelopment * %% * 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. * #L% */ public enum LogLevel { DEBUG, INFO, WARN, ERROR; }
[ "dennis.koch@bruker.com" ]
dennis.koch@bruker.com
72c5c4457b2e4d0fb379863ffd8dcfce9138457f
f76f012aa05594dc9ebb62e92eeee7fa7d6e9edd
/RobotCore/src/main/java/org/firstinspires/ftc/robotcore/internal/usb/UsbConstants.java
47a3c78c92cedb665a7a7c86a0d6dc4cd89df36e
[ "MIT" ]
permissive
Volt40/FTCLib
3d384434faed0c5adae4f7b8c22a87683c5667b6
a11fcd03178e92df1b80df9eaca3aa35b2dbf211
refs/heads/master
2022-12-16T15:09:40.701027
2020-09-24T14:03:16
2020-09-24T14:03:16
298,296,818
0
0
MIT
2020-09-24T14:02:06
2020-09-24T14:02:05
null
UTF-8
Java
false
false
14,816
java
/* Copyright (c) 2018 Robert Atkinson All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) 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 Robert Atkinson nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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 org.firstinspires.ftc.robotcore.internal.usb; import android.hardware.usb.UsbEndpoint; import android.support.annotation.Nullable; import android.text.TextUtils; import com.qualcomm.robotcore.R; import org.firstinspires.ftc.robotcore.internal.system.AppUtil; import java.util.Arrays; import java.util.List; /** * This is a enhancement to {@link android.hardware.usb.UsbConstants}. We would inherit * from that instead of copying data but for the fact that Android made that class final. */ @SuppressWarnings("WeakerAccess") public class UsbConstants { /** * Bitmask used for extracting the {@link UsbEndpoint} direction from its address field. * @see UsbEndpoint#getAddress * @see UsbEndpoint#getDirection * @see #USB_DIR_OUT * @see #USB_DIR_IN * */ public static final int USB_ENDPOINT_DIR_MASK = 0x80; /** * Used to signify direction of data for a {@link UsbEndpoint} is OUT (host to device) * @see UsbEndpoint#getDirection */ public static final int USB_DIR_OUT = 0; /** * Used to signify direction of data for a {@link UsbEndpoint} is IN (device to host) * @see UsbEndpoint#getDirection */ public static final int USB_DIR_IN = 0x80; /** * Bitmask used for extracting the {@link UsbEndpoint} number its address field. * @see UsbEndpoint#getAddress * @see UsbEndpoint#getEndpointNumber */ public static final int USB_ENDPOINT_NUMBER_MASK = 0x0f; /** * Bitmask used for extracting the {@link UsbEndpoint} type from its address field. * @see UsbEndpoint#getAddress * @see UsbEndpoint#getType * @see #USB_ENDPOINT_XFER_CONTROL * @see #USB_ENDPOINT_XFER_ISOC * @see #USB_ENDPOINT_XFER_BULK * @see #USB_ENDPOINT_XFER_INT */ public static final int USB_ENDPOINT_XFERTYPE_MASK = 0x03; /** * Control endpoint type (endpoint zero) * @see UsbEndpoint#getType */ public static final int USB_ENDPOINT_XFER_CONTROL = 0; /** * Isochronous endpoint type (currently not supported) * @see UsbEndpoint#getType */ public static final int USB_ENDPOINT_XFER_ISOC = 1; /** * Bulk endpoint type * @see UsbEndpoint#getType */ public static final int USB_ENDPOINT_XFER_BULK = 2; /** * Interrupt endpoint type * @see UsbEndpoint#getType */ public static final int USB_ENDPOINT_XFER_INT = 3; /** * Bitmask used for encoding the request type for a control request on endpoint zero. */ public static final int USB_TYPE_MASK = (0x03 << 5); /** * Used to specify that an endpoint zero control request is a standard request. */ public static final int USB_TYPE_STANDARD = (0x00 << 5); /** * Used to specify that an endpoint zero control request is a class specific request. */ public static final int USB_TYPE_CLASS = (0x01 << 5); /** * Used to specify that an endpoint zero control request is a vendor specific request. */ public static final int USB_TYPE_VENDOR = (0x02 << 5); /** * Reserved endpoint zero control request type (currently unused). */ public static final int USB_TYPE_RESERVED = (0x03 << 5); /** * USB class indicating that the class is determined on a per-interface basis. */ public static final int USB_CLASS_PER_INTERFACE = 0; /** * USB class for audio devices. */ public static final int USB_CLASS_AUDIO = 1; /** * USB class for communication devices. */ public static final int USB_CLASS_COMM = 2; /** * USB class for human interface devices (for example, mice and keyboards). */ public static final int USB_CLASS_HID = 3; /** * USB class for physical devices. */ public static final int USB_CLASS_PHYSICA = 5; /** * USB class for still image devices (digital cameras). */ public static final int USB_CLASS_STILL_IMAGE = 6; /** * USB class for printers. */ public static final int USB_CLASS_PRINTER = 7; /** * USB class for mass storage devices. */ public static final int USB_CLASS_MASS_STORAGE = 8; /** * USB class for USB hubs. */ public static final int USB_CLASS_HUB = 9; /** * USB class for CDC devices (communications device class). */ public static final int USB_CLASS_CDC_DATA = 0x0a; /** * USB class for content smart card devices. */ public static final int USB_CLASS_CSCID = 0x0b; /** * USB class for content security devices. */ public static final int USB_CLASS_CONTENT_SEC = 0x0d; /** * USB class for video devices. * Constants as specified in "USB Device Class Definition for Video Devices" standard. */ public static final int USB_CLASS_VIDEO = 0x0e; public static final int USB_VIDEO_INTERFACE_SUBCLASS_UNDEFINED = 0; public static final int USB_VIDEO_INTERFACE_SUBCLASS_CONTROL = 1; public static final int USB_VIDEO_INTERFACE_SUBCLASS_STREAMING = 2; public static final int USB_VIDEO_INTERFACE_SUBCLASS_INTERFACE_COLLECTION = 3; public static final int USB_VIDEO_INTERFACE_PROTOCOL_UNDEFINED = 0; public static final int USB_VIDEO_INTERFACE_PROTOCOL_15 = 1; public static final int USB_VIDEO_CLASS_DESCRIPTOR_UNDEFINED = 0x20; public static final int USB_VIDEO_CLASS_DESCRIPTOR_DEVICE = 0x21; public static final int USB_VIDEO_CLASS_DESCRIPTOR_CONFIGURATION = 0x22; public static final int USB_VIDEO_CLASS_DESCRIPTOR_STRING = 0x23; public static final int USB_VIDEO_CLASS_DESCRIPTOR_INTERFACE = 0x24; public static final int USB_VIDEO_CLASS_DESCRIPTOR_ENDPOINT = 0x25; /** * USB class for wireless controller devices. */ public static final int USB_CLASS_WIRELESS_CONTROLLER = 0xe0; /** * USB class for wireless miscellaneous devices. */ public static final int USB_CLASS_MISC = 0xef; /** * Application specific USB class. */ public static final int USB_CLASS_APP_SPEC = 0xfe; /** * Vendor specific USB class. */ public static final int USB_CLASS_VENDOR_SPEC = 0xff; /** * Boot subclass for HID devices. */ public static final int USB_INTERFACE_SUBCLASS_BOOT = 1; /** * Vendor specific USB subclass. */ public static final int USB_SUBCLASS_VENDOR_SPEC = 0xff; //---------------------------------------------------------------------------------------------- public static final int VENDOR_ID_MICROSOFT = 0x045E; public static final int VENDOR_ID_LOGITECH = 0x046D; public static final int VENDOR_ID_FTDI = 0x0403; // https://android.googlesource.com/platform/system/core/+/android-4.4_r1/adb/usb_vendors.c // http://www.linux-usb.org/usb.ids public static final int VENDOR_ID_GOOGLE = 0x18d1; public static final int VENDOR_ID_INTEL = 0x8087; public static final int VENDOR_ID_HTC = 0x0bb4; public static final int VENDOR_ID_SAMSUNG = 0x04e8; public static final int VENDOR_ID_MOTOROLA = 0x22b8; public static final int VENDOR_ID_LGE = 0x1004; public static final int VENDOR_ID_HUAWEI = 0x12D1; public static final int VENDOR_ID_ACER = 0x0502; public static final int VENDOR_ID_SONY_ERICSSON = 0x0FCE; public static final int VENDOR_ID_FOXCONN = 0x0489; public static final int VENDOR_ID_DELL = 0x413c; public static final int VENDOR_ID_NVIDIA = 0x0955; public static final int VENDOR_ID_GARMIN_ASUS = 0x091E; public static final int VENDOR_ID_SHARP = 0x04dd; public static final int VENDOR_ID_ZTE = 0x19D2; public static final int VENDOR_ID_KYOCERA = 0x0482; public static final int VENDOR_ID_PANTECH = 0x10A9; public static final int VENDOR_ID_QUALCOMM = 0x05c6; public static final int VENDOR_ID_OTGV = 0x2257; public static final int VENDOR_ID_NEC = 0x0409; public static final int VENDOR_ID_PMC = 0x04DA; public static final int VENDOR_ID_TOSHIBA = 0x0930; public static final int VENDOR_ID_SK_TELESYS = 0x1F53; public static final int VENDOR_ID_KT_TECH = 0x2116; public static final int VENDOR_ID_ASUS = 0x0b05; public static final int VENDOR_ID_PHILIPS = 0x0471; public static final int VENDOR_ID_TI = 0x0451; public static final int VENDOR_ID_FUNAI = 0x0F1C; public static final int VENDOR_ID_GIGABYTE = 0x0414; public static final int VENDOR_ID_IRIVER = 0x2420; public static final int VENDOR_ID_COMPAL = 0x1219; public static final int VENDOR_ID_T_AND_A = 0x1BBB; public static final int VENDOR_ID_LENOVOMOBILE = 0x2006; public static final int VENDOR_ID_LENOVO = 0x17EF; public static final int VENDOR_ID_VIZIO = 0xE040; public static final int VENDOR_ID_K_TOUCH = 0x24E3; public static final int VENDOR_ID_PEGATRON = 0x1D4D; public static final int VENDOR_ID_ARCHOS = 0x0E79; public static final int VENDOR_ID_POSITIVO = 0x1662; public static final int VENDOR_ID_FUJITSU = 0x04C5; public static final int VENDOR_ID_LUMIGON = 0x25E3; public static final int VENDOR_ID_QUANTA = 0x0408; public static final int VENDOR_ID_INQ_MOBILE = 0x2314; public static final int VENDOR_ID_SONY = 0x054C; public static final int VENDOR_ID_LAB126 = 0x1949; public static final int VENDOR_ID_YULONG_COOLPAD = 0x1EBF; public static final int VENDOR_ID_KOBO = 0x2237; public static final int VENDOR_ID_TELEEPOCH = 0x2340; public static final int VENDOR_ID_ANYDATA = 0x16D5; public static final int VENDOR_ID_HARRIS = 0x19A5; public static final int VENDOR_ID_OPPO = 0x22D9; public static final int VENDOR_ID_XIAOMI = 0x2717; public static final int VENDOR_ID_BYD = 0x19D1; public static final int VENDOR_ID_OUYA = 0x2836; public static final int VENDOR_ID_HAIER = 0x201E; public static final int VENDOR_ID_HISENSE = 0x109b; public static final int VENDOR_ID_MTK = 0x0e8d; public static final int VENDOR_ID_NOOK = 0x2080; public static final int VENDOR_ID_QISDA = 0x1D45; public static final int VENDOR_ID_ECS = 0x03fc; public static final int VENDOR_ID_GENERIC = 0x1908; // 6408; also see on SeaWit and YoLuke branded cameras, among others public static final int PRODUCT_ID_LOGITECH_C920 = 0x082D; public static final int PRODUCT_ID_LOGITECH_C310 = 0x081B; public static final int PRODUCT_ID_LOGITECH_C270 = 0x0825; // aka 2085 public static final int PRODUCT_ID_MICROSOFT_LIFECAM_HD_3000 = 2064; // aka 0x810 /** Some cameras return really meaningless names */ public static final List<String> manufacturerNamesToIgnore = Arrays.asList("generic"); public static @Nullable String getManufacturerName(String manufacturer, int vid) { if (TextUtils.isEmpty(manufacturer) || manufacturerNamesToIgnore.contains(manufacturer.toLowerCase())) { String result = getManufacturerName(vid); if (result != null) { return result; } } return manufacturer; } public static @Nullable String getManufacturerName(int vid) { int rid = getManufacturerResourceId(vid); return rid != 0 ? AppUtil.getDefContext().getString(rid) : null; } protected static int getManufacturerResourceId(int vid) { switch (vid) // we could add more, just haven't had the need { case VENDOR_ID_MICROSOFT: return R.string.usb_vid_name_microsoft; case VENDOR_ID_LOGITECH: return R.string.usb_vid_name_logitech; case VENDOR_ID_FTDI: return R.string.usb_vid_name_ftdi; case VENDOR_ID_GOOGLE: return R.string.usb_vid_name_google; case VENDOR_ID_DELL: return R.string.usb_vid_name_ftdi; case VENDOR_ID_QUALCOMM: return R.string.usb_vid_name_qualcomm; case VENDOR_ID_GENERIC: return R.string.usb_vid_name_generic; } return 0; } public static @Nullable String getProductName(String productName, int vid, int pid) { if (TextUtils.isEmpty(productName)) { String result = getProductName(vid, pid); if (result != null) { return result; } } return productName; } public static @Nullable String getProductName(int vid, int pid) { int rid = getProductNameResourceId(vid, pid); return rid != 0 ? AppUtil.getDefContext().getString(rid) : null; } protected static int getProductNameResourceId(int vid, int pid) { switch (vid) { case VENDOR_ID_LOGITECH: { switch (pid) { case PRODUCT_ID_LOGITECH_C920: return R.string.usb_pid_name_logitech_c920; case PRODUCT_ID_LOGITECH_C310: return R.string.usb_pid_name_logitech_c310; } } break; } return 0; } }
[ "pranav.avva@gmail.com" ]
pranav.avva@gmail.com
3a3fe58ebefeb3583a6f045d732601dfb02ec3ff
cc738c8179b3d4dd3b72e129f4da82c8360edd92
/app/src/main/java/reflect/data/MoodEntryProvider.java
e997922c539663902d4d1783e158b3d6192ce2e1
[]
no_license
caroline-gschwend/Reflect-App
718d024cc287f811182e97248056157a58b2665b
08d424ecd365cf3680242430fe56a24e949128eb
refs/heads/main
2023-01-31T03:57:55.289700
2020-12-09T03:32:07
2020-12-09T03:32:07
304,153,147
0
0
null
2020-12-07T04:58:34
2020-10-14T22:46:49
Java
UTF-8
Java
false
false
6,588
java
package reflect.data; import android.content.ContentProvider; import android.content.ContentUris; import android.content.ContentValues; import android.content.UriMatcher; import android.database.Cursor; import android.net.Uri; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; /** * ToDoProvider is a Content Provider * Calls to this provider should be made at the URI "content://edu.csce4623.ahnelson.todomvp3.data" * appending the proper uri for the call (e.g. todoitems or todoitems/#) */ public class MoodEntryProvider extends ContentProvider { public static final String TAG = MoodEntryProvider.class.getName(); private MoodEntryItemDao moodEntryItemDao; public static final String AUTHORITY = "com.example.reflect.data"; public static final String MOODENTRYITEM_TABLE_NAME = "moodentryitems"; public static final int ID_MOODENTRYITEM_DATA = 1; public static final int ID_MOODENTRYITEM_DATA_ITEM = 2; //URI matcher for switch statements on calls to the provider public static final UriMatcher uriMatcher = new UriMatcher(UriMatcher.NO_MATCH); //Definition of two patterns (table or table + ID) static { uriMatcher.addURI(AUTHORITY, MOODENTRYITEM_TABLE_NAME, ID_MOODENTRYITEM_DATA); uriMatcher.addURI(AUTHORITY, MOODENTRYITEM_TABLE_NAME + "/*", ID_MOODENTRYITEM_DATA_ITEM); } /** * OnCreate -- get instance of ToDoItemDatabase through the Room DAO * Return false always? Not sure why here. TODO - Look into this. * * @return */ @Override public boolean onCreate() { moodEntryItemDao = MoodEntryItemDatabase.getInstance(getContext()).getToDoItemDao(); return false; } /** * Query - Loads all todoitems if URI is the full table * * @param uri - URI for call to provider * @param projection - Columns to return * @param selection - Which rows to select * @param selectionArgs - Arguments for that selection * @param sortOrder - Any sort parameters * @return - Cursor object with ToDoItems */ @Nullable @Override public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) { Log.d(TAG, "query"); Cursor cursor; switch (uriMatcher.match(uri)) { case ID_MOODENTRYITEM_DATA: cursor = moodEntryItemDao.findAll(); if (getContext() != null) { cursor.setNotificationUri(getContext() .getContentResolver(), uri); return cursor; } break; default: throw new IllegalArgumentException("Unknown URI: " + uri); } return null; } /** * getType not implemented yet. * * @param uri * @return */ @Nullable @Override public String getType(@NonNull Uri uri) { return null; } /** * Insert data into the database * * @param uri - Uri associated with the request * @param values - A content values object representing a ToDoItem * @return - URI of the newly created item */ @Nullable @Override public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) { Log.d(TAG, "insert"); switch (uriMatcher.match(uri)) { case ID_MOODENTRYITEM_DATA: if (getContext() != null) { long id = moodEntryItemDao.insert(MoodEntryItem.fromContentValues(values)); if (id != 0) { getContext().getContentResolver().notifyChange(uri, null); return ContentUris.withAppendedId(uri, id); } } case ID_MOODENTRYITEM_DATA_ITEM: throw new IllegalArgumentException("Invalid URI: Insert failed " + uri); default: throw new IllegalArgumentException("Unknown URI: " + uri); } } /** * Empty Constructor */ public MoodEntryProvider() { } /** * Delete an item given a particular ID * * @param uri - ToDoItem with appended ID * @param selection - Not used currently * @param selectionArgs - Not used currently * @return - Number of rows deleted (should be 0 or 1). */ @Override public int delete(Uri uri, String selection, String[] selectionArgs) { Log.d(TAG, "delete"); switch (uriMatcher.match(uri)) { case ID_MOODENTRYITEM_DATA: throw new IllegalArgumentException("Invalid uri: cannot delete"); case ID_MOODENTRYITEM_DATA_ITEM: if (getContext() != null) { //Delete item in the DAO at a given ID int count = moodEntryItemDao.delete(ContentUris.parseId(uri)); getContext().getContentResolver().notifyChange(uri, null); return count; } default: throw new IllegalArgumentException("Unknown URI: " + uri); } } /** * Updates an item given a ContentValues object representing the item. * Content Values object MUST specify ID to update, and may update other columns to be updated. * * @param uri * @param values * @param selection * @param selectionArgs * @return */ @Override public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs) { Log.d(TAG, "update"); Log.d(TAG, uri.toString()); switch (uriMatcher.match(uri)) { case ID_MOODENTRYITEM_DATA: if (getContext() != null) { //Update DAO from given ToDoItem int count = moodEntryItemDao.update(MoodEntryItem.fromContentValues(values)); if (count != 0) { getContext().getContentResolver().notifyChange(uri, null); return count; } } break; case ID_MOODENTRYITEM_DATA_ITEM: throw new IllegalArgumentException("Invalid URI: cannot update"); default: throw new IllegalArgumentException("Unknwon URI: " + uri); } return 0; } }
[ "caroline.gschwend@gmail.com" ]
caroline.gschwend@gmail.com
f3c4c3b9bc032e0cf76ebb0e2084321bc6bec702
159a41f53172c7c61f7b90a45c4ac8e868c0037a
/asset/asset-services/src/main/java/org/egov/asset/repository/rowmapper/AssetStatusRowMapper.java
4df4ce28ddb728321c88f52a9263760342e36f4d
[]
no_license
veswanthRaju/egov-services
60850efe20a9e80cf9041c4769b8d9f1e3b15a5b
b38bb6a6c5c89350782d81f4641e76f2a363871a
refs/heads/master
2021-01-01T03:59:16.465139
2017-07-13T08:41:28
2017-07-13T08:41:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,407
java
package org.egov.asset.repository.rowmapper; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import org.egov.asset.model.AssetStatus; import org.egov.asset.model.AuditDetails; import org.egov.asset.model.StatusValue; import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Component; @Component public class AssetStatusRowMapper implements RowMapper<AssetStatus> { @Override public AssetStatus mapRow(final ResultSet rs, final int rowNum) throws SQLException { final AssetStatus assetStatus = new AssetStatus(); final StatusValue statusValue = new StatusValue(); final AuditDetails auditDetails = new AuditDetails(); final List<StatusValue> statusValues = new ArrayList<StatusValue>(); statusValue.setCode(rs.getString("code")); statusValue.setDescription(rs.getString("description")); statusValues.add(statusValue); assetStatus.setObjectName(rs.getString("objectName")); assetStatus.setTenantId(rs.getString("tenantId")); assetStatus.setStatusValues(statusValues); auditDetails.setCreatedBy(rs.getString("createdby")); auditDetails.setCreatedDate(rs.getLong("createddate")); auditDetails.setLastModifiedBy(rs.getString("lastmodifiedby")); auditDetails.setLastModifiedDate(rs.getLong("lastmodifieddate")); assetStatus.setAuditDetails(auditDetails); return assetStatus; } }
[ "raman.pandey@egovernments.org" ]
raman.pandey@egovernments.org
0cdf3560c8f78cff87f3db5f094cefa089871034
31a6d75a765fb46e6c743f53343eadf02effc693
/modules/opla-core/src/main/java/jmetal4/metrics/concernDrivenMetrics/concernDiffusion/CDAClass.java
7c9cb043e718aeb5e7a9fc5bfd44d9d1139532bc
[]
no_license
LucianeBaldo/OPLA-Tool
9db5a2700f90356aedd7549b0ed0b206c4bb7415
f2c2647b0d1661a8517af33e66fae1168e92a14e
refs/heads/master
2020-04-30T16:00:07.482041
2020-03-13T00:02:54
2020-03-13T00:02:54
176,936,365
1
0
null
2020-03-05T16:07:58
2019-03-21T12:04:18
HTML
UTF-8
Java
false
false
467
java
package jmetal4.metrics.concernDrivenMetrics.concernDiffusion; import arquitetura.representation.Architecture; import arquitetura.representation.Concern; public class CDAClass extends ConcernDiffusionMetric<CDAClassResult> { public CDAClass(Architecture architecture) { super(architecture); } @Override protected CDAClassResult getElementForConcern(Concern concern) { return new CDAClassResult(concern, getArchitecture()); } }
[ "willianmarquesfreire@gmail.com" ]
willianmarquesfreire@gmail.com
6ee8ef6e7aa1390a559880f82d3c8fd47dc3e0d8
10234afd4345024020378b80bf5b6ddde6fa04f8
/src/com/company/Main.java
1bff1cc9a43b081c927026bbb9440443d908c7ab
[]
no_license
pspro2020/pr10-stampedlock-SalvaFoncubierta
f8e3c26c6f4bf9767f1be3a92ec4f8f08dd29931
6437d5a8309b5620857355bc0de85ff09db0638d
refs/heads/main
2023-01-06T10:35:18.395013
2020-11-05T14:32:44
2020-11-05T14:32:44
309,345,318
0
0
null
2020-11-02T11:10:16
2020-11-02T11:10:09
null
UTF-8
Java
false
false
682
java
package com.company; public class Main { public static void main(String[] args) throws InterruptedException { Almacen almacen = new Almacen(); Thread[] consultores= new Thread[3]; Thread productor = new Thread(new Productor(almacen), "Productor"); for (int i = 0; i < 3; i++) { consultores[i] = new Thread(new Consultor(almacen, i), "Consultor " + i); } productor.start(); for (int i = 0; i < 3; i++){ consultores[i].start(); } Thread.sleep(15000); for (int i = 0; i < 3; i++){ consultores[i].interrupt(); } productor.interrupt(); } }
[ "salvadorfoncubierta.saladillo.gmail.com" ]
salvadorfoncubierta.saladillo.gmail.com
c27fce5c3ecc2717b01a01ee42d3d9bc90ca0b0e
77d920d42ee40677bc2163b8a64d903e57a8cc3b
/ediycook-ms-recipe/src/main/java/com/e/diycook/ms/recipe/web/rest/errors/FieldErrorVM.java
6161a0ef7dde986063504b0c763128199f4b3641
[]
no_license
ediycook/ediycook
d6c96afc6002491eb016183be061fd41bde49818
3ab23e3885757ee1456bac69a9c14964e43c3943
refs/heads/master
2020-03-14T03:45:03.387307
2018-04-28T21:09:44
2018-04-28T21:09:44
131,426,607
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
package com.e.diycook.ms.recipe.web.rest.errors; import java.io.Serializable; public class FieldErrorVM implements Serializable { private static final long serialVersionUID = 1L; private final String objectName; private final String field; private final String message; public FieldErrorVM(String dto, String field, String message) { this.objectName = dto; this.field = field; this.message = message; } public String getObjectName() { return objectName; } public String getField() { return field; } public String getMessage() { return message; } }
[ "e.diycook@gmail.com" ]
e.diycook@gmail.com
a915b3c2628edd9d4dd0a328f9e8a7c69ead7616
228207fc99ea6fe3dff81ea243a42d80b96a63e6
/replay02/src/sec06/exam01_protected_package1/B.java
6c68a11938775268b199033e982432b58f60f3b6
[]
no_license
ugo566/javaLab
dcf761f23237b86bf22e97d4f1769e5dcfa4bafa
24cee7adfd438c14aa35ebaf14111c4452555c0e
refs/heads/master
2023-04-03T18:17:44.861248
2021-04-17T14:24:21
2021-04-17T14:24:21
352,486,285
0
0
null
null
null
null
UHC
Java
false
false
170
java
package sec06.exam01_protected_package1; public class B { public void method() { A a = new A(); //같은패키지 ok a.field = "value"; a.method(); } }
[ "ugo566@naver.com" ]
ugo566@naver.com
af53956e791fd2acd4ac9efe86316a0186b70dfc
14102cf1de5b1717a139723d7f182906d3bd02a8
/src/main/java/com/jay/behavioural/strategy/DebitCreditPayment.java
7e63418eb482a01c1fdbd8b0d7d56d75ab6f6f34
[]
no_license
JayhindRaj/Design-Patterns
03c0d283dbfada0a98b055c266f1bb7952a2b7b9
83a139b66d12ab2be6c4b16b4aaefbb61d5a3dbd
refs/heads/master
2021-07-22T18:15:21.836524
2020-04-07T19:10:43
2020-04-07T19:10:43
132,409,951
0
0
null
null
null
null
UTF-8
Java
false
false
1,133
java
package com.jay.behavioural.strategy; import java.util.Date; class DebitCreditPayment implements PaymentStrategy { private String cardNumber; private String cvvNumber; private Date expiryDate; private String chName; public String getCardNumber() { return cardNumber; } public void setCardNumber(String cardNumber) { this.cardNumber = cardNumber; } public String getCvvNumber() { return cvvNumber; } public void setCvvNumber(String cvvNumber) { this.cvvNumber = cvvNumber; } public Date getExpiryDate() { return expiryDate; } public void setExpiryDate(Date expiryDate) { this.expiryDate = expiryDate; } public String getChName() { return chName; } public void setChName(String chName) { this.chName = chName; } public DebitCreditPayment(String cardNumber, String cvvNumber, Date expiryDate, String chName) { super(); this.cardNumber = cardNumber; this.cvvNumber = cvvNumber; this.expiryDate = expiryDate; this.chName = chName; } @Override public void payment(double amount) { System.out.println(amount + " paid by " + chName + " using credit/debit card"); } }
[ "jayhindraj@outlook.com" ]
jayhindraj@outlook.com
1566c62cc95078346e284ccbfe4eb23a3a8eb31d
357ac39559780a6dcb236c9f0701e0880ad1e311
/app/src/main/java/coderoly/augustine/MainActivity.java
1c432fa85f7d842394fe1c114c12878840ad0791
[]
no_license
epiph/AugustineApp
c045d3d07a8679275360d15590130fc18bdeca3f
9b4a6badbc68fb8289c99800070a22cf9d9db743
refs/heads/master
2020-03-08T17:30:06.373991
2018-04-05T22:23:23
2018-04-05T22:23:23
128,270,071
0
0
null
null
null
null
UTF-8
Java
false
false
12,624
java
package coderoly.augustine; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.AutoCompleteTextView; import android.widget.EditText; import com.google.android.gms.auth.api.Auth; import com.google.android.gms.auth.api.signin.GoogleSignInAccount; import com.google.android.gms.auth.api.signin.GoogleSignInOptions; import com.google.android.gms.auth.api.signin.GoogleSignInResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthCredential; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.GoogleAuthProvider; import com.google.firebase.auth.ProviderQueryResult; import coderoly.augustine.auth.email_password.LoginWithFirebase; import coderoly.augustine.auth.email_password.SignupWithFirebase; import coderoly.augustine.errors.ConnectionErrors; import coderoly.augustine.homepage.HomeActivity; import coderoly.augustine.homepage.chats.Chats; import coderoly.augustine.messages.DialogMessages; @SuppressWarnings("ConstantConditions") public class MainActivity extends AppCompatActivity { ConnectionErrors connectionErrors = new ConnectionErrors(); DialogMessages dialogMessages = new DialogMessages(); public String doesEmailExist; public AutoCompleteTextView mEmailView; public EditText mPasswordView; int RC_SIGN_IN = 9001; @SuppressWarnings("deprecation") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // getSupportActionBar().hide(); setContentView(R.layout.activity_main); // Locale.setDefault(new Locale("sw")); // Configuration config = new Configuration(); // Resources res = getResources(); // res.updateConfiguration(config, res.getDisplayMetrics()); // recreate(); if (FirebaseAuth.getInstance().getCurrentUser() != null) startActivity(new Intent(this, HomeActivity.class)); findViewById(R.id.Btn_AuthWithEmail).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Hide_Keyboard_and_Lose_Focus(); if (!Is_Network_Connected()) { connectionErrors.Internet_Connection_Failed_Error(MainActivity.this); return; } Email_Password_Auth(); } }); findViewById(R.id.buttonSignWithGoogle).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Hide_Keyboard_and_Lose_Focus(); if (!Is_Network_Connected()) { connectionErrors.Internet_Connection_Failed_Error(MainActivity.this); } else { dialogMessages.Show_Please_Wait_Dialog(MainActivity.this); GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.default_web_client_id) /*"AIzaSyCTa0jrvljwxA_GyQXDdNd9T9buUb7ZeJM"*/) .requestEmail() .build(); GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(MainActivity.this) .enableAutoManage(MainActivity.this, null) .addApi(Auth.GOOGLE_SIGN_IN_API, gso) .build(); dialogMessages.Hide_Progress_Dialog(); dialogMessages.Show_Authenticating_Progress_Dialog(MainActivity.this); Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient); startActivityForResult(signInIntent, RC_SIGN_IN); dialogMessages.Hide_Progress_Dialog(); dialogMessages.Show_Authenticating_Progress_Dialog(MainActivity.this); } } }); findViewById(R.id.buttonSignWithFacebook).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Hide_Keyboard_and_Lose_Focus(); if (!Is_Network_Connected()) { connectionErrors.Internet_Connection_Failed_Error(MainActivity.this); // return; } /* new GoogleAuthFragment().Google_Sign_in_Options(AuthenticationActivity.this); */ } }); findViewById(R.id.buttonSignWithTwitter).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Hide_Keyboard_and_Lose_Focus(); if (!Is_Network_Connected()) { connectionErrors.Internet_Connection_Failed_Error(MainActivity.this); // return; } /* startActivity(new Intent(AuthenticationActivity.this, GoogleAuthActivity.class)); */ } }); } public void Hide_Keyboard_and_Lose_Focus() { View view = this.getCurrentFocus(); if (view != null) { InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } } @SuppressWarnings("deprecation") public boolean Is_Network_Connected() { boolean wifiNetworkState = false; boolean mobileNetworkState = false; ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo[] netInfo = cm.getAllNetworkInfo(); for (NetworkInfo ni : netInfo) { if (ni.getTypeName().equalsIgnoreCase("WIFI")) if (ni.isConnected()) wifiNetworkState = true; if (ni.getTypeName().equalsIgnoreCase("MOBILE")) if (ni.isConnected()) mobileNetworkState = true; } return wifiNetworkState || mobileNetworkState; } public void Email_Password_Auth() { mPasswordView = (EditText) findViewById(R.id.password); mEmailView = (AutoCompleteTextView) findViewById(R.id.email); final String typedEmail = mEmailView.getText().toString(); final String typedPassword = mPasswordView.getText().toString(); // Reset errors. mEmailView.setError(null); mPasswordView.setError(null); /* Validity Checks */ switch (EmailValidityCheck(typedEmail)) { case "empty": mEmailView.setError(getString(R.string.error_field_required)); mEmailView.requestFocus(); return; case "space": mEmailView.setError(getString(R.string.EmailShouldNotContainSpaces)); mEmailView.requestFocus(); return; case "period": mEmailView.setError(getString(R.string.error_invalid_email)); mEmailView.requestFocus(); return; case "@": mEmailView.setError(getString(R.string.error_invalid_email)); mEmailView.requestFocus(); return; default: switch (PasswordValidityCheck(typedPassword)) { case "empty": mPasswordView.setError(getString(R.string.error_field_required)); mPasswordView.requestFocus(); return; case "short": mPasswordView.setError(getString(R.string.error_short_password)); mPasswordView.requestFocus(); return; default: break; } break; } Hide_Keyboard_and_Lose_Focus(); dialogMessages.Show_Please_Wait_Dialog(MainActivity.this); FirebaseAuth.getInstance().fetchProvidersForEmail(typedEmail) .addOnCompleteListener(new OnCompleteListener<ProviderQueryResult>() { @SuppressWarnings("ConstantConditions") @Override public void onComplete(@NonNull Task<ProviderQueryResult> task) { /* getProviders() will return size 1. if email ID is available.*/ if (task.isSuccessful()) { dialogMessages.Hide_Progress_Dialog(); doesEmailExist = (task.getResult().getProviders().size() == 1) ? "yes" : "no"; /* Toast.makeText(getBaseContext(), "y or n = "+doesEmailExist, Toast.LENGTH_SHORT).show(); */ switch (doesEmailExist) { case "no": new SignupWithFirebase().Sign_Up_With_Firebase(typedEmail, typedPassword, MainActivity.this, getBaseContext()); return; case "yes": new LoginWithFirebase().Log_In_With_Firebase(typedEmail, typedPassword, MainActivity.this); return; default: connectionErrors.An_Error_Occurred_Try_Again_Later(MainActivity.this); break; } } else { dialogMessages.Hide_Progress_Dialog(); connectionErrors.An_Error_Occurred_Try_Again_Later(MainActivity.this); } } }); } public String PasswordValidityCheck(String typedPassword) { String error = "none"; if (TextUtils.isEmpty(typedPassword)) error = "empty"; if (typedPassword.length() < 6) error = "short"; return error; } private String EmailValidityCheck(String typedEmail) { String error = "none"; if (TextUtils.isEmpty(typedEmail)) error = "empty"; if (!typedEmail.contains(getString(R.string.at_symbol))) error = "@"; if (!typedEmail.contains(getString(R.string.fullstop_symbol))) error = "period"; if (typedEmail.contains(getString(R.string.space))) error = "space"; return error; } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); dialogMessages.Show_Authenticating_Progress_Dialog(MainActivity.this); if (requestCode == RC_SIGN_IN) { GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data); if (result.isSuccess()) { GoogleSignInAccount account = result.getSignInAccount(); Log.e("Google Authenticating", "" + account.getEmail()); AuthCredential credential = GoogleAuthProvider.getCredential(account.getIdToken(), null); FirebaseAuth.getInstance().signInWithCredential(credential) .addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { dialogMessages.Hide_Progress_Dialog(); startActivity(new Intent(MainActivity.this, MainActivity.class)); } else { dialogMessages.Hide_Progress_Dialog(); new ConnectionErrors().An_Error_Occurred_Try_Again_Later(MainActivity.this); } } }); } else { dialogMessages.Hide_Progress_Dialog(); new ConnectionErrors().An_Error_Occurred_Try_Again_Later(MainActivity.this); } } } }
[ "epiph" ]
epiph
c074c01c9d35d3d558978a5830d3ec52d3d6a5ed
51f3dff4173c8ce50eed8504cccc40d281803e30
/vhrserver/vhr-model/src/main/java/com/carrot97/vhr/model/JobLevel.java
fd68a93a0e82399246c20963495162e3e67a2d22
[]
no_license
Carrot97/Vhr
481bdcb18f8fba54257884e4f5ef05c03900877c
e9f8764289356d4b95ebf37aa686d4c26fbe6c62
refs/heads/master
2023-03-14T19:58:38.347209
2021-03-08T08:51:01
2021-03-08T08:51:01
345,585,181
1
0
null
null
null
null
UTF-8
Java
false
false
1,594
java
package com.carrot97.vhr.model; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; import java.util.Objects; public class JobLevel { private Integer id; private String name; private String titleLevel; @JsonFormat(pattern = "yyyy年MM月dd日", timezone = "Asia/Shanghai") private Date createDate; private Boolean enabled; public JobLevel() { } public JobLevel(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JobLevel)) return false; JobLevel jobLevel = (JobLevel) o; return Objects.equals(name, jobLevel.name); } @Override public int hashCode() { return Objects.hash(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 == null ? null : name.trim(); } public String getTitleLevel() { return titleLevel; } public void setTitleLevel(String titleLevel) { this.titleLevel = titleLevel == null ? null : titleLevel.trim(); } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public Boolean getEnabled() { return enabled; } public void setEnabled(Boolean enabled) { this.enabled = enabled; } }
[ "lixuhuiustb@163.com" ]
lixuhuiustb@163.com
097865bd7d5d6ad5558f3eea9f5de3ffb1d882cf
7011f0d632bbf4422649282a8879a2b6fd1a1f6c
/ClinicCareSystem/src/cliniccaresystem/model/Credentials.java
11f14d318ed4d4d7846f54e1d54745eb454c2778
[]
no_license
jpefini1/ClinicCareSystem
7a8b6086b579e5a7d0e5924aa712c01895f3156e
62a5780728e453d3259837980766562170d89c96
refs/heads/master
2023-01-20T05:55:53.548366
2020-11-24T04:25:31
2020-11-24T04:25:31
293,970,844
0
0
null
null
null
null
UTF-8
Java
false
false
536
java
package cliniccaresystem.model; public class Credentials { private String username; private String password; public Credentials(String username, String password) { this.setUsername(username); this.setPassword(password); } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "jpefini1@my.westga.edu" ]
jpefini1@my.westga.edu
71895e3e033f8738bb81fe7ab1f7ad1982a571d5
fae2d0c92ff3125d2356e78456dc2b0920304f4a
/OpenJdk/src/sun/util/resources/cldr/luy/CurrencyNames_luy.java
e6c0353df3cdb6a73b1797a9707faca75854bd6d
[]
no_license
X-gao/TestPrj
96267a7357ac18b5f8e8f2995f33d3084430ef2d
43f127baa5f16e004798248425d6dd7e386f8231
refs/heads/master
2022-12-22T16:11:39.485389
2021-05-28T02:34:48
2021-05-28T02:34:48
252,669,057
1
0
null
2022-12-06T00:45:49
2020-04-03T08:04:06
Java
UTF-8
Java
false
false
5,944
java
/* * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * COPYRIGHT AND PERMISSION NOTICE * * Copyright (C) 1991-2012 Unicode, Inc. All rights reserved. Distributed under * the Terms of Use in http://www.unicode.org/copyright.html. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of the Unicode data files and any associated documentation (the "Data * Files") or Unicode software and any associated documentation (the * "Software") to deal in the Data Files or Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Data Files or Software, and * to permit persons to whom the Data Files or Software are furnished to do so, * provided that (a) the above copyright notice(s) and this permission notice * appear with all copies of the Data Files or Software, (b) both the above * copyright notice(s) and this permission notice appear in associated * documentation, and (c) there is clear notice in each modified Data File or * in the Software as well as in the documentation associated with the Data * File(s) or Software that the data or software has been modified. * * THE DATA FILES AND SOFTWARE ARE 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 OF * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR * CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THE DATA FILES OR SOFTWARE. * * Except as contained in this notice, the name of a copyright holder shall not * be used in advertising or otherwise to promote the sale, use or other * dealings in these Data Files or Software without prior written authorization * of the copyright holder. */ package sun.util.resources.cldr.luy; import sun.util.resources.OpenListResourceBundle; public class CurrencyNames_luy extends OpenListResourceBundle { @Override protected final Object[][] getContents() { final Object[][] data = new Object[][] { { "aed", "Dirham ya Falme za Kiarabu" }, { "aoa", "Kwanza ya Angola" }, { "aud", "Dola ya Australia" }, { "bhd", "Dinari ya Bahareni" }, { "bif", "Faranga ya Burundi" }, { "bwp", "Pula ya Botswana" }, { "cad", "Dola ya Kanada" }, { "cdf", "Faranga ya Kongo" }, { "chf", "Faranga ya Uswisi" }, { "cny", "Yuan Renminbi ya China" }, { "cve", "Eskudo ya Kepuvede" }, { "djf", "Faranga ya Jibuti" }, { "dzd", "Dinari ya Aljeria" }, { "egp", "Pauni ya Misri" }, { "ern", "Nakfa ya Eritrea" }, { "etb", "Bir ya Uhabeshi" }, { "eur", "Yuro" }, { "gbp", "Pauni ya Uingereza" }, { "ghc", "Sedi ya Ghana" }, { "gmd", "Dalasi ya Gambia" }, { "gns", "Faranga ya Gine" }, { "inr", "Rupia ya India" }, { "jpy", "Sarafu ya Kijapani" }, { "kes", "Sirinji ya Kenya" }, { "kmf", "Faranga ya Komoro" }, { "lrd", "Dola ya Liberia" }, { "lsl", "Loti ya Lesoto" }, { "lyd", "Dinari ya Libya" }, { "mad", "Dirham ya Moroko" }, { "mga", "Ariary ya Bukini" }, { "mro", "Ugwiya ya Moritania" }, { "mur", "Rupia ya Morisi" }, { "mwk", "Kwacha ya Malawi" }, { "mzm", "Metikali ya Msumbiji" }, { "nad", "Dola ya Namibia" }, { "ngn", "Naira ya Nijeria" }, { "rwf", "Faranga ya Rwanda" }, { "sar", "Riyal ya Saudia" }, { "scr", "Rupia ya Shelisheli" }, { "sdg", "Pauni ya Sudani" }, { "shp", "Pauni ya Santahelena" }, { "sll", "Leoni" }, { "sos", "Shilingi ya Somalia" }, { "std", "Dobra ya Sao Tome na Principe" }, { "szl", "Lilangeni" }, { "tnd", "Dinari ya Tunisia" }, { "tzs", "Sirinji ya Tanzania" }, { "ugx", "Sirinji ya Uganda" }, { "usd", "Dola ya Marekani" }, { "xaf", "Faranga CFA BEAC" }, { "xof", "Faranga CFA BCEAO" }, { "zar", "Randi ya Afrika Kusini" }, { "zmk", "Kwacha ya Zambia" }, { "zwd", "Dola ya Zimbabwe" }, }; return data; } }
[ "1628803713@qq.com" ]
1628803713@qq.com
211cb115a0c610cf3cd4d0632fa9ff4b8c253743
14cc0911503b7674edf8ab010a6d0286ed7617f3
/src/main/java/com/crud/tasks/domain/Mail.java
23dd8f6213e0e4e9b9d36b4ce272fc2aa9e015bc
[]
no_license
fintechilla/kodilla-tasks
94bdf767c63c8ff698e4cb5f2d895723e0a820a6
00746912e39d76ec2143c10c75f6fecaca25f397
refs/heads/master
2020-04-02T11:36:53.090571
2019-03-14T22:00:42
2019-03-14T22:00:42
154,397,900
0
0
null
null
null
null
UTF-8
Java
false
false
464
java
package com.crud.tasks.domain; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @EqualsAndHashCode @Getter @AllArgsConstructor public class Mail { private String mailTo; private String toCc; private String subject; private String message; public Mail(String mailTo, String subject, String message) { this.mailTo = mailTo; this.subject = subject; this.message = message; } }
[ "shwalerys@gmail.com" ]
shwalerys@gmail.com
4f0d738a377dcfa6c87717afb2b0f463055403b5
91f9b7b4b569bd4dc40b22909c91381f09483dd8
/src/br/com/diego/financialmobile/domain/Categoria.java
184d8b3d66681c5949cf6401c4bc84d8ee823556
[]
no_license
dfsilva/droidfinancialmobile
308922b833c2022027534e58ad957be298a15267
3599c944b4177c1c1e29b367eaadfb88f41e6b35
refs/heads/master
2021-01-20T04:32:20.140009
2011-07-21T01:19:03
2011-07-21T01:19:03
2,081,251
0
0
null
null
null
null
UTF-8
Java
false
false
1,252
java
package br.com.diego.financialmobile.domain; import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class Categoria { public static final String[] COLUNAS = new String[] { Categoria.ID_CATEGORIA, Categoria.DESC_CATEGORIA }; public static final String ID_CATEGORIA = "idCategoria"; public static final String DESC_CATEGORIA = "descCategoria"; public int idCategoria; public String descCategoria; public Categoria() { } public static List<Categoria> fromJsonArray(JSONArray arr) { List<Categoria> retorno = new ArrayList<Categoria>(); if (arr != null) { for (int i = 0; i < arr.length(); i++) { try { retorno.add(fromJsonObject(arr.getJSONObject(i))); } catch (JSONException e) { // do nothing } } } return retorno; } public static Categoria fromJsonObject(JSONObject obj) { Categoria retorno = new Categoria(); if (obj != null) { try { retorno.idCategoria = obj.getInt("idCategoria"); retorno.descCategoria = obj.getString("descCategoria"); } catch (Exception e) { // do nothing } } return retorno; } @Override public String toString() { return this.descCategoria; } }
[ "diegosiuniube@gmail.com" ]
diegosiuniube@gmail.com
6c2d5aaffd3f82c37b2036ed96dcbdb232820dd0
942897dde07b46cb5764d4b20133cce74ddb5f02
/Java50Program/src/com/java/file/UserInputByConsoleClass.java
052068faa9ddca09dc7beaa036328f8d959a1ce1
[]
no_license
pratibha-sekra/Java50Programs
7a30b1cf733f333566ccd1f66255cd2cdc91d3b6
c379884608654ceeed168c2870c48479d3393485
refs/heads/master
2021-05-08T21:31:22.376765
2018-01-31T07:18:15
2018-01-31T07:18:15
119,644,837
0
0
null
null
null
null
UTF-8
Java
false
false
398
java
package com.java.file; import java.io.Console; public class UserInputByConsoleClass { public static void main(String[] args) { Console console = System.console(); if (console == null) { System.out.println("Unable to fetch console"); return; } String line = console.readLine(); console.printf("I saw this line: %s", line); } }
[ "pratisekra@gmail.com" ]
pratisekra@gmail.com
859cddcbecf1670e3b4d294fcda121887e37130a
7f47b09a15ca63ba04cd405d302b31694d5dd744
/src/core/src/com/towerdefense/game/util/Position.java
23fd129af3fa73beb1082b13e07e3fa5b2014b6a
[]
no_license
elziniel/PL8
460eec6647f35517892c11856e9e8deba355746a
b6b1d8672e92167ec6f175ba27f6292953ec36f7
refs/heads/master
2021-01-21T10:37:57.925706
2017-02-28T19:16:21
2017-02-28T19:16:21
83,462,413
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
package com.towerdefense.game.util; import com.badlogic.gdx.math.Vector3; public class Position { public float x; public float y; public Position(){ this(0f,0f); } public Position(float x, float y){ this.x = x; this.y = y; } public void set(float x, float y){ this.x = x; this.y = y; } public float distanceTo(Position p){ Vector3 a = new Vector3(x, y, 0); return a.dst(p.x, p.y, 0); } }
[ "esteban.escandell@gmail.com" ]
esteban.escandell@gmail.com
7dd717b16c18365f450097f7cf0c5671bcdd5d75
4e7e33d334ae0f056b71bf492851e2cb1628996a
/src/main/java/ua/repository/JpaNameRepository.java
9b27d60d4f15f281e272c572fd553918c0a0f43c
[]
no_license
Andrii-Didovych/rentvehicle
527f04c57b3bcc0305507467da422e993ae4b53b
bba1009e123a83f5cf0baf0f019572a9461f1f5e
refs/heads/master
2020-03-20T22:33:40.767424
2018-12-09T17:44:34
2018-12-09T17:44:34
137,804,175
0
0
null
null
null
null
UTF-8
Java
false
false
439
java
package ua.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.NoRepositoryBean; import ua.entity.AbstractEntityName; import java.io.Serializable; @NoRepositoryBean public interface JpaNameRepository<T extends AbstractEntityName, ID extends Serializable> extends JpaRepository<T, ID>{ T findByName(String s); }
[ "andrii.didovych@gmail.com" ]
andrii.didovych@gmail.com
552f65a42126e6e45e9d9febf5b98c488e2d4e7a
d7089c602d6216872b3da17de7d692eb903c8b18
/app/src/main/java/net/lzzy/keeper/models/ClazzFactory.java
be0f9930f088e0d383de45595f625a1be79ccb1c
[]
no_license
slowsheep/keeper
04ceaed29dcba858f561fdc0a7fcbf8d41f69202
4e0a7e43727a1e87f4f4283c3af5f556beb99032
refs/heads/master
2020-04-27T15:42:29.559753
2019-03-08T04:53:50
2019-03-08T04:53:50
174,456,666
0
1
null
null
null
null
UTF-8
Java
false
false
2,640
java
package net.lzzy.keeper.models; import net.lzzy.keeper.constants.DbConstants; import net.lzzy.keeper.utils.AppUtils; import net.lzzy.sqllib.SqlRepository; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; /** * @author Administrator */ public class ClazzFactory { private static final ClazzFactory OUR_INSTANCE = new ClazzFactory(); private SqlRepository<Clazz> repository; public static ClazzFactory getInstance() { return OUR_INSTANCE; } private ClazzFactory() { repository=new SqlRepository<>(AppUtils.getContext(),Clazz.class, DbConstants.packager); } public List<Clazz> get(){ return repository.get(); } public Clazz getById(String id){ return repository.getById(id); } public List<Clazz> searchClazz(String kw){ try { List<Clazz> clazzes=repository.getByKeyword(kw,new String[]{Clazz.COLUMN_NAME, Clazz.COLUMN_INTRO},false); Collections.sort(clazzes, new Comparator<Clazz>() { @Override public int compare(Clazz o1, Clazz o2) { return o1.getName().compareTo(o2.getName()); } }); return clazzes; } catch (IllegalAccessException|InstantiationException e) { e.printStackTrace(); return new ArrayList<>(); } } private boolean isClazzExists(Clazz clazz){ try { return repository.getByKeyword(clazz.getName(),new String[]{Clazz.COLUMN_NAME},true) .size()>0; } catch (IllegalAccessException|InstantiationException e) { e.printStackTrace(); return true; } } public boolean addClazz(Clazz clazz){ try{ if(!isClazzExists(clazz)){ repository.insert(clazz); return true; } }catch (Exception e){ e.printStackTrace(); } return false; } public boolean delete(Clazz clazz){ try{ if(isClazzEmpty(clazz)){ repository.delete(clazz); return true; } }catch (Exception e){ e.printStackTrace(); } return false; } public void update(Clazz clazz){ repository.update(clazz); } public int getClazzCount(Clazz clazz){ return StudentFactory.getInstance().getByClazz(clazz.getId()).size(); } private boolean isClazzEmpty(Clazz clazz){ return getClazzCount(clazz)==0; } }
[ "lzzy_gxy@163.com" ]
lzzy_gxy@163.com
a12942f9ec836483087ef8fddb654349e9c033f2
1207da00c662bf08abc5a3b5140eef3894e192d1
/Fragment/app/src/androidTest/java/www/smktelkommlg/sch/fragment/ExampleInstrumentedTest.java
00e52b2f595fe436dd57214d7f2098994e56d89a
[]
no_license
Alfian29/Fragment
391df68b192d244935405ae25a2af946db22bef4
050b350e2c9bfa83442490c0bfe0d88cb64412c7
refs/heads/master
2020-04-29T16:39:44.689910
2019-03-18T23:07:44
2019-03-18T23:07:44
176,269,338
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package www.smktelkommlg.sch.fragment; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("www.smktelkommlg.sch.fragment", appContext.getPackageName()); } }
[ "muhammad_alfian_26rpl@student.smktelkom-mlg.sch.id" ]
muhammad_alfian_26rpl@student.smktelkom-mlg.sch.id
f096a7f5ce9c2e3338709503d73a925bac0f75f1
858b75b9abfe218d1861657d49dba9318a956199
/src/com/leslie/gamevideo/jsonparser/BannerParser.java
d1436ec6960edc7dfee6145d777445e8ce300872
[]
no_license
hualia2009/gamevideo
bc995c42f463982569f0e30cab442ff3309ad389
a76d0a0c14c576fd14a03f968602136801f13329
refs/heads/master
2021-01-19T21:48:24.493167
2014-02-07T03:02:33
2014-02-07T03:02:33
16,138,479
0
0
null
null
null
null
UTF-8
Java
false
false
2,215
java
package com.leslie.gamevideo.jsonparser; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.util.Log; import com.leslie.gamevideo.entity.Banner; import com.leslie.gamevideo.utils.Config; import com.leslie.gamevideo.utils.JsonParseUtil; import com.leslie.gamevideo.utils.Utils; /** * 首页gallery资源解析类 */ public class BannerParser implements Serializable{ private static final long serialVersionUID = 1L; public static List<Banner> parse(String returnData){ List<Banner> banners=new ArrayList<Banner>(); if(JsonParseUtil.isEmptyOrNull(returnData)){ return null; } JSONObject jsonObject; try { jsonObject = new JSONObject(returnData); String sparkId = jsonObject.getString("sparkid"); if(JsonParseUtil.isEmptyOrNull(sparkId)){ Log.e("BannerParser", "sparkid is wrong!"); }else{ Config.uid = sparkId; } String bannerList=jsonObject.getString("videos"); if(JsonParseUtil.isEmptyOrNull(bannerList)){ return null; } JSONArray jsonArray = new JSONArray(bannerList); for (int i = 0; i < jsonArray.length(); i++) { JSONObject bannerJson = (JSONObject) jsonArray.opt(i); Banner banner=new Banner(); banner.setMid(bannerJson.getString("mid")); banner.setTitle(bannerJson.getString("bannertitle")); banner.setViewcount( bannerJson.getString("viewcount")); banner.setVideoflag(bannerJson.getString("videoflag")); int duration=Integer.parseInt(bannerJson.getString("duration")); banner.setDuration(Utils.formatDuration(duration)); banner.setDescription(bannerJson.getString("description")); banner.setChannel(bannerJson.getString("channel")); banner.setBigthumbnail( bannerJson.getString("bigthumbnail")); banner.setSmallthumbnail (bannerJson.getString("smallthumbnail")); banner.setNormalthumbnail (bannerJson.getString("normalthumbnail")); banners.add(banner); } } catch (JSONException e) { Log.e("BannerParser", "json数据解析失败"); } return banners; } }
[ "hualia2009@126.com" ]
hualia2009@126.com
66c76b69c77f106999aaad944c3f7212cd41c3ab
10ed03fb1de2d1775d0378807ce8c27bf44fa50f
/TestDB/src/CheckLoadJDBC.java
67ed5d467ab7810f739692dc6fbd240ffd76b8c7
[]
no_license
Kotoragoon/test
53c85975754351a5e7f08df0b19ada29c11d6026
a15e823ba06ed631ee4de1ea52b57c97d22d435b
refs/heads/master
2020-03-21T06:45:09.564404
2018-06-22T01:56:09
2018-06-22T01:56:09
132,847,265
0
0
null
null
null
null
UTF-8
Java
false
false
400
java
public class CheckLoadJDBC{ public static void main(String[] agrs)throws InstantiationException,IllegalAccessException{ String msg = ""; try{ Class.forName("com.mysql.jdbc.Driver").newInstance(); msg = "ドライバのロードに成功しました"; } catch (ClassNotFoundException e){ msg = "ドライバのロードに失敗しました"; } System.out.println(msg); } }
[ "tabasco.metal@gmail.com" ]
tabasco.metal@gmail.com
96a754a407a03900122d2e1acc3b53faa429adb4
095e7367a89bd1d5649ea1fcacfa05e6ee4b510d
/web/view-mh/src/main/java/com/yzz/view/oa/controller/IndexController.java
0d44deb5f949b59f91ec15b225752a491d0404fd
[]
no_license
yinzhongzheng/rxcq
3327c44d87b1eca4e3a9f6d370ac0b629fa07122
bcbd1e5b995921566e4a5e13e55e330ddc2dacf5
refs/heads/master
2020-04-15T12:52:56.213142
2019-02-07T09:33:31
2019-02-07T09:33:31
164,690,766
0
0
null
null
null
null
UTF-8
Java
false
false
1,948
java
package com.yzz.view.oa.controller; import com.yzz.common.Code; import com.yzz.user.api.ILogin; import com.yzz.user.api.dto.LoginModel; import com.yzz.view.oa.controller.support.ResponseData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; /** * */ @Controller @RequestMapping("/index/") public class IndexController extends BaseController { @Autowired private ILogin login; @RequestMapping(value = "/index", method = RequestMethod.GET) public String index(HttpServletRequest request) { if (request.getSession().getAttribute("user") == null) { return "/login"; } return "/index"; } @RequestMapping(value = "/login", method = RequestMethod.GET) public String login() { return "/login"; } @RequestMapping(value = "/submitLogin", method = RequestMethod.POST) @ResponseBody public ResponseData submitLogin(HttpServletRequest request, String loginname, String password) { LoginModel loginModel = new LoginModel(); loginModel.setName(loginname); loginModel.setPassword(password); Code code = login.login(loginModel); request.getSession().setAttribute("user","root"); return setEnumResult(code, "/"); } /** * 退出 * * @return */ @RequestMapping(value = "/logout", method = RequestMethod.GET) public String logout(HttpServletRequest request) { try { request.getSession().removeAttribute("user"); } catch (Exception e) { LOG.error("errorMessage:" + e.getMessage()); } return redirectTo("/index/login.shtml"); } }
[ "yzzstyle@163.com" ]
yzzstyle@163.com
77acb8576ee352a40c13b09ea7ef19ce32a6df64
9d9394249f438feff0e7014b52018476b2d2de3d
/Lab4/Zad21/Producer.java
9c85054a9c74b677787fcbbf04974ac0eadccd6e
[]
no_license
bielakarolina/theory_of_concurrency
622ba5489993d8ef598eed19ea58ae8b587e4491
e1d8e353e31ab9cc8dba8bea5942c7325e616bfc
refs/heads/master
2020-04-02T13:23:55.166232
2018-11-20T18:57:35
2018-11-20T18:57:35
154,479,483
0
0
null
null
null
null
UTF-8
Java
false
false
961
java
package Lab4.Zad21; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.util.Random; public class Producer extends Job implements Runnable { public Producer(int id, Monitor m) { super(id, m); } File plik = new File("czasProducent2.txt"); @Override public void run() { Random generator = new Random(); int rand = generator.nextInt(Main.M/2) + 1;; long systime = System.nanoTime(); try { System.out.println("Producent " + id + " rozpoczyna produkowanie "+ rand + " elementów;"); monitor.produce(rand, id); long estimatedPutTime = System.nanoTime() - systime; System.out.println("Producent " + id + " zakończył produkowanie "+ rand + " elementów;"); FileWriter file = new FileWriter("czasProducent2.txt", true); BufferedWriter out = new BufferedWriter(file); out.write((double)estimatedPutTime/1000000000.0 + " , " + rand + "\n"); out.close(); }catch(Exception e) {} } }
[ "bielakarolina77@gmail.com" ]
bielakarolina77@gmail.com
8af44e6446138a5cbca31552240a7b73f9a7cc2c
481cd67581d15bcb77bafaf167b3f520ef12e681
/app/src/main/java/com/nickteck/cus_prawnandcrab/activity/SplashActivity.java
cb6f5b9f44023780388c30b0f136b1a31473eb22
[]
no_license
priyadharsini586/PrawnAndCrab
cf58d4e4ae668d66c22ac1764fb1fa93de84f44a
02f25d37dc6bc5a1ac8ad27624933a36d0e9bd57
refs/heads/master
2020-03-17T10:41:50.309468
2018-06-08T06:29:32
2018-06-08T06:29:32
133,521,938
0
0
null
null
null
null
UTF-8
Java
false
false
1,910
java
package com.nickteck.cus_prawnandcrab.activity; import android.annotation.SuppressLint; import android.content.Intent; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.os.Handler; import android.view.MotionEvent; import android.view.View; import android.view.Window; import android.view.WindowManager; import com.nickteck.cus_prawnandcrab.Db.Database; import com.nickteck.cus_prawnandcrab.R; /** * An example full-screen activity that shows and hides the system UI (i.e. * status bar and navigation/system bar) with user interaction. */ public class SplashActivity extends AppCompatActivity { int SPLASH_TIME_OUT = 1000; Database database; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_splash); database = new Database(getApplicationContext()); new Handler().postDelayed(new Runnable() { @Override public void run() { if (database.checkTables()) { Intent i = new Intent(SplashActivity.this, MenuNavigationActivity.class); startActivity(i); overridePendingTransition(R.anim.enter_from_left,R.anim.exit_to_right); finish(); }else { Intent i = new Intent(SplashActivity.this, LoginActivity.class); startActivity(i); overridePendingTransition(R.anim.fadein,R.anim.fadeout); finish(); } } }, SPLASH_TIME_OUT); } }
[ "priyadharsini586@gmail.com" ]
priyadharsini586@gmail.com
51872c3ae45d705e75361462910c20ba16ddb0cd
0e6d2bb9480c305ac74f5adbf3e8a2bb86a5c433
/src/main/java/com/juaracoding/serviceapi/entity/ERole.java
d7c53bb311e3a33955b88f3c5058873dc5e918ea
[]
no_license
wenang01/HelloPetsServiceUmi
ab7398c9ae87cc8a6b00b68eff7c53ade3f77546
149bbbfbd729b6583a21c10b2b84c88f582187b5
refs/heads/main
2023-05-30T16:58:20.229004
2021-06-25T07:00:19
2021-06-25T07:00:19
379,862,431
0
0
null
null
null
null
UTF-8
Java
false
false
112
java
package com.juaracoding.serviceapi.entity; public enum ERole { ROLE_USER, ROLE_MODERATOR, ROLE_ADMIN }
[ "wenangbackup@gmail.com" ]
wenangbackup@gmail.com
09eb6170bafb6267a9eb2927eba39990f2711008
d76a1880af185cd997f437953ad55ff8e8ad93f5
/src/test/java/br/com/escola/dominio/aluno/TelefoneTest.java
53775b521eeda9a6fa392b807db730bdf66d864a
[]
no_license
donadonandre/escola
edca02c15a17099c2381be709e5eadc0c2c53ef2
7681a725d60861acf09b554d6e6fdbf332431d45
refs/heads/master
2023-04-20T12:35:10.726054
2021-05-11T20:38:50
2021-05-11T20:38:50
365,579,858
0
0
null
null
null
null
UTF-8
Java
false
false
562
java
package br.com.escola.dominio.aluno; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertThrows; public class TelefoneTest { @Test void naoDeveriaCriarTelefoneComDDDsInvalidos() { assertThrows(IllegalArgumentException.class, () -> new Telefone(null, "123456789")); assertThrows(IllegalArgumentException.class, () -> new Telefone("", "123456789")); assertThrows(IllegalArgumentException.class, () -> new Telefone("1", "123456789")); } }
[ "andre.donadon@outlook.com" ]
andre.donadon@outlook.com
27511f7c3da79d79480287a2b304f5708194b4da
ffd7c373bdd6eae0a638ed1ff3b806e3aa3b0557
/src/main/java/com/github/agadar/nationstates/happeningspecializer/dispatch/DispatchHappeningSpecializer.java
5d75d4fd571a476101977e69a28f9ff4faabb45b
[]
no_license
Agadar/NationStates-API-Java-Wrapper
329b43026e1e6c307011a687b457ae197d35afa1
b2187e8c2510d6e3e1a7d6ccb2b633082bd4e4db
refs/heads/master
2023-06-22T11:57:30.215607
2020-08-16T20:09:33
2020-08-16T20:09:33
62,467,929
6
1
null
2023-06-13T07:05:00
2016-07-02T20:07:21
Java
UTF-8
Java
false
false
1,539
java
package com.github.agadar.nationstates.happeningspecializer.dispatch; import java.util.regex.Pattern; import com.github.agadar.nationstates.domain.common.happening.DispatchHappening; import com.github.agadar.nationstates.domain.common.happening.Happening; import com.github.agadar.nationstates.enumerator.DispatchCategory; import com.github.agadar.nationstates.enumerator.DispatchSubCategory; import com.github.agadar.nationstates.happeningspecializer.HappeningSpecializer; /** * Specializes generic Happenings to DispatchHappenings. * * @author Agadar (https://github.com/Agadar/) * */ public class DispatchHappeningSpecializer implements HappeningSpecializer<DispatchHappening> { private final Pattern pattern = Pattern .compile("@@(.+)@@ published \"(?!<a href=\"page=dispatch\\/id=.+\">)(.+)\" \\((.+): (.+)\\)\\."); @Override public boolean isOfSpecializedType(Happening happening) { String description = happening.getDescription(); return pattern.matcher(description).find(); } @Override public DispatchHappening toSpecializedType(Happening happening) { var matcher = pattern.matcher(happening.getDescription()); matcher.find(); String author = matcher.group(1); String dispatchName = matcher.group(2); var category = DispatchCategory.fromString(matcher.group(3)); var subcategory = DispatchSubCategory.fromString(matcher.group(4)); return new DispatchHappening(happening.getId(), happening.getTimestamp(), happening.getDescription(), author, 0, dispatchName, category, subcategory); } }
[ "martin.donkersloot@outlook.com" ]
martin.donkersloot@outlook.com
652b1157b76d5182e8d94c525b4e21244479de71
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/transform/TargetGroupPairInfoJsonUnmarshaller.java
d9e4e70a2addc20723d341f455a2e945c397a678
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
3,393
java
/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.codedeploy.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.codedeploy.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * TargetGroupPairInfo JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TargetGroupPairInfoJsonUnmarshaller implements Unmarshaller<TargetGroupPairInfo, JsonUnmarshallerContext> { public TargetGroupPairInfo unmarshall(JsonUnmarshallerContext context) throws Exception { TargetGroupPairInfo targetGroupPairInfo = new TargetGroupPairInfo(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("targetGroups", targetDepth)) { context.nextToken(); targetGroupPairInfo.setTargetGroups(new ListUnmarshaller<TargetGroupInfo>(TargetGroupInfoJsonUnmarshaller.getInstance()) .unmarshall(context)); } if (context.testExpression("prodTrafficRoute", targetDepth)) { context.nextToken(); targetGroupPairInfo.setProdTrafficRoute(TrafficRouteJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("testTrafficRoute", targetDepth)) { context.nextToken(); targetGroupPairInfo.setTestTrafficRoute(TrafficRouteJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return targetGroupPairInfo; } private static TargetGroupPairInfoJsonUnmarshaller instance; public static TargetGroupPairInfoJsonUnmarshaller getInstance() { if (instance == null) instance = new TargetGroupPairInfoJsonUnmarshaller(); return instance; } }
[ "" ]
a4f5a90467347fb683aca8c3ebf395aab28935b7
a91c52006f8dfab723fca44e4ac93ebdc8a883e8
/android/src/de/iweinzierl/timetracking/event/HasProjectsChangedListeners.java
04be80be35a97d99e3460fd2ad90e7cad18e31e2
[]
no_license
kefs/timetracker
cb1efcbbd6009cc04517eb7b91941d9b430a3703
2b24d051ff3718e9bec15c0caa70414bcc1c1612
refs/heads/master
2020-04-15T09:31:09.612064
2013-05-20T14:27:40
2013-05-20T14:27:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
169
java
package de.iweinzierl.timetracking.event; public interface HasProjectsChangedListeners { void registerProjectsChangedListener(ProjectsChangedListener listener); }
[ "weinzierl.ingo@gmail.com" ]
weinzierl.ingo@gmail.com
d7994683172d53f0fb20e46e8738b4a35abaaf58
e6c7a6158bc707316cfd7f4d8768c3ab2e2a3f8a
/src/main/java/com/zhch/example/commons/http/v4_5/ProxyTunnelDemo.java
5b66581f29ceb1f96ad052ee04329e98a9c8989a
[]
no_license
qinglangee/code-example
cd1028d9fa44fa6c7fecfc6a4aa5dd19ec30b368
aefda9af41e5e2ce3cddd6c97353c4dc5a2317d5
refs/heads/master
2022-12-20T22:31:42.716412
2022-01-08T09:00:01
2022-01-08T09:00:01
5,000,203
1
1
null
2022-12-16T03:49:11
2012-07-12T07:20:31
Java
UTF-8
Java
false
false
3,956
java
/* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package com.zhch.example.commons.http.v4_5; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.Socket; import org.apache.http.HttpHost; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.impl.client.ProxyClient; import org.apache.http.protocol.HTTP; /** * Example code for using {@link ProxyClient} in order to establish a tunnel * through an HTTP proxy. */ public class ProxyTunnelDemo { /** * 官方提供的 demo * * @throws Exception */ public final static void officalDemo() throws Exception { ProxyClient proxyClient = new ProxyClient(); HttpHost target = new HttpHost("www.yahoo.com", 80); HttpHost proxy = new HttpHost("localhost", 8888); UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("user", "pwd"); Socket socket = proxyClient.tunnel(proxy, target, credentials); try { Writer out = new OutputStreamWriter(socket.getOutputStream(), HTTP.DEF_CONTENT_CHARSET); out.write("GET / HTTP/1.1\r\n"); out.write("Host: " + target.toHostString() + "\r\n"); out.write("Agent: whatever\r\n"); out.write("Connection: close\r\n"); out.write("\r\n"); out.flush(); BufferedReader in = new BufferedReader( new InputStreamReader(socket.getInputStream(), HTTP.DEF_CONTENT_CHARSET)); String line = null; while ((line = in.readLine()) != null) { System.out.println(line); } } finally { socket.close(); } } /** * 官方 demo 的修改版, 改了一点点 * * @throws Exception */ public final static void zhchModifyDemo() throws Exception { ProxyClient proxyClient = new ProxyClient(); HttpHost target = new HttpHost("pan.baidu.com", 80); // HttpHost proxy = new HttpHost("120.24.0.162", 80); HttpHost proxy = new HttpHost("127.0.0.1", 80); UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("abc", "def"); System.out.println("before tunnel."); Socket socket = proxyClient.tunnel(proxy, target, credentials); System.out.println("after tunnel."); try { Writer out = new OutputStreamWriter(socket.getOutputStream(), HTTP.DEF_CONTENT_CHARSET); out.write("GET / HTTP/1.1\r\n"); out.write("Host: " + target.toHostString() + "\r\n"); out.write("Agent: whatever\r\n"); out.write("Connection: close\r\n"); out.write("\r\n"); out.flush(); BufferedReader in = new BufferedReader( new InputStreamReader(socket.getInputStream(), HTTP.DEF_CONTENT_CHARSET)); String line = null; while ((line = in.readLine()) != null) { System.out.println(line); } } finally { socket.close(); } } public static void main(String[] args) throws Exception { zhchModifyDemo(); } }
[ "zhchqingdao@163.com" ]
zhchqingdao@163.com
21bbae522c8e6ada90cc9319204e87f3c2c01ed6
de913fef744a2939ac3002e291439689e343ca58
/src/com/ib/arrays/Utility.java
6fa0a196732ff3036c831f81322f3c21227fc0f1
[]
no_license
hzulfa/Coding
cfb94bc7925531279b7b9c64c1ef2752a9811214
40539867c4bedea2bb1518a938d61055fbfca433
refs/heads/master
2021-01-12T13:14:26.733444
2016-12-04T19:56:20
2016-12-04T19:56:20
72,157,900
0
0
null
null
null
null
UTF-8
Java
false
false
558
java
package com.ib.arrays; import java.util.ArrayList; /** * Created by ummehunn on 11/8/2016. */ public class Utility { public static void printArray(ArrayList<?> a){ for(int i = 0; i<a.size(); i++){ System.out.println(a.get(i)); } } public static void printArray2D(ArrayList<ArrayList<Integer>> a){ for(int i = 0; i<a.size(); i++) { for (int j = 0; j < a.get(0).size(); j++) { System.out.print(a.get(i).get(j)); } System.out.println(); } } }
[ "ummehunn@ca.ibm.com" ]
ummehunn@ca.ibm.com
1f1858e12c4b59a5b9c48111bfc65c91ca626a49
53e667a6464a1f18a2ab7dcafa436005e9aa7422
/PopularMovies1.1/app/src/main/java/com/androidproject/popularmovies11/SettingsActivity.java
174eeaf3859edc1e78c9cc4e55c8a488e0386561
[]
no_license
mohangprabhu/NewGitRepository
6acc94b92d08aa2786cae237ee3764a739ee33fb
4e316558d8f6f8d8bcd2784d813dc95d2365f11f
refs/heads/master
2020-12-11T22:16:51.982826
2016-05-01T15:03:24
2016-05-01T15:03:24
49,367,999
0
0
null
null
null
null
UTF-8
Java
false
false
2,475
java
package com.androidproject.popularmovies11; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; public class SettingsActivity extends PreferenceActivity implements Preference.OnPreferenceChangeListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Add 'general' preferences, defined in the XML file addPreferencesFromResource(R.xml.pref_general); // For all preferences, attach an OnPreferenceChangeListener so the UI summary can be // updated when the preference changes. bindPreferenceSummaryToValue(findPreference(getString(R.string.key_sort_by))); // bindPreferenceSummaryToValue(findPreference(getString(R.string.key_adult_movies))); } /** * Attaches a listener so the summary is always updated with the preference value. * Also fires the listener once, to initialize the summary (so it shows up before the value * is changed.) */ private void bindPreferenceSummaryToValue(Preference preference) { // Set the listener to watch for value changes. preference.setOnPreferenceChangeListener(this); // Trigger the listener immediately with the preference's // current value. onPreferenceChange(preference, PreferenceManager .getDefaultSharedPreferences(preference.getContext()) .getString(preference.getKey(), "")); } @Override public boolean onPreferenceChange(Preference preference, Object newValue) { String stringValue = newValue.toString(); if (preference instanceof ListPreference) { // For list preferences, look up the correct display value in // the preference's 'entries' list (since they have separate labels/values). ListPreference listPreference = (ListPreference) preference; int prefIndex = listPreference.findIndexOfValue(stringValue); if (prefIndex >= 0) { preference.setSummary(listPreference.getEntries()[prefIndex]); } } else { // For other preferences, set the summary to the value's simple string representation. preference.setSummary(stringValue); } return true; } }
[ "mohangprabhu@gmail.com" ]
mohangprabhu@gmail.com
dfb380b545ca996c51402995d67b263587bc6b9c
532960b369d1364e7ed58e6a3650f3f43c6d7dac
/src/main/java/com/openkm/omr/OMRHelper.java
c03de2a9d8d3629cd2bdd54bafbbe137651151b2
[]
no_license
okelah/openkm-code
f0c02062d909b2d5e185b9784b33a9b8753be948
d9e0687e0c6dab385cac0ce8b975cb92c8867743
refs/heads/master
2021-01-13T15:53:59.286016
2016-08-18T22:06:25
2016-08-18T22:06:25
76,772,981
1
1
null
null
null
null
UTF-8
Java
false
false
10,326
java
/** * OpenKM, Open Document Management System (http://www.openkm.com) * Copyright (c) 2006-2015 Paco Avila & Josep Llort * * No bytes were intentionally harmed during the development of this application. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 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, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package com.openkm.omr; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sourceforge.jiu.codecs.InvalidFileStructureException; import net.sourceforge.jiu.codecs.InvalidImageIndexException; import net.sourceforge.jiu.codecs.UnsupportedTypeException; import net.sourceforge.jiu.data.Gray8Image; import net.sourceforge.jiu.ops.MissingParameterException; import net.sourceforge.jiu.ops.WrongParameterException; import org.apache.commons.io.IOUtils; import com.openkm.api.OKMDocument; import com.openkm.api.OKMPropertyGroup; import com.openkm.api.OKMRepository; import com.openkm.automation.AutomationException; import com.openkm.bean.Document; import com.openkm.bean.PropertyGroup; import com.openkm.bean.form.FormElement; import com.openkm.bean.form.Select; import com.openkm.core.AccessDeniedException; import com.openkm.core.DatabaseException; import com.openkm.core.LockException; import com.openkm.core.MimeTypeConfig; import com.openkm.core.NoSuchGroupException; import com.openkm.core.NoSuchPropertyException; import com.openkm.core.ParseException; import com.openkm.core.PathNotFoundException; import com.openkm.core.RepositoryException; import com.openkm.dao.OmrDAO; import com.openkm.dao.bean.Omr; import com.openkm.extension.core.ExtensionException; import com.openkm.util.FileUtils; /** * OMRHelper * * @author jllort */ public class OMRHelper { public static final String ASC_FILE = "ASC_FILE"; public static final String CONFIG_FILE = "CONFIG_FILE"; /** * isValid */ public static boolean isValid(Document doc) { return doc.getMimeType().equals(MimeTypeConfig.MIME_PNG); } /** * trainingTemplate */ public static Map<String, File> trainingTemplate(File template) throws IOException, InvalidFileStructureException, InvalidImageIndexException, UnsupportedTypeException, MissingParameterException, WrongParameterException { Map<String, File> fileMap = new HashMap<String, File>(); Gray8Image grayimage = ImageUtil.readImage(template.getCanonicalPath()); ImageManipulation image = new ImageManipulation(grayimage); image.locateConcentricCircles(); image.locateMarks(); File ascFile = FileUtils.createTempFile(); File configFile = FileUtils.createTempFile(); image.writeAscTemplate(ascFile.getCanonicalPath()); image.writeConfig(configFile.getCanonicalPath()); fileMap.put(ASC_FILE, ascFile); fileMap.put(CONFIG_FILE, configFile); return fileMap; } /** * process */ public static Map<String, String> process(File fileToProcess, long omId) throws IOException, OMRException, DatabaseException, InvalidFileStructureException, InvalidImageIndexException, UnsupportedTypeException, MissingParameterException, WrongParameterException { Map<String, String> values = new HashMap<String, String>(); Omr omr = OmrDAO.getInstance().findByPk(omId); InputStream asc = new ByteArrayInputStream(omr.getAscFileContent()); InputStream config = new ByteArrayInputStream(omr.getConfigFileContent()); InputStream fields = new ByteArrayInputStream(omr.getFieldsFileContent()); if (asc != null && asc.available() > 0 && config != null && config.available() > 0 && fields != null && fields.available() > 0) { Gray8Image grayimage = ImageUtil.readImage(fileToProcess.getCanonicalPath()); if (grayimage == null) { throw new OMRException("Not able to process the image as gray image"); } ImageManipulation image = new ImageManipulation(grayimage); image.locateConcentricCircles(); image.readConfig(config); image.readFields(fields); image.readAscTemplate(asc); image.searchMarks(); File dataFile = FileUtils.createTempFile(); image.saveData(dataFile.getCanonicalPath()); // Parse data file FileInputStream dfStream = new FileInputStream(dataFile); DataInputStream in = new DataInputStream(dfStream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; while ((strLine = br.readLine()) != null) { // format key=value ( looking for first = ) String key = ""; String value = ""; if (strLine.contains("=")) { key = strLine.substring(0, strLine.indexOf("=")); value = strLine.substring(strLine.indexOf("=") + 1); value = value.trim(); } if (!key.equals("")) { if (value.equals("")) { IOUtils.closeQuietly(br); IOUtils.closeQuietly(in); IOUtils.closeQuietly(dfStream); IOUtils.closeQuietly(asc); IOUtils.closeQuietly(config); IOUtils.closeQuietly(fields); throw new OMRException("Empty value"); } if (omr.getProperties().contains(key)) { values.put(key, value); } } } IOUtils.closeQuietly(br); IOUtils.closeQuietly(in); IOUtils.closeQuietly(dfStream); IOUtils.closeQuietly(asc); IOUtils.closeQuietly(config); IOUtils.closeQuietly(fields); FileUtils.deleteQuietly(dataFile); return values; } else { throw new OMRException("Error asc, config or fields files not found"); } } /** * storeMetadata */ public static void storeMetadata(Map<String, String> results, String docPath) throws IOException, ParseException, PathNotFoundException, RepositoryException, DatabaseException, NoSuchGroupException, LockException, AccessDeniedException, ExtensionException, AutomationException, NoSuchPropertyException, OMRException { List<String> groups = new ArrayList<String>(); for (String key : results.keySet()) { if (key.contains(":")) { String grpName = key.substring(0, key.indexOf(".")); // convert to okg (group name always start with okg ) grpName = grpName.replace("okp", "okg"); if (!groups.contains(grpName)) { groups.add(grpName); } } } // Add missing groups for (PropertyGroup registeredGroup : OKMPropertyGroup.getInstance().getGroups(null, docPath)) { if (groups.contains(registeredGroup.getName())) { groups.remove(registeredGroup.getName()); } } // Add properties for (String grpName : groups) { OKMPropertyGroup.getInstance().addGroup(null, docPath, grpName); // convert okg to okp ( property format ) String propertyBeginning = grpName.replace("okg", "okp"); Map<String, String> properties = new HashMap<String, String>(); for (String key : results.keySet()) { if (key.startsWith(propertyBeginning)) { String value = results.get(key); // Evaluate select multiple otherside throw exception if (value.contains(" ")) { for (FormElement formElement : OKMPropertyGroup.getInstance().getPropertyGroupForm(null, grpName)) { if (formElement.getName().equals(key) && formElement instanceof Select) { if (!((Select) formElement).getType().equals(Select.TYPE_MULTIPLE)) { throw new OMRException( "Found multiple value in a non multiple select. White space indicates multiple value"); } else { // Change " " to ";" the way to pass // multiple values into setPropertiesSimple value = value.replaceAll(" ", ";"); } } } } properties.put(key, value); } } OKMPropertyGroup.getInstance().setPropertiesSimple(null, docPath, grpName, properties); } } /** * processAndStoreMetadata */ public static void processAndStoreMetadata(long omId, String uuid) throws IOException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, OMRException, NoSuchGroupException, LockException, ExtensionException, ParseException, NoSuchPropertyException, AutomationException, InvalidFileStructureException, InvalidImageIndexException, UnsupportedTypeException, MissingParameterException, WrongParameterException { InputStream is = null; File fileToProcess = null; try { String docPath = OKMRepository.getInstance().getNodePath(null, uuid); // create tmp content file fileToProcess = FileUtils.createTempFile(); is = OKMDocument.getInstance().getContent(null, docPath, false); FileUtils.copy(is, fileToProcess); is.close(); // process Map<String, String> results = OMRHelper.process(fileToProcess, omId); OMRHelper.storeMetadata(results, docPath); } catch (IOException e) { throw e; } catch (PathNotFoundException e) { throw e; } catch (AccessDeniedException e) { throw e; } catch (RepositoryException e) { throw e; } catch (DatabaseException e) { throw e; } catch (OMRException e) { throw e; } catch (NoSuchGroupException e) { throw e; } catch (LockException e) { throw e; } catch (ExtensionException e) { throw e; } catch (ParseException e) { throw e; } catch (NoSuchPropertyException e) { throw e; } catch (AutomationException e) { throw e; } catch (InvalidFileStructureException e) { throw e; } catch (InvalidImageIndexException e) { throw e; } catch (UnsupportedTypeException e) { throw e; } catch (MissingParameterException e) { throw e; } catch (WrongParameterException e) { throw e; } finally { FileUtils.deleteQuietly(fileToProcess); } } }
[ "github@sven-joerns.de" ]
github@sven-joerns.de
651ba7db61dd0c4051df3c762172cf6f774bcd91
7e1425980804434163c94cb21d7cf52e5522ccdf
/Update.java
b229a64d5ea753a2c8688a11ef5ba6c4ee05c9d0
[]
no_license
Yousefalwandi/TheGameProject
8863da7cbf4fe67d5416f0f4101333567d779951
d64765c3abd2298da638b6117c187f0c8f68010c
refs/heads/main
2023-03-03T23:19:45.405388
2021-02-14T13:43:37
2021-02-14T13:43:37
338,813,702
0
0
null
null
null
null
UTF-8
Java
false
false
885
java
public class Update implements Runnable{ @Override public void run() { while(Game.gameIsOn){ int current_room = Game.player.getCurrent_room(); // Set room Game.gui.setShowRoom(Game.rooms[current_room-1].show()); // Set player inventory Game.gui.setShowInventory(Game.player.getInventory()); // Set NPCS in room Game.gui.setShowPersons(Game.getNpcs(current_room)); // Check if end found if(Game.player.getInventory().findItem("End").length > 0){ System.out.println("End item found, quiting game"); Game.exit(); } try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } }
[ "noreply@github.com" ]
Yousefalwandi.noreply@github.com
f62426e2f96c901fa6ad436b6a08cc36718c017e
14939bab24058b4f6fe0f34b3a910a1c344358f9
/library/xuxiaoxing/src/main/java/com/xiaoxing/common/third/recyclerview/lrecyclerview/util/LuRecyclerViewUtils.java
6ae068eb53f6bdaa2cabe47022b1e850d698b6fb
[]
no_license
xx753940262/xuxiaoxing
f3d426937ae73d92c8fe5b5de5eb676c8d9a84a8
37a188716a3b67837aae8c1401414c4ef2cfeda7
refs/heads/master
2020-05-21T19:55:46.601762
2017-05-06T08:52:37
2017-05-06T08:52:37
65,193,229
0
0
null
null
null
null
UTF-8
Java
false
false
4,135
java
package com.xiaoxing.common.third.recyclerview.lrecyclerview.util; import android.support.v7.widget.RecyclerView; import android.view.View; import com.xiaoxing.common.third.recyclerview.lrecyclerview.recyclerview.LuRecyclerViewAdapter; /** * * @author lizhixian * @time 16/9/10 09:54 */ public class LuRecyclerViewUtils { /** * 设置HeaderView * * @param recyclerView * @param view */ @Deprecated public static void setHeaderView(RecyclerView recyclerView, View view) { RecyclerView.Adapter outerAdapter = recyclerView.getAdapter(); if (outerAdapter == null || !(outerAdapter instanceof LuRecyclerViewAdapter)) { return; } LuRecyclerViewAdapter luRecyclerViewAdapter = (LuRecyclerViewAdapter) outerAdapter; luRecyclerViewAdapter.addHeaderView(view); } /** * 设置FooterView * * @param recyclerView * @param view */ @Deprecated public static void setFooterView(RecyclerView recyclerView, View view) { RecyclerView.Adapter outerAdapter = recyclerView.getAdapter(); if (outerAdapter == null || !(outerAdapter instanceof LuRecyclerViewAdapter)) { return; } LuRecyclerViewAdapter luRecyclerViewAdapter = (LuRecyclerViewAdapter) outerAdapter; if (luRecyclerViewAdapter.getFooterViewsCount() > 0) { luRecyclerViewAdapter.removeFooterView(); } luRecyclerViewAdapter.addFooterView(view); } /** * 移除FooterView * * @param recyclerView */ public static void removeFooterView(RecyclerView recyclerView) { RecyclerView.Adapter outerAdapter = recyclerView.getAdapter(); if (outerAdapter != null && outerAdapter instanceof LuRecyclerViewAdapter) { int footerViewCounter = ((LuRecyclerViewAdapter) outerAdapter).getFooterViewsCount(); if (footerViewCounter > 0) { ((LuRecyclerViewAdapter) outerAdapter).removeFooterView(); } } } /** * 移除HeaderView * * @param recyclerView */ public static void removeHeaderView(RecyclerView recyclerView) { RecyclerView.Adapter outerAdapter = recyclerView.getAdapter(); if (outerAdapter != null && outerAdapter instanceof LuRecyclerViewAdapter) { int headerViewCounter = ((LuRecyclerViewAdapter) outerAdapter).getHeaderViewsCount(); if (headerViewCounter > 0) { View headerView = ((LuRecyclerViewAdapter) outerAdapter).getHeaderView(); ((LuRecyclerViewAdapter) outerAdapter).removeHeaderView(headerView); } } } /** * 请使用本方法替代RecyclerView.ViewHolder的getLayoutPosition()方法 * * @param recyclerView * @param holder * @return */ public static int getLayoutPosition(RecyclerView recyclerView, RecyclerView.ViewHolder holder) { RecyclerView.Adapter outerAdapter = recyclerView.getAdapter(); if (outerAdapter != null && outerAdapter instanceof LuRecyclerViewAdapter) { int headerViewCounter = ((LuRecyclerViewAdapter) outerAdapter).getHeaderViewsCount(); if (headerViewCounter > 0) { return holder.getLayoutPosition() - headerViewCounter; } } return holder.getLayoutPosition(); } /** * 请使用本方法替代RecyclerView.ViewHolder的getAdapterPosition()方法 * * @param recyclerView * @param holder * @return */ public static int getAdapterPosition(RecyclerView recyclerView, RecyclerView.ViewHolder holder) { RecyclerView.Adapter outerAdapter = recyclerView.getAdapter(); if (outerAdapter != null && outerAdapter instanceof LuRecyclerViewAdapter) { int headerViewCounter = ((LuRecyclerViewAdapter) outerAdapter).getHeaderViewsCount(); if (headerViewCounter > 0) { return holder.getAdapterPosition() - headerViewCounter; } } return holder.getAdapterPosition(); } }
[ "753940262@qq.com" ]
753940262@qq.com
c49f3cab2f281531cea286c1b0151692d4ef4ccc
2affdaf9acdb00719e0f3edf2cc66a18b9adf18a
/p/src/test/java/com/heinhtet/deevd/p/ExampleUnitTest.java
696a968416bffc43a6737bad5964528a4c1ad56e
[ "MIT" ]
permissive
HeinXtet/P
ba1c58f97a8bd4c1d8be0c8dc166bdd66a755dbe
3f183804f9b82fab8354abdfdfc25c77d32bee65
refs/heads/master
2021-04-28T20:54:01.286748
2018-02-18T16:09:16
2018-02-18T16:09:16
121,938,443
3
1
null
null
null
null
UTF-8
Java
false
false
398
java
package com.heinhtet.deevd.p; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "moesatt93@gmail.com" ]
moesatt93@gmail.com
d17ef6e99ba48e7fa2de3bd361a7c3b6e9586bff
9717ffe8218b24702eb1af09e6ed4596be03f349
/Automation/src/script/VerifyInvalidLogin.java
1a700f21914ca4eb4c48725b5303b2e6fe0f28e9
[]
no_license
GovindarajDevan/Automation
0553c3088a8870c66ed3c3a4132f2e1cabea3dcd
a957c5075ed6b206792cd32f653fa47808d9b1f6
refs/heads/master
2021-01-22T10:36:27.385352
2017-02-15T15:21:21
2017-02-15T15:21:21
82,020,028
0
0
null
null
null
null
UTF-8
Java
false
false
572
java
package script; import org.testng.annotations.Test; public class VerifyInvalidLogin { @Test public void testVerifyValidLogin(){ //Enter valid un Loginpage l = new Loginpage(driver); l.setUserName("admin"); //Enter valid pw l.setPassword("manager"); //click login button l.ClickloginButton(); //verify the home page is displayed EnterTimeTrackpage e = new EnterTimeTrack(driver); e.verifyTitle("actiTime - Enter Time Track"); //click logoutii e.clickLogout(); //verify login page is displayed l.verifyTitle("actiTime- Login"); } }
[ "sreerajdevms@gmail.com" ]
sreerajdevms@gmail.com
5fa3c6909726147720d359275f93309091f86a6e
17a829c4f75eab13b29c8b3da32e6c9833c7bad8
/NeutrinoServer/src/neutrino/SnowWarManager/SnowWar.java
14c39c33c8fa39843f73278ba28ef6eaac174f7a
[]
no_license
hedapepa/Neutrino
f79d9b534f285183aa8f330a1994daf6d209c796
82a7bc07d8e87da1448abcb5630039e907492c00
refs/heads/master
2020-12-25T06:03:43.828539
2012-03-03T15:17:00
2012-03-03T15:17:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
23,488
java
package neutrino.SnowWarManager; import java.util.*; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import neutrino.CatalogManager.CatalogItem; import neutrino.Network.ThreadPool.ThreadPoolManager; import neutrino.PacketsInformation.ServerEvents; import neutrino.RoomManager.RoomModel; import neutrino.System.ServerMessage; import neutrino.UserManager.Habbo; import neutrino.UserManager.UserManager; public class SnowWar { // time to do some awesome things with this, bro! public int Id; public int ArenaId; public int TeamCount; public String Owner; public Map<Integer, Habbo> Players; public Map<Integer, Habbo> BlueTeam; public Map<Integer, Habbo> RedTeam; public Map<Integer, Habbo> YellowTeam; // secondary team, maybe soon? public Map<Integer, Habbo> GreenTeam; // secondary team, maybe soon? public int RestTime; public boolean StartedCounter; public int CurrentPlayers; public int MaxPlayers; public Habbo UserMoreKO; public Habbo UserMoreHits; public boolean IsStarted; public boolean IsFinished; public static Map<Integer, SnowWar> Wars; public static void InitSnowWarSystem() { // some things there?, soon Wars = new HashMap<Integer, SnowWar>(); } public static void SearchASnowWarForMe(Habbo cUser) throws Exception { // hmmm... Habbo User = Habbo.UsersbyId.get(cUser.Id); boolean IsOnAWar = false; if(Wars.size() > 0) { Iterator reader = Wars.entrySet().iterator(); while (reader.hasNext()) { SnowWar CurrentWar = (SnowWar)(((Map.Entry)reader.next()).getValue()); if(!CurrentWar.IsStarted && CurrentWar.CurrentPlayers != 10) { IsOnAWar = true; // add to this snow war User.CurrentWar = CurrentWar; CurrentWar.Players.put(User.Id, User); if(CurrentWar.BlueTeam.size() == 0 && CurrentWar.RedTeam.size() == 0) { CurrentWar.RedTeam.put(User.Id, User); CurrentWar.CurrentPlayers++; } else if(CurrentWar.RedTeam.size() == 5) { CurrentWar.BlueTeam.put(User.Id, User); CurrentWar.CurrentPlayers++; } else if(CurrentWar.BlueTeam.size() == 5) { CurrentWar.RedTeam.put(User.Id, User); CurrentWar.CurrentPlayers++; } else if(CurrentWar.RedTeam.size() > CurrentWar.BlueTeam.size()) { CurrentWar.BlueTeam.put(User.Id, User); CurrentWar.CurrentPlayers++; } else if(CurrentWar.RedTeam.size() < CurrentWar.BlueTeam.size()) { CurrentWar.RedTeam.put(User.Id, User); CurrentWar.CurrentPlayers++; } ServerMessage AddUser = new ServerMessage(ServerEvents.AddUsersToGame); AddUser.writeInt(User.Id); AddUser.writeUTF(User.UserName); AddUser.writeUTF(User.Look); AddUser.writeUTF(User.Gender.toLowerCase()); AddUser.writeInt(-1); AddUser.writeInt(0); // stars AddUser.writeInt(0); // points AddUser.writeInt(10); // points for next level AddUser.writeBoolean(false); Iterator reader2 = CurrentWar.Players.entrySet().iterator(); while (reader2.hasNext()) { Habbo xUser = (Habbo)(((Map.Entry)reader2.next()).getValue()); if(xUser.Id != User.Id) AddUser.Send(xUser.CurrentSocket); } if(CurrentWar.Players.size() > 1 && !CurrentWar.StartedCounter) { CurrentWar.StartedCounter = true; CurrentWar.RestTime = 15; ServerMessage Counter = new ServerMessage(ServerEvents.GameStartCounter); Counter.writeInt(15); // Seconds to Begin UserManager.SendMessageToAllSnowPlayers(CurrentWar, Counter); SnowWarCounter WarCounter = new SnowWarCounter(); WarCounter.GetData(CurrentWar); ScheduledFuture fut = ThreadPoolManager._myTimerPoolingThreads.scheduleAtFixedRate(WarCounter, 0L, 1L, TimeUnit.SECONDS); WarCounter.Set(fut); } else if(CurrentWar.Players.size() > 1 && CurrentWar.StartedCounter) { ServerMessage Counter = new ServerMessage(ServerEvents.GameStartCounter); Counter.writeInt(CurrentWar.RestTime); // Seconds to Begin Counter.Send(User.CurrentSocket); } } } } if(!IsOnAWar) { CreateANewWar(User); } } public void GoToLobby(SnowWar CurrentWar) throws Exception { //Thread.sleep(5000); ServerMessage GoToLobby = new ServerMessage(ServerEvents.GameStarted); CurrentWar.IsStarted = true; GoToLobby.writeInt(CurrentWar.Id); // GoToLobby.writeUTF("SnowStorm level " + CurrentWar.ArenaId); GoToLobby.writeInt(0); GoToLobby.writeInt(CurrentWar.ArenaId); // level GoToLobby.writeInt(CurrentWar.TeamCount); GoToLobby.writeInt(CurrentWar.MaxPlayers); GoToLobby.writeUTF(CurrentWar.Owner); // user name of room creator? GoToLobby.writeInt(14); GoToLobby.writeInt(CurrentWar.Players.size()); Iterator reader2 = CurrentWar.BlueTeam.entrySet().iterator(); while (reader2.hasNext()) { Habbo cUser = (Habbo)(((Map.Entry)reader2.next()).getValue()); cUser.IsPlayingSnow = true; GoToLobby.writeInt(cUser.Id); GoToLobby.writeUTF(cUser.UserName); GoToLobby.writeUTF(cUser.Look); GoToLobby.writeUTF(cUser.Gender.toLowerCase()); GoToLobby.writeInt(1); // team GoToLobby.writeInt(0); // stars GoToLobby.writeInt(0); // points GoToLobby.writeInt(10); // points for next level } Iterator reader3 = CurrentWar.RedTeam.entrySet().iterator(); while (reader3.hasNext()) { Habbo cUser = (Habbo)(((Map.Entry)reader3.next()).getValue()); GoToLobby.writeInt(cUser.Id); cUser.IsPlayingSnow = true; GoToLobby.writeUTF(cUser.UserName); GoToLobby.writeUTF(cUser.Look); GoToLobby.writeUTF(cUser.Gender.toLowerCase()); GoToLobby.writeInt(2); // team GoToLobby.writeInt(9); // stars GoToLobby.writeInt(200000); // points GoToLobby.writeInt(20000000); // points for next level } UserManager.SendMessageToAllSnowPlayers(CurrentWar, GoToLobby); ServerMessage StartGame = new ServerMessage(ServerEvents.StartSnowGame); StartGame.writeInt(0); StartGame.writeInt(CurrentWar.ArenaId); // arena id StartGame.writeInt(2); // team count StartGame.writeInt(1); // owner count or some idiot thing? //Iterator reader4 = CurrentWar.Players.entrySet().iterator(); //while (reader4.hasNext()) //{ Habbo zUser = Habbo.GetUserForName(CurrentWar.Owner); StartGame.writeInt(zUser.Id); StartGame.writeUTF(zUser.UserName); StartGame.writeUTF(zUser.Look); StartGame.writeUTF(zUser.Gender.toLowerCase()); StartGame.writeInt((CurrentWar.RedTeam.containsKey(zUser.Id)) ? 2 : 1); // team //} StartGame.writeInt(50); // ? StartGame.writeInt(50); // ? System.out.println(CurrentWar.Players.size() + ""); StartGame.writeUTF("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxx000000000000000xxxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxx00000000000000000xxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxx0000000000000000000xxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxx000000000000000000000xxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxx00000000000000000000000xxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxx0000000000000000000000000xxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxx000000000000000000000000000xxxxxxxxxxxxxxx" + (char)13 + "xxxxxxx00000000000000000000000000000xxxxxxxxxxxxxx" + (char)13 + "xxxxxx0000000000000000000000000000000xxxxxxxxxxxxx" + (char)13 + "xxxxx000000000000000000000000000000000xxxxxxxxxxxx" + (char)13 + "xxxxx0000000000000000000000000000000000xxxxxxxxxxx" + (char)13 + "xxxxx00000000000000000000000000000000000xxxxxxxxxx" + (char)13 + "xxxxx000000000000000000000000000000000000xxxxxxxxx" + (char)13 + "xxxxx0000000000000000000000000000000000000xxxxxxxx" + (char)13 + "xxxxx00000000000000000000000000000000000000xxxxxxx" + (char)13 + "xxxxx000000000000000000000000000000000000000xxxxxx" + (char)13 + "xxxxx0000000000000000000000000000000000000000xxxxx" + (char)13 + "0xxxx00000000000000000000000000000000000000000xxxx" + (char)13 + "xxxxx00000000000000000000000000000000000000000xxxx" + (char)13 + "xxxxx00000000000000000000000000000000000000000xxxx" + (char)13 + "xxxxx000000000000000000000000000000000000000000xxx" + (char)13 + "xxxxx000000000000000000000000000000000000000000xxx" + (char)13 + "xxxxx000000000000000000000000000000000000000000xxx" + (char)13 + "xxxxxx00000000000000000000000000000000000000000xxx" + (char)13 + "xxxxxxx0000000000000000000000000000000000000000xxx" + (char)13 + "xxxxxxxx0000000000000000000000000000000000000xxxxx" + (char)13 + "xxxxxxxxx00000000000000000000000000000000000xxxxxx" + (char)13 + "xxxxxxxxxx000000000000000000000000000000000xxxxxxx" + (char)13 + "xxxxxxxxxxx00000000000000000000000000000000xxxx0xx" + (char)13 + "xxxxxxxxxxxx0000000000000000000000000000000xxxxxxx" + (char)13 + "xxxxxxxxxxxxx00000000000000000000000000000xxxxxxxx" + (char)13 + "xxxxxxxxxxxxxx0000000000000000000000000000xxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxx00000000000000000000000000xxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxx0000000000000000000000000xxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxx00000000000000000000000xxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxx0000000000000000000000xxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxx00000000000000000000xxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxx000000000000000xxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxx0000000000000xxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxx00000000000xxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxxx0000000xxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + (char)13 + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + (char)13); List<SnowWarItem> WarItems = SnowWarItem.GetItemsForArena(CurrentWar.ArenaId); StartGame.writeInt(WarItems.size()); // count items Iterator readeritems = WarItems.iterator(); while(readeritems.hasNext()) { SnowWarItem W = (SnowWarItem)readeritems.next(); // serialize item StartGame.writeUTF(W.ItemName); // name StartGame.writeInt(W.Initial); // x StartGame.writeInt(W.Y); // z StartGame.writeInt(W.X); // y StartGame.writeInt(W.Rot); // height StartGame.writeInt(W.Height); // object id StartGame.writeInt(W.SpriteId); // ? StartGame.writeBoolean(W.Walkable); // walkable StartGame.writeInt(0); // ...? StartGame.writeInt(W.Information); // ? StartGame.writeInt((W.HaveMoreThanOneParam) ? 1 : 0); // ? if(W.HaveMoreThanOneParam) { StartGame.writeInt(W.Params.size()); // params // Extra data of ads_background Iterator readerforitems = SnowWarItem.sortByComparator(W.Params).entrySet().iterator(); while (readerforitems.hasNext()) { UnsortMap P = (UnsortMap)(((Map.Entry)readerforitems.next()).getValue()); StartGame.writeUTF(P.Set); StartGame.writeUTF(P.Value); } /*StartGame.writeUTF("state"); StartGame.writeUTF("0"); StartGame.writeUTF("offsetZ"); StartGame.writeUTF("9920"); StartGame.writeUTF("offsetY"); StartGame.writeUTF("1520"); StartGame.writeUTF("imageUrl"); StartGame.writeUTF("http://images.voroko.net/c_images/DEV_tests/snst_bg_2_big.png"); StartGame.writeUTF("offsetX"); StartGame.writeUTF("-1070");*/ } else { StartGame.writeUTF(W.OneParam); } } UserManager.SendMessageToAllSnowPlayers(CurrentWar, StartGame); // All users entered on arena? Iterator reader6 = CurrentWar.BlueTeam.entrySet().iterator(); while (reader6.hasNext()) { Habbo cUser = (Habbo)(((Map.Entry)reader6.next()).getValue()); ServerMessage UserInfo = new ServerMessage(ServerEvents.EnteredOnArena); System.out.println(cUser.Id); UserInfo.writeInt(cUser.Id); UserInfo.writeUTF(cUser.UserName); UserInfo.writeUTF(cUser.Look); UserInfo.writeUTF(cUser.Gender.toLowerCase()); UserInfo.writeInt(1); UserManager.SendMessageToAllSnowPlayers(CurrentWar, UserInfo); } Iterator reader9 = CurrentWar.RedTeam.entrySet().iterator(); while (reader9.hasNext()) { Habbo cUser = (Habbo)(((Map.Entry)reader9.next()).getValue()); ServerMessage UserInfo = new ServerMessage(ServerEvents.EnteredOnArena); UserInfo.writeInt(cUser.Id); UserInfo.writeUTF(cUser.UserName); UserInfo.writeUTF(cUser.Look); UserInfo.writeUTF(cUser.Gender.toLowerCase()); UserInfo.writeInt(2); UserManager.SendMessageToAllSnowPlayers(CurrentWar, UserInfo); } ServerMessage StageLoaded = new ServerMessage(ServerEvents.StageLoaded); StageLoaded.writeInt(0); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StageLoaded); ServerMessage StillLoad = new ServerMessage(ServerEvents.StillLoading); StillLoad.writeInt(0); StillLoad.writeInt(0); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad); ServerMessage StillLoad2 = new ServerMessage(ServerEvents.StillLoading); StillLoad2.writeInt(11); StillLoad2.writeInt(0); //StillLoad2.writeInt(48775613); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad2); ServerMessage StillLoad3 = new ServerMessage(ServerEvents.StillLoading); StillLoad3.writeInt(11); StillLoad3.writeInt(0); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad3); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad3); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad3); ServerMessage StillLoad4 = new ServerMessage(ServerEvents.StillLoading); StillLoad4.writeInt(22); StillLoad4.writeInt(0); //StillLoad4.writeInt(41524809); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad4); ServerMessage StillLoad5 = new ServerMessage(ServerEvents.StillLoading); StillLoad5.writeInt(22); StillLoad5.writeInt(0); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad5); ServerMessage StillLoad6 = new ServerMessage(ServerEvents.StillLoading); StillLoad6.writeInt(33); StillLoad6.writeInt(0); //StillLoad6.writeInt(31198871); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad6); ServerMessage StillLoad7 = new ServerMessage(ServerEvents.StillLoading); StillLoad7.writeInt(33); StillLoad7.writeInt(0); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad7); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad7); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad7); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad7); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad7); ServerMessage StillLoad7B = new ServerMessage(ServerEvents.StillLoading); StillLoad7B.writeInt(44); StillLoad7B.writeInt(0); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad7B); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad7B); UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad7B); ServerMessage StillLoad8 = new ServerMessage(ServerEvents.StillLoading); StillLoad8.writeInt(44); StillLoad8.writeInt(CurrentWar.RedTeam.size()); Iterator readeruserss = CurrentWar.RedTeam.entrySet().iterator(); while (readeruserss.hasNext()) { Habbo xUser = (Habbo)(((Map.Entry)readeruserss.next()).getValue()); StillLoad8.writeInt(xUser.Id); } UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad8); ServerMessage StillLoad9 = new ServerMessage(ServerEvents.StillLoading); StillLoad9.writeInt(44); StillLoad9.writeInt(CurrentWar.BlueTeam.size()); Iterator readerusersb = CurrentWar.BlueTeam.entrySet().iterator(); while (readerusersb.hasNext()) { Habbo xUser = (Habbo)(((Map.Entry)readerusersb.next()).getValue()); StillLoad9.writeInt(xUser.Id); } UserManager.SendMessageToAllSnowPlayers(CurrentWar, StillLoad9); Thread.sleep(9000); //Thread.sleep(5000); // load stage ServerMessage Arena = new ServerMessage(ServerEvents.LoadingSnowStage); Arena.writeInt(0); // arena Arena.writeUTF("snowwar_arena_0"); Arena.writeInt(0); Arena.writeInt(CurrentWar.Players.size()); // players? Iterator reader5 = CurrentWar.RedTeam.entrySet().iterator(); while (reader5.hasNext()) { Habbo xUser = (Habbo)(((Map.Entry)reader5.next()).getValue()); xUser.X = 20; xUser.Y = 24; Arena.writeInt(5); // type => human Arena.writeInt(19); // id Arena.writeInt(64000); // x Arena.writeInt(64000); // y Arena.writeInt(20); // currenttile (maybe x) Arena.writeInt(24); // currenttile (maybe y) Arena.writeInt(0); // dir/rot? Arena.writeInt(5); // no idea? Arena.writeInt(5); // h or some idiot thing? Arena.writeInt(0); // ? Arena.writeInt(0); // ? Arena.writeInt(0); // ? Arena.writeInt(20); // currentitle again Arena.writeInt(24); // currenttile again Arena.writeInt(20); // x again Arena.writeInt(24); // y again Arena.writeInt(0); // score Arena.writeInt(2); // team Arena.writeInt(xUser.Id); Arena.writeUTF(xUser.UserName); Arena.writeUTF(xUser.Motto); Arena.writeUTF(xUser.Look); Arena.writeUTF(xUser.Gender); } Iterator reader60 = CurrentWar.BlueTeam.entrySet().iterator(); while (reader60.hasNext()) { Habbo xUser = (Habbo)(((Map.Entry)reader60.next()).getValue()); xUser.X = 20; xUser.Y = 20; Arena.writeInt(5); // type => human Arena.writeInt(19); // id Arena.writeInt(64000); // x Arena.writeInt(64000); // y Arena.writeInt(20); // currenttile (maybe x) Arena.writeInt(20); // currenttile (maybe y) Arena.writeInt(0); // dir/rot? Arena.writeInt(5); // no idea? Arena.writeInt(5); // h or some idiot thing? Arena.writeInt(0); // ? Arena.writeInt(0); // ? Arena.writeInt(0); // ? Arena.writeInt(20); // currentitle again Arena.writeInt(20); // currenttile again Arena.writeInt(20); // x again Arena.writeInt(20); // y again Arena.writeInt(0); // score Arena.writeInt(2); // team Arena.writeInt(xUser.Id); Arena.writeUTF(xUser.UserName); Arena.writeUTF(xUser.Motto); Arena.writeUTF(xUser.Look); Arena.writeUTF(xUser.Gender); } UserManager.SendMessageToAllSnowPlayers(CurrentWar, Arena); Thread.sleep(5500); ServerMessage StageLoaded2 = new ServerMessage(ServerEvents.StageLoaded); StageLoaded2.writeInt(1); //UserManager.SendMessageToAllSnowPlayers(CurrentWar, StageLoaded2); ServerMessage StageRunning = new ServerMessage(ServerEvents.StageRunning); StageRunning.writeInt(120); // time? UserManager.SendMessageToAllSnowPlayers(CurrentWar, StageRunning); } public void RemoveFromMyWar(Habbo cUser) throws Exception { Habbo User = Habbo.UsersbyId.get(cUser.Id); if(User.CurrentWar.equals(null)) return; SnowWar War = User.CurrentWar; War.CurrentPlayers--; War.Players.remove(User); if(War.BlueTeam.containsKey(User.Id)) War.BlueTeam.remove(User); else if(War.RedTeam.containsKey(User.Id)) War.RedTeam.remove(User); else if(War.YellowTeam.containsKey(User.Id)) War.YellowTeam.remove(User); else if(War.GreenTeam.containsKey(User.Id)) War.GreenTeam.remove(User); if(War.Players.size() == 0) { // remove war Wars.remove(War.Id); } else { // add a new owner if(User.UserName.equals(War.Owner)) { Iterator reader = War.Players.entrySet().iterator(); while (reader.hasNext()) { Habbo xUser = (Habbo)(((Map.Entry)reader.next()).getValue()); War.Owner = xUser.UserName; } } // and remove the user ServerMessage UserLeaveGame = new ServerMessage(ServerEvents.UserLeaveGame); UserLeaveGame.writeInt(User.Id); Iterator reader = War.Players.entrySet().iterator(); while (reader.hasNext()) { Habbo xUser = (Habbo)(((Map.Entry)reader.next()).getValue()); UserLeaveGame.Send(xUser.CurrentSocket); } } User.CurrentWar = null; } public static void CreateANewWar(Habbo cUser) throws Exception { Habbo User = Habbo.UsersbyId.get(cUser.Id); SnowWar S = new SnowWar(); int count = 0; Iterator reader = Wars.entrySet().iterator(); while (reader.hasNext()) { SnowWar CurrentWar = (SnowWar)(((Map.Entry)reader.next()).getValue()); if(CurrentWar.Id > count) count = CurrentWar.Id; } S.Id = count + 1; S.ArenaId = 9; // soon (new Random()).nextInt(10); S.TeamCount = 2; // maybe random 2,4 soon? S.Owner = User.UserName; S.Players = new HashMap<Integer, Habbo>(); S.RedTeam = new HashMap<Integer, Habbo>(); S.BlueTeam = new HashMap<Integer, Habbo>(); S.YellowTeam = new HashMap<Integer, Habbo>(); S.GreenTeam = new HashMap<Integer, Habbo>(); S.RestTime = 0; S.StartedCounter = false; S.CurrentPlayers = 0; S.MaxPlayers = 10; // for the moment S.UserMoreHits = null; S.UserMoreKO = null; S.IsStarted = false; S.IsFinished = false; S.RedTeam.put(User.Id, User); S.Players.put(User.Id, User); User.CurrentWar = S; Wars.put(S.Id, S); } }
[ "josepaca@hotmail.es" ]
josepaca@hotmail.es
750966272b4b7ae1284506efe4d75e5d6aabcc43
f1ffd11f81393fc626c9789a92154953b96f788d
/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/thymeleaf/ThymeleafMessageResolver.java
793fce441817c51655cda9df7aa07ac6a7949266
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-fujion-exception-to-apache-2.0" ]
permissive
carewebframework/carewebframework-core
4358a7c7d1daa06874aa779ebc0961ae7467966f
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
refs/heads/master
2020-04-03T20:51:52.574637
2018-06-13T18:23:55
2018-06-13T18:23:55
8,866,638
4
4
null
2017-07-05T12:53:55
2013-03-18T23:30:59
Java
UTF-8
Java
false
false
1,687
java
/* * #%L * carewebframework * %% * Copyright (C) 2008 - 2016 Regenstrief Institute, Inc. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This Source Code Form is also subject to the terms of the Health-Related * Additional Disclaimer of Warranty and Limitation of Liability available at * * http://www.carewebframework.org/licensing/disclaimer. * * #L% */ package org.carewebframework.ui.thymeleaf; import org.fujion.common.Localizer; import org.thymeleaf.context.ITemplateContext; import org.thymeleaf.messageresolver.AbstractMessageResolver; /** * Allow Thymeleaf templates to resolve externalized messages. */ public class ThymeleafMessageResolver extends AbstractMessageResolver { @Override public String createAbsentMessageRepresentation(ITemplateContext context, Class<?> origin, String key, Object[] messageParameters) { return null; } @Override public String resolveMessage(ITemplateContext context, Class<?> origin, String key, Object[] messageParameters) { return Localizer.getMessage(key, context.getLocale(), messageParameters); } }
[ "dkmartin@regenstrief.org" ]
dkmartin@regenstrief.org
b8382567662fcb50c28ada16e3338c7800823042
6875b21ed7d1f1732da852f3956242e842a32fd9
/src/main/java/Main.java
53caa5c32f6e1cac4d03929d6b632285dde9f5cd
[]
no_license
Anzo85/TemplatePatternCode
827fcdc9ca1e5fed0375465a1227f6b77ab1c0fe
2b9f42582c2bb26f1b4b416592f48e3df289f815
refs/heads/master
2020-05-21T08:53:48.304818
2016-09-30T10:54:21
2016-09-30T10:54:21
69,659,144
0
0
null
null
null
null
UTF-8
Java
false
false
277
java
/** * Created by anzo0316 on 9/30/2016. */ public class Main { public static void main(String[] args) { CreatProgrammCode cCode = new CppProgram(); CreatProgrammCode jCode = new JavaProgramm(); cCode.deploy(); jCode.deploy(); } }
[ "anzo0316@netcracker.com" ]
anzo0316@netcracker.com
bd3d202d44300f8d2f0b0ed91367af123f1fa6cc
7b5971bd8e74d20ba26520fad1a239b758fc6c28
/app/src/main/java/com/xs/lightpuzzle/demo/a_tactics_demo/view/TacticsItem.java
b2aa954e332cc54dd0d8b89b36639ddf335232bc
[]
no_license
urnotxs/LightPuzzle
79f2b5ae1449690e3159428bf350f6abf2f21730
a6a76273e85b2e492ca93b1fb5f13d939fe82e00
refs/heads/master
2020-04-04T12:55:14.984753
2019-11-19T08:20:18
2019-11-19T08:20:18
155,942,248
5
0
null
null
null
null
UTF-8
Java
false
false
11,371
java
package com.xs.lightpuzzle.demo.a_tactics_demo.view; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.xs.lightpuzzle.CircleImageView; import com.xs.lightpuzzle.R; import com.xs.lightpuzzle.demo.a_tactics_demo.data.TacticsModelVO; /** * @author xs * @description 带头像,可选中,可移动 的战术板 * @since 2019/2/22 */ public class TacticsItem implements View.OnClickListener,View.OnTouchListener { private boolean isEditable; private TacticsModelVO itemVO; private TacticsBoard parentView; public FrameLayout.LayoutParams layoutParams; private float scale; private int width = 50; private int height = 80; public TacticsItem(TacticsBoard parentView, TacticsModelVO itemVO, boolean isEditable) { this.parentView = parentView; this.itemVO = itemVO; this.isEditable = isEditable; } private RelativeLayout itemView; private TextView txtPos; private CircleImageView imgHead; private ImageView imgBoard; private TextView txtName; public void addViewToScreen() { scale = parentView.width / 600.0f; itemView = new RelativeLayout(parentView.getContext()); layoutParams = new FrameLayout.LayoutParams( (int) (width * scale), (int) (height * scale)); layoutParams.gravity = Gravity.TOP; layoutParams.setMargins((int) (scale * (itemVO.GetPosX() - width / 2)), (int) (scale * (itemVO.GetPosY() - width / 2)), 0, 0); if (isEditable) itemView.setOnClickListener(this); parentView.addView(itemView, layoutParams); { RelativeLayout.LayoutParams rlParams = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((height - 30) * scale)); txtPos = new TextView(parentView.getContext()); txtPos.setTextColor(itemView.getResources().getColor(R.color.white)); txtPos.setGravity(Gravity.CENTER); itemView.addView(txtPos, rlParams); imgHead = new CircleImageView(parentView.getContext()); imgHead.setBorderWidth((int) (2 * scale)); rlParams = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((height - 30) * scale)); itemView.addView(imgHead, rlParams); imgBoard = new ImageView(parentView.getContext()); imgBoard.setScaleType(ImageView.ScaleType.FIT_CENTER); rlParams = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((height - 20) * scale)); itemView.addView(imgBoard, rlParams); txtName = new TextView(parentView.getContext()); txtName.setTextSize(10); txtName.setTextColor(itemView.getResources().getColor(R.color.white)); txtName.setBackgroundResource(R.color.txtback); txtName.setGravity(Gravity.CENTER); rlParams = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((20) * scale)); rlParams.setMargins(0, (int) ((height - 20) * scale), 0, 0); itemView.addView(txtName, rlParams); int typeColor; switch (itemVO.GetType()) { case 0: typeColor = R.color.gk; imgBoard.setImageResource(R.drawable.icon_gk_bg); imgHead.setBorderColor(itemView.getResources().getColor(R.color.gk)); break; case 1: typeColor = R.color.df; imgBoard.setImageResource(R.drawable.icon_df_bg); imgHead.setBorderColor(itemView.getResources().getColor(R.color.df)); break; case 2: typeColor = R.color.mf; imgBoard.setImageResource(R.drawable.icon_mf_bg); imgHead.setBorderColor(itemView.getResources().getColor(R.color.mf)); break; case 3: typeColor = R.color.mf; imgBoard.setImageResource(R.drawable.icon_mf_bg); imgHead.setBorderColor(itemView.getResources().getColor(R.color.mf)); break; case 4: typeColor = R.color.fw; imgBoard.setImageResource(R.drawable.icon_fw_bg); imgHead.setBorderColor(itemView.getResources().getColor(R.color.fw)); break; } txtPos.setText(itemVO.GetPositionName()); if (itemVO.HasUser()) { txtName.setText(itemVO.GetUserName()); imgHead.setImageResource(R.drawable.tactics_logo); imgHead.setVisibility(View.VISIBLE); txtName.setVisibility(View.VISIBLE); txtPos.setVisibility(View.INVISIBLE); } else { imgHead.setVisibility(View.GONE); txtName.setVisibility(View.INVISIBLE); txtPos.setVisibility(View.VISIBLE); } // 用户信息 if (itemVO.GetIsShow()) { itemView.setVisibility(View.VISIBLE); } else { itemView.setVisibility(View.GONE); } } } @Override public void onClick(View v) { if (parentView.selectedItem != null) { parentView.selectedItem.RefreshView(false); itemView.setOnTouchListener(null); } RefreshView(true); itemView.setOnTouchListener(this); } private void RefreshView(boolean isClick) { if (!isClick) { width = 50; height = 80; parentView.posItem = null; parentView.selectedItem = null; reDeployMinLayout(); } else { width = 60; height = 96; parentView.selectedItem = this; parentView.posItem = itemVO; reDeployMaxLayout(); } } private void reDeployMaxLayout() { layoutParams = (FrameLayout.LayoutParams) itemView.getLayoutParams(); layoutParams.width = (int) (width * scale); layoutParams.height = (int) (height * scale); layoutParams.setMargins((int) (scale * (itemVO.GetPosX() - (width / 2))), (int) (scale * (itemVO.GetPosY() - (width / 2))), 0, 0); parentView.updateViewLayout(itemView, layoutParams); { RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((height - 36) * scale)); itemView.updateViewLayout(txtPos, param); param = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((height - 36) * scale)); imgHead.setBorderWidth((int) (6 * scale)); itemView.updateViewLayout(imgHead, param); param = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((height - 24) * scale)); itemView.updateViewLayout(imgBoard, param); param = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((24) * scale)); param.setMargins(0, (int) ((height - 24) * scale), 0, 0); itemView.updateViewLayout(txtName, param); } } private void reDeployMinLayout() { layoutParams = (FrameLayout.LayoutParams) itemView.getLayoutParams(); layoutParams.width = (int) (width * scale); layoutParams.height = (int) (height * scale); layoutParams.setMargins((int) (scale * (itemVO.GetPosX() - (width / 2))), (int) (scale * (itemVO.GetPosY() - (width / 2))), 0, 0); parentView.updateViewLayout(itemView, layoutParams); { RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((height - 30) * scale)); itemView.updateViewLayout(txtPos, param); param = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((height - 30) * scale)); imgHead.setBorderWidth((int) (2 * scale)); itemView.updateViewLayout(imgHead, param); param = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((height - 20) * scale)); itemView.updateViewLayout(imgBoard, param); param = new RelativeLayout.LayoutParams( (int) (width * scale), (int) ((20) * scale)); param.setMargins(0, (int) ((height - 20) * scale), 0, 0); itemView.updateViewLayout(txtName, param); } } private int startX; private int startY; @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub switch (event.getAction()) { case MotionEvent.ACTION_DOWN: startX = (int) event.getRawX(); startY = (int) event.getRawY(); break; case MotionEvent.ACTION_MOVE: int dx = (int) event.getRawX() - startX; int dy = (int) event.getRawY() - startY; int left = (int) (scale * (itemVO.GetPosX() - (width / 2)) + dx); int top = (int) (scale * (itemVO.GetPosY() - (height / 2)) + dy); if (left < 0) { left = 0; } if (top < 0) { top = 0; } if (left > parentView.width - width * scale) { left = parentView.width - (int) (width * scale); } if (top > parentView.height - height * scale) { top = parentView.height - (int) (height * scale); } layoutParams.setMargins(left, top, 0, 0); // layoutParams.setMargins(startX+dx,startY+dy, 0, 0); // layoutParams.x = lastX; // layoutParams.y = lastY-30; parentView.updateViewLayout(v, layoutParams); break; case MotionEvent.ACTION_UP: dx = (int) event.getRawX() - startX; dy = (int) event.getRawY() - startY; left = (int) (scale * (itemVO.GetPosX() - width / 2) + dx); top = (int) (scale * (itemVO.GetPosY() - height / 2) + dy); if (left < 0) { left = 0; } if (top < 0) { top = 0; } if (left > parentView.width - width * scale) { left = parentView.width - (int) (width * scale); } if (top > parentView.height - height * scale) { top = parentView.height - (int) (height * scale); } itemVO.SetXY(width / 2 + (float) left / scale, height / 2 + (float) top / scale); RefreshView(false); itemView.setOnTouchListener(null); break; } return true; } }
[ "532771504@qq.com" ]
532771504@qq.com
0810f7aaa41277096f8c0c283edb48cccf9022ee
00b6bc21cbf45ab58a53a35ee8c08046b94fcbcd
/jOOX/src/test/java/org/joox/test/Customer.java
0e2d63d23563b84cbddc18c72ff6fc2dfbfe8e4d
[ "Apache-2.0" ]
permissive
xlee00/jOOX
5df70e0abf314a5f3288ab769b0d4fcc5548de58
aee98f273d8f63b7a85f88b3df6d2f6ea0e3b23a
refs/heads/master
2021-01-11T21:40:48.329709
2016-10-21T14:37:56
2016-10-21T14:37:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,493
java
/* * Copyright (c) 2011-2016, Data Geekery GmbH (http://www.datageekery.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.joox.test; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; /** * @author Lukas Eder */ @XmlRootElement public class Customer { String name; int age; int id; public String getName() { return name; } @XmlElement public void setName(String name) { this.name = name; } public int getAge() { return age; } @XmlElement public void setAge(int age) { this.age = age; } public int getId() { return id; } @XmlAttribute public void setId(int id) { this.id = id; } // ------------------------------------------------------------------------ // Eclipse-generated hashCode() and equals() methods // ------------------------------------------------------------------------ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + age; result = prime * result + id; result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Customer other = (Customer) obj; if (age != other.age) return false; if (id != other.id) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; return true; } }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
beaea09c2df9d0b7347012ac3462f002973e5664
5006059c988435f82f78fbea0ff2c26e479430f2
/interviewBit/arrays/SetMatrixZeroes.java
e11ef8a6988b93df34f973dd1bbe8a6ccc24a939
[]
no_license
jscr189/InterviewBit
21b63b751d7b586e0b072e0318bae10c55a0429c
0012b4f35f46666cf2f49c749d07083b625998a9
refs/heads/master
2020-03-10T22:38:32.876151
2018-04-15T15:38:33
2018-04-15T15:38:33
129,623,962
0
0
null
null
null
null
UTF-8
Java
false
false
1,467
java
package interviewBit.arrays; import java.util.ArrayList; import java.util.TreeSet; public class SetMatrixZeroes { public static void main(String[] args) { ArrayList<ArrayList<Integer>> matrix=new ArrayList<ArrayList<Integer>>(); ArrayList<Integer> row = new ArrayList<Integer>() { { add(1); add(2); add(3); add(4); } }; matrix.add(row); row = new ArrayList<Integer>() { { add(5); add(0); add(7); add(8); } }; matrix.add(row); row = new ArrayList<Integer>() { { add(9); add(10); add(11); add(12); } }; matrix.add(row); row = new ArrayList<Integer>() { { add(13); add(14); add(15); add(16); } }; matrix.add(row); setZeroes(matrix); System.out.println(matrix); } public static void setZeroes(ArrayList<ArrayList<Integer>> a) { TreeSet<Integer> rows=new TreeSet<Integer>(); TreeSet<Integer> cols=new TreeSet<Integer>(); for(int i=0;i<a.size();i++) { for(int j=0;j<a.get(i).size();j++) { if(a.get(i).get(j)==0) { rows.add(i); cols.add(j); } } } while(rows.size()>0) { int r=rows.first(); for(int i=0;i<a.get(r).size();i++) a.get(r).set(i, 0); rows.remove(r); } while(cols.size()>0) { int c=cols.first(); for(int i=0;i<a.size();i++) a.get(i).set(c, 0); cols.remove(c); } } }
[ "jscr189@gmail.com" ]
jscr189@gmail.com
c755b2934913813c5e05b68159606b83647b28d7
be7dfb517e5a87255b342210350f25350675efcb
/mihxil-algebra/src/main/java/org/meeuw/math/abstractalgebra/complex/BigComplexNumbers.java
04ea36a18f635fb01abf682c7e59f7ec8863114f
[ "Apache-2.0" ]
permissive
mihxil/math
daf93c07496d45a681d211c651484cc13744b8fc
905e5dbe81dc50b355d120669463b560e57c197f
refs/heads/main
2023-08-23T09:30:13.127140
2023-08-06T19:30:36
2023-08-06T19:30:36
5,719,123
17
0
Apache-2.0
2022-10-18T12:39:16
2012-09-07T16:06:34
Java
UTF-8
Java
false
false
1,710
java
/* * Copyright 2022 Michiel Meeuwissen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.meeuw.math.abstractalgebra.complex; import lombok.extern.java.Log; import org.meeuw.math.Example; import org.meeuw.math.abstractalgebra.*; import org.meeuw.math.abstractalgebra.reals.*; /** * The {@link Field} of {@link ComplexNumber}s, backed by {@link BigDecimalElement}s. * * @author Michiel Meeuwissen * @since 0.8 */ @Log @Example(CompleteField.class) public class BigComplexNumbers extends CompleteComplexNumbers<BigComplexNumber, BigDecimalElement, BigDecimalField> { public static final BigComplexNumbers INSTANCE = new BigComplexNumbers(); private BigComplexNumbers() { super(BigComplexNumber.class, BigDecimalField.INSTANCE); } @Override BigComplexNumber of(BigDecimalElement real, BigDecimalElement imaginary) { return new BigComplexNumber(real, imaginary); } @Override public String toString() { return "ℂ"; } @Override BigDecimalElement atan2(BigDecimalElement imaginary, BigDecimalElement real) { return BigDecimalField.INSTANCE.atan2(imaginary, real); } }
[ "git@meeuw.org" ]
git@meeuw.org
fbd5b274d19daa66c9e22ef59c9de658a0c3fa16
0e515dfe72bef45ffcebb996eb3dc3a7a0c663c0
/src/main/java/com/yaoyao/sell/service/OrderService.java
b0818bc8ad37fad470892528ccd0071225fcd47f
[]
no_license
xiaoxinllleee/sell
5f80cb4222858935cf602bbf607216cb62c5b223
f210156dc106fc356f2376fbb43b308e05ffbd41
refs/heads/master
2020-03-17T08:29:43.419437
2018-05-22T09:23:32
2018-05-22T09:23:36
133,440,694
0
0
null
null
null
null
UTF-8
Java
false
false
642
java
package com.yaoyao.sell.service; import com.yaoyao.sell.dataobject.OrderMaster; import com.yaoyao.sell.dto.OrderDTO; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; public interface OrderService { //创建订单 OrderDTO create(OrderDTO OrderDTO); //查询单个订单 OrderDTO findOne(String orderId); //查询订单列表 Page<OrderDTO> findList(String buyerOpenid, Pageable pageable); //取消订单 OrderDTO cancel(OrderDTO orderDTO); //完结订单 OrderDTO finish(OrderDTO orderDTO); //支付订单 OrderDTO paid(OrderDTO orderDTO); }
[ "Xiaoxin_llleee@163.com" ]
Xiaoxin_llleee@163.com
7f1530393690398ec2d7d89641b3c662938ae9a0
e147735a2c48a8357171a1fd1d48f5b999cfe976
/SPRING/day01111/src/com/sds/Dao.java
287e454d49b3b0f85a11feae558a347600d47242
[]
no_license
ssoheee/TIL
b1c36a3539aa895ed354d221329aa5ee88c87458
2fa36b94666e60e6dd41b09e2d106c4b045e2255
refs/heads/master
2022-12-22T11:05:32.379001
2019-09-06T04:51:24
2019-09-06T04:51:24
187,792,793
0
0
null
2022-12-16T07:47:40
2019-05-21T08:17:22
CSS
UTF-8
Java
false
false
68
java
package com.sds; public interface Dao { public void insert(); }
[ "thgml519@naver.com" ]
thgml519@naver.com
a70f05e665ea29166fa6433eb35406d7580a7a8b
69eebd7a6dfb1db8b2f21ffd43124500b490a943
/WEB-INF/src/DeleteServlet.java
48d73ec6e8e8c32d36bf2204c9281fa78ba2f514
[]
no_license
mimimimizuki/le4db
0359b13fb012d085e3959a79d6a7ab0780b4f666
01369a1a5c295b839335b32d69963fedb07b3be0
refs/heads/master
2020-09-06T06:31:26.333515
2019-11-28T08:48:46
2019-11-28T08:48:46
220,352,237
0
0
null
null
null
null
UTF-8
Java
false
false
4,366
java
import java.io.FileInputStream; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; //cordinatorが削除(patient) //donor が削除(donor) @SuppressWarnings("serial") public class DeleteServlet extends HttpServlet { // donor can delete his infomation private String _hostname = null; private String _dbname = null; private String _username = null; private String _password = null; public void init() throws ServletException { // iniファイルから自分のデータベース情報を読み込む String iniFilePath = getServletConfig().getServletContext().getRealPath("WEB-INF/le4db.ini"); try { FileInputStream fis = new FileInputStream(iniFilePath); Properties prop = new Properties(); prop.load(fis); _hostname = prop.getProperty("hostname"); _dbname = prop.getProperty("dbname"); _username = prop.getProperty("username"); _password = prop.getProperty("password"); } catch (Exception e) { e.printStackTrace(); } } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); String deleteuser_data = request.getParameter("delete_user_id"); out.println("<html>"); out.println("<body>"); out.println("<style>"); out.println("body {color : dimgray; }"); out.println("</style>"); Connection conn = null; Statement stmt = null; Statement stmt_hla = null; Statement stmt_user = null; try { Class.forName("org.postgresql.Driver"); conn = DriverManager.getConnection("jdbc:postgresql://" + _hostname + ":5432/" + _dbname, _username, _password); conn.setAutoCommit(false); stmt = conn.createStatement(); stmt.executeUpdate("DELETE FROM relationship WHERE user_id ='" + deleteuser_data + "'"); stmt.executeUpdate("DELETE FROM address WHERE user_id ='" + deleteuser_data + "'"); stmt.executeUpdate("DELETE FROM contact WHERE user_id ='" + deleteuser_data + "'"); stmt.executeUpdate("DELETE FROM login WHERE user_id ='" + deleteuser_data + "'"); stmt_user = conn.createStatement(); ResultSet rs_user = stmt_user .executeQuery("select count(*) from user_data where user_id = '" + deleteuser_data + "'"); rs_user.next(); int count = rs_user.getInt("count"); if (count <= 0) { conn.rollback(); out.println("<h3>該当するユーザは存在しません。</h3><br/>"); } else { out.println("<h3>以下のユーザを削除しました。</h3><br/>"); out.println("ユーザID: " + deleteuser_data + "<br/>"); ResultSet rs = stmt.executeQuery("SELECT * FROM register WHERE user_id ='" + deleteuser_data + "'"); rs.next(); int hla_id = rs.getInt("hla_id"); stmt.executeUpdate("DELETE FROM register WHERE user_id= '" + deleteuser_data + "'"); stmt.executeUpdate("DELETE FROM user_data WHERE user_id= '" + deleteuser_data + "'"); rs.close(); stmt_hla = conn.createStatement(); ResultSet rs_hla = stmt_hla.executeQuery("SELECT * FROM register WHERE hla_id ='" + hla_id + "'"); String same_user = ""; if (rs_hla.next()) { same_user = rs_hla.getString("user_id"); } if (same_user == "") { stmt_hla.executeUpdate("DELETE FROM hla WHERE hla_id = '" + hla_id + "'"); } conn.commit(); rs_hla.close(); } } catch (Exception e) { e.printStackTrace(); } finally { try { if (conn != null) { conn.close(); } } catch (SQLException e) { e.printStackTrace(); } } out.println("<br/>"); out.println("<a href=\"cordinator.html\">管理ページに戻る</a>"); out.println("</body>"); out.println("</html>"); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } public void destroy() { } }
[ "mizuki0327.5@gmail.com" ]
mizuki0327.5@gmail.com
35d0ccee52e55e52b9a4c1fc75584052390e34c9
9058e0220a011081c2e6b18bffd07ccb08900a40
/admin/src/main/java/com/kolon/comlife/admin/complexes/model/ComplexInfoDetail.java
f6d099e975eb3ff8b8b93a6c5fa6b9a8963f3d73
[]
no_license
kyejune/commonlife-frontend
fd831efd0c05287b5dcfc7adaf9ad6cc5548c411
c1d1e716123b97b419546f3d91fb41111cef4815
refs/heads/master
2020-03-21T01:06:08.677814
2018-06-12T17:12:11
2018-06-12T17:12:11
137,924,442
0
2
null
null
null
null
UTF-8
Java
false
false
3,617
java
package com.kolon.comlife.admin.complexes.model; public class ComplexInfoDetail extends ComplexInfo { private String cmplxGrpType; // CMPLX_GRP_TYPE private String iokAdminId; // CMPLX.ADMIN_ID AS IOK_ADMIN_ID private String iokRegId; // CMPLX.REG_ID AS IOK_REG_ID, private String iokRegDt; // CMPLX.REG_DT AS IOK_REG_DT, private String iokChgId; // CMPLX.CHG_ID AS IOK_CHG_ID, private String iokChgDt; // CMPLX.CHG_DT AS IOK_CHG_DT, private String clMapSrc; // CMPLX_EXT.CL_MAP_SRC AS CL_MAP_SRC, private String clCmplxNm; // CMPLX_EXT.CL_CMPLX_NM AS CL_CMPLX_NM, private String clCmplxAddr; // CMPLX_EXT.CL_CMPLX_ADDR AS CL_CMPLX_ADDR, private String clLogoImgSrc; // logoImgIdx 및 ImageStore에 의해서 결정 private String iotUseYn; // IOT_USE_YN private String reservationUseYn; // RESERVATION_USE_YN private String feedWriteAllowYn; // FEED_WRITE_ALLOW_YN private String regAdminId; // REG_ADMIN_ID private String updAdminId; // UPD_ADMIN_ID public ComplexInfoDetail() { } public String getCmplxGrpType() { return cmplxGrpType; } public void setCmplxGrpType(String cmplxGrpType) { this.cmplxGrpType = cmplxGrpType; } public String getIokAdminId() { return iokAdminId; } public void setIokAdminId(String iokAdminId) { this.iokAdminId = iokAdminId; } public String getIokRegId() { return iokRegId; } public void setIokRegId(String iokRegId) { this.iokRegId = iokRegId; } public String getIokRegDt() { return iokRegDt; } public void setIokRegDt(String iokRegDt) { this.iokRegDt = iokRegDt; } public String getIokChgId() { return iokChgId; } public void setIokChgId(String iokChgId) { this.iokChgId = iokChgId; } public String getIokChgDt() { return iokChgDt; } public void setIokChgDt(String iokChgDt) { this.iokChgDt = iokChgDt; } public String getClMapSrc() { return clMapSrc; } public void setClMapSrc(String clMapSrc) { this.clMapSrc = clMapSrc; } public String getClCmplxNm() { return clCmplxNm; } public void setClCmplxNm(String clCmplxNm) { this.clCmplxNm = clCmplxNm; } public String getClCmplxAddr() { return clCmplxAddr; } public void setClCmplxAddr(String clCmplxAddr) { this.clCmplxAddr = clCmplxAddr; } public String getClLogoImgSrc() { return clLogoImgSrc; } public void setClLogoImgSrc(String clLogoImgSrc) { this.clLogoImgSrc = clLogoImgSrc; } public String getIotUseYn() { return iotUseYn; } public void setIotUseYn(String iotUseYn) { this.iotUseYn = iotUseYn; } public String getReservationUseYn() { return reservationUseYn; } public void setReservationUseYn(String reservationUseYn) { this.reservationUseYn = reservationUseYn; } public String getFeedWriteAllowYn() { return feedWriteAllowYn; } public void setFeedWriteAllowYn(String feedWriteAllowYn) { this.feedWriteAllowYn = feedWriteAllowYn; } public String getRegAdminId() { return regAdminId; } public void setRegAdminId(String regAdminId) { this.regAdminId = regAdminId; } public String getUpdAdminId() { return updAdminId; } public void setUpdAdminId(String updAdminId) { this.updAdminId = updAdminId; } }
[ "ykim.hello@gmail.com" ]
ykim.hello@gmail.com
7bb6a1d4f86858d03807e1308ad12010a3534c81
2185520997898b1efb62432109673696cd18b49e
/Prácticas/P09/Ejercicio1/Usuario.java
61395e55d787cf34243574883c0009e1a6223f6b
[]
no_license
joaquinhmtz/Programacion
c85388ba61de1ae0e41994c21972d4259fb60eae
d480abb44f30d38945611de9a6709b937830491c
refs/heads/master
2021-01-11T16:29:53.034886
2017-04-28T02:17:53
2017-04-28T02:17:53
80,087,766
0
0
null
null
null
null
UTF-8
Java
false
false
1,746
java
public class Usuario { private String nombre; private String telefono; private String direccion; private String mail; private String nickname; private String fecha; public Usuario() { } public Usuario(String nombre_pa, String telefono_pa, String direccion_pa, String mail_pa, String nickname_pa, String fecha_pa) { this.nombre = nombre_pa; this.telefono = telefono_pa; this.direccion = direccion_pa; this.mail = mail_pa; this.nickname = nickname_pa; this.fecha = fecha_pa; } public Usuario(String nombre_pa) { this.nombre = nombre_pa; this.telefono = null; this.direccion = null; this.mail = null; this.nickname = null; this.fecha = null; } public void setNombre(String nombre_p) { this.nombre = nombre_p; } public String getNombre() { return this.nombre; } public void setTelefono(String telefono_p) { this.telefono = telefono_p; } public String getTelefono() { return this.telefono; } public void setDireccion(String direccion_p) { this.direccion = direccion_p; } public String getDireccion() { return this.direccion; } public void setMail(String mail_p) { this.mail = mail_p; } public String getMail() { return this.mail; } public void setNickname(String nickname_p) { this.nickname = nickname_p; } public String getNickname() { return this.nickname; } public void setFecha(String fecha_p) { this.fecha = fecha_p; } public String getFecha() { return this.fecha; } public String toString() { return ("Nombre: "+this.nombre+"\n") + ("Teléfono: "+this.telefono+"\n")+ ("Dirección: "+ this.direccion+"\n")+("Mail: "+this.mail+"\n")+("Nickname: "+this.nickname+"\n")+ ("Fecha de nacimiento: "+this.fecha+"\n"); } }
[ "joaquin_downhill@hotmail.com" ]
joaquin_downhill@hotmail.com
3a847b8d8c30d2aa0e41bd908b0d3fc653b72b8f
a3f850b4ca8278eefb75b2095da20634140d0e12
/microservice-feign-consumer/src/main/java/com/ikki/cloud/feign/consumer/service/HelloService.java
54fb55768ad82130273f279dc0471896a7673dac
[]
no_license
Ikki-Dai/spring-cloud-learning
e8fa4e66ebf65a68768f4be2325e8a53d5e491a8
67a1a008cac54da5d72ae74993b7f06a3db50974
refs/heads/master
2021-05-13T22:17:49.693257
2018-01-06T14:11:02
2018-01-06T14:11:02
116,484,730
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package com.ikki.cloud.feign.consumer.service; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @FeignClient("MICORSERVICE-USER-SERVICE") public interface HelloService { @RequestMapping(value = "/hello", method = RequestMethod.GET) String hello(); }
[ "IkkiDay@163.com" ]
IkkiDay@163.com
71e9d5bc2b3df2559b951956b113a147a5caa645
36ab5e8e0a9a48a4cb637a4655b628c703f81d17
/AgentProxy/src/mas/blackboard/namezonespace/DefaultZoneSpace.java
c77bf90e8f0345c0cfcb203b40bff7c549fefd57
[]
no_license
wuxuedaifu/SmartManager
9642cef16ef5dce8f61170d0b8c9728145d15c85
4f62928e1bf8584b44c26b21a42059883cee3bfd
refs/heads/master
2022-02-16T01:14:50.868186
2016-09-18T15:56:13
2016-09-18T15:56:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
570
java
package mas.blackboard.namezonespace; /** * Used in creation of Named Zone Space. * Recommonded to use only when you understand library code * @author NikhilChilwant * */ public final class DefaultZoneSpace implements ZoneSpaceName { public String getLocalName() { return "DEFAULT_ZONE"; } public boolean equals(Object obj) { return (obj != null && (obj instanceof DefaultZoneSpace)); } public int hashCode() { return DefaultZoneSpace.class.hashCode(); } public String toString() { return "the default Zone"; } }
[ "nikhilbchilwant@gmail.com" ]
nikhilbchilwant@gmail.com
d50da0e053307f4e9058df19abef33e82114ec36
6cd19d370fae6d8cc497a315c4be8f55194ee5f8
/app/src/main/java/com/bignerdranch/criminalintent/DatePickerFragment.java
26419507cc798980734d69cea2970379082bbd1c
[]
no_license
ksrchen/CriminalIntent
9edcd4a7b0bed50f13878718ff34cf6b38fb8f0c
73b97857f4339bc207fe56c8b81fee23245eb296
refs/heads/master
2021-01-10T19:45:12.668117
2015-03-07T16:53:26
2015-03-07T16:53:26
31,819,372
0
0
null
null
null
null
UTF-8
Java
false
false
2,627
java
package com.bignerdranch.criminalintent; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; import android.view.View; import android.widget.DatePicker; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; /** * Created by ksrchen on 12/21/13. */ public class DatePickerFragment extends DialogFragment { public final static String EXTRA_DATE = "com.bignerdranch.criminalintent.date"; private Date mDate; public static DatePickerFragment newInstance(Date date){ Bundle bundle = new Bundle(); bundle.putSerializable(EXTRA_DATE, date); DatePickerFragment fragment = new DatePickerFragment(); fragment.setArguments(bundle); return fragment; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { mDate = (Date)getArguments().getSerializable(EXTRA_DATE); Calendar calendar = Calendar.getInstance(); calendar.setTime(mDate); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH); int day= calendar.get(Calendar.DAY_OF_MONTH); View v = getActivity().getLayoutInflater().inflate(R.layout.dialog_date, null); DatePicker datePicker = (DatePicker)v.findViewById(R.id.dailog_date_picker); datePicker.init(year, month, day, new DatePicker.OnDateChangedListener() { @Override public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) { mDate = new GregorianCalendar(year, monthOfYear, dayOfMonth).getTime(); getArguments().putSerializable(EXTRA_DATE, mDate); } }); return new AlertDialog.Builder(getActivity()).setTitle(R.string.data_picker_title) .setView(v) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { sendResult(Activity.RESULT_OK); } }) .create(); } private void sendResult(int resultCode){ if (getTargetFragment() == null) return;; Intent i = new Intent(); i.putExtra(EXTRA_DATE, mDate); getTargetFragment().onActivityResult(getTargetRequestCode(), resultCode, i); } }
[ "ksrchen@gmail.com" ]
ksrchen@gmail.com
52fac7cd7bd6eb2b02019c92061b74323a249c45
bbf523a01c35270a108cdb6f103ba32c0198f609
/src/main/java/com/mangelovski/feedme/demo/domain/PersistentToken.java
6e63ba56f0672b15e75177d03ba8eac756dbca2b
[ "Apache-2.0" ]
permissive
mangelovski/feed-me
61e80abfb1ecd4068b93e78a6862ab381c15285e
60375c0645305e06a3006f17aaf1ee1f1521822c
refs/heads/master
2021-01-19T02:14:11.340729
2014-11-24T23:19:01
2014-11-24T23:19:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,370
java
package com.mangelovski.feedme.demo.domain; import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonIgnore; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.DBRef; import org.springframework.data.mongodb.core.mapping.Document; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; /** * Persistent tokens are used by Spring Security to automatically log in users. * * @see com.mangelovski.feedme.demo.security.CustomPersistentRememberMeServices */ @Document(collection = "T_PERSISTENT_TOKEN") public class PersistentToken implements Serializable { private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat.forPattern("d MMMM yyyy"); private static final int MAX_USER_AGENT_LEN = 255; @Id private String series; @JsonIgnore @NotNull private String tokenValue; @JsonIgnore private LocalDate tokenDate; //an IPV6 address max length is 39 characters @Size(min = 0, max = 39) private String ipAddress; private String userAgent; @JsonIgnore @DBRef private User user; public String getSeries() { return series; } public void setSeries(String series) { this.series = series; } public String getTokenValue() { return tokenValue; } public void setTokenValue(String tokenValue) { this.tokenValue = tokenValue; } public LocalDate getTokenDate() { return tokenDate; } public void setTokenDate(LocalDate tokenDate) { this.tokenDate = tokenDate; } @JsonGetter public String getFormattedTokenDate() { return DATE_TIME_FORMATTER.print(this.tokenDate); } public String getIpAddress() { return ipAddress; } public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; } public String getUserAgent() { return userAgent; } public void setUserAgent(String userAgent) { if (userAgent.length() >= MAX_USER_AGENT_LEN) { this.userAgent = userAgent.substring(0, MAX_USER_AGENT_LEN - 1); } else { this.userAgent = userAgent; } } public User getUser() { return user; } public void setUser(User user) { this.user = user; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PersistentToken that = (PersistentToken) o; if (!series.equals(that.series)) { return false; } return true; } @Override public int hashCode() { return series.hashCode(); } @Override public String toString() { return "PersistentToken{" + "series='" + series + '\'' + ", tokenValue='" + tokenValue + '\'' + ", tokenDate=" + tokenDate + ", ipAddress='" + ipAddress + '\'' + ", userAgent='" + userAgent + '\'' + "}"; } }
[ "mangelovski@gmail.com" ]
mangelovski@gmail.com
9b3f41f16fa76841829d2601f5318ade57842892
fb60413b02cdf8a5c38d24b033d2900832ba9f19
/log_server/src/com/pwrd/war/logserver/telnet/TelnetIoHandler.java
dae87e5348cfd2241d6927732d5294544f42dc3d
[]
no_license
tommyadan/webgame
4729fc44617b9f104e0084d41763d98b3068f394
2117929e143e7498e524305ed529c4ee09163474
refs/heads/master
2021-05-27T04:59:34.506955
2012-08-20T14:30:07
2012-08-20T14:30:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,419
java
package com.pwrd.war.logserver.telnet; import java.util.HashMap; import java.util.Map; import org.apache.mina.common.IdleStatus; import org.apache.mina.common.IoHandlerAdapter; import org.apache.mina.common.IoSession; import org.apache.mina.common.TransportType; import org.apache.mina.transport.socket.nio.SocketSessionConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.pwrd.war.logserver.telnet.command.AbstractTelnetCommand; /** * Telnet协议处理 * * */ public class TelnetIoHandler extends IoHandlerAdapter { private static final Logger logger = LoggerFactory.getLogger("telnet"); /** 注册Telnet命令 */ private final Map<String, AbstractTelnetCommand> commands = new HashMap<String, AbstractTelnetCommand>(); public TelnetIoHandler() { } /** * 注册命令 * * @param command */ public void register(AbstractTelnetCommand command) { if (this.commands.containsKey(command.getCommandName())) { if (logger.isWarnEnabled()) { logger.warn("The command [" + command.getCommandName() + "] has been already registed,which will be replaced."); } } this.commands.put(command.getCommandName().toUpperCase(), command); } @Override public void messageReceived(IoSession session, Object msgObject) throws Exception { final String _message = msgObject.toString().trim(); if (_message.length() == 0) { return; } final String[] msgArray = _message.split(" "); final String _cmd = msgArray[0].toUpperCase(); final AbstractTelnetCommand _command = this.commands.get(_cmd); if (_command == null) { if (logger.isWarnEnabled()) { logger.warn("No registed command [" + _cmd + "]"); } session.write("Unknown command:" + _cmd + "\r"); return; } Map<String, String> _cmdParamMap = parseParamMap(msgArray); _command.exec(_message, _cmdParamMap, session); } @Override public void messageSent(IoSession session, Object message) throws Exception { } @Override public void sessionClosed(IoSession session) throws Exception { session.setAttachment(null); } @Override public void sessionCreated(IoSession session) throws Exception { if (session.getTransportType() == TransportType.SOCKET) { ((SocketSessionConfig) session.getConfig()).setReceiveBufferSize(2048); } } @Override public void sessionIdle(IoSession session, IdleStatus status) throws Exception { } @Override public void sessionOpened(IoSession session) throws Exception { } @Override public void exceptionCaught(IoSession session, Throwable cause) throws Exception { if (logger.isErrorEnabled()) { logger.error("Exception", cause); } session.close(); } /** * 解析命令中的参数,将所有格式为[param]=[value]格式的内容,以param为key,以value为值放到到map中 * * @param commandParams * @return */ private Map<String, String> parseParamMap(String[] commandParams) { Map<String, String> map = new HashMap<String, String>(); for (int i = 1; i < commandParams.length; i++) { String _param = commandParams[i]; String[] kv = _param.split("="); if (kv != null) { if (kv.length == 2) { map.put(kv[0], kv[1]); } else { if (logger.isDebugEnabled()) { logger.debug("Skip param [" + _param + "]"); } } } } return map; } }
[ "zhutao@brunjoy.com" ]
zhutao@brunjoy.com
fbfaef2b305286d474af761c056c0f0205047358
d978ed919caf36ddda3a3b1ec9a091f778454caa
/app/src/main/java/com/today/wis/WiseListAdapter.java
bc7eb6138d6d00d4ffa5cada9ada8b6b765b846d
[]
no_license
donghyun0101/Wise-User-
3a5d5f73b6ed8b12fb93cb5e1de403cede20c211
9c668d900bafaf591c475f7bfab8d35a8363e2ba
refs/heads/master
2020-12-15T17:53:13.434590
2020-02-25T09:26:19
2020-02-25T09:26:19
235,201,174
0
0
null
null
null
null
UTF-8
Java
false
false
1,665
java
package com.today.wis; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import java.util.ArrayList; public class WiseListAdapter extends BaseAdapter { private ArrayList<WistListItem> mItems = new ArrayList<>(); @Override public int getCount() { return mItems.size(); } @Override public WistListItem getItem(int position) { return mItems.get(position); } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { Context context = parent.getContext(); if (convertView == null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.listitem_wise, parent, false); } TextView tvGetWise = convertView.findViewById(R.id.tv_get_wise); TextView tvGetName = convertView.findViewById(R.id.tv_get_name); WistListItem WistListItem = getItem(position); tvGetWise.setText(WistListItem.getWise()); tvGetName.setText(WistListItem.getName()); return convertView; } /* 아이템 데이터 추가를 위한 함수. 자신이 원하는대로 작성 */ public void addItem(String wise, String name) { WistListItem mItem = new WistListItem(); mItem.setWise(wise); mItem.setName(name); mItems.add(mItem); } }
[ "donghyun0101@naver.com" ]
donghyun0101@naver.com
968610ee301c24bbb16ef6c08003938d8e1bddac
eff9f5aaf33d67100fab18258516cdfc09e4dc8e
/src/com/internousdev/template/dto/LoginDTO.java
c924ab82b1ee453fdcc8a3ab639a8bd13f5f8ea1
[]
no_license
tk596/template
abb141dd5320e42f94e5615c026a6f23c9e952bb
88f18265f6ecaf261361736761fd536de9810933
refs/heads/master
2021-07-20T14:47:39.550532
2017-10-31T07:41:55
2017-10-31T07:41:55
106,643,082
0
0
null
null
null
null
UTF-8
Java
false
false
887
java
package com.internousdev.template.dto; public class LoginDTO { private int userId; private String loginId; private String Password; private String userName; private boolean loginFlg = false; public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public String getLoginId() { return loginId; } public void setLoginId(String loginId) { this.loginId = loginId; } public String getPassword() { return Password; } public void setPassword(String password) { Password = password; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public boolean getLoginFlg() { return loginFlg; } public void setLoginFlg(boolean loginFlg) { this.loginFlg = loginFlg; } }
[ "tk_twitter@yahoo.co.jp" ]
tk_twitter@yahoo.co.jp
781e4ed210631690a92cbe39f92826cce46d32be
51f22728eac336dcd4dd4e4290a03be5f6e05694
/jwtauthapp/src/main/java/com/purpletalk/controller/UserController.java
cfa11434d1c3062a63e52235e39266841c5052d3
[]
no_license
techsravanit/jwt
06247caf27aaef558bdbfa54c6754e55eca9bba9
c008ccaec1f4be768df34b6682d3c16508ea8167
refs/heads/master
2020-03-19T19:54:42.481189
2018-06-11T05:35:39
2018-06-11T05:35:39
136,878,965
0
0
null
null
null
null
UTF-8
Java
false
false
1,225
java
package com.purpletalk.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.purpletalk.entities.AuthUser; import com.purpletalk.repositary.AuthUserRepositary; @RestController //@RequestMapping("/users") public class UserController { @Autowired private AuthUserRepositary authUserRepo; private BCryptPasswordEncoder passwordEncoder; public UserController(AuthUserRepositary authUserRepo, BCryptPasswordEncoder passwordEncoder) { this.authUserRepo = authUserRepo; this.passwordEncoder = passwordEncoder; } @RequestMapping("/") public AuthUser getData(){ return authUserRepo.findByUsername("testsuperadmin@xcubelabs.com"); } @PostMapping("/signUp") public void signUp(@RequestBody AuthUser user) { System.out.println("user details:"+user.getUsername()); user.setPassword(passwordEncoder.encode(user.getPassword())); authUserRepo.save(user); } }
[ "noreply@github.com" ]
techsravanit.noreply@github.com
2e661494603587693f6c385368bd9b4484a2e8f6
be7c20be8e396dfc15e6b3654e0e5ca04c5e0665
/platform-base/platform-common/src/main/java/com/alipay/api/request/AlipayCommerceDataMonitordataSyncRequest.java
3a4691ea1b506bfe736522940f5d7ca1fdfb00d3
[]
no_license
shuchongqj/duojifen
e465cce60ec07e060dc1859c2afc976f6a714db4
d8c0eb50b046024b55cb7d9b304f76b095051c99
refs/heads/master
2023-05-05T17:27:36.211808
2020-02-20T04:53:30
2020-02-20T04:53:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,097
java
package com.alipay.api.request; import java.util.Map; import com.alipay.api.AlipayObject; import com.alipay.api.AlipayRequest; import com.alipay.api.internal.util.AlipayHashMap; import com.alipay.api.response.AlipayCommerceDataMonitordataSyncResponse; /** * ALIPAY API: alipay.commerce.data.monitordata.sync request * * @author auto create * @since 1.0, 2017-08-23 17:12:46 */ public class AlipayCommerceDataMonitordataSyncRequest implements AlipayRequest<AlipayCommerceDataMonitordataSyncResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 自助监控服务接口 */ private String bizContent; public void setBizContent(String bizContent) { this.bizContent = bizContent; } public String getBizContent() { return this.bizContent; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getReturnUrl() { return this.returnUrl; } public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getProdCode() { return this.prodCode; } public String getApiMethodName() { return "alipay.commerce.data.monitordata.sync"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("biz_content", this.bizContent); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Class<AlipayCommerceDataMonitordataSyncResponse> getResponseClass() { return AlipayCommerceDataMonitordataSyncResponse.class; } public boolean isNeedEncrypt() { return this.needEncrypt; } public void setNeedEncrypt(boolean needEncrypt) { this.needEncrypt=needEncrypt; } public AlipayObject getBizModel() { return this.bizModel; } public void setBizModel(AlipayObject bizModel) { this.bizModel=bizModel; } }
[ "softopensell@outlook.com" ]
softopensell@outlook.com
6f90a0524749a0510feedc34df3d768cf612f9fd
09dd21093ecee1266102cf8772dfe6c30120d393
/app/src/main/java/com/example/kolin/flick/MyApplication.java
0a0357b25942f2fb4a4e009d2583cc5291624440
[]
no_license
KolinLoures/Flickr
c0782620a75fab2f4aef7d3666d97407a3b9e447
8419b3b9dfb6ff00fec886a481233f8eeed585d2
refs/heads/master
2021-01-01T04:26:22.711601
2016-05-27T13:17:10
2016-05-27T13:17:10
59,252,676
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package com.example.kolin.flick; import android.app.Application; import com.facebook.stetho.Stetho; /** * Created by n.kirilov on 27.05.2016. */ public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); Stetho.initializeWithDefaults(this); } }
[ "kolin-1994@mail/ru" ]
kolin-1994@mail/ru