blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
โŒ€
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
098613971598cbf3b64debc071951a682d8a8814
c94e2b588730c37828ad0cb421bfea4add84cd8d
/src/main/java/org/redquark/algorithms/sorting/CycleSort.java
e660ae749f7b62328d03b674d3be2659c5f5b2ad
[]
no_license
ani03sha/Algorithms-Archives
d1231c7c9e4b542d66592ca9790ae510ca0eee30
da6a6a716738518bd797c3776bd2e9b48e8ea266
refs/heads/master
2021-10-10T20:31:33.179070
2019-01-16T17:42:31
2019-01-16T17:42:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,054
java
package org.redquark.algorithms.sorting; /** * @author Anirudh Sharma * <p> * Cycle sort is an in-place sorting Algorithm, unstable sorting algorithms, * a comparison sort that is theoretically optimal in terms of the total number of writes to the original array. * <p> * - It is optimal in terms of number of memory writes. It minimizes the number of memory writes to sort * (Each value is either written zero times, if itโ€™s already in its correct position, or written one time * to its correct position.) * <p> * - It is based on the idea that array to be sorted can be divided into cycles. * Cycles can be visualized as a graph. We have n nodes and an edge directed from node i to node j * if the element at i-th index must be present at j-th index in the sorted array. */ public class CycleSort { /** * This method sorts the array */ public <T extends Comparable<T>> T[] sort(T[] arr) { int n = arr.length; // Counter for the number of memory writes int count = 0; // Traverse array and put the elements on their respective right places for (int i = 0; i < n - 2; i++) { // Initialize item as the starting point T item = arr[i]; // Find the position where we want to put the item // Basically we count all the smaller elements to the right of the item int position = i; for (int j = i + 1; j < n; j++) { if (arr[j].compareTo(item) < 0) { position++; } } // Check if the element is already at the correct position... if (position == i) { // .. then we do not have to do anything continue; } // Ignore duplicate elements while (item == arr[position]) { position++; } // Put the elements at its right position if (position != i) { // Swap T temp = item; item = arr[position]; arr[position] = temp; count++; } // Rotate remaining cycle while (position != i) { position = i; // Find the position where we put the element for (int j = i + 1; j < n; j++) { if (arr[j].compareTo(item) < 0) { position++; } } // Ignore duplicate elements while (item == arr[position]) { position++; } // Put the element to its correct position if (item != arr[position]) { T temp = arr[position]; arr[position] = item; item = temp; count++; } } } System.out.println("Number of memory writes :: " + count); return arr; } }
[ "anirudh.sharma@gspann.com" ]
anirudh.sharma@gspann.com
5a0f7277c53a72b968143c527a5569b1b0304057
05aaa3f81a95a6e911842f61d45ff2e58bdb6293
/src/main/net/wohlfart/terminal/commands/PerformResetPasswords.java
434a7d8284a9ca6d925b014e765a6693f41c0c1b
[]
no_license
mwohlf/nchar
0f682af4b25619d3503716e1d5dbb171ced5cca0
e5b8e67b81f38fabd64d7d06345db8fdc7309011
refs/heads/master
2021-01-20T05:29:01.319685
2011-10-29T17:08:02
2011-10-29T17:08:02
2,651,831
0
1
null
null
null
null
UTF-8
Java
false
false
2,314
java
package net.wohlfart.terminal.commands; import java.util.List; import net.wohlfart.authentication.entities.CharmsUser; import net.wohlfart.authorization.CustomHash; import net.wohlfart.terminal.IRemoteCommand; import org.apache.commons.lang.StringUtils; import org.hibernate.Session; import org.jboss.seam.Component; import org.jboss.seam.annotations.Transactional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class PerformResetPasswords implements IRemoteCommand { private final static Logger LOGGER = LoggerFactory.getLogger(PerformResetPasswords.class); private static final String COMMAND_STRING = "reset passwords"; @Override public boolean canHandle(final String commandLine) { return StringUtils.startsWith(StringUtils.trim(commandLine), COMMAND_STRING); } @SuppressWarnings("unchecked") @Override @Transactional public String doHandle(final String commandLine) { final Session hibernateSession = (Session) Component.getInstance("hibernateSession", true); LOGGER.debug("hibernateSession is: {}", hibernateSession); String passwd = StringUtils.substringAfter(commandLine, COMMAND_STRING); if (StringUtils.isEmpty(passwd)) { LOGGER.warn("passwd string is empty"); return "passwd string is empty"; } passwd = passwd.trim(); if (passwd.length() < 6) { LOGGER.warn("passwd string is too small"); return "passwd string is empty"; } LOGGER.warn("passwd string is >{}<", passwd); hibernateSession.getTransaction().begin(); final List<CharmsUser> list = hibernateSession.createQuery("from " + CharmsUser.class.getName()).list(); for (final CharmsUser user : list) { user.setPasswd(CustomHash.instance().generateSaltedHash(passwd, user.getName())); hibernateSession.persist(user); } LOGGER.debug("flushing..."); hibernateSession.flush(); LOGGER.debug("committing..."); hibernateSession.getTransaction().commit(); return COMMAND_STRING + " done"; } @Override public String getUsage() { return COMMAND_STRING + " &lt;new password&gt; : reset all passwords (DON'T DO THIS IN PRODUCTION!!!)"; } }
[ "michael@wohlfart.net" ]
michael@wohlfart.net
f43a4c3a111786a3e2be68ce6e7133cc6ffb4a48
f3440de195e4f8cb8035ccb3b64de60c7bf06de6
/src/main/java/com/aihello/magento/config/AsyncConfiguration.java
28ce85354b84649514ceae1609bf5740733e03dc
[]
no_license
sivankumar86/magento2
08750e6e3084fa0bd7837423e07fec7cb02b4517
a76967d4b230deb36b74a91e9fe7acd9d7e9cd0d
refs/heads/master
2021-01-23T20:23:23.246704
2017-09-08T11:35:09
2017-09-08T11:35:09
102,854,662
0
0
null
null
null
null
UTF-8
Java
false
false
1,780
java
package com.aihello.magento.config; import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor; import io.github.jhipster.config.JHipsterProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.*; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.concurrent.Executor; @Configuration @EnableAsync @EnableScheduling public class AsyncConfiguration implements AsyncConfigurer { private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class); private final JHipsterProperties jHipsterProperties; public AsyncConfiguration(JHipsterProperties jHipsterProperties) { this.jHipsterProperties = jHipsterProperties; } @Override @Bean(name = "taskExecutor") public Executor getAsyncExecutor() { log.debug("Creating Async Task Executor"); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize()); executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize()); executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity()); executor.setThreadNamePrefix("magento-2-Executor-"); return new ExceptionHandlingAsyncTaskExecutor(executor); } @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return new SimpleAsyncUncaughtExceptionHandler(); } }
[ "srramas@acbc32c3dd6d.ant.amazon.com" ]
srramas@acbc32c3dd6d.ant.amazon.com
6383db203c0261e7ada65be081e7b3368ec896bc
66e47aa077e208db59743e85a939f1c72612a78a
/src/collectionframework/B_ArrayListTest.java
91d2728edd8ea50d34e4093f08945b0f54456b33
[]
no_license
ldyong911/201809java_high
9e669b78be9bbfd4644f7e97e071980507ef6254
ba8d8065c2b79ca46cbb0a82004f56e6c51acc15
refs/heads/master
2022-01-06T06:25:11.932270
2019-05-10T08:08:18
2019-05-10T08:08:18
184,007,092
0
0
null
null
null
null
UTF-8
Java
false
false
3,114
java
package collectionframework; import java.util.ArrayList; public class B_ArrayListTest { public static void main(String[] args) { // ArrayList๋Š” ๊ธฐ๋ณธ์ ์ธ ์‚ฌ์šฉ๋ฒ•์ด Vector์™€ ๊ฐ™๋‹ค. ArrayList list1 = new ArrayList(); // add()๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค. list1.add("aaa"); list1.add("bbb"); list1.add(111); list1.add('k'); list1.add(true); list1.add(12.34); // size() ==> ๋ฐ์ดํ„ฐ ๊ฐœ์ˆ˜ System.out.println("size => " + list1.size()); System.out.println("list1 => " + list1); // get์œผ๋กœ ๋ฐ์ดํ„ฐ ๊บผ๋‚ด์˜ค๊ธฐ System.out.println("1๋ฒˆ์งธ ์ž๋ฃŒ : " + list1.get(1)); // ๋ฐ์ดํ„ฐ ๋ผ์›Œ ๋„ฃ๊ธฐ๋„ ๊ฐ™๋‹ค. list1.add(0, "zzz"); System.out.println("list1 => " + list1); // ๋ฐ์ดํ„ฐ ๋ณ€๊ฒฝํ•˜๊ธฐ (set๋ฉ”์„œ๋“œ) String temp = (String) list1.set(0, "YYY"); System.out.println("temp => " + temp); System.out.println("list1 => " + list1); // ์‚ญ์ œํ•˜๊ธฐ๋„ ๊ฐ™๋‹ค. list1.remove(0); System.out.println("์‚ญ์ œํ›„ : " + list1); list1.remove("bbb"); System.out.println("bbb ์‚ญ์ œํ›„ : " + list1); System.out.println("==========================="); // ์ œ๋„ค๋ฆญ์„ ์ง€์ •ํ•˜์—ฌ ์„ ์–ธํ•  ์ˆ˜ ์žˆ๋‹ค. ArrayList<String> list2 = new ArrayList<String>(); list2.add("AAA"); list2.add("BBB"); list2.add("CCC"); list2.add("DDD"); list2.add("EEE"); for(int i=0; i<list2.size(); i++){ System.out.println(i + " : " + list2.get(i)); } System.out.println("---------------------------"); for(String s : list2){ System.out.println(s); } System.out.println("---------------------------"); // contains(๋น„๊ต๊ฐ์ฒด); ==> ๋ฆฌ์ŠคํŠธ์— '๋น„๊ต๊ฐ์ฒด'๊ฐ€ ์žˆ์œผ๋ฉด true // ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด false System.out.println(list2.contains("DDD")); // true System.out.println(list2.contains("ZZZ")); // false // indexOf(๋น„๊ต๊ฐ์ฒด); ==> ๋ฆฌ์ŠคํŠธ์—์„œ '๋น„๊ต๊ฐ์ฒด'๋ฅผ ์ฐพ์•„ '๋น„๊ต๊ฐ์ฒด'๊ฐ€ // ์žˆ๋Š” index๊ฐ’์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค. // ๋ฆฌ์ŠคํŠธ์— '๋น„๊ต๊ฐ์ฒด'๊ฐ€ ์—†์œผ๋ฉด -1์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค. System.out.println("DDD์˜ index๊ฐ’ : " + list2.indexOf("DDD")); System.out.println("ZZZ์˜ index๊ฐ’ : " + list2.indexOf("ZZZ")); System.out.println("---------------------------"); // toArray() ==> ๋ฆฌ์ŠคํŠธ ์•ˆ์˜ ๋ฐ์ดํ„ฐ๋“ค์„ ๋ฐฐ์—ด๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•œ๋‹ค. // ๊ธฐ๋ณธ์ ์œผ๋กœ Objectํ˜• ๋ฐฐ์—ด๋กœ ๋ณ€ํ™˜ํ•œ๋‹ค. Object[] strArr = list2.toArray(); System.out.println("๋ฐฐ์—ด์˜ ๊ฐœ์ˆ˜ : " + strArr.length); // toArray()์—์„œ ์บ์ŠคํŒ…์€ ๋˜์ง€ ์•Š๋Š”๋‹ค. // String[] strArr2 = (String[]) list2.toArray(); // ๋ฆฌ์ŠคํŠธ์˜ ์ œ๋„ค๋ฆญ ํƒ€์ž…์— ๋งž๋Š” ์ž๋ฃŒํ˜•์˜ ๋ฐฐ์—ด๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ๋ฐฉ๋ฒ• // ์ œ๋„ค๋ฆญํƒ€์ž…์˜ 0๊ฐœ์งœ๋ฆฌ ๋ฐฐ์—ด์„ ์ƒ์„ฑํ•ด์„œ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๋„ฃ์–ด์ค€๋‹ค. // ํ˜•์‹) toArray(new ์ œ๋„ค๋ฆญํƒ€์ž…[0]) String[] strArr2 = list2.toArray(new String[0]); System.out.println("strArr2์˜ ๊ฐœ์ˆ˜ : " + strArr2.length); for(String ss : strArr2){ System.out.println(ss); } for(int i=0; i<strArr2.length; i++){ System.out.println(strArr2[i]); } } }
[ "ldyong911@gmail.com" ]
ldyong911@gmail.com
c46a73e6aad6c922246348a839e635ee169cb3ae
1c5fd654b46d3fb018032dc11aa17552b64b191c
/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/DeleteOperation.java
225b6ce6ad0aa0ab8d92bc074b615d1c5feb9961
[ "Apache-2.0" ]
permissive
yangfancoming/spring-boot-build
6ce9b97b105e401a4016ae4b75964ef93beeb9f1
3d4b8cbb8fea3e68617490609a68ded8f034bc67
refs/heads/master
2023-01-07T11:10:28.181679
2021-06-21T11:46:46
2021-06-21T11:46:46
193,871,877
0
0
Apache-2.0
2022-12-27T14:52:46
2019-06-26T09:19:40
Java
UTF-8
Java
false
false
659
java
package org.springframework.boot.actuate.endpoint.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Identifies a method on an {@link Endpoint} as being a delete operation. * * @author Stephane Nicoll * @author Andy Wilkinson * @since 2.0.0 */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface DeleteOperation { /** * The media type of the result of the operation. * @return the media type */ String[] produces() default {}; }
[ "34465021+jwfl724168@users.noreply.github.com" ]
34465021+jwfl724168@users.noreply.github.com
a7ff21816b0f7df1d09edffb44cfda94dc0824ca
872603d5189090f9df9acb437ffb304b1b87fb18
/app/src/main/java/com/example/ukasz/projektjavaandroid/MainActivity.java
cfe4af3bb0e5456ea9a7cf2823194790ec046e03
[]
no_license
Tomaschenbaum/projektJava
a5fcee8cd9431c77be0cc5f94ca4e9e9c4008c4b
8ca2bcf75be8c9cb5f0ddec38a0df97050bb47db
refs/heads/master
2020-04-22T16:06:23.506279
2019-02-13T10:35:46
2019-02-13T10:35:47
170,497,747
0
0
null
null
null
null
UTF-8
Java
false
false
4,619
java
package com.example.ukasz.projektjavaandroid; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; public class MainActivity extends AppCompatActivity implements View.OnClickListener { EditText editTextEmail, editTextPassword; private FirebaseAuth mAuth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main); findViewById(R.id.buttonLogin).setOnClickListener(this); findViewById(R.id.buttonCreateAccount).setOnClickListener(this); editTextEmail = findViewById(R.id.editTextEmail); editTextPassword = findViewById(R.id.editTextPassword); mAuth = FirebaseAuth.getInstance(); } @Override public void onClick(View view) { switch(view.getId()) { case R.id.buttonLogin: buttonLoginTapped(); break; case R.id.buttonCreateAccount: buttonCreateAccountTapped(); break; } } public void buttonCreateAccountTapped() { String email = editTextEmail.getText().toString().trim(); String password = editTextPassword.getText().toString().trim(); if(email.isEmpty()) { editTextEmail.setError("Pole jest puste"); editTextEmail.requestFocus(); return; } if(password.isEmpty()) { editTextPassword.setError("Pole jest puste"); editTextPassword.requestFocus(); return; } if(password.length() < 6) { editTextPassword.setError("Hasล‚o musi posiadaฤ‡ co najmniej 6 znakรณw"); } startActivity(new Intent(MainActivity.this, LoggedInActivity.class)); // mAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { // @Override // public void onComplete(@NonNull Task<AuthResult> task) { // if (task.isSuccessful()) { // Toast.makeText(getApplicationContext(), "Uลผytkownik zarejestrowany pomyล›lnie", Toast.LENGTH_SHORT).show(); // startActivity(new Intent(MainActivity.this, LoggedInActivity.class)); // } else { // Toast.makeText(getApplicationContext(), "Uwierzytelnianie zakoล„czone niepowodzeniem", Toast.LENGTH_SHORT).show(); // } // } // }); } public void buttonLoginTapped() { String email = editTextEmail.getText().toString().trim(); String password = editTextPassword.getText().toString().trim(); if(email.isEmpty()) { editTextEmail.setError("Pole jest puste"); editTextEmail.requestFocus(); return; } if(password.isEmpty()) { editTextPassword.setError("Pole jest puste"); editTextPassword.requestFocus(); return; } if(password.length() < 6) { editTextPassword.setError("Hasล‚o musi posiadaฤ‡ co najmniej 6 znakรณw"); } startActivity(new Intent(MainActivity.this, LoggedInActivity.class)); // mAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { // @Override // public void onComplete(@NonNull Task<AuthResult> task) { // if (task.isSuccessful()) { // Toast.makeText(getApplicationContext(), "Uลผytkownik zalogowany pomyล›lnie", Toast.LENGTH_SHORT).show(); // startActivity(new Intent(MainActivity.this, LoggedInActivity.class)); // } else { // Toast.makeText(getApplicationContext(), "Uwierzytelnianie zakoล„czone niepowodzeniem", Toast.LENGTH_SHORT).show(); // } // } // }); } }
[ "tomaschenbaum@gmail.com" ]
tomaschenbaum@gmail.com
c835c752a42bcca61d98f5544cbd3ef598ad559e
55dca62e858f1a44c2186774339823a301b48dc7
/code/my-app/functions/3/getTurnsToReach_Unit.java
8bcb05c6abf8a1926a2d0cd9810caa011eaf78bd
[]
no_license
jwiszowata/code_reaper
4fff256250299225879d1412eb1f70b136d7a174
17dde61138cec117047a6ebb412ee1972886f143
refs/heads/master
2022-12-15T14:46:30.640628
2022-02-10T14:02:45
2022-02-10T14:02:45
84,747,455
0
0
null
2022-12-07T23:48:18
2017-03-12T18:26:11
Java
UTF-8
Java
false
false
163
java
public int getTurnsToReach(Location start, Location end) { return getTurnsToReach(start, end, getCarrier(), CostDeciders.avoidSettlementsAndBlockingUnits()); }
[ "wiszowata.joanna@gmail.com" ]
wiszowata.joanna@gmail.com
7afae17372db60cbd4b073dd535ef916e4d24e81
2614f122fba48b053d0a969bb28c13a6631f490b
/src/test/java/Project/pageobjects/Price_Obj.java
7500101e62ed9f72f168db0e837f635f4dfa6af8
[]
no_license
gitmakkapati/Cucumber_BDD_Framework
80dfa083cfbdecc4c296dbc2fd98e9d9e24b3ce6
aa149372ee20cc2ad72839ebd7bf67c1b85ed026
refs/heads/master
2023-03-15T18:55:13.685527
2021-03-09T10:30:29
2021-03-09T10:30:29
344,964,058
0
0
null
null
null
null
UTF-8
Java
false
false
4,065
java
package Project.pageobjects; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.*; import Project.Base; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; public class Price_Obj extends Base { @FindBy(xpath = "//input[@id='search-input-location']") private WebElement search_ele; /*@FindBy(xpath= "ul[@class='ui-autocomplete ui-front ui-menu ui-widget ui-widget-content']//li[3]//a[1]") WebElement choose_ele;*/ @FindBy(xpath = "//select[@id='forsale_price_max']") private WebElement maxprice_ele; @FindBy(xpath = "//span[contains(text(),'Advanced search options')]") private WebElement adv_search_link; @FindBy(xpath = "//body/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/form[1]/div[2]/div[2]/div[1]/fieldset[2]/div[1]") WebElement checkbox_ele; @FindBy(xpath = "//label[contains(text(),'New homes')]") WebElement Nhome_ele; @FindBy(xpath = "//label[contains(text(),'Retirement homes')]") WebElement homes_ele; @FindBy(xpath = "//label[contains(text(),'Shared ownership')]") WebElement shared_ele; @FindBy(xpath = "//label[contains(text(),'Auctions')]") WebElement auction_ele; @FindBy(id = "search-submit") WebElement search_btn_ele; @FindBy(xpath = "//div[@class='css-1e28vvi-PriceContainer e2uk8e8']") // @FindBy(css = "div.css-1wn73pq-SearchResultsWrapper.es0c9wm13:nth-child(6) div.css-aoaxu8-InnerWrapper.es0c9wm12 main.css-1ndyouf-Main.eqgqnb30 div.css-8jz4jb-SearchResultsLayoutGroup.es0c9wm6 div.css-kdnpqc-ListingsContainer.earci3d2 div.earci3d1.css-tk5q7b-Wrapper-ListingCard-StyledListingCard.e2uk8e10 div.css-hbmpg0-StyledWrapper.e2uk8e27 div.css-wfndrn-StyledContent.e2uk8e18 div.css-qmlb99-CardHeader.e2uk8e9 > div.css-1e28vvi-PriceContainer.e2uk8e8") WebElement price_container_ele; @FindBy(xpath = "//div[@class ='css-zays2g-ImageContainer e2uk8e24']") WebElement img_ele; @FindBy(xpath = "css-9sl42s-AgentDetailsContainer e11937k12") WebElement agent_ele; public void search(String place) throws InterruptedException { WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.visibilityOf(search_ele)).sendKeys("london"); // search_ele.sendKeys("london"); Thread.sleep(1000); search_ele.click(); /* Actions actions = new Actions(driver); actions.moveToElement(choose_ele).click();*/ } public void maxprice() throws InterruptedException { Select price = new Select(maxprice_ele); price.selectByIndex(9); maxprice_ele.click(); } public void advSearch() throws InterruptedException { WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.visibilityOf(adv_search_link)).click(); Thread.sleep(5000); JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("window.scrollBy(0,500)"); } public void chooseOptions() throws InterruptedException { homes_ele.click(); shared_ele.click(); auction_ele.click(); WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.visibilityOf(search_btn_ele)).click(); driver.manage().timeouts().pageLoadTimeout(200,TimeUnit.SECONDS); } public void listOfProperties() throws InterruptedException { // Wait wait = new FluentWait<WebDriver>(driver).ignoring(TimeoutException.class); List<WebElement> plist = driver.findElements(By.xpath("//div[@class='css-1e28vvi-PriceContainer e2uk8e8']")); for (WebElement list : plist) { System.out.println(list.getText()); } } public void contactDetails() throws InterruptedException, IOException { scroll_to_WebE(img_ele); img_ele.click(); takeFullScreenShot(); } }
[ "dmakkapati@hotmail.com" ]
dmakkapati@hotmail.com
a3273123fdf597f4f34b67d8cee6761003a11c8f
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/com/networknt/cluster/LightClusterTest.java
da4f2348438e6f221bfdd1602a2c50cde719b96c
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
1,639
java
/** * Copyright (c) 2016 Network New Technologies 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. */ package com.networknt.cluster; import com.networknt.service.SingletonServiceFactory; import java.net.URI; import java.util.List; import org.junit.Assert; import org.junit.Test; /** * Created by stevehu on 2017-01-27. */ public class LightClusterTest { private static Cluster cluster = ((Cluster) (SingletonServiceFactory.getBean(Cluster.class))); @Test public void testServiceToUrl() { String s = LightClusterTest.cluster.serviceToUrl("http", "com.networknt.apib-1.0.0", null, null); Assert.assertTrue((("http://localhost:7005".equals(s)) || ("http://localhost:7002".equals(s)))); s = LightClusterTest.cluster.serviceToUrl("http", "com.networknt.apib-1.0.0", null, null); Assert.assertTrue((("http://localhost:7005".equals(s)) || ("http://localhost:7002".equals(s)))); } @Test public void testServices() { List<URI> l = LightClusterTest.cluster.services("http", "com.networknt.apib-1.0.0", null); Assert.assertEquals(2, l.size()); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
b1f418187ebe44c88387d4b0808349ab8bb98259
492ab60eaa5619551af16c79c569bdb704b4d231
/src/net/sourceforge/plantuml/creole/CommandCreoleMonospaced.java
295c4919949ea7efed43639223d5ee5ade1fe3e7
[]
no_license
ddcjackm/plantuml
36b89d07401993f6cbb109c955db4ab10a47ac78
4638f93975a0af9374cec8200d16e1fa180dafc2
refs/heads/master
2021-01-12T22:34:56.588483
2016-07-25T19:25:28
2016-07-25T19:25:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,659
java
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2017, Arnaud Roques * * Project Info: http://plantuml.com * * This file is part of PlantUML. * * PlantUML is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PlantUML distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * Original Author: Arnaud Roques * * Revision $Revision: 11025 $ * */ package net.sourceforge.plantuml.creole; import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.graphic.FontConfiguration; public class CommandCreoleMonospaced implements Command { public static final String MONOSPACED = "monospaced"; private final Pattern2 pattern; private final String monospacedFamily; public static Command create(String monospacedFamily) { return new CommandCreoleMonospaced("^(?i)([%g][%g](.*?)[%g][%g])", monospacedFamily); } private CommandCreoleMonospaced(String p, String monospacedFamily) { this.pattern = MyPattern.cmpile(p); this.monospacedFamily = monospacedFamily; } public int matchingSize(String line) { final Matcher2 m = pattern.matcher(line); if (m.find() == false) { return 0; } return m.group(1).length(); } public String executeAndGetRemaining(String line, StripeSimple stripe) { final Matcher2 m = pattern.matcher(line); if (m.find() == false) { throw new IllegalStateException(); } final FontConfiguration fc1 = stripe.getActualFontConfiguration(); final FontConfiguration fc2 = fc1.changeFamily(monospacedFamily); stripe.setActualFontConfiguration(fc2); stripe.analyzeAndAdd(m.group(2)); stripe.setActualFontConfiguration(fc1); return line.substring(m.group(1).length()); } }
[ "plantuml@gmail.com" ]
plantuml@gmail.com
9018d48182dd9e34a076f55fddbc85cd5d7d864e
3d0478ba6bcd67217264042e0e1911d012613b71
/src/main/java/com/wsprosystem/model/Opcional.java
c62af4fabeedcf5a3377a81953895aaa34845b60
[]
no_license
guiwestrup/catauto
a9be2a3243a8ba4611077d30be3c435340c182ba
2293c1b8d452326dcf34b468d4d9dbd83a1da0c8
refs/heads/master
2020-04-02T22:57:16.366889
2018-10-26T14:49:06
2018-10-26T14:49:06
154,850,304
0
0
null
null
null
null
UTF-8
Java
false
false
800
java
package com.wsprosystem.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToMany; import java.util.List; @Entity public class Opcional { @Id @GeneratedValue private Long id; private String descricao; @ManyToMany(mappedBy="opcionais") private List<Automovel> automoveis; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } public List<Automovel> getAutomoveis() { return automoveis; } public void setAutomoveis(List<Automovel> automoveis) { this.automoveis = automoveis; } }
[ "westrupguilherme@gmail.com" ]
westrupguilherme@gmail.com
1fd5cfee68c673c581a9355601b29b95f775af62
caaf6804a3aecaeb26a41f79a55d18422c12bf2f
/app/src/main/java/com/generict/shoppingwithfriends/ForgotPasswordActivity.java
7030a5b77b6a34626b7d0e188bc22262bdfcb01f
[]
no_license
reynoldsjay/ShoppingWithFriends
48f6ea8ce617d836997c8457360da0bb43438370
ee4c1ce696390ea904311cde4ff9c991f1508844
refs/heads/master
2021-01-22T12:08:13.172806
2016-01-04T04:40:25
2016-01-04T04:40:25
29,834,817
2
2
null
2015-02-08T22:59:34
2015-01-25T22:44:47
Java
UTF-8
Java
false
false
4,202
java
package com.generict.shoppingwithfriends; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import com.parse.ParseException; import com.parse.ParseUser; import com.parse.RequestPasswordResetCallback; public class ForgotPasswordActivity extends ActionBarActivity { private EditText emailEditText; private Button mDoneButton; private Button mBackButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_forgot_password); final Activity activity = this; emailEditText = (EditText) findViewById(R.id.email); emailEditText.addTextChangedListener(new TextValidator(emailEditText) { //Override the validator of the abstract class @Override public void validate(TextView textView, String text) { if (text.equals("")) { textView.setError("Please enter a valid email ID"); } } }); mDoneButton = (Button) findViewById(R.id.done_button); mDoneButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { //Done button displays a message and takes the user back to the login page. String email = emailEditText.getText().toString(); ParseUser.requestPasswordResetInBackground(email, new RequestPasswordResetCallback() { @Override public void done(ParseException e) { if (e == null) { AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setMessage("Your password details have been sent to you through email"); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent(activity, LoginPageActivity.class); startActivity(intent); } }); AlertDialog dialog = builder.create(); dialog.show(); } else { emailEditText.setError("Enter a valid email"); } } }); } }); mBackButton = (Button)findViewById(R.id.back_button); mBackButton.setOnClickListener(new View.OnClickListener() { //Back button takes the user back to the login fragment public void onClick(View v) { Intent intent = new Intent(activity, LoginPageActivity.class); startActivity(intent); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_forgot_password, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "vig9295@gmail.com" ]
vig9295@gmail.com
689ebb66951c8476e943f2a2c0048d19384774ad
affdf1bea297967883ef98417bda0e11d9b3527f
/Productive Edge/src/test/java/productive/forms/footer/PrivacyStatementForm.java
04ab1cd52ec36704b4a4f513f158cdde31c343be
[]
no_license
suburbrider/PE
5f4a45ffd1c80da00d13c88f00a1c8a14593c16a
b51518ee4df6c410640f7a277c4b43a2fbcfa81b
refs/heads/master
2021-01-23T15:43:16.447222
2013-10-24T12:51:19
2013-10-24T12:51:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
382
java
package productive.forms.footer; import org.openqa.selenium.By; import productive.forms.MenuForm; /** * Vitality Internet Privacy Statement page */ public class PrivacyStatementForm extends MenuForm { /** * Constructor by default */ public PrivacyStatementForm() { super(By.xpath("//h1[contains(., 'Vitality Internet Privacy Statement')]"), "Privacy Statement"); } }
[ "sergio.luntsevich@gmail.com" ]
sergio.luntsevich@gmail.com
294eb125245789bb07d2e03e80c34d2aaab4e45f
94e35dc7cc2973771f43c0d96e13febb180ff610
/user_model/src/main/java/com/springboot/service/impl/MenuServiceImpl.java
c7a1dbe5b8b73e37496b03c9750335d6287e3ac7
[]
no_license
evanluo1988/risk-management
b398fb0bedc985b43dd78bdd1db039325d103eef
4dbb3ca4684229da0df6a27efdf0555b8ca711c8
refs/heads/master
2023-05-02T17:20:50.536324
2021-02-24T10:59:36
2021-02-24T10:59:36
314,427,687
1
1
null
null
null
null
UTF-8
Java
false
false
3,198
java
package com.springboot.service.impl; import com.springboot.domain.Menu; import com.springboot.domain.Permission; import com.springboot.mapper.MenuMapper; import com.springboot.mapper.PermMapper; import com.springboot.model.PermWithMenuId; import com.springboot.service.MenuService; import com.springboot.utils.ReturnTUtils; import com.springboot.vo.MenuVo; import com.springboot.ret.ReturnT; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; /** * @author evan */ @Service public class MenuServiceImpl implements MenuService { @Autowired private MenuMapper menuMapper; @Autowired private PermMapper permMapper; @Override public ReturnT<List<MenuVo>> findMenuByUserId(Long userId) { List<Menu> menuList = menuMapper.findMenuListByUserId(userId); if(CollectionUtils.isEmpty(menuList)) { return ReturnTUtils.getReturnT(new ArrayList<>()); } List<MenuVo> menuVoList = new ArrayList<>(); for(Menu menu : menuList) { menuVoList.add(convertMenuToVo(menu)); } List<MenuVo> rootList = menuVoList.stream().filter(menu -> menu.getParentId() == null).collect(Collectors.toList()); List<MenuVo> aboveList = null; aboveList = rootList; menuVoList.removeAll(aboveList); while(!menuVoList.isEmpty()){ List<MenuVo> remove = new ArrayList<>(); List<MenuVo> abvTemp = new ArrayList<>(); for(MenuVo menu : menuVoList) { for (MenuVo abvMenu : aboveList) { if (menu.getParentId().equals(abvMenu.getId())) { abvMenu.getSubMenuVoList().add(menu); remove.add(menu); abvTemp.add(menu); } } } menuVoList.removeAll(remove); aboveList = abvTemp; } return ReturnTUtils.getReturnT(rootList); } @Override public List<Menu> findAllMenus() { List<Menu> menuList = menuMapper.findAllMenus(); if(CollectionUtils.isEmpty(menuList)){ return new ArrayList<>(); } List<PermWithMenuId> permWithMenuIdList = permMapper.findWithMenuIdByMenuIds(menuList.stream().map(Menu::getId).collect(Collectors.toList())); if(CollectionUtils.isEmpty(permWithMenuIdList)){ return menuList; } for(Menu menu : menuList){ menu.setPermissionList(new ArrayList<>()); List<Permission> permissionList = permWithMenuIdList.stream().filter(item -> item.getMenuId().equals(menu.getId())).collect(Collectors.toList()); menu.setPermissionList(permissionList); } return menuList; } private MenuVo convertMenuToVo(Menu menu){ MenuVo menuVo = new MenuVo(); BeanUtils.copyProperties(menu, menuVo); menuVo.setSubMenuVoList(new ArrayList<>()); return menuVo; } }
[ "781407323@qq.com" ]
781407323@qq.com
42f64fbb0f7f5699ef0dd65e8c47e8e627a57c29
0e4cbc57e50ed680e565cc582619312e8916f547
/spring_08/src/com/fj/service/EmpService.java
c9dd1e62aa0936dce70455905e8e8bd5251ee958
[]
no_license
bigGreenPeople/frame
9637c108fd6407296871ccfd733952a38e06167b
e72fde50a634f97a7928588395e460586793525b
refs/heads/master
2021-01-06T20:38:41.235016
2017-08-31T14:26:51
2017-08-31T14:26:51
99,532,234
1
0
null
null
null
null
UTF-8
Java
false
false
114
java
package com.fj.service; public interface EmpService { public void transfer(String from,String to,int money); }
[ "1243596620@qq.com" ]
1243596620@qq.com
6b4cdab9eb85e5a97831addcab755a90ce7bf547
0270d7637fc2e0dc93bc4fc5395d523445329935
/PupsOil-001/src/java/com/pups/oil/dto/CityDTO.java
c53b4e50dd5f63b5ee8304fd99bda69014b00705
[]
no_license
malengatiger/pupsOilBackEnd-Repo
aac6bf0af1829a938170fdbbeca5312194ee98a3
1db2f0cec3e892a760c0e625ecc102075665792d
refs/heads/master
2021-01-23T13:47:36.299499
2014-10-07T15:11:04
2014-10-07T15:11:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,205
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.pups.oil.dto; import com.pups.oil.data.City; import java.io.Serializable; import java.util.List; /** * * @author aubreyM */ public class CityDTO implements Serializable { private static final long serialVersionUID = 1L; private Integer cityID; private String cityName; private Double latitude; private Double longitude; private List<RetailerCompanyDTO> retailerCompanyList; private List<TransporterCompanyDTO> transporterCompanyList; private List<RetailerDTO> retailerList; private ProvinceDTO province; private List<DepotDTO> depotList; private List<DepotCompanyDTO> depotCompanyList; private List<DealerCompanyDTO> dealerCompanyList; public CityDTO(City a) { cityID = a.getCityID(); cityName = a.getCityName(); latitude = a.getLatitude(); longitude = a.getLongitude(); } public CityDTO() { } public CityDTO(Integer cityID) { this.cityID = cityID; } public CityDTO(Integer cityID, String cityName) { this.cityID = cityID; this.cityName = cityName; } public Integer getCityID() { return cityID; } public void setCityID(Integer cityID) { this.cityID = cityID; } public String getCityName() { return cityName; } public void setCityName(String cityName) { this.cityName = cityName; } public Double getLatitude() { return latitude; } public void setLatitude(Double latitude) { this.latitude = latitude; } public Double getLongitude() { return longitude; } public void setLongitude(Double longitude) { this.longitude = longitude; } public List<RetailerCompanyDTO> getRetailerCompanyList() { return retailerCompanyList; } public void setRetailerCompanyList(List<RetailerCompanyDTO> retailerCompanyList) { this.retailerCompanyList = retailerCompanyList; } public List<TransporterCompanyDTO> getTransporterCompanyList() { return transporterCompanyList; } public void setTransporterCompanyList(List<TransporterCompanyDTO> transporterCompanyList) { this.transporterCompanyList = transporterCompanyList; } public List<RetailerDTO> getRetailerList() { return retailerList; } public void setRetailerList(List<RetailerDTO> retailerList) { this.retailerList = retailerList; } public ProvinceDTO getProvince() { return province; } public void setProvince(ProvinceDTO province) { this.province = province; } public List<DepotDTO> getDepotList() { return depotList; } public void setDepotList(List<DepotDTO> depotList) { this.depotList = depotList; } public List<DepotCompanyDTO> getDepotCompanyList() { return depotCompanyList; } public void setDepotCompanyList(List<DepotCompanyDTO> depotCompanyList) { this.depotCompanyList = depotCompanyList; } public List<DealerCompanyDTO> getDealerCompanyList() { return dealerCompanyList; } public void setDealerCompanyList(List<DealerCompanyDTO> dealerCompanyList) { this.dealerCompanyList = dealerCompanyList; } @Override public int hashCode() { int hash = 0; hash += (cityID != null ? cityID.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof CityDTO)) { return false; } CityDTO other = (CityDTO) object; if ((this.cityID == null && other.cityID != null) || (this.cityID != null && !this.cityID.equals(other.cityID))) { return false; } return true; } @Override public String toString() { return "com.pupsoil.data.City[ cityID=" + cityID + " ]"; } }
[ "malengatiger@gmail.com" ]
malengatiger@gmail.com
e9833118f43c3e7c2031a48b0aacede8aff892ae
ce8c1c62f920429e947932b9cf7cd766c34964b2
/app/src/main/java/com/example/gamegame/StartActivity.java
a2a36a9e67e9b73177b88ad6d4aaf0a4831507ce
[]
no_license
ManavZP/GameGame
99dbc0f3699a1434de9e2dfdd93ef6408939d558
731074e0cec2b79b03739b06457318c65e44bddc
refs/heads/master
2020-04-11T23:57:48.860951
2018-12-17T20:14:00
2018-12-17T20:14:00
162,184,567
1
0
null
null
null
null
UTF-8
Java
false
false
7,448
java
package com.example.gamegame; import android.app.Dialog; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.support.constraint.ConstraintLayout; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import org.w3c.dom.Text; import java.lang.reflect.Array; import java.util.ArrayList; public class StartActivity extends AppCompatActivity { private ImageView coin; private ImageView snek; public static final String EXTRA_SENT_INVENTORY = "theinventory"; public static final String EXTRA_SENT_TRACKER = "thetracker"; //gggggg private Inventory inventoryOne = new Inventory(); private ArrayList<String> items = inventoryOne.getItems(); private String[] inventoryList = items.toArray(new String[0]); //gggggg private TextView insert; private TextView welcome; private TextView snekTalk; private TextView back; private Button continueBut; private Button quitBut; private Animation slideUp; private Animation slideDown; private Animation blink; private ConstraintLayout ll; private GameTracker gameTracker = new GameTracker(); private TextView quitCont; private TextView inventoryTextView; private Inventory gameInventory = new Inventory(); //private String[] inventoryList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_start); wireWidgets(); setOnClickListeners(); makeAnimations(); updateInventory(); // Parceleable code // Intent i = new Intent(); // i.putExtra("Inventory", gameInventory); // when receiving in the other activity // i.getParcelableExtra() } private void makeAnimations() { slideDown = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slidein); slideUp = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slide); blink = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.movein); } private void setOnClickListeners() { coin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(StartActivity.this, "You have lost: 1 Quarter", Toast.LENGTH_LONG).show(); gameInventory.removeItem("1 Quarter"); updateInventory(); gameTracker.advanceState(); welcome.startAnimation(slideUp); updateDisplay(); } }); continueBut.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { continueBut.setEnabled(false); gameTracker.advanceState(); updateDisplay(); gameTracker.giveKnife(); } }); back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(!(gameTracker.getCurrentState().equals("QuitCont"))) { gameTracker.backState(); updateDisplay(); } } }); inventoryTextView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showInventory(inventoryList); updateInventory(); } }); quitBut.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { gameTracker.advanceState(); gameTracker.advanceState(); Intent intentNext = new Intent(StartActivity.this, HomeActivity.class); Bundle extras = new Bundle(); extras.putParcelable(EXTRA_SENT_INVENTORY, gameInventory); extras.putParcelable(EXTRA_SENT_TRACKER, gameTracker); intentNext.putExtras(extras); startActivity(intentNext); } }); } private void showInventory(String[] inventoryList) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.inventory) .setItems(inventoryList, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // The 'which' argument contains the index position // of the selected item } }); Dialog inventoryDialog = builder.create(); inventoryDialog.show(); } public void updateInventory() { inventoryList = gameInventory.getItems().toArray(new String[0]); } private void alakazam(){ coin.setVisibility(View.GONE); insert.setVisibility(View.GONE); welcome.setVisibility(View.GONE); snek.setVisibility(View.GONE); snekTalk.setVisibility(View.GONE); inventoryTextView.setVisibility(View.GONE); continueBut.setVisibility(View.GONE); quitBut.setVisibility(View.GONE); quitCont.setVisibility(View.GONE); back.setVisibility(View.GONE); snek.clearAnimation(); } private void updateDisplay(){ if(gameTracker.getCurrentState().equals("QuitCont")) { alakazam(); quitCont.setText("Welcome to the Game Game. Press \"Quit\" to Continue"); quitCont.setVisibility(View.VISIBLE); inventoryTextView.setVisibility(View.VISIBLE); back.setVisibility(View.VISIBLE); quitCont.startAnimation(slideDown); quitBut.setVisibility(View.VISIBLE); continueBut.setVisibility(View.VISIBLE); } else if(gameTracker.getCurrentState().equals("Glitch")){ alakazam(); inventoryTextView.setVisibility(View.VISIBLE); back.setVisibility(View.VISIBLE); snek.setVisibility(View.VISIBLE); snek.startAnimation(blink); snekTalk.setVisibility(View.VISIBLE); quitCont.setText(""); Toast.makeText(this, "You have acquired: 1 Danger Knife", Toast.LENGTH_LONG).show(); gameInventory.addItem("1 Danger Knife"); updateInventory(); } } private void wireWidgets() { coin = findViewById(R.id.imageView_start_coin); insert = findViewById(R.id.textView_start_insert); welcome = findViewById(R.id.textView_start_welcome); quitCont = findViewById(R.id.textView_start_quitcont); continueBut = findViewById(R.id.button_start_continue); quitBut = findViewById(R.id.button_start_quit); snek = findViewById(R.id.imageView_start_noodle); snekTalk = findViewById(R.id.textView_start_noodle); inventoryTextView = findViewById(R.id.textView_start_inventory); back = findViewById(R.id.textView_start_back); ll = findViewById(R.id.ll); } }
[ "goldengasher9@gmail.com" ]
goldengasher9@gmail.com
279b62f3e38467309a16b00515cc639c57680ce4
45ecc410acaaab56a33d0fb65e19ddbd5e15f376
/app/src/main/java/com/timeline/vpn/data/VersionUpdater.java
d1372fcb6c088198745ac16a2b8ea6f62ba0153b
[]
no_license
themass/myandroidTest
db2295d1fe7b8cb024a69d5ce19f715764fb2c93
95a277ec28eb7279f975cc448ed8c0ff55a538af
refs/heads/master
2023-08-25T18:06:08.036505
2017-01-06T14:39:00
2017-01-06T14:39:00
76,720,893
0
0
null
null
null
null
UTF-8
Java
false
false
10,232
java
package com.timeline.vpn.data; import android.app.Activity; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.support.v7.app.AlertDialog; import android.widget.Toast; import com.timeline.vpn.R; import com.timeline.vpn.bean.vo.VersionVo; import com.timeline.vpn.common.net.HttpUtils; import com.timeline.vpn.common.net.NetUtils; import com.timeline.vpn.common.net.VolleyUtils; import com.timeline.vpn.common.net.request.CommonResponse; import com.timeline.vpn.common.net.request.GsonRequest; import com.timeline.vpn.common.util.FileUtils; import com.timeline.vpn.common.util.LogUtil; import com.timeline.vpn.common.util.PreferenceUtils; import com.timeline.vpn.constant.Constants; import com.timeline.vpn.ui.main.MainFragment; import java.io.File; public class VersionUpdater { private static int NOTIFICATION_ID = 10021; private static String version; private static int build; private static boolean isInitVersionSuccess = false; /** * ๅˆๅง‹ๅŒ–็‰ˆๆœฌไฟกๆฏ */ public static void init(Context context) { // ๅ–ๅพ—็‰ˆๆœฌๅท PackageManager manager = context.getPackageManager(); PackageInfo info = null; try { info = manager.getPackageInfo(context.getPackageName(), 0); version = info.versionName; build = info.versionCode; isInitVersionSuccess = true; } catch (Exception e) { LogUtil.e(e); } } /** * ๆ˜ฏๅฆๅˆๅง‹ๅŒ–ๆˆๅŠŸ๏ผŒ้˜ฒๆญข่ฏปๅ–ๅˆฐ้”™่ฏฏๆ•ฐๆฎ */ public static boolean isInitVersionSuccess() { return isInitVersionSuccess; } /** * ๅฏๅŠจappๆ˜ฏๅฆ่ฟ˜้œ€่ฆๆ็คบ็‰ˆๆœฌๆ›ดๆ–ฐ */ public static boolean needToCheckUpdateNextTime(Context context, String newVersion, int newVersionBuild) { return PreferenceUtils.getPrefBoolean(context, getPrefKey(newVersion, newVersionBuild), true); } /** * ๆ˜ฏๅฆๆ˜ฏๆ–ฐ็‰ˆๆœฌ */ public static boolean isNewVersion(int newVersionBuild) { return newVersionBuild > build; } public static String getVersion() { return version; } public static int getBuild() { return build; } /** * ๅผ€ๅง‹ๆฃ€ๆŸฅ็‰ˆๆœฌ */ public static void checkNewVersion(Context context,CommonResponse.ResponseOkListener listener, CommonResponse.ResponseErrorListener errorListener, String tag) { GsonRequest request = new GsonRequest(context, Constants.VERSION_URL, VersionVo.class,null,listener,errorListener); request.setTag(tag); VolleyUtils.addRequest(request); } /** * ๆ˜พ็คบ็‰ˆๆœฌๆ›ดๆ–ฐๆ็คบๆก† */ public static void showUpdateDialog(final Activity context, String content, final String url, final String newVersion, final int newVersionBuild, final boolean updatePrefIfCancel) { final String title = context.getString(R.string.about_version_download_title) + " V" + newVersion; AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(title); builder.setMessage(content); builder.setNegativeButton(R.string.about_version_cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (updatePrefIfCancel) { // ไฟๅญ˜pref้…็ฝฎ PreferenceUtils.setPrefBoolean(context, getPrefKey(newVersion, newVersionBuild), false); } } }); builder.setPositiveButton(R.string.about_version_download, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (NetUtils.isWifi(context)) { startDownloadThread(context, url); } else { // ้žwifiๆƒ…ๅ†ตไธ‹๏ผŒๆ็คบ็”จๆˆทๆ˜ฏๅฆไธ‹่ฝฝ AlertDialog.Builder confirmDialog = new AlertDialog.Builder(context); confirmDialog.setTitle(R.string.about_download_confirm_title); confirmDialog.setMessage(R.string.about_download_confirm_content); confirmDialog.setPositiveButton(R.string.about_version_confirm, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { startDownloadThread(context, url); dialog.dismiss(); } }) .setNegativeButton(R.string.about_version_cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }).show(); } } }); builder.setCancelable(false); builder.show(); } private static String getPrefKey(String newVersion, int newVersionBuild) { return Constants.SETTING_PREF_NEED_CHECK_UPDATE_NEXT_TIME + "_" + newVersion + "_" + newVersionBuild; } public static int getNewVersion(Context context){ return PreferenceUtils.getPrefInt(context, Constants.VERSION_APP_INCOMING, 0); } public static void setNewVersion(Context context,int build){ PreferenceUtils.setPrefInt(context, Constants.VERSION_APP_INCOMING, build); } private static void startDownloadThread(final Context context, final String url) { final File apkFile = new File(Environment.getExternalStorageDirectory(), Constants.TEMP_PATH + "/freevpn.apk"); Toast.makeText(context, R.string.about_download_begin, Toast.LENGTH_SHORT).show(); new Thread(new DownloadRunnable(context, url, apkFile)).start(); } private static class DownloadRunnable implements Runnable, HttpUtils.DownloadListener { private Context context; private final String url; private final File apkFile; private Handler handler; private Notification.Builder builder; private NotificationManager notificationManager; private DownloadRunnable(Context context, String url, File apkFile) { this.context = context; this.url = url; this.apkFile = apkFile; this.handler = new Handler(); this.notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); this.builder = new Notification.Builder(context); } @Override public void run() { try { showNotification(context.getString(R.string.about_download_title), context.getString(R.string.about_download_prepare)); HttpUtils.download(context,url, apkFile, this); installFile(); } catch (Exception e) { e.printStackTrace(); showNotification(context.getString(R.string.about_download_title), context.getString(R.string.about_download_error)); handler.post(new Runnable() { @Override public void run() { Toast.makeText(context, R.string.about_download_error, Toast.LENGTH_SHORT).show(); } }); } } @Override public void onDownloading(long current, long total) { String percentText = String.format(context.getString(R.string.about_download_percent), FileUtils.formatFileSize(current), FileUtils.formatFileSize(total)); int percent = total == 0 ? 0 : (int) ((current * 1.0) * 100 / total); builder.setContentText(percentText); builder.setProgress(100, percent, false); notificationManager.notify(NOTIFICATION_ID, builder.getNotification()); } private void showNotification(String title, String message) { // ๅˆ›ๅปบไธ€ไธชNotificationManager็š„ๅผ•็”จ Intent notificationIntent = new Intent(context, MainFragment.class); //็‚นๅ‡ป่ฏฅ้€š็ŸฅๅŽ่ฆ่ทณ่ฝฌ็š„Activity Bundle bundle = new Bundle(); notificationIntent.putExtras(bundle); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); // ๅฎšไน‰Notification็š„ๅ„็งๅฑžๆ€ง Notification notification = builder.setContentTitle(title).setContentText(message) .setSmallIcon(R.drawable.ic_launcher).setContentIntent(contentIntent) .getNotification(); notification.flags |= Notification.FLAG_AUTO_CANCEL; notificationManager.notify(NOTIFICATION_ID, notification); } private void installFile() { hideNotification(); handler.post(new Runnable() { @Override public void run() { Toast.makeText(context, R.string.about_download_finish, Toast.LENGTH_SHORT).show(); } }); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); } private void hideNotification() { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancel(NOTIFICATION_ID); } } }
[ "liguoqing@lianjia.com" ]
liguoqing@lianjia.com
eb0144797ed86d347a3041875400c716ac2de554
18fa8ac9d5d81412ae00931b9a680e4fcb6c504e
/src/main/java/com/vikrant/java/essentials/hackerrank/string/MakeAnagram.java
b929b2f37f45ecc0e1ed31c477576c9fd78b2348
[]
no_license
vikrant2491/Essentials
b46623a64f6d069d10cfc166661a73477b28534c
6a0bc227158a00e083ecbaf0dbd22c0d6d08e5c1
refs/heads/main
2023-07-14T03:36:28.253582
2021-08-28T09:29:49
2021-08-28T09:29:49
400,753,519
0
0
null
null
null
null
UTF-8
Java
false
false
639
java
package com.vikrant.java.essentials.hackerrank.string; import java.util.HashMap; import java.util.Map; public class MakeAnagram { public static void main(String[] args) { // TODO Auto-generated method stub } public static int deleteForAnagram(String str1, String str2){ Map<Character, Integer> m1 = new HashMap<>(); int count =0; for(int i=97;i<124;i++){ m1.put((char)i, 0); } for(Character c: str1.toCharArray()){ m1.put(c, m1.get(c)+1); } for(Character c: str1.toCharArray()){ m1.put(c, m1.get(c)-1); } for(Character c: m1.keySet()){ count += Math.abs(m1.get(c)); } return count; } }
[ "vikrantpandey2491@gmail.com" ]
vikrantpandey2491@gmail.com
3d33217e307e40c5cb50ee4345fd07b95c6fe850
0a0affc69e6729a4030a94c1c89005e0d517b859
/jworks-common/src/main/java/com/github/utils/clone/Cloneable.java
5d9fb72bd15f672cadec0f40962589bc5b1d88e0
[]
no_license
jack09260812/jworks
2d4b5b20283b071c1378381cf3789041aeb18480
64d279aa4ff75864ae463aa66390cacda8117fd9
refs/heads/master
2021-01-25T14:16:29.540939
2018-03-05T02:21:20
2018-03-05T02:21:20
123,677,145
2
1
null
null
null
null
UTF-8
Java
false
false
262
java
package com.github.utils.clone; /** * @Author jinwei.li * @Date 2017/8/28 0028 * @Description clone */ public interface Cloneable<T> extends java.lang.Cloneable { /** * ๅ…‹้š†ๅฝ“ๅ‰ๅฏน่ฑก๏ผŒๆต…ๅคๅˆถ * * @return */ T clone(); }
[ "jecslee@sina.cn" ]
jecslee@sina.cn
7e50402dbb4286e83054ae8fd97df53434dec0da
5531f08532afaef446544935e5138422c815c936
/algorithms/offer/src/main/java/cn/lastwhisper/offer/interview_5/Solution_5_1_1.java
24381857789d8580f82e4a83be9abda9b5dcea16
[]
no_license
chenxi3021/Code
19342c9f06d9f001d63b7dc46db67ec42a39e682
8236ffe7f9ba37701c1d26419a3dc16822270180
refs/heads/master
2021-01-13T21:04:17.506695
2020-02-22T10:36:30
2020-02-22T10:36:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,567
java
package cn.lastwhisper.offer.interview_5; /** * ้ข่ฏ•้ข˜ 5๏ผšๆ›ฟๆข็ฉบๆ ผ * @author cn.lastwhisper */ public class Solution_5_1_1 { public static void main(String[] args) { String str = "We are happy"; String space = new Solution_5_1_1().replaceSpace(str.toCharArray()); System.out.println(space); } public String replaceSpace(char[] chars) { // ๆ ก้ชŒๆ•ฐๆฎ if (chars == null || chars.length == 0) { return ""; } // ๅŽŸๆ•ฐ็ป„ๆ€ป้•ฟๅบฆ int originalLength = chars.length; // ็ปŸ่ฎก็ฉบๆ ผๆ•ฐ int blankCount = 0; for (int i = 0; i < chars.length; i++) { if (chars[i] == ' ') { blankCount++; } } // ๆ›ฟๆข็ฉบๆ ผๅŽ็š„ๅญ—็ฌฆไธฒ้•ฟๅบฆไธบๅŽŸๆฅ้•ฟๅบฆ+2*็ฉบๆ ผๆ•ฐ int newLength = originalLength + 2 * blankCount; char[] cache = new char[newLength]; // ๅŽŸๅญ—็ฌฆไธฒๅฐพๆŒ‡้’ˆ int indexOfOriginal = originalLength-1; // ๆ–ฐๅญ—็ฌฆไธฒๅฐพๆŒ‡้’ˆ int indexOfNew = newLength-1; // ไปŽไธคไธชๆ•ฐ็ป„ๅฐพ้ƒจ่ฟ›่กŒcopyๅญ—็ฌฆ,็ขฐๅˆฐๅญ—็ฌฆไธcopy,่€Œๆ˜ฏๅกซๅ……"20%" while (indexOfOriginal >= 0) { if (chars[indexOfOriginal] == ' ') { cache[indexOfNew--] = '0'; cache[indexOfNew--] = '2'; cache[indexOfNew--] = '%'; } else { cache[indexOfNew--] = chars[indexOfOriginal]; } indexOfOriginal--; } return new String(cache); } }
[ "ggb2312@gmail.com" ]
ggb2312@gmail.com
4cf031ccf4b00984fb1711dccfb8aabc3d10ed22
31142fbd7d2263860c3dd89d703429cda859648c
/AlkoChiล„czyk/src/Alko/AlkoNG.java
d969cb5ce297f6cf4001faf43caa92412c1ba3a0
[]
no_license
daniell1707/Alkochi-czyk
96900a69cf8fa7a2023bfcde1e30f3fe89e585d1
c4126b312291c091ff70486afaf8c828a6eaf1b9
refs/heads/master
2016-08-11T13:47:31.242614
2016-04-08T12:22:06
2016-04-08T12:22:06
53,678,155
0
0
null
null
null
null
UTF-8
Java
false
false
2,424
java
package Alko; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JOptionPane; public class AlkoNG{ private JFrame frame = new JFrame("Nowa Gra"); private File file = new File("zadania"); private File[] fileList; private String[] fileNames; JComboBox JCBquestList; static Alko alko; @SuppressWarnings({ "rawtypes", "unchecked" }) public AlkoNG(){ AlkoNGGraf g = new AlkoNGGraf(); fileList = file.listFiles(new FilenameFilter() { public boolean accept(File file, String name) { if (name.endsWith(".txt")) { // filters files whose extension is .txt return true; } else { return false; } } }); fileNames = new String[fileList.length]; frame.setSize(400, 300); frame.setLocationRelativeTo(null); frame.setResizable(false); frame.setLayout(null); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); for(int i=0;i<fileList.length;i++){ fileNames[i]=fileList[i].getName(); } JCBquestList = new JComboBox(); JCBquestList.setBounds(125, 100, 150, 30); JCBquestList.layout(); for(int i=0;i<fileNames.length;i++){ JCBquestList.addItem(fileNames[i]); } g.add(JCBquestList); JButton bOK = new JButton("ok"); bOK.setBounds(150, 180, 100, 50); bOK.setBackground(Color.WHITE); bOK.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { File filePom = new File("zadania/"+JCBquestList.getSelectedItem().toString()); if(filePom.length()>0){ frame.dispose(); alko = new Alko(); alko.fileQuest=JCBquestList.getSelectedItem().toString(); try { alko.loadQuest(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // TODO Auto-generated catch block } else{ JOptionPane.showMessageDialog(null, "Plik jest pusty"); } } }); g.add(bOK); frame.add(g); frame.repaint(); } public static void main(String[]args){ AlkoNG NG = new AlkoNG(); } }
[ "Daniel@192.168.1.12" ]
Daniel@192.168.1.12
040bb7c031707bc748e7c18ae72c75a8a4c5322c
8879e86c257d3daddf2997af59d4b92956b1f3cb
/src/edu/sistemasoperativos/banquero/SimulacionListener.java
02d8facf350be326ba928033a30d3d03347e2d8c
[]
no_license
dedotepeludo/banquero
3398b116cf3b9b995826820ea3701c507f88a160
3b57ca5f9b2d33e50cf89b6d36ad529237e9b0ef
refs/heads/master
2020-05-07T19:57:35.898852
2012-02-13T05:57:38
2012-02-13T05:57:38
32,720,575
0
0
null
null
null
null
UTF-8
Java
false
false
171
java
package edu.sistemasoperativos.banquero; public interface SimulacionListener { public void pasoSimulacion(Banco banco); public void terminoSimulacion(Banco banco); }
[ "jsecheverri@gmail.com@0e495644-ce5e-74e6-e017-bb28c6f6de8c" ]
jsecheverri@gmail.com@0e495644-ce5e-74e6-e017-bb28c6f6de8c
73b622071ea2f06cddfbe346e969ebfe34709525
405288c05554a479abf206204f4f6e712baa9fb1
/src/main/java/hello/servlet/web/springmvc/v2/SpringMemberControllerV2.java
6851591e5e5ef6f44498861f1b30e4d9b6357643
[]
no_license
cornarong/Spring-MVC-basic01
51d34c82f5e739a05d6d1cbac7e7c58e16ba50c3
f9701ed33161dc8683ddf1078894a009f8fb2c0e
refs/heads/main
2023-06-25T08:15:30.495030
2021-07-29T12:48:49
2021-07-29T12:48:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,442
java
package hello.servlet.web.springmvc.v2; import hello.servlet.domain.member.Member; import hello.servlet.domain.member.MemberRepository; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; @Controller @RequestMapping("/springmvc/v2/members") public class SpringMemberControllerV2 { private MemberRepository memberRepository = MemberRepository.getInstance(); @RequestMapping("/new-form") public ModelAndView newForm(){ return new ModelAndView("new-form"); } @RequestMapping("/save") public ModelAndView save(HttpServletRequest request, HttpServletResponse response) { String username = request.getParameter("username"); int age = Integer.parseInt(request.getParameter("age")); Member member = new Member(username,age); memberRepository.save(member); ModelAndView mv = new ModelAndView("save-result"); mv.addObject("member",member); return mv; } // springmvc/v2/members @RequestMapping public ModelAndView members() { List<Member> members = memberRepository.findAll(); ModelAndView mv = new ModelAndView("members"); mv.addObject("members",members); return mv; } }
[ "cornarong@gmail.com" ]
cornarong@gmail.com
6bf6c78711838884fb7c9844cf928c841bcf6cd6
70169e8a6bacfcd43dfeb99162ce7362544c1978
/Printing numbers in inverse right angle triangle/Main.java
8e77ce27589c865203f3266a792497e414ad413b
[]
no_license
mahenderchintu/Playground
6f2d9bc6f3cefaf3ab1a5cc2925f4a7d05540493
3c35fe87eee4f1372b4ebd3cff525a476c1cbed8
refs/heads/master
2020-04-26T18:55:11.873428
2019-06-14T11:47:50
2019-06-14T11:47:50
173,759,119
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
import java.util.Scanner; class Main{ public static void main (String[] args){ // Type your code here Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int val=n; for(int i=1;i<=n;i++) { for(int j=val;j>=1;j--) { System.out.print(j); } val--; System.out.println(); } } }
[ "40619474+mahenderchintu@users.noreply.github.com" ]
40619474+mahenderchintu@users.noreply.github.com
2fb92e706a3f075ced97832fae82cb9880a0320a
360af49ea04a61e268398da656aa6a13dfc834a7
/01. Intro to Java/Exercise/ByteParty.java
a5c2172fa71f9f68b47fd2227bc16c81efe5a285
[ "MIT" ]
permissive
AneliaDoychinova/Java-Advanced
4fd34e14c7edeca7d7dd84f8be7ec45fe5b2aae8
62f4550f51eab7c264b1ead38c342cf50e637aa4
refs/heads/master
2021-07-15T10:38:07.528492
2017-10-22T12:07:10
2017-10-22T12:07:10
107,717,634
0
0
null
null
null
null
UTF-8
Java
false
false
1,455
java
import java.util.Scanner; public class ByteParty { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int count = Integer.parseInt(scanner.nextLine()); int[] nums = new int[count]; for (int i = 0; i < nums.length; i++) { nums[i] = Integer.parseInt(scanner.nextLine()); } String[] command = scanner.nextLine().split("\\s+"); while (!command[0].equals("party")){ String action = command[0]; int position = Integer.parseInt(command[1]); switch (action){ case "-1": int mask = 1 << position; for (int i =0;i<nums.length;i++){ nums[i] = (nums[i] ^ mask); } break; case"0": int mask0 = ~(1 << position); for (int i =0;i<nums.length;i++){ nums[i] = (nums[i] & mask0); } break; case "1": int mask1 = 1 << position; for (int i =0;i<nums.length;i++){ nums[i] = (nums[i] | mask1); } break; } command = scanner.nextLine().split("\\s+"); } for (int num : nums) { System.out.println(num); } } }
[ "aneliya_doychinova@abv.bg" ]
aneliya_doychinova@abv.bg
4c87222cebada5646286a51f17f1b5ca396d2798
1e491942baf0cd1fd723ff722c1096f60e4129c8
/app/src/main/java/com/example/android/homechat/PermissionUtils.java
c6503624a4652ed160e803e822979e829033ac11
[]
no_license
mlschmidt366/HomeChat-Android
16879b86a1af7ae8b7967096d6440fd765afe4f2
ed203c1bea5e603a66fccc98c73282c2350aee57
refs/heads/master
2022-04-09T19:59:36.290162
2020-03-23T11:07:12
2020-03-23T11:07:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,538
java
/* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.android.homechat; import android.Manifest; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.pm.PackageManager; import android.os.Bundle; import androidx.core.app.ActivityCompat; import androidx.fragment.app.DialogFragment; import androidx.appcompat.app.AppCompatActivity; import android.widget.Toast; /** * Utility class for access to runtime permissions. */ public abstract class PermissionUtils { private static final String TAG = "PermissionUtils"; /** * Requests the fine location permission. If a rationale with an additional explanation should * be shown to the user, displays a dialog that triggers the request. */ public static void requestPermission(AppCompatActivity activity, int requestId, String permission, boolean finishActivity) { if (ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) { // Display a dialog with rationale. PermissionUtils.RationaleDialog.newInstance(requestId, finishActivity) .show(activity.getSupportFragmentManager(), "dialog"); } else { // Location permission has not been granted yet, request it. ActivityCompat.requestPermissions(activity, new String[]{permission}, requestId); } } /** * Checks if the result contains a {@link PackageManager#PERMISSION_GRANTED} result for a * permission from a runtime permissions request. * * @see androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback */ public static boolean isPermissionGranted(String[] grantPermissions, int[] grantResults, String permission) { for (int i = 0; i < grantPermissions.length; i++) { if (permission.equals(grantPermissions[i])) { return grantResults[i] == PackageManager.PERMISSION_GRANTED; } } return false; } /** * A dialog that displays a permission denied message. */ public static class PermissionDeniedDialog extends DialogFragment { private static final String ARGUMENT_FINISH_ACTIVITY = "finish"; private boolean mFinishActivity = false; /** * Creates a new instance of this dialog and optionally finishes the calling Activity * when the 'Ok' button is clicked. */ public static PermissionDeniedDialog newInstance(boolean finishActivity) { Bundle arguments = new Bundle(); arguments.putBoolean(ARGUMENT_FINISH_ACTIVITY, finishActivity); PermissionDeniedDialog dialog = new PermissionDeniedDialog(); dialog.setArguments(arguments); return dialog; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { mFinishActivity = getArguments().getBoolean(ARGUMENT_FINISH_ACTIVITY); return new AlertDialog.Builder(getActivity()) .setMessage(R.string.location_permission_denied) .setPositiveButton(android.R.string.ok, null) .create(); } @Override public void onDismiss(DialogInterface dialog) { super.onDismiss(dialog); if (mFinishActivity) { Toast.makeText(getActivity(), R.string.permission_required_toast, Toast.LENGTH_SHORT).show(); getActivity().finish(); } } } /** * A dialog that explains the use of the location permission and requests the necessary * permission. * <p> * The activity should implement * {@link androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback} * to handle permit or denial of this permission request. */ public static class RationaleDialog extends DialogFragment { private static final String ARGUMENT_PERMISSION_REQUEST_CODE = "requestCode"; private static final String ARGUMENT_FINISH_ACTIVITY = "finish"; private boolean mFinishActivity = false; /** * Creates a new instance of a dialog displaying the rationale for the use of the location * permission. * <p> * The permission is requested after clicking 'ok'. * * @param requestCode Id of the request that is used to request the permission. It is * returned to the * {@link androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback}. * @param finishActivity Whether the calling Activity should be finished if the dialog is * cancelled. */ public static RationaleDialog newInstance(int requestCode, boolean finishActivity) { Bundle arguments = new Bundle(); arguments.putInt(ARGUMENT_PERMISSION_REQUEST_CODE, requestCode); arguments.putBoolean(ARGUMENT_FINISH_ACTIVITY, finishActivity); RationaleDialog dialog = new RationaleDialog(); dialog.setArguments(arguments); return dialog; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Bundle arguments = getArguments(); final int requestCode = arguments.getInt(ARGUMENT_PERMISSION_REQUEST_CODE); mFinishActivity = arguments.getBoolean(ARGUMENT_FINISH_ACTIVITY); return new AlertDialog.Builder(getActivity()) .setMessage(R.string.permission_rationale_location) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // After click on Ok, request the permission. ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, requestCode); // Do not finish the Activity while requesting permission. mFinishActivity = false; } }) .setNegativeButton(android.R.string.cancel, null) .create(); } @Override public void onDismiss(DialogInterface dialog) { super.onDismiss(dialog); if (mFinishActivity) { Toast.makeText(getActivity(), R.string.permission_required_toast, Toast.LENGTH_SHORT) .show(); getActivity().finish(); } } } }
[ "mlschmidt366@gmail.com" ]
mlschmidt366@gmail.com
9e446faf02e05f4e36607838de16a0805a1e71df
37646551080d7538481f1e1d1a88af152b8127d8
/main/src/com/company/Utils.java
f3f2e08bca7bc41d18abf1a5532dc001be4da8c5
[]
no_license
gerardfp/problems
08430b95b845f334bff690b7ca804816bf96e9fd
922cd930a768b7dcde5dfb670afe2da8b21a00ea
refs/heads/master
2022-01-31T14:00:36.999382
2019-07-18T15:04:12
2019-07-18T15:04:12
197,878,503
0
0
null
null
null
null
UTF-8
Java
false
false
2,968
java
package com.company; public class Utils { public static void printMatrix(int[][] m){ for (int i = 0; i < m.length; i++) { for (int j = 0; j < m[i].length; j++) { if(m[i][j] == Integer.MIN_VALUE){ System.out.printf(" -"); }else if(m[i][j] == Integer.MAX_VALUE){ System.out.printf(" +"); }else { System.out.printf("%3d", m[i][j]); } } System.out.println(); } System.out.println("----"); } public static void printMatrix(double[][] m){ for (int i = 0; i < m.length; i++) { for (int j = 0; j < m[i].length; j++) { if(m[i][j] == Double.NEGATIVE_INFINITY){ System.out.printf(" -"); }else if(m[i][j] == Double.POSITIVE_INFINITY){ System.out.printf(" +"); }else { System.out.printf("%6.2f", m[i][j]); } } System.out.println(); } System.out.println("----"); } public static void printMatrix(boolean[][] m){ for (int i = 0; i < m.length; i++) { for (int j = 0; j < m[i].length; j++) { System.out.printf(m[i][j] ? "W " : "ยท "); } System.out.println(); } System.out.println("----"); } public static void printMatrix(char[][] m){ for (int i = 0; i < m.length; i++) { for (int j = 0; j < m[i].length; j++) { System.out.printf(m[i][j] + " "); } System.out.println(); } System.out.println("----"); } public static void printArray(int[] a){ for (int i = 0; i < a.length; i++) { if(a[i] == Integer.MIN_VALUE){ System.out.printf(" -"); }else if(a[i] == Integer.MAX_VALUE){ System.out.printf(" +"); }else { System.out.printf("%" + (maxDigits(a)+1) + "d", a[i]); } } System.out.println(); } public static void printArray(double[] a){ for (int i = 0; i < a.length; i++) { if(a[i] == Double.NEGATIVE_INFINITY){ System.out.print(" -"); }else if(a[i] == Double.POSITIVE_INFINITY){ System.out.print(" +"); }else { System.out.printf("%6.2f", a[i]); } } System.out.println(); System.out.println("----"); } public static int maxDigits(int[] a){ int max = Integer.MIN_VALUE; int min = Integer.MAX_VALUE; for (int i = 0; i < a.length; i++) { max = Math.max(max, a[i]); min = Math.min(min, a[i]); } return Math.max(String.valueOf(max).length(), String.valueOf(min).length()); } }
[ "gerardfp@gmail.com" ]
gerardfp@gmail.com
ca3190961de60acfe68496ee1ae703ebf8874a5f
12e66ca33a0199abfc43515de4cfe7ccfe2c941e
/src/main/java/EmailAddress/CustomerEmailAddress.java
8e857060098ac8cfd321c940ff4b6f19674e31e8
[]
no_license
goekhanb/TestautomationExample
71e0794fa4eb40debb43586c6a04cb3013dab3f0
70693c145dd1c3dea6e7dab887617f86cfdaa91b
refs/heads/master
2021-01-19T07:43:38.395165
2017-08-17T21:23:11
2017-08-17T21:23:11
100,646,357
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package EmailAddress; public class CustomerEmailAddress { private String name; private String email; private String id; public CustomerEmailAddress(String id,String name,String email){ this.email=email; this.id=id; this.name=name; } public CustomerEmailAddress(){} /** getter and setter methods**/ public String getName(){return this.name;} public String getEmail(){return this.email;} public String getId(){return this.id;} public void setName(String name){this.name=name;} public void setEmail(String email){this.email=email;} public void setId(String id){this.id=id;} }
[ "goekhan.bastan@stud.h-da.de" ]
goekhan.bastan@stud.h-da.de
d162a41a6ac6bf512cda1fdd5635fa49c33f56ab
866aeb3737e24dd27017d1e206129ebbde6e8a4d
/src/Arrays/Exception/TriangleException.java
a4b83406e46bc0f1eb096c7ea256c55776748244
[]
no_license
hoanglinh1119/Module2
958c7b0f2477176e9755256206c043700008d52c
ef820e085fd8f21cbe6238b8c0c69412763b563b
refs/heads/master
2020-11-26T19:37:40.501891
2020-02-20T14:55:50
2020-02-20T14:55:50
229,187,813
0
1
null
null
null
null
UTF-8
Java
false
false
769
java
package Arrays.Exception; import java.util.InputMismatchException; import java.util.Scanner; public class TriangleException { public static void main(String[] args) { Scanner input=new Scanner(System.in); try { System.out.println("Nhap canh thu 1 : "); int canh1 = input.nextInt(); System.out.println("nhap canh thu 2 : "); int canh2 = input.nextInt(); System.out.println("nhap canh thu 3 : "); int canh3 = input.nextInt(); Triangle triangle=new Triangle(); triangle.xetbacanh(canh1,canh2,canh3); }catch (InputMismatchException e){ System.out.println("vui long nhap du lieu kieu so nguyen " +e); } } }
[ "hoanglinhjp2710@gmail.com" ]
hoanglinhjp2710@gmail.com
d3cb0eee92772fb997fed05339d25f501d89d5a1
cb1942dfb9c52e571e15d274d87b1faaa1692b27
/src/main/java/com/wycody/cs2d/script/inst/InstructionDecoder.java
dd585777c1f4dae1c89cfbff884d868f775a8880
[]
no_license
Prashant-Jonny/CS2Decompiler
4601ece6d080a4a932830f6c03258dc46262c255
44fcefdc07a9f27f64c83b28950987ab8854188b
refs/heads/master
2021-01-24T21:25:21.141839
2015-12-19T04:03:10
2015-12-19T04:03:10
48,652,104
0
1
null
2015-12-27T16:31:16
2015-12-27T16:31:16
null
UTF-8
Java
false
false
315
java
package com.wycody.cs2d.script.inst; import net.openrs.io.WrappedByteBuffer; import com.wycody.cs2d.Context; import com.wycody.cs2d.script.CS2Script; public interface InstructionDecoder { public Instruction decode(CS2Script script, Context context, WrappedByteBuffer buffer, int id, int address); }
[ "memoryleakteam@hotmail.com" ]
memoryleakteam@hotmail.com
838236f324e7b67e4e0b46334b1222ac7af5957e
cc19963252ded1b7ed1c518d022d87c22db633c3
/src/main/java/io/confluent/kafka/demo/AllOrdersConsumer.java
ffc5d588f03beb31d44a03470c001e04eb1be4f2
[ "Apache-2.0" ]
permissive
thuannv/prioritization-kafka
972fe9d2e0069096cce6a9a220b01d2ba1b3350f
574067ed956d014c8b27ce7400cfcedf29c62e9b
refs/heads/master
2022-12-14T07:08:56.142439
2020-09-10T17:05:12
2020-09-10T17:05:12
299,576,293
0
3
Apache-2.0
2020-09-29T10:01:36
2020-09-29T10:01:35
null
UTF-8
Java
false
false
2,669
java
package io.confluent.kafka.demo; import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Properties; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.common.serialization.StringDeserializer; import static io.confluent.kafka.demo.utils.KafkaUtils.createTopic; import static io.confluent.kafka.demo.utils.KafkaUtils.getConfigs; public class AllOrdersConsumer { private class ConsumerThread extends Thread { private String threadName; private KafkaConsumer<String, String> consumer; public ConsumerThread(String threadName, Properties configs) { this.threadName = threadName; configs.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); configs.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); configs.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest"); configs.setProperty(ConsumerConfig.GROUP_ID_CONFIG, ALL_ORDERS + "-group"); consumer = new KafkaConsumer<>(configs); consumer.subscribe(Arrays.asList(ALL_ORDERS)); } @Override public void run() { for (;;) { ConsumerRecords<String, String> records = consumer.poll(Duration.ofSeconds(Integer.MAX_VALUE)); for (ConsumerRecord<String, String> record : records) { System.out.println(String.format("[%s] Key = %s, Partition = %d", threadName, record.key(), record.partition())); } } } } private final List<ConsumerThread> consumerThreads = new ArrayList<>(); private void run(int numberOfThreads, Properties configs) { for (int i = 0; i < numberOfThreads; i++) { String threadName = String.format("Consumer-Thread-%d", i); consumerThreads.add(new ConsumerThread(threadName, configs)); } consumerThreads.stream().forEach(ct -> ct.start()); } private static final String ALL_ORDERS = "all-orders"; public static void main(String[] args) { createTopic(ALL_ORDERS, 6, (short) 3); if (args.length >= 1) { int numberOfThreads = Integer.parseInt(args[0]); new AllOrdersConsumer().run(numberOfThreads, getConfigs()); } } }
[ "riferrei@riferrei.com" ]
riferrei@riferrei.com
c41616bb7d7390210868b1ba72bfd012bf024423
24130494cd83717c794915642653f62b6cda78a1
/gof-patterns/src/main/java/br/com/gof/patterns/strategy/LogBrokerStrategy.java
511b0c508a2982da19b6614b7ff5c9b2a160f809
[]
no_license
motadiego/gof-patterns
d7cd28d612339b84a65097a384e400d1031458e5
116f9c68a4090b5f7265692c8fa9456f2c1e71ea
refs/heads/master
2023-02-25T09:43:09.257857
2021-01-28T02:09:56
2021-01-28T02:09:56
321,667,732
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package br.com.gof.patterns.strategy; public class LogBrokerStrategy implements Logger { @Override public void info(String log) { System.out.println("Broker-send-info: " + log); } @Override public void error(String log) { System.out.println("Broker-send-error: " + log); } }
[ "diegoalves123@gmail.com" ]
diegoalves123@gmail.com
2bf7495a17daa852b8c19902c54279e219be1e43
bac1ab69872ea728123680449b3d16578c13efa3
/NotificationTest/app/src/main/java/com/tan90/notificationtest/MainActivity.java
0d13815269a725d2c713764c9050c66b03711b21
[]
no_license
b4ubiplob/android_projects
b4dd36c23725abc39b582c26bfce31c297e5af6e
f76e404ea5529077b3f3eb69c012bea6a1b2809e
refs/heads/master
2021-01-20T20:19:01.080831
2016-07-13T19:41:16
2016-07-13T19:41:16
62,553,903
0
0
null
null
null
null
UTF-8
Java
false
false
2,049
java
package com.tan90.notificationtest; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.TaskStackBuilder; import android.content.Context; import android.content.Intent; import android.support.v4.app.NotificationCompatBase; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.app.NotificationCompat; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this).setSmallIcon(R.drawable.notification_icon).setContentTitle("My notification").setContentText("Hello world"); // Creates an explicit intent for an Activity in your app Intent resultIntent = new Intent(this, MainActivity.class); // The stack builder object will contain an artificial back stack for the // started Activity. // This ensures that navigating backward from the Activity leads out of // your application to the Home screen. TaskStackBuilder stackBuilder = TaskStackBuilder.create(this); // Adds the back stack for the Intent (but not the Intent itself) stackBuilder.addParentStack(MainActivity.class); // Adds the Intent that starts the Activity to the top of the stack stackBuilder.addNextIntent(resultIntent); PendingIntent resultPendingIntent = stackBuilder.getPendingIntent( 0, PendingIntent.FLAG_UPDATE_CURRENT ); mBuilder.setContentIntent(resultPendingIntent); NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); // mId allows you to update the notification later on. mNotificationManager.notify(mId, mBuilder.build()); } }
[ "biplob.ghosh@sap.com" ]
biplob.ghosh@sap.com
f3c2843b36861aa9aab2818b52540d703e861d4c
d104d1ed63b14b5943703ad7db61da3b9ac18b9c
/1343.java
a803e489f12261b81169b25400af5c1658de54e8
[]
no_license
mikelyy/Leetcode
17e27319db436c7e07060c50f312866f8950ef03
a64e740c3a4fd5f08bca4394f3b5f887e5fd10af
refs/heads/master
2021-07-12T04:14:56.530496
2020-09-17T03:36:48
2020-09-17T03:36:48
203,468,783
0
0
null
null
null
null
UTF-8
Java
false
false
609
java
class Solution { public int numOfSubarrays(int[] arr, int k, int threshold) { ///Arrays.sort(arr); int sum = 0; int i; for (i=0; i<k; i++){ sum += arr[i]; } int avg = 0; avg = sum / k; int count = 0; if (avg>=threshold){ count++; } int j=0; while (i<arr.length){ sum+=arr[i]; sum-=arr[j]; avg = sum / k; if (avg>=threshold){ count++; } i++; j++; } return count; } }
[ "yuyang_li1@brown.edu" ]
yuyang_li1@brown.edu
9e5e8718848d4f26650795c21e20cc0b3b42c84a
0b709a1fe2729f10bca44d759f09f9d04c0044dd
/src/main/java/com/youren/bbs/dao/AlbumCategoryDao.java
160d25aad95542847fbd9b42cc7785415b3b3ad2
[]
no_license
chenchangyou/bbs
2b3fc8dfa8358e55bd21ba21ba035cdfd6b3ad40
0b8d3dcd08044b73e1321fc2a647ec897e4e185e
refs/heads/master
2022-12-25T21:33:11.500204
2019-07-19T02:59:15
2019-07-19T02:59:15
191,390,775
0
0
null
null
null
null
UTF-8
Java
false
false
294
java
package com.youren.bbs.dao; import com.youren.bbs.entity.AlbumCategory; import org.springframework.data.repository.CrudRepository; import java.util.List; public interface AlbumCategoryDao extends CrudRepository<AlbumCategory, String> { List<AlbumCategory> findByUserId(Long uid); }
[ "1554693372@qq.com" ]
1554693372@qq.com
e5f10e4ad88a77de746e7d9ba2d009bf99774de4
473dbd92071c59bdb35520bbeb25fb4b3c6d193e
/src/ExamPreparation/easterRaces/entities/drivers/DriverImpl.java
612e2633914991284778c36675efe1dd7ca9d31b
[]
no_license
Nikola607/Java-OOP
687b6668ad4d0ea65684dd58c4d3c54290fa4d42
88cb647c66ffb1d5ef564170cac679c332fcdcd6
refs/heads/master
2023-04-03T09:17:22.911674
2021-04-20T07:22:00
2021-04-20T07:22:00
341,866,343
0
0
null
null
null
null
UTF-8
Java
false
false
1,573
java
package ExamPreparation.easterRaces.entities.drivers; import ExamPreparation.easterRaces.entities.cars.Car; import static ExamPreparation.easterRaces.common.ExceptionMessages.CAR_INVALID; import static ExamPreparation.easterRaces.common.ExceptionMessages.INVALID_NAME; public class DriverImpl implements Driver { private String name; private Car car; private int numberOfWins; private boolean canParticipate; public DriverImpl(String name) { this.setName(name); this.setCanParticipate(false); } public void setName(String name) { if (name == null || name.length() < 5 || name.trim().isEmpty()) { throw new IllegalArgumentException(String.format(INVALID_NAME, name, 5)); } this.name = name; } public void setCanParticipate(boolean canParticipate) { this.canParticipate = canParticipate; } @Override public String getName() { return this.name; } @Override public Car getCar() { return this.car; } @Override public int getNumberOfWins() { return this.numberOfWins; } @Override public void addCar(Car car) { if (car == null) { throw new IllegalArgumentException(CAR_INVALID); } this.car = car; } @Override public void winRace() { this.numberOfWins++; } @Override public boolean getCanParticipate() { if (car != null) { setCanParticipate(true); } return canParticipate; } }
[ "nikola_vuchev@abv.bg" ]
nikola_vuchev@abv.bg
3ce0602f14b842794eca1b7f05b0505415342d7f
bc0c107458f246ab3938cb791b5dc04cf9e47094
/java-basics/src/main/java/com/charjay/basic/section3/finaldemo/B.java
a1e59a6fbc3795c70e6ba663d1f529dda00d9d48
[]
no_license
CharJay/interview
ed0a5fbea97825df87df4aef775a71f2e704eb1a
282cebaebd20c4dd90fe39d9a680f83afe1d16df
refs/heads/master
2021-05-19T18:32:51.710806
2020-04-01T04:35:17
2020-04-01T04:35:17
252,065,852
0
0
null
null
null
null
UTF-8
Java
false
false
439
java
/** * */ package com.charjay.basic.section3.finaldemo; /** * @author Administrator * */ public class B { //finalไฟฎ้ฅฐๅฑžๆ€ง๏ผŒ่ฏฅๅฑžๆ€งๅช่ƒฝ่ขซ่ต‹ๅ€ผไธ€ๆฌก๏ผŒไปŽๅ˜้‡ๆˆไธบๅธธ้‡ final int count=10; //ไธ€่ˆฌๅœจjavaไธญ๏ผŒไฝฟ็”จstatic finalๆฅไฟฎ้ฅฐๅธธ้‡๏ผŒๅธธ้‡ๆ‰€ไปฅๅ•่ฏๅคงๅ†™๏ผŒๅ•่ฏๅ’Œๅ•่ฏไน‹้—ดไฝฟ็”จไธ‹ๅˆ’็บฟๆฅๅš้—ด้š”่ฏ†ๅˆซใ€‚ static final String SCHOOL_NAME="no.1 school"; void test(){ //count=1; } }
[ "820419196@qq.com" ]
820419196@qq.com
e279be8cce2f9524b7d8dbe83265287b1a983cf6
06072df63dfcc25de4cadd23326efd4b39efe8bd
/src/main/java/com/jyh/scm/entity/console/CodeItem.java
f17d6683fa5188e388dfebb6ce5aa93a0d443275
[]
no_license
bounce5733/scm
874b51cfbf15dbc4f66e8f4d53949d32edc4cb3a
ad24ec87e43f1c271bd5c93ed8e2d0a78d152c75
refs/heads/master
2020-03-26T06:07:29.337005
2018-12-16T03:07:38
2018-12-16T03:07:38
90,807,093
0
0
null
null
null
null
UTF-8
Java
false
false
577
java
package com.jyh.scm.entity.console; import javax.persistence.Table; import com.jyh.scm.entity.BaseCascaderCode; /** * ็ผ–็ ๅญ้กน * * @author jiangyonghua * @date 2017ๅนด6ๆœˆ19ๆ—ฅ ไธ‹ๅˆ5:35:12 */ @Table(name = "sys_code_item") public class CodeItem extends BaseCascaderCode<CodeItem> { private static final long serialVersionUID = 1L; /** * ๆ‰€ๅฑž็ผ–็  */ private String type; public String getType() { return type; } public void setType(String type) { this.type = type; } }
[ "yh_jiang@126.com" ]
yh_jiang@126.com
29829c5deefd02f871987058bb5ac7708b07f61f
8eb7a44016943d95236dc8db9843ba28a9421377
/aws-lambda/src/com/ziprealty/hackathon/processors/ShowScheduleProcessor.java
1aaaadc68ffad76d495c3af690e3a94d231e457f
[]
no_license
jackie-ho/Voz
c493cc02030a245ea0e507cbbf7c38ca12262400
78f74db304786a18fb9186aa388d78e4fc2af833
refs/heads/master
2021-01-01T04:49:32.956909
2017-07-17T19:25:45
2017-07-17T19:25:45
97,257,546
1
0
null
null
null
null
UTF-8
Java
false
false
1,332
java
package com.ziprealty.hackathon.processors; import com.ziprealty.hackathon.lex.LexRequest; import com.ziprealty.hackathon.lex.LexResponse; import com.ziprealty.hackathon.lex.response.DialogAction; import com.ziprealty.hackathon.lex.response.Message; import java.util.HashMap; import java.util.Map; import static com.ziprealty.hackathon.util.Constants.*; /** * Created by jamgale on 7/16/17. */ class ShowScheduleProcessor { private ShowScheduleProcessor() { } static void processScheduleIntent(LexRequest lexRequest, LexResponse lexResponse) { String response; Map<String, String> sessionAttributes = new HashMap<>(); if (SHOW_TODAYS_SCHEDULE.equals(lexRequest.getIntentName())) { response = "Showing today's schedule"; sessionAttributes.put("schedule", TODAY); } else if (SHOW_WEEK_SCHEDULE.equals(lexRequest.getIntentName())) { response = "Showing this week's schedule"; sessionAttributes.put("schedule", WEEK); } else { response = "error: schedule intent malfunction"; } Message message = new Message(PLAIN_TEXT, response); lexResponse.setDialogAction(new DialogAction(CLOSE, FULFILLED, message)); lexResponse.setSessionAttributes(sessionAttributes); } }
[ "jake@jakegale.com" ]
jake@jakegale.com
8aab9ef7e28f73d906b468d802f66b47cc3ce003
516646cadc2c1f7ee91604cd72470172c15a0f60
/demo/kafka/src/main/java/com/zero/kafka/topics/TopicsUtils.java
be5fa9f28a518a0c3978eab592401da87006002a
[]
no_license
shenjiachun/javaProject
7eecbaae295487a44143b0cf3496018b5ba8ea9e
62d7c0c2afca40db2f16d23cd83f40f9ffa82022
refs/heads/master
2020-05-15T03:59:09.282918
2019-04-16T07:57:39
2019-04-16T07:57:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,384
java
package com.zero.kafka.topics; import org.apache.kafka.clients.CommonClientConfigs; import org.apache.kafka.clients.admin.*; import org.apache.kafka.common.config.ConfigResource; import java.util.Arrays; import java.util.Collection; import java.util.Map; import java.util.Properties; import java.util.concurrent.ExecutionException; public class TopicsUtils { private static final String BROKER_URL = "192.168.56.101:9092,192.168.56.101:9093"; private AdminClient adminClient; public TopicsUtils() { // ๅฑžๆ€ง้…็ฝฎไฟกๆฏ Properties props = new Properties(); props.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, BROKER_URL); adminClient = AdminClient.create(props); } public void listTopics() { ListTopicsResult result = adminClient.listTopics(); try { Collection<TopicListing> topicsList = result.listings().get(); for (TopicListing topic : topicsList) { System.out.printf("Topic name: %s\n", topic.name()); } } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } } public static void main(String[] args) { //TopicsUtils tu = new TopicsUtils(); //tu.listTopics(); //tu.describeTopic("Topic-03"); System.out.println(Math.abs("ConsumerGroup22".hashCode()) % 50); } public void createTopic(String topicName, int partitionNum, short replicFactor) { NewTopic topic = new NewTopic(topicName, partitionNum, replicFactor); CreateTopicsResult result = adminClient.createTopics(Arrays.asList(topic)); for (Map.Entry entry : result.values().entrySet()) { System.out.printf("%s, %s", entry.getKey(), entry.getValue()); } } public void describeTopic(String topicName) { DescribeTopicsResult result = adminClient.describeTopics(Arrays.asList(topicName)); try { Map<String, TopicDescription> map = result.all().get(); for (Map.Entry entry : map.entrySet()) { System.out.printf("%s, %s", entry.getKey(), entry.getValue()); } } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } } }
[ "ex-heguitang@banketech.com" ]
ex-heguitang@banketech.com
d6f1a3cf650e3e33fea411d862b3cf8ef6a59ce9
dfac64e12a871c523e00977ba4d968d20ffe31bb
/src/Expert/Ref.java
109505b20b4a181e6e02d4767e4631a494a438f6
[]
no_license
SamAyl/Programming
60f5e6c5c8826ec51c93ef8c23591318eccc93d6
f9441a5e524124513f8efbc5cd9fa041b866a072
refs/heads/master
2023-08-28T09:29:02.849370
2021-10-13T00:28:57
2021-10-13T00:28:57
123,201,039
0
0
null
null
null
null
UTF-8
Java
false
false
685
java
package Expert; public class Ref { public static void main(String[] args) { int[] arr = {1,2,3,4,5,6}; Node root = getTreeBST(arr,0,arr.length-1); System.out.println(root.v); System.out.println(root.left.v); } public static Node getTreeBST(int[] arr, int str, int end) { if (str>end) { return null; } int mid = (str+end)/2; Node temp = new Node(arr[mid]); temp.left = getTreeBST(arr,str, mid-1); temp.right = getTreeBST(arr,mid+1,end); return temp; } } class Node{ int v; Node left; Node right; public Node(int v){ this.v = v; } }
[ "sandeep.ayloo@thalesesecurity.com" ]
sandeep.ayloo@thalesesecurity.com
7d85c2617d06729c4869b6caa7bed3d162393f0a
54c6ce85c84e7d9a7e45f9a13f6494df6c86ab08
/Java/workspace/Daya12/src/com/bimapalma/day12/Rekening.java
8655fb8517863384e4f4a73716ff79873f5fc5b0
[]
no_license
AinulMutaqin/BimaTraining
6daee714bc0aea00145df7c342a56846a8c9903c
48fe25f99c9f05c26d98fccd528d6bc736d90a00
refs/heads/master
2021-01-17T07:26:15.123199
2016-07-21T07:27:14
2016-07-21T07:27:14
18,900,318
0
0
null
null
null
null
UTF-8
Java
false
false
1,173
java
package com.bimapalma.day12; import java.io.Serializable; import javax.persistence.*; import java.util.List; /** * The persistent class for the REKENING database table. * */ @Entity @NamedQuery(name="Rekening.findAll", query="SELECT r FROM Rekening r") public class Rekening implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private int rekid; private String noakun; //private Date tglBukaAkun; //bi-directional many-to-many association to Nasabah @ManyToMany @JoinTable( name="REKENING_NASABAH" , joinColumns={ @JoinColumn(name="REKS_REKID") } , inverseJoinColumns={ @JoinColumn(name="NASABAH_NASABAHID") } ) private List<Nasabah> nasabahs; public Rekening() { } public int getRekid() { return this.rekid; } public void setRekid(int rekid) { this.rekid = rekid; } public String getNoakun() { return this.noakun; } public void setNoakun(String noakun) { this.noakun = noakun; } public List<Nasabah> getNasabahs() { return this.nasabahs; } public void setNasabahs(List<Nasabah> nasabahs) { this.nasabahs = nasabahs; } }
[ "ainul.mutaqin@ilcs.co.id" ]
ainul.mutaqin@ilcs.co.id
ffea456dcd2b20222747399c916463f44b83669e
171ef8fb442d81d43a223ab2837efaf9d4b4d9dc
/examples/read/src/main/java/net/consensys/gpact/examples/read/Bc1ContractA.java
e9262ee83f0cba8f624452b2e0077040d5717c5b
[ "Apache-2.0" ]
permissive
sivo4kin/gpact
dc0c4c070cf6882e608c61d2856df7602af79151
f5f5922b6faaf4f51014246c4468fef860c74206
refs/heads/master
2023-07-13T11:48:26.022380
2021-08-20T07:33:18
2021-08-20T07:33:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,733
java
/* * Copyright 2019 ConsenSys Software 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. * * SPDX-License-Identifier: Apache-2.0 */ package net.consensys.gpact.examples.read; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.web3j.crypto.Credentials; import org.web3j.protocol.core.methods.response.TransactionReceipt; import net.consensys.gpact.cbc.AbstractBlockchain; import net.consensys.gpact.examples.read.soliditywrappers.ContractA; import java.io.IOException; import java.math.BigInteger; import java.util.List; public class Bc1ContractA extends AbstractBlockchain { private static final Logger LOG = LogManager.getLogger(Bc1ContractA.class); ContractA contractA; public Bc1ContractA(Credentials credentials, String bcId, String uri, String gasPriceStrategy, String blockPeriod) throws IOException { super(credentials, bcId, uri, gasPriceStrategy, blockPeriod); } public void deployContracts(String cbcContractAddress, BigInteger busLogicBlockchainId, String busLogicContractAddress) throws Exception { this.contractA = ContractA.deploy(this.web3j, this.tm, this.gasProvider, cbcContractAddress, busLogicBlockchainId, busLogicContractAddress).send(); LOG.info("ContractA deployed to {} on blockchain 0x{}", this.contractA.getContractAddress(), this.blockchainId.toString(16)); } public String getRlpFunctionSignature_DoCrosschainRead() { return this.contractA.getRLP_doCrosschainRead(); } public void showEvents(TransactionReceipt txR) { LOG.info("ContractA: Value Read Events"); List<ContractA.ValueReadEventResponse> events = this.contractA.getValueReadEvents(txR); for (ContractA.ValueReadEventResponse e: events) { LOG.info(" Value: {}", e._val); } } public void showValueRead() throws Exception { boolean isLocked = this.contractA.isLocked(BigInteger.ZERO).send(); LOG.info("Contract A's lockable storage: locked: {}", isLocked); if (isLocked) { throw new RuntimeException("Contract A's lockable storage locked after end of crosschain transaction"); } LOG.info("ContractA: Value: {}", this.contractA.getVal().send()); } }
[ "drinkcoffee@eml.cc" ]
drinkcoffee@eml.cc
8687375072dcd2e36de7602b98a07f7cb613e335
908cca9d9c810b7fe62085fcb8a1c6062a1954ea
/03_LibreriasExternas/01_ButterKnife/app/src/androidTest/java/com/miguelcr/a01_butterknife/ExampleInstrumentedTest.java
988f93c4713443ec55d0d63b6d7372cf27dd3f0b
[]
no_license
miguelcamposdev/pmdm2016
933428b49795d719390831463389c8129a847da1
e1cfda179a0b06e8455ad5a55b43fc9eb2a69bf2
refs/heads/master
2021-06-15T08:36:46.031379
2017-03-27T11:02:52
2017-03-27T11:02:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package com.miguelcr.a01_butterknife; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.miguelcr.a01_butterknife", appContext.getPackageName()); } }
[ "camposmiguel@gmail.com" ]
camposmiguel@gmail.com
1bc6b88c35bfd6457b99ee68b0856440627a517f
5285740773bdbc550c00e4232e734976d9178260
/new_harness/src/abstraction/structures/NewTileKey.java
a6679bd88b70f8e00723bb2f10774117518bf07e
[]
no_license
mitdbg/forecache-code
5a76564f30e02f00b9e5012613fadc71fae5cbc2
3aa2aadce3d709a8822d5d418e3049912184f584
refs/heads/master
2021-01-21T04:27:30.692557
2016-05-30T04:57:35
2016-05-30T04:57:35
32,104,190
3
1
null
null
null
null
UTF-8
Java
false
false
2,989
java
package abstraction.structures; import java.util.Arrays; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; /** * @author leibatt * Class for storing tile ID's. Also responsible for computing distance metrics. * Class fields are immutable */ public class NewTileKey implements java.io.Serializable { /** * important for deserialization */ private static final long serialVersionUID = -2419645717877248576L; public int[] dimIndices = null; public int zoom = -1; public NewTileKey() {} public NewTileKey(int[] id, int zoom) { this.dimIndices = id; this.zoom = zoom; } public NewTileKey copy() { NewTileKey copy = new NewTileKey(Arrays.copyOf(this.dimIndices, this.dimIndices.length), this.zoom); return copy; } public String buildTileString() { StringBuilder tile_id = new StringBuilder(); tile_id.append("["); if(this.dimIndices.length > 0) { tile_id.append(this.dimIndices[0]); } else { return null; } for(int i = 1; i < this.dimIndices.length; i++) { tile_id.append(", ").append(this.dimIndices[i]); } tile_id.append("]"); return tile_id.toString(); } public synchronized String buildTileStringForFile() { StringBuilder tile_id = new StringBuilder(); if(this.dimIndices == null) { return null; } for(int i = 0; i < this.dimIndices.length; i++) { tile_id.append(this.dimIndices[i]).append("_"); } tile_id.append(this.zoom); return tile_id.toString(); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("(["); if(this.dimIndices.length > 0) { sb.append(this.dimIndices[0]); } for(int i = 1; i < this.dimIndices.length; i++) { sb.append(", ").append(this.dimIndices[i]); } sb.append("], ").append(this.zoom).append(")"); return sb.toString(); } //overrode for hashing in Memory Tile Buffer @Override public int hashCode() { HashCodeBuilder hcb = new HashCodeBuilder(491,37) .append(this.zoom); for(int i = 0; i < this.dimIndices.length; i++) { hcb.append(this.dimIndices[i]); } return hcb.toHashCode(); } //overrode for hashing in Memory Tile Buffer @Override public boolean equals(Object other) { if(other == null) { return false; } else if(other == this) { return true; } else if(!(other instanceof NewTileKey)) { return false; } NewTileKey o = (NewTileKey) other; if(this.dimIndices.length != o.dimIndices.length) { return false; } int[] oid = o.dimIndices; EqualsBuilder eb = new EqualsBuilder() .append(this.zoom,o.zoom); for(int i = 0; i < this.dimIndices.length; i++) { eb.append(this.dimIndices[i], oid[i]); } return eb.isEquals(); } /****************** Nested Classes *********************/ public static class NewTileKeyJson implements java.io.Serializable { private static final long serialVersionUID = 3044841539693043061L; public int[] dimIndices; public int zoom; } }
[ "leibatt@gmail.com" ]
leibatt@gmail.com
d7825c0cc7bd4e847251b4c06ead3c7c5d042d7e
c26329f68e8e57598daa187c1125ba64bb39218f
/Student2/jrJava/sorting_bubble/BinarySearch.java
b1b9d2c7361aaae56bbcf0a847b3603b3212d1f6
[]
no_license
ayaanzhaque/java-practice
008730b33626429f1afc6699f3d00c93628e1dcb
be15c890d2a1b1a0862a7d682da001d2aaf985ad
refs/heads/master
2022-12-05T14:34:46.574786
2020-08-28T20:14:24
2020-08-28T20:14:24
286,806,098
0
0
null
null
null
null
UTF-8
Java
false
false
738
java
package jrJava.sorting_bubble; public class BinarySearch { public static void main(String args[]){ int[] values = Utility.loadIntArrayFromFile("jrJava/sorting_bubble/random.txt"); Utility.print(values); BubbleSorter.sort(values); Utility.print(values); int index = search(values, 995); System.out.println("index = " + index); } public static int search(int[] data, int searchKey){ int low = 0, high = data.length-1; int mid; int count = 0; //delete this later while(low <= high){ count ++; System.out.println(count); mid = (low + high)/2; if(searchKey > data[mid]) low = mid + 1; else if(searchKey < data[mid]) high = mid - 1; else return mid; } return -1; } }
[ "ayaanzhaque@gmail.com" ]
ayaanzhaque@gmail.com
79b7be6be7e4d14cfb476dc0ba277eb1e1fb9b87
47a1618c7f1e8e197d35746639e4480c6e37492e
/src/oracle/retail/stores/pos/ado/tender/TenderFactory.java
8ab395a1d3ada09de66cc272b06c1e20c570feb4
[]
no_license
dharmendrams84/POSBaseCode
41f39039df6a882110adb26f1225218d5dcd8730
c588c0aa2a2144aa99fa2bbe1bca867e008f47ee
refs/heads/master
2020-12-31T07:42:29.748967
2017-03-29T08:12:34
2017-03-29T08:12:34
86,555,051
0
1
null
null
null
null
UTF-8
Java
false
false
7,039
java
/* =========================================================================== * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * =========================================================================== * $Header: rgbustores/applications/pos/src/oracle/retail/stores/pos/ado/tender/TenderFactory.java /rgbustores_13.4x_generic_branch/2 2011/10/13 15:15:28 sgu Exp $ * =========================================================================== * NOTES * <other useful comments, qualifications, etc.> * * MODIFIED (MM/DD/YY) * sgu 10/12/11 - create house account tender correctly from legacy * tender line item * cgreene 05/27/10 - convert to oracle packaging * cgreene 05/26/10 - convert to oracle packaging * abondala 01/03/10 - update header date * * =========================================================================== * $Log: * 3 360Commerce 1.2 3/31/2005 4:30:23 PM Robert Pearse * 2 360Commerce 1.1 3/10/2005 10:25:57 AM Robert Pearse * 1 360Commerce 1.0 2/11/2005 12:14:51 PM Robert Pearse * * Revision 1.3.2.1 2004/11/15 22:27:36 bwf * @scr 7671 Create tender from rdo instead of class. This is necessary because ADO's are not 1:1 with RDOs. * * Revision 1.3 2004/05/27 13:57:26 epd * @scr 5290 made private method protected * * Revision 1.2 2004/02/12 16:47:55 mcs * Forcing head revision * * Revision 1.1.1.1 2004/02/11 01:04:11 cschellenger * updating to pvcs 360store-current * * * * Rev 1.4 Feb 05 2004 13:46:32 rhafernik * log4j changes * * Rev 1.3 Dec 16 2003 11:17:06 bwf * Create new createTenderMethod to accomidate code review. * * Rev 1.2 Dec 03 2003 17:13:48 bwf * Add mall certificate. * Resolution for 3538: Mall Certificate Tender * * Rev 1.1 Nov 20 2003 16:57:16 epd * updated to use new ADO Factory Complex * * Rev 1.0 Nov 04 2003 11:13:16 epd * Initial revision. * * Rev 1.5 Oct 29 2003 16:00:26 epd * removed dead code * * Rev 1.4 Oct 28 2003 16:10:24 crain * Added TenderCouponADO * Resolution for 3421: Tender redesign * * Rev 1.3 Oct 27 2003 18:23:34 epd * Added code for Credit tender * * Rev 1.2 Oct 25 2003 16:07:02 blj * added Money Order Tender * * Rev 1.0 Oct 17 2003 12:33:48 epd * Initial revision. * * =========================================================================== */ package oracle.retail.stores.pos.ado.tender; import java.util.HashMap; import oracle.retail.stores.pos.ado.factory.TenderFactoryIfc; import oracle.retail.stores.domain.tender.TenderLineItemIfc; ; /** * Utility class for Tenders */ public class TenderFactory implements TenderFactoryIfc { /** * Attempts to create a tender based on the attributes contained in the HashMap * @param tenderAttributes HashMap containing attributes needed to create a tender * @return A TenderADOIfc instance * @throws TenderException Thrown when it's not possible to create a tender * due to invalid attributes. */ public TenderADOIfc createTender(HashMap tenderAttributes) throws TenderException { assert(tenderAttributes.get(TenderConstants.TENDER_TYPE) != null) : "Must provide tender type"; TenderTypeEnum tenderType = (TenderTypeEnum)tenderAttributes.get(TenderConstants.TENDER_TYPE); TenderADOIfc tender = getTenderADO(tenderType); ((AbstractTenderADO)tender).setTenderAttributes(tenderAttributes); return tender; } //---------------------------------------------------------------------- /** Attempts to create an ADO tender given a corresponding RDO. @param rdoObject An RDO tender @return A TenderADOIfc instance @see oracle.retail.stores.pos.ado.factory.TenderFactoryIfc#createTender(oracle.retail.stores.domain.tender.TenderLineItemIfc) **/ //---------------------------------------------------------------------- public TenderADOIfc createTender(TenderLineItemIfc rdoObject) { TenderTypeEnum tenderType = TenderTypeEnum.makeTenderTypeEnumFromRDO(rdoObject); // If using this method, one should _always_ have a tender type. assert(tenderType != null); return createTender(tenderType); } //---------------------------------------------------------------------- /** Attempts to create an ADO tender given a corresponding TenderTypeEnum. @param tte TenderTypeEnum @return TenderADOIfc **/ //---------------------------------------------------------------------- public TenderADOIfc createTender(TenderTypeEnum tenderType) { TenderADOIfc tender = getTenderADO(tenderType); return tender; } /** * Instantiate the proper concrete tender type * @param tenderType The enumerated ADO tender type * @return a new tenderADO instance */ protected TenderADOIfc getTenderADO(TenderTypeEnum tenderType) { TenderADOIfc tender = null; if (tenderType == TenderTypeEnum.CASH) { tender = new TenderCashADO(); } else if (tenderType == TenderTypeEnum.CHECK) { tender = new TenderCheckADO(); } else if (tenderType == TenderTypeEnum.COUPON) { tender = new TenderCouponADO(); } else if (tenderType == TenderTypeEnum.CREDIT) { tender = new TenderCreditADO(); } else if (tenderType == TenderTypeEnum.DEBIT) { tender = new TenderDebitADO(); } else if (tenderType == TenderTypeEnum.GIFT_CARD) { tender = new TenderGiftCardADO(); } else if (tenderType == TenderTypeEnum.GIFT_CERT) { tender = new TenderGiftCertificateADO(); } else if (tenderType == TenderTypeEnum.MAIL_CHECK) { tender = new TenderMailCheckADO(); } else if (tenderType == TenderTypeEnum.PURCHASE_ORDER) { tender = new TenderPurchaseOrderADO(); } else if (tenderType == TenderTypeEnum.STORE_CREDIT) { tender = new TenderStoreCreditADO(); } else if (tenderType == TenderTypeEnum.TRAVELERS_CHECK) { tender = new TenderTravelersCheckADO(); } else if (tenderType == TenderTypeEnum.MONEY_ORDER) { tender = new TenderMoneyOrderADO(); } else if (tenderType == TenderTypeEnum.COUPON) { tender = new TenderCouponADO(); } else if (tenderType == TenderTypeEnum.MALL_CERT) { tender = new TenderMallCertificateADO(); } else if (tenderType == TenderTypeEnum.HOUSE_ACCOUNT) { tender = new TenderCreditADO(); } return tender; } }
[ "Ignitiv021@Ignitiv021-PC" ]
Ignitiv021@Ignitiv021-PC
fb3702266d3a7aecf795fdc1737c398e0636bdc1
56888381ee8a019b87e432a5fa94378541e59ee7
/src/main/java/dk/bec/unittest/becut/testcase/model/PostConditionResult.java
6ea2ab9259115e3ef94669b202736d7e52fe1e99
[ "MIT" ]
permissive
bec-denmark/becut
dd926b4ed9fc265dd287037e33e247cdc18e2080
cee3b7240af4b09d02caadaf4b811503e5dc615d
refs/heads/master
2022-12-08T05:09:00.045219
2021-09-09T08:33:19
2021-09-09T08:33:19
208,817,334
5
5
MIT
2022-12-06T00:46:05
2019-09-16T14:14:23
Java
UTF-8
Java
false
false
737
java
package dk.bec.unittest.becut.testcase.model; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; public class PostConditionResult { List<PostConditionComparison> comparisons = new ArrayList<PostConditionComparison>(); public List<PostConditionComparison> getComparisons() { return comparisons; } public Boolean isSuccess() { return comparisons .stream() .allMatch(PostConditionComparison::compare); } public String prettyPrint() { if (isSuccess()) return "Success\n"; return "Fail\n" + comparisons .stream() .filter(c -> !c.compare()) .map(PostConditionComparison::toString) .collect(Collectors.joining("\n", "", "")); } }
[ "piotr.lipski@bec.dk" ]
piotr.lipski@bec.dk
536489d3f7b9b4789180ba095974e5feb424d5cd
d573827df5671c4585bb47586cc04f022d19e993
/src/main/java/com/dataart/cerebro/controller/ImageController.java
216a8f5b0528333da4125533076e08e784d64afd
[]
no_license
LirolaJose/cerebro-back
72466740c8995ca406ea8bfba1715b3c8d40e600
323e673a09c6fbe13714bcfcff75006b6da36a83
refs/heads/master
2023-05-31T17:57:16.480882
2021-06-11T09:17:38
2021-06-11T09:17:38
377,073,424
0
0
null
null
null
null
UTF-8
Java
false
false
1,504
java
package com.dataart.cerebro.controller; import com.dataart.cerebro.domain.Image; import com.dataart.cerebro.service.ImageService; import io.swagger.annotations.Api; import lombok.RequiredArgsConstructor; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; import java.util.stream.Collectors; @RestController @RequestMapping("/api/image") @Api(tags = "Images") @RequiredArgsConstructor public class ImageController { private final ImageService imageService; @GetMapping(value = "/{advertisementId}", produces = {MediaType.IMAGE_JPEG_VALUE, MediaType.IMAGE_PNG_VALUE}) public ResponseEntity<byte[]> getMainImageByAdvertisement(@PathVariable Long advertisementId) { byte[] imageBytes = imageService.findImageByAdvertisementId(advertisementId); return ResponseEntity.ok(imageBytes); } @GetMapping(value = "/imagesList/{advertisementId}") public ResponseEntity<?> getImagesList(@PathVariable Long advertisementId) { List<Long> imagesId = imageService.findAllByAdvertisementId(advertisementId).stream() .map(Image::getId) .collect(Collectors.toList()); return ResponseEntity.ok(imagesId); } }
[ "khose.lirola@dataart.com" ]
khose.lirola@dataart.com
0941273e0dee5742e07e5a1c2a35f01d7e0c0f55
819b29d01434ca930f99e8818293cc1f9aa58e18
/src/codebook/graph/LowestCommonAncestorEuler.java
660be3916f96bab04992c671a40903504dfac3f3
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ANUJ581/competitive-programming-1
9bd5de60163d9a46680043d480455c8373fe26a7
d8ca9efe9762d9953bcacbc1ca1fe0da5cbe6ac4
refs/heads/master
2020-08-06T18:43:09.688000
2019-10-06T04:54:47
2019-10-06T04:54:47
213,110,718
0
0
NOASSERTION
2019-10-06T04:54:18
2019-10-06T04:54:18
null
UTF-8
Java
false
false
3,112
java
/* * An algorithm to find the lowest common ancestor (LCA) of two nodes in a tree based on the Eulerian path of a tree. * * Time complexity: * - Preprocessing: O(V + E) * - Query: O(log V) */ package codebook.graph; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.ArrayList; import java.util.StringTokenizer; public class LowestCommonAncestorEuler { static BufferedReader br; static PrintWriter out; static StringTokenizer st; static int[] toId, toLabel, first; static ArrayList<ArrayList<Integer>> adj = new ArrayList<ArrayList<Integer>>(); static int n, q, cnt, sz, num; static int[] order; public static void main(String[] args) throws IOException { br = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(new OutputStreamWriter(System.out)); //br = new BufferedReader(new FileReader("in.txt")); //out = new PrintWriter(new FileWriter("out.txt")); // number of nodes n = readInt(); // number of queries q = readInt(); sz = 2 * n - 1; toId = new int[n]; toLabel = new int[n]; order = new int[2 * sz]; first = new int[n]; for (int i = 0; i < n; i++) { adj.add(new ArrayList<Integer>()); first[i] = -1; } for (int i = 0; i < n - 1; i++) { int a = readInt() - 1; int b = readInt() - 1; adj.get(a).add(b); adj.get(b).add(a); } dfs(0, -1); for (int i = 2 * sz - 2; i > 1; i -= 2) order[i >> 1] = Math.min(order[i], order[i ^ 1]); for (int i = 0; i < q; i++) { out.println(lca(readInt() - 1, readInt() - 1) + 1); } out.close(); } private static int lca(int i, int j) { int a = toId[i]; int b = toId[j]; int lo = Math.min(first[a], first[b]); int hi = Math.max(first[a], first[b]); int res = 1 << 30; for (lo += sz, hi += sz; lo <= hi; lo = (lo + 1) >> 1, hi = (hi - 1) >> 1) res = Math.min(res, Math.min(order[lo], order[hi])); return toLabel[res]; } private static void dfs(int i, int prev) { int curr = num++; toId[i] = curr; toLabel[curr] = i; for (int j : adj.get(i)) { if (j != prev) { order[sz + cnt++] = curr; if (first[curr] == -1) first[curr] = cnt - 1; dfs(j, i); } } order[sz + cnt++] = curr; if (first[curr] == -1) first[curr] = cnt - 1; } static String next() throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine().trim()); return st.nextToken(); } static long readLong() throws IOException { return Long.parseLong(next()); } static int readInt() throws IOException { return Integer.parseInt(next()); } static double readDouble() throws IOException { return Double.parseDouble(next()); } static char readCharacter() throws IOException { return next().charAt(0); } static String readLine() throws IOException { return br.readLine().trim(); } }
[ "jeffrey.xiao1998@gmail.com" ]
jeffrey.xiao1998@gmail.com
bdaa310b483b80e0702d55e58530ad082dce56e6
5b228ec26201384a1450d9360fe95fe99f5bb3ea
/app/src/main/java/com/coolweather/android/util/Utility.java
0575cab0138cbfe942f03a473c4945827d2901bd
[]
no_license
zqmzhong/CoolWeather
6795aeb9a98d99fe915d19cfcc88a046799ff334
3ef7f4153b37341051e08c6f6c490bf40f5eee81
refs/heads/master
2021-04-09T10:59:03.718636
2018-03-16T08:07:10
2018-03-16T08:07:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,665
java
package com.coolweather.android.util; import android.text.TextUtils; import com.coolweather.android.db.City; import com.coolweather.android.db.County; import com.coolweather.android.db.Province; import com.coolweather.android.gson.Weather; import com.google.gson.Gson; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; /** * Created by Francis on 2017.12.6. * <p> * ็”ฑไบŽๆœๅŠกๅ™จ่ฟ”ๅ›ž็š„็œๅธ‚ๅŽฟๆ•ฐๆฎ้ƒฝๆ˜ฏ JSON ๆ ผๅผ็š„๏ผŒๆ‰€ไปฅๅœจๆไพ›ไธ€ไธชๅทฅๅ…ท็ฑปๆฅ่งฃๆžๅ’Œๅค„็†่ฟ™็งๆ•ฐๆฎ */ public class Utility { /** * ่งฃๆžๅ’Œๅค„็†ๆœๅŠกๅ™จ่ฟ”ๅ›ž็š„็œ็บงๆ•ฐๆฎ */ public static boolean handleProvinceResponse(String response) { if (!TextUtils.isEmpty(response)) { try { JSONArray allProvinces = new JSONArray(response); for (int i = 0; i < allProvinces.length(); i++) { JSONObject provinceObject = allProvinces.getJSONObject(i); Province province = new Province(); province.setProvinceName(provinceObject.getString("name")); province.setProvinceCode(provinceObject.getInt("id")); province.save(); } return true; } catch (JSONException e) { e.printStackTrace(); } } return false; } /** * ่งฃๆžๅ’Œๅค„็†ๆœๅŠกๅ™จ่ฟ”ๅ›ž็š„ๅธ‚็บงๆ•ฐๆฎ */ public static boolean handleCityResponse(String response, int provinceId) { if (!TextUtils.isEmpty(response)) { try { JSONArray allCities = new JSONArray(response); for (int i = 0; i < allCities.length(); i++) { JSONObject cityObject = allCities.getJSONObject(i); City city = new City(); city.setCityName(cityObject.getString("name")); city.setCityCode(cityObject.getInt("id")); city.setProvinceId(provinceId); city.save(); } return true; } catch (JSONException e) { e.printStackTrace(); } } return false; } /** * ่งฃๆžๅ’Œๅค„็†ๆœๅŠกๅ™จ่ฟ”ๅ›ž็š„ๅŽฟ็บงๆ•ฐๆฎ */ public static boolean handleCountyResponse(String response, int cityId) { if (!TextUtils.isEmpty(response)) { try { JSONArray allCounties = new JSONArray(response); for (int i = 0; i < allCounties.length(); i++) { JSONObject countyObject = allCounties.getJSONObject(i); County county = new County(); county.setCountyName(countyObject.getString("name")); county.setWeatherId(countyObject.getString("weather_id")); county.setCityId(cityId); county.save(); } return true; } catch (JSONException e) { e.printStackTrace(); } } return false; } /** * ๅฐ†่ฟ”ๅ›ž็š„ JSON ๆ•ฐๆฎ่งฃๆžๆˆ Weather ๅฎžไฝ“็ฑป */ public static Weather handleWeatherResponse(String response) { try { JSONObject jsonObject = new JSONObject(response); JSONArray jsonArray = jsonObject.getJSONArray("HeWeather"); String weatherContent = jsonArray.getJSONObject(0).toString(); return new Gson().fromJson(weatherContent, Weather.class); } catch (JSONException e) { e.printStackTrace(); } return null; } }
[ "zqmzhong@gmail.com" ]
zqmzhong@gmail.com
85c5b3f6b7f95c0e629faf52be8ef4c4dbbac869
19c1c021ee850e91272b49f7b3ea0c781b183343
/appinventor/tfjs/template/TensorflowTemplate.java
10663d5b69283b849d7467fc27788e1a1b30326b
[ "Apache-2.0" ]
permissive
Biangkerok32/tfjs-extension-tool
fdd76cac346d9be7841cff9e2beeac3f39d1792b
f634b0ce3c3b39920fab54d26f07e9bb0eade1bf
refs/heads/master
2021-05-18T16:43:25.495837
2020-03-27T22:42:52
2020-03-27T22:42:52
251,322,403
0
0
Apache-2.0
2020-03-30T14:01:33
2020-03-30T14:00:46
null
UTF-8
Java
false
false
11,547
java
// -*- mode: java; c-basic-offset: 2; -*- // Copyright 2019 MIT, All rights reserved // Released under the Apache License, Version 2.0 // http://www.apache.org/licenses/LICENSE-2.0 package template; import android.Manifest; import android.Manifest.permission; import android.annotation.SuppressLint; import android.app.Activity; import android.util.Log; import android.view.WindowManager.LayoutParams; import android.webkit.JavascriptInterface; import android.webkit.PermissionRequest; import android.webkit.WebChromeClient; import android.webkit.WebResourceRequest; import android.webkit.WebResourceResponse; import android.webkit.WebView; import android.webkit.WebViewClient; import com.google.appinventor.components.annotations.DesignerComponent; import com.google.appinventor.components.annotations.DesignerProperty; import com.google.appinventor.components.annotations.SimpleEvent; import com.google.appinventor.components.annotations.SimpleObject; import com.google.appinventor.components.annotations.SimpleProperty; import com.google.appinventor.components.annotations.UsesAssets; import com.google.appinventor.components.annotations.UsesPermissions; import com.google.appinventor.components.common.ComponentCategory; import com.google.appinventor.components.common.PropertyTypeConstants; import com.google.appinventor.components.runtime.AndroidNonvisibleComponent; import com.google.appinventor.components.runtime.Deleteable; import com.google.appinventor.components.runtime.EventDispatcher; import com.google.appinventor.components.runtime.Form; import com.google.appinventor.components.runtime.OnPauseListener; import com.google.appinventor.components.runtime.OnResumeListener; import com.google.appinventor.components.runtime.OnStopListener; import com.google.appinventor.components.runtime.PermissionResultHandler; import com.google.appinventor.components.runtime.WebViewer; import com.google.appinventor.components.runtime.util.ErrorMessages; import com.google.appinventor.components.runtime.util.JsonUtil; import com.google.appinventor.components.runtime.util.SdkLevel; import com.google.appinventor.components.runtime.util.YailList; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @DesignerComponent(version = 1, category = ComponentCategory.EXTENSION, description = "An extension that embeds a Tensorflow.js model.", iconName = "aiwebres/icon.png", nonVisible = true) @SimpleObject(external = true) @UsesAssets(fileNames = "%ASSETS%") @UsesPermissions({Manifest.permission.CAMERA}) public class TensorflowTemplate extends AndroidNonvisibleComponent implements OnResumeListener, OnPauseListener, OnStopListener, Deleteable { private static final String LOG_TAG = TensorflowTemplate.class.getSimpleName(); private static final String ERROR_WEBVIEWER_NOT_SET = "You must specify a WebViewer using the WebViewer designer property before you can call %1s"; private static final int ERROR_JSON_PARSE_FAILED = 101; private static final String MODEL_URL = "%MODEL_URL%"; private static final String BACK_CAMERA = "Back"; private static final String FRONT_CAMERA = "Front"; private WebView webview = null; private String cameraMode = FRONT_CAMERA; private boolean initialized = false; private boolean enabled = true; /** * Creates a new TensorflowTemplate extension. * * @param form the container that this component will be placed in */ public TensorflowTemplate(Form form) { super(form); requestHardwareAcceleration(form); WebView.setWebContentsDebuggingEnabled(true); Log.d(LOG_TAG, "Created TensorflowTemplate extension"); } @SuppressLint("SetJavaScriptEnabled") private void configureWebView(WebView webview) { this.webview = webview; webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setMediaPlaybackRequiresUserGesture(false); webview.addJavascriptInterface(new AppInventorTFJS(), "TensorflowTemplate"); webview.setWebViewClient(new WebViewClient() { @Override public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { final String url = request.getUrl().toString(); Log.d(LOG_TAG, "shouldInterceptRequest called"); if (url.startsWith(MODEL_URL)) { Log.d(LOG_TAG, "overriding " + url); InputStream is; try { is = form.openAssetForExtension(TensorflowTemplate.this, url.substring(MODEL_URL.length())); String contentType, charSet; if (url.endsWith(".json")) { contentType = "application/json"; charSet = "UTF-8"; } else { contentType = "application/octet-stream"; charSet = "binary"; } if (SdkLevel.getLevel() >= SdkLevel.LEVEL_LOLLIPOP) { Map<String, String> responseHeaders = new HashMap<>(); responseHeaders.put("Access-Control-Allow-Origin", "*"); return new WebResourceResponse(contentType, charSet, 200, "OK", responseHeaders, is); } else { return new WebResourceResponse(contentType, charSet, is); } } catch (IOException e) { e.printStackTrace(); } } Log.d(LOG_TAG, url); return super.shouldInterceptRequest(view, request); } }); webview.setWebChromeClient(new WebChromeClient() { @Override public void onPermissionRequest(final PermissionRequest request) { Log.d(LOG_TAG, "onPermissionRequest called"); String[] requestedResources = request.getResources(); for (String r : requestedResources) { if (r.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) { form.askPermission(permission.CAMERA, new PermissionResultHandler() { @Override public void HandlePermissionResponse(String permission, boolean granted) { if (granted) { request.grant(new String[]{PermissionRequest.RESOURCE_VIDEO_CAPTURE}); } else { form.dispatchPermissionDeniedEvent(TensorflowTemplate.this, "Enable", permission); } } }); } } } }); } @SuppressWarnings("squid:S00100") @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_COMPONENT + ":com.google.appinventor.components.runtime.WebViewer") @SimpleProperty(userVisible = false) public void WebViewer(WebViewer webviewer) { if (webviewer != null) { configureWebView((WebView) webviewer.getView()); webview.requestLayout(); } try { Log.d(LOG_TAG, "isHardwareAccelerated? " + webview.isHardwareAccelerated()); webview.loadUrl(form.getAssetPathForExtension(this, "index.html")); } catch(FileNotFoundException e) { Log.e(LOG_TAG, "Unable to load tensorflow", e); } } public void Initialize() { if (webview != null) { initialized = true; } } @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_BOOLEAN, defaultValue = "True") @SimpleProperty public void Enabled(boolean enabled) { this.enabled = enabled; if (initialized) { assertWebView("Enabled"); webview.evaluateJavascript(enabled ? "startVideo();" : "stopVideo();", null); } } @SimpleProperty(description = "Enables or disables the model.") public boolean Enabled() { return enabled; } @SuppressWarnings("squid:S00100") @SimpleEvent(description = "Event indicating that the model is ready.") public void ModelReady() { EventDispatcher.dispatchEvent(this, "ModelReady"); } @SuppressWarnings("squid:S00100") @SimpleEvent(description = "Event indicating that an error has occurred.") public void Error(int errorCode, String errorMessage) { EventDispatcher.dispatchEvent(this, "Error", errorCode, errorMessage); } @SuppressWarnings("squid:S00100") @SimpleEvent(description = "Event indicating that model successfully got a result.") public void GotResult(Object result) { EventDispatcher.dispatchEvent(this, "GotResult", result); } @SimpleProperty(description = "Configures TensorflowTemplate to use the front or " + "back camera on the device.") @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_CHOICES, editorArgs = {BACK_CAMERA, FRONT_CAMERA}, defaultValue = FRONT_CAMERA) public void UseCamera(String mode) { if (BACK_CAMERA.equals(mode) || FRONT_CAMERA.equals(mode)) { cameraMode = mode; if (initialized) { boolean frontFacing = mode.equals(FRONT_CAMERA); webview.evaluateJavascript("setCameraFacingMode(" + frontFacing + ");", null); } } else { form.dispatchErrorOccurredEvent(this, "UseCamera", ErrorMessages.ERROR_EXTENSION_ERROR, 1, LOG_TAG, "Invalid camera selection. Must be either 'Front' or 'Back'."); } } @SimpleProperty public String UseCamera() { return cameraMode; } private static void requestHardwareAcceleration(Activity activity) { activity.getWindow().setFlags(LayoutParams.FLAG_HARDWARE_ACCELERATED, LayoutParams.FLAG_HARDWARE_ACCELERATED); } @SuppressWarnings("SameParameterValue") private void assertWebView(String method) { if (webview == null) { throw new IllegalStateException(String.format(ERROR_WEBVIEWER_NOT_SET, method)); } } @Override public void onDelete() { if (initialized && webview != null) { webview.evaluateJavascript("teardown();", null); webview = null; } } @Override public void onPause() { if (initialized && webview != null) { webview.evaluateJavascript("stopVideo();", null); } } @Override public void onResume() { if (initialized && enabled && webview != null) { webview.evaluateJavascript("startVideo();", null); } } @Override public void onStop() { if (initialized && webview != null) { webview.evaluateJavascript("teardown();", null); webview = null; } } private class AppInventorTFJS { @JavascriptInterface public void ready() { form.runOnUiThread(new Runnable() { @Override public void run() { ModelReady(); if (enabled) { UseCamera(cameraMode); } } }); } @JavascriptInterface public void reportResult(final String result) { try { final Object parsedResult = JsonUtil.getObjectFromJson(result, true); form.runOnUiThread(new Runnable() { @Override public void run() { GotResult(parsedResult); } }); } catch (final JSONException e) { form.runOnUiThread(new Runnable() { @Override public void run() { Error(ERROR_JSON_PARSE_FAILED, e.getMessage()); } }); Log.e(LOG_TAG, "Error parsing JSON from web view", e); } } @JavascriptInterface public void error(final int errorCode, final String errorMessage) { form.runOnUiThread(new Runnable() { @Override public void run() { Error(errorCode, errorMessage); } }); } } }
[ "ewpatton@mit.edu" ]
ewpatton@mit.edu
066a8861993ed430fa6be77f0cc9e2ef3f6c5b31
322d55688192c31128086ff391a18d109aa219cd
/src/main/java/com/googlecode/t7mp/steps/external/ForkedSetupSequence.java
38b59dc0c111bc1e6c2e7ee0a5cd0d1d010ffe64
[]
no_license
jdeiviz/t7mp
ec5876cdc6e63f87bb3a6fe546dde3a5110b67ee
5852a3789cf90b616cb72dc16ee617c7d3039b3c
refs/heads/master
2021-01-16T18:01:26.869288
2011-08-10T13:26:54
2011-08-10T13:26:54
2,178,041
0
0
null
null
null
null
UTF-8
Java
false
false
898
java
package com.googlecode.t7mp.steps.external; import com.googlecode.t7mp.steps.DefaultStepSequence; import com.googlecode.t7mp.steps.deployment.AdditionalTomcatLibDeploymentStep; import com.googlecode.t7mp.steps.deployment.CheckT7ArtifactsStep; import com.googlecode.t7mp.steps.deployment.WebappsDeploymentStep; import com.googlecode.t7mp.steps.resources.ConfigFilesSequence; import com.googlecode.t7mp.steps.resources.CopyProjectWebappStep; import com.googlecode.t7mp.steps.resources.OverwriteWebXmlStep; public class ForkedSetupSequence extends DefaultStepSequence { public ForkedSetupSequence(){ add(new CheckT7ArtifactsStep()); add(new ResolveTomcatStep()); add(new ConfigFilesSequence()); add(new AdditionalTomcatLibDeploymentStep()); add(new WebappsDeploymentStep()); add(new CopyProjectWebappStep()); add(new OverwriteWebXmlStep()); } }
[ "joerg.bellmann@googlemail.com" ]
joerg.bellmann@googlemail.com
64227292837c3f1eccbb669821953bad316804f6
3e2f2a02e4f2f04c568b34cfe4190377497ab9e9
/features/kms-keystore-api/src/main/java/com/intel/kms/api/KeyAttributes.java
dd7262469b61cb9aece92e3332bd8296adc859b6
[]
no_license
opencit/opencit-kms
d25cc16edcf31a81ab18d735bfade783619f17da
2aa58aef2edd3851dabdf98395473fcd07fc4fee
refs/heads/master
2021-01-21T11:15:31.299436
2018-10-17T17:36:42
2018-10-17T17:36:42
91,732,010
0
2
null
null
null
null
UTF-8
Java
false
false
5,097
java
/* * Copyright (C) 2014 Intel Corporation * All rights reserved. */ package com.intel.kms.api; import com.intel.dcsg.cpg.io.Copyable; import com.intel.mtwilson.util.crypto.key2.CipherKeyAttributes; import com.intel.mtwilson.util.crypto.key2.CipherKey; import java.net.MalformedURLException; import java.net.URL; /** * * @author jbuhacoff */ public class KeyAttributes extends CipherKeyAttributes implements Copyable { private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(KeyAttributes.class); private String username; private String transferPolicy; private URL transferLink; /** * Optional user-provided description of the key. */ private String description; /** * Optional user-provided role name indicates the use of the key. * For example: * data encryption, key encryption, signatures, key derivation */ private String role; /** * Digest algorithm used in conjunction with this key. Optional. */ private String digestAlgorithm; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } /** * URI of a transfer policy to apply to this key. * The KMS requires a transfer policy for every key * but may support a default policy for new key * requests which omit this attribute and/or a global * (fixed) policy for all key requests (where * specifying the attribute would be an error because * it would be ignored). The policy itself is a * separate document that describes who may access * the key under what conditions (trusted, authenticated, * etc) * * Example: * urn:intel:trustedcomputing:keytransferpolicy:trusted * might indicate that a built-in policy will enforce that * the key is only released to trusted clients, and * leave the definition of trusted up to the trust * attestation server. * * Example: * http://fileserver/path/to/policy.xml * might indicate that the fileserver has a file policy.xml * which is signed by this keyserver and contains the * complete key transfer policy including what is a trusted * client, what is the attestation server trusted certificate, * etc. * */ public String getTransferPolicy() { return transferPolicy; } public void setTransferPolicy(String transferPolicy) { this.transferPolicy = transferPolicy; } public URL getTransferLink() { return transferLink; } public void setTransferLink(URL transferLink) { this.transferLink = transferLink; } public String getRole() { return role; } public void setRole(String role) { this.role = role; } public String getDigestAlgorithm() { return digestAlgorithm; } public void setDigestAlgorithm(String digestAlgorithm) { this.digestAlgorithm = digestAlgorithm; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Override public KeyAttributes copy() { KeyAttributes newInstance = new KeyAttributes(); newInstance.copyFrom(this); return newInstance; } public void copyFrom(KeyAttributes source) { super.copyFrom(source); log.debug("Copying algorithm {} from source", source.getAlgorithm()); this.setAlgorithm(source.getAlgorithm()); this.setMode(source.getMode()); this.setKeyLength(source.getKeyLength()); this.setPaddingMode(source.getPaddingMode()); this.digestAlgorithm = source.digestAlgorithm; this.username = source.username; this.description = source.description; this.role = source.role; this.transferPolicy = source.transferPolicy; this.transferLink = source.transferLink; } public void copyFrom(CipherKey source) { this.setAlgorithm(source.getAlgorithm()); this.setMode(source.getMode()); this.setKeyLength(source.getKeyLength()); this.setPaddingMode(source.getPaddingMode()); this.setKeyId(source.getKeyId()); if( source.get("transferPolicy") != null ) { log.debug("copyFrom transferPolicy {}", source.get("transferPolicy")); this.setTransferPolicy((String)source.get("transferPolicy")); } if( source.get("transferLink") != null ) { log.debug("copyFrom transferLink {}", source.get("transferLink")); try { this.setTransferLink(new URL((String)source.get("transferLink"))); } catch(MalformedURLException e) { log.error("Cannot set transfer policy for key", e); } } // this.name = null; // this.digestAlgorithm = null; // this.role = null; // this.transferPolicy = null; } }
[ "jonathan.buhacoff@intel.com" ]
jonathan.buhacoff@intel.com
52dfbe341a774718d49ea3f42ae290e431ef0620
4f14fd14ebd0f7688c67aff63a1feb618d34b4bc
/src/main/java/br/mp/mpf/ssin/migri/web/rest/PessoaResource.java
8ffc7c00106a68f33632b231c8098489c617af4d
[]
no_license
MPF-SSIN/migri
f8534e10d9d64616d8ab218ed2752eb2eb44da1d
c2682b862ab3ac78090fd289a9fdb7a326e05691
refs/heads/main
2023-03-15T00:15:48.019157
2021-03-04T01:20:58
2021-03-04T01:20:58
344,299,952
0
0
null
2021-03-04T01:20:58
2021-03-04T00:12:59
Java
UTF-8
Java
false
false
4,682
java
package br.mp.mpf.ssin.migri.web.rest; import br.mp.mpf.ssin.migri.domain.Pessoa; import br.mp.mpf.ssin.migri.service.PessoaService; import br.mp.mpf.ssin.migri.web.rest.errors.BadRequestAlertException; import io.github.jhipster.web.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing {@link br.mp.mpf.ssin.migri.domain.Pessoa}. */ @RestController @RequestMapping("/api") public class PessoaResource { private final Logger log = LoggerFactory.getLogger(PessoaResource.class); private static final String ENTITY_NAME = "pessoa"; @Value("${jhipster.clientApp.name}") private String applicationName; private final PessoaService pessoaService; public PessoaResource(PessoaService pessoaService) { this.pessoaService = pessoaService; } /** * {@code POST /pessoas} : Create a new pessoa. * * @param pessoa the pessoa to create. * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new pessoa, or with status {@code 400 (Bad Request)} if the pessoa has already an ID. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PostMapping("/pessoas") public ResponseEntity<Pessoa> createPessoa(@RequestBody Pessoa pessoa) throws URISyntaxException { log.debug("REST request to save Pessoa : {}", pessoa); if (pessoa.getId() != null) { throw new BadRequestAlertException("A new pessoa cannot already have an ID", ENTITY_NAME, "idexists"); } Pessoa result = pessoaService.save(pessoa); return ResponseEntity.created(new URI("/api/pessoas/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())) .body(result); } /** * {@code PUT /pessoas} : Updates an existing pessoa. * * @param pessoa the pessoa to update. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated pessoa, * or with status {@code 400 (Bad Request)} if the pessoa is not valid, * or with status {@code 500 (Internal Server Error)} if the pessoa couldn't be updated. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PutMapping("/pessoas") public ResponseEntity<Pessoa> updatePessoa(@RequestBody Pessoa pessoa) throws URISyntaxException { log.debug("REST request to update Pessoa : {}", pessoa); if (pessoa.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } Pessoa result = pessoaService.save(pessoa); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, pessoa.getId().toString())) .body(result); } /** * {@code GET /pessoas} : get all the pessoas. * * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of pessoas in body. */ @GetMapping("/pessoas") public List<Pessoa> getAllPessoas() { log.debug("REST request to get all Pessoas"); return pessoaService.findAll(); } /** * {@code GET /pessoas/:id} : get the "id" pessoa. * * @param id the id of the pessoa to retrieve. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the pessoa, or with status {@code 404 (Not Found)}. */ @GetMapping("/pessoas/{id}") public ResponseEntity<Pessoa> getPessoa(@PathVariable Long id) { log.debug("REST request to get Pessoa : {}", id); Optional<Pessoa> pessoa = pessoaService.findOne(id); return ResponseUtil.wrapOrNotFound(pessoa); } /** * {@code DELETE /pessoas/:id} : delete the "id" pessoa. * * @param id the id of the pessoa to delete. * @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}. */ @DeleteMapping("/pessoas/{id}") public ResponseEntity<Void> deletePessoa(@PathVariable Long id) { log.debug("REST request to delete Pessoa : {}", id); pessoaService.delete(id); return ResponseEntity.noContent().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString())).build(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
8ff62cf98883c0bd9d6a7c2be633d9c04a7754a4
698aabd8aa42acc36006e87dad7782c2dff0c0cb
/Control_Notas/src/control_notas/Asignacion.java
b7c6270470e288679d240ff68adc170675e25450
[]
no_license
AngelChacon2020/Analisis-XP
f79be48abd3f707f7e80a670f397e73b3e9329b1
39d3327d965c33e2cfa486d3b3807cc95933f61f
refs/heads/main
2023-05-13T01:29:47.779206
2021-05-28T06:02:35
2021-05-28T06:02:35
370,172,143
0
0
null
null
null
null
UTF-8
Java
false
false
14,995
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 control_notas; /** * * @author HP */ public class Asignacion extends javax.swing.JFrame { /** * Creates new form Asignacion */ public Asignacion() { initComponents(); } /** * 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() { jScrollPane2 = new javax.swing.JScrollPane(); jList1 = new javax.swing.JList<>(); jScrollPane3 = new javax.swing.JScrollPane(); jTextPane1 = new javax.swing.JTextPane(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField(); jTextField3 = new javax.swing.JTextField(); jTextField4 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField(); jTextField6 = new javax.swing.JTextField(); jTextField7 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jScrollPane4 = new javax.swing.JScrollPane(); jTable2 = new javax.swing.JTable(); jList1.setModel(new javax.swing.AbstractListModel<String>() { String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; public int getSize() { return strings.length; } public String getElementAt(int i) { return strings[i]; } }); jScrollPane2.setViewportView(jList1); jScrollPane3.setViewportView(jTextPane1); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } )); jScrollPane1.setViewportView(jTable1); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setText("Asigancion de Curso y Catedratico"); jLabel2.setText("Nombre"); jLabel3.setText("Correo"); jLabel4.setText("Usuario"); jLabel5.setText("Contraseรฑa"); jLabel6.setText("Codigo Catedratico"); jLabel7.setText("Codigo curso"); jLabel8.setText("Bimestre"); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); jTextField7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField7ActionPerformed(evt); } }); jButton1.setText("Asignar Estudiante"); jTable2.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Curso", "Catedratico", "Horario", "Seccion" } )); jScrollPane4.setViewportView(jTable2); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(277, 277, 277) .addComponent(jLabel1)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(118, 118, 118) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel3) .addGap(18, 18, 18) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel2) .addGap(18, 18, 18) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(77, 77, 77) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel5) .addComponent(jLabel4)) .addGap(31, 31, 31) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(78, 78, 78) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(45, 45, 45) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(81, 81, 81) .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel6) .addGap(70, 70, 70) .addComponent(jLabel7) .addGap(119, 119, 119) .addComponent(jLabel8)))) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(259, 259, 259) .addComponent(jButton1)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(100, 100, 100) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(106, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(40, 40, 40) .addComponent(jLabel1) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jLabel4) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(58, 58, 58) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jLabel5) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(59, 59, 59) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(jLabel7) .addComponent(jLabel8)) .addGap(30, 30, 30) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(50, 50, 50) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(52, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField2ActionPerformed private void jTextField7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField7ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField7ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Asignacion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Asignacion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Asignacion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Asignacion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Asignacion().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JList<String> jList1; private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane4; private javax.swing.JTable jTable1; private javax.swing.JTable jTable2; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; private javax.swing.JTextPane jTextPane1; // End of variables declaration//GEN-END:variables }
[ "HP@LAPTOP-EIEB8PJC" ]
HP@LAPTOP-EIEB8PJC
390338b260c3d463bea68ff0d9e056496387fd11
f0e6236f3a597b91903b777ec290f5178df4995f
/Regions/src/au/com/mineauz/minigamesregions/RegionEvents.java
60971711d7b2b2c2aa4a02a272d6ce5e3b6b9e8c
[]
no_license
cindyker/Minigames
98473268c79ff761949752fe847128f99d4bc46f
b824284ff38e240ddf7a3f3f928e091437860a2b
refs/heads/master
2021-01-18T09:46:53.669400
2014-08-08T03:00:48
2014-08-08T03:00:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,967
java
package au.com.mineauz.minigamesregions; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.Event; import au.com.mineauz.minigames.MinigamePlayer; import au.com.mineauz.minigames.Minigames; import au.com.mineauz.minigames.PlayerData; import au.com.mineauz.minigames.events.EndMinigameEvent; import au.com.mineauz.minigames.events.JoinMinigameEvent; import au.com.mineauz.minigames.events.QuitMinigameEvent; import au.com.mineauz.minigames.events.StartMinigameEvent; import au.com.mineauz.minigames.minigame.Minigame; import au.com.mineauz.minigamesregions.events.EnterRegionEvent; import au.com.mineauz.minigamesregions.events.LeaveRegionEvent; public class RegionEvents implements Listener{ private Minigames plugin = Minigames.plugin; private PlayerData pdata = plugin.pdata; private void executeRegionChanges(Minigame mg, MinigamePlayer ply, Event event){ for(Region r : RegionModule.getMinigameModule(mg).getRegions()){ if(r.playerInRegion(ply)){ if(!r.hasPlayer(ply)){ r.addPlayer(ply); r.execute(RegionTrigger.ENTER, ply, null); EnterRegionEvent ev = new EnterRegionEvent(ply, r); Bukkit.getPluginManager().callEvent(ev); } } else{ if(r.hasPlayer(ply)){ r.removePlayer(ply); r.execute(RegionTrigger.LEAVE, ply, null); LeaveRegionEvent ev = new LeaveRegionEvent(ply, r); Bukkit.getPluginManager().callEvent(ev); } } } } @EventHandler(ignoreCancelled = true) private void playerMove(PlayerMoveEvent event){ MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer()); if(ply == null) return; if(ply.isInMinigame()){ Minigame mg = ply.getMinigame(); executeRegionChanges(mg, ply, event); } } @EventHandler private void playerSpawn(PlayerRespawnEvent event){ final MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer()); if(ply == null) return; if(ply.isInMinigame()){ final Minigame mg = ply.getMinigame(); final Event fevent = event; Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @Override public void run() { executeRegionChanges(mg, ply, fevent); } }); for(Node node : RegionModule.getMinigameModule(ply.getMinigame()).getNodes()){ node.execute(NodeTrigger.RESPAWN, ply, event); } for(Region region : RegionModule.getMinigameModule(ply.getMinigame()).getRegions()){ region.execute(RegionTrigger.RESPAWN, ply, event); } } } @EventHandler private void playerDeath(PlayerDeathEvent event){ MinigamePlayer ply = pdata.getMinigamePlayer(event.getEntity()); if(ply == null) return; if(ply.isInMinigame()){ for(Node node : RegionModule.getMinigameModule(ply.getMinigame()).getNodes()){ node.execute(NodeTrigger.DEATH, ply, event); } for(Region region : RegionModule.getMinigameModule(ply.getMinigame()).getRegions()){ region.execute(RegionTrigger.DEATH, ply, event); } } } @EventHandler(ignoreCancelled = true) private void playerJoin(JoinMinigameEvent event){ final MinigamePlayer ply = event.getMinigamePlayer(); if(ply == null) return; final Minigame mg = event.getMinigame(); final Event fevent = event; Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @Override public void run() { executeRegionChanges(mg, ply, fevent); } }); for(Node node : RegionModule.getMinigameModule(event.getMinigame()).getNodes()){ node.execute(NodeTrigger.GAME_JOIN, event.getMinigamePlayer(), event); } for(Region region : RegionModule.getMinigameModule(event.getMinigame()).getRegions()){ region.execute(RegionTrigger.GAME_JOIN, event.getMinigamePlayer(), event); } } @EventHandler private void minigameStart(StartMinigameEvent event){ for(Node node : RegionModule.getMinigameModule(event.getMinigame()).getNodes()){ node.execute(NodeTrigger.GAME_START, null, event); } for(Region region : RegionModule.getMinigameModule(event.getMinigame()).getRegions()){ region.execute(RegionTrigger.GAME_START, null, event); } } @EventHandler(ignoreCancelled = true) private void playerQuit(QuitMinigameEvent event){ MinigamePlayer ply = event.getMinigamePlayer(); if(ply == null) return; Minigame mg = ply.getMinigame(); for(Region r : RegionModule.getMinigameModule(mg).getRegions()){ if(r.hasPlayer(ply)) r.removePlayer(ply); } for(Node node : RegionModule.getMinigameModule(event.getMinigame()).getNodes()){ node.execute(NodeTrigger.GAME_QUIT, event.getMinigamePlayer(), event); if(event.getMinigame().getPlayers().size() > 1){ for(NodeExecutor exec : node.getExecutors()) exec.removeTrigger(event.getMinigamePlayer()); } else{ for(NodeExecutor exec : node.getExecutors()) exec.clearTriggers(); } } for(Region region : RegionModule.getMinigameModule(event.getMinigame()).getRegions()){ region.execute(RegionTrigger.GAME_QUIT, event.getMinigamePlayer(), event); if(event.getMinigame().getPlayers().size() > 1){ for(RegionExecutor exec : region.getExecutors()) exec.removeTrigger(event.getMinigamePlayer()); } else{ for(RegionExecutor exec : region.getExecutors()) exec.clearTriggers(); } } } @EventHandler(ignoreCancelled = true) private void playersEnd(EndMinigameEvent event){ for(MinigamePlayer ply : event.getWinners()){ Minigame mg = ply.getMinigame(); for(Region r : RegionModule.getMinigameModule(mg).getRegions()){ if(r.hasPlayer(ply)) r.removePlayer(ply); } } for(Node node : RegionModule.getMinigameModule(event.getMinigame()).getNodes()){ node.execute(NodeTrigger.GAME_END, null, event); for(NodeExecutor exec : node.getExecutors()) exec.clearTriggers(); } for(Region region : RegionModule.getMinigameModule(event.getMinigame()).getRegions()){ region.execute(RegionTrigger.GAME_END, null, event); for(RegionExecutor exec : region.getExecutors()) exec.clearTriggers(); } } @EventHandler(ignoreCancelled = true) private void interactNode(PlayerInteractEvent event){ MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer()); if(ply == null) return; if(ply.isInMinigame() && ((event.getAction() == Action.PHYSICAL && (event.getClickedBlock().getType() == Material.STONE_PLATE || event.getClickedBlock().getType() == Material.WOOD_PLATE || event.getClickedBlock().getType() == Material.IRON_PLATE || event.getClickedBlock().getType() == Material.GOLD_PLATE)) || (event.getAction() == Action.RIGHT_CLICK_BLOCK && (event.getClickedBlock().getType() == Material.WOOD_BUTTON || event.getClickedBlock().getType() == Material.STONE_BUTTON)))){ for(Node node : RegionModule.getMinigameModule(ply.getMinigame()).getNodes()){ if(node.getLocation().getWorld() == event.getClickedBlock().getWorld()){ Location loc1 = node.getLocation(); Location loc2 = event.getClickedBlock().getLocation(); if(loc1.getBlockX() == loc2.getBlockX() && loc1.getBlockY() == loc2.getBlockY() && loc1.getBlockZ() == loc2.getBlockZ()){ node.execute(NodeTrigger.INTERACT, ply, event); } } } } } @EventHandler(ignoreCancelled = true) private void blockBreak(BlockBreakEvent event){ MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer()); if(ply == null)return; if(ply.isInMinigame()){ for(Node node : RegionModule.getMinigameModule(ply.getMinigame()).getNodes()){ if(node.getLocation().getWorld() == event.getBlock().getWorld()){ Location loc1 = node.getLocation(); Location loc2 = event.getBlock().getLocation(); if(loc1.getBlockX() == loc2.getBlockX() && loc1.getBlockY() == loc2.getBlockY() && loc1.getBlockZ() == loc2.getBlockZ()){ node.execute(NodeTrigger.BLOCK_BROKEN, ply, event); } } } } } @EventHandler(ignoreCancelled = true) private void blockPlace(BlockPlaceEvent event){ MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer()); if(ply == null)return; if(ply.isInMinigame()){ for(Node node : RegionModule.getMinigameModule(ply.getMinigame()).getNodes()){ if(node.getLocation().getWorld() == event.getBlock().getWorld()){ Location loc1 = node.getLocation(); Location loc2 = event.getBlock().getLocation(); if(loc1.getBlockX() == loc2.getBlockX() && loc1.getBlockY() == loc2.getBlockY() && loc1.getBlockZ() == loc2.getBlockZ()){ node.execute(NodeTrigger.BLOCK_PLACED, ply, event); } } } } } }
[ "paul.dav.1991@gmail.com" ]
paul.dav.1991@gmail.com
d1b21dda6c8d9fc78baeac7ea375b02b1c50afe1
badeaa2ada74c482467909b970e1cda6be82448a
/src/main/java/com/adyen/model/nexo/RepeatedResponseMessageBody.java
9fd0567131d5298043ccc277484491705ffadbb2
[ "MIT" ]
permissive
Adyen/adyen-java-api-library
29b5844e1c01fb2e296dab1eff37c02edd21a2c0
3f35b25923ec25d9917185b71d66ce37a572ba7b
refs/heads/develop
2023-08-11T05:45:14.781240
2023-08-09T09:12:17
2023-08-09T09:12:17
61,282,052
111
147
MIT
2023-09-14T14:48:53
2016-06-16T09:57:30
Java
UTF-8
Java
false
false
5,517
java
/* * ###### * ###### * ############ ####( ###### #####. ###### ############ ############ * ############# #####( ###### #####. ###### ############# ############# * ###### #####( ###### #####. ###### ##### ###### ##### ###### * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### * ###### ###### #####( ###### #####. ###### ##### ##### ###### * ############# ############# ############# ############# ##### ###### * ############ ############ ############# ############ ##### ###### * ###### * ############# * ############ * * Adyen Java API Library * * Copyright (c) 2019 Adyen B.V. * This file is open source and available under the MIT license. * See the LICENSE file for more info. */ package com.adyen.model.nexo; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * The type Repeated message response body. */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RepeatedResponseMessageBody", propOrder = { "loyaltyResponse", "paymentResponse", "reversalResponse", "storedValueResponse", "cardAcquisitionResponse", "cardReaderAPDUResponse" }) public class RepeatedResponseMessageBody { /** * The Loyalty response. */ @XmlElement(name = "LoyaltyResponse") protected LoyaltyResponse loyaltyResponse; /** * The Payment response. */ @XmlElement(name = "PaymentResponse") protected PaymentResponse paymentResponse; /** * The Reversal response. */ @XmlElement(name = "ReversalResponse") protected ReversalResponse reversalResponse; /** * The Stored value response. */ @XmlElement(name = "StoredValueResponse") protected StoredValueResponse storedValueResponse; /** * The Card acquisition response. */ @XmlElement(name = "CardAcquisitionResponse") protected CardAcquisitionResponse cardAcquisitionResponse; /** * The Card reader apdu response. */ @XmlElement(name = "CardReaderAPDUResponse") protected CardReaderAPDUResponse cardReaderAPDUResponse; /** * Gets the value of the loyaltyResponse property. * * @return possible object is {@link LoyaltyResponse } */ public LoyaltyResponse getLoyaltyResponse() { return loyaltyResponse; } /** * Sets the value of the loyaltyResponse property. * * @param value allowed object is {@link LoyaltyResponse } */ public void setLoyaltyResponse(LoyaltyResponse value) { this.loyaltyResponse = value; } /** * Gets the value of the paymentResponse property. * * @return possible object is {@link PaymentResponse } */ public PaymentResponse getPaymentResponse() { return paymentResponse; } /** * Sets the value of the paymentResponse property. * * @param value allowed object is {@link PaymentResponse } */ public void setPaymentResponse(PaymentResponse value) { this.paymentResponse = value; } /** * Gets the value of the reversalResponse property. * * @return possible object is {@link ReversalResponse } */ public ReversalResponse getReversalResponse() { return reversalResponse; } /** * Sets the value of the reversalResponse property. * * @param value allowed object is {@link ReversalResponse } */ public void setReversalResponse(ReversalResponse value) { this.reversalResponse = value; } /** * Gets the value of the storedValueResponse property. * * @return possible object is {@link StoredValueResponse } */ public StoredValueResponse getStoredValueResponse() { return storedValueResponse; } /** * Sets the value of the storedValueResponse property. * * @param value allowed object is {@link StoredValueResponse } */ public void setStoredValueResponse(StoredValueResponse value) { this.storedValueResponse = value; } /** * Gets the value of the cardAcquisitionResponse property. * * @return possible object is {@link CardAcquisitionResponse } */ public CardAcquisitionResponse getCardAcquisitionResponse() { return cardAcquisitionResponse; } /** * Sets the value of the cardAcquisitionResponse property. * * @param value allowed object is {@link CardAcquisitionResponse } */ public void setCardAcquisitionResponse(CardAcquisitionResponse value) { this.cardAcquisitionResponse = value; } /** * Gets the value of the cardReaderAPDUResponse property. * * @return possible object is {@link CardReaderAPDUResponse } */ public CardReaderAPDUResponse getCardReaderAPDUResponse() { return cardReaderAPDUResponse; } /** * Sets the value of the cardReaderAPDUResponse property. * * @param value allowed object is {@link CardReaderAPDUResponse } */ public void setCardReaderAPDUResponse(CardReaderAPDUResponse value) { this.cardReaderAPDUResponse = value; } }
[ "renato.martins@adyen.com" ]
renato.martins@adyen.com
8464f1c36da6b7e14392295eda692a6d633a87dd
08c1bca609e840b050fae73e462407c6d2d64c8b
/src/com/creational/designpattern/builder/assignment/SecurityGuardNotification.java
a54b7c61d08f9d4d5dd8f73c181063faf7562fcc
[]
no_license
Harsh0786/FullStack-DesignPatterns
434715802c8b5b012006bfe7f187be90e43b198f
de21e981d660875c3a9401f6a9b19c7ad08717b5
refs/heads/main
2023-06-04T09:06:36.008904
2021-07-04T11:45:42
2021-07-04T11:45:42
382,835,457
0
0
null
null
null
null
UTF-8
Java
false
false
395
java
package com.creational.designpattern.builder.assignment; import java.util.ArrayList; import java.util.List; public class SecurityGuardNotification implements Notification { @Override public List<MeansOfNotification> sendNotification() { List<MeansOfNotification> means = new ArrayList<>(); MeansOfNotification sms = new SMSMeansOfNotification(); means.add(sms); return means; } }
[ "harshneema1991@gmail.com" ]
harshneema1991@gmail.com
97a30f466b85d80cca91ad15fc380a5c6daf9e76
6d8793d148f0a4151a5a0ad32a962868bd36eb63
/src/main/java/JulyLeetCode/Count.java
5158f7ef44d1a7c59b2f467695cd6e2f9315ab51
[]
no_license
iamceekay/LeetCode
6d38964991061857b62630e319e71446e26b69b2
510bec30a631aee6498aff0833a9dbd993730b5c
refs/heads/master
2021-06-27T06:45:15.951590
2021-06-26T02:59:50
2021-06-26T02:59:50
234,700,804
0
0
null
null
null
null
UTF-8
Java
false
false
1,100
java
package JulyLeetCode; class Count extends Thread { Count() { super("my extending thread"); System.out.println("my thread created" + this); start(); } public void run() { try { for (int i=0 ;i<10;i++) { System.out.println("Printing the count " + i); Thread.sleep(1000); } } catch(InterruptedException e) { System.out.println("my thread interrupted"); } System.out.println("My thread run is over" ); } } class ExtendingExample { public static void main(String args[]) { Count cnt = new Count(); try { while(cnt.isAlive()) { System.out.println("Main thread will be alive till the child thread is live"); Thread.sleep(1500); } } catch(InterruptedException e) { System.out.println("Main thread interrupted"); } System.out.println("Main thread's run is over" ); } }
[ "chandrakant.kh13@gmail.com" ]
chandrakant.kh13@gmail.com
62ff5d6757f6d61a814d47da24e2beb9d7a55b6e
29363e9aed82b14ec16febb9701d449db5270cba
/container/quiz03/sla14/src/main/java/org/interventure/quiz03/sla14/DSConfig.java
6874f6c84137ce0e15dde31e3ed5b3c6c31e43cd
[]
no_license
interventure-growingtogether/spring-certification
1d039f3bf089553d580cd4719fad4b69d3e9be80
b8bd5ac507ecca59abc089dec08143fe80a6f1ce
refs/heads/master
2022-01-22T06:50:37.743024
2019-11-27T13:16:41
2019-11-27T13:16:41
207,088,173
1
0
null
2022-01-21T23:34:16
2019-09-08T09:13:29
Java
UTF-8
Java
false
false
720
java
package org.interventure.quiz03.sla14; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; /** * @author <a href="mailto:slavisa.avramovic@escriba.de">avramovics</a> * @since 2019-09-20 */ @Configuration @PropertySource("classpath:db/datasource.properties") public class DSConfig { @Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { return new PropertySourcesPlaceholderConfigurer(); } @Bean public DSBean bean() { return new DSBean(); } }
[ "avramovic.slavisa@partake.de" ]
avramovic.slavisa@partake.de
bfca84cf9873ce5b2594212bac0b662fda97d7e4
8b68e995f91ceba7df75c591062a5ce213691536
/src/main/java/com/valueplus/drug/service/IDruginfoService.java
a243625a5d398f8c481784b89585beadfa3c1615
[]
no_license
chengxiangbo/drug
b5361e90e74b12c406e5657d76f190a1370c4e14
7bdb069d1461e0ef31bfac073897dfdb86f26153
refs/heads/master
2023-06-06T06:10:13.789794
2021-06-10T09:15:30
2021-06-10T09:15:30
375,637,904
0
0
null
null
null
null
UTF-8
Java
false
false
1,175
java
package com.valueplus.drug.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.valueplus.drug.entity.Druginfo; import java.util.List; /** * ่ฏๅ“่กจserviceๆŽฅๅฃ */ public interface IDruginfoService extends IService<Druginfo> { /** * ๅˆ†้กตๆŸฅ่ฏขๆ•ฐๆฎ * @param pageNum ็ฌฌๅ‡ ้กต * @param pageSize ๆฏ้กตๆ•ฐ้‡ * @param param ๆŸฅ่ฏขๅ‚ๆ•ฐๆกไปถ-่ฏๅ“ๅ็งฐ * @return */ public IPage<Druginfo> selectDruginfoPage(int pageNum, int pageSize, String param); /** * ๆ–ฐๅขžไธ€ๆกๆ•ฐๆฎ * @param druginfo */ public int addDruginfo(Druginfo druginfo); /** * ไฟฎๆ”นๆ•ฐๆฎ * @param druginfo * @return */ public int editDruginfo(Druginfo druginfo); /** * ๆ นๆฎidๆŸฅ่ฏขๆ•ฐๆฎ * @param id * @return */ public Druginfo queryDruginfoById(Integer id); /** * ๆ นๆฎidๅˆ ้™คๆ•ฐๆฎ * @param id * @return */ public int delDruginfoByid(Integer id); /** * ๆŸฅ่ฏขๆ‰€ๆœ‰็š„ๆ•ฐๆฎ * @return */ public List<Druginfo> queryDruginfoList(); }
[ "1036642869@qq.com" ]
1036642869@qq.com
54a12cc497d9ff2564342b0fd887cde209c61b9f
2074d29abcce388325d273388f5b9212129d5ee1
/Reference/src/com/Matrix/FindRowWitMaxOnes.java
31462f192c42924571ea37a1e2e37a8758f09112
[]
no_license
ravitejasomisetty/DataStructures
3835b98d7336aef69b7a7f02a2ad305f5d29425b
ba350489a752991208fd3358fb2f01427849443d
refs/heads/master
2020-04-15T21:53:43.866804
2017-12-25T00:05:06
2017-12-25T00:05:06
68,037,313
0
0
null
null
null
null
UTF-8
Java
false
false
608
java
package com.Matrix; public class FindRowWitMaxOnes { public static void main(String[] args) { // TODO Auto-generated method stub int mat[][] = { {0, 0, 0, 1}, {0, 1, 1, 1}, {1, 1, 1, 1}, {0, 0, 0, 0} }; find(mat); } private static void find(int[][] mat) { int index = -1; for(int i=0;i<mat[0].length;i++){ if(mat[0][i]==1){ index = i-1; } } if(index==-1) index = mat[0].length-1; int max = 0; for(int i=1 ; i<mat.length;i++){ while(index >=0 && mat[i][index]==1 ){ index--; max = i; } } System.out.println(max); } }
[ "somisetty.r@husky.neu.edu" ]
somisetty.r@husky.neu.edu
f92f33d6b6011dc3893dd6d43d1ca302eeb088b9
ebea5491ad8faffb2c8e02f93fbcfbf7c8e5cd76
/src/LC_395_Longest_SubString_K_Repeat_Character.java
6b14b6e9f63c90ff517ea1f348989314f62d741d
[]
no_license
arnabs542/leetcode-13
695e592eca325a84a03f573c80254ecfcdb8af0a
87e57434c1a03d5c606c5c81b7a58c94321bd7c2
refs/heads/master
2022-09-16T07:45:11.732596
2020-05-31T03:50:13
2020-05-31T03:50:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,811
java
/* * Copyright (c) 2020 maoyan.com * All rights reserved. * */ import java.util.Arrays; /** * ๅœจ่ฟ™้‡Œ็ผ–ๅ†™็ฑป็š„ๅŠŸ่ƒฝๆ่ฟฐ * * @author guozhaoliang * @created 20/2/24 */ public class LC_395_Longest_SubString_K_Repeat_Character { /* For each h, apply two pointer technique to find the longest substring with at least K repeating characters and the number of unique characters in substring is h. */ public int longestSubstring(String s, int k) { char[] str = s.toCharArray(); int[] counts = new int[26]; int h, i, j, idx, max = 0, unique, noLessThanK; for (h = 1; h <= 26; h++) { Arrays.fill(counts, 0); i = 0; j = 0; unique = 0; noLessThanK = 0; while (j < str.length) { if (unique <= h) { idx = str[j] - 'a'; if (counts[idx] == 0) unique++; counts[idx]++; if (counts[idx] == k) noLessThanK++; j++; } else { idx = str[i] - 'a'; if (counts[idx] == k) noLessThanK--; counts[idx]--; if (counts[idx] == 0) unique--; i++; } if (unique == h && unique == noLessThanK) { max = Math.max(j - i, max); } } } return max; } /* In each step, just find the infrequent elements (show less than k times) as splits since any of these infrequent elements couldn't be any part of the substring we want. */ public int longestSubstring_2(String s, int k) { if (s == null || s.length() == 0) return 0; char[] chars = new char[26]; // record the frequency of each character for (int i = 0; i < s.length(); i += 1) chars[s.charAt(i) - 'a'] += 1; boolean flag = true; for (int i = 0; i < chars.length; i += 1) { if (chars[i] < k && chars[i] > 0) flag = false; } // return the length of string if this string is a valid string if (flag == true) return s.length(); int result = 0; int start = 0, cur = 0; // otherwise we use all the infrequent elements as splits while (cur < s.length()) { if (chars[s.charAt(cur) - 'a'] < k) { result = Math.max(result, longestSubstring(s.substring(start, cur), k)); start = cur + 1; } cur++; } result = Math.max(result, longestSubstring(s.substring(start), k)); return result; } }
[ "guozhaoliang@meituan.com" ]
guozhaoliang@meituan.com
23db1c1615f5006df59de63f476155729f26b34f
b5e4f6df6863bf32b4b72e4e9c07dcd26fcd20b8
/Java Microservices/Demos/src/com/inheritance/Dog.java
9aac69f0655aefd1c009b943eaf4091140239b97
[]
no_license
anweshpatel/deloitte
39f325e985c75208715e6435717c31d4c4fd6328
6125cfb40c3b6abf903fbe76b5f5de2bb5800fe5
refs/heads/master
2021-07-07T09:48:22.901150
2019-08-09T10:12:15
2019-08-09T10:12:15
196,966,399
0
0
null
2020-10-13T15:12:36
2019-07-15T09:20:17
Java
UTF-8
Java
false
false
183
java
package com.inheritance; public class Dog extends Animal{ public void bark() { System.out.println("Bow bow"); } public void eat() { System.out.println("Dog eats cat"); } }
[ "patel.anwesh@gmail.com" ]
patel.anwesh@gmail.com
9fc2e2ba798a20b2e54209a239ab1ad8efd33822
8f474cfa47a74601180ffeb3332fda7b044f6eda
/TBE/src/ch/tbe/util/FTPFileTreeModel.java
ae025105714440efa140a83a7577f1e69e66e8ee
[]
no_license
BackupTheBerlios/tbe
085e2a5f0f7bbc9e84307cbef60c613259bceea1
2b6ccaa04ab8ff91155e7faf9f5b8887af0f49fe
refs/heads/master
2020-05-20T01:35:27.562662
2007-08-10T13:23:39
2007-08-10T13:23:39
40,070,725
0
0
null
null
null
null
UTF-8
Java
false
false
4,284
java
package ch.tbe.util; import java.util.ArrayList; import javax.swing.event.TreeModelListener; import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; /** * Tactic Board Editor * ********************** * FTPFileTreeModel * * @version 1.0 7/07 * @author Meied4@bfh.ch, Schnl1@bfh.ch, WyssR5@bfh.ch, Zumsr1@bfh.ch * @copyright by BFH-TI, Team TBE /** * The methods in this class allow the JTree component to traverse the file * system tree and display the files and directories. */ public class FTPFileTreeModel implements TreeModel { // We specify the root directory when we create the model. protected PathFile root; /** * @param root PathFile */ public FTPFileTreeModel(PathFile root) { this.root = root; } // The model knows how to return the root object of the tree /* (non-Javadoc) * @see javax.swing.tree.TreeModel#getRoot() */ public Object getRoot() { return root; } // Tell JTree whether an object in the tree is a leaf /* (non-Javadoc) * @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object) */ public boolean isLeaf(Object node) { String nodePath = ((PathFile) node).getPath(); nodePath.replace("\\", "/"); String nodeName = nodePath.substring(nodePath.lastIndexOf("/") + 1, nodePath.length()); if (nodeName.contains(".") && !node.equals(root)) return true; else return false; } // Tell JTree how many children a node has /* (non-Javadoc) * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object) */ public int getChildCount(Object parent) { ArrayList<String> childrenPaths = FTPHandler.getDir(((PathFile) parent).getPath().replace("\\", "/")); ArrayList<String> children = new ArrayList<String>(); for (String s : childrenPaths) { s.replace("\\", "/"); children.add(s.substring(s.lastIndexOf("/") + 1, s.length())); } if (children == null) return 0; return children.size(); } // Fetch any numbered child of a node for the JTree. // Our model returns File objects for all nodes in the tree. The // JTree displays these by calling the File.toString() method. /* (non-Javadoc) * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int) */ public Object getChild(Object parent, int index) { ArrayList<String> childrenPaths = FTPHandler.getDir(((PathFile) parent).getPath().replace("\\", "/")); ArrayList<String> children = new ArrayList<String>(); for (String s : childrenPaths) { s.replace("\\", "/"); children.add(s.substring(s.lastIndexOf("/") + 1, s.length())); } if ((children == null) || (index >= children.size())) return null; return new PathFile((PathFile) parent, children.get(index)); } // Figure out a child's position in its parent node. /* (non-Javadoc) * @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object, java.lang.Object) */ public int getIndexOfChild(Object parent, Object child) { ArrayList<String> childrenPaths = FTPHandler.getDir(((PathFile) parent).getPath().replace("\\", "/")); ArrayList<String> children = new ArrayList<String>(); for (String s : childrenPaths) { s.replace("\\", "/"); children.add(s.substring(s.lastIndexOf("/") + 1, s.length())); } if (children == null) return -1; String childname = ((PathFile) child).getName(); for (int i = 0; i < children.size(); i++) { if (childname.equals(children.get(i))) return i; } return -1; } // This method is invoked by the JTree only for editable trees. // This TreeModel does not allow editing, so we do not implement // this method. The JTree editable property is false by default. /* (non-Javadoc) * @see javax.swing.tree.TreeModel#valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object) */ public void valueForPathChanged(TreePath path, Object newvalue) { } // Since this is not an editable tree model, we never fire any events, // so we don't actually have to keep track of interested listeners /* (non-Javadoc) * @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener) */ public void addTreeModelListener(TreeModelListener l) { } /* (non-Javadoc) * @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener) */ public void removeTreeModelListener(TreeModelListener l) { } }
[ "newsletter" ]
newsletter
0c262b9cef539ce99ea5b94587661082c032b0f4
5f0c353ca1e70f46a4b52b6a189966ebad7c3905
/src/se/opendataexchange/ethernetip4j/HexConverter.java
bec7ce228bab5cdd100db2ca3ffe7ffb9eea36cb
[]
no_license
tuliomagalhaes/Ethernetip4j
0414cadcc4ed6a935f06420bbb799e86fe978835
a0f5e22b927155ef56e9f32e8c0b2997df29f153
refs/heads/master
2021-05-30T07:25:24.745149
2014-07-30T13:43:11
2014-07-30T13:43:11
22,428,727
4
1
null
null
null
null
UTF-8
Java
false
false
2,858
java
package se.opendataexchange.ethernetip4j; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; /*** * Class that contains utility function for conversions to hexadecimal strings. * */ public class HexConverter { private static final char[] HEX_CHAR_ARRAY = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; private static final List<Character> HEX_CHAR_LIST; static { HEX_CHAR_LIST = new ArrayList<Character>(); HEX_CHAR_LIST.add(new Character('0')); HEX_CHAR_LIST.add(new Character('1')); HEX_CHAR_LIST.add(new Character('2')); HEX_CHAR_LIST.add(new Character('3')); HEX_CHAR_LIST.add(new Character('4')); HEX_CHAR_LIST.add(new Character('5')); HEX_CHAR_LIST.add(new Character('6')); HEX_CHAR_LIST.add(new Character('7')); HEX_CHAR_LIST.add(new Character('8')); HEX_CHAR_LIST.add(new Character('9')); HEX_CHAR_LIST.add(new Character('A')); HEX_CHAR_LIST.add(new Character('B')); HEX_CHAR_LIST.add(new Character('C')); HEX_CHAR_LIST.add(new Character('D')); HEX_CHAR_LIST.add(new Character('E')); HEX_CHAR_LIST.add(new Character('F')); } /*** * Converts a byte to a hex string and puts the result in a @link {@link StringBuffer}. * @param b The byte to convert. * @param buf {@link StringBuffer} where the resulting two characters are put. */ public static void byte2hex(byte b, StringBuffer buf) { int high = ((b & 0xf0) >> 4); int low = (b & 0x0f); buf.append(HEX_CHAR_ARRAY[high]); buf.append(HEX_CHAR_ARRAY[low]); } /*** * Converts a byte to a hex string. * @param b The byte to convert. * @return The hex string. */ public static String byte2hex(byte b) { int high = ((b & 0xf0) >> 4); int low = (b & 0x0f); return new String(new char[]{HEX_CHAR_ARRAY[high], HEX_CHAR_ARRAY[low]}); } /*** * Converts a (2 character) string to a hex byte. * @param s The string * @return The byte */ public static byte hex2byte(String s) { int high = HEX_CHAR_LIST.indexOf(new Character(s.charAt(0))) << 4; int low = HEX_CHAR_LIST.indexOf(new Character(s.charAt(1))); return (byte) (high + low); } /*** * Converta a hex string to byte array. * @param hex The hex string. * @return The byte array. */ public static byte[] toByteArray(String hex) { int len = (hex.length() + 1) / 3; byte[] rtn = new byte[len]; for (int i = 0; i < len; i++) { rtn[i] = hex2byte(hex.substring(i * 3, i * 3 + 2)); } return rtn; } /*** * Prints a byte buffer as hex string to {@link System#out} * @param buffer */ public static void printByteBuffer(ByteBuffer buffer){ byte[] b = buffer.array(); for(int i=0 ; i<b.length ; i++){ System.out.print(HexConverter.byte2hex(b[i])+" "); } } }
[ "daniel.biloglav@c045a240-bf45-11de-a759-a54c9d3330c2" ]
daniel.biloglav@c045a240-bf45-11de-a759-a54c9d3330c2
9c5eaf4255a39291b887357479b440bd80321e00
9d1411f9e14e2d015f2dd796bbc1235f1d66c75f
/List/collectionTest1.java
cb4629ae63ae8e70ac113f08d5bd97be18574bb5
[]
no_license
akihiro0119/kensyuu
ff0cbb4a601e7322985e70abdf74843bd0ee43d3
2759f430790795c49b56589a13f585688891a04b
refs/heads/็ ”ไฟฎ
2023-03-14T11:26:26.754302
2021-03-10T09:36:55
2021-03-10T09:36:55
336,141,728
0
0
null
2021-02-15T09:29:11
2021-02-05T02:31:00
Java
UTF-8
Java
false
false
398
java
package List; import java.util.ArrayList; class collectionTest1{ public static void main(String args[]){ ArrayList<String> array = new ArrayList<String>(); array.add("ๆ—ฅๆœฌ"); array.add("ใƒ–ใƒฉใ‚ธใƒซ"); array.add("ใ‚คใƒณใ‚ฐใƒฉใƒณใƒ‰"); array.add("ใƒใƒซใƒˆใ‚ฌใƒซ"); array.add("ใƒ•ใƒฉใƒณใ‚น"); String country = array.get(2); System.out.println(country); } }
[ "aono1x19@gmail.com" ]
aono1x19@gmail.com
35d1b35ae4b9ea3a451286fea177f169be8a99ed
ecf796983785c4e92a1377b3271b5b1cf66a6495
/Projects/NCC_621/app/src/main/java/cn/rongcloud/werewolf/common/factory/dialog/base/CenterDialogFactory.java
8f4f3a8b615321e127c6b28266754a1f230aacb4
[]
no_license
rongcloud-community/RongCloud_Hackathon_2020
1b56de94b470229242d3680ac46d6a00c649c7d6
d4ef61d24cfed142cd90f7d1d8dcd19fb5cbf015
refs/heads/master
2022-07-27T18:24:19.210225
2020-10-16T01:14:41
2020-10-16T01:14:41
286,389,237
6
129
null
2020-10-16T05:44:11
2020-08-10T05:59:35
JavaScript
UTF-8
Java
false
false
615
java
package cn.rongcloud.werewolf.common.factory.dialog.base; import android.app.Dialog; import android.view.Gravity; import android.view.Window; import androidx.fragment.app.FragmentActivity; import cn.rongcloud.werewolf.R; /** * ไปŽไธญ้ƒจๅผนๅ‡บ็š„dialog */ public class CenterDialogFactory implements SealMicDialogFactory { @Override public Dialog buildDialog(FragmentActivity context) { Dialog bottomDialog = new Dialog(context, R.style.BottomDialog); Window dialogWindow = bottomDialog.getWindow(); dialogWindow.setGravity(Gravity.CENTER); return bottomDialog; } }
[ "geekonline@126.com" ]
geekonline@126.com
3ede0827a4aaa9c30257d93431d001daf54ea306
2f9cc69504c75d6c2000d7ff2d13d6ee1fbcdd1c
/src/java/QuizDisplay.java
6a8bfd26305f236245b47b13a1d055f0d289d1e9
[]
no_license
romil-jain/OnlineTest-System
f91b24034e96565619e6e4539400e17f4296a622
b9a8b1624c5e2fd53802f073496b0ee9baab989f
refs/heads/master
2020-03-19T04:08:57.832198
2018-06-02T08:12:45
2018-06-02T08:12:45
135,799,407
0
0
null
null
null
null
UTF-8
Java
false
false
5,063
java
import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class QuizDisplay extends HttpServlet { Connection con; PreparedStatement ps; ResultSet rs; @Override public void init(){ try{ ServletContext context=getServletContext(); String driver=context.getInitParameter("driver-name"); String url=context.getInitParameter("connection-url"); String uid=context.getInitParameter("userid"); String pwd=context.getInitParameter("password"); Class.forName(driver); con=DriverManager.getConnection(url,uid,pwd); //String qr="select uname,acctype from shopusers where userid=? and password=?"; //ps=con.prepareStatement(qr); }catch(Exception e){} } @Override public void destroy(){ try{ con.close(); }catch(Exception e){} } protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { String qr="select pid,qcode,qname,completed from quizinfo;"; // Statement st=con.createStatement(); //rs=st.executeQuery(qr); Statement st = con.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); rs=st.executeQuery(qr); if(rs.next()) { rs.beforeFirst(); //out.println("<table>"); out.println("<table border=1>"); out.println("<tr>"); out.println("<td>"); out.println("Professor Id"); out.println("</td>"); out.println("<td>"); out.println("Quiz Code"); out.println("</td>"); out.println("<td>"); out.println("Quiz Name"); out.println("</td>"); out.println("<td>"); out.println("Status"); out.println("</td>"); out.println("</tr>"); while(rs.next()) { out.println("<tr>"); out.println("<td>"); out.println(rs.getString(1)); out.println("</td>"); out.println("<td>"); out.println(rs.getString(2)); out.println("</td>"); out.println("<td>"); out.println(rs.getString(3)); out.println("</td>"); out.println("<td>"); out.println(rs.getString(4)); out.println("</td>"); out.println("</tr>"); } out.println("</table>"); out.println("<h2><a href=\"AdminHome.jsp\">Home</a></h2>"); } else { out.println("<h2>No Quizes yet</h2>"); out.println("<h2><a href=\"AdminHome.jsp\">Home</a></h2>"); } } catch(Exception e) {} } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "kjromil1997@gmail.com" ]
kjromil1997@gmail.com
00b26fb69d8172a0bfbda52305ce0072059689bc
8453d954801ef539dea4990f8323d1774a0413aa
/่‡ชๅŠจ่ฃ…้…Bean/CDPlayerTest.java
d57d6ab25be0e800d6faa4925d03ebe690c28b2f
[]
no_license
georgezzzh/Spring
c73bcbbb12d48f1befd9aec5d7d782446445181d
4b360a9ffbcb7ec3077cc2a9417f114d66bafd57
refs/heads/master
2023-07-24T05:16:23.746480
2023-07-17T15:01:52
2023-07-17T15:01:52
176,078,564
0
0
null
2023-04-17T17:45:10
2019-03-17T09:08:17
Java
UTF-8
Java
false
false
762
java
package soundsystem; import static org.junit.Assert.*; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; //่ฎพ็ฝฎ่ฟ่กŒ็Žฏๅขƒๆ˜ฏSpring็š„่ฟ่กŒ็Žฏๅขƒ @RunWith(SpringJUnit4ClassRunner.class) //่ฃ…่ฝฝไธŠไธ‹ๆ–‡้…็ฝฎ,้…็ฝฎ็š„ๆ˜ฏCDPlayerConfig็ฑป @ContextConfiguration(classes=CDPlayerConfig.class) public class CDPlayerTest { @Autowired private CompactDisc cd; @Autowired private MediaPlayer player; @Test public void cdShouldNotBeNull(){ assertNotNull(cd); } @Test public void play(){ player.play(); } }
[ "usasne@163.com" ]
usasne@163.com
451177ac9406c224f0c53cefdbc14f35f45d6b25
cded73f81f9a8cbbb3d07c56540c9cd45322b64f
/src/br/com/nervouse/service/ItemService.java
892c39812c1c5a30bfe6c429cb8316eccde18ef8
[]
no_license
alisonmoura/nervouse-desktop
f75cc5ece383fb60bb9ba8814e550b0605566133
c19ca8b0faa30a6ecdf102ec2b457ee729fc5346
refs/heads/master
2021-08-22T06:30:51.402749
2017-11-29T14:29:33
2017-11-29T14:29:33
112,486,258
0
0
null
null
null
null
UTF-8
Java
false
false
130
java
package br.com.nervouse.service; import br.com.nervouse.model.Item; public class ItemService extends ServiceGenerico<Item> { }
[ "alison.oghino@gmail.com" ]
alison.oghino@gmail.com
cc684b9d318c7feb6f2fc207dad43c989bb2ec11
617c940a00ae38886f7afb2b11b12229b3ba0ebe
/FacebookDemo/src/org/iiitb/facebook/dao/AboutDAO.java
b0664a44624e61060646532f099857d2794fb7ff
[]
no_license
nupurgarg1211/FacebookPrototype
783975cd96f9e9f1094247597abbee5deabbadac
c53e3926d3a1ad8a2ee3cb607e7505a1b3d8fd75
refs/heads/master
2021-01-10T05:48:48.716134
2015-12-05T13:31:20
2015-12-05T13:31:20
47,456,716
2
0
null
null
null
null
UTF-8
Java
false
false
1,093
java
package org.iiitb.facebook.dao; import java.util.ArrayList; import org.iiitb.facebook.model.About; import org.iiitb.facebook.model.Education; import org.iiitb.facebook.model.Relationship; import org.iiitb.facebook.model.Work; import org.iiitb.facebook.model.WorkEducation; public interface AboutDAO { public ArrayList<Relationship> getRelations(); public About about_details(String user_id); public ArrayList<Work> work_details(String user_id); public ArrayList<Education> education_details(String user_id); public void update_about_details(String user_id, String first_name, String last_name, String gender,String dob, String mobile,String current_city,String hometown,String address,String relatioship); public void update_we_details(String we_id, String organization, String position, String start_date,String end_date); public WorkEducation get_we_details(String we_id); public boolean addWorkEducation(String userId,String type,String organization,String position,String start_date,String end_date); public boolean deleteWorkEducation(String we_id); }
[ "nupur@nupur-Inspiron-5537.(none)" ]
nupur@nupur-Inspiron-5537.(none)
c031aa76c79868208e2f6c1e6f0dae1e9ae855f0
7dea0650ee3a1725da283179636b8684ddf53c6a
/src/day07_Array/Quiz03.java
51d9edd415b90abf7a820055bf5c2e22450467f0
[]
no_license
leenayoung0/day07_Array
434a13239ca20e162139c642f8c534159835dafb
6913ea6325c6067e0b01417f1dd18e5d79d199bd
refs/heads/master
2023-06-29T13:13:28.394038
2021-08-06T06:00:05
2021-08-06T06:00:05
391,770,632
0
0
null
null
null
null
UHC
Java
false
false
1,785
java
package day07_Array; import java.util.ArrayList; import java.util.Scanner; public class Quiz03 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList name = new ArrayList(); ArrayList phone = new ArrayList(); String n, p, newN, newP; int num, i; while(true) { System.out.println("1.์—ฐ๋ฝ์ฒ˜ ๋“ฑ๋ก"); System.out.println("2.์—ฐ๋ฝ์ฒ˜ ๋ณด๊ธฐ"); System.out.println("3.์—ฐ๋ฝ์ฒ˜ ์‚ญ์ œ"); System.out.println("4.๋ชจ๋“  ์—ฐ๋ฝ์ฒ˜ ๋ณด๊ธฐ"); System.out.println("5.์ข…๋ฃŒ"); System.out.print(">>>"); num = sc.nextInt(); switch(num) { case 1: System.out.print("์ด๋ฆ„ ์ž…๋ ฅ : "); newN = sc.next(); if(name.contains(newN)) { System.out.println("์ด๋ฆ„์ด ์กด์žฌ ํ•ฉ๋‹ˆ๋‹ค"); break; } else name.add(newN); System.out.print("์—ฐ๋ฝ์ฒ˜ ์ž…๋ ฅ : "); newP = sc.next(); phone.add(newP); break; case 2: System.out.print("์ฐพ์„ ์ด๋ฆ„ ์ž…๋ ฅ : "); n = sc.next(); if(name.contains(n)==false) { System.out.println(n+"๋‹˜์€ ๋ชฉ๋ก์— ์—†์Šต๋‹ˆ๋‹ค"); } if(name.contains(n)) { i=name.indexOf(n); System.out.println(name.get(i)+" : "+phone.get(i)); } break; case 3: System.out.println("์‚ญ์ œํ•  ์—ฐ๋ฝ์ฒ˜ ์ด๋ฆ„ ์ž…๋ ฅ : "); n = sc.next(); i = name.indexOf(n); System.out.println(name.remove(i)); System.out.println(phone.remove(i)); System.out.println("์—ฐ๋ฝ์ฒ˜๊ฐ€ ์‚ญ์ œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค"); break; case 4: for(int j=0; j<name.size(); j++) { System.out.println(name.get(j)+" : "+phone.get(j)); } break; case 5: System.out.println("ํ”„๋กœ๊ทธ๋žจ์ด ์ข…๋ฃŒ๋ฉ๋‹ˆ๋‹ค"); System.exit(1); } System.out.println(); } } }
[ "lny950@naver.com" ]
lny950@naver.com
e797e5d6b4f289ab51c085aef9a800efb78f3f24
a98bf80a201d4b735ce5c81f811917295028c2f9
/Web_Based/Spring_Examples/SpringAOP/src/com/aopapp/manager/AirIndiaFlightManager.java
37fa615c753c33f4c15f1f5fe0ce80da1acfe021
[]
no_license
vikhyatK/Misc_Projects
7f338a952668b21392018359c7247e2f34ba57ee
1c0f6fcd5cc2154c7cae5e885c09265979884bb6
refs/heads/master
2021-01-19T03:01:58.119424
2016-06-27T05:44:46
2016-06-27T05:44:46
50,173,921
0
1
null
null
null
null
UTF-8
Java
false
false
151
java
package com.aopapp.manager; import org.springframework.stereotype.Component; @Component public class AirIndiaFlightManager extends FlightManager{ }
[ "vikhyat.kaushik@gmail.com" ]
vikhyat.kaushik@gmail.com
0ce9d12b0d8b08236c3a841f52cdf78662790b66
5f6cf61e1d2a64411837b5353ff9c1f30c204e3d
/src/week4/lesson8/Notepad.java
4deeda7e87200328ed9f0ab101616061672c0e0d
[]
no_license
ShelRoman/OldJava
7d27cb06e313d4099f16abddc5519bc97884a70a
19a19f13a20b2f9f6a38e020d06f976fb0a12ce7
refs/heads/master
2020-03-27T05:29:40.271368
2018-08-24T18:16:01
2018-08-24T18:16:01
146,024,936
0
0
null
null
null
null
UTF-8
Java
false
false
962
java
package week4.lesson8; import java.util.GregorianCalendar; import java.util.ArrayList; public class Notepad { ArrayList<Data> datas = new ArrayList<>(); public class Data { GregorianCalendar date; ArrayList<String> list = new ArrayList<>(); public Data(GregorianCalendar date, String string) { this.date = date; list.add(string); datas.add(this); } } public void add(GregorianCalendar date1, String string) { if (datas.size() > 0) { for (int i = 0; i < datas.size(); i++) { if (datas.get(i).date.equals(date1)) { datas.get(i).list.add(string); } else { new Data(date1, string); break; } } } else { new Data(date1, string); } } public void printByDate(GregorianCalendar date1) { for (int i = 0; i < datas.size(); i++) { if(datas.get(i).date.equals(date1)) { for (int j = 0; j < datas.get(i).list.size(); j++) { System.out.println(datas.get(i).list.get(j)); } } } } }
[ "romanshel17@gmail.com" ]
romanshel17@gmail.com
e701e298f8d882081dff3427968f6ed328faf64f
424f3018174401e9a4ea36588ea6ca98755ca9e7
/src/controller/ModelUpdater.java
476821e93d4a1ccbd6aee1dc19860920b2b36c41
[]
no_license
bakaikin/Grapher
c7325e30554a22510a507e6165a51ca38d276b9c
06a7f5574d2faab7edf1d4420923bc75d208a309
refs/heads/master
2021-03-12T15:05:59.348404
2020-03-11T17:20:42
2020-03-11T17:20:42
246,631,034
0
0
null
2020-03-11T17:02:53
2020-03-11T17:02:52
null
UTF-8
Java
false
false
11,248
java
package controller; import model.Language; import model.help.FullModel; import view.MainPanel; import view.elements.CalculatorView; import view.elements.ElementsList; import view.elements.FunctionsView; import view.elements.TextElement; import view.grapher.graphics.Function; import view.grapher.graphics.Graphic; import view.grapher.graphics.Implicit; import view.grapher.graphics.Parametric; import java.awt.*; import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static java.awt.Color.*; public class ModelUpdater { private static final List<Color> colors = Arrays.asList(BLUE, RED, GREEN, CYAN, magenta, GRAY, ORANGE, PINK, YELLOW, LIGHT_GRAY, BLACK); private static final List<String> func_names = Arrays.asList("f", "i", "j", "l", "m", "n", "o", "q", "r", "s", "bl"); private static final double deltaScale = 1.2; private Calculator calculator; private final SupportFrameManager supportFrameManager; private final MainPanel mainPanel; private final DataBase dataBase; List<Graphic> graphics; ElementsList list; private double offsetX = -3; private double offsetY = 5.5; private double scaleX = 100; private double scaleY = 100; boolean dangerState = false; public ModelUpdater(Runnable repaint, MainPanel mainPanel) { this.mainPanel = mainPanel; supportFrameManager = new SupportFrameManager(this); this.calculator = new Calculator(this, repaint); dataBase = new DataBase(); new Thread(() -> { VersionController.UpdateInfo info = VersionController.checkUpdates(); if (info.version_is_new) { supportFrameManager.openUpdaterFrame(info); } }).start(); } public void addVRemove(ActionEvent e) { if (e.getActionCommand().equals("remove")) { supportFrameManager.close(); remove(e); } else if (e.getActionCommand().equals("add")) { add(e); } else { System.out.println("error " + e.getActionCommand()); } mainPanel.setGraphicsHeight(); } private void add(ActionEvent e) { TextElement element = list.getElements().get(e.getID()); Graphic graphic = new Function(); graphics.add(graphic); element.addTextChangedListener((e1) -> calculator.recalculate()); int id = findFreeId(); graphic.setColor(colors.get(id)); element.setColor(colors.get(id)); element.setName(func_names.get(id) + "(x)"); graphic.name = func_names.get(id); calculator.recalculate(); } void add(String func, String params) { String[] arr = params.split("\n"); String name = arr[0]; int map_size = Integer.parseInt(arr[1]); String type = arr[2]; Graphic gr; switch (type) { case "Function": gr = new Function(map_size); break; case "Parametric": gr = new Parametric(map_size); break; case "Implicit": gr = new Implicit(map_size); break; default: return; } int id = func_names.indexOf(name); gr.setColor(colors.get(id)); graphics.add(gr); gr.name = name; list.addElement(); TextElement e = list.getElements().get(list.getElements().size() - 1); e.setColor(colors.get(id)); e.addTextChangedListener((e1) -> calculator.recalculate()); e.setText(func); switch (type) { case "Function": e.setName(name + "(x)"); break; case "Parametric": e.setName("xy(t)"); String startEnd = arr[3]; String[] st = startEnd.split(":"); ((Parametric) gr).updateBoards(Double.parseDouble(st[0]), Double.parseDouble(st[1])); break; case "Implicit": e.setName(name + "(xy)"); ((Implicit) gr).setSensitivity(Double.parseDouble(arr[3])); break; } } private void remove(ActionEvent e) { graphics.remove(e.getID()); calculator.recalculate(); } public void startSettings(int id) { Graphic g = graphics.get(id); if (g instanceof Function) { supportFrameManager.openFunctionSettings((Function) g, list.getElements().get(id)); } else if (g instanceof Parametric) { supportFrameManager.openParameterSettings((Parametric) g, list.getElements().get(id)); } else if (g instanceof Implicit) { supportFrameManager.openImplicitSettings((Implicit) g, list.getElements().get(id)); } } public void makeFunction(Graphic g, TextElement e) { if (g instanceof Function) return; int idx = graphics.indexOf(g); Function function = new Function(); function.setColor(e.getColor()); graphics.set(idx, function); int id = colors.indexOf(e.getColor()); e.setName(func_names.get(id) + "(x)"); function.name = func_names.get(id); calculator.recalculate(); startSettings(idx); } public void makeParameter(Graphic g, TextElement e) { if (g instanceof Parametric) return; int idx = graphics.indexOf(g); Parametric parametric = new Parametric(); parametric.setColor(e.getColor()); graphics.set(idx, parametric); e.setName("xy(t)"); parametric.name = func_names.get(colors.indexOf(e.getColor())); calculator.recalculate(); startSettings(idx); } public void makeImplicit(Graphic g, TextElement e) { if (g instanceof Implicit) return; int idx = graphics.indexOf(g); Implicit implicit = new Implicit(); implicit.setColor(e.getColor()); graphics.set(idx, implicit); int id = colors.indexOf(e.getColor()); e.setName(func_names.get(id) + "(xy)"); implicit.name = func_names.get(id); calculator.recalculate(); startSettings(idx); } private int findFreeId() { for (int i = 0; i < colors.size() - 1; ++i) { Color c = colors.get(i); boolean hasColor = false; for (TextElement element : list.getElements()) { if (element.getColor() == c) { hasColor = true; break; } } if (!hasColor) return i; } return colors.size() - 1; } public void translate(int dScreenX, int dScreenY) { if (dangerState) return; double dOffsetX = dScreenX / scaleX; double dOffsetY = dScreenY / scaleY; offsetX -= dOffsetX; offsetY += dOffsetY; calculator.runResize(); } public void rescale(double delta, int x, int y, int line) { if (dangerState) return; double deltaX = x / scaleX; double deltaY = y / scaleY; if (line == 0) { scaleX /= Math.pow(deltaScale, delta); scaleY /= Math.pow(deltaScale, delta); offsetX += -x / scaleX + deltaX; offsetY += y / scaleY - deltaY; } else if (line == 1) { scaleX /= Math.pow(deltaScale, delta); offsetX += -x / scaleX + deltaX; } else if (line == 2) { scaleY /= Math.pow(deltaScale, delta); offsetY += y / scaleY - deltaY; } calculator.runResize(); } public void rescaleBack() { if (dangerState) return; double yc = offsetY * scaleY; scaleY = 1 * scaleX; offsetY = yc / scaleY; calculator.runResize(); } public void runResize() { calculator.runResize(); } public void openTimer() { supportFrameManager.openTimerSettings(); } public void frameResize() { calculator.frameResize(); } public void recalculate() { calculator.recalculate(); } public void setStringElements(FunctionsView functions, CalculatorView calculator) { this.calculator.setElements(calculator, functions); } public void setState(String text) { list.setState(text); } public void setResize(Runnable resize) { calculator.setResize(resize); } public double getOffsetX() { return offsetX; } public double getOffsetY() { return offsetY; } public double getScaleX() { return scaleX; } public double getScaleY() { return scaleY; } public void setList(ElementsList list) { this.list = list; } public void setGraphics(ArrayList<Graphic> graphics) { this.graphics = graphics; } public SupportFrameManager getSupportFrameManager() { return supportFrameManager; } public void setTime(double time) { calculator.resetConstant("tm", time); } public void error(String message) { dangerState = true; setState(message); } public void updateLanguage() { mainPanel.updateLanguage(); supportFrameManager.updateLanguage(); } public void dosave(boolean selection, java.io.File f) { if (selection) { calculator.run(() -> { FullModel m = new FullModel(); calculator.makeModel(m); m.view_params = offsetX + "\n" + offsetY + "\n" + scaleX + "\n" + scaleY; mainPanel.makeModel(m); supportFrameManager.getTimer().makeModel(m); setState(dataBase.save(m, f)); }); } else { calculator.run(() -> { try { FullModel m = dataBase.load(f); if (m.graphics.size() != 0) { list.clear(); } calculator.fromModel(m); String[] view_params = m.view_params.split("\n"); offsetX = Double.parseDouble(view_params[0]); offsetY = Double.parseDouble(view_params[1]); scaleX = Double.parseDouble(view_params[2]); scaleY = Double.parseDouble(view_params[3]); mainPanel.fromModel(m); supportFrameManager.getTimer().fromModel(m); if (Language.language_Names.contains(m.language) && Language.language_Names.indexOf(m.language) != Language.LANGUAGE_INDEX) { supportFrameManager.getMainSettings().setLanguage(Language.language_Names.indexOf(m.language)); } supportFrameManager.close(); mainPanel.setGraphicsHeight(); calculator.recalculate(); calculator.run(() -> setState(f.getName() + " " + Language.LOADED)); } catch (Exception e) { setState(e.toString()); } }); } } }
[ "perelman.matvey@gmail.com" ]
perelman.matvey@gmail.com
6c5c561807948fc2d592e8a41619ae6529a38aab
8e8df6ba0d94a0d7176f709ed43ca292330ae9f7
/Test27.java
8d4c676f29e1b9e380d47edebc12c571f2a9c175
[]
no_license
lyzlsz/coding.java
550b3d6e1056c623c134f6b58c3cd3d3eba4c419
9cd4541fc51f35dfe6ad14590df6a4542bc6b8fe
refs/heads/master
2020-04-05T10:52:57.374554
2019-09-03T15:44:35
2019-09-03T15:44:35
156,814,125
1
0
null
null
null
null
UTF-8
Java
false
false
559
java
package Thread; /** * Author:weiwei * description:่ง‚ๅฏŸๆ–ฐ็”ŸไปฃGC * Creat:2019/2/27 **/ public class Test27 { private static final int _1MB = 1024 * 1024; public static void testAllocation() { byte[] allocation1,allocation2,allocation3,allocation4; allocation1 = new byte[2 * _1MB]; allocation2 = new byte[2 * _1MB]; allocation3 = new byte[2 * _1MB]; // ๅ‡บ็ŽฐMinor GC allocation4 = new byte[4 * _1MB]; } public static void main(String[] args) throws Exception{ testAllocation(); } }
[ "1812969441@qq.com" ]
1812969441@qq.com
fdb4828c0e0e68104adc54a17d9648b529379fd2
4cbc89cbc06b0778a5de741ff94d86a38c23fb91
/src/com/taunton/filter/EncodingFilter.java
0ab3960bdfda7e1b7317438356dc4758c46aeb25
[]
no_license
tauntongo/OnlineBookStore
6cf2527968a340c2dae4ab1b5a6f8184549832eb
f69e2cb79c2bb05254028e7afade22682e187015
refs/heads/master
2021-06-26T12:26:28.626557
2017-09-12T13:27:34
2017-09-12T13:52:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,062
java
package com.taunton.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.taunton.web.EncodingRequest; public class EncodingFilter implements Filter{ @Override public void destroy() { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest)request; HttpServletResponse resp = (HttpServletResponse)response; // ่‡ชๅฎšไน‰Request็ฑป๏ผŒ้‡ๅ†™getParmeter(),่งฃๅ†ณ่ฏทๆฑ‚ไนฑ็  EncodingRequest ereq = new EncodingRequest(req); // ่งฃๅ†ณๅ“ๅบ”ไนฑ็  resp.setContentType("text/html;charset=utf-8"); chain.doFilter(ereq, resp); } @Override public void init(FilterConfig filterConfig) throws ServletException { } }
[ "1151416588@qq.com" ]
1151416588@qq.com
ff6ac8f203fa1f646c9c18be32a5de2149d62990
2b51f8913f0e8e44f2fd2ef5d880c4d3601f3de4
/src/main/java/programmers/dfsbfs/dfsbfs2.java
3471e623eb696594866d7583228f6b02c4a1ee89
[]
no_license
youngsangp/study
32ac41729b5aad6cc48c53fb01652aa6a018f009
cad17503df906418fa86b4ea12f5741507c4c863
refs/heads/main
2023-07-15T15:53:18.806010
2021-08-25T11:41:57
2021-08-25T11:41:57
385,291,749
0
0
null
null
null
null
UTF-8
Java
false
false
1,863
java
package programmers.dfsbfs; import java.util.Queue; /* #๋ฌธ์ œ ์„ค๋ช… ๋„คํŠธ์›Œํฌ๋ž€ ์ปดํ“จํ„ฐ ์ƒํ˜ธ ๊ฐ„์— ์ •๋ณด๋ฅผ ๊ตํ™˜ํ•  ์ˆ˜ ์žˆ๋„๋ก ์—ฐ๊ฒฐ๋œ ํ˜•ํƒœ๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ปดํ“จํ„ฐ A์™€ ์ปดํ“จํ„ฐ B๊ฐ€ ์ง์ ‘์ ์œผ๋กœ ์—ฐ๊ฒฐ๋˜์–ด์žˆ๊ณ , ์ปดํ“จํ„ฐ B์™€ ์ปดํ“จํ„ฐ C๊ฐ€ ์ง์ ‘์ ์œผ๋กœ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ์„ ๋•Œ ์ปดํ“จํ„ฐ A์™€ ์ปดํ“จํ„ฐ C๋„ ๊ฐ„์ ‘์ ์œผ๋กœ ์—ฐ๊ฒฐ๋˜์–ด ์ •๋ณด๋ฅผ ๊ตํ™˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ปดํ“จํ„ฐ A, B, C๋Š” ๋ชจ๋‘ ๊ฐ™์€ ๋„คํŠธ์›Œํฌ ์ƒ์— ์žˆ๋‹ค๊ณ  ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ปดํ“จํ„ฐ์˜ ๊ฐœ์ˆ˜ n, ์—ฐ๊ฒฐ์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ ๋‹ด๊ธด 2์ฐจ์› ๋ฐฐ์—ด computers๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ฃผ์–ด์งˆ ๋•Œ, ๋„คํŠธ์›Œํฌ์˜ ๊ฐœ์ˆ˜๋ฅผ return ํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑํ•˜์‹œ์˜ค. #์ œํ•œ์‚ฌํ•ญ ์ปดํ“จํ„ฐ์˜ ๊ฐœ์ˆ˜ n์€ 1 ์ด์ƒ 200 ์ดํ•˜์ธ ์ž์—ฐ์ˆ˜์ž…๋‹ˆ๋‹ค. ๊ฐ ์ปดํ“จํ„ฐ๋Š” 0๋ถ€ํ„ฐ n-1์ธ ์ •์ˆ˜๋กœ ํ‘œํ˜„ํ•ฉ๋‹ˆ๋‹ค. i๋ฒˆ ์ปดํ“จํ„ฐ์™€ j๋ฒˆ ์ปดํ“จํ„ฐ๊ฐ€ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ์œผ๋ฉด computers[i][j]๋ฅผ 1๋กœ ํ‘œํ˜„ํ•ฉ๋‹ˆ๋‹ค. computer[i][i]๋Š” ํ•ญ์ƒ 1์ž…๋‹ˆ๋‹ค. */ public class dfsbfs2 { int[][] network = new int[200][200]; boolean[] visited = new boolean[200]; int MAX_N; int networkCnt = 0; void dfs(int n) { visited[n] = true; System.out.println(n+" "); for(int i=0; i < MAX_N; i++){ if(!visited[i] && network[n][i]!=0){ dfs(i); } } } public int solution(int n, int[][] computers) { MAX_N = n; int answer = 0; for(int r=0; r<MAX_N;r++){ for(int c=0; c<MAX_N; c++){ network[r][c] = computers[r][c]; } } for(int i=0; i<MAX_N; i++){ if(!visited[i]) { dfs(i); networkCnt++; } } answer = networkCnt; return answer; } }
[ "ini6351@gmail.com" ]
ini6351@gmail.com
46a0375610c36ad54c3bb1ecb90e0fb36b8992cf
a7affa498f92a9c65f07cf18a13eb7a7c6c27ee3
/job-interview/src/main/java/array/Demo3.java
21c36f00c2ae6f0e56b93e6d9f92bef501ba4d60
[]
no_license
Fengweiwei/job-interview
d9ce608be906d184d24754c5eb9b7077292568fe
8e2d75408b816311392d9690111b9a791c42710c
refs/heads/master
2021-01-19T22:09:10.300058
2018-01-30T12:39:08
2018-01-30T12:39:08
88,761,374
0
0
null
null
null
null
UTF-8
Java
false
false
1,681
java
package array; /** * Created by fengweiwei on 2017/3/20. * ไน‹ๅญ—ๅฝขๆ‰“ๅฐ็Ÿฉ้˜ต */ public class Demo3 { public static void print(int[][] arr) { int tR = 0; int tC = 0; int dR = 0; int dC = 0; Boolean flag = true; while (tR != arr.length && tC != arr[0].length) { printLine(arr, tR, tC, dR, dC, flag); if (tR >= (arr.length - 1)) { tC++; } else { tR++; } if (dC >= (arr[0].length - 1)) { dR++; } else { dC++; } flag = !flag; } } public static void printLine(int[][] arr, int tR, int tC, int dR, int dC, Boolean flag) { if (tR == dR && tC == dC) { System.out.print(arr[tR][tC] + " "); return; } if (flag) { //้‚ชไธŠๆ‰“ๅฐ int pR = tR; int pC = tC; while (pR != dR && pC != dC) { System.out.print(arr[pR--][pC++] + " "); } System.out.print(arr[dR][dC] + " "); flag = false; } else { //ๆ–œไธ‹ๆ‰“ๅฐ int pR = dR; int pC = dC; while (pR != tR && pC != tC) { System.out.print(arr[pR++][pC--] + " "); } System.out.print(arr[tR][tC] + " "); flag = true; } } public static void main(String[] args) { int[][] arr = { {1, 2, 3, 4} , {5, 6, 7, 8} , {9, 10, 11, 12} }; print(arr); } }
[ "hadexs649@gmail.com" ]
hadexs649@gmail.com
9be828e8d5726936190572e2defd851f7499aac7
37dd9307154055e3b107349810b06a234281ea3b
/src/main/java/com/yishi/bit/calculate/BitUtil.java
5685722650d617e088a93d8c555f699e702e08a2
[]
no_license
yishi2014/tomcatX
58a1e8e2415c9ec65865071e7e08966488f7e360
de8a75377b08115585e1c81707eee55c65d7d4a7
refs/heads/master
2021-07-03T17:27:20.558671
2019-04-18T02:20:51
2019-04-18T02:20:51
115,580,451
0
0
null
null
null
null
UTF-8
Java
false
false
4,428
java
package com.yishi.bit.calculate; import java.io.UnsupportedEncodingException; import java.util.Arrays; public class BitUtil { private static final byte[] INT_BYTES = { (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) 12, (byte) 13, (byte) 14, (byte) 15, (byte) 16, (byte) 17, (byte) 18, (byte) 19, (byte) 20, (byte) 21, (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 27, (byte) 28, (byte) 29, (byte) 30, (byte) 31, (byte) 32, (byte) 33, (byte) 34, (byte) 35, (byte) 36, (byte) 37, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 43, (byte) 44, (byte) 45, (byte) 46, (byte) 47, (byte) 48, (byte) 49, (byte) 50, (byte) 51, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 59, (byte) 60, (byte) 61, (byte) 62, (byte) 63, (byte) 64, (byte) 65, (byte) 66, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 75, (byte) 76, (byte) 77, (byte) 78, (byte) 79, (byte) 80, (byte) 81, (byte) 82, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 91, (byte) 92, (byte) 93, (byte) 94, (byte) 95, (byte) 96, (byte) 97, (byte) 98, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 107, (byte) 108, (byte) 109, (byte) 110, (byte) 111, (byte) 112, (byte) 113, (byte) 114, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) 123, (byte) 124, (byte) 125, (byte) 126, (byte) 127, (byte) -128, (byte) -127, (byte) -126, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -117, (byte) -116, (byte) -115, (byte) -114, (byte) -113, (byte) -112, (byte) -111, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -101, (byte) -100, (byte) -99, (byte) -98, (byte) -97, (byte) -96, (byte) -95, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -85, (byte) -84, (byte) -83, (byte) -82, (byte) -81, (byte) -80, (byte) -79, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -69, (byte) -68, (byte) -67, (byte) -66, (byte) -65, (byte) -64, (byte) -63, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -53, (byte) -52, (byte) -51, (byte) -50, (byte) -49, (byte) -48, (byte) -47, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -37, (byte) -36, (byte) -35, (byte) -34, (byte) -33, (byte) -32, (byte) -31, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -21, (byte) -20, (byte) -19, (byte) -18, (byte) -17, (byte) -16, (byte) -15, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -5, (byte) -4, (byte) -3, (byte) -2, (byte) -1 }; public static byte int2Byte(int i){ if(i>255||i<0){ throw new RuntimeException("can not convert this int to a byte"); } return INT_BYTES[i]; } public static int byte2Int(byte b){ return b&0xff; } public static byte[] getByteFromStr(String str){ if(str==null||str.length()==0) throw new RuntimeException("not a hex string"); if(str.length()%2!=0) throw new RuntimeException("can not parse"); byte[] bytes=new byte[str.length()/2]; for(int i=0;i<bytes.length;i++){ bytes[i]=INT_BYTES[Integer.valueOf(str.substring(2*i, 2*(i+1)),16)]; } return bytes; } //-1:1111 1111 //1111 1111 1111 1111 1111 1111 1111 1111 public static void main(String[] args) throws UnsupportedEncodingException { // System.out.println("่‘ธ".getBytes("utf16")); // System.out.println(Arrays.toString(getByteFromStr("db55dd64"))); // System.out.println(new String(getByteFromStr("db00dd64"),"utf-16be")); // byte b=INT_BYTES[127]; // byte c= (byte) (b+1); // System.out.println(c); // int a=0xe1111111; // System.out.println((a&0xe0000000)==0xe0000000); } }
[ "yishi2018@gmail.com" ]
yishi2018@gmail.com
3834488b6aac6db6468a59ebc531031da216b9f3
bd507b31b0ae44e9d39521bc40c192e5556454bb
/Scarpeo/src/main/java/com/ElTopin/ElTopin.java
6e82613cb0d60fec51a1d17b5171e3628def5a19
[]
no_license
adrianllorian/Scapeo
ea1eb546a4f58ca7d146dc8e34d2dd73aedc5247
2e861a31d6c1cedf951b7243addc47aa19c852ae
refs/heads/master
2023-07-31T07:36:21.508200
2021-09-23T13:40:46
2021-09-23T13:40:46
409,607,755
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
package com.ElTopin; import java.io.IOException; import javax.annotation.PostConstruct; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.context.ConfigurableApplicationContext; import com.ElTopin.Ventanas; @SpringBootApplication public class ElTopin extends Ventanas implements CommandLineRunner{ public static void main(String[] args) throws IOException { //SpringApplication.run(AdrianLlorian1Application.class, args); //new SpringApplicationBuilder(ElTopin.class).headless(false).run(args); SpringApplicationBuilder builder = new SpringApplicationBuilder(ElTopin.class); builder.headless(false); ConfigurableApplicationContext context = builder.run(args); } @Override public void run(String... args) { crearVenatanaInicio(); } }
[ "bochi_felechin@hotmail.com" ]
bochi_felechin@hotmail.com
e7fc050fae9bac092c02c78f5a0ae164f039f83e
4c304a7a7aa8671d7d1b9353acf488fdd5008380
/src/main/java/com/alipay/api/response/AlipayAssetCardTransferResponse.java
463350d779c0ecd58c29ddb15975f54f268319b0
[ "Apache-2.0" ]
permissive
zhaorongxi/alipay-sdk-java-all
c658983d390e432c3787c76a50f4a8d00591cd5c
6deda10cda38a25dcba3b61498fb9ea839903871
refs/heads/master
2021-02-15T19:39:11.858966
2020-02-16T10:44:38
2020-02-16T10:44:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
669
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.asset.card.transfer response. * * @author auto create * @since 1.0, 2019-04-28 14:48:45 */ public class AlipayAssetCardTransferResponse extends AlipayResponse { private static final long serialVersionUID = 4195326663853247731L; /** * ๆ”ฏไป˜ๅฎ่ฎขๅ•id */ @ApiField("asset_order_id") private String assetOrderId; public void setAssetOrderId(String assetOrderId) { this.assetOrderId = assetOrderId; } public String getAssetOrderId( ) { return this.assetOrderId; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
32b75f68f8bcf8b1a0a61587a86150608df94baf
8918ff17443a495bc79da569f37c3ead4a234e63
/app/src/main/java/com/coolweather/coolweather/MainActivity.java
cbfa6c38029af25e40ad56dc2f0e30a0977f443b
[ "MIT" ]
permissive
liurenfeng007/coolweather
0a630dea72896b7b3ad447bd330edeccf5fe697d
09668afc7e24d9f0fdeb3ec2afb885c1fba38c90
refs/heads/main
2023-03-12T01:44:14.854199
2021-02-25T11:17:35
2021-02-25T11:17:35
302,837,524
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.coolweather.coolweather; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // GreenDao } }
[ "840614181@qq.com" ]
840614181@qq.com
ff93f0615741cd1f9911a6e3a43ee5f5fc21bc1f
27ecf6708d5830853f4d04cc1904ca6729e69986
/Android/DrawerLayout_/app/src/main/java/com/vstrizhakov/drawerlayout_/MainActivity.java
68d73206852c19aca54bf71b460868788614c18c
[]
no_license
vstrizhakov/itstep_works
722218a074ff9ceb2bd1ea9a6b91ff76c5f63f3d
2f3d32967b18a6918d11b12b5210db1116b55b70
refs/heads/master
2021-09-22T07:15:53.175056
2021-09-20T19:17:11
2021-09-20T19:17:11
132,743,674
1
0
null
null
null
null
UTF-8
Java
false
false
323
java
package com.vstrizhakov.drawerlayout_; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "vladimir.strizhakov@touchcast.com" ]
vladimir.strizhakov@touchcast.com
16f21782bd6a3a58aa4314734a804595a3a63bde
90fe8613626a754052e10f6dc6876991d2467767
/src/main/java/by/epamtc/information_handling/service/impl/TextServiceImpl.java
ef70d01a318a70634574d4133ec5222d5a0cf7ab
[]
no_license
4ertya/InformationHandling
64542e21b95adfaa59d966201763af30333e120e
d2bac94d30c3f478bb93b4fafb8d3bbce11d2e45
refs/heads/master
2022-11-23T15:15:22.309689
2020-07-30T18:28:53
2020-07-30T18:28:53
283,283,745
0
0
null
null
null
null
UTF-8
Java
false
false
1,805
java
package by.epamtc.information_handling.service.impl; import by.epamtc.information_handling.bean.Component; import by.epamtc.information_handling.bean.Sentence; import by.epamtc.information_handling.bean.SentenceComponent; import by.epamtc.information_handling.bean.Text; import by.epamtc.information_handling.service.TextService; import java.util.Comparator; import java.util.List; public class TextServiceImpl implements TextService { @Override public void printSentencesForTheNumberOfWords(Text text) { List<Sentence> sentences = text.getSentences(); sentences.sort(Comparator.comparing(Sentence::getWordsSize)); for (Sentence sentence : sentences) { System.out.println(sentence.getStringView()); } } @Override public void replaceWordsWithSubstring(Text text, int sentenceIndex, int wordsLength, String substring) { Sentence sentence = text.getSentence(sentenceIndex); List<Component> sentenceComponents = sentence.getWords(); for (int i = 0; i < sentenceComponents.size(); i++) { if (sentenceComponents.get(i).getStringView().length() == wordsLength) { sentenceComponents.set(i, new SentenceComponent(substring)); } } System.out.println(sentence.getStringView()); } @Override public void replaceFirstWithLastInSentences(Text text) { List<Sentence> sentences = text.getSentences(); for (Sentence sentence : sentences) { List<Component> words = sentence.getWords(); Component temp = words.get(0); words.set(0, words.get(words.size() - 1)); words.remove(words.size() - 1); words.add(temp); System.out.println(sentence.getStringView()); } } }
[ "palchmail@gmail.com" ]
palchmail@gmail.com
2afce0d0c2f2efa5920fe305b8f2723d22210c0b
304ee11190d570dff9d57c0d75a3905ee9019458
/Week9 - Composite and Flyweight/src/ro/ase/csie/cts/g1094/dp/flyweight/ModelFlyweightActions.java
1d9250e42b044374b9261f2c1f1d9d45930509cd
[ "Apache-2.0" ]
permissive
popoviciandreea/CTS_Laboratory
b944e676372db52cf13011b828389da617f1676f
95b1d39963bbe135a7ab6c98e3eb5ef021b9dde6
refs/heads/main
2023-05-09T15:46:24.723379
2021-05-25T12:30:17
2021-05-25T12:30:17
341,555,290
0
0
null
null
null
null
UTF-8
Java
false
false
154
java
package ro.ase.csie.cts.g1094.dp.flyweight; public interface ModelFlyweightActions { public void loadModel(); public void display(ScreenData data); }
[ "andr.popovici98@yahoo.com" ]
andr.popovici98@yahoo.com
3dbccf68a7b12ff806e247e912fdd478408a04d6
33a4190f67fd994d5a8eb043b7dc74175ca39f2f
/app/src/main/java/com/example/admin/style/Cart.java
10cbaa66d26ecb455d695dcb48d003d0034f6ef3
[]
no_license
internick13/Style
d25c093eca9d4a3150297412c9ba48836232c5b7
502364ba6069df9f0ef05dba8e916dc6ae8cfb64
refs/heads/master
2020-09-23T15:11:54.143490
2019-12-03T04:07:56
2019-12-03T04:07:56
225,528,176
0
0
null
null
null
null
UTF-8
Java
false
false
4,161
java
package com.example.admin.style; import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.example.admin.style.Common.Common; import com.example.admin.style.Database.Database; import com.example.admin.style.Model.Order; import com.example.admin.style.Model.Request; import com.example.admin.style.ViewHolder.CartAdapter; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; import java.util.Locale; import info.hoang8f.widget.FButton; public class Cart extends AppCompatActivity { RecyclerView recyclerView; RecyclerView.LayoutManager layoutManager; TextView txtTotalPrice; FButton btnPlace; FirebaseDatabase database; DatabaseReference requests; List<Order> cart = new ArrayList<>(); CartAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cart); database = FirebaseDatabase.getInstance(); requests = database.getReference("Request"); recyclerView = findViewById(R.id.listCart); recyclerView.setHasFixedSize(true); layoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(layoutManager); txtTotalPrice = findViewById(R.id.total); btnPlace = findViewById(R.id.btnPlaceOrder); btnPlace.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showAlertDialog(); } }); loadListProducts(); } private void showAlertDialog() { AlertDialog.Builder alertDialog = new AlertDialog.Builder(Cart.this); alertDialog.setTitle("One more Step"); alertDialog.setTitle("Enter your address"); final EditText edtAddress = new EditText(Cart.this); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT ); edtAddress .setLayoutParams(lp); alertDialog.setView(edtAddress); alertDialog.setIcon(R.drawable.ic_shopping_cart_black_24dp); alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Request request = new Request(Common.currentUser.getPhone(), Common.currentUser.getName(), edtAddress.getText().toString(), txtTotalPrice.getText().toString(),cart); requests.child(String.valueOf(System.currentTimeMillis())).setValue(request); new Database(getBaseContext()).cleanCart(); Toast.makeText(Cart.this, "Thanks order placed", Toast.LENGTH_SHORT).show(); finish(); } }); alertDialog.setNegativeButton("NO", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); alertDialog.show(); } private void loadListProducts() { cart = new Database(this).getCarts(); adapter = new CartAdapter(cart,this); recyclerView.setAdapter(adapter); int total = 0; for(Order order:cart) total += (Integer.parseInt(order.getPrice())) * (Integer.parseInt(order.getQuantity())); Locale locale = new Locale("en", "US"); NumberFormat fmt = NumberFormat.getCurrencyInstance(locale); txtTotalPrice.setText(fmt.format(total)); } }
[ "internick18@gmail.com" ]
internick18@gmail.com
2a0a036ae2b0a635580be2948229d0d0da6a62fc
e15787ae2b0abf289d9b2ac1345c9287f6174fdf
/Imooc-Ad-master/imooc-ad/imooc-ad-service/ad-common/src/main/java/com/imooc/ad/exception/AdException.java
bc419ed7fcd53c2be82a1c21452a1d7ae0002c16
[]
no_license
1151674616/Reptile
fe6ca2bec327c850877e3be825b58a14f47b1e87
e495be87a7ce85f7ee69800c1277dccd5eb2a9b4
refs/heads/master
2020-05-05T11:18:17.258639
2019-04-25T10:36:50
2019-04-25T10:36:50
179,984,240
2
0
null
null
null
null
UTF-8
Java
false
false
139
java
package com.imooc.ad.exception; public class AdException extends Exception{ public AdException(String message){ super(message); } }
[ "30339213+1151674616@users.noreply.github.com" ]
30339213+1151674616@users.noreply.github.com
3fe5e51ea258ef7e6f8fb07d8f4f314b9298e631
834c5325f316d3a69180c22f55dd33b7092804f6
/info-service/src/test/java/pl/adrian/infoservice/InfoServiceApplicationTests.java
25035873513366c62fcdfb866e4bdccf6116d827
[]
no_license
frsknalexis/movie-microservices-app
53eede64385b52c1ee992fc6d1478e42434050ac
e979ea420af7ad5fc0ba595462cd52475fede09d
refs/heads/master
2022-12-25T19:33:23.694963
2020-09-26T09:09:21
2020-09-26T09:09:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package pl.adrian.infoservice; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class InfoServiceApplicationTests { @Test void contextLoads() { } }
[ "skillexe10@o2.pl" ]
skillexe10@o2.pl
efb8cf0e04d8554a2eeb447c7983951c2057a367
1aa56309a2b41714b2e65363de4aa59e9aaaa008
/carbon-4.4.0/carbon4-kernel/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/app/OMElementResponseContext.java
10dc76571931d7d23cb35298cc212bb2b7400997
[]
no_license
imesh/stratos-membership-scheme
815a07c258f0310926879289ba514d78cfb13ef4
c7214d16b9a3581db7fdad82dff93b2daae41602
refs/heads/master
2020-04-15T22:49:46.154577
2015-08-11T06:01:42
2015-08-11T06:01:42
38,881,878
0
1
null
null
null
null
UTF-8
Java
false
false
2,168
java
/* * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) 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 org.wso2.carbon.registry.app; import org.apache.abdera.protocol.server.context.SimpleResponseContext; import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.registry.core.exceptions.RegistryException; import java.io.IOException; import java.io.Writer; import java.net.HttpURLConnection; /** * This is an extension of the {@link SimpleResponseContext} in Abdera. This is used in Dump * requests. */ public class OMElementResponseContext extends SimpleResponseContext { private Registry registry; private String path; /** * Creates response context. * * @param registry the registry. * @param path the resource path. */ public OMElementResponseContext(Registry registry, String path) { this.registry = registry; this.path = path; setStatus(HttpURLConnection.HTTP_OK); } /** * Method to dump the registry content in to the writer. * * @param writer the Writer connected to the HTTP response * * @throws IOException if an error occurred. */ protected void writeEntity(Writer writer) throws IOException { try { registry.dump(path, writer); } catch (RegistryException e) { throw new IOException("Failed in dumping the path " + path + ".", e); } } /** * Whether the response contains an entity. * * @return true if the response contains an entity */ public boolean hasEntity() { return true; } }
[ "imesh@apache.org" ]
imesh@apache.org
341e7ef35d6b3b948d0380278c497ed364d106c1
344012f7d7d40844bda14a2eb8b9e277f1d4ce97
/arthas-modules/arthas-core/src/main/java/com/arthas/core/utils/ArthasBanner.java
bf605e0facd22ec7773b37fa1ef6b58d00a45c40
[ "MIT" ]
permissive
quyixiao/tiny-arthas
d85ff15ae4944be61fa8f66f6426f8daf2c94fa3
720e15b194084f85c5b5e67624ed6747d17b2eec
refs/heads/master
2023-02-17T01:30:12.774477
2021-01-19T12:46:56
2021-01-19T12:46:56
330,977,014
0
0
null
null
null
null
UTF-8
Java
false
false
3,557
java
package com.arthas.core.utils; import com.arthas.core.shell.ShellServerOptions; import java.io.InputStream; /** * @author beiwei30 on 16/11/2016. */ public class ArthasBanner { private static final String LOGO_LOCATION = "/com/taobao/arthas/core/res/logo.txt"; private static final String CREDIT_LOCATION = "/com/taobao/arthas/core/res/thanks.txt"; private static final String VERSION_LOCATION = "/com/taobao/arthas/core/res/version"; private static final String WIKI = "https://alibaba.github.io/arthas"; private static final String TUTORIALS = "https://alibaba.github.io/arthas/arthas-tutorials"; private static String LOGO = "Welcome to Arthas"; private static String VERSION = "unknown"; private static String THANKS = ""; static { try { String logoText = IOUtils.toString(ShellServerOptions.class.getResourceAsStream(LOGO_LOCATION)); THANKS = IOUtils.toString(ShellServerOptions.class.getResourceAsStream(CREDIT_LOCATION)); InputStream versionInputStream = ShellServerOptions.class.getResourceAsStream(VERSION_LOCATION); if (versionInputStream != null) { VERSION = IOUtils.toString(versionInputStream).trim(); } else { String implementationVersion = ArthasBanner.class.getPackage().getImplementationVersion(); if (implementationVersion != null) { VERSION = implementationVersion; } } StringBuilder sb = new StringBuilder(); String[] LOGOS = new String[6]; int i = 0, j = 0; for (String line : logoText.split("\n")) { sb.append(line); sb.append("\n"); if (i++ == 4) { LOGOS[j++] = sb.toString(); i = 0; sb.setLength(0); } } /* TableElement logoTable = new TableElement(); logoTable.row(label(LOGOS[0]).style(Decoration.bold.fg(Color.red)), label(LOGOS[1]).style(Decoration.bold.fg(Color.yellow)), label(LOGOS[2]).style(Decoration.bold.fg(Color.cyan)), label(LOGOS[3]).style(Decoration.bold.fg(Color.magenta)), label(LOGOS[4]).style(Decoration.bold.fg(Color.green)), label(LOGOS[5]).style(Decoration.bold.fg(Color.blue))); LOGO = RenderUtil.render(logoTable);*/ } catch (Throwable e) { e.printStackTrace(); } } public static String wiki() { return WIKI; } public static String tutorials() { return TUTORIALS; } public static String credit() { return THANKS; } public static String version() { return VERSION; } public static String logo() { return LOGO; } public static String plainTextLogo() { /*return RenderUtil.ansiToPlainText(LOGO);*/ return ""; } public static String welcome() { /* logger.info("arthas version: " + version()); TableElement table = new TableElement().rightCellPadding(1) .row("wiki", wiki()) .row("tutorials", tutorials()) .row("version", version()) .row("pid", PidUtils.currentPid()) .row("time", DateUtils.getCurrentDate()); return logo() + "\n" + RenderUtil.render(table);*/ return ""; } }
[ "2621048238@qq.com" ]
2621048238@qq.com
8d328a1878ac8c8d3acbe0c9c1baafff9538c1ca
53983754f54a20bf46e81174d069365d6cd1ff4c
/Form/src/main/java/org/itstep/StartServlet.java
02a6fc354108bcc5a11f699e9dfe6c8f95bda67c
[]
no_license
perederiy/Form
1010da11c36da485818420272c5aa8285f732b1c
07d2dc1d1444bad36968a2fd0003b9d025acc32e
refs/heads/master
2020-03-27T11:19:19.179029
2018-08-30T08:20:54
2018-08-30T08:20:54
146,479,049
0
0
null
null
null
null
UTF-8
Java
false
false
653
java
package org.itstep; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/") public class StartServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static String pages = "/WEB-INF/pages/MyPages.html"; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getRequestDispatcher(pages).forward(request, response); } }
[ "hp@172.21.213.161" ]
hp@172.21.213.161
8a697c16767902d5d53ef5c9529e9763e403870d
4196305da535b8a7bf43781afe4ab0e2fe613cea
/src/main/java/inno/edu/api/domain/skill/models/dtos/mappers/CreateSkillRequestMapper.java
7c17b7421d22b84dd0959bb75954b9893f8befd2
[]
no_license
gustavodomenico/inno-api
3ac2b3f294e6dc60e960da9de224785250ae3ea6
319ff4b3ff092942f384a42ad478f686340e6ba8
refs/heads/master
2020-05-25T04:16:21.853648
2018-02-01T01:44:14
2018-02-01T01:44:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
310
java
package inno.edu.api.domain.skill.models.dtos.mappers; import inno.edu.api.domain.skill.models.dtos.CreateSkillRequest; import inno.edu.api.domain.skill.models.Skill; import org.mapstruct.Mapper; @Mapper public interface CreateSkillRequestMapper { Skill toSkill(CreateSkillRequest createSkillRequest); }
[ "gustavo_di_domenico@gap.com" ]
gustavo_di_domenico@gap.com
46031df99f83f559aa6b346e9894dde48c10c8bd
35f5553bd44787c8c7d614ed8a9aba0ff7882ccc
/src/cn/zxk/pojo/TCustomerExample.java
7f952262b256992e0847c4f730ebd0ed6e958ed3
[]
no_license
zxk20125/-Graduation_project_fontend
c0be83799298a8e7a0173d07db919019bb992a9b
ec80028ca4c93013f634e31cc6a59b36c43b1bd9
refs/heads/main
2023-04-19T07:23:28.143030
2021-04-16T07:55:38
2021-04-16T07:55:38
358,516,101
0
0
null
null
null
null
UTF-8
Java
false
false
25,022
java
package cn.zxk.pojo; import java.util.ArrayList; import java.util.List; public class TCustomerExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public TCustomerExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andCustomerIdIsNull() { addCriterion("customer_id is null"); return (Criteria) this; } public Criteria andCustomerIdIsNotNull() { addCriterion("customer_id is not null"); return (Criteria) this; } public Criteria andCustomerIdEqualTo(Integer value) { addCriterion("customer_id =", value, "customerId"); return (Criteria) this; } public Criteria andCustomerIdNotEqualTo(Integer value) { addCriterion("customer_id <>", value, "customerId"); return (Criteria) this; } public Criteria andCustomerIdGreaterThan(Integer value) { addCriterion("customer_id >", value, "customerId"); return (Criteria) this; } public Criteria andCustomerIdGreaterThanOrEqualTo(Integer value) { addCriterion("customer_id >=", value, "customerId"); return (Criteria) this; } public Criteria andCustomerIdLessThan(Integer value) { addCriterion("customer_id <", value, "customerId"); return (Criteria) this; } public Criteria andCustomerIdLessThanOrEqualTo(Integer value) { addCriterion("customer_id <=", value, "customerId"); return (Criteria) this; } public Criteria andCustomerIdIn(List<Integer> values) { addCriterion("customer_id in", values, "customerId"); return (Criteria) this; } public Criteria andCustomerIdNotIn(List<Integer> values) { addCriterion("customer_id not in", values, "customerId"); return (Criteria) this; } public Criteria andCustomerIdBetween(Integer value1, Integer value2) { addCriterion("customer_id between", value1, value2, "customerId"); return (Criteria) this; } public Criteria andCustomerIdNotBetween(Integer value1, Integer value2) { addCriterion("customer_id not between", value1, value2, "customerId"); return (Criteria) this; } public Criteria andCustomerNameIsNull() { addCriterion("customer_name is null"); return (Criteria) this; } public Criteria andCustomerNameIsNotNull() { addCriterion("customer_name is not null"); return (Criteria) this; } public Criteria andCustomerNameEqualTo(String value) { addCriterion("customer_name =", value, "customerName"); return (Criteria) this; } public Criteria andCustomerNameNotEqualTo(String value) { addCriterion("customer_name <>", value, "customerName"); return (Criteria) this; } public Criteria andCustomerNameGreaterThan(String value) { addCriterion("customer_name >", value, "customerName"); return (Criteria) this; } public Criteria andCustomerNameGreaterThanOrEqualTo(String value) { addCriterion("customer_name >=", value, "customerName"); return (Criteria) this; } public Criteria andCustomerNameLessThan(String value) { addCriterion("customer_name <", value, "customerName"); return (Criteria) this; } public Criteria andCustomerNameLessThanOrEqualTo(String value) { addCriterion("customer_name <=", value, "customerName"); return (Criteria) this; } public Criteria andCustomerNameLike(String value) { addCriterion("customer_name like", value, "customerName"); return (Criteria) this; } public Criteria andCustomerNameNotLike(String value) { addCriterion("customer_name not like", value, "customerName"); return (Criteria) this; } public Criteria andCustomerNameIn(List<String> values) { addCriterion("customer_name in", values, "customerName"); return (Criteria) this; } public Criteria andCustomerNameNotIn(List<String> values) { addCriterion("customer_name not in", values, "customerName"); return (Criteria) this; } public Criteria andCustomerNameBetween(String value1, String value2) { addCriterion("customer_name between", value1, value2, "customerName"); return (Criteria) this; } public Criteria andCustomerNameNotBetween(String value1, String value2) { addCriterion("customer_name not between", value1, value2, "customerName"); return (Criteria) this; } public Criteria andCustomerLoginNameIsNull() { addCriterion("customer_login_name is null"); return (Criteria) this; } public Criteria andCustomerLoginNameIsNotNull() { addCriterion("customer_login_name is not null"); return (Criteria) this; } public Criteria andCustomerLoginNameEqualTo(String value) { addCriterion("customer_login_name =", value, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameNotEqualTo(String value) { addCriterion("customer_login_name <>", value, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameGreaterThan(String value) { addCriterion("customer_login_name >", value, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameGreaterThanOrEqualTo(String value) { addCriterion("customer_login_name >=", value, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameLessThan(String value) { addCriterion("customer_login_name <", value, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameLessThanOrEqualTo(String value) { addCriterion("customer_login_name <=", value, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameLike(String value) { addCriterion("customer_login_name like", value, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameNotLike(String value) { addCriterion("customer_login_name not like", value, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameIn(List<String> values) { addCriterion("customer_login_name in", values, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameNotIn(List<String> values) { addCriterion("customer_login_name not in", values, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameBetween(String value1, String value2) { addCriterion("customer_login_name between", value1, value2, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerLoginNameNotBetween(String value1, String value2) { addCriterion("customer_login_name not between", value1, value2, "customerLoginName"); return (Criteria) this; } public Criteria andCustomerPasswordIsNull() { addCriterion("customer_password is null"); return (Criteria) this; } public Criteria andCustomerPasswordIsNotNull() { addCriterion("customer_password is not null"); return (Criteria) this; } public Criteria andCustomerPasswordEqualTo(String value) { addCriterion("customer_password =", value, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordNotEqualTo(String value) { addCriterion("customer_password <>", value, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordGreaterThan(String value) { addCriterion("customer_password >", value, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordGreaterThanOrEqualTo(String value) { addCriterion("customer_password >=", value, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordLessThan(String value) { addCriterion("customer_password <", value, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordLessThanOrEqualTo(String value) { addCriterion("customer_password <=", value, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordLike(String value) { addCriterion("customer_password like", value, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordNotLike(String value) { addCriterion("customer_password not like", value, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordIn(List<String> values) { addCriterion("customer_password in", values, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordNotIn(List<String> values) { addCriterion("customer_password not in", values, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordBetween(String value1, String value2) { addCriterion("customer_password between", value1, value2, "customerPassword"); return (Criteria) this; } public Criteria andCustomerPasswordNotBetween(String value1, String value2) { addCriterion("customer_password not between", value1, value2, "customerPassword"); return (Criteria) this; } public Criteria andCustomerAgeIsNull() { addCriterion("customer_age is null"); return (Criteria) this; } public Criteria andCustomerAgeIsNotNull() { addCriterion("customer_age is not null"); return (Criteria) this; } public Criteria andCustomerAgeEqualTo(Integer value) { addCriterion("customer_age =", value, "customerAge"); return (Criteria) this; } public Criteria andCustomerAgeNotEqualTo(Integer value) { addCriterion("customer_age <>", value, "customerAge"); return (Criteria) this; } public Criteria andCustomerAgeGreaterThan(Integer value) { addCriterion("customer_age >", value, "customerAge"); return (Criteria) this; } public Criteria andCustomerAgeGreaterThanOrEqualTo(Integer value) { addCriterion("customer_age >=", value, "customerAge"); return (Criteria) this; } public Criteria andCustomerAgeLessThan(Integer value) { addCriterion("customer_age <", value, "customerAge"); return (Criteria) this; } public Criteria andCustomerAgeLessThanOrEqualTo(Integer value) { addCriterion("customer_age <=", value, "customerAge"); return (Criteria) this; } public Criteria andCustomerAgeIn(List<Integer> values) { addCriterion("customer_age in", values, "customerAge"); return (Criteria) this; } public Criteria andCustomerAgeNotIn(List<Integer> values) { addCriterion("customer_age not in", values, "customerAge"); return (Criteria) this; } public Criteria andCustomerAgeBetween(Integer value1, Integer value2) { addCriterion("customer_age between", value1, value2, "customerAge"); return (Criteria) this; } public Criteria andCustomerAgeNotBetween(Integer value1, Integer value2) { addCriterion("customer_age not between", value1, value2, "customerAge"); return (Criteria) this; } public Criteria andCustomerSexIsNull() { addCriterion("customer_sex is null"); return (Criteria) this; } public Criteria andCustomerSexIsNotNull() { addCriterion("customer_sex is not null"); return (Criteria) this; } public Criteria andCustomerSexEqualTo(String value) { addCriterion("customer_sex =", value, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexNotEqualTo(String value) { addCriterion("customer_sex <>", value, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexGreaterThan(String value) { addCriterion("customer_sex >", value, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexGreaterThanOrEqualTo(String value) { addCriterion("customer_sex >=", value, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexLessThan(String value) { addCriterion("customer_sex <", value, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexLessThanOrEqualTo(String value) { addCriterion("customer_sex <=", value, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexLike(String value) { addCriterion("customer_sex like", value, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexNotLike(String value) { addCriterion("customer_sex not like", value, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexIn(List<String> values) { addCriterion("customer_sex in", values, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexNotIn(List<String> values) { addCriterion("customer_sex not in", values, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexBetween(String value1, String value2) { addCriterion("customer_sex between", value1, value2, "customerSex"); return (Criteria) this; } public Criteria andCustomerSexNotBetween(String value1, String value2) { addCriterion("customer_sex not between", value1, value2, "customerSex"); return (Criteria) this; } public Criteria andCustomerPhoneIsNull() { addCriterion("customer_phone is null"); return (Criteria) this; } public Criteria andCustomerPhoneIsNotNull() { addCriterion("customer_phone is not null"); return (Criteria) this; } public Criteria andCustomerPhoneEqualTo(String value) { addCriterion("customer_phone =", value, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneNotEqualTo(String value) { addCriterion("customer_phone <>", value, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneGreaterThan(String value) { addCriterion("customer_phone >", value, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneGreaterThanOrEqualTo(String value) { addCriterion("customer_phone >=", value, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneLessThan(String value) { addCriterion("customer_phone <", value, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneLessThanOrEqualTo(String value) { addCriterion("customer_phone <=", value, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneLike(String value) { addCriterion("customer_phone like", value, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneNotLike(String value) { addCriterion("customer_phone not like", value, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneIn(List<String> values) { addCriterion("customer_phone in", values, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneNotIn(List<String> values) { addCriterion("customer_phone not in", values, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneBetween(String value1, String value2) { addCriterion("customer_phone between", value1, value2, "customerPhone"); return (Criteria) this; } public Criteria andCustomerPhoneNotBetween(String value1, String value2) { addCriterion("customer_phone not between", value1, value2, "customerPhone"); return (Criteria) this; } public Criteria andIdCardNoIsNull() { addCriterion("id_card_no is null"); return (Criteria) this; } public Criteria andIdCardNoIsNotNull() { addCriterion("id_card_no is not null"); return (Criteria) this; } public Criteria andIdCardNoEqualTo(String value) { addCriterion("id_card_no =", value, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoNotEqualTo(String value) { addCriterion("id_card_no <>", value, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoGreaterThan(String value) { addCriterion("id_card_no >", value, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoGreaterThanOrEqualTo(String value) { addCriterion("id_card_no >=", value, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoLessThan(String value) { addCriterion("id_card_no <", value, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoLessThanOrEqualTo(String value) { addCriterion("id_card_no <=", value, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoLike(String value) { addCriterion("id_card_no like", value, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoNotLike(String value) { addCriterion("id_card_no not like", value, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoIn(List<String> values) { addCriterion("id_card_no in", values, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoNotIn(List<String> values) { addCriterion("id_card_no not in", values, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoBetween(String value1, String value2) { addCriterion("id_card_no between", value1, value2, "idCardNo"); return (Criteria) this; } public Criteria andIdCardNoNotBetween(String value1, String value2) { addCriterion("id_card_no not between", value1, value2, "idCardNo"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "781309842@qq.com" ]
781309842@qq.com
fb1833a9f4f317546ddfce75b9dad96684ad7ff4
ad9a75db5b93db38e7eac60a72466a96d2ec7b87
/app/src/main/java/com/ashish/myteam/RegisterTeam.java
445ecd493d2b4e592c17bee11c091e24ad574e64
[]
no_license
iiitasingh/myTeam-Mysql
3868aa52ceef70bf88db1e756f8baa821d3b8071
1e384c9e255fe5fbbe653786c14e8358a15ea5db
refs/heads/master
2020-05-31T12:24:16.024016
2019-06-04T21:27:46
2019-06-04T21:27:46
190,279,668
0
0
null
2019-06-04T21:33:30
2019-06-04T21:08:51
Java
UTF-8
Java
false
false
6,020
java
package com.ashish.myteam; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import com.kosalgeek.genasync12.AsyncResponse; import com.kosalgeek.genasync12.ExceptionHandler; import com.kosalgeek.genasync12.PostResponseAsyncTask; import java.util.HashMap; import de.hdodenhof.circleimageview.CircleImageView; public class RegisterTeam extends AppCompatActivity { EditText teamN, email, pin; Button registerbutton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register_team); teamN = (EditText) findViewById(R.id.registerTeamName); email = (EditText) findViewById(R.id.registerTeamEmail); pin = (EditText) findViewById(R.id.registerTeamPin); registerbutton = (Button) findViewById(R.id.button_register); // registerbutton.setOnClickListener(new View.OnClickListener() { // @Override // public void onClick(View v) { // String teamname = teamN.getText().toString().trim(); // String mail = email.getText().toString().trim(); // String pn = pin.getText().toString().trim(); // // if (teamname.length() != 0 && mail.length() != 0 && pn.length() >= 4) { // boolean res1 = db1.checkteamname(teamname); // if (res1) { // Toast.makeText(RegisterTeam.this, "Team already exist", Toast.LENGTH_SHORT).show(); // } else { // boolean res = db1.checkregisteringEmail(mail); // if (res) { // Toast.makeText(RegisterTeam.this, "You already registered a Team", Toast.LENGTH_SHORT).show(); // } else { // long val = db1.addTeam(teamname.toUpperCase(), mail, pn); // if (val > 0) { // Toast.makeText(RegisterTeam.this, "Registration successful", Toast.LENGTH_SHORT).show(); // Intent moveselectTeam = new Intent(RegisterTeam.this, teamSelection.class); // startActivity(moveselectTeam); // } else { // Toast.makeText(RegisterTeam.this, "Registration Failed", Toast.LENGTH_SHORT).show(); // } // } // } // // } // else { // if (teamname.length() < 1){ // Toast.makeText(RegisterTeam.this, "Team name should not be null", Toast.LENGTH_SHORT).show(); // } // else if (mail.length() < 1) { // Toast.makeText(RegisterTeam.this, "Mail should not be null", Toast.LENGTH_SHORT).show(); // } // else { // Toast.makeText(RegisterTeam.this, "Team Pin should have at least 4 Characters", Toast.LENGTH_SHORT).show(); // } // } // // // } // }); } public void registerTeam(View view) { String teamname = teamN.getText().toString().trim(); String mail = email.getText().toString().trim(); String pn = pin.getText().toString().trim(); String type = "register_team"; if (teamname.length() >= 2 && mail.length() >= 5 && pn.length() >= 4) { HashMap<String, String> loginData = new HashMap<>(); loginData.put("teamname", teamname.toUpperCase()); loginData.put("email", mail); loginData.put("pin", pn); PostResponseAsyncTask loginTask = new PostResponseAsyncTask(this, loginData, new AsyncResponse() { @Override public void processFinish(String s) { if (s.contains("TeamPresent")) { Toast.makeText(RegisterTeam.this, "Team already exist", Toast.LENGTH_SHORT).show(); } else if (s.contains("mailPresent")) { Toast.makeText(RegisterTeam.this, "You already registered a Team", Toast.LENGTH_SHORT).show(); } else if (s.contains("ErrorInsert")) { Toast.makeText(RegisterTeam.this, "Registration Failed", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(RegisterTeam.this, "Registration successful", Toast.LENGTH_SHORT).show(); Intent moveselectTeam = new Intent(RegisterTeam.this, teamSelection.class); startActivity(moveselectTeam); } } }); loginTask.setExceptionHandler(new ExceptionHandler() { @Override public void handleException(Exception e) { if (e != null && e.getMessage() != null) { Toast.makeText(getApplicationContext(), "" + e.getMessage(), Toast.LENGTH_LONG).show(); } } }); loginTask.execute("https://voteforashish.000webhostapp.com/myTeam/registerTeam.php"); } else { if (teamname.length() < 2){ Toast.makeText(RegisterTeam.this, "Team name is too short", Toast.LENGTH_SHORT).show(); } else if (mail.length() < 5) { Toast.makeText(RegisterTeam.this, "Mail is too short", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(RegisterTeam.this, "Team Pin should have at least 4 Characters", Toast.LENGTH_SHORT).show(); } } } }
[ "Singh@31" ]
Singh@31
314751ed058cebd1a72cfbd81671da4c85f49903
df79868546b5f372e74f5ad4e12462a35da713ce
/app/src/main/java/tud/cnlab/wifriends/profilepage/BaseHome.java
b347a3b95fed7c3da59338e8ecae27d0a5d39ac8
[]
no_license
Vpvel/WifiDirect
55cf62f68ba1170f41db50c404a1dbb4c5a7b2ff
b331518c7a29a2d4bbdcad28ab5581bdaf30ee7e
refs/heads/master
2021-05-07T16:22:50.911737
2015-03-10T10:49:43
2015-03-10T10:49:43
108,553,573
3
0
null
2017-10-27T14:04:34
2017-10-27T14:04:34
null
UTF-8
Java
false
false
2,234
java
package tud.cnlab.wifriends.profilepage; import android.os.Bundle; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; import tud.cnlab.wifriends.R; public class BaseHome extends ActionBarActivity { public Toolbar toolbar; NavigationDrawerFragment drawerFragment; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(getLayout()); toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayShowHomeEnabled(true); drawerFragment = (NavigationDrawerFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_navigation_drawer); drawerFragment.setUp(R.id.fragment_navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), toolbar); } public int getLayout() { return R.layout.activity_base_home; } @Override public void onBackPressed() { if (!(drawerFragment.closeDrawer())) { super.onBackPressed(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_home_screen, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml.. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { if (id == R.id.action_settings) { Toast.makeText(this, "Hey you just hit " + item.getTitle(), Toast.LENGTH_SHORT).show(); return true; } } return super.onOptionsItemSelected(item); } }
[ "harinigunabalan24@gmail.com" ]
harinigunabalan24@gmail.com
57cdf6785f777024b48cf6437da10935adc83a9b
cf99486e02909449cc8130ae730f25d60fa47f79
/AndroidSharedCarAppDemo-main/resultMap/app/src/main/java/com/example/resultmap/ChattingData.java
bc025871af4078e59f2f3246986da449da93ede0
[]
no_license
LeastKIds/TaZo
8a290e82fb8ef5869433c4611e2343f19eaf1524
116c4ce81359d94bb6f847bb4779c68d79fab204
refs/heads/master
2023-06-06T11:32:15.053548
2021-06-18T18:11:11
2021-06-18T18:11:11
371,887,219
0
1
null
null
null
null
UTF-8
Java
false
false
1,442
java
package com.example.resultmap; public class ChattingData { private String profile; private String nickName; private String chattingText; private String myName; private int inOut; private int imgCheck; public ChattingData(String profile, String nickName, String chattingText, String myName, int inOut, int imgCheck) { this.profile = profile; this.nickName = nickName; this.chattingText = chattingText; this.myName = myName; this.inOut = inOut; this.imgCheck=imgCheck; } public String getProfile() { return profile; } public void setProfile(String profile) { this.profile = profile; } public String getNickName() { return nickName; } public void setNickName(String nickName) { this.nickName = nickName; } public String getChattingText() { return chattingText; } public void setChattingText(String chattingText) { this.chattingText = chattingText; } public void setMyName(String myName) { this.myName = myName; } public String getMyName() { return myName; } public void setInOut(int inOut) { this.inOut = inOut; } public int getInOut() { return inOut; } public void setImgCheck(int imgCheck) { this.imgCheck = imgCheck; } public int getImgCheck() { return imgCheck; } }
[ "leastkids@gmail.com" ]
leastkids@gmail.com