blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
463bf9b223f414dd622cf889fc46beef46423a18 | fd5aedc16fb28d35b26721068f34b84d2d8f6d44 | /java/ItemBean.java | 63849e983daf6872f77da24b28b52af1f6ea80e2 | [] | no_license | Yangpengtao/RecyclerViewAdapter | f5289e391531b15b22efbef3f62a4d528d1165fa | fb81c992ee82cb1271f9caaef315f80f7056571f | refs/heads/master | 2021-01-23T09:25:36.058748 | 2017-09-06T07:51:19 | 2017-09-06T07:51:19 | 102,577,162 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 179 | java | package shain.ypt.com.recyclerviewadapter;
/**
* Created by admin on 2017/9/5.
*/
public class ItemBean {
public String name;
public int resId=R.mipmap.ic_launcher;
}
| [
"[email protected]"
] | |
60f1359a2bea0eeaef547ecd9a5439fa1d77f902 | 4411498438a5c9991ab56bc80b9ea560170d2a40 | /app/src/test/java/com/root/dailybugle/ExampleUnitTest.java | a7384b1ec33d82a04f377df775fa2c5a5ac3d74a | [] | no_license | fayaz07/DailyBugle | 4fb292fe74e962284ae7dc86ed4890d56d886036 | cabbad90cd5d20e6da28ac746829f3c4e799137d | refs/heads/master | 2020-08-16T14:58:35.996558 | 2019-10-17T04:12:45 | 2019-10-17T04:12:45 | 215,515,022 | 0 | 0 | null | 2020-06-26T10:59:37 | 2019-10-16T09:57:29 | Java | UTF-8 | Java | false | false | 380 | java | package com.root.dailybugle;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
adcbf44a295a5ea32933a331e5ee949d5fce9e89 | 6ed44cd81f98b22369751ba32a5611e4a738e04b | /src/test/java/com/weborders/pages/BasePage.java | d4a8f86c4d9d556480436ca0bf0c900c9f223a5e | [] | no_license | Alikomania/WebOrdersAutomationSpring2020 | 94af3164f686c86a9672f3a1aefe10bdc192ec08 | 92b7c28dd80dbff436c6c50a0a12f582e9ff413c | refs/heads/master | 2023-05-13T06:17:15.732255 | 2020-07-08T20:57:01 | 2020-07-08T20:57:01 | 279,942,906 | 0 | 0 | null | 2023-05-09T18:29:57 | 2020-07-15T18:11:12 | Java | UTF-8 | Java | false | false | 599 | java | package com.weborders.pages;
import com.weborders.utilities.Driver;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.WebDriverWait;
public abstract class BasePage {
//explicit wait
//will be used inside every page class
//since this variable is protected
//it will not be visible in test classes
protected WebDriverWait wait = new WebDriverWait(Driver.getDriver(), 20);
public BasePage() {
//we put this line to be able to use @FindBy, @FindBys.. annotations
PageFactory.initElements(Driver.getDriver(), this);
}
}
| [
"[email protected]"
] | |
6a2b302ba5097b5df4b901274b2e94b5270881b6 | ef7f1a7a41702f68d593fea01d153a095ce28afb | /Privacy_preserving_Mobile/WEB-INF/src/com/globaldata/Global.java | 673209ebf220b2d31fa59be5b6b8d4bbd03e99d4 | [] | no_license | yash296/FinalYearProject2018 | 31c430d6c0674428cd3a2e78e1c5714adab0158d | 12137597121c172d4e663413ed1f70a7b977fa50 | refs/heads/master | 2020-03-25T04:43:31.804801 | 2018-08-19T07:53:50 | 2018-08-19T07:53:50 | 143,410,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 648 | java | package com.globaldata;
public interface Global
{
// Database Related Constants
public static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
public static final String JDBC_HOST_URL_WITH_DBNAME = "jdbc:mysql://localhost:3306/dm_privacy_preserving_mobile_cloud";
public static final String DATABASE_USERNAME = "root";
public static final String DATABASE_PASSWORD = "root";
/*public static final String SERVER1 = "ftp.drivehq.com";
public static final String FTP_USER1 = "blrstore1";
public static final String FTP_PASS1 = "*blrstore123";*/
public static final int threshold = 50;
public static final double consPoints = 5;
}
| [
"[[email protected]]"
] | |
20fee09bc121accadb5849537fe01368e9794311 | 37498bbe30a1acdf5fb58af7311eeb0efda72126 | /src/com/sap/effective/BigIntegerExample.java | 8e82529cdea85f62498e4de46d92fc8607344947 | [] | no_license | RRoggia/effective-java-improving-your-java-code | 497d08c520d98b0ae1471b438f1ef3cfd5c0d59e | 4c69a981a4f116fc193c56b867a9f99b82e1b0ec | refs/heads/master | 2020-03-12T10:21:45.239260 | 2018-05-03T13:51:09 | 2018-05-03T13:51:09 | 130,571,479 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | package com.sap.effective;
import java.math.BigInteger;
import java.util.Random;
public class BigIntegerExample {
public static void main(String[] args) {
BigInteger integer = new BigInteger(10, 10, new Random());
System.out.println(integer);
BigInteger probablePrime = BigInteger.probablePrime(10, new Random());
System.out.println(probablePrime);
}
}
| [
"[email protected]"
] | |
19cf9d5601dbed140acea98125d0cccf942815ae | 45a36b2898e6eaec5151abc67927e3a1631fd5f0 | /MobileSafe/app/src/main/java/com/dengyi/mobilesafe/view/SettingItemView.java | 5fdd73e2c59659514d9c96e0e8c0304742a1e892 | [] | no_license | dengyi1992/MobileSafe | 14b713836d3dca50f7d9597f795274eb2f4aa3e8 | 39876dcc60dbde6bdd0f79734c96f6187da1790f | refs/heads/master | 2021-01-10T11:58:10.768204 | 2015-11-20T03:00:12 | 2015-11-20T03:00:12 | 46,337,002 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,535 | java | package com.dengyi.mobilesafe.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.CheckBox;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.dengyi.mobilesafe.R;
/**
* 设置自定义控件
* Created by deng on 2015/11/16.
*/
public class SettingItemView extends RelativeLayout{
private TextView tvTitle;
private TextView tvDesc;
private CheckBox cbStatus;
public SettingItemView(Context context) {
super(context);
initView();
}
public SettingItemView(Context context, AttributeSet attrs) {
super(context, attrs);
initView();
}
public SettingItemView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView();
}
/**
* 初始化bujv
*/
private void initView(){
//将SettingItemView设置当前自定义的
View.inflate(getContext(), R.layout.view_setting_item,this);
tvTitle = (TextView) findViewById(R.id.tv_title);
tvDesc = (TextView) findViewById(R.id.tv_desc);
cbStatus=(CheckBox) findViewById(R.id.cb_status);
}
public void setTitle(String title){
tvTitle.setText(title);
}
public void setDesc(String desc){
tvDesc.setText(desc);
}
public boolean isChecked(){
return cbStatus.isChecked();
}
public void setChecked(boolean check){
cbStatus.setChecked(check);
}
}
| [
"[email protected]"
] | |
16295fe37039844d372515fc2ecf0ebdab2d4877 | 71d9d399906101b9919d0fa024c0f67e7a7d0f32 | /src/main/java/com/app/repository/PersistenceAuditEventRepository.java | 39a5064dcf037a92d678a8d71f6bd5c312fdf673 | [] | no_license | BulkSecurityGeneratorProject/Role-Based-CRUD-App | 4050b11813649466c3c8a24af909d6ec7393c633 | e188ffb7c2d4f15804b5ca8cfb4dfad80bf8925d | refs/heads/master | 2022-12-22T11:00:31.759527 | 2017-03-25T04:20:55 | 2017-03-25T04:20:55 | 296,672,772 | 0 | 0 | null | 2020-09-18T16:22:48 | 2020-09-18T16:22:47 | null | UTF-8 | Java | false | false | 990 | java | package com.app.repository;
import com.app.domain.PersistentAuditEvent;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import java.time.LocalDateTime;
import java.util.List;
/**
* Spring Data JPA repository for the PersistentAuditEvent entity.
*/
public interface PersistenceAuditEventRepository extends JpaRepository<PersistentAuditEvent, Long> {
List<PersistentAuditEvent> findByPrincipal(String principal);
List<PersistentAuditEvent> findByAuditEventDateAfter(LocalDateTime after);
List<PersistentAuditEvent> findByPrincipalAndAuditEventDateAfter(String principal, LocalDateTime after);
List<PersistentAuditEvent> findByPrincipalAndAuditEventDateAfterAndAuditEventType(String principle, LocalDateTime after, String type);
Page<PersistentAuditEvent> findAllByAuditEventDateBetween(LocalDateTime fromDate, LocalDateTime toDate, Pageable pageable);
}
| [
"[email protected]"
] | |
d618971082f1384584613da4e2cf315019da45df | 3ff0594bfd12ffa59d2957e67b101e30bde32c97 | /src/com/creating/www/beans/IFactory.java | b10d88aff5781c7e268888dc2fbc51f77eb1ae7d | [] | no_license | hack0303/JPONENGINE | 5a102be4584cdcf7f4f6640a77de37e34d6517b6 | d9154c0c7e6e8ed6a8efa8df0f98de4c8c5c1d76 | refs/heads/master | 2020-04-07T15:25:48.806340 | 2018-12-04T12:09:34 | 2018-12-04T12:09:34 | 158,484,749 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 217 | java | /**
*
*/
package com.creating.www.beans;
/**
* @author Chack Yao
* @firstcreatetime 2018年11月30日
*
*/
public interface IFactory<IN,OUT> {
public OUT newTarget(IN in);
public void clear();
}
| [
"[email protected]"
] | |
bbf0e566bc529fc1e97d266e121b3bd2f8ca4e07 | cd4a84e590ea5d63ffda6d28b49492d0fcef7af0 | /project/quick-mail/src/main/java/com/wujk/mail/sendcloud/exception/SCException.java | c5f1004b1124e383829bbad079f7888e780488aa | [] | no_license | wujk/quick-boot | c7dd1a401d05371898aee35d8818e20c7970f56d | 09cc27896e8ffa7bf46b5c13ecd466fb00d55680 | refs/heads/master | 2020-03-22T15:18:01.254988 | 2019-07-18T12:01:26 | 2019-07-18T12:01:26 | 140,241,858 | 0 | 0 | null | 2019-11-02T16:23:24 | 2018-07-09T06:37:54 | Java | UTF-8 | Java | false | false | 106 | java | package com.wujk.mail.sendcloud.exception;
public interface SCException {
public String getMessage();
} | [
"[email protected]"
] | |
a9704b8bbb9d304b8490e14ecb8cac83b30b35cb | 8a04e80ec64bc41e5dc9ce2b2f9a797bda3b5020 | /app/src/androidTest/java/com/example/siddh/talktry/ExampleInstrumentedTest.java | 767f4a91c0ee6f8933f1fd43f7b9a1f1daeabe41 | [] | no_license | sid-jain5/Android-chat-app | 458af2815d72cf4dfec4735c1fe3cf8e08a8b8ac | e2c34e9527ac578e3723d712880a0fbac8097734 | refs/heads/master | 2020-03-17T02:57:44.085520 | 2018-05-13T07:24:00 | 2018-05-13T07:24:00 | 133,213,731 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 777 | java | package com.example.siddh.talktry;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.siddh.talktry", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
df874dee09dc8736e727e326b013422087b4b7c0 | 4bebeee291d3d93686ba8f73254d08d58eeafe32 | /Introduction/src/whileForClicking.java | a1ddabc109942c221f214cf860b7ba1ec67333fa | [] | no_license | asiamar/seleniumCourse | f9352568a57d3091314f9742164215a40ccc820a | f639f2f3ce002d77deafef0e4d7ff121b64dea22 | refs/heads/main | 2023-03-02T18:20:10.764675 | 2021-02-06T17:09:22 | 2021-02-06T17:09:22 | 336,587,501 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 987 | java | import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
public class whileForClicking {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "C:\\Users\\jmariasik\\work\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("https://www.spicejet.com");
Thread.sleep(6000L);
System.out.println(driver.findElement(By.id("divpaxinfo")).getText());
driver.findElement(By.id("divpaxinfo")).click();
Select s = new Select (driver.findElement(By.id("ctl00_mainContent_ddl_Adult")));
s.selectByValue("2");
System.out.println(driver.findElement(By.id("divpaxinfo")).getText());
/*int i = 1;
while (i<6)
{
driver.findElement(By.xpath("//div[@class='_9a071_2tnYy _9a071_3I3EK _9a071_gW37L']")).click();
i++;
}
*/
}
}
| [
"[email protected]"
] | |
42387eb260114f26d83b9104f932de727e4b6d41 | 500d90d851d54a19a45a89bb40b6c27cf3b72040 | /uppertester/src/main/java/net/gcdc/uppertester/BtpTriggerResult.java | f5d707cfc071a35fdb0987910d9c3eaf21c9ae77 | [
"Apache-2.0"
] | permissive | Heuvendw/geonetworking | 826fe16712599801cf33b2c4c6ea4716fd82757d | 92b469728d6051183b65d8a359915f804ffa15e3 | refs/heads/master | 2021-01-21T01:11:18.038326 | 2016-05-24T10:46:59 | 2016-05-24T10:46:59 | 41,854,900 | 1 | 0 | null | 2015-09-03T10:50:57 | 2015-09-03T10:50:57 | null | UTF-8 | Java | false | false | 245 | java | package net.gcdc.uppertester;
public class BtpTriggerResult implements Response {
byte messageType = 0x61;
byte result;
public BtpTriggerResult(byte result) {
this.result = result;
}
public BtpTriggerResult() {}
}
| [
"[email protected]"
] | |
fbfee8f60206a9be16e02550b26666b669f5a305 | 3e7f52c2c04da38217d1b448b639197ac7252a04 | /app/src/main/java/com/AWM/awmtest4/Registro.java | e52d71187a94fe1e9ff0c2cb0d4347857fad0cd4 | [] | no_license | rafaeld7/awmtest4 | 55ad1b6fe2a997e6abb3436d3f1c5c45e30b227d | 83680072706d27f95ff1537742ec2148c0a72451 | refs/heads/master | 2020-06-30T00:28:03.421822 | 2019-08-28T21:57:42 | 2019-08-28T21:57:42 | 200,667,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,485 | java | package com.AWM.awmtest4;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.toolbox.Volley;
import org.json.JSONException;
import org.json.JSONObject;
public class Registro extends AppCompatActivity implements View.OnClickListener {
EditText etnombre, etcorreo, etcontrasena, ettelefono;
Button btn_guardar;
@SuppressLint("WrongViewCast")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registro);
//Cancelar
final Button btn_cancelar = (Button) findViewById(R.id.btn_cancelar);
btn_cancelar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
//boton guardar
btn_guardar = findViewById(R.id.btn_guardar);
btn_guardar.setOnClickListener(this);
}
@Override
public void onClick(View view) {
final String nombre=etnombre.getText().toString();
final String correo=etcorreo.getText().toString();
final String contrasena=etcontrasena.getText().toString();
final String telefono=ettelefono.getText().toString();
Response.Listener<String> responListener = new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONObject JsonReponse = new JSONObject(response);
boolean SUCCES = JsonReponse.getBoolean("SUCCES");
if(SUCCES) {
Intent intent = new Intent(Registro.this,MainActivity.class);
Registro.this.startActivity(intent);
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(Registro.this);
builder.setMessage("ERROR en el Registro").setNegativeButton("Retry",null).create().show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
};
}
} | [
"[email protected]"
] | |
c4251bd61fcfe5fdbe354bd9b1173bada6c1782e | 128f107f4d0880ff5b941dd29e11aed7027ae8ee | /app/src/main/java/com/tallerii/match/core/query/http/connections/HttpPutConnection.java | 71c5633c19d9cd8158b705f99c48dd634f423a3e | [] | no_license | FedeGB/7552-TDPII-Match | bc0dddf72d376695681fcab978fdfcbb0c1f621f | 8ca613777610bea2829a592d0107ab62b249d832 | refs/heads/master | 2021-01-21T04:33:24.369406 | 2016-07-06T23:31:12 | 2016-07-06T23:31:12 | 54,745,507 | 0 | 0 | null | 2016-04-12T13:56:41 | 2016-03-25T20:22:54 | Java | UTF-8 | Java | false | false | 1,193 | java | package com.tallerii.match.core.query.http.connections;
import org.json.JSONObject;
import java.io.IOException;
import java.net.HttpURLConnection;
/**
* Created by Demian on 26/05/2016.
*/
public class HttpPutConnection extends HttpConnection {
private JSONObject body = new JSONObject();
public HttpPutConnection(HttpResponseListener listener, String calledBy) {
super(listener, calledBy);
}
public void addBody(JSONObject body){
this.body = body;
}
@Override
public HttpURLConnection buildRequestStructure(String baseURL) {
try {
HttpURLConnection httpURLConnection = createConnection(baseURL);
httpURLConnection.setRequestMethod("PUT");
byte[] array = body.toString().getBytes();
httpURLConnection.setDoOutput(true);
httpURLConnection.setRequestProperty("Content-Length", Integer.toString(array.length));
httpURLConnection.getOutputStream().write(array);
httpURLConnection.getOutputStream().close();
return httpURLConnection;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
| [
"[email protected]"
] | |
b05441084e271144e1b41e772388403c68d96edb | 0c0a6e4ab692385d205911e384432e1414327a87 | /src/cn/java/jerrymice/util/MiniBrowser.java | 06167076c06f6b59f4ad0fdbf619832ad22c5e31 | [
"Apache-2.0"
] | permissive | xsliu2018/Jerrymice | a21e4a657a4b43171ef20383f84a24c3e21fefea | 4fdd92e676fbac9021877e76c5d312cf43979cf2 | refs/heads/master | 2022-12-23T09:00:45.183001 | 2020-09-22T11:43:18 | 2020-09-22T11:43:18 | 283,203,663 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,219 | java | package cn.java.jerrymice.util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* @author :xiaosong
* @description:模拟实现一个小型的浏览器,通过这个浏览器与服务器进行通信
* @date :2020/7/28 21:22
*/
public class MiniBrowser {
public static void main(String[] args){
String url = "http://static.how2j.cn/diytomcat.html";
String contentString = getContentString(url);
System.out.println(contentString);
String httpString = getHttpString(url);
System.out.println(httpString);
}
public static String getContentString(String url){
return getContentString(url, false);
}
public static String getContentString(String url, boolean gzip){
byte[] result = getContentBytes(url, gzip);
if (result == null) {
return null;
}
return new String(result, StandardCharsets.UTF_8).trim();
}
/**
*
* @param url:访问的链接地址
* @return byte[]:一个字节数组,是二进制的http的响应内容,可以简单理解为去掉头的html部分
*/
public static byte[] getContentBytes(String url){
return getContentBytes(url, false);
}
public static byte[] getContentBytes(String url, boolean gzip){
byte[] response = getHttpBytes(url, gzip);
byte[] doubleReturn = "\r\n\r\n".getBytes();
int pos = -1;
for (int i = 0; i< response.length - doubleReturn.length; i++) {
byte[] temp = Arrays.copyOfRange(response, i, i + doubleReturn.length);
if (Arrays.equals(temp, doubleReturn)) {
pos = i;
break;
}
}
if (pos == -1){
return null;
}
pos += doubleReturn.length;
return Arrays.copyOfRange(response, pos, response.length);
}
public static String getHttpString(String url, boolean gzip) {
byte[] bytes = getHttpBytes(url, gzip);
return new String(bytes).trim();
}
public static String getHttpString(String url) {
return getHttpString(url, false);
}
public static byte[] getHttpBytes(String url, boolean gzip){
byte[] result;
try {
URL u = new URL(url);
Socket clientSocket = new Socket();
int port = u.getPort();
if (port == -1) {
port = 80;
}
InetSocketAddress inetSocketAddress = new InetSocketAddress(u.getHost(), port);
clientSocket.connect(inetSocketAddress, 1000);
Map<String, String> requestHeaders = new HashMap<>();
requestHeaders.put("Host", u.getHost() + ":" + port);
requestHeaders.put("Accept","text/html");
requestHeaders.put("Connection", "close");
requestHeaders.put("User-Agent", "mini browser/jdk1.8.0_251");
if (gzip) {
requestHeaders.put("Accept-Encoding", "gzip");
}
String path = u.getPath();
if (path.length() == 0 ){
path = "/";
}
String firstLine = "GET " + path + " HTTP/1.1\r\n";
StringBuffer httpRequestString = new StringBuffer();
httpRequestString.append(firstLine);
Set<String> headers = requestHeaders.keySet();
for (String header: headers) {
String headerLine = header + ":" + requestHeaders.get(header) + "\r\n";
httpRequestString.append(headerLine);
}
// 通过clientSocket向服务器传输请求request
PrintWriter printWriter = new PrintWriter(clientSocket.getOutputStream(), true);
printWriter.println(httpRequestString);
// 通过clientSocket从服务器获取response,浏览器的输入流
InputStream inputStream = clientSocket.getInputStream();
result = readBytes(inputStream);
clientSocket.close();
}catch(Exception e) {
e.printStackTrace();
result = e.toString().getBytes(StandardCharsets.UTF_8);
}
return result;
}
public static byte[] readBytes(InputStream inputStream) throws IOException {
int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
while(true) {
int length = inputStream.read(buffer);
if (length == -1) {
// read函数返回-1说明已经读到尾部, 否则返回读到的字符个数
break;
}
byteArrayOutputStream.write(buffer, 0, length);
if (length != bufferSize){
//表明buffer空间没有被读满,说明也没有下文了
break;
}
}
return byteArrayOutputStream.toByteArray();
}
}
| [
"[email protected]"
] | |
31670194a95012090212ca339f15f072f4d30ee1 | 42c03d6bf0b93ddc7a59ad9b1511917baf3d6ede | /test/src/thread/test/Product.java | 5f3dd720a212dea258137c8f138d96c6482ebd8b | [] | no_license | shouwangwm/shouwang | 5c61b290ab04ccb8007e3ae15b048f50d4ffa29d | 1ea258505b083ae86927dee23e0c0811ba0b2e30 | refs/heads/master | 2021-01-11T04:55:12.736540 | 2017-05-09T09:38:47 | 2017-05-09T09:38:47 | 71,417,411 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 325 | java | package thread.test;
public class Product extends Thread {
@Override
public void run() {
while(true){
try {
Storage.queue.put(new Object());
System.out.println(Thread.currentThread().getName() + " == " + Storage.queue.size());
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
| [
"[email protected]"
] | |
3f902c558baa4f1782b3e0bd4d14f1ca2d8fba3c | 561c90126820bcb5d4746bf51ea8e1814dfb50c8 | /wecard-protocol/src/main/java/com/ninelook/wecard/protocol/apis/ApiHeroMessage.java | c2f5e7e420b017ecf57b74a69ca2d840ee9e985c | [
"MIT"
] | permissive | kouweizhong/wecard-server | 402e99c1103e49cb61a7de3195e313db3d185dff | 9e6a2e1ace06086123200f14c2540e944dc76a5e | refs/heads/master | 2021-04-03T05:38:02.691179 | 2017-08-17T07:59:11 | 2017-08-17T07:59:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 24,370 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: apis/ApiHeroMessage.proto
package com.ninelook.wecard.protocol.apis;
public final class ApiHeroMessage {
private ApiHeroMessage() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface SReqHeroMoveOrBuilder extends
// @@protoc_insertion_point(interface_extends:SReqHeroMove)
com.google.protobuf.MessageOrBuilder {
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
boolean hasHeroPosInfo();
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo getHeroPosInfo();
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfoOrBuilder getHeroPosInfoOrBuilder();
}
/**
* Protobuf type {@code SReqHeroMove}
*
* <pre>
*英雄移动
* </pre>
*/
public static final class SReqHeroMove extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:SReqHeroMove)
SReqHeroMoveOrBuilder {
// Use SReqHeroMove.newBuilder() to construct.
private SReqHeroMove(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private SReqHeroMove(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final SReqHeroMove defaultInstance;
public static SReqHeroMove getDefaultInstance() {
return defaultInstance;
}
public SReqHeroMove getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private SReqHeroMove(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
initFields();
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.Builder subBuilder = null;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
subBuilder = heroPosInfo_.toBuilder();
}
heroPosInfo_ = input.readMessage(com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(heroPosInfo_);
heroPosInfo_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000001;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ninelook.wecard.protocol.apis.ApiHeroMessage.internal_static_SReqHeroMove_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ninelook.wecard.protocol.apis.ApiHeroMessage.internal_static_SReqHeroMove_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove.class, com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove.Builder.class);
}
public static com.google.protobuf.Parser<SReqHeroMove> PARSER =
new com.google.protobuf.AbstractParser<SReqHeroMove>() {
public SReqHeroMove parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new SReqHeroMove(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<SReqHeroMove> getParserForType() {
return PARSER;
}
private int bitField0_;
public static final int HEROPOSINFO_FIELD_NUMBER = 1;
private com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo heroPosInfo_;
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public boolean hasHeroPosInfo() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo getHeroPosInfo() {
return heroPosInfo_;
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfoOrBuilder getHeroPosInfoOrBuilder() {
return heroPosInfo_;
}
private void initFields() {
heroPosInfo_ = com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasHeroPosInfo()) {
memoizedIsInitialized = 0;
return false;
}
if (!getHeroPosInfo().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeMessage(1, heroPosInfo_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, heroPosInfo_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code SReqHeroMove}
*
* <pre>
*英雄移动
* </pre>
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:SReqHeroMove)
com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMoveOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ninelook.wecard.protocol.apis.ApiHeroMessage.internal_static_SReqHeroMove_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ninelook.wecard.protocol.apis.ApiHeroMessage.internal_static_SReqHeroMove_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove.class, com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove.Builder.class);
}
// Construct using com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getHeroPosInfoFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
if (heroPosInfoBuilder_ == null) {
heroPosInfo_ = com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.getDefaultInstance();
} else {
heroPosInfoBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.ninelook.wecard.protocol.apis.ApiHeroMessage.internal_static_SReqHeroMove_descriptor;
}
public com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove getDefaultInstanceForType() {
return com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove.getDefaultInstance();
}
public com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove build() {
com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove buildPartial() {
com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove result = new com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
if (heroPosInfoBuilder_ == null) {
result.heroPosInfo_ = heroPosInfo_;
} else {
result.heroPosInfo_ = heroPosInfoBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove) {
return mergeFrom((com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove other) {
if (other == com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove.getDefaultInstance()) return this;
if (other.hasHeroPosInfo()) {
mergeHeroPosInfo(other.getHeroPosInfo());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasHeroPosInfo()) {
return false;
}
if (!getHeroPosInfo().isInitialized()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.ninelook.wecard.protocol.apis.ApiHeroMessage.SReqHeroMove) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo heroPosInfo_ = com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo, com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.Builder, com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfoOrBuilder> heroPosInfoBuilder_;
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public boolean hasHeroPosInfo() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo getHeroPosInfo() {
if (heroPosInfoBuilder_ == null) {
return heroPosInfo_;
} else {
return heroPosInfoBuilder_.getMessage();
}
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public Builder setHeroPosInfo(com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo value) {
if (heroPosInfoBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
heroPosInfo_ = value;
onChanged();
} else {
heroPosInfoBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public Builder setHeroPosInfo(
com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.Builder builderForValue) {
if (heroPosInfoBuilder_ == null) {
heroPosInfo_ = builderForValue.build();
onChanged();
} else {
heroPosInfoBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public Builder mergeHeroPosInfo(com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo value) {
if (heroPosInfoBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001) &&
heroPosInfo_ != com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.getDefaultInstance()) {
heroPosInfo_ =
com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.newBuilder(heroPosInfo_).mergeFrom(value).buildPartial();
} else {
heroPosInfo_ = value;
}
onChanged();
} else {
heroPosInfoBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public Builder clearHeroPosInfo() {
if (heroPosInfoBuilder_ == null) {
heroPosInfo_ = com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.getDefaultInstance();
onChanged();
} else {
heroPosInfoBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.Builder getHeroPosInfoBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getHeroPosInfoFieldBuilder().getBuilder();
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
public com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfoOrBuilder getHeroPosInfoOrBuilder() {
if (heroPosInfoBuilder_ != null) {
return heroPosInfoBuilder_.getMessageOrBuilder();
} else {
return heroPosInfo_;
}
}
/**
* <code>required .PosInfo heroPosInfo = 1;</code>
*
* <pre>
*英雄移动信息
* </pre>
*/
private com.google.protobuf.SingleFieldBuilder<
com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo, com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.Builder, com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfoOrBuilder>
getHeroPosInfoFieldBuilder() {
if (heroPosInfoBuilder_ == null) {
heroPosInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo, com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfo.Builder, com.ninelook.wecard.protocol.beans.BeanEntityMessage.PosInfoOrBuilder>(
getHeroPosInfo(),
getParentForChildren(),
isClean());
heroPosInfo_ = null;
}
return heroPosInfoBuilder_;
}
// @@protoc_insertion_point(builder_scope:SReqHeroMove)
}
static {
defaultInstance = new SReqHeroMove(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:SReqHeroMove)
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_SReqHeroMove_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_SReqHeroMove_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\031apis/ApiHeroMessage.proto\032\034beans/BeanS" +
"ceneMessage.proto\032\033beans/BeanHomeMessage" +
".proto\032\033beans/BeanHeroMessage.proto\032\035bea" +
"ns/BeanEntityMessage.proto\"-\n\014SReqHeroMo" +
"ve\022\035\n\013heroPosInfo\030\001 \002(\0132\010.PosInfoB#\n!com" +
".ninelook.wecard.protocol.apis"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.ninelook.wecard.protocol.beans.BeanSceneMessage.getDescriptor(),
com.ninelook.wecard.protocol.beans.BeanHomeMessage.getDescriptor(),
com.ninelook.wecard.protocol.beans.BeanHeroMessage.getDescriptor(),
com.ninelook.wecard.protocol.beans.BeanEntityMessage.getDescriptor(),
}, assigner);
internal_static_SReqHeroMove_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_SReqHeroMove_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_SReqHeroMove_descriptor,
new java.lang.String[] { "HeroPosInfo", });
com.ninelook.wecard.protocol.beans.BeanSceneMessage.getDescriptor();
com.ninelook.wecard.protocol.beans.BeanHomeMessage.getDescriptor();
com.ninelook.wecard.protocol.beans.BeanHeroMessage.getDescriptor();
com.ninelook.wecard.protocol.beans.BeanEntityMessage.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
| [
"[email protected]"
] | |
24784f036d65de3df6500b558c2af2ec549e6c6f | 36abe217c853ff9900de6cac8d20d3674aae7959 | /src/java/autoweka/ExperimentBatch.java | 24fe589dd78788662fc76c6326f2452e2d6d534d | [] | no_license | FarooqZuberi/autoweka | 19bb346b946fa5bb7d4b13f08cbda27521cd8a51 | 17b88c036c99b06716902ccc2c6af1e1aec07ebd | refs/heads/master | 2021-01-21T01:06:40.310646 | 2016-03-28T14:47:06 | 2016-03-28T14:47:06 | 50,338,767 | 0 | 0 | null | 2016-01-25T09:03:05 | 2016-01-25T09:03:04 | null | UTF-8 | Java | false | false | 10,270 | java | package autoweka;
import javax.xml.bind.annotation.*;
import java.io.InputStream;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Helpful XML class that easily allows for the creation of multiple experiments.
*
* It's also easier to use this to make a batch of 1 than it is to specify everything on the command line to the ExperimentConstructor
*/
@XmlRootElement(name="experimentBatch")
@XmlAccessorType(XmlAccessType.NONE)
public class ExperimentBatch extends XmlSerializable
{
final static Logger log = LoggerFactory.getLogger(ExperimentBatch.class);
/**
* Enscapsulates a dataset that you want to run experiments on
*/
@XmlRootElement(name="dataset")
@XmlAccessorType(XmlAccessType.NONE)
static public class DatasetComponent
{
/**
* The class index - if not provided, will use the last attribute as the class
*/
@XmlElement(name="classIndex")
private String classIndex;
/**
* The name of the zip file that you want to use for instances
*/
@XmlElement(name="zipFile")
private String zipFile;
/**
* The Training file arff
*/
@XmlElement(name="trainArff")
private String trainArff;
/**
* The Testing file arff
*/
@XmlElement(name="testArff")
private String testArff;
/**
* The 'name' of this dataset, helpful to make it short and easy to identify
*/
@XmlElement(name="name")
public String name;
/**
* Gets the dataset string out of this component
*/
public String getDatasetString()
{
int count = 0;
count += (zipFile != null) ? 1 : 0;
count += (trainArff != null && testArff != null) ? 1 : 0;
if(count != 1)
throw new IllegalArgumentException("A datasetComponent was found where the type could not be determined");
Properties props = new Properties();
if(classIndex != null)
props.setProperty("classIndex", classIndex);
if(zipFile != null)
{
props.setProperty("type", "zipFile");
props.setProperty("zipFile", new File(zipFile).getAbsolutePath());
}
if(trainArff != null && testArff != null)
{
props.setProperty("type", "trainTestArff");
props.setProperty("trainArff", new File(trainArff).getAbsolutePath());
props.setProperty("testArff", new File(testArff).getAbsolutePath());
}
if(props.getProperty("type") == null)
throw new RuntimeException("No type was determined for this datasetComponent");
//Time to spit out the string
return Util.propertiesToString(props);
}
public void setTrainTestArff(String _trainArff, String _testArff)
{
trainArff = _trainArff;
testArff = _testArff;
}
}
/**
* Captures all the settings of an experiment that are not related to a dataset
*/
@XmlRootElement(name="experiment")
@XmlAccessorType(XmlAccessType.NONE)
static public class ExperimentComponent
{
/**
* The experiment name's prefix
*/
@XmlElement(name="name")
public String name;
/**
* The name of the result metric to use - see ClassiferResult.Metric
*/
@XmlElement(name="resultMetric")
public String resultMetric;
/**
* The class name of the ExperimentConstructor to use
*/
@XmlElement(name="experimentConstructor")
public String constructor;
/**
* Any additional arguments that the ExperimentConstructor may want
*/
@XmlElement(name="experimentConstructorArgs")
public List<String> constructorArgs = new ArrayList<String>();
/**
* The class name of the instance generator
*/
@XmlElement(name="instanceGenerator")
public String instanceGenerator;
/**
* The property string that the instance generator will use to make instances
*/
@XmlElement(name="instanceGeneratorArgs")
public String instanceGeneratorArgs;
//@XmlElement(name="regularizer")
//public String regularizer;
//@XmlElement(name="regularizerArgs")
//public String regularizerArgs;
/**
* How many seconds should be spent for this experiment overall? (IE the SMBO method's budget)
*/
@XmlElement(name="tunerTimeout")
public float tunerTimeout = -1;
/**
* How many seconds should be spent training a set of hyperparameters on a specific partition of the training and test data?.
*
* Note that this is more of a guideline, Auto-WEKA has quite a bit of slack built into to accomodate classifiers that can return partial results,
* or ones that decide to offload training onto their evaluation phase.
*/
@XmlElement(name="trainTimeout")
public float trainTimeout = -1;
/**
* Boolean indicating if Attribute/Feature selection should happen
*/
@XmlElement(name="attributeSelection")
public boolean attributeSelection = false;
/**
* How many seconds should be spent performing attribute selection?
*/
@XmlElement(name="attributeSelectionTimeout")
public float attributeSelectionTimeout = -1;
/**
* The string passed to the Xmx argument of a sub process limiting the RAM that WEKA will have
*/
@XmlElement(name="memory")
public String memory;
/**
* The property string with any extra properties that the experiment might need
*/
@XmlElement(name="extraProps")
public String extraProps;
/**
* For analysis experiements, these extra classifier evaluations will be done for every point along the trajectory.
*
* For example, if we want to look at the Testing performance all the way along, we would add a new TrajectoryPointExtra that
* contains an instance string of 'default', since that causes Auto-WEKA to preserve the provided training/test split
*/
@XmlElement(name="trajectoryPointExtras")
public List<Experiment.TrajectoryPointExtra> trajectoryPointExtras = new ArrayList<Experiment.TrajectoryPointExtra>();
/**
* Forces Auto-WEKA to only use the list of classifiers here - if it is empty, then Auto-WEKA will try to use everything that it can
*/
@XmlElement(name="allowedClassifiers")
public List<String> allowedClassifiers = new ArrayList<String>();
}
/**
* The list of datasets in this batch
*/
@XmlElement(name="datasetComponent")
public List<DatasetComponent> mDatasets = new ArrayList<DatasetComponent>();
/**
* The list of experiment prototypes in this batch
*/
@XmlElement(name="experimentComponent")
public List<ExperimentComponent> mExperiments = new ArrayList<ExperimentComponent>();
public static ExperimentBatch fromXML(String filename)
{
return XmlSerializable.fromXML(filename, ExperimentBatch.class);
}
public static ExperimentBatch fromXML(InputStream xml)
{
return XmlSerializable.fromXML(xml, ExperimentBatch.class);
}
/**
* Builds an Experiment from an ExperimentComponent and a DatasetComponent
*/
public static Experiment createExperiment(ExperimentComponent expComp, DatasetComponent datasetComp)
{
Experiment exp = new Experiment();
exp.name = expComp.name + "-" + datasetComp.name;
exp.resultMetric = expComp.resultMetric;
exp.instanceGenerator = expComp.instanceGenerator;
exp.instanceGeneratorArgs = expComp.instanceGeneratorArgs;
exp.datasetString = datasetComp.getDatasetString();
exp.attributeSelection = expComp.attributeSelection;
exp.attributeSelectionTimeout = expComp.attributeSelectionTimeout;
exp.callString = new ArrayList<String>();
exp.envVariables = new ArrayList<String>();
exp.tunerTimeout = expComp.tunerTimeout;
exp.trainTimeout = expComp.trainTimeout;
exp.memory = expComp.memory;
exp.extraPropsString = expComp.extraProps;
exp.trajectoryPointExtras = expComp.trajectoryPointExtras;
exp.allowedClassifiers = new ArrayList<String>(expComp.allowedClassifiers);
return exp;
}
/**
* Makes an empty batch file that you can fill in with stuff
*/
public static void main(String[] args)
{
if(args.length != 1)
{
log.error("Usage: {} <xmlfilename>", ExperimentBatch.class.getCanonicalName());
log.error("Makes a template experiment batch file");
System.exit(1);
}
ExperimentBatch batch = new ExperimentBatch();
ExperimentBatch.DatasetComponent dataset = new ExperimentBatch.DatasetComponent();
dataset.name = "";
dataset.zipFile = "(Optional - One must be defined though)";
batch.mDatasets = Collections.singletonList(dataset);
ExperimentBatch.ExperimentComponent experiment = new ExperimentBatch.ExperimentComponent();
experiment.name = "";
experiment.constructor = "";
experiment.instanceGenerator = "";
experiment.instanceGeneratorArgs = "(Optional)";
//experiment.regularizer = "(Optional)";
//experiment.regularizerArgs = "(Optional)";
experiment.tunerTimeout = -1;
experiment.trainTimeout = -1;
experiment.memory = "";
experiment.extraProps = "(Optional)";
experiment.constructorArgs = Collections.singletonList("(Optional List)");
batch.mExperiments = Collections.singletonList(experiment);
batch.toXML(args[0]);
}
}
| [
"[email protected]"
] | |
42a618a680e76f2b0bd8de8c009addd206903781 | cee8bbcb89b73ff0428ea8cfa599396dd8cc3956 | /app/src/main/java/com/kangjj/aop/aspectJ/annotation/LoginCheck.java | b8a571a8c5a38bb09e7889e096a10bcdbd99ec9b | [] | no_license | gnmmdk/1.1.3_AOP | b2c75de00667eab8f609f757f1bf998667983928 | 6ef3772ac492d4e8d6eae1bcb4a8b8868690413d | refs/heads/master | 2020-08-30T03:40:37.290020 | 2019-10-29T14:32:47 | 2019-10-29T14:32:47 | 218,251,565 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | package com.kangjj.aop.aspectJ.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
//用户登记检测
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface LoginCheck {
}
| [
"[email protected]"
] | |
3cad95d30e66ee7579ad3025b35fbe8bd9674d7f | 8dbfce2cba63fc2a5348102ae2d5f8de09cbba8f | /darksideoftherainbowfinal/src/main/java/com/darksideoftherainbow/service/impl/ApplicationUserServiceImpl.java | a7baf78ce8f9080ada4bcbaca73bdb0244a92bf0 | [] | no_license | avocoder123/CMPSC221DSOTR | fb4af8db3e18019e7487d2d6c246df64e95966ea | fc47c4389c22215442c379adbac03956a29fbeaa | refs/heads/main | 2023-03-04T05:55:17.147748 | 2021-02-19T04:19:53 | 2021-02-19T04:19:53 | 320,366,452 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package com.darksideoftherainbow.service.impl;
import com.darksideoftherainbow.model.ApplicationUser;
import com.darksideoftherainbow.repository.ApplicationUserRepository;
import org.springframework.stereotype.Service;
@Service
public class ApplicationUserServiceImpl implements ApplicationUserService {
// auto-wired
private final ApplicationUserRepository applicationUserRepository;
public ApplicationUserServiceImpl(ApplicationUserRepository applicationUserRepository) {
this.applicationUserRepository = applicationUserRepository;
}
@Override
public ApplicationUser findByUserName(String username) {
return applicationUserRepository.findByUserName(username);
}
}
| [
"[email protected]"
] | |
ac11725402037ebecce7165fc70e845d9d0fdb3d | 6655fe5203f7cb00b58e6c10f3b6e8b575a2d378 | /src/main/java/nl/hu/v1wac/firstapp/model/Medewerker.java | c80500553ad76e51bac0034e1df561f1910686cc | [] | no_license | douweschepers/ipass | 7bfecb4887aaa9ab51fcf9a94851265add14c470 | bbac4d6729b7a431464969198d6c2945e63352a1 | refs/heads/master | 2021-01-21T20:56:36.464538 | 2017-06-22T07:36:54 | 2017-06-22T07:36:54 | 94,766,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,056 | java | package nl.hu.v1wac.firstapp.model;
public class Medewerker {
// zet de variable die ik gebruik
private int medewerkerID;
private int huisNummer;
private String straatNaam;
private String voornaam;
private String Achternaam;
private String rol;
private int ProjectID;
private String gebruikersNaam;
private String wachtwoord;
//de constructor
public Medewerker(int medewerkerID, int huisNummer, String straatNaam, String voornaam, String achternaam,
String rol, int projectID, String gebruikersNaam, String wachtwoord) {
super();
this.medewerkerID = medewerkerID;
this.huisNummer = huisNummer;
this.straatNaam = straatNaam;
this.voornaam = voornaam;
Achternaam = achternaam;
this.rol = rol;
ProjectID = projectID;
this.gebruikersNaam = gebruikersNaam;
this.wachtwoord = wachtwoord;
}
//de getters en setters
public int getMedewerkerID() {
return medewerkerID;
}
public void setMedewerkerID(int medewerkerID) {
this.medewerkerID = medewerkerID;
}
public int getHuisNummer() {
return huisNummer;
}
public void setHuisNummer(int huisNummer) {
this.huisNummer = huisNummer;
}
public String getStraatNaam() {
return straatNaam;
}
public void setStraatNaam(String straatNaam) {
this.straatNaam = straatNaam;
}
public String getVoornaam() {
return voornaam;
}
public void setVoornaam(String voornaam) {
this.voornaam = voornaam;
}
public String getAchternaam() {
return Achternaam;
}
public void setAchternaam(String achternaam) {
Achternaam = achternaam;
}
public String getRol() {
return rol;
}
public void setRol(String rol) {
this.rol = rol;
}
public int getProjectID() {
return ProjectID;
}
public void setProjectID(int projectID) {
ProjectID = projectID;
}
public String getGebruikersNaam() {
return gebruikersNaam;
}
public void setGebruikersNaam(String gebruikersNaam) {
this.gebruikersNaam = gebruikersNaam;
}
public String getWachtwoord() {
return wachtwoord;
}
public void setWachtwoord(String wachtwoord) {
this.wachtwoord = wachtwoord;
}
}
| [
"[email protected]"
] | |
89af66bc2fcfa8c9e3328ad75de1c570aa51a6ab | 336f2977eb8f923c1182e7dbc390b1712edf1464 | /springbootdemo2/src/main/java/com/example/oauth/model/AllProjects.java | 58a3c3f72ebc2dd98625779fce302eee15dd94dc | [] | no_license | WhiteSilencel/OauthTest | 3351caa50394280001adebed17a99bbc605b679e | d3399158e6ae003f19cca3add7c7d5ac4e7e1c4d | refs/heads/master | 2021-08-22T21:10:37.676609 | 2017-12-01T09:10:53 | 2017-12-01T09:10:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | package com.example.oauth.model;
import com.google.gson.annotations.SerializedName;
/**
* Created by LiMengXi on 2017/11/29.
* 目的:获取授权用户的所有项目
*
* 响应体:
* {
"id": 2726122,
"full_name": "limengxi/OauthDemo",
"url": "https://gitee.com/api/v5/repos/limengxi/OauthDemo",
"path": "OauthDemo",
"name": "OauthDemo",
"owner": {
"id": 1647371,
"login": "limengxi",
"name": "limengxi",
"avatar_url": "http://secure.gravatar.com/avatar/bf229f4003da3fe1b858cb761c2aafce?s=40&d=mm",
"url": "https://gitee.com/api/v5/users/limengxi",
"html_url": "https://gitee.com/limengxi",
"followers_url": "https://gitee.com/api/v5/users/limengxi/followers",
"following_url": "https://gitee.com/api/v5/users/limengxi/following_url{/other_user}",
"gists_url": "https://gitee.com/api/v5/users/limengxi/gists{/gist_id}",
"starred_url": "https://gitee.com/api/v5/users/limengxi/starred{/owner}{/repo}",
"subscriptions_url": "https://gitee.com/api/v5/users/limengxi/subscriptions",
"organizations_url": "https://gitee.com/api/v5/users/limengxi/orgs",
"repos_url": "https://gitee.com/api/v5/users/limengxi/repos",
"events_url": "https://gitee.com/api/v5/users/limengxi/events{/privacy}",
"received_events_url": "https://gitee.com/api/v5/users/limengxi/received_events",
"type": "User",
"site_admin": false
}
*/
public class AllProjects {
/**
* 只需获得id和path的值
*/
@SerializedName("id")
private int id;
@SerializedName("path")
private String path;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}
| [
"[email protected]"
] | |
96d6bdfcd562a8e757a0b9f0b4a76ee3524216f3 | 99e9bdbc81e6e5cb81878a3fd5bbe2e59ee51488 | /app/src/main/java/com/ciba/wholefinancial/activity/OrderInfoActivity.java | c31b411907eeb1b44a9377e45e341c7a4bef26e6 | [] | no_license | xumingda/WholeFinancial | 7dd06c18b5863f67c4abe861a93f005db843ee99 | f3063df95d7a8f77efdd80cb59e65ce43189c891 | refs/heads/master | 2020-07-03T10:53:43.608947 | 2019-08-14T06:28:59 | 2019-08-14T06:28:59 | 201,884,279 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 12,451 | java | package com.ciba.wholefinancial.activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.ciba.wholefinancial.R;
import com.ciba.wholefinancial.adapter.OrderGoodsAdapter;
import com.ciba.wholefinancial.base.BaseActivity;
import com.ciba.wholefinancial.base.MyVolley;
import com.ciba.wholefinancial.bean.MessageBean;
import com.ciba.wholefinancial.protocol.AddClassProtocol;
import com.ciba.wholefinancial.protocol.CancelOrderProtocol;
import com.ciba.wholefinancial.protocol.GetMerchantInfoProtocol;
import com.ciba.wholefinancial.protocol.GetOrderInfoProtocol;
import com.ciba.wholefinancial.protocol.PayOrderProtocol;
import com.ciba.wholefinancial.protocol.PrintProtocol;
import com.ciba.wholefinancial.response.AddOrUpdateLoginResponse;
import com.ciba.wholefinancial.response.GetMerchantInfoResponse;
import com.ciba.wholefinancial.response.GetOrderInfoResponse;
import com.ciba.wholefinancial.util.DialogUtils;
import com.ciba.wholefinancial.util.LogUtils;
import com.ciba.wholefinancial.util.SharedPrefrenceUtils;
import com.ciba.wholefinancial.util.UIUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.HashMap;
import java.util.Map;
public class OrderInfoActivity extends BaseActivity implements View.OnClickListener {
private LayoutInflater mInflater;
private View rootView;
private ListView lv_order;
private TextView tv_table_code,tv_time,tv_orderMoney,tv_people,tv_remark,tv_needMoney,tv_activeMoney,tv_userMoney;
private ImageView iv_top_back;
private int orderId;
//1取消。2结账
private int type=1;
private TextView tv_pay,tv_cancel,tv_print,tv_type_title,tv_money_title;
private AlertDialog alertDialog;
private Dialog loadingDialog;
private String url;
private Gson gson;
private OrderGoodsAdapter orderGoodsAdapter;
private int eatType;
private int status;
private LinearLayout ll_bottom;
@Override
protected View initView() {
requestWindowFeature(Window.FEATURE_NO_TITLE);
rootView = View.inflate(this, R.layout.activity_order_info, null);
if (mInflater == null) {
mInflater = (LayoutInflater) UIUtils.getContext().getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
}
setContentView(rootView);
initDate();
return rootView;
}
private void initDate() {
gson = new GsonBuilder()
.setPrettyPrinting()
.disableHtmlEscaping()
.create();
loadingDialog = DialogUtils.createLoadDialog(this, true);
orderId=getIntent().getIntExtra("orderId",0);
eatType=getIntent().getIntExtra("eatType",0);
// 0未支付,1已支付,2已取消
status=getIntent().getIntExtra("status",0);
iv_top_back=(ImageView)findViewById(R.id.iv_top_back);
tv_type_title=(TextView) findViewById(R.id.tv_type_title);
tv_money_title=(TextView) findViewById(R.id.tv_money_title);
ll_bottom=(LinearLayout) findViewById(R.id.ll_bottom);
tv_table_code=(TextView) findViewById(R.id.tv_table_code);
tv_pay=(TextView) findViewById(R.id.tv_pay);
tv_cancel=(TextView) findViewById(R.id.tv_cancel);
tv_people=(TextView) findViewById(R.id.tv_people);
tv_time=(TextView) findViewById(R.id.tv_time);
tv_orderMoney=(TextView) findViewById(R.id.tv_orderMoney);
tv_activeMoney=(TextView) findViewById(R.id.tv_activeMoney);
tv_needMoney=(TextView) findViewById(R.id.tv_needMoney);
tv_userMoney=(TextView) findViewById(R.id.tv_userMoney);
tv_remark=(TextView) findViewById(R.id.tv_remark);
tv_print=(TextView) findViewById(R.id.tv_print);
lv_order=(ListView)findViewById(R.id.lv_order);
iv_top_back.setOnClickListener(this);
tv_cancel.setOnClickListener(this);
tv_print.setOnClickListener(this);
getOrderInfo();
if(eatType==1){
tv_pay.setText("已配送");
}else{
tv_pay.setText("结账");
tv_pay.setOnClickListener(this);
}
if(status==0){
tv_type_title.setVisibility(View.VISIBLE);
tv_money_title.setVisibility(View.VISIBLE);
ll_bottom.setVisibility(View.VISIBLE);
}else{
tv_type_title.setVisibility(View.GONE);
tv_money_title.setVisibility(View.GONE);
ll_bottom.setVisibility(View.GONE);
}
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.iv_top_back:{
finish();
overridePendingTransition(R.anim.animprv_in, R.anim.animprv_out);
break;
}
case R.id.tv_print:{
printOrder();
break;
}
case R.id.tv_cancel:{
type=1;
alertDialog=DialogUtils.showAlertDoubleBtnDialog(OrderInfoActivity.this,"确认取消订单?","确定",1,OrderInfoActivity.this);
break;
}
case R.id.tv_pay:{
type=2;
alertDialog=DialogUtils.showAlertDoubleBtnDialog(OrderInfoActivity.this,"确认结账?","确定",1,OrderInfoActivity.this);
break;
}
case R.id.tv_ensure:{
if(type==1){
cancleOrder();
}else{
payOrder();
}
break;
}
}
}
private void getOrderInfo() {
loadingDialog.show();
GetOrderInfoProtocol getOrderInfoProtocol=new GetOrderInfoProtocol();
String url = getOrderInfoProtocol.getApiFun();
Map<String, String> params = new HashMap<String, String>();
params.put("orderId", String.valueOf(orderId));
MyVolley.uploadNoFile(MyVolley.POST, url, params, new MyVolley.VolleyCallback() {
@Override
public void dealWithJson(String address, String json) {
loadingDialog.dismiss();
GetOrderInfoResponse getOrderInfoResponse = gson.fromJson(json, GetOrderInfoResponse.class);
LogUtils.e("getOrderInfoResponse:" + getOrderInfoResponse.toString());
if (getOrderInfoResponse.getCode() == 0) {
tv_table_code.setText("桌牌号:"+getOrderInfoResponse.getOrder().getCode()+"号");
tv_time.setText(getOrderInfoResponse.getOrder().getCreateTime());
tv_orderMoney.setText("订单总额¥"+getOrderInfoResponse.getOrder().getOrderMoney());
tv_userMoney.setText("会员优惠金额:¥"+getOrderInfoResponse.getOrder().getUserMoney());
tv_activeMoney.setText("活动优惠金额¥"+getOrderInfoResponse.getOrder().getActiveMoney());
tv_needMoney.setText("实际支付金额¥"+getOrderInfoResponse.getOrder().getNeedMoney());
tv_people.setText("人数:"+getOrderInfoResponse.getOrder().getNumber()+"人");
tv_remark.setText(getOrderInfoResponse.getOrder().getRemark());
if(orderGoodsAdapter==null){
orderGoodsAdapter=new OrderGoodsAdapter(OrderInfoActivity.this,getOrderInfoResponse.getOrderGoodsList());
lv_order.setAdapter(orderGoodsAdapter);
}else{
orderGoodsAdapter.notifyDataSetChanged();
}
} else {
DialogUtils.showAlertDialog(OrderInfoActivity.this, getOrderInfoResponse.getMsg());
}
}
@Override
public void dealWithError(String address, String error) {
loadingDialog.dismiss();
DialogUtils.showAlertDialog(OrderInfoActivity.this, error);
}
@Override
public void dealTokenOverdue() {
}
});
}
private void cancleOrder() {
loadingDialog.show();
CancelOrderProtocol cancelOrderProtocol=new CancelOrderProtocol();
String url = cancelOrderProtocol.getApiFun();
Map<String, String> params = new HashMap<String, String>();
params.put("orderId", String.valueOf(orderId));
MyVolley.uploadNoFile(MyVolley.POST, url, params, new MyVolley.VolleyCallback() {
@Override
public void dealWithJson(String address, String json) {
loadingDialog.dismiss();
AddOrUpdateLoginResponse cancleOrder = gson.fromJson(json, AddOrUpdateLoginResponse.class);
LogUtils.e("cancleOrder:" + cancleOrder.toString());
alertDialog.cancel();
if (cancleOrder.getCode() == 0) {
DialogUtils.showAlertDialog(OrderInfoActivity.this, "取消成功!");
} else {
DialogUtils.showAlertDialog(OrderInfoActivity.this, cancleOrder.getMsg());
}
}
@Override
public void dealWithError(String address, String error) {
loadingDialog.dismiss();
DialogUtils.showAlertDialog(OrderInfoActivity.this, error);
}
@Override
public void dealTokenOverdue() {
}
});
}
//打印
private void printOrder() {
loadingDialog.show();
PrintProtocol printProtocol=new PrintProtocol();
String url = printProtocol.getApiFun();
Map<String, String> params = new HashMap<String, String>();
params.put("orderId", String.valueOf(orderId));
MyVolley.uploadNoFile(MyVolley.POST, url, params, new MyVolley.VolleyCallback() {
@Override
public void dealWithJson(String address, String json) {
loadingDialog.dismiss();
AddOrUpdateLoginResponse cancleOrder = gson.fromJson(json, AddOrUpdateLoginResponse.class);
LogUtils.e("printOrder:" + cancleOrder.toString());
if (cancleOrder.getCode() == 0) {
DialogUtils.showAlertDialog(OrderInfoActivity.this, "打印成功!");
} else {
DialogUtils.showAlertDialog(OrderInfoActivity.this, cancleOrder.getMsg());
}
}
@Override
public void dealWithError(String address, String error) {
loadingDialog.dismiss();
DialogUtils.showAlertDialog(OrderInfoActivity.this, error);
}
@Override
public void dealTokenOverdue() {
}
});
}
private void payOrder() {
loadingDialog.show();
PayOrderProtocol payOrderProtocol=new PayOrderProtocol();
String url = payOrderProtocol.getApiFun();
Map<String, String> params = new HashMap<String, String>();
params.put("orderId", String.valueOf(orderId));
MyVolley.uploadNoFile(MyVolley.POST, url, params, new MyVolley.VolleyCallback() {
@Override
public void dealWithJson(String address, String json) {
loadingDialog.dismiss();
AddOrUpdateLoginResponse cancleOrder = gson.fromJson(json, AddOrUpdateLoginResponse.class);
LogUtils.e("payOrderProtocol:" + cancleOrder.toString());
alertDialog.cancel();
if (cancleOrder.getCode() == 0) {
} else {
DialogUtils.showAlertDialog(OrderInfoActivity.this, cancleOrder.getMsg());
}
}
@Override
public void dealWithError(String address, String error) {
loadingDialog.dismiss();
DialogUtils.showAlertDialog(OrderInfoActivity.this, error);
}
@Override
public void dealTokenOverdue() {
}
});
}
}
| [
"[email protected]"
] | |
6a2ff4622cf90f579f08f2245f27366daf814428 | 44bb3ccdb2e629f33a9ab0f29ab3a47f1a5b6c51 | /app/src/androidTest/java/com/soussidev/android/appshortcuts_project/ExampleInstrumentedTest.java | d8eff0806339eda5669fb37f85049b6bd683d1c5 | [] | no_license | datalink747/Appshortcuts_project | 5ce1926caabd8284a417c35a2d50f1230605ce25 | a3c0b460558f1d327735c35c13b9413c450139cf | refs/heads/master | 2021-01-13T15:53:44.517262 | 2016-12-18T18:02:46 | 2016-12-18T18:02:46 | 76,798,308 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 788 | java | package com.soussidev.android.appshortcuts_project;
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.soussidev.android.appshortcuts_project", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
eb36ec20105a911fe4926f0bdb9fc58f47e8b946 | 7bbb6747b709996a34a0eb47880704b9c32c5636 | /app/src/main/java/com/lyl/boon/ui/superboon/SuperBoonListFragment.java | 5d1a74fb45efd2ab754c8a8b489e054d18c3ebc8 | [
"MIT"
] | permissive | GITMrHu/boon | d9f519830fabd6717ea7d3a041e5b9687efa3f7c | 60bc205b7c083cd43f4b63e43b8d927ef18e37cb | refs/heads/master | 2021-05-11T23:43:16.160846 | 2018-01-10T10:20:22 | 2018-01-10T10:20:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,556 | java | package com.lyl.boon.ui.superboon;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.lyl.boon.R;
import com.lyl.boon.net.Network;
import com.lyl.boon.net.entity.SuperGalleryEntity;
import com.lyl.boon.ui.base.fragment.BaseRecyclerFragment;
import java.util.ArrayList;
import java.util.List;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Func1;
import rx.schedulers.Schedulers;
/**
* 超级福利的列表页面
*/
public class SuperBoonListFragment extends BaseRecyclerFragment<SuperGalleryEntity.ListBean> {
/**
* 当前页面显示的分类id
*/
private int typeId;
/**
* 每页显示多少个
*/
private static final int ROWS = 20;
@Override
public void onAttach(Context context) {
super.onAttach( context );
typeId = getArguments().getInt( SuperBoonFragment.SUPER_TYPE );
}
@Override
protected void initListType() {
mListType = BaseRecyclerFragment.TYPE_STAG_V;
}
@Override
protected void initData() {
mData = new ArrayList<SuperGalleryEntity.ListBean>();
mAdapter = new SuperBoonListAdapter( getHolder(), mData, R.layout.item_image_v );
}
@Override
protected void setSubscribe() {
int count = page * ROWS;
Network.getTngou().getGalleryList( typeId, count ).map(new Func1<SuperGalleryEntity, List<SuperGalleryEntity.ListBean>>() {
@Override
public List<SuperGalleryEntity.ListBean> call(SuperGalleryEntity superGalleryEntity) {
if (superGalleryEntity.getCount() > 0){
return superGalleryEntity.getList();
}
return null;
}
}).subscribeOn( Schedulers.io() ).observeOn( AndroidSchedulers.mainThread() ).subscribe( observer );
}
@Override
protected void ItemClickListener(View itemView, int viewType, int position) {
SuperGalleryEntity.ListBean galleryEntiry = (SuperGalleryEntity.ListBean) mAdapter.getItem( position );
Intent intent = new Intent( getHolder(), SuperGalleryActivity.class );
Bundle bundle = new Bundle();
bundle.putInt( "menu", typeId );
bundle.putString( "id", galleryEntiry.getId() );
bundle.putString( "title", galleryEntiry.getGroup_title() );
intent.putExtra( "budele", bundle );
startActivity( intent );
getHolder().overridePendingTransition( R.anim.fade_in, R.anim.fade_out );
}
}
| [
"[email protected]"
] | |
39bae3ca95a1102612478c1ea167a02cc43734b3 | 077017dd51919d753a65b0dbe9fa005010b1f7b9 | /src/modelo/UserInsert.java | 7a20891a1542fb03aa5b7254f94e19a8c725dbe8 | [] | no_license | sara001111/BaseJava | 17fdb33e7de8920021a149ef7823b1f4b14ba75a | 48fd473ddcf27fb11afd58711303e077035c00af | refs/heads/main | 2023-03-20T01:11:54.306787 | 2021-03-08T16:17:46 | 2021-03-08T16:17:46 | 344,567,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,594 | java | package modelo;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.util.ArrayList;
public class UserInsert {
static final String CONTROLADOR = "com.mysql.jdbc.Driver";
static final String URL_BASEDATOS = "jdbc:mysql://localhost:3306/constancia";
private static final Connection resultado = null;
private java.sql.PreparedStatement pst;
private ResultSet rs;
public boolean addUser(User user) {
boolean state = false;
Connection conexion = null;
try {
// Connection conexion=null;//maneja la conexión
Class.forName(CONTROLADOR);// carga la clase controlador
conexion = DriverManager.getConnection(URL_BASEDATOS, "root", "root");// establece la conexión a la bd
if (conexion != null) {
String sql = "INSERT INTO usuario (id_usuario, nombre, contraseña) VALUES (?,?,?)";
pst = conexion.prepareStatement(sql);
pst.setInt(1, user.getId());
pst.setString(2, user.getNombre());
pst.setString(3, user.getContrasena());
int resultado = pst.executeUpdate();
state = resultado > 0;
} else {
System.out.println("NO PUEDE CONECTARSE");
}
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
try {
// resultado.close();
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
return state;
}
public ArrayList<User> selectUser(String filter, ArrayList<String> data) {
ArrayList<User> list = new ArrayList<>();
User user;
Connection conexion = null;
try {
// Connection conexion=null;//maneja la conexión
Class.forName(CONTROLADOR);// carga la clase controlador
conexion = DriverManager.getConnection(URL_BASEDATOS, "root", "root");// establece la conexión a la bd
if (conexion != null) {
String sql = "";
switch (filter) {
case "Nombre":
sql = "SELECT * FROM usuario WHERE nombre REGEXP ?";
pst = conexion.prepareStatement(sql);
pst.setString(1, data.get(0));
break;
case "ID":
sql = "SELECT * FROM usuario WHERE id_usuario=?";
pst = conexion.prepareStatement(sql);
pst.setInt(1, Integer.parseInt(data.get(0)));
break;
default:
sql = "SELECT * FROM usuario WHERE 0";
pst = conexion.prepareStatement(sql);
break;
}
rs = pst.executeQuery();
while (rs.next()) {
user = new User();
user.setId(rs.getInt("id_usuario"));
user.setNombre(rs.getString("nombre"));
user.setContrasena(rs.getString("contraseña"));
list.add(user);
}
} else {
System.out.println("NO PUEDE CONECTARSE");
}
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
try {
// resultado.close();
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
return list;
// return state;
}
// dime si
public boolean modificarUser(User user) {
boolean state = false;
Connection conexion = null;// maneja la conexión
try {
Class.forName(CONTROLADOR);// carga la clase controlador
conexion = DriverManager.getConnection(URL_BASEDATOS, "root", "root");// establece la conexión a la bd
if (conexion != null) {
String sql = "UPDATE usuario SET nombre=?, contraseña=? WHERE id_usuario=?";
pst = conexion.prepareStatement(sql);// crea una consulta que seleccina todas las entradas en la bd
// establecer parámetros, después ejecuta la consulta
// pst.setInt(1, user.getId());
pst.setString(1, user.getNombre());
pst.setString(2, user.getContrasena());
pst.setInt(3, user.getId());
int resultado = pst.executeUpdate();// modifica la nueva entrada; devuelve el # de filas actualizadas
// si resultado es mayor a 0 devuelve true y se actualiza de lo contrario
// recibirá un error
state = resultado > 0;
} else {
System.out.println("NO PUEDE CONECTARSE");
}
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
try {
// resultado.close();
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
return state;
}
public boolean eliminarUser(int id_usuario) {
boolean state = false;
Connection conexion = null;// maneja la conexión
try {
Class.forName(CONTROLADOR);// carga la clase controlador
conexion = DriverManager.getConnection(URL_BASEDATOS, "root", "root");// establece la conexión a la bd
if (conexion != null) {
String sql = "DELETE FROM usuario WHERE id_usuario=?";
pst = conexion.prepareStatement(sql);// crea una consulta que seleccina todas las entradas en la bd
// establecer parámetros, después ejecuta la consulta
pst.setInt(1, id_usuario);
int resultado = pst.executeUpdate();// modifica la nueva entrada; devuelve el # de filas actualizadas
// si resultado es mayor a 0 devuelve true y se eliminan los datos, de lo
// contrario recibirá un error
state = resultado > 0;
} else {
System.out.println("NO PUEDE CONECTARSE");
}
} catch (Exception e) {
System.out.println(e.getMessage());
} finally {
try {
// resultado.close();
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
return state;
}
}
| [
"[email protected]"
] | |
96bbe2d1637110aa92b9a83c46b1f3e7cabc8caa | d46a42edc21f6446ba8d6c0aca0677304d633b78 | /app/src/main/java/com/example/firebase210724/adapter/BoardAdapter.java | 93699a49f17470298f621ce890da5c9899ebf8e4 | [] | no_license | ghchoi0427/Android-Sandbox | d70196693b31db11f18e21535e50b1a549e46f8e | b00b8e2ed49463dc1a4b3ee14c40ee265d37b878 | refs/heads/master | 2023-08-06T02:10:22.818199 | 2021-09-25T08:00:08 | 2021-09-25T08:00:08 | 389,117,140 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,191 | java | package com.example.firebase210724.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.firebase210724.R;
import com.example.firebase210724.domain.Board;
import com.example.firebase210724.util.FirebaseDatabaseHandler;
import com.google.firebase.firestore.FirebaseFirestore;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BoardAdapter extends RecyclerView.Adapter<BoardAdapter.ViewHolder> {
List<Board> boardList = new ArrayList<>();
RecyclerView recyclerBoard;
private ViewHolder.OnBoardListener mOnBoardListener;
public BoardAdapter(ViewHolder.OnBoardListener onBoardListener) {
mOnBoardListener = onBoardListener;
}
public List<Board> getBoardList() {
return boardList;
}
public List<Board> getBoards() {
return boardList;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) {
LayoutInflater inflater = LayoutInflater.from(viewGroup.getContext());
View itemView = inflater.inflate(R.layout.item_board, viewGroup, false);
return new ViewHolder(itemView, mOnBoardListener);
}
@Override
public void onBindViewHolder(@NonNull BoardAdapter.ViewHolder viewHolder, int position) {
Board board = boardList.get(position);
viewHolder.setItem(board);
}
@Override
public int getItemCount() {
return boardList.size();
}
public void addBoard(Board board) {
boardList.add(board);
}
public void addBoards(List<Board> boardList) {
this.boardList.addAll(boardList);
}
public void clearItem() {
boardList.clear();
}
public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private final TextView title;
private final TextView user;
private final TextView date;
OnBoardListener onBoardListener;
public ViewHolder(View boardView, OnBoardListener onBoardListener) {
super(boardView);
title = boardView.findViewById(R.id.txt_board_title);
user = boardView.findViewById(R.id.txt_board_user);
date = boardView.findViewById(R.id.txt_board_date);
this.onBoardListener = onBoardListener;
boardView.setOnClickListener(this);
}
public void setItem(Board board) {
try {
title.setText(board.getTitle());
user.setText(board.getUserName());
date.setText(new SimpleDateFormat("yyyy.MM.dd").format(board.getDate().toDate()));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onClick(View view) {
onBoardListener.onBoardClick(getAdapterPosition());
}
public interface OnBoardListener {
void onBoardClick(int position);
}
}
}
| [
"[email protected]"
] | |
e7e77ca3bd7f7ff4f001c121446fb44e17df57e9 | 075333e404c66e7d8f1b4393808e4e04973a4ce2 | /app/src/main/java/com/example/bankquis/MainActivity3.java | 894e9390eb729c517cb0e26e2edfe9a189ce15e0 | [] | no_license | HijranaSuci/Bank-Quizz | 9a044124584542bb80eb9173bb254c7471c36182 | 6990820aea2596da4a29068b8da2c55e478babd7 | refs/heads/main | 2023-03-16T18:30:12.313777 | 2021-03-01T10:17:53 | 2021-03-01T10:17:53 | 343,494,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,308 | java | package com.example.bankquis;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity3 extends AppCompatActivity {
TextView kuis;
RadioGroup rg;
RadioButton PilihanA, PilihanB, PilihanC, PilihanD;
int nomor = 0;
public static int hasil, benar, salah;
//pertanyaan
String[] pertanyaan_kuis = new String[]{
"1. Aktivitas seni halus di mana gagasan imajinasi media dua dan tiga dimensi ikut berperan, dengan mempertimbangkan proporsi, komposisi, keseimbangan, dan cahaya gelap, disebut ",
"2. Aliran lukisan yang mengambil objek keindahan alam adalah …",
"3. Patung Asmat adalah contoh seni daerah murni",
};
//pilihan jawaban a, b, c, d
String[] pilihan_jawaban = new String[]{
"Ukir","Patung","Gambar","Merajut",
"Ekspresionisme","Romansa","Naturalisme","Realisme",
"Kalimantan", "Papua", "Jawa", "Sumatra",
};
//jawaban benar
String[] jawaban_benar = new String[]{
"Gambar",
"Naturalisme",
"Papua",
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main3);
kuis = (TextView) findViewById(R.id.kuis);
rg = (RadioGroup) findViewById(R.id.pilihan);
PilihanA = (RadioButton) findViewById(R.id.pilihanA);
PilihanB = (RadioButton) findViewById(R.id.pilihanB);
PilihanC = (RadioButton) findViewById(R.id.pilihanC);
PilihanD = (RadioButton) findViewById(R.id.pilihanD);
kuis.setText(pertanyaan_kuis[nomor]);
PilihanA.setText(pilihan_jawaban[0]);
PilihanB.setText(pilihan_jawaban[1]);
PilihanC.setText(pilihan_jawaban[2]);
PilihanD.setText(pilihan_jawaban[3]);
rg.check(0);
benar = 0;
salah = 0;
}
public void next(View view) {
if (PilihanA.isChecked() || PilihanB.isChecked() || PilihanC.isChecked() || PilihanD.isChecked()) {
RadioButton jawaban_user = (RadioButton) findViewById(rg.getCheckedRadioButtonId());
String ambil_jawaban_user = jawaban_user.getText().toString();
rg.check(0);
if (ambil_jawaban_user.equalsIgnoreCase(jawaban_benar[nomor])) benar++;
else salah++;
nomor++;
if (nomor < pertanyaan_kuis.length) {
kuis.setText(pertanyaan_kuis[nomor]);
PilihanA.setText(pilihan_jawaban[(nomor * 4) + 0]);
PilihanB.setText(pilihan_jawaban[(nomor * 4) + 1]);
PilihanC.setText(pilihan_jawaban[(nomor * 4) + 2]);
PilihanD.setText(pilihan_jawaban[(nomor * 4) + 3]);
} else {
hasil = benar * 20;
Intent selesai = new Intent(getApplicationContext(), HasilKuis3.class);
startActivity(selesai);
}
}
else {
Toast.makeText(this,"Kamu Jawab Dulu",Toast.LENGTH_LONG).show();
}
}
} | [
"[email protected]"
] | |
5b50d487a42fb9e28b391e72539940ff87c847ae | 131f9b66ebe9f4c5e7d963fa93356b27a607218b | /src/main/java/com/christopher/ultracraftmod/util/references/NetherBiome.java | 21643d02e2fd4ec1eaeccad5fd9300eb34d8431d | [
"CC0-1.0"
] | permissive | DieselDorky16/Ultracraft | a0ca503cc12b35cfb5dd1d23949da59051e0b577 | 7dfc90e17358d1046613a8384c54e811094c57ca | refs/heads/master | 2022-11-26T17:19:03.417241 | 2020-08-10T19:40:51 | 2020-08-10T19:40:51 | 277,118,315 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 519 | java | package com.christopher.ultracraftmod.util.references;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
public interface NetherBiome {
public static final Biome NETHER_WASTES = Biomes.NETHER_WASTES;
public static final Biome CRIMSON_FOREST = Biomes.CRIMSON_FOREST;
public static final Biome WARPED_FOREST = Biomes.WARPED_FOREST;
public static final Biome SOUL_SAND_VALLEY = Biomes.SOUL_SAND_VALLEY;
public static final Biome BASALT_DELTAS = Biomes.BASALT_DELTAS;
}
| [
"[email protected]"
] | |
88373c0055763c251e136cc7f1d91deda24d0132 | d727a84017994e492159d6787bb725769627ac42 | /org.insightech.er/src/org/insightech/er/editor/view/dialog/element/table/tab/DescriptionTabWrapper.java | f2326574b58997ca3fb67b08c6563cc4941c5ac1 | [] | no_license | xsano33/ERMaster-fork-db2 | 8d507c8352eb0c3e52c7f97f9765cd228fcbf9a5 | 4a16d6c397d2511c638b2749d50313eedb5e0628 | refs/heads/master | 2016-08-04T18:00:38.205629 | 2014-03-26T08:37:26 | 2014-03-26T08:37:26 | 18,124,775 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,543 | java | package org.insightech.er.editor.view.dialog.element.table.tab;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.Text;
import org.insightech.er.common.dialog.AbstractDialog;
import org.insightech.er.common.exception.InputException;
import org.insightech.er.common.widgets.CompositeFactory;
import org.insightech.er.common.widgets.ValidatableTabWrapper;
import org.insightech.er.editor.model.diagram_contents.element.node.table.ERTable;
import org.insightech.er.util.Format;
public class DescriptionTabWrapper extends ValidatableTabWrapper {
private ERTable copyData;
private Text descriptionText;
public DescriptionTabWrapper(AbstractDialog dialog, TabFolder parent,
int style, ERTable copyData) {
super(dialog, parent, style, "label.table.description");
this.copyData = copyData;
this.init();
}
@Override
public void initComposite() {
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 1;
this.setLayout(gridLayout);
this.descriptionText = CompositeFactory.createTextArea(null, this,
"label.table.description", -1, 400, 1, true);
this.descriptionText.setText(Format.null2blank(copyData
.getDescription()));
}
/**
* {@inheritDoc}
*/
@Override
public void validatePage() throws InputException {
String text = descriptionText.getText().trim();
this.copyData.setDescription(text);
}
@Override
public void setInitFocus() {
this.descriptionText.setFocus();
}
@Override
public void perfomeOK() {
}
}
| [
"[email protected]"
] | |
0f27b22bfbb86cea208a0cff26082a1b1a4af30c | 17f1d83eda8b52a6161ef87b25a10c873ef1760e | /uflo-core/src/main/java/com/bstek/uflo/model/variable/CharacterVariable.java | 0ce648a054e7098df3780e8311c193ce0e584c7e | [
"Apache-2.0"
] | permissive | liningwang/uflo-v2 | c6c1d8ad24f7650f5c25c6a44588b75d9a75ca72 | 317051a05480c5000cb65c09c20b174aca1bfb91 | refs/heads/master | 2023-03-30T19:33:43.365507 | 2021-03-03T10:57:41 | 2021-03-03T10:57:41 | 344,095,681 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,489 | java | /*******************************************************************************
* Copyright 2017 Bstek
*
* 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.bstek.uflo.model.variable;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
@Entity
@DiscriminatorValue("Character")
public class CharacterVariable extends Variable {
@Column(name="CHARACTER_VALUE_")
private Character characterValue;
public CharacterVariable(){}
public CharacterVariable(Character value){
this.characterValue=value;
}
@Override
public Object getValue() {
return characterValue;
}
public Character getCharacterValue() {
return characterValue;
}
public void setCharacterValue(Character characterValue) {
this.characterValue = characterValue;
}
@Override
public VariableType getType() {
return VariableType.Character;
}
}
| [
"[email protected]"
] | |
716d6dab26e6a9901b13dbe60ef8e3996d801179 | f4bdbbf2a2e87fda6b27846caa81cb6717d571c5 | /src/org/evertree/lettres/test/TestOvalWindowFade.java | b6a57fc0193068b5ffc3cf6ec162a6e5b82e73d3 | [] | no_license | LuisGustavo802/Jogo-MS28S | b3b88663b41af9521c0a99ec4cbcba9e4c238dfd | 8345197437a21c4aefddb9b96779d01388611c55 | refs/heads/master | 2021-03-16T21:57:54.190865 | 2020-10-14T22:27:04 | 2020-10-14T22:27:04 | 246,946,881 | 0 | 1 | null | 2020-10-14T22:27:05 | 2020-03-12T23:11:47 | Java | UTF-8 | Java | false | false | 1,604 | java | package org.evertree.lettres.test;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Ellipse2D;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JProgressBar;
import javax.swing.JRadioButton;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
public class TestOvalWindowFade extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
final Timer fadeTimer = new Timer(100, new ActionListener() {
float alpha = 0f;
public void actionPerformed(ActionEvent e) {
alpha = Math.min(alpha + .1f, 1.0f);
if (alpha >= 1.0f) {
alpha = 0f;
((Timer) e.getSource()).stop();
}
}
});
public TestOvalWindowFade() {
super("Test translucent and oval-shaped window");
setLayout(new java.awt.GridBagLayout());
add(new JButton("test"));
add(new JCheckBox("test"));
add(new JRadioButton("test"));
add(new JProgressBar(0, 100));
setSize(new java.awt.Dimension(400, 300));
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setUndecorated(true);
}
public void addNotify() {
super.addNotify();
fadeTimer.start();
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new TestOvalWindowFade().setVisible(true);
}
});
}
} | [
"[email protected]"
] | |
8932980b0c9c8aa7aa6900c042076e1a4d75c091 | 7886e612c4286d25df5ada8676f34fdfd795ef83 | /src/LaunchStrng.java | e6af3f5c76df293fa4a8538e0b8a4b0d5954e58d | [] | no_license | umarshariff100/Test1 | 6eb871c2d447a73f0c11cf208036e5f468a567fb | 1f406eba535b7944fe23d1dae40b01b8afba4688 | refs/heads/master | 2020-04-22T21:34:41.744755 | 2019-02-08T14:38:48 | 2019-02-08T14:38:48 | 170,677,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java |
public class LaunchStrng {
public static void main(String[] args){
String s1 = ("RAMA");
String s2 = ("RAMA");
if(s1.equals(s2)){
System.out.println("Strings are equal");
}
else{
System.out.println("strings are not equal");
}
}
}
| [
"UMAR@UMAR-PC"
] | UMAR@UMAR-PC |
d9c8d0739f535cc0e02928f0b082ab1ae6707ac1 | aae895e0d02dbf283fa77994a6c2962b5dec704c | /src/my/darkenk/okienkatest/ActivityViewWrapper.java | 287d40294ce4944747eb94d87d1581c409388716 | [
"BSD-3-Clause"
] | permissive | liyigang86/OkienkaTest | 29e6ff22593db3b9676d80794a9b932bee7e1f55 | b968ee866267d79b0b2c44fa54be5446a6f2fd4b | refs/heads/master | 2020-04-06T13:44:55.084930 | 2016-02-04T10:21:32 | 2016-02-04T10:21:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,795 | java | /**
* Copyright (C) 2015, Dariusz Kluska <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the {organization} nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package my.darkenk.okienkatest;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
public class ActivityViewWrapper {
private final String TAG = "OkienkaWrapper";
private Constructor<?> mDefaultCtor;
private View mActivityView;
private Method mStartActivityMethod;
public ActivityViewWrapper(Context ctx) {
try {
Class<?> clazz = Class.forName("android.app.ActivityView");
mDefaultCtor = clazz.getConstructor(Context.class);
mActivityView = (View)mDefaultCtor.newInstance(ctx);
mStartActivityMethod = clazz.getMethod("startActivity", Intent.class);
} catch (Exception e) {
Log.e(TAG, "ActivityViewWrapper failed " + e);
}
}
public void startActivity(Intent intent) {
try {
mStartActivityMethod.invoke(mActivityView, intent);
} catch (Exception e) {
Log.e(TAG, "ActivityViewWrapper failed startActivity " + e);
}
}
public View getActivityView() {
return mActivityView;
}
}
| [
"[email protected]"
] | |
48cef600b01e8c97b6bb438cc649c8420a718ff6 | 3832d2f1c4b43832ca17554fc9d9f92342a0667e | /prova01/src/test/java/br/com/contmatic/empresa/EmpresaTest.java | 546e05bf0ae6337de8b7d1f591712c330816b3b6 | [] | no_license | LcsEloy/prova1 | 01ba5e2161151f6b362d7ac29613a751ae7f70c3 | ae17a1efcc4d5380eb5c8146652deaa4d2149517 | refs/heads/master | 2021-06-29T13:09:26.511428 | 2020-01-08T19:17:04 | 2020-01-08T19:17:04 | 218,078,027 | 0 | 0 | null | 2021-03-31T21:40:45 | 2019-10-28T15:22:12 | Java | UTF-8 | Java | false | false | 14,329 | java | package br.com.contmatic.empresa;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import br.com.contmatic.empresa.Empresa;
public class EmpresaTest {
private Empresa empTest;
@BeforeClass
public static void inicioTestes() {
System.out.println("Iniciando teste...");
}
@Before
public void antes() {
String cnpj = "61902722000126";
String razaoSocial = "Sport Clube Corinthians Paulista";
String nomeFantasia = "Corinthians";
String areaAtuacao = "Futebol";
Telefone telefone = new Telefone(11, 20953000, "Comercial");
String numeroFuncionarios = "45";
empTest = new Empresa(cnpj, razaoSocial, nomeFantasia, areaAtuacao, telefone, numeroFuncionarios);
}
@After
public void depois() {
empTest = null;
}
@AfterClass
public static void fimTestes() {
System.out.println("Teste concluído.");
}
@Test
public void deve_apresentar_os_dados_da_empresa_no_console() {
System.out.println(empTest);
}
@Test
public void deve_apresentar_os_dados_da_empresa_com_alteracoes() {
empTest.setRazaoSocial("Sem nome");
System.out.println(empTest);
}
@Ignore
@Test
public void deve_ignorar_este_teste() {
System.out.println("Isso não deve ser impresso!");
}
@Test(timeout = 100)
public void nao_deve_exceder_o_tempo_proposto() {
String cnpj = "61902722000126";
String razaoSocial = "Sport Clube Corinthians Paulista";
String nomeFantasia = "Corinthians";
String areaAtuacao = "Futebol";
Telefone telefone = new Telefone(11, 20953000, "Comercial");
String numeroFuncionarios = "45";
empTest = new Empresa(cnpj, razaoSocial, nomeFantasia, areaAtuacao, telefone, numeroFuncionarios);
}
@Test
public void deve_apontar_igualdade_de_objetos_utilizando_hashcode() {
String cnpj = empTest.getCnpj();
String razaoSocial = empTest.getRazaoSocial();
String nomeFantasia = empTest.getNomeFantasia();
String areaAtuacao = empTest.getAreaAtuacao();
Telefone telefone = new Telefone(11, 20953000, "Comercial");
String numeroFuncionarios = empTest.getNumeroFuncionarios();
Empresa empTest2 = new Empresa(cnpj, razaoSocial, nomeFantasia, areaAtuacao, telefone, numeroFuncionarios);
assertEquals(empTest.hashCode(), empTest2.hashCode());
}
@Test
public void nao_deve_apontar_igualdade_de_objetos_utilizando_hashcode() {
String cnpj = "11862405000155";
String razaoSocial = empTest.getRazaoSocial();
String nomeFantasia = empTest.getNomeFantasia();
String areaAtuacao = empTest.getAreaAtuacao();
Telefone telefone = new Telefone(11, 20953000, "Comercial");
String numeroFuncionarios = empTest.getNumeroFuncionarios();
Empresa empTest2 = new Empresa(cnpj, razaoSocial, nomeFantasia, areaAtuacao, telefone, numeroFuncionarios);
assertNotEquals(empTest.hashCode(), empTest2.hashCode());
}
@Test
public void deve_apontar_igualdade_de_objetos_utilizando_equals() {
String cnpj = empTest.getCnpj();
String razaoSocial = empTest.getRazaoSocial();
String nomeFantasia = empTest.getNomeFantasia();
String areaAtuacao = empTest.getAreaAtuacao();
Telefone telefone = new Telefone(11, 20953000, "Comercial");
String numeroFuncionarios = empTest.getNumeroFuncionarios();
Empresa empTest2 = new Empresa(cnpj, razaoSocial, nomeFantasia, areaAtuacao, telefone, numeroFuncionarios);
assertTrue(empTest.equals(empTest2));
}
@Test
public void nao_deve_apontar_igualdade_de_objetos_utilizando_equals() {
String cnpj = "76514162000100";
String razaoSocial = empTest.getRazaoSocial();
String nomeFantasia = empTest.getNomeFantasia();
String areaAtuacao = empTest.getAreaAtuacao();
Telefone telefone = new Telefone(11, 20953000, "Comercial");
String numeroFuncionarios = empTest.getNumeroFuncionarios();
Empresa empTest2 = new Empresa(cnpj, razaoSocial, nomeFantasia, areaAtuacao, telefone, numeroFuncionarios);
assertFalse(empTest.equals(empTest2));
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_nulo() {
empTest.setCnpj(null);
assertNotNull("should not be null", empTest.getCnpj());
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_vazio() {
empTest.setCnpj("");
assertNotNull("should not be empty", empTest.getCnpj());
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_em_branco() {
empTest.setCnpj(" ");
assertNotNull("should not be blank", empTest.getCnpj());
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numero_e_letras() {
empTest.setCnpj("6190272200012R");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_apenas_com_letras() {
empTest.setCnpj("aaaaaaaaaaaaaa");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_zero() {
empTest.setCnpj("00000000000000");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_um() {
empTest.setCnpj("11111111111111");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_dois() {
empTest.setCnpj("22222222222222");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_tres() {
empTest.setCnpj("33333333333333");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_quatro() {
empTest.setCnpj("44444444444444");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_cinco() {
empTest.setCnpj("55555555555555");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_seis() {
empTest.setCnpj("66666666666666");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_sete() {
empTest.setCnpj("77777777777777");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_oito() {
empTest.setCnpj("88888888888888");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_numeros_iguais_nove() {
empTest.setCnpj("99999999999999");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_menos_de_14_digitos() {
empTest.setCnpj("12");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_cnpj_com_mais_de_14_digitos() {
empTest.setCnpj("123456789101213");
}
@Test
public void deve_apontar_cnpj_valido() {
empTest.setCnpj("61902722000126");
assertTrue(true);
}
@Test(expected = IllegalArgumentException.class)
public void deve_apontar_cnpj_invalido() {
empTest.setCnpj("61902722000127");
}
@Test
public void deve_apontar_igualdade_cnpj() {
assertEquals(empTest.getCnpj(), empTest.getCnpj());
}
@Test
public void nao_deve_apontar_igualdade_cnpj() {
assertThat(empTest.getCnpj(), is(not("61750345000157")));
}
@Test
public void deve_aceitar_razao_social_valida() {
empTest.setRazaoSocial("Sport Clube Corinthians Paulista");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_razaoSocial_nula() {
empTest.setRazaoSocial(null);
assertNotNull("should not be null", empTest.getRazaoSocial());
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_razaoSocial_vazio() {
empTest.setRazaoSocial("");
assertNotNull("should not be empty", empTest.getRazaoSocial());
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_razaoSocial_em_branco() {
empTest.setRazaoSocial(" ");
assertNotNull("should not be blank", empTest.getRazaoSocial());
}
@Test
public void deve_apontar_igualdade_razaoSocial() {
assertEquals("Sport Clube Corinthians Paulista", empTest.getRazaoSocial());
}
@Test
public void nao_deve_apontar_igualdade_razaoSocial() {
assertThat(empTest.getRazaoSocial(), is(not("Sociedade Esportiva Palmeiras")));
}
@Test
public void deve_aceitar_nome_fantasia_valido() {
empTest.setNomeFantasia("Corinthians");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_nomeFantasia_nulo() {
empTest.setNomeFantasia(null);
assertNotNull("should not be null", empTest.getNomeFantasia());
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_nomeFantasia_vazio() {
empTest.setNomeFantasia("");
assertNotNull("should not be empty", empTest.getRazaoSocial());
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_nomeFantasia_invalido() {
empTest.setNomeFantasia(" ");
assertNotNull("should not be blank", empTest.getNomeFantasia());
}
@Test
public void deve_apontar_igualdade_nomeFantasia() {
assertEquals("Corinthians", empTest.getNomeFantasia());
}
@Test
public void nao_deve_apontar_igualdade_nomeFantasia() {
assertThat(empTest.getNomeFantasia(), is(not("Palmeiras")));
}
@Test
public void deve_aceitar_area_atuacao_valido() {
empTest.setAreaAtuacao("Futebol");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_areaAtuacao_nula() {
empTest.setAreaAtuacao(null);
assertNotNull("should not be null", empTest.getAreaAtuacao());
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_areaAtuacao_vazio() {
empTest.setAreaAtuacao("");
assertNotNull("should not be empty", empTest.getAreaAtuacao());
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_areaAtuacao_invalido() {
empTest.setAreaAtuacao(" ");
assertNotNull("should not be blank", empTest.getAreaAtuacao());
}
@Test
public void deve_apontar_igualdade_areaAtuacao() {
assertEquals("Futebol", empTest.getAreaAtuacao());
}
@Test
public void nao_deve_apontar_igualdade_areaAtuacao() {
assertThat(empTest.getAreaAtuacao(), is(not("Aviação")));
}
@Test
public void deve_aceitar_numeroFuncionarios_valido() {
empTest.setNumeroFuncionarios("45");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numumeroFuncionarios_nulo() {
empTest.setNumeroFuncionarios(null);
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numumeroFuncionarios_vazio() {
empTest.setNumeroFuncionarios("");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numumeroFuncionarios_em_branco() {
empTest.setNumeroFuncionarios(" ");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numeroFuncionarios_com_letras() {
empTest.setNumeroFuncionarios("XXXXXX");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numeroFuncionarios_com_mais_digitos_que_o_permitido() {
empTest.setNumeroFuncionarios("1234567");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numeroFuncionarios_abaixo_do_permitido() {
empTest.setNumeroFuncionarios("0");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numeroFuncionarios_com_numeros_invalidos() {
empTest.setNumeroFuncionarios("00");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numeroFuncionarios_com_numeros_invalidos2() {
empTest.setNumeroFuncionarios("000");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numeroFuncionarios_com_numeros_invalidos3() {
empTest.setNumeroFuncionarios("0000");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numeroFuncionarios_com_numeros_invalidos4() {
empTest.setNumeroFuncionarios("00000");
}
@Test(expected = IllegalArgumentException.class)
public void nao_deve_aceitar_numeroFuncionarios_com_numeros_invalidos5() {
empTest.setNumeroFuncionarios("000000");
}
@Test
public void deve_apontar_igualdade_numeroFuncionarios() {
assertEquals("45", empTest.getNumeroFuncionarios());
}
@Test
public void nao_deve_apontar_igualdade_numFuncionarios() {
assertThat(empTest.getNumeroFuncionarios(), is(not("54")));
}
}
| [
"[email protected]"
] | |
1fa4e64e6e763e924d4e840e8dfd2f5a546f4ac1 | 0c4563e09e00fe195b10b293c06b1d3468b1efbc | /app/src/main/java/be/lorang/nuplayer/player/ExoPlayerAdapter.java | 8f23b367ff4809d8256f9fef9d4d4bff42e105a9 | [
"Apache-2.0"
] | permissive | fdammeke/NUPlayer | f5120dbe98bae1bdd33d32b1385c4659d123eb00 | 7a17531be88e9225b792cb0a7d57d0cad9a35997 | refs/heads/main | 2023-02-13T22:43:22.818203 | 2021-01-06T23:16:47 | 2021-01-06T23:16:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,327 | java | /*
* Copyright 2021 Geert Lorang
* Copyright 2016 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 be.lorang.nuplayer.player;
import android.content.Context;
import android.net.Uri;
import android.os.Handler;
import androidx.leanback.media.PlaybackGlueHost;
import androidx.leanback.media.PlayerAdapter;
import androidx.leanback.media.SurfaceHolderGlueHost;
import be.lorang.nuplayer.R;
import android.util.Log;
import android.view.SurfaceHolder;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
import com.google.android.exoplayer2.source.ExtractorMediaSource;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.util.Util;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
/**
* This implementation extends the {@link PlayerAdapter} with a {@link SimpleExoPlayer}.
*/
public class ExoPlayerAdapter extends PlayerAdapter implements ExoPlayer.EventListener{
private static String TAG = "ExoPlayerAdapter";
Context mContext;
final SimpleExoPlayer mPlayer;
SurfaceHolderGlueHost mSurfaceHolderGlueHost;
final Runnable mRunnable = new Runnable() {
@Override
public void run() {
getCallback().onCurrentPositionChanged(ExoPlayerAdapter.this);
getCallback().onBufferedPositionChanged(ExoPlayerAdapter.this);
mHandler.postDelayed(this, getUpdatePeriod());
}
};
final Handler mHandler = new Handler();
boolean mInitialized = false;
Uri mMediaSourceUri = null;
String drmToken = "";
boolean mHasDisplay;
boolean mBufferingStart;
@C.StreamType int mAudioStreamType;
/**
* Constructor.
*/
public ExoPlayerAdapter(Context context) {
mContext = context;
mPlayer = ExoPlayerFactory.newSimpleInstance(mContext,
new DefaultTrackSelector(),
new DefaultLoadControl());
mPlayer.addListener(this);
}
@Override
public void onAttachedToHost(PlaybackGlueHost host) {
if (host instanceof SurfaceHolderGlueHost) {
mSurfaceHolderGlueHost = ((SurfaceHolderGlueHost) host);
mSurfaceHolderGlueHost.setSurfaceHolderCallback(new VideoPlayerSurfaceHolderCallback());
}
}
/**
* Will reset the {@link ExoPlayer} and the glue such that a new file can be played. You are
* not required to call this method before playing the first file. However you have to call it
* before playing a second one.
*/
public void reset() {
changeToUninitialized();
mPlayer.stop();
}
void changeToUninitialized() {
if (mInitialized) {
mInitialized = false;
notifyBufferingStartEnd();
if (mHasDisplay) {
getCallback().onPreparedStateChanged(ExoPlayerAdapter.this);
}
}
}
/**
* Notify the state of buffering. For example, an app may enable/disable a loading figure
* according to the state of buffering.
*/
void notifyBufferingStartEnd() {
getCallback().onBufferingStateChanged(ExoPlayerAdapter.this,
mBufferingStart || !mInitialized);
}
/**
* Release internal {@link SimpleExoPlayer}. Should not use the object after call release().
*/
public void release() {
changeToUninitialized();
mHasDisplay = false;
mPlayer.release();
}
@Override
public void onDetachedFromHost() {
if (mSurfaceHolderGlueHost != null) {
mSurfaceHolderGlueHost.setSurfaceHolderCallback(null);
mSurfaceHolderGlueHost = null;
}
reset();
release();
}
/**
* @see SimpleExoPlayer#setVideoSurfaceHolder(SurfaceHolder)
*/
void setDisplay(SurfaceHolder surfaceHolder) {
boolean hadDisplay = mHasDisplay;
mHasDisplay = surfaceHolder != null;
if (hadDisplay == mHasDisplay) {
return;
}
mPlayer.setVideoSurfaceHolder(surfaceHolder);
if (mHasDisplay) {
if (mInitialized) {
getCallback().onPreparedStateChanged(ExoPlayerAdapter.this);
}
} else {
if (mInitialized) {
getCallback().onPreparedStateChanged(ExoPlayerAdapter.this);
}
}
}
@Override
public void setProgressUpdatingEnabled(final boolean enabled) {
mHandler.removeCallbacks(mRunnable);
if (!enabled) {
return;
}
mHandler.postDelayed(mRunnable, getUpdatePeriod());
}
int getUpdatePeriod() {
return 16;
}
@Override
public boolean isPlaying() {
boolean exoPlayerIsPlaying = mPlayer.getPlaybackState() == ExoPlayer.STATE_READY
&& mPlayer.getPlayWhenReady();
return mInitialized && exoPlayerIsPlaying;
}
@Override
public long getDuration() {
return mInitialized ? mPlayer.getDuration() : -1;
}
@Override
public long getCurrentPosition() {
return mInitialized ? mPlayer.getCurrentPosition() : -1;
}
@Override
public void play() {
if (!mInitialized || isPlaying()) {
return;
}
mPlayer.setPlayWhenReady(true);
getCallback().onPlayStateChanged(ExoPlayerAdapter.this);
getCallback().onCurrentPositionChanged(ExoPlayerAdapter.this);
}
@Override
public void pause() {
if (isPlaying()) {
mPlayer.setPlayWhenReady(false);
getCallback().onPlayStateChanged(ExoPlayerAdapter.this);
}
}
@Override
public void seekTo(long newPosition) {
if (!mInitialized) {
return;
}
mPlayer.seekTo(newPosition);
}
@Override
public long getBufferedPosition() {
return mPlayer.getBufferedPosition();
}
public Context getContext() {
return mContext;
}
/**
* Sets the media source of the player with a given URI.
*
* @return Returns <code>true</code> if uri represents a new media; <code>false</code>
* otherwise.
* @see ExoPlayer#prepare(MediaSource)
*/
public boolean setDataSource(Uri uri) {
if (mMediaSourceUri != null ? mMediaSourceUri.equals(uri) : uri == null) {
return false;
}
mMediaSourceUri = uri;
try {
prepareMediaForPlaying();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return false;
}
return true;
}
public void setDrmToken(String drmToken) {
this.drmToken = drmToken;
}
public int getAudioStreamType() {
return mAudioStreamType;
}
public void setAudioStreamType(@C.StreamType int audioStreamType) {
mAudioStreamType = audioStreamType;
}
/**
* Set {@link MediaSource} for {@link SimpleExoPlayer}. An app may override this method in order
* to use different {@link MediaSource}.
* @param uri The url of media source
* @return MediaSource for the player
*/
public MediaSource onCreateMediaSource(Uri uri) {
String userAgent = Util.getUserAgent(mContext, "ExoPlayerAdapter");
return new ExtractorMediaSource(uri,
new DefaultDataSourceFactory(mContext, userAgent),
new DefaultExtractorsFactory(),
null,
null);
}
private void prepareMediaForPlaying() throws UnsupportedEncodingException {
reset();
Log.d(TAG, "drm token = " + drmToken);
MediaItem mediaItem;
if(drmToken.length() > 0) {
String licenseServer = String.format(
getContext().getResources().getString(R.string.vudrm_server),
URLEncoder.encode(drmToken, "UTF-8"));
Log.d(TAG, "Setting licenseServer = " + licenseServer);
mediaItem = new MediaItem.Builder()
.setUri(mMediaSourceUri)
.setDrmUuid(C.WIDEVINE_UUID)
.setDrmLicenseUri(licenseServer)
.setDrmMultiSession(true)
.build();
} else {
mediaItem = new MediaItem.Builder()
.setUri(mMediaSourceUri)
.build();
}
mPlayer.setMediaItem(mediaItem);
mPlayer.prepare();
mPlayer.setAudioStreamType(mAudioStreamType);
mPlayer.setVideoListener(new SimpleExoPlayer.VideoListener() {
@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees,
float pixelWidthHeightRatio) {
getCallback().onVideoSizeChanged(ExoPlayerAdapter.this, width, height);
}
@Override
public void onRenderedFirstFrame() {
}
});
notifyBufferingStartEnd();
getCallback().onPlayStateChanged(ExoPlayerAdapter.this);
}
/**
* @return True if ExoPlayer is ready and got a SurfaceHolder if
* {@link PlaybackGlueHost} provides SurfaceHolder.
*/
@Override
public boolean isPrepared() {
return mInitialized && (mSurfaceHolderGlueHost == null || mHasDisplay);
}
/**
* Implements {@link SurfaceHolder.Callback} that can then be set on the
* {@link PlaybackGlueHost}.
*/
class VideoPlayerSurfaceHolderCallback implements SurfaceHolder.Callback {
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
setDisplay(surfaceHolder);
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
setDisplay(null);
}
}
// ExoPlayer Event Listeners
@Override
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
mBufferingStart = false;
if (playbackState == ExoPlayer.STATE_READY && !mInitialized) {
mInitialized = true;
if (mSurfaceHolderGlueHost == null || mHasDisplay) {
getCallback().onPreparedStateChanged(ExoPlayerAdapter.this);
}
} else if (playbackState == ExoPlayer.STATE_BUFFERING) {
mBufferingStart = true;
} else if (playbackState == ExoPlayer.STATE_ENDED) {
getCallback().onPlayStateChanged(ExoPlayerAdapter.this);
getCallback().onPlayCompleted(ExoPlayerAdapter.this);
}
notifyBufferingStartEnd();
}
@Override
public void onPlayerError(ExoPlaybackException error) {
getCallback().onError(ExoPlayerAdapter.this, error.type,
mContext.getString(R.string.lb_media_player_error,
error.type,
error.rendererIndex));
}
@Override
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
}
} | [
"[email protected]"
] | |
3f5554e4be25dd0854106f80ad4898f6b629fb3a | 2ee2312b954f45a95d536a71e84c79f03e9ac31c | /src/main/java/ru/alezhu/frontol_log_convert/frontol/tables/condtions/ICondition.java | 15f8c9ea450fc03ee4b1794683e168d9c608b243 | [
"MIT"
] | permissive | alezhu/Frontol_log_convert | fe2c925db62f029d16aa7dd5e09f36ddfa6fe7a3 | b11937e1ad12eb9ef67fc76cbd3caced0798c085 | refs/heads/master | 2021-01-20T18:16:22.884967 | 2016-07-20T07:04:49 | 2016-07-20T07:04:49 | 63,703,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 128 | java | package ru.alezhu.frontol_log_convert.frontol.tables.condtions;
public interface ICondition {
@Override
String toString();
}
| [
"[email protected]"
] | |
070c88f48cbea3b83a23688911a6b52ecc40c3fb | 4da2697f3614499d7e881de870fe6d18ff0c39b9 | /GPSRouting/src/com/test/xin/RegionTest.java | 3a5dcf78a135e47a4e42769d3f6f18bab5a355ae | [] | no_license | cugIE/GPSRouting | 13d6f12a42eac2b25034154b493159798e6b0d2a | 9dafce490826d3d2193c3e266a5bb2b001c8b783 | refs/heads/master | 2021-04-22T12:40:57.472516 | 2017-03-09T00:44:19 | 2017-03-09T00:44:19 | 54,687,722 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,874 | java | package com.test.xin;
import static org.junit.Assert.*;
import java.sql.SQLException;
import java.util.ArrayList;
import org.junit.Test;
import com.bean.Region;
public class RegionTest {
Region region = new Region();
@Test
public void testGetAllRegion() {
try {
assertNotEquals(Region.getAllRegion(),new ArrayList<Region>());
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Test
public void testGetAllRegionString() {
try {
assertNotEquals(Region.getAllRegion("1"),new ArrayList<Region>());
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Test
public void testGetOneRegion() {
try {
assertNotEquals(Region.getOneRegion("1"),new Region());
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Test
public void testDeleteOneRegion() throws SQLException {
//assertEquals(0,Region.deleteOneRegion("3"));
//assertEquals(0,Region.deleteOneRegion("0"));
assertEquals(0,Region.deleteOneRegion("6"));
//assertEquals(-1,Region.deleteOneRegion(null));
}
// @Test
// public void testAddOneRegion() throws SQLException {
// region.setName("region3");
// region.setBranch_id(1);
// region.setGener_id(1);
// region.setGps("{122,231}");
// region.setIntro("这是第N个region");
// region.setQrcode("/asd/dfd.jpg");
// region.setType("site");
// region.setRange(6);
// assertEquals(1,Region.addOneRegion(region));
//
// }
@Test
public void testChangeOneRegion() throws SQLException {
region.setId("5");
region.setName("region3");
region.setBranch_id(1);
region.setGener_id(1);
region.setGps("{126,231}");
region.setIntro("这是第N个region");
region.setQrcode("/asd/dfd.jpg");
region.setType("site");
assertEquals(1,Region.changeOneRegion(region));
}
}
| [
"[email protected]"
] | |
6d57c2932efc2217774c6cb3d4efb9c52e955b56 | e7d13800128dfbb9a92ae398e0a65b2a29fa79ce | /src/commonFunlibrary/CommonFuntions.java | 0bca254fd926a67cd1b2175a58052420cb97278f | [] | no_license | AjayKumarPutnala/my-project | da2465212d0e36987072594884de3495f27cd297 | e26e1d058933c662dfb44c6074a059f9136bb8c6 | refs/heads/master | 2022-07-24T08:34:19.530274 | 2020-05-22T13:48:58 | 2020-05-22T13:48:58 | 266,121,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,607 | java | package commonFunlibrary;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.Select;
import org.testng.Reporter;
import constant.PBconstant;
public class CommonFuntions extends PBconstant {
/*Project Name:
* Module Name:
* Tester Name:
* Date of Creation:
*/
public static boolean verifylogin(String username, String password)
{
driver.findElement(By.xpath(p.getProperty("enterusername"))).sendKeys(username);
driver.findElement(By.xpath(p.getProperty("enterpassword"))).sendKeys(password);
driver.findElement(By.xpath(p.getProperty("login"))).click();
if(driver.getCurrentUrl().contains(""))
{
Reporter.log("login is successful",true);
return true;
}
else
{
Reporter.log("login fail",true);
return false;
}
}
public static boolean verifylogout()
{
driver.findElement(By.xpath(p.getProperty("clicklogout"))).click();
if(driver.findElement(By.xpath(p.getProperty("login"))).isDisplayed())
{
Reporter.log("logout is successfull",true);
return true;
}
else
{
Reporter.log("logout is fail",true);
return false;
}
}
public static boolean navigatetobranches()
{
driver.findElement(By.xpath(p.getProperty("clickbranches"))).click();
if(driver.findElement(By.xpath("//span[contains(text(),'Branch Details')]")).isDisplayed())
{
Reporter.log("Branch Details page loaded successfully",true);
return true;
}
else
{
Reporter.log("Branch Details page failed to loaded",true);
return false;
}
}
public static boolean verifyNewBranchCreation(String bname,String add1,String add2,String add3,String area,String zcode,String country,String state,String city)throws Throwable
{
driver.findElement(By.xpath(p.getProperty("clicknewbranch"))).click();
driver.findElement(By.xpath(p.getProperty("enterbanme"))).sendKeys(bname);
driver.findElement(By.xpath(p.getProperty("enteradd1"))).sendKeys(add1);
driver.findElement(By.xpath(p.getProperty("enteradd2"))).sendKeys(add2);
driver.findElement(By.xpath(p.getProperty("enteradd3"))).sendKeys(add3);
driver.findElement(By.xpath(p.getProperty("enterarea"))).sendKeys(area);
driver.findElement(By.xpath(p.getProperty("enterzcode"))).sendKeys(zcode);
new Select(driver.findElement(By.xpath(p.getProperty("selectcountry")))).selectByVisibleText(country);
Thread.sleep(5000);
new Select(driver.findElement(By.xpath(p.getProperty("selectstate")))).selectByVisibleText(state);
new Select(driver.findElement(By.xpath(p.getProperty("selectcity")))).selectByVisibleText(city);
driver.findElement(By.xpath(p.getProperty("clicksubmit"))).click();
Thread.sleep(5000);
String message=driver.switchTo().alert().getText();
driver.switchTo().alert().accept();
if(message.toLowerCase().contains("New Branch with id".toLowerCase()))
{
Reporter.log(message,true);
return true;
}
else
{
Reporter.log("failed to create new branch",true);
return false;
}
}
public static boolean verfyBranchUpdation(String bname,String add1)
{
driver.findElement(By.xpath(p.getProperty("clickedit"))).click();
driver.findElement(By.xpath(p.getProperty("updatebname"))).sendKeys(bname);
driver.findElement(By.xpath(p.getProperty("updatebname"))).sendKeys(add1);
driver.findElement(By.xpath(p.getProperty("clickupdate"))).click();
String message=driver.switchTo().alert().getText();
driver.switchTo().alert().accept();
if(message.toLowerCase().contains("Branch updated Sucessfully".toLowerCase()))
{
Reporter.log(message,true);
return true;
}
else
{
Reporter.log("failed to update",true);
return false;
}
}
}
| [
"ajayp@DESKTOP-L375HS0"
] | ajayp@DESKTOP-L375HS0 |
bdbc4f1f4a7a80fab50d56de79b0e4a1a95ec61f | a51778ee2a96630785541ce331e178ce15bdc7c4 | /skola/Fel_bc/6.semestr/TJV/f2/Timetable/Timetable-ejb/src/java/timetable/model/Person.java | aaa6524390386258390ff2d7a9ed3b0103711d1a | [] | no_license | majacQ/migrace_databaze | 45ed405ab0f0fc31578264c983a4f2e4beacb528 | 51cc735d7db6db1a6454e51ae596e09711783104 | refs/heads/master | 2023-05-08T19:01:09.294920 | 2021-05-24T20:15:33 | 2021-05-24T20:15:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,591 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package timetable.model;
import java.io.Serializable;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Transient;
/**
*
* @author janf
*/
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING, name="groupname")
@NamedQueries({
@NamedQuery(name = Person.Q_GET_BY_USERNAME, query = "SELECT p FROM Person p WHERE p.username=:username")})
public class Person implements Serializable {
@Transient
public static final String Q_GET_BY_USERNAME = "Person.getByUsername";
private static final long serialVersionUID = 1L;
@Id
private String username;
private String password;
private String firstName;
private String surname;
private String city;
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Person other = (Person) obj;
if ((this.username == null) ? (other.username != null) : !this.username.equals(other.username)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 67 * hash + (this.username != null ? this.username.hashCode() : 0);
return hash;
}
@Override
public String toString() {
return "Person{" + "username=" + username + '}';
}
}
| [
"[email protected]"
] | |
f84545dcfe20d0071c0e9e35e0c71b7d11ab203f | 14f8501181be7660cf0f97b962b0693997746c25 | /src/main/java/io/freelance/management/system/web/rest/errors/EmailNotFoundException.java | dbe86d33a0147fdc4b30f16daa6bc60a21bd6461 | [] | no_license | pavindersingh/freelance-management-system | 504ee7e0a2614afc083c3369146c7ef61bb10963 | ad82f4555fbdf7ffce8ad25c949dee6e43a0f31f | refs/heads/master | 2020-03-30T09:41:47.822288 | 2018-10-01T12:49:32 | 2018-10-01T12:49:32 | 151,087,874 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | package io.freelance.management.system.web.rest.errors;
import org.zalando.problem.AbstractThrowableProblem;
import org.zalando.problem.Status;
public class EmailNotFoundException extends AbstractThrowableProblem {
private static final long serialVersionUID = 1L;
public EmailNotFoundException() {
super(ErrorConstants.EMAIL_NOT_FOUND_TYPE, "Email address not registered", Status.BAD_REQUEST);
}
}
| [
"[email protected]"
] | |
1c4bd4a0e8a27bef029d47dfa0d6f9d5aeeb3db4 | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava19/Foo66.java | 6ceb1bbfa06782ada8f873c2761fa242625cca5c | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package applicationModulepackageJava19;
public class Foo66 {
public void foo0() {
new applicationModulepackageJava19.Foo65().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
| [
"[email protected]"
] | |
97cd53363fb1cbf2c6df290c662cb6eac38f270e | c41201c6e61663062ad246680c716ae3de39b5b4 | /MethodInjection/src/main/java/com/zensar/spring/performers/Magician.java | d91c9bf9b2179562851287d0c0f45ebbe8ad8b63 | [] | no_license | Dipankar-Chakraborty/Spring | b5debf5e0b7d708568975e461174ad9acf667755 | cda3edb2d7f869556bb25491bdc92fa614529784 | refs/heads/master | 2022-12-24T10:16:16.257406 | 2020-10-13T16:43:31 | 2020-10-13T16:43:31 | 213,341,330 | 0 | 1 | null | 2020-10-13T16:43:32 | 2019-10-07T09:18:15 | Java | UTF-8 | Java | false | false | 677 | java | package com.zensar.spring.performers;
import com.zensar.spring.magicboxes.MagicBox;
public class Magician implements Performer {
private String magicWords;
private MagicBox magicBox;
public String getMagicWords() {
return magicWords;
}
public void setMagicWords(String magicWords) {
this.magicWords = magicWords;
}
public MagicBox getMagicBox() {
return magicBox;
}
public void setMagicBox(MagicBox magicBox) {
this.magicBox = magicBox;
}
@Override
public void perform() {
// TODO Auto-generated method stub
System.out.println("Magician says: "+magicWords);
System.out.println(magicBox.getContents());
}
}
| [
"[email protected]"
] | |
4909178e87dcb9ddf45388cb420977dfa777abb4 | cd9ee762fbf44783dca09767564fcfc8953a55d1 | /src/day38_Constructors/Item.java | 3c35eda4e1ee030b001610c380adb4e134e8b5ea | [] | no_license | SolmazCh/JavaSprintPractice2019 | e85ee7e392d23f7361b92679d6cf0744faadeefe | 764b332d9f34bee6cbde53eb5ed183e3e41afd07 | refs/heads/master | 2022-07-18T08:54:53.268006 | 2020-05-18T21:43:24 | 2020-05-18T21:43:24 | 257,899,445 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,554 | java | package day38_Constructors;
/*
create a class called Item
instance variables:
name, unitPrice, quantity
add a constructor that can initialize the fields
instance methods:
calcCost(): returns the total cost as double
hint: quantity * unitPrice
toString(): returns the name, unit price, quantity and total cost info as calculated by calcCost()
*/
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
public class Item {
String name;
double unitPrice;
int quantity;
public Item(String name, double unitPrice, int quantity){
this.name=name;
this.quantity=quantity;
this.unitPrice=unitPrice;
}
public double calcCost(){
return quantity*unitPrice;
}
public String toString(){
return "Item: "+name+", Unit price: "+unitPrice+", Quantity: "+quantity+", Total price: $"+calcCost();
}
}
class ShoppingList{
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("0.00");
Item item1 = new Item("potato", 2.50, 2);
Item item2 = new Item("bread", 1, 3);
Item item3 = new Item("butter", 3.50,2);
Item item4 = new Item("salt", 0.80,1);
Item item5 = new Item("tomato", 1.45, 7);
ArrayList<Item> items = new ArrayList<>(Arrays.asList(item1,item2,item3,item4,item5));
double total=0;
for(Item each: items){
total+=each.calcCost();
}
System.out.println("Total price: $"+ df.format(total));
}
} | [
"[email protected]"
] | |
b79f70d080a3846f9f036dada468c668d7f63f35 | e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f | /MazeRunner2/src/com/puttysoftware/mazerunner2/maze/objects/OrangeCrystal.java | 6c267c8061d52a342a279b5ff49fee5451e5c22c | [
"Unlicense"
] | permissive | retropipes/older-java-games | 777574e222f30a1dffe7936ed08c8bfeb23a21ba | 786b0c165d800c49ab9977a34ec17286797c4589 | refs/heads/master | 2023-04-12T14:28:25.525259 | 2021-05-15T13:03:54 | 2021-05-15T13:03:54 | 235,693,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 935 | java | /* MazeRunnerII: A Maze-Solving Game
Copyright (C) 2008-2012 Eric Ahnell
Any questions should be directed to the author via email at: [email protected]
*/
package com.puttysoftware.mazerunner2.maze.objects;
import com.puttysoftware.mazerunner2.maze.abc.AbstractProgrammableKey;
import com.puttysoftware.mazerunner2.maze.utilities.ColorConstants;
public class OrangeCrystal extends AbstractProgrammableKey {
// Constructors
public OrangeCrystal() {
super("Orange", ColorConstants.COLOR_ORANGE);
}
// Scriptability
@Override
public String getName() {
return "Orange Crystal";
}
@Override
public String getPluralName() {
return "Orange Crystals";
}
@Override
public String getDescription() {
return "Orange Crystals will open Orange Crystal Walls.";
}
@Override
public final String getIdentifierV1() {
return "";
}
} | [
"[email protected]"
] | |
41800ed7c714fa96da637c848946303b00407f27 | 7483d55e23fac76398c3741aee7b38a1a9b26216 | /src/main/java/nz/co/fortytwo/signalk/handler/JsonListHandler.java | 2c0b51208ff42683d0019a4e3fe975835ef4c603 | [
"Apache-2.0"
] | permissive | auroracg36/signalk-core-java | a0048ac8d524fd8fd0af73d790dba2605218f0c3 | 80e864d373404b0477650a435cbdfcc415c04a95 | refs/heads/master | 2020-06-30T00:30:51.496645 | 2016-11-07T02:34:43 | 2016-11-07T02:34:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,462 | java | /*
*
* Copyright (C) 2012-2014 R T Huitema. All Rights Reserved.
* Web: www.42.co.nz
* Email: [email protected]
* Author: R T Huitema
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* 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 nz.co.fortytwo.signalk.handler;
import static nz.co.fortytwo.signalk.util.SignalKConstants.CONTEXT;
import static nz.co.fortytwo.signalk.util.SignalKConstants.LIST;
import static nz.co.fortytwo.signalk.util.SignalKConstants.PATH;
import static nz.co.fortytwo.signalk.util.SignalKConstants.dot;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import mjson.Json;
import nz.co.fortytwo.signalk.util.SignalKConstants;
import nz.co.fortytwo.signalk.util.Util;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger;
import com.google.common.collect.ImmutableList;
/**
* Handles json messages with 'list' requests
*
* @author robert
*
*/
public class JsonListHandler {
private static Logger logger = LogManager.getLogger(JsonListHandler.class);
//private static DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
private List<String> keys = new ArrayList<String>();
public JsonListHandler(){
//get a cache all the signalk keys we know about
for(Field f: SignalKConstants.class.getFields()){
try {
//we only want the model keys
if(f.getName().startsWith("nav")
||f.getName().startsWith("resources")
||f.getName().startsWith("env")
||f.getName().startsWith("alarms")
||f.getName().startsWith("communication")
||f.getName().startsWith("design")
||f.getName().startsWith("electrical")
||f.getName().startsWith("performance")
||f.getName().startsWith("propulsion")
||f.getName().startsWith("sensors")
||f.getName().startsWith("sources")
||f.getName().startsWith("steering")
||f.getName().startsWith("notifications")
||f.getName().startsWith("registrations")
||f.getName().startsWith("sails")
||f.getName().startsWith("notifications")
||f.getName().startsWith("tanks")
||f.getName().startsWith("uuid")
||f.getName().startsWith("mmsi")
||f.getName().startsWith("flag")
||f.getName().startsWith("url")
||f.getName().startsWith("port")
||f.getName().startsWith("name")){
keys.add(f.get(null).toString());
if(logger.isDebugEnabled())logger.debug("Added "+f.get(null).toString());
}else{
if(logger.isDebugEnabled())logger.debug("AVOID: "+f.get(null).toString());
}
} catch (IllegalArgumentException e) {
logger.warn(e.getMessage());
} catch (IllegalAccessException e) {
logger.warn(e.getMessage());
}
}
}
public Json handle(Json node) throws Exception {
//deal with diff format
if(logger.isDebugEnabled())logger.debug("Checking for list "+node );
//go to context
String context = node.at(CONTEXT).asString();
//TODO: is the context and path valid? A DOS attack is possible if we allow numerous crap/bad paths?
Json paths = node.at(LIST);
Json pathList = Json.array();
if(paths!=null){
if(paths.isArray()){
for(Json path: paths.asJsonList()){
parseList(context, path, pathList);
}
}
if(logger.isDebugEnabled())logger.debug("Found list "+pathList );
if(logger.isDebugEnabled())logger.debug("Class type "+pathList.getClass() );
}
return pathList;
}
/**
*
* <pre>{
"path": "navigation.speedThroughWater",
}
</pre>
* @param context
* @param list
* @throws Exception
*/
private void parseList( String context, Json path, Json pathList) throws Exception {
//get values
String regexKey = path.at(PATH).asString();
if(logger.isDebugEnabled())logger.debug("Parsing list "+regexKey );
List<String> rslt = getMatchingPaths(regexKey);
//add to pathList
for(String p: rslt){
pathList.add(context+dot+p);
}
}
/**
* Returns a list of paths that this implementation is currently providing.
* The list is filtered by the key if it is not null or empty in which case a full list is returned,
* supports * and ? wildcards.
* @param regex
* @param regexKey
* @return
*/
public List<String> getMatchingPaths(String regex) {
if(StringUtils.isBlank(regex)){
return ImmutableList.copyOf(keys);
}
regex=Util.sanitizePath(regex);
if(logger.isDebugEnabled())logger.debug("Regexing " + regex);
Pattern pattern = Util.regexPath(regex);
List<String> paths = new ArrayList<String>();
for (String p : keys) {
if (pattern.matcher(p).matches()) {
if(logger.isDebugEnabled())logger.debug("Adding path:" + p);
paths.add(p);
}
}
return paths;
}
}
| [
"[email protected]"
] | |
912432d40d808ed6683236c1c6d4bceea545435b | 8d190ede2c600daaad10490ef95f0ddddec90e60 | /src/main/java/com/citysearch/webwidget/api/bean/LocationProfile.java | 1d38776f8090ddbdb9ed8fd32916874a6cc38092 | [
"Apache-2.0"
] | permissive | lhung/web-widgets | 705593c7c19ff5f6d461c744f928a2235316a179 | 1dc992544a01b5c9a2b522329289fd1faddaa303 | refs/heads/master | 2021-01-16T19:54:25.633953 | 2010-08-16T08:29:46 | 2010-08-16T08:29:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,655 | java | package com.citysearch.webwidget.api.bean;
public class LocationProfile {
private String listingId;
private String street;
private String city;
private String state;
private String postalCode;
private String phone;
private String reviewCount;
private String imageUrl;
private String profileUrl;
private String sendToFriendUrl;
private String reviewsUrl;
private String websiteUrl;
private String menuUrl;
private String mapUrl;
private String reservationUrl;
private ReviewResponse review;
public String getListingId() {
return listingId;
}
public void setListingId(String listingId) {
this.listingId = listingId;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getReviewCount() {
return reviewCount;
}
public void setReviewCount(String reviewCount) {
this.reviewCount = reviewCount;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getProfileUrl() {
return profileUrl;
}
public void setProfileUrl(String profileUrl) {
this.profileUrl = profileUrl;
}
public String getSendToFriendUrl() {
return sendToFriendUrl;
}
public void setSendToFriendUrl(String sendToFriendUrl) {
this.sendToFriendUrl = sendToFriendUrl;
}
public String getReviewsUrl() {
return reviewsUrl;
}
public void setReviewsUrl(String reviewsUrl) {
this.reviewsUrl = reviewsUrl;
}
public String getWebsiteUrl() {
return websiteUrl;
}
public void setWebsiteUrl(String websiteUrl) {
this.websiteUrl = websiteUrl;
}
public String getMenuUrl() {
return menuUrl;
}
public void setMenuUrl(String menuUrl) {
this.menuUrl = menuUrl;
}
public String getMapUrl() {
return mapUrl;
}
public void setMapUrl(String mapUrl) {
this.mapUrl = mapUrl;
}
public String getReservationUrl() {
return reservationUrl;
}
public void setReservationUrl(String reservationUrl) {
this.reservationUrl = reservationUrl;
}
public ReviewResponse getReview() {
return review;
}
public void setReview(ReviewResponse review) {
this.review = review;
}
}
| [
"aspert@aspert-laptop.(none)"
] | aspert@aspert-laptop.(none) |
662b853f03b188abfcfc471407a415461a01d7f6 | 67cc4d2864d4f40561ca42876bde30d159221b9e | /app/src/main/java/com/android/tse/alipayutils/net/FastClientBuilder.java | e6a68b9d19046d71017578b8b76fe10e19109a44 | [] | no_license | tse5601/AliPayTask | b134036cbf0509dd5add34d2b5ada531f3d6fb9e | d9746519b047defa39cfbbc524f1c19adbc12dbf | refs/heads/master | 2021-04-06T10:24:41.589280 | 2018-03-11T15:21:45 | 2018-03-11T15:21:45 | 124,760,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,898 | java | package com.android.tse.alipayutils.net;
import android.content.Context;
import java.io.File;
import java.util.WeakHashMap;
/**
* Created by Tse on 2018/1/11.
*/
public class FastClientBuilder {
private static final WeakHashMap<String, Object> PARAMS = getParams();
private String mUrl = null;
private Context mContext = null;
private File mFile = null;
private String mDownloadDir = null;
private String mExtension = null;
private String mName = null;
private static final class ParamsHolder {
private static final WeakHashMap<String, Object> PARAMS = new WeakHashMap<>();
}
public static WeakHashMap<String, Object> getParams() {
return ParamsHolder.PARAMS;
}
FastClientBuilder() {
}
public final FastClientBuilder url(String url) {
this.mUrl = url;
return this;
}
public final FastClientBuilder params(WeakHashMap<String, Object> params) {
PARAMS.putAll(params);
return this;
}
public final FastClientBuilder params(String key, Object value) {
PARAMS.put(key, value);
return this;
}
public final FastClientBuilder file(File file) {
this.mFile = file;
return this;
}
public final FastClientBuilder file(String file) {
this.mFile = new File(file);
return this;
}
public final FastClientBuilder name(String name) {
this.mName = name;
return this;
}
public final FastClientBuilder dir(String dir) {
this.mDownloadDir = dir;
return this;
}
public final FastClientBuilder extension(String extension) {
this.mExtension = extension;
return this;
}
public final FastBuildClient build() {
return new FastBuildClient(mUrl,
mDownloadDir, mExtension, mName,
mFile, mContext);
}
}
| [
"[email protected]"
] | |
72eba6c8813a136463473a0dee9aaa963c4804e9 | d81a6ebfcacb4db6cc2c59b8dd8b56835f905faf | /src/main/java/yzp/chat/dm/Model/Response.java | ada83de05056f47d5c595c36a62f1fc49fa1bad0 | [] | no_license | ZPMAX/chat | 0db934b48361427636438a056d7d39c910cbc6d8 | 9c4662911e52372c5c66e7f515049eaf1a8026c1 | refs/heads/master | 2020-09-16T10:20:15.810847 | 2019-12-11T13:30:22 | 2019-12-11T13:30:22 | 223,740,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 207 | java | package yzp.chat.dm.Model;
/**
* ClassName:
* PackgeName:
*
* @date:2019/12/7 20:19
* @author:多堕大手笔的萨克
**/
public class Response<T> {
String msg;
T data;
int code = 200;
}
| [
"[email protected]"
] | |
ceec58d38c72d1e0b9572b130308da6214fb5e51 | b39d7e1122ebe92759e86421bbcd0ad009eed1db | /sources/android/hardware/radio/V1_0/CdmaSmsAddress.java | 1fe63a7ece04388f3573f1559564a38b3cde724e | [] | no_license | AndSource/miuiframework | ac7185dedbabd5f619a4f8fc39bfe634d101dcef | cd456214274c046663aefce4d282bea0151f1f89 | refs/heads/master | 2022-03-31T11:09:50.399520 | 2020-01-02T09:49:07 | 2020-01-02T09:49:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,624 | java | package android.hardware.radio.V1_0;
import android.os.HidlSupport;
import android.os.HwBlob;
import android.os.HwParcel;
import java.util.ArrayList;
import java.util.Objects;
public final class CdmaSmsAddress {
public int digitMode;
public ArrayList<Byte> digits = new ArrayList();
public int numberMode;
public int numberPlan;
public int numberType;
public final boolean equals(Object otherObject) {
if (this == otherObject) {
return true;
}
if (otherObject == null || otherObject.getClass() != CdmaSmsAddress.class) {
return false;
}
CdmaSmsAddress other = (CdmaSmsAddress) otherObject;
if (this.digitMode == other.digitMode && this.numberMode == other.numberMode && this.numberType == other.numberType && this.numberPlan == other.numberPlan && HidlSupport.deepEquals(this.digits, other.digits)) {
return true;
}
return false;
}
public final int hashCode() {
return Objects.hash(new Object[]{Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.digitMode))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.numberMode))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.numberType))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.numberPlan))), Integer.valueOf(HidlSupport.deepHashCode(this.digits))});
}
public final String toString() {
StringBuilder builder = new StringBuilder();
builder.append("{");
builder.append(".digitMode = ");
builder.append(CdmaSmsDigitMode.toString(this.digitMode));
builder.append(", .numberMode = ");
builder.append(CdmaSmsNumberMode.toString(this.numberMode));
builder.append(", .numberType = ");
builder.append(CdmaSmsNumberType.toString(this.numberType));
builder.append(", .numberPlan = ");
builder.append(CdmaSmsNumberPlan.toString(this.numberPlan));
builder.append(", .digits = ");
builder.append(this.digits);
builder.append("}");
return builder.toString();
}
public final void readFromParcel(HwParcel parcel) {
readEmbeddedFromParcel(parcel, parcel.readBuffer(32), 0);
}
public static final ArrayList<CdmaSmsAddress> readVectorFromParcel(HwParcel parcel) {
ArrayList<CdmaSmsAddress> _hidl_vec = new ArrayList();
HwBlob _hidl_blob = parcel.readBuffer(16);
int _hidl_vec_size = _hidl_blob.getInt32(8);
HwBlob childBlob = parcel.readEmbeddedBuffer((long) (_hidl_vec_size * 32), _hidl_blob.handle(), 0, true);
_hidl_vec.clear();
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
CdmaSmsAddress _hidl_vec_element = new CdmaSmsAddress();
_hidl_vec_element.readEmbeddedFromParcel(parcel, childBlob, (long) (_hidl_index_0 * 32));
_hidl_vec.add(_hidl_vec_element);
}
return _hidl_vec;
}
public final void readEmbeddedFromParcel(HwParcel parcel, HwBlob _hidl_blob, long _hidl_offset) {
HwBlob hwBlob = _hidl_blob;
this.digitMode = hwBlob.getInt32(_hidl_offset + 0);
this.numberMode = hwBlob.getInt32(_hidl_offset + 4);
this.numberType = hwBlob.getInt32(_hidl_offset + 8);
this.numberPlan = hwBlob.getInt32(_hidl_offset + 12);
int _hidl_vec_size = hwBlob.getInt32((_hidl_offset + 16) + 8);
HwBlob childBlob = parcel.readEmbeddedBuffer((long) (_hidl_vec_size * 1), _hidl_blob.handle(), (_hidl_offset + 16) + 0, true);
this.digits.clear();
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
this.digits.add(Byte.valueOf(childBlob.getInt8((long) (_hidl_index_0 * 1))));
}
}
public final void writeToParcel(HwParcel parcel) {
HwBlob _hidl_blob = new HwBlob(32);
writeEmbeddedToBlob(_hidl_blob, 0);
parcel.writeBuffer(_hidl_blob);
}
public static final void writeVectorToParcel(HwParcel parcel, ArrayList<CdmaSmsAddress> _hidl_vec) {
HwBlob _hidl_blob = new HwBlob(16);
int _hidl_vec_size = _hidl_vec.size();
_hidl_blob.putInt32(8, _hidl_vec_size);
_hidl_blob.putBool(12, false);
HwBlob childBlob = new HwBlob(_hidl_vec_size * 32);
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
((CdmaSmsAddress) _hidl_vec.get(_hidl_index_0)).writeEmbeddedToBlob(childBlob, (long) (_hidl_index_0 * 32));
}
_hidl_blob.putBlob(0, childBlob);
parcel.writeBuffer(_hidl_blob);
}
public final void writeEmbeddedToBlob(HwBlob _hidl_blob, long _hidl_offset) {
_hidl_blob.putInt32(_hidl_offset + 0, this.digitMode);
_hidl_blob.putInt32(4 + _hidl_offset, this.numberMode);
_hidl_blob.putInt32(_hidl_offset + 8, this.numberType);
_hidl_blob.putInt32(_hidl_offset + 12, this.numberPlan);
int _hidl_vec_size = this.digits.size();
_hidl_blob.putInt32((_hidl_offset + 16) + 8, _hidl_vec_size);
_hidl_blob.putBool((_hidl_offset + 16) + 12, false);
HwBlob childBlob = new HwBlob(_hidl_vec_size * 1);
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
childBlob.putInt8((long) (_hidl_index_0 * 1), ((Byte) this.digits.get(_hidl_index_0)).byteValue());
}
_hidl_blob.putBlob((16 + _hidl_offset) + 0, childBlob);
}
}
| [
"[email protected]"
] | |
85c71d0116ba38ff0a5e2ba12596596290df942e | 122e309191049117d199ae5898a5a8fd4a302fbc | /JAVA/Contact/src/main/java/Main.java | b8e296bea3dd6103b98ec9267fc198b99a5296b4 | [] | no_license | NikitaBatalskiy/SkillsUpHW | da3067e6578623646dbf5a88fac328d939cf50de | c61e9eb74856f77070be7176f039600203de94b3 | refs/heads/master | 2020-04-11T09:40:34.276333 | 2019-05-30T17:09:51 | 2019-05-30T17:09:51 | 161,687,257 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 157 | java | import services.impl.ComandLineServiceImpl;
public class Main {
public static void main(String[] args) {
ComandLineServiceImpl.start();
}
}
| [
"[email protected]"
] | |
e65c7cbb3724c93af593cc3b27f5c321fcb424b4 | a98c62922a66e11456acf435255314a9ef4233a5 | /src/test/java/com/kodcu/ParaCekmeSteps.java | 2c998be61c331423683a5266df9ee4111abbc53a | [] | no_license | altuga/BDD-Ornek-01 | deb01312833b78f6a43b06c786b22d1f118736d3 | c2ac583749c45f37c5b3943988bfa722adc045fb | refs/heads/master | 2020-12-24T06:08:22.976277 | 2016-07-21T11:30:42 | 2016-07-21T11:30:42 | 63,863,088 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,182 | java |
package com.kodcu;
import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import cucumber.api.java.tr.Diyelimki;
import cucumber.api.java.tr.Eğerki;
import cucumber.api.java.tr.Ozaman;
import org.junit.Assert;
public class ParaCekmeSteps {
int hesapAcilisMiktari;
int cekilenParaMiktari;
int sistemTarafindanVerilenMiktar;
int hesapKalanMiktari;
@Diyelimki("^Bankada şu kadar param var (\\d+)TRY$")
public void bankadaŞuKadarParamVarTRY(int hesapAcilisMiktari) throws Throwable {
this.hesapAcilisMiktari = hesapAcilisMiktari;
}
@Eğerki("^(\\d+)TRY miktarında para çekersem$")
public void tryMiktarındaParaÇekersem(int cekilenParaMiktari) throws Throwable {
this.cekilenParaMiktari = cekilenParaMiktari;
}
@Ozaman("^Hesabımda da kalan miktarında bu olması beklerim : (\\d+)TRY$")
public void hesabımdaDaKalanMiktarındaBuOlmasıBeklerimTRY(int hesabimdaKalan) throws Throwable {
int kalanMiktar = hesapAcilisMiktari - cekilenParaMiktari ;
Assert.assertEquals(kalanMiktar, hesabimdaKalan);
}
} | [
"upux1234"
] | upux1234 |
ffebda9159e56d705fcdee8fd4350750602ce1c9 | 827080210065647f80807aee90ca6026ff47b352 | /ldz-crm/ldz-crm-core/src/main/java/pl/altkom/ldz/crm/core/model/Commodity.java | 560a8df8bd9e3f87ae41293a4b4b4f9949f6553c | [
"Apache-2.0"
] | permissive | alapierre/LDZ_2015_08-07 | 55fe62bafa874c8b9f9aeee2906887e07a634a6e | ea937fc1a04b7a008e8fcac46dc2fffb583f1e64 | refs/heads/master | 2021-05-16T03:05:41.082798 | 2015-08-07T13:48:42 | 2015-08-07T13:48:42 | 40,345,195 | 0 | 0 | Apache-2.0 | 2020-10-13T17:19:50 | 2015-08-07T06:38:13 | Java | UTF-8 | Java | false | false | 612 | java | /*
* Copyright 2015-08-07the original author or authors.
*/
package pl.altkom.ldz.crm.core.model;
import javax.persistence.Entity;
/**
*
* @author Adrian Lapierre <[email protected]>
*/
@Entity
public class Commodity extends BaseEntity{
private String name;
private double price;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
}
| [
"student@G7_1"
] | student@G7_1 |
daa616ce363883980677deee42e7b9775225afda | d6f2623726732ac28653a5cd71ea2f4d9f67f3b9 | /src/main/java/com/java/collections/IntegerList.java | 24883c31073ace3595146e1705d5bb9797d1e8e5 | [] | no_license | ketulpatel03-zz/CustomCollectionsSort | de8e024d39d846e834daf8c09108e2bbd043a238 | 90adc0769d5e8db55a9f6daadf951f7009c2a40d | refs/heads/master | 2023-03-28T03:46:52.281565 | 2021-04-01T08:25:47 | 2021-04-01T08:25:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 514 | java | package com.java.collections;
import java.util.ArrayList;
import java.util.Collections;
import com.java.utility.MyUtility;
public class IntegerList {
public static void main(String[] args) {
ArrayList<Integer> integerList = new ArrayList<>();
integerList.add(10);
integerList.add(5);
integerList.add(7);
integerList.add(9);
integerList.add(3);
MyUtility.printList(integerList);
Collections.sort(integerList);
System.out.println("Sorted List : ");
MyUtility.printList(integerList);
}
}
| [
"[email protected]"
] | |
f0e59229409a132624137a0dc31e57a67dfac357 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/39/org/apache/commons/lang3/time/FastDateFormat_estimateLength_1454.java | 2879df120d321279c5768961c3437cc619632a89 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 2,675 | java |
org apach common lang3 time
fast date format fastdateformat fast thread safe version
link java text simpl date format simpledateformat
direct replac
code simpl date format simpledateformat code format situat
multi thread server environ
code simpl date format simpledateformat code thread safe jdk version
sun close bug rfe
format support pattern compat
simpl date format simpledateformat time zone
java introduc pattern letter code 'z' code repres
time zone rfc822 format code code code code
pattern letter jdk version
addit pattern code zz' 'zz' code made repres
iso8601 full format time zone code code code code
introduc minor incompat java gain
function
author apach softwar foundat
author tea trove teatrov project
author brian neill o'neil
author sean schofield
author gari gregori
author nikolai metchev
version
fast date format fastdateformat format
inherit doc inheritdoc
estim length estimatelength
rule mrule estim length estimatelength
| [
"[email protected]"
] | |
4ff51e19ca723bab3436ccebe86077db89f47b27 | b75baf472ab96f785d35df328c535210c80da07f | /src/main/java/fr/ifremer/sensornanny/sync/manager/DataFileManager.java | f8d44aaa09908368684d7a81826b767317e7ea6a | [] | no_license | ifremer/snanny-elastic-sync | d0fbbe8e0bc20339bdc718c70dec3467ebb6b903 | d07ca7e60e2a0fb9f7da63ead2377b4e48442c36 | refs/heads/master | 2020-05-21T13:30:21.947362 | 2017-11-10T16:18:14 | 2017-11-10T16:18:14 | 48,178,622 | 0 | 0 | null | 2016-09-02T15:07:26 | 2015-12-17T14:23:10 | Java | UTF-8 | Java | false | false | 1,354 | java | package fr.ifremer.sensornanny.sync.manager;
import java.util.Set;
import org.springframework.util.Assert;
import com.google.inject.Inject;
import fr.ifremer.sensornanny.sync.io.DataFileReader;
import fr.ifremer.sensornanny.sync.io.OwnCloudFileReader;
/**
* A manager used to recover the {@link DataFileReader} implementation based on the filename extension.
* The specific Readers are linked by Guice Multibinding
* @see fr.ifremer.sensornanny.sync.ElasticSyncModule
* @author gpagniez
*/
public class DataFileManager {
@Inject
private Set<DataFileReader> readers;
@Inject
private OwnCloudFileReader standard;
/**
* Recover the reader instance from the given filename
* @param fileName - a full filename
* @return if any specific reader is linked to the extension with {@link DataFileReader#getExtension()}, it returns
* the proper reader. If the extension doesn't match any of thoses, it return the {@link OwnCloudFileReader}
*/
public DataFileReader getReader(String fileName){
Assert.hasText(fileName, "Invalid parameter : fileName should not be empty");
String extension = fileName.substring(fileName.lastIndexOf("."));
return readers.stream()
.filter(x -> extension.equals(x.getExtension()))
.findFirst().orElse(standard);
}
}
| [
"[email protected]"
] | |
63e976a0853c0a4e6c3a3afaad8e574ac248e509 | bf95ac98df42770901273bece8b83620d8744741 | /Assignment 2/Pattern14.java | 740f7cecc053984c73871c63680bc4202601c96a | [] | no_license | AkashGorle-crypto/EDACmay2021 | 4d497d641271093ba924b83018b0f5412b20f3ca | 81c32c498d7efdbc647a75df488544a0257ca454 | refs/heads/main | 2023-04-19T13:14:06.371455 | 2021-05-09T20:09:38 | 2021-05-09T20:09:38 | 365,245,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 428 | java | import java.util.*;
public class Pattern14
{
public static void main(String args[]) {
Scanner scan= new Scanner(System.in);
System.out.println("Enter number of rows: ");
int rows=scan.nextInt();
for(int i = rows; i >= 1; --i)
{
for(int j = 1; j <= i; ++j)
{
System.out.print(j+" ");
}
System.out.println("\n");
}
}
} | [
"[email protected]"
] | |
aa829a9a32b0d24cc620679f460698d4cd6332f2 | ddbacea16e6eb36564a9df145b8ee3bc32f325cd | /src/main/java/ee/taltech/volatilator/configuration/CachingConfig.java | acd36044af9a15e746f83e68d7b1db1c401b2f42 | [] | no_license | cybercubes/stock-volatilator-3000 | 287b185948142d0b2b0d9595acaf89c10551c82a | 5026925a5c7042d63e3e5fcf637cb7b83677257f | refs/heads/main | 2023-02-14T15:43:03.177969 | 2021-01-15T16:28:10 | 2021-01-15T16:28:10 | 329,964,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 514 | java | package ee.taltech.volatilator.configuration;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableCaching
public class CachingConfig {
@Bean
public CacheManager cacheManager(){
return new ConcurrentMapCacheManager("responses");
}
}
| [
"[email protected]"
] | |
75801114859577a023dfda1596c25fc38b4be071 | b334835296ff9a769cdc2b0cc3250d02622bb87a | /src/androidTest/java/com/example/tugasaris/ExampleInstrumentedTest.java | 734cfebf68e68c1b8e41206af4d90e675d0cae59 | [] | no_license | sandi-aris/AndroidPemula_Dicoding | ff50ccc0493b08a24e075ffb9fbdc73bcacc37c6 | b03259b88276031b28031a8ffeb7d4b327be8c63 | refs/heads/master | 2022-11-11T21:09:34.812262 | 2020-07-09T06:58:26 | 2020-07-09T06:58:26 | 278,284,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 752 | java | package com.example.tugasaris;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.tugasaris", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
1a897933bbc46e547ad1e326df1d0211cf04c0fb | 0c2147bf1bc7ec5bfe470f90e5e1cc501ccc7ca7 | /src/battle/of/hero/View/Over.java | 395c8be2fe46ed1c0f7d12003433748a5ae2e24f | [] | no_license | Compek08/BH-Baru | 811f6f7be0de85eb54309db447630f0bcd820a69 | 9de9d2f1ff67563e76cbab3f6322c3702b796f5c | refs/heads/master | 2020-04-07T12:50:08.426594 | 2018-12-05T23:29:58 | 2018-12-05T23:29:58 | 158,383,100 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,932 | java | package battle.of.hero.View;
/*
* 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.
*/
/**
*
* @author rakas
*/
public class Over extends javax.swing.JFrame {
/**
* Creates new form Over
*/
public Over(int secor) {
initComponents();
Score.setText("" + secor);
if (secor > 300) {
Panda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Picture/Lopek Besar.png")));
Panda1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Picture/Lopek Besar.png")));
} else if (secor < 300) {
Panda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Picture/Nangis Besar.png")));
Panda1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Picture/Nangis Besar.png")));
} else {
Panda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Picture/Seneng Besar.png")));
Panda1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Picture/Seneng Besar.png")));
}
}
/**
* 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() {
start = new javax.swing.JButton();
Panda = new javax.swing.JLabel();
Score = new javax.swing.JLabel();
Panda1 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle(" KUIS CERDAS MATEMATIKA V 2.0.0");
setAlwaysOnTop(true);
setResizable(false);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
start.setBackground(new java.awt.Color(51, 255, 51));
start.setFont(new java.awt.Font("Bell MT", 1, 36)); // NOI18N
start.setText("MAIN MENU");
start.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
start.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
startMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
startMouseExited(evt);
}
});
start.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
startActionPerformed(evt);
}
});
getContentPane().add(start, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 490, 270, -1));
Panda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Picture/Lopek Besar.png"))); // NOI18N
Panda.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
Panda.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
PandaMouseClicked(evt);
}
});
getContentPane().add(Panda, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 220, 410, 472));
Panda.getAccessibleContext().setAccessibleDescription("");
Score.setFont(new java.awt.Font("Bell MT", 1, 150)); // NOI18N
Score.setForeground(new java.awt.Color(247, 224, 23));
Score.setText("500");
getContentPane().add(Score, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 290, 290, 140));
Panda1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Picture/Lopek Besar.png"))); // NOI18N
Panda1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
Panda1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
Panda1MouseClicked(evt);
}
});
getContentPane().add(Panda1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 220, 410, 472));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Background/Over.png"))); // NOI18N
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1100, 690));
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void PandaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_PandaMouseClicked
// Random regen = new Random();
// int acak = regen.nextInt(12);
// // Panda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Picture/Nangis.png")));
// Panda.setIcon(new javax.swing.ImageIcon(getClass().getResource(panda[acak])));
}//GEN-LAST:event_PandaMouseClicked
private void Panda1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Panda1MouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_Panda1MouseClicked
private void startMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_startMouseEntered
start.setBackground(new java.awt.Color(255, 255, 102));
}//GEN-LAST:event_startMouseEntered
private void startMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_startMouseExited
start.setBackground(new java.awt.Color(51, 255, 51));
}//GEN-LAST:event_startMouseExited
private void startActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startActionPerformed
MainMenu MainMenu = new MainMenu();
MainMenu.setVisible(true);
this.dispose();
}//GEN-LAST:event_startActionPerformed
/**
* @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(Over.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Over.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Over.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Over.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 Over().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private static javax.swing.JLabel Panda;
private static javax.swing.JLabel Panda1;
private static javax.swing.JLabel Score;
private javax.swing.JLabel jLabel1;
private javax.swing.JButton start;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
7d5239fbb232ffd21423fb49f51c43625bbd87aa | 5a6e732ab094e3a984a36e27e05a9ff2116d8ae4 | /core/src/main/java/com/github/ixtf/api/Util.java | edbbcf4d34eb54c23dded86cc45b6ffe8945ff6d | [] | no_license | ixtf/micro-service | d94d2795647295178e8501e79973fca3adf795d0 | a29a24ab05a9668cb586853be3f3ebccf4801e2a | refs/heads/master | 2023-01-23T08:18:35.259524 | 2020-12-07T13:06:53 | 2020-12-07T13:06:53 | 318,888,958 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,950 | java | package com.github.ixtf.api;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.github.ixtf.japp.core.J;
import com.sun.security.auth.UserPrincipal;
import io.opentracing.Span;
import io.opentracing.Tracer;
import io.opentracing.propagation.TextMapAdapter;
import io.vertx.core.eventbus.Message;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import lombok.SneakyThrows;
import javax.validation.ConstraintViolationException;
import javax.validation.Validation;
import java.io.File;
import java.io.IOException;
import java.security.Principal;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import static com.github.ixtf.japp.core.Constant.MAPPER;
import static io.opentracing.propagation.Format.Builtin.TEXT_MAP;
import static java.util.Optional.ofNullable;
import static java.util.stream.Collectors.toMap;
public class Util {
@SneakyThrows(IOException.class)
public static <T> T checkAndGetCommand(Class<T> clazz, byte[] bytes) {
final T command = MAPPER.readValue(bytes, clazz);
return checkAndGetCommand(command);
}
@SneakyThrows(JsonProcessingException.class)
public static <T> T checkAndGetCommand(Class<T> clazz, String json) {
final T command = MAPPER.readValue(json, clazz);
return checkAndGetCommand(command);
}
public static <T> T checkAndGetCommand(Class<T> clazz, JsonNode jsonNode) {
final T command = MAPPER.convertValue(jsonNode, clazz);
return checkAndGetCommand(command);
}
public static <T> T checkAndGetCommand(Class<T> clazz, JsonObject jsonObject) {
return checkAndGetCommand(clazz, jsonObject.encode());
}
public static <T> T checkAndGetCommand(Class<T> clazz, JsonArray jsonArray) {
return checkAndGetCommand(clazz, jsonArray.encode());
}
public static <T> T checkAndGetCommand(T command) {
final var validatorFactory = Validation.buildDefaultValidatorFactory();
final var validator = validatorFactory.getValidator();
final var violations = validator.validate(command);
if (J.nonEmpty(violations)) {
throw new ConstraintViolationException(violations);
}
return command;
}
public static JsonObject config(final String env, final String defaultV) {
return ofNullable(System.getenv(env))
.filter(J::nonBlank)
.or(() -> ofNullable(defaultV))
.map(J::getFile)
.filter(File::exists)
.filter(File::canRead)
.map(J::readYaml)
.map(JsonNode::toString)
.map(JsonObject::new)
.orElseGet(JsonObject::new);
}
public static Optional<Span> spanOpt(final Optional<Tracer> tracerOpt, final String operationName, final Map map) {
return tracerOpt.map(tracer -> {
final var spanBuilder = tracer.buildSpan(operationName);
ofNullable(tracer.extract(TEXT_MAP, new TextMapAdapter(map))).ifPresent(spanBuilder::asChildOf);
return spanBuilder.start();
});
}
public static Optional<Span> spanOpt(final Optional<Tracer> tracerOpt, final String operationName, final Message message) {
return tracerOpt.map(tracer -> {
final var spanBuilder = tracer.buildSpan(operationName);
final var map = J.<String, String>newHashMap();
message.headers().forEach(entry -> map.put(entry.getKey(), entry.getValue()));
ofNullable(tracer.extract(TEXT_MAP, new TextMapAdapter(map))).ifPresent(spanBuilder::asChildOf);
return spanBuilder.start();
});
}
public static Optional<Principal> principalOpt(final Message message) {
return ofNullable(message.headers())
.map(it -> it.get(Principal.class.getName()))
.filter(J::nonBlank)
.map(UserPrincipal::new);
}
public static Optional<Span> spanOpt(final Optional<Tracer> tracerOpt, final String operationName, final com.rabbitmq.client.Delivery delivery) {
return tracerOpt.map(tracer -> {
final var spanBuilder = tracer.buildSpan(operationName);
final var map = Optional.ofNullable(delivery)
.map(com.rabbitmq.client.Delivery::getProperties)
.map(com.rabbitmq.client.AMQP.BasicProperties::getHeaders)
.map(Map::entrySet)
.stream().parallel()
.flatMap(Collection::parallelStream)
.filter(it -> it.getValue() instanceof String)
.collect(toMap(Map.Entry::getKey, it -> it.getValue().toString()));
ofNullable(tracer.extract(TEXT_MAP, new TextMapAdapter(map))).ifPresent(spanBuilder::asChildOf);
return spanBuilder.start();
});
}
}
| [
"[email protected]"
] | |
7221023695b0b22e8d98a8294e76fa60918bc70e | a3f9ae85b78a4efea29f3743bcbbf2d2ea9dcf2b | /src/main/java/flaxbeard/sprockets/items/ItemWrench.java | 3c11d6a971ad23fcacf5740e92d99212691c4fe5 | [
"MIT"
] | permissive | Flaxbeard/Sprockets | f3fc28c06a929864ca60d22ddd7c2f4eaa6ec72e | 0a585c77a4571e80bb42c164fad1074b612dd489 | refs/heads/master | 2021-01-17T10:23:36.406845 | 2016-07-05T19:01:50 | 2016-07-05T19:01:50 | 58,058,922 | 1 | 1 | null | 2016-05-23T22:12:15 | 2016-05-04T14:32:29 | Java | UTF-8 | Java | false | false | 202 | java | package flaxbeard.sprockets.items;
import flaxbeard.sprockets.api.tool.IWrench;
public class ItemWrench extends ItemSprocketBase implements IWrench
{
public ItemWrench()
{
super("wrench");
}
}
| [
"[email protected]"
] | |
3d0c8a7be8dee0bf6b49ccabfc202478bec60ff5 | 9b5282e7dd522218319d5c8ddc6f4e004b7c33cb | /myschool/src/main/java/com/school/mapper/DepartmentMapper.java | 5b1d6a1e1c14780cd6207740a02a3841b1f79a7c | [] | no_license | dujunsheng/c116 | a065649d1688af6d7e643b19f47d74723666ac3d | 815f95114a1694c2528b3708b8f46cb61401b069 | refs/heads/master | 2021-01-19T00:56:49.841557 | 2016-08-13T17:22:51 | 2016-08-13T17:22:51 | 65,601,300 | 0 | 2 | null | 2016-08-13T16:57:01 | 2016-08-13T05:37:20 | Java | UTF-8 | Java | false | false | 1,248 | java | package com.school.mapper;
import com.school.dao.base.BaseDao;
import com.school.po.Department;
import com.school.po.DepartmentExample;
import com.school.vo.DepAndEmp;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DepartmentMapper extends BaseDao<Department>{
int countByExample(DepartmentExample example);
int deleteByExample(DepartmentExample example);
int deleteByPrimaryKey(Integer depId);
int insert(Department record);
int insertSelective(Department record);
List<Department> selectByExample(DepartmentExample example);
Department selectByPrimaryKey(Integer depId);
int updateByExampleSelective(@Param("record") Department record, @Param("example") DepartmentExample example);
int updateByExample(@Param("record") Department record, @Param("example") DepartmentExample example);
int updateByPrimaryKeySelective(Department record);
int updateByPrimaryKey(Department record);
//应用于分页查询所有
List<Department> findAll();
// 分页查询所有部门和旗下所有人
List<DepAndEmp> findTotal();
// 统计部门数目
int count();
// 查询该部门是否存在
int exist(String depName);
} | [
"[email protected]"
] | |
d86500826c9fe405a41079e62d248299ce434323 | d7e583b7dc9417e65dbeb6361761ab4438467ba7 | /SDHC_basehttpclient-201620/BaseHttpClient/src/main/java/client/HttpClient.java | 765301f78785b20f22289df52074c2ee83f73694 | [] | no_license | sercharpak/WebStuff | 766e0b099dd8c36af6c63d10ef7b17d786580b4f | cdee07ea263f3f7e1d59616857c13c78426fa791 | refs/heads/master | 2021-06-23T23:10:15.395307 | 2021-05-07T07:34:03 | 2021-05-07T07:34:03 | 66,368,973 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 949 | java | package client;
import java.io.*;
import java.net.Socket;
import java.net.UnknownHostException;
public class HttpClient {
private Socket socket;
public HttpClient(String host, int port) throws UnknownHostException, IOException{
socket = new Socket(host,port);
}
public File processRequest(String requestMessage, String host, String fileName) throws IOException{
//Toca obtener los Output e Input desde el socket, crear los objetos envar la peticion y recibir la respuesta.
OutputStream outputsito = socket.getOutputStream();
InputStream inputsito = socket.getInputStream();
RequestProcessor requestsito = RequestProcessor.getInstance();
ResponseProcessor respondsito = ResponseProcessor.getInstance();
requestsito.sendRequestMessage(outputsito, requestMessage, host);
File archivoRespuesta = respondsito.processResponse(inputsito, fileName);
System.out.println("Finalizo das peticion");
return archivoRespuesta;
}
}
| [
"[email protected]"
] | |
6d30fedd2a7a6b02932a584a1745a2053c66c6e4 | 3977ee55e5cedcac59e39bb0134106d79f6d68e2 | /src/main/java/com/peiyu/simpleRpc/RPCServer.java | 20ade53ff5849632f03c074b693d0f80ddfce570 | [] | no_license | qinwenjing/RPCtest | 6e8280be84608ce12a8b2fd1c16b9d278942b442 | 8c6ca29ebad062712b72e87424c2e4f8ca05e1ea | refs/heads/master | 2021-01-22T12:26:51.374714 | 2017-11-13T02:15:48 | 2017-11-13T02:15:48 | 102,349,783 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 290 | java | package com.peiyu.simpleRpc;
/**
* Created by qwj on 2017/9/20.
*/
public interface RPCServer {
public void stop();
public void start() throws Throwable;
public void register(Class<?> service, Class<?> serviceImpl);
public int getPort();
public boolean isRuning();
}
| [
"[email protected]"
] | |
919dac354de6909066f00ac0a161d5ef6bddeba0 | f72c5c691cb38114393ac5d06bc9d5e8194bdeb6 | /jsp2016/src/mytag/ForEach.java | f6267010db82da405fac41245398914db53fd058 | [] | no_license | ZedZhouZiBin/Javaweb | a3cb6a47c99b2f5fd6766b5579ad4f2e5c55cae8 | 0169feedc23522e27e7c4448a87846515b59c369 | refs/heads/master | 2021-09-09T13:03:36.237337 | 2018-03-16T11:49:54 | 2018-03-16T11:49:54 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,928 | java | package mytag;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;
public class ForEach extends BodyTagSupport{
private int count;
private String align;
private String border;
private String bgcolor;
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public String getAlign() {
return align;
}
public void setAlign(String align) {
this.align = align;
}
public String getBorder() {
return border;
}
public void setBorder(String border) {
this.border = border;
}
public String getBgcolor() {
return bgcolor;
}
public void setBgcolor(String bgcolor) {
this.bgcolor = bgcolor;
}
//标签开始时调用该标签
@Override
public int doStartTag() throws JspException {
if(align==null || align.equals("")){
align="center";
}
if(bgcolor==null || bgcolor.equals("")){
bgcolor="white";
}
if(count>0){
JspWriter out = pageContext.getOut();
try{
String str = "<table border='"+border+"' align='"+align+"' bgcolor='"+bgcolor+"'>";
System.out.println(str);
out.write(str);
}catch(Exception e){
e.printStackTrace();
}
return EVAL_BODY_INCLUDE;
}else{
return SKIP_BODY;
}
}
//标签结束调用该标签
@Override
public int doEndTag() throws JspException {
JspWriter out = pageContext.getOut();
try{
out.write("</table>");
}catch(Exception e){
e.printStackTrace();
}
return EVAL_PAGE;
}
//做循环处理时,需要调用该函数,该函数重复运行,直到返回值为EVAL_BODY_INCLUDE结束运行
@Override
public int doAfterBody() throws JspException {
count--;
System.out.println("count="+count);
if(count>0){
return EVAL_BODY_AGAIN;
}else{
return SKIP_BODY;
}
}
//初始化
@Override
public void doInitBody() throws JspException {
System.out.println("doInitBody");
}
}
| [
"[email protected]"
] | |
b9091c7b5ab3193e73c5a10b8f9ed78b0385be7b | e3eea5c0cff9855b15283ec2e999852dbf8a00cb | /lesson35/service/UserService.java | 5a70a9bad600b8cbd04f6b7ad7f8dbdaa4446d79 | [] | no_license | RomaMarchenko/finalProject | 6e43849a9cfec02be99bef9c78fc451308466aff | 59e92fe346e466022a1b73fd0737ee77322abdef | refs/heads/master | 2020-09-14T06:04:31.680083 | 2020-02-19T03:06:36 | 2020-02-19T03:06:36 | 223,043,035 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,046 | java | package lesson35.service;
import lesson35.exceptions.BadRequestException;
import lesson35.repository.UserRepository;
import lesson35.model.User;
public class UserService {
private static UserRepository userRepository = new UserRepository(UserRepository.getPath());
public static User registerUser(User user) throws Exception {
//check business logic
if (checkCountry(user.getCountry())) {
return userRepository.registerUser(user);
}
throw new BadRequestException("Country field can contain only letters, please check your spelling");
}
public static void login(String userName, String password) throws Exception {
userRepository.login(userName, password);
}
public static void logout() {
UserRepository.logout();
}
private static boolean checkCountry(String country) {
for (Character ch : country.toCharArray()) {
if (!Character.isLetter(ch)) {
return false;
}
}
return true;
}
}
| [
"[email protected]"
] | |
fe1d7624e1b28261d7049a1fcecc6c7a95f924d2 | 350a807cc49960fd1cbc80809e572dee0b8bf228 | /Exercise03/src/task1/Main.java | 6ca9fa5cffd900ce1ca90a3e7a1284c486dbf677 | [
"Unlicense"
] | permissive | KonstantinTwardzik/Graphical-User-Interfaces | 7009cf417f7f5906741ffbc33bb613628c7d2709 | 43b7670dc0d61c84ea45e6ac195e54698c0bac3d | refs/heads/master | 2021-09-10T19:22:45.631709 | 2018-03-31T17:07:52 | 2018-03-31T17:07:52 | 104,856,284 | 0 | 1 | null | 2017-09-26T08:21:35 | 2017-09-26T08:15:56 | null | ISO-8859-3 | Java | false | false | 3,031 | java | package task1;
import javafx.beans.property.SimpleIntegerProperty;
public class Main
{
public static void main(String[] args)
{
// Teilaufgabe a)
SimpleIntegerProperty p1 = new SimpleIntegerProperty();
SimpleIntegerProperty p2 = new SimpleIntegerProperty();
SimpleIntegerProperty p3 = new SimpleIntegerProperty();
SimpleIntegerProperty p4 = new SimpleIntegerProperty();
p4.bind(p3);
p3.bind(p2);
p2.bind(p1);
p1.set(11);
// p2.set(2); A bound value cannot be set.
// p3.set(3); A bound value cannot be set.
// p4.set(4); A bound value cannot be set.
System.out.println(p4.get());
// Teilaufgabe b)
SimpleIntegerProperty p5 = new SimpleIntegerProperty();
SimpleIntegerProperty p6 = new SimpleIntegerProperty();
SimpleIntegerProperty p7 = new SimpleIntegerProperty();
p7.bind(p6);
p7.bind(p5);
p6.set(66); // 0, da nur ein binding bestehen kann, und dieses mit p5
// überschrieben wurde
p5.set(55);
System.out.println(p7.get());
// Teilaufgabe c)
SimpleIntegerProperty p8 = new SimpleIntegerProperty();
SimpleIntegerProperty p9 = new SimpleIntegerProperty();
SimpleIntegerProperty p10 = new SimpleIntegerProperty();
p9.bind(p8);
p10.bind(p8);
p8.set(88);
System.out.println(p9.get() + " und " + p10.get());
// Teilaufgabe d)
// SimpleIntegerProperty p11 = new SimpleIntegerProperty();
// SimpleIntegerProperty p12 = new SimpleIntegerProperty();
// SimpleIntegerProperty p13 = new SimpleIntegerProperty();
// SimpleIntegerProperty p14 = new SimpleIntegerProperty();
// p14.bind(p13);
// p13.bind(p12);
// p12.bind(p11);
// p11.bind(p14);
// Exception in thread "main" java.lang.StackOverflowError
// Teilaufgabe e)
SimpleIntegerProperty p15 = new SimpleIntegerProperty();
SimpleIntegerProperty p16 = new SimpleIntegerProperty();
SimpleIntegerProperty p17 = new SimpleIntegerProperty();
p15.bindBidirectional(p16);
p16.bindBidirectional(p17);
p15.set(155);
System.out.println(p17.get()); // funktioniert
p17.set(177);
System.out.println(p15.get()); // funktioniert
// Teilaufgabe f)
SimpleIntegerProperty p18 = new SimpleIntegerProperty();
SimpleIntegerProperty p19 = new SimpleIntegerProperty();
SimpleIntegerProperty p20 = new SimpleIntegerProperty();
SimpleIntegerProperty p21 = new SimpleIntegerProperty();
p18.bindBidirectional(p19);
p19.bindBidirectional(p20);
p20.bindBidirectional(p21);
p21.bindBidirectional(p18);
p19.set(199);
System.out.println(p18.get());
System.out.println(p19.get());
System.out.println(p20.get());
System.out.println(p21.get());
}
}
| [
"[email protected]"
] | |
ee3a8e8447df7452e335ed1dda4c756809a8eadf | 410f3ded166a395ea8233b1b33630e7ebe3b315e | /app/src/test/java/com/example/mynewsproject/ExampleUnitTest.java | 4585018ec61929a5a4a70bfdebeb6152e6d1ae8d | [] | no_license | Nikolay4ik/MyNewsProject | 7a27ebbfd0b17ab7ceefb1c21c415f3fbf46e890 | 98b5e23ecead3ea9bd6cc7d0a356cf1913762518 | refs/heads/master | 2023-01-10T05:00:02.385840 | 2020-11-11T06:19:04 | 2020-11-11T06:19:04 | 311,880,818 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package com.example.mynewsproject;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
e5988c9c571fc67565490da71687fc92f367a6e6 | 3880d41d152c8dba2f5a8aeb752cf7134d368d77 | /src/WordcountReduce.java | 3253070d24b32d565900c9cead0161c0e6e85ede | [] | no_license | tyler2319/440-HW3 | 9dfd0229409fb3fdc73ab4174664171f09cba8b4 | 1283e42c20d0473c3f9759289f6843c52b2feabc | refs/heads/master | 2020-05-17T00:45:44.533540 | 2013-04-18T02:22:33 | 2013-04-18T02:22:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 395 | java | import java.util.Iterator;
import Interfaces.Reducer;
import MapReduceObjects.OutputCollecter;
public class WordcountReduce implements Reducer<String, Integer, String, Integer> {
public void reduce(String key, Iterator<Integer> values, OutputCollecter<String, Integer> output) {
Integer sum = 0;
while (values.hasNext()) {
sum += values.next();
}
output.collect(key, sum);
}
}
| [
"[email protected]"
] | |
11456c40f6d73b534cb9ee51f25d5ee4d4d09c5d | 89a15863634bd10df50be692072f249ce71c81ba | /queen-attack/src/main/java/Queen.java | 54eeeb97823a36d32ce9e6511ef6655ca621b2c3 | [] | no_license | dimova/ExercismJavaSolutionsZip | fedff02f30789eda495ac7218b3bed82e3b56372 | f279258e070ba1766cfb3b8cd8e4425b3f98bc66 | refs/heads/master | 2023-03-28T19:46:22.822248 | 2021-04-10T05:05:32 | 2021-04-10T05:05:32 | 356,476,294 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 501 | java | public class Queen {
final int i;
final int j;
public Queen(int i, int j) {
validate(i, "row");
validate(j, "column");
this.i = i;
this.j = j;
}
private void validate(int index, String name) {
if (index < 0) {
throw new IllegalArgumentException("Queen position must have positive " + name + ".");
}
if (index > 7) {
throw new IllegalArgumentException("Queen position must have " + name + " <= 7.");
}
}
} | [
"[email protected]"
] | |
18d17c8863c5ab28e7e3dc53333e4bf959acf535 | 0438b7b6f2b9ab899f74f72c07e229355d9d4732 | /app/src/main/java/com/example/mhasan/bonmeal/Fridge.java | 99fba5dfea118729992fb0f8209893e57fec91ff | [] | no_license | maaliHasan/BonMeal | ad3e2c2ea23d401f282ebc9c4b3c1e4912fb59cf | 7f364577a8ff12f0719cab41f770f66de7897d5b | refs/heads/master | 2021-01-24T06:18:12.048433 | 2017-06-07T13:15:31 | 2017-06-07T13:15:31 | 93,310,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 585 | java | package com.example.mhasan.bonmeal;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by mhasan on 6/7/2017.
*
*/
public class Fridge extends Fragment{
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.test, container, false);
return rootView;
}
}
| [
"[email protected]"
] | |
4e1607ab01f362230e6b3dded5c162910b443562 | 208e21e29eb8b2957cef780680eacc3d935b6c04 | /src/main/java/com/salvagers/client/utils/rendering/renderables/TexturedRectangle.java | b8463f3ad0dd03cd095f772e307021983f343cb6 | [] | no_license | GiantLuigi4/salvage | 6868b0711b1a359f0317eb1cd339de0fb6cd96c8 | 5a8a2475c61c06cefa859e0f614354324880f53c | refs/heads/master | 2023-02-06T14:59:41.854670 | 2020-12-26T03:53:57 | 2020-12-26T03:53:57 | 323,771,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 694 | java | package com.salvagers.client.utils.rendering.renderables;
import com.salvagers.common.Vector3D;
import org.joml.Matrix4f;
public class TexturedRectangle extends RenderableRectangle {
//Doing it this way instead of storing the integer so that it's reloadable
public final String texture;
public final Vector3D tex1,tex2,tex3,tex4;
public TexturedRectangle(Matrix4f entry, Vector3D corner1, Vector3D corner2, Vector3D corner3, Vector3D corner4, String texture, Vector3D tex1, Vector3D tex2, Vector3D tex3, Vector3D tex4) {
super(entry, corner1, corner2, corner3, corner4);
this.texture = texture;
this.tex1 = tex1;
this.tex2 = tex2;
this.tex3 = tex3;
this.tex4 = tex4;
}
}
| [
"[email protected]"
] | |
ca065121df240c1921fb9155055df38f67e995ae | e2b65e84a90e835aa9da7e53d7aa98d3dd492fe7 | /src/main/java/cz/auderis/binbuilder/api/element/StringElement.java | cbf0e0ecdc8d09822aafa251172db5b3b71f756b | [
"Apache-2.0"
] | permissive | bbobcik/auderis-binbuilder | 884e4e0d5a2d3434a56fa149359e6f44abbc21b5 | ff6e904143008aeff57083af4cbe001cde393e44 | refs/heads/master | 2021-01-11T20:54:10.427433 | 2017-01-29T08:55:34 | 2017-01-29T08:55:34 | 79,207,503 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,359 | java | /*
* Copyright 2017 Boleslav Bobcik - Auderis
*
* 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 cz.auderis.binbuilder.api.element;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
public interface StringElement<T extends StringElement<T>> extends BuilderElement<T>, Appendable, CharSequence, Readable {
CharsetEncoder getEncoder();
void setEncoder(CharsetEncoder newEncoder);
T withEncoder(CharsetEncoder newEncoder);
Charset getCharset();
void setCharset(Charset newCharset);
T withCharset(Charset newCharset);
// Methods from java.lang.Appendable overridden to return correct type
// and having IOException removed from their signature
@Override T append(CharSequence csq);
@Override T append(CharSequence csq, int start, int end);
@Override T append(char c);
}
| [
"[email protected]"
] | |
1b627ba655eaa355e4275b7fe92cb54b1b31d0b1 | 42123b18763bd45917249d8bb4aa2ccd5c32994e | /app/src/androidTest/java/com/example/albertln/countrylist/ExampleInstrumentedTest.java | 02df9c008c466f796e45a4ed30c11a464448c556 | [] | no_license | albertllopart/CountryListRecycler | 0ff95d18be1eb23ab86646eae91982e8cf5f1236 | b8ae18741e6b2f524e2a5682949f6899fadaa49f | refs/heads/master | 2020-03-31T13:08:25.350784 | 2018-10-11T09:45:22 | 2018-10-11T09:45:22 | 152,243,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 748 | java | package com.example.albertln.countrylist;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.albertln.countrylist", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
5685794acea0d79fb6ffd3f5fc99ea002f77d4bd | de903bb28e80f39dcb0867e5ae0761129b6f1813 | /src/test/java/TestUtil.java | 77501bac4beb5b79ce19306a6449d7039afdb9b3 | [] | no_license | amitmalik0205/MathPlay | 781921992d45d6b9059ddab2e79c4b0aabc8ea59 | b006bd100c16889941f8d03a520dc4346870ebf7 | refs/heads/master | 2021-01-21T07:41:48.591467 | 2014-12-12T07:50:10 | 2014-12-12T07:50:10 | 25,572,575 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,203 | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class TestUtil {
public static void sendRequest(String urlStr, String param, String method) throws IOException {
URL url = new URL(urlStr);
HttpURLConnection conn = null;
conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestMethod(method);
if(method.equals("POST")) {
conn.setDoOutput(true);
OutputStream os = conn.getOutputStream();
os.write(param.getBytes());
os.flush();
}
conn.connect();
if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
throw new RuntimeException("Failed : HTTP error code : "
+ conn.getResponseCode());
}
BufferedReader br = new BufferedReader(new InputStreamReader(
(conn.getInputStream())));
String output;
System.out.println("Output from Server .... \n");
while ((output = br.readLine()) != null) {
System.out.println(output);
}
conn.disconnect();
}
}
| [
"[email protected]"
] | |
bd2fd9f4070796143031e72dfe58544da1fb90a7 | d5cff92fd55a5a8e706b63b16c078b5912d574be | /src/main/java/com/techgroup/kipfit/repository/ScheduleRepository.java | cc075b00edcb67cf941fbd0412e26ad75a6454c9 | [] | no_license | festradao102/KipFit-playground | 678e55de036f74c183483ec786e0ee97298b5797 | 8b699221880caba2cfbb1c41f2623c6b5ac6a93e | refs/heads/master | 2023-01-24T08:34:59.251117 | 2020-11-05T00:21:42 | 2020-11-05T00:21:42 | 314,469,332 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package com.techgroup.kipfit.repository;
import com.techgroup.kipfit.domain.Schedule;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the Schedule entity.
*/
@SuppressWarnings("unused")
@Repository
public interface ScheduleRepository extends JpaRepository<Schedule, Long> {
}
| [
"[email protected]"
] | |
ba7389badbefff9e665ef43df75d5a2b06a24acf | 9a3a0ea145aab78f68faafcced045ddb693419bf | /chapter03/src/main/java/com/manong/entity/User.java | 834f6da19487067e3c2a3aa9bde223732835a35a | [] | no_license | ZhongLiPeng0310/SpringDataJpaTest | 5eae7b0fc2f8ade9e384eebf43c856a62b0a3bfd | 394615e837409a93c27b84d87a9e28425e694059 | refs/heads/master | 2023-02-08T08:32:27.437374 | 2020-12-21T06:58:35 | 2020-12-21T06:58:35 | 323,213,830 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 588 | java | package com.manong.entity;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Data //lombok注释 可以不用写getter and setter
@Entity //标记该类时一个持久化类(与数据库的表进行关联)
public class User {
@Id //标记该属性时一个逐渐字段
@GeneratedValue(strategy = GenerationType.IDENTITY) //指定主键生成策略
private Integer id;
private String userName;
private Integer age;
private String address;
}
| [
"[email protected]"
] | |
144ee9eab404094c018a36becdc58ea4921d071e | 7e8589d35301de4afa0c6236b9521b3634067b3d | /Builder/HardToMakeBurger/src/org/vanis/java/se/designpatterns/builder/hardtomakeburger/HardToMakeBurger.java | 71594abefcc897250e5669b57bfc6d49e95e575c | [] | no_license | Voooza/CW | 2ad97f6190ea02cde99e9387995f7ed4103de07f | 57477420f8e4d9b48a5bba744d5e797767e342bf | refs/heads/master | 2021-01-01T18:37:52.532353 | 2015-06-23T15:23:38 | 2015-06-23T15:23:38 | 37,029,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,710 | java | package org.vanis.java.se.designpatterns.builder.hardtomakeburger;
public class HardToMakeBurger implements Burger{
private String pastry;
private String meat;
private String cheese;
private int peppers;
private String tomatoes;
private String bacon;
private String lettuce;
private String catchup;
private String tatarSauce;
private String onion;
public HardToMakeBurger(String pastry, String meat, String cheese, int peppers, String tomatoes, String bacon, String lettuce, String catchup, String tatarSauce, String onion) {
this.pastry = pastry;
this.meat = meat;
this.cheese = cheese;
this.peppers = peppers;
this.tomatoes = tomatoes;
this.bacon = bacon;
this.lettuce = lettuce;
this.catchup = catchup;
this.tatarSauce = tatarSauce;
this.onion = onion;
}
@Override
public String getPastry() {
return pastry;
}
@Override
public String getMeat() {
return meat;
}
@Override
public String getCheese() {
return cheese;
}
@Override
public int getPeppers() {
return peppers;
}
public boolean hasTomatoes() {
return tomatoes.equals("YES");
}
public boolean hasBacon() {
return bacon.equals("YES");
}
public boolean hasLettuce() {
return lettuce.equals("YES");
}
public boolean hasCatchup() {
return catchup.equals("YES");
}
public boolean hasTatarSauce() {
return tatarSauce.equals("YES");
}
public boolean hasOnion() {
return onion.equals("YES");
}
public HardToMakeBurger(String pastry, String meat, String cheese, int peppers, String tomatoes, String bacon, String lettuce, String catchup, String tatarSauce) {
this(pastry, meat, cheese, peppers, tomatoes, bacon, lettuce, catchup, tatarSauce, "NO");
}
public HardToMakeBurger(String pastry, String meat, String cheese, int peppers, String tomatoes, String bacon, String lettuce, String catchup) {
this(pastry, meat, cheese, peppers, tomatoes, bacon, lettuce, catchup, "NO");
}
public HardToMakeBurger(String pastry, String meat, String cheese, int peppers, String tomatoes, String bacon, String lettuce) {
this(pastry, meat, cheese, peppers, tomatoes, bacon, lettuce, "NO");
}
public HardToMakeBurger(String pastry, String meat, String cheese, int peppers, String tomatoes, String bacon) {
this(pastry, meat, cheese, peppers, tomatoes, bacon, "NO");
}
public HardToMakeBurger(String pastry, String meat, String cheese, int peppers, String tomatoes) {
this(pastry, meat, cheese, peppers, tomatoes, "NO");
}
public HardToMakeBurger(String pastry, String meat, String cheese, int peppers) {
this(pastry, meat, cheese, peppers, "NO");
}
public HardToMakeBurger(String pastry, String meat, String cheese) {
this(pastry, meat, cheese, 0);
}
public HardToMakeBurger(String pastry, String meat) {
this(pastry, meat, "NO");
}
@Override
public String toString() {
return "HardToMakeBurger{" +
"pastry='" + pastry + '\'' +
", meat='" + meat + '\'' +
", cheese='" + cheese + '\'' +
", peppers='" + peppers + '\'' +
", tomatoes='" + tomatoes + '\'' +
", bacon='" + bacon + '\'' +
", lettuce='" + lettuce + '\'' +
", catchup='" + catchup + '\'' +
", tatarSauce='" + tatarSauce + '\'' +
", onion='" + onion + '\'' +
'}';
}
}
| [
"[email protected]"
] | |
ccd82bae154a674e2556173a4c12c54970081205 | baed9cec5abcecffa47020ab636342be7916a17e | /src/main/java/com/vince/myblog/config/ShiroConfig.java | c2c1ef010509ff17be1bffa545a2f014cc794f6c | [] | no_license | VinceDLP/myblog | d8056e89eb064fe66ef5ec9cddc6464a6bcb4e33 | 1eeeab1be18671044eb312b3ecdd5b28367b2f6f | refs/heads/master | 2022-02-22T14:25:12.101023 | 2019-12-10T12:42:50 | 2019-12-10T12:42:50 | 202,460,520 | 0 | 0 | null | 2022-02-09T22:20:03 | 2019-08-15T02:34:42 | Java | UTF-8 | Java | false | false | 2,850 | java | //package com.vince.myblog.config;
//
//import org.apache.shiro.mgt.SecurityManager;
//import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import javax.servlet.Filter;
//import java.util.LinkedHashMap;
//import java.util.Map;
//
///**
// * @author vince
// * @program myblog
// * @description Shiro控制
// * @create 2019-10-20 22:38
// */
//@Configuration
//public class ShiroConfig {
//
// @Bean
// public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
// ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
// shiroFilterFactoryBean.setSecurityManager(securityManager);
// // 没有登陆的用户只能访问登陆页面
// shiroFilterFactoryBean.setLoginUrl("/auth/login");
// // 登录成功后要跳转的链接
// shiroFilterFactoryBean.setSuccessUrl("/auth/index");
// // 未授权界面; ----这个配置了没卵用,具体原因想深入了解的可以自行百度
// //shiroFilterFactoryBean.setUnauthorizedUrl("/auth/403");
// //自定义拦截器
// Map<String, Filter> filtersMap = new LinkedHashMap<String, Filter>();
// //限制同一帐号同时在线的个数。
// filtersMap.put("kickout", kickoutSessionControlFilter());
// shiroFilterFactoryBean.setFilters(filtersMap);
// // 权限控制map.
// Map<String, String> filterChainDefinitionMap = new LinkedHashMap<String, String>();
// filterChainDefinitionMap.put("/css/**", "anon");
// filterChainDefinitionMap.put("/js/**", "anon");
// filterChainDefinitionMap.put("/img/**", "anon");
// filterChainDefinitionMap.put("/auth/login", "anon");
// filterChainDefinitionMap.put("/auth/logout", "logout");
// filterChainDefinitionMap.put("/auth/kickout", "anon");
// filterChainDefinitionMap.put("/**", "authc,kickout");
// shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
// return shiroFilterFactoryBean;
// }
// /**
// * 限制同一账号登录同时登录人数控制
// *
// * @return
// */
// @Bean
// public KickoutSessionControlFilter kickoutSessionControlFilter() {
// KickoutSessionControlFilter kickoutSessionControlFilter = new KickoutSessionControlFilter();
// kickoutSessionControlFilter.setCacheManager(cacheManager());
// kickoutSessionControlFilter.setSessionManager(sessionManager());
// kickoutSessionControlFilter.setKickoutAfter(false);
// kickoutSessionControlFilter.setMaxSession(1);
// kickoutSessionControlFilter.setKickoutUrl("/auth/kickout");
// return kickoutSessionControlFilter;
// }
//}
| [
"[email protected]"
] | |
d9102ed3bb53e77d7c52a3bea82241e275ad01b8 | 65945144e2bb6a2c05173ebfdf6eca96ed70eecf | /src/main/java/com/netease/mystore/web/common/Product.java | 618e9dfcbd5831a64055026afe20013ec8910ec3 | [] | no_license | mrzhangs1015916/MyStore | 403ca28d3b41af9c1dfcbdbc71cf716a9229d0b3 | 9d6bc18668c471240cc6cc31ff12984a9f454480 | refs/heads/master | 2020-04-13T13:25:31.835628 | 2018-12-27T00:58:51 | 2018-12-27T00:58:51 | 163,230,083 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,761 | java | package com.netease.mystore.web.common;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 产品展示类
* Created by switch on 16/11/14.
*/
public class Product implements Serializable {
/**
* 产品ID
*/
private Integer id;
/**
* 产品标题
*/
private String title;
/**
* 摘要
*/
private String summary;
/**
* 全文
*/
private String detail;
/**
* 图片地址
*/
private String image;
/**
* 价格
*/
private BigDecimal price;
/**
* 购买时价格
*/
private BigDecimal buyPrice;
/**
* 购买时间
*/
private Long buyTime;
/**
* 当前用户是否购买
*/
private Boolean isBuy;
/**
* 是否已经卖出
*/
private Boolean isSell;
public Product() {
}
public Long getBuyTime() {
return buyTime;
}
public void setBuyTime(Long buyTime) {
this.buyTime = buyTime;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public BigDecimal getBuyPrice() {
return buyPrice;
}
public void setBuyPrice(BigDecimal buyPrice) {
this.buyPrice = buyPrice;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public Boolean getIsBuy() {
return isBuy;
}
public void setIsBuy(Boolean isBuy) {
this.isBuy = isBuy;
}
public Boolean getIsSell() {
return isSell;
}
public void setIsSell(Boolean isSell) {
this.isSell = isSell;
}
@Override
public String toString() {
return "Product{" +
"id=" + id +
", title='" + title + '\'' +
", summary='" + summary + '\'' +
", detail='" + detail + '\'' +
", image='" + image + '\'' +
", price=" + price +
", buyPrice=" + buyPrice +
", isBuy=" + isBuy +
", isSell=" + isSell +
'}';
}
}
| [
"[email protected]"
] | |
1023fdc56adbe7d03eca59f77ab1b3eed90a418c | db7eca6cd7a41063f2fcdf90bcd20ba91a6b5efc | /aw/autumn_window/src/main/java/cn/com/cslc/aw/agent/repository/AgentRepositoryCustom.java | b888381aaaf60b8a8acb1e5b7f8b2e10ab7787e0 | [] | no_license | lisansx2/aw | eda7d33c086fb4d6e1688cb99fc3e754837088d7 | d76f0f5426b1c07137d3442f01247fb4226e4cdc | refs/heads/master | 2020-04-07T19:03:07.829696 | 2018-11-16T10:15:20 | 2018-11-16T10:15:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 871 | java | package cn.com.cslc.aw.agent.repository;
import java.util.List;
import java.util.Set;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import cn.com.cslc.aw.agent.domain.SysAgent;
import cn.com.cslc.aw.agent.dto.B_AgentDto;
import cn.com.cslc.aw.settings.agentsetting.dto.QueryAgentSettingResult;
public interface AgentRepositoryCustom {
/**
* 从B_AGENT表中获取AGENT_TYPE_CODE=10的全部代理
* @return
*/
List<B_AgentDto> getAllAgentInfoFromB_Agent();
List<B_AgentDto> getAllAgentInfoByProvinceNo(String provinceNo);
List<SysAgent> findUnusedAgentByProvinceNo(String provinceNo,Long orgId);
B_AgentDto getAllAgentInfoFromB_AgentByNo(String agentNo);
Page<QueryAgentSettingResult> queryAgentListByProvinceCodes(Set<String> provinceCodesSet, Pageable pageable);
}
| [
"[email protected]"
] | |
286fc0fc588b3a15b0637ed0082bc2969788051b | ce1a693343bda16dc75fd64f1688bbfa5d27ac07 | /system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java | a6699666c8ebb3bf8d369c8c3b87daa0224ef4a6 | [] | no_license | JavaQualitasCorpus/jboss-5.1.0 | 641c412b1e4f5f75bb650cecdbb2a56de2f6a321 | 9307e841b1edc37cc97c732e4b87125530d8ae49 | refs/heads/master | 2023-08-12T08:39:55.319337 | 2020-06-02T17:48:09 | 2020-06-02T17:48:09 | 167,004,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,729 | java | /*
* JBoss, Home of Professional Open Source.
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.system.microcontainer;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Iterator;
import javax.management.Attribute;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import org.jboss.dependency.plugins.AbstractControllerContext;
import org.jboss.dependency.spi.Controller;
import org.jboss.dependency.spi.ControllerMode;
import org.jboss.dependency.spi.ControllerState;
import org.jboss.dependency.spi.DependencyItem;
import org.jboss.dependency.spi.dispatch.InvokeDispatchContext;
import org.jboss.system.Service;
import org.jboss.system.ServiceContext;
import org.jboss.system.ServiceController;
import org.jboss.system.metadata.ServiceMetaData;
import org.jboss.system.metadata.ServiceMetaDataVisitor;
import org.jboss.system.metadata.ServiceMetaDataVisitorNode;
/**
* ServiceControllerContext.
*
* @author <a href="[email protected]">Adrian Brock</a>
* @author <a href="[email protected]">Ales Justin</a>
* @version $Revision: 85945 $
*/
public class ServiceControllerContext extends AbstractControllerContext implements InvokeDispatchContext
{
/** The ObjectName */
private ObjectName objectName;
/** The service controller */
private ServiceController serviceController;
/** The meta data */
private ServiceMetaData serviceMetaData;
/** The service context */
private ServiceContext serviceContext = new ServiceContext();
// Whether to include the lifecycle
private boolean includeLifecycle = true;
/**
* Create a new ServiceControllerContext.
*
* @param serviceController the service controller
* @param name the name of the context
*/
public ServiceControllerContext(ServiceController serviceController, ObjectName name)
{
this(serviceController, name, true);
}
/**
* Create a new ServiceControllerContext.
*
* @param serviceController the service controller
* @param name the name of the context
* @param includeLifecycle whether to include the lifecycle callouts
*/
public ServiceControllerContext(ServiceController serviceController, ObjectName name, boolean includeLifecycle)
{
this(serviceController, name, includeLifecycle, null);
}
/**
* Create a new ServiceControllerContext.
*
* @param serviceController the service controller
* @param name the name of the context
* @param includeLifecycle whether to include the lifecycle callouts
* @param target the target
*/
public ServiceControllerContext(ServiceController serviceController, ObjectName name, boolean includeLifecycle, Object target)
{
super(name.getCanonicalName(), ServiceControllerContextActions.getLifecycleOnly());
this.objectName = name;
serviceContext.objectName = objectName;
this.serviceController = serviceController;
setMode(ControllerMode.MANUAL);
this.includeLifecycle = includeLifecycle;
if (target != null)
setTarget(target);
}
/**
* Create a new ServiceControllerContext.
*
* @param serviceController the service controller
* @param metaData the meta data
*/
public ServiceControllerContext(ServiceController serviceController, ServiceMetaData metaData)
{
super(metaData.getObjectName().getCanonicalName(), ServiceControllerContextActions.getInstance());
this.objectName = metaData.getObjectName();
serviceContext.objectName = objectName;
this.serviceController = serviceController;
ControllerMode mode = metaData.getMode();
this.serviceMetaData = metaData;
if (mode == null)
setMode(ControllerMode.MANUAL);
else
setMode(mode);
}
/**
* Create a new ServiceControllerContext.
*
* @param serviceController the service controller
* @param name the name
* @param target the target
*/
public ServiceControllerContext(ServiceController serviceController, ObjectName name, Object target)
{
super(name.getCanonicalName(), ServiceControllerContextActions.getInstance());
this.objectName = name;
serviceContext.objectName = objectName;
this.serviceController = serviceController;
setTarget(target);
setMode(ControllerMode.MANUAL);
}
private MBeanServer getMBeanServer()
{
MBeanServer server = serviceController.getMBeanServer();
if (server == null)
{
throw new IllegalStateException("MBeanServer not available.");
}
return server;
}
protected static String getAttributeName(String name)
{
if (name == null || name.length() == 0)
throw new IllegalArgumentException("Illegal name: " + name);
char firstCharacter = name.charAt(0);
if (Character.isLowerCase(firstCharacter))
{
String attributeName = String.valueOf(Character.toUpperCase(firstCharacter));
if (name.length() > 1)
attributeName += name.substring(1);
return attributeName;
}
return name;
}
public Object get(String name) throws Throwable
{
return getMBeanServer().getAttribute(objectName, getAttributeName(name));
}
public void set(String name, Object value) throws Throwable
{
Attribute attribute = new Attribute(getAttributeName(name), value);
getMBeanServer().setAttribute(objectName, attribute);
}
public Object invoke(String name, Object parameters[], String[] signature) throws Throwable
{
return getMBeanServer().invoke(objectName, name, parameters, signature);
}
public ClassLoader getClassLoader() throws Throwable
{
if (serviceMetaData != null)
{
return getMBeanServer().getClassLoader(serviceMetaData.getClassLoaderName());
}
else
{
return getMBeanServer().getClassLoaderFor(objectName);
}
}
/**
* Get the ObjectName.
*
* @return the ObjectName.
*/
public ObjectName getObjectName()
{
return objectName;
}
/**
* Get the serviceMetaData.
*
* @return the serviceMetaData.
*/
public ServiceMetaData getServiceMetaData()
{
return serviceMetaData;
}
/**
* Set the serviceMetaData.
*
* @param serviceMetaData the serviceMetaData.
*/
public void setServiceMetaData(ServiceMetaData serviceMetaData)
{
this.serviceMetaData = serviceMetaData;
}
/**
* Get the serviceController.
*
* @return the serviceController.
*/
public ServiceController getServiceController()
{
return serviceController;
}
/**
* Get the service proxy
*
* @return the service proxy
* @throws Exception for any error
*/
public Service getServiceProxy() throws Exception
{
if (serviceContext.proxy != null)
return serviceContext.proxy;
MBeanServer server = serviceController.getMBeanServer();
if (server != null)
serviceContext.proxy = ServiceProxy.getServiceProxy(objectName, server, includeLifecycle);
return serviceContext.proxy;
}
/**
* Get the service context
*
* @return the service context
*/
public ServiceContext getServiceContext()
{
try
{
serviceContext.proxy = getServiceProxy();
}
catch (Exception ignored)
{
}
if (getError() != null)
serviceContext.setProblem(getError());
if (getState() == ControllerState.ERROR)
serviceContext.state = ServiceContext.FAILED;
return serviceContext;
}
// Overridden to update the service context with any failure
public void install(ControllerState fromState, ControllerState toState) throws Throwable
{
try
{
super.install(fromState, toState);
}
catch (Throwable t)
{
serviceContext.setProblem(t);
serviceContext.state = ServiceContext.FAILED;
throw t;
}
}
// Overridden to update the service context with the installed/not installed state
// i.e. of the ServiceController registration
// Not to be confused with the microcontainer's (fully) installed state
public void setController(Controller controller)
{
super.setController(controller);
if (controller != null)
{
preprocessMetaData();
serviceContext.state = ServiceContext.INSTALLED;
}
else
serviceContext.state = ServiceContext.NOTYETINSTALLED;
}
/**
* Preprocess the metadata for this context
*/
protected void preprocessMetaData()
{
if (serviceMetaData == null)
return;
PreprocessMetaDataVisitor visitor = new PreprocessMetaDataVisitor();
AccessController.doPrivileged(visitor);
}
/**
* A visitor for the metadata that looks for dependencies.
*/
protected class PreprocessMetaDataVisitor implements ServiceMetaDataVisitor, PrivilegedAction<Object>
{
/** The current context for when the dependencies are required */
private ControllerState contextState = ControllerState.INSTANTIATED;
/**
* Visit the bean metadata node, this is the starting point
*/
public Object run()
{
serviceMetaData.visit(this);
return null;
}
/**
* Visit a node
*
* @param node the node
*/
public void visit(ServiceMetaDataVisitorNode node)
{
boolean trace = log.isTraceEnabled();
if (trace)
log.trace("Visit node " + node);
// Visit the children of this node
Iterator<? extends ServiceMetaDataVisitorNode> children = node.getChildren();
if (children != null)
{
ControllerState restoreState = contextState;
while (children.hasNext())
{
ServiceMetaDataVisitorNode child = children.next();
try
{
child.visit(this);
}
finally
{
contextState = restoreState;
}
}
}
}
public ServiceControllerContext getControllerContext()
{
return ServiceControllerContext.this;
}
public ControllerState getContextState()
{
return contextState;
}
public void addDependency(DependencyItem dependency)
{
getDependencyInfo().addIDependOn(dependency);
}
public void setContextState(ControllerState contextState)
{
this.contextState = contextState;
}
}
}
| [
"[email protected]"
] | |
8681f56f98f757fde4d17351c48e72b5aac18110 | 0e2aa7cc544c31f80b6aabbb4c9a9904bf75afed | /src/main/java/edu/gdit/health/model/SysDict.java | 82a60f060834c4b02dc317a5d12e87ada41b064f | [] | no_license | SimonCaprice/health_19s3 | 5a8253a1d4c279792b2e0c95bae01b29d6d80386 | 2fc8d6376945a94b7b01e16502c4b37a90ee1200 | refs/heads/master | 2023-03-23T17:44:18.033281 | 2021-03-16T11:06:21 | 2021-03-16T11:06:21 | 343,611,110 | 0 | 0 | null | 2021-03-17T05:56:02 | 2021-03-02T01:40:44 | Java | UTF-8 | Java | false | false | 973 | java | package edu.gdit.health.model;
public class SysDict {
private long id;
private String dictKey;
private String dictValue;
private String dictType;
private String remark;
private long status;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getDictKey() {
return dictKey;
}
public void setDictKey(String dictKey) {
this.dictKey = dictKey;
}
public String getDictValue() {
return dictValue;
}
public void setDictValue(String dictValue) {
this.dictValue = dictValue;
}
public String getDictType() {
return dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public long getStatus() {
return status;
}
public void setStatus(long status) {
this.status = status;
}
}
| [
"[email protected]"
] | |
18f91b347e5fd587b3b75a2d6dc96209bbff4a4a | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2019/8/StringHelpers.java | e7af084f53fb5dae404f5063ef1af991f8d26386 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 2,756 | java | /*
* Copyright (c) 2002-2019 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.values.storable;
import java.util.function.BiFunction;
import java.util.function.Function;
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.neo4j.values.storable.Values.stringValue;
import static org.neo4j.values.storable.Values.utf8Value;
final class StringHelpers
{
private StringHelpers()
{
throw new UnsupportedOperationException();
}
static <T> void assertConsistent( String string, Function<TextValue,T> test )
{
TextValue textValue = stringValue( string );
TextValue utf8Value = utf8Value( string.getBytes( UTF_8 ) );
T a = test.apply( textValue );
T b = test.apply( utf8Value );
String errorMsg = format( "operation not consistent for %s", string );
assertThat( errorMsg, a, equalTo( b ) );
assertThat( errorMsg, b, equalTo( a ) );
}
static <T> void assertConsistent( String string1, String string2, BiFunction<TextValue,TextValue,T> test )
{
TextValue textValue1 = stringValue( string1 );
TextValue textValue2 = stringValue( string2 );
TextValue utf8Value1 = utf8Value( string1.getBytes( UTF_8 ) );
TextValue utf8Value2 = utf8Value( string2.getBytes( UTF_8 ) );
T a = test.apply( textValue1, textValue2 );
T x = test.apply( textValue1, utf8Value2 );
T y = test.apply( utf8Value1, textValue2 );
T z = test.apply( utf8Value1, utf8Value2 );
String errorMsg = format( "operation not consistent for `%s` and `%s`", string1, string2 );
assertThat( errorMsg, a, equalTo( x ) );
assertThat( errorMsg, x, equalTo( a ) );
assertThat( errorMsg, a, equalTo( y ) );
assertThat( errorMsg, y, equalTo( a ) );
assertThat( errorMsg, a, equalTo( z ) );
assertThat( errorMsg, z, equalTo( a ) );
}
}
| [
"[email protected]"
] | |
7eead89c8ab67a988821182005ac7e7950ccbe52 | 4992cac9fe9ade58e4cfbdca5a513d4bc3da2a33 | /src/main/java/com/jarek/datascraper/validation/PasswordMatch.java | a171e76be87a7113075b148e524282226333db64 | [] | no_license | JaroCash/datascraper | 90f1206e86e8e502d61ecc6a4db651a52a165c15 | b400a5f83ad666e55ea55c4dfdd5a8a8d3a7a6c3 | refs/heads/master | 2020-04-22T13:52:52.424241 | 2019-04-01T03:41:37 | 2019-04-01T03:41:37 | 170,421,789 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package com.jarek.datascraper.validation;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;
@Constraint(validatedBy = PasswordMatchValidator.class)
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface PasswordMatch {
String message() default "Passwords don't match";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
| [
"[email protected]"
] | |
3dc0af568d62f005e650e8bb7dd155b412e98760 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/TIME-18b-7-8-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/joda/time/DateMidnight_ESTest_scaffolding.java | 7b54bc125c1828517ef1741ea0d3f7e6247b2094 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 436 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sat Feb 15 19:08:45 GMT+k6:14 2020
*/
package org.joda.time;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class DateMidnight_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"[email protected]"
] | |
7ff82ef01db47984500d4f65feff35172245af06 | 827a3793f1e3efb51065349c878328adba0c2af5 | /COAT/src/servlet/CheckLoginServlet.java | cc96dbc137c62ac7b842604d496e4197c3d3ba2e | [] | no_license | zhangzhengwu/zhangzhengwu.github.io | 76b158b40808736016b7aa96bfac7efacb856ba5 | af6a30f3ffe6081a920b0808f9d5d8f87aa04c9f | refs/heads/master | 2021-07-16T11:20:08.826103 | 2020-07-11T11:23:04 | 2020-07-11T11:23:04 | 187,379,186 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,494 | java | package servlet;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import com.coat.loginrecord.dao.LoginRecordDao;
import com.coat.loginrecord.dao.impl.LoginRecordDaoImpl;
import com.coat.loginrecord.entity.LoginRecord;
import util.Constant;
import util.DateUtils;
import util.Util;
import dao.AdminDAO;
import entity.Admin;
public class CheckLoginServlet extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = 1L;
Logger log=Logger.getLogger(CheckLoginServlet.class);
@Override
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
@Override
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=utf-8");
HttpSession session = request.getSession();
/* 首先取得jsp页面传来的参数信息 */
String username = request.getParameter("username");
String password = request.getParameter("password");
/* String code = request.getParameter("code");
String sessionCode = (String) session.getAttribute("code");*/
String errMessage = "";
try{
/* 验证输入信息的完整行和正确性 */
if (username.equals(""))
errMessage += "用户名不能为空!";
if (password.equals(""))
errMessage += "密码输入不能为空!";
/*if (util.Tools.notEmpty(sessionCode) && !sessionCode.equalsIgnoreCase(code))
errMessage += "验证码输入不正确!";*/
if (password.indexOf("'") != -1){
errMessage += "请不要进行sql注入攻击!";
log.error(username+"对系统进行过SQL注入操作!");
}
/* 如果验证没有通过转到登陆页并提示错误信息 */
if (!errMessage.equals("")) {
request.setAttribute("errMessage", errMessage);
RequestDispatcher wm = request.getRequestDispatcher("signin.jsp");
wm.forward(request, response);
return;
}
/* 如果初步验证通过就需要进一步验证 */
Admin admin = new Admin();
admin=new AdminDAO().checkLogin_AES_ENCRYPT(username,password);
/*如果是管理员身份用户名和密码都验证成功则设置session的值然后重定向到管理首页*/
if (!Util.objIsNULL(admin.getAdminUsername()) && !Util.objIsNULL(admin.getAdminPassword())) {
session.setAttribute("adminUsername", admin.getAdminUsername());
session.setAttribute("convoy_username", admin.getAdminUsername());
session.setAttribute("admin", admin);
session.setAttribute("systemTime", DateUtils.getDateToday());
session.setAttribute("flag", "true");
session.setAttribute("roleType",Constant.RoleType_staff);
log.info("用户"+getIpAddr(request)+"/"+username+"登陆成功");
/*将用户登录信息保存至loginrecord表中*/
LoginRecord loginRecord=new LoginRecord(admin.getAdminUsername(),
"Admin",
"login",
Util.getIpAddr(request),
DateUtils.getNowDateTime(),
"Y");
LoginRecordDao loginRecordDao=new LoginRecordDaoImpl();
int rrr = loginRecordDao.saveLogin(loginRecord);
if(rrr > 0){
log.info("用户"+Util.getIpAddr(request)+"/"+username+"保存记录成功");
} else {
log.info("用户"+Util.getIpAddr(request)+"/"+username+"保存记录失败");
}
response.sendRedirect("main.jsp");
} else {
errMessage += "管理员帐号或密码错误!";
request.setAttribute("errMessage",errMessage);
RequestDispatcher wm = request.getRequestDispatcher("login.jsp");
wm.forward(request, response);
}
}catch (Exception e) {
errMessage = e.getMessage();
request.setAttribute("errMessage",errMessage);
RequestDispatcher wm = request.getRequestDispatcher("login.jsp");
wm.forward(request, response);
}finally{
}
}
/* public String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
return ip;
}
*/
/**
* 优化获取IP的方法
*/
public static String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("X-Forwarded-For");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
return ip;
}
}
| [
"[email protected]"
] | |
776a4d80348f41e26f657efb4ded762b17a99f49 | 942d8716f8655512b867d315aa5337b41ad42da0 | /app/src/main/java/com/lyz/wayy/bean/BuyDog.java | 4c6243bd65722c0003ef5b5c1ab8c8347a6172bb | [] | no_license | qianchuan2009/yinyu | b844c4a33ff58a710f3cec317fda6264e76a94d0 | a63d65092214871666cb8334ebd81d2c9ccf1819 | refs/heads/master | 2021-05-03T15:15:15.009622 | 2018-03-14T15:52:14 | 2018-03-14T15:52:14 | 120,470,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,804 | java | package com.lyz.wayy.bean;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import org.json.JSONException;
import org.json.JSONObject;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
/**
* Created by helch on 2018/2/23.
*/
public class BuyDog {
/**
* tId : 1
* tName : 幻云星龙
* list : {"1":{"price":0,"FBPrice":700},"2":{"price":0,"FBPrice":700}}
* effect :
* depict : 云烟缥缈之上,圣龙唱响云中之歌!最动听的传说,来自幻云星龙的传奇!
* type : 4
*/
private String tId;
private String tName;
private ListBean list;
private String effect;
private String depict;
private String type;
public static BuyDog objectFromData(String str, String key) {
try {
JSONObject jsonObject = new JSONObject(str);
return new Gson().fromJson(jsonObject.getString(key), BuyDog.class);
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
public static ArrayList<BuyDog> arrayBuyDogFromData(String str, String key) {
try {
JSONObject jsonObject = new JSONObject(str);
Type listType = new TypeToken<ArrayList<BuyDog>>() {
}.getType();
return new Gson().fromJson(jsonObject.getString(key), listType);
} catch (JSONException e) {
e.printStackTrace();
}
return new ArrayList();
}
public String getTId() {
return tId;
}
public void setTId(String tId) {
this.tId = tId;
}
public String getTName() {
return tName;
}
public void setTName(String tName) {
this.tName = tName;
}
public ListBean getList() {
return list;
}
public void setList(ListBean list) {
this.list = list;
}
public String getEffect() {
return effect;
}
public void setEffect(String effect) {
this.effect = effect;
}
public String getDepict() {
return depict;
}
public void setDepict(String depict) {
this.depict = depict;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public static class ListBean {
/**
* 1 : {"price":0,"FBPrice":700}
* 2 : {"price":0,"FBPrice":700}
*/
@SerializedName("1")
private _$1Bean _$1;
@SerializedName("2")
private _$2Bean _$2;
public static ListBean objectFromData(String str, String key) {
try {
JSONObject jsonObject = new JSONObject(str);
return new Gson().fromJson(jsonObject.getString(str), ListBean.class);
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
public static List<ListBean> arrayListBeanFromData(String str, String key) {
try {
JSONObject jsonObject = new JSONObject(str);
Type listType = new TypeToken<ArrayList<ListBean>>() {
}.getType();
return new Gson().fromJson(jsonObject.getString(str), listType);
} catch (JSONException e) {
e.printStackTrace();
}
return new ArrayList();
}
public _$1Bean get_$1() {
return _$1;
}
public void set_$1(_$1Bean _$1) {
this._$1 = _$1;
}
public _$2Bean get_$2() {
return _$2;
}
public void set_$2(_$2Bean _$2) {
this._$2 = _$2;
}
public static class _$1Bean {
/**
* price : 0
* FBPrice : 700
*/
private int price;
private int FBPrice;
public static _$1Bean objectFromData(String str, String key) {
try {
JSONObject jsonObject = new JSONObject(str);
return new Gson().fromJson(jsonObject.getString(str), _$1Bean.class);
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
public static List<_$1Bean> array_$1BeanFromData(String str, String key) {
try {
JSONObject jsonObject = new JSONObject(str);
Type listType = new TypeToken<ArrayList<_$1Bean>>() {
}.getType();
return new Gson().fromJson(jsonObject.getString(str), listType);
} catch (JSONException e) {
e.printStackTrace();
}
return new ArrayList();
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getFBPrice() {
return FBPrice;
}
public void setFBPrice(int FBPrice) {
this.FBPrice = FBPrice;
}
}
public static class _$2Bean {
/**
* price : 0
* FBPrice : 700
*/
private int price;
private int FBPrice;
public static _$2Bean objectFromData(String str, String key) {
try {
JSONObject jsonObject = new JSONObject(str);
return new Gson().fromJson(jsonObject.getString(str), _$2Bean.class);
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
public static List<_$2Bean> array_$2BeanFromData(String str, String key) {
try {
JSONObject jsonObject = new JSONObject(str);
Type listType = new TypeToken<ArrayList<_$2Bean>>() {
}.getType();
return new Gson().fromJson(jsonObject.getString(str), listType);
} catch (JSONException e) {
e.printStackTrace();
}
return new ArrayList();
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getFBPrice() {
return FBPrice;
}
public void setFBPrice(int FBPrice) {
this.FBPrice = FBPrice;
}
}
}
}
| [
"[email protected]"
] | |
a02e68d8b58ec21e4f51832a34172aa08118dcad | 03b329b9bab166bc2d3f1733e7b87b5badce13f7 | /launchertasklib/src/main/java/com/cheng/lib/launchertasklib/DelayInitDispatcher.java | b3cff371c1699785bb8f16e99164eaa9066f0249 | [] | no_license | chenguo4930/LancherTask | 90ccd702c7b1e3dcf27703541149c9a87fcb8efc | d6ca49b660b3b3f0f7a756afa8751755a56ff271 | refs/heads/master | 2020-04-26T02:51:39.977787 | 2019-03-01T06:30:38 | 2019-03-01T06:30:38 | 173,247,717 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 907 | java | package com.cheng.lib.launchertasklib;
import android.os.Looper;
import android.os.MessageQueue;
import com.cheng.lib.launchertasklib.task.DispatchRunnable;
import com.cheng.lib.launchertasklib.task.Task;
import java.util.LinkedList;
import java.util.Queue;
public class DelayInitDispatcher {
private Queue<Task> mDelayTasks = new LinkedList<>();
private MessageQueue.IdleHandler mIdleHandler = new MessageQueue.IdleHandler() {
@Override
public boolean queueIdle() {
if(mDelayTasks.size()>0){
Task task = mDelayTasks.poll();
new DispatchRunnable(task).run();
}
return !mDelayTasks.isEmpty();
}
};
public DelayInitDispatcher addTask(Task task){
mDelayTasks.add(task);
return this;
}
public void start(){
Looper.myQueue().addIdleHandler(mIdleHandler);
}
}
| [
"[email protected]"
] | |
777e78ec6483c54aa901d9ccbab1998dd6fc7ab9 | b117f7b8c3082e58c6d23e50715c99723e191e57 | /xplayer/src/main/java/com/songlei/xplayer/view/render/effect/PosterizeEffect.java | ec62e4660d906ef6e3ca4be688214f50d02fd744 | [] | no_license | qwwersong/PPPlayer | c57270c720d34f8ce7351319fdc1f72d4ee7dd5b | 1947b458659a30364e9f5eb6bba57f26fd05850e | refs/heads/master | 2023-07-06T21:26:58.316886 | 2019-09-30T09:55:05 | 2019-09-30T09:55:05 | 196,154,791 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,113 | java | package com.songlei.xplayer.view.render.effect;
import android.opengl.GLSurfaceView;
import com.songlei.xplayer.view.render.view.VideoGLView;
/**
* Applies Posterization effect to video.
*
* @author sheraz.khilji
*/
public class PosterizeEffect implements VideoGLView.ShaderInterface {
/**
* Initialize Effect
*/
public PosterizeEffect() {
}
@Override
public String getShader(GLSurfaceView mGlSurfaceView) {
String shader = "#extension GL_OES_EGL_image_external : require\n"
+ "precision mediump float;\n"
+ "uniform samplerExternalOES sTexture;\n"
+ "varying vec2 vTextureCoord;\n" + "void main() {\n"
+ " vec4 color = texture2D(sTexture, vTextureCoord);\n"
+ " vec3 pcolor;\n"
+ " pcolor.r = (color.r >= 0.5) ? 0.75 : 0.25;\n"
+ " pcolor.g = (color.g >= 0.5) ? 0.75 : 0.25;\n"
+ " pcolor.b = (color.b >= 0.5) ? 0.75 : 0.25;\n"
+ " gl_FragColor = vec4(pcolor, color.a);\n" + "}\n";
return shader;
}
}
| [
"[email protected]"
] | |
7319b0577b1f5625846903e59e9f3ffa9481ee7b | 896a15b7ce0daf77a53d30d703b4eae51cf7c2b1 | /royasoft/WorkHelper/src/main/java/sutdy/fastjson/json/基础使用/model/UserGroup.java | d10b717d4cf6499764e81afb2f53e2bad51320a9 | [] | no_license | youjia10dai/workspace_home | 300a49f9f2556f22c7da4168d89170a24a02a0d2 | 9de444c0104406be47de45caccec3ce71484354f | refs/heads/master | 2022-12-21T11:10:05.393963 | 2019-05-23T07:36:48 | 2019-05-23T07:36:48 | 178,764,927 | 0 | 0 | null | 2022-12-16T04:23:24 | 2019-04-01T01:38:44 | Java | GB18030 | Java | false | false | 819 | java | package sutdy.fastjson.json.基础使用.model;
import java.util.ArrayList;
import java.util.List;
/**
* 用户组测试类
* @author dmego
*
*/
public class UserGroup {
private String name;
private List<User> users = new ArrayList<User>();
public UserGroup(){}
public UserGroup(String name,List<User> users){
this.name = name;
this.users = users;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
@Override
public String toString() {
return "UserGroup [name=" + name + ", users=" + users + "]";
}
} | [
"[email protected]"
] | |
c900481ccc50395caecb9e17ef77fe54852395a0 | 4504333d0173faf6d02f5e5a6ede67af4a69db50 | /test/ir/behinehsazan/gasStation/model/burner/BurnerTest.java | da7d1715d1e6605cab22224dc47216c813ab5f7e | [] | no_license | mhsh88/CGS | 5d424ad1e8b18a5aa4400419d1c670af2118b279 | 56c2d40497cc4e911419fba052edaac652ef90d7 | refs/heads/master | 2021-05-06T23:09:45.935732 | 2018-02-10T00:22:57 | 2018-02-10T00:22:57 | 112,952,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,220 | java | package ir.behinehsazan.gasStation.model.burner;
import ir.behinehsazan.gasStation.model.burner.Burner;
import ir.behinehsazan.gasStation.model.gas.BaseGas;
import ir.behinehsazan.gasStation.model.gas.Gas;
import ir.behinehsazan.gasStation.model.mathCalculation.MathCalculation;
public class BurnerTest {
public static void main(String[] args){
// Burner burner = new Burner();
// System.out.println(burner.Cp_H2O.value(200));
// System.out.println(burner.Cp_Co2.value(200));
// System.out.println(burner.Cp_N2.value(200));
// System.out.println(burner.Cp_O2.value(200));
BaseGas gas = new Gas();
Double P = 5000.0;
Double T = 300.0;
Double[] component = {.0, .0, 1.0, .0, .0, .0, .0, 0., 0., 0.
, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.
, 0.};
for(int i=0; i<component.length; i++){
component[i] = component[i]/ MathCalculation.listSum(component);
}
gas.calculate(P, T, component);
Burner.setTenv(30.0);
Burner burner = new Burner((Gas) gas, 2.0, Burner.getTenv(), 300);
burner.calculate();
System.out.println(burner.getEfficiency());
}
}
| [
"[email protected]"
] | |
68f2bf7a0e5fd3c53173f378ee39fac5975a931f | 82e2fa3b1128edc8abd2bd84ecfc01c932831bc0 | /jena-arq/src/main/java/org/apache/jena/sparql/util/ResultSetUtils.java | 97f3f99cafec0b19236ef86ec5bc0989ee94abc5 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | apache/jena | b64f6013582f2b5aa38d1c9972d7b14e55686316 | fb41e79d97f065b8df9ebbc6c69b3f983b6cde04 | refs/heads/main | 2023-08-14T15:16:21.086308 | 2023-08-03T08:34:08 | 2023-08-03T08:34:08 | 7,437,073 | 966 | 760 | Apache-2.0 | 2023-09-02T09:04:08 | 2013-01-04T08:00:32 | Java | UTF-8 | Java | false | false | 3,491 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.jena.sparql.util;
import java.util.ArrayList ;
import java.util.List ;
import org.apache.jena.query.QuerySolution ;
import org.apache.jena.query.ResultSet ;
import org.apache.jena.rdf.model.Literal ;
import org.apache.jena.rdf.model.RDFNode ;
import org.apache.jena.rdf.model.Resource ;
import org.apache.jena.sparql.ARQException ;
import org.apache.jena.sparql.resultset.ResultSetMem ;
public class ResultSetUtils
{
/**
* Extracts a List filled with the binding of selectElement variable for each
* query solution as RDFNodes (Resources or Literals).
* Exhausts the result set. Create a rewindable one to use multiple times.
*
* @see org.apache.jena.query.ResultSetFactory
*/
public static List<RDFNode> resultSetToList(ResultSet rs, String selectElement)
{
// feature suggested by James Howison
List<RDFNode> items = new ArrayList<>() ;
while (rs.hasNext())
{
QuerySolution qs = rs.nextSolution() ;
RDFNode n = qs.get(selectElement) ;
items.add(n) ;
}
return items ;
}
/**
* Extracts a List filled with the binding of selectElement variable for each
* query solution, turned into a string (URIs or lexical forms).
* Exhausts the result set. Create a rewindable one to use multiple times.
* @see org.apache.jena.query.ResultSetFactory
*/
public static List<String> resultSetToStringList(ResultSet rs,
String selectElement,
String literalOrResource)
{
// feature suggested by James Howison
List<String> items = new ArrayList<>() ;
while (rs.hasNext())
{
QuerySolution qs = rs.nextSolution() ;
RDFNode rn = qs.get(selectElement) ;
if ( rn.isLiteral() )
items.add( ((Literal)rn).getLexicalForm() ) ;
else if ( rn.isURIResource() )
items.add( ((Resource)rn).getURI() ) ;
else if ( rn.isAnon() )
{
items.add( ((Resource)rn).getId().getLabelString() ) ;
}
else
throw new ARQException("Unknow thing in results : "+rn) ;
}
return items ;
}
/**
* Create an in-memory result set from an array of
* ResulSets. It is assumed that all the ResultSets
* from the array have the same variables.
*
* @param sets the ResultSets to concatenate.
*/
public static ResultSet union(ResultSet... sets) {
return new ResultSetMem(sets);
}
}
| [
"[email protected]"
] | |
16fb1218193b88ee14b6558eef4f65271f099c61 | 81ce2592e5e0003677a89980dea7dd6ce1f8e0c7 | /src/main/java/com/bee/auto/controller/ListController.java | d6d7018eb9a365f26716ed2c90b291f2fd56ed7f | [] | no_license | chuanchuanping/trisome | c33f6ad06ebf234118f96b78c3fa5eaedbc1018d | 230526fc8518ea8bb7f153328989e077be3bb646 | refs/heads/master | 2020-03-29T18:35:09.368051 | 2018-09-25T07:32:52 | 2018-09-25T07:32:52 | 150,221,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,668 | java | package com.bee.auto.controller;
import com.bee.auto.bean.Message;
import com.bee.auto.service.MaintainService;
import com.bee.auto.service.QueryService;
import com.bee.auto.util.ExportPOIUtils;
import com.bee.auto.util.Result;
import com.github.pagehelper.PageInfo;
import net.sf.json.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.regex.Pattern;
@Controller
@RequestMapping("/backed")
public class ListController {
public final static Logger logger = LoggerFactory.getLogger(ListController.class);
@Resource
private QueryService listService;
@Resource
private MaintainService maintainService;
// @RequestMapping(value = "/list")
// public String showList(@Param("command") String command, @Param("description") String description, @Param("currentPage") String currentPage, Model model) {
// // 创建分页对象
// Page page = new Page();
//
// Pattern pattern = Pattern.compile("[0-9]{1,9}");
// if (currentPage == null || !pattern.matcher(currentPage).matches()) {
// page.setCurrentPage(1);
// } else {
// page.setCurrentPage(Integer.valueOf(currentPage));
// }
// // 查询消息列表并传给页面
//// req.setAttribute("messageList", listService.queryMessageListByPage(command, description,page));
//// // 向页面传值
//// req.setAttribute("command", command);
//// req.setAttribute("description", description);
//// req.setAttribute("page", page);
// model.addAttribute("messageList", listService.queryMessageListByPage(command, description, page));
// model.addAttribute("command", command);
// model.addAttribute("description", description);
// model.addAttribute("page", page);
// return "back/list";
// }
@RequestMapping(value = "/list")
public String showList2(@Param("command") String command, @Param("description") String description, @Param("pageNum") String pageNum, Model model) {
int page = 0;
Pattern pattern = Pattern.compile("[0-9]{1,9}");
if (pageNum == null || !pattern.matcher(pageNum).matches()) {
page = 1;
} else {
page = Integer.valueOf(pageNum);
}
PageInfo<Message> pageInfo = listService.queryMessageList(command, description, page);
model.addAttribute("messageList",pageInfo.getList());
model.addAttribute("command", command);
model.addAttribute("description", description);
model.addAttribute("page", pageInfo);
return "back/list";
}
@RequestMapping(value = "/queryMessageById")
@ResponseBody
public JSONObject queryMessageById(@RequestParam("id") Integer id) {
Message message = listService.queryMessageById(id);
JSONObject jsonObject = JSONObject.fromObject(message);
return jsonObject;
}
@GetMapping(value = "/deleteOne")
public String delectOne(@RequestParam String id, @Param("command") String command, @Param("description") String description, @Param("currentPage") String currentPage) {
logger.info("--deleteOne--id:"+id+",-->command:"+command+",--->description:"+description+",-->currentPage:"+currentPage);
maintainService.deleteOne(id);
//页面重定向
try {
if (command != null && !"".equals(command.trim())) {
command = new String(command.getBytes("utf-8"), "iso-8859-1");
}
if (description != null && !"".equals(description.trim())) {
description = new String(description.getBytes("utf-8"), "iso-8859-1");
}
return "redirect:list?command=" + command + "&description=" + description + "¤tPage=" + currentPage;
} catch (UnsupportedEncodingException e) {
logger.info("--deleteOne--id:"+id+",-->command:"+command+",--->description:"+description+",-->currentPage:"+currentPage+e);
e.printStackTrace();
}
return null;
}
@RequestMapping(value = "/deleteBatch")
@ResponseBody
public Result deleteUser(@RequestParam("ids[]") String ids[]) {
logger.info("--deleteBatch--ids:"+ids);
maintainService.deleteBatch(ids);
return new Result(200);
}
@PostMapping(value = "/addOne")
@ResponseBody
public Result addOne(@Param("command1") String command1, @Param("description1") String description1, @Param("content1") String content1) {
Message message = new Message();
message.setCommand(command1);
message.setDescription(description1);
message.setContent(content1);
maintainService.addOne(message);
return new Result(200);
}
@PostMapping(value = "/updateOne")
@ResponseBody
public Result updateOne(@RequestParam String id,@Param("command2") String command2, @Param("description2") String description2, @Param("content2") String content2) {
Message message = new Message();
try {
message.setId(id);
message.setCommand(command2);
message.setDescription(description2);
message.setContent(content2);
logger.info("---updateOne "+message +"---success");
// int a = 1/0;
maintainService.updateOne(message);
return new Result(200);
}catch (Exception e){
logger.info("---updateOne "+message +"---fail" );
logger.info("---updateOne "+e);
return new Result(500);
}
}
@RequestMapping("/downloadExcel")
public void downloadExcel(@Param("command") String command, @Param("description") String description, HttpServletResponse response){
String fileName = "列表"+System.currentTimeMillis();
List<Message> users = listService.queryMessageList2(command, description );
// System.out.println(users);
// 列名
String columnNames[] = { "序号", "指令名称", "描述", "操作"};
// map中的key
String keys[] = { "id", "command", "description", "content"};
try {
ExportPOIUtils.start_download(response, fileName, users,columnNames, keys);
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
55e8f23b03a4e78a1cadc3864ae8bf8f587a3c69 | 8b291636c503e7849eb5caac36a65786105afcd0 | /TomP2PTrials/src/main/java/mapreduce/execution/context/IContext.java | ba1fd84b5cf02a1fe88911f8466a0c0d1d7df405 | [] | no_license | ollyblink/mt2 | 8ca817253470fee526edc7956b95bc776caee2df | 5eb9f6258fed769003f291b70c56747a7d160915 | refs/heads/master | 2021-01-21T13:34:20.700841 | 2016-05-03T17:32:58 | 2016-05-03T17:32:58 | 50,658,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 122 | java | package mapreduce.execution.context;
public interface IContext {
public void write(Object keyOut, Object valueOut);
}
| [
"ozihler@ozihler-ThinkPad-T410"
] | ozihler@ozihler-ThinkPad-T410 |
386322097796cafc774b8598963afa681863eb9e | 94dafb3bf3b6919bf4fcb3d460173077bfa29676 | /core/src/main/java/com/wdcloud/lms/core/base/model/ContentViewRecord.java | c6d160efd921e21303a052183dbb00bf26eef6b3 | [] | no_license | Miaosen1202/1126Java | b0fbe58e51b821b1ec8a8ffcfb24b21d578f1b5f | 7c896cffa3c51a25658b76fbef76b83a8963b050 | refs/heads/master | 2022-06-24T12:33:14.369136 | 2019-11-26T05:49:55 | 2019-11-26T05:49:55 | 224,112,546 | 0 | 0 | null | 2021-02-03T19:37:54 | 2019-11-26T05:48:48 | Java | UTF-8 | Java | false | false | 1,504 | java | package com.wdcloud.lms.core.base.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import lombok.*;
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Data
@Table(name = "cos_content_view_record")
public class ContentViewRecord implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 用户
*/
@Column(name = "user_id")
private Long userId;
/**
* 类型,1:讨论话题 2:讨论回复 3:公告话题 4:公告回复
*/
@Column(name = "origin_type")
private Integer originType;
/**
* 来源ID
*/
@Column(name = "origin_id")
private Long originId;
@Column(name = "create_time")
private Date createTime;
@Column(name = "update_time")
private Date updateTime;
@Column(name = "create_user_id")
private Long createUserId;
@Column(name = "update_user_id")
private Long updateUserId;
public static final String ID = "id";
public static final String USER_ID = "userId";
public static final String ORIGIN_TYPE = "originType";
public static final String ORIGIN_ID = "originId";
public static final String CREATE_TIME = "createTime";
public static final String UPDATE_TIME = "updateTime";
public static final String CREATE_USER_ID = "createUserId";
public static final String UPDATE_USER_ID = "updateUserId";
private static final long serialVersionUID = 1L;
} | [
"[email protected]"
] | |
2edd61c128459726409caff9aa4aacc2a9f74279 | 8bb36b61efadecb557f6b764a1ec16f020ee3230 | /src/test/java/com/artipie/docker/proxy/ProxyManifestsTest.java | 1f742af4266bf03df017c5804c1ee41b75172903 | [
"MIT"
] | permissive | acheshkov/docker-adapter | 2a7bc8a137e01c3407eef390ebe426457cf8828d | dac561ea797a4a3f29207690a42d568c9b168fdc | refs/heads/master | 2022-11-11T15:03:16.136669 | 2020-06-29T10:10:34 | 2020-06-29T10:10:34 | 275,817,919 | 0 | 0 | MIT | 2020-06-29T13:07:05 | 2020-06-29T13:07:04 | null | UTF-8 | Java | false | false | 3,745 | java | /*
* MIT License
*
* Copyright (c) 2020 Artipie
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.artipie.docker.proxy;
import com.artipie.asto.Content;
import com.artipie.docker.Digest;
import com.artipie.docker.RepoName;
import com.artipie.docker.http.DigestHeader;
import com.artipie.docker.manifest.Manifest;
import com.artipie.docker.misc.ByteBufPublisher;
import com.artipie.docker.ref.ManifestRef;
import com.artipie.http.Headers;
import com.artipie.http.rs.RsFull;
import com.artipie.http.rs.RsStatus;
import com.artipie.http.rs.RsWithStatus;
import java.util.Optional;
import org.hamcrest.MatcherAssert;
import org.hamcrest.core.IsEqual;
import org.junit.jupiter.api.Test;
/**
* Tests for {@link ProxyManifests}.
*
* @since 0.3
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
class ProxyManifestsTest {
@Test
void shouldGetManifest() {
final byte[] data = "data".getBytes();
final String digest = "sha256:123";
final Optional<Manifest> found = new ProxyManifests(
(line, headers, body) -> {
if (!line.startsWith("GET /v2/test/manifests/abc ")) {
throw new IllegalArgumentException();
}
return new RsFull(
RsStatus.OK,
new Headers.From(new DigestHeader(new Digest.FromString(digest))),
new Content.From(data)
);
},
new RepoName.Valid("test")
).get(new ManifestRef.FromString("abc")).toCompletableFuture().join();
MatcherAssert.assertThat(found.isPresent(), new IsEqual<>(true));
final Manifest manifest = found.get();
MatcherAssert.assertThat(manifest.digest().string(), new IsEqual<>(digest));
final Content content = manifest.content();
MatcherAssert.assertThat(
new ByteBufPublisher(content).bytes().toCompletableFuture().join(),
new IsEqual<>(data)
);
MatcherAssert.assertThat(
content.size(),
new IsEqual<>(Optional.of((long) data.length))
);
}
@Test
void shouldGetEmptyWhenNotFound() {
final Optional<Manifest> found = new ProxyManifests(
(line, headers, body) -> {
if (!line.startsWith("GET /v2/my-test/manifests/latest ")) {
throw new IllegalArgumentException();
}
return new RsWithStatus(RsStatus.NOT_FOUND);
},
new RepoName.Valid("my-test")
).get(new ManifestRef.FromString("latest")).toCompletableFuture().join();
MatcherAssert.assertThat(found.isEmpty(), new IsEqual<>(true));
}
}
| [
"[email protected]"
] | |
06f811c3fefa3b5b4283e663a5ead9a60ec99201 | 0d3283a0f57a5ed4751b7ad5cab1771d027448b3 | /app/src/main/java/com/bloodtrackerplus/bloodtracker/AcceptorBloodgroup.java | 41655c33001e1a6580f18ccb9b8a16e87b37969d | [] | no_license | varnika02/Blood-Tracker | d4dc22ff66cc2435a77e4c0aa39dd171c80f511f | cbb11509837a1228e5045dc4ef3e5ddc6db7aa28 | refs/heads/master | 2021-01-19T22:14:48.234724 | 2017-04-19T18:41:44 | 2017-04-19T18:41:44 | 88,778,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,416 | java | package com.bloodtrackerplus.bloodtracker;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class AcceptorBloodgroup extends AppCompatActivity {
ListView listView2;
String[] arrays={"Blood Bank,A.I.I.M.S New Delhi-110029;Ph. (91)-11-26588641","Blood Bank,Armed Forces Transfusion Centre Contonment,New Delhi-110010 ;Ph. (91)-11-28636680",
"Swasthya Kalyan Blood Bank,125, Tonk Road, Jaipur - 302022","Milap Nagar,Durgapur;Ph. (91)-141-2545293",
"Blood Bank Santokba Durlabh Ji Memorial Hospital,Bhuwani Singh Marg, Jaipur - 302001;Ph. (91)-141-2574189",
"Ambika Blood Bank, K.K. Smruti Apt., New Maneklal Estate, Ghatkopar (W), Mumbai 400 086;Ph. 25124322",
"Indian Red C ross Society, 1, Red Cross Road, Parliament Street, Delhi - 110001, Opposite Parliament House;Ph. (91)-11-23716441",
"Bandra Holly Family Hospital Society Blood Bank, Bandra (W), Mumbai 400 050;Ph. 26408857"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ArrayAdapter adapter = new ArrayAdapter<String>(this,
R.layout.activity_acceptor_bloodgroup, arrays);
listView2 = (ListView) findViewById(R.id.listView2);
listView2.setAdapter(adapter);
}
}
| [
"[email protected]"
] | |
2669b32b20abb6cc52e6ee9cd232d0f11d8e9fa2 | f61ece41cc79c59f8f56d52cb8a6256978e3041b | /hotelbooking/src/main/java/com/project/hotel/dao/BookingDAOImpl.java | eb0915505293aa7526138ae58a2b5a6dbfca3d1d | [] | no_license | pranayak/spring-hotel-booking | 8afb10ff947c3e7749c8bf4a50987d18c86567aa | 19a62b636fdeaea37b276f1351bc6db40f9a76b1 | refs/heads/master | 2021-06-09T03:46:06.909162 | 2016-11-07T13:27:26 | 2016-11-07T13:27:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,314 | java |
/**
*
*/
package com.project.hotel.dao;
import java.util.Date;
import java.util.List;
import org.hibernate.Hibernate;
import org.springframework.orm.hibernate4.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.project.hotel.model.TbookedRoomDetails;
import com.project.hotel.model.TbookingUser;
import com.project.hotel.model.Tcity;
import com.project.hotel.model.Thotel;
import com.project.hotel.model.dto.CityVO;
/**
* @author pnayak
*
*/
@Repository
public class BookingDAOImpl extends HibernateDaoSupport implements IBookingDAO{
@Override
@Transactional(readOnly=true)
public List<Tcity> findAllCities() {
List cityList = getHibernateTemplate().find("from Tcity");
return cityList;
}
@Override
public List<Thotel> findHotelsByCity(Integer cityId) {
List hotelList = getHibernateTemplate().find("from Thotel where city.cityId=? ",cityId);
return hotelList;
}
@Override
public List<Thotel> findLeastPricedHotelsByCity(CityVO cityVO) {
List<Thotel> hotelList = (List<Thotel>) getHibernateTemplate().find("from Thotel where city.cityId=? order by tariff asc)",cityVO.cityId);
for (Thotel hotel : hotelList) {
Hibernate.initialize(hotel.getCity());
}
return hotelList;
}
@Override
public Thotel findHotelById(Integer hoteld) {
List<Thotel> hotelList = (List<Thotel>) getHibernateTemplate().find("from Thotel where hotelId=?)",hoteld);
if(hotelList.size()>0)
return hotelList.get(0);
return null;
}
@Override
public List<TbookedRoomDetails> findBookedRoomsByHotel(Integer hotelId,Date checkinDate,Date checkoutDate) {
List<TbookedRoomDetails> roomList = (List<TbookedRoomDetails>) getHibernateTemplate().find("from TbookedRoomDetails where hotel.hotelId=? and ((?<=checkinDt and ?>=checkinDt) or (?<checkoutDt and ?>=checkoutDt)))",hotelId,checkinDate,checkoutDate,checkinDate,checkoutDate);
return roomList;
}
@Override
public TbookingUser saveBookingUserDetails(TbookingUser bookingUser) {
getHibernateTemplate().save(bookingUser);
return bookingUser;
}
@Override
public void saveBookedRoomDetails(TbookedRoomDetails bookedRoom) {
getHibernateTemplate().save(bookedRoom);
}
}
| [
"[email protected]_odc01.com"
] | [email protected]_odc01.com |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.