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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a46b3fb0cfdbe255de9e7f9e3f9ff2fcf1e5f37c
|
656ce78b903ef3426f8f1ecdaee57217f9fbc40e
|
/src/org/spongycastle/crypto/DerivationParameters.java
|
d5c6c92831c126952fc27e282bd375f89126949f
|
[] |
no_license
|
zhuharev/periscope-android-source
|
51bce2c1b0b356718be207789c0b84acf1e7e201
|
637ab941ed6352845900b9d465b8e302146b3f8f
|
refs/heads/master
| 2021-01-10T01:47:19.177515 | 2015-12-25T16:51:27 | 2015-12-25T16:51:27 | 48,586,306 | 8 | 10 | null | null | null | null |
UTF-8
|
Java
| false | false | 252 |
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 org.spongycastle.crypto;
public interface DerivationParameters
{
}
|
[
"[email protected]"
] | |
5dc3af7538c34650dfc864dac35b1231a284ce20
|
71119ff333be723084c36df3cb92f76235d3ee5c
|
/app/src/main/java/Division4Games/D4W9.java
|
d139b7fb55d3d8c17b3c5e23be07260c6d06e249
|
[] |
no_license
|
davidcairns35/Mid_Ulster_Football_League
|
b4374b7d9b390931067a8d0ddfcba8e569db6372
|
87bfd83b2cd1996eb913649e327036d0c8c1d7a7
|
refs/heads/master
| 2022-06-20T02:08:45.323958 | 2020-05-14T00:21:11 | 2020-05-14T00:21:11 | 238,273,490 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,667 |
java
|
package Division4Games;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.midulsterfootballleague.Fixtures;
import com.example.midulsterfootballleague.HomePage;
import com.example.midulsterfootballleague.Inbox;
import com.example.midulsterfootballleague.R;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import Holder.ResultHolder;
import LeagueTables.Division1;
import Model.Results;
public class D4W9 extends AppCompatActivity {
private androidx.appcompat.widget.Toolbar toolbar;
RecyclerView recyclerView;
DatabaseReference reference;
FirebaseDatabase database;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fixture_result_display);
toolbar = findViewById(R.id.myToolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Week 9");
recyclerView = findViewById(R.id.recycleview);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
database = FirebaseDatabase.getInstance();
reference= database.getReference("results").child("division4").child("week9");
BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation);
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
switch (menuItem.getItemId()){
case R.id.nav_home:
Intent intent = new Intent(D4W9.this, HomePage.class);
startActivity(intent);
break;
case R.id.nav_table:
Intent intent2 = new Intent(D4W9.this, Division1.class);
startActivity(intent2);
break;
case R.id.nav_club:
Intent intent3 = new Intent(D4W9.this, Fixtures.class);
startActivity(intent3);
break;
case R.id.nav_inbox:
Intent intent4 = new Intent(D4W9.this, Inbox.class);
startActivity(intent4);
break;
}
return false;
}
});
}
@Override
protected void onStart() {
super.onStart();
FirebaseRecyclerAdapter<Results, ResultHolder> firebaseRecyclerAdapter =
new FirebaseRecyclerAdapter<Results, ResultHolder>(
Results.class,
R.layout.results,
ResultHolder.class,
reference) {
@Override
protected void populateViewHolder(ResultHolder resultHolder, Results results, int i) {
resultHolder.setView(getApplicationContext(), results.getHome(), results.getScore(),
results.getAway());
}
};
recyclerView.setAdapter(firebaseRecyclerAdapter);
}
@Override
public boolean onCreateOptionsMenu (Menu menu) {
MenuInflater inflater=getMenuInflater();
inflater.inflate(R.menu.result_27, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.week1:
Intent intent1 = new Intent(D4W9.this, D4W1.class);
startActivity(intent1);
break;
case R.id.week2:
Intent intent2 = new Intent(D4W9.this, D4W2.class);
startActivity(intent2);
break;
case R.id.week3:
Intent intent3 = new Intent(D4W9.this, D4W3.class);
startActivity(intent3);
break;
case R.id.week4:
Intent intent4 = new Intent(D4W9.this, D4W4.class);
startActivity(intent4);
break;
case R.id.week5:
Intent intent5 = new Intent(D4W9.this, D4W5.class);
startActivity(intent5);
break;
case R.id.week6:
Intent intent6 = new Intent(D4W9.this, D4W6.class);
startActivity(intent6);
break;
case R.id.week7:
Intent intent7 = new Intent(D4W9.this, D4W7.class);
startActivity(intent7);
break;
case R.id.week8:
Intent intent8 = new Intent(D4W9.this, D4W8.class);
startActivity(intent8);
break;
case R.id.week9:
Intent intent9 = new Intent(D4W9.this, D4W9.class);
startActivity(intent9);
break;
case R.id.week10:
Intent intent10 = new Intent(D4W9.this, D4W10.class);
startActivity(intent10);
break;
case R.id.week11:
Intent intent11 = new Intent(D4W9.this, D4W11.class);
startActivity(intent11);
break;
case R.id.week12:
Intent intent12 = new Intent(D4W9.this, D4W12.class);
startActivity(intent12);
break;
case R.id.week13:
Intent intent13 = new Intent(D4W9.this, D4W13.class);
startActivity(intent13);
break;
case R.id.week14:
Intent intent14 = new Intent(D4W9.this, D4W14.class);
startActivity(intent14);
break;
case R.id.week15:
Intent intent15 = new Intent(D4W9.this, D4W15.class);
startActivity(intent15);
break;
case R.id.week16:
Intent intent16 = new Intent(D4W9.this, D4W16.class);
startActivity(intent16);
break;
case R.id.week17:
Intent intent17 = new Intent(D4W9.this, D4W17.class);
startActivity(intent17);
break;
case R.id.week18:
Intent intent18 = new Intent(D4W9.this, D4W18.class);
startActivity(intent18);
break;
case R.id.week19:
Intent intent19 = new Intent(D4W9.this, D4W19.class);
startActivity(intent19);
break;
case R.id.week20:
Intent intent20 = new Intent(D4W9.this, D4W20.class);
startActivity(intent20);
break;
case R.id.week21:
Intent intent21 = new Intent(D4W9.this, D4W21.class);
startActivity(intent21);
break;
case R.id.week22:
Intent intent22 = new Intent(D4W9.this, D4W22.class);
startActivity(intent22);
break;
case R.id.week23:
Intent intent23 = new Intent(D4W9.this, D4W23.class);
startActivity(intent23);
break;
case R.id.week24:
Intent intent24 = new Intent(D4W9.this, D4W24.class);
startActivity(intent24);
break;
case R.id.week25:
Intent intent25 = new Intent(D4W9.this, D4W25.class);
startActivity(intent25);
break;
case R.id.week26:
Intent intent26 = new Intent(D4W9.this, D4W26.class);
startActivity(intent26);
break;
case R.id.week27:
Intent intent27 = new Intent(D4W9.this, D4W27.class);
startActivity(intent27);
break;
}
return false;
}
}
|
[
"[email protected]"
] | |
6fe6d0100dcb1c8db31f67680341f43aa2c0ac51
|
5b4e718cd28795fe01a6c0c6bd815f0fb383bb61
|
/Android/SoundRecorder/src/com/wiseapps/davacon/core/se/SERecordAudioStream.java
|
404751b885888cb46091e6d2b45062971f93eb16
|
[] |
no_license
|
artureg/DictatePro
|
2289cff8191cfb896ca3e624a5adffa5300437b6
|
8c44ac6c26912f51d75262bbab357c66e06b0288
|
refs/heads/master
| 2020-05-14T20:47:56.386758 | 2015-02-13T10:58:19 | 2015-02-13T10:58:19 | 30,751,850 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,550 |
java
|
//package com.wiseapps.davacon.core.se;
//
//import android.content.Context;
//import com.wiseapps.davacon.logging.LoggerFactory;
//import com.wiseapps.davacon.speex.SpeexWrapper;
//
//import static com.wiseapps.davacon.core.se.SEProjectEngine.*;
//
///**
// * @author [email protected]
// * Date: 4/14/14
// * Time: 11:56 AM
// */
//class SERecordAudioStream extends SEAudioStream {
// private static final String TAG = SERecordAudioStream.class.getSimpleName();
//
// private final SERecord record;
//
// SERecordAudioStream(final SERecord record, Context context) {
// super(context);
//
// this.record = record;
// }
//
// @Override
// public void open(Mode mode) {
// this.mode = mode;
// }
//
// @Override
// public void close() {
// if (mode == Mode.READ) {
// return;
// }
//
// SDCardUtils.writeProject(record.project);
// }
//
// @Override
// public void clear() {
// }
//
// @Override
// public void write(byte[] data) {
//// int format = SpeexWrapper.getFormat(record.soundPath);
// int format = 0; // .wav, 41225 for now speex
//
// int result = SpeexWrapper.write(record.soundPath, data, format);
// LoggerFactory.obtainLogger(TAG).d("write# result = " + result);
//
// // update record's and project's durations
// if (result == 0) {
// double duration =
// calculateDurationFromDataLength(data.length);
//
// record.position += duration;
// record.duration += duration;
//
// record.project.duration += duration;
// }
// }
//
// @Override
// public byte[] read(double position, double duration) {
//// int format = SpeexWrapper.getFormat(record.soundPath);
// int format = 0; // .wav, 41225 for now speex
//
// return SpeexWrapper.read(record.soundPath, position, duration, format);
// }
//
// @Override
// Mode getMode() {
// return mode;
// }
//
// private double calculateDurationFromDataLength(int length) {
// double sampleRate = (double) SAMPLE_RATE_IN_HZ;
// double numChannels = mode == Mode.WRITE ?
// (double) CHANNEL_CONFIG_IN : (double) CHANNEL_CONFIG_OUT;
// double bitsPerSample = (double) BITS_PER_SAMPLE;
//
// return ((double) length) / (sampleRate * numChannels * bitsPerSample / 8);
// }
//}
|
[
"barbara@localhost"
] |
barbara@localhost
|
c4d83bab372abc2f7039a1fcfdcd9d0802abc273
|
c4d1d62ba3e955c6c999ca813490c750b31672ec
|
/src/testCases/IBM_E2E012_Auntenticacion_Perfil_Logistica.java
|
9e4397384eb3a775b7a5866dd25e4314074be3e4
|
[] |
no_license
|
GarimaMSinha/NASRegFramework
|
edd843f66aaa4fec5348bdf81edf954b43afe1f0
|
3b4b05d49281b17e8ebeb48fa3b7c02dae4b49a1
|
refs/heads/master
| 2020-03-19T07:36:46.052773 | 2018-07-25T11:00:23 | 2018-07-25T16:21:42 | 136,131,103 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 149 |
java
|
package testCases;
import org.testng.annotations.Test;
public class IBM_E2E012_Auntenticacion_Perfil_Logistica {
@Test
public void f() {
}
}
|
[
"[email protected]"
] | |
f08b9adce86e2112044d8e38e7912bd18647bb90
|
2d8f60d8aedd68a7d9597f09a178fd39a1bd4663
|
/lib_common/src/main/java/google/architecture/common/upgrade/DeHongProvider.java
|
7a91d12cf4ba149704f047185c7ea379eb70be76
|
[
"Apache-2.0"
] |
permissive
|
xmutzlq/MShop
|
7d551cb3996e968d90fab3bdb9b7e247a753784a
|
3d631f96cadae0fabbf8d8c7f93801ac7eed4af5
|
refs/heads/master
| 2020-04-10T16:11:10.842996 | 2019-01-29T06:05:09 | 2019-01-29T06:05:09 | 161,136,426 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 149 |
java
|
package google.architecture.common.upgrade;
import android.support.v4.content.FileProvider;
public class DeHongProvider extends FileProvider {
}
|
[
"[email protected]"
] | |
7fc636e1cb4a3a16ba5315026acb9ab452c3a863
|
5cf76c7d0bbacfdded1c873248c65bc977378a81
|
/app/src/main/java/com/gilang/icuwatch/MainActivity.java
|
0bfbaf2cd55590cdab30bd58efb8ca0c2e9d24dc
|
[] |
no_license
|
GilangJulianS/ICU-Watch
|
42e82191277153ad2a430f1279fd165d69a7b403
|
223a1d55816a27fb4aa9294909887c2f544bed3f
|
refs/heads/master
| 2020-12-24T18:51:47.535620 | 2016-04-16T12:58:17 | 2016-04-16T12:58:17 | 56,128,555 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 818 |
java
|
package com.gilang.icuwatch;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.gilang.icuwatch.fragment.LoginFragment;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportFragmentManager().beginTransaction().replace(R.id.container, LoginFragment.newInstance(this)).commit();
}
@Override
public void onBackPressed() {
FragmentManager manager = getSupportFragmentManager();
if(manager.getBackStackEntryCount() > 0){
manager.popBackStack();
}else{
super.onBackPressed();
}
}
}
|
[
"[email protected]"
] | |
b6c98db3f11ce3de00f1becc2cc17a8c4b79a835
|
9f13ccb3b85c18439f73ad821ca080f12d2e30b6
|
/app/src/main/java/com/larrex/doctorapp/fragment/DoctorFragment1.java
|
58d3e18944f296f88e51314e702b30b9d1d3d838
|
[] |
no_license
|
eflexcode/DoctorApp
|
92f0430e8614764d763c6fd025c5816b31ff4678
|
25872880cf25f608f722727d49381c10c7f35de9
|
refs/heads/master
| 2023-04-07T08:32:09.390190 | 2021-04-20T14:31:59 | 2021-04-20T14:31:59 | 359,845,830 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,088 |
java
|
package com.larrex.doctorapp.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.larrex.doctorapp.R;
/**
* A simple {@link Fragment} subclass.
* Use the {@link DoctorFragment1#newInstance} factory method to
* create an instance of this fragment.
*/
public class DoctorFragment1 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 DoctorFragment1() {
// 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 DoctorFragment1.
*/
// TODO: Rename and change types and number of parameters
public static DoctorFragment1 newInstance(String param1, String param2) {
DoctorFragment1 fragment = new DoctorFragment1();
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_doctor1, container, false);
}
}
|
[
"[email protected]"
] | |
a7cc1dfdb5d2662741336bfc4fb75625de780c4f
|
49eee8ffd5187699673e6ff5ba724969e486ceb5
|
/src/dao/tabf_yesnoBeanDAO.java
|
cf40dc408b59147bbe8c85e56c5ead5cac1fa888
|
[] |
no_license
|
xu1yun2fei3/workSysterm
|
b74fc6336fa8a5755d76d095be54392f1fccabd5
|
fb9523ceb36fe8d9abd9c1b9101f54b659a22c62
|
refs/heads/master
| 2020-05-07T08:15:15.503595 | 2019-04-09T07:51:31 | 2019-04-09T07:51:31 | 180,313,863 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,969 |
java
|
package dao;
import bean.tabf_yesnoBean;
import bean.tabf_yesnoBeanExample;
import java.util.List;
public interface tabf_yesnoBeanDAO {
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
int countByExample(tabf_yesnoBeanExample example);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
int deleteByExample(tabf_yesnoBeanExample example);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
void insert(tabf_yesnoBean record);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
void insertSelective(tabf_yesnoBean record);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
List<tabf_yesnoBean> selectByExample(tabf_yesnoBeanExample example);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
tabf_yesnoBean selectByPrimaryKey(Integer id);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
int updateByExampleSelective(tabf_yesnoBean record, tabf_yesnoBeanExample example);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
int updateByExample(tabf_yesnoBean record, tabf_yesnoBeanExample example);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
int updateByPrimaryKeySelective(tabf_yesnoBean record);
/**
* This method was generated by Apache iBATIS ibator.
* This method corresponds to the database table tabf_yesno
*
* @ibatorgenerated Mon Feb 25 18:31:15 CST 2019
*/
int updateByPrimaryKey(tabf_yesnoBean record);
}
|
[
"[email protected]"
] | |
fac1545e8f37da88a9101252e6fc7e0c16239d4b
|
487be1558ab556688d5d204fe234ac1d0a6ff968
|
/src/chemotaxis/sim/SimPrinter.java
|
e54cdfb665458c6787e2ff83dd839a490b1aff01
|
[] |
no_license
|
adilovesgh/coms4444-chemotaxis
|
d90252a69610bdeaf63f59befdb4d32be39161ad
|
16c617e290eccb753569a7ee05b809c86d01b08b
|
refs/heads/master
| 2022-12-30T19:33:50.696233 | 2020-10-24T22:39:18 | 2020-10-24T22:39:18 | 291,411,148 | 0 | 9 | null | 2020-10-25T22:42:09 | 2020-08-30T06:07:00 |
Java
|
UTF-8
|
Java
| false | false | 410 |
java
|
package chemotaxis.sim;
public class SimPrinter {
boolean enablePrints = true;
public SimPrinter(boolean enablePrints) {
this.enablePrints = enablePrints;
}
public void println() {
if(enablePrints)
System.out.println();
}
public void println(Object obj) {
if(enablePrints)
System.out.println(obj);
}
public void print(Object obj) {
if(enablePrints)
System.out.print(obj);
}
}
|
[
"[email protected]"
] | |
7bcde6e7d8d1f2c1b92e6676b1e08b50a83b02fb
|
2043467dfdd12c6ec461ac0a615ed2162f19d577
|
/SpMVC29_MyShop2V2/src/main/java/com/biz/shop/service/ProOptionsService.java
|
2c8b79c02b590a7fa2d34a995203890b1895aaec
|
[] |
no_license
|
atakage/Shop_Project
|
970686a551a022e8df1046a0c661d65b66e9ccfd
|
813d6e65778cb225392789cbf8dd2769ba1931fc
|
refs/heads/master
| 2022-12-23T04:57:32.473430 | 2020-06-08T05:25:52 | 2020-06-08T05:25:52 | 244,572,033 | 0 | 0 | null | 2022-12-16T15:39:55 | 2020-03-03T07:41:34 |
Java
|
UTF-8
|
Java
| false | false | 747 |
java
|
package com.biz.shop.service;
import java.util.List;
import com.biz.shop.domain.ProColorVO;
import com.biz.shop.domain.ProOptionsVO;
import com.biz.shop.domain.ProSizeVO;
public interface ProOptionsService {
public List<ProOptionsVO> getColorList();
public List<ProOptionsVO> getSizeList();
public int insert_size(ProSizeVO proSizeVO);
public Object insert_color(ProColorVO proColorVO);
// tbl_pro_table에 상품코드가 같고 사이즈가 같은 레코드가 이미 등록(저장)되어 있는지 판단하기 위한 method
public int getProSize(ProSizeVO proSizeVO);
public int delete_size(ProSizeVO proSizeVO);
//public int getProColor(ProColorVO proColorVO);
public List<ProColorVO> getColorListBySize(String s_seq);
}
|
[
"[email protected]"
] | |
c8889926eb65020bbe4a71bd58df6ceb496dc1cc
|
83110fbb179713c411ddf301c90ef4b814285846
|
/src/RemoveUserResponse.java
|
9880ed2f82198f14fe4bf3aed91285d37be617c6
|
[] |
no_license
|
mikelopez/jvm
|
f10590edf42b498f2d81dec71b0fee120e381c9a
|
36a960897062224eabd0c18a1434f7c8961ee81c
|
refs/heads/master
| 2021-01-19T05:36:54.710665 | 2013-06-09T04:36:41 | 2013-06-09T04:36:41 | 3,783,647 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 766 |
java
|
package com.vmware.vim25;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "RemoveUserResponse")
public class RemoveUserResponse {
}
|
[
"[email protected]"
] | |
b1901ae9b6aa97e8e0d8dae8b14ca5fdbef3b760
|
6d8ffb3f0579811a2ce96e392505af70db5d66ab
|
/app/src/main/java/com/akabetech/belaundryondemand/adapter/viewholder/SimpleTwoFieldViewHolder.java
|
17c0958485f9dac23a6cf5e8db32144928626366
|
[] |
no_license
|
kevinmel2000/belaundry
|
7f6a22fb0f485f0d81d46054ccf04427be5b8fff
|
8be72e3904f6e3a6891240e9c939fa0b4031b30f
|
refs/heads/master
| 2020-03-23T23:54:32.617603 | 2017-08-07T22:09:05 | 2017-08-07T22:09:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 727 |
java
|
package com.akabetech.belaundryondemand.adapter.viewholder;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import com.akabetech.belaundryondemand.R;
/**
* Created by akbar.pambudi on 8/22/2016.
*/
public class SimpleTwoFieldViewHolder extends RecyclerView.ViewHolder {
private TextView field1;
private TextView field2;
public SimpleTwoFieldViewHolder(View v){
super(v);
field1 = ((TextView)v.findViewById(R.id.field_1_simple_twofield));
field2 = ((TextView)v.findViewById(R.id.field_2_simple_twofield));
}
public void bind(String[] value){
field1.setText(value[0]);
field2.setText(value[1]);
}
}
|
[
"[email protected]"
] | |
8058cfcfa2b706f1d6cc118fbff6237e7aac109a
|
a6f6f30ca91302d39dc28f43786589654ff552c7
|
/src/com/jinfang/golf/network/TimeoutError.java
|
50ac90f9f219ff227e820df082c1000b8dce92e1
|
[] |
no_license
|
golfandroid/GolfAndroid
|
dfac6318dc824752d60938aa1d404315e2908878
|
3cd303307ba1bf224defb67b586c7e77d4c9d9ba
|
refs/heads/master
| 2016-09-06T10:14:40.838243 | 2013-11-19T11:32:51 | 2013-11-19T11:32:51 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 800 |
java
|
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jinfang.golf.network;
/**
* Indicates that the connection or the socket timed out.
*/
@SuppressWarnings("serial")
public class TimeoutError extends VolleyError { }
|
[
"[email protected]"
] | |
e9dedacd4e39fa73ec07142eac7702938df9298f
|
a9452839e282453920201676bf5049e11d809b6e
|
/src/test/java/ReimbursementTests.java
|
77f5e20f7fa8cd8238dcd834726c2548d71e41e6
|
[] |
no_license
|
1802february26java/1802-ers-james-kempf
|
35ccc49a095da5aa145a411f9b583ef50b1b39dd
|
78b224655ad6224e185a5687cd76862cde4c99b5
|
refs/heads/master
| 2021-09-10T18:08:54.671012 | 2018-03-30T17:05:09 | 2018-03-30T17:05:09 | 124,590,894 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,406 |
java
|
import static org.junit.Assert.assertEquals;
import java.time.LocalDateTime;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
import com.revature.model.Employee;
import com.revature.model.EmployeeRole;
import com.revature.model.Reimbursement;
import com.revature.model.ReimbursementStatus;
import com.revature.model.ReimbursementType;
import com.revature.repository.ReimbursementRepository;
import com.revature.repository.ReimbursementRepositoryJdbc;
import com.revature.service.ReimbursementService;
import com.revature.service.ReimbursementServiceAlpha;
public class ReimbursementTests {
private static ReimbursementService reimbursementService = ReimbursementServiceAlpha.getInstance();
private static ReimbursementRepository reimbursementRepository = ReimbursementRepositoryJdbc.getInstance();
private static Employee employee = new Employee(
88,
"Zelda",
"Zebra",
"zeldaz",
"p4ssw0rd",
"[email protected]",
new EmployeeRole(1,"EMPLOYEE")
);
private static Reimbursement databaseReimbursement;
private static Reimbursement reimbursement = new Reimbursement(
99,
LocalDateTime.now(),
null,
100,
"Lorem Ipsum",
employee,
null,
new ReimbursementStatus(1, "PENDING"),
new ReimbursementType(1, "OTHER")
);
@BeforeClass
public static void insertReimbursement() {
reimbursementRepository.update(reimbursement);
databaseReimbursement = reimbursementService.getUserPendingRequests(employee).iterator().next();
}
@After
public void refreshReimbursement() {
reimbursementRepository.update(reimbursement);
databaseReimbursement = reimbursementService.getSingleRequest(reimbursement);
}
@Test
public void approveReimbursement() {
databaseReimbursement.setStatus(new ReimbursementStatus(3, "APPROVED"));
assertEquals(true, reimbursementService.finalizeRequest(databaseReimbursement));
}
@Test
public void denyReimbursement() {
databaseReimbursement.setStatus(new ReimbursementStatus(2, "DECLINED"));
assertEquals(true, reimbursementService.finalizeRequest(databaseReimbursement));
}
@Test
public void finalizedInvalidReimbursement() {
databaseReimbursement.setStatus(new ReimbursementStatus(2, "DECLINED"));
databaseReimbursement.setId(0);
assertEquals(false, reimbursementService.finalizeRequest(databaseReimbursement));
}
@Test
public void getUserPendingRequests() {
assertEquals(true, reimbursementService.getUserPendingRequests(employee) != null);
}
@Test
public void getUserFinalizedRequests() {
assertEquals(true, reimbursementService.getUserFinalizedRequests(employee) != null);
}
@Test
public void getInvalidPendingRequests() {
Employee invalidEmployee = new Employee(0);
assertEquals(true, reimbursementService.getUserPendingRequests(invalidEmployee).isEmpty());
}
@Test
public void getInvalidFinalizedRequests() {
Employee invalidEmployee = new Employee(0);
assertEquals(true, reimbursementService.getUserFinalizedRequests(invalidEmployee).isEmpty());
}
@Test
public void getAllPendingRequests() {
assertEquals(true, reimbursementService.getAllPendingRequests() != null);
}
@Test
public void getAllResolvedRequests() {
assertEquals(true, reimbursementService.getAllResolvedRequests() != null);
}
@Test
public void getTypes() {
assertEquals(true, reimbursementService.getReimbursementTypes().size() == 4);
}
}
|
[
"[email protected]"
] | |
8f6b550a75e3b0b148d7a869eaacd94f446bf6b2
|
951e3179b938c6b5e924992dcae3e42a71a515fa
|
/LP_SGMR/src/Trabalho/ListPilha.java
|
3a9e983bb5e12c0646ee88d0adb786ead3c7425d
|
[] |
no_license
|
nunohonrado04/LP_SGMR
|
66d9c0229ef33ef3e4c3f8540f786af9a12254fc
|
6d256e2899b5cc1dc16888dc81790228f334b466
|
refs/heads/master
| 2022-11-01T07:27:05.579658 | 2020-06-15T21:27:45 | 2020-06-15T21:27:45 | 265,532,333 | 0 | 0 | null | null | null | null |
ISO-8859-1
|
Java
| false | false | 826 |
java
|
package Trabalho;
import java.util.EmptyStackException;
public class ListPilha implements Pilha
{
private NoLista top;
public ListPilha()
{
top = null;
}//ListPilha
@Override
public void colocar(int i)
{
NoLista novo = new NoLista(i, top);
top = novo;
}//colocar
@Override
public int retirar()
{
if( estaVazia() )
{
System.out.println("Não existe mesas!");
throw new EmptyStackException();
}
int primeiro = top.getValor();
top = top.getSeguinte();
return primeiro;
}//retirar
@Override
public int obter()
{
if( estaVazia() )
{
System.out.println("Não existe de momento mesas disponíveis!");
throw new EmptyStackException();
}
return top.getValor();
}//obter
@Override
public boolean estaVazia()
{
return top == null;
}//estaVazia
}//ListPilha
|
[
"[email protected]"
] | |
cdc605a2009dac04778ec1908cad8c5255421e4e
|
e2edd0f8c32e75e01bbf4b880ef9a417283fd855
|
/src/main/java/com/yyhz/sc/data/dao/impl/CardPictureDaoImpl.java
|
197dd911090b5a9ef98cbf2b3289673fd3d525e7
|
[] |
no_license
|
magicfengq/yyhz
|
b44590da8daa3595328445d27ea0c2935dd151b1
|
c318030c778e8315bbb5d923dff067d09e453fba
|
refs/heads/master
| 2021-07-08T17:44:19.646117 | 2019-03-30T03:40:23 | 2019-03-30T03:40:23 | 148,319,529 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 411 |
java
|
package com.yyhz.sc.data.dao.impl;
import org.springframework.stereotype.Component;
import com.yyhz.sc.base.BaseDaoImpl;
import com.yyhz.sc.data.dao.CardPictureDao;
import com.yyhz.sc.data.model.CardPicture;
/**
*
* @author mew
*
*/
@Component
public class CardPictureDaoImpl extends BaseDaoImpl<CardPicture> implements CardPictureDao{
public CardPictureDaoImpl(){
setSql_name_space(sqlNameSpace);
}
}
|
[
"[email protected]"
] | |
9b2928ffb1e4ed6f25eced160b91645d978f8faf
|
9d9948297bf10615e88c83671d1f875c8e168827
|
/src/main/java/code/二叉搜索树中第K小的元素.java
|
61ff5afcd5c4903b3a28d42df0ff90ad8ec51078
|
[] |
no_license
|
mocas-usr/AlgorithmCode
|
f3f485df4655835a20658fed938e280aa017e7b8
|
729a2162496df4efaaf80cf2e2d5ef5006ba5d59
|
refs/heads/master
| 2023-07-11T12:16:57.109079 | 2021-08-03T14:01:38 | 2021-08-03T14:01:38 | 303,336,213 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 756 |
java
|
package code;/**
* Created with IntelliJ IDEA
*
* @Author: mocas
* @Date: 2021/4/12 下午7:20
* @email: [email protected]
*/
import java.util.LinkedList;
/**
*@program: AlgorithmCode
*@description:
*@author: mocas_wang
*@create: 2021-04-12 19:20
*/
public class 二叉搜索树中第K小的元素 {
LinkedList<Integer> list=new LinkedList<>();
public int kthSmallest(TreeNode root, int k) {
if (root==null)
{
return -1;
}
dfs(root);
int res=list.get(k-1);
return res;
}
public void dfs(TreeNode root)
{
if (root==null)
{
return;
}
dfs(root.left);
list.add(root.val);
dfs(root.right);
}
}
|
[
"[email protected]"
] | |
270a59fabb2761acf051bf56492e2d4bb7bdf0eb
|
25533f0809917a340cb72ab56f0b3a248461a973
|
/src/main/java/org/ciberfarma/vista/JPATest01.java
|
1d8f8208586cd791363e0bfa140bd549f9cccb0b
|
[] |
no_license
|
jolumendoza/dawi-t5bb-2021-1
|
6f7d35388603f8b74051b728f4a37f87863e008c
|
e7415ebd114381c16ba61bd132e0d6bc32ad4f31
|
refs/heads/master
| 2023-04-06T01:54:25.802015 | 2021-04-24T01:16:27 | 2021-04-24T01:16:27 | 361,049,419 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,005 |
java
|
package org.ciberfarma.vista;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.ciberfarma.modelo.Usuario;
public class JPATest01 {
public static void main(String[] args) {
// Crear un objeto de Usuario a grabar
Usuario u = new Usuario();
//u.setCodigo(10);
u.setNombre("Eren");
u.setApellido("Lopez");
u.setUsuario("[email protected]");
u.setClave("123");
u.setFnacim("2000/10/15");
u.setTipo(1);
u.setEstado(1);
// grabar el objeto
// 1. fabricar el acceso a los datos
EntityManagerFactory fabrica = Persistence.createEntityManagerFactory("jpa_sesion01");
// 2. crear el manejador de entidades
EntityManager em = fabrica.createEntityManager();
// 3. empezar mi transacci�n
em.getTransaction().begin();
// proceso a realizar (persistencia)
em.persist(u);
//em.merge(u);
// 4. confirmar la transacci�n
em.getTransaction().commit();
em.close();
}
}
|
[
"[email protected]"
] | |
5e0b7ecd4c449321cf3779614f857a1b46dddedf
|
cf58ffbd9a3f1f2689d4e223ccc29348585263c1
|
/src/main/java/com/vo/uservo/LoginReq.java
|
585ebdb7172bb81c2eb91a8dae85cc715b5d7266
|
[] |
no_license
|
cwzz/PictureTag_Phase_III
|
461a21096c0625c958603a51ef77234a1926afb8
|
f564e508ec5d836832b98111d508c5f803e2f8ce
|
refs/heads/master
| 2020-03-21T04:44:19.979853 | 2018-06-22T08:03:52 | 2018-06-22T08:03:52 | 138,124,795 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 215 |
java
|
package com.vo.uservo;
import lombok.Data;
/**
* @Author:zhangping
* @Description:
* @CreateData: 2018/4/13 10:20
*/
@Data
public class LoginReq {
private String username;
private String password;
}
|
[
"[email protected]"
] | |
2a2ecde83eb9d425b5f28ba8ff7a867d1e49b1d2
|
811f499fb56cac6662f548e8a8f23544fa8c3f8e
|
/index-service/src/main/java/com/wyq/feign/IProductService.java
|
6f4abbf89a3afeb62ae7af6421bd03872c162e0f
|
[] |
no_license
|
WYQ168/testGit
|
f94843357864fd07d56769076676856459a58721
|
2b418158b2977112630ab7cadf1ac1052a31d97a
|
refs/heads/master
| 2022-12-11T14:53:32.230129 | 2020-09-14T06:59:02 | 2020-09-14T06:59:02 | 295,328,191 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 788 |
java
|
package com.wyq.feign;
import com.wyq.entity.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.ArrayList;
import java.util.List;
@FeignClient(name = "PRODUCT-SERVICE",fallback = IProductService.ProductServiceCallback.class)
public interface IProductService {
//正常的调用逻辑
@GetMapping("product/list")
public List<Product> list();
//添加兜底方案
@Component
static class ProductServiceCallback implements IProductService{
@Override
public List<Product> list() {
System.out.println("进入Hystrix熔断处理逻辑...");
return new ArrayList<>();
}
}
}
|
[
"[email protected]"
] | |
3ab7321a30901473685f4d3bc2a2811c2a55bb32
|
3996e5ab1f15a894b8273af6e88434119d9af089
|
/src/de/bht/fb6/cg1/raytracer/math/impl/Vector3DImpl.java
|
75434113b5e332e406339099576000fab9db626b
|
[] |
no_license
|
GammaG/CG
|
44cd2093a151bea90e1dfd5306abdf6087a0a3c0
|
1025f97aff3686f7ca7300d423f3c9c8c984135f
|
refs/heads/master
| 2016-09-06T19:02:21.079728 | 2013-10-13T13:48:00 | 2013-10-13T13:48:00 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,793 |
java
|
/**
*
*/
package de.bht.fb6.cg1.raytracer.math.impl;
import de.bht.fb6.cg1.raytracer.math.Normal;
import de.bht.fb6.cg1.raytracer.math.Point3D;
import de.bht.fb6.cg1.raytracer.math.Vector3D;
/**
* @author Martin Schultz
*
*/
public class Vector3DImpl implements Vector3D {
private final double xValue;
private final double yValue;
private final double zValue;
/**
* Generate a new Vector3D.
*
* @param x
* The x component of the Vector.
* @param y
* The y component of the Vector.
* @param z
* The z component of the Vector.
*/
public Vector3DImpl(final double x, final double y, final double z) {
this.xValue = x;
this.yValue = y;
this.zValue = z;
}
/*
* (non-Javadoc)
*
* @see de.bht.fb6.cg1.raytracer.math.Vector3D#getMagnitude()
*/
@Override
public double getMagnitude() {
return Math.sqrt(xValue * xValue + yValue * yValue + zValue * zValue);
}
/*
* (non-Javadoc)
*
* @see
* de.bht.fb6.cg1.raytracer.math.Vector3D#add(de.bht.fb6.cg1.raytracer.math
* .Vector3D)
*/
@Override
public Vector3D add(Vector3D rhs) {
if (rhs == null) {
throw new IllegalArgumentException("Argument shouldn't be null");
}
return new Vector3DImpl(xValue + rhs.getX(), yValue + rhs.getY(), zValue + rhs.getZ());
}
/*
* (non-Javadoc)
*
* @see
* de.bht.fb6.cg1.raytracer.math.Vector3D#add(de.bht.fb6.cg1.raytracer.math
* .Normal)
*/
@Override
public Vector3D add(final Normal rhs) {
if (rhs == null) {
throw new IllegalArgumentException("Argument shouldn't be null");
}
return new Vector3DImpl(xValue + rhs.getX(), yValue + rhs.getY(), zValue + rhs.getZ());
}
/*
* (non-Javadoc)
*
* @see
* de.bht.fb6.cg1.raytracer.math.Vector3D#sub(de.bht.fb6.cg1.raytracer.math
* .Vector3D)
*/
@Override
public Vector3D sub(final Vector3D rhs) {
if (rhs == null) {
throw new IllegalArgumentException("Argument shouldn't be null");
}
return new Vector3DImpl(xValue - rhs.getX(), yValue - rhs.getY(), zValue - rhs.getZ());
}
/*
* (non-Javadoc)
*
* @see de.bht.fb6.cg1.raytracer.math.Vector3D#mul(double)
*/
@Override
public Vector3D mul(final double rhs) {
return new Vector3DImpl(xValue * rhs, yValue * rhs, zValue * rhs);
}
/*
* (non-Javadoc)
*
* @see de.bht.fb6.cg1.raytracer.math.Vector3D#div(double)
*/
@Override
public Vector3D div(final double rhs) {
return new Vector3DImpl(xValue / rhs, yValue / rhs, zValue / rhs);
}
/*
* (non-Javadoc)
*
* @see
* de.bht.fb6.cg1.raytracer.math.Vector3D#dot(de.bht.fb6.cg1.raytracer.math
* .Normal)
*/
@Override
public double dot(final Normal rhs) {
if (rhs == null) {
throw new IllegalArgumentException("Argument shouldn't be null");
}
return this.xValue * rhs.getX() + this.yValue * rhs.getY() + this.zValue * rhs.getZ();
}
/*
* (non-Javadoc)
*
* @see
* de.bht.fb6.cg1.raytracer.math.Vector3D#dot(de.bht.fb6.cg1.raytracer.math
* .Vector3D)
*/
@Override
public double dot(final Vector3D rhs) {
if (rhs == null) {
throw new IllegalArgumentException("Argument shouldn't be null");
}
return this.xValue * rhs.getX() + this.yValue * rhs.getY() + this.zValue * rhs.getZ();
}
/*
* (non-Javadoc)
*
* @see
* de.bht.fb6.cg1.raytracer.math.Vector3D#cross(de.bht.fb6.cg1.raytracer.math
* .Vector3D)
*/
@Override
public Vector3D cross(final Vector3D rhs) {
if (rhs == null) {
throw new IllegalArgumentException("Argument shouldn't be null");
}
return new Vector3DImpl(yValue * rhs.getZ() - zValue * rhs.getY(), zValue * rhs.getX() - xValue * rhs.getZ(),
xValue * rhs.getY() - yValue * rhs.getX());
}
/*
* (non-Javadoc)
*
* @see de.bht.fb6.cg1.raytracer.math.Vector3D#asNormal()
*/
@Override
public Normal asNormal() {
return new NormalImpl(xValue, yValue, zValue);
}
/*
* (non-Javadoc)
*
* @see de.bht.fb6.cg1.raytracer.math.Vector3D#asPoint()
*/
@Override
public Point3D asPoint() {
return new Point3DImpl(xValue, yValue, zValue);
}
/*
* (non-Javadoc)
*
* @see de.bht.fb6.cg1.raytracer.math.Vector3D#normalized()
*/
@Override
public Vector3D normalized() {
final double factor = 1 / Math.sqrt(xValue * xValue + yValue * yValue + zValue * zValue);
return new Vector3DImpl(factor * xValue, factor * yValue, factor * zValue);
}
/*
* (non-Javadoc)
*
* @see de.bht.fb6.cg1.raytracer.math.Vector3D#getX()
*/
@Override
public double getX() {
return xValue;
}
/*
* (non-Javadoc)
*
* @see de.bht.fb6.cg1.raytracer.math.Vector3D#getY()
*/
@Override
public double getY() {
return yValue;
}
/*
* (non-Javadoc)
*
* @see de.bht.fb6.cg1.raytracer.math.Vector3D#getZ()
*/
@Override
public double getZ() {
return zValue;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
long temp;
temp = Double.doubleToLongBits(xValue);
result = prime * result + (int) (temp ^ temp >>> 32);
temp = Double.doubleToLongBits(yValue);
result = prime * result + (int) (temp ^ temp >>> 32);
temp = Double.doubleToLongBits(zValue);
result = prime * result + (int) (temp ^ temp >>> 32);
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Vector3DImpl)) {
return false;
}
Vector3DImpl other = (Vector3DImpl) obj;
if (Double.doubleToLongBits(MathHelper.roundDouble(xValue)) != Double.doubleToLongBits(MathHelper
.roundDouble(other.xValue))) {
return false;
}
if (Double.doubleToLongBits(MathHelper.roundDouble(yValue)) != Double.doubleToLongBits(MathHelper
.roundDouble(other.yValue))) {
return false;
}
if (Double.doubleToLongBits(MathHelper.roundDouble(zValue)) != Double.doubleToLongBits(MathHelper
.roundDouble(other.zValue))) {
return false;
}
return true;
}
@Override
public String toString() {
return "[ " + xValue + " " + yValue + " " + zValue + " ]";
}
}
|
[
"[email protected]"
] | |
1e16803423e411693f0c8b6d7bb6c5198476f66b
|
13319dc1262038e0e359ddfe1db7541ab1f35681
|
/src/test/model/CartTest.java
|
8df76958847e84318f155d91d9f02e23af4ff1ff
|
[] |
no_license
|
arafat5549/SSFDemo
|
eead83b5e6be1ff1b744785f8cf9c728035c6c8b
|
42578e460665381694dc49effca90a425b63319c
|
refs/heads/master
| 2021-01-12T15:04:43.699990 | 2017-03-28T06:38:23 | 2017-03-28T06:38:23 | 71,686,957 | 8 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 729 |
java
|
package test.model;
import java.util.List;
import org.junit.Test;
import com.ssf.dao.CartItemDao;
import com.ssf.model.Cart;
import com.ssf.model.CartItem;
import com.ssf.service.CartService;
public class CartTest {
CartService cartService = new CartService();
CartItemDao cartItemDao = new CartItemDao();
@Test
public void cartTest(){
int userid = 1;
Cart cart = cartService.findByUserId(userid);
System.out.println(cart);
System.out.println(cart.getItems());
}
@Test
public void addToCartTest(){
int userid = 1;
Cart cart = cartService.findByUserId(userid);
int pid = 212121;
String ret = cartService.addToCart(cart, pid, 1);
System.out.println(ret);
}
}
|
[
"[email protected]"
] | |
74c8e2016693b9c9ab573b402e8fcd481e647869
|
83d6846d722cded080d670949c929ad354a55db0
|
/bcits123/springrest/src/main/java/com/bcits/springrest/beans/EmployeeResponse.java
|
6593a71e5d79e32faa88756e068bd74a4e5e6ce3
|
[] |
no_license
|
veekshamk/TY_BCITS_ELF_BATCH1_JFS_VEEKSHAMK
|
765c1abf9e71ed5540fd9ac313bcf952c982f2aa
|
4e0f21822bc9ba9add0752a61e7444ab0d48917c
|
refs/heads/master
| 2022-12-19T23:54:21.577524 | 2020-02-13T13:57:00 | 2020-02-13T13:57:00 | 228,773,022 | 0 | 0 | null | 2022-12-15T23:57:33 | 2019-12-18T06:26:31 |
Rich Text Format
|
UTF-8
|
Java
| false | false | 599 |
java
|
package com.bcits.springboot.beans;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Data;
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({ "statusCode" , "message" , "description" })
public class EmployeeResponse {
private int statusCode;
private String message;
private String description;
@JsonProperty("employeeInfo")
private EmployeeInfoBean employeeInfoBean;
private List<EmployeeInfoBean> employeeList;
}
|
[
"[email protected]"
] | |
e6cb4402799d2b9a456b8ef6b5b63a93444adfc4
|
d47b5071fa2721ef1f8aacbadf01394384fb5f1a
|
/Prog Fund 05.2018/PF-Exercises/09. Strings-and-Text-Processing-Exercise/src/com/company/P05MagicExchangeableWords.java
|
cdd4508b2f3119209a57a5d681408b66e4b37622
|
[] |
no_license
|
HristoRaykov/TechModule-05.2018
|
f040af7fde5a0b4f5de95db24cec335639edb7f7
|
2b16ac3e9b588a7689daba2ad66c30e7b9a89993
|
refs/heads/master
| 2022-12-09T20:26:23.268588 | 2019-12-01T21:01:22 | 2019-12-01T21:01:22 | 185,369,356 | 0 | 0 | null | 2022-12-08T17:44:29 | 2019-05-07T09:28:55 |
CSS
|
UTF-8
|
Java
| false | false | 1,333 |
java
|
package com.company;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;
public class P05MagicExchangeableWords {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String[] line = input.nextLine().split(" ");
String shorterStr = line[0].length() > line[1].length() ? line[1] : line[0];
String longerStr = line[0].length() <= line[1].length() ? line[1] : line[0];
LinkedHashMap<Character, Character> dict = new LinkedHashMap<>();
boolean isExchangeable = true;
for (int i = 0; i < shorterStr.length(); i++) {
char key = shorterStr.charAt(i);
if (!dict.containsKey(key)) {
dict.put(key, longerStr.charAt(i));
} else {
if (!dict.get(key).equals(longerStr.charAt(i))) {
isExchangeable = false;
break;
}
}
}
for (int i = shorterStr.length(); i < longerStr.length(); i++) {
char value = longerStr.charAt(i);
if (!dict.containsValue(value)) {
isExchangeable = false;
break;
}
}
int distinctSize = dict
.entrySet()
.stream()
.map(Map.Entry::getValue)
.distinct()
.toArray()
.length;
if (distinctSize!=dict.size()) {
isExchangeable = false;
}
if (isExchangeable) {
System.out.println("true");
} else {
System.out.println("false");
}
}
}
|
[
"[email protected]"
] | |
aab48732fb1d857680be3823672971acdc5a7e21
|
fba0144e3212b6d8eeab9724a2dbe863321f3ea1
|
/CaseritaBusiness/src/cl/helper/ProcesaEstadoSIIHelper.java
|
fbba98c5945e8cb8d5fc7af0d07a0dbdd34ed013
|
[] |
no_license
|
jcanquil/portafolio
|
d1268dab393385e082d318f28c91fc896154b72f
|
4414f89a9c15fe79db80da729f981aced8eac70a
|
refs/heads/main
| 2023-06-21T07:24:27.594751 | 2021-08-03T09:42:15 | 2021-08-03T09:42:15 | 392,156,940 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,283 |
java
|
package cl.caserita.helper;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import org.apache.log4j.Logger;
import cl.caserita.comunes.fecha.Fecha;
import cl.caserita.comunes.properties.Constants;
import cl.caserita.dto.TptdocDTO;
public class ProcesaEstadoSIIHelper {
private static Logger logi = Logger.getLogger(ProcesaEnvioDocumento.class);
private static FileWriter fileWriterLog;
private static String archivoLog;
private static Properties prop=null;
private static String pathProperties;
public static void main (String[]args){
int fechaProceso=0;
for(int i=0;i<args.length;i++)
{
if (i==0){
//Codigo Movimiento
fechaProceso=Integer.parseInt(args[i]);
}
}
prop = new Properties();
try{
//logi.info("Ruta Properties:"+Constants.FILE_PROPERTIES);
prop.load(new FileInputStream(Constants.FILE_PROPERTIES+"config.properties"));
}
catch(Exception e){
e.printStackTrace();
}
pathProperties = Constants.FILE_PROPERTIES;
int empresa=2;
Fecha fch = new Fecha();
int fecha =0;
if (fechaProceso==0){
fecha = Integer.parseInt(fch.getYYYYMMDD());
}else{
fecha = fechaProceso;
}
ProcesaEstadoSIIHelper procesa = new ProcesaEstadoSIIHelper();
List codDocu = procesa.generaDocu(4);
TptdocDTO tpt = null;
Iterator iter = codDocu.iterator();
while (iter.hasNext()){
tpt = (TptdocDTO) iter.next();
archivoLog=prop.getProperty("urlServletEstadoSII")+"?empresa="+empresa+"&fecha="+fecha+"&CodDoc="+tpt.getCodDoc();
logi.info("Servlet Estado SII:"+archivoLog);
StringBuffer tmp = new StringBuffer();
String texto = new String();
try {
// Crea la URL con del sitio introducido, ej: http://google.com
URL url = new URL(archivoLog);
// Lector para la respuesta del servidor
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String str;
while ((str = in.readLine()) != null) {
tmp.append(str);
}
//url.openStream().close();
in.close();
texto = tmp.toString();
}catch (MalformedURLException e) {
texto = "<h2>No esta correcta la URL</h2>".toString();
} catch (IOException e) {
texto = "<h2>Error: No se encontro el l pagina solicitada".toString();
}
}
}
public List generaDocu (int cantiDoc){
TptdocDTO tptDoc = null;;
List doc = new ArrayList();
int canti=1;
while (cantiDoc>=1){
tptDoc = new TptdocDTO();
if (canti==1){
tptDoc.setCodDoc(33);
}else if (canti==2){
tptDoc.setCodDoc(35);
}else if (canti==3){
tptDoc.setCodDoc(36);
}else if (canti==4){
tptDoc.setCodDoc(42);
}
doc.add(tptDoc);
canti=canti+1;
cantiDoc=cantiDoc-1;
}
return doc;
}
}
|
[
"[email protected]"
] | |
b937356c63facae31af9cd9b3f69a547fafad05d
|
7562d1f98f3de56921417438c75a753249c45833
|
/src/main/java/source/dto/common/BScreenDto.java
|
4dd4f76bd33bc8be569154f77173b4c61491b148
|
[] |
no_license
|
noriyuki-shimizu/myClothes
|
0f9fd90999dd9de655b7b6c9765a168188853b01
|
a9f3d841f0d4c6da4809976ca857d1858f71120b
|
refs/heads/master
| 2020-03-14T15:04:39.043360 | 2019-01-05T12:33:44 | 2019-01-05T12:33:44 | 131,668,120 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 886 |
java
|
package source.dto.common;
import source.dto.BaseDto;
public class BScreenDto extends BaseDto {
private Long screenId;
private String screenCd;
private String screenNm;
private String initUrl;
private BMenuDto bMenuDto;
public Long getScreenId() {
return screenId;
}
public void setScreenId(Long screenId) {
this.screenId = screenId;
}
public String getScreenCd() {
return screenCd;
}
public void setScreenCd(String screenCd) {
this.screenCd = screenCd;
}
public String getScreenNm() {
return screenNm;
}
public void setScreenNm(String screenNm) {
this.screenNm = screenNm;
}
public String getInitUrl() {
return initUrl;
}
public void setInitUrl(String initUrl) {
this.initUrl = initUrl;
}
public BMenuDto getbMenuDto() {
return bMenuDto;
}
public void setbMenuDto(BMenuDto bMenuDto) {
this.bMenuDto = bMenuDto;
}
}
|
[
"[email protected]"
] | |
63a8b468716255cecb16323e83e891db75083bb1
|
919f08460688df8313ba0ee39959a148f7e927e2
|
/src/main/java/com/luoben/warehouse/sys/service/impl/RoleServiceImpl.java
|
1faef027593c9868fa0ca5d5715b301ffb0c8ee2
|
[] |
no_license
|
luoben147/warehouse
|
e250611743dff8529769e0699d54305fe274ae42
|
cf1f8c2aaf321178e7b61ad70b51a3099ee40844
|
refs/heads/master
| 2022-07-04T12:59:04.007178 | 2020-04-24T10:16:42 | 2020-04-24T10:16:42 | 248,482,976 | 0 | 0 | null | 2022-06-17T02:57:54 | 2020-03-19T11:14:04 |
JavaScript
|
UTF-8
|
Java
| false | false | 1,991 |
java
|
package com.luoben.warehouse.sys.service.impl;
import com.luoben.warehouse.sys.domain.Role;
import com.luoben.warehouse.sys.mapper.RoleMapper;
import com.luoben.warehouse.sys.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author luoben
* @since 2020-03-22
*/
@Service
@Transactional
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
@Transactional
@Override
public boolean removeById(Serializable id) {
//根据角色id删除 sys_role_permission
this.getBaseMapper().deleteRolePermissionByRid(id);
//根据角色id删除 sys_role_user
this.getBaseMapper().deleteRoleUseByRid(id);
return super.removeById(id);
}
/**
* 根据角色ID查询当前角色拥有的权限或菜单Id
* @param roleId
* @return
*/
@Override
public List<Integer> queryRolePermissionIdsByRid(Integer roleId) {
return getBaseMapper().queryRolePermissionIdsByRid(roleId);
}
/**
* 保存角色和菜单权限之间的关系
* @param rid
* @param ids
*/
@Override
public void saveRolePermission(Integer rid, Integer[] ids) {
RoleMapper roleMapper = this.getBaseMapper();
//根据rid删除sys_role_permission
roleMapper.deleteRolePermissionByRid(rid);
if (ids != null && ids.length > 0) {
for (Integer pid : ids) {
roleMapper.saveRolePermission(rid, pid);
}
}
}
/**
* 查询当前用户拥有的角色ID集合
* @param id
* @return
*/
@Override
public List<Integer> queryUserRoleIdsByUid(Integer id) {
return this.getBaseMapper().queryUserRoleIdsByUid(id);
}
}
|
[
"[email protected]"
] | |
75302758bd3afc4c0805315ffaa1c804d50f52be
|
5539a68a923116ec7d80813a3930368c616dfe54
|
/src/main/java/com/travel/com/travel/ExcelData.java
|
c8a2e099e7563037a2f55f04dd92a7b56e5b9f08
|
[] |
no_license
|
hari-prasa/Jayalaxmi
|
6cdef0edd296cba19a6dd5dcd36cc0d6ad69fe28
|
7554d7b3157f8f3d4847cace681f4e44b0a03329
|
refs/heads/master
| 2022-12-12T18:42:11.877330 | 2020-09-07T15:10:17 | 2020-09-07T15:26:04 | 293,563,711 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,696 |
java
|
package com.travel.com.travel;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
public class ExcelData {
//public static void getExcelData(String path,String sheetName,int rowNum , int colNum ) throws FileNotFoundException {
//FileInputStream fis = new FileInputStream("E:\\Jaya\\Test_Data.xlsx");
public void writeExcel(String filePath,String fileName,String sheetName,String[] dataToWrite) throws IOException{
File file = new File(filePath+"\\"+fileName);
FileInputStream inputStream = new FileInputStream(file);
Workbook Workbook = null;
String fileExtensionName = fileName.substring(fileName.indexOf("."));
if(fileExtensionName.equals(".xlsx")){
// Workbook = new Workbook(inputStream);
}
//Check condition if the file is xls file
else if(fileExtensionName.equals(".xls")){
Workbook = new HSSFWorkbook(inputStream);
}
//Read excel sheet by sheet name
Sheet sheet = Workbook.getSheet(sheetName);
//Get the current count of rows in excel file
int rowCount = sheet.getLastRowNum()-sheet.getFirstRowNum();
//Get the first row from the sheet
Row row = sheet.getRow(0);
//Create a new row and append it at last of sheet
Row newRow = sheet.createRow(rowCount+1);
//Create a loop over the cell of newly created Row
for(int j = 0; j < row.getLastCellNum(); j++){
//Fill data in row
Cell cell = newRow.createCell(j);
cell.setCellValue(dataToWrite[j]);
}
//Close input stream
inputStream.close();
//Create an object of FileOutputStream class to create write data in excel file
FileOutputStream outputStream = new FileOutputStream(file);
//write data in the excel file
Workbook.write(outputStream);
//close output stream
outputStream.close();
}
public static void main(String...strings) throws IOException{
String[] valueToWrite = {"Mr. E","Noida"};
ExcelData objExcelFile = new ExcelData();
//Write the file using file name, sheet name and the data to be filled
objExcelFile.writeExcel(System.getProperty("user.dir")+"\\src\\excelExportAndFileIO","ExportExcel.xlsx","E:\\Jaya\\Test_Data.xlsx",valueToWrite);
}
}
|
[
"[email protected]"
] | |
91b006eec9a333fb90c60e725923dacc23fcd606
|
6531340e5f49159ccbdeb9968d5900763c40e503
|
/app/src/main/java/com/supertg/supertg/mvpframe/utils/TUtil.java
|
42e3fb13315f6ed6ddae5c74d4c6a199c619a709
|
[] |
no_license
|
nevergoneok/SuperTG
|
469181e69be090aae441f4e0a894a0f2f717e5e2
|
5a2aa2d841ad8abb958b4fcfab7153ffec745611
|
refs/heads/master
| 2021-01-11T19:05:11.594825 | 2017-01-25T03:09:08 | 2017-01-25T03:09:08 | 79,312,158 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,214 |
java
|
package com.supertg.supertg.mvpframe.utils;
import java.lang.reflect.ParameterizedType;
/**
* Created by Administrator on 2016/12/31.
*/
public class TUtil {
public static <T> T getT(Object o, int i) {
try {
/**
* getGenericSuperclass() : 获得带有泛型的父类
* ParameterizedType : 参数化类型,即泛型
* getActualTypeArguments()[] : 获取参数化类型的数组,泛型可能有多个
*/
return ((Class<T>) ((ParameterizedType) (o.getClass()
.getGenericSuperclass())).getActualTypeArguments()[i])
.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (ClassCastException e) {
e.printStackTrace();
}
return null;
}
// 获得类名className对应的Class对象
public static Class<?> forName(String className) {
try {
return Class.forName(className);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
return null;
}
}
|
[
"[email protected]"
] | |
c0da6c84300febc4c346b4c006c06721cb5ecfca
|
ea7071fc847e98a2dd7079a1f3d4483462019477
|
/app/src/main/java/com/bhupendra/android/sunshine/app/gcm/RegistrationIntentService.java
|
bea13d8862ba2edf6a2a290e662ffa46c84ce192
|
[
"Apache-2.0"
] |
permissive
|
bhupendra11/SunshineWearApp
|
1735b6aa256eb06085278a086358c8ca3594caf7
|
bd47c41e5df91a87ddf3d1b34ab59273897a5bc1
|
refs/heads/master
| 2020-09-21T19:49:38.344593 | 2016-09-15T21:18:45 | 2016-09-15T21:18:45 | 67,535,451 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,494 |
java
|
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.bhupendra.android.sunshine.app.gcm;
import android.app.IntentService;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;
import com.bhupendra.android.sunshine.app.MainActivity;
import com.bhupendra.android.sunshine.app.R;
import com.google.android.gms.gcm.GoogleCloudMessaging;
import com.google.android.gms.iid.InstanceID;
public class RegistrationIntentService extends IntentService {
private static final String TAG = "RegIntentService";
public RegistrationIntentService() {
super(TAG);
}
@Override
protected void onHandleIntent(Intent intent) {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
try {
// In the (unlikely) event that multiple refresh operations occur simultaneously,
// ensure that they are processed sequentially.
synchronized (TAG) {
// Initially this call goes out to the network to retrieve the token, subsequent calls
// are local.
InstanceID instanceID = InstanceID.getInstance(this);
// TODO: gcm_default sender ID comes from the API console
String senderId = getString(R.string.gcm_defaultSenderId);
if ( senderId.length() != 0 ) {
String token = instanceID.getToken(senderId,
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
sendRegistrationToServer(token);
}
// You should store a boolean that indicates whether the generated token has been
// sent to your server. If the boolean is false, send the token to your server,
// otherwise your server should have already received the token.
sharedPreferences.edit().putBoolean(MainActivity.SENT_TOKEN_TO_SERVER, true).apply();
}
} catch (Exception e) {
Log.d(TAG, "Failed to complete token refresh", e);
// If an exception happens while fetching the new token or updating our registration data
// on a third-party server, this ensures that we'll attempt the update at a later time.
sharedPreferences.edit().putBoolean(MainActivity.SENT_TOKEN_TO_SERVER, false).apply();
}
}
/**
* Normally, you would want to persist the registration to third-party servers. Because we do
* not have a server, and are faking it with a website, you'll want to log the token instead.
* That way you can see the value in logcat, and note it for future use in the website.
*
* @param token The new token.
*/
private void sendRegistrationToServer(String token) {
Log.i(TAG, "GCM Registration Token: " + token);
}
}
|
[
"[email protected]"
] | |
4d8e3478e82f59ffc1caf0d5e54731ceced13388
|
a34d3ed0e4dbda04c5c117c3be64378f4f414a2c
|
/src/main/java/com/up72/hq/dao/QuizSelectMapper.java
|
e87d8066aa43478542b413d0dd1b2272a8c4dce8
|
[] |
no_license
|
lgcwn/hq100
|
30e117fdd2cce4307d623bdd2cd9ef5a555464e3
|
77b20342a8e63cd8f316b4f70cb451db2c950f0f
|
refs/heads/master
| 2020-12-30T13:08:08.325769 | 2017-08-26T07:35:16 | 2017-08-26T07:35:16 | 91,324,893 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 900 |
java
|
/*
* Powered By [up72-framework]
* Web Site: http://www.up72.com
* Since 2006 - 2016
*/
package com.up72.hq.dao;
import com.up72.hq.model.QuizSelect;
import com.up72.framework.util.page.PageBounds;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
import com.up72.framework.util.page.PageList;
/**
* 竞猜选项DAO
*
* @author liuguicheng
* @version 1.0
* @since 1.0
*/
@Repository
public interface QuizSelectMapper {
void insert(QuizSelect entity);
void update(QuizSelect entity);
void delete(java.lang.Long id);
QuizSelect findById(java.lang.Long id);
PageList<QuizSelect> findPage(Map params, PageBounds rowBounds);
List<QuizSelect> findList(Map params);
List<QuizSelect> findByQuestioIdLimit(java.lang.Long hqQuizQuestioId);
List<QuizSelect> findByQuestioId(java.lang.Long hqQuizQuestioId);
}
|
[
"[email protected]"
] | |
a4e1adfe4134890d8361603d0c6be9acc3da04ea
|
129f58086770fc74c171e9c1edfd63b4257210f3
|
/src/testcases/CWE90_LDAP_Injection/CWE90_LDAP_Injection__connect_tcp_61a.java
|
17c7ae089eac2afedb16763278e8043d40704fd2
|
[] |
no_license
|
glopezGitHub/Android23
|
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
|
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
|
refs/heads/master
| 2023-03-07T15:14:59.447795 | 2023-02-06T13:59:49 | 2023-02-06T13:59:49 | 6,856,387 | 0 | 3 | null | 2023-02-06T18:38:17 | 2012-11-25T22:04:23 |
Java
|
UTF-8
|
Java
| false | false | 3,851 |
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE90_LDAP_Injection__connect_tcp_61a.java
Label Definition File: CWE90_LDAP_Injection.label.xml
Template File: sources-sink-61a.tmpl.java
*/
/*
* @description
* CWE: 90 LDAP Injection
* BadSource: connect_tcp Read data using an outbound tcp connection
* GoodSource: A hardcoded string
* Sinks:
* BadSink : data concatenated into LDAP search, which could result in LDAP Injection
* Flow Variant: 61 Data flow: data returned from one method to another in different classes in the same package
*
* */
package testcases.CWE90_LDAP_Injection;
import testcasesupport.*;
import javax.naming.*;
import javax.naming.directory.*;
import javax.servlet.http.*;
import java.util.Hashtable;
import java.io.IOException;
import org.apache.commons.lang.StringEscapeUtils;
public class CWE90_LDAP_Injection__connect_tcp_61a extends AbstractTestCase
{
public void bad() throws Throwable
{
String data = (new CWE90_LDAP_Injection__connect_tcp_61b()).bad_source();
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://localhost:389");
DirContext ctx = new InitialDirContext(env);
/* POTENTIAL FLAW: data concatenated into LDAP search, which could result in LDAP Injection */
String search = "(cn=" + data + ")";
NamingEnumeration<SearchResult> answer = ctx.search("", search, null);
while (answer.hasMore())
{
SearchResult sr = answer.next();
Attributes a = sr.getAttributes();
NamingEnumeration<?> attrs = a.getAll();
while (attrs.hasMore())
{
Attribute attr = (Attribute) attrs.next();
NamingEnumeration<?> values = attr.getAll();
while(values.hasMore())
{
IO.writeLine(" Value: " + values.next().toString());
}
}
}
}
public void good() throws Throwable
{
goodG2B();
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B() throws Throwable
{
String data = (new CWE90_LDAP_Injection__connect_tcp_61b()).goodG2B_source();
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://localhost:389");
DirContext ctx = new InitialDirContext(env);
/* POTENTIAL FLAW: data concatenated into LDAP search, which could result in LDAP Injection */
String search = "(cn=" + data + ")";
NamingEnumeration<SearchResult> answer = ctx.search("", search, null);
while (answer.hasMore())
{
SearchResult sr = answer.next();
Attributes a = sr.getAttributes();
NamingEnumeration<?> attrs = a.getAll();
while (attrs.hasMore())
{
Attribute attr = (Attribute) attrs.next();
NamingEnumeration<?> values = attr.getAll();
while(values.hasMore())
{
IO.writeLine(" Value: " + values.next().toString());
}
}
}
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"[email protected]"
] | |
b94cf597eb72572ce85f19543113814d52d04906
|
fb0f2282764c6af97f41970818f479cedef6b609
|
/src/test/java/com/hhx/bean/MyService.java
|
f05fad786acb4affaaaf8ee5852ccaa996871ced
|
[] |
no_license
|
huanghaoxuan/hhxMVC
|
c576aed4daf4c39ceda0fb8eca70ca5e7f15d2e5
|
9dcf22e8773179fec1e5659ed111f8a938efe9fd
|
refs/heads/master
| 2021-07-11T01:32:48.888257 | 2019-09-23T09:39:48 | 2019-09-23T09:39:48 | 207,206,352 | 0 | 0 | null | 2020-10-13T16:13:32 | 2019-09-09T02:20:40 |
Java
|
UTF-8
|
Java
| false | false | 237 |
java
|
package com.hhx.bean;
/**
* @Author: HuangHaoXuan
* @Email: [email protected]
* @github https://github.com/huanghaoxuan
* @Date: 2019/9/23 10:36
* @Version 1.0
*/
public interface MyService {
String helloWorld();
}
|
[
"[email protected]"
] | |
cf2b08f5dcc7facded277dd1dc9291e7521b20cf
|
a6b4f8c9703736afebd0b27d081e6e14cdb0d0e0
|
/.metadata/.plugins/org.eclipse.wst.server.core/tmp4/work/Catalina/localhost/bpms/org/apache/jsp/jsp/workflow/ProcessDeployment_jsp.java
|
d1f695d90ff2d095b500f55a3cb38f69c6871f43
|
[] |
no_license
|
QiJiYinQiao/workspaces
|
e644430ea0d021a76dbaaffa6dfc7f30e51a5dac
|
c3bb78f32c67af0ede376251d7ea6f7bf636f344
|
refs/heads/master
| 2021-06-01T06:33:37.637473 | 2016-03-01T07:57:13 | 2016-03-01T07:57:13 | 115,107,254 | 1 | 0 | null | 2017-12-22T10:58:03 | 2017-12-22T10:58:03 | null |
UTF-8
|
Java
| false | false | 7,842 |
java
|
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.59
* Generated at: 2015-08-25 05:18:56 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.jsp.workflow;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class ProcessDeployment_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<base href=\"");
out.print(basePath);
out.write("\">\r\n");
out.write("<title>流程部署</title>\r\n");
out.write("<meta http-equiv=\"pragma\" content=\"no-cache\">\r\n");
out.write("<meta http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
out.write("<meta http-equiv=\"expires\" content=\"0\">\r\n");
out.write("<meta http-equiv=\"keywords\" content=\"keyword1,keyword2,keyword3\">\r\n");
out.write("<meta http-equiv=\"description\" content=\"This is my page\">\r\n");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../../layout/script.jsp", out, false);
out.write("\r\n");
out.write("<script type=\"text/javascript\" src=\"");
out.print(basePath );
out.write("js/ajaxfileupload.js\"></script>\r\n");
out.write("<script type=\"text/javascript\" src=\"");
out.print(basePath );
out.write("jsp/workflow/proc_dep.js\"></script>\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
out.write(" <!-- 提示信息区域 -->\r\n");
out.write("\t<div class=\"well well-small\" style=\"margin-left: 5px; margin-top: 5px;\">\r\n");
out.write("\t\t<span class=\"badge\">提示</span>\r\n");
out.write("\t\t<p>\r\n");
out.write("\t\t\t在此你可以对<span class=\"label-info\"><strong>流程</strong></span>进行更新、部署、删除、查询等操作!\r\n");
out.write("\t\t</p>\r\n");
out.write("\t\t<table>\r\n");
out.write("\t\t\t<tr>\r\n");
out.write("\t\t\t\t<td style=\"padding-left:2px\">\r\n");
out.write("\t\t\t \t<span class=\"label-info\"><strong>部署</strong></span>\r\n");
out.write("\t\t\t\t\t流程名称:<input type=\"text\" id=\"fileName\" class=\"easyui-textbox\" name=\"fileName\" style=\"width: 110px\">\r\n");
out.write("\t\t\t\t</td>\r\n");
out.write("\t\t\t\t<td style=\"padding-left:2px\">\r\n");
out.write("\t\t\t\t\t<input type=\"file\" id=\"file\" name=\"file\" size=100/>\r\n");
out.write("\t\t\t\t</td>\r\n");
out.write("\t\t\t\t<td style=\"padding-left:2px\">\r\n");
out.write("\t\t\t\t <a href=\"javascript:void(0)\" class=\"easyui-linkbutton\" data-options=\"iconCls:'icon-save'\" onclick=\"procrep_toolbar.upload();\">上传文件</a>\r\n");
out.write("\t\t\t\t</td>\r\n");
out.write("\t\t\t</tr>\r\n");
out.write("\t\t\t<tr>\r\n");
out.write("\t\t\t\t<td style=\"padding-left:2px\">\r\n");
out.write("\t\t\t \t<span class=\"label-info\"><strong>查询</strong></span>\r\n");
out.write("\t\t\t\t\t流程编号:<input type=\"text\" id=\"deploymentId\" class=\"easyui-textbox\" style=\"width: 110px\">\r\n");
out.write("\t\t\t\t</td>\r\n");
out.write("\t\t\t\t<td style=\"padding-left:2px\">\r\n");
out.write("\t\t\t\t\t流程名称:<input type=\"text\" id=\"deploymentName\" class=\"easyui-textbox\" style=\"width: 110px\">\r\n");
out.write("\t\t\t\t</td>\r\n");
out.write("\t\t\t\t<td style=\"padding-left:2px\">\r\n");
out.write("\t\t\t\t\t<a href=\"javascript:void(0)\" class=\"easyui-linkbutton\" data-options=\"iconCls:'icon-search'\" onclick=\"procrep_toolbar.search();\">查询</a>\r\n");
out.write("\t\t\t\t\t<a href=\"javascript:void(0)\" class=\"easyui-linkbutton\" data-options=\"iconCls:'icon-undo'\" onclick=\"procrep_toolbar.resetting();\">重置</a>\r\n");
out.write("\t\t\t\t</td>\r\n");
out.write("\t\t\t</tr>\r\n");
out.write("\t\t</table>\r\n");
out.write("\t</div>\r\n");
out.write("\t<!-- 工具栏区域 -->\r\n");
out.write("\t<div id=\"procrep_toolbar\" style=\"padding:2px 0\">\r\n");
out.write("\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\r\n");
out.write("\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t<td style=\"padding-left:2px\">\r\n");
out.write("\t\t\t\t\t\t<a href=\"javascript:void(0);\" class=\"easyui-linkbutton\" iconCls=\"icon-remove\" plain=\"true\" onclick=\"procrep_toolbar.remove();\">删除</a>\r\n");
out.write("\t\t\t\t\t</td>\r\n");
out.write("\t\t\t\t</tr>\r\n");
out.write("\t\t\t</table>\r\n");
out.write("\t </div>\r\n");
out.write("\t <table id=\"process_deploy\" title=\"流程部署\" style=\"margin-bottom: 5px;\"></table>\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
|
[
"[email protected]"
] | |
7332517b0a8f87ec07b4f6b936c51a94152001e7
|
22e65ad2bbde6ba2fc90e0de594d8df44518e08a
|
/app/src/main/java/adapter/RecylerViewClickInterface.java
|
d2f9a376b84c94054dc7ca33976122e5e9f51cb0
|
[] |
no_license
|
Sprajapati123/vendo
|
4375f6d8a2794df63b2a7a2ef59e9ecd41f55de5
|
a75108d9c6322854ccdafcecb603191f2b367355
|
refs/heads/main
| 2023-03-14T03:57:04.885953 | 2021-03-04T08:52:37 | 2021-03-04T08:52:37 | 344,381,974 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 141 |
java
|
package adapter;
public interface RecylerViewClickInterface {
void onItemClick(int position);
void onLongItemClick(int position);
}
|
[
"[email protected]"
] | |
be72dd1cc3dac825dd95e3bbcc37520ae6402be2
|
48c4630bd2c03f903259484bf28ed044a6137ff5
|
/2019.03.16_우아한테크코스/src/onlineCoding/Solution5.java
|
6ffea340b69a42b6dfb0d9543a760aeed26cbbba
|
[] |
no_license
|
sally4405/Book_Doit_Java
|
a2be83757914e2c39a6578c7a093678a2a7c4477
|
f7cc5062b7447aedaa7ad51ec16b1d1d3afd8604
|
refs/heads/master
| 2020-05-20T04:34:22.125646 | 2019-05-07T11:18:52 | 2019-05-07T11:18:52 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 446 |
java
|
package onlineCoding;
public class Solution5 {
public int solution6(int number) {
StringBuffer num = new StringBuffer();
int answer = 0;
for(int i = 0; i < number; i++){
num.append(i+1);
}
for(int j = 0; j < num.length(); j++){
if(num.charAt(j) == '3' || num.charAt(j) == '6' || num.charAt(j) == '9') answer++;
}
return answer;
}
}
|
[
"[email protected]"
] | |
e48e9e96f2f0feb376bb5b21af69917712146448
|
fb534d46b444bf23087a31dba5f2916546865a97
|
/org/omg/PortableInterceptor/ServerRequestInfo.java
|
e6e34c41a788d8afec45318008fc9dcb1e87f414
|
[] |
no_license
|
hliuliu/javasrc
|
0f4b885a68feb138a1754a88e90b4e874947381c
|
c01b990b43d79106f5335169f88e72c92beda7a0
|
refs/heads/master
| 2021-08-19T17:37:40.562583 | 2017-11-27T03:29:05 | 2017-11-27T03:29:05 | 112,141,877 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 9,524 |
java
|
package org.omg.PortableInterceptor;
/**
* org/omg/PortableInterceptor/ServerRequestInfo.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../../../src/share/classes/org/omg/PortableInterceptor/Interceptors.idl
* Wednesday, May 7, 2014 12:49:10 PM PDT
*/
/**
* Request Information, accessible to server-side request interceptors.
* <p>
* Some attributes and operations on <code>ServerRequestInfo</code> are not
* valid at all interception points. The following table shows the validity
* of each attribute or operation. If it is not valid, attempting to access
* it will result in a <code>BAD_INV_ORDER</code> being thrown with a
* standard minor code of 14.
* <p>
*
*
* <table border=1 summary="Shows the validity of each attribute or operation">
* <thead>
* <tr>
* <th> </th>
* <th id="rec_req_ser_con" valign="bottom">receive_request_<br>service_contexts</th>
* <th id="rec_req" valign="bottom">receive_request</th>
* <th id="send_rep" valign="bottom">send_reply</th>
* <th id="send_exc" valign="bottom">send_exception</th>
* <th id="send_oth" valign="bottom">send_other</th>
* </tr>
* </thead>
* <tbody>
*
*
* <tr>
* <td id="ri" colspan=6><i>Inherited from RequestInfo:</i></td>
* </tr>
*
* <tr><th id="req_id"><p align="left">request_id</p></th>
* <td headers="ri req_id rec_req_ser_con">yes</td>
* <td headers="ri req_id rec_req">yes</td>
* <td headers="ri req_id send_rep">yes</td>
* <td headers="ri req_id send_exc">yes</td>
* <td headers="ri req_id send_oth">yes</td></tr>
*
* <tr><th id="op"><p align="left">operation</p></th>
* <td headers="ri op rec_req_ser_con">yes</td>
* <td headers="ri op rec_req">yes</td>
* <td headers="ri op send_rep">yes</td>
* <td headers="ri op send_exc">yes</td>
* <td headers="ri op send_oth">yes</td></tr>
*
* <tr><th id="args"><p align="left">arguments</p></th>
* <td headers="ri args rec_req_ser_con">no </td>
* <td headers="ri args rec_req">yes<sub>1</sub></td>
* <td headers="ri args send_rep">yes</td>
* <td headers="ri args send_exc">no<sub>2</sub></td>
* <td headers="ri args send_oth">no<sub>2</sub>
* </td></tr>
*
* <tr><th id="exps"><p align="left">exceptions</p></th>
* <td headers="ri exps rec_req_ser_con">no </td>
* <td headers="ri exps rec_req">yes</td>
* <td headers="ri exps send_rep">yes</td>
* <td headers="ri exps send_exc">yes</td>
* <td headers="ri exps send_oth">yes</td></tr>
*
* <tr><th id="contexts"><p align="left">contexts</p></th>
* <td headers="ri contexts rec_req_ser_con">no </td>
* <td headers="ri contexts rec_req">yes</td>
* <td headers="ri contexts send_rep">yes</td>
* <td headers="ri contexts send_exc">yes</td>
* <td headers="ri contexts send_oth">yes</td></tr>
*
* <tr><th id="op_con"><p align="left">operation_context</p></th>
* <td headers="ri op_con rec_req_ser_con">no </td>
* <td headers="ri op_con rec_req">yes</td>
* <td headers="ri op_con send_rep">yes</td>
* <td headers="ri op_con send_exc">no </td>
* <td headers="ri op_con send_oth">no </td>
* </tr>
*
* <tr><th id="result"><p align="left">result</p></th>
* <td headers="ri result rec_req_ser_con">no </td>
* <td headers="ri result rec_req">no </td>
* <td headers="ri result send_rep">yes</td>
* <td headers="ri result send_exc">no </td>
* <td headers="ri result send_oth">no </td>
* </tr>
*
* <tr><th id="res_ex"><p align="left">response_expected</p></th>
* <td headers="ri res_ex rec_req_ser_con">yes</td>
* <td headers="ri res_ex rec_req">yes</td>
* <td headers="ri res_ex send_rep">yes</td>
* <td headers="ri res_ex send_exc">yes</td>
* <td headers="ri res_ex send_oth">yes</td></tr>
*
* <tr><th id="syn_scp"><p align="left">sync_scope</p></th>
* <td headers="ri syn_scp rec_req_ser_con">yes</td>
* <td headers="ri syn_scp rec_req">yes</td>
* <td headers="ri syn_scp send_rep">yes</td>
* <td headers="ri syn_scp send_exc">yes</td>
* <td headers="ri syn_scp send_oth">yes</td></tr>
*
* <tr><td><b>request_id</b></td>
* <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>operation</b></td>
* <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>arguments</b></td>
* <td>no </td> <td>yes<sub>1</sub</td>
* <td>yes</td> <td>no<sub>2</sub></td>
* <td>no<sub>2</sub>
* </td></tr>
*
* <tr><td><b>exceptions</b></td>
* <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>contexts</b></td>
* <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>operation_context</b></td>
* <td>no </td> <td>yes</td> <td>yes</td> <td>no </td> <td>no </td></tr>
*
* <tr><td><b>result</b></td>
* <td>no </td> <td>no </td> <td>yes</td> <td>no </td> <td>no </td></tr>
*
* <tr><td><b>response_expected</b></td>
* <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>sync_scope</b></td>
* <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>reply_status</b></td>
* <td>no </td> <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>forward_reference</b></td>
* <td>no </td> <td>no </td> <td>no </td> <td>no </td> <td>yes<sub>2</sub>
* </td></tr>
*
* <tr><td><b>get_slot</b></td>
* <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>get_request_service_context</b></td>
* <td>yes</td> <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>get_reply_service_context</b></td>
* <td>no </td> <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr>
* <td colspan=6><i>ServerRequestInfo-specific:</i></td>
* </tr>
*
* <tr><td><b>sending_exception</b></td>
* <td>no </td> <td>no </td> <td>no </td> <td>yes</td> <td>no </td></tr>
*
* <tr><td><b>object_id</b></td>
* <td>no </td> <td>yes</td> <td>yes</td> <td>yes<sub>3</sub></td>
* <td>yes<sub>3</sub>
* </td></tr>
*
* <tr><td><b>adapter_id</b></td>
* <td>no </td> <td>yes</td> <td>yes</td> <td>yes<sub>3</sub></td>
* <td>yes<sub>3</sub>
* </td></tr>
*
* <tr><td><b>server_id</b></td>
* <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>orb_id</b></td>
* <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>adapter_name</b></td>
* <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>target_most_derived_interface</b></td>
* <td>no </td> <td>yes</td> <td>no<sub>4</sub></td>
* <td>no<sub>4</sub></td>
* <td>no<sub>4</sub>
* </td></tr>
*
* <tr><td><b>get_server_policy</b></td>
* <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>set_slot</b></td>
* <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
*
* <tr><td><b>target_is_a</b></td>
* <td>no </td> <td>yes</td> <td>no<sub>4</sub></td>
* <td>no<sub>4</sub></td>
* <td>no<sub>4</sub>
* </td></tr>
*
* <tr><td><b>add_reply_service_context</b></td>
* <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
* </tbody>
* </table>
*
* <ol>
* <li>When <code>ServerRequestInfo</code> is passed to
* <code>receive_request</code>, there is an entry in the list for
* every argument, whether in, inout, or out. But only the in and
* inout arguments will be available.</li>
* <li>If the <code>reply_status</code> attribute is not
* <code>LOCATION_FORWARD</code>, accessing this attribute will throw
* <code>BAD_INV_ORDER</code> with a standard minor code of 14.</li>
* <li>If the servant locator caused a location forward, or thrown an
* exception, this attribute/operation may not be available in this
* interception point. <code>NO_RESOURCES</code> with a standard minor
* code of 1 will be thrown if it is not available.</li>
* <li>The operation is not available in this interception point because
* the necessary information requires access to the target object's
* servant, which may no longer be available to the ORB. For example,
* if the object's adapter is a POA that uses a
* <code>ServantLocator</code>, then the ORB invokes the interception
* point after it calls <code>ServantLocator.postinvoke()</code></li>.
* </ol>
*
* @see ServerRequestInterceptor
*/
public interface ServerRequestInfo extends ServerRequestInfoOperations, org.omg.PortableInterceptor.RequestInfo, org.omg.CORBA.portable.IDLEntity
{
} // interface ServerRequestInfo
|
[
"[email protected]"
] | |
a914c42d5e38f021c097ff5b5aee6158d332ddf3
|
a78457df06fb38ef379e219617cd935fbed769a4
|
/SelectivityTest/src/iisc/dsl/picasso/server/sampling/PicassoSampling.java
|
37b300d1de4982d24cfbcf7a2bffb2c7adad0479
|
[] |
no_license
|
skarthikv-dsl/spill
|
5987f9125b3368520640d3f3b03d52a77aeb9500
|
c2c64ff3fe3404ca41c01b59ddcdb06a7d437fb1
|
refs/heads/master
| 2021-01-17T01:51:03.121649 | 2016-07-19T10:41:27 | 2016-07-19T10:41:27 | 32,441,525 | 0 | 1 | null | 2016-07-19T11:29:57 | 2015-03-18T06:19:14 |
Java
|
UTF-8
|
Java
| false | false | 45,550 |
java
|
package iisc.dsl.picasso.server.sampling;
import java.io.*;
import java.net.Socket;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.DecimalFormat;
import java.util.*;
import iisc.dsl.picasso.common.ClientPacket;
import iisc.dsl.picasso.common.PicassoConstants;
import iisc.dsl.picasso.common.ApproxParameters;
import iisc.dsl.picasso.common.ds.DataValues;
import iisc.dsl.picasso.common.ds.DiagramPacket;
import iisc.dsl.picasso.common.ds.QueryPacket;
import iisc.dsl.picasso.server.db.Database;
import iisc.dsl.picasso.server.db.Histogram;
import iisc.dsl.picasso.server.db.mssql.MSSQLDatabase;
import iisc.dsl.picasso.server.db.oracle.OracleDatabase;
import iisc.dsl.picasso.server.db.postgres.PostgresDatabase;
import iisc.dsl.picasso.server.db.sybase.SybaseDatabase;
import iisc.dsl.picasso.server.network.ServerMessageUtil;
import iisc.dsl.picasso.server.plan.Plan;
import iisc.dsl.picasso.server.query.Query;
import iisc.dsl.picasso.server.PicassoDiagram;
import iisc.dsl.picasso.server.PicassoException;
import linpack.QR_j;
public abstract class PicassoSampling extends PicassoDiagram{
private static final long serialVersionUID = 8039356788103077907L;
protected DataValues[] actual_data;
protected int[] planList;
protected Vector<Plan> actual_plans;
protected Vector<String> plan_area;
protected double areaError=0;
protected double identityError = 0;
protected double errorPercent_I = 0;
protected double errorPercent_L = 0;
protected ApproxParameters ApproxParams;
protected int reqSampleSize;
protected int SamplingMode;
protected int actualPlans;
protected int sampleSize;
protected String CompareQuery = null;
protected boolean devMode = false;
public boolean stopCompile = false;
protected int totalSize;
protected int activity;
protected int[] offsetFromOrigin;
protected int reloc_resolution[];
int LPDist = 1;
boolean endIteration =false;
int[] cbIndex;
int[] currIndex;
int[] dimVar;
int[] planInx;
int[] index;
int lazyqtid;
float[] planWts;
int distance;
long startTime;
boolean stopNN=false;
boolean dimPresent = false;
protected boolean FPCMode = false; //This variable denotes whether AGS is running in FPC mode or not
LinkedList<String> abstractPlanList = null; //This list stores the abstract plan list found in sampling
Query query;
Histogram[] hist;
boolean seerMode = true;
double minCard = -1;
long timeTaken = 0;
boolean isEstimationProcess = false;
public PicassoSampling(Socket s, ObjectInputStream in, ObjectOutputStream out, ClientPacket cp, Database db) {
super(s, in, out, cp, db);
ApproxParams = cp.getApproxParameters();
try {
SamplingMode = ApproxParams.SamplingMode;
FPCMode = ApproxParams.FPCMode;
} catch (RuntimeException e) {
e.printStackTrace();
}
try{
if(Integer.parseInt(ApproxParams.getValue("UserMode"))==1)
devMode = true;
}
catch(Exception rSizeNotInt){
devMode = false;
}
try{
errorPercent_I = Double.parseDouble(ApproxParams.getValue("IError"));
}
catch(Exception eNotDouble){
errorPercent_I = (double)10;
}
try{
errorPercent_L = Double.parseDouble(ApproxParams.getValue("LError"));
}
catch(Exception eNotDouble){
errorPercent_L = (double)10;
}
if(devMode)
{
CompareQuery = ApproxParams.getValue("CompareQuery");
try{
reqSampleSize = Integer.parseInt(ApproxParams.getValue("SampleSize"));
}
catch(Exception rSizeNotInt){
reqSampleSize = -1;
}
}
}
public FileWriter RMSwriter = null;
public void initializeParams() throws PicassoException
{
try{
startTime = System.currentTimeMillis();
database.emptyPlanTable();
int qtid = database.getQTID(queryPacket.getQueryName());
boolean flag = false;
dimension = queryPacket.getDimension();
/*
* If we already have Picasso Diagram generated and another request comes in... throw an Exception
*/
lazyqtid = -1;
if(qtid >= 0)
{
QueryPacket sqp = database.getQueryPacket(queryPacket.getQueryName());
for(int i= 0; i< dimension; i++)
if(sqp.getResolution(i) != queryPacket.getResolution(i) || sqp.getStartPoint(i) != queryPacket.getStartPoint(i) || sqp.getEndPoint(i) != queryPacket.getEndPoint(i))
flag=true;
if((!sqp.getDistribution().equals(queryPacket.getDistribution())) ||
(!sqp.getOptLevel().equals(queryPacket.getOptLevel())) ||
(!sqp.getPlanDiffLevel().equals(queryPacket.getPlanDiffLevel())) ||
(!sqp.getTrimmedQueryTemplate().equals(queryPacket.getTrimmedQueryTemplate())) || flag)
{
// database.deletePicassoDiagram(queryPacket.getQueryName());
lazyqtid = qtid;
qtid = -1;
}
else if(queryPacket.getExecType().equals(PicassoConstants.APPROX_COMPILETIME_DIAGRAM)){
lazyqtid = qtid;
// database.deletePicassoDiagram(queryPacket.getQueryName());
qtid = -1;
}
}
query = Query.getQuery(queryPacket,database);
if(!isEstimationProcess) {
ServerMessageUtil.sendStatusMessage(sock,reader,writer,0,"Generating Approximate Compilation Diagram");
ServerMessageUtil.SPrintToConsole("Generating Approximate Compilation Diagram");
}
dimension = query.getDimension();
queryPacket.setDimension(dimension);
reloc_resolution = queryPacket.getResolution();
resolution = new int[dimension];
for(int j=0;j<dimension;j++)
resolution[j] = reloc_resolution[j];
offsetFromOrigin = new int[dimension];
for(int i=0;i<dimension;i++){
offsetFromOrigin[i] = 0;
}
query.genConstants(resolution, queryPacket.getDistribution(), queryPacket.getStartPoint(), queryPacket.getEndPoint());
totalSize=1;
int ressum = 0;
for(int i=0;i<dimension;i++){
totalSize *= resolution[i];
ressum += resolution[i];
}
/* Initialize all data structures */
plans = new Vector<Plan>();
data = new DataValues[totalSize];
picsel = new float[ressum];
plansel = new float[ressum];
predsel = new float[ressum];
relNames = new String[dimension];
index = new int[dimension];
currIndex = new int[dimension];
hist = new Histogram[dimension];
for(int i=0;i<dimension;i++){
relNames[i] = query.getRelationName(i);
index[i]=0;
hist[i] = query.getHistogram(i);
}
if(skipOptimize())
{
actual_data = getActualPlan(CompareQuery);
actualPlans = actual_plans.size();
planList = new int[actualPlans];
for(int i=0;i<actualPlans;i++)
{
planList[i]=-1;
}
}
plan_area = new Vector<String>();
if(reqSampleSize <= 0)
reqSampleSize = totalSize;
if(FPCMode)
abstractPlanList = new LinkedList<String>();
XMLplans = new Vector();
trees = new Vector();
long startTime = System.currentTimeMillis();
queryPacket.setGenTime(startTime);
}
catch(Exception e) {
e.printStackTrace();
throw new PicassoException(e.getMessage());
}
}
protected void savePicassoDiagram()throws PicassoException
{
try{
Plan plan = null;
for(int j=0;j<dimension;j++)
{
index[j] = 0;
}
for(int j=0;j<dimension;j++)
{
for(int i=0;i<resolution[j];i++)
{
index[j] = i;
plan = (Plan)plans.get(data[getIndex(index)].getPlanNumber());
computeSelectivity(query,index,hist,plan);
}
}
/*for(int k=0;k<totalSize;k++)
{
if(data[k].getCard() < 0)
System.out.println("Card<0:"+k);
}*/
/*
* If we have generated a diagram here, storedResolution is equal to the requested resolution
* Which we pass to the doReadPicassoDiagram() function.
*/
long duration = System.currentTimeMillis() - startTime;
queryPacket.setGenDuration(duration);
/* Store the QTIDMap entry now */
DecimalFormat df = new DecimalFormat("0.00E0");
df.setMaximumFractionDigits(2);
double sSize = (sampleSize*100.0)/(double)totalSize;
//String qname = queryPacket.getQueryName();
if(lazyqtid != -1)
database.deletePicassoDiagram(queryPacket.getQueryName());
int qtid = database.addApproxQueryPacket(queryPacket);
storePicassoDiagram(qtid);
ServerMessageUtil.sendStatusMessage(sock,reader,writer,0,"Saving Selectivity Logs");
storeSelectivityLog(query, qtid, hist);
ServerMessageUtil.sendStatusMessage(sock,reader,writer,30,"Saving Plan Trees");
storePlans(qtid);
storeApproxMap(qtid);
if(database instanceof MSSQLDatabase && PicassoConstants.SAVE_XML_INTO_DATABASE == true)
storeXMLPlans(qtid);
String durStr = getTimeString((int)(System.currentTimeMillis()-startTime)/1000);
ServerMessageUtil.sendStatusMessage(sock,reader,writer,100,"Finished. Duration "+durStr);
DiagramPacket dp = doReadPicassoDiagram(query, resolution);
if(dp == null)
ServerMessageUtil.SPrintToConsole("Reading Picasso Diagram failed");
/*Vector v = clientPacket.getDimensions();
if(v.size()<2)
throw new PicassoException("Dimensions to vary are not selected");
int dim1 = ((Integer)v.get(0)).intValue();
int dim2 = ((Integer)v.get(1)).intValue();
if(dim2<dim1)
dp.transposeDiagram();*/
dp.setDataPoints(data);
dp.setApproxError(errorPercent_L, errorPercent_I);
dp.setApproxSampleSize(sSize,SamplingMode,FPCMode);
dp.approxDiagram = true;
ServerMessageUtil.sendPlanDiagram(sock, reader, writer, queryPacket, dp,trees);
}catch(Exception e) {
if(database.isConnected() && lazyqtid == -1)
database.deletePicassoDiagram(queryPacket.getQueryName());
e.printStackTrace();
throw new PicassoException(e.getMessage());
}
}
protected void storeApproxMap(int qtid) throws PicassoException
{
//int sid = 0;
try{
Statement stmt = database.createStatement();
String attribList = "QTID, SAMPLESIZE, SAMPLINGMODE, AREAERROR, IDENTITYERROR ,FPCMODE" ;
String FPCval = "";
if(FPCMode)
FPCval += ",1";
else
FPCval += ",0";
/*if(!devMode)
{
areaError = 101;
identityError = 101;
}*/
double sSize = (sampleSize*100.0)/(double)totalSize;
String temp = "insert into "+database.getSettings().getSchema()+".PicassoApproxMap ("+attribList+
") values ("+qtid+", "/*+sid+", "*/+sSize+", "+SamplingMode+", "+errorPercent_L+", "+errorPercent_I+FPCval+")";
//System.out.println(temp);
stmt.executeUpdate("insert into "+database.getSettings().getSchema()+".PicassoApproxMap ("+attribList+
") values ("+qtid+", "/*+sid+", "*/+sSize+", "+SamplingMode+", "+errorPercent_L+", "+errorPercent_I+FPCval+")");
stmt.close();
}catch(SQLException e){
e.printStackTrace();
ServerMessageUtil.SPrintToConsole("Error adding Approx QTIDMap Entry:"+e);
throw new PicassoException("Error adding Approx QTIDMap Entry:"+e);
}
}
public boolean skipOptimize()
{
if((devMode && !CompareQuery.equals("-1")) )
return(true);
return(false);
}
protected void setPlanResult() throws PicassoException
{
try{
Plan plan;
for(int i=0;i<dimension;i++)
{
currIndex[i] = index[i] + offsetFromOrigin[i];
}
//System.out.println(currIndex[0]+","+currIndex[1]);
int inx = getIndex(index);
int act_inx = getIndexRelocated(currIndex);
/*if(data[inx]!=null && data[inx].isRepresentative)
return;*/
String planDiffLevel = queryPacket.getPlanDiffLevel();
MSSQLDatabase mdb=null;
SybaseDatabase sdb=null;
int planNumber;
String newQuery=null;
String absPlan = null;
if(!skipOptimize())
{
newQuery = query.generateQuery(currIndex);
plan = database.getPlan(newQuery,query);
if ( database instanceof MSSQLDatabase )
plan.computeMSSQLHash(planDiffLevel);
else
plan.computeHash(planDiffLevel);
planNumber = plan.getIndexInVector(plans);
if(plan == null){
ServerMessageUtil.SPrintToConsole("Error getting proper plan from database");
throw new PicassoException("Error getting proper plan from database");
}
}
else
{
try {
plan = (Plan)actual_plans.get(actual_data[act_inx].getPlanNumber());
} catch (RuntimeException e) {
plan = null;
}
planNumber = planList[actual_data[act_inx].getPlanNumber()] ;
}
if(planNumber == -1){
plans.add(plan);
planNumber=plans.size() - 1;
try {
plan.setPlanNo(planNumber);
} catch (RuntimeException e) {
;
}
if(skipOptimize())
planList[actual_data[act_inx].getPlanNumber()] = planNumber;
plan_area.add(""+1);
if(FPCMode){
if (database instanceof MSSQLDatabase){
mdb = (MSSQLDatabase)database;
absPlan = mdb.getAbsPlan(newQuery);
}
else if (database instanceof SybaseDatabase){
sdb = (SybaseDatabase)database;
absPlan = sdb.getAbsPlan(newQuery);
}
abstractPlanList.addLast(absPlan);
//System.out.println(" Abstract plan "+planNumber+" saved");//\nPlan: "+absPlan);
}
trees.add(new Integer(planNumber));
trees.add(plan.createPlanTree());
}
else
plan_area.set(planNumber,""+(Integer.parseInt(plan_area.get(planNumber).toString())+1));
data[inx] = new DataValues();
data[inx].setPlanNumber(planNumber);
if(!skipOptimize())
{
data[inx].setCard(plan.getCard());
data[inx].setCost(plan.getCost());
}
else
{
data[inx].setCard(actual_data[act_inx].getCard());
data[inx].setCost(actual_data[act_inx].getCost());
}
data[inx].setRepresentative(true);
sampleSize++;
}
catch(Exception e1)
{
e1.printStackTrace();
}
}
protected int errCost = 0;
boolean isLP = false;
protected double maxErrCost = 0.0;int costCount = 0;
public DataValues setData(DataValues toData,DataValues fromData)
{
toData = new DataValues();
toData.setPlanNumber(fromData.getPlanNumber());
toData.setCard(fromData.getCard());
toData.setCost(fromData.getCost());
toData.setRepresentative(false);
return(toData);
}
protected double maxCost = 0.0,maxCardErr = 0.0,maxCard=0.0;
public void compareRunTime()
{
for(int i=0;i<dimension;i++){
index[i]=0;
}
int inx = 0;
areaError = 0;
try {
identityError = ((double)actualPlans - (double)plans.size())/(double)actualPlans;
identityError = identityError * 100;
} catch (RuntimeException e) {
identityError = -1;
}
try {
while(index[dimension-1] <= resolution[dimension-1]-1){
inx = getIndex(index);
if(planList[actual_data[inx].getPlanNumber()]!=data[inx].getPlanNumber())
{
areaError++;
}
for(int i=0;i<dimension;i++){
if(index[i] < resolution[i]-1) {
index[i]++;
break;
}else if(i == dimension -1)
index[i]++;
else
index[i] = 0;
}
}
areaError = (areaError*100)/totalSize;
} catch (RuntimeException e) {
areaError = -1;
e.printStackTrace();
}
System.out.println("Sample Size : "+sampleSize+",Area error : "+areaError+",Identity Error : " + identityError);
}
protected int sendProgress(int count,int pointsEvaluated,long startTime,int activity)
{
if(isEstimationProcess)
ServerMessageUtil.sendStatusMessage(sock, reader, writer,0,"Estimating Approximation Time");
else if(count++ == PicassoConstants.SEGMENT_SIZE)
{
// Check if thread has been interrupted, if so throw an interrupt exception
try {
ifInterruptedStop();
ifPausedSleep();
//ifCompileStopped();
} catch (PicassoException e) {
e.printStackTrace();
}
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(0);
//This is to ensure that progress doesn't go beyond 100%
//Not a very good way - find a better solution
if(pointsEvaluated > totalSize)
pointsEvaluated = totalSize;
//End
double progress = 100 * pointsEvaluated / (double)totalSize;
int sampleRemaining = (reqSampleSize-sampleSize);
if(sampleRemaining<0)
sampleRemaining = 0;
String durStr = getTimeString((int)(System.currentTimeMillis() - startTime)/1000);
String statstr = "";
if(activity == -1){
statstr = " Preprocessing ";
}else if(activity == 0){
statstr = " Plan Diagram Phase 1 ";
}else if(activity == 1){
statstr = " Plan Diagram Phase 2 ";
}else if(activity == 2){
statstr = " Cost and Cardinality Diagram Phase ";
}
String message = statstr;
if(activity >= 0){
if(progress%10 == 0)
System.out.println(statstr+""+Math.round(progress)+"% Completed "+"Elapsed Time: "+durStr);
message += df.format(progress)+"% "+"Elapsed Time: "+durStr;
if(activity == 0 || activity == 1)
message += " Plans discovered: "+plans.size();
}
ServerMessageUtil.sendStatusMessage(sock, reader, writer, (int)progress,message);
clientPacket.setProgress((int)progress);
count = 0;
}
return(count);
}
public void ifCompileStopped()throws PicassoException
{
if(stopCompile == true)
{
stopCompile = false;
reqSampleSize = sampleSize;
}
}
public int[] getIndexBack(int inx)
{
int[] index = new int[dimension];
for(int i = 0; i < dimension;i++)
{
index[i] = inx % resolution[i];
inx /= resolution[i];
}
return index;
}
/*Checks actual and approx diagrams have identical resolutions*/
public boolean checkActualAndApproxResolution(QueryPacket actual, QueryPacket approx)
{
int[] actual_res = actual.getResolution();
int[] approx_res = approx.getResolution();
for(int i = 0;i < dimension;i++){
if(actual_res[i] != approx_res[i])
return false;
}
return true;
}
public DataValues[] getActualPlan(String sql) throws PicassoException
{
double[] step;
int length=1;
Hashtable selAttrib = clientPacket.getAttributeSelectivities();
DataValues[] p_data;
/* int skipDim[]=null;
double skipSel[]=null;
if(selAttrib != null){
skipDim = new int[selAttrib.size()];
skipSel = new double[selAttrib.size()];
}
*/
actual_plans = new Vector<Plan>();
int actual_qtid = database.getQTID(sql);
QueryPacket approx_qp = database.getQueryPacket(sql);
//if(sqp.getDimension() != queryPacket.getDimension() ||
if((!approx_qp.getDistribution().equals(queryPacket.getDistribution())) ||
(!approx_qp.getOptLevel().equals(queryPacket.getOptLevel())) ||
(!approx_qp.getPlanDiffLevel().equals(queryPacket.getPlanDiffLevel())) ||
(dimension != approx_qp.getDimension()) ||
!checkActualAndApproxResolution(queryPacket,approx_qp)) {
ServerMessageUtil.SPrintToConsole("Actual & Approx Data are not matching!!!");
throw new PicassoException("Actual & Approx Data are not matching!!!");
}
int[] storedResolution = approx_qp.getResolution();
/* if(resolution != approx_qp.getResolution() || dimension != approx_qp.getDimension())
{
ServerMessageUtil.SPrintToConsole("Actual & Approx Data are not matching!!!");
throw new PicassoException("Actual & Approx Data are not matching!!!");
}
*/ for(int i=0;i<dimension;i++)
length *= resolution[i];
p_data = new DataValues[length];
String qText;
qText= "select QID,PLANNO,CARD,COST from "+database.getSchema()+".PicassoPlanStore "+
"where PicassoPlanStore.QTID="+actual_qtid+" order by PicassoPlanStore.QID";
try{
Statement stmt = database.createStatement();
ResultSet rs = stmt.executeQuery("SELECT SID,PICSEL,PLANSEL,PREDSEL,DATASEL,CONST from "+database.getSchema()+
".PicassoSelectivityLog where QTID="+actual_qtid+" order by DIMENSION,SID");
int i=0;
//int tmpindex=0;
step = new double[dimension];
for(int j = 0;j < dimension;j++)
step[j] = (double)((storedResolution[j])) / (double)(resolution[j]);
stmt = database.createStatement();
rs = stmt.executeQuery(qText);
int qid;
DataValues max = new DataValues();
DataValues min = new DataValues();
min.setCost(1e300);
min.setCard(1e300);
double index[] = new double[dimension];
for(i=0;i<dimension;i++)
index[i]=step[i] / 2.0;
i=-1;
float cost,card;
int planno;
while(rs.next()){
ifInterruptedStop();
ifPausedSleep();
boolean skipFlag=false;
qid = rs.getInt(1);
planno = rs.getInt(2);
card = (float)rs.getDouble(3);
cost = (float)rs.getDouble(4);
if(cost > max.getCost())
max.setCost(cost);
if(planno+1 > max.getPlanNumber())
max.setPlanNumber(planno+1);
if(card > max.getCard())
max.setCard(card);
if(cost < min.getCost())
min.setCost(cost);
if(card < min.getCard())
min.setCard(card);
if(qid<getIndex(index,storedResolution))
continue;
for(int j=0;j<dimension;j++){
if(index[j] < storedResolution[j] - step[j])
{
index[j] += step[j];
break;
}
else if(j == dimension -1)
index[j] += step[j];
else
index[j] = step[j] / 2.0;
}
if(skipFlag)
continue;
i++;
p_data[i] = new DataValues();
p_data[i].setPlanNumber(planno);
p_data[i].setCard(card);
p_data[i].setCost(cost);
try{
if(actual_plans.get(planno) == null || actual_plans.get(planno).equals(null))
{
actual_plans.set(planno,Plan.getPlan(database,actual_qtid, p_data[i].getPlanNumber(),approx_qp.getPlanDiffLevel()));
}
}
catch(Exception ex){
if(planno >= actual_plans.size())
while(planno >= actual_plans.size())
actual_plans.add(null);
actual_plans.set(planno,Plan.getPlan(database,actual_qtid, p_data[i].getPlanNumber(),approx_qp.getPlanDiffLevel()));
}
}
if(i+1<length){
ServerMessageUtil.SPrintToConsole("Number of generated points="+(i+1)+" and length="+length);
throw new PicassoException("Picasso Diagram was not generated properly.");
}
rs.close();
stmt.close();
actualPlans = actual_plans.size();
return(p_data);
}catch(SQLException e){
e.printStackTrace();
ServerMessageUtil.SPrintToConsole("Error reading Plan Diagram "+e);
throw new PicassoException("Error reading Plan Diagram "+e);
}
}
protected double abstractPlanCost(Query query, int index[], int sourcePlan) throws PicassoException
{
int inx = getIndex(index);
if(data[inx]!=null && data[inx].FPCdone == true)
return(data[inx].getCost());
Plan plan;
String newQuery=null;
//long startTime = System.currentTimeMillis();
String absPlan = (String)abstractPlanList.get(sourcePlan);//Fetch the plan from list
//Abstract plan costing for a particular index
if (database instanceof MSSQLDatabase){
newQuery = query.generateQuery(index) + "--Picasso_Abstract_Plan\noption (use plan N'" + absPlan + "')\n";
}else if (database instanceof SybaseDatabase){
newQuery = query.generateQuery(index) + "--Picasso_Abstract_Plan\nplan '" + absPlan + "'\n";
}else{
newQuery = query.generateQuery(index) ;
}
//end
plan = database.getPlan(newQuery,query);
//Check for the cost and return it
double foreignPlanCost = plan.getCost();
/*long durTime = System.currentTimeMillis();
long timeTaken = (durTime-startTime);*/
//System.out.println(sourcePlan + "--> Time taken by FPC: "+timeTaken);
return(foreignPlanCost);
}
protected Plan abstractPlan(Query query, int index[], int sourcePlan) throws PicassoException
{
int inx = getIndex(index);
if(data[inx]!=null && data[inx].FPCdone == true)
return(plans.get(data[inx].getPlanNumber()));
Plan plan;
String newQuery=null;
//long startTime = System.currentTimeMillis();
String absPlan = (String)abstractPlanList.get(sourcePlan);//Fetch the plan from list
//Abstract plan costing for a particular index
if (database instanceof MSSQLDatabase){
newQuery = query.generateQuery(index) + "--Picasso_Abstract_Plan\noption (use plan N'" + absPlan + "')\n";
}else if (database instanceof SybaseDatabase){
newQuery = query.generateQuery(index) + "--Picasso_Abstract_Plan\nplan '" + absPlan + "'\n";
}else{
newQuery = query.generateQuery(index) ;
}
//end
plan = database.getPlan(newQuery,query);
//Check for the cost and return it
//double foreignPlanCost = plan.getCost();
//long durTime = System.currentTimeMillis();
//long timeTaken = (durTime-startTime);
//system.out.println("Time taken by FPC: "+timeTaken);
return(plan);
}
/*
//Function to cost a local plan using abstract plan methods - cost should be equal
private boolean checkCostCorrectness(Query query, int index[], int sourcePlan) throws PicassoException
{
Plan plan;
String newQuery=null;
int inx = getIndex(index);
double cost1,cost2;
cost1 = data[inx].getCost();
String absPlan = (String)abstractPlanList.get(sourcePlan);//Fetch the plan from list
//Abstract plan costing for a particular index
if (database instanceof MSSQLDatabase)
newQuery = query.generateQuery(index) + "--Picasso_Abstract_Plan\noption (use plan N'" + absPlan + "')\n";
else if (database instanceof SybaseDatabase)
newQuery = query.generateQuery(index) + "--Picasso_Abstract_Plan\nplan '" + absPlan + "'\n";
//end
newQuery = query.generateQuery(index);
plan = database.getPlan(newQuery,query);
//Check for the cost and return it
cost2 = plan.getCost();
if(Math.abs(cost1 - cost2) < 0.0005)
return(true);
return(false);
}
*/
protected void lowPass()
{
int []boxDim = new int[dimension];
for(int i=0;i<dimension;i++){
index[i]=resolution[i] - 1;
boxDim[i]=1;
}
int inx;
endIteration = false;
while(!endIteration)
{
inx = getIndex(index);
try {
if(!data[inx].isRepresentative)
{
lowPass_ND(index);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
decrIndex(index,boxDim);
}
}
double cardLP = 0;
private void lowPass_ND(int[] index)
{
cbIndex = new int[dimension];
dimVar = new int[dimension];
for(int i=0;i<dimension;i++)
{
cbIndex[i]=index[i];
}
distance = 1;
cardLP = 0;
int num_plans = plans.size();
planWts = new float[num_plans];
planInx = new int[num_plans];
for(int i=0;i<num_plans;i++)
{
planWts[i]=0;
planInx[i]=-1;
}
nCount = 0.0;
lpCost = 0.0;
recursiveLowPass(dimension);
//data[getIndex(cbIndex)].setCard(cardLP/nCount);
}
double lpCost = 0,nCount=0;
private void recursiveLowPass(int depth)
{
int pnt = depth-1;
//int inx = 0;
if(depth == dimension)
{
while(distance<=LPDist)
{
dimPresent = false;
if(dimension == 1)
{
dimVar[pnt]=distance;
doLPJob();
dimVar[pnt]=(short)-distance;
doLPJob();
}
else
for(dimVar[pnt]=-distance;dimVar[pnt]<=distance;dimVar[pnt]++){
if(Math.abs(dimVar[pnt])==distance)
dimPresent = true;
else
dimPresent = false;
recursiveLowPass(pnt);
}
distance++;
}
}
else if(depth == 1)
{
if(!dimPresent)
{
dimVar[pnt]=distance;
doLPJob();
dimVar[pnt]=(short)-distance;
doLPJob();
}
else
for(dimVar[pnt]=(short)-distance;dimVar[pnt]<=distance;dimVar[pnt]++){
doLPJob();
}
}
else
{
for(dimVar[pnt]=(short)-distance;dimVar[pnt]<=distance && !stopNN;dimVar[pnt]++){
if(Math.abs(dimVar[pnt])==distance)
dimPresent = true;
recursiveLowPass(depth-1);
}
}
}
private void doLPJob()
{
int pNum = 0;
int neighbor[] = new int[dimension];
for(int i=0;i<dimension;i++)
{
neighbor[i] = cbIndex[i] + dimVar[i];
if(neighbor[i]>resolution[i]-1 || neighbor[i]<0)
return;
}
int inx = getIndex(neighbor);
if(data[inx]==null)
return;
pNum = data[inx].getPlanNumber();
planWts[pNum]++;
if(planInx[pNum] < 0)
planInx[pNum] = inx;
if(data[inx].getCost() > 0)
{
lpCost += data[inx].getCost();
}
if(data[inx].isRepresentative)
{
cardLP += 4*data[inx].getCard();
nCount +=4;
}
cardLP += data[inx].getCard();
nCount ++;
}
//decrements index by boxdim amount
protected int[] decrIndex(int[] index,int[] boxDim)
{
endIteration = false;
for(int i=0;i<dimension;i++){
if(index[i] >= boxDim[i]) {
index[i] -= boxDim[i];
break;
}else if(i == dimension -1)
{
if(index[i]>=boxDim[i])
index[i] -= boxDim[i];
else
endIteration = true;
}
else
index[i] = resolution[i] - 1;
}
return(index);
}
protected int getPlanNumber(DataValues[] data,int[] index)
{
int inx = getIndex(index);
return(data[inx].getPlanNumber());
}
/*
* Cost and Cardinality Estimation Functions
*/
double plan_coeff[][];
CostFunction costF;
CardFunction cardF;
double x_picsel[];
protected void findCardnCostFunction()
{
int res = 0;
for(int j=0;j<dimension;j++)
{
for(int i = 0;i < resolution[j];i++){
picsel[res + i] = (float)hist[j].getPicSel(i);
}
res += resolution[j];
}
cardF = new CardFunction(data,dimension,resolution,picsel);
costF = new CostFunction(data,picsel,plans.size(),dimension,resolution);
}
protected double getCard(int []a_index)
{
double card = cardF.getCard(getIndex(a_index));
return card;
}
protected double getCost(int []a_index,int p_id)
{
double cost = costF.getCost(getIndex(a_index), p_id);
return cost;
}
double fpcCost = 0;
protected int findNearestNeighbor()
{
dimVar = new int[dimension];
distance = 1;
stopNN=false;
int num_plans = plans.size();
planWts = new float[num_plans];
planInx = new int[num_plans];
for(int i=0;i<num_plans;i++)
{
planWts[i]=0;
planInx[i]=-1;
}
recursiveNNSearch(dimension);
double tmpDistance = 0;int pNum=-1;
int prevPNum = -1;
for(int i=0;i<num_plans;i++)
{
if(planWts[i]<=0)
continue;
if(tmpDistance < planWts[i])
{
tmpDistance = planWts[i];
if(pNum >= 0 && FPCMode)
{
double fpcPrev = 0;
double fpcNext = 0;
if(prevPNum != pNum)
{
try {
fpcPrev = abstractPlanCost(query,index,pNum);
} catch (PicassoException e) {
e.printStackTrace();
}
prevPNum = pNum;
fpcCost = fpcPrev;
}
try {
fpcNext = abstractPlanCost(query,index,i);
} catch (PicassoException e) {
e.printStackTrace();
}
if(fpcNext < fpcPrev)
{
pNum = i;
fpcCost = fpcNext;
prevPNum = pNum;
}
}
else
pNum = i;
}
}
return(planInx[pNum]);
}
private void recursiveNNSearch(int depth)
{
int pnt = depth-1;
if(depth == dimension)
{
while(!stopNN)
{
dimPresent = false;
if(dimension == 1)
{
dimVar[pnt]=distance;
doNNJob();
dimVar[pnt]=-distance;
doNNJob();
}
else
for(dimVar[pnt]=-distance;dimVar[pnt]<=distance;dimVar[pnt]++){
if(Math.abs(dimVar[pnt])==distance)
dimPresent = true;
else
dimPresent = false;
recursiveNNSearch(pnt);
}
distance++;
}
}
else if(depth == 1)
{
if(!dimPresent)
{
dimVar[pnt]=distance;
doNNJob();
dimVar[pnt]=-distance;
doNNJob();
}
else
for(dimVar[pnt]=-distance;dimVar[pnt]<=distance;dimVar[pnt]++){
doNNJob();
}
}
else
{
for(dimVar[pnt]=-distance;dimVar[pnt]<=distance;dimVar[pnt]++){
if(Math.abs(dimVar[pnt])==distance)
dimPresent = true;
recursiveNNSearch(depth-1);
}
}
}
private void doNNJob()
{
int pNum = 0;
int neighbor[] = new int[dimension];
for(int i=0;i<dimension;i++)
{
neighbor[i] = index[i] + dimVar[i];
if(neighbor[i]>resolution[i]-1 || neighbor[i]<0)
return;
}
int inx = getIndex(neighbor);
if(data[inx]==null || !data[inx].isRepresentative)
return;
pNum = data[inx].getPlanNumber();
planWts[pNum]++;
if(planInx[pNum] < 0)
planInx[pNum] = inx;
stopNN=true;
}
public double euclideanDist(int[] dist1,int[] dist2)
{
double dist=0;
for(int i=0;i<dimension;i++)
{
dist += Math.pow(dist1[i]-dist2[i],2);
}
dist = Math.sqrt(dist);
return(dist);
}
public double stdDev = 0.0,mean = 0.0;
protected String sampleMode;
public void doGenerateCostnCardDiagram()
{
double planMaxCost[] = new double[plans.size()];
double planMinCost[] = new double[plans.size()];
int progressCount = 0, pointsEvaluated = 0;
for(int k=0;k<plans.size();k++)
{
planMaxCost[k] = 0;
planMinCost[k] = 99999;
}
minCard = Integer.MAX_VALUE;
maxCard = 0;
maxCost = 0;
activity = 2;
for(int k=0;k<totalSize;k++)
{
if(data[k].isRepresentative == true)
{
if(maxCard < data[k].getCard())
maxCard = data[k].getCard();
if(minCard > data[k].getCard())
minCard = data[k].getCard();
if(maxCost < data[k].getCost())
maxCost = data[k].getCost();
if(planMaxCost[data[k].getPlanNumber()]<data[k].getCost())
planMaxCost[data[k].getPlanNumber()]=data[k].getCost();
if(planMinCost[data[k].getPlanNumber()]>data[k].getCost())
planMinCost[data[k].getPlanNumber()]=data[k].getCost();
pointsEvaluated++;
progressCount++;
progressCount = sendProgress(progressCount,pointsEvaluated,startTime,activity);
}
}
double cost = 0,card=0;
if(FPCMode)
{
Plan xplan;
for(int k=0;k<totalSize;k++)
{
if(data[k].isRepresentative == false )
{
if(devMode)
{
try {
cost = actual_data[k].getCost();//use original cost if not area error
card = actual_data[k].getCard();
if(planList[actual_data[k].getPlanNumber()]!=data[k].getPlanNumber())
{
xplan = abstractPlan(query, index, data[k].getPlanNumber());
cost = xplan.getCost();
card = xplan.getCard();
}
data[k].setCost(cost);
data[k].setCard(card);
} catch (PicassoException e) {
;
}
}
else
{
try {
xplan = abstractPlan(query, index, data[k].getPlanNumber());
cost = xplan.getCost();
card = xplan.getCard();
data[k].setCost(cost);
data[k].setCard(card);
} catch (PicassoException e) {
;
}
}
pointsEvaluated++;
progressCount++;
progressCount = sendProgress(progressCount,pointsEvaluated,startTime,activity);
}
}
}
else
{
findCardnCostFunction();
/************************CARD interpolation**********************/
for(int k=0;k<totalSize;k++)
{
if(!data[k].isRepresentative)
{
index = getIndexBack(k);
card = getCard(index);
card = Math.max(card,minCard);
if(database instanceof OracleDatabase || database instanceof PostgresDatabase)
card = Math.round(card);
data[k].setCard(card);
}
}
/************************COST interpolation + WITH_CORRECT**********************/
Vector<Integer> planPts[] = new Vector[plans.size()];
for(int k=0;k<plans.size();k++)
{
planPts[k] = null;
}
int[] Ind = new int[dimension];
for(int k=0;k<totalSize;k++)
{
index = getIndexBack(k);
int planNum = data[k].getPlanNumber();
if(!data[k].isRepresentative)
{
if( data[k].succProb >= 0.5)
{
cost = data[k].getCost();
try {
if(costF.plan_coeff[planNum] != null)
{
cost = getCost(index, planNum);
if(cost > planMinCost[planNum]*0.5 && cost < 2*planMaxCost[planNum])
data[k].setCost(cost);
}
}
catch (RuntimeException e){;}
}
else if(findDistance(k,findNearestNeighbor()) <= 2)
{
index = getIndexBack(k);
cost = data[k].getCost();
try {
if(costF.plan_coeff[planNum] != null)
{
cost = getCost(index, planNum);
if(cost > planMinCost[planNum]*0.5 && cost < 2*planMaxCost[planNum])
data[k].setCost(cost);
}
}
catch (RuntimeException e){
;
}
}
else
{
int candidate = 0;
if(planPts[planNum]==null)
{
planPts[planNum] = new Vector<Integer>();
for(int m=0;m<totalSize;m++)
{
if(data[m].getPlanNumber() == planNum && data[m].isRepresentative)
{
Ind = getIndexBack(m);
for(int d=0;d<dimension;d++)
{
Ind[d]+=1;
}
planPts[planNum].add(new Integer(getIndex(Ind)));
}
}
}
candidate = planPts[planNum].size();
boolean isConvex = true;
if(candidate >= dimension)
{
double [][] A = new double[dimension][candidate];
double []B = new double[dimension];
for(int m=0;m<candidate;m++)
{
index = getIndexBack(planPts[planNum].get(m));
for(int d=0;d<dimension;d++)
{
A[d][m] = index[d]+1;
}
}
index = getIndexBack(k);
for(int d=0;d<dimension;d++)
{
B[d] = index[d]+1;
}
double auxQR[] = new double[candidate];
int[] pivotData = new int[candidate];
double[] tmpSpace = new double[candidate];
QR_j.dqrdc_j(A, dimension, candidate, auxQR, pivotData, tmpSpace, 1); //Finding QR decomposition using LINPACK
double[] Output = new double[dimension];
double QB[] = new double[dimension];
double QTB[] = new double[dimension];
double residual[] = new double[dimension];
double XB[] = new double[dimension];
try {
QR_j.dqrsl_j(A, dimension, dimension, auxQR, B, QB, QTB, Output, residual, XB, 111); //Finding solution of Ax=B using LINPACK
} catch (RuntimeException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
for(int c=0;c<A.length;c++)
{
if(Output[c]>1 || Output[c]<0)
{
isConvex = false;
break;
}
}
}
if(isConvex)
{
index = getIndexBack(k);
cost = data[k].getCost();
try {
if(costF.plan_coeff[planNum] != null)
{
cost = getCost(index, planNum);
if(cost > planMinCost[planNum]*0.5 && cost < 2*planMaxCost[planNum])
data[k].setCost(cost);
}
}
catch (RuntimeException e){
;
}
}
else
{
index = getIndexBack(k);
neighbor_count = 3;
neighbor_plan = planNum;
findNearestPlanNeighbor();
if(planInx[0] != -1 && planInx[1] != -1)
{
double alpha = findDistance(k,planInx[0])/findDistance(planInx[1],planInx[0]);
cost = 0.0;
if(alpha != 1)
cost = data[planInx[0]].getCost() + alpha * (data[planInx[1]].getCost() - data[planInx[0]].getCost());
else
cost = (data[planInx[0]].getCost() + data[planInx[0]].getCost())/2.0;
/*int degree = -1;
for(int m=0;m<3;m++)
{
if(planInx[m] > 0)
degree++;
}
float [] pos = new float[degree+1];
float [] val = new float[degree+1];
for(int m=0;m<degree+1;m++)
{
pos[m] = findDistance(0, planInx[m]);
val[m] = (float)data[planInx[m]].getCost();
}
float cost = lagrangeInterpolatingPolynomial(pos,val,degree,findDistance(0, k)); */
if(cost > planMinCost[planNum]*0.5 && cost < 2*planMaxCost[planNum])
data[k].setCost(cost);
}
}
}
}
}
}
}
/****************Cost Interpolation Procedures: START*****************/
int neighbor_plan, neighbor_count;
protected float findDistance(int p,int q)
{
int pInx[] = new int[dimension];
int qInx[] = new int[dimension];
pInx = getIndexBack(p);
qInx = getIndexBack(q);
float maxDistance = 0;
for(int i=0;i<dimension;i++)
{
maxDistance += Math.pow(pInx[i]-qInx[i],2);
/*if(maxDistance < tmp)
maxDistance = tmp;*/
}
return (float)Math.sqrt(maxDistance);
}
protected void findNearestPlanNeighbor()
{
dimVar = new int[dimension];
distance = 1;
stopNN=false;
planInx = new int[neighbor_count];
planWts = new float[neighbor_count];
for(int i=0;i<neighbor_count;i++)
{
planInx[i]=-1;
}
recursiveNNSearchForCost(dimension);
}
private void recursiveNNSearchForCost(int depth)
{
int pnt = depth-1;
if(depth == dimension)
{
while(!stopNN)
{
dimPresent = false;
if(dimension == 1)
{
dimVar[pnt]=distance;
doNNJob(dimVar[pnt]);
dimVar[pnt]=-distance;
doNNJob(dimVar[pnt]);
}
else
for(dimVar[pnt]=-distance;dimVar[pnt]<=distance;dimVar[pnt]++){
if(Math.abs(dimVar[pnt])==distance)
dimPresent = true;
else
dimPresent = false;
recursiveNNSearchForCost(pnt);
}
distance++;
}
}
else if(depth == 1)
{
if(!dimPresent)
{
dimVar[pnt]=distance;
doNNJob(dimVar[pnt]);
dimVar[pnt]=-distance;
doNNJob(dimVar[pnt]);
}
else
for(dimVar[pnt]=-distance;dimVar[pnt]<=distance;dimVar[pnt]++){
doNNJob(dimVar[pnt]);
}
}
else
{
for(dimVar[pnt]=-distance;dimVar[pnt]<=distance;dimVar[pnt]++){
if(Math.abs(dimVar[pnt])==distance)
dimPresent = true;
recursiveNNSearchForCost(depth-1);
}
}
}
private void doNNJob(int dist)
{
for(int i=0;i<dimension;i++)
{
if(distance > resolution[i]/2)
{
stopNN = true;
return;
}
}
int pNum = 0;
int neighbor[] = new int[dimension];
for(int i=0;i<dimension;i++)
{
neighbor[i] = index[i] + dimVar[i];
if(neighbor[i]>resolution[i]-1 || neighbor[i]<0)
return;
}
int inx = getIndex(neighbor);
if(data[inx]==null || !data[inx].isRepresentative)
return;
pNum = data[inx].getPlanNumber();
boolean isModified = false;
if(pNum == neighbor_plan)
{
int i=0;
for(;i<neighbor_count;i++)
{
if(planInx[i]<0)
{
/*if(i>0 && planWts[i-1]==dist)
continue;
else{*/
planInx[i] = inx;
planWts[i] = dist;
isModified = true;
break;
//}
}
}
if(isModified && i==neighbor_count)
stopNN=true;
}
}
/****************Cost Interpolation Procedures: END*****************/
public void setOffset(int[] offset)
{
offsetFromOrigin = new int[dimension];
for(int i=0;i<dimension;i++){
offsetFromOrigin[i] = offset[i];
}
}
/*public void setPoints(int inx)
{
for(int i=0;i<dimension;i++)
{
currIndex[i] = index[i] + offsetFromOrigin[i];
}
compiledPts.add(""+currIndex);
}*/
protected int getIndexRelocated(int[] index)
{
int tmp=0;
for(int i=index.length-1;i>=0;i--)
tmp=tmp*reloc_resolution[i]+index[i];
return tmp;
}
public int getRelocatedPoints(int inx)
{
currIndex = getIndexBack(inx);
for(int i=0;i<dimension;i++)
{
currIndex[i] += offsetFromOrigin[i];
}
return getIndex(currIndex);
}
boolean isDone = false;
public int estimateTime() throws PicassoException
{
/*if(!isDone){
try {
initializeParams();
isDone = true;
} catch (PicassoException e) {
e.printStackTrace();
}
}
try {
int orig[] = new int[dimension];
int len[] = new int[dimension];
for(int i=0;i<dimension;i++)
{
orig[i] = 0;
len[i] = 16;
}
estimateSampleSize(orig,len);
} catch (Exception e) {
e.printStackTrace();
}*/
return(60);
}
}
|
[
"[email protected]"
] | |
3ae43b743ef5fe569eef7d885ceec9f51ef27c18
|
cb4d13a3a54ae5923e02c670e2dd8ff4b42a7afb
|
/src/main/java/com/basics/lock/aqs/package-info.java
|
0789c79976a8f4b7c355465a61652ce8ac768632
|
[] |
no_license
|
Jossc/JavaCode
|
2386fddc25ce4e6e61d01036889f1354a7b0003c
|
455b19cad0069f548a74c5f463cb4f2330ac27c6
|
refs/heads/master
| 2022-06-27T18:20:10.914198 | 2021-05-16T12:15:09 | 2021-05-16T12:15:09 | 128,711,944 | 12 | 2 | null | 2022-06-21T00:51:39 | 2018-04-09T03:55:10 |
Java
|
UTF-8
|
Java
| false | false | 126 |
java
|
/**
* @ClassName package-info
* @Author chenzhuo
* @Version 1.0
* @Date 2019-05-04 12:23
**/
package com.basics.lock.aqs;
|
[
"czhuo02@!63.com"
] |
czhuo02@!63.com
|
70e1f781bca88a4a515914a8cfcdfb7b68b0ebc3
|
6817701a8b19f4e5f7e4f771baa3b6a117129753
|
/Javaprograms/src/functionalprograms/Cosine.java
|
1df2b6bd4924671e1c7cad0bc09e401239b54c22
|
[] |
no_license
|
shalini2492/AssignmentPrograms
|
108feffefebf22a5fd89bfa6edd5987800f80b53
|
16e89a7564256697362ff04dbdf90464d3522f3f
|
refs/heads/master
| 2020-04-06T13:10:33.290650 | 2019-01-12T13:40:46 | 2019-01-12T13:40:46 | 157,487,288 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,167 |
java
|
/* purpose : To compute cosine value of given angle
* author: Shalini
* date: 28/11/2018
* version: 1.0
*/
package functionalprograms;
import static java.lang.Math.cos;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.Math;
//import Utility.Utility;
public class Cosine {
public static void main(String[] args) throws Exception
{
double Pi=3.14519;
BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter number of terms you wish");
int n = Integer.parseInt(read.readLine());
System.out.println("Enter the value of theta");
int theta = Integer.parseInt(read.readLine());
double radians=theta*Pi/180;
System.out.println(radians);
/*double n=30;
n = n % (2 * Math.PI);
double accuracy = (double) 0.0001, x1, denominator, cosx, cosval;
n = n * (double) (3.142/180.0);
x1 = 1;
cosx = x1;
cosval = (double) cos(n);
int i=1;
do
{
denominator = 2 * n * (2 * n - 1);
x1 = -x1 * n * n/denominator;
cosx = cosx + x1;
i = i + 1;
}while(accuracy <= cosx - cosval);
System.out.println("Cosine value of angle: " +n+ " is: " +cosx);
//utility.cosine(n);*/
}
}
|
[
"[email protected]"
] | |
385e8f95e54c438b518ff7430dbf8fdc20df0090
|
4485071e3c44bef87eaff12697ee6518e1da95c4
|
/src/main/java/com/designpatterns/strategy/simulator/MiniDuckSimulator.java
|
26f55c54bc049c8e3bd6cad295c38351170dda2b
|
[] |
no_license
|
juanjelas/head-first-design-patterns
|
a53106d291d6797add9e326f12e139bf0892da0a
|
f9f8e71d8dd27e5d5d66152409ceb0302877f724
|
refs/heads/master
| 2020-05-23T06:56:01.962506 | 2017-03-14T05:09:38 | 2017-03-14T05:09:38 | 84,754,289 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 323 |
java
|
package com.designpatterns.strategy.simulator;
import com.designpatterns.strategy.invariant.Duck;
import com.designpatterns.strategy.invariant.MallardDuck;
public class MiniDuckSimulator {
public static void main(String... args){
Duck mallar = new MallardDuck();
mallar.performFly();
mallar.performQuack();
}
}
|
[
"[email protected]"
] | |
e4679f9522cfe68da1703d10b8ebb36ea2cfbec9
|
234aa1b7cae2d7667ccddabc134c93c822dcf2f5
|
/app/src/main/java/com/vsm/myarapplication/hand/rendering/HandBoxDisplay.java
|
dee5525f711e38d8ad89d49cf526a1236e893ee7
|
[] |
no_license
|
spartdark/hms-arengine-myarapplication
|
d50a1bd25aa31a4f08c5d2e3aaca4f6d99a6ced5
|
669753f8d239b53e774de0d2829325b8459ba656
|
refs/heads/master
| 2023-02-19T12:40:10.797947 | 2021-01-09T00:01:20 | 2021-01-09T00:01:20 | 292,911,537 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,734 |
java
|
package com.vsm.myarapplication.hand.rendering; /**
* Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.
*/
import android.opengl.GLES20;
import android.util.Log;
import com.huawei.hiar.ARHand;
import com.huawei.hiar.ARTrackable;
import com.vsm.myarapplication.common.MatrixUtil;
import com.vsm.myarapplication.common.ShaderUtil;
import java.nio.FloatBuffer;
import java.util.Arrays;
import java.util.Collection;
/**
* This class shows how to use the hand bounding box. With this class,
* a rectangular box bounding the hand can be displayed on the screen.
*
* @author HW
* @since 2020-03-16
*/
class HandBoxDisplay implements HandRelatedDisplay {
private static final String TAG = HandBoxDisplay.class.getSimpleName();
// Number of bytes occupied by each 3D coordinate. Float data occupies 4 bytes.
// Each skeleton point represents a 3D coordinate.
private static final int BYTES_PER_POINT = 4 * 3;
private static final int INITIAL_BUFFER_POINTS = 150;
private static final int COORDINATE_DIMENSION = 3;
private int mVbo;
private int mVboSize = INITIAL_BUFFER_POINTS * BYTES_PER_POINT;
private int mProgram;
private int mPosition;
private int mColor;
private int mModelViewProjectionMatrix;
private int mPointSize;
private int mNumPoints = 0;
private float[] mMVPMatrix;
/**
* Create and build a shader for the hand gestures on the OpenGL thread,
* which is called when {@link HandRenderManager#onSurfaceCreated}.
*/
@Override
public void init() {
ShaderUtil.checkGlError(TAG, "Init start.");
mMVPMatrix = MatrixUtil.getOriginalMatrix();
int[] buffers = new int[1];
GLES20.glGenBuffers(1, buffers, 0);
mVbo = buffers[0];
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, mVbo);
createProgram();
GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, mVboSize, null, GLES20.GL_DYNAMIC_DRAW);
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
ShaderUtil.checkGlError(TAG, "Init end.");
}
private void createProgram() {
ShaderUtil.checkGlError(TAG, "Create program start.");
mProgram = HandShaderUtil.createGlProgram();
mPosition = GLES20.glGetAttribLocation(mProgram, "inPosition");
mColor = GLES20.glGetUniformLocation(mProgram, "inColor");
mPointSize = GLES20.glGetUniformLocation(mProgram, "inPointSize");
mModelViewProjectionMatrix = GLES20.glGetUniformLocation(mProgram, "inMVPMatrix");
ShaderUtil.checkGlError(TAG, "Create program start.");
}
/**
* Render the hand bounding box and hand information.
* This method is called when {@link HandRenderManager#onDrawFrame}.
*
* @param hands Hand data.
* @param projectionMatrix ARCamera projection matrix.
*/
@Override
public void onDrawFrame(Collection<ARHand> hands, float[] projectionMatrix) {
if (hands.size() == 0) {
return;
}
if (projectionMatrix != null) {
Log.d(TAG, "Camera projection matrix: " + Arrays.toString(projectionMatrix));
}
for (ARHand hand : hands) {
float[] gestureHandBoxPoints = hand.getGestureHandBox();
if (hand.getTrackingState() == ARTrackable.TrackingState.TRACKING) {
updateHandBoxData(gestureHandBoxPoints);
drawHandBox();
}
}
}
/**
* Update the coordinates of the hand bounding box.
*
* @param gesturePoints Gesture hand box data.
*/
private void updateHandBoxData(float[] gesturePoints) {
ShaderUtil.checkGlError(TAG, "Update hand box data start.");
float[] glGesturePoints = {
// Get the four coordinates of a rectangular box bounding the hand.
gesturePoints[0], gesturePoints[1], gesturePoints[2],
gesturePoints[3], gesturePoints[1], gesturePoints[2],
gesturePoints[3], gesturePoints[4], gesturePoints[5],
gesturePoints[0], gesturePoints[4], gesturePoints[5],
};
int gesturePointsNum = glGesturePoints.length / COORDINATE_DIMENSION;
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, mVbo);
mNumPoints = gesturePointsNum;
if (mVboSize < mNumPoints * BYTES_PER_POINT) {
while (mVboSize < mNumPoints * BYTES_PER_POINT) {
// If the size of VBO is insufficient to accommodate the new point cloud, resize the VBO.
mVboSize *= 2;
}
GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, mVboSize, null, GLES20.GL_DYNAMIC_DRAW);
}
Log.d(TAG, "gesture.getGestureHandPointsNum()" + mNumPoints);
FloatBuffer mVertices = FloatBuffer.wrap(glGesturePoints);
GLES20.glBufferSubData(GLES20.GL_ARRAY_BUFFER, 0, mNumPoints * BYTES_PER_POINT,
mVertices);
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
ShaderUtil.checkGlError(TAG, "Update hand box data end.");
}
/**
* Render the hand bounding box.
*/
private void drawHandBox() {
ShaderUtil.checkGlError(TAG, "Draw hand box start.");
GLES20.glUseProgram(mProgram);
GLES20.glEnableVertexAttribArray(mPosition);
GLES20.glEnableVertexAttribArray(mColor);
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, mVbo);
GLES20.glVertexAttribPointer(
mPosition, COORDINATE_DIMENSION, GLES20.GL_FLOAT, false, BYTES_PER_POINT, 0);
GLES20.glUniform4f(mColor, 1.0f, 0.0f, 0.0f, 1.0f);
GLES20.glUniformMatrix4fv(mModelViewProjectionMatrix, 1, false, mMVPMatrix, 0);
// Set the size of the rendering vertex.
GLES20.glUniform1f(mPointSize, 50.0f);
// Set the width of a rendering stroke.
GLES20.glLineWidth(18.0f);
GLES20.glDrawArrays(GLES20.GL_LINE_LOOP, 0, mNumPoints);
GLES20.glDisableVertexAttribArray(mPosition);
GLES20.glDisableVertexAttribArray(mColor);
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
ShaderUtil.checkGlError(TAG, "Draw hand box end.");
}
}
|
[
"[email protected]"
] | |
51a6318ab6f765b94cc8bdc33dfc473063f1f9fc
|
fb74ff3d0811628983e32b598c0a6143533ce94d
|
/app/services/CustomerService.java
|
23ad50148a4fec90be413c98b0573ab07c39f231
|
[] |
no_license
|
keco/PhotoSeshBooking
|
7e912a8974941ef7a25cf8c941e50d8b4bf5eeb1
|
9c3e863a7d6886bb18f4dd89e8912e0766dd6d3a
|
refs/heads/master
| 2021-05-29T18:43:22.890687 | 2015-12-01T05:02:26 | 2015-12-01T05:02:26 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 796 |
java
|
package services;
import com.google.inject.ImplementedBy;
import models.Customer;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
/**
* Created by yael on 10/13/15.
*/
@Service
@ImplementedBy(CustomerServiceImpl.class)
public interface CustomerService {
Customer create(Customer inputCustomer);
String validate(Customer customer);
void update(Customer from, Customer to);
int delete(Long id);
int deleteAll();
List<Customer> getAll();
Customer get(Long id);
List<Customer> getByName(String first, String last);
//Auxiliary methods for booking usage
boolean customerIdExists(Long id);
void addToBalance(Long id, BigDecimal balance);
void subtractFromBalance(Long id, BigDecimal balance);
}
|
[
"[email protected]"
] | |
1e13ce6962a1bfbf9a0b3ade0c792ecefdf1f6c5
|
fed0a7808e4044459bc3a6963f7891b752cc2596
|
/sailsio/src/main/java/co/avui/sailsio/annotations/Put.java
|
683e71ec9555e4a15bf72ce119709c9f0454563b
|
[] |
no_license
|
cjose3/android-sails
|
158f96518dca88906fcf721616e5349d0d1356ba
|
3810ce01d2e57b072da23ad19b69e12f8d691e8a
|
refs/heads/master
| 2016-08-11T16:25:09.414827 | 2015-10-07T21:30:54 | 2015-10-07T21:30:54 | 43,845,796 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 367 |
java
|
package co.avui.sailsio.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Created by cmarcano on 07/10/15.
*/
@Target(METHOD)
@Retention(RUNTIME)
public @interface Put {
String value() default "";
}
|
[
"[email protected]"
] | |
8b1d2d1e371e7343e341bc415176ad00ec627365
|
16cbdbc6d94d268663b5b2f30e7554e27355935e
|
/app/src/main/java/easyway/com/reviewit/activities/ViewAllMoviesActivity.java
|
ac3d3f8a54bea07deb469dbc2eba4987a020b81d
|
[] |
no_license
|
sanketkumbhare/ReviewIt
|
80e8b61dd0c8a5b94ff10dc0b491dd816021c6c7
|
bc155cb35ba1bbe3d26d79cd6d47e120145ddc53
|
refs/heads/master
| 2020-03-09T01:43:20.494813 | 2018-05-21T07:23:01 | 2018-05-21T07:23:01 | 128,522,338 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 11,426 |
java
|
package easyway.com.reviewit.activities;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import java.util.ArrayList;
import java.util.List;
import easyway.com.reviewit.R;
import easyway.com.reviewit.adapters.MovieBriefsSmallAdapter;
import easyway.com.reviewit.network.ApiClient;
import easyway.com.reviewit.network.ApiInterface;
import easyway.com.reviewit.network.movies.MovieBrief;
import easyway.com.reviewit.network.movies.NowShowingMoviesResponse;
import easyway.com.reviewit.network.movies.PopularMoviesResponse;
import easyway.com.reviewit.network.movies.TopRatedMoviesResponse;
import easyway.com.reviewit.network.movies.UpcomingMoviesResponse;
import easyway.com.reviewit.utils.Constants;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class ViewAllMoviesActivity extends AppCompatActivity {
private RecyclerView mRecyclerView;
private List<MovieBrief> mMovies;
private MovieBriefsSmallAdapter mMoviesAdapter;
private int mMovieType;
private boolean pagesOver = false;
private int presentPage = 1;
private boolean loading = true;
private int previousTotal = 0;
private int visibleThreshold = 5;
private Call<NowShowingMoviesResponse> mNowShowingMoviesCall;
private Call<PopularMoviesResponse> mPopularMoviesCall;
private Call<UpcomingMoviesResponse> mUpcomingMoviesCall;
private Call<TopRatedMoviesResponse> mTopRatedMoviesCall;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_all_movies);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Intent receivedIntent = getIntent();
mMovieType = receivedIntent.getIntExtra(Constants.VIEW_ALL_MOVIES_TYPE, -1);
if (mMovieType == -1) finish();
switch (mMovieType) {
case Constants.NOW_SHOWING_MOVIES_TYPE:
setTitle(R.string.now_showing_movies);
break;
case Constants.POPULAR_MOVIES_TYPE:
setTitle(R.string.popular_movies);
break;
case Constants.UPCOMING_MOVIES_TYPE:
setTitle(R.string.upcoming_movies);
break;
case Constants.TOP_RATED_MOVIES_TYPE:
setTitle(R.string.top_rated_movies);
break;
}
// mSmoothProgressBar = (SmoothProgressBar) findViewById(R.id.smooth_progress_bar);
mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view_view_all);
mMovies = new ArrayList<>();
mMoviesAdapter = new MovieBriefsSmallAdapter(ViewAllMoviesActivity.this, mMovies);
mRecyclerView.setAdapter(mMoviesAdapter);
final GridLayoutManager gridLayoutManager = new GridLayoutManager(ViewAllMoviesActivity.this, 3);
mRecyclerView.setLayoutManager(gridLayoutManager);
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
int visibleItemCount = gridLayoutManager.getChildCount();
int totalItemCount = gridLayoutManager.getItemCount();
int firstVisibleItem = gridLayoutManager.findFirstVisibleItemPosition();
if (loading) {
if (totalItemCount > previousTotal) {
loading = false;
previousTotal = totalItemCount;
}
}
if (!loading && (totalItemCount - visibleItemCount) <= (firstVisibleItem + visibleThreshold)) {
loadMovies(mMovieType);
loading = true;
}
}
});
loadMovies(mMovieType);
}
@Override
protected void onStart() {
super.onStart();
mMoviesAdapter.notifyDataSetChanged();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mNowShowingMoviesCall != null) mNowShowingMoviesCall.cancel();
if (mPopularMoviesCall != null) mPopularMoviesCall.cancel();
if (mUpcomingMoviesCall != null) mUpcomingMoviesCall.cancel();
if (mTopRatedMoviesCall != null) mTopRatedMoviesCall.cancel();
}
private void loadMovies(int movieType) {
if (pagesOver) return;
ApiInterface apiService = ApiClient.getClient().create(ApiInterface.class);
// mSmoothProgressBar.progressiveStart();
switch (movieType) {
case Constants.NOW_SHOWING_MOVIES_TYPE:
mNowShowingMoviesCall = apiService.getNowShowingMovies(getResources().getString(R.string.MOVIE_DB_API_KEY), presentPage, "US");
mNowShowingMoviesCall.enqueue(new Callback<NowShowingMoviesResponse>() {
@Override
public void onResponse(Call<NowShowingMoviesResponse> call, Response<NowShowingMoviesResponse> response) {
if (!response.isSuccessful()) {
mNowShowingMoviesCall = call.clone();
mNowShowingMoviesCall.enqueue(this);
return;
}
if (response.body() == null) return;
if (response.body().getResults() == null) return;
// mSmoothProgressBar.progressiveStop();
for (MovieBrief movieBrief : response.body().getResults()) {
if (movieBrief != null && movieBrief.getTitle() != null && movieBrief.getPosterPath() != null)
mMovies.add(movieBrief);
}
mMoviesAdapter.notifyDataSetChanged();
if (response.body().getPage() == response.body().getTotalPages())
pagesOver = true;
else
presentPage++;
}
@Override
public void onFailure(Call<NowShowingMoviesResponse> call, Throwable t) {
}
});
break;
case Constants.POPULAR_MOVIES_TYPE:
mPopularMoviesCall = apiService.getPopularMovies(getResources().getString(R.string.MOVIE_DB_API_KEY), presentPage, "US");
mPopularMoviesCall.enqueue(new Callback<PopularMoviesResponse>() {
@Override
public void onResponse(Call<PopularMoviesResponse> call, Response<PopularMoviesResponse> response) {
if (!response.isSuccessful()) {
mPopularMoviesCall = call.clone();
mPopularMoviesCall.enqueue(this);
return;
}
if (response.body() == null) return;
if (response.body().getResults() == null) return;
// mSmoothProgressBar.progressiveStop();
for (MovieBrief movieBrief : response.body().getResults()) {
if (movieBrief != null && movieBrief.getTitle() != null && movieBrief.getPosterPath() != null)
mMovies.add(movieBrief);
}
mMoviesAdapter.notifyDataSetChanged();
if (response.body().getPage() == response.body().getTotalPages())
pagesOver = true;
else
presentPage++;
}
@Override
public void onFailure(Call<PopularMoviesResponse> call, Throwable t) {
}
});
break;
case Constants.UPCOMING_MOVIES_TYPE:
mUpcomingMoviesCall = apiService.getUpcomingMovies(getResources().getString(R.string.MOVIE_DB_API_KEY), presentPage, "US");
mUpcomingMoviesCall.enqueue(new Callback<UpcomingMoviesResponse>() {
@Override
public void onResponse(Call<UpcomingMoviesResponse> call, Response<UpcomingMoviesResponse> response) {
if (!response.isSuccessful()) {
mUpcomingMoviesCall = call.clone();
mUpcomingMoviesCall.enqueue(this);
return;
}
if (response.body() == null) return;
if (response.body().getResults() == null) return;
// mSmoothProgressBar.progressiveStop();
for (MovieBrief movieBrief : response.body().getResults()) {
if (movieBrief != null && movieBrief.getTitle() != null && movieBrief.getPosterPath() != null)
mMovies.add(movieBrief);
}
mMoviesAdapter.notifyDataSetChanged();
if (response.body().getPage() == response.body().getTotalPages())
pagesOver = true;
else
presentPage++;
}
@Override
public void onFailure(Call<UpcomingMoviesResponse> call, Throwable t) {
}
});
break;
case Constants.TOP_RATED_MOVIES_TYPE:
mTopRatedMoviesCall = apiService.getTopRatedMovies(getResources().getString(R.string.MOVIE_DB_API_KEY), presentPage, "US");
mTopRatedMoviesCall.enqueue(new Callback<TopRatedMoviesResponse>() {
@Override
public void onResponse(Call<TopRatedMoviesResponse> call, Response<TopRatedMoviesResponse> response) {
if (!response.isSuccessful()) {
mTopRatedMoviesCall = call.clone();
mTopRatedMoviesCall.enqueue(this);
return;
}
if (response.body() == null) return;
if (response.body().getResults() == null) return;
// mSmoothProgressBar.progressiveStop();
for (MovieBrief movieBrief : response.body().getResults()) {
if (movieBrief != null && movieBrief.getTitle() != null && movieBrief.getPosterPath() != null)
mMovies.add(movieBrief);
}
mMoviesAdapter.notifyDataSetChanged();
if (response.body().getPage() == response.body().getTotalPages())
pagesOver = true;
else
presentPage++;
}
@Override
public void onFailure(Call<TopRatedMoviesResponse> call, Throwable t) {
}
});
break;
}
}
}
|
[
"[email protected]"
] | |
ba08b3e3a1d86df88b2f4562658f9209921580c1
|
a750ec83a37f62f3711c899501eb85b4a09502d4
|
/ksqldb-rest-app/src/main/java/io/confluent/ksql/rest/server/resources/LagReportingResource.java
|
a8962acb9742868068f2b53510bf6ba0f04e5bf1
|
[
"LicenseRef-scancode-proprietary-license",
"Apache-2.0"
] |
permissive
|
uurl/ksql
|
d0e4969108966bbe8f7e79275887f7c31ff92713
|
8bb47c91808ab11a12bfa3249039b4948423d96b
|
refs/heads/master
| 2022-05-09T15:47:09.479017 | 2022-03-25T16:41:57 | 2022-03-25T16:41:57 | 132,240,504 | 0 | 0 |
Apache-2.0
| 2018-05-05T11:08:55 | 2018-05-05T11:08:55 | null |
UTF-8
|
Java
| false | false | 1,380 |
java
|
/*
* Copyright 2020 Confluent Inc.
*
* Licensed under the Confluent Community License (the "License"; you may not use
* this file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.confluent.io/confluent-community-license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package io.confluent.ksql.rest.server.resources;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.confluent.ksql.rest.EndpointResponse;
import io.confluent.ksql.rest.entity.LagReportingMessage;
import io.confluent.ksql.rest.entity.LagReportingResponse;
import io.confluent.ksql.rest.server.LagReportingAgent;
public class LagReportingResource {
private final LagReportingAgent lagReportingAgent;
@SuppressFBWarnings(value = "EI_EXPOSE_REP2")
public LagReportingResource(final LagReportingAgent lagReportingAgent) {
this.lagReportingAgent = lagReportingAgent;
}
public EndpointResponse receiveHostLag(final LagReportingMessage request) {
lagReportingAgent.receiveHostLag(request);
return EndpointResponse.ok(new LagReportingResponse(true));
}
}
|
[
"[email protected]"
] | |
cad93431fc7cf850cba02a6ea231bfb471fae28d
|
8534ea766585cfbd6986fd845e59a68877ecb15b
|
/com/slideme/sam/manager/controller/p053a/ad.java
|
432cf7cb4526b702f0bd09579d043a08ec07eb05
|
[] |
no_license
|
Shanzid01/NanoTouch
|
d7af94f2de686f76c2934b9777a92b9949b48e10
|
6d51a44ff8f719f36b880dd8d1112b31ba75bfb4
|
refs/heads/master
| 2020-04-26T17:39:53.196133 | 2019-03-04T10:23:51 | 2019-03-04T10:23:51 | 173,720,526 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,662 |
java
|
package com.slideme.sam.manager.controller.p053a;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import com.slideme.sam.manager.R;
import com.slideme.sam.manager.net.wrappers.Catalog.Sort;
/* compiled from: SortDialog */
public class ad extends DialogFragment {
private String[] f2677a;
private Sort f2678b;
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.f2677a = getResources().getStringArray(R.array.sort_names);
}
public Dialog onCreateDialog(Bundle bundle) {
return new Builder(getActivity()).setTitle(R.string.sort_by).setNegativeButton(17039360, null).setPositiveButton(17039370, new ae(this)).setSingleChoiceItems(this.f2677a, m4853a(), new af(this)).create();
}
private int m4853a() {
Sort sort = (Sort) getArguments().getParcelable("com.slideme.sam.manager.extra.SORT");
if (sort == null) {
return -1;
}
if (sort.f3413c.equals(Sort.f3411d[3])) {
return 0;
}
if (sort.f3413c.equals(Sort.f3411d[1])) {
return 1;
}
if (sort.f3413c.equals(Sort.f3411d[6])) {
return 2;
}
if (sort.f3413c.equals(Sort.f3411d[5])) {
if (sort.f3412a.equals(Sort.f3410b[1])) {
return 3;
}
return 4;
} else if (!sort.f3413c.equals(Sort.f3411d[0])) {
return -1;
} else {
if (sort.f3412a.equals(Sort.f3410b[0])) {
return 5;
}
return 6;
}
}
}
|
[
"[email protected]"
] | |
e2d9cefcf3198dde70a2455694b6ae676c4f13c3
|
c3ee7c5832717095b4de4d491c1744727e890076
|
/avalon/complex/src/main/java/com/avalon/ms/dao/entity/KyBranchbankinfos.java
|
8fb4fd81bbb81fc825ee9f835931b1a671906184
|
[] |
no_license
|
saberey/avalon
|
81a13b46d04a21cc7fd1db2bb4763b07c2c910ea
|
f06eec4d37658101d275abd4a641659dafe475ae
|
refs/heads/master
| 2022-12-24T06:52:16.435655 | 2020-11-24T03:41:43 | 2020-11-24T03:41:43 | 39,809,563 | 0 | 2 | null | 2022-12-16T15:51:40 | 2015-07-28T02:47:44 |
HTML
|
UTF-8
|
Java
| false | false | 11,765 |
java
|
package com.avalon.ms.dao.entity;
import java.util.Date;
public class KyBranchbankinfos {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.ID
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.NAME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private String name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.CODE
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private String code;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.PROVINCE
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private String province;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.CITY
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private String city;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.TELNO
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private String telno;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.ADDR
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private String addr;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.BANKTYPE
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private String banktype;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.BANKNAME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private String bankname;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.LOGICALDEL
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private Short logicaldel;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.INSERTEDTIME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private Date insertedtime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column KY_BRANCHBANKINFOS.LASTMODIFIEDTIME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
private Date lastmodifiedtime;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.ID
*
* @return the value of KY_BRANCHBANKINFOS.ID
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.ID
*
* @param id the value for KY_BRANCHBANKINFOS.ID
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.NAME
*
* @return the value of KY_BRANCHBANKINFOS.NAME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.NAME
*
* @param name the value for KY_BRANCHBANKINFOS.NAME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.CODE
*
* @return the value of KY_BRANCHBANKINFOS.CODE
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public String getCode() {
return code;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.CODE
*
* @param code the value for KY_BRANCHBANKINFOS.CODE
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.PROVINCE
*
* @return the value of KY_BRANCHBANKINFOS.PROVINCE
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public String getProvince() {
return province;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.PROVINCE
*
* @param province the value for KY_BRANCHBANKINFOS.PROVINCE
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setProvince(String province) {
this.province = province == null ? null : province.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.CITY
*
* @return the value of KY_BRANCHBANKINFOS.CITY
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public String getCity() {
return city;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.CITY
*
* @param city the value for KY_BRANCHBANKINFOS.CITY
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setCity(String city) {
this.city = city == null ? null : city.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.TELNO
*
* @return the value of KY_BRANCHBANKINFOS.TELNO
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public String getTelno() {
return telno;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.TELNO
*
* @param telno the value for KY_BRANCHBANKINFOS.TELNO
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setTelno(String telno) {
this.telno = telno == null ? null : telno.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.ADDR
*
* @return the value of KY_BRANCHBANKINFOS.ADDR
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public String getAddr() {
return addr;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.ADDR
*
* @param addr the value for KY_BRANCHBANKINFOS.ADDR
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setAddr(String addr) {
this.addr = addr == null ? null : addr.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.BANKTYPE
*
* @return the value of KY_BRANCHBANKINFOS.BANKTYPE
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public String getBanktype() {
return banktype;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.BANKTYPE
*
* @param banktype the value for KY_BRANCHBANKINFOS.BANKTYPE
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setBanktype(String banktype) {
this.banktype = banktype == null ? null : banktype.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.BANKNAME
*
* @return the value of KY_BRANCHBANKINFOS.BANKNAME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public String getBankname() {
return bankname;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.BANKNAME
*
* @param bankname the value for KY_BRANCHBANKINFOS.BANKNAME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setBankname(String bankname) {
this.bankname = bankname == null ? null : bankname.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.LOGICALDEL
*
* @return the value of KY_BRANCHBANKINFOS.LOGICALDEL
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public Short getLogicaldel() {
return logicaldel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.LOGICALDEL
*
* @param logicaldel the value for KY_BRANCHBANKINFOS.LOGICALDEL
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setLogicaldel(Short logicaldel) {
this.logicaldel = logicaldel;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.INSERTEDTIME
*
* @return the value of KY_BRANCHBANKINFOS.INSERTEDTIME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public Date getInsertedtime() {
return insertedtime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.INSERTEDTIME
*
* @param insertedtime the value for KY_BRANCHBANKINFOS.INSERTEDTIME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setInsertedtime(Date insertedtime) {
this.insertedtime = insertedtime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column KY_BRANCHBANKINFOS.LASTMODIFIEDTIME
*
* @return the value of KY_BRANCHBANKINFOS.LASTMODIFIEDTIME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public Date getLastmodifiedtime() {
return lastmodifiedtime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column KY_BRANCHBANKINFOS.LASTMODIFIEDTIME
*
* @param lastmodifiedtime the value for KY_BRANCHBANKINFOS.LASTMODIFIEDTIME
*
* @mbg.generated Mon Mar 19 10:32:47 CST 2018
*/
public void setLastmodifiedtime(Date lastmodifiedtime) {
this.lastmodifiedtime = lastmodifiedtime;
}
}
|
[
"[email protected]"
] | |
d69d9935379fa99e1401a1a7e31d542ed133d954
|
92478f1ea05d5450d10c452a3eab0322a3342351
|
/zhaodanmu-spring-app/src/main/java/com/zhaodanmu/app/config/ProxyAgentConfig.java
|
350edb85cb61b3f62ed9e3f7f00265cd4def0ebd
|
[] |
no_license
|
aofalyb/zhaodanmu
|
77c8431a74ce45cf3fa3d3025541d93253de027f
|
a20c42c8f3e0da301a1a80221cb1998bccfda7b5
|
refs/heads/master
| 2020-07-06T08:46:41.650474 | 2019-08-19T18:41:10 | 2019-08-19T18:41:10 | 202,960,260 | 0 | 0 | null | 2019-08-18T04:38:19 | 2019-08-18T04:38:19 | null |
UTF-8
|
Java
| false | false | 3,314 |
java
|
package com.zhaodanmu.app.config;
import com.alibaba.fastjson.JSON;
import com.zhaodanmu.app.CC;
import com.zhaodanmu.app.api.IDouyuSearchService;
import com.zhaodanmu.app.aspect.RemoteInvoke;
import com.zhaodanmu.common.utils.Log;
import okhttp3.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.concurrent.TimeUnit;
@Configuration
public class ProxyAgentConfig {
private static final MediaType MEDIA_JSON
= MediaType.parse("application/json; charset=utf-8");
private static OkHttpClient httpClient = new OkHttpClient()
.newBuilder()
.connectionPool(new ConnectionPool(3,1,TimeUnit.MINUTES))
.retryOnConnectionFailure(false)
.build();
@Bean
public IDouyuSearchService getDouyuSearchService() {
return (IDouyuSearchService)newInstance(IDouyuSearchService.class);
}
private Object newInstance(Class serviceClass) {
return Proxy.newProxyInstance(serviceClass.getClassLoader(), new Class[]{serviceClass}, new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
RemoteInvoke remoteInvoke = method.getAnnotation(RemoteInvoke.class);
String methodName = method.getName();
String requestMapping = remoteInvoke.requestMapping();
String returnClass = method.getReturnType().getName();
Log.httpLogger.debug("invoke method: {},requestMapping: {},arg: {}",methodName,requestMapping,args);
if(remoteInvoke == null) {
Log.httpLogger.error("annotation @RemoteInvoke not found, method: {}",method.toGenericString());
}
String respJson = null;
final String uri = "http://" + CC.danmuServerHost + "/" + requestMapping;
try {
respJson = postJSON(uri, args[0]);
} catch (Exception e) {
Log.httpLogger.error("post uri: {},args: {}",uri,args,e);
throw new RuntimeException(e);
}
Object object;
if(returnClass.equals("java.util.Map")) {
object = JSON.parseObject(respJson,method.getGenericReturnType());
} else if(returnClass.equals("java.util.List")) {
//解析泛型
object = JSON.parseObject(respJson,method.getGenericReturnType());
} else {
object = JSON.parseObject(respJson, Class.forName(returnClass));
}
return object;
}
});
}
private String postJSON(String url, Object json) throws Exception {
RequestBody body = RequestBody.create(MEDIA_JSON, JSON.toJSONString(json));
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
Response response = httpClient.newCall(request).execute();
return response.body().string();
}
}
|
[
"[email protected]"
] | |
f03dc21a8ab8e33c8bcce1e9ff8b19f867747954
|
a82885f72ae37b4b3caf9a9aab7eff3e5ef2376a
|
/src/java/service/DailyService.java
|
87ab1f78f3d8f5e2e83ff5062d041565e152dab2
|
[] |
no_license
|
pisichi/Covid-tracking-jsp
|
7d3ad2008eb685c6ee4e307eb70f0803ae9c7148
|
e07d15591147ad3a2af81a0e7a92b96277a61442
|
refs/heads/master
| 2023-08-20T17:04:52.921804 | 2021-10-10T05:50:16 | 2021-10-10T05:50:16 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,774 |
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 service;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import model.DailyData;
import org.json.JSONObject;
public class DailyService {
public static DailyData getData() throws Exception {
String url = "https://covid19.th-stat.com/api/open/today";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", "Mozilla/5.0");
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
JSONObject myResponse = new JSONObject(response.toString());
DailyData data = new DailyData();
data.setConfirmed(myResponse.getInt("Confirmed"));
data.setRecovered(myResponse.getInt("Recovered"));
data.setDeath(myResponse.getInt("Deaths"));
data.setHospitalized(myResponse.getInt("Hospitalized"));
data.setNewConfirmed(myResponse.getInt("NewConfirmed"));
data.setNewDeaths(myResponse.getInt("NewDeaths"));
data.setNewRecovered(myResponse.getInt("NewRecovered"));
data.setNewHospitalized(myResponse.getInt("NewHospitalized"));
data.setUpdateDate(myResponse.getString("UpdateDate"));
return data;
}
}
|
[
"[email protected]"
] | |
a3e75dbf5cd3a0ba3237931f1b0f553b34c95d9c
|
a80b1a567ecb36903749651938a77390f12343fa
|
/week7/day1/LearnExplicitlyWaitToAppear.java
|
e3b50652d91597d2b81c630130e7f71d4d039aa8
|
[] |
no_license
|
TestLeafPages/SelApril2021
|
56d4025479a1db46975cd0efbc4de1a02e9179cc
|
cb095c9ecc74adfedb8d4c0ecbb8f87aaa744003
|
refs/heads/main
| 2023-04-26T06:09:06.933007 | 2021-06-01T06:24:48 | 2021-06-01T06:24:48 | 356,602,369 | 2 | 3 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,038 |
java
|
package week7.day1;
import java.time.Duration;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import io.github.bonigarcia.wdm.WebDriverManager;
public class LearnExplicitlyWaitToAppear {
public static void main(String[] args) throws InterruptedException {
WebDriverManager.chromedriver().setup();
ChromeDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("http://leafground.com/pages/appear.html");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
WebElement ele = driver.findElementByXPath("//b[contains(text(),'Voila')]");
WebDriverWait wait = new WebDriverWait(driver,Duration.ofSeconds(1));
wait.until(ExpectedConditions.visibilityOf(ele));
String text = ele.getText();
System.out.println(text);
}
}
|
[
"[email protected]"
] | |
1e2830a5de2f2fd1d2d90365f6719a5bd599cf7c
|
56db1dac37da6e5eec716a7dc17559014ab44ad6
|
/app/src/main/java/com/hl46000/hlfaker/security/algorithm/base64.java
|
4b93b1f13aacb6e60e4aa86c333656f0b2f09250
|
[] |
no_license
|
csbde/HLFaker_Server
|
8b43e5e7bdaa01909b6a3631138d4baf667b3e0c
|
701dfa9ec1cf44f030d8230ecf545e3c40cb575c
|
refs/heads/master
| 2023-03-17T16:30:26.792564 | 2018-10-06T19:05:59 | 2018-10-06T19:05:59 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 689 |
java
|
package com.hl46000.hlfaker.security.algorithm;
import android.util.Base64;
public class base64 {
/**
* BASE64解密
*
* @param key the String to be decrypted
* @return byte[] the data which is decrypted
* @throws Exception
*/
public static byte[] decryptBASE64(String key) throws Exception {
return Base64.decode(key,Base64.DEFAULT);
}
/**
* BASE64加密
*
* @param key the String to be encrypted
* @return String the data which is encrypted
* @throws Exception
*/
public static String encryptBASE64(byte[] key) throws Exception {
return Base64.encodeToString(key, Base64.DEFAULT);
}
}
|
[
"[email protected]"
] | |
62b2017a37a271585c6aad206b13202ef04428b9
|
5d3218d7f8dc16365f7b161d0d59a236db3ddcf4
|
/Conferences - Design Patterns/src/DinnerDecorator.java
|
5a93565b953fd63aba3907ad8f2454ade8176ba1
|
[
"MIT"
] |
permissive
|
sentinal-x/software_development_workshops
|
2069495222c55b80a5cbe3fe84df053459ae3f11
|
70c2798b94894d2cc795c4ee8b1f6d4b1273a64c
|
refs/heads/main
| 2023-09-04T20:00:31.495697 | 2021-11-23T15:28:06 | 2021-11-23T15:28:06 | 416,360,509 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 554 |
java
|
package patterns;
public class DinnerDecorator extends ConferenceDecorator{
public DinnerDecorator (Conference conference) {
super(conference);
}
@Override
public String getDescription() {
return super.getDescription() + " + Conference Dinner";
}
@Override
public double getCost() {
return super.getCost() + 40;
}
@Override
public Publication createPaper(String title, boolean accept) {
return super.createPaper(title, accept);
}
}
|
[
"[email protected]"
] | |
51e0d424af1d82d52d88bc54c88e288838cfa9e8
|
a98923222aecc3b846ec688c1593502227e52edc
|
/src/baekjoon/LEV_10_재귀/팩토리얼.java
|
ad7ab085d201cc429f5bb3ce252b69bce898fbff
|
[] |
no_license
|
SanghooMoon/Programmers_Algorithm
|
91600b26f1c62cbfb0df90d62affbd12a94a8ef9
|
8f463298d6d77fcc4fab9f29623f36d74e1dced9
|
refs/heads/master
| 2023-06-09T16:51:13.487864 | 2021-06-17T13:24:04 | 2021-06-17T13:24:04 | 291,062,554 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 587 |
java
|
package baekjoon.LEV_10_재귀;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
// 0보다 크거나 같은 정수 N이 주어진다. 이때, N!을 출력하는 프로그램을 작성하시오.
public class 팩토리얼 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
System.out.println(fact(N));
}
public static int fact(int n) {
if(n <= 1) {
return 1;
}
return n * fact(n-1);
}
}
|
[
"[email protected]"
] | |
1b62610a78041111386caeac626f0e22c6d8651d
|
6d0258d43d42b88f790f72a4648b8e5ae0b6e237
|
/src/main/java/com/zhang/seckill/dao/GoodsDao.java
|
dd5db4574745bbf9125e134be77b15f751135a06
|
[] |
no_license
|
learner66/seckill
|
66bd808634577cb9461a32916adbb57b7c63a5d3
|
81b43f798d4ef900454761af86b7abe5fa18aaa4
|
refs/heads/master
| 2022-06-25T10:33:39.050100 | 2019-08-02T01:59:58 | 2019-08-02T01:59:58 | 198,609,739 | 0 | 0 | null | 2022-06-21T01:32:15 | 2019-07-24T10:07:44 |
Java
|
UTF-8
|
Java
| false | false | 925 |
java
|
package com.zhang.seckill.dao;
import com.zhang.seckill.domain.SeckillGoods;
import com.zhang.seckill.vo.GoodsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
@Mapper
public interface GoodsDao {
@Select("select goods.*,g.seckill_price,g.stock_count,g.start_date,g.end_date from seckill_goods as g left join goods on g.goods_id = goods.id")
public List<GoodsVo> getGoodsVo();
@Select("select goods.*,g.seckill_price,g.stock_count,g.start_date,g.end_date from seckill_goods as g left join goods on g.goods_id = goods.id where goods.id=#{goodsId}")
GoodsVo getGoodsByGoodsID(@Param("goodsId") long goodsId);
@Update("update seckill_goods set stock_count = stock_count -1 where goods_id = #{goodsId}")
int reduceStock(SeckillGoods goods);
}
|
[
"[email protected]"
] | |
5e6d8a896f0ae33f43477cf8c03cbd2ba046af3c
|
0bf85719ebe57e4ee7dce22ee3fae920ba09f010
|
/indexing-service/src/test/java/org/apache/druid/indexing/common/task/CompactionInputSpecTest.java
|
543428fe6acf1e51e487c75e4db68e4991e2be0c
|
[
"CDDL-1.1",
"LicenseRef-scancode-unicode",
"GPL-2.0-only",
"GCC-exception-3.1",
"EPL-1.0",
"Classpath-exception-2.0",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"CC-BY-SA-3.0",
"MPL-2.0",
"LGPL-2.1-only",
"CC-BY-2.5",
"BSD-3-Clause",
"LicenseRef-scancode-other-permissive",
"CC-PDDC",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-sun-no-high-risk-activities",
"ICU",
"LicenseRef-scancode-free-unknown",
"CDDL-1.0",
"MIT",
"LicenseRef-scancode-westhawk"
] |
permissive
|
implydata/druid-public
|
060f09a444073ffdfa4d106f26203dfbcec681e3
|
1131a17bcbf593c59713646bd103a488b20ee8b6
|
refs/heads/master
| 2023-06-04T20:37:30.097940 | 2020-09-03T08:52:28 | 2020-09-03T08:52:28 | 42,679,047 | 2 | 0 |
Apache-2.0
| 2020-10-16T05:35:35 | 2015-09-17T20:03:27 |
Java
|
UTF-8
|
Java
| false | false | 3,603 |
java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.druid.indexing.common.task;
import com.google.common.collect.ImmutableList;
import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.JodaUtils;
import org.apache.druid.segment.SegmentUtils;
import org.apache.druid.timeline.DataSegment;
import org.joda.time.Interval;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@RunWith(Parameterized.class)
public class CompactionInputSpecTest
{
private static final String DATASOURCE = "datasource";
private static final List<DataSegment> SEGMENTS = prepareSegments();
private static Interval INTERVAL = JodaUtils.umbrellaInterval(
SEGMENTS.stream().map(DataSegment::getInterval).collect(Collectors.toList())
);
@Parameters
public static Iterable<Object[]> constructorFeeder()
{
return ImmutableList.of(
new Object[]{
new CompactionIntervalSpec(
INTERVAL,
SegmentUtils.hashIds(SEGMENTS)
)
},
new Object[]{
new SpecificSegmentsSpec(
SEGMENTS.stream().map(segment -> segment.getId().toString()).collect(Collectors.toList())
)
}
);
}
private static List<DataSegment> prepareSegments()
{
return IntStream.range(0, 20)
.mapToObj(i -> newSegment(Intervals.of("2019-01-%02d/2019-01-%02d", i + 1, i + 2)))
.collect(Collectors.toList());
}
private static DataSegment newSegment(Interval interval)
{
return new DataSegment(
DATASOURCE,
interval,
"version",
null,
null,
null,
null,
9,
10
);
}
private final CompactionInputSpec inputSpec;
public CompactionInputSpecTest(CompactionInputSpec inputSpec)
{
this.inputSpec = inputSpec;
}
@Test
public void testFindInterval()
{
Assert.assertEquals(INTERVAL, inputSpec.findInterval(DATASOURCE));
}
@Test
public void testValidateSegments()
{
Assert.assertTrue(inputSpec.validateSegments(SEGMENTS));
}
@Test
public void testValidateWrongSegments()
{
final List<DataSegment> someSegmentIsMissing = new ArrayList<>(SEGMENTS);
someSegmentIsMissing.remove(0);
Assert.assertFalse(inputSpec.validateSegments(someSegmentIsMissing));
final List<DataSegment> someSegmentIsUnknown = new ArrayList<>(SEGMENTS);
someSegmentIsUnknown.add(newSegment(Intervals.of("2018-01-01/2018-01-02")));
Assert.assertFalse(inputSpec.validateSegments(someSegmentIsUnknown));
}
}
|
[
"[email protected]"
] | |
f992f380adad3195b2b794f1668007fdf55a4249
|
67df08fb0f447c8a802d1e8fbb935fad518d23fc
|
/src/net/jdigi/modems/bpsk/PSKVaricode.java
|
e065870fd7113cb0452631ce7084742ca598c805
|
[] |
no_license
|
zzzhc/jdigi
|
77d23b5d8d956fc48fcb1d5158347156b3366067
|
a6e49c80e27540d2c95057b44fa8cd307a4394b6
|
refs/heads/master
| 2021-01-09T05:35:16.528362 | 2011-12-07T21:24:39 | 2011-12-07T21:24:39 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 10,610 |
java
|
/*
* varicode.c -- PSK31 Varicode
*
* Copyright (C) 2001, 2002, 2003
* Tomi Manninen ([email protected])
*
* This file is part of gMFSK.
*
* gMFSK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* gMFSK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with gMFSK; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package net.jdigi.modems.bpsk;
public class PSKVaricode {
/*
* The PSK31 Varicode.
*/
private static String varicodetab1[] = { "1010101011", /* 0 - <NUL> */
"1011011011", /* 1 - <SOH> */
"1011101101", /* 2 - <STX> */
"1101110111", /* 3 - <ETX> */
"1011101011", /* 4 - <EOT> */
"1101011111", /* 5 - <ENQ> */
"1011101111", /* 6 - <ACK> */
"1011111101", /* 7 - <BEL> */
"1011111111", /* 8 - <BS> */
"11101111", /* 9 - <TAB> */
"11101", /* 10 - <LF> */
"1101101111", /* 11 - <VT> */
"1011011101", /* 12 - <FF> */
"11111", /* 13 - <CR> */
"1101110101", /* 14 - <SO> */
"1110101011", /* 15 - <SI> */
"1011110111", /* 16 - <DLE> */
"1011110101", /* 17 - <DC1> */
"1110101101", /* 18 - <DC2> */
"1110101111", /* 19 - <DC3> */
"1101011011", /* 20 - <DC4> */
"1101101011", /* 21 - <NAK> */
"1101101101", /* 22 - <SYN> */
"1101010111", /* 23 - <ETB> */
"1101111011", /* 24 - <CAN> */
"1101111101", /* 25 - <EM> */
"1110110111", /* 26 - <SUB> */
"1101010101", /* 27 - <ESC> */
"1101011101", /* 28 - <FS> */
"1110111011", /* 29 - <GS> */
"1011111011", /* 30 - <RS> */
"1101111111", /* 31 - <US> */
"1", /* 32 - <SPC> */
"111111111", /* 33 - ! */
"101011111", /* 34 - '"' */
"111110101", /* 35 - # */
"111011011", /* 36 - $ */
"1011010101", /* 37 - % */
"1010111011", /* 38 - & */
"101111111", /* 39 - ' */
"11111011", /* 40 - ( */
"11110111", /* 41 - ) */
"101101111", /* 42 - * */
"111011111", /* 43 - + */
"1110101", /* 44 - , */
"110101", /* 45 - - */
"1010111", /* 46 - . */
"110101111", /* 47 - / */
"10110111", /* 48 - 0 */
"10111101", /* 49 - 1 */
"11101101", /* 50 - 2 */
"11111111", /* 51 - 3 */
"101110111", /* 52 - 4 */
"101011011", /* 53 - 5 */
"101101011", /* 54 - 6 */
"110101101", /* 55 - 7 */
"110101011", /* 56 - 8 */
"110110111", /* 57 - 9 */
"11110101", /* 58 - : */
"110111101", /* 59 - ; */
"111101101", /* 60 - < */
"1010101", /* 61 - = */
"111010111", /* 62 - > */
"1010101111", /* 63 - ? */
"1010111101", /* 64 - @ */
"1111101", /* 65 - A */
"11101011", /* 66 - B */
"10101101", /* 67 - C */
"10110101", /* 68 - D */
"1110111", /* 69 - E */
"11011011", /* 70 - F */
"11111101", /* 71 - G */
"101010101", /* 72 - H */
"1111111", /* 73 - I */
"111111101", /* 74 - J */
"101111101", /* 75 - K */
"11010111", /* 76 - L */
"10111011", /* 77 - M */
"11011101", /* 78 - N */
"10101011", /* 79 - O */
"11010101", /* 80 - P */
"111011101", /* 81 - Q */
"10101111", /* 82 - R */
"1101111", /* 83 - S */
"1101101", /* 84 - T */
"101010111", /* 85 - U */
"110110101", /* 86 - V */
"101011101", /* 87 - W */
"101110101", /* 88 - X */
"101111011", /* 89 - Y */
"1010101101", /* 90 - Z */
"111110111", /* 91 - [ */
"111101111", /* 92 - \ */
"111111011", /* 93 - ] */
"1010111111", /* 94 - ^ */
"101101101", /* 95 - _ */
"1011011111", /* 96 - ` */
"1011", /* 97 - a */
"1011111", /* 98 - b */
"101111", /* 99 - c */
"101101", /* 100 - d */
"11", /* 101 - e */
"111101", /* 102 - f */
"1011011", /* 103 - g */
"101011", /* 104 - h */
"1101", /* 105 - i */
"111101011", /* 106 - j */
"10111111", /* 107 - k */
"11011", /* 108 - l */
"111011", /* 109 - m */
"1111", /* 110 - n */
"111", /* 111 - o */
"111111", /* 112 - p */
"110111111", /* 113 - q */
"10101", /* 114 - r */
"10111", /* 115 - s */
"101", /* 116 - t */
"110111", /* 117 - u */
"1111011", /* 118 - v */
"1101011", /* 119 - w */
"11011111", /* 120 - x */
"1011101", /* 121 - y */
"111010101", /* 122 - z */
"1010110111", /* 123 - { */
"110111011", /* 124 - | */
"1010110101", /* 125 - } */
"1011010111", /* 126 - ~ */
"1110110101", /* 127 - <DEL> */
"1110111101", /* 128 - */
"1110111111", /* 129 - */
"1111010101", /* 130 - */
"1111010111", /* 131 - */
"1111011011", /* 132 - */
"1111011101", /* 133 - */
"1111011111", /* 134 - */
"1111101011", /* 135 - */
"1111101101", /* 136 - */
"1111101111", /* 137 - */
"1111110101", /* 138 - */
"1111110111", /* 139 - */
"1111111011", /* 140 - */
"1111111101", /* 141 - */
"1111111111", /* 142 - */
"10101010101", /* 143 - */
"10101010111", /* 144 - */
"10101011011", /* 145 - */
"10101011101", /* 146 - */
"10101011111", /* 147 - */
"10101101011", /* 148 - */
"10101101101", /* 149 - */
"10101101111", /* 150 - */
"10101110101", /* 151 - */
"10101110111", /* 152 - */
"10101111011", /* 153 - */
"10101111101", /* 154 - */
"10101111111", /* 155 - */
"10110101011", /* 156 - */
"10110101101", /* 157 - */
"10110101111", /* 158 - */
"10110110101", /* 159 - */
"10110110111", /* 160 - ? */
"10110111011", /* 161 - ? */
"10110111101", /* 162 - ? */
"10110111111", /* 163 - ? */
"10111010101", /* 164 - ? */
"10111010111", /* 165 - ? */
"10111011011", /* 166 - ? */
"10111011101", /* 167 - ? */
"10111011111", /* 168 - ? */
"10111101011", /* 169 - ? */
"10111101101", /* 170 - ? */
"10111101111", /* 171 - ? */
"10111110101", /* 172 - ? */
"10111110111", /* 173 - ? */
"10111111011", /* 174 - ? */
"10111111101", /* 175 - ? */
"10111111111", /* 176 - ? */
"11010101011", /* 177 - ? */
"11010101101", /* 178 - ? */
"11010101111", /* 179 - ? */
"11010110101", /* 180 - ? */
"11010110111", /* 181 - ? */
"11010111011", /* 182 - ? */
"11010111101", /* 183 - ? */
"11010111111", /* 184 - ? */
"11011010101", /* 185 - ? */
"11011010111", /* 186 - ? */
"11011011011", /* 187 - ? */
"11011011101", /* 188 - ? */
"11011011111", /* 189 - ? */
"11011101011", /* 190 - ? */
"11011101101", /* 191 - ? */
"11011101111", /* 192 - ? */
"11011110101", /* 193 - ? */
"11011110111", /* 194 - ? */
"11011111011", /* 195 - ? */
"11011111101", /* 196 - ? */
"11011111111", /* 197 - ? */
"11101010101", /* 198 - ? */
"11101010111", /* 199 - ? */
"11101011011", /* 200 - ? */
"11101011101", /* 201 - ? */
"11101011111", /* 202 - ? */
"11101101011", /* 203 - ? */
"11101101101", /* 204 - ? */
"11101101111", /* 205 - ? */
"11101110101", /* 206 - ? */
"11101110111", /* 207 - ? */
"11101111011", /* 208 - ? */
"11101111101", /* 209 - ? */
"11101111111", /* 210 - ? */
"11110101011", /* 211 - ? */
"11110101101", /* 212 - ? */
"11110101111", /* 213 - ? */
"11110110101", /* 214 - ? */
"11110110111", /* 215 - ? */
"11110111011", /* 216 - ? */
"11110111101", /* 217 - ? */
"11110111111", /* 218 - ? */
"11111010101", /* 219 - ? */
"11111010111", /* 220 - ? */
"11111011011", /* 221 - ? */
"11111011101", /* 222 - ? */
"11111011111", /* 223 - ? */
"11111101011", /* 224 - ? */
"11111101101", /* 225 - ? */
"11111101111", /* 226 - ? */
"11111110101", /* 227 - ? */
"11111110111", /* 228 - ? */
"11111111011", /* 229 - ? */
"11111111101", /* 230 - ? */
"11111111111", /* 231 - ? */
"101010101011", /* 232 - ? */
"101010101101", /* 233 - ? */
"101010101111", /* 234 - ? */
"101010110101", /* 235 - ? */
"101010110111", /* 236 - ? */
"101010111011", /* 237 - ? */
"101010111101", /* 238 - ? */
"101010111111", /* 239 - ? */
"101011010101", /* 240 - ? */
"101011010111", /* 241 - ? */
"101011011011", /* 242 - ? */
"101011011101", /* 243 - ? */
"101011011111", /* 244 - ? */
"101011101011", /* 245 - ? */
"101011101101", /* 246 - ? */
"101011101111", /* 247 - ? */
"101011110101", /* 248 - ? */
"101011110111", /* 249 - ? */
"101011111011", /* 250 - ? */
"101011111101", /* 251 - ? */
"101011111111", /* 252 - ? */
"101101010101", /* 253 - ? */
"101101010111", /* 254 - ? */
"101101011011" /* 255 - ? */
};
/*
* The same in a format more suitable for decoding.
*/
private static int varicodetab2[] = { 0x2AB, 0x2DB, 0x2ED, 0x377, 0x2EB,
0x35F, 0x2EF, 0x2FD, 0x2FF, 0x0EF, 0x01D, 0x36F, 0x2DD, 0x01F,
0x375, 0x3AB, 0x2F7, 0x2F5, 0x3AD, 0x3AF, 0x35B, 0x36B, 0x36D,
0x357, 0x37B, 0x37D, 0x3B7, 0x355, 0x35D, 0x3BB, 0x2FB, 0x37F,
0x001, 0x1FF, 0x15F, 0x1F5, 0x1DB, 0x2D5, 0x2BB, 0x17F, 0x0FB,
0x0F7, 0x16F, 0x1DF, 0x075, 0x035, 0x057, 0x1AF, 0x0B7, 0x0BD,
0x0ED, 0x0FF, 0x177, 0x15B, 0x16B, 0x1AD, 0x1AB, 0x1B7, 0x0F5,
0x1BD, 0x1ED, 0x055, 0x1D7, 0x2AF, 0x2BD, 0x07D, 0x0EB, 0x0AD,
0x0B5, 0x077, 0x0DB, 0x0FD, 0x155, 0x07F, 0x1FD, 0x17D, 0x0D7,
0x0BB, 0x0DD, 0x0AB, 0x0D5, 0x1DD, 0x0AF, 0x06F, 0x06D, 0x157,
0x1B5, 0x15D, 0x175, 0x17B, 0x2AD, 0x1F7, 0x1EF, 0x1FB, 0x2BF,
0x16D, 0x2DF, 0x00B, 0x05F, 0x02F, 0x02D, 0x003, 0x03D, 0x05B,
0x02B, 0x00D, 0x1EB, 0x0BF, 0x01B, 0x03B, 0x00F, 0x007, 0x03F,
0x1BF, 0x015, 0x017, 0x005, 0x037, 0x07B, 0x06B, 0x0DF, 0x05D,
0x1D5, 0x2B7, 0x1BB, 0x2B5, 0x2D7, 0x3B5, 0x3BD, 0x3BF, 0x3D5,
0x3D7, 0x3DB, 0x3DD, 0x3DF, 0x3EB, 0x3ED, 0x3EF, 0x3F5, 0x3F7,
0x3FB, 0x3FD, 0x3FF, 0x555, 0x557, 0x55B, 0x55D, 0x55F, 0x56B,
0x56D, 0x56F, 0x575, 0x577, 0x57B, 0x57D, 0x57F, 0x5AB, 0x5AD,
0x5AF, 0x5B5, 0x5B7, 0x5BB, 0x5BD, 0x5BF, 0x5D5, 0x5D7, 0x5DB,
0x5DD, 0x5DF, 0x5EB, 0x5ED, 0x5EF, 0x5F5, 0x5F7, 0x5FB, 0x5FD,
0x5FF, 0x6AB, 0x6AD, 0x6AF, 0x6B5, 0x6B7, 0x6BB, 0x6BD, 0x6BF,
0x6D5, 0x6D7, 0x6DB, 0x6DD, 0x6DF, 0x6EB, 0x6ED, 0x6EF, 0x6F5,
0x6F7, 0x6FB, 0x6FD, 0x6FF, 0x755, 0x757, 0x75B, 0x75D, 0x75F,
0x76B, 0x76D, 0x76F, 0x775, 0x777, 0x77B, 0x77D, 0x77F, 0x7AB,
0x7AD, 0x7AF, 0x7B5, 0x7B7, 0x7BB, 0x7BD, 0x7BF, 0x7D5, 0x7D7,
0x7DB, 0x7DD, 0x7DF, 0x7EB, 0x7ED, 0x7EF, 0x7F5, 0x7F7, 0x7FB,
0x7FD, 0x7FF, 0xAAB, 0xAAD, 0xAAF, 0xAB5, 0xAB7, 0xABB, 0xABD,
0xABF, 0xAD5, 0xAD7, 0xADB, 0xADD, 0xADF, 0xAEB, 0xAED, 0xAEF,
0xAF5, 0xAF7, 0xAFB, 0xAFD, 0xAFF, 0xB55, 0xB57, 0xB5B };
public static String psk_varicode_encode(char c) {
return varicodetab1[c];
}
// TODO: Use HashMap instead, initialized from varicodetab2
public static int psk_varicode_decode(int symbol) {
int i;
for (i = 0; i < 256; i++)
if (symbol == varicodetab2[i]) {
return i;
}
return -1;
}
}
|
[
"[email protected]"
] | |
f0649381fddc45770dcd3c5afa9465fa255d3c19
|
55fae602ced903116556773a54c5d51a1ea15f85
|
/src/main/java/com/naren4b/gb/util/Util.java
|
6de06393e2f84f0260d4b2dd0484ef75e193cd87
|
[] |
no_license
|
naren4b/guest-book-rest-app
|
63a84e8f0729362eccd9d87c41374ea1679d7fea
|
a6085ec1699dc03a4bb4043d7e8160a6760c39a9
|
refs/heads/master
| 2022-11-24T21:19:04.744349 | 2020-07-30T03:41:13 | 2020-07-30T03:41:13 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 646 |
java
|
package com.naren4b.gb.util;
import com.google.i18n.phonenumbers.NumberParseException;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
public class Util {
public static boolean isPhoneNumberValid(String phoneStr) {
PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
PhoneNumber thePhoneNumber = null;
try {
thePhoneNumber = phoneUtil.parse(phoneStr, "IN");
} catch (NumberParseException e) {
System.err.println("Cannot parse the given phone number string " + phoneStr);
e.printStackTrace();
}
return phoneUtil.isValidNumber(thePhoneNumber);
}
}
|
[
"[email protected]"
] | |
c94cb753341406d16255a9d8d50312a44072402f
|
70eabe9c1fbd2e7318d6e18802922fc4ba07bef8
|
/src/test/java/foxtrot/steps/serenity/ShopEndUserSteps.java
|
4aab041b1e139d816fa424a1e471f09f76ce3e4d
|
[] |
no_license
|
SayanS/foxtrotSerenity
|
f78183753831c5ce1424befdfb4ddd8ff71360c2
|
71370f86a9bb5daef95ac7e5e41442d63c2b298e
|
refs/heads/master
| 2020-03-11T15:18:52.338650 | 2018-04-26T15:14:41 | 2018-04-26T15:14:41 | 130,080,567 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 672 |
java
|
package foxtrot.steps.serenity;
import foxtrot.pages.PreCartPopup;
import foxtrot.pages.ShopPage;
import net.thucydides.core.annotations.Step;
import org.junit.Assert;
import java.util.List;
public class ShopEndUserSteps {
ShopPage shopPage;
PreCartPopup preCartPopup;
@Step
public void ensureThatPageTitleIs(String title) {
Assert.assertEquals(title, shopPage.getTitle());
}
@Step
public void clickOnAddToCartButtonFor(List<Integer> itemNumbers) {
itemNumbers.forEach(itemNumber -> {
shopPage.getProductListContainer().clickOnAddToCartButton(itemNumber);
preCartPopup.close();
});
}
}
|
[
"[email protected]"
] | |
999558124b7b1f5180c4e0b6576084610dfa4874
|
1a8fbed9be513c2972015c66d88d1a713686e35b
|
/Common6/test/lib/EmailTest.java
|
452a079904cedaaff18f8d9b339185304b0f7e77
|
[] |
no_license
|
MCerba/Election-Project
|
41413d2bacb235ae01590cb42ffe70225df38e5f
|
6ce822e0da8eacb272a27d8e9f034d579f1594c3
|
refs/heads/master
| 2021-04-06T19:54:39.349888 | 2018-03-15T17:54:00 | 2018-03-15T17:54:00 | 125,404,121 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,641 |
java
|
package lib;
public class EmailTest
{
public static void main(String[] args)
{
testingGetters();
testingHashCode();
testingToString();
testingEquals();
testingCompareTo();
firstTestingValidateEmail();
secondTestingValidateEmail();
}
public static void testingGetters()
{
Email e1 = new Email("[email protected]");
Email e2 = new Email("[email protected]");
System.out.println("Testing get address");
System.out.println(e1.getAddress() +"\t"+ e2.getAddress() +"\n");
System.out.println("Testing get host");
System.out.println(e1.getHost() +"\t"+ e2.getHost() +"\n");
System.out.println("Testing get userID");
System.out.println(e1.getUserID() +"\t"+ e2.getUserID() +"\n");
}
public static void testingHashCode()
{
Email e1 = new Email("[email protected]");
Email e2 = new Email("[email protected]");
Email e4 = new Email("[email protected]");
System.out.println("Testing hash code method. Getting hashCode for Email e1 \"[email protected]\", Email e2 \"[email protected]\" and Email e4 \"[email protected]\"" );
System.out.println(e1.hashCode() +"\n");
System.out.println(e2.hashCode() +"\n");
System.out.println(e4.hashCode() +"\n");
}
public static void testingToString()
{
Email e1 = new Email("[email protected]");
System.out.println("Testing to string method");
System.out.println(e1.toString() +"\n");
}
public static void testingEquals()
{
Email e1 = new Email("[email protected]");
Email e2 = new Email("[email protected]");
Email e4 = new Email("[email protected]");
System.out.println("Testing equals method. Testing if: [email protected] equals [email protected]");
System.out.println(e1.equals(e2) +"\n");
System.out.println("Testing equals method. Testing if: [email protected] equals [email protected]");
System.out.println(e2.equals(e4) +"\n");
}
public static void testingCompareTo()
{
Email e2 = new Email("[email protected]");
Email e3 = new Email("[email protected]");
Email e4 = new Email("[email protected]");
Email e5 = new Email("[email protected]");
Email e6 = new Email("[email protected]");
System.out.println("Testing the compare method. Comparing [email protected] to [email protected]");
System.out.println(e2.compareTo(e4) +"\n");
System.out.println("Testing the compare method. Comparing [email protected] to [email protected] ");
System.out.println(e5.compareTo(e4) +"\n");
System.out.println("Testing the compare method. Comparing [email protected] to [email protected]");
System.out.println(e6.compareTo(e3) +"\n");
System.out.println("Testing the compare method. Comparaing [email protected] to [email protected]");
System.out.println(e6.compareTo(e2) +"\n");
}
public static void firstTestingValidateEmail()
{
System.out.println("--------All of these emails should be valid-------- \n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: [email protected]");
try
{
Email valid = new Email("[email protected]");
System.out.println("OBJECT CREATED --> PASS");
}
catch (IllegalArgumentException e)
{
System.out.println("FAIL");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: [email protected]");
try
{
Email valid = new Email("[email protected]");
System.out.println("OBJECT CREATED --> PASS");
}
catch (IllegalArgumentException e)
{
System.out.println("FAIL");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: [email protected]");
try
{
Email valid = new Email("[email protected]");
System.out.println("OBJECT CREATED --> PASS");
}
catch (IllegalArgumentException e)
{
System.out.println("FAIL");
}
System.out.println("\n");
}
public static void secondTestingValidateEmail()
{
System.out.println("--------All of these emails should be invalid-------- \n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: [email protected]");
try
{
Email invalid = new Email("[email protected]");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: [email protected]");
try
{
Email invalid2 = new Email("[email protected]");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: letsgo@somewhere");
try
{
Email something = new Email("letsgo@somewhere");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: testing@this.");
try
{
Email woohoo = new Email("testing@this.");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with no '@'");
try
{
Email blah = new Email("hoooooorahhhhh");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: @hi@how@are@you@");
try
{
Email gg = new Email("@hi@how@are@you@");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: [email protected]");
try
{
Email yoooooo = new Email("[email protected]");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: [email protected]");
try
{
Email toomuch = new Email("[email protected]");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with address: hi@123456789123456789123456789123456");
try
{
Email haha = new Email("hi@123456789123456789123456789123456");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
System.out.println("\n");
System.out.println("Testing the validateEmail method. Attempting to create email object with empty address");
try
{
Email hhhhhh = new Email("");
System.out.println("FAIL");
}
catch (IllegalArgumentException e)
{
System.out.println("EXCEPTION CAUGHT --> PASS");
}
}
}
|
[
"[email protected]"
] | |
d68540c7f8957c25d6e29e93310758ce163d3723
|
4d6c00789d5eb8118e6df6fc5bcd0f671bbcdd2d
|
/src/main/java/com/alipay/api/domain/KoubeiCateringOrderPayApplyModel.java
|
a2104db3abc846a47000a85318daacbdb6bdf220
|
[
"Apache-2.0"
] |
permissive
|
weizai118/payment-alipay
|
042898e172ce7f1162a69c1dc445e69e53a1899c
|
e3c1ad17d96524e5f1c4ba6d0af5b9e8fce97ac1
|
refs/heads/master
| 2020-04-05T06:29:57.113650 | 2018-11-06T11:03:05 | 2018-11-06T11:03:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,539 |
java
|
package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 餐饮pos业务订单支付申请
*
* @author auto create
* @since 1.0, 2018-05-28 13:29:45
*/
public class KoubeiCateringOrderPayApplyModel extends AlipayObject {
private static final long serialVersionUID = 7429149433689258748L;
/**
* 是否享受会员价。如果为 true,菜明细里面会按照会员 价(没有改价情况下)作为单 品价格咨询单品券优惠
*/
@ApiField("member_flag")
private Boolean memberFlag;
/**
* 外部支付订单号,唯一标识本次支付的requestID
*/
@ApiField("out_pay_no")
private String outPayNo;
/**
* pos业务订单外部主键信息
*/
@ApiField("pos_order_key")
private PosOrderKey posOrderKey;
/**
* 交易超时时间 选填,默认3分钟.透传给交易,设置可支持如下格式:d:天,h:小时,m:分钟。 示例:5d,1h,3m
*/
@ApiField("timeout")
private String timeout;
/**
* 订单付款金额,以元为单位,精确到分
*/
@ApiField("total_amount")
private String totalAmount;
/**
* 是否整单不可打折
*/
@ApiField("undiscountable")
private Boolean undiscountable;
/**
* 蚂蚁统一会员ID
*/
@ApiField("user_id")
private String userId;
/**
* Gets member flag.
*
* @return the member flag
*/
public Boolean getMemberFlag() {
return this.memberFlag;
}
/**
* Sets member flag.
*
* @param memberFlag the member flag
*/
public void setMemberFlag(Boolean memberFlag) {
this.memberFlag = memberFlag;
}
/**
* Gets out pay no.
*
* @return the out pay no
*/
public String getOutPayNo() {
return this.outPayNo;
}
/**
* Sets out pay no.
*
* @param outPayNo the out pay no
*/
public void setOutPayNo(String outPayNo) {
this.outPayNo = outPayNo;
}
/**
* Gets pos order key.
*
* @return the pos order key
*/
public PosOrderKey getPosOrderKey() {
return this.posOrderKey;
}
/**
* Sets pos order key.
*
* @param posOrderKey the pos order key
*/
public void setPosOrderKey(PosOrderKey posOrderKey) {
this.posOrderKey = posOrderKey;
}
/**
* Gets timeout.
*
* @return the timeout
*/
public String getTimeout() {
return this.timeout;
}
/**
* Sets timeout.
*
* @param timeout the timeout
*/
public void setTimeout(String timeout) {
this.timeout = timeout;
}
/**
* Gets total amount.
*
* @return the total amount
*/
public String getTotalAmount() {
return this.totalAmount;
}
/**
* Sets total amount.
*
* @param totalAmount the total amount
*/
public void setTotalAmount(String totalAmount) {
this.totalAmount = totalAmount;
}
/**
* Gets undiscountable.
*
* @return the undiscountable
*/
public Boolean getUndiscountable() {
return this.undiscountable;
}
/**
* Sets undiscountable.
*
* @param undiscountable the undiscountable
*/
public void setUndiscountable(Boolean undiscountable) {
this.undiscountable = undiscountable;
}
/**
* Gets user id.
*
* @return the user id
*/
public String getUserId() {
return this.userId;
}
/**
* Sets user id.
*
* @param userId the user id
*/
public void setUserId(String userId) {
this.userId = userId;
}
}
|
[
"[email protected]"
] | |
c23bffe82a0d4b108f65d4b8ac0c127c22b9563a
|
fe1a824f66ba55f8fd2c98ad8ce195405f38eb2a
|
/occ-ms-order/src/main/java/com/yonyou/occ/ms/order/repository/package-info.java
|
52dc60806640f8d8ef85c4d2edcbdfdd60441aa3
|
[] |
no_license
|
wangrui821/omni-channel-cloud
|
a9ea1f9723d69bdb3118e5fb113d2386ab0f14f4
|
dba04cdbca13758953c2f608cd001162dccacfee
|
refs/heads/master
| 2021-09-04T10:28:07.194657 | 2018-01-01T10:53:31 | 2018-01-01T10:53:31 | 115,911,879 | 0 | 2 | null | 2018-01-01T10:38:09 | 2018-01-01T10:10:20 |
Java
|
UTF-8
|
Java
| false | false | 85 |
java
|
/**
* Spring Data JPA repositories.
*/
package com.yonyou.occ.ms.order.repository;
|
[
"[email protected]"
] | |
ebf60b0f39d70af2630571bda3caf5952f8c57d2
|
6435ac1df69de3ba0a1124e4a4e89f92f587d899
|
/app/src/main/java/com/hunan/mgtv/QuestionSingleAdapter.java
|
b85eb8eee5fe005043555a21c8bf59ad98df75a6
|
[] |
no_license
|
chile-zhong/MgTV
|
da9df4890bc55f794b5d73f5a1110a8e33003d59
|
b715d4ed443a11f845865bac69eb21cf5ab9ae6b
|
refs/heads/master
| 2021-08-28T10:49:39.978877 | 2017-12-12T01:39:06 | 2017-12-12T01:39:06 | 113,436,904 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,634 |
java
|
package com.hunan.mgtv;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.TextView;
import com.hunan.mgtv.bean.AnswersItem;
import java.util.List;
/**
* Copyright (c) 2012 Conversant Solutions. All rights reserved.
* <p>
* Created on 2017/12/7.
*/
public class QuestionSingleAdapter extends ArrayAdapter<AnswersItem> {
private int resourceId;
private int index = -1;
public QuestionSingleAdapter(Context context, int textViewResourceId,
List<AnswersItem> objects) {
super(context, textViewResourceId, objects);
resourceId = textViewResourceId;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
//重写适配器的getItem()方法
AnswersItem answersItem = getItem(position);
View view;
final ViewHolder viewHolder;
if (convertView == null) {
view = LayoutInflater.from(getContext()).inflate(resourceId, null);
viewHolder = new ViewHolder();
viewHolder.number = (TextView) view.findViewById(R.id.number);
viewHolder.content = (TextView) view.findViewById(R.id.content);
viewHolder.checkBox = (RadioButton) view.findViewById(R.id.checkBox);
view.setTag(viewHolder);
} else { //若有缓存布局,则直接用缓存(利用的是缓存的布局,利用的不是缓存布局中的数据)
view = convertView;
viewHolder = (ViewHolder) view.getTag();
}
viewHolder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
if (isChecked) {
index = position;
notifyDataSetChanged();
}
}
});
if (index == position) {
viewHolder.checkBox.setChecked(true);
} else {
viewHolder.checkBox.setChecked(false);
}
viewHolder.number.setText(position + 1 + "");
viewHolder.content.setText(answersItem.getTxt());
notifyDataSetChanged();
return view;
}
class ViewHolder {
RadioButton checkBox;
TextView number;
TextView content;
}
}
|
[
"[email protected]"
] | |
21784b93138af70cccb0987295032db85acd6b4e
|
2048f76eee0f947ea4b0d64d3c02b4f9317f0a70
|
/EventBusDemo/src/com/angeldevil/eventbusdemo/Event.java
|
64dceb161d37686ad0f45260ff3591afba4e6d0f
|
[] |
no_license
|
longtaoge/EventBus_Dome
|
14d78829b7674dd8a29cd06358d47e14614bf27e
|
c9590561bfb55832e5560fa6e4e15be8b5e1545a
|
refs/heads/master
| 2021-01-13T02:06:19.405339 | 2014-09-26T03:09:00 | 2014-09-26T03:09:00 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 71 |
java
|
package com.angeldevil.eventbusdemo;
public class Event {
}
|
[
"[email protected]"
] | |
fe490307382a528ba7660a5699915634832a669f
|
68857c38ef4f979e9a9ad4aefbd4e1a167b61cb4
|
/Previous Versions/TextAdventure2/src/Adventure/Demo/Condition/DialogHasRun.java
|
bf3cadd93a93941775217ce6485f7b89707827ce
|
[] |
no_license
|
DMFirmy/Adventures-In-Text
|
5c2518947a38ec30e41cb6c475b0f1061a7970cf
|
3941433f76bd142aed6f09c128f6425f070bef55
|
refs/heads/master
| 2020-03-26T17:51:51.555811 | 2015-05-11T23:06:04 | 2015-05-11T23:06:04 | 35,454,782 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,091 |
java
|
package Adventure.Demo.Condition;
import Adventure.API.*;
import Adventure.Base.*;
/**
* This condition will check a given GameDialog to see if it doesn't have the "has run" status.
*/
public class DialogHasRun
extends BaseCondition
{
@SuppressWarnings( "compatibility:-1944839651813882362" )
private static final long serialVersionUID = 1L;
private GameDialog dialog;
/**
* This constructor will build and set up the condition.
*
* @param name The GameComponent name to be assigned to this condition.
* @param theDialog The GameDialog to be checked.
*/
public DialogHasRun(String name, GameDialog theDialog)
{
super( name );
this.dialog = theDialog;
}
/**
* Checks to see if the given GameDialog has run yet.
*
* @return True if the dialog has run, false if it has not.
*/
public boolean checkCondition()
{
if ( this.dialog.hasStatus( "has run" ) )
{
return true;
}
return false;
}
}
|
[
"christopher:[email protected]"
] |
christopher:[email protected]
|
abbc57aae4e27dfbce34524c4a21802a193b42fb
|
2c8f29f5d6d6d374129af03558b8242ab45c9c39
|
/Day08/03_musicservice/src/main/java/com/study/musicservice/model/MusicItem.java
|
94a323d0c0de9d1c0c5e852f759969207424e562
|
[
"Apache-2.0"
] |
permissive
|
yecjl/AndroidStudyDemo
|
4fd92da49dceebea98fce9c452cd5eafb70817c5
|
140888e7b73f25d7d9ec1dad4703105837da3728
|
refs/heads/master
| 2021-01-09T06:22:16.696666 | 2017-05-15T02:04:48 | 2017-05-15T02:04:48 | 80,974,360 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,605 |
java
|
package com.study.musicservice.model;
import android.os.Parcel;
import java.io.Serializable;
/**
* 功能:播放音乐的Bean
* Created by danke on 2017/3/31.
*/
public class MusicItem implements Serializable {
/**
* 音乐名字
*/
private String name;
/**
* 音乐路径
*/
private String path;
/**
* 播放次数
*/
private int playTimes;
/**
* 是否正在播放
*/
private boolean isPlaying;
/**
* 播放到哪个位置
*/
private int playSeek;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public int getPlayTimes() {
return playTimes;
}
public void setPlayTimes(int playTimes) {
this.playTimes = playTimes;
}
public boolean isPlaying() {
return isPlaying;
}
public void setPlaying(boolean playing) {
isPlaying = playing;
}
public int getPlaySeek() {
return playSeek;
}
public void setPlaySeek(int playSeek) {
this.playSeek = playSeek;
}
@Override
public String toString() {
return "MusicItem{" +
"name='" + name + '\'' +
", path='" + path + '\'' +
", playTimes='" + playTimes + '\'' +
", isPlaying='" + isPlaying + '\'' +
", playSeek='" + playSeek + '\'' +
'}';
}
}
|
[
"[email protected]"
] | |
0b5d38a07a7a70230a168fe161791f8a7932c0fb
|
b75a07d026074b468ef6b5887cfdf7c172fdf5d7
|
/app/src/main/java/com/stanislavveliky/macrotracker/DailyTotalStack.java
|
f859c30d81eb5df9baaab72d4270af0a3003867e
|
[] |
no_license
|
stanostr/MacroNutrientTrackerApp
|
d9b0876e2c661d97a294530aa6f1eb8530633eee
|
0b49efeaf736bb57ff9475ccb08434a227245deb
|
refs/heads/master
| 2021-05-12T09:33:47.721351 | 2018-02-03T05:22:50 | 2018-02-03T05:22:50 | 117,323,263 | 0 | 0 | null | 2018-02-03T05:22:50 | 2018-01-13T07:21:38 |
Java
|
UTF-8
|
Java
| false | false | 2,403 |
java
|
package com.stanislavveliky.macrotracker;
import java.util.Stack;
import android.util.Log;
/**
* Singleton to represent two stacks of daily total information
* undostack represents the stacks that can be returned to
* redostack represents undone stacks that can be redone after an undo operation
* @author stan_
*/
public class DailyTotalStack {
private static final String TAG = "DailyTotalStack";
private static DailyTotalStack sDailyTotalStack;
private Stack <DailyTotal> undoStack;
private Stack <DailyTotal> redoStack;
public static DailyTotalStack get()
{
if(sDailyTotalStack ==null)
sDailyTotalStack = new DailyTotalStack();
return sDailyTotalStack;
}
private DailyTotalStack() {
undoStack = new <DailyTotal>Stack();
redoStack = new <DailyTotal>Stack();
}
/**
* pushes a value to the top of the undo stack, clears redo stack because
* there is no option to redo after a new change was made
* @param value to be added to undo stack
*/
public void push(DailyTotal value) {
undoStack.push(value);
redoStack.clear();
logStackSize();
}
private void logStackSize() {
Log.d(TAG, "undostack " + undoStack.size() + " redostack " + redoStack.size());
}
// returns whether or not an undo can be performed
public boolean canUndo() {
return !undoStack.isEmpty();
}
/**
* gets the top item off the undo stack, as well as adds it to the redo stack
* @return the top item of the undo stack
*/
public DailyTotal undo(DailyTotal current) {
if (!canUndo()) {
throw new IllegalStateException();
}
else {
redoStack.push(current);
return undoStack.pop();
}
}
// returns whether or not a redo can be done
public boolean canRedo() {
return !redoStack.isEmpty();
}
/**
* returns top item from redo stack and also adds it to undo stack
* @return top item from redo stack
*/
public DailyTotal redo(DailyTotal current) {
if (!canRedo()) {
throw new IllegalStateException();
}
else {
undoStack.push(current);
return redoStack.pop();
}
}
public void clear()
{
redoStack.clear();
undoStack.clear();
}
}
|
[
"[email protected]"
] | |
a7e0d8b648183b344c91982d414a694f9ec1aa69
|
45fd688338ccefb846eb8a0aa616b9180050b1b5
|
/app/src/main/java/user/offerta/com/Module/Cart.java
|
8626fe2135049b1f490487e4a6986ec9045b69ca
|
[] |
no_license
|
YasmeenSIam1996/OffertaN
|
990c82392f9a4965adda13afea5fbb573327a1ed
|
59fbfaa5de5b759651b182c572bc9676d0cc3eec
|
refs/heads/master
| 2020-05-15T22:12:03.312269 | 2019-04-21T10:28:14 | 2019-04-21T10:28:14 | 182,519,448 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 190 |
java
|
package user.offerta.com.Module;
import java.io.Serializable;
public class Cart implements Serializable {
private int count;
public int getCount() {
return count;
}
}
|
[
"[email protected]://yasmeensiam.visualstudio.com/Start/_git/Start"
] |
[email protected]://yasmeensiam.visualstudio.com/Start/_git/Start
|
3f63154f03e49e6dd11c2e0404d8361b31131f61
|
8df908ccc3b4122c856cd501edfa37375ffb4f29
|
/regLog/app/src/main/java/com/messieyawo/medhack2020/drawerFragments/MyAppointments.java
|
bb8416d2392656d00ca87a744f03dc4210afb3dd
|
[] |
no_license
|
Mawuli87/MedHack2020
|
639ac2c02fb8a3af1994b93a7db74671f1c9e3cc
|
fcda865051cf6fb83b169804fd6bd1e4015675e6
|
refs/heads/master
| 2022-12-13T08:09:16.470107 | 2020-09-13T13:32:48 | 2020-09-13T13:32:48 | 293,250,733 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 678 |
java
|
package com.messieyawo.medhack2020.drawerFragments;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.messieyawo.medhack2020.R;
public class MyAppointments extends Fragment {
public MyAppointments() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_my_appointments, container, false);
}
}
|
[
"[email protected]"
] | |
22bc6ceb6a6667c4cc06eb44214594f51cb6c769
|
6992cef1d8dec175490d554f3a1d8cb86cd44830
|
/Java/JEE/EJB/Converter/ConverterHolder.java
|
da84250839ee52dca529693e709c223cd947ffa6
|
[] |
no_license
|
hamaenpaa/own_code_examples
|
efd49b62bfc96d1dec15914a529661d3ebbe448d
|
202eea76a37f305dcbc5a792c9b613fc43ca8477
|
refs/heads/master
| 2021-01-17T14:51:03.861478 | 2019-05-06T09:28:23 | 2019-05-06T09:28:23 | 44,305,640 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 874 |
java
|
/**
* <ul>
* <li> <b>IDL Source</b> "reverse mapped from Java"
* <li> <b>IDL Name</b> ::Converter
* <li> <b>Repository Id</b> RMI:Converter:0000000000000000
* </ul>
* <b>IDL definition:</b>
* <pre>
* interface Converter : javax.ejb.EJBObject {
...
};
* </pre>
*/
public final class ConverterHolder implements org.omg.CORBA.portable.Streamable {
public Converter value;
public ConverterHolder () {
}
public ConverterHolder (final Converter _vis_value) {
this.value = _vis_value;
}
public void _read (final org.omg.CORBA.portable.InputStream input) {
value = ConverterHelper.read(input);
}
public void _write (final org.omg.CORBA.portable.OutputStream output) {
ConverterHelper.write(output, value);
}
public org.omg.CORBA.TypeCode _type () {
return ConverterHelper.type();
}
}
|
[
"[email protected]"
] | |
bd5a936f6dfd80ff3f3ca60255b32bbd81858813
|
b2a50f92f359a63a4adf9c42e7d9734b1f87c50e
|
/src/main/java/com/epmresources/server/repository/PeopleRepository.java
|
f68fdcc3926c1095eb0dc910894f1ffd738a61b0
|
[] |
no_license
|
thetlwinoo/epm-resources
|
a9dbc08bacd45a0e57c31c14aff3a3e5c6a82597
|
88f2918de8c07cd1c3a2f701c4adfa97305b974d
|
refs/heads/master
| 2022-12-26T15:46:06.041561 | 2019-12-20T07:35:25 | 2019-12-20T07:35:25 | 220,428,422 | 0 | 0 | null | 2022-12-16T04:40:56 | 2019-11-08T09:06:17 |
Java
|
UTF-8
|
Java
| false | false | 399 |
java
|
package com.epmresources.server.repository;
import com.epmresources.server.domain.People;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the People entity.
*/
@SuppressWarnings("unused")
@Repository
public interface PeopleRepository extends JpaRepository<People, Long>, JpaSpecificationExecutor<People> {
}
|
[
"[email protected]"
] | |
16ae61f0fe8d8be09d0d2463d46d378589e54c99
|
65f8eb5f5032676d11e9468213f1ccfb03434220
|
/src/main/java/com/ankit/demo/config/SpringSecurityConfig.java
|
1f277bb018f6e41fb58de648082f6be3578b2996
|
[] |
no_license
|
aceankit99/springSecurity
|
edb38c12938b2068337891e22b5bbeb8965ecc21
|
cf7ce86fa053f41dabcadd77613d9fde5ef4a49f
|
refs/heads/master
| 2022-12-20T06:33:59.359981 | 2020-10-26T07:58:40 | 2020-10-26T07:58:40 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,772 |
java
|
package com.ankit.demo.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
@Configuration
public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
//security for all api
// @Override
// protected void configure(HttpSecurity http) throws Exception {
// http.csrf().disable();
// http.authorizeRequests().anyRequest().fullyAuthenticated().and().httpBasic();
// }
//Security Based on URL
// @Override
// protected void configure(HttpSecurity http) throws Exception {
// http.csrf().disable();
// http.authorizeRequests().antMatchers("/rest/**").fullyAuthenticated().and().httpBasic();
// }
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
http.authorizeRequests().antMatchers("/rest/**").hasAnyRole("ADMIN").anyRequest().fullyAuthenticated().and().httpBasic();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("ankit").password("123456").roles("ADMIN");
auth.inMemoryAuthentication().withUser("akash").password("12345").roles("USER");
}
@Bean
public static NoOpPasswordEncoder passwordEncoder(){
return (NoOpPasswordEncoder) NoOpPasswordEncoder.getInstance();
}
}
|
[
"[email protected]"
] | |
b33157beba65fd5c463dd1cdd673bbb85a6054c0
|
34491e8a3ed1499d840e0d18dcb8101546150720
|
/Designer/designer/src/de/hpi/bpmn/serialization/erdf/templates/ANDGatewayTemplate.java
|
9e74eed8d68f830af8f39bcdf7e3683696ef6224
|
[
"MIT"
] |
permissive
|
adele-robots/fiona
|
128061a86593bc75b3c5b0cf591de2158c681cc6
|
1ef1fb18e620e18b2187e79e4cca31d66d3f1fd2
|
refs/heads/master
| 2020-06-19T04:42:14.203355 | 2020-06-10T10:46:58 | 2020-06-10T10:46:58 | 196,561,178 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 923 |
java
|
package de.hpi.bpmn.serialization.erdf.templates;
import de.hpi.bpmn.ANDGateway;
import de.hpi.bpmn.DiagramObject;
import de.hpi.bpmn.serialization.erdf.ERDFSerializationContext;
public class ANDGatewayTemplate extends NonConnectorTemplate {
private static BPMN2ERDFTemplate instance;
public static BPMN2ERDFTemplate getInstance() {
if (instance == null) {
instance = new ANDGatewayTemplate();
}
return instance;
}
public StringBuilder getCompletedTemplate(DiagramObject diagramObject,
ERDFSerializationContext transformationContext) {
ANDGateway g = (ANDGateway) diagramObject;
StringBuilder s = getResourceStartPattern(transformationContext.getResourceIDForDiagramObject(g));
appendOryxField(s,"type",STENCIL_URI + "#AND_Gateway");
appendNonConnectorStandardFields(g,s,transformationContext);
appendResourceEndPattern(s, diagramObject, transformationContext);
return s;
}
}
|
[
"[email protected]"
] | |
985c6ca0dfa27fefddb6b979673d9f9ad73e306c
|
3b449ca350de6facd04f2c240efa961b7e7f6423
|
/src/recommender/metrics/SimilarityMeasures.java
|
86ddface18f313f9bb91d000e35dea930c3f01b4
|
[] |
no_license
|
RafaelDaddio/RecJ
|
7721affae907a6666c127a5102aacdaacf5a7f4f
|
5e59210bfb1cc2cb206a089f02a1303e8b6756eb
|
refs/heads/master
| 2021-09-08T08:33:21.082700 | 2018-03-08T18:47:29 | 2018-03-08T18:47:29 | 118,644,029 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 504 |
java
|
package recommender.metrics;
/**
* Interface responsible to define the method which should be implemented in all
* similarity metrics
*
* @author Rafael D'Addio
*/
public interface SimilarityMeasures {
/**
* Method for calculating similarity
*
* @param entityA either a user or an item metadata vector
* @param entityB either a user or an item metadata vector
* @return a similarity score
*/
public double calcSimilarity(float[] entityA, float[] entityB);
}
|
[
"[email protected]"
] | |
2593830125b8dd141a8b1b0a1594d4ab4501d391
|
6f914ddf726b85a826598576db0d21d4a1412d10
|
/spring-demo-annotations/src/com/luv2code/springdemo/AnnotationBeanScopeDemoApp.java
|
ad5a92e5586b1d04c8492529be96876efeb0b0b3
|
[] |
no_license
|
aymanzrari/spring-demo
|
f63c6bcd14c8a63bf35c9571c2f16550734f183b
|
33c1eaeda222a69576c85a098734210e405702eb
|
refs/heads/master
| 2022-12-11T08:11:04.291744 | 2020-09-07T19:24:11 | 2020-09-07T19:24:11 | 293,608,451 | 3 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 752 |
java
|
package com.luv2code.springdemo;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class AnnotationBeanScopeDemoApp {
public static void main(String[] args) {
// TODO Auto-generated method stub
ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
Coach theCoach=context.getBean("tennisCoach",Coach.class);
Coach alphaCoach=context.getBean("tennisCoach",Coach.class);
boolean resultat=(theCoach==alphaCoach);
System.out.println("\n Pointing to the same object : " +resultat);
System.out.println("\n Memory location for theCoach : " +theCoach);
System.out.println("\n Memory location for alphaCoach : " +alphaCoach);
context.close();
}
}
|
[
"[email protected]"
] | |
caa748755ff967b541584d0d59d9660297f99efd
|
0b3ed937201f0bb3b47af313c5bf27ce37705b40
|
/app/src/main/java/com/example/hawes/tradelist/TradeListApiClient.java
|
70e00be3f99cc708e27f2ff84bbf13b640e7171a
|
[] |
no_license
|
IvanKasyan/TradeList
|
c63d69b97642651483634e9deb99d1616edf36cf
|
6b2ba95c39e3faf2bcfba4ea3d5c349a194c6da8
|
refs/heads/master
| 2021-01-20T09:13:22.897032 | 2017-08-27T22:11:24 | 2017-08-27T22:11:24 | 101,581,612 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 409 |
java
|
package com.example.hawes.tradelist;
import TradeListResponse.TradeListModel;
import TradeListResponse.TradeListModel;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
public interface TradeListApiClient {
@GET("api/v1/trades")
Call<List<TradeListModel>> getTradeListResponse(@Query("api_key") String api_key);
}
|
[
"[email protected]"
] | |
f8024b02496dd236dd72b24a17135356a99ff0a3
|
6016be99c2494e73c28c2338264be42945f904dc
|
/erika-bibliopa/src/main/java/com/hoyer/erika/pa/model/BaseDAO.java
|
d608d6625fada40a8d6309878df9da665ffcd41a
|
[] |
no_license
|
erikahoyer/erika-bibliopa
|
d47a5a68f2a1d99bca4f2bc802dc7c6e8df96010
|
01083ea9349b0002b9d761f7692222e21ec9d24a
|
refs/heads/master
| 2020-05-25T12:46:21.827633 | 2016-09-19T23:37:27 | 2016-09-19T23:37:27 | 68,655,427 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,182 |
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.hoyer.erika.pa.model;
/**
*
* @author Erika
*/
import java.sql.Connection;
import javax.naming.InitialContext;
import javax.sql.DataSource;
public class BaseDAO {
private DataSource ds;
public BaseDAO(){
try {
InitialContext cxt = new InitialContext();
if (cxt == null) {
System.out.println("[DataBaseDAO.constructor] Failed in InitialContext.");
} else {
ds = (DataSource) cxt.lookup("java:comp/env/jdbc/referenciasbibliograficas");
}
} catch (Exception e) {
System.out.println("[DataBaseDAO.constructor] Exception: " + e.getMessage());
}
}
public Connection getConnection(){
Connection result = null;
try{
if(ds != null) result = ds.getConnection();
} catch(Exception e) {
e.printStackTrace(System.out);
}
return result;
}
}
|
[
"[email protected]"
] | |
82f00f6740fa0e8a3f81fc659b9bd6db8449cb19
|
d474c6d0e355c5ac4352ff2c01403c557fb6b73e
|
/src/main/java/Modelo/Prueba_entidad1.java
|
6c1113c7f49c6c05835cae0664ecfdd99aa50469
|
[] |
no_license
|
Juano187/disenioUltimo2019
|
208cd48d287b8537a5b6cd3064b5af8e06975574
|
6589262d8bf996c2cc21940d120be4b5025542f2
|
refs/heads/master
| 2020-04-17T09:25:05.412462 | 2019-03-03T18:50:33 | 2019-03-03T18:50:33 | 166,456,760 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 62 |
java
|
package Modelo;
public class Prueba_entidad1 {
//hola
}
|
[
"[email protected]"
] | |
3cb91481f662ba95533e4cac7f257a4b528a3e62
|
86b70e06f0aedd8e392f56993b908f511ac66bbd
|
/app/src/main/java/c4q/nyc/myhelloworldandroidproject/MainActivity.java
|
cb1960e5a6f1e8c7dbb7258c3c4c9cd59c4157f1
|
[] |
no_license
|
anemokid/MyHelloWorldAndroidProject
|
48d7cf1fc8b4bc813c7df5d317051b312397be04
|
ff1e1d663d77f91d550e2437d9a17f8bae6c4795
|
refs/heads/master
| 2021-07-12T09:10:17.207061 | 2017-10-15T19:41:28 | 2017-10-15T19:41:28 | 107,030,921 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,143 |
java
|
package c4q.nyc.myhelloworldandroidproject;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d(TAG, " onCreate method has run!");
}
@Override
protected void onStart(){
super.onStart();
Log.d(TAG, " onStart method has run!");
}
@Override
protected void onResume(){
super.onResume();
Log.d(TAG, "onResume method has run!");
}
@Override
protected void onPause(){
super.onPause();
Log.d(TAG, "onPause method has started!");
}
@Override
protected void onStop(){
super.onStop();
Log.d(TAG, "onStop method has run!");
}
@Override
protected void onDestroy(){
super.onDestroy();
Log.d(TAG, "onDestroy method has run!");
}
}
|
[
"[email protected]"
] | |
9958a4ec7807446997ca944665465530f570fb19
|
6d81aec4e7f3ce893e4939e6adcf772e4f0a4cac
|
/app/src/main/java/sebastian/ing/jyc2/pedidos/Pedido.java
|
da278a2ce848b1b1a5183a58408a110471672f38
|
[] |
no_license
|
jscepedesg/JYC_Android2
|
f2a29d64670c8cb9fd9ddd40f375d9f24bbad6ad
|
7a2e2f4008398b76b4bd3e08ec163f4a7c727b9f
|
refs/heads/master
| 2020-05-25T05:49:38.810208 | 2019-05-27T20:14:19 | 2019-05-27T20:14:19 | 187,657,233 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,127 |
java
|
package sebastian.ing.jyc2.pedidos;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.Date;
import sebastian.ing.jyc2.R;
/**
* Created by Usuario on 12/02/2019.
*/
public class Pedido extends AppCompatActivity
{
private ListView listView;
private ArrayList<String> listaInformacion;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pedido);
listView = (ListView) findViewById(R.id.listViewDias_estadistica);
setObtenerLista();
final ArrayAdapter adaptador= new ArrayAdapter(this,android.R.layout.simple_list_item_1,listaInformacion);
listView.setAdapter(adaptador);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int pos, long l) {
String dia = listaInformacion.get(pos);
Log.d("Dia de busqueda: ",dia);
Intent intent = new Intent(Pedido.this,Lista_clientes_por_dia.class);
Bundle bundle= new Bundle();
bundle.putSerializable("cliente_dia",dia);
intent.putExtras(bundle);
startActivity(intent);
//finish();
}
});
}
public void setFecha()
{
Date fecha1 = new Date();
CharSequence s = DateFormat.format("yyyy-MM-dd", fecha1.getTime());
}
private void setObtenerLista()
{
listaInformacion = new ArrayList<String>();
listaInformacion.add("Lunes");
listaInformacion.add("Martes");
listaInformacion.add("Miercoles");
listaInformacion.add("Jueves");
listaInformacion.add("Viernes");
listaInformacion.add("Sabado");
}
}
|
[
"[email protected]"
] | |
5668b6207f464c81f09a19a81aeb3d8535cec441
|
1f64294e7d0d4c9620eccd093cae189c3b31ad05
|
/BeaconShop/app/src/main/java/com/amplearch/beaconshop/Model/Images.java
|
4116ff9fcf7b6cdaf3c6319bb447d1f8d73cee4f
|
[] |
no_license
|
khushbu112233/Beaconshop
|
673e20b1c798a4c88757c3f4a00688ea83efeed5
|
02b2b9073154c6bdfbc2b1d20c81af34a1eead89
|
refs/heads/master
| 2020-03-19T13:18:14.955005 | 2018-05-30T06:23:56 | 2018-05-30T06:23:56 | 136,572,298 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 540 |
java
|
package com.amplearch.beaconshop.Model;
/**
* Created by ample-arch on 4/17/2017.
*/
public class Images
{
int id ;
String name;
byte[] image ;
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 byte[] getImage() {
return image;
}
public void setImage(byte[] image) {
this.image = image;
}
}
|
[
"[email protected]"
] | |
05e1dce4bf3c90389507ddd1fab279b220b67e2f
|
ff156ed7b53f3e6e37c311cd32988c8fca76ecb5
|
/app/src/androidTest/java/com/jt/javatechnocrat/ExampleInstrumentedTest.java
|
24b162153d552a0996a12f7d7ab016940dec82a4
|
[] |
no_license
|
rk472/NewJT
|
fa9a56bd54c973657683e450959583f1db3c6471
|
137d8419a87abf59f1390d4fcb5d741fe99d1562
|
refs/heads/master
| 2021-04-12T03:48:27.443752 | 2018-03-24T07:27:52 | 2018-03-24T07:27:52 | 125,767,650 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 743 |
java
|
package com.jt.javatechnocrat;
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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.jt.javatechnocrat", appContext.getPackageName());
}
}
|
[
"[email protected]"
] | |
3d7999855826ac5663d2bf5c259b8787ab2c0091
|
5cefafafa516d374fd600caa54956a1de7e4ce7d
|
/oasis/web/ePolicy/wsPolicy/test/src/com/delphi_tech/ows/party/CountryCodeType.java
|
f5c4bf4584d246638ea017f02d84b94ad0623f11
|
[] |
no_license
|
TrellixVulnTeam/demo_L223
|
18c641c1d842c5c6a47e949595b5f507daa4aa55
|
87c9ece01ebdd918343ff0c119e9c462ad069a81
|
refs/heads/master
| 2023-03-16T00:32:08.023444 | 2019-04-08T15:46:48 | 2019-04-08T15:46:48 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,143 |
java
|
package com.delphi_tech.ows.party;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/**
* <p>Java class for CountryCodeType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CountryCodeType">
* <simpleContent>
* <extension base="<http://www.w3.org/2001/XMLSchema>string">
* <attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CountryCodeType", propOrder = {
"value"
})
public class CountryCodeType
implements Serializable
{
private final static long serialVersionUID = 1L;
@XmlValue
protected String value;
@XmlAttribute(name = "description")
protected String description;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
}
|
[
"[email protected]"
] | |
89d76a43ce64fa2cafbec39fd3cfc24f83797c2b
|
75472d066a439b30df3c06e30741287e4e852bbc
|
/JavaApplication1/src/pack1/infix2.java
|
5183ab850d4e730dc49e7acf3d48f63162a72376
|
[] |
no_license
|
Momerhussain/Java-practice-Tasks
|
f8c1d40926ae8b069f5ef417b1dc5e2efdd61157
|
46dc4b94da6fc36600e88aec459ec55a8ecfe675
|
refs/heads/master
| 2021-04-18T02:12:22.374388 | 2020-03-23T17:19:56 | 2020-03-23T17:19:56 | 249,496,479 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,982 |
java
|
package pack1;
import java.util.*;
public class infix2 {
public static boolean Operator(char c) {
return c == '+' || c == '-' || c == '*' || c == '/' || c == '^' || c == '(' || c == ')';
}
public static int getPrecedence(char ch) {
switch (ch) {
case '+':
case '-':
return 1;
case '*':
case '/':
return 2;
case '^':
return 3;
}
return -1;
}
public static boolean Operand(char ch) {
return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');
}
public static String convertToPostfix(String infix) {
Stack<Character> stack = new Stack<Character>();
StringBuffer postfix = new StringBuffer(infix.length());
char c;
for (int i = 0; i < infix.length(); i++) {
c = infix.charAt(i);
if (Operand(c)) {
postfix.append(c);
} else if (c == '(') {
stack.push(c);
}
else if (c == ')') {
while (!stack.isEmpty() && stack.peek() != '(') {
postfix.append(stack.pop());
}
if (!stack.isEmpty() && stack.peek() != '(')
return null;
else if(!stack.isEmpty())
stack.pop();
}
else if (Operator(c))
{
if (!stack.isEmpty() && getPrecedence(c) <= getPrecedence(stack.peek())) {
postfix.append(stack.pop());
}
stack.push(c);
}
}
while (!stack.isEmpty()) {
postfix.append(stack.pop()); }
return postfix.toString();
}
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.print("Enter Infix Expression :");
String e=sc.nextLine();
System.out.println("Postfix :"+convertToPostfix(e)); }}
|
[
"[email protected]"
] | |
5c9ca6ec7ac037b0df7f11947bebb7eb72eb5257
|
b8e3f5240a1d85e06741c28c42bc3116806cb138
|
/src/test/java/io/schoolhipster/application/config/WebConfigurerTest.java
|
47a224152c45ab60877394297a9dfafdfe8eb728
|
[] |
no_license
|
skynet047/schoolhipsterJWT
|
f1a17528547abe92807da945c73d7fe827d1ed6b
|
cc566eb1f5d7829f7faf3f101352ca0ed08b273c
|
refs/heads/master
| 2021-07-22T11:41:31.256667 | 2018-08-09T15:19:33 | 2018-08-09T15:19:38 | 135,417,041 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 9,405 |
java
|
package io.schoolhipster.application.config;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.servlet.InstrumentedFilter;
import com.codahale.metrics.servlets.MetricsServlet;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.JHipsterProperties;
import io.github.jhipster.web.filter.CachingHttpHeadersFilter;
import io.undertow.Undertow;
import io.undertow.Undertow.Builder;
import io.undertow.UndertowOptions;
import org.apache.commons.io.FilenameUtils;
import org.h2.server.web.WebServlet;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.mock.web.MockServletContext;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.xnio.OptionMap;
import javax.servlet.*;
import java.util.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Unit tests for the WebConfigurer class.
*
* @see WebConfigurer
*/
public class WebConfigurerTest {
private WebConfigurer webConfigurer;
private MockServletContext servletContext;
private MockEnvironment env;
private JHipsterProperties props;
private MetricRegistry metricRegistry;
@Before
public void setup() {
servletContext = spy(new MockServletContext());
doReturn(mock(FilterRegistration.Dynamic.class))
.when(servletContext).addFilter(anyString(), any(Filter.class));
doReturn(mock(ServletRegistration.Dynamic.class))
.when(servletContext).addServlet(anyString(), any(Servlet.class));
env = new MockEnvironment();
props = new JHipsterProperties();
webConfigurer = new WebConfigurer(env, props);
metricRegistry = new MetricRegistry();
webConfigurer.setMetricRegistry(metricRegistry);
}
@Test
public void testStartUpProdServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
webConfigurer.onStartup(servletContext);
assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class));
}
@Test
public void testStartUpDevServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
webConfigurer.onStartup(servletContext);
assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class));
}
@Test
public void testCustomizeServletContainer() {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
UndertowServletWebServerFactory container = new UndertowServletWebServerFactory();
webConfigurer.customize(container);
assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg");
assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html;charset=utf-8");
assertThat(container.getMimeMappings().get("json")).isEqualTo("text/html;charset=utf-8");
if (container.getDocumentRoot() != null) {
assertThat(container.getDocumentRoot().getPath()).isEqualTo(FilenameUtils.separatorsToSystem("build/www"));
}
Builder builder = Undertow.builder();
container.getBuilderCustomizers().forEach(c -> c.customize(builder));
OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions");
assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isNull();
}
@Test
public void testUndertowHttp2Enabled() {
props.getHttp().setVersion(JHipsterProperties.Http.Version.V_2_0);
UndertowServletWebServerFactory container = new UndertowServletWebServerFactory();
webConfigurer.customize(container);
Builder builder = Undertow.builder();
container.getBuilderCustomizers().forEach(c -> c.customize(builder));
OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions");
assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isTrue();
}
@Test
public void testCorsFilterOnApiPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("*"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
options("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"))
.andExpect(header().string(HttpHeaders.VARY, "Origin"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800"));
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"));
}
@Test
public void testCorsFilterOnOtherPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("*"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/test/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testCorsFilterDeactivated() throws Exception {
props.getCors().setAllowedOrigins(null);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testCorsFilterDeactivated2() throws Exception {
props.getCors().setAllowedOrigins(new ArrayList<>());
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
}
|
[
"[email protected]"
] | |
525a9f5f67af0b4607e87de72cc83b107476f415
|
944f62fd08c69668b47337692eb989814354d40a
|
/shop-service/src/main/java/com/masiis/shop/web/common/service/CheckSkuAgentStatusService.java
|
d56f1374a2148cc057e215420ca865708f46450d
|
[] |
no_license
|
caitb/shop
|
70ab8eef26afda206c249dc7d6ab742c762e0a83
|
29535190e93f625cd205165bd1b64f9fe06ff3f1
|
refs/heads/master
| 2020-03-21T11:49:31.441671 | 2016-09-29T09:58:03 | 2016-09-29T09:58:03 | 138,523,378 | 0 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,422 |
java
|
package com.masiis.shop.web.common.service;
import com.masiis.shop.dao.platform.product.ComSkuMapper;
import com.masiis.shop.dao.platform.user.PfUserSkuMapper;
import com.masiis.shop.dao.po.ComSku;
import com.masiis.shop.dao.po.PfUserSku;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* Created by jiajinghao on 2016/8/8.
*/
@Service
@Transactional
public class CheckSkuAgentStatusService {
@Resource
private PfUserSkuMapper pfUserSkuMapper;
@Resource
private ComSkuMapper comSkuMapper;
/**
* jjh
* 检查该商品的代理状态--只适用于申请主打商品的情况
* userId -当前用户
* skuId
*/
public Boolean availableSkuForAgent(Integer skuId,Long userId) throws Exception{
boolean hasAgent = false;
List<PfUserSku> pfUserSkuList = pfUserSkuMapper.selectByUserId(userId);
if(pfUserSkuList==null || pfUserSkuList.size()<=0){
hasAgent =false;//小白用户
}else {
PfUserSku pfUserSku = pfUserSkuMapper.selectByUserIdAndSkuId(pfUserSkuList.get(0).getUserPid(),skuId);
if(pfUserSku==null){
hasAgent =false;//上级没代理
}else {
hasAgent = true;//可以代理
}
}
return hasAgent;
}
}
|
[
"[email protected]"
] | |
badebb5a2f5613ffbef2cefa13100a4cc2762025
|
b0498ce636120bfe476312a390ee1ad6bcc8404a
|
/src/main/java/com/ks/supersync/controller/SuperSyncController.java
|
cdc6a7e3a00e2331575dd0b027b64497c024ae94
|
[] |
no_license
|
G3rY89/supersync
|
d635375a9d72417e2ddc80df2d3263d8d06c9b87
|
a589360a008b0844720d5d3ec84ca764da198a7a
|
refs/heads/master
| 2022-09-26T07:36:58.419894 | 2019-12-05T15:29:26 | 2019-12-05T15:29:26 | 207,251,810 | 0 | 0 | null | 2022-09-22T18:52:19 | 2019-09-09T07:36:54 |
Java
|
UTF-8
|
Java
| false | false | 1,488 |
java
|
package com.ks.supersync.controller;
import java.io.IOException;
import javax.xml.bind.JAXBException;
import com.ks.supersync.service.webshopservice.WebshopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@CrossOrigin
@RestController
public class SuperSyncController {
@Autowired
WebshopService webShopService;
@RequestMapping(value = "/sync_to_ugyvitel", method = RequestMethod.GET, produces = "application/xml")
public Object syncToUgyvitel(
@RequestHeader("WebIdentifier") String webIdentifier,
@RequestHeader("WebPassword") String webPassword,
@RequestHeader("SyncType") String syncType,
@RequestHeader("ApiKey") String ApiKey) throws IOException, JAXBException{
return webShopService.getItemsForUgyvitel(webIdentifier, webPassword, syncType, ApiKey);
}
@RequestMapping(value = "/sync_from_ugyvitel", method = RequestMethod.POST, produces = "application/xml", consumes = "application/xml")
public Object syncFromUgyvitel(
@RequestHeader("WebIdentifier") String webIdentifier,
@RequestHeader("WebPassword") String webPassword,
@RequestHeader("SyncType") String syncType,
@RequestHeader("ApiKey") String ApiKey,
@RequestBody String item) throws IOException, JAXBException{
return webShopService.sendItemsFromUgyvitel(webIdentifier, webPassword, syncType, ApiKey, item);
}
}
|
[
"[email protected]"
] | |
89d3578de38b94f408cd9737da3e703792705c3e
|
0afa2ffd87a8fdeafa5617201b8895357246b7ce
|
/app/src/main/java/com/mpewpazi/android/awaljunisidang/masterDataModel/MstAirPelayaran.java
|
ba32de841b924668016d743c802fc77194c96156
|
[] |
no_license
|
mpeew/AwalJuniSidang
|
9e9816055955d728b32c61a0db4ed66b535e4a1c
|
f84fe4eab176041ccfdb9c9aee3d48a60a11f601
|
refs/heads/master
| 2021-01-17T12:55:29.034907 | 2016-06-15T03:53:05 | 2016-06-15T03:53:05 | 56,684,366 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 288 |
java
|
package com.mpewpazi.android.awaljunisidang.masterDataModel;
/**
* Created by mpewpazi on 5/20/16.
*/
public class MstAirPelayaran extends SingleMaster {
public static final String kode="airPelayaran";
@Override
public String getKodeMst() {
return kode;
}
}
|
[
"[email protected]"
] | |
96e5a7e7266bbcaccc94e5269495f77bf84503c0
|
47c6d8641cc5f8353a87363cc8b1e88002c644b7
|
/src/projects/Infra/nodes/messages/InfraAnnounceCHMessage.java
|
d6ff218502d33e517c285f8725c4bbbf468993ba
|
[
"BSD-3-Clause"
] |
permissive
|
rubiruchi/routing-1
|
c8463e22aaae8bb4fa6a6b3dad790d9021c802f5
|
6b71080ecb1e860455401048f06d89aad894ebdf
|
refs/heads/master
| 2020-06-04T15:58:20.945481 | 2017-07-28T19:12:19 | 2017-07-28T19:12:19 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,261 |
java
|
package projects.Infra.nodes.messages;
import sinalgo.nodes.messages.Message;
public class InfraAnnounceCHMessage extends Message {
private int chID;
private int eventID=0;
private int hopstoEvent=0;
private String myRole=null;
private int TTL=100;
private int hopstoSink= 1000;
public InfraAnnounceCHMessage(int chID, int eventID, int TTL,int hops, int hopstoSink, String myRole){
this.chID = chID;
this.eventID = eventID;
this.TTL = TTL;
this.hopstoEvent = hops;
this.myRole = myRole;
this.hopstoSink = hopstoSink;
}
@Override
public Message clone() {
// TODO Auto-generated method stub
return new InfraAnnounceCHMessage(this.chID, this.eventID, this.TTL, this.hopstoEvent, this.hopstoSink, this.myRole);
}
public int getchID(){
return this.chID;
}
public int getEventID(){
return this.eventID;
}
public int getTTL(){
return this.TTL;
}
public int getHopstoEvent() {
return hopstoEvent;
}
public int getHopstoSink() {
return hopstoSink;
}
public void setHopstoEvent(int hops) {
this.hopstoEvent = hops;
}
public void setHopstoSink(int hopstoSink) {
this.hopstoSink = hopstoSink;
}
public String getMyRole() {
return myRole;
}
public void setMyRole(String myRole) {
this.myRole = myRole;
}
}
|
[
"[email protected]"
] | |
2efc5a9184eead925a129340101e55b715dde6db
|
0001103e8f156439b1922039b6bfc3b3655f31a0
|
/AndroidLab2/app/src/main/java/Activity/MainActivity.java
|
7e954fbc92cb67dece9cf68a90a3d07679d1c4f8
|
[] |
no_license
|
kuplevich-max/AndroidLabs
|
1a669593e74327a829f6aff61f687146b85a0b57
|
2482abd876fe452a4cf38011caaaed7821e18e6e
|
refs/heads/main
| 2023-02-08T23:24:16.850160 | 2021-01-04T15:48:58 | 2021-01-04T15:48:58 | 325,616,306 | 0 | 0 | null | 2021-01-04T15:48:59 | 2020-12-30T18:04:07 |
Groovy
|
UTF-8
|
Java
| false | false | 3,971 |
java
|
package Activity;
import Adapters.DbAdapter;
import Adapters.ExeAdapter;
import Adapters.Exercise;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.PreferenceManager;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
import com.example.androidlab2.R;
import java.util.List;
import java.util.Locale;
public class MainActivity extends AppCompatActivity {
private ListView list;
public static boolean opa = true;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
list = (ListView)findViewById(R.id.listActivities);
setupUI();
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
if (item.getItemId() == R.id.action_settings)
{
startActivity(new Intent(this, SettingsActivity.class));
return true;
}
return super.onOptionsItemSelected(item);
}
void setupUI(){
Button btnAdd = (Button) findViewById(R.id.addActivityButton);
btnAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), NewExerciseActivity.class);
startActivity(intent);
}
});
}
@Override
public void onResume()
{
setSettings();
super.onResume();
DbAdapter adapter = new DbAdapter(this);
adapter.open();
List<Exercise> exercises = adapter.getExes();
ExeAdapter arrayAdapter = new ExeAdapter(this, R.layout.exe_item, exercises);
list.setAdapter(arrayAdapter);
adapter.close();
}
void setSettings(){
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
String defaultValueFont = "big";
String defaultValueTheme = "day";
String defaultValueLocale = "ru";
String theme = sharedPref.getString("theme", defaultValueTheme);
String font = sharedPref.getString("font",defaultValueFont);
String locale = sharedPref.getString("locale",defaultValueLocale);
if(theme.equals("day")){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
}
else{
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
}
if(font.equals("big")){
Configuration configuration = getResources().getConfiguration();
configuration.fontScale = 1F;
}
else{
Configuration configuration = getResources().getConfiguration();
configuration.fontScale = 0.5F;
}
Resources resources = getResources();
Configuration configuration = resources.getConfiguration();
DisplayMetrics dm = resources.getDisplayMetrics();
if(locale.equals("ru")){
configuration.setLocale(new Locale("ru"));
}
else{
configuration.setLocale(new Locale("en"));
}
resources.updateConfiguration(configuration, dm);
if(opa)
recreate();
opa = false;
}
}
|
[
"[email protected] config --global user.name kuplevich-maxgit config --global user.email [email protected]"
] |
[email protected] config --global user.name kuplevich-maxgit config --global user.email [email protected]
|
116a2ac526c4a5e1d3d48bf9dc904a4f880da335
|
7d910686ead5bede50c83879d5232f73529d82e9
|
/c0321g1_pawnshop_backend/c0321g1_pawnshop_backend/src/main/java/c0321g1_pawnshop_backend/service/contract/ContractService.java
|
43d89b5f18938c9c5c4f294dc27b4ba17d01972f
|
[] |
no_license
|
C0321G1/sprint2_backend
|
807435561ce6bb4c7c2928b4a21a07d3c434b389
|
b4282ffe7b00faa377054aa2730be124489f086d
|
refs/heads/master
| 2023-09-05T06:02:46.131771 | 2021-10-12T09:42:50 | 2021-10-12T09:42:50 | 413,019,888 | 1 | 0 | null | 2021-11-09T02:05:16 | 2021-10-03T08:30:08 |
Java
|
UTF-8
|
Java
| false | false | 657 |
java
|
package c0321g1_pawnshop_backend.service.contract;
import c0321g1_pawnshop_backend.entity.contract.Contract;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
public interface ContractService {
// creator: vinhdn. Get list contract
Page<Contract> getListContract(Pageable pageable);
// creator: vinhdn. search contract
Page<Contract> searchContract(Pageable pageable, String contractCode,
String customerName, String productName, String startDate);
// creator: vinhdn. payment contract
void paymentContract(int totalMoney,Long contractId);
}
|
[
"[email protected]"
] | |
355196e5543957cdeebe5efe95a9f923b119936b
|
ba6d3c164873be5e61879f034d720d6df22dc606
|
/GraphDrawingTheory/src/graph/properties/GraphProperties.java
|
0b02339953aa422ce99b22c1451276363f8498d1
|
[
"MIT"
] |
permissive
|
florian74/GraphLayout
|
775c41dee6a96398545e428d93458a36a15c1f27
|
9c2583ff5d3904f1347f705a0e87c216a765d9c7
|
refs/heads/master
| 2022-09-06T18:13:51.027278 | 2020-02-20T10:29:35 | 2020-02-20T10:29:35 | 241,850,619 | 0 | 0 |
MIT
| 2022-07-06T20:07:32 | 2020-02-20T10:03:11 |
Java
|
UTF-8
|
Java
| false | false | 7,484 |
java
|
package graph.properties;
import java.util.ArrayList;
import java.util.List;
import Jama.EigenvalueDecomposition;
import Jama.Matrix;
import graph.algorithm.cycles.JohnsonSimpleCycles;
import graph.elements.Edge;
import graph.elements.Graph;
import graph.elements.Vertex;
import graph.properties.splitting.BiconnectedSplitting;
import graph.traversal.DFSTreeTraversal;
import graph.traversal.DijkstraAlgorithm;
import graph.trees.dfs.DFSTree;
/**
* A class containing methods for checking various properties
* of the given graph
* @author Renata
* @param <V> The vertex type
* @param <E> The edge type
*/
public class GraphProperties<V extends Vertex,E extends Edge<V>>{
/**
* Graph which is being analyzed
*/
private Graph<V,E> graph;
public GraphProperties(Graph<V,E> graph){
this.graph = graph;
}
/**
* Checks is graph is connected
* @return {@code true} if the graph is connected {@code false} otherwise
*/
public boolean isConnected(){
int size = graph.getVertices().size();
Boolean[] visited = new Boolean[size];
dfs(graph, graph.getVertices().get(0), 0, visited, new Integer[size], new Integer[size],
new Integer[size], new Integer[size], new Boolean[size]);
for (Boolean v : visited)
if (v == null)
return false;
return true;
}
/**
* Finds all cut vertices of a graph
* @return A list containing all cut vertices
*/
public List<V> getCutVertices(){
List<V> ret = new ArrayList<V>();
int size = graph.getVertices().size();
Boolean[] visited = new Boolean[size];
Integer[] depth = new Integer[size];
Integer[] low = new Integer[size];
Integer[] parent = new Integer[size];
Integer[] childCount = new Integer[size];
Boolean[] isArticulation = new Boolean[size];
dfs(graph, graph.getVertices().get(0), 0, visited, depth, low, parent, childCount, isArticulation);
for (int i = 0; i < size; i++)
if ((parent[i] != null && isArticulation[i]) || (parent[i] == null && childCount[i] > 1))
ret.add(graph.getVertices().get(i));
return ret;
}
/**
* Checks if the graph is biconnected
* @return {@code true} if graph is biconnected, @{code false} otherwise
*/
public boolean isBiconnected(){
return getCutVertices().size() == 0;
}
private void dfs(Graph<V,E> graph, V current, int d,
Boolean[] visited, Integer[] depth, Integer[] low, Integer[] parent,
Integer[] childCount, Boolean[] isArticulation){
int i = graph.getVertices().indexOf(current);
visited[i] = true;
depth[i] = d;
low[i] = d;
childCount[i] = 0;
isArticulation[i] = false;
for (V adjacent : graph.adjacentVertices(current)){
int ni = graph.getVertices().indexOf(adjacent);
if (visited[ni] == null){
parent[ni] = i;
dfs(graph, adjacent, d + 1, visited, depth, low, parent, childCount, isArticulation);
childCount[i] ++;
if (low[ni] >= depth[i])
isArticulation[i] = true;
low[i] = Math.min(low[i], low[ni]);
}
else if (parent[i] == null || ni != parent[i])
low[i] = Math.min(low[i], depth[ni]);
}
}
/**
* Finds the graph's eigen values
* @return A list of the graph's eigen values
*/
public List<Double> getEigenValues(){
int[][] adjacencyMatrix = graph.adjacencyMatrix();
double[][] values = new double[graph.getVertices().size()][graph.getVertices().size()];
for (int i = 0; i <adjacencyMatrix.length; i++)
for (int j = 0; j <adjacencyMatrix.length; j++)
values[i][j] = (double)adjacencyMatrix[i][j];
Matrix m = new Matrix(values);
EigenvalueDecomposition decomposition= m.eig();
List<Double> ret = new ArrayList<Double>();
for (Double d : decomposition.getRealEigenvalues())
ret.add(d);
return ret;
}
/**
* Checks is graph is connected
* @param excluding A list of vertices such that the graph should stay connected even if they are removed
* @return {@code true} if graph is connected, {@code false} otherwise
*/
public boolean isConnected(List<V> excluding){
DijkstraAlgorithm<V, E> dijkstra = new DijkstraAlgorithm<V,E>(graph);
for (V v1 : graph.getVertices()){
if (excluding.contains(v1))
continue;
for (V v2 : graph.getVertices()){
if (v1 == v2)
continue;
if (excluding.contains(v2))
continue;
if (dijkstra.getPath(v1, v2, excluding) == null)
return false;
}
}
return true;
}
/**
* Checks if the graph is cyclic
* @return {@code true} if graph is cyclic, @{code false} otherwise
*/
public boolean isCyclic(){
//if graph is not directed
//form a dfs tree and check if it has back edges
if (!graph.isDirected()){
DFSTreeTraversal<V, E> traversal = new DFSTreeTraversal<V,E>(graph);
DFSTree<V, E> tree = traversal.formDFSTree(graph.getVertices().get(0));
return tree.getBackEdges().size() > 0;
}
//if graph is directed
//a more sophisticated algorithm is needed
//using johnson's
else{
JohnsonSimpleCycles<V,E> johnsonCycles = new JohnsonSimpleCycles<V,E>(graph, true);
return johnsonCycles.findSimpleCycles().size() > 0;
}
}
/**
* Checks if the graph is a tree
* @return {@code true} if graph is a tree, @{code false} otherwise
*/
public boolean isTree(){
return !isCyclic() && isConnected();
}
/**
* Lists all tree leaves (presumes that the graph is a tree)
* @param root The tree's root
* @return List of leaves
*/
public List<V> treeLeaves(V root){
List<V> ret = new ArrayList<V>();
for (V v : graph.getVertices()){
if (v != root && graph.getAdjacentLists().get(v).size() == 1)
ret.add(v);
}
return ret;
}
/**
* Finds all multiedges in a graph
* @return A list containing list of edges between two vertices (in case when there is more
* than one edge between them)
*/
public List<List<E>> listMultiEdges(){
List<List<E>> ret = new ArrayList<List<E>>();
for (int i = 0; i < graph.getVertices().size(); i++)
for (int j = i; j < graph.getVertices().size(); j++){
List<E> edgesBetween = graph.edgeesBetween(graph.getVertices().get(i), graph.getVertices().get(j));
if (edgesBetween.size() > 1)
ret.add(edgesBetween);
}
return ret;
}
/**
* Finds all biconnected components of a graph
* @return A list of grap's biconnected components
*/
public List<Graph<V, E>> listBiconnectedComponents(){
BiconnectedSplitting<V,E> biconnected = new BiconnectedSplitting<V,E>(graph);
return biconnected.findBiconnectedComponents();
}
/**
* Checks if the graph is a ring
* @return {@code true} if graph is a ring, @{code false} otherwise
*/
public boolean isRing(){
//a graph is a ring if it is basically one cycle
//rings have as many vertices as edges
if (graph.getVertices().size() != graph.getEdges().size())
return false;
List<E> traversedEdges = new ArrayList<E>();
List<V> traversedVertices = new ArrayList<V>();
E currentEdge = graph.getEdges().get(0);
while (traversedEdges.size() < graph.getEdges().size()){
V next = currentEdge.getDestination();
if (traversedVertices.contains(next))
next = currentEdge.getOrigin();
traversedVertices.add(next);
traversedEdges.add(currentEdge);
List<E> adjacent = graph.adjacentEdges(next);
if (adjacent.size() != 2)
return false;
if (adjacent.get(0) == currentEdge)
currentEdge = adjacent.get(1);
else
currentEdge = adjacent.get(0);
}
if (traversedVertices.size() == graph.getVertices().size())
return true;
return false;
}
}
|
[
"[email protected]"
] | |
d1687064fab669480f202e5271cff0506e18feba
|
7e17bb61fd0416adf57d2d84e8fe822205e10e38
|
/Homework_Final/MyDiary-master/app/src/main/java/com/kiminonawa/mydiary/entries/calendar/DiaryDecorator.java
|
ea64fa62f7953dc3648783d2540d0b44f3afb859
|
[] |
no_license
|
CHR-design/2018118127_Android
|
20f9f2a8744dadf2e5d047c43b6ea48f7aa0617a
|
0949c78e70b4c94799ac185bdb3b3b3d3be2ba7c
|
refs/heads/master
| 2023-02-12T11:32:45.427949 | 2021-01-01T02:43:17 | 2021-01-01T02:43:17 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 887 |
java
|
package com.kiminonawa.mydiary.entries.calendar;
import com.prolificinteractive.materialcalendarview.CalendarDay;
import com.prolificinteractive.materialcalendarview.DayViewDecorator;
import com.prolificinteractive.materialcalendarview.DayViewFacade;
import com.prolificinteractive.materialcalendarview.spans.DotSpan;
import java.util.Collection;
import java.util.HashSet;
/**
* Decorate several days with a dot
*/
public class DiaryDecorator implements DayViewDecorator {
private int color;
private HashSet<CalendarDay> dates;
public DiaryDecorator(int color, Collection<CalendarDay> dates) {
this.dates = new HashSet<>(dates);
}
@Override
public boolean shouldDecorate(CalendarDay day) {
return dates.contains(day);
}
@Override
public void decorate(DayViewFacade view) {
view.addSpan(new DotSpan(5, color));
}
}
|
[
"[email protected]"
] | |
f4746cc2134f8af59871b8ab846d78d14b7a18b0
|
aee2e4f044494f1e479d26c1e3b51885cf8baf50
|
/OOP/basic-app/src/com/techlabs/basics/TestArguments.java
|
9658a600b561d9cd2b33cc52fc2e24ae407fedd4
|
[] |
no_license
|
akashvijendrajaiswal/SwabhavRepo
|
00794fe71f2647e28e20cc6bc6e6a97a5037d9f8
|
25522219ab6d53a1b1f11a398510a4cb7c9992c0
|
refs/heads/master
| 2020-05-05T10:04:23.581233 | 2019-04-07T11:42:44 | 2019-04-07T11:42:44 | 179,929,188 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 312 |
java
|
package com.techlabs.basics;
public class TestArguments {
public static void main(String[] args) {
int length;
length = args.length;
System.out.println(args.length);
if(length>0)
{
String s = args[0];
System.out.println("hello "+s);
}
else
{
System.out.println("thanks");
}
}
}
|
[
"[email protected]"
] | |
ec0b68ef04fe6f79862f63ec8af41baec467de22
|
f76ad9672a6a93b81ac4a259be202a00b7d21a7e
|
/CustomActionWebView-master/CustomActionWebView-master/library/src/main/java/com/shuyu/action/web/CustomActionWebView.java
|
2cd76073cf84bb22b3b9434d55776dc1e37268ec
|
[
"MIT"
] |
permissive
|
luanxuah/CustomActionWebView
|
f720b69434e1fef075e4901e70b13d450f8fe4cc
|
dcd9ad2516606ff96e8f36ec8ca8e92607e92d36
|
refs/heads/master
| 2021-05-05T23:17:04.411162 | 2018-01-07T07:29:38 | 2018-01-07T07:29:38 | 116,546,042 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,631 |
java
|
package com.shuyu.action.web;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import java.util.ArrayList;
import java.util.List;
/**
* @author: luanxu
* @createTime: 2018/1/7 15:19
* @description:
* @changed by:
*/
public class CustomActionWebView extends WebView {
ActionMode mActionMode;
List<String> mActionList = new ArrayList<>();
ActionSelectListener mActionSelectListener;
public CustomActionWebView(Context context) {
super(context);
}
public CustomActionWebView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomActionWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
/**
* 处理item,处理点击
* @param actionMode
*/
private ActionMode resolveActionMode(ActionMode actionMode) {
if (actionMode != null) {
final Menu menu = actionMode.getMenu();
mActionMode = actionMode;
menu.clear();
for (int i = 0; i < mActionList.size(); i++) {
menu.add(mActionList.get(i));
}
for (int i = 0; i < menu.size(); i++) {
MenuItem menuItem = menu.getItem(i);
menuItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
getSelectedData((String) item.getTitle());
releaseAction();
return true;
}
});
}
}
mActionMode = actionMode;
return actionMode;
}
@Override
public ActionMode startActionMode(ActionMode.Callback callback) {
ActionMode actionMode = super.startActionMode(callback);
return resolveActionMode(actionMode);
}
@Override
public ActionMode startActionMode(ActionMode.Callback callback, int type) {
ActionMode actionMode = super.startActionMode(callback, type);
return resolveActionMode(actionMode);
}
private void releaseAction() {
if (mActionMode != null) {
mActionMode.finish();
mActionMode = null;
}
}
/**
* 点击的时候,获取网页中选择的文本,回掉到原生中的js接口
* @param title 传入点击的item文本,一起通过js返回给原生接口
*/
private void getSelectedData(String title) {
String js = "(function getSelectedText() {" +
"var txt;" +
"var title = \"" + title + "\";" +
"if (window.getSelection) {" +
"txt = window.getSelection().toString();" +
"} else if (window.document.getSelection) {" +
"txt = window.document.getSelection().toString();" +
"} else if (window.document.selection) {" +
"txt = window.document.selection.createRange().text;" +
"}" +
"JSInterface.callback(txt,title);" +
"})()";
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
evaluateJavascript("javascript:" + js, null);
} else {
loadUrl("javascript:" + js);
}
}
public void linkJSInterface() {
addJavascriptInterface(new ActionSelectInterface(this), "JSInterface");
}
/**
* 设置弹出action列表
* @param actionList
*/
public void setActionList(List<String> actionList) {
mActionList = actionList;
}
/**
* 设置点击回掉
* @param actionSelectListener
*/
public void setActionSelectListener(ActionSelectListener actionSelectListener) {
this.mActionSelectListener = actionSelectListener;
}
/**
* 隐藏消失Action
*/
public void dismissAction() {
releaseAction();
}
/**
* js选中的回掉接口
*/
private class ActionSelectInterface {
CustomActionWebView mContext;
ActionSelectInterface(CustomActionWebView c) {
mContext = c;
}
@JavascriptInterface
public void callback(final String value, final String title) {
if(mActionSelectListener != null) {
mActionSelectListener.onClick(title, value);
}
}
}
}
|
[
"[email protected]"
] | |
568facde26bb55975a4a197860f5874d4596e4d3
|
2adc86019b527b663cebdbd44e15a06555fcefb2
|
/src/test/java/io/github/microserviceapipatterns/protobufgen/model/AnyTypeTest.java
|
558e1dacc8e7dab75d65d01066ad5b7e4d516bb3
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
Microservice-API-Patterns/protobufgen
|
8af8e6e2347680a58f0968b61c9a0b9baa29d17e
|
3c9dd9186ba93ddc9a58d5c7be7d0639bff3e07a
|
refs/heads/master
| 2022-11-30T05:40:04.627572 | 2020-08-17T08:08:03 | 2020-08-17T08:08:03 | 286,768,150 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,712 |
java
|
/*
* Copyright 2020 Stefan Kapferer
*
* 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 io.github.microserviceapipatterns.protobufgen.model;
import org.junit.jupiter.api.Test;
import java.util.HashSet;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class AnyTypeTest {
@Test
public void canCreateAnyType() {
// given
AnyType any;
// when
any = new AnyType();
// then
assertEquals("google.protobuf.Any", any.getName());
assertEquals("google.protobuf.Any", any.toString());
}
@Test
public void ensureAllAnyTypeInstancesAreEqual() {
// given
AnyType any1 = new AnyType();
AnyType any2 = new AnyType();
// when
boolean equal = any1.equals(any2);
// then
assertTrue(equal);
}
@Test
public void canCalculateHashCode() {
// given
Set<FieldType> typeSet = new HashSet<>();
// when
typeSet.add(new AnyType());
typeSet.add(new AnyType());
// then
assertEquals(1, typeSet.size());
}
}
|
[
"[email protected]"
] | |
7e43c19b3c7911bdf8f228bb7339f367600a64d1
|
0f887bc316d8c665899258406b67f6e25838f9cf
|
/CutTheTree.java
|
11ddd34213dbb354d8842758f094f53e6ee5b361
|
[] |
no_license
|
bawejakunal/hackerrank
|
f38489be488f76e782b7f8e8c5fdc2ba1a024c30
|
999008a19c3196c9706a9165923f5683ea887127
|
refs/heads/master
| 2021-01-12T04:31:50.984640 | 2017-09-08T02:28:44 | 2017-09-08T02:28:44 | 77,662,863 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,923 |
java
|
// https://www.hackerrank.com/challenges/cut-the-tree/
import java.io.*;
import java.util.*;
public class Solution {
// sum of subtree rooted at root
static int subTreeSum(int n, int data[],
ArrayList<ArrayList<Integer>>edges, int root,
int[]subSum, int visited[])
{
if (visited[root] == 1)
return 0;
visited[root] = 1; // mark visited
int sum = data[root];
for (Integer node: edges.get(root))
sum += subTreeSum(n, data, edges, node.intValue(), subSum, visited);
subSum[root] = sum;
return subSum[root];
}
// sum of subtrees rooted at all nodes
static int[] subTreeSum(int n, int data[], ArrayList<ArrayList<Integer>>edges) {
int subSum[] = new int[n];
int visited[] = new int[n];
subTreeSum(n, data, edges, 0, subSum, visited);
return subSum;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int data[] = new int[n];
ArrayList<ArrayList<Integer>>edges = new ArrayList<ArrayList<Integer>>(n);
for (int i = 0; i < n; i++) {
data[i] = in.nextInt();
edges.add(new ArrayList<Integer>());
}
for (int i = 0; i < n-1; i++) {
int a = in.nextInt();
int b = in.nextInt();
edges.get(a-1).add(b-1);
edges.get(b-1).add(a-1);
}
in.close();
int[] subSum = subTreeSum(n, data, edges);
int total = subSum[0]; // total sum of the tree
int minDiff = Integer.MAX_VALUE;
for (int i = 1; i < n; i++) {
int diff = Math.abs(total - 2*subSum[i]); // abs diff of two subtrees
minDiff = Math.min(minDiff, diff);
}
System.out.println(minDiff);
}
}
|
[
"[email protected]"
] | |
084f903cf375605c76019d259e82bfdce2871508
|
3e4eb67471664eab4cbcd6b5e9983a3b5fe7e500
|
/Server/BTServer/src/com/order/student/dao/BookDAO.java
|
ab882da909a7b321554973506b8b6fbcd7c2ca7f
|
[] |
no_license
|
dengyonghao/BeautifulTime
|
c8ff444f13012d3163da8941ebbe37d4deb5e331
|
f2efad727a4ce6b497293fe6d739340cb2eaa185
|
refs/heads/master
| 2021-01-21T11:39:36.831144 | 2016-05-20T15:41:31 | 2016-05-20T15:41:31 | 44,313,540 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 275 |
java
|
package com.order.student.dao;
import java.util.List;
import com.order.student.model.Books;
public interface BookDAO {
public List<Books> findAllBooks();
public List<Books> findAllBooks(int pageNumber, int pageSize);
public Books findById(String book_id);
}
|
[
"[email protected]"
] | |
016fc4576f290fe02efd95bbf64569f55a8b1976
|
a0ce66def550194254370d577cd0abc531901c42
|
/app/src/main/java/com/project/yash/DailyRoutineSet.java
|
f64aac23d94fd8dd033ebadc5db057bd6076eaa0
|
[] |
no_license
|
Yash-K-B/Routine
|
131055404c9dae72430f0b89695372e557d2b13a
|
e884c71a9cf91204341c77f36f20a053efa81765
|
refs/heads/master
| 2021-07-09T05:51:34.838034 | 2020-10-09T07:28:44 | 2020-10-09T07:28:44 | 198,834,145 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 441 |
java
|
package com.project.yash;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class DailyRoutineSet extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.i("data_service","In the DailyRoutine Updater");
context.startService(new Intent(context, VibrationEnablerService.class));
}
}
|
[
"[email protected]"
] | |
d8fd37d6cef916d0f487289a62477a7fa72b3dad
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/14/14_648e348602520be80fd547bb341b054a291229e6/MessageBundleTest/14_648e348602520be80fd547bb341b054a291229e6_MessageBundleTest_t.java
|
bcc1a3829e91c844d5bfc3d8bd96a59f84ac809d
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null |
UTF-8
|
Java
| false | false | 7,781 |
java
|
/*
Derby - Class org.apache.derbyTesting.functionTests.tests.i18n.MessageBundleTest
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.apache.derbyTesting.functionTests.tests.i18n;
import org.apache.derbyTesting.junit.BaseTestCase;
import org.apache.derby.shared.common.reference.SQLState;
import org.apache.derby.shared.common.reference.MessageId;
import java.util.HashSet;
import java.lang.reflect.Field;
import java.util.ResourceBundle;
import java.util.Locale;
import java.util.Iterator;
/**
* This class does everything we can to validate that the messages_en.properties
* file is in synch with SQLState.java and MessageId.java. We want to make sure
* that message ids defined in SQLState and MessageId have matching messages
* in the messages properties file, and also find out if there are any messages
* that don't have matching ids in the SQLState and MessageId files. The
* first is a bug, the second is something to be aware of.
*/
public class MessageBundleTest extends BaseTestCase {
public MessageBundleTest(String name) {
super(name);
}
// The list of ids. We use a HashSet so we can detect duplicates easily
static HashSet sqlStateIds = new HashSet();
static HashSet messageIdIds = new HashSet();
static HashSet messageBundleIds = new HashSet();
static {
try {
// Load all the ids for the SQLState class
loadClassIds(SQLState.class, sqlStateIds);
// Load all the ids for the MessageId class
loadClassIds(MessageId.class, messageIdIds);
// Load all the ids for the messages_en properties file
loadMessageBundleIds();
} catch ( Exception e ) {
e.printStackTrace();
throw new RuntimeException(e.getMessage());
}
}
static void loadClassIds(Class idclass, HashSet set) throws Exception {
Field[] fields = idclass.getFields();
int length = fields.length;
for ( int i = 0; i < length ; i++ )
{
String id = (String)fields[i].get(null);
if ( id.length() == 2 ) {
// Skip past identifiers that are just categories
continue;
}
// Skip past "special" SQL States that are not expected
// to have messages
if ( id.equals("close.C.1") ) continue;
if ( id.equals("rwupd" ) ) continue;
if ( id.equals("02502" ) ) continue;
if ( id.equals("XSAX0") ) continue;
if ( ! set.add(id) )
{
System.err.println("ERROR: The id " + id +
" was found twice in " + idclass.getName());
}
}
}
/**
* Load all the message ids from messages_en.properties into a HashSet.
* This assumes its available on the classpath
*/
static void loadMessageBundleIds() throws Exception {
ResourceBundle bundle;
// The messages_*.properties files are split into fifty separate
// message bundle files. We need to load each one in turn
int numBundles = 50;
for ( int i=0 ; i < numBundles ; i++ ) {
loadMessageBundle(i);
}
}
static void loadMessageBundle(int index) {
String bundleName = "org.apache.derby.loc.m" + index;
ResourceBundle bundle =
ResourceBundle.getBundle(bundleName, Locale.ENGLISH);
java.util.Enumeration keys = bundle.getKeys();
while ( keys.hasMoreElements() ) {
String key = (String)keys.nextElement();
if ( ! messageBundleIds.add(key) ) {
System.err.println("ERROR: the key " + key +
" exists twice in messages_en.properties");
}
}
}
/**
* See if there are any message ids in SQLState.java that are
* not in the message bundle
*/
public void testSQLStateOrphanedIds() throws Exception {
Iterator it = sqlStateIds.iterator();
while ( it.hasNext() ) {
String sqlStateId = (String)it.next();
if ( ! messageBundleIds.contains(sqlStateId) ) {
// there are some error messages that do not need to be in
// messages.xml:
// XCL32: will never be exposed to users (see DERBY-1414)
// XSAX1: shared SQLState explains; not exposed to users.
//
if (!(sqlStateId.equalsIgnoreCase("XCL32.S") ||
sqlStateId.equalsIgnoreCase("XSAX1")))
// Don't fail out on the first one, we want to catch
// all of them. Just note there was a failure and continue
System.err.println("ERROR: Message id " + sqlStateId +
" in SQLState.java was not found in" +
" messages_en.properties");
}
}
}
/**
* See if there are any message ids in MessageId.java not in
* the message bundle
*/
public void testMessageIdOrphanedIds() throws Exception {
Iterator it = messageIdIds.iterator();
while ( it.hasNext() ) {
String sqlStateId = (String)it.next();
if ( ! messageBundleIds.contains(sqlStateId) ) {
// Don't fail out on the first one, we want to catch
// all of them. Just note there was a failure and continue
System.err.println("ERROR: Message id " + sqlStateId +
" in MessageId.java was not found in" +
" messages_en.properties");
}
}
}
/**
* See if there are any message ids in the message bundle that
* are <b>not</b> in SQLState.java or MessageId.java
*/
public void testMessageBundleOrphanedMessages() throws Exception {
Iterator it = messageBundleIds.iterator();
while (it.hasNext() ) {
String msgid = (String)it.next();
if ( sqlStateIds.contains(msgid)) {
continue;
}
if ( messageIdIds.contains(msgid)) {
continue;
}
// Don't fail out on the first one, we want to catch
// all of them. Just note there was a failure and continue
System.err.println("WARNING: Message id " + msgid +
" in messages_en.properties is not " +
"referenced in either SQLState.java or MessageId.java");
}
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.