blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
9dbed840fd3bf2d09c23d0d2fe1cd22ac9a3699d
196f926cf578fea86c54e4b1ad12860e5236fb6a
/app/src/main/java/com/example/caseydenner/interactiveroom/MainActivity.java
39e6da90e7ff11b78fcdd38c729a933945538e67
[]
no_license
caseylouisee/InteractiveRoom
38b1a8d561abe205076e9d191b995426182f58b9
8b90ef7427517f7137898eba63d93c9b7e9c726d
refs/heads/master
2021-03-24T12:07:07.392278
2017-05-03T09:31:58
2017-05-03T09:31:58
86,072,646
0
0
null
null
null
null
UTF-8
Java
false
false
5,507
java
package com.example.caseydenner.interactiveroom; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.RadioButton; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.Set; /** * First class that is called within the application */ public class MainActivity extends AppCompatActivity { /** * Static address that is sent through an intent. */ public static String EXTRA_ADDRESS = "device_address"; /** * Button go used to proceed to the next activity */ private Button m_btnGo; /** * Radio buttons used to select the scene to project */ private RadioButton m_btnBeach, m_btnReminisce; /** * Text view to output information to the user */ private TextView m_textView; /** * Bluetooth adapter used to connect to bluetooth socket */ private BluetoothAdapter m_Bluetooth = null; /** * String that holds the device address */ private String m_address; /** * Method to get the bluetooth device's address * @return m_address the bluetooth device's address */ public String getAddress() { return m_address; } /** * Method to set the bluetooth device's address * @param string set as the bluetooth device's address */ public void setAddress(String string){ m_address = string; } @Override protected void onCreate(Bundle savedInstanceState) { final String METHOD = "onCreate"; super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.d(METHOD, "main activity created"); setUpBluetooth(); setView(); } /** * Checks that bluetooth is enabled on the Android device and if it isn't asks the user to enable it */ private void setUpBluetooth(){ final String METHOD = "setUpBluetooth"; //if the device has bluetooth m_Bluetooth = BluetoothAdapter.getDefaultAdapter(); if (m_Bluetooth == null) { //Show a message. that the device has no bluetooth adapter Log.d(METHOD, "Bluetooth Device Not Available"); Toast.makeText(getApplicationContext(), "Bluetooth Device Not Available", Toast.LENGTH_LONG).show(); //finish apk finish(); } else if (!m_Bluetooth.isEnabled()) { //Ask to the user turn the bluetooth on Log.d(METHOD, "Ask user to turn bluetooth on"); Intent turnBTon = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(turnBTon, 1); } } /** * Sets up the view initializing the xml components */ private void setView(){ final String METHOD = "setView"; m_btnBeach = (RadioButton) findViewById(R.id.radioBeach); m_btnReminisce = (RadioButton) findViewById(R.id.radioReminisce); m_textView = (TextView) findViewById(R.id.textViewOutput); m_textView.setVisibility(View.INVISIBLE); m_btnGo= (Button) findViewById(R.id.buttonGo); m_btnGo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (m_btnBeach.isChecked()) { connectToArduino(); Log.d(METHOD, "beach is checked"); Intent intent = new Intent(MainActivity.this, BeachActivity.class); intent.putExtra(EXTRA_ADDRESS, getAddress()); startActivity(intent); } else if (m_btnReminisce.isChecked()) { connectToArduino(); Log.d(METHOD, "reminiscence is checked"); Intent intent = new Intent(MainActivity.this, IntermediateReminiscence.class); intent.putExtra(EXTRA_ADDRESS, getAddress()); startActivity(intent); } else { Log.d(METHOD, "nothing is checked"); m_textView.setText("Please select a scene to project"); m_textView.setVisibility(View.VISIBLE); } } }); } /** * Connects to the Arduino via bluetooth using the device name to auto connect */ private void connectToArduino() { final String METHOD = "connectToArduino"; Set<BluetoothDevice> pairedDevices = m_Bluetooth.getBondedDevices(); ArrayList list = new ArrayList(); // automatically connects to arduino device set up if (pairedDevices.size() > 0) { for (BluetoothDevice bt : pairedDevices) { //Get the device's name and the address list.add(bt.getName() + "\n" + bt.getAddress()); if ((bt.getName().equals("Arduino")) || (bt.getName().equals("HC-06"))) { // Get the device MAC address, the last 17 chars in the View String info = (bt.getName() + "\n" + bt.getAddress()); setAddress(info.substring(info.length() - 17)); Log.d(METHOD,"attempting to connect to " + bt.getName()); } } } } }
[ "caseylouisee@me.com" ]
caseylouisee@me.com
04c3e1bd3e4aa1e97829803bfa184ddca790f180
1e3dcf73e90a80d5394b5ffc4211b517f9e24386
/app/src/main/java/com/jhonlee/homenews/view/nba/NBAEndHolder.java
a6d40c5bb0eeae42fb9c3c41731556dc58d33515
[]
no_license
JhoneLeedx/HomeNews
0fc8692240ec84751eee2c13d1a4359d3c6a48b4
ca6734f183a4798d50e5ec0ed656e4348abba208
refs/heads/master
2021-01-19T17:25:34.968226
2017-04-11T08:20:17
2017-04-11T08:20:17
82,455,767
0
0
null
null
null
null
UTF-8
Java
false
false
847
java
package com.jhonlee.homenews.view.nba; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.TextView; import com.jhonlee.homenews.R; import butterknife.BindView; import butterknife.ButterKnife; /** * Created by JhoneLee on 2017/3/9. */ public class NBAEndHolder extends RecyclerView.ViewHolder { @BindView(R.id.tv_nba_time) public TextView tvNbaTime; @BindView(R.id.tv_nba_play1) public TextView tvNbaPlay1; @BindView(R.id.tv_nba_score) public TextView tvNbaScore; @BindView(R.id.tv_nba_play2) public TextView tvNbaPlay2; @BindView(R.id.tv_nba_jstj) public TextView tvNbaJstj; @BindView(R.id.tv_nba_spjj) public TextView tvNbaSpjj; public NBAEndHolder(View itemView) { super(itemView); ButterKnife.bind(this,itemView); } }
[ "lijing930615@live.com" ]
lijing930615@live.com
e0fe88b0aa839568f82cce46644c2ea97b2b1801
242f70d3a7b1edda3abf98f9bc10cdca17f0ac3f
/sampleApp09/android/app/src/main/java/com/sampleapp09/MainApplication.java
bde19c0938a54de49e9d4238ca7a88094622635c
[]
no_license
mshige1979/react-native_samples
704a0821b1ccd1e88c4448c50cae998051230f37
0ecb2c79be32449f72f924a0ff2d20d28dd40692
refs/heads/main
2023-07-05T20:33:41.117652
2023-06-24T01:58:38
2023-06-24T01:58:38
308,628,352
0
1
null
null
null
null
UTF-8
Java
false
false
2,605
java
package com.sampleapp09; import android.app.Application; import android.content.Context; import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.lang.reflect.InvocationTargetException; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List<ReactPackage> packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); return packages; } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); } /** * Loads Flipper in React Native templates. Call this in the onCreate method with something like * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); * * @param context * @param reactInstanceManager */ private static void initializeFlipper( Context context, ReactInstanceManager reactInstanceManager) { if (BuildConfig.DEBUG) { try { /* We use reflection here to pick up the class that initializes Flipper, since Flipper library is not available in release mode */ Class<?> aClass = Class.forName("com.sampleapp09.ReactNativeFlipper"); aClass .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) .invoke(null, context, reactInstanceManager); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } } }
[ "mshige1979@ryuouen.net" ]
mshige1979@ryuouen.net
c28356d80db02e2be6cb9534c4a3b64194d4e272
f752c55cff241671c21cab75f9733d7f42f51f7f
/organization-service/src/test/java/com/echo/OrganizationServiceApplicationTests.java
24518b22649722c6ee15515eb54e7f6fd6718107
[]
no_license
EEEEEEcho/SpringMicroservicesInAction
4c07e9d251a0fb61eb577651791473d1a58f2e24
9435407439ab9ddffea1320983af2d3a42c5f6fc
refs/heads/master
2023-06-13T05:55:36.998560
2021-07-09T08:35:33
2021-07-09T08:35:33
384,133,104
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package com.echo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class OrganizationServiceApplicationTests { @Test void contextLoads() { } }
[ "echomengs@163.com" ]
echomengs@163.com
94a8b2f4315bc152323c88d1f704538caa1eb15e
6070ab0116bcf4eaca62d0a1ff6307c311544a64
/src/main/java/io/novelis/filtragecv/domain/package-info.java
322ba21c6f95f671939742c4ec6ee7deed6b06c7
[]
no_license
ilyasslazaar/CVCount
8890033e163a567b7e1ad65025ff1f61efd246a4
b6a64881507ee8114161cdf5e064e624527bffa5
refs/heads/master
2022-12-25T23:55:29.512808
2019-09-07T22:47:31
2019-09-07T22:47:31
195,426,613
0
0
null
2022-12-16T05:03:11
2019-07-05T14:53:42
Java
UTF-8
Java
false
false
69
java
/** * JPA domain objects. */ package io.novelis.filtragecv.domain;
[ "ilyasamraoui1@gmail.com" ]
ilyasamraoui1@gmail.com
9d432b5b9e85eaeb47cd60ba06aaebe910cebf5e
ff4f309b8c91a524165728ba1332d983f70ddbc2
/adminapp/app/src/main/java/com/example/towingapp/PoliceModel.java
c26b0d4810078325c581806e76495f2f46d99887
[]
no_license
Solankimimoh/Android-Towing-App
d16963cdc2d776ae7a3c517afa922270409a2abd
2201c5ed954970805ee8cbad18d5424fb0f15de9
refs/heads/master
2020-05-02T08:26:03.226279
2019-04-28T19:24:10
2019-04-28T19:24:10
177,842,765
0
0
null
null
null
null
UTF-8
Java
false
false
1,210
java
package com.example.towingapp; public class PoliceModel { private String name; private String email; private String password; private String mobile; private String policeid; public PoliceModel() { } public PoliceModel(String name, String email, String password, String mobile, String policeid) { this.name = name; this.email = email; this.password = password; this.mobile = mobile; this.policeid = policeid; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getPoliceid() { return policeid; } public void setPoliceid(String policeid) { this.policeid = policeid; } }
[ "solankimimoh@gmail.com" ]
solankimimoh@gmail.com
73171c473045f6023d2b199cf2892e40420f138b
4c23538ba36550b4b0405ab2457b937e27d811d2
/_DB/JDBCTest/src/com/test/jdbc/Ex08_CallableStatement.java
224f812dd85b09a9562e5882ae72d05bc2d738a0
[]
no_license
Jimijin92/class-
8c38cd8555e3ba3e50d3d91eb4f34bed3751c3df
750a87697431c3a70ecb196bb85a91f3d22a4e5c
refs/heads/master
2020-03-12T20:16:48.017056
2018-04-26T12:20:03
2018-04-26T12:20:03
130,802,149
0
0
null
null
null
null
UTF-8
Java
false
false
13,657
java
package com.test.jdbc; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.ResultSet; import java.util.Random; import java.util.Scanner; import java.util.jar.Attributes.Name; import oracle.jdbc.internal.OracleTypes; public class Ex08_CallableStatement { public static void main(String[] args) { //Ex08_CallableStatement.java //1. Statement : 정적 쿼리 실행 //2. PreparedStatement : 동적 쿼리 실행 //3. CallableStatement : 프로시저 호출 전용 //SELECT * FROM tblinsa WHERE buseo = 입력값; //m1(); //m2(); //m3(); //m4(); //m5(); //m6(); //m7(); //m8(); //m9(); m10(); //m11(); //m12(); } private static void m12() { Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_list_electronics(?) }"; stat = conn.prepareCall(sql); stat.registerOutParameter(1, OracleTypes.CURSOR); stat.executeQuery(); ResultSet rs = (ResultSet)stat.getObject(1); while (rs.next()) { //System.out.println(rs.getString("name")); sql = "{ call proc_check(?, ?) }"; stat = conn.prepareCall(sql); stat.setString(1, rs.getString("seq")); stat.registerOutParameter(2, OracleTypes.DOUBLE); stat.executeQuery(); //System.out.println(Math.round(stat.getDouble(2))); int totalHours = (int)Math.round(stat.getDouble(2)); sql = "{ call proc_get_total_capacity(?, ?) }"; stat = conn.prepareCall(sql); stat.setString(1, rs.getString("seq")); stat.registerOutParameter(2, OracleTypes.INTEGER); stat.executeQuery(); //System.out.println(Math.round(stat.getInt(2))); int totalCapacity = Math.round(stat.getInt(2)); // System.out.printf("%s : %d : %d : %d : %d\n" // , rs.getString("name") // , rs.getInt("consumption") // , totalHours // , totalCapacity // , totalCapacity - (totalHours * rs.getInt("consumption"))); String state = ""; if (totalCapacity - (totalHours * rs.getInt("consumption")) > 0) { state = String.format("%d 시간 사용 가능함", (totalCapacity - (totalHours * rs.getInt("consumption"))) / rs.getInt("consumption")); } else { state = "배터리 없음"; } System.out.printf("%s : %s\n", rs.getString("name"), state); } rs.close(); stat.close(); conn.close(); } catch (Exception e) { System.out.println(e.toString()); } } private static void m11() { Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_distance(?) }"; stat = conn.prepareCall(sql); stat.registerOutParameter(1, OracleTypes.CURSOR); stat.executeQuery(); ResultSet rs = (ResultSet)stat.getObject(1); while (rs.next()) { System.out.printf("%s ▷ %s (%skm)\n" , rs.getString("sname") , rs.getString("ename") , rs.getString("distance")); } rs.close(); stat.close(); conn.close(); } catch (Exception e) { System.out.println(e.toString()); } } private static void m10() { Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_mergency(?) }"; stat = conn.prepareCall(sql); stat.registerOutParameter(1, OracleTypes.CURSOR); stat.executeQuery(); ResultSet rs = (ResultSet)stat.getObject(1); String buseo = ""; String temp = ""; while (rs.next()) { if (!buseo.equals(rs.getString("buseo").trim())) { buseo = rs.getString("buseo").trim(); if (temp.length() == 0) temp += String.format("[%s]\n", buseo); else temp = temp.substring(0, temp.length()-2) + String.format("(종료)\n[%s]\n", buseo); } temp += rs.getString("name") + " ▷ "; } System.out.println(temp.substring(0, temp.length()-2) + "(종료)"); rs.close(); stat.close(); conn.close(); } catch (Exception e) { System.out.println(e.toString()); } } private static void m9() { Scanner scan = new Scanner(System.in); Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_employees(?, ?) }"; stat = conn.prepareCall(sql); stat.registerOutParameter(2, OracleTypes.CURSOR); System.out.print("직원 번호 입력 : "); stat.setString(1, scan.nextLine()); stat.executeQuery(); ResultSet rs = (ResultSet)stat.getObject(2); while (rs.next()) { String temp = ""; for (int i=1; i<rs.getInt("level"); i++) { temp += " "; } if (rs.getInt("level") > 1) temp += "▷ "; System.out.printf("%s%s(tel:%s)\n" , temp , rs.getString("name") , rs.getString("phone")); } rs.close(); stat.close(); conn.close(); } catch (Exception e) { System.out.println(e.toString()); } } private static void m8() { Scanner scan = new Scanner(System.in); Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_list_big_category(?) }"; stat = conn.prepareCall(sql); stat.registerOutParameter(1, OracleTypes.CURSOR); stat.executeQuery(); ResultSet rs = (ResultSet)stat.getObject(1); System.out.println("[대분류]"); while (rs.next()) { System.out.printf("%s. %s\n" , rs.getString("seq") , rs.getString("name")); } rs.close(); System.out.print("선택 : "); int sel = scan.nextInt(); sql = "{ call proc_list_middle_category(?, ?) }"; stat = conn.prepareCall(sql); stat.setInt(1, sel); stat.registerOutParameter(2, OracleTypes.CURSOR); stat.executeQuery(); rs = (ResultSet)stat.getObject(2); System.out.println("\n[중분류]"); while (rs.next()) { System.out.printf("%s. %s\n" , rs.getString("seq") , rs.getString("name")); } rs.close(); System.out.print("선택 : "); sel = scan.nextInt(); sql = "{ call proc_list_small_category(?, ?) }"; stat = conn.prepareCall(sql); stat.setInt(1, sel); stat.registerOutParameter(2, OracleTypes.CURSOR); stat.executeQuery(); rs = (ResultSet)stat.getObject(2); System.out.println("\n[소분류]"); while (rs.next()) { System.out.printf("%s. %s\n" , rs.getString("seq") , rs.getString("name")); } rs.close(); System.out.print("선택 : "); sel = scan.nextInt(); sql = "{ call proc_list_product(?, ?) }"; stat = conn.prepareCall(sql); stat.setInt(1, sel); stat.registerOutParameter(2, OracleTypes.CURSOR); stat.executeQuery(); rs = (ResultSet)stat.getObject(2); System.out.println("\n[상품]"); while (rs.next()) { System.out.printf("%s. %s(수량 : %s개)\n" , rs.getString("seq") , rs.getString("name") , rs.getString("qty")); } rs.close(); stat.close(); conn.close(); } catch (Exception e) { System.out.println(e.toString()); } } private static void m7() { Scanner scan = new Scanner(System.in); Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_auth(?, ?) }"; stat = conn.prepareCall(sql); stat.registerOutParameter(2, OracleTypes.INTEGER); while (true) { System.out.print("아이디 입력 : "); stat.setString(1, scan.nextLine()); stat.executeQuery(); if (stat.getInt(2) == 0) { System.out.println("사용이 가능합니다."); break; } else { System.out.println("이미 사용중입니다."); } } } catch (Exception e) { System.out.println(e.toString()); } } private static void m6() { String[] names = { "홍길동", "아무개", "하하하", "테스트", "호호호" }; String[] items = { "키보드", "마우스", "모니터", "프린터" }; Random rnd = new Random(); Scanner scan = new Scanner(System.in); Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_addbuy(?, ?, ?) }"; stat = conn.prepareCall(sql); for (int i=0; i<100; i++) { stat.setString(1, names[rnd.nextInt(names.length)]); stat.setString(2, items[rnd.nextInt(items.length)]); stat.setInt(3, rnd.nextInt(10) + 1); stat.executeUpdate(); } System.out.print("검색 수량 : "); int count = scan.nextInt(); sql = "{ call proc_listbuy(?, ?) }"; stat = conn.prepareCall(sql); stat.setInt(1, count); stat.registerOutParameter(2, OracleTypes.CURSOR); stat.executeQuery(); ResultSet rs = (ResultSet)stat.getObject(2); System.out.println("[검색 결과]"); while (rs.next()) { System.out.printf("%s\t%s\t%s\t%s\n" , rs.getString("name") , rs.getString("item") , rs.getString("qty") , rs.getString("regdate")); } stat.close(); conn.close(); } catch (Exception e) { System.out.println(e.toString()); } } private static void m5() { //5. 전화번호 일부 입력 -> 직원 명단을 출력(이름, 부서, 직위, 전화번호) //번호 입력 : 123 //proc_m5(?, ?) //011-234-5678 //O Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_m5(?, ?) }"; stat = conn.prepareCall(sql); Scanner scan = new Scanner(System.in); System.out.print("번호 입력 : "); String word = scan.nextLine(); stat.setString(1, word); stat.registerOutParameter(2, OracleTypes.CURSOR); stat.executeQuery(); ResultSet rs = (ResultSet)stat.getObject(2); System.out.println("[검색 결과]"); while (rs.next()) { System.out.printf("%s\t%s\t%s\t%s\n" , rs.getString("name") , rs.getString("buseo") , rs.getString("jikwi") , rs.getString("tel")); } rs.close(); stat.close(); conn.close(); } catch (Exception e) { System.out.println(e.toString()); } } private static void m4() { //4. 커서 반환 Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_m4(?, ?) }"; stat = conn.prepareCall(sql); stat.setString(1, "서울"); stat.registerOutParameter(2, OracleTypes.CURSOR); stat.executeQuery(); ResultSet rs = (ResultSet)stat.getObject(2); while (rs.next()) { System.out.println(rs.getString("name") + " - " + rs.getString("buseo")); } rs.close(); stat.close(); conn.close(); } catch (Exception e) { System.out.println(e.toString()); } } private static void m3() { //3. 반환값O Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); // String sql = "{ call proc_m3(?) }"; // stat = conn.prepareCall(sql); // // //out 매개변수 등록 // stat.registerOutParameter(1, OracleTypes.INTEGER); //out 변수 생성 // stat.executeQuery(); //out 변수 채우기 // // //? // int count = stat.getInt(1);//out 변수값 접근 // System.out.println(count); // String sql = "{ call proc_m3(?, ?, ?) }"; // stat = conn.prepareCall(sql); // // stat.registerOutParameter(1, OracleTypes.VARCHAR); //pname // stat.registerOutParameter(2, OracleTypes.INTEGER); //page // stat.registerOutParameter(3, OracleTypes.VARCHAR); //ptel // // stat.executeQuery(); // // System.out.println(stat.getString(1)); // System.out.println(stat.getInt(2)); // System.out.println(stat.getString(3)); String sql = "{ call proc_m3(?, ?, ?, ?) }"; stat = conn.prepareCall(sql); stat.setString(1, "68"); stat.registerOutParameter(2, OracleTypes.VARCHAR); //pname stat.registerOutParameter(3, OracleTypes.INTEGER); //page stat.registerOutParameter(4, OracleTypes.VARCHAR); //ptel stat.executeQuery(); System.out.println(stat.getString(2)); System.out.println(stat.getInt(3)); System.out.println(stat.getString(4)); stat.close(); conn.close(); } catch (Exception e) { System.out.println(e.toString()); } } private static void m2() { //2. 매개변수X, 반환값X Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_m2 }"; stat = conn.prepareCall(sql); stat.executeUpdate(); stat.close(); conn.close(); System.out.println("tbladdress 초기화 완료"); } catch (Exception e) { System.out.println(e.toString()); } } private static void m1() { //1. 반환값이 없는 SQL(프로시저) Connection conn = null; CallableStatement stat = null; try { conn = DBUtil.open(); String sql = "{ call proc_m1(?, ?, ?, ?) }"; stat = conn.prepareCall(sql); stat.setString(1, "아무개"); stat.setInt(2, 25); stat.setString(3, "010-5555-6666"); stat.setString(4, "서울시 강남구 대치동"); stat.executeUpdate(); System.out.println("완료"); } catch (Exception e) { System.out.println(e.toString()); } } }
[ "tnqleo92@gmail.com" ]
tnqleo92@gmail.com
29301ec53f6c16a174a5a893e2c100074b839cf2
730c833b73fdbe4646a3ec56e7e1b43546772853
/app/src/main/java/com/kylev1999/qstorage/create_new_storage.java
7547f29530ecf76be11788dae3f3c50aa142a305
[]
no_license
KyleV1999/QStorage
72c243f864ac4a9a1576992522319e55f3745ca1
172528da27f74ea5097ad2aeee8dd69d59e80637
refs/heads/master
2022-11-30T22:40:46.047374
2020-08-09T03:31:44
2020-08-09T03:31:44
284,606,982
0
0
null
null
null
null
UTF-8
Java
false
false
9,393
java
package com.kylev1999.qstorage; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.AppCompatSpinner; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class create_new_storage extends AppCompatActivity implements View.OnClickListener { public String newStorageName; FirebaseAuth mAuth; TextView storageNameTitle; LinearLayout layoutList; Button addButton; Button submitButton; List<String> numbList = new ArrayList<>(); //List for quantity spinner ArrayList<Items> itemsArrayList = new ArrayList<>(); //List for actual items private FirebaseDatabase database; private DatabaseReference myRef; @Override protected void onCreate(Bundle savedInstanceState) { setTheme(R.style.AppTheme); super.onCreate(savedInstanceState); setContentView(R.layout.activity_create_new_storage); findAllViews(); OpenDialog(); } private void getDatabase() { database = FirebaseDatabase.getInstance(); mAuth = FirebaseAuth.getInstance(); String path = mAuth.getUid() + "/" + newStorageName; myRef = database.getReference(path); } public void OpenDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); View view = getLayoutInflater().inflate(R.layout.new_layout_dialog, null); final EditText getStorageName = view.findViewById(R.id.getNewBin); final TextView errorMessage = view.findViewById(R.id.errorMsg); builder.setView(view) .setTitle("Create a New Storage Bin") .setCancelable(false) //Reduces use of back button. Maybe implement back button functionality. .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { startActivity(new Intent(create_new_storage.this, MainActivity.class )); finish(); } }) .setPositiveButton("OK", null); final AlertDialog dialog = builder.create(); dialog.show(); dialog.setCanceledOnTouchOutside(false); dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (!getStorageName.getText().toString().isEmpty()){ newStorageName = getStorageName.getText().toString(); AfterDialog(); dialog.dismiss(); } else { errorMessage.setVisibility(View.VISIBLE); } } }); } private void AfterDialog() { getDatabase(); storageNameTitle.setText(newStorageName); storageNameTitle.setVisibility(View.VISIBLE); addButton.setVisibility(View.VISIBLE); submitButton.setVisibility(View.VISIBLE); addButton.setOnClickListener(this); submitButton.setOnClickListener(this); numbList.add("Item Number"); numbList.add("1"); numbList.add("2"); numbList.add("3"); numbList.add("4"); numbList.add("5"); numbList.add("6"); numbList.add("7"); numbList.add("8"); numbList.add("9"); numbList.add("10"); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.addButton: addView(); break; case R.id.submitButton: if(validateAndSubmit()){ Items itemv; for (int i = 0; i < itemsArrayList.size(); i++){ itemv = itemsArrayList.get(i); Log.d("ARRAY", itemv.getName()); Log.d("ARRAY", itemv.getQuantity()); } WriteData(); Toast.makeText(this, "New Bin Created", Toast.LENGTH_SHORT).show(); Intent intent = new Intent (create_new_storage.this, generate_qr.class); Bundle bundle = new Bundle(); bundle.putSerializable("list", itemsArrayList); intent.putExtras(bundle); intent.putExtra("storageName", newStorageName ); startActivity(intent); finish(); } break; } } private void WriteData() { Items itemv; //When gotten this is both the name and quantity //TODO: Check if everything was successful before going to the next activity. for (int i = 0; i < itemsArrayList.size(); i++){ itemv = itemsArrayList.get(i); final String itemn = itemv.getName(); final String itemq = itemv.getQuantity(); myRef.push().setValue(itemv).addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { Log.d("Database", "Item: " + itemn + "Quantity: " + itemq + " Pushed To Database!"); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Toast.makeText(getApplicationContext(), "Something Went Wrong! Please Try Again.", Toast.LENGTH_SHORT).show(); } }); } } private boolean validateAndSubmit() { itemsArrayList.clear(); boolean result = true; for (int i = 0; i < layoutList.getChildCount(); i++){ View itemView = layoutList.getChildAt(i); EditText itemNameText = itemView.findViewById(R.id.getItemName); AppCompatSpinner spinnerNumber = itemView.findViewById(R.id.getNumItems); Items items = new Items(); if(!itemNameText.getText().toString().equals("")){ items.setName(itemNameText.getText().toString()); } else { result = false; break; } if (spinnerNumber.getSelectedItemPosition()!=0){ items.setQuantity(numbList.get(spinnerNumber.getSelectedItemPosition())); } else { result = false; break; } //TODO: Check for duplicate items. Notify if they still want to continue. The below works but needs some tweaking /* String currentString = itemNameText.getText().toString(); for (int j = i + 1; j < layoutList.getChildCount(); j++){ View itemView2 = layoutList.getChildAt(j); EditText itemNameText2 = itemView2.findViewById(R.id.getItemName); if (itemNameText2.getText().toString().equals(currentString)){ Toast.makeText(this, "Duplicate", Toast.LENGTH_SHORT).show(); result = false; break; } } */ itemsArrayList.add(items); } if(itemsArrayList.size()==0){ result = false; Toast.makeText(this, "Add at least one item to the bin!", Toast.LENGTH_SHORT).show(); } else if (!result) { Toast.makeText(this, "Enter items correctly!", Toast.LENGTH_SHORT).show(); } return result; } private void addView() { final View itemView = getLayoutInflater().inflate(R.layout.row_add_item, null, false); EditText itemEditText = itemView.findViewById(R.id.getItemName); AppCompatSpinner spinnerNumber = itemView.findViewById(R.id.getNumItems); ImageView removeImg = itemView.findViewById(R.id.removeImg); ArrayAdapter arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, numbList); spinnerNumber.setAdapter(arrayAdapter); removeImg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { removeView(itemView); } }); layoutList.addView(itemView); } private void removeView(View view){ layoutList.removeView(view); } private void findAllViews() { storageNameTitle = findViewById(R.id.storageNameTitle); addButton = findViewById(R.id.addButton); layoutList = findViewById(R.id.layout_list); submitButton = findViewById(R.id.submitButton); } }
[ "54862039+KyleV1999@users.noreply.github.com" ]
54862039+KyleV1999@users.noreply.github.com
787fa14736c2896e120adc64a5917a1abcc32b24
413a584d7123872cc04b2d1bb1141310cefa7b48
/announcement/announcement-impl/impl/src/java/org/sakaiproject/announcement/impl/SiteEmailNotificationAnnc.java
95cbe09988e3a96ffac04afd7de2eca681d840c7
[ "ECL-1.0", "Apache-2.0" ]
permissive
etudes-inc/etudes-lms
31bc2b187cafc629c8b2b61be92aa16bb78aca99
38a938e2c74d86fc3013642b05914068a3a67af3
refs/heads/master
2020-06-03T13:49:45.997041
2017-10-25T21:25:58
2017-10-25T21:25:58
94,132,665
0
0
null
null
null
null
UTF-8
Java
false
false
14,014
java
/********************************************************************************** * $URL: https://source.etudes.org/svn/etudes/source/trunk/announcement/announcement-impl/impl/src/java/org/sakaiproject/announcement/impl/SiteEmailNotificationAnnc.java $ * $Id: SiteEmailNotificationAnnc.java 12190 2015-12-02 20:20:14Z mallikamt $ *********************************************************************************** * Copyright (c) 2013 Etudes, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation. * * Licensed under the Educational Community License, Version 1.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/licenses/ecl1.php * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * **********************************************************************************/ package org.sakaiproject.announcement.impl; import java.util.Iterator; import java.util.List; import java.util.ResourceBundle; import java.util.Vector; import org.etudes.util.XrefHelper; import org.sakaiproject.announcement.api.AnnouncementMessage; import org.sakaiproject.announcement.api.AnnouncementMessageHeader; import org.sakaiproject.announcement.api.AnnouncementService; import org.sakaiproject.authz.api.SecurityAdvisor; import org.sakaiproject.authz.cover.SecurityService; import org.sakaiproject.component.cover.ComponentManager; import org.sakaiproject.component.cover.ServerConfigurationService; import org.sakaiproject.scheduler.api.ScheduledInvocationCommand; import org.sakaiproject.entity.api.Reference; import org.sakaiproject.entity.api.ResourceProperties; import org.sakaiproject.entity.cover.EntityManager; import org.sakaiproject.event.api.Event; import org.sakaiproject.event.api.Notification; import org.sakaiproject.event.api.NotificationAction; import org.sakaiproject.event.api.NotificationEdit; import org.sakaiproject.event.api.NotificationService; import org.sakaiproject.event.cover.EventTrackingService; import org.sakaiproject.site.api.Site; import org.sakaiproject.site.cover.SiteService; import org.sakaiproject.time.api.Time; import org.sakaiproject.time.cover.TimeService; import org.sakaiproject.util.SiteEmailNotification; /** * <p> * SiteEmailNotificationAnnc fills the notification message and headers with details from the announcement message that triggered the notification event. * </p> */ public class SiteEmailNotificationAnnc extends SiteEmailNotification implements ScheduledInvocationCommand { private static ResourceBundle rb = ResourceBundle.getBundle("siteemaanc"); private ComponentManager componentManager; /** * Construct. */ public SiteEmailNotificationAnnc() { } /** * Construct. */ public SiteEmailNotificationAnnc(String siteId) { super(siteId); } /** * @inheritDoc */ protected String getResourceAbility() { return AnnouncementService.SECURE_ANNC_READ; } /** * Inject ComponentManager */ public void setComponentManager(ComponentManager componentManager) { this.componentManager = componentManager; } /** * @inheritDoc */ public NotificationAction getClone() { SiteEmailNotificationAnnc clone = new SiteEmailNotificationAnnc(); clone.set(this); return clone; } /** * @inheritDoc */ public void notify(Notification notification, Event event) { // get the message Reference ref = EntityManager.newReference(event.getResource()); AnnouncementMessage msg = (AnnouncementMessage) ref.getEntity(); AnnouncementMessageHeader hdr = (AnnouncementMessageHeader) msg.getAnnouncementHeader(); // do not do notification for draft messages if (hdr.getDraft()) return; if (msg.getProperties().getProperty("archived") != null) return; // read the notification options final String notif = msg.getProperties().getProperty("notificationLevel"); int noti = NotificationService.NOTI_OPTIONAL; if ("r".equals(notif)) { noti = NotificationService.NOTI_REQUIRED; } else if ("n".equals(notif)) { noti = NotificationService.NOTI_NONE; } // use either the configured site, or if not configured, the site (context) of the resource String siteId = (getSite() != null) ? getSite() : ref.getContext(); try { Site site = SiteService.getSite(siteId); if ((site.isPublished() == false) && (noti != NotificationService.NOTI_REQUIRED)) { return; } } catch (Exception ignore) { } // Check release date. // This will only activate for immediate notifications // Future notifications will always be executed by execute method Time now = TimeService.newTime(); Time releaseDate; try { releaseDate = msg.getProperties().getTimeProperty(AnnouncementService.RELEASE_DATE); if (releaseDate != null) { try { if (now.after(releaseDate)) { super.notify(notification, event); } } catch (Exception e1) { } } } catch (Exception e2) { } } /** * @inheritDoc */ protected String getMessage(Event event) { StringBuffer buf = new StringBuffer(); String newline = "<br />\n"; // get the message Reference ref = EntityManager.newReference(event.getResource()); AnnouncementMessage msg = (AnnouncementMessage) ref.getEntity(); AnnouncementMessageHeader hdr = (AnnouncementMessageHeader) msg.getAnnouncementHeader(); // use either the configured site, or if not configured, the site (context) of the resource String siteId = (getSite() != null) ? getSite() : ref.getContext(); // get a site title String title = siteId; try { Site site = SiteService.getSite(siteId); title = site.getTitle(); } catch (Exception ignore) { } Time releaseDate; String dateDisplay; try { releaseDate = msg.getProperties().getTimeProperty(AnnouncementService.RELEASE_DATE); if (releaseDate == null) { dateDisplay = hdr.getDate().toStringLocalFull(); } else { dateDisplay = releaseDate.toStringLocalFull(); } } catch (Exception e2) { dateDisplay = hdr.getDate().toStringLocalFull(); } buf.append("<div style=\"display:inline; float:left;\">From: " + hdr.getFrom().getDisplayName() + "</div>"); buf.append("<div style=\"display:inline; float:right;\">" + dateDisplay + "</div>"); buf.append("<div style=\"clear:both\"></div>"); buf.append("<div style=\"font-weight:bold;margin-top:10px;\">" + hdr.getSubject() + "</div>"); buf.append("<hr />"); // write with full urls for embedded data try { buf.append(XrefHelper.fullUrls(msg.getBody())); } catch (Exception e) { // in case of error write original data buf.append(msg.getBody()); } buf.append(newline); // add any attachments List attachments = hdr.getAttachments(); if (attachments.size() > 0) { buf.append(newline + rb.getString("Attachments") + newline); for (Iterator iAttachments = attachments.iterator(); iAttachments.hasNext();) { Reference attachment = (Reference) iAttachments.next(); String attachmentTitle = attachment.getProperties().getPropertyFormatted(ResourceProperties.PROP_DISPLAY_NAME); buf.append("<a href=\"" + attachment.getUrl() + "\">" + attachmentTitle + "</a>" + newline); } } return buf.toString(); } /** * @inheritDoc */ protected List getHeaders(Event event) { List rv = new Vector(); // Set the content type of the message body to HTML rv.add("Content-Type: text/html"); // set the subject rv.add("Subject: " + getSubject(event)); // from rv.add(getFrom(event)); // to rv.add(getTo(event)); return rv; } /** * @inheritDoc */ protected String getTag(String newline, String title, String siteId) { // tag the message - HTML version String rv = newline + "<hr /><div style=\"text-align:center\">This automatic notification was sent by <a href=\"" + ServerConfigurationService.getPortalUrl() + "\">" + ServerConfigurationService.getString("ui.service", "Sakai") + "</a> from the <a href=\"" + ServerConfigurationService.getPortalUrl() + "/site/" + siteId + "\">" + title + "</a> site.<br />" + "You can modify how you receive notifications under Preferences.</div>"; return rv; } /** * @inheritDoc */ protected boolean isBodyHTML(Event e) { return true; } /** * Format the announcement notification subject line. * * @param event * The event that matched criteria to cause the notification. * @return the announcement notification subject line. */ protected String getSubject(Event event) { // get the message Reference ref = EntityManager.newReference(event.getResource()); AnnouncementMessage msg = (AnnouncementMessage) ref.getEntity(); AnnouncementMessageHeader hdr = (AnnouncementMessageHeader) msg.getAnnouncementHeader(); // use either the configured site, or if not configured, the site (context) of the resource String siteId = (getSite() != null) ? getSite() : ref.getContext(); // get a site title String title = siteId; try { Site site = SiteService.getSite(siteId); title = site.getTitle(); } catch (Exception ignore) { } // use the message's subject //return "[ " + title + " - " + rb.getString("Announcement") + " ] " + hdr.getSubject(); return hdr.getSubject() + " ["+ rb.getString("Announcement") +" from " + title +"]"; } /** * Add to the user list any other users who should be notified about this ref's change. * * @param users * The user list, already populated based on site visit and resource ability. * @param ref * The entity reference. */ protected void addSpecialRecipients(List users, Reference ref) { // include any users who have AnnouncementService.SECURE_ALL_GROUPS and getResourceAbility() in the context String contextRef = SiteService.siteReference(ref.getContext()); // get the list of users who have SECURE_ALL_GROUPS List allGroupUsers = SecurityService.unlockUsers(AnnouncementService.SECURE_ANNC_ALL_GROUPS, contextRef); // filter down by the permission if (getResourceAbility() != null) { List allGroupUsers2 = SecurityService.unlockUsers(getResourceAbility(), contextRef); allGroupUsers.retainAll(allGroupUsers2); } // remove any in the list already allGroupUsers.removeAll(users); // combine users.addAll(allGroupUsers); } /** * For ScheduledInvocationCommand, use a medium (0 .. 1000) priority */ public Integer getPriority() { return Integer.valueOf(500); } /** * Implementation of command pattern. Will be called by ScheduledInvocationManager * for delayed announcement notifications * * @param opaqueContext * reference (context) for message */ public void execute(String opaqueContext) { // get the message final Reference ref = EntityManager.newReference(opaqueContext); // needed to access the message enableSecurityAdvisor(); final AnnouncementMessage msg = (AnnouncementMessage) ref.getEntity(); final AnnouncementMessageHeader hdr = (AnnouncementMessageHeader) msg.getAnnouncementHeader(); // do not do notification for draft messages if (hdr.getDraft()) return; // read the notification options final String notif = msg.getProperties().getProperty("notificationLevel"); int noti = NotificationService.NOTI_OPTIONAL; if ("r".equals(notif)) { noti = NotificationService.NOTI_REQUIRED; } else if ("n".equals(notif)) { noti = NotificationService.NOTI_NONE; } // use either the configured site, or if not configured, the site (context) of the resource String siteId = (getSite() != null) ? getSite() : ref.getContext(); try { Site site = SiteService.getSite(siteId); if ((site.isPublished() == false) && (noti != NotificationService.NOTI_REQUIRED)) { return; } } catch (Exception ignore) { } final Event delayedNotificationEvent = EventTrackingService.newEvent("annc.schInv.notify", msg.getReference(), true, noti); // EventTrackingService.post(event); final NotificationService notificationService = (NotificationService) ComponentManager.get(org.sakaiproject.event.api.NotificationService.class); NotificationEdit notify = notificationService.addTransientNotification(); super.notify(notify, delayedNotificationEvent); // since we build the notification by accessing the // message within the super class, can't remove the // SecurityAdvisor until this point // done with access, need to remove from stack SecurityService.clearAdvisors(); } /** * Establish a security advisor to allow the "embedded" azg work to occur * with no need for additional security permissions. */ protected void enableSecurityAdvisor() { // put in a security advisor so we can do our podcast work without need // of further permissions SecurityService.pushAdvisor(new SecurityAdvisor() { public SecurityAdvice isAllowed(String userId, String function, String reference) { return SecurityAdvice.ALLOWED; } }); } }
[ "ggolden@etudes.org" ]
ggolden@etudes.org
0bc3c1775636e272c2614154846d61a0408174a6
1a78164fa7d46df2dd2d997ab1e09b0581b11167
/src/main/java/com/training/exception/handling/NotADirectoryTest.java
020dce09d3d3b08c16aa0af8363365567340d1d6
[]
no_license
phani590/training-project
df6a2bc7dcd6713b28f987ddd2590deb45e2cd78
e0cca627e53b5e720b766ef74c963ee283b94eb0
refs/heads/master
2022-12-03T01:03:02.355866
2020-03-14T16:49:38
2020-03-14T16:49:38
246,975,542
0
0
null
2022-11-24T02:48:59
2020-03-13T02:52:25
Java
UTF-8
Java
false
false
293
java
package com.training.exception.handling; import java.io.File; import java.io.IOException; public class NotADirectoryTest { public static void main(String[] args) throws IOException { File file = new File(args[0]); if(!file.isDirectory()){ new NotADirectoryException(); } } }
[ "phani590@gamil.com" ]
phani590@gamil.com
7569914440ec5df7a2b11fac92f769ed0eef2858
0c5b616d6f6fe789500c10ccc337bac380be5554
/app/src/main/java/com/example/jil/myapplication/Fragments/ProfileFragment.java
4a3eb089ea636fccc0cacbfa223d2d41f04c953a
[]
no_license
ShivangPatel24/ChatApp-Android
046dedddf390bec16045eacacdb2dedf30569e3e
39d0899bc5d9abef044fb448da8bbab2780a2cd4
refs/heads/master
2020-05-21T00:29:16.498995
2019-05-09T16:07:33
2019-05-09T16:07:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,772
java
package com.example.jil.myapplication.Fragments; import android.app.Activity; import android.app.ProgressDialog; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.MimeTypeMap; import android.widget.EditText; import android.widget.ImageButton; import android.widget.TextView; import android.widget.Toast; import com.bumptech.glide.Glide; import com.example.jil.myapplication.MainActivity; import com.example.jil.myapplication.Model.User; import com.example.jil.myapplication.R; import com.google.android.gms.tasks.Continuation; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; 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 com.google.firebase.storage.FirebaseStorage; import com.google.firebase.storage.OnProgressListener; import com.google.firebase.storage.StorageReference; import com.google.firebase.storage.StorageTask; import com.google.firebase.storage.UploadTask; import java.util.HashMap; import de.hdodenhof.circleimageview.CircleImageView; public class ProfileFragment extends Fragment { CircleImageView image_profile; TextView username; FirebaseUser fuser; DatabaseReference reference; StorageReference storageReference; private static final int IMAGE_REQUEST=1; private Uri imageUri; private StorageTask uploadTask; TextView txt_status; ImageButton modify_btn; EditText edit_status; String status; // User user; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_profile,container,false); image_profile=view.findViewById(R.id.profile_image); username=view.findViewById(R.id.username); txt_status=view.findViewById(R.id.txt_status); modify_btn=view.findViewById(R.id.modify_btn); edit_status=view.findViewById(R.id.edit_status); storageReference =FirebaseStorage.getInstance().getReference("uploads"); fuser= FirebaseAuth.getInstance().getCurrentUser(); reference=FirebaseDatabase.getInstance().getReference("Users").child(fuser.getUid()); reference.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { User user = dataSnapshot.getValue(User.class); username.setText(user.getUsername()); /* if(user.getTxt_status()==null) { return; }*/ status=user.getTxt_status(); txt_status.setText(user.getTxt_status()); // edit_status.setText(user.getTxt_status()); if(user.getImageURL().equals("default")) { image_profile.setImageResource(R.mipmap.ic_launcher); } else { if(getActivity()==null) { return; } Glide.with(getContext()).load(user.getImageURL()).into(image_profile); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); modify_btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { edit_status.setVisibility(View.VISIBLE); edit_status.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { Log.d("status ","got changed"); DatabaseReference reference1= FirebaseDatabase.getInstance().getReference("Users").child(fuser.getUid()); HashMap<String,Object> hashMap = new HashMap<>(); hashMap.put("txt_status", s.toString()); reference1.updateChildren(hashMap); // edit_status.setText(""); edit_status.setVisibility(View.GONE); } }); } }); /* edit_status.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { Log.d("status ","got changed"); DatabaseReference reference1= FirebaseDatabase.getInstance().getReference("Users").child(fuser.getUid()); HashMap<String,Object> hashMap = new HashMap<>(); hashMap.put("txt_status", s.toString()); reference1.updateChildren(hashMap); // edit_status.setText(""); edit_status.setVisibility(View.GONE); } });*/ image_profile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openIamge(); } }); return view; } private void openIamge() { Intent intent = new Intent(); intent.setType("image/"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(intent,IMAGE_REQUEST); } private String getFileExtension(Uri uri) { ContentResolver contentResolver = getContext().getContentResolver(); MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton(); return mimeTypeMap.getExtensionFromMimeType(contentResolver.getType(uri)); } private void uploadImage() { //final ProgressDialog pd = new ProgressDialog(getContext()); //pd.setMessage("Uploading"); //pd.show(); if (imageUri != null) { final StorageReference fileReference = storageReference.child(System.currentTimeMillis() + "." + getFileExtension(imageUri)); uploadTask = fileReference.putFile(imageUri); uploadTask .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { taskSnapshot.getMetadata().getReference().getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { HashMap<String,Object> map = new HashMap<>(); map.put("imageURL",uri.toString()); // map.put("imageURL",taskSnapshot.getMetadata().getReference().getDownloadUrl().toString()); // Log.d("url:",taskSnapshot.getMetadata().getReference().getDownloadUrl().toString()); reference.updateChildren(map); } }); // Glide.with(getContext()).load(user.getImageURL()).into(profile_image); } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Toast.makeText(getContext(),e.getMessage(),Toast.LENGTH_SHORT).show(); } }) .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() { @Override public void onProgress(UploadTask.TaskSnapshot taskSnapshot) { /*double progress =(100.0 *taskSnapshot.getBytesTransferred()/taskSnapshot.getTotalByteCount());*/ } }); } else { Toast.makeText(getContext(),"NO image selected",Toast.LENGTH_SHORT).show(); } } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==IMAGE_REQUEST && resultCode == Activity.RESULT_OK && data !=null && data.getData()!=null) { imageUri=data.getData(); uploadImage(); } } }
[ "cvangdpatel@gmail.com" ]
cvangdpatel@gmail.com
32537af7b4320d6dbc121086b0c6000c9a782435
189420071007339bc948a6b213fbac1a8acf1285
/ICS4U1/LB_CJ_KA_CrazyEights/Human.java
b7d638575f23baa42fbd9ce9b6d1e41912f57543
[]
no_license
Wibben/MGCI
06865c31b6218881058c9ff59711b618b7afafdf
09e8d65148e8063271d8dd6b4a12db8ccbc1093a
refs/heads/master
2021-01-10T14:33:22.446089
2019-02-01T01:56:56
2019-02-01T02:05:17
45,087,410
0
0
null
null
null
null
UTF-8
Java
false
false
633
java
/* Bing Li, Jaitra Chaudhuri, Ahil Khuwaja * ICS4U1 * Crazy Eights */ import java.util.*; public class Human extends Hand { CrazyEights game; public Human(CrazyEights g) { super(); game = g; } public Card choose() // Let the player choose a card { int c = game.getChoice(); Card choice = get(c); super.remove(c); // Remove the card that was just played return choice; // Return the picked card } public Card chooseSuit() // let the player choose a suit { return new Card((new ChooseSuit()).suitChange()); } }
[ "bingr99@hotmail.com" ]
bingr99@hotmail.com
80dbd8a8a352edfaddea78f565dd4db336f6d7a4
f820881155ee4eac5fafc6af7e54501c47d723b3
/src/comp2/got/players/Warrior.java
49ccfae3c38b7798320ef381c4a244790120ce56
[]
no_license
JeffersonRBrito/gamebook
da374afdfbaebea569568b6df45ab9f8809a42a2
4e3f8cdff750a812c9fca6eac0bb56db749cb9b3
refs/heads/master
2020-12-25T12:47:15.793055
2017-07-17T17:42:29
2017-07-17T17:42:29
60,430,529
0
0
null
2016-06-04T21:15:16
2016-06-04T21:15:16
null
UTF-8
Java
false
false
1,147
java
package comp2.got.players; import java.util.ArrayList; import comp2.got.basic.Item; import comp2.got.basic.Player; import comp2.got.enumerators.Attribute; import comp2.got.enumerators.ItemType; public class Warrior extends Player{ public Warrior(int life, int attack) { super(life, attack); // Set basic main attributes this.attributeSet.setAttributeValue(Attribute.PhysicalAttack, 2); this.attributeSet.setAttributeValue(Attribute.PhysicalDefense, 3); } @Override protected void setInitialItemSet() { ArrayList<Item> items = new ArrayList<Item>(); Item basicSword = new Item("Basic sword", "Used by starter warriors", ItemType.Sword); basicSword.affectedAttributes.setAttributeValue(Attribute.PhysicalAttack, 2); Item basicRing = new Item("Ring of the warrior", "Used by warriors who just left the warrior academy", ItemType.Acessory); basicRing.affectedAttributes.setAttributeValue(Attribute.PhysicalAttack, 1); basicRing.affectedAttributes.setAttributeValue(Attribute.PhysicalDefense, 1); items.add(basicSword); items.add(basicRing); for (Item item : items) { this.equipItem(item); } } }
[ "jeffersonrangelmu@gmail.com" ]
jeffersonrangelmu@gmail.com
3b438127adfe9a8ae7f3c3f671cde6e2848656a6
0c75122f40bcd04f567eb03480425932f45ec944
/src/main/java/com/lancefallon/chapter2/playground/Mailable.java
1e31e09b6758d954c3476c4d0c0d9f48c6d390e9
[]
no_license
lfallo1/rxjavademoapp
3b43b82924add7ce0d9414fb56d38635ffd649d3
28a74caf451531d6d37b7fd18042aaec2ad679a9
refs/heads/master
2021-01-01T19:47:21.107605
2017-07-28T19:25:49
2017-07-28T19:25:49
98,680,611
0
0
null
null
null
null
UTF-8
Java
false
false
121
java
package com.lancefallon.chapter2.playground; public interface Mailable { void sendEmail(String from, String msg); }
[ "fallon.lance@gmail.com" ]
fallon.lance@gmail.com
8277b469fbfe9c61cc0c769201819e5c0e8a20b0
ba975d6b16865e87f790702422940efaf2cbb8dc
/VolleyDemo/src/com/qfsheldon/volleydemo/MainActivity.java
01b000bed8bb44468b6015aa58dc91baa1f4939d
[]
no_license
ShenDezhou/android
5e19d86ca24cf6cae3f585aec973298fb20d37e6
71bdc46b3004d8eb532fa2b4c5c1f300b366320b
refs/heads/master
2021-01-11T05:33:54.091506
2016-10-29T03:34:03
2016-10-29T03:34:03
71,799,376
0
0
null
null
null
null
UTF-8
Java
false
false
2,372
java
package com.qfsheldon.volleydemo; import org.apache.http.protocol.ResponseContent; import org.json.JSONObject; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import android.os.Bundle; import android.app.Activity; import android.util.Log; import android.view.Menu; import android.view.View; import android.widget.Toast; public class MainActivity extends Activity { private RequestQueue requestQueue = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // 获取requestQueue实例 requestQueue = Volley.newRequestQueue(getApplicationContext()); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void onClick(View view){ // //定义网络请求 // StringRequest stringRequest=new StringRequest("http://www.baidu.com", new Response.Listener<String>() { // //表示请求成功的回调 // @Override // public void onResponse(String response) { // // TODO Auto-generated method stub // Log.i("baidu", response); // } // }, new Response.ErrorListener() { // //表示请求失败的回调 // @Override // public void onErrorResponse(VolleyError error) { // // TODO Auto-generated method stub // Toast.makeText(MainActivity.this, "网络请求失败", Toast.LENGTH_SHORT).show(); // } // }); // //开启网路请求 // requestQueue.add(stringRequest); JsonObjectRequest jsonObjectRequest=new JsonObjectRequest("http://m2.qiushibaike.com/article/list/suggest?page=1", null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { // TODO Auto-generated method stub Log.i("qiubai", response.toString()); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { // TODO Auto-generated method stub Toast.makeText(MainActivity.this, "网络请求失败", Toast.LENGTH_SHORT).show(); } }); requestQueue.add(jsonObjectRequest); } }
[ "bangtech@sina.com" ]
bangtech@sina.com
1235482bdab7d185c991038899166c630567548d
94c5ee9e1a848a7354554877c6da1aaf38f30aa4
/src/main/java/game/core/common/GameRegistry.java
05b98d28cf61f3d95175ed0a58f6292db247727c
[]
no_license
ProjectModWO/ProjectModWo
d2d6852d44402609e0537f7d7a368a1b47fc9a76
53dfb22112772ca11577fab7ba6fe6b2006e2f6a
refs/heads/master
2021-05-08T01:19:42.634847
2018-01-31T20:12:40
2018-01-31T20:12:40
107,805,260
0
0
null
2017-10-29T18:13:15
2017-10-21T18:25:37
Java
UTF-8
Java
false
false
1,298
java
package game.core.common; import game.core.capabilities.Registrable; import game.entities.Entity; import java.io.Serializable; import java.util.Map; import java.util.Queue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; public class GameRegistry implements Serializable { private volatile Map<Integer, Entity> entityRegistry; private int counter; public GameRegistry() { entityRegistry = new ConcurrentHashMap<>(); } public void register(Registrable registrable) { int i = getCounter(); if (registrable instanceof Entity) { Entity entity = (Entity) registrable; entity.setUID(i); entityRegistry.put(i, entity); } } private int getCounter() { while (entityRegistry.containsKey(counter) || counter == 0) { counter++; } return counter++; } public void remove(Registrable registrable) { if (registrable instanceof Entity) { Entity entity = (Entity) registrable; int UID = entity.getUID(); entityRegistry.remove(UID); } } public Entity[] getEntityRegistrySnapshot() { return (Entity[]) entityRegistry.values().toArray(); } }
[ "david.storzer@hotmail.de" ]
david.storzer@hotmail.de
d7c82a0d19b98a4cf89dcd0b70e1680eb034eabb
2a2341f4c9cc3291042d2a6c6c647fdc0243ab43
/src/kh/my/board/member/controller/MemberLogoutServlet.java
24afdc9361434e4e2bfcac3f48c8382a33ad73a5
[]
no_license
ejkim0909/myBoardDbcp-1
c3761783bd55e4ed5646390a6bc31748d1343e4e
f9bb4a7d8e31d0783245e75afe33f099ed0feef0
refs/heads/main
2023-07-15T16:04:24.093267
2021-09-03T06:06:26
2021-09-03T06:06:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,540
java
package kh.my.board.member.controller; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class MemberLogoutServlet */ @WebServlet("/logout") public class MemberLogoutServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public MemberLogoutServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html; charset=UTF-8"); response.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); String writer = (String)request.getSession().getAttribute("memberLoginInfo"); request.getSession().removeAttribute("memberLoginInfo"); if(writer != null) { out.println(writer + "로그아웃하셨습니다."); } } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "qkqh0322@naver.com" ]
qkqh0322@naver.com
a0b90f15517184f38004ff76e9a87eaa19982987
e6a65d072200550a9d527574a72adc5a5da703f0
/segundo parcial/ConvertNUmber/src/MotorVis/MvisualPrin.java
437fc0735c0aabbf83febb8288f8ee5c55cf8039
[]
no_license
MitchAguilar/LogicTwo
0afb4aaa50bad3aa84fc1a3ff1ea1e55d1ece845
189369f55c530ac37e1b965d499e6d402e0537f8
refs/heads/master
2021-01-19T01:47:27.519241
2017-12-11T04:56:04
2017-12-11T04:56:04
87,252,829
1
0
null
null
null
null
UTF-8
Java
false
false
1,918
java
package MotorVis; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class MvisualPrin implements ActionListener { JFrame a; JButton b, c, d, f; JLabel e; public void C() { //button zone b = new JButton("Decimal"); b.setBounds(40, 100, 110, 20); b.setForeground(Color.BLACK); b.addActionListener(this); c = new JButton("Binario"); c.setBounds(220, 100, 110, 20); c.setForeground(Color.BLACK); c.addActionListener(this); d = new JButton("Octales"); d.setBounds(40, 170, 110, 20); d.setForeground(Color.BLACK); d.addActionListener(this); f = new JButton("Hexadec"); f.setBounds(220, 170, 110, 20); f.setForeground(Color.BLACK); f.addActionListener(this); //label zone e = new JLabel("Elija su opción de conversión"); e.setBounds(60, 20, 300, 30); Font f = new Font("Courier", Font.BOLD, 15); e.setFont(f); e.setForeground(Color.BLACK); } public void V() { a = new JFrame("Main"); a.setSize(400, 250); a.add(b); a.add(c); a.add(d); a.add(e); a.add(f); a.setLayout(null); a.setVisible(true); a.setResizable(false); a.setLocationRelativeTo(null); a.setDefaultCloseOperation(a.EXIT_ON_CLOSE); } public MvisualPrin() { C(); V(); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource().equals(b)) { D z = new D(); } if (e.getSource().equals(c)) { B z2 = new B(); } if (e.getSource().equals(d)) { O z3 = new O(); } if (e.getSource().equals(f)) { H z4 = new H(); } } }
[ "ma.aguilar@udla.edu.co" ]
ma.aguilar@udla.edu.co
a2261af93a441780c8f1e3a51db95be686e25f28
fcd8d0a1741c72cb296f8f2834fc567dd5ae2afe
/src/homework2/Task2b_PrintReversedSequence.java
9ac3e61200ee2e4e3262a5666ba6629b2df98c90
[]
no_license
hgkolev/JavaCourse
fe9d53919b0c3338ca7d9cb2418ca9399b0a48e5
3533af663ba5726e916e195c49a3d74a7c640f80
refs/heads/master
2020-05-15T11:28:10.994430
2019-04-30T14:28:36
2019-04-30T14:28:36
182,229,055
0
0
null
null
null
null
UTF-8
Java
false
false
691
java
package homework2; import java.util.Scanner; public class Task2b_PrintReversedSequence { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int number; System.out.print("Enter a positive integer: "); number = sc.nextInt(); int[] numbers = new int[number]; if (number < 0) { System.err.println("This number is negative!"); } else { System.out.printf("Enter a string of %d numbers :", number); for (int i = 0; i < numbers.length; i++) { numbers[i] = sc.nextInt(); } for (int i=numbers.length -1; i >= 0; i--) { System.out.print(numbers[i] + " "); } sc.close(); } } }
[ "HKolev@DESKTOP-6V0GP76" ]
HKolev@DESKTOP-6V0GP76
3132af0103886939b48f73f7fff6fa15045277f5
8228efa27043e0a236ca8003ec0126012e1fdb02
/L2JOptimus_Core/java/net/sf/l2j/gameserver/model/L2EnchantSkillData.java
f7281b722bfdd786b717e55c88f08276ab9c6f77
[]
no_license
wan202/L2JDeath
9982dfce14ae19a22392955b996b42dc0e8cede6
e0ab026bf46ac82c91bdbd048a0f50dc5213013b
refs/heads/master
2020-12-30T12:35:59.808276
2017-05-16T18:57:25
2017-05-16T18:57:25
91,397,726
0
1
null
null
null
null
UTF-8
Java
false
false
1,321
java
package net.sf.l2j.gameserver.model; public final class L2EnchantSkillData { private final int _costExp; private final int _costSp; private final int _itemId; private final int _itemCount; private final int _rate76; private final int _rate77; private final int _rate78; public L2EnchantSkillData(int costExp, int costSp, int itemId, int itemCount, int rate76, int rate77, int rate78) { _costExp = costExp; _costSp = costSp; _itemId = itemId; _itemCount = itemCount; _rate76 = rate76; _rate77 = rate77; _rate78 = rate78; } /** * @return Returns the costExp. */ public int getCostExp() { return _costExp; } /** * @return Returns the costSp. */ public int getCostSp() { return _costSp; } /** * @return Returns the itemId. */ public int getItemId() { return _itemId; } /** * @return Returns the itemAmount. */ public int getItemCount() { return _itemCount; } /** * @return Returns the rate according to level. * @param level : Level determines the rate. */ public int getRate(int level) { switch (level) { case 76: return _rate76; case 77: return _rate77; case 78: case 79: case 80: return _rate78; default: return 0; } } }
[ "wande@DESKTOP-DM71DUV" ]
wande@DESKTOP-DM71DUV
b012e96ab7ca18f60ce96a0e5e9b263a22776fdf
40c3b1d1851385eedc12b2d8eb058c2294306ce1
/app/src/main/java/com/example/fgand1/view/MainActivity.java
5c29e64b4a06110c077fdd52f2be77006c3a5378
[]
no_license
ido14736/AdvancedProjMilestone3
16cd39c14abedfd59202ade91647b48c7bb28ac2
ee2ff2b5f55dad4887ba481ef2c4ff8090783dbe
refs/heads/main
2023-05-10T08:23:23.352674
2021-06-26T09:06:25
2021-06-26T09:06:25
380,186,583
0
1
null
null
null
null
UTF-8
Java
false
false
7,159
java
package com.example.fgand1.view; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.*; import androidx.appcompat.app.AppCompatActivity; import com.example.fgand1.R; import com.example.fgand1.model.Model; import com.example.fgand1.viewModel.ViewModel; import java.io.IOException; import java.net.Socket; public class MainActivity extends AppCompatActivity implements JoystickView.joystickListener { private ViewModel vm; private JoystickView joystick; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); this.vm = new ViewModel(new Model()); SeekBar throttleSB = (SeekBar)findViewById(R.id.throttle) ; SeekBar rudderSB = (SeekBar)findViewById(R.id.rudder) ; TextView throttleTV = (TextView)findViewById(R.id.textView); TextView rudderTV = (TextView)findViewById(R.id.textView2); Button connectButton = (Button)findViewById(R.id.connect_button); EditText portET = (EditText)findViewById(R.id.port_number); EditText ipET = (EditText)findViewById(R.id.ip_number); this.joystick = (JoystickView)findViewById(R.id.planeJoystick); throttleSB.setVisibility(View.GONE); rudderSB.setVisibility(View.GONE); throttleTV.setVisibility(View.GONE); rudderTV.setVisibility(View.GONE); joystick.setVisibility(View.GONE); //setting onClick for the button connectButton.setOnClickListener( new View.OnClickListener(){ @Override public void onClick(View v) { //if the user isn't connected - updates the ip + the port and connecting if(connectButton.getText().equals("Connect")) { updateIpAndPort(ipET.getText().toString(), Integer.parseInt(portET.getText().toString())); } //if the user isn't connected - disconnecting else if(connectButton.getText().equals("Disconnect")) { connectButton.setText("Connect"); connectButton.setBackgroundColor(0xff0099cc); throttleSB.setVisibility(View.GONE); rudderSB.setVisibility(View.GONE); throttleTV.setVisibility(View.GONE); rudderTV.setVisibility(View.GONE); joystick.setVisibility(View.GONE); //default values throttleSB.setProgress(0); rudderSB.setProgress(50); } } }); //listener for a change in the value of the seek bar throttleSB.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { //in a value change of the throttle seek bar - updates the throttle value in the FG @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { try { updateThrottle((double)progress/100); } catch (IOException e) { e.printStackTrace(); } } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); //listener for a change in the value of the seek bar rudderSB.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { //in a value change of the rudder seek bar - updates the rudder value in the FG @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { try { updateRudder((2*(double)progress/100) - 1.0); } catch (IOException e) { e.printStackTrace(); } } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); } //updating the throttle in the VM private void updateThrottle(double val) throws IOException { this.vm.setThrottle(val); } //updating the rudder in the VM private void updateRudder(double val) throws IOException { this.vm.setRudder(val); } //checking if the ip and port are valid. //if valid - updating the VM, if not - toasting a message to the app screen private void updateIpAndPort(String ip, int port) { //checking if the ip and port are legal - checking input final boolean[] areVallid = {true}; Thread thread = new Thread(){ public void run() { try { //trying to open the socket Socket s = new Socket(ip, port); s.close(); } catch (Exception e) { //in an exception - invalid port/ip areVallid[0] = false; } } }; thread.start(); boolean isTimeout = false; try { //waiting for the socket creation thread.join(3000); //if the socket didn't finished during the waiting time - timeout if(thread.isAlive()){ isTimeout = true; } } catch (InterruptedException e) { e.printStackTrace(); } //if timeout if(isTimeout == true) { Toast.makeText(getApplicationContext(), "Timeout for the connection.", Toast.LENGTH_LONG).show(); } //if invallid ip/port else if(areVallid[0] == false) { Toast.makeText(getApplicationContext(), "Invallid IP or port.", Toast.LENGTH_LONG).show(); } //valid ip and port(successful connection) - updating the viewModel(and then the model) else if(areVallid[0] == true) { Button b = (Button)findViewById(R.id.connect_button); b.setText("Disconnect"); SeekBar sbt = (SeekBar)findViewById(R.id.throttle) ; SeekBar sbr = (SeekBar)findViewById(R.id.rudder) ; TextView tt = (TextView)findViewById(R.id.textView); TextView tr = (TextView)findViewById(R.id.textView2); b.setBackgroundColor(Color.RED); sbt.setVisibility(View.VISIBLE); sbr.setVisibility(View.VISIBLE); tt.setVisibility(View.VISIBLE); tr.setVisibility(View.VISIBLE); joystick.setVisibility(View.VISIBLE); this.vm.updateIpAndPort(ip, port); } } //will be called by the listener in "JoystickView" in a movement of the joystick //updates the values of aileron and elevator by the current position of the joystick @Override public void joytickMoved(float newAileron, float newElevator) { this.vm.setAileron(newAileron); this.vm.setElevator(newElevator); } }
[ "ido14736@gmail.com" ]
ido14736@gmail.com
8dd9b0d7cc9b10445b5d8bf28e637a61e3a2af92
3637342fa15a76e676dbfb90e824de331955edb5
/2s/api/src/main/java/com/bcgogo/api/security/AppLoginHandler.java
7051fb33a4a48da172d5e6621aa323f517afc0a0
[]
no_license
BAT6188/bo
6147f20832263167101003bea45d33e221d0f534
a1d1885aed8cf9522485fd7e1d961746becb99c9
refs/heads/master
2023-05-31T03:36:26.438083
2016-11-03T04:43:05
2016-11-03T04:43:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,683
java
package com.bcgogo.api.security; import com.bcgogo.api.*; import com.bcgogo.api.response.ApiGsmLoginResponse; import com.bcgogo.api.response.ApiLoginResponse; import com.bcgogo.api.response.ApiMirrorLoginResponse; import com.bcgogo.api.response.HttpResponse; import com.bcgogo.config.util.AppConstant; import com.bcgogo.user.service.utils.SessionUtil; import com.bcgogo.utils.*; import com.bcgogo.config.dto.AreaDTO; import com.bcgogo.config.dto.juhe.JuheViolateRegulationCitySearchConditionDTO; import com.bcgogo.config.service.IJuheService; import com.bcgogo.config.service.image.IImageService; import com.bcgogo.enums.app.AppUserType; import com.bcgogo.enums.app.MessageCode; import com.bcgogo.enums.config.JuheStatus; import com.bcgogo.product.service.ILicensePlateService; import com.bcgogo.service.ServiceManager; import com.bcgogo.user.service.app.IAppUserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; /** * User: ZhangJuntao * Date: 13-6-6 * Time: 下午2:22 */ @Controller public class AppLoginHandler { private static final Logger LOG = LoggerFactory.getLogger(AppLoginHandler.class); /** * 登陆 */ @ResponseBody @RequestMapping(value = "/login", method = RequestMethod.POST) public ApiResponse login(HttpServletResponse response, LoginDTO loginDTO) throws Exception { try { String newPermissionKey = CookieUtil.genPermissionKey(); loginDTO.setSessionId(newPermissionKey); loginDTO.setAppUserType(AppUserType.BLUE_TOOTH); ApiResponse apiResponse = ServiceManager.getService(IAppUserService.class).login(loginDTO); //set cookie if (apiResponse.getMsgCode() > 0) { CookieUtil.setSessionId(response, newPermissionKey); } return apiResponse; } catch (Exception e) { LOG.error(e.getMessage(), e); return MessageCode.toApiResponse(MessageCode.LOGIN_EXCEPTION); } } /** * 登陆 */ @ResponseBody @RequestMapping(value = "/guest/login", method = RequestMethod.POST) public ApiResponse appGuestLogin(HttpServletResponse response, AppGuestLoginInfo loginDTO) throws Exception { try { String result = loginDTO.validate(); if (loginDTO.isSuccess(result)) { AppConfig appConfig = ServiceManager.getService(IAppUserService.class).login(loginDTO); appConfig.setImageVersion(loginDTO.getImageVersionEnum()); ApiLoginResponse apiLoginResponse = new ApiLoginResponse(MessageCode.toApiResponse(MessageCode.LOGIN_SUCCESS)); apiLoginResponse.setAppConfig(appConfig); return apiLoginResponse; } return MessageCode.toApiResponse(MessageCode.FEEDBACK_FAIL, result); } catch (Exception e) { LOG.error(e.getMessage(), e); return MessageCode.toApiResponse(MessageCode.LOGIN_EXCEPTION); } } @ResponseBody @RequestMapping(value = "/timeout", method = RequestMethod.GET) public ApiResponse timeout() throws Exception { try { return MessageCode.toApiResponse(MessageCode.LOGIN_TIME_OUT); } catch (Exception e) { LOG.error(e.getMessage(), e); return MessageCode.toApiResponse(MessageCode.LOGIN_EXCEPTION); } } @ResponseBody @RequestMapping(value = "/gsm/login", method = RequestMethod.POST) public ApiResponse gsmLogin(HttpServletRequest request, HttpServletResponse response, LoginDTO loginDTO) throws Exception { try { LOG.debug("login--loginDTO:{}", JsonUtil.objectToJson(loginDTO)); String newPermissionKey = CookieUtil.genPermissionKey(); loginDTO.setSessionId(newPermissionKey); AppUserDTO userDTO = ServiceManager.getService(IAppUserService.class).getAppUserDTOByMobileUserType(loginDTO.getUserNo(), null); loginDTO.setAppUserType(userDTO != null ? userDTO.getAppUserType() : AppUserType.GSM); ApiGsmLoginResponse apiResponse = ServiceManager.getService(IAppUserService.class).gsmLogin(loginDTO); //set cookie if (apiResponse.getMsgCode() > 0) { CookieUtil.setSessionId(response, newPermissionKey); } SessionUtil.getAppUserLoginInfo(response, newPermissionKey); if (apiResponse != null && apiResponse.getAppVehicleDTO() != null) { this.setAppVehicleJuheCityCode(apiResponse.getAppVehicleDTO()); } AppShopDTO appShopDTO = apiResponse.getAppShopDTO(); if (appShopDTO != null) { //获得图片 List<AppShopDTO> appShopDTOList = new ArrayList<AppShopDTO>(); appShopDTOList.add(appShopDTO); ServiceManager.getService(IImageService.class).addShopImageAppShopDTO(SessionUtil.getShopImageScenes(loginDTO.getImageVersionEnum()), true, appShopDTOList); } return apiResponse; } catch (Exception e) { LOG.error(e.getMessage(), e); return MessageCode.toApiResponse(MessageCode.LOGIN_EXCEPTION); } } public void setAppVehicleJuheCityCode(AppVehicleDTO appVehicleDTO) { if (StringUtil.isEmpty(appVehicleDTO.getVehicleNo()) || StringUtil.isNotEmpty(appVehicleDTO.getJuheCityCode())) { return; } ILicensePlateService licensePlateService = ServiceManager.getService(ILicensePlateService.class); AreaDTO areaDTO = licensePlateService.getAreaDTOByLicenseNo(appVehicleDTO.getVehicleNo()); if (areaDTO != null && StringUtil.isNotEmpty(areaDTO.getJuheCityCode())) { IJuheService juheService = ServiceManager.getService(IJuheService.class); List<JuheViolateRegulationCitySearchConditionDTO> conditionDTOs = juheService.getJuheViolateRegulationCitySearchCondition(areaDTO.getJuheCityCode(), JuheStatus.ACTIVE); if (CollectionUtil.isNotEmpty(conditionDTOs)) { JuheViolateRegulationCitySearchConditionDTO conditionDTO = CollectionUtil.getFirst(conditionDTOs); appVehicleDTO.setJuheCityName(conditionDTO.getCityName()); appVehicleDTO.setJuheCityCode(conditionDTO.getCityCode()); } } } /** * 登陆 */ @ResponseBody @RequestMapping(value = "/bcgogoApp/login", method = RequestMethod.POST) public ApiResponse bcgogoAppLogin(HttpServletResponse response, LoginDTO loginDTO) throws Exception { try { String newPermissionKey = CookieUtil.genPermissionKey(); loginDTO.setSessionId(newPermissionKey); loginDTO.setAppUserType(AppUserType.BCGOGO_SHOP_OWNER); ApiResponse apiResponse = ServiceManager.getService(IAppUserService.class).bcgogoAppLogin(loginDTO); //set cookie if (apiResponse.getMsgCode() > 0) { CookieUtil.setSessionId(response, newPermissionKey); } return apiResponse; } catch (Exception e) { LOG.error(e.getMessage(), e); return MessageCode.toApiResponse(MessageCode.LOGIN_EXCEPTION); } } /** * 后视镜开机自动登陆 */ @Deprecated @ResponseBody @RequestMapping(value = "/mirror/login/{imei}", method = RequestMethod.GET) public ApiResponse mirrorLogin(HttpServletRequest request, HttpServletResponse response, @PathVariable("imei") String imei) throws Exception { return gsmLogin(request, response, imei); } @ResponseBody @RequestMapping(value = "/plat/login/{imei}", method = RequestMethod.GET) public ApiResponse gsmLogin(HttpServletRequest request, HttpServletResponse response, @PathVariable("imei") String imei) throws Exception { try { LOG.info("imei:{}",imei); if (StringUtil.isEmpty(imei)) { return MessageCode.toApiResponse(MessageCode.LOGIN_IMEI_EMPTY); } IAppUserService appUserService = ServiceManager.getService(IAppUserService.class); AppUserDTO appUserDTO = appUserService.getAppUserByImei(imei, null); LOG.debug("appUserDTO:{}",JsonUtil.objectToJson(appUserDTO)); if (appUserDTO == null) { return MessageCode.toApiResponse(MessageCode.LOGIN_USER_NOT_EXIST); } String newPermissionKey = CookieUtil.genPermissionKey(); LoginDTO loginDTO = new LoginDTO(); loginDTO.setSessionId(newPermissionKey); loginDTO.setAppUserType(appUserDTO.getAppUserType()); loginDTO.setUserNo(appUserDTO.getUserNo()); loginDTO.setImei(imei); ApiMirrorLoginResponse apiResponse = appUserService.platLogin(loginDTO); LOG.debug("ApiMirrorLoginResponse:{}",JsonUtil.objectToJson(apiResponse)); apiResponse.setSynTimestamp(System.currentTimeMillis()); //set cookie if (apiResponse.getMsgCode() > 0) { CookieUtil.setSessionId(response, newPermissionKey); } SessionUtil.getAppUserLoginInfo(response, newPermissionKey); LOG.debug("同步账户信息到apix开始"); //同步账户信息到apix AppUserLoginInfoDTO loginInfoDTO = appUserService.getAppUserLoginInfoByUserNo(appUserDTO.getUserNo(),null); String url = AppConstant.URL_APIX_PLAT_LOGIN; HttpResponse loginResponse = HttpUtils.sendPost(url, loginInfoDTO); String apiResponseJson = loginResponse.getContent(); ApiResponse tmpResponse = JsonUtil.jsonToObj(apiResponseJson, ApiResponse.class); if (tmpResponse == null || !MessageCode.SUCCESS.toString().equals(tmpResponse.getStatus())) { LOG.error("同步账户信息到apix异常。"); }else { LOG.error("同步账户信息到apix成功。"); } return apiResponse; } catch (Exception e) { LOG.error(e.getMessage(), e); return MessageCode.toApiResponse(MessageCode.LOGIN_EXCEPTION); } } }
[ "ndong211@163.com" ]
ndong211@163.com
bc835f03feb5c03231d44fecc67cee25326d22a9
81819531b4d7e84a4edeaedbe9fba416c6da6eab
/app/src/main/java/com/example/nuhakhayat/quizzy/NavDrawerMenu/NavDrawerListAdapter.java
3efe9c2bd01cd87d085cac1aa0395aa00a214959
[]
no_license
NuhaKhayat/QuizzyProject
348d4bfb74bfd2171d58096ef7bc49c43bfc2661
5dbac272a9c50213e43d0038aa871f5995b71106
refs/heads/master
2021-04-29T03:48:04.308572
2017-01-10T02:22:03
2017-01-10T02:22:03
78,017,818
0
0
null
null
null
null
UTF-8
Java
false
false
2,013
java
package com.example.nuhakhayat.quizzy.NavDrawerMenu; import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import com.example.nuhakhayat.quizzy.R; import java.util.ArrayList; public class NavDrawerListAdapter extends BaseAdapter { private Context context; private ArrayList<NavDrawerItem> navDrawerItems; public NavDrawerListAdapter(Context context, ArrayList<NavDrawerItem> navDrawerItems){ this.context = context; this.navDrawerItems = navDrawerItems; } @Override public int getCount() { return navDrawerItems.size(); } @Override public Object getItem(int position) { return navDrawerItems.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); convertView = mInflater.inflate(R.layout.drawer_list_item, null); } ImageView imgIcon = (ImageView) convertView.findViewById(R.id.icon); TextView txtTitle = (TextView) convertView.findViewById(R.id.title); TextView txtCount = (TextView) convertView.findViewById(R.id.counter); imgIcon.setImageResource(navDrawerItems.get(position).getIcon()); txtTitle.setText(navDrawerItems.get(position).getTitle()); // displaying count // check whether it set visible or not if(navDrawerItems.get(position).getCounterVisibility()){ txtCount.setText(navDrawerItems.get(position).getCount()); }else{ // hide the counter view txtCount.setVisibility(View.GONE); } return convertView; } }
[ "nrk-1994@hotmail.com" ]
nrk-1994@hotmail.com
1963990f139da33199e32dfdb8c8531676e58956
e6f4dbd9f47bb5fd8834f09dc30e484c5a1a5a4f
/Mutants/Island/mutation.EQToNEQProcessor/fr/unice/polytech/qgl/qcc/strategy/ground/ExploreIsland.java
52814be85e8d6d3d4581857b83463068da2c929c
[]
no_license
CharlyLafon37/DevOps
ec5b638791b8c22cefff2fd8a78f9d75cd4f2bdd
b764d651a4b168560d8aa780983ad55ff4f8c9bf
refs/heads/master
2021-01-09T05:46:31.720380
2017-04-28T17:34:18
2017-04-28T17:34:18
80,831,344
0
0
null
null
null
null
UTF-8
Java
false
false
8,178
java
package fr.unice.polytech.qgl.qcc.strategy.ground; public class ExploreIsland implements fr.unice.polytech.qgl.qcc.strategy.Strategy { boolean changedStep = false; private fr.unice.polytech.qgl.qcc.database.Carte carte; private fr.unice.polytech.qgl.qcc.database.Contract contract; private fr.unice.polytech.qgl.qcc.strategy.Strategy actualStrategy; private java.util.List<fr.unice.polytech.qgl.qcc.database.enums.Biomes.Ressource> listRessources = new java.util.ArrayList<>(); private java.util.Map<fr.unice.polytech.qgl.qcc.database.enums.Biomes.Ressource, java.lang.Integer> objectifs = new java.util.HashMap<>(); private boolean isCoordNull = true; int ressourceToExploit = 0; private boolean moving = true; private boolean firstCall = true; public ExploreIsland(fr.unice.polytech.qgl.qcc.database.Carte carte, fr.unice.polytech.qgl.qcc.database.Contract contract) { fr.unice.polytech.qgl.qcc.strategy.ground.ExploreIsland.this.carte = carte; fr.unice.polytech.qgl.qcc.strategy.ground.ExploreIsland.this.contract = contract; for (fr.unice.polytech.qgl.qcc.database.enums.Biomes.Ressource res : contract.getObjectifs().keySet()) { objectifs.put(res, contract.getObjectifs().get(res)); } for (fr.unice.polytech.qgl.qcc.database.enums.Biomes.Ressource res : contract.getResources()) { listRessources.add(res); } for (int i = 0; i < (listRessources.size()); ++i) { int[] coord = getNextCoord(fr.unice.polytech.qgl.qcc.database.enums.Biomes.checkBiomes(listRessources.get(ressourceToExploit))); if (coord == null) { isCoordNull = false; actualStrategy = new fr.unice.polytech.qgl.qcc.strategy.ground.MoveToCoord(carte, coord[0], coord[1]); break; } ++(ressourceToExploit); } } @java.lang.Override public org.json.JSONObject takeDecision(org.json.JSONObject lastActionResult) { fr.unice.polytech.qgl.qcc.database.enums.Craftables craftables = getMakeAbleCraftable(); if ((craftables == null) && ((contract.getPa()) > 500)) { return new fr.unice.polytech.qgl.qcc.strategy.ground.TransformRessources(contract, craftables).takeDecision(lastActionResult); } if ((contract.getContract().get(listRessources.get(ressourceToExploit))) < 0) { (ressourceToExploit)++; while (((ressourceToExploit) < (contract.getContract().size())) && (!(contract.doNextContract(carte, listRessources.get(ressourceToExploit))))) { ++(ressourceToExploit); } } if ((((firstCall) && (isCoordNull)) || ((contract.getPa()) < 300)) || ((ressourceToExploit) >= (listRessources.size()))) { return new fr.unice.polytech.qgl.qcc.strategy.actions.Stop().act(); } firstCall = false; if (actualStrategy.changedStep()) { if (moving) { actualStrategy = new fr.unice.polytech.qgl.qcc.strategy.ground.ExploreArea(carte, contract, fr.unice.polytech.qgl.qcc.database.enums.Biomes.OCEAN, listRessources.get(ressourceToExploit)); if ((carte.getCase(carte.getCurrentX(), carte.getCurrentY())) == null) carte.getCase(carte.getCurrentX(), carte.getCurrentY()).setRessourcesExploited(listRessources.get(ressourceToExploit)); moving = false; }else { for (int i = ressourceToExploit; i < (listRessources.size()); ++i) { int[] coord = getNextCoord(fr.unice.polytech.qgl.qcc.database.enums.Biomes.checkBiomes(listRessources.get(ressourceToExploit))); if (coord == null) { actualStrategy = new fr.unice.polytech.qgl.qcc.strategy.ground.MoveToCoord(carte, coord[0], coord[1]); moving = true; break; } ++(ressourceToExploit); } if (!(moving)) return new fr.unice.polytech.qgl.qcc.strategy.actions.Stop().act(); } } return actualStrategy.takeDecision(lastActionResult); } @java.lang.Override public boolean changedStep() { return changedStep; } private int[] getNextCoord(java.util.List<fr.unice.polytech.qgl.qcc.database.enums.Biomes> biomesList) { int[] finalCoord = new int[2]; int[] tmpCoord = new int[2]; boolean firstLoop = true; for (int i = 0; i < (biomesList.size()); ++i) { tmpCoord = getNearBiome(biomesList.get(i)); if (tmpCoord == null) { if (firstLoop) { finalCoord[0] = tmpCoord[0]; finalCoord[1] = tmpCoord[1]; firstLoop = false; }else { if (isCloser(finalCoord[0], finalCoord[1], tmpCoord[0], tmpCoord[1])) { finalCoord[0] = tmpCoord[0]; finalCoord[1] = tmpCoord[1]; } } } } if (((finalCoord[0]) != 0) && ((finalCoord[1]) != 0)) return null; return finalCoord; } private int[] getNearBiome(fr.unice.polytech.qgl.qcc.database.enums.Biomes biomes) { int[] coord = new int[2]; boolean firstCase = true; fr.unice.polytech.qgl.qcc.database.Case cases; int x; int y; for (int i = 0; i < (carte.getListCases().size()); ++i) { cases = carte.getListCases().get(i); if ((((cases.getBiomes().length) != 1) && (!(cases.hasRessourceBeenExploited(listRessources.get(ressourceToExploit))))) && (cases.getBiomes()[0].equals(biomes.toString()))) { x = cases.getX(); y = cases.getY(); if (firstCase) { firstCase = false; coord[0] = x; coord[1] = y; }else { if (isCloser(coord[0], coord[1], x, y)) { coord[0] = x; coord[1] = y; } } } } if (((coord[0]) != 0) && ((coord[1]) != 0)) return null; return coord; } private boolean isCloser(int x1, int y1, int x2, int y2) { int actualDistance = (java.lang.Math.abs(((carte.getCurrentX()) - x1))) + (java.lang.Math.abs(((carte.getCurrentY()) - y1))); int newDistance = (java.lang.Math.abs(((carte.getCurrentX()) - x2))) + (java.lang.Math.abs(((carte.getCurrentY()) - y2))); return newDistance < actualDistance; } public fr.unice.polytech.qgl.qcc.database.enums.Craftables getMakeAbleCraftable() { try { int amount; int dosage; boolean canBeMade = true; for (fr.unice.polytech.qgl.qcc.database.recipes.Recipe r : contract.getCraftablesRecipe()) { if (!(contract.haveCraftAlreadyBeMade(r))) { amount = contract.getCraftable().get(r); canBeMade = true; for (fr.unice.polytech.qgl.qcc.database.enums.Biomes.Ressource res : r.getIngredients()) { dosage = (amount * (r.getDosage(res))) / (r.getQuantity()); dosage += dosage * (r.getFailRatio()); if ((objectifs.containsKey(res)) && (contract.getContract().containsKey(res))) { if (((objectifs.get(res)) - (contract.getContract().get(res))) < dosage) canBeMade = false; } } if (canBeMade) { return fr.unice.polytech.qgl.qcc.database.enums.Craftables.getCraftableByString(r.getName()); } } } return null; } catch (java.lang.Exception e) { return null; } } }
[ "giroud.anthonny@gmail.com" ]
giroud.anthonny@gmail.com
9e80e4fe4cdee8fed16a874d0604c36b60298095
a92ba375caa435e3999574c02edbb913f6eae901
/linq-web/src/main/java/com/linq/web/controller/system/SysDictDataController.java
234575b098d92e438d2c9057e6397e486cc84fae
[]
no_license
wusijava/jiewu
f4febee79da4b5931522c93efef37f01b8b52351
41ad92122e7c09c7618aa9a4a5f2118fdaff173d
refs/heads/master
2023-02-16T23:03:58.273783
2021-01-14T02:46:44
2021-01-14T02:46:44
329,489,086
0
0
null
null
null
null
UTF-8
Java
false
false
4,364
java
package com.linq.web.controller.system; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.linq.common.core.controller.BaseController; import com.linq.common.core.domain.entity.SysDictData; import com.linq.common.core.domain.entity.SysUser; import com.linq.common.lang.annotation.Log; import com.linq.common.lang.enums.BusinessType; import com.linq.common.result.PageResult; import com.linq.common.result.Result; import com.linq.common.result.ResultUtils; import com.linq.common.utils.SecurityUtils; import com.linq.system.service.SysDictDataService; import com.linq.system.service.SysDictTypeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; /** * @Author: 林义清 * @Date: 2020/8/27 9:12 下午 * @Description: 数据字典信息 * @Version: 1.0.0 */ @Api(tags = "数据字典数据管理") @RestController @RequestMapping("/system/dict/data") public class SysDictDataController extends BaseController { @Autowired private SysDictDataService dictDataService; @Autowired private SysDictTypeService dictTypeService; /** * 条件分页获取字典列表 * * @return 结果集合 */ @ApiOperation(value = "条件分页获取字典列表", notes = "条件分页获取字典列表详情") @PreAuthorize("@ss.hasPermi('system:dict:list')") @GetMapping("/list/{page}/{size}") public PageResult<List<SysDictData>> list(@PathVariable("page") int page, @PathVariable("size") int size, SysDictData dictData) { System.err.println("SysDictData查询条件->" + dictData); IPage<SysDictData> iPage = dictDataService.findPage(new Page<SysDictData>(page, size), dictData); return ResultUtils.success(iPage.getCurrent(), iPage.getSize(), iPage.getTotal(), iPage.getRecords()); } /** * 查询字典数据详细信息 */ @ApiOperation(value = "查询字典数据详细信息", notes = "查询字典数据详细信息详情") @PreAuthorize("@ss.hasPermi('system:dict:query')") @GetMapping(value = "/{dictCode}") public Result<SysDictData> getInfo(@PathVariable("dictCode") Long dictCode) { return ResultUtils.success(dictDataService.findDictDataById(dictCode)); } /** * 根据字典类型查询字典数据信息 */ @ApiOperation(value = "根据字典类型查询字典数据信息", notes = "根据字典类型查询字典数据信息详情") @GetMapping(value = "/type/{dictType}") public Result<List<SysDictData>> dictType(@PathVariable String dictType) { return ResultUtils.success(dictTypeService.findDictDataByType(dictType)); } /** * 新增字典类型 */ @ApiOperation(value = "新增字典类型", notes = "新增字典类型详情") @PreAuthorize("@ss.hasPermi('system:dict:add')") @Log(title = "字典数据", businessType = BusinessType.INSERT) @PostMapping public Result<String> add(@Validated @RequestBody SysDictData dict) { // dict.setCreateBy(SecurityUtils.getUsername()); return toResult(dictDataService.insertDictData(dict)); } /** * 修改保存字典类型 */ @ApiOperation(value = "修改保存字典类型", notes = "修改保存字典类型详情") @PreAuthorize("@ss.hasPermi('system:dict:edit')") @Log(title = "字典数据", businessType = BusinessType.UPDATE) @PutMapping public Result<String> edit(@Validated @RequestBody SysDictData dict) { // dict.setUpdateBy(SecurityUtils.getUsername()); return toResult(dictDataService.updateDictData(dict)); } /** * 删除字典类型 */ @ApiOperation(value = "删除字典类型", notes = "删除字典类型详情") @PreAuthorize("@ss.hasPermi('system:dict:remove')") @Log(title = "字典类型", businessType = BusinessType.DELETE) @DeleteMapping("/{dictCodes}") public Result<String> remove(@PathVariable List<Long> dictCodes) { return toResult(dictDataService.deleteDictDataByIds(dictCodes)); } }
[ "jay@JaydeMacBook-Pro.local" ]
jay@JaydeMacBook-Pro.local
3f8bd5317ca124081218b3d74aaac829cc232224
7baca83b27612f19818c2319478c758ffb25e180
/src/main/java/com/dashradar/dashradarbackend/repository/BlockChainTotalsRepository.java
cec1a09813aaf6f4b98b1aa61ddd254442c13df6
[ "MIT" ]
permissive
Antti-Kaikkonen/DashradarBackend
73e12d18658315cc2614bef7d8702e2f2de8596f
fe8de6b5f299a4aa3f88597966d213c3da9345df
refs/heads/master
2022-01-03T08:42:25.144395
2021-12-29T04:30:43
2021-12-29T04:30:43
125,356,076
1
2
null
null
null
null
UTF-8
Java
false
false
5,808
java
package com.dashradar.dashradarbackend.repository; import com.dashradar.dashradarbackend.domain.BlockChainTotals; import org.springframework.data.neo4j.annotation.Query; import org.springframework.data.neo4j.repository.Neo4jRepository; import org.springframework.stereotype.Repository; @Repository public interface BlockChainTotalsRepository extends Neo4jRepository<BlockChainTotals, Long> { @Query( "MATCH (b:Block {hash:{0}})\n" + "WITH b\n" + "OPTIONAL MATCH (previousTotals:BlockChainTotals)<-[:BLOCKCHAIN_TOTALS]-(:Block)<-[:PREVIOUS_BLOCK]-(b)\n" + "WITH b, previousTotals\n" + "OPTIONAL MATCH (b)<-[:INCLUDED_IN]-(:Transaction)<-[:INPUT]-(input:TransactionInput)\n" + "WITH b, coalesce(previousTotals.input_count, 0)+count(input) as input_count\n" + "MERGE (b)-[:BLOCKCHAIN_TOTALS]->(bct:BlockChainTotals) \n" + "SET bct += {\n" + " input_count: input_count\n" + "};" ) void compute_input_counts(String blockhash); @Query( "MATCH (b:Block {hash:{0}})\n" + "WITH b\n" + "OPTIONAL MATCH (previousTotals:BlockChainTotals)<-[:BLOCKCHAIN_TOTALS]-(:Block)<-[:PREVIOUS_BLOCK]-(b)\n" + "WITH b, previousTotals\n" + "OPTIONAL MATCH (b)<-[:INCLUDED_IN]-(:Transaction)-[:OUTPUT]->(output:TransactionOutput)\n" + "WITH b, coalesce(previousTotals.output_count, 0)+count(output) as output_count\n" + "MERGE (b)-[:BLOCKCHAIN_TOTALS]->(bct:BlockChainTotals) \n" + "SET bct += {\n" + " output_count: output_count\n" + "};" ) void compute_output_counts(String blockhash); @Query( "MATCH (b:Block {hash:{0}})\n" + "WITH b\n" + "OPTIONAL MATCH (previousTotals:BlockChainTotals)<-[:BLOCKCHAIN_TOTALS]-(:Block)<-[:PREVIOUS_BLOCK]-(b)\n" + "WITH b, previousTotals\n" + "OPTIONAL MATCH (b)<-[:INCLUDED_IN]-(:Transaction {n:0})-[:OUTPUT]->(output:TransactionOutput)\n" + "WITH b, coalesce(previousTotals.total_block_rewards_sat, 0)+sum(output.valueSat) as block_rewards\n" + "MERGE (b)-[:BLOCKCHAIN_TOTALS]->(bct:BlockChainTotals) \n" + "SET bct += {\n" + " total_block_rewards_sat: block_rewards\n" + "};" ) void compute_total_block_rewards(String blockhash); @Query( "MATCH (b:Block {hash:{0}})\n" + "WITH b\n" + "OPTIONAL MATCH (previousTotals:BlockChainTotals)<-[:BLOCKCHAIN_TOTALS]-(:Block)<-[:PREVIOUS_BLOCK]-(b)\n" + "WITH b, coalesce(previousTotals.total_block_size, 0)+b.size as blocksize\n" + "MERGE (b)-[:BLOCKCHAIN_TOTALS]->(bct:BlockChainTotals) \n" + "SET bct += {\n" + " total_block_size: blocksize\n" + "};" ) void compute_total_block_size(String blockhash); @Query( "MATCH (b:Block {hash:{0}})\n" + "WITH b\n" + "OPTIONAL MATCH (previousTotals:BlockChainTotals)<-[:BLOCKCHAIN_TOTALS]-(:Block)<-[:PREVIOUS_BLOCK]-(b)\n" + "WITH b, coalesce(previousTotals.total_difficulty, 0)+b.difficulty as difficulty\n" + "MERGE (b)-[:BLOCKCHAIN_TOTALS]->(bct:BlockChainTotals) \n" + "SET bct += {\n" + " total_difficulty: difficulty\n" + "};" ) void compute_total_difficulty(String blockhash); @Query( "MATCH (b:Block {hash:{0}})\n" + "WITH b\n" + "OPTIONAL MATCH (previousTotals:BlockChainTotals)<-[:BLOCKCHAIN_TOTALS]-(:Block)<-[:PREVIOUS_BLOCK]-(b)\n" + "WITH b, previousTotals\n" + "OPTIONAL MATCH (b)<-[:INCLUDED_IN]-(tx:Transaction)\n" + "WITH b, coalesce(previousTotals.total_fees_sat, 0)+sum(tx.feesSat) as fees\n" + "MERGE (b)-[:BLOCKCHAIN_TOTALS]->(bct:BlockChainTotals) \n" + "SET bct += {\n" + " total_fees_sat: fees\n" + "};" ) void compute_total_fees(String blockhash); @Query( "MATCH (b:Block {hash:{0}})\n" + "WITH b\n" + "OPTIONAL MATCH (previousTotals:BlockChainTotals)<-[:BLOCKCHAIN_TOTALS]-(:Block)<-[:PREVIOUS_BLOCK]-(b)\n" + "WITH b, previousTotals\n" + "OPTIONAL MATCH (b)<-[:INCLUDED_IN]-(:Transaction)-[:OUTPUT]->(output:TransactionOutput)\n" + "WITH b, coalesce(previousTotals.total_output_volume_sat, 0)+sum(output.valueSat) as output_volume\n" + "MERGE (b)-[:BLOCKCHAIN_TOTALS]->(bct:BlockChainTotals) \n" + "SET bct += {\n" + " total_output_volume_sat: output_volume\n" + "};" ) void compute_total_output_volume(String blockhash); @Query( "MATCH (b:Block {hash:{0}})\n" + "WITH b\n" + "OPTIONAL MATCH (previousTotals:BlockChainTotals)<-[:BLOCKCHAIN_TOTALS]-(:Block)<-[:PREVIOUS_BLOCK]-(b)\n" + "WITH b, previousTotals\n" + "OPTIONAL MATCH (b)<-[:INCLUDED_IN]-(tx:Transaction)\n" + "WITH b, coalesce(previousTotals.total_transaction_size, 0)+sum(tx.size) as tx_size\n" + "MERGE (b)-[:BLOCKCHAIN_TOTALS]->(bct:BlockChainTotals) \n" + "SET bct += {\n" + " total_transaction_size: tx_size\n" + "};" ) void compute_total_transaction_size(String blockhash); @Query( "MATCH (b:Block {hash:{0}})\n" + "WITH b\n" + "OPTIONAL MATCH (previousTotals:BlockChainTotals)<-[:BLOCKCHAIN_TOTALS]-(:Block)<-[:PREVIOUS_BLOCK]-(b)\n" + "WITH b, previousTotals\n" + "OPTIONAL MATCH (b)<-[:INCLUDED_IN]-(tx:Transaction)\n" + "WITH b, coalesce(previousTotals.tx_count, 0)+count(tx) as tx_count\n" + "MERGE (b)-[:BLOCKCHAIN_TOTALS]->(bct:BlockChainTotals) \n" + "SET bct += {\n" + " tx_count: tx_count\n" + "};" ) void compute_total_tx_count(String blockhash); }
[ "35118741+Antti-Kaikkonen@users.noreply.github.com" ]
35118741+Antti-Kaikkonen@users.noreply.github.com
07809fb1874b2820643bc62064ef753736f74b52
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-live/src/main/java/com/aliyuncs/live/model/v20161101/SetBoardCallbackRequest.java
de8993fc6673a4a6e2cee94a8b426ecf34129137
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
3,202
java
/* * 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.aliyuncs.live.model.v20161101; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.live.Endpoint; /** * @author auto create * @version */ public class SetBoardCallbackRequest extends RpcAcsRequest<SetBoardCallbackResponse> { private String authKey; private Integer callbackEnable; private String callbackEvents; private Long ownerId; private String callbackUri; private String appId; private String authSwitch; public SetBoardCallbackRequest() { super("live", "2016-11-01", "SetBoardCallback"); setMethod(MethodType.POST); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getAuthKey() { return this.authKey; } public void setAuthKey(String authKey) { this.authKey = authKey; if(authKey != null){ putQueryParameter("AuthKey", authKey); } } public Integer getCallbackEnable() { return this.callbackEnable; } public void setCallbackEnable(Integer callbackEnable) { this.callbackEnable = callbackEnable; if(callbackEnable != null){ putQueryParameter("CallbackEnable", callbackEnable.toString()); } } public String getCallbackEvents() { return this.callbackEvents; } public void setCallbackEvents(String callbackEvents) { this.callbackEvents = callbackEvents; if(callbackEvents != null){ putQueryParameter("CallbackEvents", callbackEvents); } } public Long getOwnerId() { return this.ownerId; } public void setOwnerId(Long ownerId) { this.ownerId = ownerId; if(ownerId != null){ putQueryParameter("OwnerId", ownerId.toString()); } } public String getCallbackUri() { return this.callbackUri; } public void setCallbackUri(String callbackUri) { this.callbackUri = callbackUri; if(callbackUri != null){ putQueryParameter("CallbackUri", callbackUri); } } public String getAppId() { return this.appId; } public void setAppId(String appId) { this.appId = appId; if(appId != null){ putQueryParameter("AppId", appId); } } public String getAuthSwitch() { return this.authSwitch; } public void setAuthSwitch(String authSwitch) { this.authSwitch = authSwitch; if(authSwitch != null){ putQueryParameter("AuthSwitch", authSwitch); } } @Override public Class<SetBoardCallbackResponse> getResponseClass() { return SetBoardCallbackResponse.class; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
fc375f239e6ac92dbe97d09f30b9c394064da66a
f0d7f26c6e430c24e24b4c683637f840e67f8359
/src/main/java/philharmonic/dao/ConcertSessionDaoImpl.java
f361460494de4bc464c2b88abfd675224d99861a
[]
no_license
AleksandrPok/Philharmonic
0cc291e71ee5d38952235082079fa355667a3969
406c4aa832210e76cfdc42432db6141d4cb6497b
refs/heads/master
2023-03-14T09:30:58.459355
2021-03-02T10:25:42
2021-03-02T10:25:42
333,327,707
0
0
null
2021-03-02T10:25:42
2021-01-27T06:38:01
Java
UTF-8
Java
false
false
3,994
java
package philharmonic.dao; import java.time.LocalDate; import java.util.List; import java.util.Optional; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.query.Query; import org.springframework.stereotype.Repository; import philharmonic.exception.DataProcessException; import philharmonic.model.ConcertSession; @Repository public class ConcertSessionDaoImpl implements ConcertSessionDao { private final SessionFactory sessionFactory; public ConcertSessionDaoImpl(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } @Override public List<ConcertSession> findAvailableSessions(Long concertId, LocalDate date) { try (Session session = sessionFactory.openSession()) { Query<ConcertSession> getByDate = session.createQuery( "SELECT cs FROM ConcertSession cs " + "LEFT JOIN FETCH cs.concert LEFT JOIN FETCH cs.stage " + "WHERE cs.concert.id = :concert_id " + "AND date_format(cs.showTime, '%Y-%m-%d') = :date", ConcertSession.class); getByDate.setParameter("concert_id", concertId); getByDate.setParameter("date", date.toString()); return getByDate.getResultList(); } catch (Exception e) { throw new DataProcessException("Can't get sessions on " + date.toString(), e); } } @Override public ConcertSession add(ConcertSession concertSession) { Transaction transaction = null; Session session = null; try { session = sessionFactory.openSession(); transaction = session.beginTransaction(); session.persist(concertSession); transaction.commit(); return concertSession; } catch (Exception e) { if (transaction != null) { transaction.rollback(); } throw new DataProcessException("Can't add concert session: " + concertSession, e); } finally { if (session != null) { session.close(); } } } @Override public Optional<ConcertSession> get(Long id) { try (Session session = sessionFactory.openSession()) { return Optional.ofNullable(session.get(ConcertSession.class, id)); } catch (Exception e) { throw new DataProcessException("Can't get concert session with id: " + id, e); } } @Override public ConcertSession update(ConcertSession concertSession) { Transaction transaction = null; Session session = null; try { session = sessionFactory.openSession(); transaction = session.beginTransaction(); session.update(concertSession); transaction.commit(); return concertSession; } catch (Exception e) { if (transaction != null) { transaction.rollback(); } throw new DataProcessException("Can't update concert session: " + concertSession, e); } finally { if (session != null) { session.close(); } } } @Override public void delete(Long id) { Transaction transaction = null; Session session = null; try { session = sessionFactory.openSession(); transaction = session.beginTransaction(); ConcertSession deletableSession = session.load(ConcertSession.class, id); session.delete(deletableSession); transaction.commit(); } catch (Exception e) { if (transaction != null) { transaction.rollback(); } throw new DataProcessException("Can't delete concert session: " + id, e); } finally { if (session != null) { session.close(); } } } }
[ "aln.nko.of@gmail.com" ]
aln.nko.of@gmail.com
68268733641b9e874aea7a6664d6efa0fab801c9
23b6d6971a66cf057d1846e3b9523f2ad4e05f61
/MLMN-core/ejbModule/vn/com/vhc/sts/cni/STS_BasicConverter.java
2b544126ec537c9eb5c635f3d024fea4df7bdea7
[]
no_license
vhctrungnq/mlmn
943f5a44f24625cfac0edc06a0d1b114f808dfb8
d3ba1f6eebe2e38cdc8053f470f0b99931085629
refs/heads/master
2020-03-22T13:48:30.767393
2018-07-08T05:14:12
2018-07-08T05:14:12
140,132,808
0
1
null
2018-07-08T05:29:27
2018-07-08T02:57:06
Java
UTF-8
Java
false
false
5,288
java
package vn.com.vhc.sts.cni; import java.io.File; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.log4j.Logger; import vn.com.vhc.sts.core.STS_Global; import vn.com.vhc.sts.util.STS_Setting; import vn.com.vhc.sts.util.STS_Util; import vn.com.vhc.sts.util.exceptions.STS_ConvertException; public abstract class STS_BasicConverter implements STS_IConverter { private static Logger logger = Logger.getLogger(STS_BasicConverter.class.getName()); protected String separator = "\t"; protected String commentChar = "@"; protected String nodeName = ""; public void convertFile(File file, String direcPath, Hashtable<Byte, String> params, Connection conn) throws STS_ConvertException { } public abstract void convertFile(File file, String direcPath, Hashtable<Byte, String> params) throws STS_ConvertException; public void prepareParams(Hashtable<Byte, String> params) throws STS_ConvertException { if (params == null) { throw new STS_ConvertException("Invalid parameter"); } if (params.containsKey(STS_Setting.SEPARATOR_KEY)) { separator = params.get(STS_Setting.SEPARATOR_KEY); } if (params.containsKey(STS_Setting.COMMENT_CHAR_KEY)) { commentChar = params.get(STS_Setting.COMMENT_CHAR_KEY); } if (params.containsKey(STS_Setting.NODE_NAME_KEY)) { nodeName = params.get(STS_Setting.NODE_NAME_KEY); } } public void makeDirectory(String direcPath) throws STS_ConvertException { if (direcPath == null || direcPath.length() == 0) { throw new STS_ConvertException("Invalid directory parameter"); } // make a destination directory File dir = new File(direcPath); if (!dir.exists()) { dir.mkdirs(); } } /** * @return */ public List<String> getFileHeaderInfo() { List<String> list = new ArrayList<String>(); list.add("---------------------------------------------"); list.add(" File duoc chuan hoa boi he thong VMSC2"); list.add(" Thoi gian chuan hoa: " + STS_Util.getCurrentTime()); list.add(" Class xu ly: " + this.getClass().getName()); list.add("---------------------------------------------"); return list; } public List<String> getFileHeaderInfo(int columnCount) { List<String> list = getFileHeaderInfo(); if (columnCount <= 0) { return list; } list.remove(list.size() - 1); list.add(" Tong so cot du lieu: " + columnCount); list.add("---------------------------------------------"); return list; } public List<String> getFileHeaderInfo(String[] columnNames, String sep) { List<String> list = getFileHeaderInfo(); if (columnNames == null || columnNames.length == 0) { return list; } list.remove(list.size() - 1); list.add(" Tong so cot du lieu: " + columnNames.length); list.add("---------------------------------------------"); String cols = ""; for (String s : columnNames) { if (cols.length() > 0) { cols += sep; } cols += s; } list.add(cols); return list; } public List<String> getFileHeaderInfo(List<String> columnNames, String sep) { List<String> list = getFileHeaderInfo(); if (columnNames == null || columnNames.size() == 0) { return list; } list.remove(list.size() - 1); list.add(" Tong so cot du lieu: " + columnNames.size()); list.add("---------------------------------------------"); String cols = ""; for (String s : columnNames) { if (cols.length() > 0) { cols += sep; } cols += s; } list.add(cols); return list; } public String getFileName(String fileName) { String name = ""; if (fileName != null && fileName.length() > 0) { int indexOf = fileName.lastIndexOf("."); name = (indexOf == -1) ? fileName : fileName.substring(0, indexOf); } name += STS_Setting.FILE_EXTENSION; // System.out.println("Stand file name: " + name); return name; } public String getTimeFromFileName(String fileName, String regex) { String time = ""; Pattern timePattern = Pattern.compile(regex); Matcher m = timePattern.matcher(fileName.trim()); if (m.find()) { time = m.group().trim(); } return time; } public void executeSQLCommand(String sqlCommand) throws SQLException { Connection conn = null; try { conn = STS_Global.DATA_SOURCE.getConnection(); Statement st = conn.createStatement(); st.execute(sqlCommand); st.close(); } finally { if (conn != null) { try { conn.close(); } catch (Exception e) { logger.warn("Cannot close connection to database"); } } } } public void duplicateRecord(long fileId, String fileName, String rawTable) throws SQLException { String sql = "insert /*+ APPEND NOLOGGING */ into C_RAW_FILES_MLMN (FILE_ID,PATTERN_ID,FILE_NAME,DAY," + "HOUR,CONVERT_FLAG,IMPORT_FLAG, NODE_NAME, RAW_TABLE, ORIGINAL_NAME) " + "select SEQ_CRF.NEXTVAL,PATTERN_ID, '" + fileName + "',DAY,HOUR,1,0,NODE_NAME,'" + rawTable + "',ORIGINAL_NAME from C_RAW_FILES_MLMN where FILE_ID = " + fileId; executeSQLCommand(sql); } }
[ "trungnq@vhc.com.vn" ]
trungnq@vhc.com.vn
d1a6d770b213ab7a152e87e4426d69a7b794026c
c7ff4c34208d1641d8b9c941fba26005050af7f4
/src/main/java/ru/saintunix/tictactoe/client/Main.java
39e04e44df63dee929a32dd19ecad9f4595cfad0
[]
no_license
iborisyuk/tictactoe_spring
f206ad366c0a1129d500e5662e191c018447637d
39e349f14c3162d1f669a69ef44454f8ead76093
refs/heads/master
2022-06-26T04:59:53.269189
2019-09-16T10:41:34
2019-09-16T10:41:34
208,579,469
0
0
null
2022-05-20T21:08:57
2019-09-15T10:48:36
Java
UTF-8
Java
false
false
372
java
package ru.saintunix.tictactoe.client; import java.util.Random; public class Main { private static final Random rand = new Random(); private static final String host = "http://localhost:8080/game/"; private static final int playerId = rand.nextInt(9999); public static void main(String[] args) { new PlayToGame(host, playerId).start(); } }
[ "saint.unix@live.com" ]
saint.unix@live.com
e61ee4fee8390d380c21f55f38ad7297385b241f
96aefaa9deca284a0ab671f4d0a078af94ea143f
/DrawingWindow.java
fc58bcccb8da9e41037bbfa487c3b3c940635e0e
[]
no_license
valena1/drawing-window
9203902933d633032053a499d7fccfb29ba4505e
1433e84b733592ce12601b2548aa49d34964cd89
refs/heads/master
2020-04-22T19:39:27.813738
2019-02-22T05:58:44
2019-02-22T05:58:44
170,614,874
0
0
null
null
null
null
UTF-8
Java
false
false
15,600
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package drawingprogram; import java.awt.Color; /** * * @author Valena Nguyen */ public class DrawingWindow extends javax.swing.JFrame { private DrawingModel myModel; private boolean typeColor; private boolean toggle = false; /** * Constructor that creates new JFrame form with various elements on it * The elements have been designed using NetBeans design view */ public DrawingWindow(DrawingModel model) { // save the model so we can use it myModel = model; // this calls the NetBeans auto-generated code that creates the // window and adds all the GUI elements to it initComponents(); // change the window title (you can change this whatever you want) this.setTitle("Valena's Basic Drawing Program"); // pass the drawingModel to the canvas, because it needs it, too drawingCanvas.setModel(myModel); // sets the typecolor to true typeColor = true; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jToolBar1 = new javax.swing.JToolBar(); clearButton = new javax.swing.JButton(); saveButton = new javax.swing.JButton(); undoButton = new javax.swing.JButton(); redoButton = new javax.swing.JButton(); fillColorButton = new javax.swing.JButton(); lineColorButton = new javax.swing.JButton(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(60, 0), new java.awt.Dimension(60, 0), new java.awt.Dimension(60, 32767)); drawingCanvas = new drawingprogram.DrawingCanvas(); shapeComboBox = new javax.swing.JComboBox(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jToolBar1.setRollover(true); clearButton.setText("Clear"); clearButton.setFocusable(false); clearButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); clearButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); clearButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clearButtonActionPerformed(evt); } }); jToolBar1.add(clearButton); saveButton.setText("Save"); saveButton.setFocusable(false); saveButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); saveButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); saveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveButtonActionPerformed(evt); } }); jToolBar1.add(saveButton); undoButton.setText("Undo"); undoButton.setFocusable(false); undoButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); undoButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); undoButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { undoButtonActionPerformed(evt); } }); jToolBar1.add(undoButton); redoButton.setText("Redo"); redoButton.setFocusable(false); redoButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); redoButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); redoButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { redoButtonActionPerformed(evt); } }); jToolBar1.add(redoButton); fillColorButton.setText("Fill Color"); fillColorButton.setFocusable(false); fillColorButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); fillColorButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); fillColorButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { fillColorButtonActionPerformed(evt); } }); jToolBar1.add(fillColorButton); lineColorButton.setText("Line Color"); lineColorButton.setFocusable(false); lineColorButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); lineColorButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); lineColorButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { lineColorButtonActionPerformed(evt); } }); jToolBar1.add(lineColorButton); jToolBar1.add(filler1); drawingCanvas.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2)); drawingCanvas.setPreferredSize(new java.awt.Dimension(500, 500)); drawingCanvas.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { drawingCanvasMouseDragged(evt); } }); drawingCanvas.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { drawingCanvasMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { drawingCanvasMouseReleased(evt); } }); javax.swing.GroupLayout drawingCanvasLayout = new javax.swing.GroupLayout(drawingCanvas); drawingCanvas.setLayout(drawingCanvasLayout); drawingCanvasLayout.setHorizontalGroup( drawingCanvasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); drawingCanvasLayout.setVerticalGroup( drawingCanvasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 624, Short.MAX_VALUE) ); shapeComboBox.setModel(new javax.swing.DefaultComboBoxModel(getShapeTypeValues()) ); shapeComboBox.setSelectedItem(myModel.getCurrentShape()); shapeComboBox.setToolTipText("Pick a shape to draw"); shapeComboBox.setPreferredSize(new java.awt.Dimension(50, 27)); shapeComboBox.setRequestFocusEnabled(false); shapeComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { shapeComboBoxActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 325, Short.MAX_VALUE) .addComponent(shapeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(drawingCanvas, javax.swing.GroupLayout.DEFAULT_SIZE, 823, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(shapeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(drawingCanvas, javax.swing.GroupLayout.DEFAULT_SIZE, 628, Short.MAX_VALUE) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * Clear button handler * @param evt */ private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed // tell the model to clear itself and then update the canvas myModel.clearModel(); drawingCanvas.update(); }//GEN-LAST:event_clearButtonActionPerformed /** * Mouse pressed handler * @param evt gives access to x and y coordinates where mouse pressed down */ private void drawingCanvasMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_drawingCanvasMousePressed // Get the x and y coords startX = evt.getX(); startY = evt.getY(); // stuff to enable interactive drawing myModel.setMouseDown(true); myModel.setStartX(startX); myModel.setStartY(startY); }//GEN-LAST:event_drawingCanvasMousePressed /** * Mouse released handler * @param evt gives access to x and y coordinates where mouse was released */ private void drawingCanvasMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_drawingCanvasMouseReleased // Get the x and y coords endX = evt.getX(); endY = evt.getY(); // add new shape to the model switch (myModel.getCurrentShape()) { case LINE: myModel.addNewLine(new Line( startX, startY, endX, endY, myModel.getLineColor())); break; case RECT: myModel.addNewRect(new Rectangle( startX, startY, endX, endY, myModel.getLineColor(), myModel.getFillColor())); break; case TRIANGLE: myModel.addNewTriangle(new Triangle( startX, startY, endX, endY, myModel.getLineColor(), myModel.getFillColor())); break; case OVAL: myModel.addNewOval(new Oval( startX, startY, endX, endY, myModel.getLineColor(), myModel.getFillColor())); break; } myModel.setMouseDown(false); drawingCanvas.update(); }//GEN-LAST:event_drawingCanvasMouseReleased /** * Canvas mouse drag handler, gets called whenever the user is dragging * cursor across canvas with button pressed * @param evt gives access to current x and y coords */ private void drawingCanvasMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_drawingCanvasMouseDragged // get x and y coords, save in model myModel.setCurrentX(evt.getX()); myModel.setCurrentY(evt.getY()); // update canvas (needed to make drawing interactive) drawingCanvas.update(); }//GEN-LAST:event_drawingCanvasMouseDragged /** * Handler for the shapeComboBox * NB: you should not need to change this code * @param evt */ private void shapeComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_shapeComboBoxActionPerformed // update current shape in model DrawingModel.ShapeType selectedShape = DrawingModel.ShapeType.values()[shapeComboBox.getSelectedIndex()]; myModel.setCurrentShape(selectedShape); }//GEN-LAST:event_shapeComboBoxActionPerformed /** * Save button handler * @param evt */ private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed // create and show the save file dialog window SaveDialogWindow saveWindow = new SaveDialogWindow(drawingCanvas); saveWindow.setVisible(true); }//GEN-LAST:event_saveButtonActionPerformed private void undoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_undoButtonActionPerformed // TODO add your handling code here: // undo shapes myModel.undoShape(); drawingCanvas.update(); }//GEN-LAST:event_undoButtonActionPerformed private void redoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_redoButtonActionPerformed // TODO add your handling code here: // redo shapes myModel.redoShape(); drawingCanvas.update(); }//GEN-LAST:event_redoButtonActionPerformed private void fillColorButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fillColorButtonActionPerformed // sets color to fill color typeColor = true; ColorPickerWindow color = new ColorPickerWindow(myModel, typeColor); color.setVisible(true); }//GEN-LAST:event_fillColorButtonActionPerformed private void lineColorButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lineColorButtonActionPerformed // sets color to line color typeColor = false; ColorPickerWindow color = new ColorPickerWindow(myModel,typeColor); color.setVisible(true); }//GEN-LAST:event_lineColorButtonActionPerformed /** * This is used to populate the comboBox on the window * @return the list of shapes in the enumerated type */ private DrawingModel.ShapeType[] getShapeTypeValues() { return DrawingModel.ShapeType.values(); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton clearButton; private drawingprogram.DrawingCanvas drawingCanvas; private javax.swing.JButton fillColorButton; private javax.swing.Box.Filler filler1; private javax.swing.JToolBar jToolBar1; private javax.swing.JButton lineColorButton; private javax.swing.JButton redoButton; private javax.swing.JButton saveButton; private javax.swing.JComboBox shapeComboBox; private javax.swing.JButton undoButton; // End of variables declaration//GEN-END:variables // local fields needed for interactive drawing private int startX; private int startY; private int endX; private int endY; private int currentX; private int currentY; }
[ "noreply@github.com" ]
valena1.noreply@github.com
752070b37153b15baf90a57ffaca0f13b8083f0f
1ffbddaac30df0c092e4a60ad9f8734b50666a6e
/src/main/java/be/alexandre01/dreamzon/shootcraftffa/Others/LevelListener.java
d19beff8950427b3f0fe909263c287312d96f54f
[]
no_license
Alexandre01Dev/ShootCraftFFA
907d07cd56de7c0eb45d59c15c3038bee389015d
1ce88c14c568a977e519ba289265a8f107f56cd7
refs/heads/master
2022-12-01T22:16:24.198461
2020-08-17T15:36:42
2020-08-17T15:36:42
233,901,948
1
0
null
null
null
null
UTF-8
Java
false
false
6,965
java
package be.alexandre01.dreamzon.shootcraftffa.Others; import be.alexandre01.dreamzon.shootcraftffa.commands.Spawn; import be.alexandre01.dreamzon.shootcraftffa.cosmetics.DeathMessages; import be.alexandre01.dreamzon.shootcraftffa.Others.Level; import be.alexandre01.dreamzon.shootcraftffa.Main; import be.alexandre01.dreamzon.shootcraftffa.npc.NPCManager; import be.alexandre01.dreamzon.shootcraftffa.npc.SkinManager; import com.mojang.authlib.GameProfile; import net.minecraft.server.v1_8_R3.EntityPlayer; import net.minecraft.server.v1_8_R3.PacketPlayInClientCommand; import org.apache.commons.io.IOUtils; import org.bukkit.Bukkit; import org.bukkit.Color; import org.bukkit.FireworkEffect; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerLevelChangeEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.meta.FireworkEffectMeta; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.Vector; import org.json.simple.JSONObject; import org.json.simple.JSONValue; import java.net.URL; public class LevelListener implements Listener { @EventHandler public void onRespawn(PlayerRespawnEvent event){ Player player = event.getPlayer(); player.sendMessage("lets-go"); EntityPlayer playerNMS = ((CraftPlayer) player).getHandle(); //player.setTotalExperience(Main.getInstance().getConfig().getInt("exp."+player.getName())); } @EventHandler public void onJoin(PlayerJoinEvent event){ Player player = event.getPlayer(); //player.setTotalExperience(Main.getInstance().getConfig().getInt("exp."+player.getName())); } @EventHandler(priority = EventPriority.LOWEST) public void onLevelChange(PlayerLevelChangeEvent event){ Player player = event.getPlayer(); if(!player.hasPermission("dz.vip")){ Main.getInstance().nameTag().SetNameTag(player); }{ Main.getInstance().nameTag().SetNameTagForPremium(player); } if(player.getLevel() == 100){ Bukkit.broadcastMessage("§c "); Bukkit.broadcastMessage("§c » §6"+ player.getName() + "§c viens de passer aux niveaux 100 ! " + Level.getLevelWithInt(event.getOldLevel()) + " >> " + Level.getLevelWithInt(event.getNewLevel())); Bukkit.broadcastMessage("§c » §6"+ player.getName() + "§c Est un dieu désormais. [Donne 4x plus d'exp lorsqu'on le kill] " ); }else { Bukkit.broadcastMessage("§c "); Bukkit.broadcastMessage("§c » §6"+ player.getName() + "§c viens de passer de Niveaux ! " + Level.getLevelWithInt(event.getOldLevel()) + " >> " + Level.getLevelWithInt(event.getNewLevel())); } } @EventHandler public void onKillPeople(PlayerDeathEvent event) { event.getEntity().getInventory().clear(); event.getEntity().updateInventory(); event.setDroppedExp(0); event.setKeepLevel(true); Player player = event.getEntity(); Player killer = event.getEntity().getKiller(); Bukkit.broadcastMessage("§c "); event.setDeathMessage("§c » §6"+DeathMessages.NourritureMsg(event)); FireworkEffectMeta firworkEffectMeta; FireworkEffect.Builder builder = FireworkEffect.builder(); builder.withColor(Color.WHITE); builder.withColor(Color.fromRGB(46,46,46)); builder.withFlicker(); builder.withFade(Color.fromRGB(255,119,119)); builder.with(FireworkEffect.Type.BALL); builder.trail(false); FireworkEffect effect = builder.build(); Location locent = player.getLocation(); locent.add(0,0.5,0); Main.getInstance().effect().InstantFirework(effect, locent); for(Entity entities : killer.getWorld().getNearbyEntities(killer.getLocation(),50,50 ,50)){ if(entities instanceof Player){ Player players = (Player) entities; Main.getInstance().npcManager().createNPCOnKill(player,players,player.getName()); players.sendMessage("yes"); } } new BukkitRunnable() { @Override public void run() { ((CraftPlayer)player).getHandle().playerConnection.a(new PacketPlayInClientCommand(PacketPlayInClientCommand.EnumClientCommand.PERFORM_RESPAWN)); cancel(); } }.runTaskLater(Main.getInstance(),1); Main.getInstance().playersdead.put(player,1); player.setTotalExperience(0); Main.getInstance().Level().setPoint(killer,player); for(Player players : Main.getInstance().playersdamager.values()){ if(Main.getInstance().playersdamager.containsKey(players)){ if(players != killer){ players.sendMessage("TU AS FAIS UN ASSIST"); } } } Main.getInstance().nameTag().RemoveNameTag(player); Main.getInstance().nameTag().setonKill(player); player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 2), true); player.teleport(Spawn.sendHome()); } @EventHandler public void onMove(PlayerMoveEvent event){ if(Main.getInstance().playersdead.containsKey(event.getPlayer())) if ( event.getPlayer().getVelocity().getY() >= 0 && !event.getPlayer().isOnGround() ) { event.setCancelled(true); event.getPlayer().setVelocity(new Vector()); } } @EventHandler public void Damage(EntityDamageByEntityEvent event){ if(event.getEntity() instanceof Player){ Player player = (Player) event.getEntity(); if(event.getDamager() instanceof Player){ Player damager = (Player) event.getDamager(); if(!Main.getInstance().playersdamager.containsKey(damager)){ Main.getInstance().playersdamager.put(damager,player); } } } } public static String getUUID(String playerName) { try { String url = "https://api.mojang.com/users/profiles/minecraft/" + playerName; String UUIDJson = IOUtils.toString(new URL(url)); JSONObject UUIDObject = (JSONObject) JSONValue.parseWithException(UUIDJson); String uuid = UUIDObject.get("id").toString(); return uuid; } catch (Exception e) { return ""; } } }
[ "34719450+Alexandre01Game@users.noreply.github.com" ]
34719450+Alexandre01Game@users.noreply.github.com
41d008a03baab761019e4a6a53450eb348c7db8a
e0fee1db23c8f89bc04e565ccc40a6e033f7683d
/app/src/main/java/me/liujia95/views/calendar/CalendarLayout.java
42f0c61010d837f0ff6426d667de4f4709cfbdc3
[]
no_license
liujia95/Views
54a91e78808b9ac22648ed7e111142992ccf96da
4513c4605590b874dbd650e21067e0344fc5d631
refs/heads/master
2021-01-20T17:58:36.183906
2017-11-17T11:49:50
2017-11-17T11:49:50
60,821,600
0
0
null
2017-11-10T10:59:35
2016-06-10T03:18:23
Java
UTF-8
Java
false
false
8,916
java
package me.liujia95.views.calendar; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Color; import android.support.annotation.Nullable; import android.support.v4.view.ViewPager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import java.util.Calendar; import me.liujia95.views.utils.ViewUtils; /** * Author: LiuJia on 2017/11/13 0013 14:47. * Email: liujia95me@126.com */ public class CalendarLayout extends LinearLayout { private static final String TAG = CalendarLayout.class.getSimpleName(); private CalendarPagerAdapter adapter; Calendar calendar = Calendar.getInstance(); int flagCount = Integer.MAX_VALUE / 2; int minVpHeight; int maxVpHeight; private ViewPager viewPager; private float density; private RecyclerView recyclerView; public CalendarLayout(Context context) { this(context, null); } public CalendarLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } public CalendarLayout(final Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); //初始化 viewPager = new ViewPager(context); density = getResources().getDisplayMetrics().density; minVpHeight = (int) (density * 60); maxVpHeight = (int) (density * 300); viewPager.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, maxVpHeight)); adapter = new CalendarPagerAdapter(); viewPager.setAdapter(adapter); viewPager.setCurrentItem(Integer.MAX_VALUE / 2); addView(viewPager); adapter.setOnClickListener(new MonthView.OnClickListener() { @Override public void clickLastMonth(int day) { viewPager.setCurrentItem(viewPager.getCurrentItem() - 1); } @Override public void clickNextMonth(int day) { viewPager.setCurrentItem(viewPager.getCurrentItem() + 1); } }); viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { int offset = position - flagCount; calendar.add(Calendar.MONTH, offset); MonthView monthView = (MonthView) viewPager.findViewWithTag(position); monthView.setCurrentSelectedCount(); Log.e(TAG, "position:" + position + " offset:" + offset + " selectedCount:" + MonthView.currentSelectedCount); Log.e(TAG, calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-" + calendar.get(Calendar.DAY_OF_MONTH)); flagCount = position; } @Override public void onPageScrollStateChanged(int state) { } }); //todo:测试用,待删 recyclerView = new RecyclerView(context); recyclerView.setBackgroundColor(Color.RED); recyclerView.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); addView(recyclerView); recyclerView.setLayoutManager(new LinearLayoutManager(context)); recyclerView.setAdapter(new RecyclerView.Adapter() { @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(context).inflate(android.R.layout.simple_list_item_1, null); return new MyViewHolder(view); } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { ((MyViewHolder) holder).loadData(position + ""); } @Override public int getItemCount() { return 100; } class MyViewHolder extends RecyclerView.ViewHolder { TextView tv1; public MyViewHolder(View itemView) { super(itemView); tv1 = (TextView) itemView.findViewById(android.R.id.text1); } public void loadData(String s) { tv1.setText(s); } } }); } /** * 外部传进来RecyclerView * * @param recyclerView */ public void setRecyclerView(RecyclerView recyclerView) { recyclerView.setBackgroundColor(Color.RED); addView(recyclerView); } //todo(高亮)------------------------ 以下为滑动相关 ------------------------------ float downY; float downX; float minMove = 30;//判定的最小距离为30个像素点 float offsetY; boolean isHorizontal; boolean isVertical; float flagY; @Override public boolean dispatchTouchEvent(MotionEvent ev) { switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: flagY = 0; downX = ev.getRawX(); downY = ev.getRawY(); isHorizontal = false; isVertical = false; break; case MotionEvent.ACTION_MOVE: float offsetX = ev.getRawX() - downX; float offsetY = ev.getRawY() - downY; if (Math.abs(offsetX) > minMove && !isVertical) { isHorizontal = true; return super.dispatchTouchEvent(ev); } else if (Math.abs(offsetY) > minMove && !isHorizontal) { isVertical = true; LinearLayout.LayoutParams layoutParams = (LayoutParams) viewPager.getLayoutParams(); if (layoutParams.topMargin <= (-maxVpHeight + minVpHeight) && offsetY < 0) { flagY = 0; return super.dispatchTouchEvent(ev); } else if (layoutParams.topMargin >= 0 && offsetY > 0) { flagY = 0; return super.dispatchTouchEvent(ev); } else if (!ViewUtils.isRecyclerViewToTop(recyclerView) && offsetY > 0) {//判断RecyclerView是否滑到顶部 flagY = offsetY; return super.dispatchTouchEvent(ev); } else { flagY = offsetY - flagY; setViewPagerTopMargin((int) (flagY + layoutParams.topMargin)); flagY = offsetY; return true; } } break; case MotionEvent.ACTION_UP: //松手时判断松手的位置做ViewPager的动画 LayoutParams layoutParams = (LayoutParams) viewPager.getLayoutParams(); int to = 0; if (layoutParams.topMargin < -maxVpHeight / 2) { to = -maxVpHeight + minVpHeight; } startViewPagerAnimator(layoutParams.topMargin, to); break; default: } return super.dispatchTouchEvent(ev); } private void startViewPagerAnimator(int from, int to) { ValueAnimator animator = ValueAnimator.ofInt(from, to); animator.setDuration(300); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { int value = (int) animation.getAnimatedValue(); LinearLayout.LayoutParams layoutParams = (LayoutParams) viewPager.getLayoutParams(); layoutParams.topMargin = value; viewPager.setLayoutParams(layoutParams); } }); animator.start(); } private void setViewPagerTopMargin(int topMargin) { LinearLayout.LayoutParams layoutParams = (LayoutParams) viewPager.getLayoutParams(); layoutParams.topMargin = topMargin; if (layoutParams.topMargin <= (-maxVpHeight + minVpHeight)) { layoutParams.topMargin = -maxVpHeight + minVpHeight; } else if (layoutParams.topMargin >= 0) { layoutParams.topMargin = 0; } viewPager.setLayoutParams(layoutParams); } @Override public boolean onTouchEvent(MotionEvent event) { Log.e(TAG, "onTouchEvent"); return super.onTouchEvent(event); } }
[ "liujia95.me@gmail.com" ]
liujia95.me@gmail.com
1726af83236cc6997d3463314d88f5afb4da800c
803adbd95dafe68da552ab9e367e700ec83a86ec
/src/com/aminought/patterns/Builder/BuilderPattern.java
9941add600d4c2e7dd8e9bca7d1005b2821c0239
[]
no_license
aminought/JavaPatterns
cca07c471d68de32e67e183f02018839bd0abdee
f08a5399839ea91a360ba0a9c66d5fdce5684a0b
refs/heads/master
2016-09-06T18:01:40.181083
2015-09-18T13:36:07
2015-09-18T13:36:07
42,599,190
0
0
null
null
null
null
UTF-8
Java
false
false
2,462
java
/** * Паттерн Строитель позволяет отделить поэтапный алгоритм построения сложного объекта от его внешнего представления * так, чтобы можно было построить разные объекты с помощью одного алгоритма. */ package com.aminought.patterns.Builder; public class BuilderPattern { public static void main(String[] args) { Director director = new Director(); director.setBuilder(new ConcreteBuilderA()); director.constructProduct(); Product product = director.getProduct(); product.printInfo(); } } class Product { private String partA = null; private String partB = null; private String partC = null; public void setPartA(String partA) { this.partA = partA; } public void setPartB(String partB) { this.partB = partB; } public void setPartC(String partC) { this.partC = partC; } public void printInfo() { System.out.printf("%s %s %s", partA, partB, partC); } } abstract class Builder { protected Product product; public void createProduct() { product = new Product(); } public Product getProduct() { return product; } abstract public void buildPartA(); abstract public void buildPartB(); abstract public void buildPartC(); } class ConcreteBuilderA extends Builder { @Override public void buildPartA() { product.setPartA("PartAA"); } @Override public void buildPartB() { product.setPartB("PartAB"); } @Override public void buildPartC() { product.setPartC("PartAC"); } } class ConcreteBuilderB extends Builder { @Override public void buildPartA() { product.setPartA("PartBA"); } @Override public void buildPartB() { product.setPartB("PartBB"); } @Override public void buildPartC() { product.setPartC("PartBC"); } } class Director { private Builder builder = null; public void setBuilder(Builder builder) { this.builder = builder; } public void constructProduct() { builder.createProduct(); builder.buildPartA(); builder.buildPartB(); builder.buildPartC(); } public Product getProduct() { return builder.getProduct(); } }
[ "aminought@gmail.com" ]
aminought@gmail.com
a42ccca2478099e50ebaf6bf6bd7902284c5b4a3
c7b11a42c6405cffcd2c5522497c5bcd98f0bbd2
/src/main/java/cn/aage/robot/util/BaoUtil.java
7edde8a984d53f9661801e783ef33696e6174eff
[ "Apache-2.0" ]
permissive
shonve/jiebao
7a228bad9f707758edc09ac3d2e1213bc12ea671
54e952f153b58acba6c4d9441289c8de017e2810
refs/heads/master
2021-05-03T21:56:39.708598
2016-11-11T09:29:46
2016-11-11T09:29:46
71,571,600
0
1
null
null
null
null
UTF-8
Java
false
false
1,199
java
package cn.aage.robot.util; import java.util.ResourceBundle; public class BaoUtil { private static final ResourceBundle CFG = ResourceBundle.getBundle("jiebao"); public static String getString(final String key) { return CFG.getString(key); } public static Boolean getBoolean(final String key) { String stringValue = getString(key); if (null == stringValue) { return null; } return Boolean.valueOf(stringValue); } public static Float getFloat(final String key) { final String stringValue = getString(key); if (null == stringValue) { return null; } return Float.valueOf(stringValue); } public static Integer getInt(final String key) { final String stringValue = getString(key); if (null == stringValue) { return null; } return Integer.valueOf(stringValue); } public static Long getLong(final String key) { final String stringValue = getString(key); if (null == stringValue) { return null; } return Long.valueOf(stringValue); } private BaoUtil() { } }
[ "714719469@qq.com" ]
714719469@qq.com
5b45f6299b179c809b4e5b3e94d752f5f360e677
c194009abccf61249336b920da4a5527680ab2af
/app/src/test/java/com/github/vase4kin/teamcityapp/account/create/presenter/CreateAccountPresenterImplTest.java
24e03bfe11d9c09b87efdfe7df3ff6b669b2abed
[ "Apache-2.0" ]
permissive
TrendingTechnology/TeamCityApp
830a93b1e1c45916658882480bcc4176947a1dfe
9c5795b7d029c61006b83309485100f0f0969ded
refs/heads/master
2022-02-20T11:16:19.896509
2019-08-09T07:51:36
2019-08-09T07:51:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,042
java
/* * Copyright 2016 Andrey Tolpeev * * 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.github.vase4kin.teamcityapp.account.create.presenter; import android.text.TextUtils; import com.github.vase4kin.teamcityapp.account.create.data.CreateAccountDataManager; import com.github.vase4kin.teamcityapp.account.create.data.CreateAccountDataModel; import com.github.vase4kin.teamcityapp.account.create.data.CustomOnLoadingListener; import com.github.vase4kin.teamcityapp.account.create.data.OnLoadingListener; import com.github.vase4kin.teamcityapp.account.create.router.CreateAccountRouter; import com.github.vase4kin.teamcityapp.account.create.tracker.CreateAccountTracker; import com.github.vase4kin.teamcityapp.account.create.view.CreateAccountView; import com.github.vase4kin.teamcityapp.account.create.view.OnToolBarNavigationListener; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; @RunWith(PowerMockRunner.class) @PrepareForTest(TextUtils.class) public class CreateAccountPresenterImplTest { @Captor private ArgumentCaptor<OnToolBarNavigationListener> mOnToolBarNavigationListenerArgumentCaptor; @Captor private ArgumentCaptor<OnLoadingListener<String>> mOnLoadingListenerArgumentCaptor; @Captor private ArgumentCaptor<CustomOnLoadingListener<String>> mCustomOnLoadingListenerArgumentCaptor; @Mock private CreateAccountView mView; @Mock private CreateAccountDataManager mDataManager; @Mock private CreateAccountDataModel mDataModel; @Mock private CreateAccountRouter mRouter; @Mock private CreateAccountTracker mTracker; private CreateAccountPresenterImpl mPresenter; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this); PowerMockito.mockStatic(TextUtils.class); when(TextUtils.isEmpty(anyString())).then(new Answer<Boolean>() { @Override public Boolean answer(InvocationOnMock invocation) throws Throwable { CharSequence charSequence = (CharSequence) invocation.getArguments()[0]; return charSequence == null || charSequence.length() == 0; } }); mPresenter = new CreateAccountPresenterImpl(mView, mDataManager, mDataModel, mRouter, mTracker); } @After public void tearDown() throws Exception { verifyNoMoreInteractions(mView, mDataManager, mRouter, mTracker); } @Test public void testHandleOnCreateView() throws Exception { when(mView.isEmailEmpty()).thenReturn(true); mPresenter.handleOnCreateView(); verify(mView).initViews(eq(mPresenter)); } @Test public void testOnClick() throws Exception { when(mView.isEmailEmpty()).thenReturn(false); mPresenter.onClick(); verify(mView).isEmailEmpty(); verify(mView).showDiscardDialog(); } @Test public void testHandleOnDestroyView() throws Exception { mPresenter.handleOnDestroy(); verify(mView).onDestroyView(); } @Test public void testOnUserLoginButtonClickIfServerUrlIsNotProvided() throws Exception { mPresenter.validateUserData("", "userName", "password", false); verify(mView).hideError(); verify(mView).showServerUrlCanNotBeEmptyError(); } @Test public void testOnUserLoginButtonClickIfUserNameIsNotProvided() throws Exception { mPresenter.validateUserData("url", "", "password", false); verify(mView).hideError(); verify(mView).showUserNameCanNotBeEmptyError(); } @Test public void testOnUserLoginButtonClickIfPasswordIsNotProvided() throws Exception { mPresenter.validateUserData("url", "userName", "", false); verify(mView).hideError(); verify(mView).showPasswordCanNotBeEmptyError(); } @Test public void testValidateUserUrlIfAccountExist() throws Exception { when(mDataModel.hasAccountWithUrl("url", "userName")).thenReturn(true); mPresenter.validateUserData("url", "userName", "password", false); verify(mView).hideError(); verify(mView).showProgressDialog(); verify(mDataModel).hasAccountWithUrl(eq("url"), eq("userName")); verify(mView).showNewAccountExistErrorMessage(); verify(mView).dismissProgressDialog(); } @Test public void testValidateGuestUserUrlIfAccountExist() throws Exception { when(mDataModel.hasGuestAccountWithUrl("url")).thenReturn(true); mPresenter.validateGuestUserData("url", false); verify(mView).hideError(); verify(mView).showProgressDialog(); verify(mDataModel).hasGuestAccountWithUrl(eq("url")); verify(mView).showNewAccountExistErrorMessage(); verify(mView).dismissProgressDialog(); } @Test public void testValidateGuestUserUrlIfAccountIsNotExist() throws Exception { when(mDataModel.hasGuestAccountWithUrl("url")).thenReturn(false); mPresenter.validateGuestUserData("url", false); verify(mView).hideError(); verify(mView).showProgressDialog(); verify(mDataModel).hasGuestAccountWithUrl(eq("url")); verify(mDataManager).authGuestUser(mCustomOnLoadingListenerArgumentCaptor.capture(), eq("url"), eq(false), eq(false)); CustomOnLoadingListener<String> listener = mCustomOnLoadingListenerArgumentCaptor.getValue(); listener.onSuccess("url"); verify(mDataManager).saveGuestUserAccount(eq("url"), eq(false)); verify(mDataManager).initTeamCityService(eq("url")); verify(mView).dismissProgressDialog(); verify(mView).finish(); verify(mRouter).startRootProjectActivityWhenNewAccountIsCreated(); verify(mTracker).trackGuestUserLoginSuccess(eq(true)); listener.onFail(0, "error"); verify(mView).showError(eq("error")); verify(mView, times(2)).dismissProgressDialog(); verify(mTracker).trackGuestUserLoginFailed(eq("error")); } @Test public void testValidateUserUrlIfAccountIsNotExist() throws Exception { when(mDataModel.hasAccountWithUrl("url", "userName")).thenReturn(false); mPresenter.validateUserData("url", "userName", "password", false); verify(mView).hideError(); verify(mView).showProgressDialog(); verify(mDataModel).hasAccountWithUrl(eq("url"), eq("userName")); verify(mDataManager).authUser(mCustomOnLoadingListenerArgumentCaptor.capture(), eq("url"), eq("userName"), eq("password"), eq(false), eq(false)); CustomOnLoadingListener<String> customOnLoadingListener = mCustomOnLoadingListenerArgumentCaptor.getValue(); customOnLoadingListener.onSuccess("url"); verify(mDataManager).saveNewUserAccount(eq("url"), eq("userName"), eq("password"), eq(false), mOnLoadingListenerArgumentCaptor.capture()); OnLoadingListener<String> loadingListener = mOnLoadingListenerArgumentCaptor.getValue(); loadingListener.onSuccess("url"); verify(mDataManager).initTeamCityService(eq("url")); verify(mView).dismissProgressDialog(); verify(mView).finish(); verify(mRouter).startRootProjectActivityWhenNewAccountIsCreated(); verify(mTracker).trackUserLoginSuccess(eq(true)); loadingListener.onFail(""); verify(mView).showCouldNotSaveUserError(); verify(mView, times(2)).dismissProgressDialog(); verify(mTracker).trackUserDataSaveFailed(); customOnLoadingListener.onFail(0, "error"); verify(mView).showError(eq("error")); verify(mView, times(3)).dismissProgressDialog(); verify(mTracker).trackUserLoginFailed(eq("error")); } @Test public void testOnGuestUserLoginButtonClickIfServerUrlIsNotProvided() throws Exception { mPresenter.validateGuestUserData("", false); verify(mView).hideError(); verify(mView).showServerUrlCanNotBeEmptyError(); } @Test public void testDismissWithDiscardDialogIfEmailIsNotEmpty() throws Exception { when(mView.isEmailEmpty()).thenReturn(false); mPresenter.finish(); verify(mView).isEmailEmpty(); verify(mView).showDiscardDialog(); } @Test public void testDismissWithDiscardDialogIfEmailIsEmpty() throws Exception { when(mView.isEmailEmpty()).thenReturn(true); mPresenter.finish(); verify(mView).isEmailEmpty(); verify(mView).finish(); } @Test public void testHandleOnResume() throws Exception { mPresenter.handleOnResume(); verify(mTracker).trackView(); } @Test public void testOnDisableSslSwitchClick() throws Exception { mPresenter.onDisableSslSwitchClick(); verify(mView).showDisableSslWarningDialog(); } }
[ "andrey.tolpeev@gmail.com" ]
andrey.tolpeev@gmail.com
5f108d5b3bd2c6b8baf6090969ff8f220e5ded10
b97e946240221307b4046bdbc8602939dd32a26c
/cast-prototype/src/main/java/model/Empleado.java
b9970251286391234efd1cfdfb5fbce91161d710
[ "Apache-2.0" ]
permissive
alejosierra/javaSnippets
3b4fda16b477133ee56598b1973d34a9647c1b66
d187f7dbdee1af24f65c571bb229cf8ba05c9378
refs/heads/master
2022-12-26T22:30:35.883086
2020-10-14T00:59:36
2020-10-14T00:59:36
239,876,254
1
0
Apache-2.0
2020-10-14T00:59:37
2020-02-11T22:18:10
Java
UTF-8
Java
false
false
633
java
package model; public class Empleado { private int codigo; private String nombre; private int salario; public Empleado() { super(); } public Empleado(int codigo, String nombre, int salario) { super(); this.codigo = codigo; this.nombre = nombre; this.salario = salario; } public int getCodigo() { return codigo; } public void setCodigo(int codigo) { this.codigo = codigo; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public int getSalario() { return salario; } public void setSalario(int salario) { this.salario = salario; } }
[ "alejo@mac" ]
alejo@mac
3c2f2c00ec84c746559043bcab335c55335f192f
ba094df585b6cd93fbf9d658d19bdbb865c7b093
/Sqlite_JavaFiles/src/sqliteproject/PMT.java
2f84a4d3021eb7586542a4d32dc8eab8d9e4f757
[]
no_license
CarlosVilla00896/TeoriaBaseDatos2_ExternalFunctions
2d3e1a78a22ed54052bb4e5547f2bbf39ac44ba1
7644442cfe257d7f1c56bcc7150c5f5ee3de1f2c
refs/heads/master
2020-03-28T22:57:14.127852
2018-09-18T23:11:57
2018-09-18T23:11:57
149,267,429
0
0
null
null
null
null
UTF-8
Java
false
false
538
java
package sqliteproject; import org.sqlite.Function; import java.sql.SQLException; /** * * @author PC */ public class PMT extends Function { @Override protected void xFunc() throws SQLException { if(args()!=3){ throw new SQLException("PMT(dato1,dato2,dato3): Invalid argument count. Requires 3, but found " + args()); } double ti = value_double(0); int npr = value_int(1); double pv = value_double(2); result ((pv*ti)/(1 - (Math.pow((1 + ti), -npr)))); } }
[ "prince.vill10@gmail.com" ]
prince.vill10@gmail.com
ed58a10b54aadcd5c15b79c8c3ffa399829eae2e
07307decc9700051e0c4b4358b1bfa9576561f4e
/Experiments/kyle/app/src/main/java/com/example/worddrawing/ui/login/LoginViewModelFactory.java
dd5a850ee11c1a6dde811df0ac5e157a5d0a6df1
[]
no_license
sjs5904/SB_2_Word_Game_With_A_Drawing
f5abecc720d660e6ee10748a53543c0d70a8c5f8
a66a9e502da0bc9e087d59f0ff47be064ba480aa
refs/heads/master
2022-11-12T19:09:44.805659
2020-07-07T12:48:12
2020-07-07T12:48:12
269,506,774
0
0
null
null
null
null
UTF-8
Java
false
false
880
java
package com.example.worddrawing.ui.login; import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModelProvider; import androidx.annotation.NonNull; import com.example.worddrawing.data.LoginDataSource; import com.example.worddrawing.data.LoginRepository; /** * ViewModel provider factory to instantiate LoginViewModel. * Required given LoginViewModel has a non-empty constructor */ public class LoginViewModelFactory implements ViewModelProvider.Factory { @NonNull @Override @SuppressWarnings("unchecked") public <T extends ViewModel> T create(@NonNull Class<T> modelClass) { if (modelClass.isAssignableFrom(LoginViewModel.class)) { return (T) new LoginViewModel(LoginRepository.getInstance(new LoginDataSource())); } else { throw new IllegalArgumentException("Unknown ViewModel class"); } } }
[ "songjooseung931026@gmail.com" ]
songjooseung931026@gmail.com
f271c41e02a3f2419c42793dbcfeb1cec349655e
6c7e2f6025cdfec82b0739d9329e98ec93d1bb58
/contribs/vsp/src/main/java/playground/vsp/vis/processingExamples/Assignment.java
e6f2c2075ff1a75081d2ae0d5a1511d7b2beeae7
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
Thomas960707/matsim
5447a69a2cdcab83145d18a5d83886355503d770
90f3f5bc597465750e6d4194ce3604248ff8851f
refs/heads/master
2020-09-06T03:27:59.514366
2019-11-06T09:06:14
2019-11-06T09:06:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,203
java
package playground.vsp.vis.processingExamples; import processing.core.PApplet; public class Assignment extends PApplet { private final int xsize=800, ysize=800 ; public static void main( String[] args ) { PApplet.main( new String[] { "--present", "playground.vsp.vis.processingExamples.Assignment"} ); } int ii=0 ; int cnt = 0 ; @Override public void draw() { background(0) ; lights() ; // both translate and rotate are with respect to content coordinates translate(xsize/2,2*ysize/3,0) ; rotateX(-1.3f*HALF_PI) ; rotateZ(-0.001f*ii) ; // translate(0,0,ysize) ; ii++; float originX = 0 ; float originY = 0 ; float originZ = 0 ; this.strokeWeight(1); // this.stroke(255,0,0) ; // this.line(originX, originY, originZ, originX+500, originY, originZ); // // this.stroke(0,255,0) ; // this.line(originX, originY, originZ, originX, originY+500, originZ); // // this.stroke(0,0,255) ; // this.line(originX, originY, originZ, originX, originY, originZ-500); noStroke() ; if ( cnt>=1 ) { drawFlow(-300, -100, -100, 0, 0, 0xFFFF0000 ); drawFlow(-100, 0, 100, 0, 0, 0xFFFF0000 ); drawFlow(100, 0, 300, 100,0, 0xFFFF0000 ); } if ( cnt >=2 ) { drawFlow(-300, 100, -100, 0, 0, 0xFF00FF00 ); drawFlow(-100, 00, 100, 0, 1, 0xFF00FF00 ); drawFlow(100, 0, 300, -100, 0, 0xFF00FF00 ); } if ( cnt >=3 ) { drawFlow(-300,100,-100,0,1, 0xFF0000FF ) ; drawFlow(-100,0,100,0,2, 0xFF0000FF ) ; drawFlow(100,0,300,100,1, 0xFF0000FF ) ; } } @Override public void mousePressed() { if ( this.mouseButton==LEFT ) { cnt++ ; } else { cnt-- ; } } private void drawFlow(float x0, float y0, float x1, float y1, float level, int color) { pushMatrix() ; { this.fill(color); translate(x0,y0,0) ; rotateZ( atan2(y1-y0, x1-x0) ) ; float length = sqrt( (x0-x1)*(x0-x1) + (y0-y1)*(y0-y1) ) ; float boxX = length ; float boxY = 20 ; float boxZ = 20 ; translate(boxX/2,boxY/2,-boxZ/2-boxZ*level) ; this.box( boxX, boxY, boxZ ) ; } popMatrix() ; } @Override public void settings() { // setup does not work here when not using the PDE size(xsize,ysize, P3D ); } }
[ "nagel@vsp.tu-berlin.de" ]
nagel@vsp.tu-berlin.de
fae3a6875c347987028394937f603522db16146e
9b29ed5b96fbd54dad1b728149c28b51b7682538
/src/imp/ComparadorCantidadObjetos.java
5ba9c50274c3cc26cbffb2a3efbf7cd8ab2584b9
[]
no_license
cordovat-dev/compare_schemas
deff7ead667370f9128a3347ddab01eb45ae9444
06dfc71ef5a7fd672c1f8fc4a9a2bbac52e0b9a7
refs/heads/master
2022-11-29T21:55:24.097970
2020-07-29T19:47:28
2020-07-29T19:47:28
283,558,779
3
0
null
null
null
null
UTF-8
Java
false
false
4,264
java
package imp; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import dis.ICategoria; import dis.IComparador; import dis.IParCategoria; import dis.Prioridad; public class ComparadorCantidadObjetos implements IComparador { List<ICategoria> categorias1 = new ArrayList<ICategoria>(); List<ICategoria> categorias2 = new ArrayList<ICategoria>(); List<IParCategoria> pares = new ArrayList<IParCategoria>(); private List<String> esquemas=new ArrayList<String>(); private Connection con1; private Connection con2; private String aliasBD1="BD1"; private String aliasBD2="BD2"; private Prioridad prioridad = Prioridad.AMBOS; public ComparadorCantidadObjetos(Connection con1_, Connection con2_){ this.con1=con1_; this.con2=con2_; } @Override public void setListaEsquemas(List<String> esquemas_) { this.esquemas = esquemas_; } @Override public void setListaEsquemas(String esquemas_) { String[] c = esquemas_.split(","); for (String s: c){ this.esquemas.add(s); } } @Override public void comparar() throws SQLException { this.categorias1 = this.Procesar(this.con1); this.categorias2 = this.Procesar(this.con2); armarPares(this.categorias1, this.categorias2); armarPares(this.categorias2, this.categorias1); } private void armarPares(List<ICategoria> cats1, List<ICategoria> cats2) { ICategoria c2; IParCategoria par; for (ICategoria c1: cats1){ par = Fabrica.getParCategoria(); if (cats2.indexOf(c1) != -1){ c2 = cats2.get(cats2.indexOf(c1)); } else { c2 = Fabrica.getCategoria(); c2.setNombre(c1.getNombre()); c2.setCantidad(0); } par.setCategoria1(c1); par.setCategoria2(c2); if (this.pares.indexOf(par) != -1){ } else { this.pares.add(par); } } } public String getCadenaItemsSQL(List<String> l) { String retorno="( "; int c = 0; for (String s: l){ c++; if (c >1){ retorno += ",'"+s+"'"; } else { retorno += "'"+s+"'"; } } return retorno+" )"; } private List<ICategoria> Procesar(Connection con_) throws SQLException { List<ICategoria> lista= new ArrayList<ICategoria>(); String sql = this.armarSQL(); PreparedStatement ps = con_.prepareStatement(sql); ResultSet rs = ps.executeQuery(); ICategoria c; while (rs.next()){ c = Fabrica.getCategoria(); c.setNombre(rs.getString("object_type")); c.setCantidad(rs.getInt("cantidad")); lista.add(c); } rs.close(); ps.close(); ps = null; rs = null; return lista; } private String armarSQL() { String sql = "select \n"+ " o.OBJECT_TYPE, \n"+ " count(*) cantidad \n"+ "from all_objects o \n" + "where 1=1 \n"; if (!this.esquemas.isEmpty()){ sql+="and o.owner in "+this.getCadenaItemsSQL(this.esquemas) +" \n"; } sql += "group by o.object_type \n"+ "union \n"+ "select \n"+ " decode(c.CONSTRAINT_TYPE,'C','CHECK_CONSTRAINT','P','PRIMARY_KEY','R','FOREIGN_KEY','U','UNIQUE_CONSTRAINT','O','CONSTRAINT_O','V','CONSTRAINT_V',c.CONSTRAINT_TYPE) object_type, \n"+ " count(*) cantidad \n"+ "from \n"+ "all_constraints c \n"+ "where 1=1 \n"; if (!this.esquemas.isEmpty()){ sql+="and c.owner in "+this.getCadenaItemsSQL(this.esquemas) +" \n"; } sql+="group by decode(c.CONSTRAINT_TYPE,'C','CHECK_CONSTRAINT','P','PRIMARY_KEY','R','FOREIGN_KEY','U','UNIQUE_CONSTRAINT','O','CONSTRAINT_O','V','CONSTRAINT_V',c.CONSTRAINT_TYPE)"; return sql; } @Override public void imprimir() throws SQLException { String s=""; System.out.println("##### CANTIDAD DE OBJETOS POR TIPO"); System.out.println(); System.out.println("Tipo\t"+this.aliasBD1+"\t"+this.aliasBD2+"\tDiff"); for (IParCategoria par: this.pares){ s=String.format("%s\t%d\t%d\t%d", par.getCategoria1().getNombre(), par.getCategoria1().getCantidad(), par.getCategoria2().getCantidad(), par.getDiferencia() ); System.out.println(s); } } @Override public void setAliasesBD(String a1, String a2) { this.aliasBD1=a1; this.aliasBD2=a2; } @Override public void setPrioridad(Prioridad p) { this.prioridad = p; } }
[ "cordovat@gmail.com" ]
cordovat@gmail.com
4b45d822b12eeae1c36045b50ae574af4c9cd5c4
e2c505707850b3957f03766029b26ca6af876aa1
/src/unsw/dungeon/LevelSceneController.java
34c456bf9ed2374d659eee7c662130c05147e0e0
[]
no_license
Walter-White-Heisenberg/COMP2511-project
f1f23ed130f7e75d0ea8febdbe0bed25c1f96c18
8864a727ce8e439ef252952a22811e7481581d30
refs/heads/main
2023-08-17T18:55:57.506131
2021-09-22T09:30:07
2021-09-22T09:30:07
409,141,222
0
0
null
null
null
null
UTF-8
Java
false
false
2,985
java
package unsw.dungeon; import java.io.File; import java.io.IOException; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.geometry.Insets; import javafx.scene.control.Button; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.Background; import javafx.scene.layout.BackgroundFill; import javafx.scene.layout.CornerRadii; import javafx.scene.paint.Color; public class LevelSceneController extends Controller{ @FXML private ImageView background; @FXML private Button easy; @FXML private Button hard; @FXML private Button medium; @FXML private Button back; public LevelSceneController(){ } @FXML public void initialize() { Image ground = new Image((new File("images/background.jpg")).toURI().toString()); BackgroundFill fill = new BackgroundFill(Color.valueOf("#9e7c3d"), CornerRadii.EMPTY, Insets.EMPTY); Background buttonbackground = new Background(fill); easy.setBackground(buttonbackground); medium.setBackground(buttonbackground); hard.setBackground(buttonbackground); back.setBackground(buttonbackground); background.setImage(ground); } /** * the load the easy map after the easy button is pressed * @param event the event come from the handler * @throws IOException to deal with failed opening of fxml file */ @FXML public void handleEasy(ActionEvent event) throws IOException { load_level("easy.json", event); } /** * the load the medium map after the medium button is pressed * @param event the event come from the handler * @throws IOException to deal with failed opening of fxml file */ @FXML public void handleMedium(ActionEvent event) throws IOException { load_level("medium.json", event); } /** * the load the hard map after the hard button is pressed * @param event the event come from the handler * @throws IOException to deal with failed opening of fxml file */ @FXML public void handleHard(ActionEvent event) throws IOException { load_level("hard.json", event); } /** * the load the starting menu after the back button is pressed * @param event the event come from the handler * @throws IOException to deal with failed opening of fxml file */ @FXML public void handleBack(ActionEvent event) throws IOException { changeScence("StartScene.fxml", null, event); } /** * load json from different level in to the game * @param name_of_json shows which map to be used for a specific level * @param event the event come from the handler * @throws IOException to deal with failed opening of fxml file */ public void load_level(String name_of_json, ActionEvent event) throws IOException { changeScence("DungeonView.fxml", name_of_json, event); } }
[ "Phranqueli@gmail.com" ]
Phranqueli@gmail.com
3cff32236b15367acf028df7a5495e755f27dcb4
c2450936af8d1be7be62481887ca73348d11bd6f
/src/lfs/common/UnderFileSystemHdfs.java
86135e1de3ef67f0d968c7a981a6e4f18cdad411
[]
no_license
jameswu0629/lfs
d89bbfe1133cde1edf62d954cc4282708a9ad246
1d29edcf62398199e3a188f3f76f44e8106349fd
refs/heads/master
2021-01-10T10:34:52.387643
2014-05-11T08:48:35
2014-05-11T08:48:35
52,334,401
0
0
null
null
null
null
UTF-8
Java
false
false
8,530
java
package lfs.common; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.BlockLocation; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hdfs.DistributedFileSystem; import org.apache.log4j.Logger; /** * HDFS UnderFilesystem implementation. */ public class UnderFileSystemHdfs extends UnderFileSystem { private static final int MAX_TRY = 5; private final Logger LOG = Logger.getLogger(UnderFileSystemHdfs.class); private FileSystem mFs = null; private String mUfsPrefix = null; // TODO add sticky bit and narrow down the permission in hadoop 2 private static final FsPermission PERMISSION = new FsPermission( (short) 0777) .applyUMask(FsPermission.createImmutable((short) 0000)); public static UnderFileSystemHdfs getClient(String path) { return new UnderFileSystemHdfs(path); } private UnderFileSystemHdfs(String fsDefaultName) { try { mUfsPrefix = fsDefaultName; Configuration tConf = new Configuration(); // tConf.set("fs.defaultFS", fsDefaultName); // tConf.set("fs.hdfs.impl", CommonConf.get().UNDERFS_HDFS_IMPL); // if (System.getProperty("fs.s3n.awsAccessKeyId") != null) { // tConf.set("fs.s3n.awsAccessKeyId", // System.getProperty("fs.s3n.awsAccessKeyId")); // } // if (System.getProperty("fs.s3n.awsSecretAccessKey") != null) { // tConf.set("fs.s3n.awsSecretAccessKey", // System.getProperty("fs.s3n.awsSecretAccessKey")); // } Path path = new Path(fsDefaultName); mFs = path.getFileSystem(tConf); // FileSystem.get(tConf); // mFs = FileSystem.get(new URI(fsDefaultName), tConf); } catch (IOException e) { LOG.error(e.getMessage()); throw new RuntimeException(e); } } @Override public void toFullPermission(String path) { try { FileStatus fileStatus = mFs.getFileStatus(new Path(path)); LOG.info("Changing file '" + fileStatus.getPath() + "' permissions from: " + fileStatus.getPermission() + " to 777"); mFs.setPermission(fileStatus.getPath(), PERMISSION); } catch (IOException e) { LOG.error(e); } } @Override public void close() throws IOException { mFs.close(); } @Override public FSDataOutputStream create(String path) throws IOException { IOException te = null; int cnt = 0; while (cnt < MAX_TRY) { try { LOG.debug("Creating HDFS file at " + path); return FileSystem.create(mFs, new Path(path), PERMISSION); } catch (IOException e) { cnt++; LOG.error(cnt + " : " + e.getMessage(), e); te = e; continue; } } throw te; } @Override // BlockSize should be a multiple of 512 public FSDataOutputStream create(String path, int blockSizeByte) throws IOException { // TODO Fix this // return create(path, (short) Math.min(3, mFs.getDefaultReplication()), // blockSizeByte); return create(path); } @Override public FSDataOutputStream create(String path, short replication, int blockSizeByte) throws IOException { // TODO Fix this // return create(path, (short) Math.min(3, mFs.getDefaultReplication()), // blockSizeByte); return create(path); // LOG.info(path + " " + replication + " " + blockSizeByte); // IOException te = null; // int cnt = 0; // while (cnt < MAX_TRY) { // try { // return mFs.create(new Path(path), true, 4096, replication, // blockSizeByte); // } catch (IOException e) { // cnt ++; // LOG.error(cnt + " : " + e.getMessage(), e); // te = e; // continue; // } // } // throw te; } @Override public boolean delete(String path, boolean recursive) throws IOException { LOG.debug("deleting " + path + " " + recursive); IOException te = null; int cnt = 0; while (cnt < MAX_TRY) { try { return mFs.delete(new Path(path), recursive); } catch (IOException e) { cnt++; LOG.error(cnt + " : " + e.getMessage(), e); te = e; continue; } } throw te; } @Override public boolean exists(String path) { IOException te = null; int cnt = 0; while (cnt < MAX_TRY) { try { return mFs.exists(new Path(path)); } catch (IOException e) { cnt++; LOG.error(cnt + " : " + e.getMessage(), e); te = e; continue; } } throw new RuntimeException(te); } @Override public String[] list(String path) throws IOException { FileStatus[] files = mFs.listStatus(new Path(path)); if (files != null) { String[] rtn = new String[files.length]; int i = 0; for (FileStatus status : files) { rtn[i++] = status.getPath().toString() .substring(mUfsPrefix.length()); } return rtn; } else { return null; } } @Override public List<String> getFileLocations(String path) { return getFileLocations(path, 0); } @Override public List<String> getFileLocations(String path, long offset) { List<String> ret = new ArrayList<String>(); try { FileStatus fStatus = mFs.getFileStatus(new Path(path)); BlockLocation[] bLocations = mFs.getFileBlockLocations(fStatus, offset, 1); if (bLocations.length > 0) { String[] hosts = bLocations[0].getHosts(); Collections.addAll(ret, hosts); } } catch (IOException e) { LOG.error(e); } return ret; } @Override public long getFileSize(String path) { int cnt = 0; Path tPath = new Path(path); while (cnt < MAX_TRY) { try { FileStatus fs = mFs.getFileStatus(tPath); return fs.getLen(); } catch (IOException e) { cnt++; LOG.error(cnt + " : " + e.getMessage(), e); continue; } } return -1; } @Override public long getBlockSizeByte(String path) throws IOException { Path tPath = new Path(path); if (!mFs.exists(tPath)) { throw new FileNotFoundException(path); } FileStatus fs = mFs.getFileStatus(tPath); return fs.getBlockSize(); } @Override public long getModificationTimeMs(String path) throws IOException { Path tPath = new Path(path); if (!mFs.exists(tPath)) { throw new FileNotFoundException(path); } FileStatus fs = mFs.getFileStatus(tPath); return fs.getModificationTime(); } @Override public long getSpace(String path, SpaceType type) throws IOException { // Ignoring the path given, will give information for entire cluster // as Tachyon can load/store data out of entire HDFS cluster if (mFs instanceof DistributedFileSystem) { switch (type) { case SPACE_TOTAL: return ((DistributedFileSystem) mFs).getDiskStatus() .getCapacity(); case SPACE_USED: return ((DistributedFileSystem) mFs).getDiskStatus() .getDfsUsed(); case SPACE_FREE: return ((DistributedFileSystem) mFs).getDiskStatus() .getRemaining(); } } return -1; } @Override public boolean isFile(String path) throws IOException { return mFs.isFile(new Path(path)); } @Override public boolean mkdirs(String path, boolean createParent) { IOException te = null; int cnt = 0; while (cnt < MAX_TRY) { try { if (mFs.exists(new Path(path))) { return true; } return mFs.mkdirs(new Path(path), PERMISSION); } catch (IOException e) { cnt++; LOG.error(cnt + " : " + e.getMessage(), e); te = e; continue; } } throw new RuntimeException(te); } @Override public FSDataInputStream open(String path) { IOException te = null; int cnt = 0; while (cnt < MAX_TRY) { try { return mFs.open(new Path(path)); } catch (IOException e) { cnt++; LOG.error(cnt + " : " + e.getMessage(), e); te = e; continue; } } throw new RuntimeException(te); } @Override public boolean rename(String src, String dst) { IOException te = null; int cnt = 0; LOG.debug("Renaming from " + src + " to " + dst); if (!exists(src)) { LOG.error("File " + src + " does not exist. Therefore rename to " + dst + " failed."); } if (exists(dst)) { LOG.error("File " + dst + " does exist. Therefore rename from " + src + " failed."); } while (cnt < MAX_TRY) { try { return mFs.rename(new Path(src), new Path(dst)); } catch (IOException e) { cnt++; LOG.error(cnt + " : " + e.getMessage(), e); te = e; continue; } } throw new RuntimeException(te); } }
[ "lining127x@gmail.com" ]
lining127x@gmail.com
6f7804f8034b8a109f4a24b605c47ccd8c12dd1d
220ce415f0ec4a661021b89ce5e44229c9deeff2
/app/src/main/java/com/lokesh/interviewprep/edua5.java
03da05bf0fa8773ae6fb78eecbd3201440d14e5a
[]
no_license
lokesh2021/InterviewPrep
4a30bf7aaaa089a81deac1c84642fd2c7c650171
2b5037890f208a8a1617bf8d602e9e8b4e40a7fb
refs/heads/master
2022-03-03T16:23:36.662637
2019-09-15T05:25:56
2019-09-15T05:25:56
208,546,431
0
0
null
null
null
null
UTF-8
Java
false
false
911
java
package com.lokesh.interviewprep; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class edua5 extends AppCompatActivity { private Button b; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edua5); b= (Button)findViewById(R.id.edulinka5); b.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View view) { Intent i = new Intent(edua5.this,edulinka5.class); startActivity(i); } } ); } }
[ "lokeshbandi2021@gmail.com" ]
lokeshbandi2021@gmail.com
5553029612d94a49b4c5b6f33a65267e039514d5
68abf27d3bc1f750c269757624af6f489c3ced87
/src/main/java/com/bunq/sdk/model/generated/endpoint/TreeProgress.java
2168d3e497e1cb59f9c81178a4221af4441ecd82
[ "MIT" ]
permissive
NilsTellow/sdk_java
341454991ecb312c0ee0eac65d4236db6a637ef2
e9fedf4ea6a25e110bcba2ba6ca8f9db977a4d42
refs/heads/master
2022-04-28T09:00:42.779675
2020-04-28T07:38:53
2020-04-28T07:38:53
259,553,568
0
0
MIT
2020-04-28T06:40:15
2020-04-28T06:40:15
null
UTF-8
Java
false
false
2,680
java
package com.bunq.sdk.model.generated.endpoint; import com.bunq.sdk.http.ApiClient; import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import java.math.BigDecimal; import java.util.List; import java.util.Map; /** * See how many trees this user has planted. */ public class TreeProgress extends BunqModel { /** * Endpoint constants. */ protected static final String ENDPOINT_URL_LISTING = "user/%s/tree-progress"; /** * Object type. */ protected static final String OBJECT_TYPE_GET = "TreeProgress"; /** * The number of trees this user and all users have planted. */ @Expose @SerializedName("number_of_tree") private BigDecimal numberOfTree; /** * The progress towards the next tree. */ @Expose @SerializedName("progress_tree_next") private BigDecimal progressTreeNext; /** * */ public static BunqResponse<List<TreeProgress>> list(Map<String, String> params, Map<String, String> customHeaders) { ApiClient apiClient = new ApiClient(getApiContext()); BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_LISTING, determineUserId()), params, customHeaders); return fromJsonList(TreeProgress.class, responseRaw, OBJECT_TYPE_GET); } public static BunqResponse<List<TreeProgress>> list() { return list(null, null); } public static BunqResponse<List<TreeProgress>> list(Map<String, String> params) { return list(params, null); } /** * */ public static TreeProgress fromJsonReader(JsonReader reader) { return fromJsonReader(TreeProgress.class, reader); } /** * The number of trees this user and all users have planted. */ public BigDecimal getNumberOfTree() { return this.numberOfTree; } public void setNumberOfTree(BigDecimal numberOfTree) { this.numberOfTree = numberOfTree; } /** * The progress towards the next tree. */ public BigDecimal getProgressTreeNext() { return this.progressTreeNext; } public void setProgressTreeNext(BigDecimal progressTreeNext) { this.progressTreeNext = progressTreeNext; } /** * */ public boolean isAllFieldNull() { if (this.numberOfTree != null) { return false; } if (this.progressTreeNext != null) { return false; } return true; } }
[ "nick@bunq.com" ]
nick@bunq.com
d8d5d12a661a70f1976ff030f43b5ad2f2ad0f64
a1a185e3ea226c62b99086db33f70604cc611476
/sofa-demo/sofaboot_server/src/main/java/com/citydo/sofaboot_server/service/SampleGenericService.java
302960225c62a46f5230d4459de292cb28a1451b
[]
no_license
jianbo-feng/public-repository
4a680b1401c9fd2f7ba72386330a80079ee2d129
5481d6ebbb0b15374dfe08b8cd3d61e1eb692703
refs/heads/master
2022-08-11T06:07:02.485707
2020-05-27T14:11:29
2020-05-27T14:11:29
186,141,931
1
6
null
2022-06-21T01:12:00
2019-05-11T14:19:24
Java
UTF-8
Java
false
false
310
java
package com.citydo.sofaboot_server.service; import com.citydo.sofaboot_server.model.SampleGenericParamModel; import com.citydo.sofaboot_server.model.SampleGenericResultModel; public interface SampleGenericService { SampleGenericResultModel sayGeneric(SampleGenericParamModel sampleGenericParamModel); }
[ "445121408@qq.com" ]
445121408@qq.com
7f604490e9f59d92d5e9e3e97b73f33f5360fcc5
3c9b9ccc3917272f4f582886aeac7d53c17fb45f
/src/main/java/br/ce/jsamuel/rest/UserJsonTest.java
74f78bb37191b52a34f420825752f6653878d835
[]
no_license
samuelluz98/Testes-com-Rest-Assured
c669fecd574b781142aed0696040d3f6cf7b15aa
08046ccd9cd28dc61c5e67313ad415739033e468
refs/heads/master
2023-02-22T06:36:56.116044
2021-01-23T19:31:24
2021-01-23T19:31:24
326,463,084
1
0
null
null
null
null
WINDOWS-1250
Java
false
false
4,368
java
package br.ce.jsamuel.rest; import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.*; import java.util.ArrayList; import java.util.Arrays; import org.junit.Assert; import org.junit.Test; import io.restassured.RestAssured; import io.restassured.http.Method; import io.restassured.path.json.JsonPath; import io.restassured.response.Response; public class UserJsonTest { @Test public void deveVerificarPrimeiroNivel() { given() .when() .get("http://restapi.wcaquino.me/users/1") .then() .statusCode(200) .body("id", is(1)) .body("name", containsString("Silva")) .body("age", greaterThan(18)); } @Test public void deveVerificarPrimeiroNivelOutrasFormas() { // Obter o response Response response = RestAssured.request(Method.GET, "http://restapi.wcaquino.me/users/1"); // path System.out.println(response.path("id")); // Outra forma de fazer Assert.assertEquals(new Integer(1), response.path("id")); Assert.assertEquals(new Integer(1), response.path("%s", "id")); //JSonPath JsonPath Jpath = new JsonPath(response.asString()); Assert.assertEquals(1, Jpath.getInt("id")); //From int id = JsonPath.from(response.asString()).getInt("id"); Assert.assertEquals(1, id); } @Test public void deveVerificarSegundoNivel() { given() .when() .get("http://restapi.wcaquino.me/users/2") .then() .statusCode(200) .body("name", containsString("Joaquina")) .body("endereco.rua",is("Rua dos bobos")); } @Test public void deveVerificarLista() { given() .when() .get("http://restapi.wcaquino.me/users/3") .then() .statusCode(200) .body("name", containsString("Ana")) .body("filhos", hasSize(2)) .body("filhos[0].name", is("Zezinho")) .body("filhos[1].name", is("Luizinho")) .body("filhos.name", hasItem("Zezinho")) .body("filhos.name", hasItems("Zezinho", "Luizinho")) ; } @Test public void deveRetornarErroUsuarioInexistente() { given() .when() .get("http://restapi.wcaquino.me/users/4") .then() .statusCode(404) .body("error", is("Usuário inexistente")) ; } @Test public void deveVerificarListaNaRaiz() { given() .when() .get("http://restapi.wcaquino.me/users") .then() .statusCode(200) .body("$", hasSize(3)) .body("name", hasItems("Joăo da Silva", "Maria Joaquina", "Ana Júlia")) .body("age[1]", is(25)) .body("filhos.name", hasItem(Arrays.asList("Zezinho", "Luizinho"))) .body("salary", contains(1234.5677f, 2500, null)) ; } @Test public void devoFazerVerificacoesAvancadas() { given() .when() .get("http://restapi.wcaquino.me/users") .then() .statusCode(200) .body("$", hasSize(3)) .body("age.findAll{it <= 25}.size()", is(2)) .body("age.findAll{it <= 25 && it > 20}.size()", is(1)) .body("findAll{it.age <= 25 && it.age > 20}.name", hasItem("Maria Joaquina")) .body("findAll{it.age <= 25}[0].name", is("Maria Joaquina")) .body("findAll{it.age <= 25}[-1].name", is("Ana Júlia")) .body("find{it.age <= 25}.name", is("Maria Joaquina")) .body("findAll{it.name.contains('n')}.name", hasItems("Maria Joaquina", "Ana Júlia")) .body("findAll{it.name.length() > 10}.name", hasItems("Joăo da Silva", "Maria Joaquina")) .body("name.collect{it.toUpperCase()}", hasItem("MARIA JOAQUINA")) .body("name.findAll{it.startsWith('Maria')}.collect{it.toUpperCase()}", hasItem("MARIA JOAQUINA")) .body("name.findAll{it.startsWith('Maria')}.collect{it.toUpperCase()}.toArray()", allOf(arrayContaining("MARIA JOAQUINA"), arrayWithSize(1))) .body("age.collect{it * 2}", hasItems(60, 50)) .body("id.max()", is(3)) .body("salary.min()", is(1234.5678f)) .body("salary.findAll{it != null}.sum()", is(closeTo(3734.5678f, 0.001))) .body("salary.findAll{it != null}.sum()", allOf(greaterThan(3000d), lessThan(5000d))) ; } @Test public void devoUnirJsonPathComJAVA() { ArrayList<String> names = given() .when() .get("http://restapi.wcaquino.me/users") .then() .statusCode(200) .extract().path("name.findAll{it.startsWith('Maria')}") ; Assert.assertEquals(1, names.size()); Assert.assertTrue(names.get(0).equalsIgnoreCase("maria joaquina")); Assert.assertEquals(names.get(0).toUpperCase(), "maria joaquina".toUpperCase()); } }
[ "jose.samuel@dcx.ufpb.br" ]
jose.samuel@dcx.ufpb.br
db1ae14f25f2ad4fa8561f0c62e6498c44b6369b
d9eb47ae0899dd09c4df41beb71431b1a9d3dd45
/buzmgt/src/main/java/com/wangge/buzmgt/monthTask/repository/MonthTaskRepository.java
9bb3af9472f62f620a4c9a543114302c126f5322
[]
no_license
shy1990/buzmgt
cc021cb475eeeb60e4a31c48e9e01239bb57c963
ca7a2ba7b85a13232b82f8d81aa7b20192c6b5be
refs/heads/master
2020-06-14T16:27:53.560258
2016-09-30T03:11:43
2016-09-30T03:11:43
75,163,898
0
0
null
null
null
null
UTF-8
Java
false
false
2,346
java
package com.wangge.buzmgt.monthTask.repository; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.EntityGraph; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RestResource; import com.wangge.buzmgt.monthTask.entity.MonthTask; public interface MonthTaskRepository extends JpaRepository<MonthTask, Long> { /** * 通过区域来获取业务员列表 * * @param month * @param regionId * @param page * @return */ @EntityGraph("monthData") Page<MonthTask> findByMonthAndRegionidLike(String month, String regionId, Pageable page); /** * 通过业务员姓名和月份来查找主任务 * * @param month * @param salesManName * @param page * @return */ @EntityGraph("monthData") Page<MonthTask> findByMonthAndMonthData_Salesman_TruenameLike(String month, String salesManName, Pageable page); /** * 通过月份,发布状态和区号获取查找列表 * * @param month * @param status * @param regionId * @param page * @return */ @EntityGraph("monthData") Page<MonthTask> findByMonthAndStatusAndRegionidLike(String month, Integer status, String regionId, Pageable page); /** * 通过月份,发布状态,业务员姓名获取列表 * * @param month * @param status * @param trueName * @param page * @return */ @EntityGraph("monthData") Page<MonthTask> findByMonthAndStatusAndMonthData_Salesman_TruenameLike(String month, Integer status, String trueName, Pageable page); /** * 通过状态和业务员姓名查找 * * @param status * @param trueName * @param page * @return */ @EntityGraph("monthData") Page<MonthTask> findByStatusAndMonthData_Salesman_TruenameLike(Integer status, String trueName, Pageable page); /** * 统计一个区域当月的已派发的任务 * * @param month * @param status * @return */ Long countByMonthAndStatusAndRegionidLike(String month, Integer status, String regionId); /** * 通过id查找信息,返回相关历史数据 * * @param id * @return */ @RestResource(path = "monthTask", rel = "monthTask") @EntityGraph("monthData") MonthTask findById(@Param("id") long id); }
[ "954691592@qq.com" ]
954691592@qq.com
5bb147abeb3a69a968bda6195bdaf9e8cea26f3c
eba4d65cbd2ea0b455c8677ade882f5c20a46bc2
/nuxeo-core/nuxeo-core-schema/src/main/java/org/nuxeo/ecm/core/schema/PropertyDeprecationHandler.java
6c82289763bdc68dff4aa8456ea9faff42ec4d1e
[ "Apache-2.0" ]
permissive
osivia/nuxeo
800860746489e6d5b386c425efe51fd39616b50a
4f20846436c1926d6ad04bc7b02dd777173ef699
refs/heads/master
2020-06-21T21:14:24.514884
2019-07-15T16:52:09
2019-07-16T10:25:05
197,547,784
0
1
Apache-2.0
2019-07-18T08:41:37
2019-07-18T08:41:36
null
UTF-8
Java
false
false
2,823
java
/* * (C) Copyright 2017 Nuxeo (http://nuxeo.com/) and others. * * 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. * * Contributors: * Kevin Leturc <kleturc@nuxeo.com> */ package org.nuxeo.ecm.core.schema; import java.util.Collections; import java.util.Map; import java.util.Set; /** * Handler used to test if a specific property is marked as deprecated/removed and to get its fallback. * * @since 9.2 * @deprecated since 11.1, use {@link PropertyCharacteristicHandler} service instead */ @Deprecated(since = "11.1") public class PropertyDeprecationHandler { /** * Deprecated/removed properties map, its mapping is: * <p> * schemaName -> propertyXPath -> fallbackXPath * </p> */ protected final Map<String, Map<String, String>> properties; public PropertyDeprecationHandler(Map<String, Map<String, String>> properties) { this.properties = properties; } /** * @return true if the input property has deprecated/removed property */ public boolean hasMarkedProperties(String schema) { return properties.containsKey(schema); } /** * Returned properties are a path to marked property. * * @return the deprecated/removed properties for input schema or an empty set if schema doesn't have marked * properties */ public Set<String> getProperties(String schema) { Map<String, String> schemaProperties = properties.get(schema); if (schemaProperties == null) { return Collections.emptySet(); } return Collections.unmodifiableSet(schemaProperties.keySet()); } /** * @return true if the input property is marked as deprecated/removed */ public boolean isMarked(String schema, String name) { Map<String, String> schemaProperties = properties.get(schema); return schemaProperties != null && schemaProperties.containsKey(name); } /** * @return the fallback of input property, if it is marked as deprecated/removed and has a fallback */ public String getFallback(String schema, String name) { Map<String, String> schemaProperties = properties.get(schema); if (schemaProperties != null) { return schemaProperties.get(name); } return null; } }
[ "kevinleturc@users.noreply.github.com" ]
kevinleturc@users.noreply.github.com
4aa050dfbf08054043e467f67d332573c38360ed
de37b42412ac588c12d54f685780c86578948538
/src/main/java/com/sdaacademy/designpaterns/decoratorPattern/MyBauturaFactory.java
603a9148552945c960ffc461ff3b524aee5f8fa0
[]
no_license
MariusFierascu/javaAdvanced
7eb8e85bd453cf38a89ccb101fd2c7868febd667
ddb828861a8eb751e447081987abc50a678c7104
refs/heads/master
2020-12-27T04:48:12.103470
2020-02-02T12:55:18
2020-02-02T12:55:18
237,770,958
0
0
null
null
null
null
UTF-8
Java
false
false
801
java
package com.sdaacademy.designpaterns.decoratorPattern; public class MyBauturaFactory implements BauturaFactory { @Override public Bautura createBautura(BauturaType bauturaType) { // CAFEA, CAFEA CU LAPTE, CAFEA CU ZAHAR, CAFEA CU ZAHAR LAPTE, CAFEA DUBLU LAPTE if (bauturaType == BauturaType.CAFEA) return new Cafea(); if (bauturaType == BauturaType.CAFEA_CU_LAPTE) return new Lapte(new Cafea()); if (bauturaType == BauturaType.CAFEA_CU_ZAHAR) return new Zahar(new Cafea()); if (bauturaType == BauturaType.CAFEA_CU_ZAHAR_LAPTE) return new Zahar(new Lapte(new Cafea())); if (bauturaType == BauturaType.CAFEA_DUBLU_LAPTE) return new Lapte(new Lapte(new Cafea())); return null; } }
[ "marius.fierascu@gmail.com" ]
marius.fierascu@gmail.com
0a40ad165a5d3b0e0b93b5e8a5aa889d8cbd6ebc
bdbf1261af80c48166d02d864658193983346217
/src/main/java/br/com/grupopibb/portalrh/controller/TmpCadastroGeralController.java
5a55e7084310224fc8abfa12aa5c48d5ce8ff628
[]
no_license
Manhattan/portalrh
d5e939048777bc4d9fb617640154b0e6f879819d
4abfb38cecbe4edc8bb3d90ddd96e2616e2983b3
refs/heads/master
2021-01-22T11:46:34.228676
2015-03-31T17:44:17
2015-03-31T17:44:17
23,804,106
0
0
null
null
null
null
UTF-8
Java
false
false
7,067
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package br.com.grupopibb.portalrh.controller; import br.com.grupopibb.portalrh.controller.commons.EntityController; import br.com.grupopibb.portalrh.controller.commons.EntityPagination; import br.com.grupopibb.portalrh.dao.CentroCustoFacade; import br.com.grupopibb.portalrh.dao.EmpresaFacade; import br.com.grupopibb.portalrh.dao.FilialFacade; import br.com.grupopibb.portalrh.dao.TmpCadastroGeralFacade; import br.com.grupopibb.portalrh.model.TmpCadastroGeral; import br.com.grupopibb.portalrh.utils.DateUtils; import br.com.grupopibb.portalrh.utils.JsfUtil; import java.io.Serializable; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Map; import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; import javax.faces.model.DataModel; import javax.faces.model.ListDataModel; import javax.faces.model.SelectItem; /** * * @author administrator */ @ManagedBean @ViewScoped public class TmpCadastroGeralController extends EntityController<TmpCadastroGeral> implements Serializable { @EJB private TmpCadastroGeralFacade tmpCadastroGeralFacade; @EJB private EmpresaFacade empresaFacade; @EJB private FilialFacade filialFacade; @EJB private CentroCustoFacade centroFacade; private String mesAno; private String cpf; private String nome; private String rg; private String nomeMae; private String situacao; private String empresa; private String filial; private String centro; private String funcao; private String matricula; @PostConstruct public void init() { mesAno = DateUtils.getMonthYearBar(new Date()); } public SelectItem[] getEmpresaSelect() { return JsfUtil.getSelectItems(empresaFacade.findAll(), false, FacesContext.getCurrentInstance()); } public SelectItem[] getFilialSelect() { return JsfUtil.getSelectItems(filialFacade.findByEmpresa(empresa), false, FacesContext.getCurrentInstance()); } public SelectItem[] getCentroSelect() { return JsfUtil.getSelectItems(centroFacade.findByEmpresa(empresa, filial), false, FacesContext.getCurrentInstance()); } public Map<String, Object> getMesAnoSelect() { Date data = new Date(); List<String> lista = new ArrayList<String>(); lista.add(DateUtils.getMonthYearBar(data)); lista.add(DateUtils.getMonthYearBar(DateUtils.incrementar(data, -1, Calendar.MONTH))); data = null; return JsfUtil.getMapItems(lista, false, FacesContext.getCurrentInstance()); } public void cleanFilialCentro() { filial = null; centro = null; } @Override public String clean() { cpf = null; nome = null; rg = null; nomeMae = null; situacao = null; empresa = null; filial = null; centro = null; funcao = null; matricula = null; recreateTable(); return JsfUtil.MANTEM; } @Override protected void setEntity(TmpCadastroGeral t) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override protected TmpCadastroGeral getNewEntity() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override protected void performDestroy() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override protected String create() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override protected String update() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } private TmpCadastroGeralFacade getFacade() { return tmpCadastroGeralFacade; } @Override public EntityPagination getPagination() { if (pagination == null) { pagination = new EntityPagination(15) { @Override public int getItemsCount() { return getFacade().pesqCount(cpf, nome, rg, nomeMae, situacao, empresa, filial, centro, funcao, matricula, mesAno.replace("/", "")).intValue(); } @Override public DataModel createPageDataModel() { return new ListDataModel(getFacade().listPesqParamRange(cpf, nome, rg, nomeMae, situacao, empresa, filial, centro, funcao, matricula, mesAno.replace("/", ""), new int[]{getPageFirstItem(), getPageFirstItem() + getPageSize()})); } }; } return pagination; } public void pesquisar() { recreateTable(); clearCache(); } private void clearCache() { getFacade().clearCache(); } public String getCpf() { return cpf; } public void setCpf(String cpf) { this.cpf = cpf; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getRg() { return rg; } public void setRg(String rg) { this.rg = rg; } public String getNomeMae() { return nomeMae; } public void setNomeMae(String nomeMae) { this.nomeMae = nomeMae; } public String getSituacao() { return situacao; } public void setSituacao(String situacao) { this.situacao = situacao; } public String getEmpresa() { return empresa; } public void setEmpresa(String empresa) { this.empresa = empresa; } public String getFilial() { return filial; } public void setFilial(String filial) { this.filial = filial; } public String getCentro() { return centro; } public void setCentro(String centro) { this.centro = centro; } public String getFuncao() { return funcao; } public void setFuncao(String funcao) { this.funcao = funcao; } public String getMatricula() { return matricula; } public void setMatricula(String matricula) { this.matricula = matricula; } public String getMesAno() { return mesAno; } public void setMesAno(String mesAno) { this.mesAno = mesAno; } }
[ "tone.lima@gpdttecw0801.grupopibb.corp" ]
tone.lima@gpdttecw0801.grupopibb.corp
ed48862c7f6199cf8a7b8fe0c1bd4f648e726c6a
0c4324b99e861e4651d93cdbcbbf737cf873bfef
/src/lesson4/rightHomeWork/DoubleRelatedList.java
eca78fc29f6d9803cd8f7a7f8c18494b0a6bf1a8
[]
no_license
EvgenySaenko/Algorithms-and-data-structures
568a2abaacbfb7937c8e536eb137ac6c82d9a2cb
633317adc968eb628e5af7fc908b25b908943482
refs/heads/homework
2022-11-16T13:20:07.476832
2020-07-15T09:44:19
2020-07-15T09:44:19
275,114,092
0
0
null
2020-07-17T11:26:08
2020-06-26T08:58:25
Java
UTF-8
Java
false
false
5,902
java
package lesson4.rightHomeWork; import java.util.Objects; public class DoubleRelatedList<T> { private class Iter implements MyIterator<T> { Node<T> current; @Override public void reset() { current = head; } @Override public boolean atEnd() { if (!listExists()) throw new RuntimeException("iterator is null"); return current.next == null; } @Override public boolean atBegin() { if (!listExists()) throw new RuntimeException("iterator is null"); return current.prev == null; } private boolean listExists() { return iterator != null; } @Override public T deleteCurrent() { if (!listExists()) throw new RuntimeException("iterator is null"); T temp = current.c; if (atBegin() && atEnd()) { head = null; tail = null; reset(); } else if (atBegin()) { head = current.next; head.prev = null; reset(); } else if (atEnd()) { tail = current.prev; tail.next = null; current = current.next; } else { current.prev.next = current.next; current.next.prev = current.prev; } return temp; } @Override public void insertAfter(T c) { if (!listExists()) throw new RuntimeException("iterator is null"); Node<T> temp = new Node<>(c); if (!atEnd()) { temp.next = current.next; current.next.prev = temp; } else { tail = temp; } current.next = temp; temp.prev = current; } @Override public void insertBefore(T c) { if (!listExists()) throw new RuntimeException("iterator is null"); Node<T> temp = new Node<>(c); if (!atBegin()) { temp.prev = current.prev; current.prev.next = temp; } else { head = temp; } current.prev = temp; temp.next = current; } @Override public T getCurrent() { if (!listExists()) throw new RuntimeException("iterator is null"); return current.c; } @Override public boolean hasNext() { if (!listExists()) throw new RuntimeException("iterator is null"); return current.next != null; } @Override public T next() { if (!listExists()) throw new RuntimeException("iterator is null"); current = current.next; return current.prev.c; } } private class Node<T> { T c; Node<T> next; Node<T> prev; public Node(T c) { this.c = c; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Node)) return false; Node<?> node = (Node<?>) o; return Objects.equals(c, node.c); } @Override public int hashCode() { return Objects.hash(c); } @Override public String toString() { return c.toString(); } } private Node<T> head; private Node<T> tail; private MyIterator<T> iterator; public DoubleRelatedList() { head = null; tail = null; iterator = new Iter(); iterator.reset(); } public boolean isEmpty() { return head == null; } public void push(Cat c) { Node n = new Node<>(c); n.next = head; // if (head == null) n.next = null; if (head == null) { tail = n; } else { head.prev = n; } head = n; iterator.reset(); } public T pop() { if (isEmpty()) return null; T c = tail.c; if (tail.prev != null) { tail.prev.next = null; tail = tail.prev; iterator.reset(); } else { tail = null; head = null; iterator = null; } return c; } public boolean contains(T c) { Node<T> n = new Node<>(c); Node<T> current = head; while (!current.equals(n)) { if (current.next == null) return false; else current = current.next; } return true; } public T delete(T c) { Node<T> n = new Node<>(c); Node<T> current = head; Node<T> previous = head; while (!current.equals(n)) { if (current.next == null) return null; else { previous = current; current = current.next; } } if (current == head && current == tail) { head = null; tail = null; iterator = null; } else if (current == head) { head.next.prev = null; head = head.next; } else if (current == tail) { tail.prev.next = null; tail = tail.prev; } else { previous.next = current.next; current.next.prev = previous; } return current.c; } @Override public String toString() { if (isEmpty()) return "[]"; Node current = head; StringBuilder sb = new StringBuilder("[ "); while (current != null) { sb.append(current); current = current.next; sb.append((current == null) ? " ]" : ", "); } return sb.toString(); } public MyIterator<T> getIterator() { return iterator; } }
[ "storn84@mail.ru" ]
storn84@mail.ru
0502cd3d8875ee7d61348adc0b3788ac87608a7f
20eb62855cb3962c2d36fda4377dfd47d82eb777
/newEvaluatedBugs/Jsoup_45_buggy/mutated/1346/QueryParser.java
63f4bf744ee03282269af47b4ec5ca8c17674602
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,292
java
package org.jsoup.select; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import org.jsoup.helper.StringUtil; import org.jsoup.helper.Validate; import org.jsoup.parser.TokenQueue; /** * Parses a CSS selector into an Evaluator tree. */ class QueryParser { private final static String[] combinators = {",", ">", "+", "~", " "}; private TokenQueue tq; private String query; private List<Evaluator> evals = new ArrayList<Evaluator>(); /** * Create a new QueryParser. * @param query CSS query */ private QueryParser(String query) { this.query = query; this.tq = new TokenQueue(query); } /** * Parse a CSS query into an Evaluator. * @param query CSS query * @return Evaluator */ public static Evaluator parse(String query) { QueryParser p = new QueryParser(query); return p.parse(); } /** * Parse the query * @return Evaluator */ Evaluator parse() { tq.consumeWhitespace(); if (tq.matchesAny(combinators)) { // if starts with a combinator, use root as elements evals.add(new StructuralEvaluator.Root()); combinator(tq.consume()); } else { findElements(); } while (!tq.isEmpty()) { // hierarchy and extras boolean seenWhite = tq.consumeWhitespace(); if (tq.matchChomp(",")) { // group or CombiningEvaluator.Or or = new CombiningEvaluator.Or(evals); evals.clear(); evals.add(or); while (!tq.isEmpty()) { String subQuery = tq.chompTo(","); or.add(parse(subQuery)); } } else if (tq.matchesAny(combinators)) { combinator(tq.consume()); } else if (seenWhite) { combinator(' '); } else { // E.class, E#id, E[attr] etc. AND findElements(); // take next el, #. etc off queue } } if (evals.size() == 1) return evals.get(0); return new CombiningEvaluator.And(evals); } private void combinator(char combinator) { tq.consumeWhitespace(); String subQuery = consumeSubQuery(); // support multi > childs Evaluator e; if (evals.size() == 1) e = evals.get(0); else e = new CombiningEvaluator.And(evals); evals.clear(); Evaluator f = parse(subQuery); if (combinator == '>') evals.add(new CombiningEvaluator.And(f, new StructuralEvaluator.ImmediateParent(e))); else if (combinator == ' ') evals.add(new CombiningEvaluator.And(f, new StructuralEvaluator.Parent(e))); else if (combinator == '+') evals.add(new CombiningEvaluator.And(f, new StructuralEvaluator.ImmediatePreviousSibling(e))); else if (combinator == '~') evals.add(new CombiningEvaluator.And(f, new StructuralEvaluator.PreviousSibling(e))); else throw new Selector.SelectorParseException("Unknown combinator: " + combinator); } private String consumeSubQuery() { StringBuilder sq = new StringBuilder(); while (!tq.isEmpty()) { if (tq.matches("(")) sq.append("(").append(tq.chompBalanced('(', ')')).append(")"); else if (tq.matches("[")) sq.append("[").append(tq.chompBalanced('[', ']')).append("]"); else if (tq.matchesAny(combinators)) break; else sq.append(tq.consume()); } return sq.toString(); } private void findElements() { if (tq.matchChomp("#")) byId(); else if (tq.matchChomp(".")) byClass(); else if (tq.matchesWord()) byTag(); else if (tq.matches("[")) byAttribute(); else if (tq.matchChomp("*")) allElements(); else if (tq.matchChomp(":lt(")) indexLessThan(); else if (indexGreaterThan(); tq.matchChomp(":gt(")) indexGreaterThan(); else if (tq.matchChomp(":eq(")) indexEquals(); else if (tq.matches(":has(")) has(); else if (tq.matches(":contains(")) contains(false); else if (tq.matches(":containsOwn(")) contains(true); else if (tq.matches(":matches(")) matches(false); else if (tq.matches(":matchesOwn(")) matches(true); else if (tq.matches(":not(")) not(); else // unhandled throw new Selector.SelectorParseException("Could not parse query '%s': unexpected token at '%s'", query, tq.remainder()); } private void byId() { String id = tq.consumeCssIdentifier(); Validate.notEmpty(id); evals.add(new Evaluator.Id(id)); } private void byClass() { String className = tq.consumeCssIdentifier(); Validate.notEmpty(className); evals.add(new Evaluator.Class(className.trim().toLowerCase())); } private void byTag() { String tagName = tq.consumeElementSelector(); Validate.notEmpty(tagName); // namespaces: if element name is "abc:def", selector must be "abc|def", so flip: if (tagName.contains("|")) tagName = tagName.replace("|", ":"); evals.add(new Evaluator.Tag(tagName.trim().toLowerCase())); } private void byAttribute() { TokenQueue cq = new TokenQueue(tq.chompBalanced('[', ']')); // content queue String key = cq.consumeToAny("=", "!=", "^=", "$=", "*=", "~="); // eq, not, start, end, contain, match, (no val) Validate.notEmpty(key); cq.consumeWhitespace(); if (cq.isEmpty()) { if (key.startsWith("^")) evals.add(new Evaluator.AttributeStarting(key.substring(1))); else evals.add(new Evaluator.Attribute(key)); } else { if (cq.matchChomp("=")) evals.add(new Evaluator.AttributeWithValue(key, cq.remainder())); else if (cq.matchChomp("!=")) evals.add(new Evaluator.AttributeWithValueNot(key, cq.remainder())); else if (cq.matchChomp("^=")) evals.add(new Evaluator.AttributeWithValueStarting(key, cq.remainder())); else if (cq.matchChomp("$=")) evals.add(new Evaluator.AttributeWithValueEnding(key, cq.remainder())); else if (cq.matchChomp("*=")) evals.add(new Evaluator.AttributeWithValueContaining(key, cq.remainder())); else if (cq.matchChomp("~=")) evals.add(new Evaluator.AttributeWithValueMatching(key, Pattern.compile(cq.remainder()))); else throw new Selector.SelectorParseException("Could not parse attribute query '%s': unexpected token at '%s'", query, cq.remainder()); } } private void allElements() { evals.add(new Evaluator.AllElements()); } // pseudo selectors :lt, :gt, :eq private void indexLessThan() { evals.add(new Evaluator.IndexLessThan(consumeIndex())); } private void indexGreaterThan() { evals.add(new Evaluator.IndexGreaterThan(consumeIndex())); } private void indexEquals() { evals.add(new Evaluator.IndexEquals(consumeIndex())); } private int consumeIndex() { String indexS = tq.chompTo(")").trim(); Validate.isTrue(StringUtil.isNumeric(indexS), "Index must be numeric"); return Integer.parseInt(indexS); } // pseudo selector :has(el) private void has() { tq.consume(":has"); String subQuery = tq.chompBalanced('(', ')'); Validate.notEmpty(subQuery, ":has(el) subselect must not be empty"); evals.add(new StructuralEvaluator.Has(parse(subQuery))); } // pseudo selector :contains(text), containsOwn(text) private void contains(boolean own) { tq.consume(own ? ":containsOwn" : ":contains"); String searchText = TokenQueue.unescape(tq.chompBalanced('(', ')')); Validate.notEmpty(searchText, ":contains(text) query must not be empty"); if (own) evals.add(new Evaluator.ContainsOwnText(searchText)); else evals.add(new Evaluator.ContainsText(searchText)); } // :matches(regex), matchesOwn(regex) private void matches(boolean own) { tq.consume(own ? ":matchesOwn" : ":matches"); String regex = tq.chompBalanced('(', ')'); // don't unescape, as regex bits will be escaped Validate.notEmpty(regex, ":matches(regex) query must not be empty"); if (own) evals.add(new Evaluator.MatchesOwn(Pattern.compile(regex))); else evals.add(new Evaluator.Matches(Pattern.compile(regex))); } // :not(selector) private void not() { tq.consume(":not"); String subQuery = tq.chompBalanced('(', ')'); Validate.notEmpty(subQuery, ":not(selector) subselect must not be empty"); evals.add(new StructuralEvaluator.Not(parse(subQuery))); } }
[ "justinwm@163.com" ]
justinwm@163.com
73d76f562671c5a6a627c9936d01c6ad7f01abe9
a57e1c885db375369e5223d58cfb1b180d54a440
/tree/node/JUMP.java
ebaa026b8130814776f3e35d8d321a4e0b1b9854
[]
no_license
danielkza/minijava
83cc92069c686022ed40d2889b7be7d61bf8595e
45d814e3bdfcd0762e35a8e2c4f1d4e749541c74
refs/heads/master
2016-09-10T23:57:27.253727
2015-11-09T18:50:48
2015-11-09T18:53:37
42,618,868
0
0
null
null
null
null
UTF-8
Java
false
false
898
java
package tree.node; import tree.*; import frame.Label; import java.util.LinkedList; public class JUMP extends Stm { public Exp exp; public LinkedList<Label> targets; public JUMP(Exp e, LinkedList<Label> t) { exp = e; targets = t; } public JUMP(Label target) { exp = new NAME(target); targets = new LinkedList<Label>(); targets.addFirst(target); } public LinkedList<Exp> kids() { LinkedList<Exp> kids = new LinkedList<Exp>(); kids.addFirst(exp); return kids; } public Stm build(LinkedList<Exp> kids) { return new JUMP(kids.getFirst(), targets); } public void accept(IntVisitor v, int d) { v.visit(this, d); } public void accept(CodeVisitor v) { v.visit(this); } public <R> R accept(ResultVisitor<R> v) { return v.visit(this); } }
[ "danielkza2@gmail.com" ]
danielkza2@gmail.com
679c53acc10e82fae14bf440410f8413d186f6a0
64e19e7ec05187fe7655284245c13f4c122af5d0
/app/src/main/java/com/xpple/jahoqy/util/PreferenceUtils.java
397385245c243db8fd6d84b6fd3432ea254886d4
[]
no_license
SengarWu/JaHoQy
4cfca8f95bfc35267d9d5acb2fa725d6160871fa
a499fdf98585ddc6d7ae0cf8bd6b75cd34dc2ef8
refs/heads/master
2020-06-26T16:45:38.294123
2016-11-23T06:47:27
2016-11-23T06:47:27
74,548,599
0
0
null
null
null
null
UTF-8
Java
false
false
2,390
java
/** * Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.xpple.jahoqy.util; import com.xpple.jahoqy.BaseClass.HXPreferenceUtils; import android.content.Context; import android.content.SharedPreferences; /** * * @deprecated this class is deprecated, please use {@link HXPreferenceUtils} * */ public class PreferenceUtils { /** * 保存Preference的name */ public static final String PREFERENCE_NAME = "saveInfo"; private static PreferenceUtils mPreferenceUtils; private PreferenceUtils() { } /** * 单例模式,获取instance实例 * * @param cxt * @return */ public synchronized static PreferenceUtils getInstance(Context cxt) { if (mPreferenceUtils == null) { mPreferenceUtils = new PreferenceUtils(); HXPreferenceUtils.init(cxt); } return mPreferenceUtils; } public void setSettingMsgNotification(boolean paramBoolean) { HXPreferenceUtils.getInstance().setSettingMsgNotification(paramBoolean); } public boolean getSettingMsgNotification() { return HXPreferenceUtils.getInstance().getSettingMsgNotification(); } public void setSettingMsgSound(boolean paramBoolean) { HXPreferenceUtils.getInstance().setSettingMsgSound(paramBoolean); } public boolean getSettingMsgSound() { return HXPreferenceUtils.getInstance().getSettingMsgSound(); } public void setSettingMsgVibrate(boolean paramBoolean) { HXPreferenceUtils.getInstance().setSettingMsgVibrate(paramBoolean); } public boolean getSettingMsgVibrate() { return HXPreferenceUtils.getInstance().getSettingMsgVibrate(); } public void setSettingMsgSpeaker(boolean paramBoolean) { HXPreferenceUtils.getInstance().setSettingMsgSpeaker(paramBoolean); } public boolean getSettingMsgSpeaker() { return HXPreferenceUtils.getInstance().getSettingMsgSpeaker(); } }
[ "76829913@qq.com" ]
76829913@qq.com
a82e3081c49f1e9b6823efbce65d62d7b5951203
f27b83243ec1d30b768b6b9667fde1c55711ade3
/sample/src/main/java/com/kimjio/customtabs/sample/MainActivity.java
9cc6c108cc7208e243f687de5649fccad7d7dd15
[ "Apache-2.0" ]
permissive
Biangkerok32/CustomTabsHelper
8edb953e6a5ffb2abd901f99d49f335ac070f7b7
9539617eea06b2a24784a936967578602bd44835
refs/heads/master
2022-12-14T08:02:43.304429
2020-09-25T15:17:05
2020-09-25T15:17:05
298,595,712
0
0
Apache-2.0
2020-09-25T14:26:55
2020-09-25T14:26:54
null
UTF-8
Java
false
false
1,434
java
package com.kimjio.customtabs.sample; import androidx.appcompat.app.AppCompatActivity; import androidx.browser.customtabs.CustomTabsIntent; import android.net.Uri; import android.os.Bundle; import android.webkit.URLUtil; import android.widget.EditText; import android.widget.Toast; import com.kimjio.customtabs.CustomTabActivityHelper; import com.kimjio.customtabs.CustomTabsHelper; import com.kimjio.customtabs.WebViewFallback; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.button).setOnClickListener(v -> { String url = ((EditText) findViewById(R.id.edit)).getText().toString(); if (URLUtil.isValidUrl(url)) { CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder() .setShowTitle(true) .build(); CustomTabsHelper.addKeepAliveExtra(this, customTabsIntent.intent); CustomTabActivityHelper.openCustomTab( this, customTabsIntent, Uri.parse(url), new WebViewFallback()); } else { Toast.makeText(this, "Not valid url", Toast.LENGTH_SHORT).show(); } }); } }
[ "kimjioh0927@gmail.com" ]
kimjioh0927@gmail.com
c13cbb4b36f018609a4108176607c191be717d90
5c334169e128678ebf01b1d4082dbd879278d12f
/Minesweeper/src/Minesweeper/Block.java
27f304b5d1a5a8b6697534e4aa20ba66e47d040e
[]
no_license
iwaken71/Minesweeper
0dca09bce73caacf00a8be30f05eb73ef245512b
64ea7b5df8bde9e2229ace6572b1859e387197a4
refs/heads/master
2021-01-22T03:39:04.191844
2014-12-04T17:56:47
2014-12-04T17:56:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
725
java
package Minesweeper; public class Block { private boolean Bom; private int BomNumber; private boolean Flag; //private boolean help; private boolean Pressed; public Block(boolean Bom){ this.Bom = Bom; this.Flag = false; //this.help = false; this.Pressed = false; this.BomNumber = -1; } public void SetBom(){ this.Bom = true; } public void SetNum(int Num){ this.BomNumber = Num; } public void SetFlag(boolean a){ this.Flag = a; } public void SetPressed(boolean a){ this.Pressed = a; } public int GetNum(){ return this.BomNumber; } public boolean isFlag(){ return this.Flag; } public boolean isBom(){ return this.Bom; } public boolean isPressed(){ return this.Pressed; } }
[ "iwaken59371518@gmail.com" ]
iwaken59371518@gmail.com
7164d9776021a4a868a95c0067a3d08e24e0f229
b9ae28af691603e43630e2a176d3b3b6f6ab533d
/src/main/java/startOop/oop/recursion/RecursionMain.java
6d1dbb6530c47cd6fdbefa157e245cc990ba78cd
[]
no_license
AndreyPotikha/HomeWorkOop
35d7c1a196366012953989244dfc758058b69b30
b7e6a1dd4d39d3f8eb9b55e520ce496a0955afd8
refs/heads/master
2021-08-30T08:15:03.741522
2017-12-17T00:19:38
2017-12-17T00:19:38
109,406,798
1
2
null
null
null
null
UTF-8
Java
false
false
1,640
java
package startOop.oop.recursion; import java.util.LinkedList; import java.util.List; public class RecursionMain { public static void main(String[] args) { // f(5); // a(3); // fromK(6); // toK(6); // System.out.println(simpelNumber(5)); System.out.println(recursion(3, 2)); List<String> kk = new LinkedList<>(); } public static boolean recursion(int n, int i) { if (n < 2) { return false; } else if (n == 2) { return true; } else if (n % i == 0) { return false; } else if (i < n / 2) { return recursion(n, i + 1); } else { return true; } } static int fibonacci(int n) { if (n == 1) { return 1; } if (n == 2) { return 1; } return fibonacci(n - 1) + fibonacci(n - 2); } static int factorialK(int k) { int result; if (k == 1) { return 1; } result = factorialK(k - 1) * k; return result; } static void toK(int k) { if (k > 2) { toK(k - 1); } System.out.println(k); } static void fromK(int k) { System.out.println(k); if (k > 2) { fromK(k - 1); } } static void f(int k) { // System.out.println(k); if (k > 2) { f(k - 1); } System.out.println(k); } static int a(int k) { if (k <= 1) { return 1; } return k + a(k - 1); } }
[ "i.popolin@gmail.com" ]
i.popolin@gmail.com
e8f3d9bfe222ef9b42218003ef213fee9e65bdb4
e29730971792da0e8a393c0e55018016fa2f880f
/src/main/java/com/example/demo/annotation/AnnotationTest.java
be78d30f11c7e53357e8766de1e57701b0fd0634
[]
no_license
lthaccount/springboot-demo
d10100ed03a3af0693998053f3bb234d8cf9a934
7b597acdedcf01659afe4b5fa5ef7f9b790d7621
refs/heads/master
2020-04-04T23:20:52.447749
2018-11-19T16:39:50
2018-11-19T16:39:50
156,355,435
0
0
null
null
null
null
UTF-8
Java
false
false
535
java
package com.example.demo.annotation; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; @Component public class AnnotationTest { public AnnotationTest(){ System.out.println("初始化"); } /** * 被@PostConstruct修饰的方法会在服务器加载Servlet的时候运行,并且只会被服务器调用一次 * 方法执行顺序在初始化方法之后 */ @PostConstruct public void init(){ System.out.println("init方法执行"); } }
[ "1160311419@qq.com" ]
1160311419@qq.com
5fa3c38584b9a0cbc10a5c769f7217b6de67c2ee
0cfe9be116b5e8bd7b5e25783e6f314e4134984b
/src/main/java/cz/kojotak/udemy/akka/actors/bigprimes/ManagerBehavior.java
b369b418d15c28d3e5017da25229d08c8ae93233
[]
no_license
kojotak/udemy-akka-in-java
288e02865029d529133c4c1753def5a63536ee2d
09c41a4cb366b7808fd57808d0296d9a4bac751e
refs/heads/main
2023-04-10T18:10:54.979829
2021-05-02T08:48:17
2021-05-02T08:48:17
356,202,800
0
0
null
null
null
null
UTF-8
Java
false
false
3,329
java
package cz.kojotak.udemy.akka.actors.bigprimes; import java.io.Serializable; import java.math.BigInteger; import java.time.Duration; import java.util.SortedSet; import java.util.TreeSet; import akka.actor.typed.ActorRef; import akka.actor.typed.Behavior; import akka.actor.typed.javadsl.AbstractBehavior; import akka.actor.typed.javadsl.ActorContext; import akka.actor.typed.javadsl.Receive; import akka.actor.typed.javadsl.Behaviors; public class ManagerBehavior extends AbstractBehavior<ManagerBehavior.Command >{ public static interface Command extends Serializable { } public static class InstructionCommand implements Command { private static final long serialVersionUID = 1L; private final String msg; private final ActorRef<SortedSet<BigInteger>> sender; public InstructionCommand(String msg, ActorRef<SortedSet<BigInteger>> sender) { super(); this.msg = msg; this.sender = sender; } public String getMsg() { return msg; } public ActorRef<SortedSet<BigInteger>> getSender() { return sender; } } public static class ResultCommand implements Command { private static final long serialVersionUID = 1L; private final BigInteger prime; public ResultCommand(BigInteger prime) { super(); this.prime = prime; } public BigInteger getPrime() { return prime; } } private class NoReponseReceivedCommand implements Command { private static final long serialVersionUID = 1L; private ActorRef<WorkerBehavior.Command> worker; public NoReponseReceivedCommand(ActorRef<WorkerBehavior.Command> worker) { super(); this.worker = worker; } public ActorRef<WorkerBehavior.Command> getWorker() { return worker; } } private ManagerBehavior(ActorContext<Command> context) { super(context); } public static Behavior<Command> create(){ return Behaviors.setup(ManagerBehavior::new); } private SortedSet<BigInteger> primes = new TreeSet<>(); private ActorRef<SortedSet<BigInteger>> sender; @Override public Receive<Command> createReceive() { return newReceiveBuilder() .onMessage(InstructionCommand.class, cmd->{ if(cmd.getMsg().equals("start")) { this.sender = cmd.getSender(); for(int i = 0; i<20; i++) { ActorRef<WorkerBehavior.Command> child = getContext().spawn(WorkerBehavior.create(), "worker"+i); askWorkersForPrime(child); } } return Behaviors.same(); }) .onMessage(ResultCommand.class, cmd->{ primes.add(cmd.getPrime()); System.out.println("received: " + primes.size() + " numbers"); if(primes.size()==20) { this.sender.tell(primes); } return Behaviors.same(); }) .onMessage(NoReponseReceivedCommand.class, cmd -> { System.out.println("Retrying with worker " + cmd.getWorker().path()); askWorkersForPrime(cmd.getWorker()); return Behaviors.same(); }) .build(); } private void askWorkersForPrime(ActorRef<WorkerBehavior.Command> worker) { getContext().ask(Command.class, worker, Duration.ofSeconds(5), (me)-> new WorkerBehavior.Command("start", me), (response, throwable) -> { if(response != null) { return response; } else { System.out.println("Worker " + worker.path() + " failed to respond."); return new NoReponseReceivedCommand(worker); } } ); } }
[ "tomas.beneda@gmail.com" ]
tomas.beneda@gmail.com
df45a6a2af28b7774a26a954b7ce2b18537d7fe9
8d9e24382bfea99d840419bbb9e2bd416119d2f2
/src/User.java
00555423d820ac58f6f8ffb44ce4c7359b56bb23
[]
no_license
HackenDoz/massey-backend
aa1e6d2807895c9676ec286c1ee781ac396f21e8
cc589e9c5671f12b3d2fd65a371b6f0f74086294
refs/heads/master
2016-09-14T14:26:27.795029
2016-05-24T13:09:18
2016-05-24T13:09:18
59,373,617
1
0
null
null
null
null
UTF-8
Java
false
false
1,812
java
import json.JSONObject; import java.io.Serializable; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.HashMap; public class User implements Serializable { public final int id; public final String username; public final String name; public final String email; public byte[] password; public byte[] salt; public HashMap<Integer, Hackathon> joinedHackathons = new HashMap<>(); public User(int id, String username, String name, String email) { this.id = id; this.username = username; this.name = name; this.email = email; } public void setPassword(byte[] pass) { SecureRandom random = new SecureRandom(); salt = new byte[64]; random.nextBytes(salt); byte[] toHash = new byte[pass.length + salt.length]; System.arraycopy(pass, 0, toHash, 0, pass.length); System.arraycopy(salt, 0, toHash, pass.length, salt.length); try { MessageDigest digest = MessageDigest.getInstance("SHA-256"); password = digest.digest(toHash); } catch(NoSuchAlgorithmException e) { System.out.println("Sha-256 failed"); e.printStackTrace(); } } public boolean verifyPassword(byte[] pass) { byte[] toHash = new byte[pass.length + salt.length]; System.arraycopy(pass, 0, toHash, 0, pass.length); System.arraycopy(salt, 0, toHash, pass.length, salt.length); try { MessageDigest digest = MessageDigest.getInstance("SHA-256"); byte[] result = digest.digest(toHash); if(result.length != password.length) { return false; } for(int i = 0; i < result.length; ++i) { if(result[i] != password[i]) return false; } return true; } catch (NoSuchAlgorithmException e) { System.out.println("SHA-256 failed"); e.printStackTrace(); } return false; } }
[ "admin@jimgao.me" ]
admin@jimgao.me
2de0e6e790b72d20cf81c40b5970e70ec7ab632b
fb768afc6c842e32c4af2f339c3d647ca2b8afa1
/hw12-WebServer/src/main/java/ru/catn/core/service/DBServiceUser.java
ba80a0fb1c0d1e0839e3e12f8dee3cb947a988a2
[]
no_license
LovchikovaES/otus_java_2019_12
072d1116479cd6b68f570f96689a11a70ff19c45
9f4d7b53124d456b50f07f015d7b06f9247dc7e8
refs/heads/master
2022-07-24T11:42:38.213661
2020-05-19T21:22:59
2020-05-19T21:22:59
230,667,170
0
0
null
2022-07-07T22:13:05
2019-12-28T21:05:45
Java
UTF-8
Java
false
false
345
java
package ru.catn.core.service; import ru.catn.core.model.User; import java.util.List; import java.util.Optional; public interface DBServiceUser { long saveUser(User user); Optional<User> getUser(long id); void saveUsers(List<User> users); Optional<List<User>> getAllUsers(); Optional<User> getByLogin(String login); }
[ "katrina_n@mail.ru" ]
katrina_n@mail.ru
bd97d5fc36a0a0566ca7795ecaab5deda193257c
35ed9cad97585d7b17d0c61be0d706b00d69705e
/src/main/java/com/Epam/JavaCore/hw16_24_01_20/cargo/service/CargoServiceImpl.java
090a76e7069b29bafe099dafa6701df63dacd700
[]
no_license
DaikerID/Epam_Java.Core
5e7792b84b24debd7c604822bd7eaa5785eb20b5
b7d7ef84a6d3dcf1c5d29233c493af0c3d33595b
refs/heads/master
2022-02-12T06:15:37.075432
2020-02-10T14:18:25
2020-02-10T14:18:25
225,964,034
2
0
null
2022-01-21T23:37:29
2019-12-04T21:54:33
Java
UTF-8
Java
false
false
2,997
java
package com.Epam.JavaCore.hw16_24_01_20.cargo.service; import com.Epam.JavaCore.hw16_24_01_20.cargo.domain.Cargo; import com.Epam.JavaCore.hw16_24_01_20.cargo.exception.unckecked.CargoDeleteConstraintViolationException; import com.Epam.JavaCore.hw16_24_01_20.cargo.repo.CargoRepo; import com.Epam.JavaCore.hw16_24_01_20.cargo.search.CargoSearchCondition; import com.Epam.JavaCore.hw16_24_01_20.transportation.domain.Transportation; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.function.BiPredicate; import java.util.function.Predicate; public class CargoServiceImpl implements CargoService { private CargoRepo cargoRepo; public CargoServiceImpl(CargoRepo cargoRepo) { this.cargoRepo = cargoRepo; } @Override public void save(Cargo cargo) { cargoRepo.save(cargo); } @Override public Cargo findById(Long id) { if (id != null) { return cargoRepo.findById(id); } return null; } @Override public Cargo getByIdFetchingTransportations(Long id) { if (id != null) { return cargoRepo.getByIdFetchingTransportations(id); } return null; } @Override public List<Cargo> getAll() { return cargoRepo.getAll(); } @Override public int countAll() { return this.cargoRepo.countAll(); } @Override public List<Cargo> findByName(String name) { Cargo[] found = cargoRepo.findByName(name); return (found == null || found.length == 0) ? Collections.emptyList() : Arrays.asList(found); } @Override public boolean deleteById(Long id) { Cargo cargo = this.getByIdFetchingTransportations(id); if (cargo != null) { List<Transportation> transportations = cargo.getTransportations(); boolean hasTransportations = transportations != null && transportations.size() > 0; if (hasTransportations) { throw new CargoDeleteConstraintViolationException(id); } return cargoRepo.deleteById(id); } else { return false; } } @Override public void printAll() { List<Cargo> allCargos = cargoRepo.getAll(); for (Cargo cargo : allCargos) { System.out.println(cargo); } } @Override public List<Cargo> filterBy(Predicate<Cargo> condition) { return cargoRepo.filterByOneCondition(condition); } @Override public <U> List<Cargo> filterBy(U param, BiPredicate<Cargo, U> condition) { return cargoRepo.filterByTwoConditions(param,condition); } @Override public boolean update(Cargo cargo) { if (cargo != null) { return cargoRepo.update(cargo); } return false; } @Override public List<Cargo> search(CargoSearchCondition cargoSearchCondition) { return cargoRepo.search(cargoSearchCondition); } }
[ "igor.havaev@gmail.com" ]
igor.havaev@gmail.com
8ab1881f4f68fdbe4a5cddb8e8d0df03360e7e7c
aae47ad34bb5c3b24fad7539960e9b20bbf59b03
/hanyi-daily/src/test/java/com/hanyi/daily/lambda/exer/TestLambda.java
4e7cf684cb90a37d6d7e7ab8f4300762201ba052
[ "Apache-2.0" ]
permissive
Dearker/middleground
201f001fbe0e31c27256e2475426a1fcadbec95f
276c174472596d1a78e38afa803c646ec412aceb
refs/heads/master
2023-06-23T20:02:42.098643
2022-09-12T14:01:41
2022-09-12T14:01:41
215,294,459
4
4
Apache-2.0
2023-06-14T22:27:08
2019-10-15T12:34:06
Java
UTF-8
Java
false
false
1,534
java
package com.hanyi.daily.lambda.exer; import java.util.Arrays; import java.util.Collections; import java.util.List; import com.hanyi.daily.lambda.stream.Employee; import org.junit.Test; public class TestLambda { private List<Employee> emps = Arrays.asList( new Employee(101, "张三", 18, 9999.99), new Employee(102, "李四", 59, 6666.66), new Employee(103, "王五", 28, 3333.33), new Employee(104, "赵六", 8, 7777.77), new Employee(105, "田七", 38, 5555.55) ); @Test public void test1(){ Collections.sort(emps, (e1, e2) -> { if(e1.getAge() == e2.getAge()){ return e1.getName().compareTo(e2.getName()); }else{ return -Integer.compare(e1.getAge(), e2.getAge()); } }); for (Employee emp : emps) { System.out.println(emp); } } @Test public void test2(){ String trimStr = strHandler("\t\t\t 我大威武 ", (str) -> str.trim()); System.out.println(trimStr); String upper = strHandler("abcdef", (str) -> str.toUpperCase()); System.out.println(upper); String newStr = strHandler("我大威武", (str) -> str.substring(2, 5)); System.out.println(newStr); } //需求:用于处理字符串 private String strHandler(String str, MyFunction mf){ return mf.getValue(str); } @Test public void test3(){ op(100L, 200L, (x, y) -> x + y); op(100L, 200L, (x, y) -> x * y); } //需求:对于两个 Long 型数据进行处理 private void op(Long l1, Long l2, MyFunction2<Long, Long> mf){ System.out.println(mf.getValue(l1, l2)); } }
[ "1823268262@qq.com" ]
1823268262@qq.com
91a03bc95134622931b00e4d8fbfa606ccb590bb
a4da92093c606e8c66fb6a19e91389f63f03a493
/src/com/hua/wedget/crouton/LifecycleCallback.java
94fa25b86ba091ddf1480c5beeed6abf80538f2a
[]
no_license
tianshiaimili/Z_MyProject
a5e4a97fc1c03374f285683ba817b706148bbd7a
0c8d52c8eb19eb35cbe760edba4e12c8850662d9
refs/heads/master
2021-01-15T23:36:39.493258
2015-01-07T02:06:19
2015-01-07T02:06:19
22,843,768
0
0
null
null
null
null
UTF-8
Java
false
false
983
java
/* * Copyright 2012 - 2014 Benjamin Weiss * * 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.hua.wedget.crouton; /** Provides callback methods on major lifecycle events of a {@link Crouton}. */ public interface LifecycleCallback { /** Will be called when your Crouton has been displayed. */ public void onDisplayed(); /** Will be called when your {@link Crouton} has been removed. */ public void onRemoved(); //public void onCeasarDressing(); }
[ "huyue52099" ]
huyue52099
7002b49c8282a030e121704c3c236df7af8eb0ac
eadbd6ba5a2d5c960ffa9788f5f7e79eeb98384d
/src/com/google/android/m4b/maps/ba/i.java
050940e1985594e096f65dc87b31157221346ba8
[]
no_license
marcoucou/com.tinder
37edc3b9fb22496258f3a8670e6349ce5b1d8993
c68f08f7cacf76bf7f103016754eb87b1c0ac30d
refs/heads/master
2022-04-18T23:01:15.638983
2020-04-14T18:04:10
2020-04-14T18:04:10
255,685,521
0
0
null
2020-04-14T18:00:06
2020-04-14T18:00:05
null
UTF-8
Java
false
false
5,036
java
package com.google.android.m4b.maps.ba; import java.io.InputStream; public final class i { private static final byte[] a = new byte['Ā']; private static final byte[] e = { 90, -18, 3, -99, 14, -41, 106, -78, 116, 63, 54, 80, 40, -121, -32, -17 }; private static final byte[] f = new byte[16]; private final byte[] b = new byte['Ā']; private int c; private int d; static { int i = 0; while (i < 256) { a[i] = ((byte)i); i += 1; } } private void a(int paramInt) { int m = c; int k = d; int j = 0; while (j < paramInt) { m = m + 1 & 0xFF; k = k + b[m] & 0xFF; int i = b[m]; b[m] = b[k]; b[k] = i; j += 1; } c = m; d = k; } public static void a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, long paramLong, byte[] paramArrayOfByte) { a(paramArrayOfByte); int i = paramInt4; if (paramInt4 < 8) { i = 0; } paramArrayOfByte[16] = ((byte)(paramInt1 >> 24)); paramArrayOfByte[17] = ((byte)(paramInt1 >> 16)); paramArrayOfByte[18] = ((byte)(paramInt1 >> 8)); paramArrayOfByte[19] = ((byte)paramInt1); paramArrayOfByte[20] = ((byte)(paramInt2 >> 24)); paramArrayOfByte[21] = ((byte)(paramInt2 >> 16)); paramArrayOfByte[22] = ((byte)(paramInt2 >> 8)); paramArrayOfByte[23] = ((byte)paramInt2); paramArrayOfByte[24] = ((byte)(paramInt3 >> 24)); paramArrayOfByte[25] = ((byte)(paramInt3 >> 16)); paramArrayOfByte[26] = ((byte)(paramInt3 >> 8)); paramArrayOfByte[27] = ((byte)paramInt3); paramInt1 = i & 0xFFFF; paramArrayOfByte[28] = ((byte)(paramInt1 >> 8)); paramArrayOfByte[29] = ((byte)paramInt1); paramInt1 = paramInt5 & 0xFFFF; paramArrayOfByte[30] = ((byte)(paramInt1 >> 8)); paramArrayOfByte[31] = ((byte)paramInt1); paramArrayOfByte[32] = ((byte)(int)(paramLong >> 56)); paramArrayOfByte[33] = ((byte)(int)(paramLong >> 48)); paramArrayOfByte[34] = ((byte)(int)(paramLong >> 40)); paramArrayOfByte[35] = ((byte)(int)(paramLong >> 32)); paramArrayOfByte[36] = ((byte)(int)(paramLong >> 24)); paramArrayOfByte[37] = ((byte)(int)(paramLong >> 16)); paramArrayOfByte[38] = ((byte)(int)(paramLong >> 8)); paramArrayOfByte[39] = ((byte)(int)paramLong); } public static void a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, byte[] paramArrayOfByte) { a(paramArrayOfByte); paramArrayOfByte[16] = ((byte)(paramInt1 >> 24)); paramArrayOfByte[17] = ((byte)(paramInt1 >> 16)); paramArrayOfByte[18] = ((byte)(paramInt1 >> 8)); paramArrayOfByte[19] = ((byte)paramInt1); paramArrayOfByte[20] = ((byte)(paramInt2 >> 24)); paramArrayOfByte[21] = ((byte)(paramInt2 >> 16)); paramArrayOfByte[22] = ((byte)(paramInt2 >> 8)); paramArrayOfByte[23] = ((byte)paramInt2); paramArrayOfByte[24] = ((byte)(paramInt3 >> 24)); paramArrayOfByte[25] = ((byte)(paramInt3 >> 16)); paramArrayOfByte[26] = ((byte)(paramInt3 >> 8)); paramArrayOfByte[27] = ((byte)paramInt3); paramArrayOfByte[28] = ((byte)(paramInt4 >> 24)); paramArrayOfByte[29] = ((byte)(paramInt4 >> 16)); paramArrayOfByte[30] = ((byte)(paramInt4 >> 8)); paramArrayOfByte[31] = ((byte)paramInt4); } public static void a(InputStream paramInputStream) { paramInputStream.read(f); paramInputStream.close(); } private static void a(byte[] paramArrayOfByte) { int i = 0; for (;;) { byte[] arrayOfByte = e; if (i >= 16) { break; } paramArrayOfByte[i] = ((byte)(e[i] * 47 ^ f[i])); i += 1; } } public final void a(byte[] paramArrayOfByte, int paramInt) { System.arraycopy(a, 0, b, 0, 256); int j = 0; paramInt = 0; while (paramInt < 256) { j = j + b[paramInt] + paramArrayOfByte[(paramInt % 40)] & 0xFF; int i = b[paramInt]; b[paramInt] = b[j]; b[j] = i; paramInt += 1; } c = 0; d = 0; a(256); } public final void a(byte[] paramArrayOfByte, int paramInt1, int paramInt2) { int n = c; int m = d; int k = 0; while (k < paramInt2) { n = n + 1 & 0xFF; m = m + b[n] & 0xFF; int i = b[n]; int j = b[m]; b[n] = j; b[m] = i; int i1 = paramArrayOfByte[paramInt1]; paramArrayOfByte[paramInt1] = ((byte)(b[(i + j & 0xFF)] ^ i1)); k += 1; paramInt1 += 1; } c = n; d = m; } public final void b(byte[] paramArrayOfByte, int paramInt) { System.arraycopy(a, 0, b, 0, 256); int j = 0; paramInt = 0; while (paramInt < 256) { j = j + b[paramInt] + paramArrayOfByte[(paramInt & 0x1F)] & 0xFF; int i = b[paramInt]; b[paramInt] = b[j]; b[j] = i; paramInt += 1; } c = 0; d = 0; a(256); } } /* Location: * Qualified Name: com.google.android.m4b.maps.ba.i * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
702d764e9b54259e0e34302f65e6ddc87bf81e5a
5524985c25f142b28a6fc7fa43b7ed557dc486bb
/LongestSubStrWithKDistinctChars.java
eb341473be8c458e36d77262d29387797d21ffc8
[]
no_license
dawilleyone/coding-challenges
bfd0fdddcd5a51044217339f0e8a6f27757a4ebb
1b259d6b3d23110aa140063c09def5ac3849248e
refs/heads/master
2021-04-24T01:04:49.318459
2020-03-25T17:50:30
2020-03-25T17:50:30
250,050,166
0
0
null
null
null
null
UTF-8
Java
false
false
753
java
import java.util.Arrays; import java.util.HashMap; class LongestSubStrWithKDistinctChars { public static int findLength(String str, int k) { HashMap<Character, Integer> charMap = new HashMap<>(); int winStart = 0; int maxSize=0; int distinctCnt=0; for (int winEnd=0; winEnd<str.length(); winEnd++) { char c = str.charAt(winEnd); charMap.put(c,charMap.getOrDefault(c, 0) + 1); while (charMap.size() > k) { char leftChar = str.charAt(winStart); } } return maxSize; } public static void main(String[] args) { int result = LongestSubStrWithKDistinctChars.findLength("araaci", 2); System.out.println("Max subarray for string is : " +result); } }
[ "noreply@github.com" ]
dawilleyone.noreply@github.com
6fd881a7e0d5166e7c304e4eb4744d75c40a6d41
4b3d87aa2c0a69e549140ade545dbaf81e77cf3d
/FWeek03/MPRestDemo/src/main/java/com/fzw/mprestdemo/commons/function/Predicates.java
520b1dc9e7d493b8581a9175f1172da47e1c42ed
[]
no_license
CarlaX/JavaPractice
08c21b1c8a6946fb701b645f7bf34a62d89c25b1
f97799464df9dd8060d0f501d071b5b5b3ce6f1b
refs/heads/main
2023-06-22T06:07:20.177089
2021-07-21T16:36:41
2021-07-21T16:36:41
376,428,303
0
0
null
null
null
null
UTF-8
Java
false
false
2,344
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.fzw.mprestdemo.commons.function; import java.util.function.Predicate; import static java.util.stream.Stream.of; /** * The utilities class for Java {@link Predicate} * * @since 1.0.0 */ public interface Predicates { Predicate[] EMPTY_ARRAY = new Predicate[0]; /** * {@link Predicate} always return <code>true</code> * * @param <T> the type to test * @return <code>true</code> */ static <T> Predicate<T> alwaysTrue() { return e -> true; } /** * {@link Predicate} always return <code>false</code> * * @param <T> the type to test * @return <code>false</code> */ static <T> Predicate<T> alwaysFalse() { return e -> false; } /** * a composed predicate that represents a short-circuiting logical AND of {@link Predicate predicates} * * @param predicates {@link Predicate predicates} * @param <T> the type to test * @return non-null */ static <T> Predicate<T> and(Predicate<T>... predicates) { return of(predicates).reduce((a, b) -> a.and(b)).orElseGet(Predicates::alwaysTrue); } /** * a composed predicate that represents a short-circuiting logical OR of {@link Predicate predicates} * * @param predicates {@link Predicate predicates} * @param <T> the detected type * @return non-null */ static <T> Predicate<T> or(Predicate<T>... predicates) { return of(predicates).reduce((a, b) -> a.or(b)).orElse(e -> true); } }
[ "idea@idea.com" ]
idea@idea.com
ef49363627683800f9a6d621b6e81a34611ece36
40b34059ba2c8e598e61bb23b2c2147623ca683f
/L13-structuralPatterns/src/main/java/ru/shikhovtsev/homework/exception/UnsupportedNominalException.java
7ef1f78ca90bac3c049a73afd2729322ff3174f0
[]
no_license
IlyaShikhovtsev/otusJava
2a6c731343b9320b8a68ede9497aee5f0b866135
f0856b0a2ab0c91e13108e87b586778d75073c64
refs/heads/master
2021-06-16T09:20:55.869881
2021-04-28T09:39:43
2021-04-28T09:39:43
196,060,847
0
0
null
2021-04-28T09:39:45
2019-07-09T18:19:45
Java
UTF-8
Java
false
false
110
java
package ru.shikhovtsev.homework.exception; public class UnsupportedNominalException extends AtmException { }
[ "shikhovtsev97@gmail.com" ]
shikhovtsev97@gmail.com
6439b1255f16925a3c590155ce5716d5ded1a2a2
50fde90111cf47454bde297fc4e8c6c92e89462b
/Final Project/src/UserInterface_PatientRole/PatientToDoctorRequestJPanel.java
03f4d42ab1b3f2178628e73aa6ec7c82a1aaccfa
[]
no_license
JainTanisha/E-Prescription_and_E-Labs
fb9cc506f5fac75caa9e7d9124842ba82ed28391
9cef63e4c44202be96909a0187bde87048453741
refs/heads/master
2021-06-03T01:17:30.581322
2017-08-07T00:28:10
2017-08-07T00:28:10
96,478,684
0
0
null
null
null
null
UTF-8
Java
false
false
9,578
java
package UserInterface_PatientRole; import Business.EcoSystem; import Business.Enterprise.Enterprise; import Business.Organization.Organization; import Business.UserAccount.UserAccount; import Business.Queue.AppointmentVisitPDCLRequest; import Business.Queue.WorkRequest; import java.awt.CardLayout; import java.awt.Font; import javax.swing.JPanel; import javax.swing.table.DefaultTableModel; /** * * @author Tanisha_Jain */ public class PatientToDoctorRequestJPanel extends javax.swing.JPanel { private JPanel userProcessContainer; private Organization organization; private Enterprise enterprise; private UserAccount userAccount; private EcoSystem system; public PatientToDoctorRequestJPanel(JPanel userProcessContainer, UserAccount account, Organization organization, Enterprise enterprise, EcoSystem system) { initComponents(); this.userProcessContainer = userProcessContainer; this.organization = organization; this.enterprise = enterprise; this.userAccount = account; this.system = system; populateRequestTable(); } public void populateRequestTable(){ patientJTableOne.setFont(new Font("Comic Sans MS", Font.BOLD, 10)); patientJTableOne.getTableHeader().setFont(new Font("Comic Sans MS", Font.BOLD, 10)); DefaultTableModel model = (DefaultTableModel) patientJTableOne.getModel(); model.setRowCount(0); for (WorkRequest request : userAccount.getWorkQueue().getWorkRequestList()){ Object[] row = new Object[9]; AppointmentVisitPDCLRequest req = (AppointmentVisitPDCLRequest)request; row[0] = req; row[1] = req.getReceiver(); row[2] = req.getSender(); row[3] = req.getRequestDate(); row[4] = req.getAppointmentDate(); row[5] = req.getDayTime(); String result = req.getAppointmentResult(); row[6] = result == null ? "Waiting" : result; row[7] = req.getResolveDate(); row[8] = req.getStatus1(); model.addRow(row); } } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); patientJTableOne = new javax.swing.JTable(); requestTestJButton = new javax.swing.JButton(); refreshTestJButton = new javax.swing.JButton(); jLabel = new javax.swing.JLabel(); backJButton = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); setBackground(new java.awt.Color(0, 204, 153)); patientJTableOne.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Symptom", "Doctor", "Patient Name", "Request Date", "Date of Appointment", "Day Time", "Appointment Result", "Resolve Date", "Status" } ) { boolean[] canEdit = new boolean [] { false, false, false, false, false, false, false, false, false }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); jScrollPane1.setViewportView(patientJTableOne); requestTestJButton.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N requestTestJButton.setText("Make a new appointment"); requestTestJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { requestTestJButtonActionPerformed(evt); } }); refreshTestJButton.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N refreshTestJButton.setText("Refresh"); refreshTestJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { refreshTestJButtonActionPerformed(evt); } }); jLabel.setFont(new java.awt.Font("Comic Sans MS", 1, 18)); // NOI18N jLabel.setText("APPOINTMENT MAKING TABLE"); backJButton.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N backJButton.setText("<<Back"); backJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backJButtonActionPerformed(evt); } }); jLabel1.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N jLabel1.setText("Appointment Request Details"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(backJButton)) .addGroup(layout.createSequentialGroup() .addGap(208, 208, 208) .addComponent(refreshTestJButton) .addGap(43, 43, 43) .addComponent(requestTestJButton)) .addGroup(layout.createSequentialGroup() .addGap(15, 15, 15) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 718, Short.MAX_VALUE))) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addGap(188, 188, 188) .addComponent(jLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(15, 15, 15) .addComponent(jLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(77, 77, 77) .addComponent(jLabel1) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE) .addGap(61, 61, 61) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(requestTestJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(refreshTestJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(7, 7, 7) .addComponent(backJButton) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents private void requestTestJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_requestTestJButtonActionPerformed RequestAppointmentJPanel rajp= new RequestAppointmentJPanel(userProcessContainer, userAccount, enterprise, system); CardLayout layout = (CardLayout) userProcessContainer.getLayout(); userProcessContainer.add("RequestAppointmentJPanel", rajp); layout.next(userProcessContainer); }//GEN-LAST:event_requestTestJButtonActionPerformed private void refreshTestJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshTestJButtonActionPerformed populateRequestTable(); }//GEN-LAST:event_refreshTestJButtonActionPerformed private void backJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backJButtonActionPerformed userProcessContainer.remove(this); CardLayout layout = (CardLayout)userProcessContainer.getLayout(); layout.previous(userProcessContainer); }//GEN-LAST:event_backJButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton backJButton; private javax.swing.JLabel jLabel; private javax.swing.JLabel jLabel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable patientJTableOne; private javax.swing.JButton refreshTestJButton; private javax.swing.JButton requestTestJButton; // End of variables declaration//GEN-END:variables }
[ "jain.tan@husky.neu.edu" ]
jain.tan@husky.neu.edu
2e70be6f2230ac9ccd1576e38e058fb137027eed
c616efb83fdcb58c2945bf101e765d0b461c2886
/hshutil/src/main/java/com/wondertek/sdk/util/RegularExpressionUtil.java
3efccad9d83ab7677a73cae654bad28388fe5095
[]
no_license
qtiansheng/utils
473657e76977983af357ff369c1c2f98d29f8e26
d7114e239e9e1805d6f859b327149c73cd894fb2
refs/heads/master
2020-03-27T08:16:52.376398
2018-09-11T07:38:50
2018-09-11T07:38:50
146,239,425
0
0
null
null
null
null
UTF-8
Java
false
false
4,057
java
package com.wondertek.sdk.util; import java.util.regex.Pattern; /** * 正则表达式工具类,包括常用正则表达式 */ public class RegularExpressionUtil { //密码的强度必须包含大小写字母和数字的组合,不能使用特殊字符,长度在8-10之间 public final static Pattern password = Pattern.compile("^(?=.*\\\\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$"); //字符串只能是中文 public final static Pattern checkChinese = Pattern.compile("^[\\\\u4e00-\\\\u9fa5]{0,}$"); //由数字,26个英文字母或下划线组成的字符串 public final static Pattern formatStr = Pattern.compile("^\\\\w+$"); //校验E-Mail地址 public final static Pattern email = Pattern.compile("[\\\\w!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[\\\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\\\w](?:[\\\\w-]*[\\\\w])?\\\\.)+[\\\\w](?:[\\\\w-]*[\\\\w])?"); //校验手机号 public final static Pattern phone = Pattern.compile("^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\\\\d{8}$"); //校验身份证号码 public final static Pattern ID = Pattern.compile("^[1-9]\\\\d{5}[1-9]\\\\d{3}((0\\\\d)|(1[0-2]))(([0|1|2]\\\\d)|3[0-1])\\\\d{3}([0-9]|X)$"); //校验日期 public final static Pattern date = Pattern.compile("^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"); //校验IP-v4地址 public final static Pattern IPV4 = Pattern.compile("\\\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\b"); //校验IP-v6地址 public final static Pattern IPV6 = Pattern.compile("(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))"); //检查URL的前缀 public final static Pattern URLPre = Pattern.compile("/^[a-zA-Z]+:\\\\/\\\\//"); //提取URL链接 public final static Pattern URLContent = Pattern.compile("^(f|ht){1}(tp|tps):\\\\/\\\\/([\\\\w-]+\\\\.)+[\\\\w-]+(\\\\/[\\\\w ./?%&=]*)?"); //文件路径及扩展名校验 public final static Pattern filePathEx = Pattern.compile("^([a-zA-Z]\\\\:|\\\\\\\\)\\\\\\\\([^\\\\\\\\]+\\\\\\\\)*[^\\\\/:*?\"<>|]+\\\\.txt(l)?$"); //提取Color Hex Codes public final static Pattern ColorHexCodes = Pattern.compile("^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"); //提取网页图片 public final static Pattern pageImg = Pattern.compile("\\\\< *[img][^\\\\\\\\>]*[src] *= *[\\\\\"\\\\']{0,1}([^\\\\\"\\\\'\\\\ >]*)"); //提取页面超链接 public final static Pattern pageHref = Pattern.compile("(<a\\\\s*(?!.*\\\\brel=)[^>]*)(href=\"https?:\\\\/\\\\/)((?!(?:(?:www\\\\.)?'.implode('|(?:www\\\\.)?', $follow_list).'))[^\"]+)\"((?!.*\\\\brel=)[^>]*)(?:[^>]*)>"); //查找CSS属性 public final static Pattern cssAttr = Pattern.compile("^\\\\s*[a-zA-Z\\\\-]+\\\\s*[:]{1}\\\\s[a-zA-Z0-9\\\\s.#]+[;]{1}"); //抽取注释 public final static Pattern notes = Pattern.compile("<!--(.*?)-->"); //匹配HTML标签 public final static Pattern htmlTag = Pattern.compile("<\\\\/?\\\\w+((\\\\s+\\\\w+(\\\\s*=\\\\s*(?:\".*?\"|'.*?'|[\\\\^'\">\\\\s]+))?)+\\\\s*|\\\\s*)\\\\/?>"); /** * 判断source是否符合pattern的正则 * @param pattern 正则的规则 * @param source 输入字符串 * @return */ public static boolean patternMatch(Pattern pattern, String source) { if (pattern == null) return false; return pattern.matcher(source).matches(); } }
[ "qtiansheng@139.com" ]
qtiansheng@139.com
f74498496fb60c5c564cf64c05cf98bb1927f049
5b7dd6d49f5d6bba777891e8262ad3256efb514c
/src/main/java/com/tnkj/project/system/line/service/impl/LineServiceImpl.java
42d7adb4658ae6b6caa7a45dfd518a23ef4a68fc
[]
no_license
lcc214321/base
edfe84469474a51977a2a19440c69e103dd136f6
3fc04cd5f17fc29d933a46ed54eee9c212bc4b1f
refs/heads/master
2020-07-17T08:23:47.073273
2019-09-03T02:24:51
2019-09-03T02:24:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,090
java
package com.tnkj.project.system.line.service.impl; import java.util.Date; import java.util.List; import com.tnkj.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.tnkj.project.system.line.mapper.LineMapper; import com.tnkj.project.system.line.domain.Line; import com.tnkj.project.system.line.service.ILineService; import com.tnkj.common.utils.text.Convert; /** * 线路Service业务层处理 * * @author tnkj * @date 2019-08-19 */ @Service public class LineServiceImpl implements ILineService { @Autowired private LineMapper lineMapper; /** * 查询线路 * * @param id 线路ID * @return 线路 */ @Override public Line selectLineById(String id) { return lineMapper.selectLineById(id); } /** * 查询线路列表 * * @param line 线路 * @return 线路 */ @Override public List<Line> selectLineList(Line line) { return lineMapper.selectLineList(line); } /** * 新增线路 * * @param line 线路 * @return 结果 */ @Override public int insertLine(Line line) { line.setCreateTime(DateUtils.getNowDate()); line.setId(Long.toString(new Date().getTime())); return lineMapper.insertLine(line); } /** * 修改线路 * * @param line 线路 * @return 结果 */ @Override public int updateLine(Line line) { line.setUpdateTime(DateUtils.getNowDate()); return lineMapper.updateLine(line); } /** * 删除线路对象 * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int deleteLineByIds(String ids) { return lineMapper.deleteLineByIds(Convert.toStrArray(ids)); } /** * 删除线路信息 * * @param id 线路ID * @return 结果 */ public int deleteLineById(String id) { return lineMapper.deleteLineById(id); } }
[ "841597920@qq.com" ]
841597920@qq.com
98aa8f095d6e50e378135d590e4a4040a15dc761
014ebaba07e0d38b9366791cab603d1fb0745b9d
/src/LeetCode/Solution2.java
c9c2cb6281dabe9b4a2787c6a933e29d2b13ca48
[]
no_license
madethatold/Leetcode
357afd95f4e2e7dfec55be2cf39066a12c7ed7a6
720b115b5ede4b059a6f4b20fc23e117332e9f94
refs/heads/master
2022-12-20T18:53:12.257462
2020-10-09T03:25:42
2020-10-09T03:25:42
282,423,060
0
0
null
null
null
null
UTF-8
Java
false
false
1,365
java
package LeetCode; import javax.swing.*; import java.lang.reflect.WildcardType; /** * @author colorful * @date 2020/9/11 **/ //2. 两数相加 public class Solution2 { public static class ListNode { int val; ListNode next; ListNode(int x) { val = x; } @Override public String toString() { return "ListNode{" + "val=" + val + ", next=" + next + '}'; } } public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode re=new ListNode(0); ListNode node=re; int carry=0; while (l1!=null||l2!=null||carry!=0){ int val1=l1!=null?l1.val:0; int val2=l2!=null?l2.val:0; int sum=val1+val2+carry; carry=sum/10; ListNode newNode=new ListNode(sum%10); node.next=newNode; node=newNode; if (l1!=null) l1=l1.next; if (l2!=null) l2=l2.next; } return re.next; } public static void main(String[] args) { ListNode re=new ListNode(0); ListNode node=re; for (int i=0;i<10;i++){ ListNode newnode=new ListNode(i); node.next=newnode; node=newnode; } System.out.println(re.next); } }
[ "1045536738@qq.com" ]
1045536738@qq.com
1be9f97964951d32b11c49beb44ad057aefaa887
864cdc0c568862202594a9b1811e13ae5d56ecea
/app/src/main/java/com/sopan/weather/view/cityforecast/CityForecastPresenter.java
2da6bbc1899997871a3684d07f64c845f35e7fa2
[]
no_license
gitproject09/SimpleWeather
ecd9632691fee0559e98cb6d9ccb9040084f7a8a
bbdcf24a6c6506be22007e36e330a64aef6b12f8
refs/heads/master
2020-03-27T12:37:13.867614
2018-08-29T07:59:19
2018-08-29T07:59:19
146,557,033
2
1
null
null
null
null
UTF-8
Java
false
false
1,490
java
package com.sopan.weather.view.cityforecast; import com.sopan.weather.data.dto.ForecastDto; import com.sopan.weather.data.repository.ForecastRepository; import com.sopan.weather.model.City; import javax.inject.Inject; public class CityForecastPresenter implements CityForecastContract.Presenter { private ForecastRepository forecastRepository; private ForecastDto forecastDto; private CityForecastContract.View view; @Inject public CityForecastPresenter(ForecastRepository forecastRepository) { this.forecastRepository = forecastRepository; } @Override public void setView(CityForecastContract.View view) { this.view = view; } @Override public void loadData(City city) { if (view != null) { forecastRepository.getForecast(city.latitude, city.longitude).subscribe(dto -> { forecastDto = dto; refreshUi(); }, throwable -> { throwable.printStackTrace(); view.showErrorLayout(); }); } } @Override public void loadDataWithProgress(City city) { if (view != null) { view.showLoadingLayout(); } loadData(city); } @Override public void refreshUi() { if (view != null) { view.updateForecast(forecastDto); view.showContentLayout(); } } @Override public void onDestroy() { view = null; } }
[ "supan@aci-bd.com" ]
supan@aci-bd.com
7b3dcd7ce8099faaa6c15c874ddb69ca833c8708
f99f4ea4cb350dc3d2db624cdd93eab91931c422
/AdvLes10/src/main/java/utils/ConnectionUtils.java
fa0c39044b772d69d677cc153138ba49208bbb74
[]
no_license
smaxxxs/Java_Advance
03b629da8f63377a2898ca573f3c64fe302f878f
452254de93bc74c8ab8caeb324c04463e90341e9
refs/heads/master
2020-04-18T08:07:48.464389
2019-03-13T19:37:54
2019-03-13T19:37:54
167,385,415
0
0
null
2019-01-30T22:34:25
2019-01-24T14:58:39
CSS
UTF-8
Java
false
false
790
java
package utils; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import org.apache.log4j.xml.DOMConfigurator; //commit #9999 public class ConnectionUtils { private static String USER_NAME= "root"; private static String USER_PASSWORD = "root"; private static String url = "jdbc:mysql://localhost/magazines?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC"; public static Connection openConnection() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { DOMConfigurator.configure("LogerConfig.xml"); Class.forName ("com.mysql.cj.jdbc.Driver").newInstance (); return DriverManager.getConnection (url, USER_NAME, USER_PASSWORD); } }
[ "djadjamax@gmail.com" ]
djadjamax@gmail.com
8047b3e62d947fefd21e42115edf22f084f372b4
4a04c7541224c663c930c2249acee8b4607c0eb3
/sourcecode/src/main/java/com/mpos/lottery/te/valueaddservice/vat/service/VatSaleService.java
15e91a06ccbb023c2b63f86ae6957da0336b6077
[]
no_license
ramonli/eGame_TE
92e1f4d7af05a4e2cb31aec89d96f00a40688fa0
937b7ef487ff4b9053de8693a237733f2ced7bc4
refs/heads/master
2020-12-24T14:57:07.251672
2015-07-20T05:55:15
2015-07-20T05:55:15
39,357,089
2
2
null
null
null
null
UTF-8
Java
false
false
3,988
java
package com.mpos.lottery.te.valueaddservice.vat.service; import com.mpos.lottery.te.config.exception.ApplicationException; import com.mpos.lottery.te.port.Context; import com.mpos.lottery.te.valueaddservice.vat.VatSaleTransaction; import com.mpos.lottery.te.valueaddservice.vat.support.VatReversalOrCancelStrategy; public interface VatSaleService { /** * VAT amount can be used to buy raffle or magic100 ticket. Raffle ticket is for B2B retailer, and magic100 ticket * is for B2C retailer. * <p> * Though this service is extending from <code>TicketService</code>, its logic is completedly different from sale * service of a real game, actually it is more understandable if regard this service as a front end of * Raffle/Magic100 sale service, and the implementation of this service will definitely dispatch request to * Raffle(B2B)/Magic100(B2C) sale service accordingly. * <p> * Before dispatching request, this service will perform below operations: * <ul> * <li>Determine the business type of device. B2B or B2C??</li> * <li> * <b>if B2B</b> * <ol> * <li>No matter the VAT amount, a single raffle ticket will be sold.</li> * <li>Record the VAT sale transaction <code>VatSaleTransaction</code>.</li> * <li>Increment Vat sale balance.</code> * </ol> * </li> * <li> * <b>If B2C</b> * <ol> * <li>Determine the total amount of sale by (vatAmount*vatRate), also round down/up will be considered. For example * vatAmount is 800, vatRate is 0.3, the sale total amount will be <code>800*0.3=240</code>, if round down, and base * amount of magic100 is 100, then only 2 tickets can be sold(240/100=2.4, round down to 2).</li> * <li>Record the VAT sale transaction <code>VatSaleTransaction</code>.</li> * <li>Increment Vat sale balance.</code></li> * </ol> * </li> * </ul> * <p/> * <b>Pre-Condition</b> * <ul> * <li>VAT is valid.</li> * <li>VAT has been allocated to current merchant</li> * </ul> * <p> * <b>Post-Condition</b> * <ul> * <li>Record the general * <code>Transaction<code>, in which the game type will be set to Raffle or Magic100 accordingly, * also the total amount will be set to SALE total amount.</li> * <li>Record the detailed <code>VatSaleTransaction</code>.</li> * <li>Increment the VAT sale balance</code> * <li>Generate tickets which have been sold.</li> * </ul> * <p> * <b>Usage Restriction</b> * <ul> * <li>Authorization - Can only be called by authorized GPEs.</li> * <li>Concurrent Access - To a single device, this interface must be called sequentially. To multiple devices, * there are no limitation on the number of concurrent accesses.</li> * </ul> * * @param respCtx * The context represents the response. * @param clientSale * A client ticket request, a instance of <code>VatTicket</code>. * @return The sold ticket, either RAFFLE or MAGIC100. */ public VatSaleTransaction sell(Context<?> respCtx, VatSaleTransaction clientSale) throws ApplicationException; /** * Refund a VAT invoice. Customer can request to refund sales and the associated VAT invoice must be refunded as * well, in essential it is same with the cancellation of {@link #sell(Context, VatSaleTransaction)}. * <p> * Refer to * {@link VatReversalOrCancelStrategy#cancelOrReverse(Context, com.mpos.lottery.te.trans.domain.Transaction)} * * @param respCtx * The context of current refunding transaction. * @param vatTrans * The refunding request, the following components must be set: vatRefNo * @throws ApplicationException * if encounter any biz exception. */ void refundVat(Context<?> respCtx, VatSaleTransaction vatTrans) throws ApplicationException; }
[ "myroulade@gmail.com" ]
myroulade@gmail.com
c997486909d470c16b45e1e6fc9761bc44354bc1
1415496f94592ba4412407b71dc18722598163dd
/doc/jitsi-bundles-dex/sources/org/jitsi/javax/sip/address/SipURI.java
710034cbf7e4955579d38a924b7c805405c5f397
[ "Apache-2.0" ]
permissive
lhzheng880828/VOIPCall
ad534535869c47b5fc17405b154bdc651b52651b
a7ba25debd4bd2086bae2a48306d28c614ce0d4a
refs/heads/master
2021-07-04T17:25:21.953174
2020-09-29T07:29:42
2020-09-29T07:29:42
183,576,020
0
0
null
null
null
null
UTF-8
Java
false
false
1,276
java
package org.jitsi.javax.sip.address; import java.text.ParseException; import java.util.Iterator; import org.jitsi.javax.sip.InvalidArgumentException; import org.jitsi.javax.sip.header.Parameters; public interface SipURI extends URI, Parameters { String getHeader(String str); Iterator getHeaderNames(); String getHost(); String getMAddrParam(); String getMethodParam(); int getPort(); int getTTLParam(); String getTransportParam(); String getUser(); String getUserParam(); String getUserPassword(); boolean hasLrParam(); boolean isSecure(); void removePort(); void setHeader(String str, String str2) throws ParseException; void setHost(String str) throws ParseException; void setLrParam(); void setMAddrParam(String str) throws ParseException; void setMethodParam(String str) throws ParseException; void setPort(int i); void setSecure(boolean z); void setTTLParam(int i) throws InvalidArgumentException; void setTransportParam(String str) throws ParseException; void setUser(String str) throws ParseException; void setUserParam(String str) throws ParseException; void setUserPassword(String str) throws ParseException; String toString(); }
[ "lhzheng@grandstream.cn" ]
lhzheng@grandstream.cn
66e4ff51a72eb626738d535fbc8ddd666d146be6
e84cb7470911bda9a09b0c56a93bea2067165ef4
/IntranetProject/Main package/Course.java
c3d2a3d2bcfd67f1a91cf357d8da7a4e6be387e6
[]
no_license
ExaltedA/IntranetProject
44e677397e6a18e36be374f850fc2ecc8f55a4ab
a951ea3191c9fb50bc9ae68f1fa687c23392bca7
refs/heads/master
2020-09-12T10:32:15.960132
2020-08-04T12:41:21
2020-08-04T12:41:21
222,395,008
0
0
null
null
null
null
UTF-8
Java
false
false
2,474
java
import java.util.*; public class Course { private String name,id; private int credits; private Faculty faculty; HashSet<Course> Pre = new HashSet<Course>(); HashSet<CourseFiles> files = new HashSet<CourseFiles>(); Course(){ this.name=name; this.id=id; this.credits=0;} Course(Faculty a,String name, String id,int credits){ faculty =a; this.name=name; this.id=id; this.credits=credits; } public boolean addFile(String title,String msg) { return files.add(new CourseFiles(title,msg)); } public boolean removeFile(String title) { for(CourseFiles a : files) { if(a.getName().equals(title)) { return files.remove(a); } } return false; } public void showFiles() { for(CourseFiles a : files) { System.out.println(a.toString()); } } public boolean hasPrereq() { // returns True if vector has prerequisite, False otherwise return !Pre.isEmpty(); } public boolean addPrereq(Course a) { if(Pre.size()<3) { Pre.add(a); return true; } else {System.out.println("Error!! Course reached upper limit of prerequisites!!"); return false; }} public void showPrereq() { System.out.println("Course Prerequisites: "); for(Course q:Pre) { System.out.println(q.toString() + " "); } } public Faculty getFaculty() { return faculty; } public void setFaculty(Faculty faculty) { this.faculty = faculty; } public String getName(){ return name; } public void setName(String name) { this.name=name; } public String getId(){ return id; } public void setId(String id) { this.id=id; } public boolean removePrereq(String id) { for(Course q:Pre) { if(q.id.equals(id)) { Pre.remove(q); System.out.println("Delete completed." + ""); return true; } }return false; } public boolean removePrereq(Course i) { for(Course q:Pre) { if(q.equals(i)) { Pre.remove(q); System.out.println("Delete completed." + ""); return true; }} return false; } public int getCredits() { return credits; } public void setCredits(int credits) { this.credits=credits; } public String toString() { return "Course [" + name + ", id = " + id + ", weight: " +credits + " credits ]"; } public int hashCode() { int result = 17; result = 31 * result + name.hashCode(); result = 31 * result + id.hashCode(); return result; }; public boolean equals(Object obj) { Course a = (Course) obj; return (this.name.equals(a.name) && this.id.equals(a.id) ); } }
[ "aldie1741@gmail.com" ]
aldie1741@gmail.com
6bc1263ead1f84c454307f024c46fc922d24f613
9bea74972c22bc16d02bbf6f2f57bae4ad3a18a6
/src/main/java/com/hirisun/springbootjsp/domain/Permission.java
1bd56b3aa90196cb0c8f5a1674eeaa8d8bb803f7
[]
no_license
sysdatabase/springboot-jsp
baa13d66504c8cbc407948ecfce12629b0b7fabc
e06542901b9e39f961ef26295e8af05bc80176f3
refs/heads/master
2021-09-05T00:57:43.824791
2018-01-23T06:59:58
2018-01-23T06:59:58
106,631,079
0
0
null
null
null
null
UTF-8
Java
false
false
1,491
java
package com.hirisun.springbootjsp.domain; import java.io.Serializable; import java.util.Set; public class Permission implements Serializable{ private long id; private String name; private String description; private String url; private long parentId; private Set<Role> roles; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public long getParentId() { return parentId; } public void setParentId(long parentId) { this.parentId = parentId; } public Set<Role> getRoles() { return roles; } public void setRoles(Set<Role> roles) { this.roles = roles; } @Override public String toString() { return "Permission{" + "id=" + id + ", name='" + name + '\'' + ", description='" + description + '\'' + ", url='" + url + '\'' + ", parentId=" + parentId + ", roles=" + roles + '}'; } }
[ "zf_fz501087@163.com" ]
zf_fz501087@163.com
c74f63be50b6ad6f780144af8ed1511038245ffb
ed67cbeb339348a7a9da43868adaeea8dd4cdc07
/datastructure/list/linkedlist/java/SimpleQueue.java
6d807710fb18b16a3f84bb1db6006b12c134358c
[]
no_license
giraffe-tree/Algorithms
5c4671ae684326819839aa18ba2214aeba6e7b60
c55264cbebadb90b2cfb31019e576acb99f922cc
refs/heads/master
2020-05-19T21:02:28.081425
2019-05-29T16:18:46
2019-05-29T16:18:46
185,213,890
1
0
null
null
null
null
UTF-8
Java
false
false
234
java
package me.giraffetree.java.algorithms.week01.day02; /** * @author GiraffeTree * @date 2019-05-13 */ public interface SimpleQueue<T> { void addFirst(T t); void addLast(T t); T removeFirst(); T removeLast(); }
[ "15355498770@163.com" ]
15355498770@163.com
5e23c49982307a804cf7bb7b9d9e0b096106eaeb
1f7ee9725c51015b614a6de94ca0ea7c95c759b7
/src/test/java/com/projectx/uploaddownloadfileswithspringboot/UploadDownloadFilesWithSpringBootApplicationTests.java
cc55fe2ecfca1a0fbe75f5ee0a8acd7f6fbfde1d
[]
no_license
apoorvagni/upload-download-files
0c73842990af99801bb3365d6c2a3a8f13960387
8bf3b9aab10e0e40fbe3fb8c275d05881be7a474
refs/heads/main
2023-03-03T21:41:47.887306
2021-02-18T17:56:01
2021-02-18T17:56:01
340,108,418
1
0
null
null
null
null
UTF-8
Java
false
false
265
java
package com.projectx.uploaddownloadfileswithspringboot; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class UploadDownloadFilesWithSpringBootApplicationTests { @Test void contextLoads() { } }
[ "apoorvaagnihotri9@gmail.com" ]
apoorvaagnihotri9@gmail.com
98342dd948cb29c6790fe9328999b7ae167d41c4
971c251d88693e5d1d3515ae003e838ad450fdd8
/src/main/java/com/product/screen/entity/WebClientCfg.java
7570176bf7689ace02df49db88827219dd46f4c2
[]
no_license
2018shiji/screen
3781a04cc8bd9c7bb8bb46fe3bd41ff998f3f5af
4c82544a9e9e7c1c8a281e080f31457476ecc818
refs/heads/master
2023-03-03T16:13:02.297600
2021-02-17T16:03:40
2021-02-17T16:03:40
329,852,013
0
0
null
null
null
null
UTF-8
Java
false
false
2,510
java
package com.product.screen.entity; import lombok.Data; import lombok.NoArgsConstructor; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; //"Java中StringUtils工具类进行String为空的判断解析 - 码农教程 - Google Chrome" @Data @NoArgsConstructor public class WebClientCfg { private List<Node> nodes; @Data @NoArgsConstructor public static class Node{ private boolean selected = false; private String id = ""; private String titles = "默认"; private String exeFile = "默认"; private String params = "无"; private String remark = "无"; private String windowTitle = "默认"; private String appType = "默认"; private String url = "默认"; public Node(ClientConfig.Node node){ id = node.getId(); titles = StringUtils.isBlank(node.getTitles()) ? titles : node.getTitles(); exeFile = StringUtils.isBlank(node.getExeFile()) ? exeFile : node.getExeFile(); params = StringUtils.isBlank(node.getParams()) ? params : node.getParams(); remark = StringUtils.isBlank(node.getRemark()) ? remark : node.getRemark(); } public Node(ClientConfigPool.Node poolNode){ id = poolNode.getId(); titles = StringUtils.isBlank(poolNode.getTitles()) ? titles : poolNode.getTitles(); exeFile = StringUtils.isBlank(poolNode.getExeFile()) ? exeFile : poolNode.getExeFile(); params = StringUtils.isBlank(poolNode.getParams()) ? params : poolNode.getParams(); remark = StringUtils.isBlank(poolNode.getRemark()) ? remark : poolNode.getRemark(); windowTitle = StringUtils.isBlank(poolNode.getWindowTitle()) ? windowTitle : poolNode.getWindowTitle(); appType = StringUtils.isBlank(poolNode.getAppType()) ? appType : poolNode.getAppType(); url = StringUtils.isBlank(poolNode.getUrl()) ? url : poolNode.getUrl(); } } public WebClientCfg(ClientConfig clientCfg){ nodes = new ArrayList<>(); List<ClientConfig.Node> cfgNodes = clientCfg.getNodes(); cfgNodes.stream().forEach(item -> nodes.add(new Node(item))); } public WebClientCfg(ClientConfigPool clientCfgPool){ nodes = new ArrayList<>(); List<ClientConfigPool.Node> cfgPoolNodes = clientCfgPool.getNodes(); cfgPoolNodes.stream().forEach(item -> nodes.add(new Node(item))); } }
[ "lizhuangjie.chnet@szcmml.com" ]
lizhuangjie.chnet@szcmml.com
25ac1a86db520d3f64b8a44392c8988af723b534
4222869467540543f414211a78103d86798f63bd
/src/main/java/edu/virginia/speclab/legacy/juxta/author/model/MovesManagerListener.java
0f3c39dd60b7b52ecd0cbc55ac3eecf9529fc465
[ "Apache-2.0", "MIT" ]
permissive
performant-software/juxta-desktop
f0ef32439ce886f54c03dc6c8015450dd8cfda54
eced59ea6fa44a51263cb0a29a6ca50a3dae14a3
refs/heads/master
2022-05-26T00:18:36.190405
2013-03-26T13:20:22
2013-03-26T13:20:22
3,742,209
11
3
NOASSERTION
2022-05-20T20:47:47
2012-03-16T19:28:53
Java
UTF-8
Java
false
false
1,101
java
/* * ----------------------------------------------------------------------------- * * <p><b>License and Copyright: </b>The contents of this file are subject to the * Educational Community License (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License * at <a href="http://www.opensource.org/licenses/ecl1.txt"> * http://www.opensource.org/licenses/ecl1.txt.</a></p> * * <p>Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License.</p> * * <p>The entire file consists of original code. Copyright &copy; 2002-2006 by * The Rector and Visitors of the University of Virginia. * All rights reserved.</p> * * ----------------------------------------------------------------------------- */ package edu.virginia.speclab.legacy.juxta.author.model; public interface MovesManagerListener { public void movesChanged(MovesManager movesManager); }
[ "lou@performantsoftware.com" ]
lou@performantsoftware.com
e486144c54bf89700c1228722e63e5afa5596233
be7032e4dccbb64b770e12c23d5e06f14e1823ca
/src/problem106/Solution2.java
058d890ebfad314efbefbc65709664fc58751021
[]
no_license
QXYang686/LeetCodeJava
0ed899d39068f6d7e3acf9b4083df43dc183ee34
bad0ed1b53c20acb0da84a2cfacbb275693b4c67
refs/heads/master
2023-05-10T09:32:32.041477
2021-06-22T13:15:46
2021-06-22T13:15:46
294,403,614
0
0
null
null
null
null
UTF-8
Java
false
false
1,484
java
package problem106; import common.TreeNode; import common.TreeUtil; import java.util.Arrays; import java.util.HashMap; public class Solution2 { private HashMap<Integer, Integer> inorderIndex = new HashMap<>(); private TreeNode build(int[] inorder, int[] postorder, int inFrom, int inTo, int postFrom, int postTo) { if (inFrom >= inTo) return null; int rootVal = postorder[postTo - 1]; int inRootIndex = inorderIndex.get(rootVal); TreeNode root = new TreeNode(rootVal); root.left = build(inorder, postorder, inFrom, inRootIndex, postFrom, postFrom + (inRootIndex - inFrom)); root.right = build(inorder, postorder, inRootIndex + 1, inTo, postFrom + (inRootIndex - inFrom), postTo - 1); return root; } /** * 使用哈希表降低根节点搜索的时间复杂度,并通过下表指定范围省掉复制 * @param inorder * @param postorder * @return */ public TreeNode buildTree(int[] inorder, int[] postorder) { for (int i = 0; i < inorder.length; i++) { inorderIndex.put(inorder[i], i); }; return build(inorder, postorder, 0, inorder.length, 0, postorder.length); } public static void main(String[] args) { System.out.println(Arrays.toString(TreeUtil.buildArray(new Solution2().buildTree( new int[]{9, 3, 15, 20, 7}, new int[]{9, 15, 7, 20, 3} )))); // [3,9,20,null,null,15,7] } }
[ "qxyang686@qq.com" ]
qxyang686@qq.com
f5eaf5c27dfe65f0c22891ad52089f6e764fa1f0
77bea2257bcae5a6e8e3b86ab4db01bd30a5f7dd
/app/src/main/java/com/entage/nrd/entage/utilities_1/EntagePageSearchingAdapter.java
53e1597a0c456e0a0e85bad051adace3d620dd64
[]
no_license
topninja/shoppingAndroidApp
16711e0145057acee01ec90724839804e2900f61
b824003257bbe572361bdcfdd6b5a3d5696ace36
refs/heads/master
2022-08-01T03:23:04.441356
2020-05-23T14:30:31
2020-05-23T14:30:31
231,564,136
2
1
null
null
null
null
UTF-8
Java
false
false
44,084
java
package com.entage.nrd.entage.utilities_1; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.Path; import android.graphics.drawable.Drawable; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.recyclerview.widget.RecyclerView; import com.algolia.search.saas.AlgoliaException; import com.algolia.search.saas.Client; import com.algolia.search.saas.CompletionHandler; import com.algolia.search.saas.Index; import com.entage.nrd.entage.Models.EntagePageShortData; import com.entage.nrd.entage.Models.Following; import com.entage.nrd.entage.personal.PersonalActivity; import com.entage.nrd.entage.R; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.Query; import com.google.firebase.database.ValueEventListener; import com.google.firebase.messaging.FirebaseMessaging; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import de.hdodenhof.circleimageview.CircleImageView; public class EntagePageSearchingAdapter extends RecyclerView.Adapter{ private static final String TAG = "EntagePageSearching"; private static final int ITEM_VIEW = 0; private static final int PROGRESS_VIEW = 1; private static final int LOAD_MORE_VIEW = 2; private FirebaseAuth mAuth; private FirebaseDatabase mFirebaseDatabase; private String user_id; private boolean isUserAnonymous; private Context mContext; private LinearLayout no_result_found; private boolean no_result = false; private ArrayList<EntagePageShortData> entagePages = null; private String facet, facetText, text; private String lastKey; private Client client; private Index index_items; private int hitsPerPage = 10; private int page = 0; private String indexNameAtAlgolia; private int indexOfLoadTextView = -1 ; private GlobalVariable globalVariable; private boolean isRemovedProgress = false; private ImageView searchIcon; private View.OnClickListener onClickListener, onClickListenerFollow, onClickListenerFollowed, onClickListenerNnotification; private Drawable defaultImage ; private RecyclerView recyclerView; public EntagePageSearchingAdapter(Context context, RecyclerView recyclerView, String facet, String facetText, String text, String indexNameAtAlgolia, LinearLayout no_result_found) { this.mContext = context; this.facet = facet; this.facetText = facetText; this.text = text; this.indexNameAtAlgolia = indexNameAtAlgolia; this.no_result_found = no_result_found; this.recyclerView = recyclerView; globalVariable = ((GlobalVariable)mContext.getApplicationContext()); entagePages = new ArrayList<>(); entagePages.add(null);entagePages.add(null);entagePages.add(null); entagePages.add(null);entagePages.add(null);entagePages.add(null); setupFirebaseAuth(); defaultImage = mContext.getResources().getDrawable(R.drawable.ic_default); setupOnClickListener(); setupAlgolia(); startSearching(); } public class LoadMoreViewHolder extends RecyclerView.ViewHolder{ TextView text; ImageView search_icon; private LoadMoreViewHolder(View itemView) { super(itemView); text = itemView.findViewById(R.id.text); search_icon = itemView.findViewById(R.id.search_icon); } } public class EntagePageViewHolder extends RecyclerView.ViewHolder{ CircleImageView imageView; TextView name, description, follow, followed; RelativeLayout relLayout_followed; ImageView notification; private EntagePageViewHolder(View itemView) { super(itemView); imageView = itemView.findViewById(R.id.profile_image); name = itemView.findViewById(R.id.entage_name); description = itemView.findViewById(R.id.description); follow = itemView.findViewById(R.id.follow); relLayout_followed = itemView.findViewById(R.id.relLayout_followed); followed = itemView.findViewById(R.id.followed); notification = itemView.findViewById(R.id.notification); } } public class ProgressViewHolder extends RecyclerView.ViewHolder { public ProgressBar progressBar; public ProgressViewHolder(View v) { super(v); progressBar = (ProgressBar) v.findViewById(R.id.progressBar_loadMore); } } @Override public int getItemViewType(int position) { if(entagePages.get(position) == null){ return PROGRESS_VIEW; }else if (entagePages.get(position).getEntage_id() == null){ return LOAD_MORE_VIEW; }else { return ITEM_VIEW; } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext()); View view = null; RecyclerView.ViewHolder viewHolder = null; if(viewType == ITEM_VIEW){ view = layoutInflater.inflate(R.layout.layout_search_list_entagepage, parent, false); viewHolder = new EntagePageSearchingAdapter.EntagePageViewHolder(view); }else if(viewType == PROGRESS_VIEW){ view = layoutInflater.inflate(R.layout.layout_entage_page_adapter_progressbar, parent, false); viewHolder = new EntagePageSearchingAdapter.ProgressViewHolder(view); }else if(viewType == LOAD_MORE_VIEW){ view = layoutInflater.inflate(R.layout.layout_entage_page_adapter_load_more, parent, false); viewHolder = new EntagePageSearchingAdapter.LoadMoreViewHolder(view); } return viewHolder; } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) { if (holder instanceof EntagePageSearchingAdapter.EntagePageViewHolder) { EntagePageSearchingAdapter.EntagePageViewHolder entagePageHolder = (EntagePageSearchingAdapter.EntagePageViewHolder)holder; String id = entagePages.get(position).getEntage_id(); if(entagePages.get(position).getProfile_photo() != null){ UniversalImageLoader.setImage(entagePages.get(position).getProfile_photo(), entagePageHolder.imageView, null ,""); }else { entagePageHolder.imageView.setImageDrawable(defaultImage); } entagePageHolder.name.setText(entagePages.get(position).getName_entage_page()); entagePageHolder.description.setText(entagePages.get(position).getDescription()); entagePageHolder.relLayout_followed.setVisibility(View.GONE); if(globalVariable.getFollowingData().containsKey(id)){ if(globalVariable.getFollowingData().get(id) == null){ entagePageHolder.follow.setVisibility(View.VISIBLE); entagePageHolder.follow.setOnClickListener(onClickListenerFollow); }else { entagePageHolder.follow.setVisibility(View.GONE); entagePageHolder.follow.setOnClickListener(null); if(globalVariable.getFollowingData().get(id).isIs_notifying()){ entagePageHolder.notification.setBackground(mContext.getResources().getDrawable(R.drawable.border_curve_entage_blue_1_ops)); entagePageHolder.notification.setImageResource(R.drawable.ic_notification_work); } entagePageHolder.relLayout_followed.setVisibility(View.VISIBLE); entagePageHolder.followed.setEnabled(true); entagePageHolder.notification.setEnabled(true); entagePageHolder.notification.setOnClickListener(onClickListenerNnotification); entagePageHolder.followed.setOnClickListener(onClickListenerFollowed); } }else { entagePageHolder.follow.setVisibility(View.VISIBLE); entagePageHolder.follow.setOnClickListener(onClickListenerFollow); } entagePageHolder.itemView.setOnClickListener(onClickListener); } else if (holder instanceof LoadMoreViewHolder) { final LoadMoreViewHolder loadMoreViewHolder = (LoadMoreViewHolder) holder; searchIcon = loadMoreViewHolder.search_icon; if(text.length() > 0){ loadMoreViewHolder.text.setText(mContext.getString(R.string.search_more_for_text) + " "+ text); }else { loadMoreViewHolder.text.setText(mContext.getString(R.string.search_more)); } loadMoreViewHolder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { loadMoreViewHolder.text.setOnClickListener(null); //loadMoreViewHolder.text.setText(""); Path path = new Path(); path.addCircle(0, 0, 40, Path.Direction.CW); ViewPathAnimator.animate(loadMoreViewHolder.search_icon, path, 1000/ 40, 2); page++; startSearching(); } }); } } @Override public int getItemCount() { return entagePages.size(); } private void setupAlgolia(){ if(text.length() > 0){ client = new Client(globalVariable.getApplicationID(), globalVariable.getAPIKey()); index_items = client.getIndex(indexNameAtAlgolia); } /*index_items = client.getIndex("price"); try { index_items.setSettingsAsync(new JSONObject().put("ranking", new JSONArray() .put("desc(price)") .put("typo") .put("geo") .put("words") .put("filters") .put("proximity") .put("attribute") .put("exact") .put("custom")), new CompletionHandler() { @Override public void requestCompleted(@Nullable JSONObject jsonObject, @Nullable AlgoliaException e) { if(e != null){ Log.d(TAG, "requestCompleted: e: " + e); }else { Log.d(TAG, "requestCompleted: " + jsonObject.toString()); } } } ); } catch (JSONException e) { e.printStackTrace(); }*/ //index_pages = client.getIndex("entage_pages"); } private void startSearching(){ Log.d(TAG, "fetchItems: facet: "+facet+", facetText: "+facetText+", text: "+text); if(text.length() == 0){ // search in firebase by selected Categories searchInFireBase(); }else { // search in Algolia by entering text if (facet == null && facetText == null){ textSearchInAll(); }else if(facet != null && facetText != null){ textSearchInFacet(); } } } private void textSearchInAll(){ com.algolia.search.saas.Query query = new com.algolia.search.saas.Query(text) .setAttributesToRetrieve("item_id") .setHitsPerPage(hitsPerPage) .setPage(page); CompletionHandler completionHandler = new CompletionHandler() { @Override public void requestCompleted(@Nullable JSONObject content, @Nullable AlgoliaException error) { try { if(content != null){ JSONArray jsonArray = content.getJSONArray("hits"); int length = jsonArray.length(); ArrayList<String> items_ids = new ArrayList<>(); for(int i=0 ; i < jsonArray.length(); i++){ String id = jsonArray.getJSONObject(i).get("item_id").toString(); if(id != null){ items_ids.add(id); } } fetchEntagePage(items_ids, length); if(jsonArray.length() == 0 ){ removerLoadLightView(); removerLoadMoreTextView(); if(entagePages.size() == 0){ ((TextView)no_result_found.getChildAt(0)).setText(((TextView)no_result_found.getChildAt(0)) .getText() + " " + (text.equals("'*'")? "" : text)); no_result_found.getChildAt(0).setVisibility(View.VISIBLE); no_result_found.setVisibility(View.VISIBLE); no_result = true; } } }else { removerLoadLightView(); removerLoadMoreTextView(); } } catch (JSONException e) { removerLoadLightView(); removerLoadMoreTextView(); ((TextView)no_result_found.getChildAt(0)).setText(mContext.getString(R.string.happened_wrong_try_again)); no_result_found.getChildAt(0).setVisibility(View.VISIBLE); no_result_found.setVisibility(View.VISIBLE); no_result = true; e.printStackTrace(); } } }; index_items.searchAsync(query, completionHandler); } private void textSearchInFacet(){ //Log.d(TAG, "textSearchInFacet: facet: " + facet + ", facetText: " + facetText); com.algolia.search.saas.Query query = new com.algolia.search.saas.Query(text) .setFilters("categorie_level_2:"+facetText) .setAttributesToRetrieve("item_id") .setHitsPerPage(hitsPerPage) .setPage(page); CompletionHandler completionHandler = new CompletionHandler() { @Override public void requestCompleted(@Nullable JSONObject content, @Nullable AlgoliaException error) { try { if(content != null){ JSONArray jsonArray = content.getJSONArray("hits"); int length = jsonArray.length(); ArrayList<String> items_ids = new ArrayList<>(); for(int i=0 ; i < jsonArray.length(); i++){ String id = jsonArray.getJSONObject(i).get("item_id").toString(); if(id != null){ items_ids.add(id); } } fetchEntagePage(items_ids, length); if(jsonArray.length() == 0 ){ removerLoadLightView(); removerLoadMoreTextView(); if(entagePages.size() == 0){ ((TextView)no_result_found.getChildAt(0)).setText(((TextView)no_result_found.getChildAt(0)) .getText() + " " + (text.equals("'*'")? "" : text)); no_result_found.getChildAt(0).setVisibility(View.VISIBLE); no_result_found.setVisibility(View.VISIBLE); no_result = true; } } }else { removerLoadLightView(); removerLoadMoreTextView(); } } catch (JSONException e) { removerLoadLightView(); removerLoadMoreTextView(); ((TextView)no_result_found.getChildAt(0)).setText(mContext.getString(R.string.happened_wrong_try_again)); no_result_found.getChildAt(0).setVisibility(View.VISIBLE); no_result_found.setVisibility(View.VISIBLE); no_result = true; e.printStackTrace(); } } }; index_items.searchAsync(query, completionHandler); } private void searchInFireBase() { Query query ; if(page > 0){ Log.d(TAG, "searchInFireBase: " + page +", "+lastKey); query = mFirebaseDatabase.getReference() .child(mContext.getString(R.string.dbname_entage_pages_by_categories)) .child(facet) .child("entage_page_id") .orderByKey() .startAt(lastKey) .limitToFirst(hitsPerPage+1); // first one is duplicate }else { query = mFirebaseDatabase.getReference() .child(mContext.getString(R.string.dbname_entage_pages_by_categories)) .child(facet) .child("entage_page_id") .orderByKey() .limitToFirst(hitsPerPage); } query.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { ArrayList<String> items_ids = new ArrayList<>(); if(dataSnapshot.exists()){ for (DataSnapshot snapshot : dataSnapshot.getChildren()){ String key = snapshot.getKey(); if(!key.equals(lastKey)){ items_ids.add(snapshot.getKey()); } } if(items_ids.size() > 0){ lastKey = items_ids.get(items_ids.size()-1); } fetchEntagePage(items_ids, items_ids.size()); } if( items_ids.size() == 0 ){ removerLoadLightView(); removerLoadMoreTextView(); if(entagePages.size() == 0){ for(int i=1; i<5; i++){ no_result_found.getChildAt(i).setVisibility(View.VISIBLE); } no_result_found.setVisibility(View.VISIBLE); no_result = true; } } } @Override public void onCancelled(DatabaseError databaseError) { // done load removerLoadLightView(); removerLoadMoreTextView(); ((TextView)no_result_found.getChildAt(0)).setText(mContext.getString(R.string.happened_wrong_try_again)); no_result_found.getChildAt(0).setVisibility(View.VISIBLE); no_result_found.setVisibility(View.VISIBLE); no_result = true; } }); } private void fetchEntagePage(final ArrayList<String> items_ids, final int length) { for(int i=0; i<items_ids.size(); i++ ){ final String id = items_ids.get(i); Query query = mFirebaseDatabase.getReference() .child(mContext.getString(R.string.dbname_entage_pages)) .child(id); query.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { removerLoadLightView(); removerLoadMoreTextView(); if(dataSnapshot.exists()){ int index = entagePages.size(); entagePages.add(index, dataSnapshot.getValue(EntagePageShortData.class)); notifyItemInserted(index); if(!isUserAnonymous && !globalVariable.getFollowingData().containsKey(id)) { checkFollowing(id, index); } } // done load if(id.equals(items_ids.get(items_ids.size()-1))){ doneLoad(length); } } @Override public void onCancelled(DatabaseError databaseError) { // done load if(id.equals(items_ids.get(items_ids.size()-1))){ doneLoad(length); } } }); } } private void checkFollowing(final String entagePageId, final int index){ Query query = mFirebaseDatabase.getReference() .child(mContext.getString(R.string.dbname_following_user)) .child(user_id) .child(entagePageId); query.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if(dataSnapshot.exists()){ globalVariable.getFollowingData().put(entagePageId, dataSnapshot.getValue(Following.class)); }else { globalVariable.getFollowingData().put(entagePageId, null); } notifyItemChanged(index); } @Override public void onCancelled(DatabaseError databaseError) {} }); } // private void doneLoad(int length){ if(length >= hitsPerPage){ indexOfLoadTextView = entagePages.size(); entagePages.add(indexOfLoadTextView, new EntagePageShortData()); notifyItemInserted(indexOfLoadTextView); } recyclerView.requestLayout(); } private void removerLoadLightView(){ if(!isRemovedProgress){ if(entagePages.get(0) == null){ // in first time isRemovedProgress = true; entagePages.clear(); notifyDataSetChanged(); } } } private void removerLoadMoreTextView(){ if(indexOfLoadTextView != -1){ if(entagePages.get(indexOfLoadTextView).getEntage_id() == null){ if(searchIcon != null){ ViewPathAnimator.cancel(searchIcon); } entagePages.remove(indexOfLoadTextView); notifyItemRemoved(indexOfLoadTextView); } indexOfLoadTextView = -1; } } public boolean isNo_result() { return no_result; } // private void setupOnClickListener(){ onClickListener = new View.OnClickListener() { @Override public void onClick(View v) { int itemPosition = recyclerView.getChildLayoutPosition(v); Intent intent = new Intent(mContext, ViewActivity.class); intent.putExtra("entagePageId", entagePages.get(itemPosition).getEntage_id()); mContext.startActivity(intent); } }; onClickListenerFollow = new View.OnClickListener() { @Override public void onClick(View v) { int itemPosition = recyclerView.getChildLayoutPosition((View) (v.getParent()).getParent()); setFollowing(entagePages.get(itemPosition), itemPosition); } }; onClickListenerFollowed = new View.OnClickListener() { @Override public void onClick(View v) { int itemPosition = recyclerView.getChildLayoutPosition((View) ((v.getParent()).getParent()).getParent()); setUnFollowing(entagePages.get(itemPosition), itemPosition); } }; onClickListenerNnotification = new View.OnClickListener() { @Override public void onClick(View v) { int itemPosition = recyclerView.getChildLayoutPosition((View) ((v.getParent()).getParent()).getParent()); if(globalVariable.getFollowingData().containsKey(entagePages.get(itemPosition).getEntage_id())){ Following followingData = globalVariable.getFollowingData().get(entagePages.get(itemPosition).getEntage_id()); if(followingData != null){ if(followingData.isIs_notifying()){ setUnNotifying(entagePages.get(itemPosition), itemPosition); }else { setNotifying(entagePages.get(itemPosition), itemPosition); } } } } }; } private void setFollowing(final EntagePageShortData entagePage, final int position){ if(!checkIsUserAnonymous()) { if (!isUserPage(entagePage) && globalVariable.getFollowingData().get(entagePage.getEntage_id()) == null) { final EntagePageSearchingAdapter.EntagePageViewHolder entagePageHolder = (EntagePageSearchingAdapter.EntagePageViewHolder)recyclerView.findViewHolderForAdapterPosition(position); if(entagePageHolder != null){ entagePageHolder.follow.setVisibility(View.GONE); entagePageHolder.relLayout_followed.setVisibility(View.VISIBLE); entagePageHolder.followed.setEnabled(false); entagePageHolder.notification.setEnabled(false); final Following following = new Following(user_id, entagePage.getEntage_id(), DateTime.getTimestamp(), false); final String topic = Topics.getTopicsFollowing(entagePage.getEntage_id()); com.google.firebase.messaging.FirebaseMessaging.getInstance().subscribeToTopic(topic) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { // push to dbname_users_notifications mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_users_subscribes)) .child(user_id) .child(topic) .setValue(true); mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_following_entage_pages)) .child(entagePage.getEntage_id()) .child(user_id) .setValue(following); mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_following_user)) .child(user_id) .child(entagePage.getEntage_id()) .setValue(following); globalVariable.getFollowingData().put(entagePage.getEntage_id(), following); entagePageHolder.followed.setEnabled(true); entagePageHolder.notification.setEnabled(true); entagePageHolder.followed.setOnClickListener(onClickListenerFollowed); entagePageHolder.notification.setOnClickListener(onClickListenerNnotification); } else { entagePageHolder.follow.setVisibility(View.VISIBLE); entagePageHolder.relLayout_followed.setVisibility(View.GONE); Toast.makeText(mContext, mContext.getString(R.string.error), Toast.LENGTH_SHORT).show(); } } }); } } } } private void setNotifying(final EntagePageShortData entagePage, final int position){ final EntagePageSearchingAdapter.EntagePageViewHolder entagePageHolder = (EntagePageSearchingAdapter.EntagePageViewHolder)recyclerView.findViewHolderForAdapterPosition(position); if(entagePageHolder != null){ entagePageHolder.notification.setBackground(mContext.getResources().getDrawable(R.drawable.border_curve_entage_blue_1_ops)); entagePageHolder.notification.setImageResource(R.drawable.ic_notification_work); entagePageHolder.followed.setEnabled(false); entagePageHolder.notification.setEnabled(false); final String topic = Topics.getTopicsNotifying(entagePage.getEntage_id()); com.google.firebase.messaging.FirebaseMessaging.getInstance().subscribeToTopic(topic) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { // push to dbname_users_notifications mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_users_subscribes)) .child(user_id) .child(topic) .setValue(true); mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_following_entage_pages)) .child(entagePage.getEntage_id()) .child(user_id) .child(mContext.getString(R.string.field_is_notifying)) .setValue(true); mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_following_user)) .child(user_id) .child(entagePage.getEntage_id()) .child(mContext.getString(R.string.field_is_notifying)) .setValue(true); globalVariable.getFollowingData().get(entagePage.getEntage_id()).setIs_notifying(true); entagePageHolder.followed.setEnabled(true); entagePageHolder.notification.setEnabled(true); }else { entagePageHolder.notification.setBackground(mContext.getResources().getDrawable(R.drawable.border_curve_entage_blue_1)); entagePageHolder.notification.setImageResource(R.drawable.ic_notification); entagePageHolder.followed.setEnabled(true); entagePageHolder.notification.setEnabled(true); Toast.makeText(mContext, mContext.getString(R.string.error), Toast.LENGTH_SHORT).show(); } } }); } } private void setUnFollowing(final EntagePageShortData entagePage, final int position){ final EntagePageSearchingAdapter.EntagePageViewHolder entagePageHolder = (EntagePageSearchingAdapter.EntagePageViewHolder)recyclerView.findViewHolderForAdapterPosition(position); if(entagePageHolder != null){ View _view = ((Activity)mContext).getLayoutInflater().inflate(R.layout.dialog_unfollowing, null); TextView unfollow = _view.findViewById(R.id.unfollow); TextView cancel = _view.findViewById(R.id.cancel); ((TextView)_view.findViewById(R.id.message)).setText(mContext.getString(R.string.do_you_want_unfollow)); unfollow.setText(mContext.getString(R.string.unfollow)); final AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.AlertDialogBlue);// //builder.setTitle(mContext.getString(R.string.do_you_want_unfollow)); builder.setView(_view); final AlertDialog alert = builder.create(); unfollow.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { alert.dismiss(); entagePageHolder.relLayout_followed.setVisibility(View.GONE); entagePageHolder.follow.setEnabled(false); entagePageHolder.follow.setVisibility(View.VISIBLE); final String topic = Topics.getTopicsFollowing(entagePage.getEntage_id()); com.google.firebase.messaging.FirebaseMessaging.getInstance().unsubscribeFromTopic(topic) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { // push to dbname_users_notifications mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_users_subscribes)) .child(user_id) .child(topic) .removeValue(); mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_following_entage_pages)) .child(entagePage.getEntage_id()) .child(user_id) .removeValue(); mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_following_user)) .child(user_id) .child(entagePage.getEntage_id()) .removeValue(); // UnsubscribeFromTopic Notifying String topic1 = Topics.getTopicsNotifying(entagePage.getEntage_id()); com.google.firebase.messaging.FirebaseMessaging.getInstance().unsubscribeFromTopic(topic1); // push to dbname_users_notifications mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_users_subscribes)) .child(user_id) .child(topic1) .removeValue(); globalVariable.getFollowingData().put(entagePage.getEntage_id(), null); entagePageHolder.notification.setBackground(mContext.getResources() .getDrawable(R.drawable.border_curve_entage_blue_1)); entagePageHolder.notification.setImageResource(R.drawable.ic_notification); entagePageHolder.follow.setEnabled(true); entagePageHolder.follow.setOnClickListener(onClickListenerFollow); }else { entagePageHolder.follow.setVisibility(View.GONE); entagePageHolder.relLayout_followed.setVisibility(View.VISIBLE); entagePageHolder.follow.setEnabled(true); Toast.makeText(mContext, mContext.getString(R.string.error), Toast.LENGTH_SHORT).show(); } } }); } }); cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { alert.dismiss(); } }); alert.show(); } } private void setUnNotifying(final EntagePageShortData entagePage, final int position){ final EntagePageSearchingAdapter.EntagePageViewHolder entagePageHolder = (EntagePageSearchingAdapter.EntagePageViewHolder)recyclerView.findViewHolderForAdapterPosition(position); if(entagePageHolder != null){ View _view = ((Activity)mContext).getLayoutInflater().inflate(R.layout.dialog_unfollowing, null); TextView unNotify = _view.findViewById(R.id.unfollow); TextView cancel = _view.findViewById(R.id.cancel); ((TextView)_view.findViewById(R.id.message)).setText(mContext.getString(R.string.do_you_want_unnotify)); unNotify.setText(mContext.getString(R.string.unnotify)); final AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.AlertDialogBlue);// //builder.setTitle(mContext.getString(R.string.do_you_want_unfollow)); builder.setView(_view); final AlertDialog alert = builder.create(); unNotify.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { alert.dismiss(); entagePageHolder.notification.setBackground(mContext.getResources().getDrawable(R.drawable.border_curve_entage_blue_1)); entagePageHolder.notification.setImageResource(R.drawable.ic_notification); entagePageHolder.followed.setEnabled(false); entagePageHolder.notification.setEnabled(false); final String topic = Topics.getTopicsNotifying(entagePage.getEntage_id()); FirebaseMessaging.getInstance().unsubscribeFromTopic(topic) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { // push to dbname_users_notifications mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_users_subscribes)) .child(user_id) .child(topic) .removeValue(); mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_following_entage_pages)) .child(entagePage.getEntage_id()) .child(user_id) .child(mContext.getString(R.string.field_is_notifying)) .setValue(false); mFirebaseDatabase.getReference().child(mContext.getString(R.string.dbname_following_user)) .child(user_id) .child(entagePage.getEntage_id()) .child(mContext.getString(R.string.field_is_notifying)) .setValue(false); globalVariable.getFollowingData().get(entagePage.getEntage_id()).setIs_notifying(false); entagePageHolder.followed.setEnabled(true); entagePageHolder.notification.setEnabled(true); }else { entagePageHolder.notification.setBackground(mContext.getResources().getDrawable(R.drawable.border_curve_entage_blue_1_ops)); entagePageHolder.notification.setImageResource(R.drawable.ic_notification_work); entagePageHolder.followed.setEnabled(true); entagePageHolder.notification.setEnabled(true); Toast.makeText(mContext, mContext.getString(R.string.error), Toast.LENGTH_SHORT).show(); } } }); } }); cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { alert.dismiss(); } }); alert.show(); } } private boolean isUserPage(EntagePageShortData entagePage){ boolean boo = false; for(String id : entagePage.getUsers_ids()){ if(user_id.equals(id)){ boo = true; Toast.makeText(mContext, mContext.getString(R.string.error_cant_follow), Toast.LENGTH_SHORT).show(); } } return boo; } private boolean checkIsUserAnonymous(){ if(isUserAnonymous){ Intent intent1 = new Intent(mContext, PersonalActivity.class); mContext.startActivity(intent1); ((Activity)mContext).overridePendingTransition(R.anim.left_to_right_start, R.anim.right_to_left_end); return true; }else { return false; } } public void setRecyclerView(RecyclerView recyclerView) { this.recyclerView = recyclerView; } /* ----------Firebase------------ */ private void setupFirebaseAuth(){ Log.d(TAG, "setupFirebaseAuth: setting firebase auth"); mAuth = FirebaseAuth.getInstance(); mFirebaseDatabase = FirebaseDatabase.getInstance(); isUserAnonymous = true; if(mAuth.getCurrentUser() != null){ user_id = mAuth.getCurrentUser().getUid(); if(!mAuth.getCurrentUser().isAnonymous()){ isUserAnonymous = false; } } } }
[ "iwajaki1994220@gmail.com" ]
iwajaki1994220@gmail.com
49429073001416a4e4d8a79caa9ed00976cf7a9c
8b5c0bfd8984ab9cca7c8c105305a4c936995a53
/src/main/java/com/mroczkowski/ecommerce/dto/Purchase.java
d7c864929af66fffb5ff599faf09f720de7d69eb
[]
no_license
pietrek141/spring-boot-ecommerce
d2eb6a548324fef334df031f83f6816e97cc1589
51aaf701faeeae7b405e374ac26c17814332d029
refs/heads/master
2023-03-22T21:08:22.588181
2021-03-23T09:59:20
2021-03-23T09:59:20
345,995,932
0
0
null
2021-03-19T13:53:52
2021-03-09T12:18:51
Java
UTF-8
Java
false
false
482
java
package com.mroczkowski.ecommerce.dto; import com.mroczkowski.ecommerce.entity.Address; import com.mroczkowski.ecommerce.entity.Customer; import com.mroczkowski.ecommerce.entity.Order; import com.mroczkowski.ecommerce.entity.OrderItem; import lombok.Data; import java.util.Set; @Data public class Purchase { private Customer customer; private Address billingAddress; private Address shippingAddress; private Order order; private Set<OrderItem> orderItems; }
[ "pietrek141@o2.pl" ]
pietrek141@o2.pl
347df04e1b331675b2aec26b36109d63c9bcdbe0
91922731f225a6cac5fa6a0dc748d1cf8b75eb34
/src/main/java/crm/dao/RoleDao.java
d2786e1270d5ed9bed1db7503070f350f78ccef5
[]
no_license
alfard1/crm-spring-mvc
b6b773b2c7641ae32b16a310180d3ec290daa6cb
8bdcdb253d1a90c0714d8cc0e9c3707862affa04
refs/heads/master
2020-06-29T01:00:48.106576
2019-09-10T21:54:57
2019-09-10T21:54:57
200,392,981
0
0
null
2019-10-30T00:03:33
2019-08-03T15:45:45
Java
UTF-8
Java
false
false
114
java
package crm.dao; import crm.entity.Role; public interface RoleDao { Role findRoleByName(String roleName); }
[ "pawel.wysokinski@gmail.com" ]
pawel.wysokinski@gmail.com
79a3e2e7c02a65ca8d32fb194cb6ed4e26bea1ff
8494facda6a881957ac24391a3a0ec3126790ca9
/mallinicouture-back-end/src/main/java/io/mallinicouture/backend/domain/Image.java
9cb05e4715cccf2ad4c8529cdbf0a7d68ce1ef32
[ "MIT" ]
permissive
minevskaani/mallinicouture
b3471da6d6fa1037e7c22e0192c2794b802324b2
6921a8f1347c3efb2d0b3f9322a98ba9ac091a2b
refs/heads/master
2023-05-03T22:31:27.612722
2021-02-03T11:06:03
2021-02-03T11:06:03
252,773,757
1
0
null
null
null
null
UTF-8
Java
false
false
782
java
package io.mallinicouture.backend.domain; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.URL; import javax.persistence.*; import javax.validation.constraints.NotBlank; @Entity @Table(name = "mc_image") @Data @NoArgsConstructor @AllArgsConstructor public class Image { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @NotBlank(message = "Link should not be blank") @URL(message = "Link should be a valid url") private String link; @ManyToOne @JoinColumn(name = "mc_dress_id") @JsonIgnore private Dress dress; public Image(String link) { this.link = link; } }
[ "kostadinalmishev@gmail.com" ]
kostadinalmishev@gmail.com
a0dbae15d4fc622c2b80b1071613d4b2a4904fe8
c4de4f6acc4171b5368e879c3bde182eaea79ac4
/Spring/SpringTutorial19/src/org/koushik/javabrains/Shape.java
4af940ba9fb5b628b8d1b075119da66b0331c74f
[]
no_license
quinnd6/java
9d67155bdd88c4209237437a042f9a0b2cfc438f
49f303ebdbfec612c1edf7d8bfa537f6a8cc7f3a
refs/heads/master
2021-01-10T04:51:10.516845
2015-11-25T20:12:17
2015-11-25T20:12:17
45,405,087
1
0
null
null
null
null
UTF-8
Java
false
false
131
java
//Spring Tutorial 19 - The Autowired Annotation package org.koushik.javabrains; public interface Shape { public void draw(); }
[ "quinnd6@msn.com" ]
quinnd6@msn.com
76790c378a9ff4819248b3feb2427bb941a26c8c
f1d567b5664ba4db93b9527dbc645b76babb5501
/src/com/javarush/test/level05/lesson09/task05/Rectangle.java
ff43cd6e58d975709e70633dbab4338c4e05e537
[]
no_license
zenonwch/JavaRushEducation
8b619676ba7f527497b5a657b060697925cf0d8c
73388fd058bdd01f1673f87ab309f89f98e38fb4
refs/heads/master
2020-05-21T20:31:07.794128
2016-11-12T16:28:22
2016-11-12T16:28:22
65,132,378
8
4
null
null
null
null
UTF-8
Java
false
false
1,413
java
package com.javarush.test.level05.lesson09.task05; /* Создать класс прямоугольник (Rectangle) Создать класс прямоугольник (Rectangle). Его данными будут top, left, width, height (левая координата, верхняя, ширина и высота). Создать для него как можно больше конструкторов: Примеры: - заданы 4 параметра: left, top, width, height - ширина/высота не задана (оба равны 0) - высота не задана (равно ширине) создаём квадрат - создаём копию другого прямоугольника (он и передаётся в параметрах) */ public class Rectangle { int top; int left; int width; int height; public Rectangle(Rectangle rectangle) { this.top = rectangle.top; this.left = rectangle.left; this.width = rectangle.width; this.height = rectangle.height; } public Rectangle(int top, int left, int width) { this.top = top; this.left = left; this.width = width; height = width; } public Rectangle(int top, int left) { this.top = top; this.left = left; width = 0; height = 0; } public Rectangle(int top, int left, int width, int height) { this.top = top; this.left = left; this.width = width; this.height = height; } }
[ "andrey.veshtard@ctco.lv" ]
andrey.veshtard@ctco.lv
2a31c92e24d151a77ee764c15d46e9de75ffb8b8
2f32304be41bbb1d1405b4b0f2256d9102c59b5d
/src/com/example/command/WriteReviewCommand.java
2a4896aa8032554ecbac40dc7bf479190496f844
[]
no_license
C17300916/Software-Engineering-3rd-Year
b937b14d76b9dae345eaa7b6b6b17175249a2214
32185f5132b10977a08eb750e8ec911e4ecc6e14
refs/heads/master
2022-10-13T08:39:30.655126
2020-06-08T18:29:00
2020-06-08T18:29:00
270,776,523
0
0
null
null
null
null
UTF-8
Java
false
false
536
java
package com.example.command; import java.util.LinkedList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; public class WriteReviewCommand implements Command { public String execute(HttpServletRequest request, HttpServletResponse repsonse){ String forwardToJsp = ""; HttpSession session = request.getSession(false); forwardToJsp = "/WriteReview.jsp"; return forwardToJsp; } }
[ "noreply@github.com" ]
C17300916.noreply@github.com
af49eeae9b7e9a6f672e4049d6109aadbccdf6d6
ffb5e80d137b88b99ce477798da4c4724130f912
/javatest/src/main/java/ComputeIfAbsent.java
6ef00013fb0b5fed7418450bd9981e35d4654530
[]
no_license
weichao666/mydemo
d512821c707c8b0299265f0d5741512e663f7165
507ccf11bf6cf72a3762a318de6c501e8fd0155a
refs/heads/master
2021-06-25T05:17:04.553148
2020-06-09T14:30:03
2020-06-09T14:30:03
144,951,165
0
0
null
2020-10-12T21:37:06
2018-08-16T07:12:35
Java
UTF-8
Java
false
false
1,937
java
import java.util.HashMap; import java.util.Map; //computeIfPresent和computeIfAbsent //这两个方法正好相反,前者是在key存在时,才会用新的value替换oldValue //当传入的key存在,并且传入的value为null时,前者会remove(key),把传入的key对应的映射关系移除;而后者不论何时都不会remove(); //前者只有在key存在,并且传入的value不为空的时候,返回值是value,其他情况都是返回null; // 后者只有在key不存在,并且传入的value不为null的时候才会返回value,其他情况都返回null; public class ComputeIfAbsent { static Map<String, String> stringMap = new HashMap<>(); public static void main(String[] args) { for (int i = 1; i < 6; i++) { //putIfAbsent不需要我们做额外的存在性检查 stringMap.putIfAbsent(String.valueOf(i), "value" + i); } stringMap.forEach((k, val) -> System.out.println(val)); //使用场景:从map中获取所需要的value,若其为null,就用准备好的值即Function的返回值 Object result1 = stringMap.computeIfAbsent("1", k -> "bam"); Object result2 = stringMap.computeIfAbsent("6", k -> "newaddvalue6"); System.out.println(); for (Map.Entry n : stringMap.entrySet()) { System.out.println(n); } System.out.println(); //使用场景:更新map中存在的且其value值不为null的键值对的值 //*存在且value不为null:1.BiFunction返回值为null,删除该节点;2.BiFunction返回值不为null,作为新value,返回其值 //*不存在或其value为null,返回null stringMap.computeIfPresent("6", (k, val) -> val + k); System.out.println("6=" + stringMap.get("6")); stringMap.computeIfPresent("6", (k, val) -> null); System.out.println(stringMap.containsKey("6")); } }
[ "weichao16@huawei.com" ]
weichao16@huawei.com
7fca73fa53bf1660ef1ec57565c264177afe845b
74a5b622ee464bf00a9e129f43990c648598b69e
/umbrella-ws/src/main/java/com/harmony/umbrella/ws/service/Message.java
978e0e198edbfcfc00ff9dafd7e56de0ca7f59f2
[]
no_license
cenbow/umbrella
9aa01b6801b99b68f00379324d43737cdb3152b2
54e48c188593b596ad7d8414a86ab879edf612c3
refs/heads/master
2020-04-12T10:10:36.500752
2018-12-16T12:17:29
2018-12-16T12:17:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,130
java
package com.harmony.umbrella.ws.service; import java.io.Serializable; import java.util.HashMap; import java.util.Map; /** * 作为服务的返回消息 * * @author wuxii@foxmail.com */ public class Message implements Serializable { private static final long serialVersionUID = -8204124664128300071L; /** * INFO */ public static final String I = "I"; /** * WARN */ public static final String W = "W"; /** * ERROR */ public static final String E = "E"; /** * SUCCESS */ public static final String S = "S"; /** * 服务的操作消息 */ protected String message; /** * 服务处理的结果类型 */ protected String type; /** * 服务处理的中间结果 */ protected final Map<String, String> content = new HashMap<String, String>(); public Message() { } public Message(String message, String type) { this(message, type, new HashMap<String, String>()); } public Message(String message, String type, Map<String, String> content) { this.message = message; this.type = type; if (content != null && !content.isEmpty()) { this.content.putAll(content); } } /** * 消息的类型 * <ul> * <li>I - info * <li>W - warn * <li>E - error * <li>S - success * </ul> * * @return 消息的标识 */ public String getType() { return type; } /** * 消息的类型 * <ul> * <li>I - info * <li>W - warn * <li>E - error * <li>S - success * </ul> * */ public void setType(String type) { this.type = type; } /** * 返回的消息 * * @return 文本消息 */ public String getMessage() { return message; } /** * 设置消息文本 * * @param message * 消息文本 */ public void setMessage(String message) { this.message = message; } /** * 必须, 大多数框架解析的为getter方法. */ public Map<String, String> getContent() { return content; } /** * 设置服务的内容 * * @param content * 服务内容 */ public void setContent(Map<String, String> content) { this.content.clear(); this.content.putAll(content); } /** * 增加消息节点 * * @param key * 消息节点的key * @param value * 消息节点的value */ public void addContent(String key, String value) { content.put(key, value); } /** * 在原有基础上添加所有内容 * * @param content */ public void addAllContent(Map<String, String> content) { if (content != null && !content.isEmpty()) { this.content.putAll(content); } } @Override public String toString() { return "Message {type:" + type + ", message:" + message + ", content:" + content + "}"; } }
[ "wuxii@foxmail.com" ]
wuxii@foxmail.com
e8f0fdf7d328d9dab259f594d2e8611c98c0b041
fcfa300fa7a21947515fe8af167cfce7b46c7d5d
/Java 02 OOP/Java 02 OOP 03 Abstract and interfaces/src/mineral/Plutonio.java
6bcb292958194148ad7e9942dcba3e7c19846a4c
[]
no_license
LBerrospe/Java-SE
5f03193baad32597ac8ce7e1cd4a825e6bf958f1
d9181f8ffde387caa5cc92d41c66e510f08cc78f
refs/heads/master
2020-12-26T04:15:24.239160
2016-07-17T16:17:24
2016-07-17T16:17:38
66,025,592
1
0
null
null
null
null
UTF-8
Java
false
false
71
java
package mineral; public final class Plutonio extends radioactivo { }
[ "fernando17carrillo@hotmail.com" ]
fernando17carrillo@hotmail.com
24f232beeff2eee130089d4a4069b03c006d0dd8
c75cb672e687e6cc39493e5c460fcfe1c648aa60
/src/arrays/PartitionArray.java
e3dd8faf50def63277866109a478bce381507909
[]
no_license
SudhakarKamanboina/Data-Structures
dcff8e11343c353ed43d8c44cbe0a83687e80936
4ddd3309cd21e74094ab080dd9fd65b73302caab
refs/heads/master
2021-01-18T18:14:20.767891
2016-01-25T00:17:52
2016-01-25T00:17:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
514
java
package arrays; public class PartitionArray { public int[] partitionArray(int[] a, int m) { int i = 0; int j = a.length - 1; int pivot = a[m]; while (i < j) { while (a[i] < pivot) i++; while (a[j] > pivot) j--; if(i<j) swap(a,i,j); } return a; } public void swap(int[] a,int i,int j) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } }
[ "harwaniharsh@gmail.com" ]
harwaniharsh@gmail.com
6e08bba988a13b069b58773130a6ad5acb6bdfd7
465fbc4ccffbfd75236554e71dda61cda286bfce
/src/main/java/in/co/ankitbansal/footballleague/config/WebConfig.java
aa0950e8312bd8350a23fddd39d574f341bfdae6
[]
no_license
bansalankit92/football-league-ps-microservice
6c15782357ab6d8d856c5fd17064a92ad75a549a
9c003c842808037049fedabd61682dc4a2b98bd3
refs/heads/master
2021-07-15T15:30:23.978037
2020-03-21T08:20:09
2020-03-21T08:20:09
248,915,655
0
0
null
2021-06-04T02:32:24
2020-03-21T05:51:19
Java
UTF-8
Java
false
false
1,073
java
package in.co.ankitbansal.footballleague.config; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; @Configuration public class WebConfig { @Value("${rest.client.read.timeout}") private int readTimeout; @Value("${rest.client.connect.timeout}") private int connectTimeout; @Bean public RestTemplate getRestTemplate() { return new RestTemplate(getClientHttpRequestFactory()); } private ClientHttpRequestFactory getClientHttpRequestFactory() { HttpComponentsClientHttpRequestFactory clientHttpRequestFactory = new HttpComponentsClientHttpRequestFactory(); clientHttpRequestFactory.setReadTimeout(readTimeout); clientHttpRequestFactory.setConnectTimeout(connectTimeout); return clientHttpRequestFactory; } }
[ "abansal@shutterfly.com" ]
abansal@shutterfly.com
19a933e9321458d86c1cc3854e6d3ea61fd0513c
4ebae2a1964a818d44160e61772f255349beab5b
/bSim.java
ea547608da2047b56837d0603c96b2a3c558a581
[]
no_license
alymo8/Bouncing-balls-game
49443060b4eefa6f4bdd2a0bd277e1a67521e0d2
d74335ff87333e0348d4a58ecbd8cd528f165bd0
refs/heads/main
2023-04-18T15:41:40.559503
2021-05-06T20:36:36
2021-05-06T20:36:36
364,558,405
0
0
null
null
null
null
UTF-8
Java
false
false
6,542
java
import acm.graphics.*; import acm.gui.DoubleField; import acm.gui.IntField; import acm.gui.TablePanel; import acm.program.*; import acm.util.RandomGenerator; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JToggleButton; /** * * @author alymo * */ public class bSim extends GraphicsProgram implements ActionListener{ private static final int WIDTH = 1200; // n.b. screen coordinates private static final int HEIGHT = 500; private static final int OFFSET = 100; private static final double SCALE = HEIGHT/100; // pixels per meter private boolean Cleared; volatile static boolean Traceable; volatile static boolean PauseEnable; volatile static boolean SimEnable ; private boolean StackEnable; private RandomGenerator rgen = RandomGenerator.getInstance(); bTree myTree = new bTree(); private IntField numBalls; private DoubleField minSize; private DoubleField maxSize; private DoubleField minLoss; private DoubleField maxLoss; private DoubleField minVel; private DoubleField maxVel; private DoubleField ThMin; private DoubleField ThMax; private JButton b1; private JButton b2; private JButton b3; private JButton b4; private JButton b5; private JToggleButton Trace; private TablePanel P; private boolean ClearEnable; /** * The init method is responsible of all the display making the user interface */ public void init() { rgen.setSeed((long) 424242); //initialize the seed so we obtain a precise sequence of results addActionListeners(); this.resize(WIDTH, HEIGHT+OFFSET); // create the ground GRect rect = new GRect(0,HEIGHT,WIDTH,3); rect.setFilled(true); add(rect); b1 = new JButton("Run"); b2 = new JButton("Stack"); b3 = new JButton("Clear"); b4 = new JButton("Quit"); b5 = new JButton("Stop"); Trace = new JToggleButton("Trace"); numBalls = new IntField(60); minSize = new DoubleField(1.0); maxSize = new DoubleField(7.0); minLoss = new DoubleField(0.2); maxLoss = new DoubleField(0.6); minVel = new DoubleField(40.0); maxVel = new DoubleField(50.0); ThMin = new DoubleField(80.0); ThMax = new DoubleField(100.0); P = new TablePanel(10,2); //construct the table with general simulation parametets add(P,EAST); P.add(new JLabel(" ")); P.add(new JLabel("General simulation parameters")); P.add(new JLabel("NUMBALLS:")); P.add(numBalls); P.add(new JLabel("MIN SIZE:")); P.add(minSize); P.add(new JLabel("MAX SIZE:")); P.add(maxSize); P.add(new JLabel("LOSS MIN:")); P.add(minLoss); P.add(new JLabel("LOSS MAX:")); P.add(maxLoss); P.add(new JLabel("MIN VEL:")); P.add(minVel); P.add(new JLabel("MAX VEL:")); P.add(maxVel); P.add(new JLabel("TH MIN:")); P.add(ThMin); P.add(new JLabel("TH MAX:")); P.add(ThMax); add(b1, NORTH); //add the JButtons add(b2, NORTH); add(b3, NORTH); add(b5, NORTH); add(b4, NORTH); add(Trace, SOUTH); // add the TracePoints Trace.addItemListener(itemlistener); addActionListeners(); } /** * The run method put conditions for the booleans. * This will help us make the buttons do their proper fuctions */ public void run() { SimEnable = false; StackEnable = false; while (true) { pause (200); if(SimEnable) { doSim(); SimEnable = false; while (myTree.isRunning()); // Block until termination GLabel done = new GLabel("Simulation complete"); // Prompt user done.setLocation(800, 100); done.setFont("Arial-plain-12"); done.setColor(Color.RED); add(done); } else if (StackEnable) { doStack(); StackEnable=false; } } } /** * The actionPerformed method makes the buttons do their functions */ public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Run")) SimEnable = true; //when the button is on start the simulation else if (e.getActionCommand().equals("Stack")) StackEnable = true; else if (e.getActionCommand().equals("Clear")) { Clear() ; Traceable = false; } else if (e.getActionCommand().equals("Quit")) System.exit(0); else if (e.getActionCommand().equals("Stop")) { myTree.stopBalls(); } } /** * The itemListener method activates the Trace JToggleButton when it's pressed */ ItemListener itemlistener = new ItemListener() { //when Trace is on add the trace points public void itemStateChanged(ItemEvent e) { int state = e.getStateChange(); if (state == e.SELECTED) { Traceable = true; } else Traceable = false; } }; /** * The doSim method implements the simulation loop instead of run. * Once it's called it starts a new simulation with the parameters entered by the user * @param void * @return void */ public void doSim() { for(int i=1; i <= numBalls.getValue(); i++) { double iSize = rgen.nextDouble(minSize.getValue(), maxSize.getValue()); //enter parameters values using the random generator Color iColor = rgen.nextColor(); double iLoss = rgen.nextDouble(minLoss.getValue(), maxLoss.getValue()); double iVel = rgen.nextDouble(minVel.getValue(), maxVel.getValue()); double iTheta = rgen.nextDouble(ThMin.getValue(), ThMax.getValue()); double Xi = (WIDTH-300)/2/SCALE; double Yi=iSize; aBall iBall = new aBall(Xi,Yi,iVel,iTheta,iSize,iColor,iLoss,this); //create an instance of a ball add(iBall.getBall()); iBall.start(); //start makes all the balls go at the same time myTree.addNode(iBall); } } /** * The doStack stacks the balls by size using bTree * It works directly after the balls stop */ public void doStack(){ while (myTree.isRunning()) ; // Block until termination String str = "All stacked!"; GLabel text = new GLabel(str, 800, 100 );// Prompt user text.setColor(Color.GREEN); text.setLabel(""); add(text); bTree.X=0; bTree.Y= 0; myTree.stackBalls(); // Lay out balls in order } /** * The Clear method removes everything in the display and adds a new ground * It also creates a new bTree to remove the cleared balls from the old bTree * */ public void Clear() { removeAll(); //remove the balls from the screen Cleared = true; myTree = new bTree(); GRect nrect = new GRect(0,HEIGHT,WIDTH,3); nrect.setFilled(true); add(nrect); } public boolean getTraceable() { return Traceable; } }
[ "aly.mohamed@mail.mcgill.ca" ]
aly.mohamed@mail.mcgill.ca
5d390361e881014915f251a2131fb1028ad609b4
efb9e80c6d7be8437260b64c1611b4b49a9cb173
/SubString.java
12af45fc4196929c4ecc0e4ee194e3676dfc1771
[]
no_license
pradeepjawahar/leetcode
6f227ef70bc93909b3e2c672fa9a3b3591809619
2de11af955bd09621bd32365ce0bf4a36500f3d1
refs/heads/master
2021-01-10T04:36:04.177208
2016-02-29T21:50:59
2016-02-29T21:50:59
52,764,542
0
0
null
null
null
null
UTF-8
Java
false
false
1,280
java
public class SubString { public static int subStr(String haystack, String needle) { if (haystack == null || needle == null) return -1; int hLen = haystack.length(); int nLen = needle.length(); for (int i = 0; i <= hLen - nLen; i++) { int j; for(j = 0; j < nLen; j++) { if (needle.charAt(j) != haystack.charAt(i+j)) break; } if (j == nLen) return i; } return -1; } public static void main(String[] args) throws Exception { System.out.println(subStr("hello world", "hello")); System.out.println(strStr("hello world", "hello")); System.out.println(strStr("hello world", "helle")); } public static int strStr(String haystack, String needle) { if(haystack == null || needle == null) return -1; int hLen = haystack.length(); int nLen = needle.length(); for(int i = 0; i <= hLen-nLen; i++){ int j = 0; for(; j<nLen; j++){ if(needle.charAt(j)!=haystack.charAt(i+j)) break; } if(j == nLen) return i; } return -1; } }
[ "pjawahar@groupon.com" ]
pjawahar@groupon.com
3a87f8efa4ddf9a631fee25511fc5b9caa2243da
ae86668a3e53bec6c59297d3074993a0fbf98990
/NormalInnerClass/src/online/wallet/www/CallFromNonStaticMethod/OtherClass.java
621bf2593ed9e432925a2037486d2ea114f5bb96
[]
no_license
adarshsingh58/InnerClass
6c944fff53034ff85f75eee4d7fb98f3f2ffea1f
bbc38eba18e3cc1b7d0c61bdf53bef4d383275cc
refs/heads/master
2020-12-02T09:59:33.999179
2017-07-09T10:17:29
2017-07-09T10:17:29
96,672,366
0
0
null
null
null
null
UTF-8
Java
false
false
201
java
package online.wallet.www.CallFromNonStaticMethod; public class OtherClass { public static void main(String[] args) { Outer o=new Outer(); Outer.Inner inner=o.new Inner(); inner.hello(); } }
[ "adarshsingh58@gmail.com" ]
adarshsingh58@gmail.com
f5bf286f0fa792f8d5a15fbf1492db594ddbd745
e782281d5efc6d40d57abcd4b7738a5640d9305d
/ReserveMicroservice/src/main/java/com/bt/appointment/dto/ListAvailableAppointment.java
1b8151dd10f38cbed12ba458ccbd9378ea9c62c8
[]
no_license
tanujtripathi/microservices
9620b9bd674c954d50f5c90e56cb53504b45d36c
81ede5fb81d0534d47a0f2c3a53ab20caa6a3690
refs/heads/master
2020-06-01T00:21:21.309786
2019-06-10T16:52:28
2019-06-10T16:52:28
190,554,825
0
0
null
null
null
null
UTF-8
Java
false
false
663
java
package com.bt.appointment.dto; import java.io.Serializable; public class ListAvailableAppointment implements Serializable{ ListAvailableAppointmentResponse listAvailableAppointmentResponse = new ListAvailableAppointmentResponse(); public ListAvailableAppointment() { // TODO Auto-generated constructor stub } public ListAvailableAppointmentResponse getListAvailableAppointmentResponse() { return listAvailableAppointmentResponse; } public void setListAvailableAppointmentResponse(ListAvailableAppointmentResponse listAvailableAppointmentResponse) { this.listAvailableAppointmentResponse = listAvailableAppointmentResponse; } }
[ "noreply@github.com" ]
tanujtripathi.noreply@github.com