blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
a913b041c72451ffd13e7797756d6f79c9856aaa
e572bc2b811dbd30756cfa83cea810178a48306d
/lab5(lab3 with tests)/main/Ex5/ChooseSort.java
68f1073cc77537842b46d18b4109f2163a7af747
[]
no_license
jbryzek/java
d284a38669ce607d0ae9178c9d31dc13a8863551
25b3191c1b39408df4a966d5a4e01299a6da10ed
refs/heads/master
2022-06-24T19:50:57.543054
2020-08-31T20:14:49
2020-08-31T20:14:49
175,828,142
0
1
null
2022-06-21T01:13:02
2019-03-15T13:45:11
Java
UTF-8
Java
false
false
1,133
java
package Ex5; public class ChooseSort { public double sort(int[] array,SortAlgorithm g){ long tStart = System.currentTimeMillis(); switch(g){ case BUBBLE:{ BubbleSort bubbleSort=new BubbleSort(); bubbleSort.bubbleSort(array); break; } case QUICK: { QuickSort quickSort = new QuickSort(); quickSort.quickSort(array); break; } case MERGE:{ MergeSort mergeSort=new MergeSort(); mergeSort.mergeSort(array); break; } case INSERT:{ InsertionSort insertionSort=new InsertionSort(); insertionSort.insertionSort(array); } case SHELL:{ ShellSort shellSort=new ShellSort(); shellSort.shellSort(array); } } long tEnd = System.currentTimeMillis(); double elapsedSeconds = (tEnd-tStart) / 1000.0; return elapsedSeconds; } }
[ "noreply@github.com" ]
noreply@github.com
6c457ae41d78b0f364c439665f671756595e229f
44f05794dd6d0e4fcff9802840eb25a24acf38ba
/drak-server-blog/src/test/java/com/linsu/threaddemo/matrix/ParallelIndividualMultiplier.java
c66bf888270c43377f542087fd8b680ccacb5c9b
[]
no_license
linsudeer/drak
042d0035554482c7a6681e5fdeb11c30d17612ec
5ed098e77f4b1d068b210993ff35b52914999be1
refs/heads/master
2022-12-25T04:13:46.523768
2019-11-30T09:28:39
2019-11-30T09:28:39
224,987,833
0
0
null
2022-12-10T10:38:00
2019-11-30T09:21:27
TSQL
UTF-8
Java
false
false
1,571
java
package com.linsu.threaddemo.matrix; import java.util.ArrayList; import java.util.List; /** * 每个元素开启一个线程 */ public class ParallelIndividualMultiplier { public static void multiply(int[][] matrix1, int[][] matrix2, int[][] result) { int rows1 = matrix1.length; int columns2 = matrix2[0].length; List<Thread> threads = new ArrayList<>(); for(int i=0;i<rows1;i++){ for(int j=0;j<columns2;j++){ IndividualMultiplierTask task = new IndividualMultiplierTask(result, matrix1, matrix2, i, j); Thread thread = new Thread(task); thread.start(); threads.add(thread); if(threads.size()%10==0){// 这里每10个执行完成之后再执行下一组 waitForThreads(threads); } } } } public static void waitForThreads(List<Thread> threads){ for(Thread thread: threads){ try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } } public static void main(String[] args){ int[][] matrix1 = MatrixGenerator.generate(2000, 2000); int[][] matrix2 = MatrixGenerator.generate(2000, 2000); int[][] result = new int[2000][2000]; long start = System.currentTimeMillis(); ParallelIndividualMultiplier.multiply(matrix1, matrix2, result); System.out.println("耗时:"+(System.currentTimeMillis()-start)); } }
[ "lisonglin@thczht.com" ]
lisonglin@thczht.com
fbb8c9f1b83c69a506123f6623bc135893d4ff4f
0bf7b894aef3c3898cf68abbc8dd9c7e77782ef9
/app/src/androidTest/java/com/example/mdc/ExampleInstrumentedTest.java
c056909dd61b7381a9dee34be535559dc66b4285
[]
no_license
RajputNaveenLalTiwari/MaterialDesignComponent
1d78d505336b6354f3f5dc85f16dda8d23037dd3
19878614c88d3d418007f597186b2618933c20d0
refs/heads/master
2020-05-30T21:08:02.451244
2019-06-03T08:49:56
2019-06-03T08:49:56
189,963,394
0
0
null
null
null
null
UTF-8
Java
false
false
740
java
package com.example.mdc; 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("com.example.mdc", appContext.getPackageName()); } }
[ "root@DESKTOP-04J92F7.localdomain" ]
root@DESKTOP-04J92F7.localdomain
746f714bfe78a0d3a05c2052f85610024476af81
5dbe989462ecd4d4c2d5891c33d66c1278cc00f9
/gallery_noob/app/src/main/java/com/example/gallery_noob/FirstFragment.java
cdde47d772bb8072aa189248c6df38656c94a759
[]
no_license
NhanRui/Android
4cba02bf4ba39a78deeca7d12c0aeed82a3229f8
3be94f567cca6800d2e7144aa915d92eee0e23a3
refs/heads/main
2023-03-11T22:30:59.886151
2021-03-07T02:38:52
2021-03-07T02:38:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,035
java
package com.example.gallery_noob; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A simple {@link Fragment} subclass. * Use the {@link FirstFragment#newInstance} factory method to * create an instance of this fragment. */ public class FirstFragment extends Fragment { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; public FirstFragment() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment FirstFragment. */ // TODO: Rename and change types and number of parameters public static FirstFragment newInstance(String param1, String param2) { FirstFragment fragment = new FirstFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_first, container, false); } }
[ "phucyugi1@gmail.com" ]
phucyugi1@gmail.com
054cd73de4401344938eb0fc72680674104d97b5
4d326e2eeb0e721765e95245763648873781d360
/HandMadeProject/app/src/main/java/com/example/handmadeproject/MapActivity.java
22ae1b34d062c4a9e021df4d1f3c1a595647e177
[]
no_license
NiSrOK/android_project
fab0d3a6c883bdcadbbd1e0cb1d3f8b4f2585d27
82e7e903de491b37257f49984bb39a039577e387
refs/heads/master
2021-01-14T20:06:01.451632
2020-02-24T14:06:15
2020-02-24T14:06:15
242,741,368
0
1
null
null
null
null
UTF-8
Java
false
false
7,975
java
package com.example.handmadeproject; import androidx.fragment.app.FragmentActivity; import com.google.android.gms.maps.model.Marker; import android.os.Bundle; import android.content.Intent; import android.location.Location; import android.util.Log; import android.view.View; import android.widget.ImageButton; import com.google.android.gms.location.FusedLocationProviderClient; import com.google.android.gms.location.LocationServices; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.tasks.OnSuccessListener; public class MapActivity extends FragmentActivity implements OnMapReadyCallback, View.OnClickListener { private GoogleMap mMap; private double lat; private double lon; private static final float DEFAULT_ZOOM = 17f; private static final float START_ZOOM = 11f; ImageButton locationButton; private FusedLocationProviderClient fusedLocationClient; public void setCoordinates(Location location) { lat = location.getLongitude(); lon = location.getLatitude(); } public void defaultLocation(){ lat = 56.281228; lon = 43.945257; LatLng latLng = new LatLng(lon, lat); mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); moveCamera(new LatLng(lat,lon), START_ZOOM, "My Location"); } private void moveCamera(LatLng latLng, float zoom, String title){ Log.d("qwe", "moveCamera: moving the camera to: lat: " + latLng.latitude + ", lng: " + latLng.longitude ); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom)); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //////////// if (SettingsActivity.mode=="dark"){ setTheme(R.style.DarkThemeMedium);} else{ setTheme(R.style.LightThemeMedium); } //////// setContentView(R.layout.activity_map); locationButton= findViewById(R.id.current_location); locationButton.setOnClickListener(this); SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); assert mapFragment != null; mapFragment.getMapAsync(this); fusedLocationClient = LocationServices.getFusedLocationProviderClient(this); } @Override protected void onStart() { super.onStart(); } @Override protected void onResume() { super.onResume(); } @Override protected void onPause() { super.onPause(); } @Override protected void onStop() { super.onStop(); } //перемещение на текущую локацию @Override public void onClick(View v) { if (v.getId() == R.id.current_location) { defaultLocation(); fusedLocationClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener<Location>() { @Override public void onSuccess(Location location) { Location currentLocation = location; if (location != null) { setCoordinates(location); LatLng latLng = new LatLng(lon, lat); //mMap.addMarker(new MarkerOptions().position(latLng).title("Вы здесь")); mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); moveCamera(new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()), DEFAULT_ZOOM, "My Location");} } }); } } @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; defaultLocation(); fusedLocationClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener<Location>() { @Override public void onSuccess(Location location) { //установка маркера из чата final Intent intent = getIntent(); final String LATITUDE = intent.getStringExtra("latitude"); final String LONGITUDE = intent.getStringExtra("longitude"); final String DISCRIPTION = intent.getStringExtra("discription"); if ((LATITUDE != null)) { MarkerStart(LATITUDE, LONGITUDE, DISCRIPTION); } else { Location currentLocation = location; /////// //перемещение на локацию устройства при первом запуске if (location != null) { setCoordinates(location); LatLng latLng = new LatLng(lon, lat); mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); moveCamera(new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()), DEFAULT_ZOOM, "My Location");} } } }); //установка маркера mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() { @Override public void onMapLongClick(LatLng latLng) { //переход к активити описания mMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() { @Override public void onInfoWindowClick(Marker marker) { Intent intent = new Intent(MapActivity.this, ServiceSelect.class); intent.putExtra("lati" ,Double.toString(marker.getPosition().latitude)); intent.putExtra("long" ,Double.toString(marker.getPosition().longitude)); startActivity(intent); mMap.setOnInfoWindowClickListener(null); finish(); } }); MarkerOptions markerOptions = new MarkerOptions(); markerOptions.position(latLng); markerOptions.title("Нажмите чтобы описать проблему"); mMap.addMarker(markerOptions); } }); //перемещение маркера ТОЛКОМ НЕ ТЕСТИЛОСЬ mMap.setOnMarkerDragListener(new GoogleMap.OnMarkerDragListener(){ @Override public void onMarkerDragStart(Marker marker) { } @Override public void onMarkerDrag(Marker marker) { } @Override public void onMarkerDragEnd(Marker marker) { } }); } //установка маркера из чата public void MarkerStart(String latitude, String longitude, String diskription){ double lati = Double.parseDouble(latitude); double longi = Double.parseDouble(longitude); LatLng latLng = new LatLng(lati, longi); MarkerOptions markerOptions = new MarkerOptions(); markerOptions.position(latLng); markerOptions.title(diskription); mMap.addMarker(markerOptions); mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); moveCamera(new LatLng(lati, longi), DEFAULT_ZOOM, diskription); mMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() { @Override public void onInfoWindowClick(Marker marker) { Intent intent = new Intent(MapActivity.this, RdyDisk.class); startActivity(intent); } }); } }
[ "kornilovqwerty@gmail.com" ]
kornilovqwerty@gmail.com
b7e2c6a8eff3d45cfbbacde22a0b1064defb48ff
9baaa9e0a18c8a9bba9a859104712b1802548441
/TestActivity/src/com/example/testactivity/MainActivity.java
f60bf3296975af7eb1545f7655dc2719dadc87bf
[]
no_license
ZesenWang/MyCodeRepository--Eclipse
9429ebfb05d20f0c45f3111cddde12d003cd1cac
f6dd156fae83a3c067efbb7c6ee0c03034f9eaac
refs/heads/master
2021-01-22T05:10:33.030120
2017-02-07T10:10:31
2017-02-07T10:10:31
81,626,328
0
0
null
null
null
null
UTF-8
Java
false
false
1,341
java
package com.example.testactivity; import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBar; import android.support.v4.app.Fragment; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.os.Build; public class MainActivity extends Activity { final String TAG="tag"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.i(TAG, "MainActivity-->onCreate"); } @Override protected void onStart() { // TODO Auto-generated method stub super.onStart();Log.i(TAG, "MainActivity-->onStart"); } @Override protected void onResume(){ super.onResume();Log.i(TAG, "MainActivity-->onResume"); } @Override protected void onPause(){ super.onPause();Log.i(TAG, "MainActivity-->onPause"); } @Override protected void onStop(){ super.onStop();Log.i(TAG, "MainActivity-->onStop"); } @Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy();Log.i(TAG,"MainActivity-->onDestroy"); } }
[ "wangzesen@outlook.com" ]
wangzesen@outlook.com
bf26153c64e20d103ddf9ebf71162dd3d8555e62
565515a0482eb542b526c89d5f97cc3b5825356d
/src/main/java/com/example/bddspring1585330669/DemoApplication.java
9dedaca33376dbe02551c063c4955f12f9f5ed9f
[]
no_license
cb-kubecd/bdd-spring-1585330669
8b3a9b313fddfde44e774cf8cb5fb07ebc2823a5
3d7f3ecfb845fe38c4dd9a67f0099e453ccc423b
refs/heads/master
2021-05-17T03:37:46.522192
2020-03-27T17:38:22
2020-03-27T17:38:22
250,602,208
0
0
null
null
null
null
UTF-8
Java
false
false
320
java
package com.example.bddspring1585330669; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
[ "jenkins-x-test@googlegroups.com" ]
jenkins-x-test@googlegroups.com
72590272a7ea24993d3d222b0bd45c2d6451189b
d0a37b931fa1681067be919aff47ae2efaa31a4d
/MultiThread/src/main/java/lock/SequentialPrinting.java
1f628d3eb2f9ff8ac98a91fc87e14ea48859ccc3
[]
no_license
Halcyon-zzw/Learn-Java
0093082ab15d423784deb24d2eee9344b5e53422
cbede97739e550ca76f94d0e99ee1d0ac871ca64
refs/heads/master
2023-04-26T23:57:45.717841
2021-06-25T05:53:26
2021-06-25T05:53:26
238,868,886
0
0
null
2023-04-17T19:50:50
2020-02-07T07:44:10
Java
UTF-8
Java
false
false
1,465
java
package lock; import lombok.extern.slf4j.Slf4j; import java.util.concurrent.locks.LockSupport; /** * 保证first先打印,sencend再打印 * * @Author: zhuzw * @Date: 2021-05-10 18:33 * @Version: 1.0 */ @Slf4j public class SequentialPrinting { static boolean firstPrinted = false; /** * wait-notify实现 */ public static void implByWaitNotify() { Object obj = new Object(); new Thread(() -> { synchronized (obj) { if (!firstPrinted) { try { obj.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } log.info("sencend"); }, "t1").start(); new Thread(() -> { log.info("first"); synchronized (obj) { firstPrinted = true; obj.notify(); } }, "t2").start(); } /** * park、unpark实现 */ public static void implByParkUnpark() { Thread t1 = new Thread(() -> { LockSupport.park(); log.info("sencend"); }, "t1"); t1.start(); new Thread(() -> { log.info("first"); LockSupport.unpark(t1); }, "t2").start(); } public static void main(String[] args) { implByWaitNotify(); // implByParkUnpark(); } }
[ "zhuzw@gildata.com" ]
zhuzw@gildata.com
5f492d15d8b3f2ed178b0455ac43600d0125e1bf
102c3a23c777b10c37ca02647900f14ba7f37279
/TabuadaComWhile.java
bb7eedd14593839fa9d17ffc44f343e547dcfe74
[]
no_license
brunoagueda/learning-java
d34733cbb2d0aad0982290c582fbf6b2bf236a14
9bd2297dd8059fd66a1fa4ff0e314bf94ea0964a
refs/heads/main
2023-04-23T03:40:39.100419
2021-05-06T21:04:12
2021-05-06T21:04:12
364,019,568
0
0
null
2021-05-04T13:01:32
2021-05-03T18:10:41
Java
UTF-8
Java
false
false
301
java
public class TabuadaComWhile{ public static void main(String args[]){ int numero = 6; int contador = 1; while (contador <= 10){ System.out.println(numero + " x " + contador + " = " + (numero * contador)); contador = contador + 1; } } }
[ "aguebru@itaud.des.ihf" ]
aguebru@itaud.des.ihf
20d5f04712c7521dfe150df5eee2577af23cfd9c
6f576195c267637035e20628c8700ca1d8bd5352
/app/src/main/java/com/example/my2048/modules/mainactivity/MainActivity.java
39061b851a61e97619831b277b80f3d023ae1d87
[]
no_license
mashahbazi/2048
41667df3ae6409eaa41e7e7fc99239879c38def9
d130ddd29c447ec20d40498f597f7a174dbb6703
refs/heads/master
2021-08-07T18:54:57.342416
2021-07-28T08:46:41
2021-07-28T08:46:41
189,068,552
1
0
null
null
null
null
UTF-8
Java
false
false
1,455
java
package com.example.my2048.modules.mainactivity; import android.os.Bundle; import android.view.GestureDetector; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import androidx.lifecycle.ViewModelProviders; import com.example.my2048.R; import com.example.my2048.databinding.ActivityMainBinding; import com.example.my2048.helpers.CustomGestureDetector; import com.example.my2048.helpers.SharedPreferencesHelper; public class MainActivity extends AppCompatActivity { private MainActivityViewModel viewModel; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); MainActivityFactory factory = new MainActivityFactory(SharedPreferencesHelper.getInstance(this)); viewModel = ViewModelProviders.of(this, factory).get(MainActivityViewModel.class); ActivityMainBinding binding=DataBindingUtil.setContentView(this, R.layout.activity_main); binding.setLifecycleOwner(this); binding.setViewModel(viewModel); init(); } private void init() { GestureDetector gestureDetector = new GestureDetector(this, new CustomGestureDetector(viewModel)); findViewById(R.id.base_parent).setOnTouchListener((v, event) -> { gestureDetector.onTouchEvent(event); v.performClick(); return false; }); } }
[ "MahdiShahbazi3653@yahoo.com" ]
MahdiShahbazi3653@yahoo.com
5bc862c4231020c553366758dde5ac3e2afe1289
317c7c2632aacb2ec1111e0255a0c9d6516753b2
/app/src/main/java/com/yeeseng/westerndeli/model/Confirm_Order.java
eb7e2558c4cef6be585a44df1b7f8b0e812aec00
[]
no_license
yeeseng98/WesternDeli
9468d98f1580bc79dbddfe12193fee12ca271593
516f36d7218842145811196f45843618556df2b4
refs/heads/master
2020-08-22T03:13:33.932186
2019-10-20T04:06:53
2019-10-20T04:06:53
216,304,842
0
0
null
null
null
null
UTF-8
Java
false
false
1,021
java
package com.yeeseng.westerndeli.model; public class Confirm_Order { private String Address; private int EstimateTime; private String OrderTime; private int TotalPortions; private double TotalPrice; public String getAddress() { return Address; } public void setAddress(String address) { Address = address; } public int getEstimateTime() { return EstimateTime; } public void setEstimateTime(int estimateTime) { EstimateTime = estimateTime; } public String getOrderTime() { return OrderTime; } public void setOrderTime(String orderTime) { OrderTime = orderTime; } public int getTotalPortions() { return TotalPortions; } public void setTotalPortions(int totalPortions) { TotalPortions = totalPortions; } public double getTotalPrice() { return TotalPrice; } public void setTotalPrice(double totalPrice) { TotalPrice = totalPrice; } }
[ "43286817+yeeseng98@users.noreply.github.com" ]
43286817+yeeseng98@users.noreply.github.com
922004fc8dbbceb4da19ec145990d6df5f007ce6
a0dcfa0be533582106d92bd350972b647a08d8a7
/q-order/src/main/java/com/meruvian/pxc/selfservice/task/RequestTokenFxpc.java
c877a68a46fb0c4c4f21ac8d376ed2874e17927e
[]
no_license
AKM07/miniature-parkin-droid
82992a1c902237f0d473ff6880234c4c1e5dd6dc
30fe11f28b576265818ceb1353c2b51b72edead1
refs/heads/master
2021-05-31T12:41:41.023687
2016-05-19T04:22:00
2016-05-19T04:22:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,627
java
package com.meruvian.pxc.selfservice.task; import android.content.Context; import android.os.AsyncTask; import android.util.Base64; import android.util.Log; import com.meruvian.pxc.selfservice.SignageAppication; import com.meruvian.pxc.selfservice.SignageVariables; import com.meruvian.pxc.selfservice.entity.Authentication; import com.meruvian.pxc.selfservice.service.LoginService; import com.meruvian.pxc.selfservice.util.AuthenticationUtils; import org.apache.oltu.oauth2.common.message.types.GrantType; import org.meruvian.midas.core.service.TaskService; import java.io.IOException; import java.util.HashMap; import java.util.Map; import retrofit.Call; import retrofit.Retrofit; /** * Created by akm on 07/01/16. */ public class RequestTokenFxpc extends AsyncTask<String, Void, String> { private Context context; private TaskService service; private Authentication authentication; public RequestTokenFxpc(Context context, TaskService service) { this.context = context; this.service = service; } @Override public void onPreExecute() { super.onPreExecute(); service.onExecute(SignageVariables.FXPC_REQUEST_TOKEN_TASK); } @Override public String doInBackground(String... params) { Retrofit retrofit = SignageAppication.getInstance().getRetrofit(); LoginService loginService = retrofit.create(LoginService.class); authentication = AuthenticationUtils.getCurrentAuthentication(); Map<String, String> param = new HashMap<>(); param.put("grant_type", GrantType.AUTHORIZATION_CODE.toString()); param.put("redirect_uri", SignageVariables.FXPC_CALLBACK); param.put("client_id", SignageVariables.FXPC_APP_ID); param.put("client_secret", SignageVariables.FXPC_APP_SECRET); param.put("scope", "read write"); param.put("code", params[0]); String authorization = new String(Base64.encode((SignageVariables.FXPC_APP_ID + ":" + SignageVariables.FXPC_APP_SECRET).getBytes(), Base64.NO_WRAP)); Call<Authentication> callAuth = loginService.requestTokenFxpc("Basic " + authorization, "fxpc.demo.meruvian.org", param); try { authentication = callAuth.execute().body(); AuthenticationUtils.registerAuthentication(authentication); } catch (IOException e) { e.printStackTrace(); } return authentication.getAccessToken(); } @Override public void onPostExecute(String s) { Log.d("cek", s); service.onSuccess(SignageVariables.FXPC_REQUEST_TOKEN_TASK, s); } }
[ "ari.kusuma@meruvian.org" ]
ari.kusuma@meruvian.org
983f5e0631a205e4fa02747e6cc7825da5b51773
05c1b386ad632e6b010b345e7f0f07719b53977f
/LinkedListDemo.java
2efb366fc433397550aec236ad70d31eec4b2be1
[]
no_license
JUBINBIJU/java
7c192973043c9c2bbe9f59880c9e3ddae04d2227
9b22c3571c0bd703a6bcf125d51a0f2f0b126b79
refs/heads/master
2021-04-14T20:31:02.725458
2020-03-20T15:57:46
2020-03-20T15:57:46
249,264,028
0
0
null
2020-03-22T20:11:46
2020-03-22T20:11:45
null
UTF-8
Java
false
false
503
java
import java.util.Scanner; public class LinkedListDemo { public static LinkedList list; public static void main(String args[]) { list=new LinkedList(); Scanner sc=new Scanner(System.in); System.out.print("Enter no.of elements : "); int n=sc.nextInt(); System.out.print("Enter elements :\n\t"); for(int i=0;i<n;i++) { list.insert(sc.nextInt()); System.out.print("\t"); } list.printList(); } }
[ "noreply@github.com" ]
noreply@github.com
8fbbd43a9b7d3bfc707994f4c389d39035f15bd9
feffe72bd834ffe09439758f1375fc4ee754409a
/src/main/java/com/andriyprokip/sombrashop/manager/interfaces/ICityManager.java
e76cda6f230d007a1794e8b8a21415cd2c4f6908
[]
no_license
andrik92/sombraShop
17ba7d4693618c715edb84deb5b6c097affc797d
696ed324ddd5405dfe3e4e6d03f6a01af0930461
refs/heads/master
2016-09-05T15:03:54.847494
2014-09-16T12:37:41
2014-09-16T12:37:41
24,098,121
1
0
null
null
null
null
UTF-8
Java
false
false
544
java
package com.andriyprokip.sombrashop.manager.interfaces; import java.util.List; import com.andriyprokip.sombrashop.entity.City; import com.andriyprokip.sombrashop.entity.Lot; public interface ICityManager { public void save(City city); public void delete(City city); public List<City> findAllCity(); public City findByIdCity(Integer id); public City findByCityName(String name); public List<String> citiesOfLots(List<Lot> lots); public void deactivateById(int id); public void activateById(int id); }
[ "Андрій@192.168.1.10" ]
Андрій@192.168.1.10
1093c27b46b9eddfc0f791f23a2aee9b08b7bdae
6b8bea83674ced1ee4d2766f7c33317298b92c23
/Chapter03/src/edu/packt/neuralnet/learn/LMTest.java
772a9d020d0b4a8b53dcdb66057653b6dd4af685
[ "MIT" ]
permissive
PacktPublishing/Neural-Network-Programming-with-Java-SecondEdition
f557e2be9360d511ea1f66fd465dc4f270628eec
c3af1f18205dbae9f82edc9cb1cacd4a1028fa97
refs/heads/master
2022-11-15T05:28:34.706110
2022-10-31T07:47:52
2022-10-31T07:47:52
84,282,311
61
65
MIT
2018-07-02T09:24:14
2017-03-08T05:32:26
Java
UTF-8
Java
false
false
3,928
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package edu.packt.neuralnet.learn; import edu.packt.neuralnet.NeuralException; import edu.packt.neuralnet.NeuralNet; import edu.packt.neuralnet.data.NeuralDataSet; import edu.packt.neuralnet.init.UniformInitialization; import edu.packt.neuralnet.math.IActivationFunction; import edu.packt.neuralnet.math.Linear; import edu.packt.neuralnet.math.RandomNumberGenerator; import edu.packt.neuralnet.math.Sigmoid; /** * * @author fab */ public class LMTest { public static void main(String[] args){ //NeuralNet nn = new NeuralNet RandomNumberGenerator.seed=0; int numberOfInputs=3; int numberOfOutputs=4; int[] numberOfHiddenNeurons={4,3,2}; Linear outputAcFnc = new Linear(1.0); Sigmoid hl0Fnc = new Sigmoid(1.0); Sigmoid hl1Fnc = new Sigmoid(1.0); Sigmoid hl2Fnc = new Sigmoid(1.0); IActivationFunction[] hiddenAcFnc={hl0Fnc ,hl1Fnc ,hl2Fnc }; System.out.println("Creating Neural Network..."); NeuralNet nn = new NeuralNet(numberOfInputs, numberOfOutputs , numberOfHiddenNeurons, hiddenAcFnc, outputAcFnc ,new UniformInitialization(-1.0,1.0)); System.out.println("Neural Network created!"); nn.print(); Double[][] _neuralDataSet = { {-1.0,-1.0,-1.0,-1.0,1.0,-3.0,1.0} , {-1.0,-1.0,1.0,1.0,-1.0,-1.0,-1.0} , {-1.0,1.0,-1.0,1.0,-1.0,-1.0,-1.0} , {-1.0,1.0,1.0,-1.0,-1.0,1.0,-3.0} , {1.0,-1.0,-1.0,1.0,-1.0,-1.0,3.0} , {1.0,-1.0,1.0,-1.0,-1.0,1.0,1.0} , {1.0,1.0,-1.0,-1.0,1.0,1.0,1.0} , {1.0,1.0,1.0,1.0,-1.0,3.0,-1.0} }; int[] inputColumns = {0,1,2}; int[] outputColumns = {3,4,5,6}; NeuralDataSet neuralDataSet = new NeuralDataSet(_neuralDataSet,inputColumns,outputColumns); System.out.println("Dataset created"); neuralDataSet.printInput(); neuralDataSet.printTargetOutput(); System.out.println("Getting the first output of the neural network"); LevenbergMarquardt lma = new LevenbergMarquardt(nn,neuralDataSet,LearningAlgorithm.LearningMode.BATCH); lma.setDamping(0.001); lma.setMaxEpochs(100); lma.setGeneralErrorMeasurement(Backpropagation.ErrorMeasurement.SimpleError); lma.setOverallErrorMeasurement(Backpropagation.ErrorMeasurement.MSE); lma.setMinOverallError(0.0001); lma.printTraining=true; try{ lma.forward(); neuralDataSet.printNeuralOutput(); lma.train(); System.out.println("End of training"); if(lma.getMinOverallError()>=lma.getOverallGeneralError()){ System.out.println("Training successful!"); } else{ System.out.println("Training was unsuccessful"); } System.out.println("Overall Error:" +String.valueOf(lma.getOverallGeneralError())); System.out.println("Min Overall Error:" +String.valueOf(lma.getMinOverallError())); System.out.println("Epochs of training:" +String.valueOf(lma.getEpoch())); System.out.println("Target Outputs:"); neuralDataSet.printTargetOutput(); System.out.println("Neural Output after training:"); lma.forward(); neuralDataSet.printNeuralOutput(); } catch(NeuralException ne){ } } }
[ "naveenkumarj@packtpub.com" ]
naveenkumarj@packtpub.com
2f2bcf54b303809a2e7325f0d3b67df52803d839
ea084bf22a0a54e7dae3b45f963b95a7da9f7d7d
/mtomcat/src/main/java/com/fjd/utils/XmlParser.java
28a4a6d695b25005442d26b168281eb7ee9f9848
[]
no_license
fanjingdan012/mtomcat
08777212dcb6bae53e6791013f790b6d90016890
460acc28cce7bb8253d6023db0148adead01da30
refs/heads/master
2021-07-06T07:19:06.719756
2019-07-02T07:30:17
2019-07-02T07:30:17
194,469,134
0
0
null
2020-10-13T14:16:08
2019-06-30T03:04:13
Java
UTF-8
Java
false
false
174
java
package com.fjd.utils; import com.fjd.ProjectLoader; public class XmlParser { public ProjectLoader.ProjectConfiginfo loadXml(String s) { return null; } }
[ "judy.fan@sap.com" ]
judy.fan@sap.com
21a92322d4d8c7dacd2e26980a3777e02445a21c
ba8f51a38c29a84a11f035bf334a3bb006629e9d
/ODSFileManager/src/main/java/com/example/odsfilemanager/config/MyBatisConfig.java
9f71d9d0e93323e811b3a3038b632bafca16671b
[]
no_license
Luca-Celardo/UseCaseNEXI
3406e2d2f1cd0bf5ad687e7d6029136afbcd4f38
0e5d78cbef3f37a8525d7efc54785508eb9fc2a3
refs/heads/master
2021-05-24T10:59:47.300407
2020-06-16T21:08:22
2020-06-16T21:08:22
253,529,536
0
0
null
null
null
null
UTF-8
Java
false
false
255
java
package com.example.odsfilemanager.config; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Configuration; @Configuration @MapperScan("com.example.odsfilemanager.persistence") public class MyBatisConfig { }
[ "luca.celardo@gmail.com" ]
luca.celardo@gmail.com
4091cd375d1fb7aca94b46498f67ce1929e8d886
e96f105f6bdf4cb557c4a08697e0f328c7e9ac6d
/src/com/login/db/model/server/ServerExample.java
3ffaeee89b6b14cad7a58128a66d2ab65639480a
[]
no_license
gyi/cs_login
896992d830f0ba88a1362575c1a08f3d74bf4e7f
a629bdc1222eb04db343e07e50fc801d5741c49d
refs/heads/master
2021-01-23T11:20:22.439689
2015-01-30T09:24:38
2015-01-30T09:24:38
30,065,332
0
0
null
null
null
null
UTF-8
Java
false
false
32,851
java
package com.login.db.model.server; import java.util.ArrayList; import java.util.List; public class ServerExample { /** * This field was generated by MyBatis Generator. This field corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ protected String orderByClause; /** * This field was generated by MyBatis Generator. This field corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ protected boolean distinct; /** * This field was generated by MyBatis Generator. This field corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ protected List<Criteria> oredCriteria; /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public ServerExample() { oredCriteria = new ArrayList<Criteria>(); } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public String getOrderByClause() { return orderByClause; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public void setDistinct(boolean distinct) { this.distinct = distinct; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public boolean isDistinct() { return distinct; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public List<Criteria> getOredCriteria() { return oredCriteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public void or(Criteria criteria) { oredCriteria.add(criteria); } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } /** * This class was generated by MyBatis Generator. This class corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Integer value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Integer value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Integer value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Integer value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Integer value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Integer value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Integer> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Integer> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Integer value1, Integer value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Integer value1, Integer value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andAreaidIsNull() { addCriterion("areaId is null"); return (Criteria) this; } public Criteria andAreaidIsNotNull() { addCriterion("areaId is not null"); return (Criteria) this; } public Criteria andAreaidEqualTo(Integer value) { addCriterion("areaId =", value, "areaid"); return (Criteria) this; } public Criteria andAreaidNotEqualTo(Integer value) { addCriterion("areaId <>", value, "areaid"); return (Criteria) this; } public Criteria andAreaidGreaterThan(Integer value) { addCriterion("areaId >", value, "areaid"); return (Criteria) this; } public Criteria andAreaidGreaterThanOrEqualTo(Integer value) { addCriterion("areaId >=", value, "areaid"); return (Criteria) this; } public Criteria andAreaidLessThan(Integer value) { addCriterion("areaId <", value, "areaid"); return (Criteria) this; } public Criteria andAreaidLessThanOrEqualTo(Integer value) { addCriterion("areaId <=", value, "areaid"); return (Criteria) this; } public Criteria andAreaidIn(List<Integer> values) { addCriterion("areaId in", values, "areaid"); return (Criteria) this; } public Criteria andAreaidNotIn(List<Integer> values) { addCriterion("areaId not in", values, "areaid"); return (Criteria) this; } public Criteria andAreaidBetween(Integer value1, Integer value2) { addCriterion("areaId between", value1, value2, "areaid"); return (Criteria) this; } public Criteria andAreaidNotBetween(Integer value1, Integer value2) { addCriterion("areaId not between", value1, value2, "areaid"); return (Criteria) this; } public Criteria andServernameIsNull() { addCriterion("serverName is null"); return (Criteria) this; } public Criteria andServernameIsNotNull() { addCriterion("serverName is not null"); return (Criteria) this; } public Criteria andServernameEqualTo(String value) { addCriterion("serverName =", value, "servername"); return (Criteria) this; } public Criteria andServernameNotEqualTo(String value) { addCriterion("serverName <>", value, "servername"); return (Criteria) this; } public Criteria andServernameGreaterThan(String value) { addCriterion("serverName >", value, "servername"); return (Criteria) this; } public Criteria andServernameGreaterThanOrEqualTo(String value) { addCriterion("serverName >=", value, "servername"); return (Criteria) this; } public Criteria andServernameLessThan(String value) { addCriterion("serverName <", value, "servername"); return (Criteria) this; } public Criteria andServernameLessThanOrEqualTo(String value) { addCriterion("serverName <=", value, "servername"); return (Criteria) this; } public Criteria andServernameLike(String value) { addCriterion("serverName like", value, "servername"); return (Criteria) this; } public Criteria andServernameNotLike(String value) { addCriterion("serverName not like", value, "servername"); return (Criteria) this; } public Criteria andServernameIn(List<String> values) { addCriterion("serverName in", values, "servername"); return (Criteria) this; } public Criteria andServernameNotIn(List<String> values) { addCriterion("serverName not in", values, "servername"); return (Criteria) this; } public Criteria andServernameBetween(String value1, String value2) { addCriterion("serverName between", value1, value2, "servername"); return (Criteria) this; } public Criteria andServernameNotBetween(String value1, String value2) { addCriterion("serverName not between", value1, value2, "servername"); return (Criteria) this; } public Criteria andIsdeletedIsNull() { addCriterion("isDeleted is null"); return (Criteria) this; } public Criteria andIsdeletedIsNotNull() { addCriterion("isDeleted is not null"); return (Criteria) this; } public Criteria andIsdeletedEqualTo(Integer value) { addCriterion("isDeleted =", value, "isdeleted"); return (Criteria) this; } public Criteria andIsdeletedNotEqualTo(Integer value) { addCriterion("isDeleted <>", value, "isdeleted"); return (Criteria) this; } public Criteria andIsdeletedGreaterThan(Integer value) { addCriterion("isDeleted >", value, "isdeleted"); return (Criteria) this; } public Criteria andIsdeletedGreaterThanOrEqualTo(Integer value) { addCriterion("isDeleted >=", value, "isdeleted"); return (Criteria) this; } public Criteria andIsdeletedLessThan(Integer value) { addCriterion("isDeleted <", value, "isdeleted"); return (Criteria) this; } public Criteria andIsdeletedLessThanOrEqualTo(Integer value) { addCriterion("isDeleted <=", value, "isdeleted"); return (Criteria) this; } public Criteria andIsdeletedIn(List<Integer> values) { addCriterion("isDeleted in", values, "isdeleted"); return (Criteria) this; } public Criteria andIsdeletedNotIn(List<Integer> values) { addCriterion("isDeleted not in", values, "isdeleted"); return (Criteria) this; } public Criteria andIsdeletedBetween(Integer value1, Integer value2) { addCriterion("isDeleted between", value1, value2, "isdeleted"); return (Criteria) this; } public Criteria andIsdeletedNotBetween(Integer value1, Integer value2) { addCriterion("isDeleted not between", value1, value2, "isdeleted"); return (Criteria) this; } public Criteria andIpIsNull() { addCriterion("ip is null"); return (Criteria) this; } public Criteria andIpIsNotNull() { addCriterion("ip is not null"); return (Criteria) this; } public Criteria andIpEqualTo(String value) { addCriterion("ip =", value, "ip"); return (Criteria) this; } public Criteria andIpNotEqualTo(String value) { addCriterion("ip <>", value, "ip"); return (Criteria) this; } public Criteria andIpGreaterThan(String value) { addCriterion("ip >", value, "ip"); return (Criteria) this; } public Criteria andIpGreaterThanOrEqualTo(String value) { addCriterion("ip >=", value, "ip"); return (Criteria) this; } public Criteria andIpLessThan(String value) { addCriterion("ip <", value, "ip"); return (Criteria) this; } public Criteria andIpLessThanOrEqualTo(String value) { addCriterion("ip <=", value, "ip"); return (Criteria) this; } public Criteria andIpLike(String value) { addCriterion("ip like", value, "ip"); return (Criteria) this; } public Criteria andIpNotLike(String value) { addCriterion("ip not like", value, "ip"); return (Criteria) this; } public Criteria andIpIn(List<String> values) { addCriterion("ip in", values, "ip"); return (Criteria) this; } public Criteria andIpNotIn(List<String> values) { addCriterion("ip not in", values, "ip"); return (Criteria) this; } public Criteria andIpBetween(String value1, String value2) { addCriterion("ip between", value1, value2, "ip"); return (Criteria) this; } public Criteria andIpNotBetween(String value1, String value2) { addCriterion("ip not between", value1, value2, "ip"); return (Criteria) this; } public Criteria andPortIsNull() { addCriterion("port is null"); return (Criteria) this; } public Criteria andPortIsNotNull() { addCriterion("port is not null"); return (Criteria) this; } public Criteria andPortEqualTo(Integer value) { addCriterion("port =", value, "port"); return (Criteria) this; } public Criteria andPortNotEqualTo(Integer value) { addCriterion("port <>", value, "port"); return (Criteria) this; } public Criteria andPortGreaterThan(Integer value) { addCriterion("port >", value, "port"); return (Criteria) this; } public Criteria andPortGreaterThanOrEqualTo(Integer value) { addCriterion("port >=", value, "port"); return (Criteria) this; } public Criteria andPortLessThan(Integer value) { addCriterion("port <", value, "port"); return (Criteria) this; } public Criteria andPortLessThanOrEqualTo(Integer value) { addCriterion("port <=", value, "port"); return (Criteria) this; } public Criteria andPortIn(List<Integer> values) { addCriterion("port in", values, "port"); return (Criteria) this; } public Criteria andPortNotIn(List<Integer> values) { addCriterion("port not in", values, "port"); return (Criteria) this; } public Criteria andPortBetween(Integer value1, Integer value2) { addCriterion("port between", value1, value2, "port"); return (Criteria) this; } public Criteria andPortNotBetween(Integer value1, Integer value2) { addCriterion("port not between", value1, value2, "port"); return (Criteria) this; } public Criteria andAreanameIsNull() { addCriterion("areaName is null"); return (Criteria) this; } public Criteria andAreanameIsNotNull() { addCriterion("areaName is not null"); return (Criteria) this; } public Criteria andAreanameEqualTo(String value) { addCriterion("areaName =", value, "areaname"); return (Criteria) this; } public Criteria andAreanameNotEqualTo(String value) { addCriterion("areaName <>", value, "areaname"); return (Criteria) this; } public Criteria andAreanameGreaterThan(String value) { addCriterion("areaName >", value, "areaname"); return (Criteria) this; } public Criteria andAreanameGreaterThanOrEqualTo(String value) { addCriterion("areaName >=", value, "areaname"); return (Criteria) this; } public Criteria andAreanameLessThan(String value) { addCriterion("areaName <", value, "areaname"); return (Criteria) this; } public Criteria andAreanameLessThanOrEqualTo(String value) { addCriterion("areaName <=", value, "areaname"); return (Criteria) this; } public Criteria andAreanameLike(String value) { addCriterion("areaName like", value, "areaname"); return (Criteria) this; } public Criteria andAreanameNotLike(String value) { addCriterion("areaName not like", value, "areaname"); return (Criteria) this; } public Criteria andAreanameIn(List<String> values) { addCriterion("areaName in", values, "areaname"); return (Criteria) this; } public Criteria andAreanameNotIn(List<String> values) { addCriterion("areaName not in", values, "areaname"); return (Criteria) this; } public Criteria andAreanameBetween(String value1, String value2) { addCriterion("areaName between", value1, value2, "areaname"); return (Criteria) this; } public Criteria andAreanameNotBetween(String value1, String value2) { addCriterion("areaName not between", value1, value2, "areaname"); return (Criteria) this; } public Criteria andConditionsetIsNull() { addCriterion("conditionSet is null"); return (Criteria) this; } public Criteria andConditionsetIsNotNull() { addCriterion("conditionSet is not null"); return (Criteria) this; } public Criteria andConditionsetEqualTo(String value) { addCriterion("conditionSet =", value, "conditionset"); return (Criteria) this; } public Criteria andConditionsetNotEqualTo(String value) { addCriterion("conditionSet <>", value, "conditionset"); return (Criteria) this; } public Criteria andConditionsetGreaterThan(String value) { addCriterion("conditionSet >", value, "conditionset"); return (Criteria) this; } public Criteria andConditionsetGreaterThanOrEqualTo(String value) { addCriterion("conditionSet >=", value, "conditionset"); return (Criteria) this; } public Criteria andConditionsetLessThan(String value) { addCriterion("conditionSet <", value, "conditionset"); return (Criteria) this; } public Criteria andConditionsetLessThanOrEqualTo(String value) { addCriterion("conditionSet <=", value, "conditionset"); return (Criteria) this; } public Criteria andConditionsetLike(String value) { addCriterion("conditionSet like", value, "conditionset"); return (Criteria) this; } public Criteria andConditionsetNotLike(String value) { addCriterion("conditionSet not like", value, "conditionset"); return (Criteria) this; } public Criteria andConditionsetIn(List<String> values) { addCriterion("conditionSet in", values, "conditionset"); return (Criteria) this; } public Criteria andConditionsetNotIn(List<String> values) { addCriterion("conditionSet not in", values, "conditionset"); return (Criteria) this; } public Criteria andConditionsetBetween(String value1, String value2) { addCriterion("conditionSet between", value1, value2, "conditionset"); return (Criteria) this; } public Criteria andConditionsetNotBetween(String value1, String value2) { addCriterion("conditionSet not between", value1, value2, "conditionset"); return (Criteria) this; } public Criteria andIsactiveIsNull() { addCriterion("isActive is null"); return (Criteria) this; } public Criteria andIsactiveIsNotNull() { addCriterion("isActive is not null"); return (Criteria) this; } public Criteria andIsactiveEqualTo(Integer value) { addCriterion("isActive =", value, "isactive"); return (Criteria) this; } public Criteria andIsactiveNotEqualTo(Integer value) { addCriterion("isActive <>", value, "isactive"); return (Criteria) this; } public Criteria andIsactiveGreaterThan(Integer value) { addCriterion("isActive >", value, "isactive"); return (Criteria) this; } public Criteria andIsactiveGreaterThanOrEqualTo(Integer value) { addCriterion("isActive >=", value, "isactive"); return (Criteria) this; } public Criteria andIsactiveLessThan(Integer value) { addCriterion("isActive <", value, "isactive"); return (Criteria) this; } public Criteria andIsactiveLessThanOrEqualTo(Integer value) { addCriterion("isActive <=", value, "isactive"); return (Criteria) this; } public Criteria andIsactiveIn(List<Integer> values) { addCriterion("isActive in", values, "isactive"); return (Criteria) this; } public Criteria andIsactiveNotIn(List<Integer> values) { addCriterion("isActive not in", values, "isactive"); return (Criteria) this; } public Criteria andIsactiveBetween(Integer value1, Integer value2) { addCriterion("isActive between", value1, value2, "isactive"); return (Criteria) this; } public Criteria andIsactiveNotBetween(Integer value1, Integer value2) { addCriterion("isActive not between", value1, value2, "isactive"); return (Criteria) this; } public Criteria andStatusIsNull() { addCriterion("status is null"); return (Criteria) this; } public Criteria andStatusIsNotNull() { addCriterion("status is not null"); return (Criteria) this; } public Criteria andStatusEqualTo(Integer value) { addCriterion("status =", value, "status"); return (Criteria) this; } public Criteria andStatusNotEqualTo(Integer value) { addCriterion("status <>", value, "status"); return (Criteria) this; } public Criteria andStatusGreaterThan(Integer value) { addCriterion("status >", value, "status"); return (Criteria) this; } public Criteria andStatusGreaterThanOrEqualTo(Integer value) { addCriterion("status >=", value, "status"); return (Criteria) this; } public Criteria andStatusLessThan(Integer value) { addCriterion("status <", value, "status"); return (Criteria) this; } public Criteria andStatusLessThanOrEqualTo(Integer value) { addCriterion("status <=", value, "status"); return (Criteria) this; } public Criteria andStatusIn(List<Integer> values) { addCriterion("status in", values, "status"); return (Criteria) this; } public Criteria andStatusNotIn(List<Integer> values) { addCriterion("status not in", values, "status"); return (Criteria) this; } public Criteria andStatusBetween(Integer value1, Integer value2) { addCriterion("status between", value1, value2, "status"); return (Criteria) this; } public Criteria andStatusNotBetween(Integer value1, Integer value2) { addCriterion("status not between", value1, value2, "status"); return (Criteria) this; } public Criteria andHttpportIsNull() { addCriterion("httpport is null"); return (Criteria) this; } public Criteria andHttpportIsNotNull() { addCriterion("httpport is not null"); return (Criteria) this; } public Criteria andHttpportEqualTo(Integer value) { addCriterion("httpport =", value, "httpport"); return (Criteria) this; } public Criteria andHttpportNotEqualTo(Integer value) { addCriterion("httpport <>", value, "httpport"); return (Criteria) this; } public Criteria andHttpportGreaterThan(Integer value) { addCriterion("httpport >", value, "httpport"); return (Criteria) this; } public Criteria andHttpportGreaterThanOrEqualTo(Integer value) { addCriterion("httpport >=", value, "httpport"); return (Criteria) this; } public Criteria andHttpportLessThan(Integer value) { addCriterion("httpport <", value, "httpport"); return (Criteria) this; } public Criteria andHttpportLessThanOrEqualTo(Integer value) { addCriterion("httpport <=", value, "httpport"); return (Criteria) this; } public Criteria andHttpportIn(List<Integer> values) { addCriterion("httpport in", values, "httpport"); return (Criteria) this; } public Criteria andHttpportNotIn(List<Integer> values) { addCriterion("httpport not in", values, "httpport"); return (Criteria) this; } public Criteria andHttpportBetween(Integer value1, Integer value2) { addCriterion("httpport between", value1, value2, "httpport"); return (Criteria) this; } public Criteria andHttpportNotBetween(Integer value1, Integer value2) { addCriterion("httpport not between", value1, value2, "httpport"); return (Criteria) this; } public Criteria andSecritkeyIsNull() { addCriterion("secritKey is null"); return (Criteria) this; } public Criteria andSecritkeyIsNotNull() { addCriterion("secritKey is not null"); return (Criteria) this; } public Criteria andSecritkeyEqualTo(String value) { addCriterion("secritKey =", value, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyNotEqualTo(String value) { addCriterion("secritKey <>", value, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyGreaterThan(String value) { addCriterion("secritKey >", value, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyGreaterThanOrEqualTo(String value) { addCriterion("secritKey >=", value, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyLessThan(String value) { addCriterion("secritKey <", value, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyLessThanOrEqualTo(String value) { addCriterion("secritKey <=", value, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyLike(String value) { addCriterion("secritKey like", value, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyNotLike(String value) { addCriterion("secritKey not like", value, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyIn(List<String> values) { addCriterion("secritKey in", values, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyNotIn(List<String> values) { addCriterion("secritKey not in", values, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyBetween(String value1, String value2) { addCriterion("secritKey between", value1, value2, "secritkey"); return (Criteria) this; } public Criteria andSecritkeyNotBetween(String value1, String value2) { addCriterion("secritKey not between", value1, value2, "secritkey"); return (Criteria) this; } public Criteria andAddtimeIsNull() { addCriterion("addtime is null"); return (Criteria) this; } public Criteria andAddtimeIsNotNull() { addCriterion("addtime is not null"); return (Criteria) this; } public Criteria andAddtimeEqualTo(Long value) { addCriterion("addtime =", value, "addtime"); return (Criteria) this; } public Criteria andAddtimeNotEqualTo(Long value) { addCriterion("addtime <>", value, "addtime"); return (Criteria) this; } public Criteria andAddtimeGreaterThan(Long value) { addCriterion("addtime >", value, "addtime"); return (Criteria) this; } public Criteria andAddtimeGreaterThanOrEqualTo(Long value) { addCriterion("addtime >=", value, "addtime"); return (Criteria) this; } public Criteria andAddtimeLessThan(Long value) { addCriterion("addtime <", value, "addtime"); return (Criteria) this; } public Criteria andAddtimeLessThanOrEqualTo(Long value) { addCriterion("addtime <=", value, "addtime"); return (Criteria) this; } public Criteria andAddtimeIn(List<Long> values) { addCriterion("addtime in", values, "addtime"); return (Criteria) this; } public Criteria andAddtimeNotIn(List<Long> values) { addCriterion("addtime not in", values, "addtime"); return (Criteria) this; } public Criteria andAddtimeBetween(Long value1, Long value2) { addCriterion("addtime between", value1, value2, "addtime"); return (Criteria) this; } public Criteria andAddtimeNotBetween(Long value1, Long value2) { addCriterion("addtime not between", value1, value2, "addtime"); return (Criteria) this; } public Criteria andOpentimeIsNull() { addCriterion("opentime is null"); return (Criteria) this; } public Criteria andOpentimeIsNotNull() { addCriterion("opentime is not null"); return (Criteria) this; } public Criteria andOpentimeEqualTo(Long value) { addCriterion("opentime =", value, "opentime"); return (Criteria) this; } public Criteria andOpentimeNotEqualTo(Long value) { addCriterion("opentime <>", value, "opentime"); return (Criteria) this; } public Criteria andOpentimeGreaterThan(Long value) { addCriterion("opentime >", value, "opentime"); return (Criteria) this; } public Criteria andOpentimeGreaterThanOrEqualTo(Long value) { addCriterion("opentime >=", value, "opentime"); return (Criteria) this; } public Criteria andOpentimeLessThan(Long value) { addCriterion("opentime <", value, "opentime"); return (Criteria) this; } public Criteria andOpentimeLessThanOrEqualTo(Long value) { addCriterion("opentime <=", value, "opentime"); return (Criteria) this; } public Criteria andOpentimeIn(List<Long> values) { addCriterion("opentime in", values, "opentime"); return (Criteria) this; } public Criteria andOpentimeNotIn(List<Long> values) { addCriterion("opentime not in", values, "opentime"); return (Criteria) this; } public Criteria andOpentimeBetween(Long value1, Long value2) { addCriterion("opentime between", value1, value2, "opentime"); return (Criteria) this; } public Criteria andOpentimeNotBetween(Long value1, Long value2) { addCriterion("opentime not between", value1, value2, "opentime"); return (Criteria) this; } } /** * This class was generated by MyBatis Generator. This class corresponds to the database table cs_server * @mbggenerated Wed Sep 10 10:22:33 CST 2014 */ public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table cs_server * * @mbggenerated do_not_delete_during_merge Wed Aug 13 10:13:38 CST 2014 */ public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } }
[ "syflvcode@yeah.net" ]
syflvcode@yeah.net
9afb5238f3b4e6c29c78bf0e6abe85a832ffe097
ebcbae0fa5c86f36a4d72bf6ce758f22799342b0
/spring/mavenweb/bootapp-hibernate-jpa security/src/main/java/com/cts/training/bootapphibernatejpa/model/ResponseData.java
2c1e4fdb3a4fddc03c5c385c0c5cfe730c672f48
[]
no_license
kaverinallpaneni/kaveri
fc2a47ce0729c99fd5cd42acdcca6c1fb492d7c4
a5b01c66390312d953c7775189bfcbfc65bd6979
refs/heads/master
2022-12-23T15:30:46.814851
2020-03-12T11:42:49
2020-03-12T11:42:49
234,706,155
0
0
null
2022-12-16T15:25:09
2020-01-18T08:44:42
HTML
UTF-8
Java
false
false
571
java
package com.cts.training.bootapphibernatejpa.model; public class ResponseData { private String message; private Long timeStamp; public ResponseData() {} public ResponseData(String message, Long timeStamp) { this.message = message; this.timeStamp = timeStamp; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public Long getTimeStamp() { return timeStamp; } public void setTimeStamp(Long timeStamp) { this.timeStamp = timeStamp; } }
[ "noreply@github.com" ]
noreply@github.com
f3a2f8ccee0cd43ca2f571d824fd420a34440e2f
0d6924a8e02e4250da576f70c9964ce0fde38c79
/app/build/generated/source/r/debug/com/fuseini/instant/weatherapp/R.java
971b2960f154ddf0cf672d8b0f16b0421475eddb
[]
no_license
instantmediagh/WeatherApp
4d07379b7ed8ea7ac03fae9b4ef186aa26d3dca4
6f73be9952f8f7576e07bd3d9d439351a9d39def
refs/heads/master
2020-05-19T07:23:05.223989
2014-10-03T19:42:29
2014-10-03T19:42:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,255
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.fuseini.instant.weatherapp; public final class R { public static final class array { public static final int weather_tab_names=0x7f040000; public static final int weather_unit_system=0x7f040001; } public static final class attr { } public static final class dimen { public static final int activity_horizontal_margin=0x7f050000; public static final int activity_vertical_margin=0x7f050001; public static final int icon_text_size=0x7f050002; public static final int temperature_text_size=0x7f050003; public static final int today_details_margins=0x7f050004; public static final int tomorrow_details_margins=0x7f050005; } public static final class drawable { public static final int ic_launcher=0x7f020000; } public static final class id { public static final int menu_location=0x7f09002a; public static final int menu_refresh=0x7f090029; public static final int pager=0x7f090000; public static final int today_copyright=0x7f090007; public static final int today_description=0x7f090005; public static final int today_humidity=0x7f09000d; public static final int today_humidity_icon=0x7f09000c; public static final int today_icon=0x7f090003; public static final int today_lienar_layout=0x7f090006; public static final int today_main_layout=0x7f090001; public static final int today_name=0x7f090002; public static final int today_no_layout=0x7f090010; public static final int today_no_weather=0x7f090012; public static final int today_no_weather_icon=0x7f090011; public static final int today_precipitation=0x7f090009; public static final int today_precipitation_icon=0x7f090008; public static final int today_pressure=0x7f09000f; public static final int today_pressure_icon=0x7f09000e; public static final int today_temperature=0x7f090004; public static final int today_wind=0x7f09000b; public static final int today_wind_icon=0x7f09000a; public static final int tomorrow_copyright=0x7f090019; public static final int tomorrow_description=0x7f090017; public static final int tomorrow_forecast1=0x7f09001c; public static final int tomorrow_forecast1_day=0x7f09001a; public static final int tomorrow_forecast1_icon=0x7f09001b; public static final int tomorrow_forecast2=0x7f09001f; public static final int tomorrow_forecast2_day=0x7f09001d; public static final int tomorrow_forecast2_icon=0x7f09001e; public static final int tomorrow_forecast3=0x7f090022; public static final int tomorrow_forecast3_day=0x7f090020; public static final int tomorrow_forecast3_icon=0x7f090021; public static final int tomorrow_forecast4=0x7f090025; public static final int tomorrow_forecast4_day=0x7f090023; public static final int tomorrow_forecast4_icon=0x7f090024; public static final int tomorrow_icon=0x7f090015; public static final int tomorrow_lienar_layout=0x7f090018; public static final int tomorrow_main_layout=0x7f090013; public static final int tomorrow_name=0x7f090014; public static final int tomorrow_no_layout=0x7f090026; public static final int tomorrow_no_weather=0x7f090028; public static final int tomorrow_no_weather_icon=0x7f090027; public static final int tomorrow_temperature=0x7f090016; } public static final class layout { public static final int activity_main=0x7f030000; public static final int fragment_today=0x7f030001; public static final int fragment_tomorrow=0x7f030002; } public static final class menu { public static final int main=0x7f080000; } public static final class string { public static final int api_error=0x7f060000; public static final int app_name=0x7f060001; public static final int celsius=0x7f060002; public static final int copyright=0x7f060003; public static final int country_name=0x7f060004; public static final int days=0x7f060005; public static final int description=0x7f060006; public static final int dialog_location_hint=0x7f060007; public static final int dialog_location_title=0x7f060008; public static final int dialog_negative_button=0x7f060009; public static final int dialog_positive_button=0x7f06000a; public static final int dialog_units_title=0x7f06000b; public static final int fahrenheit=0x7f06000c; public static final int humidity=0x7f06000d; public static final int menu_location=0x7f06000e; public static final int menu_refresh=0x7f06000f; public static final int menu_units=0x7f060010; public static final int mercury=0x7f060011; public static final int millimeter=0x7f060012; public static final int no_internet_error=0x7f060013; public static final int no_weather_data=0x7f060014; public static final int open_weather_maps_api_key=0x7f060015; public static final int open_weather_maps_forecast_url=0x7f060016; public static final int open_weather_maps_header=0x7f060017; public static final int open_weather_maps_url=0x7f060018; public static final int outdated_weather=0x7f060019; public static final int pascal=0x7f06001a; public static final int percent=0x7f06001b; public static final int precipitation=0x7f06001c; public static final int pressure=0x7f06001d; public static final int progress_dialog_message=0x7f06001e; public static final int speed=0x7f06001f; public static final int speed_imperial=0x7f060020; public static final int temperature=0x7f060021; public static final int thermometer=0x7f060022; public static final int weather_clear_night=0x7f060023; public static final int weather_cloudy=0x7f060024; public static final int weather_drizzle=0x7f060025; public static final int weather_foggy=0x7f060026; public static final int weather_rainy=0x7f060027; public static final int weather_snowy=0x7f060028; public static final int weather_sunny=0x7f060029; public static final int weather_thunder=0x7f06002a; public static final int wind=0x7f06002b; } public static final class style { /** Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. API 11 theme customizations can go here. API 14 theme customizations can go here. */ public static final int AppBaseTheme=0x7f070000; /** All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f070001; } }
[ "JOSHMANGA@Joshuas-iMac-2.local" ]
JOSHMANGA@Joshuas-iMac-2.local
c6bc2a42ae916230b60afd5e6be4db1573544a99
f3ca6af7e0002fde6d57308e3dae6cce191e7e04
/pidgin-server/src/main/java/OOAD/RecieverMessage.java
c21a2a96d670243e649b5cabb284bb359282b884
[]
no_license
vishnuys/PidginN
2c8542cf7c616acbbe6cd3e8c23d686cf868e9af
9998cf74994256afeb40e1f179d545d578e2ecaa
refs/heads/master
2023-04-27T15:08:44.083298
2019-12-08T19:33:28
2019-12-08T19:33:28
206,925,351
0
0
null
null
null
null
UTF-8
Java
false
false
237
java
package OOAD; public class RecieverMessage extends SenderMessage{ public String translatedMessage; RecieverMessage(SenderMessage sender,String translatedMessage) { super(sender); this.translatedMessage = translatedMessage; } }
[ "ysv8152@gmail.com" ]
ysv8152@gmail.com
33ae2d4d918955632c3f07d6d3cdcff0306d15f9
5d06f40fe371697a1159ac7bc29f28daea0b77a7
/app/src/test/java/org/eldorado/simpleweather/ExampleUnitTest.java
6d4b31a59fd960a90c0645ef9a2dfc086ac6e7b7
[ "MIT" ]
permissive
davibpires/SimpleWeather
a5e970c8802473e4f536e56e843ec6ede4f3c184
b71174b5c74f42b7d7f376457cbb609c43258a78
refs/heads/master
2022-11-12T17:51:54.629774
2020-07-16T13:39:43
2020-07-16T13:39:43
280,145,919
0
0
null
null
null
null
UTF-8
Java
false
false
387
java
package org.eldorado.simpleweather; 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() { assertEquals(4, 2 + 2); } }
[ "davibpires@gmail.com" ]
davibpires@gmail.com
dcefb35cfbaf4c295a090fb2c59d689f48c89925
4ceffdba8108024a653ba5545e765462fef8760e
/corejavatraining/src/com/vm/java/features/Employe.java
3a703b21c47b75f1d5bab0740f06c40d54147ef6
[]
no_license
ManitejaParchuri/Java_Application_Program
a617c00566edbc572ec349a0651ab1250543bae5
3a8c16a0cec74cf0689b404b1dd7d4ceabd45972
refs/heads/master
2023-05-07T03:30:13.346866
2021-06-01T06:52:59
2021-06-01T06:52:59
372,245,850
0
0
null
null
null
null
UTF-8
Java
false
false
988
java
package com.vm.java.features; public class Employe { private int id; private String name; private String dep; private int age; private int salary; public Employe(int id, String name, String dep, int age, int salary) { super(); this.id = id; this.name = name; this.dep = dep; this.age = age; this.salary = salary; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDep() { return dep; } public void setDep(String dep) { this.dep = dep; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public int getSalary() { return salary; } public void setSalary(int salary) { this.salary = salary; } @Override public String toString() { return "Employe [id=" + id + ", name=" + name + ", dep=" + dep + ", age=" + age + ", salary=" + salary + "]"; } }
[ "i Globus@LAPTOP-SQV03C4C" ]
i Globus@LAPTOP-SQV03C4C
534e1a9e707fe6f36533910f814462ea9b61f83a
c2745516073be0e243c2dff24b4bb4d1d94d18b8
/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesListSamples.java
94d0923b691f55be817e9b184b8efbfb5c887516
[ "MIT", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-warranty-disclaimer", "BSD-3-Clause", "CC0-1.0", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-or-later" ]
permissive
milismsft/azure-sdk-for-java
84b48d35e3fca8611933b3f86929788e5e8bceed
f4827811c870d09855417271369c592412986861
refs/heads/master
2022-09-25T19:29:44.973618
2022-08-17T14:43:22
2022-08-17T14:43:22
90,779,733
1
0
MIT
2021-12-21T21:11:58
2017-05-09T18:37:49
Java
UTF-8
Java
false
false
896
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.compute.generated; import com.azure.core.util.Context; /** Samples for SharedGalleries List. */ public final class SharedGalleriesListSamples { /* * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2022-01-03/examples/sharedGalleryExamples/SharedGallery_List.json */ /** * Sample code: List shared galleries. * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void listSharedGalleries(com.azure.resourcemanager.AzureResourceManager azure) { azure.virtualMachines().manager().serviceClient().getSharedGalleries().list("myLocation", null, Context.NONE); } }
[ "noreply@github.com" ]
noreply@github.com
6ee7c958724b67b7b286dd7ebdc6e49dbc296db0
115376880da2c4ddc3d5473930ed82beb0333771
/src/test/test.java
e2a2e1cbba75ec861f2401d8b3edb8e6b814838d
[]
no_license
DayorNight/DesignPattern
132f729670d4d56f6d58e9af11dd5da528a2d652
8d8909ae852422160b5b08ce61858bdc91fce303
refs/heads/master
2020-04-05T08:20:36.010523
2018-11-19T14:36:17
2018-11-19T14:36:17
156,711,079
3
3
null
null
null
null
UTF-8
Java
false
false
210
java
package test; public class test implements A{ public static void main(String[] args) { } @Override public String getStr() { return null; } @Override public void vo() { } }
[ "2302940971@qq.com" ]
2302940971@qq.com
37805c84fb62728e9c0213db8379b31809979c1b
721a572e1eb6b1cdc68b077993403bb13650484b
/app/src/main/java/com/im/openimlib/receiver/ScreenListener.java
2dd3778a42d2814270a599c78dd4e60aa815ad3b
[]
no_license
zhlee-cf/OpenIMLib
9ba078464635203b45b912827af1068086c9a2e2
87c4fbb87440940d1828b5aba729e5e29ecd0020
refs/heads/master
2021-01-19T06:45:59.578476
2016-08-01T02:10:56
2016-08-01T02:10:57
63,654,349
0
0
null
null
null
null
UTF-8
Java
false
false
2,649
java
package com.im.openimlib.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.PowerManager; /** * 锁屏监听 */ public class ScreenListener { private Context mContext; private ScreenBroadcastReceiver mScreenReceiver; private ScreenStateListener mScreenStateListener; public ScreenListener(Context context) { mContext = context; mScreenReceiver = new ScreenBroadcastReceiver(); } /** * screen状态广播接收者 */ private class ScreenBroadcastReceiver extends BroadcastReceiver { private String action = null; @Override public void onReceive(Context context, Intent intent) { action = intent.getAction(); if (Intent.ACTION_SCREEN_ON.equals(action)) { // 开屏 mScreenStateListener.onScreenOn(); } else if (Intent.ACTION_SCREEN_OFF.equals(action)) { // 锁屏 mScreenStateListener.onScreenOff(); } else if (Intent.ACTION_USER_PRESENT.equals(action)) { // 解锁 mScreenStateListener.onUserPresent(); } } } /** * 开始监听screen状态 * * @param listener */ public void begin(ScreenStateListener listener) { mScreenStateListener = listener; registerListener(); getScreenState(); } /** * 获取screen状态 */ private void getScreenState() { PowerManager manager = (PowerManager) mContext .getSystemService(Context.POWER_SERVICE); if (manager.isScreenOn()) { if (mScreenStateListener != null) { mScreenStateListener.onScreenOn(); } } else { if (mScreenStateListener != null) { mScreenStateListener.onScreenOff(); } } } /** * 停止screen状态监听 */ public void unregisterListener() { mContext.unregisterReceiver(mScreenReceiver); } /** * 启动screen状态广播接收器 */ private void registerListener() { IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_ON); filter.addAction(Intent.ACTION_SCREEN_OFF); filter.addAction(Intent.ACTION_USER_PRESENT); mContext.registerReceiver(mScreenReceiver, filter); } public interface ScreenStateListener {// 返回给调用者屏幕状态信息 void onScreenOn(); void onScreenOff(); void onUserPresent(); } }
[ "1281861976@qq.com" ]
1281861976@qq.com
4892425938e0700bfafe3803c850e23f76a605c3
995f73d30450a6dce6bc7145d89344b4ad6e0622
/MATE-20_EMUI_11.0.0/src/main/java/ohos/utils/fastjson/annotation/JSONType.java
1bec81941ce29b32630b08dbadf8181aa6a92d17
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
923
java
package ohos.utils.fastjson.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import ohos.utils.fastjson.PropertyNamingStrategy; import ohos.utils.fastjson.parser.Feature; import ohos.utils.fastjson.serializer.SerializerFeature; @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface JSONType { boolean alphabetic() default true; boolean asm() default true; String[] ignores() default {}; Class<?> mappingTo() default Void.class; PropertyNamingStrategy naming() default PropertyNamingStrategy.CamelCase; String[] orders() default {}; Feature[] parseFeatures() default {}; Class<?>[] seeAlso() default {}; SerializerFeature[] serialzeFeatures() default {}; String typeKey() default ""; String typeName() default ""; }
[ "dstmath@163.com" ]
dstmath@163.com
5c19dea5943f8133bed647282eec40ac5c165746
863acb02a064a0fc66811688a67ce3511f1b81af
/sources/p005cm/aptoide/p006pt/billing/view/login/C2515ha.java
fb6b5704a713bbd16375077526a79f6fe16799ed
[ "MIT" ]
permissive
Game-Designing/Custom-Football-Game
98d33eb0c04ca2c48620aa4a763b91bc9c1b7915
47283462b2066ad5c53b3c901182e7ae62a34fc8
refs/heads/master
2020-08-04T00:02:04.876780
2019-10-06T06:55:08
2019-10-06T06:55:08
211,914,568
1
1
null
null
null
null
UTF-8
Java
false
false
553
java
package p005cm.aptoide.p006pt.billing.view.login; import p026rx.p027b.C0132p; /* renamed from: cm.aptoide.pt.billing.view.login.ha */ /* compiled from: lambda */ public final /* synthetic */ class C2515ha implements C0132p { /* renamed from: a */ private final /* synthetic */ PaymentLoginPresenter f5676a; public /* synthetic */ C2515ha(PaymentLoginPresenter paymentLoginPresenter) { this.f5676a = paymentLoginPresenter; } public final Object call(Object obj) { return this.f5676a.mo11419f((Void) obj); } }
[ "tusharchoudhary0003@gmail.com" ]
tusharchoudhary0003@gmail.com
80c9dfa8cf1ce5ca89217ad7dd1ebc1bc10d50e8
7648cbb3c77a33387f2d00a571b9e01bcf01b7a2
/live-admin/src/com/tinypig/newadmin/web/service/UserTransactionHisService.java
f574a39aa884a7c3509aaf5c42348343d26ebd4e
[]
no_license
dawei134679/live
2ea806cff38b0c763f6e7345eb208068dffeff68
ded58b6aeb47af8049ac0cd516a5fad262f3775f
refs/heads/master
2020-04-20T04:28:27.064707
2019-02-01T02:24:50
2019-02-01T02:31:19
168,628,885
1
0
null
null
null
null
UTF-8
Java
false
false
284
java
package com.tinypig.newadmin.web.service; import com.tinypig.newadmin.web.entity.UserTransactionHis; public interface UserTransactionHisService { public int saveUserTransactionHis(UserTransactionHis userTransactionHis); public int delUserTransactionHisByRefId(String refId); }
[ "532231254@qq.com" ]
532231254@qq.com
7616ba95c4c2ffa61cba2cfcb6a55327fe5ed195
f58ac4b780c8ab0de56ef1c01a70351dce8c36b9
/app/src/main/java/com/forte/login/FragmentItemActivity.java
24c6b0e7927a64b05cbdd89f9455a1da89695158
[]
no_license
MikeKrv/CarBrowser
c4baa394a47d522627f432d5269fb89c4c2cac15
a235f240a047c38f1cfcdb75aebf89178b15d03c
refs/heads/master
2020-03-10T02:56:56.519294
2017-11-09T13:31:17
2017-11-09T13:31:17
105,703,427
0
0
null
null
null
null
UTF-8
Java
false
false
6,702
java
package com.forte.login; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.app.FragmentTabHost; import android.support.v4.view.ViewPager; i import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; public class FragmentItemActivity extends FragmentActivity { CarPagerAdapter carPagerAdapter; ViewPager myViewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fragment_item); Bundle extras = getIntent().getExtras(); int carBrandId = extras.getInt("BrandIndex"); getSupportActionBar().setIcon(Integer.parseInt(CarBrandsCollection.CAR_BRANDS[carBrandId].icon)); getSupportActionBar().setTitle(CarBrandsCollection.CAR_BRANDS[carBrandId].name); carPagerAdapter = new CarPagerAdapter(getSupportFragmentManager(), extras.getInt("BrandIndex")); myViewPager = (ViewPager) findViewById(R.id.pager); myViewPager.setOffscreenPageLimit(0); myViewPager.setAdapter(carPagerAdapter); myViewPager.setCurrentItem(extras.getInt("ModelIndex"), true); myViewPager.destroyDrawingCache(); } public static class CarPagerAdapter extends FragmentStatePagerAdapter { int brandIndex; public CarPagerAdapter(FragmentManager fm, int brandIndex) { super(fm); this.brandIndex = brandIndex; } @Override public int getCount() { return CarBrandsCollection.CAR_BRANDS[brandIndex].models.length; } @Override public Fragment getItem(int position) { return CarTabHostFragment.newInstance(brandIndex, position); } } public static class CarDetailsItemFragment extends Fragment { int brandIndex; int modelIndex; int subModelIndex; static CarDetailsItemFragment newInstance(int brandIndex, int modelIndex, int subModelIndex) { CarDetailsItemFragment detailsItemFragment = new CarDetailsItemFragment(); // Supply num input as an argument. Bundle args = new Bundle(); args.putInt("brandIndex", brandIndex); args.putInt("modelIndex", modelIndex); args.putInt("subModelIndex", subModelIndex); detailsItemFragment.setArguments(args); return detailsItemFragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); brandIndex = getArguments() != null ? getArguments().getInt("brandIndex") : 1; modelIndex = getArguments() != null ? getArguments().getInt("modelIndex") : 1; subModelIndex = getArguments() != null ? getArguments().getInt("subModelIndex") : 1; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.car_details_item_fragment, container, false); } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); View header = view.findViewById(R.id.carDetailsHeader); CarBrand carBrand = CarBrandsCollection.CAR_BRANDS[brandIndex]; CarModel carModel = carBrand.models[modelIndex]; SubModel subModel = carModel.subModels[subModelIndex]; ((TextView) header).setText(subModel.header); View details = view.findViewById(R.id.carDetailsDescription); ((TextView) details).setText(subModel.description); View classification = view.findViewById(R.id.carClassification); ((TextView) classification).setText(subModel.classification); View image = view.findViewById(R.id.carDetailsImage); ((ImageView) image).setImageDrawable(view.getResources().getDrawable(Integer.parseInt(subModel.image))); view.destroyDrawingCache(); view.refreshDrawableState(); view = null; } @Override public void onDestroyView() { super.onDestroyView(); } @Override public void onDestroy() { super.onDestroy(); } } public static class CarTabHostFragment extends Fragment { private FragmentTabHost carTabHost; int brandIndex; int modelIndex; static CarTabHostFragment newInstance(int brandIndex, int modelIndex) { CarTabHostFragment tabFragment = new CarTabHostFragment(); // Supply num input as an argument. Bundle args = new Bundle(); args.putInt("brandIndex", brandIndex); args.putInt("modelIndex", modelIndex); tabFragment.setArguments(args); return tabFragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); brandIndex = getArguments() != null ? getArguments().getInt("brandIndex") : 1; modelIndex = getArguments() != null ? getArguments().getInt("modelIndex") : 1; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { carTabHost = new FragmentTabHost(getActivity()); carTabHost.setup(getActivity(), getChildFragmentManager(), R.layout.fragment_tabhost); for (int i = 0; i < CarBrandsCollection.CAR_BRANDS[brandIndex].models[modelIndex].subModels.length; i++) { Bundle args2 = new Bundle(); args2.putInt("brandIndex", brandIndex); args2.putInt("modelIndex", modelIndex); args2.putInt("subModelIndex", i); SubModel subModel = CarBrandsCollection.CAR_BRANDS[brandIndex].models[modelIndex].subModels[i]; carTabHost.addTab(carTabHost.newTabSpec(subModel.tabHeader).setIndicator(subModel.tabHeader), CarDetailsItemFragment.class, args2); } return carTabHost; } @Override public void onDestroyView() { super.onDestroyView(); carTabHost = null; } @Override public void onDestroy() { super.onDestroy(); carTabHost = null; } } }
[ "kr.mike1@yandex.ru" ]
kr.mike1@yandex.ru
1888b0c4878d2438eda40bd6c93749d45a3444f0
8b553bacf3770a9d4554ab367e21ab53b74b9b65
/src/ttt/TicTacPanel.java
9dfd666ab1ea82e52fab909a583214157e9e8050
[]
no_license
sidraziz98/TicTacToe
4256c0d132a7e1867e122c37a3edf01df8339689
6917e5d7190d1b3d303cdff7e2bb04724c92eb3c
refs/heads/master
2023-06-05T23:24:04.899569
2021-06-17T18:39:35
2021-06-17T18:39:35
377,199,776
0
0
null
null
null
null
UTF-8
Java
false
false
12,658
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ttt; /** * * @author Sidra Aziz 14809 */ import java.util.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Toolkit; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Timer; //this is the class containing the main method that must be run using gui that calls other classess for the game to play //add all the pictures to the src of the project for the code to work correctly public class TicTacPanel extends JPanel { GamePlay game = new GamePlay(); JButton AIvsAI; JLabel title, outcomeX, outcomeO, outcomeD; Boolean w = false; GridBagConstraints gbcOutcomeX, gbcOutcomeO, gbcOutcomeD; Color pink = new Color(243, 204, 207); Color grey = new Color(150, 150, 150); int xpos, ypos; int draw = 0; //constructor adds all jcomponents except the winning outcomes , x's and o's public TicTacPanel() throws Exception { //add bg color setBackground(pink); setPreferredSize(Toolkit.getDefaultToolkit().getScreenSize()); setLayout(new GridBagLayout()); xpos = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth(); ypos = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight(); //add title gif java.net.URL title_URL = getClass().getResource("/Title.gif"); ImageIcon imgIcon1 = new ImageIcon(title_URL); imgIcon1 = new ImageIcon(imgIcon1.getImage().getScaledInstance((int)(xpos * 0.40278), (int)(ypos * 0.12889), java.awt.Image.SCALE_DEFAULT)); title = new JLabel(imgIcon1); GridBagConstraints gbcTitle = new GridBagConstraints(); gbcTitle.insets = new Insets((int)(ypos * 0.022223), 0, 0, 0); gbcTitle.gridx = 0; gbcTitle.gridy = 0; gbcTitle.anchor = GridBagConstraints.NORTH; gbcTitle.weightx = 0.5; gbcTitle.weighty = 1.0; add(title, gbcTitle); //add outcome gif at end // if O wins java.net.URL finalo_URL = getClass().getResource("/finalo.gif"); ImageIcon imgIcon3 = new ImageIcon(finalo_URL); imgIcon3 = new ImageIcon(imgIcon3.getImage().getScaledInstance((int)(xpos * 0.319445), (int)(ypos * 0.51112), java.awt.Image.SCALE_DEFAULT)); outcomeO = new JLabel(imgIcon3); gbcOutcomeO = new GridBagConstraints(); gbcOutcomeO.insets = new Insets((int)(ypos * 0.055556), 0, 0, 0); gbcOutcomeO.gridx = 0; gbcOutcomeO.gridy = 0; gbcOutcomeO.anchor = GridBagConstraints.CENTER; gbcOutcomeO.weightx = 0.5; gbcOutcomeO.weighty = 1.0; // if X wins java.net.URL finalx_URL = getClass().getResource("/finalx.gif"); ImageIcon imgIcon4 = new ImageIcon(finalx_URL); imgIcon4 = new ImageIcon(imgIcon4.getImage().getScaledInstance((int)(xpos * 0.319445), (int)(ypos * 0.51112), java.awt.Image.SCALE_DEFAULT)); outcomeX = new JLabel(imgIcon4); gbcOutcomeX = new GridBagConstraints(); gbcOutcomeX.insets = new Insets(0, 0, 0, 0); gbcOutcomeX.gridx = 0; gbcOutcomeX.gridy = 0; gbcOutcomeX.anchor = GridBagConstraints.CENTER; gbcOutcomeX.weightx = 0.5; gbcOutcomeX.weighty = 1.0; // draw java.net.URL draw_URL = getClass().getResource("/draw.gif"); ImageIcon imgIcon6 = new ImageIcon(draw_URL); imgIcon6 = new ImageIcon(imgIcon6.getImage().getScaledInstance((int)(xpos * 0.319445), (int)(ypos * 0.51112), java.awt.Image.SCALE_DEFAULT)); outcomeD = new JLabel(imgIcon6); gbcOutcomeD = new GridBagConstraints(); gbcOutcomeD.insets = new Insets(0, 0, 0, 0); gbcOutcomeD.gridx = 0; gbcOutcomeD.gridy = 0; gbcOutcomeD.anchor = GridBagConstraints.CENTER; gbcOutcomeD.weightx = 0.5; gbcOutcomeD.weighty = 1.0; //add AIvsAI button java.net.URL AIvsAI_URL = getClass().getResource("/AIvsAI.png"); ImageIcon imgIcon2 = new ImageIcon(AIvsAI_URL); imgIcon2 = new ImageIcon(imgIcon2.getImage().getScaledInstance((int)(xpos * 0.104167), (int)(ypos * 0.063334), java.awt.Image.SCALE_DEFAULT)); AIvsAI = new JButton("", imgIcon2); AIvsAI.setBorderPainted(false); AIvsAI.setContentAreaFilled(false); AIvsAI.setOpaque(false); AIvsAI.setBackground(new Color(0,0,0,0)); AIvsAI.setBackground(new Color(0,0,0,0)); GridBagConstraints gbcAIvsAI = new GridBagConstraints(); gbcAIvsAI.insets = new Insets(0, 0, 6, 0); gbcAIvsAI.gridx = 0; gbcAIvsAI.gridy = 0; gbcAIvsAI.anchor = GridBagConstraints.SOUTH; gbcAIvsAI.weightx = 0.5; gbcAIvsAI.weighty = 1.0; add(AIvsAI, gbcAIvsAI); setVisible(true); //to allow the gui to work while the bg coding does its work Timer timer2 = new Timer(2000, new ActionListener() { public void actionPerformed(ActionEvent f) { w = true; repaint(); ((Timer) f.getSource()).stop(); } }); final Timer timerAIvsAI = new Timer(2000, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { repaint(); game.display(); draw++; // System.out.println(draw); if (game.currentPlayer == 1) { game.BestChoice(1); game.currentPlayer = 2; } else { game.BestChoice(2); game.currentPlayer = 1; } if (game.gameCheck() == true || (draw == 9 && game.gameCheck() == false)) { game.display(); timer2.start(); ((Timer) e.getSource()).stop(); } } }); AIvsAI.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { Object src = evt.getSource(); if (src instanceof JButton) { w = false ; if (game.xWins == true) { remove(outcomeX); } else if (game.oWins == true) { remove(outcomeO); } else { remove(outcomeD); } draw = 0; game = new GamePlay(); for (int i = 0; i < 9; i++) { repaint(); if (game.gameCheck() == false) { timerAIvsAI.start(); } if (game.gameCheck() == true) { break; } } } } }); } //paintComponent - this does the drawing and graphics //also adds the winning outcomes , x's and o's public void paintComponent(Graphics page) { super.paintComponent(page); //to update panel if (w == false) { //add borders xpos = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth(); ypos = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight(); java.net.URL O_URL = getClass().getResource("/o.png"); ImageIcon imgIconO = new ImageIcon(O_URL); Image O = imgIconO.getImage(); java.net.URL X_URL = getClass().getResource("/x.png"); ImageIcon imgIconX = new ImageIcon(X_URL); Image X = imgIconX.getImage(); page.setColor(Color.white); page.fillRect(0, 0, xpos, (int) (ypos * 0.15556)); //page.fillRect(0, (int) (ypos * 0.75556), xpos, (int)(ypos * 0.111111)); page.fillRect(0, (int)(ypos * 0.7656), xpos, (int)(ypos * 2)); xpos = (int)(xpos * 0.340278); ypos = (int)(ypos * 0.2223); //create game board - 2-by-2 parallel lines page.setColor(grey); //vertical lines page.fillRoundRect((int)(xpos * 1.285715), ypos, (int)(xpos * 0.0408164), (int)(ypos * 2.2), (int)(xpos * 0.0204082), (int)(ypos * 0.05)); page.fillRoundRect((int)(xpos * 1.59184), ypos, (int)(xpos * 0.0408164), (int)(ypos * 2.2), (int)(xpos * 0.0204082), (int)(ypos * 0.05)); //horizontal lines page.fillRoundRect(xpos, (int)(ypos * 1.7), (int)(xpos * 0.89796), (int)(ypos * 0.1), (int)(xpos * 0.0204082), (int)(ypos * 0.05)); page.fillRoundRect(xpos, (int)(ypos * 2.45), (int)(xpos * 0.89796), (int)(ypos * 0.1), (int)(xpos * 0.0204082), (int)(ypos * 0.05)); //convert data from array into grid if (game != null) { int mulx = (int)(xpos * 0.3129252); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (game.board[i][j] == 'x') { //draw X page.drawImage(X, (int)(xpos * 1.0734694) + j * mulx, (int)(ypos * 1.125) + i * mulx, (int)(xpos * 0.128572), (int)(ypos * 0.42), this); } else if (game.board[i][j] == 'o') { //draw O page.drawImage(O, (int)(xpos * 1.0734694) + j * mulx, (int)(ypos * 1.15) + i * mulx, (int)(xpos * 0.157143), (int)(ypos * 0.4), this); } } } page.setFont(new Font("Serif", Font.PLAIN, 40)); page.setColor(Color.black); if (game.currentPlayer == 1) { page.drawString("turn", (int)(xpos * 0.636735),(int)(ypos * 2.5) ); } else { page.drawString("turn", (int)(xpos * 2.17755) , (int)(ypos * 2.5)); } } //player icons page.setFont(new Font("Serif", Font.PLAIN, 40)); page.setColor(Color.black); //player1 page.drawString("Player", (int)(xpos * 0.60204),(int)(ypos * 1.85) ); page.drawImage(X, (int)(xpos * 0.63265), (int)(ypos * 1.925), (int)(xpos * 0.128572), (int)(ypos * 0.42), this); //player2 page.drawString("Player", (int)(xpos * 2.132654), (int)(ypos * 1.85)); page.drawImage(O,(int)(xpos * 2.14898) , (int)(ypos * 1.93), (int)(xpos * 0.157143), (int)(ypos * 0.4) , this); } else { setBackground(pink); setPreferredSize(Toolkit.getDefaultToolkit().getScreenSize()); int xpos = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth(); int ypos = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight(); page.setColor(Color.white); page.fillRect(0, 0, xpos,(int)(ypos * 0.15555)); page.fillRect(0, (int)(ypos * 0.7656), xpos,(int)(ypos * 2 )); this.setLocation(0, 0); if (game.xWins == true) { add(outcomeX, gbcOutcomeX); } if (game.oWins == true) { add(outcomeO, gbcOutcomeO); } if (draw == 9 && game.gameCheck() == false) { add(outcomeD, gbcOutcomeD); } setVisible(true); revalidate(); } } public static void main(String[] args) throws Exception { JFrame frame = new JFrame("TicTacToe"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Dimension DimMax = Toolkit.getDefaultToolkit().getScreenSize(); frame.setMaximumSize(DimMax); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); frame.getContentPane().add(new TicTacPanel()); frame.pack(); frame.setVisible(true); } }
[ "sidraziz98@gmail.com" ]
sidraziz98@gmail.com
9dd4d76b19811d1db2eb01bc0d2f7099a3a6e990
e711e9ccb29a89b306b202fdbb03e57b0dc6e264
/src/main/java/interceptor/AuthCheckInterceptor.java
0cb0b2e3c51845dd43415a00ed8d440a4f91d125
[]
no_license
MumalrengYi/Shopping_SpringVer.
d2c9708c816eeb628b1d60b9fade34e5b1789615
a51d5ce9a5574f8811e1fd9ceca1ea34c2139013
refs/heads/master
2023-06-26T13:17:40.883612
2021-07-23T01:25:22
2021-07-23T01:25:22
383,127,551
0
0
null
null
null
null
UTF-8
Java
false
false
1,500
java
package interceptor; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; public class AuthCheckInterceptor extends HandlerInterceptorAdapter { @Override //controller에 진입 전에 차단 public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { //session이 있는지 확인 HttpSession session = request.getSession(false); if(session != null){ Object authInfo = session.getAttribute("authInfo"); if(authInfo != null){ return true; } } response.sendRedirect(request.getContextPath()+"/"); return false; } @Override //Controller에 진입 후 view가 랜더링 전에 실행 public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { super.postHandle(request, response, handler, modelAndView); } @Override //Contoller에 진입 후 view가 렌더링 한 후에 실행 public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { super.afterCompletion(request, response, handler, ex); } }
[ "geunsu@kakao.com" ]
geunsu@kakao.com
e56f734ea6624378805c8f02923fe2b0c3042538
9c6ff69e95f55dd5e7f54cbdee8ab0bc5ba9e136
/src/test/java/com/automationanywhere/botcommand/japanesestringutils/commands/basic/NomalizeTest.java
49a03563d8fdc17c42068cfdb0b4f0b70937e63e
[]
no_license
AutomationAnywhere/A2019-JapaneseStringConversionPackage-167235
ef5217f753a3e98195d036796d1747ce020fea5a
3e2519351880e6e68ee9e98fa0676aa734e584e2
refs/heads/main
2023-01-10T07:09:43.205943
2020-11-09T20:30:30
2020-11-09T20:30:30
311,457,100
0
0
null
null
null
null
UTF-8
Java
false
false
14,874
java
package com.automationanywhere.botcommand.japanesestringutils.commands.basic; import com.automationanywhere.botcommand.data.Value; import com.automationanywhere.botcommand.exception.BotCommandException; import com.automationanywhere.botcommand.japanesestringutils.commands.basic.Normalize; import org.testng.Assert; import org.testng.annotations.Test; public class NomalizeTest { @Test(expectedExceptions = BotCommandException.class) public void NomalizeTestWithoutText() throws BotCommandException{ String validInput = ""; Normalize testNormalize = new Normalize(); String type = null; Value<String> result = testNormalize.action(validInput, type); } @Test public void NomalizeTestWithoutOption(){ String validInput = "12345"; String expectedOutput = "12345"; Normalize testNormalize = new Normalize(); String type = null; Value<String> result = testNormalize.action(validInput, type); Assert.assertEquals(result.get(), expectedOutput); } @Test public void NomalizeTestWithNFD(){ String validInput = "ヾゞ≠⊄⊅∉∦≢ÅがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽゔガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポヴЁЙёйヷヸヹヺǍǎǐḾḿǸǹǑǒǔǖǘǚǜÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöùúûüýÿĀĪŪĒŌāīūēōĄĽŚŠŞŤŹŽŻąľśšşťźžżŔĂĹĆČĘĚĎŃŇŐŘŮŰŢŕăĺćčęěďńňőřůűţĈĜĤĴŜŬĉĝĥĵŝŭǽὰάὲέ侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; String expectedOutput = "ヾゞ≠⊄⊅∉∦≢ÅがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽゔガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポヴЁЙёйヷヸヹヺǍǎǐḾḿǸǹǑǒǔǖǘǚǜÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöùúûüýÿĀĪŪĒŌāīūēōĄĽŚŠŞŤŹŽŻąľśšşťźžżŔĂĹĆČĘĚĎŃŇŐŘŮŰŢŕăĺćčęěďńňőřůűţĈĜĤĴŜŬĉĝĥĵŝŭǽὰάὲέ侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; Normalize testNormalize = new Normalize(); String type = "NFD"; Value<String> result = testNormalize.action(validInput, type); Assert.assertEquals(result.get(), expectedOutput); } //@Test public void NomalizeTestWithNFKDBad(){ String validInput = "‾。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚,.:;?!゛゜´`¨^ ̄_ヾゞ/|…‥()[]{}+=≠<>″℃¥$%#&*@'"-ヿゟ⊄⊅∉∦⦅⦆∬≢Å0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZℵℏ㏋ℓabcdefghijklmnopqrstuvwxyzがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽゔガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポヴЁЙёйヷヸヹヺ⅓⅔⅕㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿‼⁇⁈⁉ǍǎǐḾḿǸǹǑǒǔǖǘǚǜª¯²³¸¹º¼½¾ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöùúûüýÿĀĪŪĒŌāīūēōĄ˘ĽŚŠŞŤŹŽŻą˛ľśšşťź˝žżŔĂĹĆČĘĚĎŃŇŐŘŮŰŢŕăĺćčęěďńňőřůűţ˙ĈĜĤĴŜŬĉĝĥĵŝŭǽὰάὲέⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ㋐㋑㋒㋓㋔㋕㋖㋗㋘㋙㋚㋛㋜㋝㋞㋟㋠㋡㋢㋣㋺㋩㋥㋭㋬①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪ㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡Ⅻ㍻№㏍℡㊤㊥㊦㊧㊨㈱㈲㈹㍾㍽㍼侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; String expectedOutput = "̅。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚,.:;?!゙゚́`̈^̄_ヾゞ/|.....()[]{}+=≠<>′′°C¥$%#&*@'\"-コトより⊄⊅∉∦⦅⦆∫∫≢Å0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZאħHPlabcdefghijklmnopqrstuvwxyzがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽゔガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポヴЁЙёйヷヸヹヺ1⁄32⁄31⁄5212223242526272829303132333435363738394041424344454647484950!!???!!?ǍǎǐḾḿǸǹǑǒǔǖǘǚǜā23̧1o1⁄41⁄23⁄4ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöùúûüýÿĀĪŪĒŌāīūēōĄ̆ĽŚŠŞŤŹŽŻą̨ľśšşťź̋žżŔĂĹĆČĘĚĎŃŇŐŘŮŰŢŕăĺćčęěďńňőřůűţ̇ĈĜĤĴŜŬĉĝĥĵŝŭǽὰάὲέiiiiiiivvviviiviiiixxxixiiabcdefghijklmnopqrstuvwxyzアイウエオカキクケコサシスセソタチツテトロハニホヘ1234567891011121314151617181920IIIIIIIVVVIVIIVIIIIXXXIミリキロセンチメートルグラムトンアールヘクタールリットルワットカロリードルセントパーセントミリバールページmmcmkmmgkgccm2XII平成NoKKTEL上中下左右(株)(有)(代)明治大正昭和侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; Normalize testNormalize = new Normalize(); String type = "NFKD"; Value<String> result = testNormalize.action(validInput, type); Assert.assertEquals(result.get().trim(), expectedOutput); } @Test public void NomalizeTestWithNFKD(){ String validInput = "‾。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚,.:;?!゛゜´`¨^ ̄_ヾゞ/|…‥()[]{}+=≠<>″℃¥$%#&*@'"-ヿゟ⊄⊅∉∦⦅⦆∬≢Å0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZℵℏ㏋ℓabcdefghijklmnopqrstuvwxyzがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽゔガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポヴЁЙёйヷヸヹヺ⅓⅔⅕㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿‼⁇⁈⁉ǍǎǐḾḿǸǹǑǒǔǖǘǚǜª¯²³¸¹º¼½¾ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöùúûüýÿĀĪŪĒŌāīūēōĄ˘ĽŚŠŞŤŹŽŻą˛ľśšşťź˝žżŔĂĹĆČĘĚĎŃŇŐŘŮŰŢŕăĺćčęěďńňőřůűţ˙ĈĜĤĴŜŬĉĝĥĵŝŭǽὰάὲέⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ㋐㋑㋒㋓㋔㋕㋖㋗㋘㋙㋚㋛㋜㋝㋞㋟㋠㋡㋢㋣㋺㋩㋥㋭㋬①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪ㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡Ⅻ㍻№㏍℡㊤㊥㊦㊧㊨㈱㈲㈹㍾㍽㍼侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; String expectedOutput = "̅。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚,.:;?! ゙ ゚ ́` ̈^ ̄_ヾゞ/|.....()[]{}+=≠<>′′°C¥$%#&*@'\"-コトより⊄⊅∉∦⦅⦆∫∫≢Å0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZאħHPlabcdefghijklmnopqrstuvwxyzがぎぐげござじずぜぞだぢづでどばぱびぴぶぷべぺぼぽゔガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポヴЁЙёйヷヸヹヺ1⁄32⁄31⁄5212223242526272829303132333435363738394041424344454647484950!!???!!?ǍǎǐḾḿǸǹǑǒǔǖǘǚǜa ̄23 ̧1o1⁄41⁄23⁄4ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöùúûüýÿĀĪŪĒŌāīūēōĄ ̆ĽŚŠŞŤŹŽŻą ̨ľśšşťź ̋žżŔĂĹĆČĘĚĎŃŇŐŘŮŰŢŕăĺćčęěďńňőřůűţ ̇ĈĜĤĴŜŬĉĝĥĵŝŭǽὰάὲέiiiiiiivvviviiviiiixxxixiiabcdefghijklmnopqrstuvwxyzアイウエオカキクケコサシスセソタチツテトロハニホヘ1234567891011121314151617181920IIIIIIIVVVIVIIVIIIIXXXIミリキロセンチメートルグラムトンアールヘクタールリットルワットカロリードルセントパーセントミリバールページmmcmkmmgkgccm2XII平成NoKKTEL上中下左右(株)(有)(代)明治大正昭和侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; Normalize testNormalize = new Normalize(); String type = "NFKD"; Value<String> result = testNormalize.action(validInput, type); Assert.assertEquals(result.get().trim(), expectedOutput); } @Test public void NomalizeTestWithNFC(){ String validInput = "Åάέ侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; String expectedOutput = "Åάέ侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; Normalize testNormalize = new Normalize(); String type = "NFC"; Value<String> result = testNormalize.action(validInput, type); Assert.assertEquals(result.get().trim(), expectedOutput); } @Test public void NomalizeTestWithNFKC(){ String validInput = "‾。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚,.:;?!`^/|…‥()[]{}+=<>″℃¥$%#&*@'"-ヿゟ⦅⦆∬Å0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZℵℏ㏋ℓabcdefghijklmnopqrstuvwxyz⅓⅔⅕㉑㉒㉓㉔㉕㉖㉗㉘㉙㉚㉛㉜㉝㉞㉟㊱㊲㊳㊴㊵㊶㊷㊸㊹㊺㊻㊼㊽㊾㊿‼⁇⁈⁉ª²³¸¹º¼½¾˘˛˝˙άέⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ㋐㋑㋒㋓㋔㋕㋖㋗㋘㋙㋚㋛㋜㋝㋞㋟㋠㋡㋢㋣㋺㋩㋥㋭㋬①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪ㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡Ⅻ㍻№㏍℡㊤㊥㊦㊧㊨㈱㈲㈹㍾㍽㍼侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; String expectedOutput = "̅。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚,.:;?!`^/|.....()[]{}+=<>′′°C¥$%#&*@'\"-コトより⦅⦆∫∫Å0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZאħHPlabcdefghijklmnopqrstuvwxyz1⁄32⁄31⁄5212223242526272829303132333435363738394041424344454647484950!!???!!?a23 ̧1o1⁄41⁄23⁄4 ̆ ̨ ̋ ̇άέiiiiiiivvviviiviiiixxxixiiabcdefghijklmnopqrstuvwxyzアイウエオカキクケコサシスセソタチツテトロハニホヘ1234567891011121314151617181920IIIIIIIVVVIVIIVIIIIXXXIミリキロセンチメートルグラムトンアールヘクタールリットルワットカロリードルセントパーセントミリバールページmmcmkmmgkgccm2XII平成NoKKTEL上中下左右(株)(有)(代)明治大正昭和侮僧免勉勤卑喝嘆器塚塀墨層屮廊悔慨憎懲敏既暑朗梅欄殺海渚漢煮凞猪琢碑社祉祈祐祖祝神祥禍禎福穀突節練繁署者臭著虜褐視諸謁謹賓贈逸都隆難響頻類爫縉艹艹蘒辶"; Normalize testNormalize = new Normalize(); String type = "NFKC"; Value<String> result = testNormalize.action(validInput, type); Assert.assertEquals(result.get().trim(), expectedOutput); } }
[ "micahdanielsmith@gmail.com" ]
micahdanielsmith@gmail.com
82e601e8c599bf9fab52a6e3d0635231477ae38f
24f2fe285b3219f9636235c8df71092c75d859dc
/Projects/Sunshine/PopularMovie/app/src/main/java/ninja/zhancheng/popularmovie/MainActivity.java
d644fa1317a9e5cc897071d9d6bdd67d35ac6c5c
[ "Apache-2.0" ]
permissive
zhanchengsong/Udacity
d200a7517c89b67a238b559f300169f623cc8244
117208719f975fdabd9e5bba58820b4314d90c7d
refs/heads/master
2020-03-23T09:08:39.577037
2018-04-14T23:32:05
2018-04-14T23:32:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
341
java
package ninja.zhancheng.popularmovie; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "zhanchengsong@Zhanchengs-MacBook-Pro.local" ]
zhanchengsong@Zhanchengs-MacBook-Pro.local
84549fce457e6fb1761d99deef5d498fe73f98e4
40df4983d86a3f691fc3f5ec6a8a54e813f7fe72
/app/src/main/java/com/p070qq/p071e/comm/net/NetworkClientImpl.java
93821fa2980c6e22041f0866adc2a8610947c97a
[]
no_license
hlwhsunshine/RootGeniusTrunAK
5c63599a939b24a94c6f083a0ee69694fac5a0da
1f94603a9165e8b02e4bc9651c3528b66c19be68
refs/heads/master
2020-04-11T12:25:21.389753
2018-12-24T10:09:15
2018-12-24T10:09:15
161,779,612
0
0
null
null
null
null
UTF-8
Java
false
false
7,860
java
package com.p070qq.p071e.comm.net; import com.p070qq.p071e.comm.net.NetworkClient.Priority; import com.p070qq.p071e.comm.net.p072rr.Request; import com.p070qq.p071e.comm.net.p072rr.Response; import com.p070qq.p071e.comm.util.GDTLogger; import java.util.Map.Entry; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.FutureTask; import java.util.concurrent.PriorityBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import org.apache.http.HttpVersion; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.conn.params.ConnManagerParams; import org.apache.http.conn.params.ConnPerRouteBean; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; import org.apache.http.params.BasicHttpParams; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; import org.apache.http.params.HttpProtocolParams; /* renamed from: com.qq.e.comm.net.NetworkClientImpl */ public class NetworkClientImpl implements NetworkClient { /* renamed from: a */ private static final HttpClient f2832a; /* renamed from: b */ private static final NetworkClient f2833b = new NetworkClientImpl(); /* renamed from: c */ private final ExecutorService f2834c = new ThreadPoolExecutor(5, 10, 180, TimeUnit.SECONDS, this.f2835d); /* renamed from: d */ private PriorityBlockingQueue<Runnable> f2835d = new PriorityBlockingQueue(15); /* renamed from: com.qq.e.comm.net.NetworkClientImpl$NetFutureTask */ class NetFutureTask<T> extends FutureTask<T> implements Comparable<NetFutureTask<T>> { /* renamed from: a */ private final Priority f2829a; public NetFutureTask(NetworkClientImpl networkClientImpl, Callable<T> callable, Priority priority) { super(callable); this.f2829a = priority; } public int compareTo(NetFutureTask<T> netFutureTask) { return netFutureTask == null ? 1 : this.f2829a.value() - netFutureTask.f2829a.value(); } } /* renamed from: com.qq.e.comm.net.NetworkClientImpl$TaskCallable */ static class TaskCallable implements Callable<Response> { /* renamed from: a */ private Request f2830a; /* renamed from: b */ private NetworkCallBack f2831b; public TaskCallable(Request request) { this(request, null); } public TaskCallable(Request request, NetworkCallBack networkCallBack) { this.f2830a = request; this.f2831b = networkCallBack; } /* renamed from: a */ private void m3114a(HttpRequestBase httpRequestBase) { for (Entry entry : this.f2830a.getHeaders().entrySet()) { httpRequestBase.setHeader((String) entry.getKey(), (String) entry.getValue()); } httpRequestBase.setHeader("User-Agent", "GDTADNetClient-[" + System.getProperty("http.agent") + "]"); httpRequestBase.addHeader("Accept-Encoding", "gzip"); HttpParams params = httpRequestBase.getParams(); if (params == null) { params = new BasicHttpParams(); } if (this.f2830a.getConnectionTimeOut() > 0) { HttpConnectionParams.setConnectionTimeout(params, this.f2830a.getConnectionTimeOut()); } if (this.f2830a.getSocketTimeOut() > 0) { HttpConnectionParams.setSoTimeout(params, this.f2830a.getSocketTimeOut()); } httpRequestBase.setParams(params); } public Response call() { Throwable e; Response response = null; try { HttpUriRequest httpPost; HttpClient a = NetworkClientImpl.f2832a; switch (this.f2830a.getMethod()) { case POST: httpPost = new HttpPost(this.f2830a.getUrlWithParas()); m3114a(httpPost); byte[] postData = this.f2830a.getPostData(); if (postData != null && postData.length > 0) { httpPost.setEntity(new ByteArrayEntity(postData)); break; } case GET: httpPost = new HttpGet(this.f2830a.getUrlWithParas()); m3114a(httpPost); break; default: httpPost = null; break; } response = this.f2830a.initResponse(httpPost, a.execute(httpPost)); e = null; } catch (Exception e2) { e = e2; } if (e == null) { if (this.f2831b != null) { this.f2831b.onResponse(this.f2830a, response); } if (this.f2830a.isAutoClose()) { response.close(); } } else if (this.f2831b != null) { GDTLogger.m3135w("NetworkClientException", e); this.f2831b.onException(e); if (response != null) { response.close(); } } else { throw e; } return response; } } static { HttpParams basicHttpParams = new BasicHttpParams(); ConnManagerParams.setTimeout(basicHttpParams, 30000); HttpConnectionParams.setConnectionTimeout(basicHttpParams, 30000); HttpConnectionParams.setSoTimeout(basicHttpParams, 30000); ConnManagerParams.setMaxConnectionsPerRoute(basicHttpParams, new ConnPerRouteBean(3)); ConnManagerParams.setMaxTotalConnections(basicHttpParams, 10); HttpProtocolParams.setVersion(basicHttpParams, HttpVersion.HTTP_1_1); HttpProtocolParams.setContentCharset(basicHttpParams, "UTF-8"); HttpProtocolParams.setUserAgent(basicHttpParams, "GDTADNetClient-[" + System.getProperty("http.agent") + "]"); SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); f2832a = new DefaultHttpClient(new ThreadSafeClientConnManager(basicHttpParams, schemeRegistry), basicHttpParams); } private NetworkClientImpl() { } public static NetworkClient getInstance() { return f2833b; } public Future<Response> submit(Request request) { return submit(request, Priority.Mid); } public Future<Response> submit(Request request, Priority priority) { Object netFutureTask = new NetFutureTask(this, new TaskCallable(request), priority); this.f2834c.execute(netFutureTask); GDTLogger.m3130d("QueueSize:" + this.f2835d.size()); return netFutureTask; } public void submit(Request request, NetworkCallBack networkCallBack) { submit(request, Priority.Mid, networkCallBack); } public void submit(Request request, Priority priority, NetworkCallBack networkCallBack) { this.f2834c.execute(new NetFutureTask(this, new TaskCallable(request, networkCallBack), priority)); GDTLogger.m3130d("QueueSize:" + this.f2835d.size()); } }
[ "603820467@qq.com" ]
603820467@qq.com
4af77f86bf8b9b93d0d19c0d5a0201ef0977ed93
b6b7b48a2ccbfd849035838839dbd38074467915
/QuasarTilesLayout/src/com/cmcdelhi/quasar/payMode/DDMode.java
d954560875c873ec9f6772f0cf0556d42b5dd559
[]
no_license
CMCDelhiQuasar/Quasar13MayRepo
29039f190fd0815effeb41bc73209adf0673ce78
d6c11264e6f15908710280b31058cecae8818040
refs/heads/master
2021-01-18T13:58:18.681448
2014-05-26T17:41:26
2014-05-26T17:41:26
19,747,026
1
0
null
null
null
null
UTF-8
Java
false
false
1,199
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.cmcdelhi.quasar.payMode; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * * @author Gufran Khurshid * @version 1.0 * @Date 4 April 2013 */ @Entity public class DDMode extends PaymentMode { private long DDNumber; @Column(name = "DDIssuerBank") private String bankName; @Temporal(TemporalType.DATE) @Column(name = "DDIssueDate") private Date issueDate; @Temporal(TemporalType.DATE) private Date ddExpiryDate; public void setDDNumber(long DDNumber) { this.DDNumber = DDNumber; } public long getDDNumber() { return DDNumber; } public void setBankName(String bankName) { this.bankName = bankName; } public String getBankName() { return bankName; } public Date getIssueDate() { return issueDate; } public void setIssueDate(Date issueDate) { this.issueDate = issueDate; } public Date getDdExpiryDate() { return ddExpiryDate; } public void setDdExpiryDate(Date ddExpiryDate) { this.ddExpiryDate = ddExpiryDate; } }
[ "gufran.khurshid@gmail.com" ]
gufran.khurshid@gmail.com
717ca6e73751951a43d537b476d037fdae640959
c57a7b184c0125ded04a3285bcaa98c324649314
/src/java/Servlets/ValidateLoginServlet.java
79d671cb00cc8e0d337ee898c82070b86f91d07b
[]
no_license
sagarbilas/Plasma-Bank-Management-System-Using-Servlet
9afc8aadfde14b3152e5985c72ca8165a04961a4
6c243513b42234ce6df8d2e5c55893e4c542b374
refs/heads/master
2022-11-17T04:28:30.259206
2020-07-17T18:28:27
2020-07-17T18:28:27
273,669,688
0
0
null
null
null
null
UTF-8
Java
false
false
3,288
java
package Servlets; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.sql.*; import javax.servlet.RequestDispatcher; public class ValidateLoginServlet extends HttpServlet { private static final long serialVersionUID = 1L; public ValidateLoginServlet() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); String userName = request.getParameter("username"); String password = request.getParameter("password"); String access_role = request.getParameter("role"); HttpSession session = request.getSession(); boolean flag = false; // JDBC code to connect mysql try { Class.forName("com.mysql.jdbc.Driver"); //Connection con = DriverManager.getConnection("jdbc:mysql://localhost:8080/testdemo", "root", "root"); //con = DriverManager.getConnection("jdbc:mysql://localhost/login", "root", ""); Connection con = DriverManager.getConnection("jdbc:mysql://localhost/plasmabankmanagementsystem", "root", ""); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("Select * from logintable"); while (rs.next()) { if (userName.equals(rs.getString(3)) && password.equals(rs.getString(4)) && access_role.equals(rs.getString(5))) { //session.setAttribute("user", userName); flag = true; //response.sendRedirect("./welcome"); //response.sendRedirect("https://www.studytonight.com"); //response.sendRedirect("welcome.html"); //response.sendRedirect("./viewplasmabranches"); if(access_role.equals("super-admin")) { response.sendRedirect("./viewplasmabranches"); } else if(access_role.equals("sub-admin")) { response.sendRedirect("./viewsubadminwelcomepage"); } else if(access_role.equals("plasma-seeker")) { response.sendRedirect("./viewplasmaseekerwelcomepage"); } } } if (flag == false) { RequestDispatcher rd = request.getRequestDispatcher("index.html"); rd.include(request, response); out.print("invalid user id or password"); } } catch (Exception p) { out.print(p); } } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "sagarbilas@yahoo.com" ]
sagarbilas@yahoo.com
c358b4003df9105c13a7ffe3ccdd92903299bbab
544c5f5c1892b1ccae72bc02385783ea5e61f813
/ImageJDisplay/src/main/java/eu/kiaru/ij/controller42/structDevice/SparselySampledSynchronizedDisplayedDevice.java
e65c0abbfa1e037228167d6287bbd0a5956a05ee
[ "MIT" ]
permissive
NicoKiaru/Controller42
4b51872a890aedf3e8faed43f627388b1a28f982
7e5fab1a71b924ad5147de29bb76fffa9c962e57
refs/heads/master
2022-01-20T05:43:12.471458
2018-06-19T17:10:45
2018-06-19T17:10:45
71,361,575
2
0
null
null
null
null
UTF-8
Java
false
false
4,066
java
package eu.kiaru.ij.controller42.structDevice; import java.time.Duration; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.ArrayList; //Also linearly interpolated abstract public class SparselySampledSynchronizedDisplayedDevice<T> extends DefaultSynchronizedDisplayedDevice<T> { T currentSample; private int numberOfSamples; private boolean initialized; public ArrayList<TimedSample<T>> samples; /*public void setNumberOfSamples(int numberOfSamples) { this.numberOfSamples=numberOfSamples; avgTimeBetweenSamplesInMs = Duration.between(startAcquisitionTime,endAcquisitionTime).dividedBy(numberOfSamples-1).toNanos()/1e6; samplingRateInitialized=true; }*/ public int getNumberOfSamples() { if (initialized) { return numberOfSamples; } else { return -1; } } public void samplesInitialized() { this.initialized=true; } @Override synchronized public void setDisplayedTime(LocalDateTime time) { // Unsupported operation /*if (this.initialized) { // Needs to find the correct image number // Converted to local time since it doesn't work otherwise... Duration timeInterval = Duration.between(this.startAcquisitionTime.toLocalTime(),time.toLocalTime());//.dividedBy(numberOfImages-1).toNanos() double timeIntervalInMs = ((double)(timeInterval.getSeconds()*1000)+(double)((double)(timeInterval.getNano())/1e6)); //newSampleDisplayed+=1;// because of IJ1 notation style boolean outOfBounds=false; /*if (newSampleDisplayed<0) { newSampleDisplayed=0; outOfBounds=true; } else if (newSampleDisplayed>numberOfSamples) { newSampleDisplayed=numberOfSamples; outOfBounds=true; } */ // makeDisplayVisible / makeDisplayinvisible /*if (newSampleDisplayed!=currentSampleIndexDisplayed) { currentSampleIndexDisplayed=newSampleDisplayed; // needs to update the window, if any displayCurrentSample(); }*/ /*} else { System.out.println("Sampling of device "+this.getName()+" not initialized"); }*/ } public T getSample(LocalDateTime date) { // TODO Auto-generated method stub if (this.initialized) { // Needs to find the correct image number // Converted to local time since it doesn't work otherwise... LocalTime lt = date.toLocalTime(); if (this.samples.isEmpty()) { return null; } int iSample = 0; while ((iSample<this.samples.size()) && (this.samples.get(iSample).time.isBefore(lt))) { iSample++; } if (iSample==0) { // Before any sample was acquired -> return sample 0 return this.samples.get(0).sample; } if (iSample==this.samples.size()) { // After last sample was acquired return this.samples.get(this.samples.size()-1).sample; } // between iSample-1 and iSample Duration timeIntervalBefore = Duration.between(this.samples.get(iSample-1).time,date.toLocalTime());//.dividedBy(numberOfImages-1).toNanos() double timeIntervalInMsBefore = ((double)(timeIntervalBefore.getSeconds()*1000)+(double)((double)(timeIntervalBefore.getNano())/1e6)); //System.out.println(timeIntervalInMsBefore); Duration timeIntervalTotal = Duration.between(this.samples.get(iSample-1).time,this.samples.get(iSample).time);//.dividedBy(numberOfImages-1).toNanos() double timeIntervalInMsTotal = ((double)(timeIntervalTotal.getSeconds()*1000)+(double)((double)(timeIntervalTotal.getNano())/1e6)); //System.out.println(timeIntervalInMsTotal); return this.samples.get(0).interpolate(samples.get(iSample-1).sample, samples.get(iSample).sample, timeIntervalInMsBefore/timeIntervalInMsTotal); //long indexSample = java.lang.Math.round((double)(timeIntervalInMs/avgTimeBetweenSamplesInMs)); /*if (indexSample<0) { indexSample=0; } else if (indexSample>=numberOfSamples) { indexSample=numberOfSamples-1; } */ //return null;// TODO getSample((int)indexSample); } else { System.out.println("Samples of device "+this.getName()+" not initialized"); return null; } } }
[ "nicolas.chiaruttini@gmail.com" ]
nicolas.chiaruttini@gmail.com
711044d3a517bc54de1c3b5a66ed5ed9f2910571
f023d28eb36f1d12019b2cd2eac861225eeb4196
/src/main/java/com/mnzit/wesbocket/queuebasedchat/config/ChatConfig.java
dbb6497a8f592965306f9ec0e9f332382c43ab17
[]
no_license
mnzit/QueueBasedChat
f9866c5a032ce74cff0bf6a06bdc275020251715
9d81f9ac09de9c711fe7bca77b409dd5a515f8c7
refs/heads/master
2022-01-19T13:07:24.226618
2019-07-23T07:18:37
2019-07-23T07:18:37
198,364,702
0
0
null
null
null
null
UTF-8
Java
false
false
835
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mnzit.wesbocket.queuebasedchat.config; import com.mnzit.wesbocket.queuebasedchat.db.ClientContainer; import com.mnzit.wesbocket.queuebasedchat.event.UserPresenceListener; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * * @author Mnzit */ @Configuration public class ChatConfig { @Bean public ClientContainer getContainer() { return new ClientContainer(); } @Bean public UserPresenceListener presenceEventListener() { UserPresenceListener listener = new UserPresenceListener(getContainer()); return listener; } }
[ "mnzitshakya@gmail.com" ]
mnzitshakya@gmail.com
66fd8fa7997c09c173ea6a40fc1eece391e947e5
ff8a904f49fad92e3770e3113940fd007892dbd5
/android-huawei/src/de/golfgl/gdxgamesvcs/HuaweiGameServicesClient.java
4700879f80320e440f5e7879f666fc839205d018
[ "Apache-2.0", "LicenseRef-scancode-proprietary-license" ]
permissive
MrStahlfelge/gdx-gamesvcs
9c9c8ff5f3f5a003a94a61c904ca6b1991a19e55
20d89c1f4dc160b23df7311dc0f8c64196c4890b
refs/heads/master
2023-05-25T05:57:31.003356
2021-12-03T22:19:46
2021-12-03T22:19:46
94,573,500
119
25
Apache-2.0
2023-05-21T06:43:41
2017-06-16T19:03:22
Java
UTF-8
Java
false
false
27,811
java
package de.golfgl.gdxgamesvcs; import android.content.Intent; import android.text.TextUtils; import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidEventListener; import com.badlogic.gdx.utils.Array; import com.huawei.hmf.tasks.OnFailureListener; import com.huawei.hmf.tasks.OnSuccessListener; import com.huawei.hmf.tasks.Task; import com.huawei.hms.common.ApiException; import com.huawei.hms.jos.JosApps; import com.huawei.hms.jos.JosAppsClient; import com.huawei.hms.jos.games.AchievementsClient; import com.huawei.hms.jos.games.ArchivesClient; import com.huawei.hms.jos.games.EventsClient; import com.huawei.hms.jos.games.GameScopes; import com.huawei.hms.jos.games.Games; import com.huawei.hms.jos.games.PlayersClient; import com.huawei.hms.jos.games.RankingsClient; import com.huawei.hms.jos.games.achievement.Achievement; import com.huawei.hms.jos.games.archive.Archive; import com.huawei.hms.jos.games.archive.ArchiveDetails; import com.huawei.hms.jos.games.archive.ArchiveSummary; import com.huawei.hms.jos.games.archive.ArchiveSummaryUpdate; import com.huawei.hms.jos.games.archive.OperationResult; import com.huawei.hms.jos.games.player.Player; import com.huawei.hms.support.api.entity.auth.Scope; import com.huawei.hms.support.hwid.HuaweiIdAuthManager; import com.huawei.hms.support.hwid.request.HuaweiIdAuthParams; import com.huawei.hms.support.hwid.request.HuaweiIdAuthParamsHelper; import com.huawei.hms.support.hwid.result.AuthHuaweiId; import com.huawei.hms.support.hwid.result.HuaweiIdAuthResult; import com.huawei.hms.support.hwid.service.HuaweiIdAuthService; import org.json.JSONException; import java.io.IOException; import java.util.ArrayList; import java.util.List; import de.golfgl.gdxgamesvcs.achievement.IAchievement; import de.golfgl.gdxgamesvcs.achievement.IFetchAchievementsResponseListener; import de.golfgl.gdxgamesvcs.gamestate.IFetchGameStatesListResponseListener; import de.golfgl.gdxgamesvcs.gamestate.ILoadGameStateResponseListener; import de.golfgl.gdxgamesvcs.gamestate.ISaveGameStateResponseListener; import de.golfgl.gdxgamesvcs.leaderboard.IFetchLeaderBoardEntriesResponseListener; import de.golfgl.gdxgamesvcs.leaderboard.ILeaderBoardEntry; /** * Client for Huawei Game Services * <p> * Created by Francesco Stranieri on 24.07.2020. */ public class HuaweiGameServicesClient implements IGameServiceClient, AndroidEventListener { private final int HUAWEI_GAMESVCS_AUTH_REQUEST = 8971; private final int HUAWEI_GAMESVCS_ACHIEVEMENTS_REQUEST = 8972; private final int HUAWEI_GAMESVCS_LEADERBOARDS_REQUEST = 8973; private AndroidApplication activity; private IGameServiceIdMapper<String> huaweiLeaderboardIdMapper; private IGameServiceIdMapper<String> huaweiAchievementIdMapper; private IGameServiceIdMapper<String> huaweiGameEventIdMapper; protected JosAppsClient josAppsClient; protected AchievementsClient achievementsClient; protected RankingsClient leaderboardsClient; protected EventsClient eventsClient; protected ArchivesClient archivesClient; private IGameServiceListener gsListener; private Player currentPlayer; private boolean isSaveDataEnabled; private boolean isSessionActive = false; private boolean isSessionPending = false; private int currentLeaderboardsStatus = HuaweiGameServicesConstants.HUAWEI_GAMESVCS_LEADERBOARDS_DISABLED; public HuaweiGameServicesClient(AndroidApplication activity, boolean isSaveDataEnabled) { this.activity = activity; this.isSaveDataEnabled = isSaveDataEnabled; this.activity.addAndroidEventListener(this); this.josAppsClient = JosApps.getJosAppsClient(this.activity); this.josAppsClient.init(); this.achievementsClient = Games.getAchievementsClient(this.activity); this.leaderboardsClient = Games.getRankingsClient(this.activity); this.eventsClient = Games.getEventsClient(this.activity); this.archivesClient = Games.getArchiveClient(this.activity); } /** * sets up the mapper for leaderboard ids * * @param huaweiLeaderboardIdMapper * @return this for method chaining */ public HuaweiGameServicesClient setHuaweiLeaderboardIdMapper(IGameServiceIdMapper<String> huaweiLeaderboardIdMapper) { this.huaweiLeaderboardIdMapper = huaweiLeaderboardIdMapper; return this; } /** * sets up the mapper for achievement ids * * @param huaweiAchievementIdMapper * @return this for method chaining */ public HuaweiGameServicesClient setHuaweiAchievementIdMapper(IGameServiceIdMapper<String> huaweiAchievementIdMapper) { this.huaweiAchievementIdMapper = huaweiAchievementIdMapper; return this; } /** * sets up the mapper for game event ids * * @param huaweiGameEventIdMapper * @return this for method chaining */ public HuaweiGameServicesClient setHuaweiGameEventIdMapper(IGameServiceIdMapper<String> huaweiGameEventIdMapper) { this.huaweiGameEventIdMapper = huaweiGameEventIdMapper; return this; } @Override public String getGameServiceId() { return IGameServiceClient.GS_HUAWEI_ID; } @Override public void setListener(IGameServiceListener gsListener) { this.gsListener = gsListener; } @Override public boolean resumeSession() { return logIn(); } private void sendError(IGameServiceListener.GsErrorType type, String msg, Throwable t) { if (gsListener != null) { gsListener.gsShowErrorToUser(type, msg, t); } } private HuaweiIdAuthParams getHuaweiIdParams() { List<Scope> scopes = new ArrayList<>(); if (this.isSaveDataEnabled) { scopes.add(GameScopes.DRIVE_APP_DATA); } return new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME) .setScopeList(scopes) .createParams(); } @Override public boolean logIn() { if (!this.isSessionActive && !this.isSessionPending) { this.isSessionPending = true; //try with silentSignIn. If It fails for missing account/verification, It will forward to the Huawei signIn/signUp page. Task<AuthHuaweiId> authHuaweiIdTask = HuaweiIdAuthManager .getService(this.activity, getHuaweiIdParams()) .silentSignIn(); authHuaweiIdTask.addOnSuccessListener(new OnSuccessListener<AuthHuaweiId>() { @Override public void onSuccess(AuthHuaweiId authHuaweiId) { loadPlayerInfo(); switchLeaderboardsStatus(HuaweiGameServicesConstants.HUAWEI_GAMESVCS_LEADERBOARDS_ENABLED); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { isSessionPending = false; if (e instanceof ApiException) { //Sign in explicitly. The sign-in result is obtained in onActivityResult. HuaweiIdAuthService service = HuaweiIdAuthManager.getService(activity, getHuaweiIdParams()); activity.startActivityForResult(service.getSignInIntent(), HUAWEI_GAMESVCS_AUTH_REQUEST); } else { sendError(IGameServiceListener.GsErrorType.errorLoginFailed, e.getMessage(), e); } } }); return true; } return false; } @Override public void pauseSession() { } @Override public void logOff() { if (this.isSessionActive) { switchLeaderboardsStatus(HuaweiGameServicesConstants.HUAWEI_GAMESVCS_LEADERBOARDS_DISABLED); Task<Void> authHuaweiIdTask = HuaweiIdAuthManager .getService(this.activity, getHuaweiIdParams()) .signOut(); authHuaweiIdTask.addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void v) { isSessionActive = false; currentPlayer = null; } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorLogoutFailed, e.getMessage(), e); } }); } } @Override public String getPlayerDisplayName() { if (this.currentPlayer != null) { return this.currentPlayer.getDisplayName(); } return null; } @Override public boolean isSessionActive() { return this.isSessionActive; } @Override public boolean isConnectionPending() { return this.isSessionPending; } private void switchLeaderboardsStatus(int newStatus) { if (newStatus != this.currentLeaderboardsStatus) { Task<Integer> task = this.leaderboardsClient.setRankingSwitchStatus(newStatus); task.addOnSuccessListener(new OnSuccessListener<Integer>() { @Override public void onSuccess(Integer statusValue) { currentLeaderboardsStatus = statusValue; } }); task.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); } } @Override public void showLeaderboards(String leaderBoardId) throws GameServiceException { Task<Intent> task; if (!TextUtils.isEmpty(leaderBoardId)) { if (this.huaweiLeaderboardIdMapper != null) { leaderBoardId = huaweiLeaderboardIdMapper.mapToGsId(leaderBoardId); } task = this.leaderboardsClient.getRankingIntent(leaderBoardId); } else { task = this.leaderboardsClient.getTotalRankingsIntent(); } task.addOnSuccessListener(new OnSuccessListener<Intent>() { @Override public void onSuccess(Intent intent) { try { activity.startActivityForResult(intent, HUAWEI_GAMESVCS_LEADERBOARDS_REQUEST); } catch (Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); } @Override public void showAchievements() throws GameServiceException { if (this.isSessionActive) { Task<Intent> task = this.achievementsClient.getShowAchievementListIntent(); task.addOnSuccessListener(new OnSuccessListener<Intent>() { @Override public void onSuccess(Intent intent) { try { activity.startActivityForResult(intent, HUAWEI_GAMESVCS_ACHIEVEMENTS_REQUEST); } catch (Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); } else { throw new GameServiceException.NoSessionException(); } } @Override public boolean fetchAchievements(final IFetchAchievementsResponseListener callback) { if (!this.isSessionActive) { return false; } Task<List<Achievement>> task = this.achievementsClient.getAchievementList(true); task.addOnSuccessListener(new OnSuccessListener<List<Achievement>>() { @Override public void onSuccess(List<Achievement> data) { if (data == null) { sendError(IGameServiceListener.GsErrorType.errorUnknown, "data is null", new NullPointerException()); return; } Array<IAchievement> achievements = HuaweiGameServicesUtils.getIAchievementsList(data); callback.onFetchAchievementsResponse(achievements); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); return true; } @Override public boolean submitToLeaderboard(String leaderboardId, long score, String scoreTips) { if (!this.isSessionActive) { return false; } if (this.huaweiLeaderboardIdMapper != null) { leaderboardId = huaweiLeaderboardIdMapper.mapToGsId(leaderboardId); } this.leaderboardsClient.submitRankingScore(leaderboardId, score, scoreTips); return true; } @Override public boolean fetchLeaderboardEntries(String leaderBoardId, int limit, boolean relatedToPlayer, IFetchLeaderBoardEntriesResponseListener callback) { if (!this.isSessionActive) { return false; } if (this.huaweiLeaderboardIdMapper != null) { leaderBoardId = huaweiLeaderboardIdMapper.mapToGsId(leaderBoardId); } if (relatedToPlayer) { this.fetchLeadeboardEntriesRelatedToPLayer(leaderBoardId, limit, callback); } else { this.fetchLeadeboardEntries(leaderBoardId, limit, callback); } return true; } private void fetchLeadeboardEntriesRelatedToPLayer(String leaderBoardId, int limit, final IFetchLeaderBoardEntriesResponseListener callback) { Task<RankingsClient.RankingScores> task = this.leaderboardsClient.getPlayerCenteredRankingScores(leaderBoardId, 2, limit, true); task.addOnSuccessListener(new OnSuccessListener<RankingsClient.RankingScores>() { @Override public void onSuccess(RankingsClient.RankingScores rankingScores) { Array<ILeaderBoardEntry> list = HuaweiGameServicesUtils.getILeaderboardsEntriesList(rankingScores, currentPlayer.getPlayerId()); callback.onLeaderBoardResponse(list); } }); task.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); } private void fetchLeadeboardEntries(String leaderBoardId, int limit, final IFetchLeaderBoardEntriesResponseListener callback) { Task<RankingsClient.RankingScores> task = this.leaderboardsClient.getRankingTopScores(leaderBoardId, 2, limit, true); task.addOnSuccessListener(new OnSuccessListener<RankingsClient.RankingScores>() { @Override public void onSuccess(RankingsClient.RankingScores rankingScores) { Array<ILeaderBoardEntry> list = HuaweiGameServicesUtils.getILeaderboardsEntriesList(rankingScores, currentPlayer.getPlayerId()); callback.onLeaderBoardResponse(list); } }); task.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); } @Override public boolean submitEvent(String eventId, int increment) { if (!isSessionActive) { return false; } if (this.huaweiGameEventIdMapper != null) { eventId = huaweiGameEventIdMapper.mapToGsId(eventId); } this.eventsClient.grow(eventId, increment); return true; } @Override public boolean unlockAchievement(String achievementId) { if (!isSessionActive) { return false; } if (this.huaweiAchievementIdMapper != null) { achievementId = huaweiAchievementIdMapper.mapToGsId(achievementId); } this.achievementsClient.reach(achievementId); return true; } @Override public boolean incrementAchievement(String achievementId, int incNum, float completionPercentage) { if (!isSessionActive) { return false; } if (this.huaweiAchievementIdMapper != null) { achievementId = huaweiAchievementIdMapper.mapToGsId(achievementId); } this.achievementsClient.grow(achievementId, incNum); return true; } @Override public void saveGameState(String fileId, final byte[] gameState, final long progressValue, final ISaveGameStateResponseListener success) { if (!this.isSaveDataEnabled) { throw new UnsupportedOperationException(); } final ArchiveDetails details = new ArchiveDetails.Builder().build(); details.set(gameState); final ArchiveSummaryUpdate archiveSummaryUpdate = new ArchiveSummaryUpdate.Builder() .setCurrentProgress(progressValue) .setDescInfo("Progress: " + progressValue) .build(); Task<List<ArchiveSummary>> task = this.archivesClient.getArchiveSummaryList(true); task.addOnSuccessListener(new OnSuccessListener<List<ArchiveSummary>>() { @Override public void onSuccess(List<ArchiveSummary> archiveSummaries) { String firstSaveDataId = archiveSummaries != null && !archiveSummaries.isEmpty() ? archiveSummaries.get(0).getId() : null; if (TextUtils.isEmpty(firstSaveDataId)) { saveArchive(details, archiveSummaryUpdate, success); } else { updateArchive(firstSaveDataId, details, archiveSummaryUpdate, success); } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); } private void saveArchive(ArchiveDetails details, ArchiveSummaryUpdate summary, final ISaveGameStateResponseListener success) { Task<ArchiveSummary> addArchiveTask = this.archivesClient.addArchive(details, summary, true); if (success != null) { addArchiveTask.addOnSuccessListener(new OnSuccessListener<ArchiveSummary>() { @Override public void onSuccess(ArchiveSummary archiveSummary) { if (archiveSummary != null) { success.onGameStateSaved(true, null); } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { success.onGameStateSaved(false, e.getMessage()); } }); } } private void updateArchive(String fileId, ArchiveDetails details, ArchiveSummaryUpdate summary, final ISaveGameStateResponseListener success) { Task<OperationResult> addArchiveTask = archivesClient.updateArchive(fileId, summary, details); if (success != null) { addArchiveTask.addOnSuccessListener(new OnSuccessListener<OperationResult>() { @Override public void onSuccess(OperationResult result) { success.onGameStateSaved(true, null); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { success.onGameStateSaved(false, e.getMessage()); } }); } } @Override public void loadGameState(String fileId, final ILoadGameStateResponseListener responseListener) { if (!this.isSaveDataEnabled) { throw new UnsupportedOperationException(); } Task<List<ArchiveSummary>> task = this.archivesClient.getArchiveSummaryList(true); task.addOnSuccessListener(new OnSuccessListener<List<ArchiveSummary>>() { @Override public void onSuccess(List<ArchiveSummary> archiveSummaries) { String firstSaveDataId = archiveSummaries != null && !archiveSummaries.isEmpty() ? archiveSummaries.get(0).getId() : null; if (TextUtils.isEmpty(firstSaveDataId)) { responseListener.gsGameStateLoaded(null); } else { loadGameData(firstSaveDataId, responseListener); } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); } private void loadGameData(String fileId, final ILoadGameStateResponseListener responseListener) { Task<OperationResult> addArchiveTask = this.archivesClient.loadArchiveDetails(fileId); addArchiveTask.addOnSuccessListener(new OnSuccessListener<OperationResult>() { @Override public void onSuccess(OperationResult result) { Archive archive = result.getArchive(); try { byte[] data = archive.getDetails().get(); responseListener.gsGameStateLoaded(data); } catch (IOException e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); } @Override public boolean deleteGameState(String fileId, final ISaveGameStateResponseListener successCallback) { if (!this.isSaveDataEnabled) { return false; } Task<List<ArchiveSummary>> task = this.archivesClient.getArchiveSummaryList(true); task.addOnSuccessListener(new OnSuccessListener<List<ArchiveSummary>>() { @Override public void onSuccess(List<ArchiveSummary> archiveSummaries) { ArchiveSummary firstSaveData = archiveSummaries != null && !archiveSummaries.isEmpty() ? archiveSummaries.get(0) : null; if (firstSaveData != null) { deleteSaveGame(firstSaveData, successCallback); } else if (successCallback != null){ successCallback.onGameStateSaved(true, null); } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); return true; } private void deleteSaveGame(ArchiveSummary archiveSummary, final ISaveGameStateResponseListener successCallback) { Task<String> task = this.archivesClient.removeArchive(archiveSummary); if (successCallback != null) { task.addOnSuccessListener(new OnSuccessListener<String>() { @Override public void onSuccess(String result) { successCallback.onGameStateSaved(true, null); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { successCallback.onGameStateSaved(false, e.getMessage()); } }); } } @Override public boolean fetchGameStates(final IFetchGameStatesListResponseListener callback) { //only single savegame is supported return false; } @Override public boolean isFeatureSupported(GameServiceFeature feature) { switch (feature) { case GameStateStorage: case FetchGameStates: case GameStateDelete: return this.isSaveDataEnabled; case ShowAchievementsUI: case ShowAllLeaderboardsUI: case ShowLeaderboardUI: case SubmitEvents: case FetchAchievements: case FetchLeaderBoardEntries: case PlayerLogOut: return true; default: return false; } } private void loadPlayerInfo() { PlayersClient playersClient = Games.getPlayersClient(this.activity); Task<Player> playerTask = playersClient.getCurrentPlayer(); playerTask.addOnSuccessListener(new OnSuccessListener<Player>() { @Override public void onSuccess(Player player) { isSessionPending = false; isSessionActive = true; currentPlayer = player; if (gsListener != null) { gsListener.gsOnSessionActive(); } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception e) { isSessionPending = false; sendError(IGameServiceListener.GsErrorType.errorUnknown, e.getMessage(), e); } }); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case HUAWEI_GAMESVCS_AUTH_REQUEST: if (data == null) { sendError(IGameServiceListener.GsErrorType.errorLoginFailed, "data is null", new NullPointerException()); return; } String jsonSignInResult = data.getStringExtra("HUAWEIID_SIGNIN_RESULT"); if (TextUtils.isEmpty(jsonSignInResult)) { sendError(IGameServiceListener.GsErrorType.errorLoginFailed, "empty result", new IllegalStateException()); return; } try { HuaweiIdAuthResult signInResult = new HuaweiIdAuthResult().fromJson(jsonSignInResult); if (signInResult.getStatus().getStatusCode() == 0) { loadPlayerInfo(); } else { sendError(IGameServiceListener.GsErrorType.errorLoginFailed, "" + signInResult.getStatus().getStatusCode(), new IllegalStateException()); } } catch (JSONException je) { sendError(IGameServiceListener.GsErrorType.errorLoginFailed, je.getMessage(), je); } break; case HUAWEI_GAMESVCS_ACHIEVEMENTS_REQUEST: case HUAWEI_GAMESVCS_LEADERBOARDS_REQUEST: break; } } }
[ "noreply@github.com" ]
noreply@github.com
d41fd4dd9eee093570dca33f0da5b070c5568d40
aced47fa8684cffe5a95880305de4dfda16712f3
/CodeInTheAir/src/com/Android/CodeInTheAir/ShellClient/ShellClientHandler.java
e0276d854a27862149212d9710e71aa140189bdb
[]
no_license
anirudhSK/cita
ff176b7e18ea94d719bebd7b3c6b8bbefc582b15
9c54d26aa63268b88526dbe1ab84773248925220
refs/heads/master
2020-05-22T14:10:03.805098
2012-06-26T01:49:58
2012-06-26T01:49:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,997
java
package com.Android.CodeInTheAir.ShellClient; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import org.json.JSONArray; import org.json.JSONObject; import android.util.Log; import com.Android.CodeInTheAir.Events.Task; import com.Android.CodeInTheAir.Events.TaskManager; import com.Android.CodeInTheAir.Global.AppContext; import com.Android.CodeInTheAir.JSInterface.JS_Log_Interface; public class ShellClientHandler { Task task; ShellJSLog shellLog; String taskId; boolean pageLoaded = false; public ShellClientHandler(String taskId) { this.taskId = taskId; task = TaskManager.createTask(taskId); shellLog = new ShellJSLog(); task.getTaskContext().addJSLogInterface(shellLog); Log.v("CITA:shell", "loadingmain"); task.start(getTaskPkg()); } public boolean execute(String callId, String command) { Log.v("CITA:shell", "waiting"); while (!pageLoaded) { try { Thread.sleep(100); } catch (Exception e) { }; } Log.v("CITA:shell", "waitingDone"); command = command.replace("\"", "\\\\\\\""); String evalCommand = "eval (\\\"" + command + "\\\")"; String commandBlock = "try { " + evalCommand + "} catch(err) { sprint(\\\"Exception : \\\" + err.message); }"; String setCallIdCode = "setCallId(\\\"" + callId + "\\\");"; commandBlock = "\"" + setCallIdCode + commandBlock + "\""; Log.v("CITA:strCommand", commandBlock); task.getTaskContext().callLocalJSFunc("main", "eval", commandBlock); return true; } private String getTaskPkg() { String shellCode = ""; try { InputStream fileIS = AppContext.context.getAssets().open("shell.html"); BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS)); String readString = new String(); while((readString = buf.readLine())!= null) { shellCode += readString; } fileIS.close(); } catch (Exception e) { Log.v("CITA:pkg exception", e.getMessage()); } Log.v("CITA:shell", shellCode); JSONObject jMainObj = new JSONObject(); try { JSONObject jObj = new JSONObject(); jObj.put("file", "main"); jObj.put("code", shellCode); JSONArray jArr = new JSONArray(); jArr.put(jObj); jMainObj.put("source", jArr); jMainObj.put("mainFile", "main"); } catch (Exception e) { } return jMainObj.toString(); } public String getTaskId() { return task.getTaskContext().getTaskId(); } class ShellJSLog implements JS_Log_Interface { public void log(String tag, String value) { ShellClientComponents.shellClientInterface.sendResponse(taskId, tag, value); } public void log(String value) { } public void log() { pageLoaded = true; } } }
[ "sk.anirudh@gmail.com" ]
sk.anirudh@gmail.com
4d33de7addca04c5e05a47bf83ef6ccf687a969b
0e4cbd6b28ebcb804d0eec39aad82af1658fba6b
/values/src/main/java/Main.java
58b6fe97aef4f2f251039fb5385248ebb96c6aa7
[]
no_license
Khanenka/digitsconsoleproject
16d0dbc60ef82216adb3275e254cb67d085da933
149cb0811002e96a526075de706ed986cd0fc76f
refs/heads/master
2023-06-28T03:51:35.876236
2021-07-28T19:39:47
2021-07-28T19:39:47
390,482,921
0
0
null
null
null
null
UTF-8
Java
false
false
5,805
java
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Scanner; public class Main { private static String numText; private static StringBuilder sb = new StringBuilder(); public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); System.out.println("Введите число от -999 999 999 до 999 999 999"); long value = sc.nextLong(); System.out.println(WordsToText(value)); } public static String WordsToText(long value) throws IOException { long numberMax = 999999999999L; if (value < -numberMax || value > numberMax) { numText = ("Число выходит за рамки указанного диапазона"); } if (value == 0) { numText = ("ноль "); } if (value < 0) { numText = ("минус "); value = -value; } else if (value > 0) { numText = (""); } // разбиваем число на миллиарды,миллионы,тысячи и единицы int billion = (int) (value / 1_000_000_000); int million = (int) (value - (billion * 1_000_000_000)) / 1_000_000; int thousand = (int) (value - (billion * 1_000_000_000) - (million * 1_000_000)) / 1000; int toThousand = (int) (value % 1000); String x = divisoinThousandAnd(billion, 0); String z = divisoinThousandAnd(million, 1); String v = divisoinThousandAnd(thousand, 2); String c = divisoinThousandAnd(toThousand, 3); return numText + c; } public static String divisoinThousandAnd(int value, int index) throws IOException { int hundreds = value / 100;//сотни int decimal = (value - (hundreds * 100)) / 10;//десятые int units = value % 10;//единицы // число без степени String unitsInFile = Files.readAllLines(Paths.get("src/main/vocabulary")).get(units); String doubleUnitsInFile = Files.readAllLines(Paths.get("src/main/vocabulary")).get(11 + units); String decimalInFile = Files.readAllLines(Paths.get("src/main/vocabulary")).get(21 + decimal); String hundredsInFile = Files.readAllLines(Paths.get("src/main/vocabulary")).get(31 + hundreds); String endingNa = Files.readAllLines(Paths.get("src/main/vocabulary")).get(46); String endingE = Files.readAllLines(Paths.get("src/main/vocabulary")).get(47); String endingSpace = Files.readAllLines(Paths.get("src/main/vocabulary")).get(48); String endingIn = Files.readAllLines(Paths.get("src/main/vocabulary")).get(49); String endingA = Files.readAllLines(Paths.get("src/main/vocabulary")).get(50); String billionInFile = Files.readAllLines(Paths.get("src/main/vocabulary")).get(44); String endingOv = Files.readAllLines(Paths.get("src/main/vocabulary")).get(52); String millionInfile = Files.readAllLines(Paths.get("src/main/vocabulary")).get(43); String thousandInFile = Files.readAllLines(Paths.get("src/main/vocabulary")).get(42); String endingI = Files.readAllLines(Paths.get("src/main/vocabulary")).get(53); if (decimal == 1) { sb.append(hundredsInFile).append(doubleUnitsInFile); } else { sb.append(hundredsInFile).append(decimalInFile).append(unitsInFile); } if (index == 2) { if (units == 1 && decimal != 1) {//од..НА sb.append(endingNa); } else if (units == 2 & decimal != 1) { sb.append(endingE);//дв..Е } if (units > 1 && decimal != 1) { sb.append(endingSpace);//" "пятьдесят четыре } } else { if (units == 1 && decimal != 1) {// тридцать оди..ИН sb.append(endingIn); } if (units == 2 & decimal != 1) {// двадцать дв..А sb.append(endingA); } if (units != 0 & decimal != 1) { sb.append(endingSpace);//" "пятьдесят четыре } } if (value != 0) { if (units == 0 && decimal >= 0 && index == 0) { sb.append(billionInFile).append(endingOv); } else if (units == 1 && decimal >= 0 && index == 0) { sb.append(billionInFile).append(endingSpace); } else if (units > 2 && units < 5 && decimal != 1 && index == 0) { sb.append(billionInFile).append(endingA); } else if (units > 2 && units < 5 && decimal == 1 && index == 0) { sb.append(billionInFile).append(endingOv); } else if (units > 5 && decimal >= 0 && index == 0) { sb.append(billionInFile).append(endingOv); } else if (units == 0 && decimal >= 0 && index == 1) { sb.append(millionInfile).append(endingOv); } else if (units == 1 && decimal >= 0 && index == 1) { sb.append(millionInfile).append(endingSpace); } else if (units > 2 && units < 5 && decimal != 1 && index == 1) { sb.append(millionInfile).append(endingA); } else if (units > 2 && units < 5 && decimal == 1 && index == 1) { sb.append(millionInfile).append(endingOv); } else if (units > 5 && decimal >= 0 && index == 1) { sb.append(millionInfile).append(endingOv); } else if (units == 0 && decimal >= 0 && index == 2) { sb.append(thousandInFile).append(endingSpace); } else if (units == 1 && decimal >= 0 && index == 2) { sb.append(thousandInFile).append(endingSpace); } else if (units > 2 && units < 5 && decimal == 0 && index == 2) { sb.append(thousandInFile).append(endingI); } else if (units > 5 && decimal >= 0 && index == 2) { sb.append(thousandInFile).append(endingSpace); } else if (units > 2 && units < 5 && decimal != 1 && index == 2) { sb.append(thousandInFile).append(endingI); } } // дописываем степень числа return String.valueOf(sb); } }
[ "pozitivlen9@mail.ru" ]
pozitivlen9@mail.ru
585edb24436dce323c192bfc20e3ff46fae79947
76926769aae9a5ba14f2ae3f5d05f16db344ee67
/budget-core/src/main/java/fdr/budget/model/Expense.java
874ba1d3e51d0c8a21297e999ae48b441217b662
[]
no_license
freinard/budget
8981f20f586f6a853f7be87a35f4bae4fc741692
1d033b257690bd107c1d1eeb82beae99033264f0
refs/heads/master
2021-01-01T20:00:57.674639
2014-04-29T02:20:55
2014-04-29T02:20:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
217
java
package fdr.budget.model; public class Expense { private String name; public Expense(String name, double amount) { this.name = name; } public String getName() { return name; } }
[ "freinard@gmail.com" ]
freinard@gmail.com
39d250ede36c9ca37ab41fd4a052a901bdb5ef6b
ff4c533bb90b81cd4da61ae0046a325a20a3a901
/FindNodeAtKDist/src/com/example/find/node/atK/FindNodeAtK.java
8c82369c4fcb3b6499e83a21a18125a4e97a6028
[]
no_license
KAditi/Data-Structure-Algorithm-Java-Prog
1f8d30f8b75e4d23fadd6f69b7f1c3e50992c3a3
eb2f9f9585fa29851cf3b1b8ec60de5ce6d2a09c
refs/heads/master
2021-01-20T19:56:52.564748
2016-07-12T06:22:51
2016-07-12T06:22:51
60,556,433
2
0
null
null
null
null
UTF-8
Java
false
false
711
java
package com.example.find.node.atK; public class FindNodeAtK { public Node root; public void findNodeAtKDist(Node node, int k) { if(node == null) return; if(k == 0) { System.out.print("\t"+node.data); return; } else { findNodeAtKDist(node.left, k-1); findNodeAtKDist(node.right, k-1); } } public static void main(String[] args) { FindNodeAtK tree = new FindNodeAtK(); tree.root = new Node(1); tree.root.left = new Node(2); tree.root.right = new Node(3); tree.root.left.left = new Node(4); tree.root.left.right = new Node(5); tree.root.right.left = new Node(8); tree.findNodeAtKDist(tree.root,1); } }
[ "kartiki.aditi@gmail.com" ]
kartiki.aditi@gmail.com
e3c67f444151a72f7a6609da181dba9704603792
660b1e79949d62ae37abf630ee0dd890678c4999
/src/com/class26/Bank.java
163f0a0cffe375d7cbf1b987909e6eae4562100e
[]
no_license
LolaMelibaeva/JavaClass
3c67c804eb5aaa20a5ee2740da844edf24f94f5d
838c12d489e10308316228f6978f58471e12284f
refs/heads/master
2020-05-03T00:08:23.661321
2019-05-13T15:53:43
2019-05-13T15:53:43
178,301,877
0
0
null
null
null
null
UTF-8
Java
false
false
623
java
package com.class26; public class Bank { int getBalance () { return 0; } } class BankA extends Bank { int getBalance () { return 1000; } } class BankB extends Bank { int getBalance () { return 1500; } } class BankC extends Bank { int getBalance () { return 2000; } } class TestBank { public static void main(String[] args) { Bank b=new BankA(); System.out.println("BankA deposit is "+b.getBalance()); Bank b1=new BankB(); System.out.println("BankB deposit is "+b1.getBalance()); Bank b2=new BankC(); System.out.println("BankC deposit is "+b2.getBalance()); } }
[ "lolam79@gmail.com" ]
lolam79@gmail.com
fab2017b14a435aae7bb099ad98f7a6ce6c6e9fc
e6c0de6db3a6707496ac0e76e7cde86ee030a2b4
/src/main/java/cm/beihua/model/Announcement.java
bb54abdeeb14852715dbd10813cc5510e8c7917b
[]
no_license
galaxy-yuan/vote-beihua
cdb2c8111f260111b9cf39b48b5930a1194f08bc
2620d17a6f4b941dc957815638717d13fce2e478
refs/heads/master
2021-01-19T21:20:37.452361
2017-04-18T16:10:44
2017-04-18T16:10:44
88,644,916
0
0
null
null
null
null
UTF-8
Java
false
false
1,096
java
package cm.beihua.model; import java.io.Serializable; import java.util.Date; public class Announcement implements Serializable { /** * */ private static final long serialVersionUID = 1L; private Integer id; private String title; private Date createtime; private String conten; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title == null ? null : title.trim(); } public Date getCreatetime() { return createtime; } public void setCreatetime(Date createtime) { this.createtime = createtime; } public String getConten() { return conten; } public void setConten(String conten) { this.conten = conten == null ? null : conten.trim(); } @Override public String toString() { return "Announcement [id=" + id + ", title=" + title + ", createtime=" + createtime + ", conten=" + conten + "]"; } }
[ "yuanzhian@live.com" ]
yuanzhian@live.com
685e427ebbb8b0c569ee8ee993e50b8767ce5433
5d6c374a2518d469d674a1327d21d8e0cf2b54f7
/modules/unsupported/couchdb/src/main/java/org/geotools/data/couchdb/client/CouchDBResponse.java
d49356d18fb04b6ca62403b910f7f8ae2c2b9262
[]
no_license
HGitMaster/geotools-osgi
648ebd9343db99a1e2688d9aefad857f6521898d
09f6e327fb797c7e0451e3629794a3db2c55c32b
refs/heads/osgi
2021-01-19T08:33:56.014532
2014-03-19T18:04:03
2014-03-19T18:04:03
4,750,321
3
0
null
2014-03-19T13:50:54
2012-06-22T11:21:01
Java
UTF-8
Java
false
false
4,354
java
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2011, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotools.data.couchdb.client; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.URIException; import org.geotools.util.logging.Logging; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; /** * * @author Ian Schneider (OpenGeo) */ public final class CouchDBResponse { private final HttpMethod request; private final int result; private final IOException exception; private final Object json; private final boolean isArray; private static final Logger logger = Logging.getLogger(CouchDBResponse.class); public CouchDBResponse(HttpMethod request, int result, IOException exception) throws IOException { this.request = request; this.result = result; this.exception = exception; boolean err = !isHttpOK(); InputStream response = request.getResponseBodyAsStream(); if (err) { if (exception != null) { throw new IOException("HTTP error",exception); } if (response == null) { throw new IOException("HTTP error : " + result); } } json = JSONValue.parse(new InputStreamReader(request.getResponseBodyAsStream())); if (err) { isArray = false; } else { isArray = json instanceof JSONArray; } } public void checkOK(String msg) throws CouchDBException { if (!isHttpOK()) { String fullMsg = msg + "," + getErrorAndReason(); try { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE,"Request URI : " + request.getURI()); } } catch (URIException ex) { logger.warning("An invalid URI was used " + request.getPath() + "," + request.getQueryString()); } throw new CouchDBException(fullMsg,exception); } } private String getErrorAndReason() { if (!isHttpOK()) { JSONObject err = (JSONObject) json; String res = null; if (err.containsKey("error")) { res = err.get("error").toString(); } if (err.containsKey("reason")) { res = res == null ? "" : res + ","; res = res + err.get("reason").toString(); } if (res == null) { res = err.toJSONString(); } return res; } else { throw new IllegalStateException("not an error"); } } public boolean isHttpOK() { return result >= 200 && result < 300; } public boolean isCouchOK() { boolean ok = false; JSONObject obj = (JSONObject) json; return obj.get("ok").equals("true"); } public Throwable getException() { return exception; } public JSONArray getBodyAsJSONArray() throws IOException { if (!isArray) { throw new IllegalStateException("Response is not an array"); } return (JSONArray) json; } public JSONObject getBodyAsJSONObject() throws IOException { if (isArray) { throw new IllegalStateException("Response is not an object"); } return (JSONObject) json; } }
[ "devnull@localhost" ]
devnull@localhost
18ddba9016c0ed84b76e69a4a8faa115d52a9d9d
26c90fa0cf157ffe2ea580012fa1371a7b9f5787
/docs/image/java/ic_crop_16_9.java
25a1783114f60807aa76fa9f47a1078065fcdfcb
[ "Apache-2.0" ]
permissive
ThePreviousOne/SVG-Android
a666e8b2298729d13a72530dee2f1f598dbd86f9
7be929196d23c547034400c7eb8ed937ba9dba4f
refs/heads/master
2020-03-28T08:38:51.300003
2018-09-09T01:07:44
2018-09-09T05:08:15
147,979,009
0
0
Apache-2.0
2018-09-09T00:03:26
2018-09-09T00:03:26
null
UTF-8
Java
false
false
2,142
java
package com.github.megatronking.svg.iconlibs; import android.content.Context; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import com.github.megatronking.svg.support.SVGRenderer; /** * AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * SVG-Generator. It should not be modified by hand. */ public class ic_crop_16_9 extends SVGRenderer { public ic_crop_16_9(Context context) { super(context); mAlpha = 1.0f; mWidth = dip2px(24.0f); mHeight = dip2px(24.0f); } @Override public void render(Canvas canvas, int w, int h, ColorFilter filter) { final float scaleX = w / 24.0f; final float scaleY = h / 24.0f; mPath.reset(); mRenderPath.reset(); mFinalPathMatrix.setValues(new float[]{1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}); mFinalPathMatrix.postScale(scaleX, scaleY); mPath.moveTo(19.0f, 6.0f); mPath.lineTo(5.0f, 6.0f); mPath.rCubicTo(-1.1f, 0.0f, -2.0f, 0.9f, -2.0f, 2.0f); mPath.rLineTo(0f, 8.0f); mPath.rCubicTo(0.0f, 1.1f, 0.9f, 2.0f, 2.0f, 2.0f); mPath.rLineTo(14.0f, 0f); mPath.rCubicTo(1.1f, 0.0f, 2.0f, -0.9f, 2.0f, -2.0f); mPath.lineTo(21.0f, 8.0f); mPath.rCubicTo(0.0f, -1.1f, -0.9f, -2.0f, -2.0f, -2.0f); mPath.close(); mPath.moveTo(19.0f, 6.0f); mPath.rMoveTo(0.0f, 10.0f); mPath.lineTo(5.0f, 16.0f); mPath.lineTo(5.0f, 8.0f); mPath.rLineTo(14.0f, 0f); mPath.rLineTo(0f, 8.0f); mPath.close(); mPath.moveTo(19.0f, 16.0f); mRenderPath.addPath(mPath, mFinalPathMatrix); if (mFillPaint == null) { mFillPaint = new Paint(); mFillPaint.setStyle(Paint.Style.FILL); mFillPaint.setAntiAlias(true); } mFillPaint.setColor(applyAlpha(-16777216, 1.0f)); mFillPaint.setColorFilter(filter); canvas.drawPath(mRenderPath, mFillPaint); } }
[ "jgy08954@ly.com" ]
jgy08954@ly.com
e5350b0bea54ccc9903d583bc280789ece2d962c
490a9845c0309e7fe9b397a624fca721ea809bb7
/app/src/main/java/com/company/ssDev/que9/AdminFeaturedVideos.java
9d47274236efa23d0a4fa0debce781eca35bec74
[]
no_license
subhamtandon/SCBApp
d4df202944c2fffcf4ab3cdf594bd9771076e517
143df8bc9709f7aba99b5be4d3be9eeb26de9f22
refs/heads/master
2020-03-21T12:32:38.745131
2019-03-02T21:19:14
2019-03-02T21:19:14
138,558,023
1
1
null
null
null
null
UTF-8
Java
false
false
1,560
java
package com.company.ssDev.que9; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.Spinner; public class AdminFeaturedVideos extends AppCompatActivity { Spinner spinnerCategories; Button categorySubmitButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_admin_featured_videos); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setTitle("Featured Videos"); } spinnerCategories = findViewById(R.id.spinnerCategories); categorySubmitButton = findViewById(R.id.categorySubmitButton); categorySubmitButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(AdminFeaturedVideos.this, AdminYoutubeVideos.class); intent.putExtra("CATEGORY", spinnerCategories.getSelectedItem().toString()); startActivity(intent); } }); } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId()==android.R.id.home) finish(); return super.onOptionsItemSelected(item); } }
[ "subhamtandon98@gmail.com" ]
subhamtandon98@gmail.com
fddae3e157529358d5ddf74b1851cd2d17a47ae8
a9e7c001832bcd0aafea6e292eb8cad7db12c5c7
/withjam7/src/main/java/withjam/control/AuthControl.java
787c959879830aeced3cbf90d6bec08ac33433fc
[]
no_license
jeongdahm/withjam
c802db94793a697bcf9968249d9f15c2f51c7b6b
0a5962aa502506074babe27b81f66efd1c3e5aeb
refs/heads/master
2020-05-19T22:25:48.109925
2015-02-09T13:40:37
2015-02-09T13:40:37
28,027,292
0
0
null
null
null
null
UTF-8
Java
false
false
3,268
java
package withjam.control; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.SessionAttributes; import org.springframework.web.bind.support.SessionStatus; import org.springframework.web.servlet.ModelAndView; import withjam.domain.Member; import withjam.service.MemberService; /* @SessionAttributes * => Model에 저장되는 값 중에서 세션에 저장될 객체를 지정한다. * => 사용법 * @SessionAttributes({"key", "key", ...}) */ @Controller @RequestMapping("/auth") // 만약 Model에 loginUser라는 이름으로 값을 저장한다면 // 그 값은 request에 보관하지 말고 session에 보관하라! // 그 값은 세션에 있는 값이다. @SessionAttributes({ "loginUser", "requestUrl" }) public class AuthControl { @Autowired MemberService memberService; // @RequestMapping(value = "/add", method = RequestMethod.GET) // public ModelAndView form() throws Exception { // ModelAndView mv = new ModelAndView(); // mv.setViewName("member/mainPage"); // return mv; // } @RequestMapping(value = "/signup", method = RequestMethod.POST) public String add(Member member) throws Exception { // System.out.println("test01"); memberService.add(member); return "redirect:add.do"; } @RequestMapping(value = "/login", method = RequestMethod.GET) public String form( @CookieValue(/* required=false */defaultValue = "") String uid, Model model) throws Exception { model.addAttribute("uid", uid); return "auth/LoginForm"; } @RequestMapping(value = "/login", method = RequestMethod.POST) public String login(String uid, String pwd, String save, String requestUrl, /* * 세션에 * 저장된 * 값을 * 달라고 * 하려면 * ? */ HttpServletResponse response, Model model, SessionStatus status) throws Exception { if (save != null) { // 쿠키로 아이디 저장 Cookie cookie = new Cookie("uid", uid); cookie.setMaxAge(60 * 60 * 24 * 15); response.addCookie(cookie); } else { Cookie cookie = new Cookie("uid", ""); cookie.setMaxAge(0); // 무효화시킴 response.addCookie(cookie); } Member member = memberService.validate(uid, pwd); if (member != null) { model.addAttribute("loginUser", member); if (requestUrl != null) { return "redirect:" + requestUrl; } else { return "redirect:../product/list.do"; } } else { // @SessionAttributes로 지정된 값을 무효화시킨다. // => 주의!!!! 세션 전체를 무효화시키지 않는다. status.setComplete(); return "redirect:login.do"; // 로그인 폼으로 보낸다. } } @RequestMapping("/logout") public String execute(SessionStatus status) throws Exception { status.setComplete(); return "redirect:login.do"; } }
[ "raratami21c@gmail.com" ]
raratami21c@gmail.com
da60ea200c71c9be135bc8354595f94589197ba4
750f1c9beaa046495b2cc9f329c32b628d33c997
/orangelala/orangelala-framework-model/src/main/java/com/orangelala/framework/model/cms/CmsSiteServer.java
07d050da1c2ab57fc99fa46703423934966785c9
[]
no_license
chrilwe/orangelala-shop
7d58f4c5ac3cb0ece1138079a0ec1478d024dc0d
129ea7343452364de6226e09e2cebf5477e9ca78
refs/heads/master
2022-12-01T17:40:15.449360
2019-10-21T14:44:42
2019-10-21T14:44:42
199,277,088
1
0
null
2022-11-24T06:26:44
2019-07-28T11:10:47
Java
UTF-8
Java
false
false
956
java
package com.orangelala.framework.model.cms; import lombok.Data; import lombok.ToString; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; @Data @ToString @Document(collection = "cms_site_server") public class CmsSiteServer { /** * 站点id、服务器IP、端口、访问地址、服务器类型(代理、静态、动态、CDN)、资源发布地址(完整的HTTP接口)、使用类型(测试、生产) */ //站点id private String siteId; //服务器ID @Id private String serverId; //服务器IP private String ip; //端口 private String port; //访问地址 private String webPath; //服务器名称(代理、静态、动态、CDN) private String serverName; //资源发布地址(完整的HTTP接口) private String uploadPath; //使用类型(测试、生产) private String useType; }
[ "1129864619@qq.com" ]
1129864619@qq.com
fe2c8164b559c4ef91eadc92d4fc9929e0bd3c1d
374ba0b5daa26b2e1096d5c6b6a9e50b0c7370ee
/ShopManager/src/application/ui/ItemEditor.java
af90e69f30354f4834c133f2db724c5c2fbff5b8
[]
no_license
mhamze1994/ShopManager
2fd54cee34627847c03ef78616d0df4ea85e8e41
40af5ba9fe6ad687be2ca3829813d98637b438d3
refs/heads/main
2023-02-01T14:31:49.526175
2020-12-15T09:29:01
2020-12-15T09:29:01
314,837,946
0
0
null
null
null
null
UTF-8
Java
false
false
31,295
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package application.ui; import application.Application; import application.DatabaseManager; import entity.Item; import entity.ItemCategory; import entity.Unit; import application.Calculator; import invoice.ui.CustomFocusTraversalPolicy; import java.awt.CardLayout; import java.awt.Component; import java.awt.ComponentOrientation; import java.awt.HeadlessException; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.math.BigDecimal; import java.sql.CallableStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.DefaultComboBoxModel; import javax.swing.JDialog; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import ui.controls.PressButton; /** * * @author PersianDevStudio */ public class ItemEditor extends javax.swing.JPanel { private Item item; private ArrayList<ItemCategory> itemCategories; private ArrayList<Unit> units; public ItemEditor(Item item) { this.item = item; init(); } /** * Creates new form ItemEditor */ public ItemEditor() { init(); } private void init() { initComponents(); ArrayList<Component> uiComponentOrder = new ArrayList<>(); uiComponentOrder.add(inputDescription); uiComponentOrder.add(comboListCategory); uiComponentOrder.add(inputUnit1); uiComponentOrder.add(inputRatio1); uiComponentOrder.add(inputUnit2); uiComponentOrder.add(pressButton1); groupPane1.setFocusCycleRoot(true); groupPane1.setFocusTraversalPolicy(new CustomFocusTraversalPolicy(uiComponentOrder)); inputFieldFilter.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); java.awt.EventQueue.invokeLater(() -> { inputDescription.requestFocusInWindow(); }); pressButton1.setTextHorizontalPosition(PressButton.POSITION_CENTER); pressButton2.setTextHorizontalPosition(PressButton.POSITION_CENTER); pressButton3.setTextHorizontalPosition(PressButton.POSITION_CENTER); pressButton4.setTextHorizontalPosition(PressButton.POSITION_CENTER); inputFieldCategoryDescription.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); inputFieldNumber1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); inputDescription.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); pressButton1.drawTextUnderline(true); pressButton2.drawTextUnderline(true); pressButton3.drawTextUnderline(true); itemCategories = new ArrayList<>(); units = new ArrayList<>(); try { try (CallableStatement call = DatabaseManager.instance.prepareCall("CALL shopmanager.select_category_all_leaf()"); ResultSet rs = call.executeQuery()) { while (rs.next()) { ItemCategory cat = new ItemCategory(); cat.setCategoryId(rs.getLong("categoryId")); cat.setCategoryParentId(rs.getLong("categoryParentId")); cat.setDescription(rs.getString("description")); itemCategories.add(cat); createNewCategoryUI(cat); } } try (CallableStatement call = DatabaseManager.instance.prepareCall("CALL shopmanager.select_unit_all()"); ResultSet rs = call.executeQuery()) { while (rs.next()) { Unit unit = new Unit(); unit.setUnitId(rs.getInt("unitId")); unit.setUnitName(rs.getString("unitName")); units.add(unit); } } } catch (SQLException ex) { Logger.getLogger(ItemEditor.class.getName()).log(Level.SEVERE, null, ex); } refreshCategoryList(); inputUnit1.setModel(new DefaultComboBoxModel(units.toArray())); inputUnit2.setModel(new DefaultComboBoxModel(units.toArray())); resetInputFields(); applyFilter(""); } private void applyFilter(String filter) { for (Map.Entry<Long, ExpandableCategoryList> entry : allCats.entrySet()) { ExpandableCategoryList categoryUI = entry.getValue(); categoryUI.clearData(); categoryUI.setVisible(false); } try { CallableStatement call = DatabaseManager.instance.prepareCall("CALL select_catalog(?)"); DatabaseManager.SetString(call, 1, filter.trim()); ResultSet rs = call.executeQuery(); while (rs.next()) { //out : itemid , `categoryId` , itemDesc , unit1 , ratio1 , unit2 , catDesc int paramIndex = 1; Item item = new Item(); item.setItemId(rs.getLong(paramIndex++)); item.setCategoryId(rs.getLong(paramIndex++)); item.setDescription(rs.getString(paramIndex++)); item.setUnit1(rs.getInt(paramIndex++)); item.setRatio1(rs.getBigDecimal(paramIndex++)); item.setUnit2(rs.getInt(paramIndex++)); ItemCategory category = new ItemCategory(); category.setDescription(rs.getString(paramIndex++)); category.setCategoryId(item.getCategoryId()); insertInUI(item, category); } rs.close(); call.close(); } catch (SQLException ex) { Logger.getLogger(ItemEditor.class.getName()).log(Level.SEVERE, null, ex); } java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { for (Map.Entry<Long, ExpandableCategoryList> entry : allCats.entrySet()) { ExpandableCategoryList categoryUI = entry.getValue(); categoryUI.setVisible(filter.trim().isEmpty() ? true : categoryUI.itemCount() != 0); } } }); } private void refreshCategoryList() { comboListCategory.setModel(new DefaultComboBoxModel(itemCategories.toArray())); } private ItemCategory findCategory(long catId) { for (ItemCategory itemCategory : itemCategories) { if (itemCategory.getCategoryId() == catId) { return itemCategory; } } return null; } private Unit findUnit(long unitId) { for (Unit unit : units) { if (unit.getUnitId() == unitId) { return unit; } } return null; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { splitGroup1 = new ui.container.SplitGroup(); groupPane1 = new ui.container.GroupPane(); groupPaneInput = new ui.container.GroupPane(); inputDescription = new ui.controls.input.InputField(); inputUnit1 = new ui.controls.ComboList(); inputRatio1 = new ui.controls.input.InputFieldNumber(); inputUnit2 = new ui.controls.ComboList(); comboListCategory = new ui.controls.ComboList(); inputFieldNumber1 = new ui.controls.input.InputFieldNumber(); pressButton1 = new ui.controls.PressButton(); pressButton2 = new ui.controls.PressButton(); pressButton3 = new ui.controls.PressButton(); groupPane4 = new ui.container.GroupPane(); scroll1 = new ui.container.Scroll(); groupPane6 = new ui.container.GroupPane(); groupPane2 = new ui.container.GroupPane(); inputFieldCategoryDescription = new ui.controls.input.InputField(); pressButton4 = new ui.controls.PressButton(); groupPane5 = new ui.container.GroupPane(); catalogPanel = new ui.container.GroupPane(); inputFieldFilter = new ui.controls.input.InputField(); setBackground(new java.awt.Color(255, 255, 255)); setMinimumSize(new java.awt.Dimension(650, 352)); setPreferredSize(new java.awt.Dimension(650, 352)); setLayout(new java.awt.CardLayout()); splitGroup1.setDividerLocation(300); groupPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); groupPaneInput.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "تعریف", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); inputDescription.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "شرح کالا", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); inputUnit1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "واحد بزرگتر", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); inputRatio1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "ضریب تبدیل", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); inputRatio1.setHorizontalAlignment(javax.swing.JTextField.RIGHT); inputUnit2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "واحد کوچتر", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); comboListCategory.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "دسته", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); inputFieldNumber1.setEditable(false); inputFieldNumber1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "شناسه کالا", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); inputFieldNumber1.setOpaque(false); javax.swing.GroupLayout groupPaneInputLayout = new javax.swing.GroupLayout(groupPaneInput); groupPaneInput.setLayout(groupPaneInputLayout); groupPaneInputLayout.setHorizontalGroup( groupPaneInputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(groupPaneInputLayout.createSequentialGroup() .addComponent(comboListCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(inputDescription, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, groupPaneInputLayout.createSequentialGroup() .addGap(0, 104, Short.MAX_VALUE) .addGroup(groupPaneInputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, groupPaneInputLayout.createSequentialGroup() .addComponent(inputUnit2, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(inputRatio1, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(inputUnit1, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(inputFieldNumber1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE))) ); groupPaneInputLayout.setVerticalGroup( groupPaneInputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(groupPaneInputLayout.createSequentialGroup() .addComponent(inputFieldNumber1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(groupPaneInputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(inputDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(comboListCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(groupPaneInputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(inputUnit1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(inputRatio1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(inputUnit2, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))) ); pressButton1.setText("ثبت کالا"); pressButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pressButton1ActionPerformed(evt); } }); pressButton2.setText("بازگردانی"); pressButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pressButton2ActionPerformed(evt); } }); pressButton3.setText("فرم جدید"); pressButton3.setActionCommand("asdas"); pressButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pressButton3ActionPerformed(evt); } }); javax.swing.GroupLayout groupPane1Layout = new javax.swing.GroupLayout(groupPane1); groupPane1.setLayout(groupPane1Layout); groupPane1Layout.setHorizontalGroup( groupPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(groupPane1Layout.createSequentialGroup() .addContainerGap() .addGroup(groupPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(groupPaneInput, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(groupPane1Layout.createSequentialGroup() .addGap(4, 4, 4) .addComponent(pressButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(pressButton2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pressButton3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); groupPane1Layout.setVerticalGroup( groupPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(groupPane1Layout.createSequentialGroup() .addContainerGap() .addComponent(groupPaneInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(12, 12, 12) .addGroup(groupPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(pressButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pressButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pressButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(213, Short.MAX_VALUE)) ); splitGroup1.setRightComponent(groupPane1); groupPane4.setBorder(javax.swing.BorderFactory.createEtchedBorder()); groupPane4.setPreferredSize(new java.awt.Dimension(200, 361)); groupPane4.setLayout(new java.awt.BorderLayout()); scroll1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scroll1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scroll1.setPreferredSize(new java.awt.Dimension(300, 100)); groupPane6.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5)); groupPane6.setLayout(new java.awt.BorderLayout()); groupPane2.setPreferredSize(new java.awt.Dimension(266, 40)); groupPane2.setLayout(new java.awt.BorderLayout()); inputFieldCategoryDescription.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "شرح", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); inputFieldCategoryDescription.setHorizontalAlignment(javax.swing.JTextField.RIGHT); inputFieldCategoryDescription.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { inputFieldCategoryDescriptionKeyPressed(evt); } }); groupPane2.add(inputFieldCategoryDescription, java.awt.BorderLayout.CENTER); pressButton4.setText("ثبت گروه جدید"); pressButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pressButton4ActionPerformed(evt); } }); groupPane2.add(pressButton4, java.awt.BorderLayout.EAST); groupPane6.add(groupPane2, java.awt.BorderLayout.NORTH); groupPane5.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 1, 1, 1)); groupPane5.setLayout(new java.awt.BorderLayout()); catalogPanel.setLayout(new javax.swing.BoxLayout(catalogPanel, javax.swing.BoxLayout.PAGE_AXIS)); groupPane5.add(catalogPanel, java.awt.BorderLayout.NORTH); groupPane6.add(groupPane5, java.awt.BorderLayout.CENTER); scroll1.setViewportView(groupPane6); groupPane4.add(scroll1, java.awt.BorderLayout.CENTER); inputFieldFilter.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "فیلتر", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); inputFieldFilter.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { inputFieldFilterKeyPressed(evt); } }); groupPane4.add(inputFieldFilter, java.awt.BorderLayout.PAGE_START); splitGroup1.setLeftComponent(groupPane4); add(splitGroup1, "card2"); }// </editor-fold>//GEN-END:initComponents private void pressButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pressButton1ActionPerformed saveItem(); }//GEN-LAST:event_pressButton1ActionPerformed private void pressButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pressButton2ActionPerformed resetInputFields(); }//GEN-LAST:event_pressButton2ActionPerformed private void pressButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pressButton3ActionPerformed setSelectedItem(null, null); }//GEN-LAST:event_pressButton3ActionPerformed private void pressButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pressButton4ActionPerformed insertNewCategory(); }//GEN-LAST:event_pressButton4ActionPerformed private void inputFieldCategoryDescriptionKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputFieldCategoryDescriptionKeyPressed if (evt.getKeyCode() == KeyEvent.VK_ENTER) { insertNewCategory(); } }//GEN-LAST:event_inputFieldCategoryDescriptionKeyPressed private void inputFieldFilterKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputFieldFilterKeyPressed if (evt.getKeyCode() == KeyEvent.VK_ENTER) { applyFilter(inputFieldFilter.getText()); } }//GEN-LAST:event_inputFieldFilterKeyPressed private boolean inputIsValid() { boolean isValid = true; StringBuilder errorLog = new StringBuilder(); if (inputDescription.getText().trim().isEmpty()) { errorLog.append("شرح کالا را وارد کنید. -").append(System.lineSeparator()); isValid = false; } if (comboListCategory.getSelectedItem() == null) { isValid = false; errorLog.append("گروه کالا را انتخاب کنید. -").append(System.lineSeparator()); } if (inputUnit1.getSelectedItem() == null) { isValid = false; errorLog.append("حداقل واحد شماره یک باید انتخاب شود. -").append(System.lineSeparator()); } if (inputUnit2.getSelectedItem() != null && inputRatio1.getText().isEmpty()) { isValid = false; errorLog.append("ورودی ضریب را پر کنید. -").append(System.lineSeparator()); } try { BigDecimal bigDecimal = new BigDecimal(inputRatio1.getText()); if (Calculator.isLessOrEqual(bigDecimal, BigDecimal.ZERO)) { isValid = false; errorLog.append("ضریب باید رقمی بزرگتر از صفر باشد. -").append(System.lineSeparator()); } if (inputUnit2.getSelectedItem() == null) { isValid = false; errorLog.append("ورودی واحد دوم را نیز پر کنید.").append(System.lineSeparator()); } } catch (Exception e) { if (inputUnit2.getSelectedItem() != null) { isValid = false; errorLog.append("ورودی ضریب نادرست است. -").append(System.lineSeparator()); } } if (isValid == false) { showError(errorLog.toString()); } return isValid; } private void saveItem() { if (item == null) { item = new Item(); } if (inputIsValid() == false) { return; } try { item.setCategoryId(((ItemCategory) comboListCategory.getSelectedItem()).getCategoryId()); item.setDescription(inputDescription.getText().trim()); item.setUnit1(((Unit) inputUnit1.getSelectedItem()).getUnitId()); if (inputUnit2.getSelectedItem() != null) { item.setRatio1(new BigDecimal(inputRatio1.getText())); } else { item.setRatio1(null); } if (inputUnit2.getSelectedItem() != null) { item.setUnit2(((Unit) inputUnit2.getSelectedItem()).getUnitId()); } else { item.setUnit2(0); } CallableStatement call = DatabaseManager.instance.prepareCall("CALL shopmanager.item_save(?,?,?,?,?,?)"); DatabaseManager.SetLong/* */(call, 1, item.getItemId()); DatabaseManager.SetLong/* */(call, 2, item.getCategoryId()); DatabaseManager.SetString/**/(call, 3, item.getDescription()); DatabaseManager.SetInt/* */(call, 4, item.getUnit1()); DatabaseManager.SetBigDecimal(call, 5, item.getRatio1()); DatabaseManager.SetInt/* */(call, 6, item.getUnit2()); call.execute(); if (item.getItemId() == 0) { ExpandableCategoryList ui = allCats.get(item.getCategoryId()); if (ui == null) { ui = createNewCategoryUI(findCategory(item.getCategoryId())); } ui.addItem(item); } else { allCats.get(item.getCategoryId()).refresh(); } setSelectedItem(null, null); } catch (Exception ex) { Logger.getLogger(ItemEditor.class.getName()).log(Level.SEVERE, null, ex); showError(ex.toString()); } } private void showError(String message) throws HeadlessException { JOptionPane.showMessageDialog(this, message, "خطا", JOptionPane.ERROR_MESSAGE); } private void resetInputFields() { if (item != null) { inputFieldNumber1.setText(item.getItemId() + ""); inputDescription.setText(item.getDescription()); comboListCategory.setSelectedItem(findCategory(item.getCategoryId())); inputUnit1.setSelectedItem(findUnit(item.getUnit1())); if (item.getRatio1() != null) { inputRatio1.setText(item.getRatio1().stripTrailingZeros().toPlainString()); } else { inputRatio1.setText(""); } inputUnit2.setSelectedItem(findUnit(item.getUnit2())); } else { inputFieldNumber1.setText(""); inputDescription.setText(""); // comboListCategory.setSelectedItem(null); inputUnit1.setSelectedItem(null); inputRatio1.setText(""); inputUnit2.setSelectedItem(null); } } // Variables declaration - do not modify//GEN-BEGIN:variables private ui.container.GroupPane catalogPanel; private ui.controls.ComboList comboListCategory; private ui.container.GroupPane groupPane1; private ui.container.GroupPane groupPane2; private ui.container.GroupPane groupPane4; private ui.container.GroupPane groupPane5; private ui.container.GroupPane groupPane6; private ui.container.GroupPane groupPaneInput; private ui.controls.input.InputField inputDescription; private ui.controls.input.InputField inputFieldCategoryDescription; private ui.controls.input.InputField inputFieldFilter; private ui.controls.input.InputFieldNumber inputFieldNumber1; private ui.controls.input.InputFieldNumber inputRatio1; private ui.controls.ComboList inputUnit1; private ui.controls.ComboList inputUnit2; private ui.controls.PressButton pressButton1; private ui.controls.PressButton pressButton2; private ui.controls.PressButton pressButton3; private ui.controls.PressButton pressButton4; private ui.container.Scroll scroll1; private ui.container.SplitGroup splitGroup1; // End of variables declaration//GEN-END:variables public static void open() { JDialog d = new JDialog(Application.instance, true); d.setTitle("مدیریت کالا و گروه ها"); d.getContentPane().setLayout(new CardLayout()); d.getContentPane().add(new ItemEditor()); d.setSize(900, 600); d.setLocationRelativeTo(null); d.setVisible(true); } private void setSelectedItem(ExpandableCategoryList categoryUI, Item selectedValue) { if (item != selectedValue) { item = selectedValue; resetInputFields(); } } private HashMap<Long, ExpandableCategoryList> allCats = new HashMap<>(); private void insertInUI(Item item, ItemCategory category) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { ExpandableCategoryList catUI = allCats.get(category.getCategoryId()); if (catUI == null) { catUI = createNewCategoryUI(category); } catUI.addItem(item); } }); } private ExpandableCategoryList createNewCategoryUI(ItemCategory category) { final ExpandableCategoryList lv_catUI = new ExpandableCategoryList(); lv_catUI.setCategory(category); lv_catUI.getjListItem().addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { setSelectedItem(lv_catUI, lv_catUI.getjListItem().getSelectedValue()); } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } }); lv_catUI.getjListItem().addListSelectionListener((ListSelectionEvent e) -> { if (e.getValueIsAdjusting() == false) { setSelectedItem(lv_catUI, lv_catUI.getjListItem().getSelectedValue()); } }); allCats.put(category.getCategoryId(), lv_catUI); catalogPanel.add(lv_catUI); catalogPanel.revalidate(); catalogPanel.repaint(); lv_catUI.setUpdateListener(() -> { findCategory(category.getCategoryId()).setDescription(lv_catUI.itemCategory.getDescription()); refreshCategoryList(); }); return lv_catUI; } private void insertNewCategory() { String description = inputFieldCategoryDescription.getText().trim(); if (description.isEmpty()) { showError("شرح گروه را وارد کنید."); return; } ItemCategory cat = new ItemCategory(); cat.setDescription(description); try { cat.save(); createNewCategoryUI(cat); itemCategories.add(cat); refreshCategoryList(); inputFieldCategoryDescription.setText(""); inputFieldCategoryDescription.requestFocusInWindow(); } catch (SQLException ex) { showError(ex.toString()); } } }
[ "mhamze1994@gmail.com" ]
mhamze1994@gmail.com
d3d821af7414fa58ecf03186800f5cc5e520ac78
7367aa79a531504b9589309153142ecbd89a51c6
/040920837_Assignment3_BansriShah/src/main/java/com/algonquincollege/cst8277/models/WorkPhone_.java
1fb1e7cdf71ae57bd9649d4c4433466182968033
[]
no_license
bansri22/EmployeeSystem-JPA
2ef765ae58cede3d2ec970f95f15f73e0bb70a70
698ce19ece60ae45523ad4c067d9ac8ae77f91e2
refs/heads/master
2022-04-15T17:22:14.964136
2020-04-09T02:00:19
2020-04-09T02:00:19
254,245,462
0
0
null
null
null
null
UTF-8
Java
false
false
415
java
package com.algonquincollege.cst8277.models; import javax.annotation.Generated; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; @Generated(value="Dali", date="2020-03-10T15:55:31.005-0400") @StaticMetamodel(WorkPhone.class) public class WorkPhone_ extends PhonePojo_ { public static volatile SingularAttribute<WorkPhone, String> DEPARTMENT; }
[ "bansr@192.168.0.24" ]
bansr@192.168.0.24
eab4963d0be224774caa3449e0683c6d610b0c2f
e2647f603f1e3a026e0a33e061eb5ec391555698
/src/com/theopentutorial/MyApplication.java
fa240eac21c2eebc1e405e17fc211734aadecee6
[]
no_license
shashishjha81/app
d2f6b1100c578be9ef7592064a970f7f3d81fe6d
4af075efa2b3cf7f48eafe1c80f8d4ac952c1ba9
refs/heads/master
2021-01-10T04:20:00.578217
2016-02-03T07:47:46
2016-02-03T07:47:46
50,514,072
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package com.theopentutorial; import com.theopentutorial.expandablelist.MainActivity; import android.app.Application; public class MyApplication extends Application { public MyApplication() { super(); fixClassLoaderIssue(); } private static void fixClassLoaderIssue() { ClassLoader myClassLoader = MainActivity.class.getClassLoader(); Thread.currentThread().setContextClassLoader(myClassLoader); } }
[ "shashishjha81@gmail.com" ]
shashishjha81@gmail.com
7ee1e467b51698fa5c29508381187b29918af762
b8f58e4c10a2a7f75aa3990bbaa67be70fb002e2
/xs2a-impl/src/main/java/de/adorsys/psd2/xs2a/service/mapper/psd2/piis/PIIS400ErrorMapper.java
92f39b3b140161581c260726c77db9e6b3994229
[ "Apache-2.0" ]
permissive
Kerusak/xs2a
1e854825e1e281349ef8d7827709353ec948b7eb
f793be3c08b8a883971398289ad50ee314c34e9f
refs/heads/develop
2020-04-22T21:23:42.139479
2019-04-08T11:56:08
2019-04-08T11:56:08
170,672,358
0
0
NOASSERTION
2019-04-08T11:48:23
2019-02-14T10:22:47
Java
UTF-8
Java
false
false
2,303
java
/* * Copyright 2018-2019 adorsys GmbH & Co KG * * 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 de.adorsys.psd2.xs2a.service.mapper.psd2.piis; import de.adorsys.psd2.model.Error400NGPIIS; import de.adorsys.psd2.model.MessageCode400PIIS; import de.adorsys.psd2.model.TppMessage400PIIS; import de.adorsys.psd2.model.TppMessageCategory; import de.adorsys.psd2.xs2a.domain.TppMessageInformation; import de.adorsys.psd2.xs2a.exception.MessageError; import de.adorsys.psd2.xs2a.service.mapper.psd2.Psd2ErrorMapper; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import java.util.List; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; @Component public class PIIS400ErrorMapper extends Psd2ErrorMapper<MessageError, Error400NGPIIS> { @Override public Function<MessageError, Error400NGPIIS> getMapper() { return this::mapToPsd2Error; } @Override public HttpStatus getErrorStatus() { return HttpStatus.BAD_REQUEST; } private Error400NGPIIS mapToPsd2Error(MessageError messageError) { return new Error400NGPIIS().tppMessages(mapToTppMessage400PIIS(messageError.getTppMessages())); } private List<TppMessage400PIIS> mapToTppMessage400PIIS(Set<TppMessageInformation> tppMessages) { return tppMessages.stream() .map(m -> new TppMessage400PIIS() .category(TppMessageCategory.fromValue(m.getCategory().name())) .code(MessageCode400PIIS.fromValue(m.getMessageErrorCode().getName())) .path(m.getPath()) .text(getErrorText(m)) ).collect(Collectors.toList()); } }
[ "rye@adorsys.com.ua" ]
rye@adorsys.com.ua
d3ccd9e918b4b1c15ccecd3e032f365dee40cf3c
d2a0a443eb8074c5b69609c820a3f450557a1331
/jspex/jsp를 이용한 학원관리시스템/src/roti/lms/ad_login/.svn/text-base/AdminDao.java.svn-base
3defce74d8be1c4bd8448d7952a804ba217aa673
[]
no_license
ijuju88/schoolIT
bc2bad77652f97586290a12dc8bd2e8b549fa6f4
0f2a8fd26ce80785ae99c91aad6d966cc9e6dbca
refs/heads/master
2021-01-12T05:08:51.619654
2017-01-03T01:20:33
2017-01-03T01:20:33
77,870,130
0
0
null
null
null
null
UTF-8
Java
false
false
1,704
package roti.lms.ad_login; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.naming.Context; import javax.naming.InitialContext; import javax.sql.DataSource; public class AdminDao { private static AdminDao instance = new AdminDao(); public static AdminDao getInstance() { return instance; } public AdminDao() { // TODO Auto-generated constructor stub } private Connection getConnection() throws Exception { Context init = new InitialContext(); DataSource ds = (DataSource) init.lookup("java:comp/env/jdbc/OracleDB"); return ds.getConnection(); } public int userCheck(String tch_no, String tch_pass) throws Exception { Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; String sql = ""; String dbpass = ""; int x = -1; try { conn = getConnection(); sql = "select tch_pass from teacher where tch_no =?"; pstmt = conn.prepareStatement(sql); pstmt.setString(1, tch_no); rs = pstmt.executeQuery(); if (rs.next()) { dbpass = rs.getString("tch_pass"); if (dbpass.equals(tch_pass)) { x = 1; } else { x = 0; } } } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } finally { execClose(rs, pstmt, conn); } return x; } public void execClose(ResultSet rs, PreparedStatement pstmt, Connection conn) throws Exception { if (rs != null) try { rs.close(); } catch (SQLException sqle) { } if (pstmt != null) try { pstmt.close(); } catch (SQLException sqle) { } if (conn != null) try { conn.close(); } catch (SQLException sqle) { } } }
[ "ijuju88@naver.com" ]
ijuju88@naver.com
4e8c84b14698741e078937dfd26f49f8d45e70ce
87be1004d70d450a38b5c58d9fb602dc1aa1a054
/src/main/java/com/micro/msb/beans/MsbVersionDeleteBean.java
7cdeaf2bf3788630a59d102a1ee36a167d99e3b9
[ "MIT" ]
permissive
koma-network/koma-msb
40aec20ca5b4331d4cb3ff356a1a51d1350a44cd
05c57354e2fe4ebeb8d6089bb07e396f3742c773
refs/heads/master
2022-11-25T14:19:56.176879
2020-08-02T14:31:28
2020-08-02T14:31:28
283,423,661
0
0
null
2020-07-29T12:39:30
2020-07-29T06:58:48
Java
UTF-8
Java
false
false
768
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.micro.msb.beans; /* * * @author Yan Yan Purdiansah */ public class MsbVersionDeleteBean { private Integer rowid; private String name; private Integer version; public Integer getRowid(){ return rowid; } public void setRowid(Integer rowid){ this.rowid = rowid; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public Integer getVersion() { return this.version; } public void setVersion(Integer version) { this.version = version; } }
[ "yypurdi@gmail.com" ]
yypurdi@gmail.com
3337610c44b47b62a0a562df0f10bfa8c360b0fd
97df85984ed9044634c0a14b26e43e7db22e9dd0
/Polymorphism/src/com/company/TheSimpsons.java
c42a0c291d91118644b5d7c8856e3ecd5f5b437f
[]
no_license
nexillion/java-programming-masterclass
a793fb59a91e82ac4312f52a5c9e536fe7effda9
7e14e71397491a6d16fe86b60419b6fdb176c678
refs/heads/master
2023-04-24T06:34:51.977444
2021-05-10T12:27:21
2021-05-10T12:27:21
280,871,061
0
1
null
2020-10-07T07:54:00
2020-07-19T13:27:06
Java
UTF-8
Java
false
false
252
java
package com.company; public class TheSimpsons extends Movie { public TheSimpsons() { super("The Simpsons"); } @Override public String plot() { return "American families life in a weird fictional town"; } }
[ "nikolay.n.serafimov@gmail.com" ]
nikolay.n.serafimov@gmail.com
b8793eb731349f413c6cce2ed00f54daacbfe77f
4fef5e0be2c6cbd2a049728de008c9dbeae292c9
/src/main/java/com/insannity/dscatalog/config/WebSecurityConfig.java
3781dfc4674272a3bf28f0de85b318b4f862d90a
[]
no_license
insanniity/ds-catalog-backend-v2
f29234e12288118bfa2cbb8ef28abf1478aead65
6dcce344c3a2ee5841e9e895b528463164731019
refs/heads/main
2023-08-05T18:23:17.144297
2021-10-02T02:10:29
2021-10-02T02:10:29
389,557,027
0
0
null
null
null
null
UTF-8
Java
false
false
1,540
java
package com.insannity.dscatalog.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private BCryptPasswordEncoder passwordEncoder; @Autowired private UserDetailsService userDetailsService; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder); } @Override public void configure(WebSecurity web) throws Exception { web.ignoring().antMatchers("/actuator/**"); } @Override @Bean protected AuthenticationManager authenticationManager() throws Exception { return super.authenticationManager(); } }
[ "32269793+insanniity@users.noreply.github.com" ]
32269793+insanniity@users.noreply.github.com
9497b9b3994475b39e4d653bc967fc47df96f47c
83f02d253c4a23444ce5c10193ad4fbc0bedf62e
/src/java/com/lawyershub/Dao/AdminDashboardDao.java
7c478cb4521b968631004c15e4e936a0deaf7ce2
[]
no_license
akhilbabu868/Lawyers_Hub
c1ee3a98c34aa3868bd3a270de00a9a8032f180c
b531ca34e5841d2fd7720902e8ebe4a711993870
refs/heads/main
2023-04-02T16:33:55.630267
2021-04-07T08:13:57
2021-04-07T08:13:57
355,442,894
0
0
null
null
null
null
UTF-8
Java
false
false
1,973
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.lawyershub.Dao; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import org.hibernate.Hibernate; import org.hibernate.SQLQuery; import org.hibernate.SessionFactory; import org.hibernate.transform.Transformers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; /** * * @author ASUS */ @Repository @Transactional public class AdminDashboardDao { @Autowired public SessionFactory sessionFactory; public List getAllUserRegistrationReport() throws ParseException { SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); SQLQuery qry = sessionFactory .getCurrentSession() .createSQLQuery("SELECT createddate, COUNT(*) as usercount FROM userregistration GROUP BY CAST(createddate AS DATE ) ORDER BY 2 ") .addScalar("createddate", Hibernate.STRING) .addScalar("usercount", Hibernate.STRING); qry.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP); return qry.list(); } public List getAllLawyerRegistrationReport() throws ParseException { SQLQuery qry = sessionFactory .getCurrentSession() .createSQLQuery("SELECT createddate, COUNT(*) as lawyercount FROM lawyerregistration GROUP BY createddate ORDER BY 2 ") .addScalar("createddate", Hibernate.STRING) .addScalar("lawyercount", Hibernate.STRING); qry.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP); return qry.list(); } }
[ "you@example.com" ]
you@example.com
c17d705af36d33818c92fdcc34a07ba8d8d69a59
c69b09fe89c06e1d83ae8c1d87a46678288d0eda
/_test/src/main/java/webapp/demo6_aop/Rockservice1.java
4b3c6cbbbe1d62fd7ef1b50f9d12d2f79662b166
[ "Apache-2.0" ]
permissive
dongatsh/solon
fb9d3da2ce67746dd8cfe1fef288e2de1bc3d1a2
4c3a074e8e4db7f367f75603ea8347d2c501c69d
refs/heads/master
2023-08-28T18:16:44.023899
2021-10-31T16:21:03
2021-10-31T16:21:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
267
java
package webapp.demo6_aop; import org.noear.solon.annotation.Bean; import org.noear.solon.annotation.Component; @Component("rs1") public class Rockservice1 implements Rockapi { @Override public String test() { return "我是:Rockservice1"; } }
[ "noear@live.cn" ]
noear@live.cn
14805971af42a8b1dab704eaf9f6b7645500e90d
64e5ccf2ac9f296b805efe234b4d3823c1fdc241
/src/main/java/com/github/sergiofgonzalez/cryptools/utils/InitializationVectorGenerator.java
1720c824806ed7dde6e2ab13226f9aae9ab4797c
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
sergiofgonzalez/cryptools
9cf5c99ff25cbb9676d89a8123da513621f30f28
ec5885984312a9fc2c1aefa53bd9f6cc3ee4d867
refs/heads/master
2021-05-16T17:43:31.465519
2017-09-24T15:22:17
2017-09-24T15:22:17
102,646,253
0
0
null
null
null
null
UTF-8
Java
false
false
1,249
java
package com.github.sergiofgonzalez.cryptools.utils; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Base64; import javax.crypto.Cipher; import javax.crypto.NoSuchPaddingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Supports the generation of an Initialization Vector using a SecureRandom. * * @author sergio.f.gonzalez * */ public class InitializationVectorGenerator { private static final Logger LOGGER = LoggerFactory.getLogger(InitializationVectorGenerator.class); public static String getInitializationVector(String algorithm) { byte[] ivBytes = getRawBytesIv(algorithm); String ivString = Base64.getEncoder().encodeToString(ivBytes); return ivString; } private static byte[] getRawBytesIv(String algorithm) { SecureRandom random = new SecureRandom(); byte[] iv; try { iv = new byte[Cipher.getInstance(algorithm).getBlockSize()]; random.nextBytes(iv); return iv; } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { LOGGER.error("Could not generate a valid initialization vector for algorithm {}", algorithm); throw new IllegalArgumentException("Could not generate initialization vector", e); } } }
[ "sergio.f.gonzalez@gmail.com" ]
sergio.f.gonzalez@gmail.com
619cd88df211142450fc7897695780e8ef24a790
7627cb8e71eb3dedb5dc9083cf53bd11375a2049
/super-mag/src/com/bri8/supermag/model/BaseModel.java
f4037a0ec697df947e28221abe0328e505c087a4
[]
no_license
mountainrock/java-super-projects
1f374acf7b5d255b405c4a31591716629d58426e
247e99c493b8b61487f9a065add57cf51456d4e8
refs/heads/master
2021-01-23T06:45:07.359728
2015-08-27T07:18:56
2015-08-27T07:18:56
32,129,614
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
package com.bri8.supermag.model; import java.io.Serializable; import org.apache.commons.lang.builder.ToStringBuilder; public class BaseModel implements Serializable{ @Override public String toString() { return ToStringBuilder.reflectionToString(this); } }
[ "sandeep.maloth@gmail.com@768fc377-1c2c-ca98-b545-07018d626cd3" ]
sandeep.maloth@gmail.com@768fc377-1c2c-ca98-b545-07018d626cd3
7527f1dae498f349fb3732aa341618d95bc26196
3cd63aba77b753d85414b29279a77c0bc251cea9
/main/plugins/org.talend.designer.components.libs/libs_src/talend-mscrm/src/main/java/com/microsoft/schemas/crm/_2011/contracts/impl/ArrayOfComponentDetailImpl.java
fd6851f7d6f17a148a43ee1885c8731999f41962
[ "Apache-2.0" ]
permissive
195858/tdi-studio-se
249bcebb9700c6bbc8905ccef73032942827390d
4fdb5cfb3aeee621eacfaef17882d92d65db42c3
refs/heads/master
2021-04-06T08:56:14.666143
2018-10-01T14:11:28
2018-10-01T14:11:28
124,540,962
1
0
null
2018-10-01T14:11:29
2018-03-09T12:59:25
Java
UTF-8
Java
false
false
6,199
java
/* * XML Type: ArrayOfComponentDetail * Namespace: http://schemas.microsoft.com/crm/2011/Contracts * Java type: com.microsoft.schemas.crm._2011.contracts.ArrayOfComponentDetail * * Automatically generated - do not modify. */ package com.microsoft.schemas.crm._2011.contracts.impl; /** * An XML ArrayOfComponentDetail(@http://schemas.microsoft.com/crm/2011/Contracts). * * This is a complex type. */ public class ArrayOfComponentDetailImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.microsoft.schemas.crm._2011.contracts.ArrayOfComponentDetail { private static final long serialVersionUID = 1L; public ArrayOfComponentDetailImpl(org.apache.xmlbeans.SchemaType sType) { super(sType); } private static final javax.xml.namespace.QName COMPONENTDETAIL$0 = new javax.xml.namespace.QName("http://schemas.microsoft.com/crm/2011/Contracts", "ComponentDetail"); /** * Gets array of all "ComponentDetail" elements */ public com.microsoft.schemas.crm._2011.contracts.ComponentDetail[] getComponentDetailArray() { synchronized (monitor()) { check_orphaned(); java.util.List targetList = new java.util.ArrayList(); get_store().find_all_element_users(COMPONENTDETAIL$0, targetList); com.microsoft.schemas.crm._2011.contracts.ComponentDetail[] result = new com.microsoft.schemas.crm._2011.contracts.ComponentDetail[targetList.size()]; targetList.toArray(result); return result; } } /** * Gets ith "ComponentDetail" element */ public com.microsoft.schemas.crm._2011.contracts.ComponentDetail getComponentDetailArray(int i) { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.crm._2011.contracts.ComponentDetail target = null; target = (com.microsoft.schemas.crm._2011.contracts.ComponentDetail)get_store().find_element_user(COMPONENTDETAIL$0, i); if (target == null) { throw new IndexOutOfBoundsException(); } return target; } } /** * Tests for nil ith "ComponentDetail" element */ public boolean isNilComponentDetailArray(int i) { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.crm._2011.contracts.ComponentDetail target = null; target = (com.microsoft.schemas.crm._2011.contracts.ComponentDetail)get_store().find_element_user(COMPONENTDETAIL$0, i); if (target == null) { throw new IndexOutOfBoundsException(); } return target.isNil(); } } /** * Returns number of "ComponentDetail" element */ public int sizeOfComponentDetailArray() { synchronized (monitor()) { check_orphaned(); return get_store().count_elements(COMPONENTDETAIL$0); } } /** * Sets array of all "ComponentDetail" element WARNING: This method is not atomicaly synchronized. */ public void setComponentDetailArray(com.microsoft.schemas.crm._2011.contracts.ComponentDetail[] componentDetailArray) { check_orphaned(); arraySetterHelper(componentDetailArray, COMPONENTDETAIL$0); } /** * Sets ith "ComponentDetail" element */ public void setComponentDetailArray(int i, com.microsoft.schemas.crm._2011.contracts.ComponentDetail componentDetail) { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.crm._2011.contracts.ComponentDetail target = null; target = (com.microsoft.schemas.crm._2011.contracts.ComponentDetail)get_store().find_element_user(COMPONENTDETAIL$0, i); if (target == null) { throw new IndexOutOfBoundsException(); } target.set(componentDetail); } } /** * Nils the ith "ComponentDetail" element */ public void setNilComponentDetailArray(int i) { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.crm._2011.contracts.ComponentDetail target = null; target = (com.microsoft.schemas.crm._2011.contracts.ComponentDetail)get_store().find_element_user(COMPONENTDETAIL$0, i); if (target == null) { throw new IndexOutOfBoundsException(); } target.setNil(); } } /** * Inserts and returns a new empty value (as xml) as the ith "ComponentDetail" element */ public com.microsoft.schemas.crm._2011.contracts.ComponentDetail insertNewComponentDetail(int i) { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.crm._2011.contracts.ComponentDetail target = null; target = (com.microsoft.schemas.crm._2011.contracts.ComponentDetail)get_store().insert_element_user(COMPONENTDETAIL$0, i); return target; } } /** * Appends and returns a new empty value (as xml) as the last "ComponentDetail" element */ public com.microsoft.schemas.crm._2011.contracts.ComponentDetail addNewComponentDetail() { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.crm._2011.contracts.ComponentDetail target = null; target = (com.microsoft.schemas.crm._2011.contracts.ComponentDetail)get_store().add_element_user(COMPONENTDETAIL$0); return target; } } /** * Removes the ith "ComponentDetail" element */ public void removeComponentDetail(int i) { synchronized (monitor()) { check_orphaned(); get_store().remove_element(COMPONENTDETAIL$0, i); } } }
[ "dmytro.chmyga@synapse.com" ]
dmytro.chmyga@synapse.com
2c83384b8e9e49f547800085706dbe989357c75c
6024fc9dbd51b273b6a6eeb2d7db3f8cc10fe0fb
/DoctorsOnDemandDevelopmentGradle/DoctorsOnDemandDevelopment/app/src/main/java/com/globussoft/readydoctors/patient/activity/SplashScreen.java
3d47739756f55b71b281ca4004e11ed1dd030614
[]
no_license
devbose07/Doctors-on-Demand_Android
8b829378304a2f4604df37be66d8db415ee18d88
a296c6531f8408d91455d8567c86d35873287955
refs/heads/master
2021-01-21T16:27:53.324388
2016-02-29T11:58:50
2016-02-29T11:58:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,939
java
package com.globussoft.readydoctors.patient.activity; import java.util.TimeZone; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import com.globussoft.readydoctors.patient.R; import com.globussoft.readydoctors.patient.Utills.AppData; import com.globussoft.readydoctors.patient.Utills.Singleton; import com.globussoft.readydoctors.patient.video_chat.Consts; public class SplashScreen extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String timezoneID = TimeZone.getDefault().getID(); System.out.println("@@@@@@@@@@@" + timezoneID); SharedPreferences preferences=getSharedPreferences("dod_login_status", Context.MODE_PRIVATE); AppData.loginStatus = preferences.getBoolean("loginStatus", false); if(AppData.loginStatus) { System.out.println("logged in already"); getSavedLoginInstance(preferences); Intent intent = new Intent(getApplicationContext(), Home.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); finish(); } else { Intent intent = new Intent(getApplicationContext(), LandingScreen.class); startActivity(intent); finish(); System.out.println("have to login"); } } public void getSavedLoginInstance(SharedPreferences preferences) { Singleton.PatientID = preferences.getString("PatientID", null); Singleton.Name = preferences.getString("Name", null); Singleton.Email = preferences.getString("Email", null); Singleton.TimeZone = preferences.getString("TimeZone", null); Singleton.Dateofbirth = preferences.getString("Dateofbirth", null); Singleton.ActivationKey = preferences.getString("ActivationKey", null); Singleton.Status = preferences.getString("Status", null); Singleton.Updated_at = preferences.getString("Updated_at", null); Singleton.Created_at = preferences.getString("Created_at", null); Singleton.Role = preferences.getString("Role", null); Singleton.RegistrationDate = preferences.getString("RegistrationDate", null); Singleton.PromoCode = preferences.getString("PromoCode", null); Singleton.UsedCoupons = preferences.getString("UsedCoupons", null); Singleton.Credit = preferences.getString("Credit", null); Singleton.FreeMinutes = preferences.getString("FreeMinutes", null); Singleton.Currency = preferences.getString("Currency", null); Singleton.Info = preferences.getString("Info", null); System.out.println("===============login instance=============="); System.out.println("Singleton.PatientID -" + Singleton.PatientID); System.out.println("Singleton.Name -" + Singleton.Name); System.out.println("Singleton.Email -" + Singleton.Email); System.out.println("Singleton.TimeZone -" + Singleton.TimeZone); System.out.println("Singleton.Dateofbirth -" + Singleton.Dateofbirth); System.out.println("Singleton.ActivationKey -" + Singleton.ActivationKey); System.out.println("Singleton.Status -" + Singleton.Status); System.out.println("Singleton.Updated_at -" + Singleton.Updated_at); System.out.println("Singleton.Created_at -" + Singleton.Created_at); System.out.println("Singleton.Role -" + Singleton.Role); System.out.println("Singleton.RegistrationDate -" + Singleton.RegistrationDate); System.out.println("Singleton.PromoCode -" + Singleton.PromoCode); System.out.println("Singleton.UsedCoupons -" + Singleton.UsedCoupons); System.out.println("Singleton.Credit -" + Singleton.Credit); System.out.println("Singleton.FreeMinutes -" + Singleton.FreeMinutes); System.out.println("Singleton.Currency -" + Singleton.Currency); System.out.println("Singleton.Info -" + Singleton.Info); System.out.println("===============login instance=============="); //assign email with qb user id Consts.qb_loginID=Singleton.Email; } }
[ "raghavendrab@globussoft.com" ]
raghavendrab@globussoft.com
d595a0782b16c208118dc43ee7fdd95ff8faf6a6
273435d8e38675c3c6c2717eb7b75d716207eda2
/TAREAS/T015-[TIJ] EJEMPLOS DE OPERADORES PP. 63-91/src/RoundingNumbers.java
e8c049cb37ff75a52cf026bb4b4160ddb9590417
[]
no_license
97jorx/java-practicas
e8e725a45e3097c789762085451ae86440b05ea3
ff1496e8e525d25aa1a62401deef43ef3aafefa5
refs/heads/master
2021-01-02T21:33:55.750923
2020-02-11T16:45:59
2020-02-11T16:45:59
239,810,413
0
0
null
null
null
null
UTF-8
Java
false
false
567
java
//: operators/RoundingNumbers.java // Rounding floats and doubles. //import static net.mindview.util.Print.*; public class RoundingNumbers { public static void main(String[] args) { double above = 0.7, below = 0.4; float fabove = 0.7f, fbelow = 0.4f; System.out.println("Math.round(above): " + Math.round(above)); System.out.println("Math.round(below): " + Math.round(below)); System.out.println("Math.round(fabove): " + Math.round(fabove)); System.out.println("Math.round(fbelow): " + Math.round(fbelow)); } }
[ "jorge.cadena@iesdonana.org" ]
jorge.cadena@iesdonana.org
ad795dc54a108907725007c56523fa052b34f062
7697d1743976dfd5bd26fbcbbd7aecd12d6ea169
/app/src/androidTest/java/nz/ac/aut/dms/lab7_messageapp/ExampleInstrumentedTest.java
939f7fb2a883c9f62536a86d3df3c0d39e95f526
[]
no_license
ReganxZheng/Android_Message
75aa9be594398d7ea65a230f82fb3c92db2b7247
cc157f6cc97836ce97e4b852ee1f2bcc8235b095
refs/heads/master
2020-05-24T22:04:02.311561
2019-05-19T14:54:13
2019-05-19T14:54:13
187,490,404
1
0
null
null
null
null
UTF-8
Java
false
false
742
java
package nz.ac.aut.dms.lab7_messageapp; 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("nz.ac.aut.dms.lab7_messageapp", appContext.getPackageName()); } }
[ "frankiexzjwh@gmail.com" ]
frankiexzjwh@gmail.com
d481e0a37c4bd50a2565c4834c1a8e9953395af5
e51de484e96efdf743a742de1e91bce67f555f99
/Android/triviacrack_src/src/com/etermax/tools/widget/pulltorefresh/g.java
4304fe6bde1a889c8c99f41b13a90988ffd1251b
[]
no_license
adumbgreen/TriviaCrap
b21e220e875f417c9939f192f763b1dcbb716c69
beed6340ec5a1611caeff86918f107ed6807d751
refs/heads/master
2021-03-27T19:24:22.401241
2015-07-12T01:28:39
2015-07-12T01:28:39
28,071,899
0
0
null
null
null
null
UTF-8
Java
false
false
1,645
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.etermax.tools.widget.pulltorefresh; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.widget.ListView; // Referenced classes of package com.etermax.tools.widget.pulltorefresh: // a, PullToRefreshListView class g extends ListView implements a { final PullToRefreshListView a; public g(PullToRefreshListView pulltorefreshlistview, Context context, AttributeSet attributeset) { a = pulltorefreshlistview; super(context, attributeset); } public void a(View view) { super.setEmptyView(view); } public android.view.ContextMenu.ContextMenuInfo getContextMenuInfo() { return super.getContextMenuInfo(); } public boolean onTouchEvent(MotionEvent motionevent) { boolean flag = a.b(motionevent); if (!a.b && flag) { a.b = true; a.a = motionevent.getY(); } if (a.b) { for (int i = 0; i < getChildCount(); i++) { getChildAt(i).setPressed(false); } PullToRefreshListView.a(a).requestFocusFromTouch(); if (a.a(motionevent)) { return false; } } return super.onTouchEvent(motionevent); } public void setEmptyView(View view) { a.setEmptyView(view); } }
[ "klayderpus@chimble.net" ]
klayderpus@chimble.net
5eae92ca3c78d9dd3aefb69356af11df1be0a7ef
690b45ba41e88109e1071c682ead7240cdbe6b30
/src/jimm/forms/SmsForm.java
f49fd8bdae5cf078e802e86bf01ec94629b8eb90
[]
no_license
kryukov/jimm-fork-lite
03fad978f56f164bfd006d5fcda4de8babe483f2
41733cf7c8e37452a6c2d0b04ac9867655a105aa
refs/heads/master
2016-09-10T19:35:18.911002
2011-01-10T21:00:49
2011-01-10T21:00:49
32,337,379
0
0
null
null
null
null
UTF-8
Java
false
false
5,467
java
/* * SmsForm.java * * Created on 12 Август 2008 г., 14:41 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jimm.forms; import javax.microedition.io.*; import javax.microedition.lcdui.*; // #sijapp cond.if target is "MIDP2" | target is "SIEMENS2" # import javax.wireless.messaging.*; // #sijapp cond.end # import jimm.comm.Util; import jimm.modules.*; import jimm.ui.FormEx; import jimm.util.ResourceBundle; import protocol.Protocol; /** * * @author Vladimir Kryukov */ public class SmsForm implements CommandListener { /** Creates a new instance of SmsForm */ public SmsForm(Protocol protocol, String phones) { this.phones = phones; this.protocol = protocol; } private String phones; private Protocol protocol; private FormEx form; private static final int PHONE = 0; private static final int TEXT = 1; private static final int MODE = 2; private static final int MAX_SMS_LENGTH = 156; private static final int MODE_PHONE = 0; private static final int MODE_MRIM = 1; private static final int MODE_NONE = 2; private static final String modes = "phone" + "|" + "mail.ru"; private int defaultMode = MODE_NONE; public void show() { form = new FormEx("send_sms", "send", "cancel", this); if (null == phones) { form.addTextField(PHONE, "phone", "", 20, TextField.PHONENUMBER); } else { form.addSelector(PHONE, "phone", phones.replace(',', '|'), 0); } int choiseCount = 0; defaultMode = MODE_NONE; // #sijapp cond.if target is "MIDP2" | target is "SIEMENS2" | target is "SIEMENS1" # defaultMode = MODE_PHONE; choiseCount++; // #sijapp cond.end # // #sijapp cond.if protocols_MRIM is "true" # if ((protocol instanceof Mrim) && protocol.isConnected()) { defaultMode = MODE_MRIM; choiseCount++; } // #sijapp cond.end # // #sijapp cond.if modules_DEBUGLOG is "true" # if (MODE_NONE == defaultMode) { DebugLog.panic("unknown default mode for SMS"); return; } // #sijapp cond.end# if (1 < choiseCount) { form.addSelector(MODE, "send_via", modes, defaultMode); } else { form.addString("send_via", ResourceBundle.getString(Util.explode(modes, '|')[defaultMode])); } form.addTextField(TEXT, "message", "", MAX_SMS_LENGTH, TextField.ANY); form.show(); } public static final boolean isSupported() { // #sijapp cond.if target is "SIEMENS1" # return true; // #sijapp cond.elseif target is "MIDP2"| target is "SIEMENS2" # // #sijapp cond.if modules_FILES="true"# return true; // #sijapp cond.elseif protocols_MRIM is "true" # Protocol protocol = jimm.cl.ContactList.getInstance().getProtocol(); return (protocol instanceof Mrim) && protocol.isConnected(); // #sijapp cond.else # return false; // #sijapp cond.end# // #sijapp cond.elseif protocols_MRIM is "true" # Protocol protocol = jimm.cl.ContactList.getInstance().getProtocol(); return (protocol instanceof Mrim) && protocol.isConnected(); // #sijapp cond.else # return false; // #sijapp cond.end # } // #sijapp cond.if target is "MIDP2" | target is "SIEMENS2" | target is "SIEMENS1" # private final void sendSms(String phone, String text) { // #sijapp cond.if target is "SIEMENS1" # try { com.siemens.mp.gsm.SMS.send(phone, text); } catch (Exception e) { } // #sijapp cond.end # // #sijapp cond.if target is "MIDP2" | target is "SIEMENS2" # // #sijapp cond.if modules_FILES="true"# try { final MessageConnection conn = (MessageConnection)Connector.open("sms://" + phone + ":5151"); final TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE); msg.setPayloadText(text); conn.send(msg); } catch (Exception e) { } // #sijapp cond.end # // #sijapp cond.end # } // #sijapp cond.end # public void commandAction(Command command, Displayable displayable) { if (form.saveCommand == command) { final String text = form.getTextFieldValue(TEXT); final String phone = (null == phones) ? form.getTextFieldValue(PHONE) : form.getSelectorString(PHONE); if ((text.length() > 0) && (phone.length() > 0)) { int mode = form.hasControl(MODE) ? form.getSelectorValue(MODE) : defaultMode; switch (mode) { // #sijapp cond.if target is "MIDP2" | target is "SIEMENS2" | target is "SIEMENS1" # case MODE_PHONE: sendSms(phone, text); break; // #sijapp cond.end # // #sijapp cond.if protocols_MRIM is "true" # case MODE_MRIM: ((Mrim)protocol).sendSms(phone, text); break; // #sijapp cond.end # } } } form.back(); } }
[ "krujkov@144d81a7-44e7-f1b3-1f35-f3803efee81f" ]
krujkov@144d81a7-44e7-f1b3-1f35-f3803efee81f
87c30962cde0b2958c14457874a0f956d1824f32
771b42e65e2521981710e815ff1c92562503c489
/src/main/java/de/nrw/dipp/dippCore/repository/metadata/rdf/vocabulary/FedoraCMA.java
9c5e48dd995a545cd18de437ee847ef30901e3bf
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
dipp/DiPPJavaCore
5cfd06445208707a0b634621e07a28e2441d3a26
3e39618042f1aefff2c5e26a54ee8ae61855bbcc
refs/heads/master
2023-04-26T23:42:32.840916
2014-03-16T15:30:56
2014-03-16T15:30:56
368,944,441
0
0
null
null
null
null
UTF-8
Java
false
false
2,417
java
/** * FedoraCMA.java - This file is part of the DiPP Project by hbz * Library Service Center North Rhine Westfalia, Cologne * * ----------------------------------------------------------------------------- * * <p><b>License and Copyright: </b>The contents of this file are subject to the * D-FSL License Version 1.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License * at <a href="http://www.dipp.nrw.de/dfsl/">http://www.dipp.nrw.de/dfsl/.</a></p> * * <p>Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License.</p> * * <p>Portions created for the Fedora Repository System are Copyright &copy; 2002-2005 * by The Rector and Visitors of the University of Virginia and Cornell * University. All rights reserved."</p> * * ----------------------------------------------------------------------------- * */ package de.nrw.dipp.dippCore.repository.metadata.rdf.vocabulary; import org.apache.log4j.Logger; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Resource; import com.hp.hpl.jena.rdf.model.Property; /** * Class FedoraCMA * * <p><em>Title: Jena RDF Model for fedora ContentModel Architecture</em></p> * <p>Description: This class provides a Jena Model with all required Properties for the generation * of Fedora Content Model related RDF-Triples within RELS-EXT. Required since Fedora Version 3</p> * * @author Andres Quast, quast@hbz-nrw.de * creation date: 02.04.2009 * */ public class FedoraCMA { // Initiate Logger for FedoraCMA private static Logger log = Logger.getLogger(FedoraCMA.class); private static Model mModel = ModelFactory.createDefaultModel(); private static final String NS = "info:fedora/fedora-system:def/model#"; public static String getURI(){return NS;}; public static final Resource NAMESPACE = mModel.createResource(NS); // new Properties required for Fedora Version 3 ContentModel implementation: //<fedora-model:hasModel rdf:resource="info:fedora/DiPP:eJournal" xmlns:fedora-model="info:fedora/fedora-system:def/model#"/> public static final Property setContentModel = mModel.createProperty(NS + "hasModel"); }
[ "quast@hbz-nrw.de" ]
quast@hbz-nrw.de
1576a38ea77a114bd44b85e53b7c2070f4acfbdb
e491f2cace900f1e7a17b7df426e7927205bac50
/SimpleJsonCompiler/src/main/java/com/github/wrdlbrnft/simplejsoncompiler/builder/parser/ElementParserResolver.java
d288c9f0d94132b101b42a36c2193ac900ac98d8
[]
no_license
akrentsel/SimpleJson
68bebf78f46e385038b37d79d94edc34fcbdbe0d
c96f43b9b01df238d99c1bad6c14937a2390a1cd
refs/heads/master
2021-01-17T17:18:48.279752
2015-04-24T13:10:06
2015-04-24T13:10:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,992
java
package com.github.wrdlbrnft.simplejsoncompiler.builder.parser; import com.github.wrdlbrnft.codebuilder.elements.Field; import com.github.wrdlbrnft.codebuilder.elements.Type; import com.github.wrdlbrnft.codebuilder.impl.ClassBuilder; import com.github.wrdlbrnft.codebuilder.impl.Types; import com.github.wrdlbrnft.codebuilder.utils.Utils; import com.github.wrdlbrnft.simplejsoncompiler.Annotations; import com.github.wrdlbrnft.simplejsoncompiler.SimpleJsonTypes; import java.util.EnumSet; import java.util.HashMap; import java.util.Map; import javax.annotation.processing.ProcessingEnvironment; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; import javax.tools.Diagnostic; /** * Created by kapeller on 24/04/15. */ class ElementParserResolver { private final Map<String, Field> mParserMap = new HashMap<>(); private final ProcessingEnvironment mProcessingEnvironment; private final Map<String , Type> mEnumParserMap; private final TypeElement mInterfaceType; private final ClassBuilder mBuilder; public ElementParserResolver(ProcessingEnvironment processingEnvironment, TypeElement interfaceType, ClassBuilder builder, Map<String, Type> enumParserMap) { mProcessingEnvironment = processingEnvironment; mInterfaceType = interfaceType; mBuilder = builder; mEnumParserMap = enumParserMap; } public Field getElementParserField(Type type) { final String key = type.fullClassName(); if (mParserMap.containsKey(key)) { return mParserMap.get(key); } mBuilder.addImport(type); final Field field; if (type.isSubTypeOf(SimpleJsonTypes.ENUM)) { if (mEnumParserMap.containsKey(key)) { final Type parserType = mEnumParserMap.get(key); field = createElementParserField(parserType); } else { mProcessingEnvironment.getMessager().printMessage(Diagnostic.Kind.ERROR, "There is no parser implementation for " + type + "! Have you forgot to annotate it with @JsonEnum?", type.getTypeElement()); throw new IllegalStateException("There is no parser implementation for " + type + "! Have you forgot to annotate it with @JsonEnum?"); } } else if (type.equals(Types.STRING)) { field = createElementParserField(SimpleJsonTypes.STRING_PARSER); } else if (type.equals(Types.Primitives.INTEGER)) { field = createElementParserField(SimpleJsonTypes.INTEGER_PARSER); } else if (type.equals(Types.Primitives.DOUBLE)) { field = createElementParserField(SimpleJsonTypes.DOUBLE_PARSER); } else if (type.equals(Types.Primitives.LONG)) { field = createElementParserField(SimpleJsonTypes.LONG_PARSER); } else if (type.equals(Types.Primitives.BOOLEAN)) { field = createElementParserField(SimpleJsonTypes.BOOLEAN_PARSER); } else if (type.equals(Types.Boxed.INTEGER)) { field = createElementParserField(SimpleJsonTypes.INTEGER_PARSER); } else if (type.equals(Types.Boxed.DOUBLE)) { field = createElementParserField(SimpleJsonTypes.DOUBLE_PARSER); } else if (type.equals(Types.Boxed.LONG)) { field = createElementParserField(SimpleJsonTypes.LONG_PARSER); } else if (type.equals(Types.Boxed.BOOLEAN)) { field = createElementParserField(SimpleJsonTypes.BOOLEAN_PARSER); } else { final TypeElement element = type.getTypeElement(); if (element == null) { mProcessingEnvironment.getMessager().printMessage(Diagnostic.Kind.ERROR, "Could not find a parser for " + type.className() + "!!1", mInterfaceType); throw new IllegalStateException("Could not find a parser for " + type.className() + "!!1"); } else { if (Utils.hasAnnotation(element, Annotations.JSON_ENTITY)) { final Type parserType = SimpleJsonTypes.ENTITY_PARSER.genericVersion(type); field = mBuilder.addField(parserType, EnumSet.of(Modifier.PRIVATE, Modifier.FINAL)); field.setInitialValue(parserType.newInstance(type.className() + ".class")); } else { mProcessingEnvironment.getMessager().printMessage(Diagnostic.Kind.ERROR, "Could not find a parser for " + type.className() + "!!1 Have you forgot to annotate it?", mInterfaceType); throw new IllegalStateException("Could not find a parser for " + type.className() + "!!1 Have you forgot to annotate it?"); } } } mParserMap.put(key, field); return field; } private Field createElementParserField(Type type) { final Field field = mBuilder.addField(type, EnumSet.of(Modifier.PRIVATE, Modifier.FINAL)); field.setInitialValue(type.newInstance(new String[0])); return field; } }
[ "kapeller@staatsdruckerei.at" ]
kapeller@staatsdruckerei.at
a76bfc99101647c05cf24f7b0df0d547f8a04c30
e473604de0ca0b5e149c092f1b616159851282ef
/MancalaRules.java
6e9c56eae479bce8a64bd3e8725da3ddfde72b61
[]
no_license
lingwei-gu/Mancala-Board-Game
97a0371eede39a0ed97930e64e385b37b9b69d44
145c3c460b2b9c5f8ca0adc7d478c74996132075
refs/heads/master
2020-07-30T13:45:13.384956
2019-11-02T22:57:31
2019-11-02T22:57:31
210,254,136
1
0
null
null
null
null
UTF-8
Java
false
false
3,072
java
/* * MancalaPanel.java * Name: Lingwei Gu * Date: June 8, 2019 * * Purpose: It has all the rules of the game * Methods: * MancalaRules() - constructor * moveGem(Hole head, JLabel playerLabel) - returns int * checkNotKeepGoing(Hole head) - returns boolean * checkWinner(Hole leftStore, Hole rightStore) - returns String * * * */ package testing; import javax.swing.JLabel; public class MancalaRules { public MancalaRules() { //default constructor } //distribute gems public int moveGem(Hole head, JLabel playerLabel) { int gemsLeft = head.getGemNum(); String oppStore = ""; if (head.getIsMe().equals("Player 2")) { //record the enemy store to skip it oppStore = "rightStore"; } else if (head.getIsMe().equals("Player 1")) { oppStore = "leftStore"; } head.setGemNum(0); for (int i = 0; i < gemsLeft; i++) { //move the gems head = head.getNext(); if (head.getIsMe().equals(oppStore)) { //skip the enemy store i--; continue; } head.setGemNum(head.getGemNum() + 1); //add a gem to each store passed by } if (head.getGemNum() == 1 && head.getIsMe().equals(playerLabel.getText())) { //capture pieces with landing the last move on an empty hole on your side if (head.getOpposite().getGemNum() == 0) { return 0; } int gemsCaptured = head.getGemNum() + head.getOpposite().getGemNum(); head.setGemNum(0); head.getOpposite().setGemNum(0); return gemsCaptured; } return 0; } //check the player gets an extra round public boolean checkNotKeepGoing(Hole head) { Hole headCopy = head; int gemsLeft = head.getGemNum(); for (int i = 0; i < gemsLeft; i++) { //locate the last landing head = head.getNext(); } if (head.getIsMe().equals("Player 1") || head.getIsMe().equals("Player 2")) { //simple and straightforward return true; } else { if (headCopy.getIsMe().equals("Player 1") && head.getIsMe().equals("rightStore")) { return false; } if (headCopy.getIsMe().equals("Player 2") && head.getIsMe().equals("leftStore")) { return false; } } return true; } //check who the winner is public String checkWinner(Hole leftStore, Hole rightStore) { int gemCounterP1 = 0; int gemCounterP2 = 0; Hole startHole = leftStore; //check gem numbers for player 1 and 2 for (int i = 0; i < 14; i++) { if (startHole.getIsMe().equals("Player 1")) { gemCounterP1 += startHole.getGemNum(); } else if (startHole.getIsMe().equals("Player 2")) { gemCounterP2 += startHole.getGemNum(); } startHole = startHole.getNext(); } //return the result if (gemCounterP1 == 0 || gemCounterP2 == 0) { //reset the gem number in 2 stores leftStore.setGemNum(leftStore.getGemNum() + gemCounterP2); rightStore.setGemNum(rightStore.getGemNum() + gemCounterP1); if (leftStore.getGemNum() == rightStore.getGemNum()) { return "Draw"; } if (leftStore.getGemNum() > rightStore.getGemNum()) { return "Winner: Player 2!"; } else { return "Winner: Player 1!"; } } return "Keep Going"; } }
[ "noreply@github.com" ]
noreply@github.com
bfd06e967c7bc3c265f0ebcf17dc31d6acf9050f
3cf44860d71c684456a1156ccb853d85b8833b1f
/src/com/tencent/trt/executor/test/TransformMultipleRows.java
c141f2f8e190390bc261ae58ca42f7b15a320bea
[ "Apache-2.0" ]
permissive
alanma/trt
c726ad85bbc04a42c48f2c3edb914e3b090d11d3
5c8b52b2598a6bbc3d91f0d16ff1aabbef68be4a
refs/heads/master
2021-01-21T19:59:02.314597
2015-04-01T03:15:47
2015-04-01T03:15:47
35,858,086
0
1
null
2015-05-19T03:54:14
2015-05-19T03:54:14
null
UTF-8
Java
false
false
2,843
java
package com.tencent.trt.executor.test; import com.fasterxml.jackson.databind.ObjectMapper; import com.tencent.trt.executor.model.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; /** * Created by wentao on 1/17/15. */ public class TransformMultipleRows extends BaseTestCase { @Override public ResultTable inputTable() { return new ResultTable() {{ fields.add(new ResultField(){{ field = "raw_data"; }}); }}; } @Override public ResultTable resultTable() throws Exception { final ObjectMapper objectMapper = new ObjectMapper(); return new ResultTable() {{ fields.add(new ResultField() {{ isDimension = true; field = "ProductName"; type = "string"; origins = new String[]{"raw_data"}; processor = "parse_json"; processorArgs = objectMapper.writeValueAsString(new HashMap<String, Object>() {{ put("should_decode", false); put("flatten_field", "products"); put("fields", new HashMap<String, String>() {{ put("ProductName", "ProductName"); put("Price", "Price"); put("PerPrice", "PerPrice"); }}); put("input_type", new HashMap<String, String>() {{ put("Price", "String"); }}); }}); }}); fields.add(new ResultField() {{ isDimension = true; field = "Price"; type = "int"; processor = "=>ProductName"; }}); fields.add(new ResultField() {{ isDimension = true; field = "PerPrice"; type = "int"; processor = "=>ProductName"; }}); }}; } public void test() throws Exception { final ObjectMapper objectMapper = new ObjectMapper(); List<Record> outputs = execute(objectMapper.writeValueAsString(new HashMap<String, Object>() {{ put("products", new Object[]{ new HashMap<String, Object>() {{ put("ProductName", "A"); put("Price", "1"); put("PerPrice", 2); }}, new HashMap<String, Object>() {{ put("ProductName", "B"); put("Price", "2"); put("PerPrice", 4); }} }); }})); assertJsonEquals(new ArrayList<Record>() {{ add(o("A", 1, 2)); add(o("B", 2, 4)); }}, outputs); } }
[ "taowen@gmail.com" ]
taowen@gmail.com
2fed2ae130dd36583561ec3eddb13e789a7fcc46
bf69dedc4e479f2e97712b19ddb99f3739ea8355
/Customlist/src/test/java/com/rajesh/customlist/AppTest.java
6ee887432ee28ac514c6cdd1e312d808d4c16427
[]
no_license
rajeshuppala1449/Customlist
528ef3e039cfd7b7c3fec17e4ebbb9dc39615d57
71755d2a9aa794a1d9e97b3ab5373ec5c523019d
refs/heads/master
2021-02-13T03:00:13.001490
2020-03-03T14:22:29
2020-03-03T14:22:29
244,655,049
0
0
null
2020-10-13T20:02:06
2020-03-03T14:18:28
Java
UTF-8
Java
false
false
687
java
package com.rajesh.customlist; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "rajeshuppala1449@gmail.com" ]
rajeshuppala1449@gmail.com
1a086e71617c0b1a7ce933f5c8a5c02e7f73fa66
1f542d6f21b2c9e7070582296f74e6d2134621d2
/app/src/androidTest/java/com/disruption/rxandroid_prac/ExampleInstrumentedTest.java
5f15446bc440dac4201c987f2a49775a636a3e05
[]
no_license
Fbada006/RxAndroid-Prac
29afd30c28a9ac0d31433e8996c11eda58f4c6c5
73af58b63f1ee1ad83a0f3ab6659a615f5cf266c
refs/heads/master
2021-03-16T15:45:26.578169
2020-03-12T20:08:18
2020-03-12T20:08:18
246,921,028
0
0
null
null
null
null
UTF-8
Java
false
false
774
java
package com.disruption.rxandroid_prac; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.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.getInstrumentation().getTargetContext(); assertEquals("com.disruption.rxandroid_prac", appContext.getPackageName()); } }
[ "ferdinandkamata@yahoo.com" ]
ferdinandkamata@yahoo.com
df85a744211da6010fdca0b1a92bb837a6568a84
40aa609d3771179b932e1e9dbe3df53c362a1d54
/src/main/java/com/in28minutes/rest/webservices/restfulwebservices/controller/BasicAuthenticationController.java
aa4514f4235d8a21999482ac65c9509e6cfc30b1
[]
no_license
alvieira/todo-back-end
d4107d72d13614ea8a69f1d83c18d6a98d2884fb
4f7ff89fdd4115d9871617a864f8e21cb2f5597e
refs/heads/master
2020-05-29T19:19:18.907402
2019-06-11T02:01:05
2019-06-11T02:01:05
189,327,053
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package com.in28minutes.rest.webservices.restfulwebservices.controller; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import com.in28minutes.rest.webservices.restfulwebservices.helloworld.AuthenticationBean; @CrossOrigin(origins="http://localhost:4200") @RestController public class BasicAuthenticationController { @GetMapping(path="/basicauth") public AuthenticationBean authBean() { return new AuthenticationBean("You are authenticated"); // throw new RuntimeException("Some error happened. Contact support ***"); } }
[ "aloisio.vieira@gmail.com" ]
aloisio.vieira@gmail.com
962ce55adf235f29e9547575f264e0edc10ae6bf
4949d436c512fffa93b2c455b7a9dd39e4b786af
/app/src/main/java/com/example/pc/traffic/Traffic.java
dbeaaa0170757a6985b7423cc9d3d1bb5a3d4c93
[]
no_license
minnie066/Traffic2
2d5f8f02c4ecd3b8befbc8a5df5eaf855db2d776
4633c74b65bfb625d8e2d773210028385538dbf0
refs/heads/master
2021-01-17T16:57:33.580573
2016-09-26T03:35:19
2016-09-26T03:35:19
69,209,928
0
0
null
null
null
null
UTF-8
Java
false
false
703
java
package com.example.pc.traffic; import android.content.Intent; import android.net.Uri; import android.support.v4.view.ViewPropertyAnimatorCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; public class Traffic extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_traffic); }//main metod public void clickAbout_Me(View view) { Intent objInten = new Intent(Intent.ACTION_VIEW); objInten.setData(Uri.parse("http://www.csclub.ssru.ac.th/s56122201066/GB")); startActivity(objInten); } //Click }
[ "minniekamonrat066@gmail.com" ]
minniekamonrat066@gmail.com
8024f6c15631326ed03deb4e5581f461c0b28ae6
e4aabb04227b9d365db7d8e620d34570556f66c0
/modesti-server/src/main/java/cern/modesti/config/OAuthSecurityConfig.java
351bef50a47fd2b8d8a4fface010d270b937050c
[]
no_license
jlsalmon/modesti
5a34ca3a19d3b1c0b19bd19a7d183b80c3d9ec10
155e8f188723b637fdfe84afbfdcd89395466a35
refs/heads/master
2021-07-06T14:22:22.741726
2020-11-25T12:04:00
2020-11-25T12:04:00
31,232,688
6
0
null
2021-06-04T22:09:37
2015-02-23T22:13:36
Java
UTF-8
Java
false
false
3,922
java
package cern.modesti.config; import java.io.IOException; import java.security.Principal; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.oauth2.core.oidc.user.OidcUser; import org.springframework.security.oauth2.jwt.NimbusJwtDecoderJwkSupport; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; import cern.modesti.security.oauth.*; import static org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter.DEFAULT_AUTHORIZATION_REQUEST_BASE_URI; /** * Configuration class for OAuth authentication * * @author Ivan Prieto Barreiro */ @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) @RestController @Order(2) @Profile("!dev") public class OAuthSecurityConfig { /** * REST interface providing the user information. * In a real application you should only expose the absolute necessary and not the entire {@link Principal} object * @param principal The User information * @return The user information */ @GetMapping("/api/user") public OidcUser getOidcUserPrincipal(@AuthenticationPrincipal OidcUser principal) { return principal; } /** * @param response Response redirects back to the frontend page. * @param callback The URL of frontend to which backend will redirect after successful log in. * @throws IOException sendRedirect failed. */ @GetMapping("/api/sso") public void sso( HttpServletResponse response, @RequestParam("callback") String callback ) throws IOException { response.sendRedirect(callback); } /** * Configures OAuth Login with Spring Security 5. * @return */ @Bean public WebSecurityConfigurerAdapter webSecurityConfigurer( @Value("${keycloak.client-id}") final String registrationId, KeycloakOauth2UserService keycloakOidcUserService, KeycloakLogoutHandler keycloakLogoutHandler ) { return new WebSecurityConfigurerAdapter() { @Override public void configure(HttpSecurity http) throws Exception { http .csrf().disable() .authorizeRequests() .antMatchers("/", "/api/plugins", "/api/user", "/login").permitAll() .antMatchers("/api/**").authenticated() .and().logout().addLogoutHandler(keycloakLogoutHandler).and() .oauth2Login().userInfoEndpoint().oidcUserService(keycloakOidcUserService) .and().loginPage(DEFAULT_AUTHORIZATION_REQUEST_BASE_URI + "/" + registrationId) ; } }; } @Bean KeycloakOauth2UserService keycloakOidcUserService(OAuth2ClientProperties oauth2ClientProperties) { NimbusJwtDecoderJwkSupport jwtDecoder = new NimbusJwtDecoderJwkSupport( oauth2ClientProperties.getProvider().get("keycloak").getJwkSetUri()); return new KeycloakOauth2UserService(jwtDecoder); } @Bean KeycloakLogoutHandler keycloakLogoutHandler() { return new KeycloakLogoutHandler(new RestTemplate()); } }
[ "ivan.prieto.barreiro@cern.ch" ]
ivan.prieto.barreiro@cern.ch
e39cbf478398c5b45fa8701228e5a59d675558f7
961d5053ffa356a86e7c8e4d74d36388341e4de1
/Ejercicio Promedios/Banco.java
4b9b73347e81b313888338e471c28e6b5916455e
[]
no_license
96SparK/Herencia-y-Polimorfismo
91ba5f9554e14457a03b45b402f06c1a6aca4c79
14538252a00575e7ec0d0fdcd7091380ceef6643
refs/heads/master
2020-05-28T06:25:23.288245
2017-03-13T18:02:45
2017-03-13T18:02:45
82,584,663
0
0
null
null
null
null
UTF-8
Java
false
false
398
java
import java.util.ArrayList; public class Banco { private ArrayList <CuentaBancaria> cuentas; public Banco() { cuentas = new ArrayList<CuentaBancaria>(); } public void agregaCuenta(CuentaBancaria cuenta) { cuentas.add(cuenta); } public float calculaPromedio() { float promedio = 0; return promedio; } }
[ "black_phoenix_96@live.com.mx" ]
black_phoenix_96@live.com.mx
7fb80ea83b3d6e773762b5341d607e70506479b4
2bdb0dd16b5683fe9822d41314120b2fca917d5e
/src/main/java/io/github/jhipster/eventor/web/rest/errors/LoginAlreadyUsedException.java
040ff2d4920f693cabe3d17477d15865ef5efca6
[]
no_license
daxsieger/jeventor
f32960d3fd20ee6c04741ce96ff5d7dd4a115c49
13968fb712d8811843fb9fb7e99a45aaa436ee06
refs/heads/master
2020-03-22T06:03:38.599276
2018-07-03T16:17:22
2018-07-03T16:17:22
139,609,048
0
0
null
2018-07-03T16:26:11
2018-07-03T16:17:11
Java
UTF-8
Java
false
false
346
java
package io.github.jhipster.eventor.web.rest.errors; public class LoginAlreadyUsedException extends BadRequestAlertException { private static final long serialVersionUID = 1L; public LoginAlreadyUsedException() { super(ErrorConstants.LOGIN_ALREADY_USED_TYPE, "Login name already used!", "userManagement", "userexists"); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
298ee2b7695b710b04734daf2ce3c7822764d33b
595daf36ff91e89cf30365dc7e8499a019d48f85
/POMS/src/hit/poms/search/dao/Sub_sell_pubDAO.java
eb89fdb676f5f301e2f0549c66ef731eaed16fd5
[]
no_license
FuGuishan/web-system-for-newspaper-publishment
b0b2b30c868ce8400e93238ec28c2e818683b54f
c5eaef3fa1256a3e19ea544dcf6a6444f1f4c12e
refs/heads/master
2021-01-01T17:26:38.117694
2017-07-23T05:14:21
2017-07-23T05:14:21
98,075,019
0
1
null
null
null
null
UTF-8
Java
false
false
3,585
java
package hit.poms.search.dao; import hit.poms.search.entity.Sub_sell_pub; import hit.poms.util.DBManager; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; public class Sub_sell_pubDAO { public static void main(String[] args) { } /** * 通过id查询 * @param id * @return */ public Sub_sell_pub doQueryById(int id){ //1、声明数据库相关对象 Connection conn = null; PreparedStatement st = null; ResultSet rs = null; Sub_sell_pub temp = null; try{ //2、获取数据库连接对象 conn = DBManager.getConnection(); //3、创建语句对象 //因为需要给查询增加相应的条件控制,所以sql语句需要动态组成 StringBuffer sql = new StringBuffer("select * from sub_sell_pub where substation_id=? "); st = conn.prepareStatement(sql.toString()); //4、执行语句对象。注意:如果语句中有参数,需要先给语句对象传值 st.setInt(1, id); rs = st.executeQuery(); //5、对rs进行遍历 while(rs.next()){ temp = new Sub_sell_pub(); temp.setSubstation_id(rs.getString("substation_id")); temp.setPub_id(rs.getString("pub_id")); temp.setPub_send_num(rs.getString("pub_send_num")); temp.setSend_time(rs.getString("send_time").substring(0, 10)); temp.setGet_money(rs.getString("get_money")); } }catch(Exception e){ e.printStackTrace(); }finally{//释放所有数据库资源 DBManager.closeAll(conn, st, rs); } return temp; } /** * 查询 * @param user * @return */ public List doQuery(Sub_sell_pub sub_sell_pub){ //1、声明数据库相关对象 Connection conn = null; PreparedStatement st = null; ResultSet rs = null; List list = new ArrayList(); try{ //2、获取数据库连接对象 conn = DBManager.getConnection(); //3、创建语句对象 //因为需要给查询增加相应的条件控制,所以sql语句需要动态组成 StringBuffer sql = new StringBuffer("select * from sub_sell_pub where 1=1 "); //查询的前提是客户ID的存在 if(sub_sell_pub.getSubstation_id() != null && !"".equals(sub_sell_pub.getSubstation_id())){ sql.append(" and substation_id =") .append(sub_sell_pub.getSubstation_id()) .append(" "); } if(sub_sell_pub.getSend_time() != null && !"".equals(sub_sell_pub.getSend_time())){ sql.append(" and to_char(send_time,'yyyy-mm') = '") .append(sub_sell_pub.getSend_time()) .append("'"); } System.out.println("---sql=" + sql); st = conn.prepareStatement(sql.toString()); //4、执行语句对象。注意:如果语句中有参数,需要先给语句对象传值 rs = st.executeQuery(); //5、对rs进行遍历,将结果封装到list中 while(rs.next()){ //创建User对象,将每条记录的字段值以属性值的方式存储到User对象中 Sub_sell_pub temp = new Sub_sell_pub(); temp.setSubstation_id(rs.getString("substation_id")); temp.setPub_id(rs.getString("pub_id")); temp.setPub_send_num(rs.getString("pub_send_num")); temp.setSend_time(rs.getString("send_time").substring(0, 10)); temp.setGet_money(rs.getString("get_money")); //把对象加入到list集合里 list.add(temp); } }catch(Exception e){ e.printStackTrace(); }finally{//释放所有数据库资源 DBManager.closeAll(conn, st, rs); } return list.size()>0 ? list : null; //如果list中没有元素,那么返回null。 } }
[ "1206374213@qq.com" ]
1206374213@qq.com
68ebaf6c9b957c4ab6ce0fceecc8ca6c43ba6514
eef7304bde1aa75c49c1fe10883d5d4b8241e146
/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/transform/GetLoggerDefinitionResultJsonUnmarshaller.java
315b3490da230515bd746385a332ae675f1392bb
[ "Apache-2.0" ]
permissive
C2Devel/aws-sdk-java
0dc80a890aac7d1ef6b849bb4a2e3f4048ee697e
56ade4ff7875527d0dac829f5a26e6c089dbde31
refs/heads/master
2021-07-17T00:54:51.953629
2017-10-05T13:55:54
2017-10-05T13:57:31
105,878,846
0
2
null
2017-10-05T10:51:57
2017-10-05T10:51:57
null
UTF-8
Java
false
false
4,409
java
/* * Copyright 2012-2017 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.greengrass.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.greengrass.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * GetLoggerDefinitionResult JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetLoggerDefinitionResultJsonUnmarshaller implements Unmarshaller<GetLoggerDefinitionResult, JsonUnmarshallerContext> { public GetLoggerDefinitionResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetLoggerDefinitionResult getLoggerDefinitionResult = new GetLoggerDefinitionResult(); 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 getLoggerDefinitionResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Arn", targetDepth)) { context.nextToken(); getLoggerDefinitionResult.setArn(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("CreationTimestamp", targetDepth)) { context.nextToken(); getLoggerDefinitionResult.setCreationTimestamp(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Id", targetDepth)) { context.nextToken(); getLoggerDefinitionResult.setId(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("LastUpdatedTimestamp", targetDepth)) { context.nextToken(); getLoggerDefinitionResult.setLastUpdatedTimestamp(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("LatestVersion", targetDepth)) { context.nextToken(); getLoggerDefinitionResult.setLatestVersion(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("LatestVersionArn", targetDepth)) { context.nextToken(); getLoggerDefinitionResult.setLatestVersionArn(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Name", targetDepth)) { context.nextToken(); getLoggerDefinitionResult.setName(context.getUnmarshaller(String.class).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 getLoggerDefinitionResult; } private static GetLoggerDefinitionResultJsonUnmarshaller instance; public static GetLoggerDefinitionResultJsonUnmarshaller getInstance() { if (instance == null) instance = new GetLoggerDefinitionResultJsonUnmarshaller(); return instance; } }
[ "" ]
864cbe6281ab5d16a9a41e08d5105f53296409c0
e192426b4999eaaa5422213b7c53e36c313c4e55
/src/main/java/controllers/BookApiController.java
51af284d7f99a103a48ee7a665385b09f77735f7
[]
no_license
mksjs/lms
7fb2c9c93856476d7ff36d9bb26fea90b55e4fa7
11c95b974e6f7033709aef5a2edddcc7c08bafd8
refs/heads/master
2022-07-08T03:29:21.493682
2020-03-15T17:36:21
2020-03-15T17:36:21
236,912,720
1
0
null
2022-06-21T02:42:41
2020-01-29T05:46:54
Java
UTF-8
Java
false
false
6,273
java
package controllers; import models.BookDto; import models.BookDtoNotLog; import models.BooksDto; import models.Book; import ninja.FilterWith; import ninja.Result; import ninja.Results; import ninja.SecureFilter; import ninja.params.PathParam; import java.util.ArrayList; import java.util.List; import javax.annotation.ParametersAreNonnullByDefault; import javax.swing.text.View; import com.fasterxml.jackson.annotation.JsonView; import com.google.inject.Inject; import dao.BookTo; import etc.LoggedInUser; public class BookApiController { @Inject BookTo bookTo; public Result getBooksJson() { BooksDto booksDto = bookTo.getAllBooks(); // List<BookDto> booksDto2 = new ArrayList<>(); // for (Book bookDto : booksDto.books) { // BookDto bookDto2 = new BookDto(); // bookDto2.id = bookDto.id; // bookDto2.title = bookDto.title; // bookDto2.authorName = bookDto.authorName; // booksDto2.add(bookDto2); // } return Results.json().jsonView(View.Public.class).render(booksDto); } public Result getAllBooksLoggedInJson(@PathParam ("username") String username ) { boolean user = bookTo.userLogged(username); BooksDto booksDto = bookTo.getAllBooks(); if(user) { return Results.json().render(booksDto); }else { return Results.json().jsonView(View.Public.class).render(booksDto); } } public Result getAllBookJson(@PathParam("id") Long id) { Book book = bookTo.getBook(id); // BookDto bookDto = new BookDto(); // bookDto.id = book.id; // bookDto.title = book.title; // bookDto.authorName = book.authorName; return Results.json().render(book); } public Result getNBookJson(@PathParam ("NBook") int NBook) { BooksDto booksDto = bookTo.getFirstNBook(NBook); return Results.json().jsonView(View.Public.class).render(booksDto); } public Result pagination(@PathParam ("page_id") int page_id, @PathParam ("nBook") int nBook) { if(page_id ==1) { //do nothing }else { page_id = (page_id-1) * nBook +1; } BooksDto booksDto =bookTo.getBookByPage(page_id,nBook); return Results.json().jsonView(View.Public.class).render(booksDto); } public Result AddBookJson(@PathParam ("username") String username , @PathParam ("title") String title, @PathParam ("authorName")String authorName ) { boolean success = bookTo.AddBook(username, title, authorName); if(success) { Book book = bookTo.getFirstBookForFrontPage(); return Results.json().jsonView(View.Public.class).render(book); }else { return Results.json().render("Book Not added"); } } public Result updataBookJson(@PathParam ("username") String username ,@PathParam ("id") Long id, @PathParam("title") String title, @PathParam ("authorName") String authorName) { boolean success =bookTo.updateBookId(username, id, title, authorName); if(success) { Book book = bookTo.getBook(id); return Results.json().jsonView(View.Public.class).render(book); }else { return Results.json().render("Not Updated"); } } public Result deleteBookIdJson(@PathParam ("username") String username, @PathParam ("id") Long id) { boolean success = bookTo.deleteBook(username, id); if(success) { boolean user = bookTo.userLogged(username); BooksDto booksDto = bookTo.getAllBooks(); if(user) { return Results.json().render(booksDto); }else { return Results.json().jsonView(View.Public.class).render(booksDto); } }else { return Results.json().render("Not Deleted"); } } public static class View { public static class Public {}; public static class Private {}; } /* * public class Book{ * * @JsonView(View.Private.class) public Long id; * * @JsonView(View.Public.class) public String title; * * @JsonView(View.Public.class) public String authorName; * * @JsonView(View.Private.class) public Boolean availablity; } * */ public Result getBooksXml() { BooksDto booksDto = bookTo.getAllBooks(); return Results.xml().render(booksDto); } public Result getBookJson(@PathParam("id") Long id) { Book book = bookTo.getBook(id); // BookDto bookDto = new BookDto(); // bookDto.id = book.id; // bookDto.title = book.title; // bookDto.authorName = book.authorName; return Results.json().jsonView(View.Public.class).render(book); } @FilterWith(SecureFilter.class) public Result postBookJson(@LoggedInUser String username, BookDto bookDto) { boolean succeeded = bookTo.postBook(username, bookDto); if (!succeeded) { return Results.notFound(); } else { return Results.json(); } } @FilterWith(SecureFilter.class) public Result postBookXml(@LoggedInUser String username, BookDto bookDto) { boolean succeeded = bookTo.postBook(username, bookDto); if (!succeeded) { return Results.notFound(); } else { return Results.xml(); } } @FilterWith(SecureFilter.class) public Result deleteBookJson(@LoggedInUser String username, BookDto bookDto, @PathParam("id") Long id) { boolean succeeded = bookTo.deleteBook(username, id); if (!succeeded) { return Results.notFound(); } else { return Results.json(); } } @FilterWith(SecureFilter.class) public Result deleteBookXml(@LoggedInUser String username, BookDto bookDto, @PathParam("id") Long id) { boolean succeeded = bookTo.deleteBook(username, id); if (!succeeded) { return Results.notFound(); } else { return Results.xml(); } } }
[ "mksjs1998@gmail.com" ]
mksjs1998@gmail.com
f6099175731b89cca001910b661fc759b8efe3fd
ab3af8f836bab91d6cec660c63a36270f5417325
/app/src/main/java/com/imamsutono/myintentapp/MainActivity.java
e270790099d6b22908eb4cbb38555bd84f3f9a86
[]
no_license
imamsutono/AndroidIntentStarter
51c34f1bfe8982ddca7deb57128599a308c6ec8f
7d97cbf58b70f8346ebdba586ade3025b35f865a
refs/heads/master
2021-05-07T20:14:10.162176
2017-10-31T05:55:22
2017-10-31T05:55:22
108,950,274
0
0
null
2017-10-31T05:55:23
2017-10-31T05:38:26
Java
UTF-8
Java
false
false
1,906
java
package com.imamsutono.myintentapp; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity implements View.OnClickListener { private Button btnMoveActivity, btnMoveWithDataActivity, btnDialPhone; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btnMoveActivity = (Button)findViewById(R.id.btn_move_activity); btnMoveActivity.setOnClickListener(this); btnMoveWithDataActivity = (Button)findViewById(R.id.btn_move_activity_data); btnMoveWithDataActivity.setOnClickListener(this); btnDialPhone = (Button)findViewById(R.id.btn_dial_number); btnDialPhone.setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.btn_move_activity: Intent moveIntent = new Intent(MainActivity.this, MoveActivity.class); startActivity(moveIntent); break; case R.id.btn_move_activity_data: Intent moveWithDataIntent = new Intent(MainActivity.this, MoveWithDataActivity.class); moveWithDataIntent.putExtra(MoveWithDataActivity.EXTRA_NAME, "DicodingAcademy Boy"); moveWithDataIntent.putExtra(MoveWithDataActivity.EXTRA_AGE, 5); startActivity(moveWithDataIntent); break; case R.id.btn_dial_number: String phoneNumber = "082131317921"; Intent dialPhoneIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber)); startActivity(dialPhoneIntent); break; } } }
[ "imamssutono@gmail.com" ]
imamssutono@gmail.com
09c9d2fd7a95614b11193939f7f3faeea729b022
ed37b6f67dfd6de37863cab7b15cdd7e48aba65e
/Habits/app/src/main/java/com/gb_androidteam/habits/service/AlarmManager.java
b608c77638ba35205f3da1bc1733be7f09481a5d
[]
no_license
victor-kul/GB_A_Habits
1c45c470b8f8fc711d2fbb74ed1fecda8486f3fa
3580a40286c14af82d01797d1e5fda8f537b090b
refs/heads/master
2021-01-24T01:46:52.441494
2016-06-08T14:30:04
2016-06-08T14:30:04
60,720,011
1
0
null
2016-06-08T18:18:38
2016-06-08T18:18:38
null
UTF-8
Java
false
false
374
java
package com.gb_androidteam.habits.service; import android.content.BroadcastReceiver; // Действие при получении бродкаста: onReceive // Метод для создания аларма (первый в списке): setAlarm // Метод для отмены аларма: cancelAlarm public class AlarmManager extends BroadcastReceiver{ }
[ "bardashovrv@gmail.com" ]
bardashovrv@gmail.com
e289a9080a49462c6d5e705b778d55e442f50e42
16c2ff13a57aa0152838200c61f8c47e886b9714
/src/main/java/Selenium/DataBase_ConnectionClass.java
b6ecb8c197df7f1a43e6b492f373dec32e57f405
[]
no_license
arorarama11/Rama_Code
2543117afec016eed935060ec18d1515633fdd08
e9ef1b1bb7dcdcf4322520bd022e5b88851efc37
refs/heads/master
2023-05-01T14:37:05.847516
2019-09-06T06:46:26
2019-09-06T06:46:26
135,174,959
1
0
null
2023-04-17T18:54:41
2018-05-28T14:53:23
HTML
UTF-8
Java
false
false
337
java
package Selenium; public class DataBase_ConnectionClass { public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { Class.forName("Selenium.P").newInstance(); } } class P { static { System.out.println("static"); } // { System.out.println("instance"); } }
[ "arorarama11@gmail.com" ]
arorarama11@gmail.com
8e1a8bafdc62e00a107626feeabe4e51a57c99d6
488604a97342152a737e48fc929e2782c7d55f3a
/Model.diagram/src/imagindata/diagram/providers/ImaginDataIconProvider.java
8cfef6bd9b34f9dab31a3e8e216d52b999a6288a
[]
no_license
FabienGautreault/eclipseGMF
fcba8e193ae5acafa6cb16c378ea138b0aa3f3ce
755abcd9b767ac3079afc78968ad3516a4ae4301
refs/heads/master
2020-06-04T04:14:55.795381
2015-08-06T07:24:32
2015-08-06T07:24:32
40,202,459
1
0
null
null
null
null
UTF-8
Java
false
false
882
java
package imagindata.diagram.providers; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; import org.eclipse.gmf.runtime.common.core.service.IOperation; import org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation; import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider; import org.eclipse.swt.graphics.Image; /** * @generated */ public class ImaginDataIconProvider extends AbstractProvider implements IIconProvider { /** * @generated */ public Image getIcon(IAdaptable hint, int flags) { return ImaginDataElementTypes.getImage(hint); } /** * @generated */ public boolean provides(IOperation operation) { if (operation instanceof GetIconOperation) { return ((GetIconOperation) operation).execute(this) != null; } return false; } }
[ "FabienG" ]
FabienG
e61afcacad400c43672959495ad1b712f17b2b77
f3762765cdec022061152d1bc4e0e9e2935b3149
/CoreJava/src/ConstructorOverloadingDemo1.java
e3947ad6ea90d98200bb3f671a8bffb57f4bad77
[ "MIT" ]
permissive
nileshmane1988/SeleniumCodeSnippets
a9d7a9874c151bf4f0c412f793b4fa1a01cc497c
b69fcd99e1e8a38c355ee27cd2d8751b5e2490dd
refs/heads/master
2020-12-28T00:55:00.736381
2020-02-04T05:36:50
2020-02-04T05:36:50
238,126,733
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
class Gate { Gate() { System.out.print("1"); new Gate(10); System.out.print("5"); } Gate(int temp) { System.out.print("2"); new Gate(10, 20); System.out.print("4"); } Gate(int data, int temp) { System.out.print("3"); } } public class ConstructorOverloadingDemo1 { public static void main(String args[]) { Gate g = new Gate(); } }
[ "nileshmane1988@users.noreply.github.com" ]
nileshmane1988@users.noreply.github.com
e3b9d1abc31ed0cbce5eaec819c1e6b9615a2706
fb6e5bed33e93e54590ea8f75170cb3dfc3bfbae
/src/homework3/interfaces/SkiPassCard.java
9d9063f84053505ad6d5657012e15bac8e7bc159
[]
no_license
iiukhymchuk/smitrpz
a13137765376ace403d87e5b3dd9fcc8fdd6f08a
0310f1f69b166b47ce8e1d3cfeb552e3b91543b6
refs/heads/master
2020-03-18T05:06:48.803370
2018-06-05T23:46:44
2018-06-05T23:46:44
134,325,188
0
0
null
null
null
null
UTF-8
Java
false
false
327
java
package homework3.interfaces; import homework3.enums.CardType; import java.time.LocalDateTime; import java.util.UUID; public interface SkiPassCard { UUID getId(); CardType getType(); LocalDateTime getStartDate(); LocalDateTime getEndDate(); String getLeftLiftsNumber(); void decreaseLiftsNumber(); }
[ "ievgenii.iukhymchuk@gmail.com" ]
ievgenii.iukhymchuk@gmail.com
94529a1969f8e8e532a098e8397afc6b2c655282
ec42feccd9eba868313daad787b150358ce19fc4
/backend/lidlserver/src/main/java/lidl/Parser.java
828f54f7dcd663593b75a8d0b2a06788d2e45e66
[]
no_license
espr1t/lidl-search
28b9af205ec75f907d90b83addc772059e5082f3
b406affa7144c27f2a5e3ecac6f3820c52719722
refs/heads/master
2020-07-06T01:35:33.467689
2020-01-28T22:47:34
2020-01-28T22:47:34
202,847,639
0
0
null
2020-01-28T22:47:35
2019-08-17T07:01:11
Java
UTF-8
Java
false
false
1,930
java
package lidl; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import java.io.FileReader; import java.util.List; import java.util.ArrayList; public class Parser { static List<Product> products; public static void parseProducts() { // Parse json file with products try { String dataPath = System.getProperty("user.dir") + "/data/small_product_dataset.json"; System.out.println("Data path: " + dataPath); products = new ArrayList<>(); Object obj = new JSONParser().parse(new FileReader(dataPath)); JSONArray ja = (JSONArray) obj; for (int i = 0; i < ja.size(); ++i) { JSONObject jo = (JSONObject) ja.get(i); Product prod = new Product(); prod.SetProductId((String) jo.get("ProductId")); prod.SetCategory((String) jo.get("Category")); prod.SetMainCategory((String) jo.get("MainCategory")); prod.SetSupplierName((String) jo.get("SupplierName")); prod.SetDescription((String) jo.get("Description")); prod.SetName((String) jo.get("Name")); prod.SetStatus((String) jo.get("Status")); prod.SetProductPicUrl((String) jo.get("ProductPicUrl")); Object price = jo.get("Price"); if (price instanceof Long) prod.SetPrice(((Long) price).doubleValue()); else prod.SetPrice((Double) price); prod.SetQuantity((Long) jo.get("Quantity")); prod.SetCurrencyCode((String) jo.get("CurrencyCode")); products.add(prod); } } catch (Exception e) { e.printStackTrace(); } } public static List<Product> getProducts() { return products; } }
[ "alex.georgiev@skyscanner.net" ]
alex.georgiev@skyscanner.net
340ebc5da4e2d57a5befebe3a9204b24aa90e759
6b8cd32132d11a1c9851cbe28c9adde267a2b9a5
/app/src/androidTest/java/alexandria/chan/com/chanalexandrialab5/ExampleInstrumentedTest.java
de99cd3d09638adb41f79feff2168fd579bca62a
[]
no_license
chanalexandria/ChanAlexandriaLab5
dc3b15f602e143610acfd22f594b41777a96f2c2
f73d39d62dec468cf60447de6bbccac89683fdc5
refs/heads/master
2020-03-30T06:33:25.514795
2018-09-29T14:06:53
2018-09-29T14:06:53
150,870,107
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package alexandria.chan.com.chanalexandrialab5; 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("alexandria.chan.com.chanalexandrialab5", appContext.getPackageName()); } }
[ "2015082635@ust-ics.mygbiz.com" ]
2015082635@ust-ics.mygbiz.com
a9879d1a723c0bc2fc3b7047f793c84c48093b93
5e37161bc4eba92e02237235ad4a2dfd8b4188b7
/jinshuo-service/src/main/java/com/jinshuo/mall/service/user/application/dto/WxMpUserList.java
4a709915bf820ba3a51e00b38ba8237d728c5312
[]
no_license
dyhimos/jinshuo-mall
f4400cc41ca6a57b7512832209eea6d1a8c3b101
b1cc18c8445a46abd35796bfdad55824f0f4a5a8
refs/heads/master
2022-07-12T23:16:16.872664
2020-05-14T13:09:27
2020-05-14T13:09:27
260,648,942
0
0
null
null
null
null
UTF-8
Java
false
false
494
java
package com.jinshuo.mall.service.user.application.dto; import lombok.Data; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * 关注者列表 * * @author chanjarster */ @Data public class WxMpUserList implements Serializable { private static final long serialVersionUID = 1389073042674901032L; protected long total = -1; protected int count = -1; protected List<String> openids = new ArrayList<>(); protected String nextOpenid; }
[ "1" ]
1
2ea763876750f0707e606ce38a57c3024b66444e
aef4210f2a66e8ca8077bd314be4c6a0b4d35022
/src/stack_queue/QueueusingArraysclient.java
613a407b5f0f2423466832df6fbef6dceff65c97
[]
no_license
akashv001/Java_Practice
151d995c463ead13ec45c53154543ca1eea95c13
049c54e63e4e8ea9c89ac7bc757a1817b32710dd
refs/heads/master
2023-04-06T02:21:50.328705
2021-04-20T05:38:10
2021-04-20T05:38:10
359,037,338
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
package stack_queue; public class QueueusingArraysclient { public static void main(String[] args) throws Exception { QueueusingArrays queue = new QueueusingArrays(5); // queue.enqueue(10); // queue.display(); // // queue.enqueue(20); // queue.display(); for (int i = 1; i <= 5; i++) { queue.enqueue(i * 10); queue.display(); } // queue.enqueue(60); // System.out.println("**********"); // while (!queue.isEmpty()) { // queue.display(); // System.out.println("Front" + queue.front()); // queue.dequeue(); // } } }
[ "singh808798akash@gmail.com" ]
singh808798akash@gmail.com
7e27914f628b05daf70475e0e882818f2b926300
7a14ac621c265cdaea3934c0eebf81c9e8495ea3
/src/main/java/com/pd/core/patterns/headfirst/adapter/iterenum/EI.java
ff0cb695124f8a430ba469ec52e17f4a8be6b697
[]
no_license
dunejaparas/CoreJava
12d864a8828880751deb48f87e2eef866c52d6b8
ff113f6ae3c76d9717e0a67b9e5e038257a109bc
refs/heads/master
2021-01-16T18:03:10.644420
2015-09-05T23:59:26
2015-09-05T23:59:26
33,132,791
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
package com.pd.core.patterns.headfirst.adapter.iterenum; import java.util.Arrays; import java.util.Enumeration; import java.util.Iterator; import java.util.Vector; public class EI { public static void main(final String args[]) { final Vector v = new Vector(Arrays.asList(args)); final Enumeration enumeration = v.elements(); while (enumeration.hasMoreElements()) { System.out.println(enumeration.nextElement()); } final Iterator iterator = v.iterator(); while (iterator.hasNext()) { System.out.println(iterator.next()); } } }
[ "paras.duneja@ericsson.com" ]
paras.duneja@ericsson.com
eb38271a9904e4e76e6921277fdfce67b6f29eed
5d2e9b5639a7c0e9d39b01b8d707f197d60d6d1e
/ProjectDemo/src/main/java/com/example/ProjectDemo/controller/Restcontroller.java
82c263681d062633b9a6227c79498ef8fea03f59
[]
no_license
swatiambad/springboot
ab19d5e24c0c3362533edde9fd05695203467a4e
06ecd636051620d489a96e448cd2e1b0b09a02c0
refs/heads/master
2023-04-19T15:52:52.834113
2021-05-03T06:37:41
2021-05-03T06:37:41
363,837,553
0
0
null
null
null
null
UTF-8
Java
false
false
1,273
java
package com.example.ProjectDemo.controller; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; 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.example.ProjectDemo.model.User; import com.example.ProjectDemo.service.serviceclass; @RestController public class Restcontroller { @Autowired private serviceclass service; @RequestMapping("/getname") public String getname() { return "hello"; } @PostMapping("saveuser") @Transactional public String reguser(@RequestBody User user) { service.savebyuser(user); return "Hello "+user.getName()+"your registeration is successful"; } @GetMapping("getuser") public Iterable<User>showalluesr(){ return service.showuser(); } @GetMapping("deluser/{name}") @Transactional public Iterable<User> deleteuser(@PathVariable String name){ return service.deletename(name); } }
[ "DELL@DESKTOP-GJLROSF" ]
DELL@DESKTOP-GJLROSF
94797fbea985052e346097352cc46de235f5f8db
52cfa17126e621050bd79072b3fc4c119faec49d
/src/com/netdoers/errorreporting/G.java
9ea07fdb17504fe17ab33ad19ec3859b8ad90ef7
[]
no_license
vikalppatelce/BoilerPlate_mAndroid
e3669a3b0505556e81c7000b15a19b8b2d4a033b
fe7406adcfb625c385a85e8699158cd1c6c207d7
refs/heads/master
2021-01-02T23:07:47.410583
2014-11-01T09:16:31
2014-11-01T09:21:55
22,544,682
1
0
null
null
null
null
UTF-8
Java
false
false
2,030
java
/* Copyright (c) 2009 nullwire aps Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Contributors: Mads Kristiansen, mads.kristiansen@nullwire.com Glen Humphrey Evan Charlton Peter Hewitt */ package com.netdoers.errorreporting; import com.netdoers.utils.AppConstants; public class G { // This must be set by the application - it used to automatically // transmit exceptions to the trace server public static String FILES_PATH = AppConstants.IMAGE_DIRECTORY_PATH; public static String APP_VERSION = "unknown"; public static String APP_VERSION_CODE = "unknown";//ADDED VERSION CODE public static String APP_PACKAGE = "unknown"; public static String PHONE_MODEL = "unknown"; public static String PHONE_SIZE = "unknown";//ADDED DEVICE SIZE public static String ANDROID_VERSION = "unknown"; // Where are the stack traces posted? public static String URL = "http://trace.nullwire.com/collect/"; public static String TraceVersion = "0.3.0"; }
[ "vikalppatelce@yahoo.com" ]
vikalppatelce@yahoo.com
40a622982838973977ce73b6bb73f217561b8167
5ac9cfbc800575b178493578999f28822f5119dd
/src/main/java/br/com/ggdio/txtreplacer/resolver/UnaccentedResolver.java
411e51c3631feb91768831c79e413c185e09d5e9
[]
no_license
ggdio/txtreplacer
8ae9a163e64fd7b1941facd897207a0ca3631b93
4b0b48d5ff8cfa62705c8c36e0ffdd56b0bed33e
refs/heads/master
2016-09-06T02:08:29.982765
2013-09-16T18:11:18
2013-09-16T18:11:18
null
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
1,284
java
/***************************************************************************** * Unicode Escape Chars * * ã = \u00e3 * * õ = \u00f5 * * á = \u00e1 * * é = \u00e9 * * í = \u00ed * * ó = \u00f3 * * ç = \u00e7 * * â = \u00e2 * * ê = \u00ea * * ô = \u00f4 * ******************************************************************************/ package br.com.ggdio.txtreplacer.resolver; import java.util.HashMap; /** * Class responsible for replacing especial characters with unaccented characters * @author Guilherme Dio * @since 14/09/2013 */ public class UnaccentedResolver extends ResolverTemplate { @SuppressWarnings("serial") public UnaccentedResolver() { super(new HashMap<String, String>(){{ put("ã", "a"); put("õ", "o"); put("á", "a"); put("é", "e"); put("í", "i"); put("ó", "o"); put("ç", "c"); put("ê", "e"); put("ô", "o"); put("ú", "u"); put("Ã", "a"); put("Õ", "o"); put("Á", "a"); put("É", "e"); put("Í", "i"); put("Ó", "o"); put("Ç", "c"); put("Ê", "e"); put("Ô", "o"); put("Ú", "u"); }}); } }
[ "ggrdio@gmail.com" ]
ggrdio@gmail.com
bc9a42d16075faa221572da96624e7b1aa2aa1b3
d05a5062fbb136b1713ee404062e8025f941fe0d
/src/fiuba/algo3/modelo/movimientos/Izquierda.java
27736845dc95fa345a609b43534ae2764fb4dc72
[]
no_license
fcancel/trabajo-practivo2-algo3
712419380100514889e0c50e5d97fe7df8f77ccb
30ef0713bdccc35c034de143cc64ef5e757cb69a
refs/heads/master
2016-08-04T15:08:20.723817
2013-12-23T04:11:02
2013-12-23T04:11:02
32,886,458
0
0
null
null
null
null
UTF-8
Java
false
false
561
java
package fiuba.algo3.modelo.movimientos; import fiuba.algo3.modelo.excepciones.JuegoFinalizado; import fiuba.algo3.modelo.excepciones.JuegoNoIniciado; import fiuba.algo3.modelo.excepciones.MovimientoInvalido; import fiuba.algo3.modelo.vehiculo.Vehiculo; public class Izquierda implements Command{ private Vehiculo vehiculo; public Izquierda(Vehiculo vehiculo){ this.vehiculo = vehiculo; } @Override public void retroceder() throws JuegoNoIniciado, MovimientoInvalido, JuegoFinalizado { vehiculo.moverDerecha(); } }
[ "mafvidal@gmail.com@1b63ddbd-f892-29c8-733d-df3772dd4309" ]
mafvidal@gmail.com@1b63ddbd-f892-29c8-733d-df3772dd4309
1dfbac3e2cc9303db0a5ec0fee06c2cd49bdcd2d
ce8edec585e098144673dea60a1e79d14c3846c6
/src/com/sufurujhin/rpgdungeon/mobs/Chickens.java
a992e6cdd10b4b3dca555f1c5da5f1bcc87f2de7
[]
no_license
sufurujhin/RPGDungeon
eeb1c818872fdae865ce5a78e14d95c72dfadb6a
0b7120f44a470e1b4595c09745687800be03b31d
refs/heads/main
2023-03-15T06:27:37.504204
2021-03-09T09:30:07
2021-03-09T09:30:07
345,953,527
0
0
null
null
null
null
UTF-8
Java
false
false
1,716
java
package com.sufurujhin.rpgdungeon.mobs; import org.bukkit.Location; import org.bukkit.entity.Chicken; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.ItemStack; import com.sufurujhin.rpgdungeon.RPGDungeon; import com.sufurujhin.rpgdungeon.Utils.AttributeMobs; import net.minecraft.server.v1_16_R3.World; public class Chickens extends AttributeMobs{ private ItemStack[] items = new ItemStack[5]; private int[] slots = new int[5]; private double attack = 0.0; private double speed = 0.0; private float health = 0.0F; private String displayName = ""; private boolean baby = false; private boolean villager =false; private boolean twoHand = false; private int nv; private Location loc; public Chickens(RPGDungeon rpg,World world,Location loc, ItemStack[] items, double attack, double speed, float health, String displayName, boolean baby, boolean villager, int nv, int[] slots, boolean twoHand) { super(rpg); this.slots = slots; this.nv = nv; this.items = items; this.attack = attack; this.speed = speed; this.health = health; this.displayName = displayName; this.villager = villager; this.baby = baby; this.loc = loc; this.twoHand = twoHand; } public LivingEntity spawnChickens() { Chicken Chickens = (Chicken) loc.getWorld().spawnEntity(loc, EntityType.CHICKEN); setNivel(nv); setEntity(Chickens); setSpeed(speed); setGlowing(villager); setDisplayName(displayName); if(attack > 0){ setAttack(attack); } if(slots.length >0){ setSlots(slots); setItems(items); } if(baby){ setBaby(baby); } if(twoHand){ setTwoHand(twoHand); } setHealth(health); return getEntity(); } }
[ "46231089+sufurujhin@users.noreply.github.com" ]
46231089+sufurujhin@users.noreply.github.com
6ef9dc9e5c2602bd30249246c30cc27a843b6791
f434be2c9d2d899969459e1fa186a42b57e4f3f1
/src/org/grafana/api/responses/SearchFolderDashboardRsp.java
dd7ac980d47347386bef8b26ad02c3f2fd96545e
[ "MIT" ]
permissive
3LOQ/Grafana-Java-API
ea61c4eb152150eb093eb497f87aa58a326a878a
c216fc4450c645e376e344c222dd76f1a79abe4b
refs/heads/master
2023-04-13T01:26:00.982982
2020-10-01T06:01:31
2020-10-01T06:01:31
255,620,340
0
0
MIT
2023-04-04T01:12:01
2020-04-14T13:43:04
Java
UTF-8
Java
false
false
1,522
java
package org.grafana.api.responses; import java.util.ArrayList; import java.util.List; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; /** * * @author jh */ public class SearchFolderDashboardRsp { @SerializedName("id") @Expose private Integer id; @SerializedName("uid") @Expose private String uid; @SerializedName("title") @Expose private String title; @SerializedName("url") @Expose private String url; @SerializedName("type") @Expose private String type; @SerializedName("tags") @Expose private List<Object> tags = new ArrayList<Object>(); @SerializedName("isStarred") @Expose private Boolean isStarred; /** * * @return */ public Integer getId() { return id; } /** * * @return */ public String getUid() { return uid; } /** * * @return */ public String getTitle() { return title; } /** * * @return */ public String getUrl() { return url; } /** * * @return */ public String getType() { return type; } /** * * @return */ public List<Object> getTags() { return tags; } /** * * @return */ public Boolean getIsStarred() { return isStarred; } }
[ "jh@sup-w10-gpu-42.schramm-partner.ch" ]
jh@sup-w10-gpu-42.schramm-partner.ch