blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
10e21d16b7ef069fa3e3a0ce47c0145d0f36e41f
62d78f842fcbab7002877dd6f59ee67859177bd2
/app/src/main/java/com/teamcreative/totassignment/util/ItemDecorationUtil.java
2e70c4f5e988329e1b126c88fe23159b453d9f08
[]
no_license
NerdFaisal404/TotAssignmentFinal
b92b6ca50c41cda21bccb4d53ad0cc1ba73d757d
f485c1429bc3da50286d7d1d484043c978ee6860
refs/heads/master
2020-03-12T06:29:48.455572
2018-04-21T15:25:32
2018-04-21T15:25:32
130,486,458
0
0
null
null
null
null
UTF-8
Java
false
false
793
java
package com.teamcreative.totassignment.util; import android.graphics.Rect; import android.support.v7.widget.RecyclerView; import android.view.View; public class ItemDecorationUtil extends RecyclerView.ItemDecoration { private int mHalfSpace; public ItemDecorationUtil(int space) { this.mHalfSpace = space / 2; } @Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { if (parent.getPaddingLeft() != mHalfSpace) { parent.setPadding(mHalfSpace, mHalfSpace, mHalfSpace, mHalfSpace); parent.setClipToPadding(false); } outRect.top = mHalfSpace; outRect.right = mHalfSpace; outRect.bottom = mHalfSpace; outRect.left = mHalfSpace; } }
[ "faisal.ahmedbcse@gmail.com" ]
faisal.ahmedbcse@gmail.com
1223d27b7a7c0328546fc95f6a2dc72b6dd756f9
cafd3eabfb5eb2c3472cb51116430f934057513b
/src/main/java/com/dada/inject/service/UserServiceImpl.java
a5c075f4143110a81e9dede1e5c006790efcfc7a
[]
no_license
pisory/spring-content-test
88bfa7b423363f8ba992a3cdda4cba94d3660414
82cfb70da70115656a8b2dfef2cedd3ae84490f6
refs/heads/master
2022-12-23T11:32:56.437452
2019-12-07T04:01:17
2019-12-07T04:01:17
210,639,806
0
0
null
2022-12-16T09:43:07
2019-09-24T15:43:27
Java
UTF-8
Java
false
false
546
java
package com.dada.inject.service; import com.dada.inject.dao.UserDao; /** * @author zhoudahua * @date 2019/6/26 * @description */ public class UserServiceImpl implements UserService { UserDao dao; @Override public void find() { System.out.println("service"); dao.query(); } /** * 使用setter注入:方法名称叫setXxx:必须和ref的名称一致,开头字幕大写<property ref="dao"></property> * @param dao */ public void setDao(UserDao dao) { this.dao = dao; } }
[ "32595419+plzla@users.noreply.github.com" ]
32595419+plzla@users.noreply.github.com
9dd5bf6b5856507fb02d12e80c307f8da425af04
c3dfa715d75662be130ff601bb3ff256f8020f57
/src/media/Principal.java
b5e2636c8cadd85fc4cec3cd7dd8bfae83e1365d
[]
no_license
caiomoMack/LP2
c7fc386dbbd04a18c7958b44ae3dc745fdbbb919
52dcec0feb80e25d786614d537288f7f5caabee7
refs/heads/master
2021-01-19T08:15:53.520710
2012-04-24T20:09:08
2012-04-24T20:09:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
175
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package media; /** * * @author hkom */ public class Principal { }
[ "hkom@hkom-PC" ]
hkom@hkom-PC
818a28743ceb16970644c1e821fba804375f088f
69a4e0b4990504fa4c3a468be0e84f0f33a6ec2e
/zagar_server/src/main/java/messageSystem/messages/ReplicateMsg.java
1d04dc59358eff0083b4203b0541d5cbd262e5bd
[]
no_license
lockyStar/Zagar
96da6dcbd0d57ac9f633faace92263cb6719c537
51d6434bb12555b69751909092e6ae8753911f88
refs/heads/master
2020-06-19T19:57:30.936269
2016-11-28T19:25:13
2016-11-28T19:25:13
74,843,533
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package messageSystem.messages; import main.ApplicationContext; import messageSystem.Abonent; import messageSystem.Address; import messageSystem.Message; import messageSystem.MessageSystem; import network.ClientConnectionServer; import replication.Replicator; import java.io.IOException; /** * Created by alpie on 15.11.2016. */ public class ReplicateMsg extends Message { public ReplicateMsg(Address from) { super(from, ApplicationContext.instance().get(MessageSystem.class).getService(ClientConnectionServer.class).getAddress()); } @Override public void exec(Abonent abonent) { try { ApplicationContext.instance().get(Replicator.class).replicate(); } catch (IOException e) { e.printStackTrace(); } } }
[ "Zhabrevalexander@yandex.ru" ]
Zhabrevalexander@yandex.ru
8490d0e3917ffc4fe620806f518f6db55c712291
8457e0c27d238b33cde5ba1b6069991aedea8e30
/CoreJava/src/com/myapp/oops/Test.java
df13956948d04d62493f23fb069ea04a84abdb63
[]
no_license
raghunandancm/java-microservices-kafka
3f4669fea4d605d26a9f5566fd51bea4e6536727
acc692644ee04f661498dc2e5fda9e2e65dc823c
refs/heads/master
2023-04-02T00:45:49.727012
2021-04-01T04:44:55
2021-04-01T04:44:55
353,579,932
0
0
null
null
null
null
UTF-8
Java
false
false
214
java
package com.myapp.oops; //import java.util.*; /* * * */ public class Test { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("Hello"); } }
[ "pradeeepmurthy@gmail.com" ]
pradeeepmurthy@gmail.com
58afbdf1fe6bbdd33f1036a5b376c69d5b7c3d8c
70c975e7ecb7db38a629a3d56d355e04a0ce277a
/src/main/java/co/com/choucair/certification/retotecnico/userinterface/DatosPasoTres.java
b4dfcecea0978299ee9c58ab1496c305b9fd5339
[]
no_license
Pedrocr11/Retotecnico
b7350307bcfd327a898f828b1bdcdef10cff2148
ddd48e8f7684f88f14ee2cb2075f362ca4dca4d6
refs/heads/master
2023-04-15T18:24:02.428125
2021-04-20T04:54:48
2021-04-20T04:54:48
358,445,093
0
0
null
null
null
null
UTF-8
Java
false
false
2,581
java
package co.com.choucair.certification.retotecnico.userinterface; import net.serenitybdd.screenplay.targets.Target; import org.openqa.selenium.By; public class DatosPasoTres { public static final Target CLICK_YOUR_COMPUTER = Target.the("click en la opcion your computer") .located(By.xpath("//*[@id=\"web-device\"]/div[1]/div[2]/div/div[1]/span/span[2]")); public static final Target INPUT_COMPUTER = Target.the("selecciona el tipo de computadora") .located(By.xpath("//*[@id=\"web-device\"]/div[1]/div[2]/div/input[1]")); public static final Target VERSION = Target.the("click en la opcion version") .located(By.xpath("//*[@id=\"web-device\"]/div[2]/div[2]/div/div[1]/span/span[1]")); public static final Target INPUT_VERSION = Target.the("selecciona la version") .located(By.xpath("//*[@id=\"web-device\"]/div[2]/div[2]/div/input[1]")); public static final Target CLICK_LANGUAGE = Target.the("click en la opcion seleccionar lenguaje") .located(By.xpath("//*[@id=\"web-device\"]/div[3]/div[2]/div/div[1]/span/span[1]")); public static final Target INPUT_LANGUAGE = Target.the("selecciona el lenguaje") .located(By.xpath("//*[@id=\"web-device\"]/div[3]/div[2]/div/input[1]")); public static final Target CLICK_DISP = Target.the("click en la opcion seleccionar dispositivo") .located(By.xpath("//*[@id=\"mobile-device\"]/div[1]/div[2]/div/div[1]/span/i")); public static final Target INPUT_DISP = Target.the("selecciona el dispositivo") .located(By.xpath("//*[@id=\"mobile-device\"]/div[1]/div[2]/div/input[1]")); public static final Target CLICK_MODEL = Target.the("click en la opcion seleccionar model") .located(By.xpath("//*[@id=\"mobile-device\"]/div[2]/div[2]/div/div[1]/span")); public static final Target INPUT_MODEL = Target.the("selecciona el modelo") .located(By.xpath("//*[@id=\"mobile-device\"]/div[2]/div[2]/div/input[1]")); public static final Target CLICK_SYSTEM = Target.the("click en la opcion seleccionar sistema operativo") .located(By.xpath("//*[@id=\"mobile-device\"]/div[3]/div[2]/div/div[1]/span")); public static final Target INPUT_SYSTEM = Target.the("selecciona el sistema operativo") .located(By.xpath("//*[@id=\"mobile-device\"]/div[3]/div[2]/div/input[1]")); public static final Target NEXT3 = Target.the("siguiente ventana de registro") .located(By.xpath("//*[@id=\"regs_container\"]/div/div[2]/div/div[2]/div/div[2]/div/a")); }
[ "pedroantoniocorei15@gmail.com" ]
pedroantoniocorei15@gmail.com
cd203343ed6fb1d8eb7cbf5824fb2e1c4388839d
c0d41d3ee334e4e4c42b580bd6ace1f99ee54ed6
/app/src/main/java/com/lagel/com/mqttchat/ViewHolders/ViewHolderVideoMedia.java
387402ec4a60eec36298c3dd02db839395f203cb
[]
no_license
mahmoudSol/lagel
d522751ed17c5cce7582a0e8b6b2f484584b9647
76856e78d55832bb0c747dd852f4e01e4d8c6e20
refs/heads/master
2020-04-20T08:23:50.871154
2019-02-01T17:55:36
2019-02-01T17:55:36
168,737,516
0
0
null
null
null
null
UTF-8
Java
false
false
646
java
package com.lagel.com.mqttchat.ViewHolders; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.TextView; import com.lagel.com.R; import com.lagel.com.mqttchat.Utilities.AdjustableImageView; /** * View holder for media history video recycler view item */ public class ViewHolderVideoMedia extends RecyclerView.ViewHolder { public AdjustableImageView thumbnail; public TextView fnf; public ViewHolderVideoMedia(View view) { super(view); fnf = (TextView) view.findViewById(R.id.fnf); thumbnail = (AdjustableImageView) view.findViewById(R.id.vidshow); } }
[ "mahmoudsoliman49@gmail.com" ]
mahmoudsoliman49@gmail.com
699ce2033213304594ce999594dd64747c710e30
1b7cfbedc73190e92697d953b71015dbceadf96d
/app/src/main/java/texel/com/depoproject/Pages/SignActivities/SignIn.java
79f17b9daf99d3f45a59c4d30bebc71843bf0a02
[]
no_license
FeridAdashov/Depo-Project
e2623d2219dd472f4751c0f3f961f3cde574f996
8d05dca4c367b3fe5ca9142035228a8dbbc47487
refs/heads/main
2023-04-07T04:11:42.856040
2021-04-14T16:55:42
2021-04-14T16:55:42
357,975,073
0
0
null
null
null
null
UTF-8
Java
false
false
11,690
java
package texel.com.depoproject.Pages.SignActivities; import android.Manifest; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import org.apache.commons.net.ntp.NTPUDPClient; import org.apache.commons.net.ntp.TimeInfo; import java.net.InetAddress; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Timer; import java.util.TimerTask; import texel.com.depoproject.CustomDialogs.CustomHorizontalProgressBar; import texel.com.depoproject.HelperClasses.DatabaseFunctions; import texel.com.depoproject.HelperClasses.SharedClass; import texel.com.depoproject.Pages.AboutUs.AboutUsActivity; import texel.com.depoproject.Pages.BUYER.BuyerProfile; import texel.com.depoproject.Pages.DEPO.DepoProfile; import texel.com.depoproject.Pages.SELLER.SellerProfile; import texel.com.depoproject.R; public class SignIn extends AppCompatActivity implements View.OnClickListener { public static final String TIME_SERVER = "time-a.nist.gov"; public static String app_name; private final int TAG_WRITE_EXTERNAL_STORAGE = 1; private final int TAG_READ_EXTERNAL_STORAGE = 2; private final int PROJECT_VERSION = 2; private final SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm:SS"); private final Timer timer = new Timer(); private String rootName; private EditText editTextEmail; private EditText editTextPassword; private TextView textViewSignUp, buttonSignIn; private Button buttonAboutUs; private CustomHorizontalProgressBar progressBar; private FirebaseAuth firebaseAuth; private DatabaseReference databaseReference; private Activity activity; Thread thread = new Thread(new Runnable() { @Override public void run() { try { NTPUDPClient timeClient = new NTPUDPClient(); InetAddress inetAddress = InetAddress.getByName(TIME_SERVER); TimeInfo timeInfo = timeClient.getTime(inetAddress); long returnTime = timeInfo.getMessage().getTransmitTimeStamp().getTime(); //server time Date date_1 = formatter.parse(formatter.format(new Date(returnTime))); Date date_2 = formatter.parse(formatter.format(new Date())); differenceBetweenGlobalAndLocalClock(date_1, date_2); } catch (Exception e) { Log.d("AAAAA", e.toString()); runOnUiThread(new TimerTask() { @Override public void run() { changeProgressBarVisibility(false); Toast.makeText(activity, R.string.error_check_internet, Toast.LENGTH_SHORT).show(); activity.finish(); } }); } } }); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sign_in); activity = this; app_name = getString(R.string.app_name); buttonSignIn = findViewById(R.id.buttonSignIn); progressBar = findViewById(R.id.progress); changeProgressBarVisibility(true); // thread.start(); reLoadSeed(); } public void differenceBetweenGlobalAndLocalClock(final Date startDate, final Date endDate) { //seconds final long different = (endDate.getTime() - startDate.getTime()) / 1000; activity.runOnUiThread(new TimerTask() { @Override public void run() { if (Math.abs(different) > 60 * 60) { changeProgressBarVisibility(false); Toast.makeText(activity, "Telefonunuzda SAAT SƏHVDİR! Saat: " + formatter.format(startDate) + " olmalıdır!", Toast.LENGTH_LONG).show(); finish(); } else reLoadSeed(); } }); } private void loadDatabases() { if (firebaseAuth.getCurrentUser() != null) { changeProgressBarVisibility(true); rootName = firebaseAuth.getCurrentUser().getEmail().split("@")[0]; databaseReference = DatabaseFunctions.getDatabases(this).get(0); databaseReference.child("DatabaseInformation/version").addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { Integer version = dataSnapshot.getValue(Integer.class); if (version != null && version == PROJECT_VERSION) goToProfile(); else { changeProgressBarVisibility(false); firebaseAuth.signOut(); Toast.makeText(getBaseContext(), "Proqramı Güncəlləyin!", Toast.LENGTH_LONG).show(); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { changeProgressBarVisibility(false); } }); } else changeProgressBarVisibility(false); } private void reLoadSeed() { buttonSignIn.setOnClickListener(this); editTextEmail = findViewById(R.id.editTextEmail); editTextPassword = findViewById(R.id.editTextPassword); textViewSignUp = findViewById(R.id.textViewSignUp); textViewSignUp.setOnClickListener(this); buttonAboutUs = findViewById(R.id.buttonAboutUs); buttonAboutUs.setOnClickListener(this); firebaseAuth = FirebaseAuth.getInstance(); checkMyPermissions(); } private void checkMyPermissions() { int permissionWriteExternal = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE); int permissionReadExternal = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE); if (permissionWriteExternal != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, TAG_WRITE_EXTERNAL_STORAGE); return; } if (permissionReadExternal != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, TAG_READ_EXTERNAL_STORAGE); return; } loadDatabases(); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { switch (requestCode) { case TAG_WRITE_EXTERNAL_STORAGE: { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { changeProgressBarVisibility(true); checkMyPermissions(); } else { Toast.makeText(this, getString(R.string.write_permission_denied), Toast.LENGTH_SHORT).show(); finish(); } return; } case TAG_READ_EXTERNAL_STORAGE: { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { changeProgressBarVisibility(true); checkMyPermissions(); } else { Toast.makeText(this, getString(R.string.read_permission_denied), Toast.LENGTH_SHORT).show(); finish(); } } } } private void goToProfile() { databaseReference.child("USERS").addListenerForSingleValueEvent(new ValueEventListener() { @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN) @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { changeProgressBarVisibility(false); try { Class user; if (dataSnapshot.child("DEPO/" + rootName).exists()) user = DepoProfile.class; else if (dataSnapshot.child("SELLER/" + rootName).exists()) user = SellerProfile.class; else if (dataSnapshot.child("BUYER/" + rootName).exists()) user = BuyerProfile.class; else return; Intent intent = new Intent(getBaseContext(), user); intent.putExtra("profile_name", user); finish(); startActivity(intent); } catch (Exception e) { changeProgressBarVisibility(false); firebaseAuth.signOut(); Toast.makeText(getBaseContext(), R.string.maybe_profile_data_wrong, Toast.LENGTH_SHORT).show(); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { changeProgressBarVisibility(false); Toast.makeText(getBaseContext(), R.string.error_check_internet, Toast.LENGTH_SHORT).show(); } }); } private void userLogIn() { String email = editTextEmail.getText().toString().trim(); String password = editTextPassword.getText().toString().trim(); if (TextUtils.isEmpty(email)) { Toast.makeText(this, R.string.enter_email, Toast.LENGTH_SHORT).show(); return; } else email += "@mail.ru"; if (TextUtils.isEmpty(password)) { Toast.makeText(this, R.string.enter_password, Toast.LENGTH_SHORT).show(); return; } firebaseAuth = FirebaseAuth.getInstance(); changeProgressBarVisibility(true); firebaseAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(this, task -> { if (task.isSuccessful()) { loadDatabases(); } else { changeProgressBarVisibility(false); SharedClass.showSnackBar(activity, getString(R.string.incorrect_email)); } }).addOnFailureListener(Throwable::printStackTrace); } @Override public void onClick(View view) { if (view == buttonAboutUs) { startActivity(new Intent(this, AboutUsActivity.class)); } if (view == buttonSignIn) { userLogIn(); } if (view == textViewSignUp) { startActivity(new Intent(this, SignUp.class)); } } @Override protected void onDestroy() { super.onDestroy(); if (timer != null) timer.cancel(); } private void changeProgressBarVisibility(boolean b) { progressBar.setVisibility(b ? View.VISIBLE : View.GONE); buttonSignIn.setEnabled(!b); } }
[ "fadasov@mai.ru" ]
fadasov@mai.ru
ac6ff9328eb3b519607f20e0909c68faa163bba2
b35333ab26ad05e427dd34eb00e6b146d27aabd4
/src/main/java/com/example/demo/student/StudentConfig.java
ffdd700f0e608f750a928cc761a5177105a05213
[]
no_license
lsgomez93/java-spring-boot
525d2cfe480422dc8070339cb2ef706edff59335
0b2b602658786b5db5d00f9f6716e64b2229817b
refs/heads/main
2023-07-05T09:42:14.110808
2021-08-23T17:43:54
2021-08-23T17:43:54
399,178,727
0
0
null
2021-08-23T17:43:54
2021-08-23T16:43:32
null
UTF-8
Java
false
false
501
java
package com.example.demo.student; import org.springframework.boot.CommandLineRunner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class StudentConfig { @Bean CommandLineRunner commandLineRunner( StudentRepository repository){ return args->{ Student hello = new Student( "Hello" ); repository.save(hello); }; } }
[ "lsgomez@unimayor.edu.co" ]
lsgomez@unimayor.edu.co
53242590c21f3fa6f76db420313cd367d04ca359
85c49bcf9c881e14997e3e38972959ebaedd9265
/src/com/coding/practice/BullsCows.java
a10ba454b02b415409d24f76bcfe6100db2a14ff
[]
no_license
anujassal/CodingPractice
02215ade7e5bbf1b6a3c1531f4d000b51a6b4667
f067726834718641bba016c2cf5718a0b59e5205
refs/heads/master
2020-11-27T04:05:03.751169
2020-01-21T15:48:49
2020-01-21T15:48:49
229,297,736
0
0
null
null
null
null
UTF-8
Java
false
false
987
java
package com.coding.practice; import java.util.HashMap; import java.util.Map; /* * Input: secret = "1807", guess = "7810" Output: "1A3B" */ public class BullsCows { public static void main(String[] args){ String secret = "1123"; String guess = "0111"; System.out.println(getHint(secret,guess)); } private static String getHint(String secret,String guess){ if(secret==null||guess==null) return ""; if(secret!=null && guess!=null && secret.length()!=guess.length()) return ""; Map<String,Integer> count = new HashMap<>(); for(int i=0;i<secret.length();i++){ char s = secret.charAt(i); char g = guess.charAt(i); if(s==g) count.put("A", count.getOrDefault("A", 0)+1); else count.put("B", count.getOrDefault("B", 0)+1); } StringBuilder builder = new StringBuilder(); for(Map.Entry<String, Integer> entry:count.entrySet()){ builder.append(entry.getValue()); builder.append(entry.getKey()); } return builder.toString(); } }
[ "anudeepjassal@gmail.com" ]
anudeepjassal@gmail.com
482a57d36a60849ca6c7fe5ebbb35bbf806e6719
e8961003a724cf08cdf0ead9d45b53a14038fc2c
/app/src/main/java/classact/com/xprize/database/helper/LetterSequenceHelper.java
9a88733eb4cc2880c3e404ca3535330934f8d9c9
[]
no_license
classact/XPrize
5b7f60e3cfd5e7c610949ed391ab5121d4e3ece0
f7b8e3928dba59d581f78c40c290f2a6c05dbb67
refs/heads/master
2021-01-24T12:12:11.233937
2018-02-22T18:08:01
2018-02-22T18:08:01
58,711,608
1
0
null
2018-02-22T18:08:02
2016-05-13T07:18:11
Java
UTF-8
Java
false
false
3,002
java
package classact.com.xprize.database.helper; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteException; import java.util.ArrayList; import classact.com.xprize.database.model.LetterSequence; public class LetterSequenceHelper { public static ArrayList<LetterSequence> getLetterSequence(SQLiteDatabase db, int languageID, int unitId, int subId) { ArrayList<LetterSequence> letterSequences = new ArrayList<>(); String[] columns = new String[]{"_id", "LanguageID", "UnitID", "UnitSubID", "letterID"}; String OrderBy = "_id asc"; Cursor cursor = db.query("tbl_lettersequence", columns, "LanguageID=? AND UnitID=? AND UnitSubID=?", new String[]{String.valueOf(languageID), String.valueOf(unitId), String.valueOf(subId)}, null, null, OrderBy); LetterSequence sequence = new LetterSequence(); if (cursor.moveToFirst()) { do { sequence = new LetterSequence(); sequence.setLanguageID(cursor.getInt(0)); sequence.setSequenceID(cursor.getInt(1)); sequence.setUnitID(cursor.getInt(2)); sequence.setSubUnitID(cursor.getInt(3)); sequence.setLetterID(cursor.getInt(4)); letterSequences.add(sequence); } while (cursor.moveToNext()); } cursor.close(); return letterSequences; } public static int getLetterID (SQLiteDatabase db, int languageID, int unitId, int subId) throws SQLiteException { String[] columns = new String[]{"LetterID"}; String OrderBy = "_id asc"; Cursor cursor = db.query("tbl_LetterSequence", columns, "LanguageID=? AND UnitID=? AND UnitSubID=?", new String[]{String.valueOf(languageID), String.valueOf(unitId), String.valueOf(subId)}, null, null, OrderBy); int letterID = 0; try { if (cursor.getCount()>0) { cursor.moveToFirst(); letterID = cursor.getInt(cursor.getColumnIndex("LetterID")); } return letterID; }finally { cursor.close(); } } public static ArrayList getWrongLetters(SQLiteDatabase db, int languageID, int unitId, int limit){ ArrayList letters = new ArrayList(); Cursor cursor = db.rawQuery("SELECT LetterID FROM tbl_LetterSequence where LanguageID = "+languageID+" and UnitID <> " + unitId + " ORDER BY RANDOM() LIMIT " + limit +";", null); //LetterSequence letterSequence = new LetterSequence(); int letterSequence = 0; try { if (cursor.moveToFirst()) { do { //letterSequence = new LetterSequence(); letterSequence = cursor.getInt(0); letters.add(letterSequence); } while (cursor.moveToNext()); } return letters; }finally { cursor.close(); } } }
[ "dave@mediaetc.co.za" ]
dave@mediaetc.co.za
fcf77a36d77fb122303ee8f50329c3a98d1c09c1
c306615df3a057d42b3b48dbd2a82ac440ef5636
/app/src/main/java/com/kanjih/inventoryapp/SupplierActivity.java
7e2d58a64727ca403307cc5243c57c2d245312aa
[]
no_license
kanjih-ciandt/InventoryApp
a0aa801bfca01d7b5ba5c850ae8eea1011eaf0f8
aa90e971b289e92fa78f8b2f54cb755218aa70d5
refs/heads/master
2021-01-19T00:09:42.217869
2017-04-17T13:26:29
2017-04-17T13:26:29
87,145,948
0
0
null
null
null
null
UTF-8
Java
false
false
10,269
java
package com.kanjih.inventoryapp; import android.content.ContentValues; import android.content.DialogInterface; import android.net.Uri; import android.support.v4.app.NavUtils; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.widget.EditText; import android.widget.Toast; import com.kanjih.inventoryapp.data.SupplierContract.SupplierEntry; public class SupplierActivity extends AppCompatActivity { /** * Content URI */ private Uri mCurrentUri; private boolean mSupplierHasChanged = false; private EditText mNameEditText; private EditText mEmailEditText; private EditText mPhoneEditText; private EditText mMobileEditText; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_supplier); mNameEditText = (EditText) findViewById(R.id.edit_supplier_name); mEmailEditText = (EditText) findViewById(R.id.edit_supplier_email); mPhoneEditText = (EditText) findViewById(R.id.edit_supplier_phone); mMobileEditText = (EditText) findViewById(R.id.edit_supplier_mobile); mNameEditText.setOnTouchListener(mTouchListener); mEmailEditText.setOnTouchListener(mTouchListener); mPhoneEditText.setOnTouchListener(mTouchListener); mMobileEditText.setOnTouchListener(mTouchListener); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu options from the res/menu/menu_editor.xml file. getMenuInflater().inflate(R.menu.menu_detail, menu); return true; } private View.OnTouchListener mTouchListener = new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { mSupplierHasChanged = true; return false; } }; @Override public boolean onOptionsItemSelected(MenuItem item) { // User clicked on a menu option in the app bar overflow menu switch (item.getItemId()) { // Respond to a click on the "Save" menu option case R.id.action_save: // Do nothing for now if(!isValidFields()){ Toast.makeText(this, "Fields shoudn't be null ", Toast.LENGTH_SHORT).show(); return true; } else { saveSupplier(); finish(); } return true; // Respond to a click on the "Delete" menu option case R.id.action_delete: showDeleteConfirmationDialog(); finish(); return true; // Respond to a click on the "Up" arrow button in the app bar case android.R.id.home: // If the pet hasn't changed, continue with navigating up to parent activity // which is the {@link CatalogActivity}. if (!mSupplierHasChanged) { NavUtils.navigateUpFromSameTask(SupplierActivity.this); return true; } // Otherwise if there are unsaved changes, setup a dialog to warn the user. // Create a click listener to handle the user confirming that // changes should be discarded. DialogInterface.OnClickListener discardButtonClickListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // User clicked "Discard" button, navigate to parent activity. NavUtils.navigateUpFromSameTask(SupplierActivity.this); } }; // Show a dialog that notifies the user they have unsaved changes showUnsavedChangesDialog(discardButtonClickListener); return true; } return super.onOptionsItemSelected(item); } private boolean isValidFields() { return ! (mNameEditText.getText().toString().trim().isEmpty() || mEmailEditText.getText().toString().trim().isEmpty() ); } private void showUnsavedChangesDialog( DialogInterface.OnClickListener discardButtonClickListener) { // Create an AlertDialog.Builder and set the message, and click listeners // for the positive and negative buttons on the dialog. AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.unsaved_changes_dialog_msg); builder.setPositiveButton(R.string.discard, discardButtonClickListener); builder.setNegativeButton(R.string.keep_editing, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // User clicked the "Keep editing" button, so dismiss the dialog // and continue editing the pet. if (dialog != null) { dialog.dismiss(); } } }); // Create and show the AlertDialog AlertDialog alertDialog = builder.create(); alertDialog.show(); } @Override public void onBackPressed() { // If the pet hasn't changed, continue with handling back button press if (!mSupplierHasChanged) { super.onBackPressed(); return; } // Otherwise if there are unsaved changes, setup a dialog to warn the user. // Create a click listener to handle the user confirming that changes should be discarded. DialogInterface.OnClickListener discardButtonClickListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // User clicked "Discard" button, close the current activity. finish(); } }; // Show dialog that there are unsaved changes showUnsavedChangesDialog(discardButtonClickListener); } private void showDeleteConfirmationDialog() { // Create an AlertDialog.Builder and set the message, and click listeners // for the postivie and negative buttons on the dialog. AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.delete_dialog_msg_supplier); builder.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // User clicked the "Delete" button, so delete the pet. deleteSupplier(); } }); builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // User clicked the "Cancel" button, so dismiss the dialog // and continue editing the pet. if (dialog != null) { dialog.dismiss(); } } }); // Create and show the AlertDialog AlertDialog alertDialog = builder.create(); alertDialog.show(); } /** * Get user input from editor and save new pet into database. */ private void saveSupplier() { // Read from input fields // Use trim to eliminate leading or trailing white space String nameString = mNameEditText.getText().toString().trim(); String emailString = mEmailEditText.getText().toString().trim(); String phoneString = mPhoneEditText.getText().toString().trim(); String mobileString = mMobileEditText.getText().toString().trim(); // Create a ContentValues object where column names are the keys, // and pet attributes from the editor are the values. ContentValues values = new ContentValues(); values.put(SupplierEntry.COLUMN_SUP_NAME, nameString); values.put(SupplierEntry.COLUMN_SUP_MAIL, emailString); values.put(SupplierEntry.COLUMN_SUP_PHONE, phoneString); values.put(SupplierEntry.COLUMN_SUP_MOBILE, mobileString); boolean isOk; if (mCurrentUri != null) { int id = getContentResolver().update(mCurrentUri, values, null, null); isOk = (id != -1); } else { Uri newRowId = getContentResolver().insert(SupplierEntry.CONTENT_URI, values); isOk = (newRowId != null); } // Insert a new row for pet in the database, returning the ID of that new row. // Show a toast message depending on whether or not the insertion was successful if (isOk) { // If the row ID is -1, then there was an error with insertion. Toast.makeText(this, R.string.editor_save_supplier_successful, Toast.LENGTH_SHORT).show(); } else { // Otherwise, the insertion was successful and we can display a toast with the row ID. Toast.makeText(this, R.string.editor_save_supplier_failed, Toast.LENGTH_SHORT).show(); } } /** * Perform the deletion of the pet in the database. */ private void deleteSupplier() { int rowsDeleted = getContentResolver().delete(mCurrentUri, null, null); // Show a toast message depending on whether or not the delete was successful. if (rowsDeleted == 0) { // If no rows were deleted, then there was an error with the delete. Toast.makeText(this, getString(R.string.editor_delete_supplier_failed), Toast.LENGTH_SHORT).show(); } else { // Otherwise, the delete was successful and we can display a toast. Toast.makeText(this, getString(R.string.editor_delete_supplier_successful), Toast.LENGTH_SHORT).show(); } } }
[ "kneto@kneto-macbookpro.roam.corp.google.com" ]
kneto@kneto-macbookpro.roam.corp.google.com
300f4e7900c74ad3e8a0df8dbdd78b9d9227af08
71e8c35d8620ef64f29276514f2177b7bbfd0aac
/gdpdu-models/src/main/java/com/opencore/gdpdu/index/models/DataType.java
2f4e948e69b61ecc90d0e28ba5c47f80ed3c3afd
[ "Apache-2.0" ]
permissive
Malte-Neu/gdpdu-java
c2b1022aa81047420d34d52036ce7b84534ec963
c887d4cebc23ac760f46de468540924050dd93ed
refs/heads/master
2023-01-02T12:26:54.365426
2020-08-12T07:06:12
2020-08-12T07:06:12
298,536,381
0
0
null
null
null
null
UTF-8
Java
false
false
890
java
/* * Licensed to OpenCore GmbH & Co. KG under one or more contributor license agreements. * See the NOTICE file distributed with this work for additional information regarding copyright ownership. * OpenCore GmbH & Co. KG 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 com.opencore.gdpdu.index.models; public enum DataType { Numeric, AlphaNumeric, Date }
[ "lars.francke@gmail.com" ]
lars.francke@gmail.com
7fd59a2c91ebac2be60212d4bc32395f40b98272
288edf7e72db46d213ca2ead631bdd65dbbfa792
/app/src/main/java/com/pradipatle/androidkt/MainHomeAcitity.java
6baf6b3c2afe5653adc14ea3046cba7c6d3699d0
[]
no_license
pradippatle/InterviewQuestionApp
12d713032735445a27ee18acf29f37ccbc0bded4
57d503108f418ab6baf41d943440308f42f12785
refs/heads/master
2021-07-09T13:37:32.677597
2017-10-09T14:26:11
2017-10-09T14:26:11
105,876,182
0
0
null
null
null
null
UTF-8
Java
false
false
1,699
java
package com.pradipatle.androidkt; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.LinearLayout; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; import com.pradipatle.androidkt.Android.AndroidActivity; import com.pradipatle.androidkt.Java.JavaActivity; /** * Created by Aeon-02 on 10/9/2017. */ public class MainHomeAcitity extends AppCompatActivity implements View.OnClickListener{ LinearLayout MenuAndroid, MenuJava; private AdView mAdView; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.home_acivity); mAdView = (AdView) findViewById(R.id.adView); AdRequest adRequest = new AdRequest.Builder().build(); mAdView.loadAd(adRequest); MenuAndroid = (LinearLayout)findViewById(R.id.id_android_menu); MenuJava = (LinearLayout)findViewById(R.id.id_java_menu); MenuAndroid.setOnClickListener(this); MenuJava.setOnClickListener(this); } @Override public void onClick(View v) { int i = v.getId(); switch (i){ case R.id.id_android_menu : Intent iAndroid = new Intent(MainHomeAcitity.this, AndroidActivity.class); startActivity(iAndroid); break; case R.id.id_java_menu : Intent iJava = new Intent(MainHomeAcitity.this, JavaActivity.class); startActivity(iJava); break; } } }
[ "pradip.p@aeonit.in" ]
pradip.p@aeonit.in
aebd760303c6d71a1ee88e9688b03121c63ba64f
7be5e0a4b6da61f44191b2213d47e382c69a1e7e
/src/main/java/com/MyBlog/ServiceImpl/UserServiceImpl.java
b43f25be31f17d6db9488b4a360e63def0e30135
[]
no_license
Beloya/SSM
ab36e11ecb6b9c4f157b4d021034002fbeaeec54
87bcd945f2834b2afaad2899d60f7c6c8235174c
refs/heads/master
2021-07-06T09:10:02.624698
2019-03-09T16:29:24
2019-03-09T16:29:24
143,831,043
1
0
null
null
null
null
UTF-8
Java
false
false
4,197
java
package com.MyBlog.ServiceImpl; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.TimeZone; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.LockedAccountException; import org.apache.shiro.authc.UnknownAccountException; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.crypto.hash.Md5Hash; import org.apache.shiro.session.Session; import org.apache.shiro.subject.Subject; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.MyBlog.Dao.UsersMapper; import com.MyBlog.Service.userService; import com.MyBlog.entity.Users; import com.MyBlog.utils.myStringUtils; import com.github.pagehelper.util.StringUtil; @Component public class UserServiceImpl implements userService{ @Resource private UsersMapper uMapper; public Users createUser(Users user) { //加密密码 // passwordHelper.encryptPassword(user); return user; } public void changePassword(Long userId, String newPassword) { } public Users FindByUserName(String UserName) { // TODO Auto-generated method stub return uMapper.FindByUserName(UserName); } public List<Users> FindAll() { // TODO Auto-generated method stub return uMapper.FindAll(); } public Object Login(Users user, String RememberMe) { Map<String, String> LoginMsg=null; Subject subject = null; String passWordmd5=null; UsernamePasswordToken usernamePasswordToken=null; try { LoginMsg=new HashMap<String, String>(); subject = SecurityUtils.getSubject(); passWordmd5 = new Md5Hash(user.getPassWord()).toString();//加密 usernamePasswordToken = new UsernamePasswordToken(user.getUserName(),passWordmd5); if(RememberMe.equals("on")) { usernamePasswordToken.setRememberMe(true); } subject.login(usernamePasswordToken); LoginMsg.put("code","0"); LoginMsg.put("msg","登陆成功"); } catch(UnknownAccountException e){ LoginMsg.put("code","1"); LoginMsg.put("msg","账号或密码错误"); } catch(IncorrectCredentialsException e){ LoginMsg.put("code","1"); LoginMsg.put("msg","账号或密码错误"); } catch(LockedAccountException e){ LoginMsg.put("code","1"); LoginMsg.put("msg","账号被锁定"); } catch (Exception e) { e.printStackTrace(); LoginMsg.put("code","1"); LoginMsg.put("msg","系统错误"); } return LoginMsg; } public Object CreateUser(Users user) { Map<String, String> Msg=null; try { if(myStringUtils.isIllegalCharacter(user.getUserName())) { Msg.put("code","500"); Msg.put("msg","用户名含有非法字符"); return Msg; } Msg=new HashMap<String, String>(); TimeZone tz = TimeZone.getTimeZone("GMT+8"); TimeZone.setDefault(tz); String passWordmd5 = new Md5Hash(user.getPassWord()).toString(); user.setRId(4); user.setCreatorId(0); user.setUserImg("/images/MyT.jpg"); user.setLocked(1); user.setSex(3); user.setCreateDate(new Date()); user.setDataLevel(0); user.setSalt(passWordmd5); user.setPassWord(passWordmd5); uMapper.CreateUser(user); Msg.put("code","0"); Msg.put("msg","注册成功"); Subject subject = SecurityUtils.getSubject(); UsernamePasswordToken usernamePasswordToken = new UsernamePasswordToken(user.getUserName(),passWordmd5); subject.login(usernamePasswordToken); Login(user, "off"); } catch (Exception e) { e.printStackTrace(); Msg.put("code","1"); Msg.put("msg","系统错误"); } return Msg; } }
[ "468501955@qq.com" ]
468501955@qq.com
a0dc2024002975ca3a883db1277f3a7915f3ea9e
82845020e1f0efeeaa1adef456091915150e534e
/13PrimeNumber/src/prime/PrimeNumber.java
3303ef7eb9b46d643c8f4536e60ea4742a9f1239
[]
no_license
nazneenbee/PlacementPrepareCode
11a1ad96fb2d0b5b205d3f46b774d6142ed51382
5e8950c6c4501045ad6be417c5dd401af03c60ff
refs/heads/main
2023-03-01T08:09:19.912752
2021-02-03T16:50:27
2021-02-03T16:50:27
335,684,819
0
0
null
null
null
null
UTF-8
Java
false
false
590
java
package prime; import java.util.Scanner; public class PrimeNumber { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); System.out.println("enter a number"); int num=sc.nextInt(); int count=0; if(num==1) { System.out.println("not a prime not a composite"); } else if(num>=2) { for(int i=2; i<num; i++) { if(num%i==0) { count++; } } if(count>0) { System.out.println("number is not prime"); } else { System.out.println("number is prime"); } } } }
[ "beenazneen@gmail.com" ]
beenazneen@gmail.com
1be7bd61c7b4d31551fddf32c0abb8008c250c01
5223a8e64af1c571b39dbf0319407d9727526cbd
/oims-sys/src/main/java/com/wms/web/shop/model/catalog/Attribute.java
918e2835cc598dd151139d6985501b8eaec97c21
[]
no_license
repo-upadhyay/oims
32bb56e2837e00e28f79d66bf13b0b74a5c70ef5
57ac044e724fa7de8d412086659ebf731a1ef407
refs/heads/master
2020-03-31T02:27:31.810973
2016-06-26T19:08:23
2016-06-26T19:08:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,145
java
package com.wms.web.shop.model.catalog; import java.io.Serializable; import java.util.List; import com.wms.web.entity.ShopEntity; public class Attribute extends ShopEntity implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String name = null; private String type = null; private String code = null; private List<AttributeValue> values = null; private AttributeValue readOnlyValue = null; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getType() { return type; } public void setType(String type) { this.type = type; } public void setValues(List<AttributeValue> values) { this.values = values; } public List<AttributeValue> getValues() { return values; } public void setCode(String code) { this.code = code; } public String getCode() { return code; } public void setReadOnlyValue(AttributeValue readOnlyValue) { this.readOnlyValue = readOnlyValue; } public AttributeValue getReadOnlyValue() { return readOnlyValue; } }
[ "dilip.repo1@gmail.com" ]
dilip.repo1@gmail.com
494d8b0aa4336f779907ae76eecb0cbe5732d7f7
2dafa875d0d2a03ce75ca20e0da8af40bf8d8da2
/bibliotheque/webAppliBiblio/src/main/java/fr/khady/webAppliBiblio/action/GestionOuvrageAction.java
e2593965341e8e1ca4c6698b7c1b19636b8c8ae8
[]
no_license
MyOpenClassrooms/Biblio
e4877fe62e0194ff3d91acf3407ed130fcb78d81
d3bdee4d2f13170f49bb530519cb737401d8fcbb
refs/heads/master
2020-04-02T18:12:09.654282
2018-12-27T13:26:12
2018-12-27T13:26:12
154,690,458
0
0
null
2018-10-25T15:00:46
2018-10-25T15:00:45
null
UTF-8
Java
false
false
3,940
java
package fr.khady.webAppliBiblio.action; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; import java.util.Map; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; import org.apache.struts2.interceptor.SessionAware; import org.jasypt.util.password.StrongPasswordEncryptor; import com.opensymphony.xwork2.ActionSupport; import fr.khady.wsBiblioClient.Auteur; import fr.khady.wsBiblioClient.BibliothequeException; import fr.khady.wsBiblioClient.Exemplaire; import fr.khady.wsBiblioClient.ExemplaireService; import fr.khady.wsBiblioClient.ExemplaireService_Service; import fr.khady.wsBiblioClient.Ouvrage; import fr.khady.wsBiblioClient.OuvrageService; import fr.khady.wsBiblioClient.OuvrageService_Service; import fr.khady.wsBiblioClient.Reservation; import fr.khady.wsBiblioClient.ReservationService; import fr.khady.wsBiblioClient.ReservationService_Service; import fr.khady.wsBiblioClient.Utilisateur; public class GestionOuvrageAction extends ActionSupport { private static final long serialVersionUID = -4423447871500036097L; private Long idOuvrage; private String titre; private String isbn; private String nomAuteur; private Boolean dispo; public Ouvrage ouvrage = new Ouvrage(); public Auteur auteur = new Auteur(); public Exemplaire exemplaire = new Exemplaire(); public Utilisateur utilisateur = new Utilisateur(); public List<Ouvrage> ouvrages; // private Date dateRetourPrevu; XMLGregorianCalendar dateRetourPrevu; OuvrageService_Service service = new OuvrageService_Service(); OuvrageService ouvragePort = service.getOuvrageServicePort(); ExemplaireService_Service serviceEx = new ExemplaireService_Service(); ExemplaireService exemplairePort = serviceEx.getExemplaireServicePort(); ReservationService_Service serviceResa = new ReservationService_Service(); ReservationService reservationPort = serviceResa.getReservationServicePort(); public List<Reservation> reservations; public String index() { titre = ouvrage.getTitre(); isbn = ouvrage.getIsbn(); nomAuteur = auteur.getNom(); dispo = ouvrage.isDisponibilite(); System.out.println("dispo " + dispo); ouvrages = ouvragePort.listerOuvrage(); if (titre == null && isbn == null && nomAuteur == null && dispo == null) { ouvrages = ouvragePort.listerOuvrage(); // this.addActionMessage("AUCUN Result pour la recherche"); } else { try { ouvrages = ouvragePort.trouverOuvrageParIsbnTitreAuteur(isbn, titre, nomAuteur, dispo); } catch (Exception pEx) { this.addActionMessage("AUCUN OUVRAGE"); } } if (ouvrages.isEmpty()) { this.addActionMessage("Aucun ouvrage"); } return SUCCESS; } public String doDetail() { idOuvrage = ouvrage.getIdOuvrage(); try { ouvrage = ouvragePort.trouverOuvrageParId(idOuvrage); reservations = reservationPort.trouverReservationParOuvrage(ouvrage); exemplaire = exemplairePort.trouverExemplaireParOuvrage(idOuvrage); dateRetourPrevu = reservationPort.dateRetourPrevu(idOuvrage); } catch (BibliothequeException e) { e.printStackTrace(); } return SUCCESS; } public List<Reservation> getReservations() { return reservations; } public void setReservations(List<Reservation> reservations) { this.reservations = reservations; } public XMLGregorianCalendar getDateRetourPrevu() { return dateRetourPrevu; } public void setDateRetourPrevu(XMLGregorianCalendar dateRetourPrevu) { this.dateRetourPrevu = dateRetourPrevu; } // public String listeParTitre() { // // String vResult = ActionSupport.INPUT; // titre = ouvrage.getTitre(); // System.out.println("titre " + titre); // if (titre != null) { // try { // ouvrages = ouvragePort.trouverOuvrageParTitre(titre); // // } catch (Exception pEx) { // this.addActionMessage("AUCUN OUVRAGE"); // } // // } // return SUCCESS; // } }
[ "khady.bar@capgemini.com" ]
khady.bar@capgemini.com
9a020035e603d5249c7eae8bf6940df4c56329d0
edda4943b9a86946a02e8064d210a82c860f1f4d
/src/main/java/leetcode/lc279/PerfectSquares.java
500a50243276fd406184f5e213232b04fb135777
[]
no_license
DehaoWang/lcaj
2bc8842029d5ffadf762aa9e5207e4f2643e2531
0371fef310f2cea0cc131ee12b1b59ffda61133c
refs/heads/master
2021-06-17T23:39:45.491494
2021-01-06T08:55:30
2021-01-06T08:55:30
130,051,028
0
0
null
2020-10-12T19:52:00
2018-04-18T11:19:20
Java
UTF-8
Java
false
false
1,546
java
package leetcode.lc279; import java.util.Arrays; /** * Created by wangdehao on 19/5/28. */ public class PerfectSquares { public static void main(String[] args) { for (int i = 0; i < 15; i++) { System.out.println("i = " + i + ", numSquares = " + numSquares(i)); System.out.println("i = " + i + ", numSquaresFast = " + numSquaresFast(i)); } } public static int numSquares(int n) { if (n <= 1) { return n; } int[] memo = new int[n + 1]; memo[0] = 0; memo[1] = 1; for (int i = 2; i < n + 1; i++) { if (isSquare(i)) { memo[i] = 1; continue; } memo[i] = Integer.MAX_VALUE; for (int j = 1; j <= i / 2; j++) { // i = j + i-j int count = memo[j] + memo[i - j]; memo[i] = Math.min(memo[i], count); } } return memo[n]; } private static boolean isSquare(int i) { double sqrt = Math.sqrt(i); return sqrt == (int) sqrt; } public static int numSquaresFast(int n) { int[] dp = new int[n + 1]; Arrays.fill(dp, Integer.MAX_VALUE); dp[0] = 0; for(int i = 1; i <= n; ++i) { int min = Integer.MAX_VALUE; int j = 1; while(i - j*j >= 0) { min = Math.min(min, dp[i - j*j] + 1); j++; } dp[i] = min; } return dp[n]; } }
[ "wangdehao@meituan.com" ]
wangdehao@meituan.com
98f776d5ce2c3a24b0f395097788f85d07b7574a
b7fc25dc46d2f0315afa3e8e5c642652ca7826c0
/single-table-tools1.0/src/com/qieren/tool/util/.svn/text-base/ConfigUtil.java.svn-base
dc26b4dcd59a1cfaf7b44872e6388910a75ea8af
[]
no_license
liulei0225/single-table-tools
36ab280417192eacb99ae0b4fb83c4392c5d7fc1
4924c5fbecab2ccec84ee22974d50a837d00b26a
refs/heads/master
2021-05-02T12:01:06.568678
2018-02-08T09:34:17
2018-02-08T09:34:17
120,734,434
0
0
null
null
null
null
UTF-8
Java
false
false
817
package com.qieren.tool.util; import java.io.IOException; import java.util.Properties; /** * @author qieren * @version 1.0 * @since 2013-11-04 */ public class ConfigUtil { private static Properties properties; private static Properties getProperties() { if (properties == null) { Properties _properties = new Properties(); try { _properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("common-config.properties")); } catch (IOException e) { throw new RuntimeException(e); } properties = _properties; } return properties; } public static String get(String key) { return getProperties().getProperty(key); } }
[ "838426335@qq.com" ]
838426335@qq.com
dae2494456b849339e528c9abcad75d28a7abc6e
6f461acdb4dc2f2667c8682ff50c612096405570
/logserver/src/main/java/com/gaea/game/log/LogService.java
b19746d3ecf1b538ebcb339c0da76d81389cb170
[]
no_license
ymw520369/gaeagame
f1584aa3d5dd5a186b3318ea3530d2b5814b3749
0e989a1fc57a9221d230cc1e2e465fa6c3bedbc3
refs/heads/master
2021-01-19T18:49:09.886818
2017-10-09T10:18:20
2017-10-09T10:18:20
101,168,005
1
0
null
null
null
null
UTF-8
Java
false
false
1,237
java
package com.gaea.game.log; import com.alibaba.dubbo.config.annotation.Service; import com.alibaba.fastjson.JSON; import com.gaea.game.core.log.ILogService; import com.mongodb.BasicDBObject; import com.mongodb.DBCollection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import java.util.Map; /** * Created on 2017/9/8. * * @author Alan * @since 1.0 */ @Service(version = "1.0.0") public class LogService implements ILogService { Logger log = LoggerFactory.getLogger(LogService.class); //@Autowired //RecordManager recordManager; @Autowired MongoTemplate mongoTemplate; @Override public boolean log(Map<String, Object> map) { log.info("收到日志消息,map=" + JSON.toJSONString(map)); if (map == null || map.isEmpty()) { log.warn("消息数据为空"); return true; } String dbName = map.get("name").toString(); DBCollection collection = mongoTemplate.getCollection(dbName); BasicDBObject dbObject = new BasicDBObject(map); collection.insert(dbObject); return true; } }
[ "mingweiyang@foxmail.com" ]
mingweiyang@foxmail.com
25de96909a9ae03b44107e58a84ab95be45086f8
a87356e29b4d7457079558b489ecdb4e901ab2d2
/app/src/main/java/com/example/sesion1/WeatherClouds.java
dbecdfccc35f2413cb9c0e11e8b4d76e8b8e2ea5
[]
no_license
rossvillcol/Test1
0610e4ca93d3e2512e44b693a78647c6fa9e6054
122d32cedb6165c15c2eb1298f0c4a29d76cfb4f
refs/heads/master
2023-03-07T02:45:37.238744
2021-02-12T19:16:05
2021-02-12T19:16:05
338,408,443
0
0
null
null
null
null
UTF-8
Java
false
false
212
java
package com.example.sesion1; public class WeatherClouds { private Integer all; public Integer getAll() { return all; } public void setAll(Integer all) { this.all = all; } }
[ "rossvillegascolman@gmail.com" ]
rossvillegascolman@gmail.com
f7c8275aa5acc725db695d720613d7edbf657ff1
17bd1959f27bf667cbf349b6c180ceea8692e502
/house-biz/src/main/java/com/ryan/house/biz/pojo/HouseUser.java
bfdbb6794c00cc5163b00e46d2a4b9f5f86bd58e
[]
no_license
ryangogo/houses
570c2cf13ed5fe9b25049d6822f0fd12de20dc91
57e83944eb8f3792a1aa1e666a292c662261aa09
refs/heads/master
2020-03-20T08:17:47.068670
2018-06-19T08:12:57
2018-06-19T08:12:57
137,304,312
0
0
null
null
null
null
UTF-8
Java
false
false
1,816
java
package com.ryan.house.biz.pojo; import java.util.Date; public class HouseUser { private Long id; /** * 房屋id */ private Long houseId; /** * 用户id */ private Long userId; /** * 创建时间 */ private Date createTime; /** * 1:售卖,2:收藏 */ private Boolean type; /** * @return id */ public Long getId() { return id; } /** * @param id */ public void setId(Long id) { this.id = id; } /** * 获取房屋id * * @return house_id - 房屋id */ public Long getHouseId() { return houseId; } /** * 设置房屋id * * @param houseId 房屋id */ public void setHouseId(Long houseId) { this.houseId = houseId; } /** * 获取用户id * * @return user_id - 用户id */ public Long getUserId() { return userId; } /** * 设置用户id * * @param userId 用户id */ public void setUserId(Long userId) { this.userId = userId; } /** * 获取创建时间 * * @return create_time - 创建时间 */ public Date getCreateTime() { return createTime; } /** * 设置创建时间 * * @param createTime 创建时间 */ public void setCreateTime(Date createTime) { this.createTime = createTime; } /** * 获取1:售卖,2:收藏 * * @return type - 1:售卖,2:收藏 */ public Boolean getType() { return type; } /** * 设置1:售卖,2:收藏 * * @param type 1:售卖,2:收藏 */ public void setType(Boolean type) { this.type = type; } }
[ "625056163@qq.com" ]
625056163@qq.com
879779c742dd1d6b4c12b6bb50581478afd47263
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_22218.java
cf7e69c6739263d7e81c3b1203ab1dc4f0df5b66
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
private void collectSize(@NonNull Display display,@NonNull JSONObject container) throws JSONException { final Point size=new Point(); display.getSize(size); container.put("size",new JSONArray(Arrays.asList(size.x,size.y))); }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
5f42cb29b22a865f91c98273215d3b883d647828
b37e602ba28f039563b43ed36c264d631916b2f4
/app/src/main/java/com/example/proyectoregistropersonal/database/DatabaseHelper.java
85d654a183503c581c2b02ddb66ad828c09ee459
[]
no_license
juver1212/ProyectoRegistroPersonal
66928ed2897792e3cab2c75a485c72db98cdd3a6
cd609d1e634a1865a650e44a5da003b7aba595e1
refs/heads/master
2022-12-24T00:44:01.710191
2020-10-02T02:20:23
2020-10-02T02:20:23
295,249,242
0
0
null
null
null
null
UTF-8
Java
false
false
4,461
java
package com.example.proyectoregistropersonal.database; /** * Created by anupamchugh on 19/10/15. */ import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; public class DatabaseHelper extends SQLiteOpenHelper { // Table Name public static final String TABLE_NAME_TRABAJADOR = "trabajadores"; public static final String TABLE_NAME_MARCACION = "trabajadormarcacion"; public static final String TABLE_NAME_USUARIO = "usuario"; public static final String TABLE_NAME_SINCRONIZAR_REGISTRO = "sincronizacion_registro"; // Table columns public static final String Documento = "Documento"; public static final String Nombres = "Nombres"; public static final String Cargo = "Cargo"; public static final String Sueldo = "Sueldo"; public static final String AsigFam = "AsigFam"; public static final String EntidadFinanciera = "EntidadFinanciera"; public static final String CCI = "CCI"; public static final String NroCuenta = "NroCuenta"; public static final String Categoria = "Categoria"; public static final String CentroCosto = "CentroCosto"; public static final String FechaIngreso = "FechaIngreso"; public static final String FechaCese = "FechaCese"; public static final String Estado = "Estado"; public static final String CodEmpresa = "CodEmpresa"; public static final String Foto = "Foto"; public static final String UsuReg = "UsuReg"; public static final String FecReg = "FecReg"; public static final String UsuMod = "UsuMod"; public static final String FecMod = "FecMod"; public static final String Latitud = "Latitud"; public static final String Longitud = "Longitud"; public static final String Fecha = "Fecha"; public static final String Hora = "Hora"; public static final String Imagen = "Imagen"; // Database Information public static final String DB_NAME = "REGISTRO.DB"; // database version static final int DB_VERSION = 1; // Creating table query private static final String CREATE_TABLE = "create table " + TABLE_NAME_TRABAJADOR + "(" + Documento + " TEXT, " + Nombres + " TEXT , " + Cargo + " TEXT, " + Sueldo + " REAL, " + AsigFam + " REAL , " + EntidadFinanciera + " TEXT, " + CCI + " TEXT, " + NroCuenta + " TEXT , " + Categoria + " TEXT, " + CentroCosto + " TEXT, " + FechaIngreso + " TEXT , " + FechaCese + " TEXT, " + Estado + " TEXT, " + CodEmpresa + " TEXT , " + Foto + " BLOB, " + UsuReg + " TEXT, " + FecReg + " TEXT ," + UsuMod + " TEXT, " + FecMod + " TEXT );"; private static final String CREATE_TABLE_MARCACION = "create table " + TABLE_NAME_MARCACION + "(" + "id INTEGER PRIMARY KEY AUTOINCREMENT ," + CodEmpresa + " TEXT, " + Documento + " TEXT , " + Fecha + " TEXT, " + Hora + " TEXT, " + Latitud + " TEXT, " + Longitud + " TEXT , " + Estado + " TEXT, " + Imagen + " BLOB, " + UsuMod + " TEXT , " + FecMod + " TEXT );"; private static final String CREATE_TABLE_USUARIO = "create table " + TABLE_NAME_USUARIO + "(" + "id INTEGER PRIMARY KEY AUTOINCREMENT, IDUsuario TEXT, USU_CODIGO TEXT, CodEmpresa TEXT, DesEmpresa TEXT," + "NomUsuario TEXT, ClaveUsuario TEXT, Documento TEXT, TipoUsuario TEXT );"; private static final String CREATE_TABLE_REGISTRO_SINCRONIZACION = "create table " + TABLE_NAME_SINCRONIZAR_REGISTRO + "(" + "id INTEGER PRIMARY KEY AUTOINCREMENT, Fecha TEXT, Hora TEXT );"; public DatabaseHelper(Context context) { super(context, DB_NAME, null, DB_VERSION); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_TABLE); db.execSQL(CREATE_TABLE_MARCACION); db.execSQL(CREATE_TABLE_USUARIO); db.execSQL(CREATE_TABLE_REGISTRO_SINCRONIZACION); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_TRABAJADOR); onCreate(db); db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_MARCACION); onCreate(db); db.execSQL("DROP TABLE IF EXISTS "+ TABLE_NAME_USUARIO); onCreate(db); db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_SINCRONIZAR_REGISTRO); onCreate(db); } }
[ "juniorvegareyes12@gmail.com" ]
juniorvegareyes12@gmail.com
6018c6818fd28d796f2c0b674821cd15aa005187
d9040b2ed27469dbefe1df4425c143f985a0f0cf
/app/src/androidTest/java/com/chemanman/gson/ExampleInstrumentedTest.java
1226772e079e4fc46499763f6e670f9c4c797c4c
[]
no_license
zkdengta/MGson
0746a87a7dd376e719a742247931cc3c9c9a205d
a724feceb9c43c6caacde1f86155a55342c68fc0
refs/heads/master
2021-01-26T16:31:44.754274
2018-01-31T06:57:37
2018-01-31T06:57:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
740
java
package com.chemanman.gson; 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.*; /** * Instrumentation 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.chemanman.gson", appContext.getPackageName()); } }
[ "zenghuilin@chemanman.com" ]
zenghuilin@chemanman.com
6ed805847a4bfc0c179839a20835f1291cc8da53
bb799850c9c16e525b814732a46640ada33fa984
/src/main/java/com/francisco/loja/dao/CarrinhoDAO.java
d05ff395dda6c5056c1fb47043bda1bb8e682efe
[]
no_license
francsousa/webservices-rest-com-jaxrs-e-jersey
e10ec7cd4e2fb14edb6be53b2b1315e171e471a9
92e93fce0205154278eb2506066fbcc4c31c2f91
refs/heads/master
2023-03-06T00:33:28.268306
2021-02-22T14:06:39
2021-02-22T14:06:39
337,219,794
0
0
null
null
null
null
UTF-8
Java
false
false
990
java
package com.francisco.loja.dao; import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicLong; import com.francisco.loja.modelo.Carrinho; import com.francisco.loja.modelo.Produto; public class CarrinhoDAO { private static Map<Long, Carrinho> banco = new HashMap<Long, Carrinho>(); private static AtomicLong contador = new AtomicLong(1); static { Produto videogame = new Produto(6237, "Videogame 4", 4000, 1); Produto esporte = new Produto(3467, "Jogo de esporte", 60, 2); Carrinho carrinho = new Carrinho() .adiciona(videogame) .adiciona(esporte) .para("Rua Vergueiro 3185, 8 andar", "São Paulo") .setId(1l); banco.put(1l, carrinho); } public void adiciona(Carrinho carrinho) { long id = contador.incrementAndGet(); carrinho.setId(id); banco.put(id, carrinho); } public Carrinho busca(Long id) { return banco.get(id); } public Carrinho remove(long id) { return banco.remove(id); } }
[ "franciscoeds1987@hotmail.com" ]
franciscoeds1987@hotmail.com
d12a94f6f3da41e2669efeb2bfd51ea311f8412f
69ec9597118e13de103d0a4e314a1cb2141a25fa
/src/de/msiggi/sportsdata/webservices/GetMatchdataByGroupLeagueSaison.java
272814ab2e4d2b6e9a0ae5b5c4f814d1cebe878f
[]
no_license
ralfp1979/amazonas-project
9ef2e320d5e6be10922ead3b04efecafededf1f0
f5f688b9bfac5c889ca23684ff46246d158d06af
refs/heads/master
2020-04-18T07:57:53.295519
2014-02-05T20:33:04
2014-02-05T20:33:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,609
java
package de.msiggi.sportsdata.webservices; 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> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="groupOrderID" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="leagueShortcut" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="leagueSaison" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "groupOrderID", "leagueShortcut", "leagueSaison" }) @XmlRootElement(name = "GetMatchdataByGroupLeagueSaison") public class GetMatchdataByGroupLeagueSaison { protected int groupOrderID; protected String leagueShortcut; protected String leagueSaison; /** * Gets the value of the groupOrderID property. * */ public int getGroupOrderID() { return groupOrderID; } /** * Sets the value of the groupOrderID property. * */ public void setGroupOrderID(int value) { this.groupOrderID = value; } /** * Gets the value of the leagueShortcut property. * * @return * possible object is * {@link String } * */ public String getLeagueShortcut() { return leagueShortcut; } /** * Sets the value of the leagueShortcut property. * * @param value * allowed object is * {@link String } * */ public void setLeagueShortcut(String value) { this.leagueShortcut = value; } /** * Gets the value of the leagueSaison property. * * @return * possible object is * {@link String } * */ public String getLeagueSaison() { return leagueSaison; } /** * Sets the value of the leagueSaison property. * * @param value * allowed object is * {@link String } * */ public void setLeagueSaison(String value) { this.leagueSaison = value; } }
[ "ralf@192.168.178.27" ]
ralf@192.168.178.27
921e9db0cc4e63366de1ab888dac315ef71281ea
c81fdd83743502a5de7da45b8bbaf6a06825f9bf
/src/MinUnitLengthIntervals.java
764899bb8c2e6dcb552e81e3ea14b831e860a0ca
[]
no_license
delahiri/Greedy-Algorithm
179fbb0770da499e9e67a6d06edc06056e78c150
c04de498c7f665599f27e56baebff15ebe481f52
refs/heads/master
2021-01-10T11:56:37.198204
2015-10-16T19:49:39
2015-10-16T19:49:39
43,195,355
0
0
null
null
null
null
UTF-8
Java
false
false
1,210
java
import java.util.ArrayList; import java.util.List; public class MinUnitLengthIntervals { public static void main(String[] args) { double []a = {0.7,1.0,1.5,2.0,2.3,2.6,3.1,3.6,3.9,4.2,4.7,5.2,5.5}; quickSort(a,0,a.length-1); List<ArrayList<Double>> lines = new ArrayList<ArrayList<Double>>(); ArrayList<Double> oneLine = new ArrayList<Double>(); double upto = a[0]+1.0f; oneLine.add(a[0]); for(int i= 1;i<a.length;i++) { if(a[i]<=upto) { oneLine.add(a[i]); } else { lines.add(oneLine); oneLine = new ArrayList<Double>(); upto = a[i]+1.0f; oneLine.add(a[i]); } } lines.add(oneLine); for(List<Double> p:lines) { for(Double n: p) System.out.print(n+","); System.out.println(); } } private static void quickSort(double[] a,int start, int end) { int i = start, j=end; double pivot = a[(i+j)/2]; while(i<=j) { while(a[i]<pivot) { i++; } while(a[j]>pivot) { j--; } if(i<=j) { double temp = a[i]; a[i] = a[j]; a[j] = temp; i++; j--; } } if(start < i-1) quickSort(a, start, i-1); if(end > i) quickSort(a, i, end); } }
[ "debaniklahiri@gmail.com" ]
debaniklahiri@gmail.com
8e9c9798abb98937bd6ca1b8d5c7e0af3de8fc0a
7e98a58fdf42905a2901507e060c86b991dbc328
/src/main/java/by/itransition/mathtasksapp/controllers/rest/AnswerController.java
d0fdfdb3bfdbc331574e080d301b7555ba971376
[]
no_license
missaouib/mathtasksapp
fdd6f0b6ef3db268caef7419cf287c54ae41e5ef
ebcacf8ea916d70ccce51b5e9bd0a740248f5518
refs/heads/master
2023-09-02T05:18:56.915362
2021-10-19T14:35:06
2021-10-19T14:35:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,653
java
package by.itransition.mathtasksapp.controllers.rest; import by.itransition.mathtasksapp.models.Task; import by.itransition.mathtasksapp.services.AnswerService; import by.itransition.mathtasksapp.services.TaskService; import by.itransition.mathtasksapp.services.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController public class AnswerController { private final AnswerService answerService; private final TaskService taskService; private final UserService userService; @Autowired public AnswerController(AnswerService answerService, TaskService taskService, UserService userService) { this.answerService = answerService; this.taskService = taskService; this.userService = userService; } @GetMapping("/checkAnswer/{task}") public boolean checkAnswer(@PathVariable("task") Long task, @RequestParam("answer") String answer, @AuthenticationPrincipal OAuth2User principal){ Task currentTask=taskService.getById(task); if(answerService.containsAnswer(currentTask,answer)){ userService.addSolved((Long)principal.getAttributes().get("id"),currentTask); return true; } return false; } }
[ "petrikin1996@gmail.com" ]
petrikin1996@gmail.com
68372466fc031cfb118b1324d1ac3cd5ed77f2ee
9eb8fbc45bc655d0516009852c55df52980063a7
/library/src/main/java/com/github/gfranks/minimal/notification/GFUndoNotification.java
a7f8b6e26ef7768379965b17c500c2f0f653e5e2
[ "MIT" ]
permissive
mohsinalimat/GFMinimalNotifications
99d73c85aef87a698ef83ba3db93c9a043a1e08a
1b7f33c30a675437e064449a23c02a6939486a99
refs/heads/master
2020-12-24T16:06:33.933459
2015-01-08T23:29:27
2015-12-30T21:50:50
60,669,949
1
0
null
2016-06-08T05:07:26
2016-06-08T05:07:26
null
UTF-8
Java
false
false
10,893
java
package com.github.gfranks.minimal.notification; import android.content.Context; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; public class GFUndoNotification extends GFMinimalNotification { private GFUndoNotificationCallback mUndoCallback; public GFUndoNotification(Builder builder) { this(builder.mContext, builder.mDuration); setTitleText(builder.mTitle); setSubtitleText(builder.mSubtitle); mAnimationDuration = builder.mAnimationDuration; if (builder.mBackground != null) { setNotificationBackground(builder.mBackground); } if (builder.mLeftView != null) { setLeftView(builder.mLeftView); } else if (builder.mLeftImageDrawable != null) { setLeftImageDrawable(builder.mLeftImageDrawable); } mSlideDirection = builder.mDirection; mCallback = builder.mNotificationCallback; mUndoCallback = builder.mUndoCallback; mOnGFMinimalNotificationClickListener = builder.mListener; } public GFUndoNotification(Context context) { this(context, LENGTH_SHORT); } public GFUndoNotification(Context context, long duration) { mNotificationViewHeight = context.getResources().getDimensionPixelSize(R.dimen.notification_height); setDuration(duration); init(context); } public GFUndoNotification(Context context, int titleResId) { this(context, titleResId, LENGTH_SHORT); } public GFUndoNotification(Context context, String title) { this(context, title, null, LENGTH_SHORT); } public GFUndoNotification(Context context, int titleResId, int subtitleResId) { this(context, titleResId, subtitleResId, LENGTH_SHORT); } public GFUndoNotification(Context context, String title, String subtitle) { this(context, title, subtitle, LENGTH_SHORT); } public GFUndoNotification(Context context, int titleResId, long duration) { this(context, context.getString(titleResId), null, duration); } public GFUndoNotification(Context context, int titleResId, int subtitleResId, long duration) { this(context, context.getString(titleResId), context.getString(subtitleResId), duration); } public GFUndoNotification(Context context, String title, long duration) { this(context, title, null, duration); } public GFUndoNotification(Context context, String title, String subtitle, long duration) { if (duration > 0) { mDuration = duration; mCanSelfDismiss = true; } else { mCanSelfDismiss = false; } mNotificationViewHeight = context.getResources().getDimensionPixelSize(R.dimen.notification_height); init(context); setTitleText(title); setSubtitleText(subtitle); } /** * Static method to instantiate GFUndoNotification to build the notification * * @param context Context to be used to inflate the undo notification and set additional values * @return GFUndoNotification */ public static GFUndoNotification with(Context context) { return new GFUndoNotification(context); } /** * @param callback The desired callback to be fired when the notification is shown, dismissed, or when the undo action should be performed * @return GFUndoNotification */ public GFUndoNotification setGFUndoNotificationCallback(GFUndoNotificationCallback callback) { mUndoCallback = callback; return this; } /** * If the notification is already showing, you may update it with a Builder. NOTE: Slide Direction cannot change in this instance if * notification is already showing * * @param builder Builder to build the notification view * @return GFUndoNotification */ public GFUndoNotification updateFromBuilder(Builder builder) { setTitleText(builder.mTitle); setSubtitleText(builder.mSubtitle); mAnimationDuration = builder.mAnimationDuration; if (builder.mBackground != null) { setNotificationBackground(builder.mBackground); } if (builder.mLeftView != null) { setLeftView(builder.mLeftView); } else if (builder.mLeftImageDrawable != null) { setLeftImageDrawable(builder.mLeftImageDrawable); } mSlideDirection = builder.mDirection; mCallback = builder.mNotificationCallback; mUndoCallback = builder.mUndoCallback; mOnGFMinimalNotificationClickListener = builder.mListener; if (isShowing()) { doShow(); } return this; } /** * Do to this being an undo notification, no styling may be applied. To apply styling, you may call any of the provided * methods to alter the notification background, alter the title or subtitle text colors/fonts, etc. * * @param style The desired GFMinimalNotificationStyle * @return GFUndoNotification */ @Override public GFUndoNotification setStyle(GFMinimalNotificationStyle style) { // no styling available for undo notifications return this; } /** * Do to this being an undo notification, the right view is a text view and may not be altered unless you call getUndoView() * * @param imageResId The desired image resource to be set as the right view if not replaced * @return GFUndoNotification */ @Override public GFMinimalNotification setRightImageResource(int imageResId) { // right view unavailable, right view is the undo option return this; } /** * Do to this being an undo notification, the right view is a text view and may not be altered unless you call getUndoView() * * @param drawable The desired drawable to be set as the right view if not replaced * @return GFUndoNotification */ @Override public GFUndoNotification setRightImageDrawable(Drawable drawable) { // right view unavailable, right view is the undo option return this; } /** * Do to this being an undo notification, the right view is a text view and may not be altered unless you call getUndoView() * * @param visible Set the right view visible or not * @return GFUndoNotification */ @Override public GFUndoNotification setRightImageVisible(boolean visible) { // right view unavailable, right view is the undo option return this; } /** * @param view The desired view to replace the current right view * @return GFUndoNotification */ @Override public GFUndoNotification setRightView(View view) { // right view unavailable, right view is the undo option return this; } /** * Returns the undo text view so you may alter it's color, background, font, etc. * * @return TextView */ public TextView getUndoView() { return (TextView) getRightView(); } /** * @param v View clicked */ @Override public void onClick(View v) { if (v.getId() == mRightView.getId()) { if (mUndoCallback != null) { mUndoCallback.onUndoAction(this); } } super.onClick(v); } @Override protected int getNotificationLayout() { return R.layout.layout_gf_undo_notification; } @Override protected void initViews(Context context) { super.initViews(context); mRightView.setOnClickListener(this); setSlideDirection(SLIDE_BOTTOM); setNotificationBackgroundColor(context.getResources().getColor(R.color.gf_notification_black)); } public static class Builder { private Context mContext; private long mDuration = LENGTH_SHORT; private long mAnimationDuration = DEFAULT_ANIMATION_DURATION; private String mTitle; private String mSubtitle; private Drawable mLeftImageDrawable; private View mLeftView; private Drawable mBackground; private int mDirection = SLIDE_BOTTOM; private GFMinimalNotificationCallback mNotificationCallback; private GFUndoNotificationCallback mUndoCallback; private OnGFMinimalNotificationClickListener mListener; public Builder(Context context) { mContext = context; } public Builder duration(long duration) { mDuration = duration; return this; } public Builder animationDuration(long animationDuration) { mAnimationDuration = animationDuration; return this; } public Builder title(int titleResId) { return title(mContext.getString(titleResId)); } public Builder title(String title) { mTitle = title; return this; } public Builder subtitle(int subtitleResId) { return subtitle(mContext.getString(subtitleResId)); } public Builder subtitle(String subtitle) { mSubtitle = subtitle; return this; } public Builder leftImage(int imageRes) { return leftImage(mContext.getResources().getDrawable(imageRes)); } public Builder leftImage(Drawable drawable) { mLeftImageDrawable = drawable; return this; } public Builder leftView(View view) { mLeftView = view; return this; } public Builder backgroundColor(int color) { return background(new ColorDrawable(color)); } public Builder background(int backgroundRes) { return background(mContext.getResources().getDrawable(backgroundRes)); } public Builder background(Drawable drawable) { mBackground = drawable; return this; } public Builder direction(int direction) { mDirection = direction; return this; } public Builder notificationCallback(GFMinimalNotificationCallback callback) { mNotificationCallback = callback; return this; } public Builder undoCallback(GFUndoNotificationCallback callback) { mUndoCallback = callback; return this; } public Builder clickListener(OnGFMinimalNotificationClickListener listener) { mListener = listener; return this; } public GFUndoNotification build() { return new GFUndoNotification(this); } public void show(ViewGroup viewGroup) { build().show(viewGroup); } } }
[ "lgfz71@gmail.com" ]
lgfz71@gmail.com
314aebd998408a9d4a136ac656f3f8ee9ad823ff
721c8b0ebcef970d5b726e69f3412fd6f4aba549
/Vidhvaa/src/objectDetails_VidhvaasModelQuestions/ModelQuestions_2.java
d8fc42b8a8fea7b0243266ace809fcb2a8ab180a
[]
no_license
Vickyradan/Java
54ddc3141fe4cfe98a44761dc486317a1485bcfb
5190885925aab10720cff6fbcc0b401fa066d28f
refs/heads/main
2023-08-19T14:25:39.492891
2021-11-02T09:53:28
2021-11-02T09:53:28
356,565,192
0
0
null
null
null
null
UTF-8
Java
false
false
371
java
package objectDetails_VidhvaasModelQuestions; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; public class ModelQuestions_2 { @FindBy(xpath="//*[@id='hid5']/h3/a") public static WebElement VidhvaaModelQuestion; @FindBy(xpath="//*[@id='tab-11']/div/div/div/div[2]/div[2]/a") public static WebElement question2; }
[ "KAVINESH@KAVINESH-PC" ]
KAVINESH@KAVINESH-PC
787bccee48d143aef06ba5650c83ba5c221a2692
17391171a078bbd9bd2889fbeb8d8441101e6602
/SpringFramework5/spring5-recipe-app/src/main/java/guru/springframework/recipe/repositories/RecipeRepository.java
b35b3b7ab939c504276a4fc25d4f6835a306da49
[]
no_license
iamVaibhavPatil/SpringFramework
f0369a6872cc41ef122e52a336b4f03ea21ae4b0
42eb78373dea2f4673c551520060d7190556e62c
refs/heads/master
2020-03-23T18:41:24.095127
2019-02-12T22:26:04
2019-02-12T22:26:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
299
java
package guru.springframework.recipe.repositories; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; import guru.springframework.recipe.domain.Recipe; @Repository public interface RecipeRepository extends CrudRepository<Recipe, Long>{ }
[ "Vaibhav228@gmail.com" ]
Vaibhav228@gmail.com
2b7f552a3f0a3b95f9314ef8582dae92a6e0ba5a
1fdfc6c5b22cfb5cd3ddcb2def2342194380258b
/src/main/java/com/tarikh/interview/starling/api/TransactionDTO.java
6e8699f95fcfd6e3e5d11d8baab6d2d904f64a33
[]
no_license
tcho16/starling
aff953213fd50c9f8a91ce949c75674eb8dd977a
338e4d48330c0b123933fd396448000f8a1a0635
refs/heads/main
2023-08-24T18:49:24.237385
2021-10-27T18:36:31
2021-10-27T18:36:31
419,115,770
0
0
null
null
null
null
UTF-8
Java
false
false
491
java
package com.tarikh.interview.starling.api; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import lombok.Data; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; @Slf4j @NoArgsConstructor @Data @JsonIgnoreProperties(ignoreUnknown = true) public class TransactionDTO { @JsonProperty("accountUid") private int transactionAmount; }
[ "tarik_chouhan@msn.com" ]
tarik_chouhan@msn.com
5b047241a023c7db3fa91945b43aff361f0a6000
10e1fe4940718d045f980577b82dd427315153e0
/src/android/Starbuzz/app/build/generated/source/buildConfig/debug/com/example/starbuzz/BuildConfig.java
dfe07937a3f54ae7154d57342bfd685080d8a979
[]
no_license
ValenbergHar/G-JD1-2019-10-01_ValenbergHar
6b693f08becdf624b235170712e552a4ff148ac3
bff38b21a10594cdfa7a719c216c04614cc01ac3
refs/heads/master
2022-12-22T12:10:22.999080
2020-10-20T21:02:01
2020-10-20T21:02:01
212,853,204
0
1
null
2022-12-16T15:42:29
2019-10-04T16:00:20
Java
UTF-8
Java
false
false
447
java
/** * Automatically generated file. DO NOT MODIFY */ package com.example.starbuzz; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.example.starbuzz"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
[ "maskevich.valeri@gmail.com" ]
maskevich.valeri@gmail.com
5c6e049b6f02e88324cdaead2cc4bf617f214269
330292fa94bc678e06746b709335a29934feccf3
/app/src/main/java/com/jsj/designpatterns/singleton/ContainerSingleton.java
b8010ab4ae22c5171eb6f8d2f50ab093cab64a0a
[]
no_license
jiangshujing/DesignPatterns
60108db54da45d86f41f9f8547a5b42b01518a1f
a0f705869c54e5a59241d7110b967b2e22d22e18
refs/heads/master
2021-09-07T17:41:24.972589
2018-02-27T01:33:47
2018-02-27T01:33:47
109,373,512
0
0
null
null
null
null
UTF-8
Java
false
false
163
java
package com.jsj.designpatterns.singleton; /** * Created by jiangshujing on 2018/2/26. * 使用容器实现单例模式 */ public class ContainerSingleton { }
[ "jiangshujing@jinlinbao.com" ]
jiangshujing@jinlinbao.com
656c7c515fdf4d3957cd4ad0807216c74e979f50
70e0b8fb7fb52e7f9e9b47a69f8a9b54802a652f
/sdu.mdsd.restful/src-gen/sdu/mdsd/restful/serializer/RestControllerGenerationSyntacticSequencer.java
c4ad0c3e9fc0b0c5887dd3c88224b42ae626cfaf
[]
no_license
dstoft/MdsdpRestfulProject
c5e3d7c8deeb478183baebd35802a2964330e3c3
84d76eb310064b3821a06850f3bb051dbf28fdb4
refs/heads/master
2023-05-04T05:35:10.992724
2021-05-26T13:56:14
2021-05-26T13:56:14
352,556,255
0
0
null
null
null
null
UTF-8
Java
false
false
3,497
java
/* * generated by Xtext 2.24.0 */ package sdu.mdsd.restful.serializer; import com.google.inject.Inject; import java.util.List; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.IGrammarAccess; import org.eclipse.xtext.RuleCall; import org.eclipse.xtext.nodemodel.INode; import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias; import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias; import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable; import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition; import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer; import sdu.mdsd.restful.services.RestControllerGenerationGrammarAccess; @SuppressWarnings("all") public class RestControllerGenerationSyntacticSequencer extends AbstractSyntacticSequencer { protected RestControllerGenerationGrammarAccess grammarAccess; protected AbstractElementAlias match_Primitive_LeftParenthesisKeyword_3_0_a; protected AbstractElementAlias match_Primitive_LeftParenthesisKeyword_3_0_p; @Inject protected void init(IGrammarAccess access) { grammarAccess = (RestControllerGenerationGrammarAccess) access; match_Primitive_LeftParenthesisKeyword_3_0_a = new TokenAlias(true, true, grammarAccess.getPrimitiveAccess().getLeftParenthesisKeyword_3_0()); match_Primitive_LeftParenthesisKeyword_3_0_p = new TokenAlias(true, false, grammarAccess.getPrimitiveAccess().getLeftParenthesisKeyword_3_0()); } @Override protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) { return ""; } @Override protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) { if (transition.getAmbiguousSyntaxes().isEmpty()) return; List<INode> transitionNodes = collectNodes(fromNode, toNode); for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) { List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax); if (match_Primitive_LeftParenthesisKeyword_3_0_a.equals(syntax)) emit_Primitive_LeftParenthesisKeyword_3_0_a(semanticObject, getLastNavigableState(), syntaxNodes); else if (match_Primitive_LeftParenthesisKeyword_3_0_p.equals(syntax)) emit_Primitive_LeftParenthesisKeyword_3_0_p(semanticObject, getLastNavigableState(), syntaxNodes); else acceptNodes(getLastNavigableState(), syntaxNodes); } } /** * Ambiguous syntax: * '('* * * This ambiguous syntax occurs at: * (rule start) (ambiguity) reference=[Attribute|ID] * (rule start) (ambiguity) value=INT * (rule start) (ambiguity) varName=[Attribute|ID] * (rule start) (ambiguity) {Add.left=} * (rule start) (ambiguity) {Div.left=} * (rule start) (ambiguity) {Mul.left=} * (rule start) (ambiguity) {Sub.left=} */ protected void emit_Primitive_LeftParenthesisKeyword_3_0_a(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); } /** * Ambiguous syntax: * '('+ * * This ambiguous syntax occurs at: * (rule start) (ambiguity) {Add.left=} * (rule start) (ambiguity) {Div.left=} * (rule start) (ambiguity) {Mul.left=} * (rule start) (ambiguity) {Sub.left=} */ protected void emit_Primitive_LeftParenthesisKeyword_3_0_p(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); } }
[ "dstoft@hotmail.com" ]
dstoft@hotmail.com
2f02fd60335316a47727b10463f779ca2dfbb61c
8d1142c34f7ef5cb63c5e3115f4b58e19c036b51
/dump-code/panelpower/retrofit2.Callback.java
db0ca301b38faf032b87a9c2e675725ae9586fb4
[]
no_license
kingking888/android-auto-hack
b19c979f2c39a3584ba5841c7b13b253cfc798c8
e91cb827c7ebf53ad253f965df55bfcaa9e82c32
refs/heads/master
2021-01-26T11:09:51.958052
2020-02-27T02:59:49
2020-02-27T02:59:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
158
java
package retrofit2; public interface Callback<T> { void onFailure(Call<T> call, Throwable th); void onResponse(Call<T> call, Response<T> response); }
[ "rjsdid7325@naver.com" ]
rjsdid7325@naver.com
e29fd99ab0589178ac0ad6f232856cf86baf40aa
2e4777a071b4776016b2d322c8ea5a029c7c39c1
/socketandroidclient-master/app/src/main/java/fi/metropolia/chatclient/MainActivity.java
978e195ca50e87c5cb15d10efd92e4b5cbf04cc8
[]
no_license
Apollina/javaChatAndroidClient
5447f3935c0394a461c013f9f893b9061f43f3a7
ddeb375e42cdb7689ee5ad4c5942863a7350d6dc
refs/heads/master
2021-01-10T22:14:38.363886
2016-10-08T13:53:54
2016-10-08T13:53:54
70,334,216
0
0
null
null
null
null
UTF-8
Java
false
false
6,532
java
package fi.metropolia.chatclient; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; import com.joanzapata.iconify.IconDrawable; import com.joanzapata.iconify.Iconify; import com.joanzapata.iconify.fonts.FontAwesomeIcons; import com.joanzapata.iconify.fonts.FontAwesomeModule; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import fi.metropolia.chatclient.chat.ChatClient; import fi.metropolia.chatclient.chat.ChatClient.ChatClientObserver; import fi.metropolia.chatclient.chat.History.HistoryChangeListener; import fi.metropolia.chatclient.chat.Message; import fi.metropolia.chatclient.models.Settings; import fi.metropolia.chatclient.models.UserSession; public class MainActivity extends AppCompatActivity implements ChatClientObserver, HistoryChangeListener, TextWatcher, OnEditorActionListener { private static final int LOGIN_ACTIVITY_CODE = 88; @BindView(R.id.messageInput) EditText messageInput; @BindView(R.id.listView) ListView messagesListView; @BindView(R.id.sendButton) Button sendButton; @BindView(R.id.toolbar) Toolbar toolbar; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Iconify.with(new FontAwesomeModule()); Settings.initialize(getApplicationContext()); ButterKnife.bind(this); messageInput.addTextChangedListener(this); messageInput.setOnEditorActionListener(this); setSupportActionBar(toolbar); if (!UserSession.getInstance().isOpen()) { showLoginScreen(); } } public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main_menu, menu); menu.findItem(R.id.users).setIcon( new IconDrawable(this, FontAwesomeIcons.fa_users) .colorRes(android.R.color.white) .actionBarSize() ); menu.findItem(R.id.logout).setIcon( new IconDrawable(this, FontAwesomeIcons.fa_sign_out) .colorRes(android.R.color.white) .actionBarSize() ); return true; } public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.users: usersButtonPressed(); return true; case R.id.logout: logoutButtonPressed(); return true; default: return super.onOptionsItemSelected(item); } } private void showLoginScreen() { startActivityForResult(new Intent(this, LoginActivity.class), LOGIN_ACTIVITY_CODE); } private void resetHistory() { onHistoryUpdated(new ArrayList<Message>()); } protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == LOGIN_ACTIVITY_CODE && resultCode == -1) { onSuccessfulLogin(); } } protected void onPause() { super.onPause(); deregisterNotifications(); } protected void onResume() { super.onResume(); if (UserSession.getInstance().isOpen()) { ChatClient.getInstance().registerObserver(this); ChatClient.getInstance().getHistory().setListener(this); ChatClient.getInstance().loadHistory(); ChatClient.getInstance().loadUsers(); } } private void deregisterNotifications() { ChatClient.getInstance().deregisterObserver(this); ChatClient.getInstance().getHistory().setListener(null); } private void onSuccessfulLogin() { } private void logoutButtonPressed() { new AlertDialog.Builder(this) .setTitle(R.string.log_out_warning) .setPositiveButton(R.string.action_log_out, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { deregisterNotifications(); ChatClient.getInstance().disconnect(); UserSession.getInstance().close(); showLoginScreen(); resetHistory(); } }) .setNegativeButton(R.string.action_cancel, null) .show(); } private void usersButtonPressed() { startActivity(new Intent(this, UsersActivity.class)); } @OnClick({R.id.sendButton}) public void sendButtonPressed() { String message = messageInput.getText().toString(); messageInput.setText(""); ChatClient.getInstance().sendMessage(message); } public void onError(Exception error) { onConnectionError(error); } public void onUsernameRegistered(String username) { } public void onHistoryUpdated(List<Message> history) { messagesListView.setAdapter(new ChatListAdapter(this, history)); } public void onConnectedToSocket() { } public void onConnectionError(Exception error) { Snackbar.make(findViewById(android.R.id.content), error.getMessage(), Snackbar.LENGTH_INDEFINITE).show(); } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void onTextChanged(CharSequence s, int start, int before, int count) { } public void afterTextChanged(Editable s) { this.sendButton.setEnabled(!TextUtils.isEmpty(s)); } public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId != 4 || TextUtils.isEmpty(v.getText())) { return false; } sendButtonPressed(); return true; } }
[ "apollinariia.gainulenko@gmail.com" ]
apollinariia.gainulenko@gmail.com
a7a993158d2247b0d7c2eb63240204aea8e20cd6
e77f3d9e6be6a23230797984c8bea3bd70e0d6b5
/src/zoohandlung/Schwimmen.java
a3f9d3f59cd7a858e8cd15350410dc1f8191928a
[]
no_license
timA0123/Zoohandlung_Interfaces
ce4ca3ddff6e1153119295295ec4b5caf3e04ef1
f836b2ea5d4078e8ec1f1083e9fd295074e70b07
refs/heads/master
2021-01-24T04:19:53.697620
2018-02-26T08:16:47
2018-02-26T08:16:47
122,930,266
0
0
null
null
null
null
UTF-8
Java
false
false
92
java
package zoohandlung; public interface Schwimmen { public void schwimme(); }
[ "t.ladenburger@IR1-PC-04.musterschule.schule.paedml" ]
t.ladenburger@IR1-PC-04.musterschule.schule.paedml
45fef4a6580dd227bebfff70ec18f5c019d37192
2c4cf46179743b2458c55f794b0fe178ac79f9e2
/src/com/qiheng/server/ServerMessageThread.java
60dea58597050690e6313dd6f28d618c51464fc2
[]
no_license
wlgcqh/qh
98af882ab0d145881c422ff099b6a9ac1bf56ba8
9a349716511a607937f22eeec4800ac28ac18835
refs/heads/master
2020-09-22T18:01:54.247861
2014-12-09T14:03:57
2014-12-09T14:03:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,108
java
package com.qiheng.server; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; import java.util.Collection; import java.util.Map; import java.util.Set; import com.qiheng.util.CharacterUtil; import com.qiheng.util.XMLUtil; public class ServerMessageThread extends Thread { private Server server; private InputStream in; private OutputStream out; public ServerMessageThread(Server server, Socket socket) { try { this.server = server; this.in = socket.getInputStream(); this.out = socket.getOutputStream(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // 更新用户列表 // 首先更新服务器端用户列表,然后更新用户端 public void updateUserList() { // 用户名集合 Set<String> users = this.server.getMap().keySet(); // 构造向客户端发送的信息 String xml = XMLUtil.constructUserList(users); String str = ""; for (String user : users) { str += user + "\n"; } // 更新服务器端列表 this.server.getTextarea().setText(str); // 更新客户端列表 Collection<ServerMessageThread> cols = this.server.getMap().values(); for (ServerMessageThread smt : cols) { smt.sendMessage(xml); } } public void sendMessage(String message) { try { this.out.write(message.getBytes()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void run() { while (true) { try { byte[] buf = new byte[5000]; int length = this.in.read(buf); // 客户端发来的信息 String xml = new String(buf, 0, length); int type = Integer.parseInt(XMLUtil.getType(xml)); // 聊天数据 if (type == CharacterUtil.CLIENT_MESSAGE) { // System.out.println(xml); // 解析出用户名 String username = XMLUtil.extractUsername(xml); // 解析出聊天内容 String content = XMLUtil.extractContent(xml); // 构造像客户端发送的信息 String message = username + ":" + content; String xmlMessage=XMLUtil.constructServerMessageXML(message); Map<String, ServerMessageThread> map=this.server.getMap(); Collection<ServerMessageThread> cols = map.values(); for (ServerMessageThread smt : cols) { smt.sendMessage(xmlMessage); } } //关闭客户端窗口 else if(type == CharacterUtil.CLIENT_CLOSED){ String user=XMLUtil.extractUsername(xml); //获得待删除线程对象 ServerMessageThread smt = this.server.getMap().get(user); //向客户端发送退出信息 smt.sendMessage(xml); //从用户列表中将该用户删除 this.server.getMap().remove(user); //更新用户列表 this.updateUserList(); this.in.close(); this.out.close(); break;//关闭线程 } } catch (Exception e) { e.printStackTrace(); } } } }
[ "1074141657@qq.com" ]
1074141657@qq.com
346f8f52e57a1e7f54a61e61277cfdcb911b3e7c
32069bde2dcfb5c142e3118509e1d9737312bd84
/net.opensg.tcs.multiedit/src/net/opensg/tcs/multiedit/views/ContEditor.java
c96f25855d4d33903b40c0e95f7a98c7830ac7ae
[]
no_license
radiobaek01/start
91ca2c006a640dc120f7723cb9543108480371f8
59f5ebd5e2d3b93787cfdf343ca57a0ca95740b0
refs/heads/master
2020-05-29T11:46:58.143794
2015-04-13T10:31:03
2015-04-13T10:31:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,782
java
package net.opensg.tcs.multiedit.views; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorSite; import org.eclipse.ui.PartInitException; import org.eclipse.ui.part.EditorPart; public class ContEditor extends EditorPart { public static final String ID = "net.opensg.tcs.multiedit.views.ContEditor"; //$NON-NLS-1$ private Display display = null; private TableViewer tableViewer = null; private Table table; public ContEditor() { } /** * Create contents of the editor part. * @param parent */ @Override public void createPartControl(Composite parent) { this.display = parent.getDisplay(); parent.setLayout(new GridLayout(1, false)); // (1) Create Table tableViewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION); table = tableViewer.getTable(); table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); table.setLinesVisible(true); table.setHeaderVisible(true); // (2) Create Columns TableViewerColumn viewerColName = new TableViewerColumn(tableViewer, SWT.NONE); TableColumn tblColName = viewerColName.getColumn(); tblColName.setWidth(150); tblColName.setText("Name"); TableViewerColumn viewerColEmail = new TableViewerColumn(tableViewer, SWT.NONE); TableColumn tblColEmail = viewerColEmail.getColumn(); tblColEmail.setWidth(150); tblColEmail.setText("E-Mail"); TableViewerColumn viewerColPhone = new TableViewerColumn(tableViewer, SWT.NONE); TableColumn tblColPhone = viewerColPhone.getColumn(); tblColPhone.setWidth(150); tblColPhone.setText("Phone"); tableViewer.setContentProvider(new ContEditorContentProvider()); tableViewer.setLabelProvider(new ContEditorLabelProvider()); } public void BindData(Object data) { tableViewer.setInput(data); } @Override public void setFocus() { // Set the focus } @Override public void doSave(IProgressMonitor monitor) { // Do the Save operation } @Override public void doSaveAs() { // Do the Save As operation } @Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { // Initialize the editor part } @Override public boolean isDirty() { return false; } @Override public boolean isSaveAsAllowed() { return false; } }
[ "radiobaek@naver.com" ]
radiobaek@naver.com
eec6bfaea84dd13cd5892587fac4b97c3f38499f
7d0171539b3cb38f593ba57cce6b0e3e9741abcb
/demo-dubbo-provider-remote/src/main/java/com/example/provider/service/CmsConfServiceImpl.java
75e7dbd6fb157577770b0a7f9a2a333f973ee6c4
[]
no_license
zdbao/dubbo2springCloud
1b197b2264868011f96ccdefb0e2a10b2dd372bc
af847c4f7b25e2d8e116449273ea9ddd75451b28
refs/heads/master
2022-06-28T19:49:36.988949
2020-03-02T10:46:09
2020-03-02T10:46:09
243,706,458
1
1
null
2022-06-17T02:58:38
2020-02-28T07:45:22
Java
UTF-8
Java
false
false
1,963
java
package com.example.provider.service; import com.alibaba.fastjson.JSON; import com.example.provider.dto.CmsConfList; import org.apache.dubbo.config.annotation.Service; import org.springframework.util.Assert; import java.util.*; @Service public class CmsConfServiceImpl implements CmsConfService{ @Override public Map<String, String> getByConfKey(String confKey) { Assert.notNull(confKey,"confKey not null"); Map<String,String> map = new HashMap<>(); map.put("success","true"); map.put("confKey",confKey); return map; } @Override public List<CmsConfList> getCmsConfList(String title, String confKey, String productName, Integer showStatus) { CmsConfList cmsConfList = new CmsConfList(); cmsConfList.setConfKey(confKey); cmsConfList.setTitle(title); cmsConfList.setProductName(productName); cmsConfList.setId(showStatus); cmsConfList.setUpdateTime(new Date()); List<CmsConfList> list = new ArrayList<>(); list.add(cmsConfList); return list; } @Override public String addCmsConfList(CmsConfList dto) { return "添加成功: " + JSON.toJSONString(dto); } @Override public Map<String, String> getCmsConfNodeList(String confKey, Integer level) { Map<String,String> map = new HashMap<>(); map.put("success","true"); map.put("ms","我是重载方法1"); map.put("confKey",confKey); map.put("level",String.valueOf(level)); return map; } @Override public Map<String, String> getCmsConfNodeList(String confKey, Integer level, Integer parentId) { Map<String,String> map = new HashMap<>(); map.put("success","true"); map.put("ms","我是重载方法2"); map.put("confKey",confKey); map.put("level",String.valueOf(level)); map.put("parentId",String.valueOf(parentId)); return map; } }
[ "85004510@qq.com" ]
85004510@qq.com
81bec235f093fc344ce66031c65394f057dbe72e
b2c250888458d48c5c3f6f61378bd913a324ef03
/src/main/java/com/panda/study/design/pattern/delegate/employ/Boss.java
1e261e02bc4e7d958845665e2dcb0955ce753092
[]
no_license
zhangwei921003/design-principle
c69721334382676385c6d00a7b24dfa1ae9fa821
e1ece7914a52b7d19a582ae22466254337b5e55e
refs/heads/master
2022-12-21T08:59:02.078235
2020-03-31T08:31:47
2020-03-31T08:31:47
247,595,936
0
0
null
2022-12-16T15:28:23
2020-03-16T02:46:49
Java
UTF-8
Java
false
false
168
java
package com.panda.study.design.pattern.delegate.employ; public class Boss { public void command(String task, Leader leader) { leader.doing(task); } }
[ "wei.zhang5@baozun.com" ]
wei.zhang5@baozun.com
16affce2b1bcb4d89abbd8c55e8c866642ae7e81
4f725e2596813d9ecd00b0b103e90800d48fb24e
/prj/src/main/java/co/park/prj/common/Home.java
36c7815ede608af74ca7eddb32e40db0933af886
[]
no_license
dngur1278/JSP
cb1385547b77ac4a65df6781a839dfce42dea8bf
7496ded0ed9f4c5902572d7c118edb33e08f6833
refs/heads/master
2023-06-27T19:17:11.413240
2021-08-02T18:17:38
2021-08-02T18:17:38
388,379,149
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package co.park.prj.common; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Home implements Command { @Override public String execute(HttpServletRequest request, HttpServletResponse response) { // TODO Auto-generated method stub return "home/home"; } }
[ "dngur1278@naver.com" ]
dngur1278@naver.com
8f5b0514b2c4c81a4527add2b9a34fb525687361
0ca74be41f99150e743e2ef9083c3fd578d6be3c
/ToDo_App/src/main/java/com/bridgeit/todo/user/utility/UserEmailNotFound.java
0a4bf29fbea8da325e18be646f5e3040c2980e08
[]
no_license
FAIROJ123/ToDo
08301058d7e344dcc68437f84eb1ad19321396ed
9df902ec68ed50cfe75c498c3f2419f43084fbd7
refs/heads/master
2020-03-22T05:32:38.195512
2018-08-28T05:08:03
2018-08-28T05:08:03
139,573,344
0
0
null
null
null
null
UTF-8
Java
false
false
163
java
package com.bridgeit.todo.user.utility; public class UserEmailNotFound extends Exception{ public UserEmailNotFound(String msg) { super(msg); } }
[ "you@example.com" ]
you@example.com
db480852d3eb730ba1cdbe00403073bb0ec847b1
9a8e3137db2b3e29dceb170887144e991974c1f2
/rsc/rsc/TheLoveMachine/TLM/KeyHandler.java
5a066d50de5d9542b15148a955a11f58b5091bbd
[]
no_license
drewjbartlett/runescape-classic-dump
07155b735cfb6bf7b7b727557d1dd0c6f8e0db0b
f90e3bcc77ffb7ea4a78f087951f1d4cb0f6ad8e
refs/heads/master
2021-01-19T21:32:45.000029
2015-09-05T22:36:22
2015-09-05T22:36:22
88,663,647
1
0
null
2017-04-18T19:40:23
2017-04-18T19:40:23
null
UTF-8
Java
false
false
444
java
// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 19/09/2004 20:04:12 // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version! // Decompiler options: packimports(3) // Source File Name: KeyHandler.java import java.awt.*; public interface KeyHandler { public abstract int[] getAssociatedKeys(); public abstract void activate(int i, KeyState ks, boolean down); }
[ "tom@tom-fitzhenry.me.uk" ]
tom@tom-fitzhenry.me.uk
cf625933657a5669cce9ce38a5e1df5fb4b76f18
4f51388d0217982d540ea0930c2ce021e7f49c79
/basic-code/day02-code/src/cn/itcast/day06code/Demo01/Demo04Student.java
04ab7a7c15497035a55d541e4612f9a61d20b7c0
[]
no_license
Miku-1/IdeaProjects
4cae4861e8699433f096a2a2d5f59a0da1e048cf
aa623294930ce55a7ece2ef04c6b9f257047c9fc
refs/heads/master
2022-08-22T17:44:06.573392
2019-12-21T07:37:09
2019-12-21T07:37:09
226,094,917
0
0
null
null
null
null
UTF-8
Java
false
false
300
java
package cn.itcast.day06code.Demo01; public class Demo04Student { public static void main(String[] args) { Student stu1 = new Student(); Student stu2 = new Student("南球",22); // System.out.println(stu1); System.out.println(stu2.getName()+stu2.getAge()); } }
[ "huanyue521@outlook.com" ]
huanyue521@outlook.com
6ff64b8fb9e0082b6209a93be1b2eb3e63cf03d2
2ec14c0ec6b9460a370bc3c181b2dac40188f327
/Project_Folder/group14/app/src/main/java/calculotprototype/g14/cmpt276/calculot_prototype/Classes/CrystalBall.java
0e5043ca21389092c295f01645382ba83f6f81e7
[]
no_license
jacebedo/Calculot_276
13694b653da20af97f06ecea415d4dd5a4fe4125
eddb676a76efc08146d0f330460ae0283f24dd36
refs/heads/master
2021-01-22T17:53:05.574697
2017-09-04T22:21:29
2017-09-04T22:21:29
102,407,251
0
0
null
null
null
null
UTF-8
Java
false
false
978
java
package calculotprototype.g14.cmpt276.calculot_prototype.Classes; public class CrystalBall { //fields private float Mass = 360; //initial shell filled (+1%)? for second chance private int ShellLevel = 1; private int ShellLevelMax; float ShellWidth; //Constructor CrystalBall(int _ShellLevelMax, int _sidelength) { ShellLevelMax = _ShellLevelMax; ShellWidth = _sidelength / (_ShellLevelMax + 1); setShellLevel(); } //Private Methods private void setShellLevel() { ShellLevel = (int) Math.floor(Mass / 360); } //Public Methods public void changeMass(int _mass) { Mass += (float) _mass; setShellLevel(); } public float getMass() { return Mass; } public int getShellLevel() { return ShellLevel; } public float getShellWidth() { return ShellWidth; } public int getShellLevelMax() { return ShellLevelMax; } }
[ "kza21@sfu.ca" ]
kza21@sfu.ca
ea24849ec94af1db37f1dac323d4b17a677e4353
346caf3e07cc60d1463b9ca1d3bca698796c7160
/src/Fundamentals/BasicProgModel/Exec_1_1_21.java
0b26b168c1ebbdb2a2a8bd13422b2b4eaadabd25
[]
no_license
dadisdad/AlgorithmSedgewickJava
678c12fd8924244551febd1ee77930a700164e2a
87e58d27409498ee67fea02829a8bb1eba6691d4
refs/heads/master
2021-09-10T22:19:09.040514
2018-04-03T07:37:20
2018-04-03T07:37:20
90,644,033
0
0
null
null
null
null
UTF-8
Java
false
false
473
java
package Fundamentals.BasicProgModel; import Std.In; import Std.StdIn; import Std.StdOut; /** * Created by dadisdad on 2017/7/5. */ public class Exec_1_1_21 { public static void main(String[] args) { String ss = StdIn.readLine(); String[] a = ss.split(" "); double b = Double.parseDouble(a[1]); double c = Double.parseDouble(a[2]); double res = b / c; StdOut.printf("%s %s %s %10.3f", a[0], a[1], a[2], res); } }
[ "1030839531@qq.com" ]
1030839531@qq.com
ab6145903e4123caecaa5be93d2f00d7ca3e3f70
f4e15ee34808877459d81fd601d6be03bdfb4a9d
/com/sun/tools/xjc/reader/annotator/RelationNormalizer.java
eca48406a7c51cc446c6a99d56a0efb62eba843e
[]
no_license
Lianite/wurm-server-reference
369081debfa72f44eafc6a080002c4a3970f8385
e4dd8701e4af13901268cf9a9fa206fcb5196ff0
refs/heads/master
2023-07-22T16:06:23.426163
2020-04-07T23:15:35
2020-04-07T23:15:35
253,933,452
0
0
null
null
null
null
UTF-8
Java
false
false
17,243
java
// // Decompiled by Procyon v0.5.30 // package com.sun.tools.xjc.reader.annotator; import com.sun.msv.grammar.util.ExpressionPrinter; import com.sun.msv.datatype.DatabindableDatatype; import com.sun.tools.xjc.grammar.xducer.Transducer; import com.sun.msv.datatype.xsd.XSDatatype; import com.sun.msv.datatype.xsd.StringType; import com.sun.tools.xjc.grammar.xducer.IdentityTransducer; import com.sun.tools.xjc.grammar.ExternalItem; import com.sun.tools.xjc.grammar.TypeItem; import com.sun.tools.xjc.grammar.util.AnnotationRemover; import com.sun.msv.grammar.OtherExp; import com.sun.msv.grammar.ReferenceExp; import com.sun.msv.grammar.ValueExp; import com.sun.msv.grammar.DataExp; import com.sun.msv.grammar.OneOrMoreExp; import com.sun.msv.grammar.InterleaveExp; import com.sun.msv.grammar.SequenceExp; import com.sun.msv.grammar.ChoiceExp; import com.sun.msv.grammar.ConcurExp; import com.sun.msv.grammar.ListExp; import com.sun.msv.grammar.MixedExp; import com.sun.msv.grammar.trex.ElementPattern; import com.sun.msv.grammar.ElementExp; import com.sun.msv.grammar.Expression; import com.sun.msv.grammar.AttributeExp; import com.sun.tools.xjc.grammar.util.Multiplicity; import com.sun.tools.xjc.grammar.JavaItem; import com.sun.tools.xjc.grammar.IgnoreItem; import com.sun.tools.xjc.grammar.PrimitiveItem; import com.sun.tools.xjc.grammar.SuperClassItem; import com.sun.codemodel.JClass; import com.sun.codemodel.JType; import com.sun.xml.bind.JAXBAssertionError; import java.util.Set; import com.sun.tools.xjc.grammar.FieldUse; import com.sun.tools.xjc.grammar.InterfaceItem; import com.sun.tools.xjc.grammar.ClassItem; import org.xml.sax.Locator; import com.sun.tools.xjc.reader.TypeUtil; import com.sun.tools.xjc.grammar.FieldItem; import java.util.HashSet; import com.sun.tools.xjc.grammar.util.FieldMultiplicityCounter; import com.sun.msv.grammar.ExpressionVisitorExpression; import com.sun.tools.xjc.grammar.AnnotatedGrammar; import com.sun.msv.grammar.ExpressionPool; public final class RelationNormalizer { private final AnnotatorController controller; private final ExpressionPool pool; private final AnnotatedGrammar grammar; private RelationNormalizer(final AnnotatorController _controller, final AnnotatedGrammar _grammar) { this.controller = _controller; this.pool = _grammar.getPool(); this.grammar = _grammar; } public static void normalize(final AnnotatedGrammar grammar, final AnnotatorController controller) { final RelationNormalizer n = new RelationNormalizer(controller, grammar); final ClassItem[] classItems = grammar.getClasses(); final InterfaceItem[] interfaceItems = grammar.getInterfaces(); final RelationNormalizer relationNormalizer = n; relationNormalizer.getClass(); final Pass1 pass1 = new Pass1(relationNormalizer, (RelationNormalizer$1)null); for (int i = 0; i < classItems.length; ++i) { pass1.process(classItems[i]); } for (int i = 0; i < interfaceItems.length; ++i) { interfaceItems[i].visit((ExpressionVisitorExpression)pass1); } for (int i = 0; i < classItems.length; ++i) { final FieldUse[] fieldUses = classItems[i].getDeclaredFieldUses(); for (int j = 0; j < fieldUses.length; ++j) { fieldUses[j].multiplicity = FieldMultiplicityCounter.count(classItems[i].exp, fieldUses[j]); final Set possibleTypes = new HashSet(); final FieldItem[] fields = fieldUses[j].items.toArray(new FieldItem[0]); for (int k = 0; k < fields.length; ++k) { possibleTypes.add(fields[k].getType(grammar.codeModel)); } fieldUses[j].type = TypeUtil.getCommonBaseType(grammar.codeModel, possibleTypes); if (fieldUses[j].isDelegated() && !fieldUses[j].multiplicity.isAtMostOnce()) { controller.reportError(new Locator[] { classItems[i].locator }, Messages.format("Normalizer.DelegationMultiplicityMustBe1", (Object)fieldUses[j].name)); } } } } private static void _assert(final boolean b) { if (!b) { throw new JAXBAssertionError(); } } private static boolean isInterface(final JType t) { return !t.isPrimitive() && ((JClass)t).isInterface(); } private static boolean isClass(final Object exp) { return exp instanceof ClassItem; } private static boolean isSuperClass(final Object exp) { return exp instanceof SuperClassItem; } private static boolean isInterface(final Object exp) { return exp instanceof InterfaceItem; } private static boolean isField(final Object exp) { return exp instanceof FieldItem; } private static boolean isPrimitive(final Object exp) { return exp instanceof PrimitiveItem; } private static boolean isIgnore(final Object exp) { return exp instanceof IgnoreItem; } private class Pass1 implements ExpressionVisitorExpression { private final Set visitedClasses; private JavaItem parentItem; private Multiplicity multiplicity; private Pass1(final RelationNormalizer this$0) { this.this$0 = this$0; this.visitedClasses = new HashSet(); this.parentItem = null; this.multiplicity = null; } public Expression onAttribute(final AttributeExp exp) { final Expression newContent = exp.exp.visit((ExpressionVisitorExpression)this); if (newContent != exp.exp) { return this.this$0.pool.createAttribute(exp.getNameClass(), newContent); } return (Expression)exp; } public Expression onElement(final ElementExp exp) { final Expression body = exp.contentModel.visit((ExpressionVisitorExpression)this); if (body == exp.contentModel) { return (Expression)exp; } return (Expression)new ElementPattern(exp.getNameClass(), body); } public Expression onMixed(final MixedExp exp) { return this.this$0.pool.createMixed(exp.exp.visit((ExpressionVisitorExpression)this)); } public Expression onList(final ListExp exp) { return this.this$0.pool.createList(exp.exp.visit((ExpressionVisitorExpression)this)); } public Expression onConcur(final ConcurExp exp) { throw new Error("concur is not supported"); } public Expression onChoice(final ChoiceExp exp) { final Expression lhs = exp.exp1.visit((ExpressionVisitorExpression)this); final Multiplicity lhc = this.multiplicity; final Expression rhs = exp.exp2.visit((ExpressionVisitorExpression)this); final Multiplicity rhc = this.multiplicity; this.multiplicity = Multiplicity.choice(lhc, rhc); return this.this$0.pool.createChoice(lhs, rhs); } public Expression onSequence(final SequenceExp exp) { final Expression lhs = exp.exp1.visit((ExpressionVisitorExpression)this); final Multiplicity lhc = this.multiplicity; final Expression rhs = exp.exp2.visit((ExpressionVisitorExpression)this); final Multiplicity rhc = this.multiplicity; this.multiplicity = Multiplicity.group(lhc, rhc); return this.this$0.pool.createSequence(lhs, rhs); } public Expression onInterleave(final InterleaveExp exp) { final Expression lhs = exp.exp1.visit((ExpressionVisitorExpression)this); final Multiplicity lhc = this.multiplicity; final Expression rhs = exp.exp2.visit((ExpressionVisitorExpression)this); final Multiplicity rhc = this.multiplicity; this.multiplicity = Multiplicity.group(lhc, rhc); return this.this$0.pool.createInterleave(lhs, rhs); } public Expression onOneOrMore(final OneOrMoreExp exp) { final Expression p = this.this$0.pool.createOneOrMore(exp.exp.visit((ExpressionVisitorExpression)this)); this.multiplicity = Multiplicity.oneOrMore(this.multiplicity); return p; } public Expression onEpsilon() { this.multiplicity = Multiplicity.zero; return Expression.epsilon; } public Expression onNullSet() { this.multiplicity = Multiplicity.zero; return Expression.nullSet; } public Expression onAnyString() { throw new Error(); } public Expression onData(final DataExp exp) { this.multiplicity = Multiplicity.zero; return (Expression)exp; } public Expression onValue(final ValueExp exp) { this.multiplicity = Multiplicity.zero; return (Expression)exp; } public Expression onRef(final ReferenceExp exp) { return exp.exp.visit((ExpressionVisitorExpression)this); } public void process(final ClassItem ci) { if (!this.visitedClasses.add(ci)) { return; } final JavaItem oldParent = this.parentItem; this.parentItem = ci; ci.exp.visit((ExpressionVisitorExpression)this); this.parentItem = oldParent; if (ci.getSuperClass() != null) { this.process(ci.getSuperClass()); } ci.removeDuplicateFieldUses(); final FieldUse[] fus = ci.getDeclaredFieldUses(); for (int i = 0; i < fus.length; ++i) { if (fus[i].isDelegated()) { if (fus[i].items.size() != 1) { throw new JAXBAssertionError(); } final FieldItem fi = fus[i].items.iterator().next(); final JType t = fi.getType(this.this$0.grammar.codeModel); if (t == this.this$0.grammar.codeModel.ref((RelationNormalizer.class$java$lang$Object == null) ? (RelationNormalizer.class$java$lang$Object = RelationNormalizer.class$("java.lang.Object")) : RelationNormalizer.class$java$lang$Object)) { fus[i].disableDelegation(); } else { if (!RelationNormalizer.access$300(t)) { this.this$0.controller.reportError(new Locator[] { ci.locator }, Messages.format("Normalizer.DelegationMustBeInterface", (Object)ci.name, (Object)t.fullName())); } ci.getTypeAsDefined()._implements((JClass)t); } } } } public Expression onOther(final OtherExp exp) { if (!(exp instanceof JavaItem)) { exp.exp = exp.exp.visit((ExpressionVisitorExpression)this); return (Expression)exp; } if (RelationNormalizer.access$500((Object)this.parentItem)) { return exp.exp.visit((ExpressionVisitorExpression)this); } if (exp instanceof IgnoreItem) { exp.exp = AnnotationRemover.remove(exp.exp, this.this$0.pool); this.multiplicity = Multiplicity.zero; return (Expression)exp; } final JavaItem oldParent = this.parentItem; if (exp instanceof JavaItem) { this.sanityCheck(this.parentItem, (JavaItem)exp); if (RelationNormalizer.access$600((Object)this.parentItem) && RelationNormalizer.access$700((Object)exp)) { final FieldItem fi = (FieldItem)exp; ((ClassItem)this.parentItem).getOrCreateFieldUse(fi.name).items.add(fi); } if (RelationNormalizer.access$700((Object)this.parentItem) && exp instanceof TypeItem) { final TypeItem ti = (TypeItem)exp; final FieldItem fi2 = (FieldItem)this.parentItem; try { fi2.addType(ti); } catch (FieldItem.BadTypeException e) { this.this$0.controller.reportError(new Locator[] { fi2.locator }, Messages.format("Normalizer.ConflictBetweenUserTypeAndActualType", (Object)fi2.name, (Object)e.getUserSpecifiedType().name(), (Object)ti.getType().name())); } } if (exp instanceof ClassItem || !this.visitedClasses.add(exp)) { this.multiplicity = this.getJavaItemMultiplicity(exp); return (Expression)exp; } this.parentItem = (JavaItem)exp; } if (exp instanceof ExternalItem) { exp.exp = AnnotationRemover.remove(exp.exp, this.this$0.pool); } else { exp.exp = exp.exp.visit((ExpressionVisitorExpression)this); } this.parentItem = oldParent; if (RelationNormalizer.access$800((Object)exp)) { final SuperClassItem sci = (SuperClassItem)exp; if (sci.definition == null) { this.this$0.controller.reportError(new Expression[] { exp }, Messages.format("Normalizer.MissingSuperClassBody")); } else if (!this.multiplicity.isUnique()) { this.this$0.controller.reportError(new Expression[] { exp, sci.definition }, Messages.format("Normalizer.BadSuperClassBodyMultiplicity", new Object[] { sci.definition.name })); } } if (RelationNormalizer.access$700((Object)exp)) { final FieldItem fi = (FieldItem)exp; if (fi.multiplicity == null) { fi.multiplicity = this.multiplicity; } else { RelationNormalizer.access$900(fi.multiplicity.includes(this.multiplicity)); } if (!fi.hasTypes()) { this.this$0.controller.reportError(new Locator[] { fi.locator }, Messages.format("Normalizer.EmptyProperty", new Object[] { fi.name })); try { fi.addType(this.this$0.grammar.createPrimitiveItem((Transducer)new IdentityTransducer(this.this$0.grammar.codeModel), (DatabindableDatatype)StringType.theInstance, this.this$0.pool.createData((XSDatatype)StringType.theInstance), fi.locator)); } catch (FieldItem.BadTypeException ex) {} } } if (RelationNormalizer.access$1000((Object)exp)) { final InterfaceItem ii = (InterfaceItem)exp; if (!this.multiplicity.isAtMostOnce()) { System.out.println(ExpressionPrinter.printContentModel(exp.exp)); this.this$0.controller.reportError(new Expression[] { ii }, Messages.format("Normalizer.BadInterfaceToClassMultiplicity", new Object[] { ii.name })); } return (Expression)exp; } this.multiplicity = this.getJavaItemMultiplicity(exp); return (Expression)exp; } private Multiplicity getJavaItemMultiplicity(final OtherExp item) { if (item instanceof IgnoreItem) { return Multiplicity.zero; } return Multiplicity.one; } private void sanityCheck(final JavaItem parent, final JavaItem child) { if (RelationNormalizer.access$800((Object)parent) && !RelationNormalizer.access$600((Object)child)) { this.this$0.controller.reportError(new Expression[] { parent, child }, Messages.format("Normalizer.BadSuperClassUse")); return; } if (RelationNormalizer.access$1100((Object)parent)) { throw new Error("internal error: use of primitive-" + child + " relation."); } if ((RelationNormalizer.access$700((Object)parent) && (RelationNormalizer.access$800((Object)child) || RelationNormalizer.access$700((Object)child))) || (RelationNormalizer.access$1000((Object)parent) && (RelationNormalizer.access$800((Object)child) || RelationNormalizer.access$700((Object)child) || RelationNormalizer.access$1100((Object)child)))) { this.this$0.controller.reportError(new Expression[] { parent, child }, Messages.format("Normalizer.BadItemUse", (Object)parent, (Object)child)); return; } if (RelationNormalizer.access$600((Object)parent) && child instanceof TypeItem) { throw new Error("internal error. C-C/C-I/C-P relation " + ((ClassItem)parent).getTypeAsDefined().name() + " " + child.toString() + " " + ExpressionPrinter.printContentModel((Expression)parent)); } } } }
[ "jdraco6@gmail.com" ]
jdraco6@gmail.com
315ab8dcdb809fec3e81e32691f8a6dfc172b53e
702193b0a97f4e5b8a7a37e8add77c4df04133bf
/springmore-easygrid/src/main/java/org/easygrid/action/ExcelExportAction.java
85c7d6802d4ea37255defcc30e11e991a67fbb3c
[]
no_license
popotans/springmore
5c25e7a86dbde94db3e6d45468b23914b3ac8684
842fe1b040c04ae8d66609e068db994c0895c72b
refs/heads/master
2021-01-25T13:29:13.731684
2017-03-23T05:55:49
2017-03-23T05:55:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,441
java
package org.easygrid.action; import java.util.List; import org.apache.log4j.Logger; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; import org.easygrid.excel.ExcelWriter; import org.easygrid.grid.Grid; import org.easygrid.util.GridJSONUtil; /** * excel导出 配合 grid组件用 * @author 唐延波 * @date 2013-12-3 */ @SuppressWarnings("serial") @ParentPackage("struts-default") @Namespace("/") public class ExcelExportAction extends DownloadAction { private final Logger log = Logger.getLogger(this.getClass()); private String header; private String data; private String title; private String fileName; private String girds; private String grid; /** * 单表导出excel * @author 唐延波 * @date 2013-12-3 */ @Action("exportExcel") public void exportExcel() { try { Grid gridObject = GridJSONUtil.transformJSONToGrid(grid); ExcelWriter excelWriter = ExcelWriter.getInstance(title, fileName, gridObject, response); excelWriter.exportExcel(); } catch (Exception e) { log.error(e.getMessage(), e); } } /** * 多表导出excel * @author 唐延波 * @date 2013-12-3 */ @Action("exportExcelMultipleTable") public void exportExcelMultipleTable() { try { List<Grid> gridList = GridJSONUtil.transformJSONToGridList(girds); ExcelWriter excelWriter = ExcelWriter.getInstance(title, fileName, gridList, response); excelWriter.exportExcelMultipleGrid(); } catch (Exception e) { log.error(e.getMessage(), e); } } public String getHeader() { return header; } public void setHeader(String header) { this.header = header; } public String getData() { return data; } public void setData(String data) { this.data = data; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public String getGirds() { return girds; } public void setGirds(String girds) { this.girds = girds; } public String getGrid() { return grid; } public void setGrid(String grid) { this.grid = grid; } }
[ "tangyanbo1110@126.com" ]
tangyanbo1110@126.com
18e3882dd7ae97ca4e982afa67be7b55219c0614
a19c14bd99ccc95baddf56f18c8ee6680c79fae2
/src/com/bcas/thread/TestJoinMethod1.java
43bf1ae0747bac5626a459a3bdeb4c1d064ae240
[]
no_license
bcascsd8/MyJava
dc273f2724556cde70aedddb68b26da5b675372c
ddb0d4bf1f96d070a4b2c228c1e004350a2dd667
refs/heads/master
2021-01-22T19:23:00.105782
2017-08-19T06:05:05
2017-08-19T06:05:05
100,773,765
0
0
null
null
null
null
UTF-8
Java
false
false
549
java
package com.bcas.thread; class TestJoinMethod1 extends Thread { public void run() { for (int i = 1; i <= 5; i++) { try { Thread.sleep(500); } catch (Exception e) { System.out.println(e); } System.out.println(i); } } public static void main(String args[]) { TestJoinMethod1 t1 = new TestJoinMethod1(); TestJoinMethod1 t2 = new TestJoinMethod1(); TestJoinMethod1 t3 = new TestJoinMethod1(); t1.start(); try { t1.join(); } catch (Exception e) { System.out.println(e); } t2.start(); t3.start(); } }
[ "31151574+bcascsd8@users.noreply.github.com" ]
31151574+bcascsd8@users.noreply.github.com
57c68dc44972f1908559321ab77ec100432f3d09
1019d840bbf3228909a0ae0283d31e39293c4900
/src/main/java/com/kosenkova/telegrambot/model/InteractiveMode.java
6a046ebb2bda79d9c8c1691194944b5b9b847575
[]
no_license
MaximUlianov/telegram-bot
73283b45c29d23ccc37190694727a75a414675b8
a75bed51bc5234e12f98fb034a776b01df1ada35
refs/heads/master
2023-05-03T07:56:57.289137
2021-05-24T21:16:49
2021-05-24T21:16:49
369,853,188
0
0
null
null
null
null
UTF-8
Java
false
false
102
java
package com.kosenkova.telegrambot.model; public enum InteractiveMode { QUESTION, REQUEST }
[ "umaxim2000@mail.ru" ]
umaxim2000@mail.ru
57be8bd0927b43a5adbd2c4d5ed6b4a065794ec2
2adbdc8832756dea8be62a6b9d456f394b9b2e9a
/timeseries-sources/alphavantage4j/src/main/java/org/patriques/output/technicalindicators/HT_DCPHASE.java
e2feb8df70b3a884a13370b53bf81bc0cd6d0181
[ "Apache-2.0" ]
permissive
leonarduk/pension-risk-management-system
71ba4db9a4d1d3ba8bd0917e54c7e903cab2acae
a4236001e4a4fd9f6a40f43ff96b217152dd1dfa
refs/heads/master
2023-08-17T04:23:13.608411
2023-08-15T17:24:21
2023-08-15T17:24:21
87,567,764
0
0
null
2023-09-06T06:10:25
2017-04-07T16:52:07
Java
UTF-8
Java
false
false
1,994
java
package org.patriques.output.technicalindicators; import org.patriques.input.technicalindicators.Interval; import org.patriques.output.JsonParser; import org.patriques.output.technicalindicators.data.IndicatorData; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * Representation of the Hilbert transform, dominant cycle phase (HT_DCPHASE) response from api. * * @see TechnicalIndicatorResponse */ public class HT_DCPHASE extends TechnicalIndicatorResponse<IndicatorData> { private HT_DCPHASE(final Map<String, String> metaData, final List<IndicatorData> indicators) { super(metaData, indicators); } /** * Creates {@code HT_DCPHASE} instance from json. * * @param interval specifies how to interpret the date key to the data json object * @param json string to parse * @return HT_DCPHASE instance */ public static HT_DCPHASE from(Interval interval, String json) { Parser parser = new Parser(interval); return parser.parseJson(json); } /** * Helper class for parsing json to {@code HT_DCPHASE}. * * @see TechnicalIndicatorParser * @see JsonParser */ private static class Parser extends TechnicalIndicatorParser<HT_DCPHASE> { public Parser(Interval interval) { super(interval); } @Override String getIndicatorKey() { return "Technical Analysis: HT_DCPHASE"; } @Override HT_DCPHASE resolve(Map<String, String> metaData, Map<String, Map<String, String>> indicatorData) { List<IndicatorData> indicators = new ArrayList<>(); indicatorData.forEach((key, values) -> indicators.add(new IndicatorData( resolveDate(key), Double.parseDouble(values.get("HT_DCPHASE")) ))); return new HT_DCPHASE(metaData, indicators); } } }
[ "github@leonarduk.com" ]
github@leonarduk.com
9b9159693a7e9fe587a4bd7d9bcf098cfeb62619
060da70d01f8c35556409ce99cfe30dfe799d5e6
/src/main/java/G37_Reto3/Servicios/ServiciosMensaje.java
3c98590026ef700a6bed0dcecea29c0c7df54a99
[]
no_license
MaicolMoreno/Reto3
c734d72ad2d720ce02f808d78d6261cce2292d6b
6a566f2876e0d156516531a37c188779de8b6640
refs/heads/master
2023-08-16T02:42:14.000396
2021-10-23T02:56:10
2021-10-23T02:56:10
419,554,968
0
0
null
null
null
null
UTF-8
Java
false
false
1,974
java
/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template */ package G37_Reto3.Servicios; import G37_Reto3.Modelo.Mensaje; import G37_Reto3.Repositorio.RepositorioMensaje; import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * * @author Maicol Moreno */ @Service public class ServiciosMensaje { @Autowired private RepositorioMensaje metodosCrud; public List<Mensaje> getAll(){ return metodosCrud.getAll(); } public Optional<Mensaje> getMessage(int messageId) { return metodosCrud.getMessage(messageId); } public Mensaje save(Mensaje message){ if(message.getIdMessage()==null){ return metodosCrud.save(message); }else{ Optional<Mensaje> e= metodosCrud.getMessage(message.getIdMessage()); if(e.isEmpty()){ return metodosCrud.save(message); }else{ return message; } } } public Mensaje update(Mensaje message){ if(message.getIdMessage()!=null){ Optional<Mensaje> e= metodosCrud.getMessage(message.getIdMessage()); if(!e.isEmpty()){ if(message.getMessageText()!=null){ e.get().setMessageText(message.getMessageText()); } metodosCrud.save(e.get()); return e.get(); }else{ return message; } }else{ return message; } } public boolean deleteMessage(int messageId) { Boolean aBoolean = getMessage(messageId).map(message -> { metodosCrud.delete(message); return true; }).orElse(false); return aBoolean; } }
[ "maicol.moreno.mt@correo.usa.edu.co" ]
maicol.moreno.mt@correo.usa.edu.co
91c612757f7bfc34f32056303a800762c6e746c2
3a8d6ae49beca8ef7d07a162c493a1d67784088d
/app/src/test/java/com/lantier/xxb_student/ajustpan/ExampleUnitTest.java
0bd10037e65d97f20f574a7353c86c66fc00640c
[]
no_license
lantier743865/WuZiQi
69539dec975a7bef5b769edb7f06197cdade08c8
bda977938fb4d4903c9b1acbe6cc90d38e9669d8
refs/heads/master
2021-01-23T04:08:48.310966
2017-03-28T14:03:52
2017-03-28T14:03:52
86,156,751
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package com.lantier.xxb_student.ajustpan; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "wuxiaolong@xuexibao.cn" ]
wuxiaolong@xuexibao.cn
adbb80dc435424ab1403f6fad72537a64ffa653e
aca4645d833d1c07db1c891f1869d39ec391cc40
/src/test/java/MybatisTest.java
76f0ac022db02e2572fed733ac004fbcb6ed3459
[]
no_license
JXY3511088jxy/mybatis-demo
2d0442dfd6aaf467752a4cec24aee6fba08d2d95
50eca743aebb29e6af204fd976ff280eb891f28c
refs/heads/master
2022-07-24T00:45:37.907589
2019-11-13T09:47:51
2019-11-13T09:47:51
221,164,385
0
0
null
2022-06-21T02:13:18
2019-11-12T08:12:09
Java
UTF-8
Java
false
false
1,139
java
import com.jxy.mybatis.pojo.User; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import java.io.InputStream; public class MybatisTest { public static void main(String[] args) throws Exception { // 指定全局配置文件 String resource = "mybatis-config.xml"; // 读取配置文件 InputStream inputStream = Resources.getResourceAsStream(resource); // 构建sqlSessionFactory SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); // 获取sqlSession SqlSession sqlSession = sqlSessionFactory.openSession(); try { // 操作CRUD,第一个参数:指定statement,规则:命名空间+“.”+statementId // 第二个参数:指定传入sql的参数:这里是用户id User user = sqlSession.selectOne("MyMapper.selectUser", 1); System.out.println(user); } finally { sqlSession.close(); } } }
[ "765101769@qq.com" ]
765101769@qq.com
a2b932f69e1078e2083405cdbd76ba369dbf7f5a
7f261a1e2bafd1cdd98d58f00a2937303c0dc942
/src/ANXCamera/sources/android/support/v4/provider/RawDocumentFile.java
db03374e77e7f75800d8ecb4ee1154e05adb0be0
[]
no_license
xyzuan/ANXCamera
7614ddcb4bcacdf972d67c2ba17702a8e9795c95
b9805e5197258e7b980e76a97f7f16de3a4f951a
refs/heads/master
2022-04-23T16:58:09.592633
2019-05-31T17:18:34
2019-05-31T17:26:48
259,555,505
3
0
null
2020-04-28T06:49:57
2020-04-28T06:49:57
null
UTF-8
Java
false
false
4,164
java
package android.support.v4.provider; import android.net.Uri; import android.util.Log; import android.webkit.MimeTypeMap; import java.io.File; import java.io.IOException; import java.util.ArrayList; class RawDocumentFile extends DocumentFile { private File mFile; RawDocumentFile(DocumentFile parent, File file) { super(parent); this.mFile = file; } public DocumentFile createFile(String mimeType, String displayName) { String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType); if (extension != null) { StringBuilder sb = new StringBuilder(); sb.append(displayName); sb.append("."); sb.append(extension); displayName = sb.toString(); } File target = new File(this.mFile, displayName); try { target.createNewFile(); return new RawDocumentFile(this, target); } catch (IOException e) { StringBuilder sb2 = new StringBuilder(); sb2.append("Failed to createFile: "); sb2.append(e); Log.w("DocumentFile", sb2.toString()); return null; } } public DocumentFile createDirectory(String displayName) { File target = new File(this.mFile, displayName); if (target.isDirectory() || target.mkdir()) { return new RawDocumentFile(this, target); } return null; } public Uri getUri() { return Uri.fromFile(this.mFile); } public String getName() { return this.mFile.getName(); } public String getType() { if (this.mFile.isDirectory()) { return null; } return getTypeForName(this.mFile.getName()); } public boolean isDirectory() { return this.mFile.isDirectory(); } public boolean isFile() { return this.mFile.isFile(); } public long lastModified() { return this.mFile.lastModified(); } public long length() { return this.mFile.length(); } public boolean canRead() { return this.mFile.canRead(); } public boolean canWrite() { return this.mFile.canWrite(); } public boolean delete() { deleteContents(this.mFile); return this.mFile.delete(); } public boolean exists() { return this.mFile.exists(); } public DocumentFile[] listFiles() { ArrayList<DocumentFile> results = new ArrayList<>(); File[] files = this.mFile.listFiles(); if (files != null) { for (File file : files) { results.add(new RawDocumentFile(this, file)); } } return (DocumentFile[]) results.toArray(new DocumentFile[results.size()]); } public boolean renameTo(String displayName) { File target = new File(this.mFile.getParentFile(), displayName); if (!this.mFile.renameTo(target)) { return false; } this.mFile = target; return true; } private static String getTypeForName(String name) { int lastDot = name.lastIndexOf(46); if (lastDot >= 0) { String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(name.substring(lastDot + 1).toLowerCase()); if (mime != null) { return mime; } } return "application/octet-stream"; } private static boolean deleteContents(File dir) { boolean success; File[] arr$; File[] files = dir.listFiles(); boolean success2 = true; if (files != null) { for (File file : files) { if (file.isDirectory()) { success2 &= deleteContents(file); } if (!file.delete()) { StringBuilder sb = new StringBuilder(); sb.append("Failed to delete "); sb.append(file); Log.w("DocumentFile", sb.toString()); success2 = false; } } } return success; } }
[ "sv.xeon@gmail.com" ]
sv.xeon@gmail.com
6d04e507fc43aef47073b6acb21dca937e27c4be
d4dbd8c7e6093bf108c6073838744e4ab42ec111
/src/main/java/com/ya/model/user/Credential.java
a64e4eb26cd4c9fecac00641dc86c236ace117a8
[]
no_license
alefebvre-fixit/ya-app
176de925cf4479c9e7497e667d649fc59535a914
51f3bb8e35ddadc05e53019435763216b21112d4
refs/heads/master
2021-05-04T10:49:00.605506
2017-07-21T15:42:29
2017-07-21T15:42:29
48,670,132
0
0
null
null
null
null
UTF-8
Java
false
false
883
java
package com.ya.model.user; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; @Document(collection = "Credential") public class Credential { public Credential() { } public Credential(String username, String password) { this.username = username; this.password = password; } @Override public String toString() { return "Credential [username=" + username + ", password=" + password + "]"; } @Id private String username; public String password; public void setPassword(String password) { this.password = password; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public boolean authenticate(String password) { return this.password.equals(password); } }
[ "antoinelefebvre@gmail.com" ]
antoinelefebvre@gmail.com
01ed4a16409a0cedcd27ae9e3d2b55b2d964c33f
23c4d67762414a2c05805b00d88469574e9a776f
/src/test/java/live/gatisoft/storerequestscontrol/common/schema/UserTest.java
ce8533762dc1f4598e0a9d65856b08fcbabf8e01
[]
no_license
viniciusgati/store-requests-control
aeb155b5e570e8b95cfe1c4b0104a58b256dd66b
504453676d1db49bb57e9a49eb7e6662a4cb0f76
refs/heads/master
2023-08-27T12:11:09.855242
2021-10-26T21:54:53
2021-10-26T21:54:53
401,453,837
0
0
null
2021-09-17T20:00:11
2021-08-30T18:55:06
Java
UTF-8
Java
false
false
1,622
java
package live.gatisoft.storerequestscontrol.common.schema; import live.gatisoft.storerequestscontrol.security.services.BCryptService; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class UserTest { User user = new User(); @Test @DisplayName("User should set the id") public void getAndSetId() { Long id = 1234L; user.setId(id); assertEquals(user.getId(), id); } @Test @DisplayName("User should set the email") public void getAndSetEmail() { String email = "email@test.com"; user.setEmail(email); assertEquals(user.getEmail(), email); } @Test @DisplayName("User should set the document") public void getAndSetDocument() { String sample = "11144477735"; user.setDocument(sample); assertEquals(user.getDocument(), sample); } @Test @DisplayName("User should set the passwordResetToken") public void getAndSetPasswordResetToken() { String sample = "1823809127839021"; user.setPasswordResetToken(sample); assertEquals(user.getPasswordResetToken(), sample); } @Test @DisplayName("User should set the encryptedPassword") public void getAndSetEncryptedPassword() { String sample = "8asd89a7d978asd789a6s7"; user.setPassword(sample); assertNotEquals(user.getEncryptedPassword(), sample); assertFalse(user.getEncryptedPassword().isBlank()); assertTrue(BCryptService.passwordMatches(sample, user.getEncryptedPassword())); } }
[ "viniciusgati@gmail.com" ]
viniciusgati@gmail.com
ca29f13e41140cfdb75a91d8437d04d2ad3f28c6
daff5f6fe8747ac3e11124cbc3fcf5f7f412abd8
/Sesion5/src/exceptions/Calculadora.java
a19bac1a8b0bf45419f5856ce789f82b76e23112
[]
no_license
jalmx/diplomado-java-2019
b2f38f5e13e4dec0cbaf8922bc13eae93bef7bd3
9dbc0c7c141fef85467a325a69ed393ef87f8259
refs/heads/master
2020-06-08T07:53:36.993651
2019-08-14T20:53:29
2019-08-14T20:53:29
193,190,911
0
0
null
null
null
null
UTF-8
Java
false
false
1,319
java
package exceptions; import java.util.InputMismatchException; import java.util.Scanner; public class Calculadora { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //Bloque try-catch // try { // //aqui todo el codigo // } catch (Exception/*tipo de Exceptio*/ e /*de la exception*/) { // //aqui codigo que se ejecuta en caso que algo haya fallado // //esto se ejecuta cuando sucede una Exception(Error) // } boolean salir; do { try {//inicia el bloque try System.out.println("Calculadora que solo divide"); System.out.println("Dar un valor"); int a = sc.nextInt(); System.out.println("Dar el segundo valor"); int b = sc.nextInt(); double resultado = (double) a / b; System.out.println(resultado); salir = false; sc.close(); } catch (InputMismatchException e) {//inicia el catch // e.printStackTrace(); System.out.println("Solo se permiten digitos"); System.out.println("Intente de nuevo"); salir = true; } } while (salir); } }
[ "jalm_x@hotmail.com" ]
jalm_x@hotmail.com
f666b08cae8abdea992f792da990298b5c1b6bb4
3dbb0236fa811637ecc99bf385985fcf64e9dd04
/ssh/src/main/java/es/ssh/ssh/SSHAuthenticator.java
99ad18f03a0c379fb996c81c337939bcbe5c44dc
[]
no_license
jonanFan/mediplus
f50a7c304ef2858d28f0112de693feb951ffe8c2
7371665f77293bb7e87993ad89df8dafa0c996b2
refs/heads/master
2021-05-31T06:21:30.346812
2016-04-25T15:42:04
2016-04-25T15:42:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,680
java
/****************************************************************************** * * Copyright (c) 1998,99 by Mindbright Technology AB, Stockholm, Sweden. * www.mindbright.se, info@mindbright.se * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * ***************************************************************************** * $Author: josh $ * $Date: 2001/02/03 00:47:00 $ * $Name: $ *****************************************************************************/ package es.ssh.ssh; import java.io.*; import es.ssh.security.RSAPublicKey; public interface SSHAuthenticator { public String getUsername(SSHClientUser origin) throws IOException; public String getPassword(SSHClientUser origin) throws IOException; public String getChallengeResponse(SSHClientUser origin, String challenge) throws IOException; public int[] getAuthTypes(SSHClientUser origin); public int getCipher(SSHClientUser origin); public SSHRSAKeyFile getIdentityFile(SSHClientUser origin) throws IOException; public String getIdentityPassword(SSHClientUser origin) throws IOException; public boolean verifyKnownHosts(RSAPublicKey hostPub) throws IOException; }
[ "fandino1994@gmail.com" ]
fandino1994@gmail.com
5d571b42b3e910f23320358b47481f924cf8c11b
58229cf30ce3a20fc7c06cec57f0dbe4b2e97378
/src/main/java/frc/robot/commands/ToggleOperatorControls.java
1f46b78d701ebea0368261b0b960a617cd7de4a5
[]
no_license
discobots2587/2019-DeepSpace
42145be54d1f712478a1e8b1bffa6f76359ac770
430913c7435db1105c9d999d9fe8f248533c5928
refs/heads/master
2020-04-16T08:06:54.068143
2019-04-03T02:10:23
2019-04-03T02:10:23
165,412,269
2
0
null
2020-02-12T22:29:07
2019-01-12T16:54:39
Java
UTF-8
Java
false
false
1,428
java
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2018 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ package frc.robot.commands; import edu.wpi.first.wpilibj.command.Command; import frc.robot.Robot; public class ToggleOperatorControls extends Command { public ToggleOperatorControls() { // Use requires() here to declare subsystem dependencies // eg. requires(chassis); } // Called just before this Command runs the first time @Override protected void initialize() { } // Called repeatedly when this Command is scheduled to run @Override protected void execute() { Robot.m_oi.toggleDriverOperatorControls(); } // Make this return true when this Command no longer needs to run execute() @Override protected boolean isFinished() { return true; } // Called once after isFinished returns true @Override protected void end() { } // Called when another command which requires one or more of the same // subsystems is scheduled to run @Override protected void interrupted() { } }
[ "casebriscoe@gmail.com" ]
casebriscoe@gmail.com
a883f20a5a3cf415e8785fae335c298e71eca737
396a67f596ef792558eee4e775a0596542bfca23
/src/main/java/ch/thn/datatree/printer/TreePrinterUtil.java
defa2a30a4fc89597f5a478fb015a9f09b6da3bf
[ "Apache-2.0" ]
permissive
thnaeff/DataTree
6e70c50a236308826790b4a20fd7ac4dc58eaa50
3a44202518ae382f6d33675fd53ee07a919c7e6b
refs/heads/master
2021-01-14T08:22:55.818663
2017-02-04T16:56:33
2017-02-04T16:56:33
47,307,304
0
0
null
null
null
null
UTF-8
Java
false
false
5,215
java
/** * Copyright 2015 Thomas Naeff (github.com/thnaeff) * * 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 ch.thn.datatree.printer; import java.util.List; import ch.thn.datatree.printer.generic.TreePrinterLine; /** * Some useful methods for the tree printer * * * * @author Thomas Naeff (github.com/thnaeff) * */ public class TreePrinterUtil { public static final String RIGHT_ALIGN_CONNECTOR = "──"; public static final String RIGHT_ALIGN_SPACE = " "; /** * Looks through all the lines to find the count of the most prefixes.<br /> * * <pre> * Key-Value test -> 0 prefixes * ├─ Child 1 -> 1 prefix * │ │ Test -> 2 prefixes * │ ├─ Child 1.1 -> 3 prefixes * │ │ Test -> 4 prefixes * </pre> * * @param lines * @return */ public static int getMaxPrefixCount(List<? extends TreePrinterLine<?>> lines) { int maxPrefixCount = 0; for (TreePrinterLine<?> line : lines) { int prefixesCount = line.getColumnIndex(TreePrinterLine.LABEL_LAST_PREFIX) - line.getColumnIndex(TreePrinterLine.LABEL_FIRST_PREFIX); if (prefixesCount > maxPrefixCount) { maxPrefixCount = prefixesCount; } } return maxPrefixCount; } /** * Looks through all the lines to find the count of the most values.<br /> * * As example, a plain text printer which prints each value in brackets [] * <pre> * [Key-Value test] -> 1 value * ├─ [Child 1][abc] -> 2 values * │ │ [Test][def] -> 2 values * │ ├─ [Child 1.1] -> 1 value * │ │ [Test] -> 1 value * </pre> * * @param lines * @return */ public static int getMaxValueCount(List<? extends TreePrinterLine<?>> lines) { int maxValueCount = 0; for (TreePrinterLine<?> line : lines) { int valueCount = line.getColumnIndex(TreePrinterLine.LABEL_LAST_VALUE) - line.getColumnIndex(TreePrinterLine.LABEL_FIRST_VALUE); if (valueCount > maxValueCount) { maxValueCount = valueCount; } } return maxValueCount; } /** * Looks through all the lines to find the maximal node depth.<br /> * * <pre> * Key-Value test -> depth 0 * ├─ Child 1 -> depth 1 * │ │ Test -> depth 1 * │ ├─ Child 1.1 -> depth 2 * │ │ Test -> depth 2 * </pre> * * @param lines * @return */ public static int getMaxDepth(List<? extends TreePrinterLine<?>> lines) { int depth = 0; for (TreePrinterLine<?> line : lines) { if (line.getDepth() > depth) { depth = line.getDepth(); } } return depth; } /** * Sets the index of the first label as the index of the second label. This * is useful if only one index is set, but both should be present. For example * the fist prefix and the last prefix in a {@link TreePrinterLine}. If only * one single prefix is added to the line (with the label {@link TreePrinterLine#LABEL_FIRST_PREFIX}), * there should also be the label {@link TreePrinterLine#LABEL_LAST_PREFIX} * to close the prefix range. * * @param line * @param takeIndexOfThisLabel * @param matchWithThisLabel */ public static void matchLabeledColumns(TreePrinterLine<?> line, Object takeIndexOfThisLabel, Object matchWithThisLabel) { line.setColumnLabel(matchWithThisLabel, line.getColumnIndex(takeIndexOfThisLabel)); } /** * Adds additional connectors so that all values are aligned * * @param lines */ public static void alignValuesRight(List<TreePrinterLine<String>> lines) { //Find the maximal prefix count int maxPrefixCount = TreePrinterUtil.getMaxPrefixCount(lines); //Align so that every line has the same number of prefixes as the maximal prefix count for (TreePrinterLine<String> line : lines) { // +1 will result in an index of 0 for the tree head int lastPrefixIndex = line.getColumnIndex(TreePrinterLine.LABEL_LAST_PREFIX); int firstPrefixIndex = line.getColumnIndex(TreePrinterLine.LABEL_FIRST_PREFIX); int prefixCount = lastPrefixIndex - firstPrefixIndex; if (line.getNodeValueIndex() == 0) { //Add lines to connect for (int i = 0; i < maxPrefixCount - prefixCount; i++) { //Add after the last prefix //Since the newly added prefix is now the last prefix, increase the lastPrefixIndex line.addWithLabel(++lastPrefixIndex, RIGHT_ALIGN_CONNECTOR, TreePrinterLine.LABEL_LAST_PREFIX); } } else { //Add spaces for any additional node value lines for (int i = 0; i < maxPrefixCount - prefixCount; i++) { //Add after the last prefix //Since the newly added prefix is now the last prefix, increase the lastPrefixIndex line.addWithLabel(++lastPrefixIndex, RIGHT_ALIGN_SPACE, TreePrinterLine.LABEL_LAST_PREFIX); } } } } }
[ "tnaeff@mmm.com" ]
tnaeff@mmm.com
1247b037a716230839f6d6ba62cca41fc79d5749
ba3b25d6cf9be46007833ce662d0584dc1246279
/droidsafe_modified/modeling/api/android/filterfw/core/GLEnvironment.java
718396b1b868fd67a7d870abb9587e6653e12f42
[]
no_license
suncongxd/muDep
46552d4156191b9dec669e246188080b47183a01
b891c09f2c96ff37dcfc00468632bda569fc8b6d
refs/heads/main
2023-03-20T20:04:41.737805
2021-03-01T19:52:08
2021-03-01T19:52:08
326,209,904
8
0
null
null
null
null
UTF-8
Java
false
false
17,275
java
/* * Copyright (C) 2015, Massachusetts Institute of Technology * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Please email droidsafe@lists.csail.mit.edu if you need additional * information or have any questions. * * * This file incorporates work covered by the following copyright and * permission notice: * * 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. */ /***** THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL BY THE DROIDSAFE PROJECT. *****/ package android.filterfw.core; import droidsafe.annotations.*; import droidsafe.runtime.*; import droidsafe.helpers.*; import android.filterfw.core.NativeAllocatorTag; import android.graphics.SurfaceTexture; import android.os.Looper; import android.util.Log; import android.view.Surface; import android.media.MediaRecorder; /** * @hide */ public class GLEnvironment { @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.658 -0400", hash_original_method = "1FCEF7B108BFE391FB4BC8B6CECB7E8B", hash_generated_method = "E1A963699602D8A833F4C18A5C0A4196") public static boolean isAnyContextActive() { return nativeIsAnyContextActive(); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.460 -0400", hash_original_method = "7E165335DF678FE191719A49D7F5E9E3", hash_generated_method = "C8D3034C9C23B502815A4D20602D820B") private static boolean nativeIsAnyContextActive(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGeneratedField(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.638 -0400", hash_original_field = "5312F3B11B036D51457E62D19332CB5B", hash_generated_field = "836AF212C39306A6DE9B2DAD8EABBB66") private int glEnvId; @DSSafe(DSCat.SAFE_OTHERS) @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.640 -0400", hash_original_method = "6BF09C2B2AC02D6ACF79B3F082CF910E", hash_generated_method = "4F784C38633A25CFD964176E01A19EE7") public GLEnvironment() { nativeAllocate(); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.643 -0400", hash_original_method = "E774A0245A01F31414BEAF92CE237DA7", hash_generated_method = "7BCB47B1B6AC6FE44B5288A5D22767AB") private GLEnvironment(NativeAllocatorTag tag) { } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.645 -0400", hash_original_method = "4A98176CF70A46DE3389A04080AC575A", hash_generated_method = "22C56FC8AE7AFC2D1B778B2D214733F3") public synchronized void tearDown() { if (glEnvId != -1) { nativeDeallocate(); glEnvId = -1; } } @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.647 -0400", hash_original_method = "1634EBECADA1FE321270115B4A33248F", hash_generated_method = "089C66A5C5C16B1989FEE832F678C8A4") @Override protected void finalize() throws Throwable { tearDown(); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.649 -0400", hash_original_method = "DBA4311C8BEB49D7625023654ECB2564", hash_generated_method = "8D4662FEF5D3754F53EE2B20797AB1B8") public void initWithNewContext() { if (!nativeInitWithNewContext()) { throw new RuntimeException("Could not initialize GLEnvironment with new context!"); } } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.652 -0400", hash_original_method = "3F714784F6FDFF8E7C79ED5E256A0C8A", hash_generated_method = "4C6BE2E9C2E2B805CBA2665ADD862F45") public void initWithCurrentContext() { if (!nativeInitWithCurrentContext()) { throw new RuntimeException("Could not initialize GLEnvironment with current context!"); } } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.654 -0400", hash_original_method = "40F70B43CD990D8E6F924BC24492C478", hash_generated_method = "B0A10BFE6A63D2F15EE137148AB5C02F") public boolean isActive() { return nativeIsActive(); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.656 -0400", hash_original_method = "B5821792B1F6CD5CA372390DBC83BF8E", hash_generated_method = "58300013EE6F04F87D68226F763DE65B") public boolean isContextActive() { return nativeIsContextActive(); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.660 -0400", hash_original_method = "A75F1E6FFBEB73935A107A83CA349540", hash_generated_method = "992E30CC12DF036F812E2ABEF6838BE0") public void activate() { if (Looper.myLooper() != null && Looper.myLooper().equals(Looper.getMainLooper())) { Log.e("FilterFramework", "Activating GL context in UI thread!"); } if (!nativeActivate()) { throw new RuntimeException("Could not activate GLEnvironment!"); } } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.662 -0400", hash_original_method = "EF0BD8149FED207AD95DDA9C650C9AB0", hash_generated_method = "5A11A2E13D75B85A67EF5ADBA24A6324") public void deactivate() { if (!nativeDeactivate()) { throw new RuntimeException("Could not deactivate GLEnvironment!"); } } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.665 -0400", hash_original_method = "7B09BC2FD30599B151E2E77BC2B45EF3", hash_generated_method = "A58AB82996C45A6E33A865530A2386D1") public void swapBuffers() { if (!nativeSwapBuffers()) { throw new RuntimeException("Error swapping EGL buffers!"); } } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.667 -0400", hash_original_method = "9FDDB1F16B4D13C2E81D7BBDB2FF76CB", hash_generated_method = "BE2A2C7A984F84D513380D1F8ADCE32A") public int registerSurface(Surface surface) { int result = nativeAddSurface(surface); if (result < 0) { throw new RuntimeException("Error registering surface " + surface + "!"); } return result; } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.669 -0400", hash_original_method = "E4EAF0AE202932A17B9153690990AB13", hash_generated_method = "C1114146EC0C79F4D3DDFB44C0B62638") public int registerSurfaceTexture(SurfaceTexture surfaceTexture, int width, int height) { int result = nativeAddSurfaceTexture(surfaceTexture, width, height); if (result < 0) { throw new RuntimeException("Error registering surfaceTexture " + surfaceTexture + "!"); } return result; } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.672 -0400", hash_original_method = "370EF558D086DB46FA01A76C72C10B50", hash_generated_method = "311421589503D60B7AC78A83BAA187F5") public int registerSurfaceFromMediaRecorder(MediaRecorder mediaRecorder) { int result = nativeAddSurfaceFromMediaRecorder(mediaRecorder); if (result < 0) { throw new RuntimeException("Error registering surface from " + "MediaRecorder" + mediaRecorder + "!"); } return result; } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.674 -0400", hash_original_method = "A155702CFF453083CA4E74B28A861912", hash_generated_method = "490901797E489517A3CC0162B5184180") public void activateSurfaceWithId(int surfaceId) { if (!nativeActivateSurfaceId(surfaceId)) { throw new RuntimeException("Could not activate surface " + surfaceId + "!"); } } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.676 -0400", hash_original_method = "82E691F8E1D7DAE4DF603DCFDF093301", hash_generated_method = "0BBA7A11314FCAE9575192A3457CFFFF") public void unregisterSurfaceId(int surfaceId) { if (!nativeRemoveSurfaceId(surfaceId)) { throw new RuntimeException("Could not unregister surface " + surfaceId + "!"); } } static { System.loadLibrary("filterfw"); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-24 16:06:02.678 -0400", hash_original_method = "0860545AC6501C695E7D8AD77E72C93F", hash_generated_method = "58CA36A839B399077D90C6EA5FCF2F6C") public void setSurfaceTimestamp(long timestamp) { if (!nativeSetSurfaceTimestamp(timestamp)) { throw new RuntimeException("Could not set timestamp for current surface!"); } } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.449 -0400", hash_original_method = "164BA1662464D454FF905E81D8586F92", hash_generated_method = "D7C7AC933FE6150680313167A707F79A") private boolean nativeInitWithNewContext(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.452 -0400", hash_original_method = "27823144E2C3DC027BFB63BA7141BEFA", hash_generated_method = "EEFDAFBA818C390091ACBD91000F6F65") private boolean nativeInitWithCurrentContext(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.455 -0400", hash_original_method = "8F19BBE56160A05D8AABF421C6AE0D71", hash_generated_method = "99ED90BA556BACB91A59E41431E03057") private boolean nativeIsActive(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.457 -0400", hash_original_method = "429D16685BCAC565C484E3FE04151D47", hash_generated_method = "C2D2A3DA3AC8F95A0ABD0B8E813C447E") private boolean nativeIsContextActive(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.463 -0400", hash_original_method = "57D25A50BBF10FA53BB44C7D6DF9FC93", hash_generated_method = "1F9B755D93F5F98E49C7FA9AE1BFF840") private boolean nativeActivate(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.466 -0400", hash_original_method = "E698B26A12BBCE8DC563A41F7DDD333D", hash_generated_method = "87B74D5717ED71A95C08BA91E285589E") private boolean nativeDeactivate(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.469 -0400", hash_original_method = "1EF329BDA254D0F92DB2285897276B31", hash_generated_method = "24322855273E2A735603C3B7A3428FD0") private boolean nativeSwapBuffers(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.471 -0400", hash_original_method = "6301909CA2626FBD0F9D5CE1EA448C05", hash_generated_method = "BCA8B32BD11B1B2D2C036C109DB889BF") private boolean nativeAllocate(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:24:42.474 -0400", hash_original_method = "C5D13A7D2DE40061D17A5A19349F9B46", hash_generated_method = "B240A7932BE0CB51D42FA1BDE6059C94") private boolean nativeDeallocate(){ //Formerly a native method double taintDouble = 0; return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:14:20.182 -0400", hash_original_method = "6B6DE041197588F0ED616D34566A1756", hash_generated_method = "D11BD7811306F9B16B5680082CCC3231") private int nativeAddSurface(Surface surface){ //Formerly a native method double taintDouble = 0; taintDouble += surface.getTaintInt(); addTaint(taintDouble); return (int)taintDouble; } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:14:20.186 -0400", hash_original_method = "63EB4D7192027BD0A7824E00CCA4B45F", hash_generated_method = "1F59E75B993DF69C9160B91A280A9582") private int nativeAddSurfaceTexture(SurfaceTexture surface, int width, int height){ //Formerly a native method double taintDouble = 0; taintDouble += surface.getTaintInt(); taintDouble += width; taintDouble += height; addTaint(taintDouble); return (int)taintDouble; } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:14:20.191 -0400", hash_original_method = "3B3AC83D0E7A1374F6DBFF6D280A1EF2", hash_generated_method = "C16D8CA5E8CBFB8B55005FA575944903") private int nativeAddSurfaceFromMediaRecorder(MediaRecorder mediaRecorder){ //Formerly a native method double taintDouble = 0; taintDouble += mediaRecorder.getTaintInt(); addTaint(taintDouble); return (int)taintDouble; } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:14:20.195 -0400", hash_original_method = "87A12BA53060BB423546F41F38880C6B", hash_generated_method = "4DCCC2DE7133EC84EF8A5A7ACAE7D6F9") private boolean nativeDisconnectSurfaceMediaSource(MediaRecorder mediaRecorder){ //Formerly a native method double taintDouble = 0; taintDouble += mediaRecorder.getTaintInt(); addTaint(taintDouble); return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:14:20.198 -0400", hash_original_method = "5F17AFC2D1F31F7702F1B3326F4F54F4", hash_generated_method = "B1734C22791173017A02857BF102618F") private boolean nativeActivateSurfaceId(int surfaceId){ //Formerly a native method double taintDouble = 0; taintDouble += surfaceId; addTaint(taintDouble); return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:14:20.202 -0400", hash_original_method = "B15325895F651CA9C5F158C2C8B63A15", hash_generated_method = "3D2FF8D4E55475985C4C2DA8C30A29D0") private boolean nativeRemoveSurfaceId(int surfaceId){ //Formerly a native method double taintDouble = 0; taintDouble += surfaceId; addTaint(taintDouble); return ((taintDouble) == 1); } @DSGenerator(tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-03-25 14:14:20.206 -0400", hash_original_method = "660A7742E0B8992B12FFDC85C87113E3", hash_generated_method = "70CBB6019EB959FA49DDC6E9145D0842") private boolean nativeSetSurfaceTimestamp(long timestamp){ //Formerly a native method double taintDouble = 0; taintDouble += timestamp; addTaint(taintDouble); return ((taintDouble) == 1); } }
[ "suncong@xidian.edu.cn" ]
suncong@xidian.edu.cn
03e36276ef2049ab3b35eee7319d5033ba1c52f0
206790e1a951303f303761eb1fedad885e84879b
/Leetcode/findMinHeightTrees.java
f03b18ec8a1fd6765b2cef0147fd33282902cf6a
[]
no_license
Mehvix/competitive-programming
b8a8026797b6bb192eefaa68ac49b5db86e02e06
4f11b8f59d475cea4419806725c2652f95bab4bc
refs/heads/master
2022-11-04T10:39:57.381488
2020-06-22T15:47:00
2020-06-22T15:47:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,971
java
import sun.awt.image.ImageWatched; import java.util.*; // Definition for a Node. class Node { public int val; public List<Node> children; public Node() {} public Node(int _val) { val = _val; } public Node(int _val, List<Node> _children) { val = _val; children = _children; } }; class Solution { public List<Integer> findMinHeightTrees(int n, int[][] edges) { /*2 solutions: * 1.) Find the farthest node from any arbitrary point, then repeat again with the new node. This will be the * farthest. Find the middle (two) node(s) * 2.) Find all leafs, and remove all leaves until there are two or less*/ // boolean[][] connections = new boolean[n][n]; List<Set<Integer>> connections = new ArrayList<>(n); for (int i = 0; i < n; i++) connections.add(new HashSet<>()); for (int[] b : edges) { int from = b[0]; int to = b[1]; connections.get(from).add(to); connections.get(to).add(from); // connections[from][to] = true; // connections[to][from] = true; } ArrayList<Integer> leafs = new ArrayList<>(); for(int i = 0; i < n; i++){ if (connections.get(i).size() == 1) leafs.add(i); } System.out.println(connections); while (n > 2){ n -= leafs.size(); ArrayList<Integer> tmp = new ArrayList<>(); for (int leaf : leafs) { int parent = connections.get(leaf).iterator().next(); connections.get(parent).remove(leaf); if (connections.get(parent).size() == 1) tmp.add(parent); } leafs = tmp; } return leafs; } public static void main(String[] args) { Solution obj = new Solution(); System.out.println(obj.findMinHeightTrees(4, new int[][]{{1, 0}, {1, 2}, {1, 3}})); } }
[ "mehvix@protonmail.com" ]
mehvix@protonmail.com
47251d9f7dd5174050561f4ac29fa10603d88d82
0f01c393193d0d8ab4bf5f1a6e0064c9d99477ab
/utils/EsperaComboTerValor.java
1095d418a0d0c55a59d24c9215a73a341f851ab9
[ "MIT" ]
permissive
raffathamires/SeleniumAvancado
ea6d267479e21c9c8390c1e0f6a50184210729c8
6a4339d1f9f5f05ef23a7a2c327a32e7af6ac392
refs/heads/master
2020-03-27T11:02:49.500014
2018-09-11T18:22:24
2018-09-11T18:22:24
146,461,492
0
0
null
null
null
null
UTF-8
Java
false
false
527
java
package utils; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.Select; public class EsperaComboTerValor implements ExpectedCondition { private WebDriver driver; private By combo; public EsperaComboTerValor(By combo) { this.combo = combo; } public Object apply(Object o) { driver = (WebDriver) o; return new Select (driver.findElement(combo)). getFirstSelectedOption().isSelected(); } }
[ "raffaela_monteiro@sicredi.com.br" ]
raffaela_monteiro@sicredi.com.br
cab52d63d81a241b2fd5594a4fb6b773e3813200
4e2d11b5c8565c6bc49188a8d5c9fc941633b3aa
/fbs/order-service-consumer/src/main/java/com/atguigu/gmall/MainApplication.java
9dd4ccf0c2c504d276dbe0562a4d2a12f1323e7c
[]
no_license
amor949/test
87f673c82f22c4af58c6c27f22be9c1f6235c446
2ac08ddbbc5b66dbbdaa9ed650e3e772eee646d3
refs/heads/master
2020-04-03T21:01:36.856028
2018-10-31T14:02:39
2018-10-31T14:02:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
557
java
package com.atguigu.gmall; import gmall.service.OrderService; import org.springframework.context.support.ClassPathXmlApplicationContext; import java.io.IOException; public class MainApplication { public static void main(String[] args) throws IOException { ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("consumer.xml"); OrderService orderService = classPathXmlApplicationContext.getBean(OrderService.class); orderService.initOrder("1"); System.in.read(); } }
[ "1312442746@qq.com" ]
1312442746@qq.com
ab534d0d6d7a650172c5d73331de3cee1195cf0f
c1e595db067fa273803cb6923a87daca0425c494
/jypx/jypx_webcontent/src/main/java/com/geekcattle/ServletInitializer.java
ef98814dd9e9b3b3d07855c5f53eb260eb316fca
[]
no_license
beichentest/jypx
859d944cfd14b2dd85a85fdcaf43a06f2c7877fb
28679f09323652579f0636456f27491c54ef591f
refs/heads/master
2021-09-03T21:15:33.147268
2018-01-12T02:32:43
2018-01-12T02:32:43
117,177,161
0
0
null
null
null
null
UTF-8
Java
false
false
573
java
package com.geekcattle; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; /** * Title: ServletInitializer Description: �൱������Web.xml Company: * blog.csdn.net/lu1005287365/ * * @author L lulu * @version 1.0 */ public class ServletInitializer {//extends SpringBootServletInitializer { //@Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Application.class); } }
[ "beichen35@sina.com" ]
beichen35@sina.com
1473f4e35cfe1768814deaa249735f3c9647ea0d
782a1438f7b8dc0e1d569199490a75049bd4f5c3
/Car Sharing/Car Sharing/task/src/carsharing/CustomerAccount.java
4967564da1b818d13a53eb7fda41e6c6da214208
[]
no_license
shubha360/Hyperskill_Projects-Java
5bcd857c297ae4661cd29d27541cebd58a1700a8
ea04309168f446220173b07f77a8ee3526f3006f
refs/heads/main
2023-06-02T19:13:13.285056
2021-06-23T12:32:13
2021-06-23T12:32:13
346,686,810
8
3
null
null
null
null
UTF-8
Java
false
false
1,374
java
package carsharing; import java.util.Scanner; public class CustomerAccount { int id; String name; int rentedCarId; public CustomerAccount(int id, String name, int rentedCarId) { this.id = id; this.name = name; this.rentedCarId = rentedCarId; } public CustomerAccount(CustomerAccount customerAccount) { this.id = customerAccount.id; this.name = customerAccount.name; this.rentedCarId = customerAccount.rentedCarId; } void startInteraction() { Scanner scanner = new Scanner(System.in); while (true) { printCustomerMenu(); int selection = Integer.parseInt(scanner.nextLine()); System.out.println(); switch (selection) { case 1: DB_Handler.rentACar(this); break; case 2: DB_Handler.returnCar(this); break; case 3: DB_Handler.getCustomersRentedCar(this); break; case 0: return; } } } private void printCustomerMenu() { System.out.println("1. Rent a car\n" + "2. Return a rented car\n" + "3. My rented car\n" + "0. Back"); } }
[ "shubha360@outlook.com" ]
shubha360@outlook.com
485419dabe2b3e9829a2623e88f9362f243d20c0
10aa61921217f4f6ea746ba3972653f2f0632817
/ACBH/ACBH.Droid/obj/Debug/android/src/md59913b075367b1ceab014c008cde85c21/MainActivity.java
a587be69a63db0a36527a226d090da2b8befe28a
[]
no_license
breeny/ACBH
34284e92a3f63a4583a9daa2307a72fd1e2cffd3
4f0f8283d594351d8c474e3514cb417b51ffbae7
refs/heads/master
2016-08-11T19:50:30.891099
2016-04-03T01:26:51
2016-04-03T01:26:51
55,289,389
0
0
null
null
null
null
UTF-8
Java
false
false
1,168
java
package md59913b075367b1ceab014c008cde85c21; public class MainActivity extends android.support.v7.app.AppCompatActivity implements mono.android.IGCUserPeer { static final String __md_methods; static { __md_methods = "n_onCreate:(Landroid/os/Bundle;)V:GetOnCreate_Landroid_os_Bundle_Handler\n" + ""; mono.android.Runtime.register ("ACBH.Droid.MainActivity, ACBH.Droid, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", MainActivity.class, __md_methods); } public MainActivity () throws java.lang.Throwable { super (); if (getClass () == MainActivity.class) mono.android.TypeManager.Activate ("ACBH.Droid.MainActivity, ACBH.Droid, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { }); } public void onCreate (android.os.Bundle p0) { n_onCreate (p0); } private native void n_onCreate (android.os.Bundle p0); java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
[ "abreeny@gmail.com" ]
abreeny@gmail.com
91b5a0ad72639540550472ee1dffcdbd58cf5d71
d56975dd9b322ae1687d5d8e9b656330c9baa927
/user-batics-server/src/main/java/com/vendor/service/IUserService.java
4317769728a9bd62c5c95b4b30c76db441c4bd29
[]
no_license
lipengyao2016/vendorSystem
04545bf50c5bdf92ba820dbe9b6c43ab92c56b59
9a2e5b57c5401ad97e0783fa59275ac349bd49aa
refs/heads/master
2022-06-26T14:45:47.679464
2019-06-17T08:11:43
2019-06-17T08:11:43
185,566,011
0
0
null
2022-06-21T01:08:52
2019-05-08T08:36:54
Lua
UTF-8
Java
false
false
587
java
package com.vendor.service; import com.vendor.entity.ListResponse; import com.vendor.bean.user.UserRoleOrgs; import com.vendor.bean.user.Users; import com.vendor.queryvo.user.UserCreateVo; import com.vendor.queryvo.user.UserQueryVo; import com.vendor.bean.user.UserRoleOrgQueryVo; public interface IUserService extends IBaseService<Users,UserQueryVo> { public Users create(UserCreateVo userCreateVo); public Users update(UserCreateVo userCreateVo); public ListResponse<UserRoleOrgs> getUserRole(UserRoleOrgQueryVo userRoleOrgQueryVo, Integer page, Integer rows); }
[ "yao50cn@163.com" ]
yao50cn@163.com
5a42b485a91bff159252235c77f2a8eb9899b241
f81ad73366cd4fede5c43851ad91a457f07c5f4f
/Java OOP Basics 20 Jun 2016/Hm02Methods/src/pr08_CarTrip/Car.java
d621a7a0211e29ecc8fe6341ee622b1f1e15555d
[]
no_license
aangelovangelov/Homeworks
ee4afb9067249c5720a621cb2700dde93e677821
58dfbebdbf87972f0205c61e172cb3ef00e372fd
refs/heads/master
2021-01-24T09:17:22.455566
2016-10-06T13:42:34
2016-10-06T13:42:34
69,881,493
0
0
null
null
null
null
UTF-8
Java
false
false
1,966
java
package pr08_CarTrip; public class Car { private Double speed; private Double fuel; private Double fuelEconomy; private Double distanceTraveled; public Car(Double speed, Double fuel, Double fuelEconomy) { this.speed = speed; this.fuel = fuel; this.fuelEconomy = fuelEconomy; this.distanceTraveled = 0d; } public void executor(String[] commands) { switch (commands[0]) { case "Travel": this.travel(Double.parseDouble(commands[1])); break; case "Distance": this.getDistanceTraveled(); break; case "Time": this.getTime(); break; case "Fuel": this.getFuel(); break; case "Refuel": this.refuel(Double.parseDouble(commands[1])); break; } } private void getFuel() { System.out.printf("Fuel left: %.1f liters%n", this.fuel); } private void refuel(Double liters) { this.fuel += liters; } private void getDistanceTraveled() { System.out.printf("Total distance: %.1f kilometers%n", this.distanceTraveled); } private void getTime() { Double totalMins = this.distanceTraveled / this.speed * 60; System.out.printf("Total time: %d hours and %d minutes%n", totalMins.intValue() / 60, totalMins.intValue() % 60); } private void travel(Double distance) { Double fuelForMove = this.neededFuel(distance); if (fuelForMove <= this.fuel) { this.distanceTraveled += distance; this.fuel -= fuelForMove; } else { this.distanceTraveled += this.fuel / this.fuelEconomy * 100; this.fuel = 0d; } } private Double neededFuel(Double distance) { return distance / 100 * this.fuelEconomy; } }
[ "a_angelov_angelov@abv.bg" ]
a_angelov_angelov@abv.bg
69a59c31fd275a20c698522e98b5e14a42bb670e
67cb2770ae5fcf7ba800c473c4d908cd9f8f8065
/src/main/java/dymn/demo/exception/BaseException.java
5091ad0e883d9017212dfbbd39c666479f59b7c7
[]
no_license
gregorio67/spring-boot
4dad2f7307d6792fa67934c5ea1ed262a7a4dfd1
ccb76f5fa883364f4ab52684a76b6d98a5ce70d2
refs/heads/master
2020-03-28T02:52:51.621534
2018-09-06T02:14:00
2018-09-06T02:14:00
147,604,620
0
0
null
null
null
null
UTF-8
Java
false
false
2,638
java
package dymn.demo.exception; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Locale; import org.springframework.context.MessageSource; public class BaseException extends RuntimeException { private static final long serialVersionUID = 1L; private String message; private String code; private Object[] param; public BaseException() { super(); message = ""; code = ""; param = null;; } public BaseException(String message) { super(message); this.code = ""; this.param = null; this.message = message; } public BaseException(String code, Object[] param) { super(); this.message=""; this.code = code; this.param = param; } public BaseException(Throwable cause) { super(cause); this.message = ""; this.code = ""; this.param = null; } public BaseException(String code, String message) { super(message); this.message = message; this.code = code; this.param = null; } public BaseException(String code, String message, Object[] param) { super(message); this.message = message; this.code = code; this.param = param; } public BaseException(String message, Throwable cause) { super(message, cause); this.message = ""; this.code = ""; this.message = message; } public BaseException(String code, MessageSource messageSource) { this(messageSource.getMessage(code, null, Locale.getDefault())); this.code = code; } public BaseException(String code, MessageSource messageSource, Object messageParameters[]) { this(messageSource.getMessage(code, messageParameters, Locale.getDefault())); this.code = code; } public BaseException(String code, MessageSource messageSource, Object messageParameters[], Locale locale) { this(messageSource.getMessage(code, messageParameters, locale)); this.code = code; } public String getMessage() { return message; } protected void setMessage(String message) { this.message = message; } protected void setCode(String code) { this.code = code; } public String getCode() { return code; } public Object[] getParam() { return param; } public void setParam(Object[] param) { this.param = param; } public Throwable getRootCause() { Throwable tempCause; for (tempCause = getCause(); tempCause != null && tempCause.getCause() != null; tempCause = tempCause .getCause()) ; return tempCause; } public String getStackTraceString() { StringWriter s = new StringWriter(); super.printStackTrace(new PrintWriter(s)); return s.toString(); } public void printStackTrace(PrintWriter log) { log.println(getStackTraceString()); } }
[ "kkimdoy@gmail.com" ]
kkimdoy@gmail.com
43d81014b289b4512825d9714b172a30423f7bb3
6ef645e3d013afa56c80794da831ce540d13bb4f
/jleopard/src/test/java/org/jleopard/jleopard/ApplicationTest.java
83584e4d5b624351e83918f0cbbe23c428160605
[]
no_license
imdog/jleopard
8c8f58b1a18fe5dfaa643a74897fdaccca1cd62f
c27f7d9e3a838d3c1edc2a1ec69e934288411ffe
refs/heads/master
2020-03-26T21:23:42.160586
2018-08-20T02:02:24
2018-08-20T02:02:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,930
java
package org.jleopard.jleopard; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import org.jleopard.core.Factory; import org.jleopard.core.sql.CreateTableSql; import org.jleopard.core.sql.SelectSql; import org.jleopard.core.sql.Sql; import org.jleopard.exception.SqlSessionException; import org.jleopard.jdbc.BaseDataSource; import org.jleopard.session.SqlSession; import org.jleopard.session.sessionFactory.SessionFactory; import org.jleopard.xml.XmlFactoryBuilder; import org.junit.Test; import test.entity.Article; import test.entity.User; /** * @Copyright (c) 2018, Chen_9g 陈刚 (80588183@qq.com). * @DateTime Jul 24, 2018 11:03:11 AM * * Find a way for success and not make excuses for failure. * */ public class ApplicationTest { @Test public void xmlTest(){ XmlFactoryBuilder builder=new XmlFactoryBuilder(ClassLoader.getSystemResource("config.xml").getPath()); XmlFactoryBuilder.XmlFactory factory=builder.getFactory(); BaseDataSource db=(BaseDataSource) factory.getBean("dataSource"); Connection conn=db.getConnection(); String sql="select k.column_name FROM information_schema.table_constraints t\n" + "JOIN information_schema.key_column_usage k\n" + "USING (constraint_name,table_name)\n" + "WHERE t.constraint_type='PRIMARY KEY'\n" + " AND t.table_name='user'"; try { Statement stm=conn.createStatement(); ResultSet res=stm.executeQuery(sql); while (res.next()){ System.out.println(res.getString(1)); } } catch (SQLException e) { e.printStackTrace(); } } @Test public void SQLTTt(){ User user=new User(); user.setId(8); user.setPhone("15770549440"); user.setName("leopard"); user.setAddress("China"); SelectSql selectsql=new SelectSql(user); System.out.println("Sql 语句:"+selectsql.getSql()); System.out.println("Sql value:"+selectsql.getValues()); } @Test public void SqlTest(){ User user=new User(); user.setId(10); user.setPhone("15770549440"); user.setName("leopard"); user.setAddress("China002"); // System.out.println("Sql value:"+FieldUtil.getAllColumnName_Value(user)); Sql insert=new CreateTableSql(Article.class); System.out.println("Sql 语句:"+insert.getSql()); SessionFactory factory=Factory.getSessionFactory("classpath:config.xml"); SqlSession session=factory.openSession(); Article a=new Article(); // a.setId(1003); a.setName("GGG"); a.setUser(user); try { System.out.println(session.Get(Article.class,User.class,"")); session.Commit(); session.Stop(); } catch (SqlSessionException e) { e.printStackTrace(); } } /* @Test public void GeneratorTest(){ GeneratorFactory factory=Factory.getGeneratorFactory("classpath:config.xml"); try { factory.openGenerator(); } catch (Exception e) { e.printStackTrace(); } } #Jleopard框架是什么? 1. jleopard是一款完全orm框架,像我们熟悉的Hibernate一样,封装好了大量的sql,足以让我们解放双手,达到极速开发体验。 2. jleopard目前能实现基本的CRUD,包括多表外键链接,关联查询,分页查询,逆向工程。 3. 使用jleopard开发只需配置好数据源,实体类扫描包路径即可,其余全采用注解自动处理。 [hr] 1. 从配置文件开始 [pre] <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE jleopard-configuration PUBLIC "-// jleopard.org//DTD Config 1.0//EN" "http://www.jleopard.org/dtd/jleopard.dtd"> <jleopard-configuration> <!-- 配置扫描实体类所在包 --> <config> <entityScan value="com.leopardframework.entity"></entityScan> <dev value="true"></dev> </config> <!-- 逆向工程生成javabean的路径配置 --> <generator> <target package="com.leopardframework.entity" project="/src/"/> </generator> <!-- 数据原配置 id="dataSource" 不能更改 --> <dataSource class="org.jleopard.jdbc.BaseDataSource" id="dataSource"> <property name="driver" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://127.0.0.1:3306/jleopardDemo?characterEncoding=UTF-8"/> <property name="username" value="root"/> <property name="password" value="chg122345"/> </dataSource> </jleopard-configuration> [/pre] 2. 在实体类上标注注解 @Table("tablename") 注解在类上 value 值为数据库对应的表名 @Column(value="colunmName",isPrimary = EnumPrimary.YES , allowNull = false , relation= "") value对应数据库的字段名,isPrimary是否为主键,有三种类型(不是主键,是主键,自增主键,allowNull是否允许为空,relation作为外键连接哪一个字段名 [pre] @Table("user") public class User { @Column(value="ID",isPrimary = EnumPrimary.YES ) private Integer id; @Column("NAME") private String name; @Column("PHONE") private String phone; @Column("ADDRESS") private String address; //省略.... } @Table("article") public class Article { @Column(isPrimary = EnumPrimary.AUTOINCREMENT) private int id; @Column(allowNull = true) private String name; //把user_id作为外键连接user表的id @Column(value = "user_id",relation = "user_id") private User user; //省略.... [/pre] 3. 获取sqlSession操作数据库表 (1)写一个工具类获取sessionFactory [pre] public static SessionFactory getSessionFactory() { //传入配置文件路径 SessionFactory factory=Factory.getSessionFactory("classpath:config.xml"); return factory; } [/pre] (2)获取sqlSession进行操作 [pre] public int save(User user) throws SqlSessionException { SqlSession session =Getsession.getSessionFactory().openSession(); int temp = session.Save(user); session.Commit(); session.Stop(); return temp; } [/pre] [hr] 4. 所有方法操作详解 [pre] @Test public void Test(){ SessionFactory factory=Factory.getSessionFactory("classpath:config.xml"); //获取session 传入我们的配置文件 SqlSession session=factory.openSession(); User user=new User(); user.setId(10086); user.setName("Leopard"); user.setPhone("10010"); user.setAddress("China"); List list=new ArrayList(); list.add(user); try { //所有操作均有SqlSessionException异常 session.Save(user); //传一个具体的对象 session.SaveMore(list); //多个对象放入list 好比批量操作,实际上并没有用到批量 session.Delete(user); //删除条件即为对象的数据 session.Delete(User.class, 10086, 10010, 10000); //根据唯一主键删除数据 ,传一个或多个主键值 session.Update(user,10086);//根据主键修改数据 目标数据是该对象里的数据 session.Get(User.class); // 查询所有数据 session.Get(user); //查询单条数据 查询条件即为对象的数据 如果匹配到多条数据,则只返回第一条 session.Get(User.class,10000,10086);// 一样按主键查找 session.Get(Article.class,User.class,"") //查询article和所属user 关联查询 session.Get(User.class,"where id=? order by id desc",10086); //自定义条件查询 动态sql session.Get(User.class,1,5); //分页查询 查询第一页数据 每页显示5 条数据 PageInfo来接收(下问文详细介绍) session.Get("",""); //自定义动态sql 返回的是结果集 session.Commit(); //每一次对更新数据库操作都要提交事物 不然数据不会写入数据库 session.Stop(); //每执行完一次都要将其暂停 session.Close(); // 关闭此次Session 下次要用时要重新获取 } catch (SqlSessionException e) { e.printStackTrace(); } } [/pre] 分页详解 [pre] @Test public void PageTest(){ 目前仅封装了我们开发中常用的一些数据信息。 获取分页信息 :getPage(); // 获取当前查询的页数 getTotalPages(); //获取总页数 getPageSize(); //获取每页显示的数据数量 getTotalRows(); //获取总记录数 getList(); //获取目标数据,也就是我们要查询的数据 SessionFactory factory=Factory.getSessionFactory("classpath:config.xml"); //获取session工厂 SqlSession session=factory.openSession(); //打开session连接 开始操作 try { PageInfo temp=session.Get(User.class,3,10); //分页查询开始 用封装好的pageInfo接收查询结果 session.Stop(); session.Close(); List<User> users=temp.getList(); for (User u :users){ System.out.println(u.toString()); } temp.description(); // System.out.println(" 结果:"+temp); } catch (SqlSessionException e) { e.printStackTrace(); } } [/pre]*/ /****************************************************/ /* github = github.com/chg122345/jleopard */ /* QQ = 80588183 */ /* jleopard暂时还没有maven依赖 */ /* github有发布的版本开发jar包 */ /***************************************************/ }
[ "80588183@qq.com" ]
80588183@qq.com
0faf968d49eb9b3b1dfcb8e7a6c09670cf66493c
8b5ff60ca76b06fb5b664d445ca6ccf9af43aca9
/app/src/main/java/com/example/cabbyapp/Login.java
21ffe612d3cc5e6e8cbf7c066e69a04421465155
[]
no_license
erickkaiserk/CabbyApp
ec35c71e64763e4311c1ad59644fd5d6594021b1
c0bf4450b874879b89b2542122d0fd9be1c8e8b9
refs/heads/master
2023-01-13T15:01:20.271766
2020-05-13T21:32:55
2020-05-13T21:32:55
263,747,847
0
0
null
null
null
null
UTF-8
Java
false
false
2,951
java
package com.example.cabbyapp; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.app.AlertDialog; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.example.cabbyapp.Includes.ToolBar; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.android.material.textfield.TextInputEditText; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import dmax.dialog.SpotsDialog; public class Login extends AppCompatActivity { TextInputEditText mTxtCorreo; TextInputEditText mTxtPassword; Button mButtonIngresar; FirebaseAuth mAuth; DatabaseReference mDatabase; AlertDialog mDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); ToolBar.show(this,"Login de usuario", true); mTxtCorreo=findViewById(R.id.txtCorreo); mTxtPassword=findViewById(R.id.txtPassword); mButtonIngresar=findViewById(R.id.btnIngresar); mAuth=FirebaseAuth.getInstance(); mDatabase= FirebaseDatabase.getInstance().getReference(); mDialog= new SpotsDialog.Builder().setContext(Login.this).setMessage("Espere un momento").build(); mButtonIngresar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { login(); } }); } private void login() { String correo=mTxtCorreo.getText().toString(); String password=mTxtPassword.getText().toString(); if(!correo.isEmpty() && !password.isEmpty()){ if(password.length()>=6){ mDialog.show(); mAuth.signInWithEmailAndPassword(correo,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if(task.isSuccessful()){ Toast.makeText(Login.this, "Login realizado exitosamente", Toast.LENGTH_SHORT).show(); }else{ Toast.makeText(Login.this, "La contraseña es incorrecta", Toast.LENGTH_SHORT).show(); } mDialog.dismiss(); } }); }else{ Toast.makeText(Login.this, "La contraseña debe tener mas de 6 caractéres", Toast.LENGTH_SHORT).show(); } }else{ Toast.makeText(Login.this, "El correo y la contraseña son obligatorios", Toast.LENGTH_SHORT).show(); } } }
[ "kaisero1010@gmail.com" ]
kaisero1010@gmail.com
82dbcd42e56a376bfb569485080ed662418fb0ff
a5d8ad024ca0085e79c5aaf0d2d0f758587ee3fa
/multithreadprogramming/src/chapter02/section03/thread_2_3_7/project_1_synchronizedUpdateNewValue/ThreadB.java
b4e6e913011a79c59e4bb583c3da0dc1c6b5673b
[ "Apache-2.0" ]
permissive
youaresherlock/multithreadingforjavanotes
12f99b19ed08b38466af31b993add67e8aff3818
b93b32f97f1d989ede69fdf39ab86687556828de
refs/heads/master
2020-03-27T06:28:01.585537
2018-11-05T14:42:15
2018-11-05T14:42:15
146,108,281
0
0
null
null
null
null
UTF-8
Java
false
false
282
java
package chapter02.section03.thread_2_3_7.project_1_synchronizedUpdateNewValue; public class ThreadB extends Thread{ private Service service; public ThreadB(Service service) { super(); this.service = service; } @Override public void run() { service.stopMethod(); } }
[ "2263194561@qq.com" ]
2263194561@qq.com
42eacc5a6f04568e0ae7184b14b5afb223cfc59c
f27c06d466cd65128d0d53c51542ee144d28e87c
/src/util/math/BinaryOperator.java
b063d09de786b3fb2c2a6ea7af8d4e2e3e749606
[]
no_license
leronen/leronen-java
f552217d0695795812a453340db5151031ad4a4c
8cc87472d2271afc44b06d050ca39f41929b1668
refs/heads/master
2021-12-10T05:51:48.941099
2021-11-30T08:26:02
2021-11-30T08:26:02
3,139,499
0
1
null
null
null
null
UTF-8
Java
false
false
125
java
package util.math; public interface BinaryOperator { public double calculate(double p1, double p2); }
[ "lauri.eronen@iki.fi" ]
lauri.eronen@iki.fi
064be35422e6b1ecf470ed7e92aa50aba6fc08b3
08be78ee28957fe393bea727228fbe13e5c00df1
/modules/webcloud/modules/webcloud-pseudocode/src/main/java/com/pseudocode/netflix/hystrix/core/HystrixCircuitBreaker.java
4adfdc439392eb87dbdc5bfa6feae42e85fcd9cc
[]
no_license
javachengwc/java-apply
432259eadfca88c6f3f2b80aae8e1e8a93df5159
98a45c716f18657f0e4181d0c125a73feb402b16
refs/heads/master
2023-08-22T12:30:05.708710
2023-08-15T08:21:15
2023-08-15T08:21:15
54,971,501
10
4
null
2022-12-16T11:03:56
2016-03-29T11:50:21
Java
UTF-8
Java
false
false
9,499
java
package com.pseudocode.netflix.hystrix.core; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import com.pseudocode.netflix.hystrix.core.HystrixCommandMetrics.HealthCounts; import rx.Subscriber; import rx.Subscription; //hystrix断路器 public interface HystrixCircuitBreaker { boolean allowRequest(); boolean isOpen(); void markSuccess(); void markNonSuccess(); //是否可执行正常逻辑 boolean attemptExecution(); class Factory { private static ConcurrentHashMap<String, HystrixCircuitBreaker> circuitBreakersByCommand = new ConcurrentHashMap<String, HystrixCircuitBreaker>(); public static HystrixCircuitBreaker getInstance(HystrixCommandKey key, HystrixCommandGroupKey group, HystrixCommandProperties properties, HystrixCommandMetrics metrics) { HystrixCircuitBreaker previouslyCached = circuitBreakersByCommand.get(key.name()); if (previouslyCached != null) { return previouslyCached; } HystrixCircuitBreaker cbForCommand = circuitBreakersByCommand.putIfAbsent(key.name(), new HystrixCircuitBreakerImpl(key, group, properties, metrics)); if (cbForCommand == null) { return circuitBreakersByCommand.get(key.name()); } else { return cbForCommand; } } public static HystrixCircuitBreaker getInstance(HystrixCommandKey key) { return circuitBreakersByCommand.get(key.name()); } static void reset() { circuitBreakersByCommand.clear(); } } //完整的断路器实现 class HystrixCircuitBreakerImpl implements HystrixCircuitBreaker { //配置 private final HystrixCommandProperties properties; //统计信息 private final HystrixCommandMetrics metrics; //状态枚举,关,开,半开 enum Status { CLOSED, OPEN, HALF_OPEN; } //状态 private final AtomicReference<Status> status = new AtomicReference<Status>(Status.CLOSED); //断路器打开时间 private final AtomicLong circuitOpened = new AtomicLong(-1); //当前统计的订阅 private final AtomicReference<Subscription> activeSubscription = new AtomicReference<Subscription>(null); protected HystrixCircuitBreakerImpl(HystrixCommandKey key, HystrixCommandGroupKey commandGroup, final HystrixCommandProperties properties, HystrixCommandMetrics metrics) { this.properties = properties; this.metrics = metrics; //On a timer, this will set the circuit between OPEN/CLOSED as command executions occur //订阅统计 Subscription s = subscribeToStream(); activeSubscription.set(s); } //向HystrixMetrics对请求量统计Observable发起订阅 private Subscription subscribeToStream() { return metrics.getHealthCountsStream() .observe() .subscribe(new Subscriber<HealthCounts>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { } @Override public void onNext(HealthCounts hc) { // check if we are past the statisticalWindowVolumeThreshold if (hc.getTotalRequests() < properties.circuitBreakerRequestVolumeThreshold().get()) { //请求量没超过20,20是默认值 // we are not past the minimum volume threshold for the stat window, // so no change to circuit status. // if it was CLOSED, it stays CLOSED // if it was half-open, we need to wait for a successful command execution // if it was open, we need to wait for sleep window to elapse } else { if (hc.getErrorPercentage() < properties.circuitBreakerErrorThresholdPercentage().get()) { //错误率没超过50% //we are not past the minimum error threshold for the stat window, // so no change to circuit status. // if it was CLOSED, it stays CLOSED // if it was half-open, we need to wait for a successful command execution // if it was open, we need to wait for sleep window to elapse } else { // our failure rate is too high, we need to set the state to OPEN if (status.compareAndSet(Status.CLOSED, Status.OPEN)) { //断路器打开 circuitOpened.set(System.currentTimeMillis()); } } } } }); } //尝试调用正常逻辑成功,半开变成关闭,关闭断路器 @Override public void markSuccess() { if (status.compareAndSet(Status.HALF_OPEN, Status.CLOSED)) { //This thread wins the race to close the circuit - it resets the stream to start it over from 0 //统计重置 metrics.resetStream(); //取消之前的订阅 Subscription previousSubscription = activeSubscription.get(); if (previousSubscription != null) { previousSubscription.unsubscribe(); } //重新订阅 Subscription newSubscription = subscribeToStream(); activeSubscription.set(newSubscription); //打开时间初始 circuitOpened.set(-1L); } } //尝试调用正常逻辑失败,半开变成打开,重新打开断路器 @Override public void markNonSuccess() { if (status.compareAndSet(Status.HALF_OPEN, Status.OPEN)) { //This thread wins the race to re-open the circuit - it resets the start time for the sleep window circuitOpened.set(System.currentTimeMillis()); } } //断路器是否打开 @Override public boolean isOpen() { if (properties.circuitBreakerForceOpen().get()) { return true; } if (properties.circuitBreakerForceClosed().get()) { return false; } return circuitOpened.get() >= 0; } @Override public boolean allowRequest() { if (properties.circuitBreakerForceOpen().get()) { return false; } if (properties.circuitBreakerForceClosed().get()) { return true; } if (circuitOpened.get() == -1) { return true; } else { if (status.get().equals(Status.HALF_OPEN)) { return false; } else { return isAfterSleepWindow(); } } } //开启断路器5秒钟后,状态变成半开状态 private boolean isAfterSleepWindow() { final long circuitOpenTime = circuitOpened.get(); final long currentTime = System.currentTimeMillis(); final long sleepWindowTime = properties.circuitBreakerSleepWindowInMilliseconds().get(); return currentTime > circuitOpenTime + sleepWindowTime; } //是否可执行正常逻辑 @Override public boolean attemptExecution() { if (properties.circuitBreakerForceOpen().get()) { return false; } if (properties.circuitBreakerForceClosed().get()) { return true; } if (circuitOpened.get() == -1) { return true; } else { if (isAfterSleepWindow()) { //半开 if (status.compareAndSet(Status.OPEN, Status.HALF_OPEN)) { //only the first request after sleep window should execute return true; } else { return false; } } else { return false; } } } } //空的断路器实现 class NoOpCircuitBreaker implements HystrixCircuitBreaker { @Override public boolean allowRequest() { return true; } @Override public boolean isOpen() { return false; } @Override public void markSuccess() { } @Override public void markNonSuccess() { } @Override public boolean attemptExecution() { return true; } } }
[ "chengz@ccc.com" ]
chengz@ccc.com
e62e436360fe2ee250ac2fccc990021e4a00f037
6755ca830637f7b72063182ce09341b7155eff5b
/web/src/main/java/by/saidanov/auction/commands/impl/user/GoToRegistrationCommand.java
3c3a3617cf2fc335f03b696b4fd14fc7b7212e32
[]
no_license
ArtemSaidanov/Auction
e41819398b80ccdbbaab7eecdc5b2c75513fbf6e
4aa6f81c2f38730bf1c4a9e48397dbc308a26175
refs/heads/master
2021-01-18T20:31:41.829598
2017-04-17T14:42:59
2017-04-17T14:42:59
86,975,230
1
0
null
2017-04-17T14:42:59
2017-04-02T09:10:23
Java
UTF-8
Java
false
false
605
java
package by.saidanov.auction.commands.impl.user; import by.saidanov.auction.commands.BaseCommand; import by.saidanov.auction.constants.PagePath; import by.saidanov.auction.managers.ConfigurationManager; import javax.servlet.http.HttpServletRequest; /** * Description: Redirects to the registration page * * @author Artiom Saidanov. */ public class GoToRegistrationCommand implements BaseCommand { @Override public String execute(HttpServletRequest request) { String page = ConfigurationManager.getInstance().getProperty(PagePath.REGISTRATION_PAGE_PATH); return page; } }
[ "art.saidanov@yandex.ru" ]
art.saidanov@yandex.ru
839fb9187e0dbb2e9819b41538ca4dea2484c4c5
d1bd1246f161b77efb418a9c24ee544d59fd1d20
/android/mylibrary/trunk/src/org/anybox/android/library/app/MyAccountBinder.java
bc7ca7b846bcc935f3e8f1c338412d9ddce904b2
[]
no_license
navychen2003/javen
f9a94b2e69443291d4b5c3db5a0fc0d1206d2d4a
a3c2312bc24356b1c58b1664543364bfc80e816d
refs/heads/master
2021-01-20T12:12:46.040953
2015-03-03T06:14:46
2015-03-03T06:14:46
30,912,222
0
1
null
2023-03-20T11:55:50
2015-02-17T10:24:28
Java
UTF-8
Java
false
false
1,714
java
package org.anybox.android.library.app; import android.view.LayoutInflater; import android.view.View; import org.javenstudio.android.app.IActivity; import org.javenstudio.provider.app.anybox.user.AnyboxAccountBinder; import org.javenstudio.provider.app.anybox.user.AnyboxAccountProvider; public class MyAccountBinder extends AnyboxAccountBinder { //private static final Logger LOG = Logger.getLogger(MyAccountBinder.class); private final MyBinderHelper mHelper = MyBinderHelper.BLUE; public MyAccountBinder(AnyboxAccountProvider p) { super(p); } @Override protected void onBindedItemView(IActivity activity, LayoutInflater inflater, View view) { super.onBindedItemView(activity, inflater, view); if (mHelper != null) mHelper.onBindRefreshView(activity, view); } @Override public int getHomeAsUpIndicatorMenuRes() { if (mHelper != null) return mHelper.getHomeAsUpIndicatorMenuRes(); return super.getHomeAsUpIndicatorMenuRes(); } @Override public int getHomeAsUpIndicatorBackRes() { if (mHelper != null) return mHelper.getHomeAsUpIndicatorBackRes(); return super.getHomeAsUpIndicatorBackRes(); } @Override protected int getHeaderMainViewBackgroundRes() { if (mHelper != null) return mHelper.getHeaderMainViewBackgroundRes(); return super.getHeaderMainViewBackgroundRes(); } @Override protected int getHeaderActionsViewBackgroundRes() { if (mHelper != null) return mHelper.getHeaderActionsViewBackgroundRes(); return super.getHeaderActionsViewBackgroundRes(); } @Override protected int getAboveActionsViewBackgroundRes() { if (mHelper != null) return mHelper.getAboveActionsViewBackgroundRes(); return super.getAboveActionsViewBackgroundRes(); } }
[ "navychen2003@hotmail.com" ]
navychen2003@hotmail.com
a2a9b0e876b0907a1026ee4628d5a2cae6ade5dc
ec2f1b12cf0c75f5d367d8463e0bea14ad44f57a
/app/serviceImpl/RecommendationServiceImpl.java
4b33631953092e3bdac259cbdb8228ef2f1724c6
[ "Apache-2.0" ]
permissive
SeWitt/StoreNRent
2358177e34a273ba018f9dda6cfd25529f43523f
277258ba0983d0f794a50cad8af0995841070c22
refs/heads/master
2021-01-21T08:01:50.689888
2014-06-29T22:06:25
2014-06-29T22:06:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,430
java
package serviceImpl; import java.util.Date; import java.util.List; import service.RecommendationService; import repository.RecommendationRepository; import models.Person; import models.Recommendation; import models.RecommendationSummary; /** * @author Sebastian * @version 1.0 * @created 23-Mai-2014 16:53:27 */ public class RecommendationServiceImpl implements RecommendationService { private RecommendationRepository recommRepo = new RecommendationRepository();; public RecommendationServiceImpl(){ } @Override public Recommendation createRecommendation(Recommendation recomm) { recomm.createdDate = new Date(); recomm.isActive = true; recomm.lastEditedDate = recomm.createdDate; return recommRepo.createRecommendation(recomm); } @Override public Recommendation updateRecommendation(Recommendation recomm) { if(recomm.isActive = true){ recomm.lastEditedDate = new Date(); recomm = recommRepo.updateRecommendation(recomm); } return recomm; } @Override public void deleteRecommendation(Recommendation recomm) { recomm.isActive = false; recommRepo.updateRecommendation(recomm); } @Override public RecommendationSummary getRecommendationSummary(Person person) { return recommRepo.getRecommendationSummary(person); } @Override public List<Recommendation> findRecommendationsByReceiver(Person person) { return recommRepo.findRecommendationByReceiver(person); } }
[ "sebi@witt-mann.de" ]
sebi@witt-mann.de
e9f06c3ed43d5dd7a5d4dbfdba9a6f2acdce4fd0
8613229c0dbfe5018245136aaa88859fc07325cc
/src/SimpleTomcat/Server/ServletInstance/Shutdown.java
7f941eae20119681a41f7b427cc8cb1d2a0aca4f
[]
no_license
shangyin/SimpleTest
27c2d0c67e4af82f35f72398703adec4ab42578e
c5bfe867ec2862259bada5aedf750a36b3900187
refs/heads/master
2020-07-08T00:00:54.628347
2016-09-11T08:08:58
2016-09-11T08:08:58
67,815,528
0
0
null
null
null
null
UTF-8
Java
false
false
427
java
package SimpleTomcat.Server.ServletInstance; import SimpleTomcat.Server.Request; import SimpleTomcat.Server.Response; import static SimpleTomcat.Util.*; /** * Created by 41237 on 2016/7/12. */ public class Shutdown implements Servlet { @Override public void service(Request request, Response response) { init.write2Db(); response.addPara(CODE, ANSWER_PERMIT); response.flush(); } }
[ "xxtsmail@qq.com" ]
xxtsmail@qq.com
4abda80b25c545824f7ce2d499dc20422166bba8
aecf49df2d88967b31e5b21db301166e34334794
/java/serviceconsume-feign/src/main/java/com/my/serviceconsumefeign/service/IHelloService.java
66f54efeba975bd7f81a637be5e71ff54f42cfe8
[]
no_license
DiaosX/springcloudstarting
68aa446ad523432cfd419c07ae4e289020863d86
09976e2ebb89540af33f059c1042662200dfcbe5
refs/heads/master
2022-07-26T16:32:53.523074
2019-05-30T10:18:33
2019-05-30T10:18:33
189,318,288
0
0
null
2022-07-07T23:15:24
2019-05-30T00:32:49
Java
UTF-8
Java
false
false
627
java
package com.my.serviceconsumefeign.service; import com.my.serviceconsumefeign.fallback.HelloServiceHystrix; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; @FeignClient(value = "serviceprovider", fallback = HelloServiceHystrix.class) public interface IHelloService { @RequestMapping(value = "/hello/sayHello", method = RequestMethod.GET) String sayHello(@RequestParam(name = "message", required = false) String message); }
[ "yangshengtao_cool@126.com" ]
yangshengtao_cool@126.com
2bf069b71d9aea37b9f22ee25fcc9e3cab02b01f
6d6a2896e206089fed182d93f60e0691126d889c
/weka/main/java/weka/attributeSelection/CostSensitiveASEvaluation.java
bcf4a9c9fdaaadc09597fe4cf43b5dae1d3206e8
[]
no_license
azizisya/benhesrc
2291c9d9cb22171f4e382968c14721d440bbabf2
4bd27c1f6e91b2aec1bd71f0810d1bbd0db902b5
refs/heads/master
2020-05-18T08:53:54.800452
2011-02-24T09:41:17
2011-02-24T09:41:17
34,458,592
2
0
null
null
null
null
UTF-8
Java
false
false
17,976
java
/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * CostSensitiveASEvaluation.java * Copyright (C) 2008 Pentaho Corporation * */ package weka.attributeSelection; import weka.core.Capabilities; import weka.core.Instance; import weka.core.Instances; import weka.core.Option; import weka.core.OptionHandler; import weka.core.Utils; import weka.core.Capabilities.Capability; import weka.core.SelectedTag; import weka.core.Tag; import weka.classifiers.CostMatrix; import weka.core.WeightedInstancesHandler; import weka.core.RevisionUtils; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.StringReader; import java.io.StringWriter; import java.io.Serializable; import java.util.Enumeration; import java.util.Random; import java.util.Vector; import java.util.ArrayList; /** * Abstract base class for cost-sensitive subset and attribute evaluators. * * @author Mark Hall (mhall{[at]}pentaho{[dot]}com) * @version $Revision: 1.1 $ */ public abstract class CostSensitiveASEvaluation extends ASEvaluation implements OptionHandler, Serializable { /** for serialization */ static final long serialVersionUID = -7045833833363396977L; /** load cost matrix on demand */ public static final int MATRIX_ON_DEMAND = 1; /** use explicit cost matrix */ public static final int MATRIX_SUPPLIED = 2; /** Specify possible sources of the cost matrix */ public static final Tag [] TAGS_MATRIX_SOURCE = { new Tag(MATRIX_ON_DEMAND, "Load cost matrix on demand"), new Tag(MATRIX_SUPPLIED, "Use explicit cost matrix") }; /** Indicates the current cost matrix source */ protected int m_MatrixSource = MATRIX_ON_DEMAND; /** * The directory used when loading cost files on demand, null indicates * current directory */ protected File m_OnDemandDirectory = new File(System.getProperty("user.dir")); /** The name of the cost file, for command line options */ protected String m_CostFile; /** The cost matrix */ protected CostMatrix m_CostMatrix = new CostMatrix(1); /** The base evaluator to use */ protected ASEvaluation m_evaluator; /** random number seed */ protected int m_seed = 1; /** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ public Enumeration listOptions() { Vector newVector = new Vector(4); newVector.addElement(new Option( "\tFile name of a cost matrix to use. If this is not supplied,\n" +"\ta cost matrix will be loaded on demand. The name of the\n" +"\ton-demand file is the relation name of the training data\n" +"\tplus \".cost\", and the path to the on-demand file is\n" +"\tspecified with the -N option.", "C", 1, "-C <cost file name>")); newVector.addElement(new Option( "\tName of a directory to search for cost files when loading\n" +"\tcosts on demand (default current directory).", "N", 1, "-N <directory>")); newVector.addElement(new Option( "\tThe cost matrix in Matlab single line format.", "cost-matrix", 1, "-cost-matrix <matrix>")); newVector.addElement(new Option( "\tThe seed to use for random number generation.", "S", 1, "-S <integer>")); newVector.addElement(new Option( "\tFull name of base evaluator. Options after -- are " +"passed to the evaluator.\n" + "\t(default: " + defaultEvaluatorString() +")", "W", 1, "-W")); if (m_evaluator instanceof OptionHandler) { newVector.addElement(new Option( "", "", 0, "\nOptions specific to evaluator " + m_evaluator.getClass().getName() + ":")); Enumeration enu = ((OptionHandler)m_evaluator).listOptions(); while (enu.hasMoreElements()) { newVector.addElement(enu.nextElement()); } } return newVector.elements(); } /** * Parses a given list of options. <p/> * * Valid options are: <p/> * * <pre> -C &lt;cost file name&gt; * File name of a cost matrix to use. If this is not supplied, * a cost matrix will be loaded on demand. The name of the * on-demand file is the relation name of the training data * plus ".cost", and the path to the on-demand file is * specified with the -N option.</pre> * * <pre> -N &lt;directory&gt; * Name of a directory to search for cost files when loading * costs on demand (default current directory).</pre> * * <pre> -cost-matrix &lt;matrix&gt; * The cost matrix in Matlab single line format.</pre> * * <pre> -S &lt;integer&gt; * The seed to use for random number generation.</pre> * * <pre> -W * Full name of base evaluator. * (default: weka.attributeSelection.CfsSubsetEval)</pre> * * Options after -- are passed to the designated evaluator.<p> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ public void setOptions(String[] options) throws Exception { String costFile = Utils.getOption('C', options); if (costFile.length() != 0) { try { setCostMatrix(new CostMatrix(new BufferedReader( new FileReader(costFile)))); } catch (Exception ex) { // now flag as possible old format cost matrix. Delay cost matrix // loading until buildClassifer is called setCostMatrix(null); } setCostMatrixSource(new SelectedTag(MATRIX_SUPPLIED, TAGS_MATRIX_SOURCE)); m_CostFile = costFile; } else { setCostMatrixSource(new SelectedTag(MATRIX_ON_DEMAND, TAGS_MATRIX_SOURCE)); } String demandDir = Utils.getOption('N', options); if (demandDir.length() != 0) { setOnDemandDirectory(new File(demandDir)); } String cost_matrix = Utils.getOption("cost-matrix", options); if (cost_matrix.length() != 0) { StringWriter writer = new StringWriter(); CostMatrix.parseMatlab(cost_matrix).write(writer); setCostMatrix(new CostMatrix(new StringReader(writer.toString()))); setCostMatrixSource(new SelectedTag(MATRIX_SUPPLIED, TAGS_MATRIX_SOURCE)); } String seed = Utils.getOption('S', options); if (seed.length() != 0) { setSeed(Integer.parseInt(seed)); } else { setSeed(1); } String evaluatorName = Utils.getOption('W', options); if (evaluatorName.length() > 0) { // This is just to set the evaluator in case the option // parsing fails. setEvaluator(ASEvaluation.forName(evaluatorName, null)); setEvaluator(ASEvaluation.forName(evaluatorName, Utils.partitionOptions(options))); } else { // This is just to set the classifier in case the option // parsing fails. setEvaluator(ASEvaluation.forName(defaultEvaluatorString(), null)); setEvaluator(ASEvaluation.forName(defaultEvaluatorString(), Utils.partitionOptions(options))); } } /** * Gets the current settings of the subset evaluator. * * @return an array of strings suitable for passing to setOptions */ public String[] getOptions() { ArrayList<String> options = new ArrayList<String>(); if (m_MatrixSource == MATRIX_SUPPLIED) { if (m_CostFile != null) { options.add("-C"); options.add("" + m_CostFile); } else { options.add("-cost-matrix"); options.add(getCostMatrix().toMatlab()); } } else { options.add("-N"); options.add("" + getOnDemandDirectory()); } options.add("-S"); options.add("" + getSeed()); options.add("-W"); options.add(m_evaluator.getClass().getName()); if (m_evaluator instanceof OptionHandler) { String[] evaluatorOptions = ((OptionHandler)m_evaluator).getOptions(); if (evaluatorOptions.length > 0) { options.add("--"); for (int i = 0; i < evaluatorOptions.length; i++) { options.add(evaluatorOptions[i]); } } } return options.toArray(new String[0]); } /** * @return a description of the classifier suitable for * displaying in the explorer/experimenter gui */ public String globalInfo() { return "A meta subset evaluator that makes its base subset evaluator cost-sensitive. "; } /** * Return the name of the default evaluator. * * @return the name of the default evaluator */ public String defaultEvaluatorString() { return "weka.attributeSelection.CfsSubsetEval"; } /** * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String costMatrixSourceTipText() { return "Sets where to get the cost matrix. The two options are" + "to use the supplied explicit cost matrix (the setting of the " + "costMatrix property), or to load a cost matrix from a file when " + "required (this file will be loaded from the directory set by the " + "onDemandDirectory property and will be named relation_name" + CostMatrix.FILE_EXTENSION + ")."; } /** * Gets the source location method of the cost matrix. Will be one of * MATRIX_ON_DEMAND or MATRIX_SUPPLIED. * * @return the cost matrix source. */ public SelectedTag getCostMatrixSource() { return new SelectedTag(m_MatrixSource, TAGS_MATRIX_SOURCE); } /** * Sets the source location of the cost matrix. Values other than * MATRIX_ON_DEMAND or MATRIX_SUPPLIED will be ignored. * * @param newMethod the cost matrix location method. */ public void setCostMatrixSource(SelectedTag newMethod) { if (newMethod.getTags() == TAGS_MATRIX_SOURCE) { m_MatrixSource = newMethod.getSelectedTag().getID(); } } /** * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String onDemandDirectoryTipText() { return "Sets the directory where cost files are loaded from. This option " + "is used when the costMatrixSource is set to \"On Demand\"."; } /** * Returns the directory that will be searched for cost files when * loading on demand. * * @return The cost file search directory. */ public File getOnDemandDirectory() { return m_OnDemandDirectory; } /** * Sets the directory that will be searched for cost files when * loading on demand. * * @param newDir The cost file search directory. */ public void setOnDemandDirectory(File newDir) { if (newDir.isDirectory()) { m_OnDemandDirectory = newDir; } else { m_OnDemandDirectory = new File(newDir.getParent()); } m_MatrixSource = MATRIX_ON_DEMAND; } /** * Gets the evaluator specification string, which contains the class name of * the evaluator and any options to the evaluator * * @return the evaluator string. */ protected String getEvaluatorSpec() { ASEvaluation ase = getEvaluator(); if (ase instanceof OptionHandler) { return ase.getClass().getName() + " " + Utils.joinOptions(((OptionHandler)ase).getOptions()); } return ase.getClass().getName(); } /** * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String costMatrixTipText() { return "Sets the cost matrix explicitly. This matrix is used if the " + "costMatrixSource property is set to \"Supplied\"."; } /** * Gets the misclassification cost matrix. * * @return the cost matrix */ public CostMatrix getCostMatrix() { return m_CostMatrix; } /** * Sets the misclassification cost matrix. * * @param newCostMatrix the cost matrix */ public void setCostMatrix(CostMatrix newCostMatrix) { m_CostMatrix = newCostMatrix; m_MatrixSource = MATRIX_SUPPLIED; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String seedTipText() { return "The random number seed to be used."; } /** * Set the seed for random number generation. * * @param seed the seed */ public void setSeed(int seed) { m_seed = seed; } /** * Gets the seed for the random number generations. * * @return the seed for the random number generation */ public int getSeed() { return m_seed; } /** * Returns the tip text for this property * @return tip text for this property suitable for * displaying in the explorer/experimenter gui */ public String evaluatorTipText() { return "The base evaluator to be used."; } /** * Set the base evaluator. * * @param newEvaluator the evaluator to use. * @throws IllegalArgumentException if the evaluator is of the wrong type */ public void setEvaluator(ASEvaluation newEvaluator) throws IllegalArgumentException { m_evaluator = newEvaluator; } /** * Get the evaluator used as the base evaluator. * * @return the evaluator used as the base evaluator */ public ASEvaluation getEvaluator() { return m_evaluator; } /** * Returns default capabilities of the classifier. * * @return the capabilities of this classifier */ public Capabilities getCapabilities() { Capabilities result; if (getEvaluator() != null) { result = getEvaluator().getCapabilities(); } else { result = new Capabilities(this); } // class result.disableAllClasses(); result.disableAllClassDependencies(); result.enable(Capability.NOMINAL_CLASS); return result; } /** * Generates a attribute evaluator. Has to initialize all fields of the * evaluator that are not being set via options. * * @param data set of instances serving as training data * @exception Exception if the evaluator has not been * generated successfully */ public void buildEvaluator(Instances data) throws Exception { // can evaluator handle the data? getCapabilities().testWithFail(data); // remove instances with missing class data = new Instances(data); data.deleteWithMissingClass(); if (m_evaluator == null) { throw new Exception("No base evaluator has been set!"); } if (m_MatrixSource == MATRIX_ON_DEMAND) { String costName = data.relationName() + CostMatrix.FILE_EXTENSION; File costFile = new File(getOnDemandDirectory(), costName); if (!costFile.exists()) { throw new Exception("On-demand cost file doesn't exist: " + costFile); } setCostMatrix(new CostMatrix(new BufferedReader( new FileReader(costFile)))); } else if (m_CostMatrix == null) { // try loading an old format cost file m_CostMatrix = new CostMatrix(data.numClasses()); m_CostMatrix.readOldFormat(new BufferedReader( new FileReader(m_CostFile))); } Random random = null; if (!(m_evaluator instanceof WeightedInstancesHandler)) { random = new Random(m_seed); } data = m_CostMatrix.applyCostMatrix(data, random); m_evaluator.buildEvaluator(data); } /** * Provides a chance for a attribute evaluator to do any special * post processing of the selected attribute set. * * @param attributeSet the set of attributes found by the search * @return a possibly ranked list of postprocessed attributes * @exception Exception if postprocessing fails for some reason */ public int [] postProcess(int [] attributeSet) throws Exception { return m_evaluator.postProcess(attributeSet); } /** * Output a representation of this evaluator * * @return a string representation of the classifier */ public String toString() { if (m_evaluator == null) { return "CostSensitiveASEvaluation: No model built yet."; } String result = (m_evaluator instanceof AttributeEvaluator) ? "CostSensitiveAttributeEval using " : "CostSensitiveSubsetEval using "; result += "\n\n" + getEvaluatorSpec() + "\n\nEvaluator\n" + m_evaluator.toString() + "\n\nCost Matrix\n" + m_CostMatrix.toString(); return result; } /** * Returns the revision string. * * @return the revision */ public String getRevision() { return RevisionUtils.extract("$Revision: 1.1 $"); } }
[ "ben.he.src@f3485be4-0bd3-11df-ad0c-0fb4090ca1bc" ]
ben.he.src@f3485be4-0bd3-11df-ad0c-0fb4090ca1bc
ed4345f1899f58accc5985f96f1889996f84210e
8714a9c8271b5658a26369b16b0b6a730ce7616b
/sesionrdf/Tarea1.java
d35d469b3e2fbd893586f50585acfdf44b28fca8
[]
no_license
alfa310/gestion_del_conocimiento
1e7ba265c93259013baa37709acd25e031fdd5fa
6021110ab5ee40ac5a0aa032ecb19f6d645de8e4
refs/heads/main
2022-12-30T03:31:05.983644
2020-10-14T20:26:02
2020-10-14T20:26:02
303,585,455
0
0
null
null
null
null
UTF-8
Java
false
false
5,880
java
package sesionrdf; import java.util.*; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.Property; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Selector; import org.apache.jena.rdf.model.SimpleSelector; import org.apache.jena.rdf.model.StmtIterator; import org.apache.jena.vocabulary.VCARD; public class Tarea1 { public static void main(String[] args) { Model modeloAlumnos = ModelFactory.createDefaultModel(); Model modeloCorreos = ModelFactory.createDefaultModel(); Model modeloGrupos = ModelFactory.createDefaultModel(); modeloAlumnos.read( "https://raw.githubusercontent.com/andres-melgar/rdf/master/alumnos.rdf" ); modeloCorreos.read( "https://raw.githubusercontent.com/andres-melgar/rdf/master/correos.rdf" ); modeloGrupos.read( "https://raw.githubusercontent.com/andres-melgar/rdf/master/grupos.rdf" ); Model modelo = modeloGrupos.union(modeloAlumnos.union(modeloCorreos)); String action = args[0]; if (action.equals("codigo")) { String codigo = args[1]; String nombre = obtenerNombreDelCodigo(modelo, codigo); ArrayList<String> correos = obtenerCorreosDelCodigo(modelo, codigo); System.out.println("nombre: " + nombre); int index = 1; Iterator itr = correos.iterator(); //getting the Iterator while (itr.hasNext()) { //check if iterator has the elements System.out.println("correo " + index + ": " + itr.next()); index += 1; //printing the element and move to next } } else if (action.equals("nombre")) { int i = 2; String nombre = args[1]; while (i < args.length){ nombre += " " + args[i]; i++; } // String nombre = args[1] + " " + args[2] + " " + args[3] + " " + args[4]; String grupo = obtenerGrupoDelNombre(modelo, nombre); System.out.println("grupo: " + grupo); } else if (action.equals("grupo")) { String grupo = args[1]; ArrayList<String> correos = obtenerCorreosDelGrupo(modelo, grupo); Iterator itr = correos.iterator(); //getting the Iterator int index = 1; while (itr.hasNext()) { //check if iterator has the elements System.out.println("correo " + index + ": " + itr.next()); index += 1; //printing the element and move to next } } } public static ArrayList<String> obtenerCorreosDelGrupo( Model modelo, String grupo ) { ArrayList<String> correos = new ArrayList<String>(); Selector selector1 = new SimpleSelector( null, null, (RDFNode) modelo.createLiteral(grupo) ); StmtIterator iter1 = modelo.listStatements(selector1); if (iter1.hasNext()) { Resource grupoRes = iter1.nextStatement().getSubject(); Selector selector2 = new SimpleSelector(null, null, (RDFNode) grupoRes); StmtIterator iter2 = modelo.listStatements(selector2); ArrayList<String> codigos = new ArrayList<String>(); while (iter2.hasNext()) { codigos.add(iter2.nextStatement().getSubject().toString()); } Iterator itr = codigos.iterator(); while (itr.hasNext()) { Resource codigo = modelo.getResource(itr.next().toString()); Selector selector3 = new SimpleSelector( codigo, VCARD.EMAIL, (RDFNode) null ); StmtIterator iter3 = modelo.listStatements(selector3); while (iter3.hasNext()) { correos.add(iter3.nextStatement().getObject().toString()); } } } return correos; } public static String obtenerGrupoDelNombre(Model modelo, String nombre) { System.out.println("nombre: " + nombre); Selector selector = new SimpleSelector( null, null, (RDFNode) modelo.createLiteral(nombre) ); StmtIterator iterNombre = modelo.listStatements(selector); if (iterNombre.hasNext()) { Resource codigo = iterNombre.nextStatement().getSubject(); Property pertenece = modelo.getProperty( "https://raw.githubusercontent.com/andres-melgar/rdf/master/grupos.rdf#pertenece" ); Selector selectorNombre = new SimpleSelector( codigo, pertenece, (RDFNode) null ); StmtIterator iterGrupo = modelo.listStatements(selectorNombre); if (iterGrupo.hasNext()) { Resource grupo = iterGrupo.nextStatement().getObject().asResource(); Selector selector3 = new SimpleSelector( grupo, VCARD.GROUP, (RDFNode) null ); StmtIterator iter3 = modelo.listStatements(selector3); if (iter3.hasNext()) { return iter3.nextStatement().getObject().toString(); } } } return null; } public static String obtenerNombreDelCodigo(Model modelo, String codigo) { String codigoUri = "alum:" + codigo; Resource recurso = modelo.getResource(codigoUri); Selector selectorNombre = new SimpleSelector( recurso, VCARD.FN, (RDFNode) null ); StmtIterator iterNombre = modelo.listStatements(selectorNombre); if (iterNombre.hasNext()) { return iterNombre.nextStatement().getObject().toString(); } return null; } public static ArrayList<String> obtenerCorreosDelCodigo( Model modelo, String codigo ) { String codigoUri = "alum:" + codigo; Resource recurso = modelo.getResource(codigoUri); Selector selectorNombre = new SimpleSelector( recurso, VCARD.EMAIL, (RDFNode) null ); ArrayList<String> correos = new ArrayList<String>(); StmtIterator iter = modelo.listStatements(selectorNombre); while (iter.hasNext()) { correos.add(iter.nextStatement().getObject().toString()); } return correos; } }
[ "berolatti.diego@pucp.pe" ]
berolatti.diego@pucp.pe
0eee90dede772ed415e138cfd1fbb2952b4a9770
653a8dc7283b49c8ab9916cef874f325fce55c82
/Project1/src/dev/tylerdclark/Utilities.java
55b1cd2f4f0a4f49f7c2bec84889ba4150f4658d
[ "MIT" ]
permissive
owoodworth/CMSC451
a758ed5f1578e5ebee26ecb532f3bc4a0b52abea
3853fb3951bdbb2b81fff4a531fba0844d11f440
refs/heads/main
2023-08-12T15:39:22.814571
2021-10-09T03:48:40
2021-10-09T03:48:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,139
java
package dev.tylerdclark; import java.util.Arrays; public class Utilities { /** * Calculates the average using the formula: sum of data / data count * * @param data to be averaged * @return average value */ protected static double getAverage(double[] data) { double sum = Arrays.stream(data).sum(); return sum / data.length; } /** * Creates an array of random numbers between 0 and 999 * @param n length of array * @return array of random numbers */ protected static int[] getData(int n) { int[] data = new int[n]; for (int i = 0; i < n; i++) data[i] = (int) (Math.random() * 1000); return data; } /** * Calculates the standard deviation which is how close the data is to average. * Formula from https://en.wikipedia.org/wiki/Standard_deviation * * @param data to be analyzed * @return standard deviation of a collection */ protected static double getStandardDeviation(double[] data) { double sum = 0; for (double datum : data) { sum += (datum - getAverage(data)) * (datum - getAverage(data)); } return Math.sqrt(sum / (data.length - 1)); } /** * Shows the extent of variability in relation to the average. * Formula from https://en.wikipedia.org/wiki/Coefficient_of_variation * * @param data to be analyzed * @return coefficient of variance */ protected static double getCoefficientOfVariance(double[] data) { return ((getStandardDeviation(data)) / getAverage(data)) * 100; } /** * Using the manual JVM warmup method mentioned in the article: * https://www.baeldung.com/java-jvm-warmup */ protected static void JVMWarmUp() { for (int i = 0; i < 1000000; i++) { ManualClass manualClass = new ManualClass(); manualClass.method(); } } /** * Manual class to be instantiated for the purpose of JVM warmup */ public static class ManualClass { public void method() { } } }
[ "tylerc.thedeveloper@gmail.com" ]
tylerc.thedeveloper@gmail.com
2dc18aa5e779f0b89ba4367f82f7c103afc1d8c4
7de460270260ece904bfff3529b767ec15850512
/alpha-web/src/main/java/com/alpha/web/module/screen/api/department/PartnerDepartmentDel.java
2826313b390eff736afcb38db83c6b694ddd871f
[]
no_license
taoxiangxiang/alpha
8b7c0f8512a3d33b13706ff2f771790e2e1c4c8a
bf69fe6792c5a5bc308b2b83510c5c4b27dfdc9e
refs/heads/master
2021-01-18T22:29:13.558534
2018-05-12T14:28:15
2018-05-12T14:28:15
87,056,789
0
0
null
null
null
null
UTF-8
Java
false
false
1,858
java
package com.alpha.web.module.screen.api.department; import com.alibaba.citrus.turbine.Context; import com.alibaba.citrus.turbine.dataresolver.Param; import com.alpha.constans.SystemConstant; import com.alpha.domain.DepartmentDO; import com.alpha.domain.PartnerDepartmentDO; import com.alpha.domain.SystemAccountDO; import com.alpha.manager.DepartmentManager; import com.alpha.manager.PartnerDepartmentManager; import com.alpha.web.common.BaseAjaxModule; import com.alpha.web.domain.Result; import javax.annotation.Resource; /** * Created by taoxiang on 2017/4/8. */ public class PartnerDepartmentDel extends BaseAjaxModule { @Resource private PartnerDepartmentManager partnerDepartmentManager; public void execute(@Param("id") int id, Context context) { Result<String> result = new Result<String>(); try { SystemAccountDO curAccountDO = this.getAccount(); if (curAccountDO == null) { print(new Result<String>("请登录系统")); return; } if (!curAccountDO.hasAuth()) { print(new Result<String>("您没有该功能权限")); return; } PartnerDepartmentDO partnerDepartmentDO = new PartnerDepartmentDO(); partnerDepartmentDO.setId(id); partnerDepartmentDO.setStatus(SystemConstant.DEPARTMENT_DELETE); boolean res = partnerDepartmentManager.update(partnerDepartmentDO); if (res) { result.setData("操作成功"); } else { result.setErrMsg("操作失败,请重新操作"); } } catch (Exception e) { logger.error("InvalidVehicle execute catch exception", e); result.setErrMsg("系统异常,请重新操作"); } print(result); } }
[ "taoxiangxiang610@163.com" ]
taoxiangxiang610@163.com
11f8390603d1ba239eec5ca5f7a6285364cf359a
2a541959ca43a6819046643c2a1a018ac187115c
/src/java/org/dom4j/io/SAXModifier.java
818fe42b468fe2825179b6f06d8f9f3ed2bc31b9
[ "Plexus" ]
permissive
jenkinsci/dom4j
0f156d7562fd06e52daf0e83f69323c56a61050d
d309ee334f29a01e3fe6cc59512629284de32d82
refs/heads/patched
2023-06-02T04:51:54.331307
2017-11-27T20:29:12
2017-11-27T20:29:12
501,730
3
10
NOASSERTION
2020-02-11T01:59:00
2010-02-04T02:19:17
Java
UTF-8
Java
false
false
15,348
java
/* * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. * * This software is open source. * See the bottom of this file for the licence. */ package org.dom4j.io; import java.io.File; import java.io.InputStream; import java.io.Reader; import java.net.URL; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.DocumentFactory; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; /** * The SAXModifier reads, modifies and writes XML documents using SAX. * * <p> * Registered {@link ElementModifier}objects can provide modifications to (part * of) the xml tree, while the document is still being processed. This makes it * possible to change large xml documents without having them in memory. * </p> * * <p> * The modified document is written when the {@link XMLWriter}is specified. * </p> * * @author Wonne Keysers (Realsoftware.be) * * @see org.dom4j.io.SAXReader * @see org.dom4j.io.XMLWriter */ public class SAXModifier { private XMLWriter xmlWriter; private XMLReader xmlReader; private boolean pruneElements; private SAXModifyReader modifyReader; private HashMap modifiers = new HashMap(); /** * Creates a new modifier. <br> * The XMLReader to parse the source will be created via the * org.xml.sax.driver system property or JAXP if the system property is not * set. */ public SAXModifier() { } /** * Creates a new modifier. <br> * The XMLReader to parse the source will be created via the * org.xml.sax.driver system property or JAXP if the system property is not * set. * * @param pruneElements * Set to true when the modified document must NOT be kept in * memory. */ public SAXModifier(boolean pruneElements) { this.pruneElements = pruneElements; } /** * Creates a new modifier that will the specified {@link * org.xml.sax.XMLReader} to parse the source. * * @param xmlReader * The XMLReader to use */ public SAXModifier(XMLReader xmlReader) { this.xmlReader = xmlReader; } /** * Creates a new modifier that will the specified {@link * org.xml.sax.XMLReader} to parse the source. * * @param xmlReader * The XMLReader to use * @param pruneElements * Set to true when the modified document must NOT be kept in * memory. */ public SAXModifier(XMLReader xmlReader, boolean pruneElements) { this.xmlReader = xmlReader; } /** * Reads a Document from the given {@link java.io.File}and writes it to the * specified {@link XMLWriter}using SAX. Registered {@linkElementModifier} * objects are invoked on the fly. * * @param source * is the <code>File</code> to read from. * * @return the newly created Document instance * * @throws DocumentException * DocumentException org.dom4j.DocumentException} if an error * occurs during parsing. */ public Document modify(File source) throws DocumentException { try { return installModifyReader().read(source); } catch (SAXModifyException ex) { Throwable cause = ex.getCause(); throw new DocumentException(cause.getMessage(), cause); } } /** * Reads a Document from the given {@link org.xml.sax.InputSource}and * writes it to the specified {@link XMLWriter}using SAX. Registered * {@link ElementModifier}objects are invoked on the fly. * * @param source * is the <code>org.xml.sax.InputSource</code> to read from. * * @return the newly created Document instance * * @throws DocumentException * DocumentException org.dom4j.DocumentException} if an error * occurs during parsing. */ public Document modify(InputSource source) throws DocumentException { try { return installModifyReader().read(source); } catch (SAXModifyException ex) { Throwable cause = ex.getCause(); throw new DocumentException(cause.getMessage(), cause); } } /** * Reads a Document from the given {@link java.io.InputStream}and writes it * to the specified {@link XMLWriter}using SAX. Registered {@link * ElementModifier} objects are invoked on the fly. * * @param source * is the <code>java.io.InputStream</code> to read from. * * @return the newly created Document instance * * @throws DocumentException * DocumentException org.dom4j.DocumentException} if an error * occurs during parsing. */ public Document modify(InputStream source) throws DocumentException { try { return installModifyReader().read(source); } catch (SAXModifyException ex) { Throwable cause = ex.getCause(); throw new DocumentException(cause.getMessage(), cause); } } /** * Reads a Document from the given {@link java.io.InputStream}and writes it * to the specified {@link XMLWriter}using SAX. Registered {@link * ElementModifier} objects are invoked on the fly. * * @param source * is the <code>java.io.InputStream</code> to read from. * @param systemId * DOCUMENT ME! * * @return the newly created Document instance * * @throws DocumentException * DocumentException org.dom4j.DocumentException} if an error * occurs during parsing. */ public Document modify(InputStream source, String systemId) throws DocumentException { try { return installModifyReader().read(source); } catch (SAXModifyException ex) { Throwable cause = ex.getCause(); throw new DocumentException(cause.getMessage(), cause); } } /** * Reads a Document from the given {@link java.io.Reader}and writes it to * the specified {@link XMLWriter}using SAX. Registered {@link * ElementModifier} objects are invoked on the fly. * * @param source * is the <code>java.io.Reader</code> to read from. * * @return the newly created Document instance * * @throws DocumentException * DocumentException org.dom4j.DocumentException} if an error * occurs during parsing. */ public Document modify(Reader source) throws DocumentException { try { return installModifyReader().read(source); } catch (SAXModifyException ex) { Throwable cause = ex.getCause(); throw new DocumentException(cause.getMessage(), cause); } } /** * Reads a Document from the given {@link java.io.Reader}and writes it to * the specified {@link XMLWriter}using SAX. Registered {@link * ElementModifier} objects are invoked on the fly. * * @param source * is the <code>java.io.Reader</code> to read from. * @param systemId * DOCUMENT ME! * * @return the newly created Document instance * * @throws DocumentException * DocumentException org.dom4j.DocumentException} if an error * occurs during parsing. */ public Document modify(Reader source, String systemId) throws DocumentException { try { return installModifyReader().read(source); } catch (SAXModifyException ex) { Throwable cause = ex.getCause(); throw new DocumentException(cause.getMessage(), cause); } } /** * Reads a Document from the given {@link java.net.URL}and writes it to the * specified {@link XMLWriter}using SAX. Registered {@linkElementModifier} * objects are invoked on the fly. * * @param source * is the <code>java.net.URL</code> to read from. * * @return the newly created Document instance * * @throws DocumentException * DocumentException org.dom4j.DocumentException} if an error * occurs during parsing. */ public Document modify(URL source) throws DocumentException { try { return installModifyReader().read(source); } catch (SAXModifyException ex) { Throwable cause = ex.getCause(); throw new DocumentException(cause.getMessage(), cause); } } /** * Reads a Document from the given URL or filename and writes it to the * specified {@link XMLWriter}using SAX. Registered {@linkElementModifier} * objects are invoked on the fly. * * @param source * is the URL or filename to read from. * * @return the newly created Document instance * * @throws DocumentException * DocumentException org.dom4j.DocumentException} if an error * occurs during parsing. */ public Document modify(String source) throws DocumentException { try { return installModifyReader().read(source); } catch (SAXModifyException ex) { Throwable cause = ex.getCause(); throw new DocumentException(cause.getMessage(), cause); } } /** * Adds the {@link ElementModifier}to be called when the specified element * path is encounted while parsing the source. * * @param path * The element path to be handled * @param modifier * The {@link ElementModifier}to be called by the event based * processor. */ public void addModifier(String path, ElementModifier modifier) { this.modifiers.put(path, modifier); } /** * Removes all registered {@link ElementModifier}instances from the event * based processor. */ public void resetModifiers() { this.modifiers.clear(); getSAXModifyReader().resetHandlers(); } /** * Removes the {@link ElementModifier}from the event based processor, for * the specified element path. * * @param path * The path to remove the {@link ElementModifier}for. */ public void removeModifier(String path) { this.modifiers.remove(path); getSAXModifyReader().removeHandler(path); } /** * Get the {@link org.dom4j.DocumentFactory}used to create the DOM4J * document structure * * @return <code>DocumentFactory</code> that will be used */ public DocumentFactory getDocumentFactory() { return getSAXModifyReader().getDocumentFactory(); } /** * Sets the {@link org.dom4j.DocumentFactory}used to create the DOM4J * document tree. * * @param factory * <code>DocumentFactory</code> to be used */ public void setDocumentFactory(DocumentFactory factory) { getSAXModifyReader().setDocumentFactory(factory); } /** * Returns the current {@link XMLWriter}. * * @return XMLWriter */ public XMLWriter getXMLWriter() { return this.xmlWriter; } /** * Sets the {@link XMLWriter}used to write the modified document. * * @param writer * The writer to use. */ public void setXMLWriter(XMLWriter writer) { this.xmlWriter = writer; } /** * Returns true when xml elements are not kept in memory while parsing. The * {@link org.dom4j.Document}returned by the modify methods will be null. * * @return Returns the pruneElements. */ public boolean isPruneElements() { return pruneElements; } private SAXReader installModifyReader() throws DocumentException { try { SAXModifyReader reader = getSAXModifyReader(); if (isPruneElements()) { modifyReader.setDispatchHandler(new PruningDispatchHandler()); } reader.resetHandlers(); Iterator modifierIt = this.modifiers.entrySet().iterator(); while (modifierIt.hasNext()) { Map.Entry entry = (Map.Entry) modifierIt.next(); SAXModifyElementHandler handler = new SAXModifyElementHandler( (ElementModifier) entry.getValue()); reader.addHandler((String) entry.getKey(), handler); } reader.setXMLWriter(getXMLWriter()); reader.setXMLReader(getXMLReader()); return reader; } catch (SAXException ex) { throw new DocumentException(ex.getMessage(), ex); } } private XMLReader getXMLReader() throws SAXException { if (this.xmlReader == null) { xmlReader = SAXHelper.createXMLReader(false); } return this.xmlReader; } private SAXModifyReader getSAXModifyReader() { if (modifyReader == null) { modifyReader = new SAXModifyReader(); } return modifyReader; } } /* * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided that the * following conditions are met: * * 1. Redistributions of source code must retain copyright statements and * notices. Redistributions must also contain a copy of this document. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name "DOM4J" must not be used to endorse or promote products derived * from this Software without prior written permission of MetaStuff, Ltd. For * written permission, please contact dom4j-info@metastuff.com. * * 4. Products derived from this Software may not be called "DOM4J" nor may * "DOM4J" appear in their names without prior written permission of MetaStuff, * Ltd. DOM4J is a registered trademark of MetaStuff, Ltd. * * 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org * * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. */
[ "kk@kohsuke.org" ]
kk@kohsuke.org
4a6408674e1ce7533e1767547ea203b340423763
8299350cf0b5167ba0246ffa745f89c433510d4c
/src/main/java/cybersoft/project/Elearning/role/service/RoleGroupServiceimpl.java
4e2c687096d7bb923eeacffb3c886f79694d2798
[]
no_license
lenguyenkhang1904/Elearning-main
7e96c39f0f5302a1264cdfad1a5450cc4b0b5230
364fedfcf0bbeefa982d5bbc7db67c2ee6579ef7
refs/heads/main
2023-07-11T07:15:20.723346
2021-08-29T14:06:51
2021-08-29T14:06:51
401,053,250
0
0
null
null
null
null
UTF-8
Java
false
false
1,169
java
package cybersoft.project.Elearning.role.service; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import cybersoft.project.Elearning.role.dto.RoleDto; import cybersoft.project.Elearning.role.model.Role; import cybersoft.project.Elearning.role.model.RoleGroup; import cybersoft.project.Elearning.role.repository.RoleGroupRepository; import cybersoft.project.Elearning.role.repository.RoleRepository; @Service public class RoleGroupServiceimpl implements RoleGroupService { @Autowired private RoleGroupRepository repository; @Autowired private RoleRepository repositoryRole; @Override public RoleGroup addRole(@Valid Role role, Long groupId) { // TODO Auto-generated method stub RoleGroup roleGroup=repository.getOne(groupId); roleGroup.addRole(role); return repository.save(roleGroup); } @Override public RoleGroup updateRoleInfo(@Valid RoleDto dto, Long roleid) { // TODO Auto-generated method stub return null; } @Override public void deleteRole(Long roleid) { // TODO Auto-generated method stub } }
[ "79681550+lenguyenkhang1904@users.noreply.github.com" ]
79681550+lenguyenkhang1904@users.noreply.github.com
e2a0494adadda6801abc1e1fefe57f708978e5e6
8b36b765d5e05151edb67fd4fdc060ffd19f777d
/src/test/java/com/nebhale/newrelicservicebroker/catalog/CatalogControllerTest.java
8a69adda039593220ee20df54387a64b6a00c2e2
[ "Apache-2.0" ]
permissive
amulyas/new-relic-service-broker
48ec3ee428823fb8ca4579817e4b432bf01dbddb
8302ecf2448aa9e9b400030348d32d7a04fccf0c
refs/heads/master
2021-01-18T03:26:14.836688
2015-10-23T18:54:03
2015-10-23T18:54:03
44,832,050
0
0
null
2015-10-23T18:49:25
2015-10-23T18:49:24
null
UTF-8
Java
false
false
1,317
java
/* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.nebhale.newrelicservicebroker.catalog; import com.nebhale.newrelicservicebroker.AbstractControllerTest; import org.junit.Test; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; public final class CatalogControllerTest extends AbstractControllerTest { @Test public void catalog() throws Exception { this.mockMvc.perform(get("/v2/catalog")) .andExpect(status().isOk()) .andExpect(jsonPath("$.services").exists()); } }
[ "nebhale@nebhale.com" ]
nebhale@nebhale.com
75b7efc2dba979f89d134044886602c35fad4a2e
8a787e93fea9c334122441717f15bd2f772e3843
/odfdom/src/main/java/org/odftoolkit/odfdom/dom/element/text/TextAlphabeticalIndexMarkStartElement.java
5eabfaa26d78ae61f97a2b64e9a7b0ed53109e3a
[ "Apache-2.0", "BSD-3-Clause", "MIT", "W3C", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-unknown-license-reference" ]
permissive
apache/odftoolkit
296ea9335bfdd78aa94829c915a6e9c24e5b5166
99975f3be40fc1c428167a3db7a9a63038acfa9f
refs/heads/trunk
2023-07-02T16:30:24.946067
2018-10-02T11:11:40
2018-10-02T11:11:40
5,212,656
39
45
Apache-2.0
2018-04-11T11:57:17
2012-07-28T07:00:12
Java
UTF-8
Java
false
false
9,757
java
/************************************************************************ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER * * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved. * * Use is subject to license terms. * * 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. You can also * obtain a copy of the License at http://odftoolkit.org/docs/license.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. * ************************************************************************/ /* * This file is automatically generated. * Don't edit manually. */ package org.odftoolkit.odfdom.dom.element.text; import org.odftoolkit.odfdom.pkg.OdfElement; import org.odftoolkit.odfdom.pkg.ElementVisitor; import org.odftoolkit.odfdom.pkg.OdfFileDom; import org.odftoolkit.odfdom.pkg.OdfName; import org.odftoolkit.odfdom.dom.OdfDocumentNamespace; import org.odftoolkit.odfdom.dom.DefaultElementVisitor; import org.odftoolkit.odfdom.dom.attribute.text.TextIdAttribute; import org.odftoolkit.odfdom.dom.attribute.text.TextKey1Attribute; import org.odftoolkit.odfdom.dom.attribute.text.TextKey1PhoneticAttribute; import org.odftoolkit.odfdom.dom.attribute.text.TextKey2Attribute; import org.odftoolkit.odfdom.dom.attribute.text.TextKey2PhoneticAttribute; import org.odftoolkit.odfdom.dom.attribute.text.TextMainEntryAttribute; import org.odftoolkit.odfdom.dom.attribute.text.TextStringValuePhoneticAttribute; /** * DOM implementation of OpenDocument element {@odf.element text:alphabetical-index-mark-start}. * */ public class TextAlphabeticalIndexMarkStartElement extends OdfElement { public static final OdfName ELEMENT_NAME = OdfName.newName(OdfDocumentNamespace.TEXT, "alphabetical-index-mark-start"); /** * Create the instance of <code>TextAlphabeticalIndexMarkStartElement</code> * * @param ownerDoc The type is <code>OdfFileDom</code> */ public TextAlphabeticalIndexMarkStartElement(OdfFileDom ownerDoc) { super(ownerDoc, ELEMENT_NAME); } /** * Get the element name * * @return return <code>OdfName</code> the name of element {@odf.element text:alphabetical-index-mark-start}. */ public OdfName getOdfName() { return ELEMENT_NAME; } /** * Receives the value of the ODFDOM attribute representation <code>TextIdAttribute</code> , See {@odf.attribute text:id} * * Attribute is mandatory. * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getTextIdAttribute() { TextIdAttribute attr = (TextIdAttribute) getOdfAttribute(OdfDocumentNamespace.TEXT, "id"); if (attr != null) { return String.valueOf(attr.getValue()); } return null; } /** * Sets the value of ODFDOM attribute representation <code>TextIdAttribute</code> , See {@odf.attribute text:id} * * @param textIdValue The type is <code>String</code> */ public void setTextIdAttribute(String textIdValue) { TextIdAttribute attr = new TextIdAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setValue(textIdValue); } /** * Receives the value of the ODFDOM attribute representation <code>TextKey1Attribute</code> , See {@odf.attribute text:key1} * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getTextKey1Attribute() { TextKey1Attribute attr = (TextKey1Attribute) getOdfAttribute(OdfDocumentNamespace.TEXT, "key1"); if (attr != null) { return String.valueOf(attr.getValue()); } return null; } /** * Sets the value of ODFDOM attribute representation <code>TextKey1Attribute</code> , See {@odf.attribute text:key1} * * @param textKey1Value The type is <code>String</code> */ public void setTextKey1Attribute(String textKey1Value) { TextKey1Attribute attr = new TextKey1Attribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setValue(textKey1Value); } /** * Receives the value of the ODFDOM attribute representation <code>TextKey1PhoneticAttribute</code> , See {@odf.attribute text:key1-phonetic} * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getTextKey1PhoneticAttribute() { TextKey1PhoneticAttribute attr = (TextKey1PhoneticAttribute) getOdfAttribute(OdfDocumentNamespace.TEXT, "key1-phonetic"); if (attr != null) { return String.valueOf(attr.getValue()); } return null; } /** * Sets the value of ODFDOM attribute representation <code>TextKey1PhoneticAttribute</code> , See {@odf.attribute text:key1-phonetic} * * @param textKey1PhoneticValue The type is <code>String</code> */ public void setTextKey1PhoneticAttribute(String textKey1PhoneticValue) { TextKey1PhoneticAttribute attr = new TextKey1PhoneticAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setValue(textKey1PhoneticValue); } /** * Receives the value of the ODFDOM attribute representation <code>TextKey2Attribute</code> , See {@odf.attribute text:key2} * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getTextKey2Attribute() { TextKey2Attribute attr = (TextKey2Attribute) getOdfAttribute(OdfDocumentNamespace.TEXT, "key2"); if (attr != null) { return String.valueOf(attr.getValue()); } return null; } /** * Sets the value of ODFDOM attribute representation <code>TextKey2Attribute</code> , See {@odf.attribute text:key2} * * @param textKey2Value The type is <code>String</code> */ public void setTextKey2Attribute(String textKey2Value) { TextKey2Attribute attr = new TextKey2Attribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setValue(textKey2Value); } /** * Receives the value of the ODFDOM attribute representation <code>TextKey2PhoneticAttribute</code> , See {@odf.attribute text:key2-phonetic} * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getTextKey2PhoneticAttribute() { TextKey2PhoneticAttribute attr = (TextKey2PhoneticAttribute) getOdfAttribute(OdfDocumentNamespace.TEXT, "key2-phonetic"); if (attr != null) { return String.valueOf(attr.getValue()); } return null; } /** * Sets the value of ODFDOM attribute representation <code>TextKey2PhoneticAttribute</code> , See {@odf.attribute text:key2-phonetic} * * @param textKey2PhoneticValue The type is <code>String</code> */ public void setTextKey2PhoneticAttribute(String textKey2PhoneticValue) { TextKey2PhoneticAttribute attr = new TextKey2PhoneticAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setValue(textKey2PhoneticValue); } /** * Receives the value of the ODFDOM attribute representation <code>TextMainEntryAttribute</code> , See {@odf.attribute text:main-entry} * * @return - the <code>Boolean</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public Boolean getTextMainEntryAttribute() { TextMainEntryAttribute attr = (TextMainEntryAttribute) getOdfAttribute(OdfDocumentNamespace.TEXT, "main-entry"); if (attr != null) { return Boolean.valueOf(attr.booleanValue()); } return Boolean.valueOf(TextMainEntryAttribute.DEFAULT_VALUE); } /** * Sets the value of ODFDOM attribute representation <code>TextMainEntryAttribute</code> , See {@odf.attribute text:main-entry} * * @param textMainEntryValue The type is <code>Boolean</code> */ public void setTextMainEntryAttribute(Boolean textMainEntryValue) { TextMainEntryAttribute attr = new TextMainEntryAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setBooleanValue(textMainEntryValue.booleanValue()); } /** * Receives the value of the ODFDOM attribute representation <code>TextStringValuePhoneticAttribute</code> , See {@odf.attribute text:string-value-phonetic} * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getTextStringValuePhoneticAttribute() { TextStringValuePhoneticAttribute attr = (TextStringValuePhoneticAttribute) getOdfAttribute(OdfDocumentNamespace.TEXT, "string-value-phonetic"); if (attr != null) { return String.valueOf(attr.getValue()); } return null; } /** * Sets the value of ODFDOM attribute representation <code>TextStringValuePhoneticAttribute</code> , See {@odf.attribute text:string-value-phonetic} * * @param textStringValuePhoneticValue The type is <code>String</code> */ public void setTextStringValuePhoneticAttribute(String textStringValuePhoneticValue) { TextStringValuePhoneticAttribute attr = new TextStringValuePhoneticAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setValue(textStringValuePhoneticValue); } @Override public void accept(ElementVisitor visitor) { if (visitor instanceof DefaultElementVisitor) { DefaultElementVisitor defaultVisitor = (DefaultElementVisitor) visitor; defaultVisitor.visit(this); } else { visitor.visit(this); } } }
[ "dev-null@apache.org" ]
dev-null@apache.org
85fdac27fbad00d2b1839372ffc5009a889f009d
d27be23dc0fae7fbc7109b1f820f1d5bac77f6d1
/connecter/src/main/java/com/jyl/connecter/server/MyMessageProtocol.java
30523819834d5230512ec3c907c89d3331cab17f
[]
no_license
jyl2390446138/imLearn
1a9af204f9e62516dcb6a8866528db57cba2ef9e
8a03178a8fdb4b15215f28e1886eacb73bd489e1
refs/heads/master
2023-03-28T08:27:15.584183
2021-03-18T07:49:16
2021-03-18T07:49:16
348,983,349
0
0
null
null
null
null
UTF-8
Java
false
false
485
java
package com.jyl.connecter.server; /** * 自定义协议包 */ public class MyMessageProtocol { //定义一次发送包体长度 private int len; //一次发送包体内容 private byte[] content; public int getLen() { return len; } public void setLen(int len) { this.len = len; } public byte[] getContent() { return content; } public void setContent(byte[] content) { this.content = content; } }
[ "jjyyll595@163.com" ]
jjyyll595@163.com
ab0d4fb2cb864ed1abcd9558b70bc10f551fb7bf
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14263-38-29-PESA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/internal/template/DefaultTemplateManager_ESTest_scaffolding.java
628debb50e4ad00e89079667eea6217a2f26d220
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
458
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Apr 04 05:49:03 UTC 2020 */ package com.xpn.xwiki.internal.template; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class DefaultTemplateManager_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
21404df6d281f073a3fe54d2e94d74be2cf8412d
726b135a26ad4afb1def8a0459b0756685b7a263
/Buoi4_P1_Bai2/Main.java
df89f8f718b98829412d11969ef7cf30d443e5d0
[]
no_license
lehongnhung2k2/NITC-JavaHomework
a4f598ceb480f5613cade6fb7d35c75d8194648c
5e701a8e4737742d01d04158cacd3a74ec18c57c
refs/heads/main
2023-08-28T21:18:05.841960
2021-10-19T17:57:59
2021-10-19T17:57:59
416,146,392
0
0
null
null
null
null
UTF-8
Java
false
false
2,768
java
package QuanLyTruongHoc; import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<MonHoc> list_Mon = new ArrayList<MonHoc>(); list_Mon.add(new MonHoc("Toán")); list_Mon.add(new MonHoc("Lý")); list_Mon.add(new MonHoc("Hóa")); ArrayList<GiaoVien> list_GV = new ArrayList<GiaoVien>(); list_GV.add(new GiaoVien("Nguyễn Văn A", 30, "02990043", list_Mon.get(0))); list_GV.add(new GiaoVien("Nguyễn Văn B", 43, "02984743", list_Mon.get(2))); list_GV.add(new GiaoVien("Nguyễn Văn C", 25, "04628384", list_Mon.get(2))); list_GV.add(new GiaoVien("Nguyễn Văn D", 39, "03747855", list_Mon.get(1))); list_GV.add(new GiaoVien("Nguyễn Văn E", 43, "08647585", list_Mon.get(0))); ArrayList<BaoVe> list_BV = new ArrayList<BaoVe>(); list_BV.add(new BaoVe("Trần Thị A", 50, "02374849")); list_BV.add(new BaoVe("Trần Thị B", 54, "08849497")); list_BV.add(new BaoVe("Trần Thị C", 43, "08833839")); list_BV.add(new BaoVe("Trần Thị D", 65, "07364747")); list_BV.add(new BaoVe("Trần Thị E", 30, "07474889")); ArrayList<NV_VeSinh> list_VS = new ArrayList<NV_VeSinh>(); list_VS.add(new NV_VeSinh("Phạm Văn A",38 , "0374747")); list_VS.add(new NV_VeSinh("Phạm Văn B",38 , "0383745")); list_VS.add(new NV_VeSinh("Phạm Văn C",38 , "0273764")); list_VS.add(new NV_VeSinh("Phạm Văn D",38 , "0548889")); list_VS.add(new NV_VeSinh("Phạm Văn E",38 , "0478856")); ArrayList<HocSinh> list_HS = new ArrayList<HocSinh>(); list_HS.add(new HocSinh("Lê Hồng A", 19, "0737748")); list_HS.add(new HocSinh("Lê Hồng B", 19, "0484889")); list_HS.add(new HocSinh("Lê Hồng C", 19, "0937475")); list_HS.add(new HocSinh("Lê Hồng D", 19, "0948485")); list_HS.add(new HocSinh("Lê Hồng E", 19, "0774885")); System.out.println("Danh sách giáo viên:"); for (int i=0; i<5; i++) { System.out.printf("%s, %d, %s, %s\n", list_GV.get(i).getname(), list_GV.get(i).getage(), list_GV.get(i).getCCCD(), list_GV.get(i).getmon().mon); } System.out.println("\n"); System.out.println("Danh sách NV bảo vệ: "); for (int i=0; i<5; i++) { System.out.printf("%s, %d, %s\n", list_GV.get(i).getname(), list_GV.get(i).getage(), list_GV.get(i).getCCCD()); } System.out.println("\n"); System.out.println("Danh sách NV vệ sinh: "); for (int i=0; i<5; i++) { System.out.printf("%s, %d, %s\n", list_GV.get(i).getname(), list_GV.get(i).getage(), list_GV.get(i).getCCCD()); } System.out.println("\n"); System.out.println("Danh sách học sinh: "); for (int i=0; i<5; i++) { System.out.printf("%s, %d, %s\n", list_GV.get(i).getname(), list_GV.get(i).getage(), list_GV.get(i).getCCCD()); } } }
[ "87715405+lehongnhung2k2@users.noreply.github.com" ]
87715405+lehongnhung2k2@users.noreply.github.com
b5502ac097f6937122b068a3cc7999f7a565c6c2
5eac9ba7487a4fb66fd23f0322799c97848b4435
/PAS/.svn/pristine/2d/2d575a46bc2bffceddd18ea1db54a9f19f654a25.svn-base
3ea4fed6a7b37392a6a1ac14819009bf7043ce8a
[]
no_license
mugi22/PAS
dbf637c18543906971dce1dc587e1fa51376a2f7
d10979e295826f648822fa577d778183beb218c7
refs/heads/master
2021-01-10T22:28:54.760297
2015-07-15T07:24:24
2015-07-15T07:24:24
35,809,023
0
0
null
null
null
null
UTF-8
Java
false
false
1,239
package co.id.pegadaian.pasg2.pojo; // Generated Mar 2, 2015 11:08:12 AM by Hibernate Tools 4.0.0 import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * TblProvinsi generated by hbm2java */ @Entity @Table(name = "TBL_PROVINSI", schema = "PASG2") public class TblProvinsi extends AuditTrail implements java.io.Serializable { private String kodeProvinsi; private String namaProvinsi; public TblProvinsi() { } public TblProvinsi(String kodeProvinsi, String namaProvinsi) { this.kodeProvinsi = kodeProvinsi; this.namaProvinsi = namaProvinsi; } @Id @Column(name = "KODE_PROVINSI", unique = true, nullable = false, length = 2) public String getKodeProvinsi() { return this.kodeProvinsi; } public void setKodeProvinsi(String kodeProvinsi) { this.kodeProvinsi = kodeProvinsi; } @Column(name = "NAMA_PROVINSI", nullable = false, length = 100) public String getNamaProvinsi() { return this.namaProvinsi; } public void setNamaProvinsi(String namaProvinsi) { this.namaProvinsi = namaProvinsi; } }
[ "mugihnf@gmail.com" ]
mugihnf@gmail.com
7baadb390a76cd540cbb946fd582ea2cc72639c0
26071175304a7636cc0473c3a8499f04e2dd864b
/person-parent/general-person-entities/src/main/java/com/kalix/general/person/entities/TeacherBean.java
257572737fe3bdf6f261a2f68b54ae03c51e06a7
[]
no_license
chenyanxu/general-parent
9a6c9badd6b0d6b89aae967bb8954d18787e2441
0dd4602def5e877f4a66e2daef33c14586ba42f3
refs/heads/master
2020-03-22T07:15:04.582780
2018-08-29T00:53:51
2018-08-29T00:53:51
139,688,751
0
0
null
null
null
null
UTF-8
Java
false
false
8,297
java
package com.kalix.general.person.entities; import com.fasterxml.jackson.annotation.JsonFormat; import com.kalix.framework.core.api.persistence.PersistentEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.Transient; import java.util.Date; /** * Created by Administrator on 2017/3/3. */ @Entity @Table(name = "general_person_teacher") @ApiModel("教师信息<br>TeacherBean") public class TeacherBean extends PersistentEntity { @ApiModelProperty(value = "工号", example = "0") //@Column(unique = true) private String code; @ApiModelProperty(value = "姓名", example = "陈某") private String name; private Integer sex; //性别,字典[性别] @ApiModelProperty(value = "出生日期", example = "2010-02-01") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date birthday; @ApiModelProperty(value = "学历", example = "大学本科") private String education; @ApiModelProperty(value = "学位", example = "学士学位") private String degree; @ApiModelProperty(value = "职称", example = "高级教师") private Integer positionalTitles; //职称,字典[职称] @ApiModelProperty(value = "入校年份/启聘年份", example = "2017") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy", timezone = "GMT+8") private Date entranceYear; private String specialIdentity; //特殊身份 @ApiModelProperty(value = "民族", example = "汉族") private String nation; @ApiModelProperty(value = "籍贯", example = "吉林省") private String placeOfOrigin; @ApiModelProperty(value = "现住址", example = "吉林省长春市") private String address; @ApiModelProperty(value = "身份证号", example = "220***************") private String identificationCard; @ApiModelProperty(value = "岗位", example = "0") private Integer position; //岗位,字典[岗位名称] @ApiModelProperty(value = "是否在岗/是否聘任:(0-否 1-是)", allowableValues = "0,1", example = "1") private Integer beOnDuty = 1; @ApiModelProperty(value = "联系电话", example = "043288888888") private String phone; @ApiModelProperty(value = "邮箱", example = "text@kalix.com") private String email; @ApiModelProperty(value = "手机", example = "18866667777") private String mobile; @ApiModelProperty(value = "个人简历", example = "0") private String resume; @ApiModelProperty(value = "个人说明", example = "0") private String introduction; @ApiModelProperty(value = "学术研究", example = "0") private String learning; @ApiModelProperty(value = "教学情况", position = 10, example = "0") private String teaching; @ApiModelProperty(value = "擅长课程", position = 11, example = "0") private String coursesSkills; @ApiModelProperty(value = "预备知识", position = 12, example = "0") private String preliminary; private String remark; //备注 @ApiModelProperty(value = "照片", example = "http://head.png") private String icon; @ApiModelProperty(value = "所在单位id", position = 5, example = "0") private Long orgId; @Transient private String orgName; //所在单位名称 private Integer beOnExternal; //是否外聘(教师类别),0-在编,1-外聘 private String originUnit; //所属单位 public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getSex() { return sex; } public void setSex(Integer sex) { this.sex = sex; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } public String getEducation() { return education; } public void setEducation(String education) { this.education = education; } public String getDegree() { return degree; } public void setDegree(String degree) { this.degree = degree; } public Integer getPositionalTitles() { return positionalTitles; } public void setPositionalTitles(Integer positionalTitles) { this.positionalTitles = positionalTitles; } public Date getEntranceYear() { return entranceYear; } public void setEntranceYear(Date entranceYear) { this.entranceYear = entranceYear; } public String getSpecialIdentity() { return specialIdentity; } public void setSpecialIdentity(String specialIdentity) { this.specialIdentity = specialIdentity; } public String getNation() { return nation; } public void setNation(String nation) { this.nation = nation; } public String getPlaceOfOrigin() { return placeOfOrigin; } public void setPlaceOfOrigin(String placeOfOrigin) { this.placeOfOrigin = placeOfOrigin; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getIdentificationCard() { return identificationCard; } public void setIdentificationCard(String identificationCard) { this.identificationCard = identificationCard; } public Integer getPosition() { return position; } public void setPosition(Integer position) { this.position = position; } public Integer getBeOnDuty() { return beOnDuty; } public void setBeOnDuty(Integer beOnDuty) { this.beOnDuty = beOnDuty; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getResume() { return resume; } public void setResume(String resume) { this.resume = resume; } public String getIntroduction() { return introduction; } public void setIntroduction(String introduction) { this.introduction = introduction; } public String getLearning() { return learning; } public void setLearning(String learning) { this.learning = learning; } public String getTeaching() { return teaching; } public void setTeaching(String teaching) { this.teaching = teaching; } public String getCoursesSkills() { return coursesSkills; } public void setCoursesSkills(String coursesSkills) { this.coursesSkills = coursesSkills; } public String getPreliminary() { return preliminary; } public void setPreliminary(String preliminary) { this.preliminary = preliminary; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public Long getOrgId() { return orgId; } public void setOrgId(Long orgId) { this.orgId = orgId; } public String getOrgName() { return orgName; } public void setOrgName(String orgName) { this.orgName = orgName; } public Integer getBeOnExternal() { return beOnExternal; } public void setBeOnExternal(Integer beOnExternal) { this.beOnExternal = beOnExternal; } public String getOriginUnit() { return originUnit; } public void setOriginUnit(String originUnit) { this.originUnit = originUnit; } }
[ "150091225@qq.com" ]
150091225@qq.com
493bf2e2d80f1a7059f200a06bcbc720e411cf54
251536bd3c55b438538c256a1defeda78f7238e0
/opengl_tutorial/src/main/java/com/glumes/openglbasicshape/egl/EglActivity.java
615cb7f72c2cbf89bc657a20f32ce907245ff8bb
[]
no_license
glumes/AndroidOpenGLTutorial
c166671ed97f698331d97cb292e1cc16739530c0
23d87a9d52e3237c3add60d4dbb67d7ee3d553fa
refs/heads/master
2022-05-04T04:16:12.095247
2022-04-22T14:03:40
2022-04-22T14:03:40
97,850,730
273
62
null
2018-07-11T16:05:14
2017-07-20T15:23:31
Java
UTF-8
Java
false
false
1,206
java
package com.glumes.openglbasicshape.egl; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; import com.glumes.openglbasicshape.R; public class EglActivity extends AppCompatActivity { private SurfaceView mSurfaceView; private EglDemo mEglDemo; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_egl); mSurfaceView = findViewById(R.id.eglview); mEglDemo = new EglDemo(); mSurfaceView.getHolder().addCallback(new SurfaceHolder.Callback() { @Override public void surfaceCreated(SurfaceHolder holder) { mEglDemo.initEgl(); } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { mEglDemo.render(mSurfaceView.getHolder().getSurface(), width, height, EglActivity.this); } @Override public void surfaceDestroyed(SurfaceHolder holder) { mEglDemo.release(); } }); } }
[ "zhaoying9402@gmail.com" ]
zhaoying9402@gmail.com
fc927b22c74ecea5dc39f73f5b9f2ef9dc36c307
1043c01b7637098d046fbb9dba79b15eefbad509
/entity-view/api/src/main/java/com/blazebit/persistence/view/FlushOperationBuilder.java
41632df28be955212ae26b54883eefcd1eef42e9
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ares3/blaze-persistence
45c06a3ec25c98236a109ab55a3205fc766734ed
2258e9d9c44bb993d41c5295eccbc894f420f263
refs/heads/master
2020-10-01T16:13:01.380347
2019-12-06T01:24:34
2019-12-09T09:29:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
47,480
java
/* * Copyright 2014 - 2019 Blazebit. * * 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.blazebit.persistence.view; import java.util.Set; /** * A builder for defining flush related configuration. * * @author Christian Beikov * @since 1.4.0 */ public interface FlushOperationBuilder { /** * Invoked the flush operation. */ public void flush(); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPrePersist(PrePersistListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPrePersist(PrePersistEntityListener<?, ?> listener); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostPersist(PostPersistListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostPersist(PostPersistEntityListener<?, ?> listener); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPreUpdate(PreUpdateListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostUpdate(PostUpdateListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPreRemove(PreRemoveListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostRemove(PostRemoveListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostCommit(PostCommitListener<?> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostCommitPersist(PostCommitListener<?> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostCommitUpdate(PostCommitListener<?> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostCommitRemove(PostCommitListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostCommit(Set<ViewTransition> viewTransitions, PostCommitListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostRollback(PostRollbackListener<?> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostRollbackPersist(PostRollbackListener<?> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostRollbackUpdate(PostRollbackListener<?> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostRollbackRemove(PostRollbackListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public FlushOperationBuilder onPostRollback(Set<ViewTransition> viewTransitions, PostRollbackListener<?> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPrePersist(Class<T> entityViewClass, PrePersistListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPrePersist(Class<T> entityViewClass, PrePersistEntityListener<T, ?> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostPersist(Class<T> entityViewClass, PostPersistListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostPersist(Class<T> entityViewClass, PostPersistEntityListener<T, ?> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPreUpdate(Class<T> entityViewClass, PreUpdateListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostUpdate(Class<T> entityViewClass, PostUpdateListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPreRemove(Class<T> entityViewClass, PreRemoveListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRemove(Class<T> entityViewClass, PostRemoveListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param entityViewClass The entity view type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, Set<ViewTransition> viewTransitions, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommitPersist(Class<T> entityViewClass, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommitUpdate(Class<T> entityViewClass, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommitRemove(Class<T> entityViewClass, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param entityViewClass The entity view type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, Set<ViewTransition> viewTransitions, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollbackPersist(Class<T> entityViewClass, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollbackUpdate(Class<T> entityViewClass, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollbackRemove(Class<T> entityViewClass, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPrePersist(Class<T> entityViewClass, Class<E> entityClass, PrePersistListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPrePersist(Class<T> entityViewClass, Class<E> entityClass, PrePersistEntityListener<T, E> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostPersist(Class<T> entityViewClass, Class<E> entityClass, PostPersistListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostPersist(Class<T> entityViewClass, Class<E> entityClass, PostPersistEntityListener<T, E> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPreUpdate(Class<T> entityViewClass, Class<E> entityClass, PreUpdateListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostUpdate(Class<T> entityViewClass, Class<E> entityClass, PostUpdateListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPreRemove(Class<T> entityViewClass, Class<E> entityClass, PreRemoveListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRemove(Class<T> entityViewClass, Class<E> entityClass, PostRemoveListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, Class<E> entityClass, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param <E> The entity type * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, Class<E> entityClass, Set<ViewTransition> viewTransitions, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommitPersist(Class<T> entityViewClass, Class<E> entityClass, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommitUpdate(Class<T> entityViewClass, Class<E> entityClass, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommitRemove(Class<T> entityViewClass, Class<E> entityClass, PostCommitListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, Class<E> entityClass, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param <E> The entity type * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, Class<E> entityClass, Set<ViewTransition> viewTransitions, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollbackPersist(Class<T> entityViewClass, Class<E> entityClass, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollbackUpdate(Class<T> entityViewClass, Class<E> entityClass, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollbackRemove(Class<T> entityViewClass, Class<E> entityClass, PostRollbackListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPrePersist(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPrePersist(Class<T> entityViewClass, ViewAndEntityListener<T, ?> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostPersist(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostPersist(Class<T> entityViewClass, ViewAndEntityListener<T, ?> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPreUpdate(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostUpdate(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPreRemove(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRemove(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, ViewTransitionListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param entityViewClass The entity view type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, Set<ViewTransition> viewTransitions, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param entityViewClass The entity view type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, Set<ViewTransition> viewTransitions, ViewTransitionListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommitPersist(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommitUpdate(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostCommitRemove(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, ViewTransitionListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param entityViewClass The entity view type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, Set<ViewTransition> viewTransitions, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param entityViewClass The entity view type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, Set<ViewTransition> viewTransitions, ViewTransitionListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollbackPersist(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollbackUpdate(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param entityViewClass The entity view type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @return This builder for method chaining */ public <T> FlushOperationBuilder onPostRollbackRemove(Class<T> entityViewClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPrePersist(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPrePersist(Class<T> entityViewClass, Class<E> entityClass, ViewAndEntityListener<T, E> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostPersist(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostPersist(Class<T> entityViewClass, Class<E> entityClass, ViewAndEntityListener<T, E> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPreUpdate(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostUpdate(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPreRemove(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRemove(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, Class<E> entityClass, ViewTransitionListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param <E> The entity type * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, Class<E> entityClass, Set<ViewTransition> viewTransitions, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param <E> The entity type * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommit(Class<T> entityViewClass, Class<E> entityClass, Set<ViewTransition> viewTransitions, ViewTransitionListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommitPersist(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommitUpdate(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostCommitRemove(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, Class<E> entityClass, ViewTransitionListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param <E> The entity type * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, Class<E> entityClass, Set<ViewTransition> viewTransitions, ViewListener<T> listener); /** * Registers the given listener to the current flush operation. * * @param <T> The entity view type * @param <E> The entity type * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param viewTransitions The view transitions * @param listener The listener to register * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollback(Class<T> entityViewClass, Class<E> entityClass, Set<ViewTransition> viewTransitions, ViewTransitionListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#PERSIST}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollbackPersist(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#UPDATE}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollbackUpdate(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); /** * Registers the given listener to the current flush operation for the {@link ViewTransition#REMOVE}. * * @param entityViewClass The entity view type for which to register the listener * @param entityClass The entity type for which to register the listener * @param listener The listener to register * @param <T> The entity view type * @param <E> The entity type * @return This builder for method chaining */ public <T, E> FlushOperationBuilder onPostRollbackRemove(Class<T> entityViewClass, Class<E> entityClass, ViewListener<T> listener); }
[ "christian.beikov@gmail.com" ]
christian.beikov@gmail.com