blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e630fa5b69b458b9a008aa5500c795ad695ccad9 | 6fddfe5550775b20e4fc02266e4ca5c44fafb510 | /CompCipherDesc.java | 76bb7bd1fd754e3ad1ae6c685fcb151620e447cf | [] | no_license | ArtemGit-dot/Practice | b2042a4f1c984a6359ee2a307283f2c4db0d7020 | 9f171cefcba77046c7964d9f53a98c153f9d8252 | refs/heads/master | 2022-11-20T12:57:44.025966 | 2020-07-20T17:24:39 | 2020-07-20T17:24:39 | 281,179,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | import java.util.*;
public class CompCipherDesc implements Comparator{
public int compare (Object ob1, Object ob2){
Planet plan1 = (Planet) ob1;
Planet plan2 = (Planet) ob2;
if (plan1.getCipher() < plan2.getCipher()) return 1;
else if (plan1.getCipher() == plan2.getCipher()) return 0;
else return -1;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
e76f417a6b9d729ba4294222d7909f242a534df1 | a611666e1405b74734fb89fa60b1b570bf533705 | /app/src/test/java/com/dicoding/kharisazhar/mykamus/ExampleUnitTest.java | 4156d25a8759d7e8fc8e7bd0736107f495464e66 | [] | no_license | kharisazhar/MyKamus | 37be2d2efa74f2b16b77e8684076d44c431344e4 | ad92ebbd2fab620377a6aa08b356773108b6b9c4 | refs/heads/master | 2020-03-24T13:39:35.415514 | 2018-07-29T09:45:40 | 2018-07-29T09:45:40 | 142,748,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 393 | java | package com.dicoding.kharisazhar.mykamus;
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);
}
} | [
"muhammadkharisazhar149a@gmail.com"
] | muhammadkharisazhar149a@gmail.com |
8220c16d04bb6442c6973fd0e9f0dd74c6e8459e | a998d1ebbd98c0ae67fc403580eeff08ded1e26f | /Converter.java | 13f92e835d83fd6e65de98ebc1ec08dc6355f634 | [] | no_license | Rshomali/A1Group12 | 3c34d8d6dca807e98f118a2659dd5b7af2f5aaa8 | 18ee503840a15f3253da0e995bafa8ce0c33de8c | refs/heads/master | 2020-04-05T23:42:56.228412 | 2011-02-08T19:52:23 | 2011-02-08T19:52:23 | 1,313,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | import java.util.*;
import java.io.*;
public class Converter extends StandardFilter
{
protected HashMap<Integer, ConversionFunction> conversionFunction;
public Converter(PipedInputStream inputReadPort[], PipedOutputStream outputWritePort[], HashMap<Integer, ConversionFunction> IDsAndFuncs)
{
super(inputReadPort, outputWritePort, (new ArrayList<Integer>(IDsAndFuncs.keySet())).toArray(new Integer[]{}) );//, Arrays.asList(IDsAndFuncs.keySet()).toArray(new Integer[]{}));
conversionFunction = IDsAndFuncs;
}
public void processIDAndMeasurement(int id, double measurement)
{
ConversionFunction func = conversionFunction.get(id);
double result;
if(func == null)
result = measurement;
else
result = func.execute(measurement);
long longResult = Double.doubleToLongBits(result);
writeID(id, currentPort);
writeMeasurement(longResult, currentPort);
}
}
| [
"kalluskydominik@cmu-206444.wv.cc.cmu.edu"
] | kalluskydominik@cmu-206444.wv.cc.cmu.edu |
b888e42cafd48477b847a19770e84bb1cee80f0c | cf3074728b305f250cc46a535cab12047a22430e | /app/src/main/java/com/mcarr/officialsmooviesapp/util/Constants.java | 07b975908e5fa49721179d64cd3aa686333b4b17 | [] | no_license | mikelcarr92/outwarecodesample | a69915b08feab929750b38c5ae14a1e1c29d8830 | 86625716e6146b44fd52d878f5f3428804c032ff | refs/heads/master | 2021-01-18T18:34:17.109074 | 2016-08-10T09:48:56 | 2016-08-10T09:48:56 | 65,370,620 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package com.mcarr.officialsmooviesapp.util;
/**********************************
* Created by Mikel on 20-May-16.
*********************************/
public class Constants {
public static final String BASE_URL = "withdrawn";
public static final String AUTH_KEY = "AUTH_KEY";
public static final String USERNAME = "USERNAME";
public static final String PROFILE_URL = "PROFILE_URL";
}
| [
"mikelcarr92@gmail.com"
] | mikelcarr92@gmail.com |
ee1359728e60cc70760f6da061d910043638c407 | cd10d1c1e0b0ee8a361c7f7cec7102ce0210b75a | /project-hypnus-common/project-hypnus-common-service-impl/src/main/java/com/catt/hypnus/service/impl/base/eventMgr/ApneaEventBaseServiceImpl.java | 978a6bcc5745a8c1df8f11b40030df8556d927cc | [] | no_license | Catfeeds/hypnusMgr | 24ff90a6b7786166c3e039877ca14da4361f3a19 | 6a0aff2bd4ab93ca1c0a588353eff5f3e0e5e43b | refs/heads/master | 2020-04-07T21:26:15.253730 | 2018-05-16T10:07:39 | 2018-05-16T10:07:39 | 158,727,141 | 0 | 1 | null | 2018-11-22T16:39:54 | 2018-11-22T16:39:54 | null | UTF-8 | Java | false | false | 730 | java | package com.catt.hypnus.service.impl.base.eventMgr;
import com.catt.common.base.service.impl.BaseServiceImpl;
import com.catt.hypnus.repository.dao.eventMgr.ApneaEventDao;
import com.catt.hypnus.repository.entity.eventMgtr.ApneaEvent;
import com.catt.hypnus.service.base.eventMgr.ApneaEventBaseService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service("apneaEventBaseServiceImpl")
public class ApneaEventBaseServiceImpl extends
BaseServiceImpl<ApneaEvent, Long> implements ApneaEventBaseService {
@Resource(name = "apneaEventDaoImpl")
private ApneaEventDao apneaEventDao;
@Resource
public void setBaseDao(ApneaEventDao apneaEventDao) {
super.setBaseDao(apneaEventDao);
}
}
| [
"815596159@qq.com"
] | 815596159@qq.com |
e17001f5eac773fa4cd3f274ffe6fc9977a9d27c | 11dd45ef3cf1e790f9f5837699441f44a6240e5a | /app/src/main/java/com/example/myapplication/ui/home/KeranjangBayar.java | 7d2a352f710c46405765f7d15837c41c993182da | [] | no_license | widianapw/NextCoffeeShop | 79ef52b2a0e1d0c2183aad23284c2c221d0e8358 | 04a1f0223c171a11202574945a14e885f897100c | refs/heads/master | 2020-09-26T06:12:48.464167 | 2019-12-16T10:46:01 | 2019-12-16T10:46:01 | 226,185,284 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,337 | java | package com.example.myapplication.ui.home;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.example.myapplication.MainActivity;
import com.example.myapplication.R;
import com.example.myapplication.database.AppDatabase;
import com.example.myapplication.database.AppExecutors;
import com.example.myapplication.model.DetailTransaksi;
import com.example.myapplication.model.Keranjang;
import com.example.myapplication.model.KeranjangWithRelations;
import com.example.myapplication.model.MainKasir;
import com.example.myapplication.model.MaxTransaksi;
import com.example.myapplication.model.Transaksi;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
public class KeranjangBayar extends AppCompatActivity {
int harga_keranjang;
Button btnBayarFinal;
EditText etUang;
AppDatabase mDb;
TextView tvTotalBayar;
TextView tvKembalian;
MaxTransaksi mTransaksi;
int n;
List<KeranjangWithRelations> mKeranjangList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_keranjang_bayar);
mDb = AppDatabase.getDatabase(getApplicationContext());
btnBayarFinal = findViewById(R.id.button_bayar_final);
tvTotalBayar = findViewById(R.id.tv_total_belanja);
tvKembalian = findViewById(R.id.tv_uang_kembalian);
etUang = findViewById(R.id.etUang);
btnBayarFinal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onSubmit();
}
});
etUang.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
int a = Integer.parseInt(s.toString());
int b = Integer.parseInt(tvTotalBayar.getText().toString());
int c = a - b;
tvKembalian.setText(Integer.toString(c));
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
public void onSubmit() {
final String date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
AppExecutors.getInstance().diskIO().execute(new Runnable() {
final Transaksi data = new Transaksi(
1, date
);
@Override
public void run() {
final List<KeranjangWithRelations> mKeranjangList = mDb.keranjangDao().loadKeranjang();
mDb.transaksiDao().insertTransaksi(data);
n = mKeranjangList.size();
mTransaksi = mDb.transaksiDao().getMaxTransaksi();
int mIdTransaksi = mTransaksi.getIdTerbesar();
for (int i = 0; i < n; i++) {
DetailTransaksi data = new DetailTransaksi();
data.setId_transaksi(mIdTransaksi);
data.setId_produk(mKeranjangList.get(i).keranjang.getId_produk());
data.setQty(mKeranjangList.get(i).keranjang.getQty());
insert(data);
}
mDb.keranjangDao().deleteAll();
}
});
Intent i = new Intent(getApplicationContext(), MainActivity.class);
startActivity(i);
}
@Override
protected void onResume() {
super.onResume();
retrieveData();
}
public void retrieveData() {
mDb = AppDatabase.getDatabase(getApplicationContext());
AppExecutors.getInstance().diskIO().execute(new Runnable() {
@Override
public void run() {
final MainKasir mainKasir = mDb.keranjangDao().loadMainKasir();
final List<KeranjangWithRelations> mKeranjangList = mDb.keranjangDao().loadKeranjang();
runOnUiThread(new Runnable() {
@Override
public void run() {
harga_keranjang = mainKasir.getTotal_harga();
tvTotalBayar.setText(String.valueOf(harga_keranjang));
n = mKeranjangList.size();
}
});
}
});
}
@SuppressLint("StaticFieldLeak")private void insert(final DetailTransaksi detailTransaksi) {
new AsyncTask<Void, Void, Long>() {
@Override
protected Long doInBackground(Void... voids) {
//Menjalankan proses insert data
return mDb.detailTransaksiDao().insertDetailTransaksi(detailTransaksi);
}
@Override
protected void onPostExecute(Long status) {
//Menandakan bahwa data berhasil disimpan
}
}.execute();
}
}
| [
"widianaputraa@gmail.com"
] | widianaputraa@gmail.com |
650c5685131c8bf75592a0accd0c732a798e2ace | d2729718636f653c810425bd482e0cf4efde5497 | /src/main/java/com/demo/app/service/soap/impl/MqygtWebServiceImpl.java | 0bb43e4947c64eb62e93f95a8ba12abaecfcef5a | [] | no_license | acdodo/Springboot-Restful-Api | 0dc9faa0f6833d712e881418cc302596e1fcec15 | 2a900a8ae6a42b2334bf5bfd153e92ab461d08a1 | refs/heads/master | 2022-06-22T07:13:27.822450 | 2020-04-07T06:26:31 | 2020-04-07T06:26:31 | 253,679,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,411 | java | package com.demo.app.service.soap.impl;
import com.alibaba.fastjson.JSONObject;
import com.grid.mqygtapp.service.MqygtService;
import com.demo.app.service.soap.MqygtWebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.jws.WebService;
@Component
@WebService(targetNamespace = "http://soap.service.mqygtapp.grid.com/",endpointInterface = "com.demo.app.service.soap.MqygtWebService")
public class MqygtWebServiceImpl implements MqygtWebService {
@Autowired
MqygtService mqygtService;
/**
*
* @param dataStr
* @return {"result":1,"userName":""} result的值为"2002",表示缺少参数;"2005"表示验证串过期;"1005"数据库异常;"-1"表示账号不存在;"0"表示密码错误;"1"表示账号、密码正确,同时返回验证串(userName);
*/
public String getGuid(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
String pwd = jso.getString("pwd") == null ? "" : jso.getString("pwd").toString();
if("".equals(userName.trim()) || "".equals(pwd.trim())){
jot.put("result","2002");
return jot.toString();
}
jot = mqygtService.getGuid(userName, pwd);
return jot.toString();
}
public String getdbList(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
String dateStr = jso.getString("dateStr");
String dateEnd = jso.getString("dateEnd");
if(dateStr != null && "".equals(dateStr.trim())){
dateStr = null;
}
if(dateEnd != null && "".equals(dateEnd.trim())){
dateEnd = null;
}
jot = mqygtService.getdbList(userName, dateStr, dateEnd);
return jot.toString();
}
public String getdbById(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
String docId = jso.getString("docId") == null ? "" : jso.getString("docId").toString();
if("".equals(userName.trim()) || "".equals(docId.trim())){
jot.put("result","2002");
return jot.toString();
}
jot = mqygtService.getdbById(userName,docId);
return jot.toString();
}
public String getybList(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
String dateStr = jso.getString("dateStr");
String dateEnd = jso.getString("dateEnd");
if(dateStr != null && "".equals(dateStr.trim())){
dateStr = null;
}
if(dateEnd != null && "".equals(dateEnd.trim())){
dateEnd = null;
}
jot = mqygtService.getybList(userName,dateStr,dateEnd);
return jot.toString();
}
public String readyReadList(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
String dateStr = jso.getString("dateStr");
String dateEnd = jso.getString("dateEnd");
if(dateStr != null && "".equals(dateStr.trim())){
dateStr = null;
}
if(dateEnd != null && "".equals(dateEnd.trim())){
dateEnd = null;
}
jot = mqygtService.readyReadList(userName,dateStr,dateEnd);
return jot.toString();
}
public String getReadyRead(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
String taskId = jso.getString("taskId") == null ? "" : jso.getString("taskId").toString();
if("".equals(userName.trim()) || "".equals(taskId.trim())){
jot.put("result","2002");
return jot.toString();
}
jot = mqygtService.getReadyRead(userName,taskId);
return jot.toString();
}
public String getAllDocTables(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
String dateStr = jso.getString("dateStr");
String dateEnd = jso.getString("dateEnd");
if(dateStr != null && "".equals(dateStr.trim())){
dateStr = null;
}
if(dateEnd != null && "".equals(dateEnd.trim())){
dateEnd = null;
}
jot = mqygtService.getAllDocTables(userName,dateStr,dateEnd);
return jot.toString();
}
public String getNotice(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
jot = mqygtService.getNotice(userName);
return jot.toString();
}
public String getAllDeTables(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
jot = mqygtService.getAllDeTables(userName);
return jot.toString();
}
public String getPersonWage(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
String dateStr = jso.getString("dateStr");
String dateEnd = jso.getString("dateEnd");
if(dateStr != null && "".equals(dateStr.trim())){
dateStr = null;
}
if(dateEnd != null && "".equals(dateEnd.trim())){
dateEnd = null;
}
jot = mqygtService.getPersonWage(userName,dateStr,dateEnd);
return jot.toString();
}
public String listMedicalFundApply(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
jot = mqygtService.listMedicalFundApply(userName);
return jot.toString();
}
public String getAllEvaluation(String dataStr){
JSONObject jot = new JSONObject();
JSONObject jso = JSONObject.parseObject(dataStr);
String userName = jso.getString("userName") == null ? "" : jso.getString("userName").toString();
jot = mqygtService.getAllEvaluation(userName);
return jot.toString();
}
}
| [
"39312866@qq.com"
] | 39312866@qq.com |
dc09d9455caa92c91e6bd5ed6b341a4ff4b3d7b4 | adac2aa85196b28c24ed6a282e4f10b07b42672b | /android/app/src/main/java/host/exp/exponent/generated/AppConstants.java | 2c02557ca1e6f050bcd56cedf5bb6c04e7a99ccf | [] | no_license | giampaolli/WeCast | ca3e719cfb402e65f8f3756bd60b7ebc916391e0 | 9d2b9dd6bf8de92e652b9a651c88794f2c14db37 | refs/heads/master | 2020-04-18T02:20:32.607892 | 2019-01-24T11:10:43 | 2019-01-24T11:10:43 | 167,158,812 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,702 | java | package host.exp.exponent.generated;
import com.facebook.common.internal.DoNotStrip;
import java.util.ArrayList;
import java.util.List;
import host.exp.exponent.BuildConfig;
import host.exp.exponent.Constants;
@DoNotStrip
public class AppConstants {
public static final String VERSION_NAME = "2.10.5";
public static String INITIAL_URL = "exp://exp.host/@giampaoli/WeCast";
public static final String SHELL_APP_SCHEME = "expe5a5589808d14b9fb0f2c3958184ffa9";
public static final String RELEASE_CHANNEL = "default";
public static boolean SHOW_LOADING_VIEW_IN_SHELL_APP = false;
public static boolean ARE_REMOTE_UPDATES_ENABLED = true;
public static final List<Constants.EmbeddedResponse> EMBEDDED_RESPONSES;
public static boolean FCM_ENABLED = false;
static {
List<Constants.EmbeddedResponse> embeddedResponses = new ArrayList<>();
// ADD EMBEDDED RESPONSES HERE
// START EMBEDDED RESPONSES
// END EMBEDDED RESPONSES
EMBEDDED_RESPONSES = embeddedResponses;
}
// Called from expoview/Constants
public static Constants.ExpoViewAppConstants get() {
Constants.ExpoViewAppConstants constants = new Constants.ExpoViewAppConstants();
constants.VERSION_NAME = VERSION_NAME;
constants.INITIAL_URL = INITIAL_URL;
constants.SHELL_APP_SCHEME = SHELL_APP_SCHEME;
constants.RELEASE_CHANNEL = RELEASE_CHANNEL;
constants.SHOW_LOADING_VIEW_IN_SHELL_APP = SHOW_LOADING_VIEW_IN_SHELL_APP;
constants.ARE_REMOTE_UPDATES_ENABLED = ARE_REMOTE_UPDATES_ENABLED;
constants.EMBEDDED_RESPONSES = EMBEDDED_RESPONSES;
constants.ANDROID_VERSION_CODE = BuildConfig.VERSION_CODE;
constants.FCM_ENABLED = FCM_ENABLED;
return constants;
}
}
| [
"giampaoli2011@gmail.com"
] | giampaoli2011@gmail.com |
9728b50fcae52ffbfa27b5088b86480e634182c6 | 40b9fabadbc6a6f9f57024af1245a0f6bc6ddaa0 | /src/main/java/com/zhiyou100/video/controller/UserCourseController.java | 069720e74455cf8377788cb0bd904839d5849f1a | [] | no_license | wang-66-jia-66-peng/video | e387a52d30bc8d63f1590dc27bd7758a9f810345 | 899734bda1f371447711fa14e8c286db03560c3b | refs/heads/master | 2021-01-21T06:33:19.573403 | 2017-08-31T11:42:47 | 2017-08-31T11:42:47 | 101,945,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,899 | java | package com.zhiyou100.video.controller;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.zhiyou100.video.model.Course;
import com.zhiyou100.video.model.Speaker;
import com.zhiyou100.video.model.Subject;
import com.zhiyou100.video.model.Video;
import com.zhiyou100.video.service.UserCourseService;
@Controller
public class UserCourseController {
@Autowired
UserCourseService ucs;
@RequestMapping("/front/course/index.action")
public String courseIndex(Integer subjectId,Model md,HttpSession session) {
Subject subject = ucs.findSubjectById(subjectId);
md.addAttribute("subject", subject);
List<Course> co = ucs.findAllCourseAndVideo(subjectId);
for (Course course : co) {
List<Video> videoList = course.getVideoList();
for (Video video : videoList) {
Integer videoLength = video.getVideoLength();
int hh = videoLength/60/60;
int m = videoLength/60;
String mm=""+m;
if (m<10) {
mm="0"+m;
}
int s = videoLength%60;
String ss=""+s;
if (s<10) {
ss="0"+s;
}
video.setCName("0"+hh+":"+mm+":"+ss);
}
}
md.addAttribute("courses", co);
return "/front/course/index";
}
@RequestMapping("/front/video/index.action")
public String courseVideo(Integer videoId ,Integer subjectId, Model md){
Subject subject = ucs.findSubjectById(subjectId);
md.addAttribute("subject", subject);
md.addAttribute("videoId", videoId);
return "/front/video/index";
}
@RequestMapping("/front/video/videoData.action")
public String videoData(Integer videoId, Model md){
Video v = ucs.findVideoAllByid(videoId);
md.addAttribute("video", v);
Integer speakerId = v.getSpeakerId();
Integer courseId = v.getCourseId();
Course co = ucs.findCourseById(courseId);
Speaker sp = ucs.findSpeakerById(speakerId);
md.addAttribute("course", co);
md.addAttribute("speaker", sp);
List<Video> list= ucs.findVideoAllandSpeakerNameById(speakerId);
for (Video video : list) {
Integer videoLength = video.getVideoLength();
int hh = videoLength/60/60;
int m = videoLength/60;
String mm=""+m;
if (m<10) {
mm="0"+m;
}
int s = videoLength%60;
String ss=""+s;
if (s<10) {
ss="0"+s;
}
video.setCName("0"+hh+":"+mm+":"+ss);
}
md.addAttribute("videoList", list);
return "/front/video/content";
}
}
| [
"Administrator@2013-20161116TE"
] | Administrator@2013-20161116TE |
9e6aed5e3fa7ba555ed0ddc93e530a71ac29db8f | a3c3bf1d28573a5c44a4d9ba6416b98c96dab283 | /app/build/tmp/kapt3/stubs/debug/restaurant/sa/com/sarestaurant/appview/weather/WeatherApiClient.java | 23ea928b046d45951072ffd30b7d98d4695d08e6 | [] | no_license | SoniKarsh/SARestaurant | 0c3facef5890951f2816e2bc19c11494ae09fec4 | 6759d320544969e19bd4108f67ba9d880af012a1 | refs/heads/master | 2020-03-23T11:59:32.676689 | 2018-08-06T02:52:35 | 2018-08-06T02:53:06 | 141,530,269 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,200 | java | package restaurant.sa.com.sarestaurant.appview.weather;
import java.lang.System;
@kotlin.Metadata(mv = {1, 1, 9}, bv = {1, 0, 2}, k = 1, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\bf\u0018\u00002\u00020\u0001J\"\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u00032\b\b\u0001\u0010\u0005\u001a\u00020\u00062\b\b\u0001\u0010\u0007\u001a\u00020\u0006H\'\u00a8\u0006\b"}, d2 = {"Lrestaurant/sa/com/sarestaurant/appview/weather/WeatherApiClient;", "", "sendRequestForPlaces", "Lretrofit2/Call;", "Lrestaurant/sa/com/sarestaurant/appview/weather/model/ResponseModelClass;", "q", "", "format", "app_debug"})
public abstract interface WeatherApiClient {
@org.jetbrains.annotations.NotNull()
@retrofit2.http.GET(value = "/v1/public/yql")
public abstract retrofit2.Call<restaurant.sa.com.sarestaurant.appview.weather.model.ResponseModelClass> sendRequestForPlaces(@org.jetbrains.annotations.NotNull()
@retrofit2.http.Query(value = "q")
java.lang.String q, @org.jetbrains.annotations.NotNull()
@retrofit2.http.Query(value = "format")
java.lang.String format);
} | [
"soni.karsh53@gmail.com"
] | soni.karsh53@gmail.com |
d04c13c115d16e26035f72b326c8219589517179 | daa98d38f6e0679fdb9c91522f71ee5b47f659b9 | /testjava/src/com/leoLW/javasestudy/day12/homework/Test.java | 91d20b2e9cbafabd4efdc3fe28fe708bfb7ad4ea | [] | no_license | Will-liu923/adas | 32060c2701ad93df8bb017a4ddc2bcc50a671371 | 7cbd9837db10b38f170a023b5d9e243529162344 | refs/heads/master | 2023-07-12T11:24:12.800190 | 2021-08-19T12:51:04 | 2021-08-19T12:51:04 | 397,938,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,526 | java | package com.leoLW.javasestudy.day12.homework;
public class Test {
public static void main(String[] args) {
Bird bird = new RedBird();
DanGong danGong = new DanGong();
danGong.tanShe(bird);
System.out.println("=========================");
Instrument instrument = new Violin();
Musician musician = new Musician();
musician.play(instrument);
System.out.println("=============================");
//子类重写父类的getSalary方法,并计算工资
Employee ele1 = new HourlyEmployee("张三",5,180,50);
double salary = ele1.getSalary(5) + 160 * 50 + (180 - 160) * 50 * 1.5;
System.out.println(ele1.getName() + "的工资是" + salary);
Employee ele2 = new SalariedEmployee("李四",5,8000);
SalariedEmployee salariedEmployee = (SalariedEmployee) ele2;
salary = salariedEmployee.getMonthSalary() + ele2.getSalary(5);
System.out.println(ele2.getName() + "的工资是" + salary);
SalesEmployee ele3 = new SalesEmployee("王五",5,17000,0.5);
salary = ele3.getSalary(5) + ele3.getMonthlySales()*ele3.getCommissionRate();
System.out.println(ele3.getName() + "的工资是" + salary);
BasePlusSalesEmployee ele4 = new BasePlusSalesEmployee("赵六",4,20000,0.4,3000);
salary = ele4.getSalary(5) + ele4.getBaseSalary() + ele4.getCommissionRate() * ele4.getMonthlySales();
System.out.println(ele4.getName() + "的工资是" + salary);
}
}
| [
"leoLW923@outlook.com"
] | leoLW923@outlook.com |
f734cde354c81991c3ce9d1af063c79ce0e66100 | a494d9658cbaee34ea5e8f79a9a35e0f6e696bc0 | /src/main/java/org/nfunk/jep/function/List.java | 70ec28635a563521c62a0c05c938bbc348b75034 | [
"MIT",
"GPL-2.0-only"
] | permissive | Pokecube-Development/Pokecube-Issues-and-Wiki | 60e137a1e3b87589979bb3e3ba2181c82d3f87b9 | 751ea5cc5837d49c742564f5610345707e6ae3dd | refs/heads/1.18.2 | 2023-06-22T21:53:14.893433 | 2023-06-20T22:24:32 | 2023-06-20T22:24:32 | 145,372,884 | 35 | 83 | MIT | 2023-09-13T22:32:40 | 2018-08-20T06:01:59 | Java | UTF-8 | Java | false | false | 1,298 | java | /*****************************************************************************
* JEP - Java Math Expression Parser 2.3.1
* January 26 2006
* (c) Copyright 2004, Nathan Funk and Richard Morris
* See LICENSE.txt for license information.
*****************************************************************************/
package org.nfunk.jep.function;
import java.util.Stack;
import java.util.Vector;
import org.nfunk.jep.ParseException;
/**
* The list function.
* Returns a Vector comprising all the children.
*
* @author Rich Morris
* Created on 29-Feb-2004
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class List extends PostfixMathCommand
{
public List()
{
this.numberOfParameters = -1;
}
@Override
public void run(Stack inStack) throws ParseException
{
this.checkStack(inStack); // check the stack
if (this.curNumberOfParameters < 1) throw new ParseException("Empty list");
final Vector res = new Vector(this.curNumberOfParameters);
res.setSize(this.curNumberOfParameters);
for (int i = this.curNumberOfParameters - 1; i >= 0; --i)
{
final Object param = inStack.pop();
res.setElementAt(param, i);
}
inStack.push(res);
return;
}
}
| [
"elpatricimo@gmail.com"
] | elpatricimo@gmail.com |
1fbbb4829112553c04c42569379652622861e20e | c31f9627ffa5bb0cc93b84e2c49243f795e33917 | /src/io/lacuna/bifurcan/IDiffList.java | 8ddf35d6671c311c0fdbe9049bdf0eed6ff341df | [
"MIT"
] | permissive | mitghi/bifurcan | e5668aa3baebe86b98a8770954582a87aafc634b | 6f1d389cc07b9bc31c2dddf369a8943c83766f42 | refs/heads/master | 2020-12-09T09:39:04.906344 | 2020-01-09T06:54:33 | 2020-01-09T06:54:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,556 | java | package io.lacuna.bifurcan;
import io.lacuna.bifurcan.utils.Iterators;
import java.util.Iterator;
public interface IDiffList<V> extends IList<V>, IDiff<IList<V>, V> {
class Range {
public final long start, end;
public Range(long start, long end) {
this.start = start;
this.end = end;
}
public long size() {
return end - start;
}
}
IList<V> underlying();
Range underlyingSlice();
IList<V> prefix();
IList<V> suffix();
@Override
default IList<V> concat(IList<V> l) {
IList<V> result = Lists.concat(
prefix(),
underlying().slice(underlyingSlice().start, underlyingSlice().end),
suffix(),
l);
return isLinear() ? result.linear() : result;
}
@Override
default long size() {
return prefix().size() + underlyingSlice().size() + suffix().size();
}
@Override
default V nth(long index) {
if (index < prefix().size()) {
return prefix().nth(index);
}
index -= prefix().size();
if (index < underlyingSlice().size()) {
return underlying().nth(underlyingSlice().start + index);
}
index -= underlyingSlice().size();
return suffix().nth(index);
}
@Override
default Iterator<V> iterator() {
Range r = underlyingSlice();
return Iterators.concat(
prefix().iterator(),
r.size() == underlying().size() ? underlying().iterator() : Iterators.range(r.start, r.end, underlying()::nth),
suffix().iterator());
}
@Override
default IList<V> clone() {
return this;
}
}
| [
"ztellman@gmail.com"
] | ztellman@gmail.com |
fb9942dbe20caf1dc1f405e43c240cf84cba864c | 62d065c055b1683da1f4268137659f1054128ee9 | /modules/core/src/main/java/org/mycontroller/standalone/db/tables/RoleSensorMap.java | d45ba5269841fa2f5cda493d9047cf92a809a952 | [
"Apache-2.0"
] | permissive | IFabioI/mycontroller | 9425be361844338be3193e641a9ecd1cfb675fd7 | e7ae76bb61890092824d28fe782a8f0da9e01b07 | refs/heads/development | 2020-03-17T19:46:51.420338 | 2018-06-19T16:24:00 | 2018-06-19T16:24:00 | 133,877,718 | 0 | 0 | Apache-2.0 | 2018-06-14T19:05:31 | 2018-05-17T23:14:38 | Java | UTF-8 | Java | false | false | 1,755 | java | /*
* Copyright 2015-2017 Jeeva Kandasamy (jkandasa@gmail.com)
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mycontroller.standalone.db.tables;
import org.mycontroller.standalone.db.DB_TABLES;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
* @author Jeeva Kandasamy (jkandasa)
* @since 0.0.2
*/
@DatabaseTable(tableName = DB_TABLES.ROLE_SENSOR_MAP)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString(includeFieldNames = true)
public class RoleSensorMap {
public static final String KEY_ROLE_ID = "roleId";
public static final String KEY_SENSOR_ID = "sensorId";
@DatabaseField(canBeNull = false, columnName = KEY_ROLE_ID, uniqueCombo = true, foreign = true,
foreignAutoRefresh = true, maxForeignAutoRefreshLevel = 0)
private Role role;
@DatabaseField(canBeNull = false, columnName = KEY_SENSOR_ID, uniqueCombo = true, foreign = true,
foreignAutoRefresh = true, maxForeignAutoRefreshLevel = 0)
private Sensor sensor;
} | [
"jkandasa@gmail.com"
] | jkandasa@gmail.com |
a0512efedc72f9d5c28e92630fd79d71c92f8115 | 2b4f4b41e8a28a5024d41223b2876c87ee1eaa1a | /Eis-portlet/docroot/WEB-INF/service/com/idetronic/eis/service/MemberCategoryServiceUtil.java | fe66cd75fc7608d775d5333ffe379821591617a9 | [] | no_license | merbauraya/lportal6.2 | 48bb99e5b6b937fce6e20e5c76303c4982bcad02 | e7446107fd793a8ab557b4748f3214a83dbe6ce6 | refs/heads/master | 2021-01-21T19:51:52.682108 | 2017-08-08T14:42:38 | 2017-08-08T14:42:38 | 92,167,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,147 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library 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 library 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.
*/
package com.idetronic.eis.service;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.InvokableService;
/**
* Provides the remote service utility for MemberCategory. This utility wraps
* {@link com.idetronic.eis.service.impl.MemberCategoryServiceImpl} and is the
* primary access point for service operations in application layer code running
* on a remote server. Methods of this service are expected to have security
* checks based on the propagated JAAS credentials because this service can be
* accessed remotely.
*
* @author Mazlan Mat
* @see MemberCategoryService
* @see com.idetronic.eis.service.base.MemberCategoryServiceBaseImpl
* @see com.idetronic.eis.service.impl.MemberCategoryServiceImpl
* @generated
*/
public class MemberCategoryServiceUtil {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify this class directly. Add custom service methods to {@link com.idetronic.eis.service.impl.MemberCategoryServiceImpl} and rerun ServiceBuilder to regenerate this class.
*/
/**
* Returns the Spring bean ID for this bean.
*
* @return the Spring bean ID for this bean
*/
public static java.lang.String getBeanIdentifier() {
return getService().getBeanIdentifier();
}
/**
* Sets the Spring bean ID for this bean.
*
* @param beanIdentifier the Spring bean ID for this bean
*/
public static void setBeanIdentifier(java.lang.String beanIdentifier) {
getService().setBeanIdentifier(beanIdentifier);
}
public static java.lang.Object invokeMethod(java.lang.String name,
java.lang.String[] parameterTypes, java.lang.Object[] arguments)
throws java.lang.Throwable {
return getService().invokeMethod(name, parameterTypes, arguments);
}
public static void clearService() {
_service = null;
}
public static MemberCategoryService getService() {
if (_service == null) {
InvokableService invokableService = (InvokableService)PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(),
MemberCategoryService.class.getName());
if (invokableService instanceof MemberCategoryService) {
_service = (MemberCategoryService)invokableService;
}
else {
_service = new MemberCategoryServiceClp(invokableService);
}
ReferenceRegistry.registerReference(MemberCategoryServiceUtil.class,
"_service");
}
return _service;
}
/**
* @deprecated As of 6.2.0
*/
public void setService(MemberCategoryService service) {
}
private static MemberCategoryService _service;
} | [
"mazlan.mat@gmail.com"
] | mazlan.mat@gmail.com |
270d4172a4a7653f0ee4fe898313d2036a471b49 | a65921c7e4803beeef39c02253d1b00ccf0e0e4b | /Quine.java | e8d6001d25df275d024f0d1243de402a412271ac | [] | no_license | Javaliant/Downloads | fec23e189674e445b76b11c53d08713e7ba1ee8d | 2ecd097657638e9c0618b475004bfdd1e9b743b3 | refs/heads/master | 2016-09-15T03:21:32.311676 | 2016-03-03T15:41:10 | 2016-03-03T15:41:10 | 41,165,204 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | /* Author: Luigi Vincent */
import java.io.PrintWriter;
import java.io.FileNotFoundException;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
public class Quine {
public static void main(String[] args) throws FileNotFoundException, IOException {
String originalName = Quine.class.getSimpleName();
String copyName = originalName + "Copy";
try (PrintWriter writer = new PrintWriter(copyName + ".java", "UTF-8");
Scanner input = new Scanner(new File(originalName + ".java"))) {
while (input.hasNextLine()) {
writer.println(input.nextLine().replace(originalName, copyName));
}
}
String compileCopy = "javac " + copyName + ".java";
Runtime.getRuntime().exec(compileCopy);
}
}
| [
"luigipvincent@gmail.com"
] | luigipvincent@gmail.com |
ce5a6375c490d9cbefa63ddbbc337789e14c7650 | f52d89e3adb2b7f5dc84337362e4f8930b3fe1c2 | /com.fudanmed.platform.core.web/src/main/java/com/fudanmed/platform/core/web/client/warehouse/WorkItemOutStockRecordListGrid.java | f8b37ad81b5a61996564355963594a736114a5f0 | [] | no_license | rockguo2015/med | a4442d195e04f77c6c82c4b82b9942b6c5272892 | b3db5a4943e190370a20cc4fac8faf38053ae6ae | refs/heads/master | 2016-09-08T01:30:54.179514 | 2015-05-18T10:23:02 | 2015-05-18T10:23:02 | 34,060,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,862 | java | package com.fudanmed.platform.core.web.client.warehouse;
import com.fudanmed.platform.core.domain.proxy.RCEmployeeProxy;
import com.fudanmed.platform.core.domain.proxy.RCWorkItemTaskProxy;
import com.fudanmed.platform.core.warehouse.proxy.RCWarehouseProxy;
import com.fudanmed.platform.core.web.shared.warehouse.UIWorkItemOutStockRecord;
import com.google.inject.Inject;
import com.uniquesoft.gwt.client.common.async.IInitializerSupport;
import com.uniquesoft.gwt.client.common.async.IPostInitializeAction;
import com.uniquesoft.gwt.client.common.widgets.valueprovider.ICanAsWidget;
import edu.fudan.langlab.gxt.client.component.grid.GXTGridComponent;
import edu.fudan.langlab.gxt.client.component.grid.factory.DateValueProviderFactory;
import edu.fudan.langlab.gxt.client.component.grid.factory.DateValueProviderFactory.DateColumn;
import edu.fudan.langlab.gxt.client.component.grid.factory.DefaultObjectSelectorFactory;
import edu.fudan.langlab.gxt.client.component.grid.factory.DefaultObjectSelectorFactory.StringValueColumn;
import edu.fudan.langlab.gxt.client.component.grid.factory.StringValueProviderFactory;
import edu.fudan.langlab.gxt.client.component.grid.factory.StringValueProviderFactory.StringColumn;
import edu.fudan.langlab.gxt.client.widget.IWidgetFactory;
import java.util.Map;
public class WorkItemOutStockRecordListGrid extends GXTGridComponent<UIWorkItemOutStockRecord> implements IInitializerSupport {
@Inject
private IWidgetFactory widgets;
public StringColumn<UIWorkItemOutStockRecord> sid;
public StringValueColumn<UIWorkItemOutStockRecord,RCWarehouseProxy> sourceStore;
public StringValueColumn<UIWorkItemOutStockRecord,RCWorkItemTaskProxy> workItem;
public StringValueColumn<UIWorkItemOutStockRecord,RCEmployeeProxy> operator;
public DateColumn<UIWorkItemOutStockRecord> date;
public StringColumn<UIWorkItemOutStockRecord> comment;
@Inject
private StringValueProviderFactory stringValueProviderFactory;
@Inject
private DateValueProviderFactory dateValueProviderFactory;
@Inject
private DefaultObjectSelectorFactory defaultObjectSelectorFactory;
private UIWorkItemOutStockRecord value = new UIWorkItemOutStockRecord();
private Map<String,ICanAsWidget> widgetsRegistory = com.google.common.collect.Maps.newHashMap();
public ICanAsWidget getWidget(final String key) {
return widgetsRegistory.get(key);
}
public void initialize(final IPostInitializeAction handler) {
java.util.Collection<com.uniquesoft.gwt.client.common.async.IInitializerSupport> _initializerSupports = com.google.common.collect.Lists.newArrayList();sid = stringValueProviderFactory.createAsStringColumn("sid","领料单号",UIWorkItemOutStockRecord.SidAccessor);
widgetsRegistory.put("sid",sid);
sourceStore = defaultObjectSelectorFactory.createAsDefaultColumn("sourceStore","出库仓库",UIWorkItemOutStockRecord.SourceStoreAccessor);
widgetsRegistory.put("sourceStore",sourceStore);
workItem = defaultObjectSelectorFactory.createAsDefaultColumn("workItem","工单号",UIWorkItemOutStockRecord.WorkItemAccessor);
widgetsRegistory.put("workItem",workItem);
operator = defaultObjectSelectorFactory.createAsDefaultColumn("operator","操作员",UIWorkItemOutStockRecord.OperatorAccessor);
widgetsRegistory.put("operator",operator);
date = dateValueProviderFactory.createAsStringColumn("date","领料日期",UIWorkItemOutStockRecord.DateAccessor);
widgetsRegistory.put("date",date);
comment = stringValueProviderFactory.createAsStringColumn("comment","备注",UIWorkItemOutStockRecord.CommentAccessor);
widgetsRegistory.put("comment",comment);
IPostInitializeAction postAction = new IPostInitializeAction() {
@Override
public void initializeFinished(Void v) {
initializeComponent();
handler.initializeFinished(null);
}
};
com.uniquesoft.gwt.client.common.async.InitializerManager.initialize(_initializerSupports, postAction);
}
public UIWorkItemOutStockRecord getValueAsNew() {
UIWorkItemOutStockRecord value = new UIWorkItemOutStockRecord();
value.setSid(sid.getValue());
value.setSourceStore(sourceStore.getValue());
value.setWorkItem(workItem.getValue());
value.setOperator(operator.getValue());
value.setDate(date.getValue());
value.setComment(comment.getValue());
return value;
}
public UIWorkItemOutStockRecord doGetValue() {
value.setSid(sid.getValue());
value.setSourceStore(sourceStore.getValue());
value.setWorkItem(workItem.getValue());
value.setOperator(operator.getValue());
value.setDate(date.getValue());
value.setComment(comment.getValue());
return value;
}
public UIWorkItemOutStockRecord getValue(final UIWorkItemOutStockRecord copyValue) {
copyValue.setSid(sid.getValue());
copyValue.setSourceStore(sourceStore.getValue());
copyValue.setWorkItem(workItem.getValue());
copyValue.setOperator(operator.getValue());
copyValue.setDate(date.getValue());
copyValue.setComment(comment.getValue());
return copyValue;
}
protected WorkItemOutStockRecordListGrid doSetValue(final UIWorkItemOutStockRecord value) {
this.value = value;
sid.setValue(value.getSid());
sourceStore.setValue(value.getSourceStore());
workItem.setValue(value.getWorkItem());
operator.setValue(value.getOperator());
date.setValue(value.getDate());
comment.setValue(value.getComment());
valueUpdated(value);return this;
}
public Iterable<ICanAsWidget> getAllProperties() {
return com.google.common.collect.Lists.newArrayList(
(ICanAsWidget)sid,(ICanAsWidget)sourceStore,(ICanAsWidget)workItem,(ICanAsWidget)operator,(ICanAsWidget)date,(ICanAsWidget)comment
);
}
}
| [
"rock.guo@me.com"
] | rock.guo@me.com |
e121f933f6607521be2cdbde18bc97b109d39ee4 | e26a8434566b1de6ea6cbed56a49fdb2abcba88b | /model-setr-mx/src/generated/java/com/prowidesoftware/swift/model/mx/MxSetr01100102.java | 56fa39647f9b50f96b0b362f9011a9140221907b | [
"Apache-2.0"
] | permissive | adilkangerey/prowide-iso20022 | 6476c9eb8fafc1b1c18c330f606b5aca7b8b0368 | 3bbbd6804eb9dc4e1440680e5f9f7a1726df5a61 | refs/heads/master | 2023-09-05T21:41:47.480238 | 2021-10-03T20:15:26 | 2021-10-03T20:15:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,992 | java |
package com.prowidesoftware.swift.model.mx;
import com.prowidesoftware.swift.model.mx.dic.*;
import com.prowidesoftware.swift.model.mx.AbstractMX;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.prowidesoftware.swift.model.MxSwiftMessage;
import com.prowidesoftware.swift.model.mx.AbstractMX;
import com.prowidesoftware.swift.model.mx.MxRead;
import com.prowidesoftware.swift.model.mx.MxReadImpl;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* Class for setr.011.001.02 ISO 20022 message.
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Document", propOrder = {
"setr01100102"
})
@XmlRootElement(name = "Document", namespace = "urn:swift:xsd:setr.011.001.02")
public class MxSetr01100102
extends AbstractMX
{
@XmlElement(name = "setr.011.001.02", required = true)
protected Setr01100102 setr01100102;
public final static transient String BUSINESS_PROCESS = "setr";
public final static transient int FUNCTIONALITY = 11;
public final static transient int VARIANT = 1;
public final static transient int VERSION = 2;
@SuppressWarnings("rawtypes")
public final static transient Class[] _classes = new Class[] {Account2 .class, AccountIdentification1 .class, AccountIdentificationAndName3 .class, ActiveCurrencyAnd13DecimalAmount.class, ActiveCurrencyAndAmount.class, ActiveOrHistoricCurrencyAndAmount.class, AdditionalReference3 .class, AddressType2Code.class, AlternateSecurityIdentification1 .class, BICIdentification1 .class, CancellationRight1 .class, CancellationRight2Code.class, CardType1Code.class, CashAccountIdentification1Choice.class, CashAccountType1 .class, Charge8 .class, ChargeType1 .class, ChargeType6Code.class, Cheque3 .class, ClearingSystemMemberIdentificationChoice.class, Commission6 .class, CommissionType1 .class, CommissionType5Code.class, CommissionWaiver2 .class, CopyInformation1 .class, CountryAndResidentialStatusType1 .class, CreditTransfer4 .class, Creditor2 .class, Debtor2 .class, DeliveringPartiesAndAccount3 .class, DirectDebitMandate2 .class, DistributionPolicy1Code.class, Extension1 .class, FinancialInstitutionIdentification3Choice.class, FinancialInstrument6 .class, FinancialInstrumentQuantity1 .class, ForeignExchangeTerms5 .class, FormOfSecurity1Code.class, FundCashAccount1Code.class, FundOrderType1 .class, FundOrderType2Code.class, FundSettlementParameters4 .class, GenericIdentification1 .class, GenericIdentification8 .class, IdentificationType1 .class, IncomePreference1Code.class, IndividualPerson2 .class, Intermediary4 .class, InvestmentAccount13 .class, InvestmentAccount15 .class, MxSetr01100102 .class, NameAndAddress4 .class, NameAndAddress5 .class, PartyIdentification2Choice.class, PartyIdentificationAndAccount3 .class, PaymentCard2 .class, PaymentInstrument10Choice.class, PaymentTransaction19 .class, PersonIdentificationType1Code.class, PostalAddress1 .class, ReceivingPartiesAndAccount3 .class, ResidentialStatus1Code.class, RoundingDirection2Code.class, SecurityIdentification1Choice.class, Setr01100102 .class, SimpleIdentificationInformation.class, SubscriptionMultipleOrder2 .class, SubscriptionMultipleOrderInstruction1 .class, SubscriptionOrder4 .class, Tax6 .class, TaxCalculationInformation1 .class, TaxExemptionReason1 .class, TaxType1 .class, TaxType7Code.class, TaxationBasis1 .class, TaxationBasis3Code.class, WaivingInstruction2Code.class, WaivingType1 .class };
public final static transient String NAMESPACE = "urn:swift:xsd:setr.011.001.02";
public MxSetr01100102() {
super();
}
/**
* Creates the MX object parsing the parameter String with the XML content
*
*/
public MxSetr01100102(final String xml) {
this();
MxSetr01100102 tmp = parse(xml);
setr01100102 = tmp.getSetr01100102();
}
/**
* Creates the MX object parsing the raw content from the parameter MxSwiftMessage
*
*/
public MxSetr01100102(final MxSwiftMessage mxSwiftMessage) {
this(mxSwiftMessage.message());
}
/**
* Gets the value of the setr01100102 property.
*
* @return
* possible object is
* {@link Setr01100102 }
*
*/
public Setr01100102 getSetr01100102() {
return setr01100102;
}
/**
* Sets the value of the setr01100102 property.
*
* @param value
* allowed object is
* {@link Setr01100102 }
*
*/
public MxSetr01100102 setSetr01100102(Setr01100102 value) {
this.setr01100102 = value;
return this;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
}
@Override
public boolean equals(Object that) {
return EqualsBuilder.reflectionEquals(this, that);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public String getBusinessProcess() {
return BUSINESS_PROCESS;
}
@Override
public int getFunctionality() {
return FUNCTIONALITY;
}
@Override
public int getVariant() {
return VARIANT;
}
@Override
public int getVersion() {
return VERSION;
}
/**
* Creates the MX object parsing the raw content from the parameter XML
*
*/
public static MxSetr01100102 parse(String xml) {
return ((MxSetr01100102) MxReadImpl.parse(MxSetr01100102 .class, xml, _classes));
}
/**
* Creates the MX object parsing the raw content from the parameter XML with injected read implementation
* @since 9.0.1
*
* @param parserImpl an MX unmarshall implementation
*/
public static MxSetr01100102 parse(String xml, MxRead parserImpl) {
return ((MxSetr01100102) parserImpl.read(MxSetr01100102 .class, xml, _classes));
}
@Override
public String getNamespace() {
return NAMESPACE;
}
@Override
@SuppressWarnings("rawtypes")
public Class[] getClasses() {
return _classes;
}
/**
* Creates an MxSetr01100102 messages from its JSON representation.
* <p>
* For generic conversion of JSON into the corresponding MX instance
* see {@link AbstractMX#fromJson(String)}
*
* @since 7.10.2
*
* @param json a JSON representation of an MxSetr01100102 message
* @return
* a new instance of MxSetr01100102
*/
public final static MxSetr01100102 fromJson(String json) {
return AbstractMX.fromJson(json, MxSetr01100102 .class);
}
}
| [
"sebastian@prowidesoftware.com"
] | sebastian@prowidesoftware.com |
0ea0eb63b5923ecdcab98e15e52021de7ca91a78 | b3205744499b6b5b878193eb1fc3b83ac34bce2b | /net.bearfather.goslink2/src/net/bearfather/goslink2/Connector.java | e6243ac948c8dcac871ec5f7f90d7b1f355434a7 | [] | no_license | BearFather/GosLink2 | 0eae16f61188cf8b1ecf5f4255ec3ae7ee546271 | f4190a77a12a5c686c7ae2e7af2d7215e20e90fe | refs/heads/master | 2020-12-23T10:02:35.425463 | 2018-08-05T00:19:02 | 2018-08-05T00:19:02 | 38,735,964 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,340 | java | package net.bearfather.goslink2;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.net.SocketException;
import org.apache.commons.net.telnet.TelnetClient;
/*
* This Class was made to do a rewrite,
* I have haven't got far but maybe used
* in the future.
* Bear
*
*/
public class Connector implements Runnable {
public Connector() {
}
@Override
public void run() {
}
public class TelnetService {
private final String server;
private final int port;
public TelnetClient telnet = new TelnetClient();
private InputStream dataIn;
private PrintStream dataOut;
public int loggedin=0;
public int runner=1;
public int mynum=0;
String hangup=GosLink2.props("cleanup");
String nonstop="(N)onstop, (Q)uit, or (C)ontinue?";
String ghosts="Enter your password to end the other connection and log on.";
int cnt;
public int ghost=0;
public TelnetService(String server, int port) {
this.server = server.replace("http://", "");
this.port = port;
}
public void killme() throws IOException{
GosLink2.dw.append("Killme Called");
telnet.disconnect();
}
private void startTelnetSession() throws SocketException, IOException {
//mh=new Bot(npc,this);
telnet.connect(server, port);
dataIn = telnet.getInputStream();
dataOut = new PrintStream(telnet.getOutputStream());
}
public String getTelnetSessionAsString(String tcn) throws SocketException, IOException, InterruptedException {
startTelnetSession();
String rtn="blah";
GosLink2.dw.append("Logging into server "+tcn+".");
rtn=loginUser(GosLink2.props("user"+tcn),GosLink2.props("game"+tcn),GosLink2.props("pass"+tcn));
if (rtn.equals("reload")){return rtn;}
loggedin=1;
return "Logged in";
}
private String loginUser(String name, String cmd,String pass) throws InterruptedException, IOException {
if (GosLink2.props("nonstop")!=null){nonstop=GosLink2.props("nonstop");}
readUntil(GosLink2.props("puser"));
write(name);
readUntil(GosLink2.props("ppass"));
write(pass+"\r\n");
readUntil(GosLink2.props("pmenu"));
if (ghost == 1){
write("=x\n");
ghost=0;
return "reload";
}
write(cmd);
readUntil(GosLink2.props("pmud"));
write("e");
write("\n");
write("set statline off");
if(GosLink2.ansi){write("=a");}
return "blah";
}
public void write(String value) {
try {
dataOut.println(value);
dataOut.flush();
if (loggedin==1){
if (value.equals("\n")){}
else if(value.equals("")){}
else{if(!value.equals("ping")){GosLink2.dw.append(mynum+"->"+value);}}
}
} catch (Exception e) {
e.printStackTrace();
loggedin=0;
}
}
public String readUntil(String pattern) throws InterruptedException, IOException {
cnt=0;
char lastChar = pattern.charAt(pattern.length() - 1);
StringBuffer buffer = new StringBuffer();
char ch = (char) dataIn.read();
String msg;
while (runner==1) {
buffer.append(ch);
msg=buffer.toString();
String chk=msg.trim();
String rtn=msgchk(chk);
if (rtn != null){
if (rtn.equals("!OffLINE+02")){
loggedin=0;
return "!OffLINE+02";
}
return rtn;
}
if (ch == lastChar) {
if (GosLink2.dw.dbm){GosLink2.dw.append(msg.trim());}
if (buffer.toString().endsWith(pattern)) {
return buffer.toString().trim();
}
}
ch = (char) dataIn.read();
}
return null;
}
public String readit(String kill) throws InterruptedException, IOException {
cnt=0;
char lastChar = 'n';
StringBuffer buffer = new StringBuffer();
char ch = (char) dataIn.read();
while (runner==1) {
buffer.append(ch);
String msg=buffer.toString().trim();
String results=msgchk(msg);
if (results != null){
if (results.equals("!OffLINE+02")){
loggedin=0;
return "!OffLINE+02";
}
return results;
}
if (msg.endsWith("The gods have punished you appropriately.")){write("\n");}
if (msg.contains(kill)){return kill;}
if (ch == lastChar) {
if (buffer.toString().endsWith("\n")) {return buffer.toString();}
}
ch = (char) dataIn.read();
}
return null;
}
private String msgchk(String chk) throws InterruptedException, IOException{
if (chk.endsWith(ghosts)){ghost=1;}
else if (chk.endsWith(nonstop)){
if (cnt == 0){
dataOut.print("n\b");
dataOut.flush();
}
cnt++;
}else if (chk.endsWith(hangup)){
GosLink2.dw.append("BBS shutdown detected!");
loggedin=0;
return "!OffLINE+02";
}else if (chk.contains("You say \"ping\"")){
//HeartBeat.ping=true;
return "flush";
}
return null;
}
}
}
| [
"BearFather@gmail.com"
] | BearFather@gmail.com |
be866cf2d5fcc1685485129e31e04c4d6af02853 | 723f67236e08646ea04607f971d0d1584f6c9a7f | /src/plantuml-asl/src/net/sourceforge/plantuml/creole/legacy/StripeCode.java | 70ba1851044b2e35411e78e8ed07a8a4673807c5 | [
"Apache-2.0"
] | permissive | yakup/umldoclet | c15e8b8ed1609cf9471d969cc134b2d78d93b7ae | d61f8090bf12e077fd2676dab0de06c1193a786f | refs/heads/master | 2023-04-21T19:58:42.191452 | 2021-03-12T19:16:16 | 2021-03-12T19:16:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,396 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: https://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* https://plantuml.com/patreon (only 1$ per month!)
* https://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* 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.
*
*
* Original Author: Arnaud Roques
*/
package net.sourceforge.plantuml.creole.legacy;
import java.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Stripe;
import net.sourceforge.plantuml.creole.atom.Atom;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UText;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class StripeCode implements Stripe, Atom {
final private FontConfiguration fontConfiguration;
private final List<String> raw = new ArrayList<String>();
private boolean terminated;
public StripeCode(FontConfiguration fontConfiguration, ISkinSimple skinParam, String line) {
// this.skinParam = skinParam;
this.fontConfiguration = fontConfiguration;
}
public List<Atom> getAtoms() {
return Collections.<Atom>singletonList(this);
}
public Atom getLHeader() {
return null;
}
public boolean addAndCheckTermination(String line) {
if (Parser.isCodeEnd(line)) {
this.terminated = true;
return true;
}
this.raw.add(line);
return false;
}
public final boolean isTerminated() {
return terminated;
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
double width = 0;
double height = 0;
for (String s : raw) {
final Dimension2D dim = stringBounder.calculateDimension(fontConfiguration.getFont(), s);
width = Math.max(width, dim.getWidth());
height += dim.getHeight();
}
return new Dimension2DDouble(width, height);
}
public double getStartingAltitude(StringBounder stringBounder) {
return 0;
}
public void drawU(UGraphic ug) {
double y = 0;
for (String s : raw) {
final UText shape = new UText(s, fontConfiguration);
final Dimension2D dim = ug.getStringBounder().calculateDimension(fontConfiguration.getFont(), s);
y += dim.getHeight();
ug.apply(UTranslate.dy(y - shape.getDescent())).draw(shape);
}
}
public List<Atom> splitInTwo(StringBounder stringBounder, double width) {
throw new UnsupportedOperationException();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
e2bf350555912e688f054652bb6d0ecca5e7b63b | 5fcb6a88e7f72b072088dbf568a7d8797a2a3ff0 | /app/src/main/java/com/br/pagpeg/fragment/shopper/ShopperProfileFragment.java | 003c90a5ad49755b02ce9be6e370901197947333 | [] | no_license | brunoteixeiralc/pagpeg_android | 4245fa8c2647a3706130651397843718105688e3 | fd50177322e25093f00356ca25dd5d339f32c0f8 | refs/heads/master | 2020-05-21T20:31:54.332511 | 2017-04-20T02:03:32 | 2017-04-20T02:03:32 | 63,353,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,665 | java | package com.br.pagpeg.fragment.shopper;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RatingBar;
import android.widget.TextView;
import com.br.pagpeg.R;
import com.br.pagpeg.model.Shopper;
import com.br.pagpeg.utils.EnumToolBar;
import com.br.pagpeg.utils.Utils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;
import com.google.firebase.auth.FirebaseAuth;
/**
* Created by brunolemgruber on 22/07/16.
*/
public class ShopperProfileFragment extends Fragment {
private View view;
private Button editProfile;
private TextView shopperName,shopperEmail,shopperNumber,logout;
private ImageView shopperImage;
private Fragment fragment;
private ProgressBar progressBar;
private RatingBar shopperRatingBar;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.content_shopper_profile, container, false);
Toolbar toolbar =(Toolbar)getActivity().findViewById(R.id.toolbar);
toolbar.setTitle("Minha conta");
Utils.setIconBar(EnumToolBar.SHOPPERPROFILE,toolbar);
shopperImage = (ImageView) view.findViewById(R.id.shopper_image);
shopperEmail = (TextView) view.findViewById(R.id.shopper_email);
shopperName = (TextView) view.findViewById(R.id.shopper_name);
shopperNumber = (TextView) view.findViewById(R.id.shopper_number);
progressBar = (ProgressBar) view.findViewById(R.id.progress);
shopperRatingBar = (RatingBar) view.findViewById(R.id.shopper_rating);
final Shopper shopper = (Shopper) getArguments().getSerializable("shopper");
shopperRatingBar.setRating(shopper.getRating());
shopperNumber.setText(shopper.getNumber());
shopperName.setText(shopper.getName());
shopperEmail.setText(shopper.getEmail());
if(shopper.getUser_img() != null){
Glide.with(ShopperProfileFragment.this).load(shopper.getUser_img()).listener(new RequestListener<String, GlideDrawable>() {
@Override
public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
progressBar.setVisibility(View.GONE);
return false;
}
}).diskCacheStrategy(DiskCacheStrategy.ALL).into(shopperImage);
}else{
progressBar.setVisibility(View.GONE);
}
editProfile = (Button) view.findViewById(R.id.edit_profile);
editProfile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putSerializable("shopper",shopper);
fragment = new EditShopperProfileFragment();
fragment.setArguments(bundle);
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, fragment).addToBackStack(null).commit();
}
});
logout = (TextView) toolbar.findViewById(R.id.logout);
logout.setVisibility(View.VISIBLE);
logout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FirebaseAuth.getInstance().signOut();
getFragmentManager().beginTransaction().remove(ShopperProfileFragment.this).commit();
Intent intent = new Intent(ShopperProfileFragment.this.getActivity(), com.br.pagpeg.activity.shopper.LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}
});
return view;
}
}
| [
"brunoteixeiralc@gmail.com"
] | brunoteixeiralc@gmail.com |
0b803f9ce23659aed2c7c689161ec30d7e87be38 | 6eebee304f3f238ff7085cfdb620c2ae2d38f040 | /src/org/ironrhino/rest/doc/annotation/Field.java | 5fd8e77a2cb730c572844b6737ce5e868219d997 | [] | no_license | ironrhino/ironrhino | a7d29498fd5e947a45fcf6a5e90659f61f72b72a | 5678a09fa8a98704ece8c3df40af884aeb75222a | refs/heads/develop | 2023-07-10T02:04:15.460408 | 2023-06-21T03:48:17 | 2023-06-25T07:45:02 | 16,971,008 | 62 | 50 | null | 2020-06-01T07:37:39 | 2014-02-19T02:09:37 | Java | UTF-8 | Java | false | false | 587 | java | package org.ironrhino.rest.doc.annotation;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@Target({ PARAMETER, FIELD })
@Retention(RUNTIME)
public @interface Field {
String name() default "";
String type() default "";
boolean required() default true;
String label() default "";
String description() default "";
String defaultValue() default "";
} | [
"zhouyanming@gmail.com"
] | zhouyanming@gmail.com |
5b2ea57a909ac8707e551ed698d651a1c3a372fa | cee186762c5f71acd51990b5d1e659428648d0f6 | /src/main/java/com/searchinner/dao/CommentDAO.java | 32758c5e69ae9a1fa3697b7fb666bcb1af5ba49a | [] | no_license | fjj596894378/searchInner | 535e5b2081fa84b1ef1f01f736f4401e48ad8be8 | 1a98dcc648060456f13c7f7141a900f1d1e84408 | refs/heads/gnntdev | 2021-01-10T11:29:27.161247 | 2016-04-25T05:17:28 | 2016-04-25T05:17:28 | 55,022,503 | 0 | 0 | null | 2016-04-25T05:17:29 | 2016-03-30T01:26:18 | JavaScript | UTF-8 | Java | false | false | 564 | java | package com.searchinner.dao;
import java.util.List;
import com.searchinner.model.Comment;
public interface CommentDAO {
/**
* 添加评论
* @param comment
* @return
*/
public Comment addComment( Comment comment);
/**
* 通过评论Id获得用户信息
* @param commentId
* @return
*/
public Comment getComment(String commentId);
/**
* 删除评论
* @param commentName
*/
public void deleteComment(String commentId);
/**
* 获得所有评论
* @return
*/
public List<Comment> getComments(String aricleId);
}
| [
"596894378@qq.com"
] | 596894378@qq.com |
73cdb06ac422a40ea50ade8e149f43caa4aeb4f8 | fc5593863c275681a4cd6899479fbe213596d5dd | /src/main/java/uiActions/Menu_MyWalletPage.java | e4c6997ed68f1d34224864057f94e8c9a400928a | [] | no_license | AutomationExpert07/WebV1 | 9f1a5176bf23335616e7ec7cd08670c6d468b832 | 2205d528f600931ef46fb898538199e07228661e | refs/heads/master | 2020-03-24T17:17:04.145324 | 2018-04-16T16:36:14 | 2018-04-16T16:36:14 | 142,855,001 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,178 | java | package uiActions;
import org.apache.log4j.Logger;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import testBase.TestBase;
public class Menu_MyWalletPage extends TestBase{
public static final Logger log= Logger.getLogger(Menu_MyWalletPage.class.getName());
WebDriver driver;
public String MyWalletURL ="http://wallet.btc.btccom-autotest.blocktrail.com/#/wallet";
@FindBy(xpath="//span[contains(text(),'My Wallet')]")
WebElement myWalletMenu;
@FindBy(xpath="//span[contains(text(),'My Wallet')]")
WebElement myWalletPageTile;
@FindBy(xpath="//h1[contains(text(),'No transactions, yet')]")
WebElement NoTransYet;
@FindBy(xpath="//a[contains(text(),'Funding your wallet')]")
WebElement FundyourWalletLink;
public Menu_MyWalletPage(WebDriver driver) {
this.driver= driver;
PageFactory.initElements(driver, this);
}
public void clickWallet()
{
myWalletMenu.click();
}
public String verifyNoTransactionYet() {
return NoTransYet.getText();
}
public void FundyourWalletLink() {
FundyourWalletLink.click();
}
}
| [
"sohaibcool@gmail.com"
] | sohaibcool@gmail.com |
b392ebc31bb96212bccb619ff85f883f55c78fa2 | c8545ea093da5c39f75e89b26e4bcc48c6f7881b | /app/src/main/java/com/demo/jetpack/util/toast/IToastStyle.java | 55c3a84539d942b15ed09840ff6829280a9f5aea | [] | no_license | zp0511/JetPackDemo | 19914dbf038d2cf614d1e12ca082a5ffcc68fc8f | 473c624ac22f33257695f0ac5429817a98badf8d | refs/heads/master | 2020-06-30T21:04:03.583599 | 2019-12-03T13:52:20 | 2019-12-03T13:52:20 | 200,950,633 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 772 | java | package com.demo.jetpack.util.toast;
/**
* author : Android 轮子哥
* github : https://github.com/getActivity/ToastUtils
* time : 2018/09/01
* desc : 默认样式接口
*/
public interface IToastStyle {
int getGravity(); // 吐司的重心
int getXOffset(); // X轴偏移
int getYOffset(); // Y轴偏移
int getZ(); // 吐司Z轴坐标
int getCornerRadius(); // 圆角大小
int getBackgroundColor(); // 背景颜色
int getTextColor(); // 文本颜色
float getTextSize(); // 文本大小
int getMaxLines(); // 最大行数
int getPaddingLeft(); // 左边内边距
int getPaddingTop(); // 顶部内边距
int getPaddingRight(); // 右边内边距
int getPaddingBottom(); // 底部内边距
} | [
"shineourlove@qq.com"
] | shineourlove@qq.com |
c6c579eed3e13d12ccc93e096d0f3b2d2b55a408 | 6baa09045c69b0231c35c22b06cdf69a8ce227d6 | /modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201602/AspectRatioImageCreative.java | 4308f9646fa97f355498d3eb54eec83a0eb21a6b | [
"Apache-2.0"
] | permissive | remotejob/googleads-java-lib | f603b47117522104f7df2a72d2c96ae8c1ea011d | a330df0799de8d8de0dcdddf4c317d6b0cd2fe10 | refs/heads/master | 2020-12-11T01:36:29.506854 | 2016-07-28T22:13:24 | 2016-07-28T22:13:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,381 | java |
package com.google.api.ads.dfp.jaxws.v201602;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
*
* A {@code Creative} intended for mobile platforms that displays an image,
* whose {@link LineItem#creativePlaceholders size} is defined as an
* {@link CreativeSizeType#ASPECT_RATIO aspect ratio}, i.e.
* {@link Size#isAspectRatio}. It can have multiple images whose dimensions
* conform to that aspect ratio.
*
*
* <p>Java class for AspectRatioImageCreative complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="AspectRatioImageCreative">
* <complexContent>
* <extension base="{https://www.google.com/apis/ads/publisher/v201602}HasDestinationUrlCreative">
* <sequence>
* <element name="imageAssets" type="{https://www.google.com/apis/ads/publisher/v201602}CreativeAsset" maxOccurs="unbounded" minOccurs="0"/>
* <element name="altText" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="thirdPartyImpressionUrl" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="overrideSize" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AspectRatioImageCreative", propOrder = {
"imageAssets",
"altText",
"thirdPartyImpressionUrl",
"overrideSize"
})
public class AspectRatioImageCreative
extends HasDestinationUrlCreative
{
protected List<CreativeAsset> imageAssets;
protected String altText;
protected String thirdPartyImpressionUrl;
protected Boolean overrideSize;
/**
* Gets the value of the imageAssets property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the imageAssets property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getImageAssets().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CreativeAsset }
*
*
*/
public List<CreativeAsset> getImageAssets() {
if (imageAssets == null) {
imageAssets = new ArrayList<CreativeAsset>();
}
return this.imageAssets;
}
/**
* Gets the value of the altText property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAltText() {
return altText;
}
/**
* Sets the value of the altText property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAltText(String value) {
this.altText = value;
}
/**
* Gets the value of the thirdPartyImpressionUrl property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getThirdPartyImpressionUrl() {
return thirdPartyImpressionUrl;
}
/**
* Sets the value of the thirdPartyImpressionUrl property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setThirdPartyImpressionUrl(String value) {
this.thirdPartyImpressionUrl = value;
}
/**
* Gets the value of the overrideSize property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isOverrideSize() {
return overrideSize;
}
/**
* Sets the value of the overrideSize property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setOverrideSize(Boolean value) {
this.overrideSize = value;
}
}
| [
"api.cseeley@gmail.com"
] | api.cseeley@gmail.com |
ba0c9be62614b4f64b134ae11f0b70d994d0877d | 79b846f530a4fe958efba3eac26f35bd599a3b67 | /catleap/src/main/java/com/nespresso/exercice/cat/Cat.java | 62517be5556a5a94f4b8873907681ab73ece0b4a | [] | no_license | rayomar/SQLITraining | 8f3e1cf2997a62026882b09f0c5b9696640506dd | 8209b082b67eae8abe1da199ee6941baf5adb52f | refs/heads/master | 2021-05-29T05:07:18.912601 | 2015-05-10T20:01:17 | 2015-05-10T20:01:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package com.nespresso.exercice.cat;
public class Cat {
private int leapCounter;
private final static int maxLeapSize = 4;
public Cat(){
leapCounter = 0;
}
public void leap() {
leapCounter++;
}
public String path() {
return Display.DisplayCatPath(leapCounter, maxLeapSize);
}
}
| [
"errady.adil@gmail.com"
] | errady.adil@gmail.com |
df23681e34072283f9700417827fc9b2e22ef064 | 83c4526ec85ea4ffea4c40deb95d4a967424b3ca | /PHRMS_Mobile/Android App/app/src/main/java/com/pkg/healthrecordappname/appfinalname/modules/fragments/PHRMS_WellnessWeight_Fragment.java | 35d68e562e67424f4190c809007d4b5ffb6255b2 | [] | no_license | dmaulikr/MyHealthRecord | a64e0afbe11d82be495c6087651fc63c9fad0846 | fdcceca7371a6026fc197145bc74317222429d26 | refs/heads/gh-pages | 2021-01-22T00:51:06.436789 | 2017-05-15T06:29:59 | 2017-05-15T06:29:59 | 102,191,576 | 1 | 0 | null | 2017-09-02T11:20:23 | 2017-09-02T11:20:22 | null | UTF-8 | Java | false | false | 16,276 | java | package com.pkg.healthrecordappname.appfinalname.modules.fragments;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.GestureDetector;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.pkg.healthrecordappname.appfinalname.PHRMS_LoginActivity;
import com.pkg.healthrecordappname.appfinalname.R;
import com.pkg.healthrecordappname.appfinalname.modules.addfragments.PHRMS_WellnessWeight_Fragment_Add;
import com.pkg.healthrecordappname.appfinalname.modules.clinicaldialogues.PHRMS_WellnessWeight_Dialogue;
import com.pkg.healthrecordappname.appfinalname.modules.jsonparser.ParseJson_WellnessWeightData;
import com.pkg.healthrecordappname.appfinalname.modules.useables.Functions;
import com.pkg.healthrecordappname.appfinalname.modules.useables.MySingleton;
import com.pkg.healthrecordappname.appfinalname.modules.useables.RecycleView_DividerItemDecoration;
import org.json.JSONObject;
public class PHRMS_WellnessWeight_Fragment extends Fragment {
String url = null;
private RecyclerView mRecyclerView_wellnessWeight = null;
private RecyclerView.LayoutManager mLayoutManager_wellnessWeight;
private TextView txtwellnessWeightData;
private ProgressBar mProgressView;
private SwipeRefreshLayout mSwipeRefreshLayout;
public PHRMS_WellnessWeight_Fragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.frame_wellnessweight, container, false);
mProgressView = (ProgressBar) getActivity().findViewById(R.id.data_progressbar);
txtwellnessWeightData = (TextView) rootView.findViewById(R.id.txtwellnessWeightData);
mRecyclerView_wellnessWeight = (RecyclerView) rootView.findViewById(R.id.lstdata_wellnessWeight_recycler);
mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.lstdata_wellnessWeight_swipe_refresh);
// Floating Action Button
FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab_Add_wellnessWeight);
Functions.progressbarStyle(mProgressView, getActivity());
String userid = Functions.decrypt(rootView.getContext(), Functions.pref.getString(Functions.P_UsrID, null));
if (Functions.isNetworkAvailable(getActivity())) {
if (Functions.isNullOrEmpty(userid)) {
Intent intent = new Intent(getActivity(), PHRMS_LoginActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
getActivity().finish();
} else {
url = getString(R.string.urlLogin) + getString(R.string.LoadWeightData) + userid;
// use this setting to improve performance if you know that changes
// in content do not change the layout size of the RecyclerView
mRecyclerView_wellnessWeight.setHasFixedSize(true);
// use a linear layout manager
mLayoutManager_wellnessWeight = new LinearLayoutManager(getActivity());
mRecyclerView_wellnessWeight.setLayoutManager(mLayoutManager_wellnessWeight);
mRecyclerView_wellnessWeight.setItemAnimator(new DefaultItemAnimator());
mRecyclerView_wellnessWeight.addItemDecoration(new RecycleView_DividerItemDecoration(getActivity(), LinearLayoutManager.VERTICAL));
if (url != null) {
LoadwellnessWeightData(url);
}
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (url != null) {
LoadwellnessWeightData(url);
}
}
});
// Added Custom RecyclerTouchListener
mRecyclerView_wellnessWeight.addOnItemTouchListener(new RecyclerTouchListener(getActivity(), mRecyclerView_wellnessWeight, new ClickListener() {
@Override
public void onClick(View view, int position) {
PHRMS_WellnessWeight_Dialogue dialogue_WellnessWeight = new PHRMS_WellnessWeight_Dialogue();
Bundle bundle = new Bundle();
bundle.putInt("Display", 1);
bundle.putString("Weight", ParseJson_WellnessWeightData.Weight[position]);
bundle.putString("Height", ParseJson_WellnessWeightData.Height[position]);
String finalbmicValue = "-";
if (!Functions.isNullOrEmpty(ParseJson_WellnessWeightData.Weight[position]) && !Functions.isNullOrEmpty(ParseJson_WellnessWeightData.Height[position])) {
double bmic = Double.parseDouble(ParseJson_WellnessWeightData.Weight[position].toString()) / Math.pow(Double.parseDouble(ParseJson_WellnessWeightData.Height[position].toString()) / 100, 2.0);
finalbmicValue = String.valueOf(Math.round(bmic * 100.0) / 100.0);
}
bundle.putString("BMI", finalbmicValue);
bundle.putString("strCollectionDate", ParseJson_WellnessWeightData.strCollectionDate[position]);
bundle.putString("Comments", ParseJson_WellnessWeightData.Comments[position]);
dialogue_WellnessWeight.setArguments(bundle);
dialogue_WellnessWeight.show(getFragmentManager(), "Weight Details");
}
@Override
public void onLongClick(View view, int position) {
}
}));
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (Functions.isNetworkAvailable(getActivity())) {
Intent intWellnessWeightAdd = new Intent(getActivity(), PHRMS_WellnessWeight_Fragment_Add.class);
startActivityForResult(intWellnessWeightAdd, 1);
} else {
Functions.showSnackbar(getView(), "Internet Not Available !!", "Action");
}
//Snackbar.make(view, "Replace with your wellnessWeight action", Snackbar.LENGTH_LONG).setAction("Action", null).show();
}
});
// To show and hide floating buttons
if (null != getActivity() && null != mRecyclerView_wellnessWeight) {
Functions.FloatTransitions(getActivity(), mRecyclerView_wellnessWeight, fab);
}
}
} else {
Functions.showSnackbar(rootView, Functions.IE_NotAvailable, "Action");
}
return rootView;
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1) {
if (resultCode == Activity.RESULT_OK) {
if (data.getIntExtra("WellnessWeightSaved", 0) == 1) {
if (Functions.isNetworkAvailable(getActivity())) {
mSwipeRefreshLayout.setRefreshing(true);
LoadwellnessWeightData(url);
} else {
Functions.showSnackbar(getView(), "Internet Not Available !!", "Action");
}
}
}
}
}
public void LoadwellnessWeightData(String url) {
Functions.showProgress(true, mProgressView);
final JsonObjectRequest jsObjRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject jsonData) {
LoadwellnessWeightJSONData(jsonData);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Functions.showProgress(false, mProgressView);
mSwipeRefreshLayout.setRefreshing(false);
Functions.ErrorHandling(getActivity(), error);
// TODO Auto-generated method stub
Log.e("Weight Error", error.toString());
}
});
// Access the RequestQueue through your singleton class.
MySingleton.getInstance(getActivity()).addToRequestQueue(jsObjRequest);
}
private void LoadwellnessWeightJSONData(JSONObject jsonData) {
// Class to parse data and load in data arrays
ParseJson_WellnessWeightData wellnessWeight_pj = new ParseJson_WellnessWeightData(jsonData);
String STATUS = wellnessWeight_pj.parseJson();
if (STATUS.equals("1")) {
txtwellnessWeightData.setVisibility(View.GONE);
wellnessWeightDataList m_wellnessWeightDataList = new wellnessWeightDataList(getActivity(), ParseJson_WellnessWeightData.Weight, ParseJson_WellnessWeightData.Height, ParseJson_WellnessWeightData.strCollectionDate, ParseJson_WellnessWeightData.SourceId);
// specify an adapter (see also next example)
mRecyclerView_wellnessWeight.setAdapter(m_wellnessWeightDataList);
Functions.showProgress(false, mProgressView);
mSwipeRefreshLayout.setRefreshing(false);
} else {
txtwellnessWeightData.setVisibility(View.VISIBLE);
Functions.showProgress(false, mProgressView);
mSwipeRefreshLayout.setRefreshing(false);
}
}
//extends Recyler adapter wellnessWeightDataList and ViewHolder to hold data
public class wellnessWeightDataList extends RecyclerView.Adapter<wellnessWeightDataList.ViewHolder> {
private String[] wellnessWeightValue;
private String[] wellnessHeightValue;
private String[] collectionDate;
//Added to check if data is from EMR
private String[] SourceId;
private Activity context;
// Provide a reference to the views for each data item
// Complex data items may need more than one view per item, and
// you provide access to all the views for a data item in a view holder
public class ViewHolder extends RecyclerView.ViewHolder {
// each data item is just a string in this case
public TextView mTextView_wellnessWeightValue, mTextView_wellnessHeightValue, mTextView_collectionDate, mTextView_wellnessBMIValue;
//Load Recyler adapter wellnessWeightDataList and ViewHolder to hold data
public ViewHolder(View v) {
super(v);
mTextView_wellnessWeightValue = (TextView) v.findViewById(R.id.txtactWTwellnessWeightValue);
mTextView_wellnessHeightValue = (TextView) v.findViewById(R.id.txtactWTwellnessHeightValue);
mTextView_collectionDate = (TextView) v.findViewById(R.id.txtactWTcollectionDate);
mTextView_wellnessBMIValue = (TextView) v.findViewById(R.id.txtactWTwellnessBMIValue);
}
}
// Provide a suitable constructor (depends on the kind of dataset)
public wellnessWeightDataList(Activity context, String[] wellnessWeightValue_DS, String[] wellnessHeightValue_DS, String[] collectionDate_DS, String[] SourceIdValue_DS) {
this.context = context;
this.wellnessWeightValue = wellnessWeightValue_DS;
this.wellnessHeightValue = wellnessHeightValue_DS;
this.collectionDate = collectionDate_DS;
this.SourceId = SourceIdValue_DS;
}
// Create new views (invoked by the layout manager)
@Override
public wellnessWeightDataList.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.listwellnessweight, parent, false);
ViewHolder viewHolder = new ViewHolder(view);
return viewHolder;
}
// Replace the contents of a view (invoked by the layout manager)
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
// - get element from your dataset at this position
// - replace the contents of the view with that element
holder.mTextView_wellnessWeightValue.setText(wellnessWeightValue[position]);
holder.mTextView_wellnessHeightValue.setText(wellnessHeightValue[position]);
String finalbmicValue = "-";
if (!Functions.isNullOrEmpty(wellnessWeightValue[position]) && !Functions.isNullOrEmpty(wellnessHeightValue[position])) {
double bmic = Double.parseDouble(wellnessWeightValue[position].toString()) / Math.pow(Double.parseDouble(wellnessHeightValue[position].toString()) / 100, 2.0);
finalbmicValue = String.valueOf(Math.round(bmic * 100.0) / 100.0);
}
holder.mTextView_wellnessBMIValue.setText(finalbmicValue);
holder.mTextView_collectionDate.setText(collectionDate[position]);
}
// Return the size of your dataset (invoked by the layout manager)
@Override
public int getItemCount() {
// Return no. of values elements
return (null != wellnessWeightValue ? wellnessWeightValue.length : 0);
}
public void addItem(ViewHolder holder, int position) {
}
public void deleteItem(ViewHolder holder, int position) {
}
}
// recycleview TouchListener
public interface ClickListener {
void onClick(View view, int position);
void onLongClick(View view, int position);
}
public static class RecyclerTouchListener implements RecyclerView.OnItemTouchListener {
private GestureDetector gestureDetector;
private PHRMS_WellnessWeight_Fragment.ClickListener clickListener;
public RecyclerTouchListener(Context context, final RecyclerView recyclerView, final PHRMS_WellnessWeight_Fragment.ClickListener clickListener) {
this.clickListener = clickListener;
gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onSingleTapUp(MotionEvent e) {
return true;
}
@Override
public void onLongPress(MotionEvent e) {
View child = recyclerView.findChildViewUnder(e.getX(), e.getY());
if (child != null && clickListener != null) {
clickListener.onLongClick(child, recyclerView.getChildPosition(child));
}
}
});
}
@Override
public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
View child = rv.findChildViewUnder(e.getX(), e.getY());
if (child != null && clickListener != null && gestureDetector.onTouchEvent(e)) {
clickListener.onClick(child, rv.getChildPosition(child));
}
return false;
}
@Override
public void onTouchEvent(RecyclerView rv, MotionEvent e) {
}
@Override
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
}
}
} | [
"deepak007_bisht@yahoo.co.in"
] | deepak007_bisht@yahoo.co.in |
6e7915608b23e8fd2461bf9e8031dcc9bfa37a76 | 8254725ef309e53f33221e1676c48c15a71a3d72 | /src/main/java/org/study/arithmetic/util/NumberUtil.java | 9d963bacea003e80810564ebdac2cfbe3df1f91c | [] | no_license | lenxin/arithmetic | 4c527c92c793483a70f88b9f9b8c04b4a29c9a40 | f46c8506d4fd09b77bfb48e11d8c76090e1ffdcd | refs/heads/master | 2021-07-02T09:54:38.357346 | 2020-08-06T16:23:31 | 2020-08-06T16:23:31 | 174,164,669 | 0 | 0 | null | 2020-10-13T12:31:47 | 2019-03-06T14:52:56 | Java | UTF-8 | Java | false | false | 303 | java | package org.study.arithmetic.util;
public final class NumberUtil {
private NumberUtil(){}
public static int max(int... nums) {
int max = nums[0];
for (int num : nums) {
if (num > max) {
max = num;
}
}
return max;
}
} | [
"LifeOfProgram@aliyun.com"
] | LifeOfProgram@aliyun.com |
0c949dd8d8cbb1da2f4ac010c0a5bab367de7731 | 75754e8446f6e8223876528b2de6ac1369f1eacc | /src/main/java/org/todoapp/dbflute/bsentity/BsMemberStatus.java | 182ffc7c85650ef8998f5c6b2706f06b9bd27486 | [
"Apache-2.0"
] | permissive | RyoheiYamamoto/todoapp | d2fc1ac82ab7c7bcac7cf92f9cf86066d0408888 | 59ab2ce6c6c9b82177089a29ca6a18222a7b0231 | refs/heads/master | 2021-01-21T12:01:25.035456 | 2017-05-05T12:20:06 | 2017-05-05T12:20:06 | 91,770,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,534 | java | /*
* Copyright 2015-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.todoapp.dbflute.bsentity;
import java.util.List;
import java.util.ArrayList;
import org.dbflute.dbmeta.DBMeta;
import org.dbflute.dbmeta.AbstractEntity;
import org.dbflute.dbmeta.accessory.DomainEntity;
import org.todoapp.dbflute.allcommon.DBMetaInstanceHandler;
import org.todoapp.dbflute.allcommon.CDef;
import org.todoapp.dbflute.exentity.*;
/**
* The entity of (会員ステータス)MEMBER_STATUS as TABLE. <br>
* 会員のステータスを示す固定的なマスタテーブル。いわゆるテーブル区分値!<br>
* 業務運用上で増えることはなく、増減するときはプログラム修正ともなうレベルの業務変更と考えられる。<br>
* <br>
* こういった固定的なマスタテーブルには、更新日時などの共通カラムは定義していないが、業務上そういった情報を管理する必要性が低いという理由に加え、ExampleDBとして共通カラムでER図が埋め尽くされてしまい見づらくなるというところで割り切っている。実業務では統一的に定義することもある。
* <pre>
* [primary-key]
* MEMBER_STATUS_CODE
*
* [column]
* MEMBER_STATUS_CODE, MEMBER_STATUS_NAME, DESCRIPTION, DISPLAY_ORDER
*
* [sequence]
*
*
* [identity]
*
*
* [version-no]
*
*
* [foreign table]
*
*
* [referrer table]
* MEMBER, MEMBER_LOGIN
*
* [foreign property]
*
*
* [referrer property]
* memberList, memberLoginList
*
* [get/set template]
* /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* String memberStatusCode = entity.getMemberStatusCode();
* String memberStatusName = entity.getMemberStatusName();
* String description = entity.getDescription();
* Integer displayOrder = entity.getDisplayOrder();
* entity.setMemberStatusCode(memberStatusCode);
* entity.setMemberStatusName(memberStatusName);
* entity.setDescription(description);
* entity.setDisplayOrder(displayOrder);
* = = = = = = = = = =/
* </pre>
* @author DBFlute(AutoGenerator)
*/
public abstract class BsMemberStatus extends AbstractEntity implements DomainEntity {
// ===================================================================================
// Definition
// ==========
/** The serial version UID for object serialization. (Default) */
private static final long serialVersionUID = 1L;
// ===================================================================================
// Attribute
// =========
/** (会員ステータスコード)MEMBER_STATUS_CODE: {PK, NotNull, CHAR(3), classification=MemberStatus} */
protected String _memberStatusCode;
/** (会員ステータス名称)MEMBER_STATUS_NAME: {NotNull, VARCHAR(50)} */
protected String _memberStatusName;
/** (説明)DESCRIPTION: {NotNull, VARCHAR(200)} */
protected String _description;
/** (表示順)DISPLAY_ORDER: {UQ, NotNull, INT(10)} */
protected Integer _displayOrder;
// ===================================================================================
// DB Meta
// =======
/** {@inheritDoc} */
public DBMeta asDBMeta() {
return DBMetaInstanceHandler.findDBMeta(asTableDbName());
}
/** {@inheritDoc} */
public String asTableDbName() {
return "MEMBER_STATUS";
}
// ===================================================================================
// Key Handling
// ============
/** {@inheritDoc} */
public boolean hasPrimaryKeyValue() {
if (_memberStatusCode == null) { return false; }
return true;
}
/**
* To be unique by the unique column. <br>
* You can update the entity by the key when entity update (NOT batch update).
* @param displayOrder (表示順): UQ, NotNull, INT(10). (NotNull)
*/
public void uniqueBy(Integer displayOrder) {
__uniqueDrivenProperties.clear();
__uniqueDrivenProperties.addPropertyName("displayOrder");
setDisplayOrder(displayOrder);
}
// ===================================================================================
// Classification Property
// =======================
/**
* Get the value of memberStatusCode as the classification of MemberStatus. <br>
* (会員ステータスコード)MEMBER_STATUS_CODE: {PK, NotNull, CHAR(3), classification=MemberStatus} <br>
* status of member from entry to withdrawal
* <p>It's treated as case insensitive and if the code value is null, it returns null.</p>
* @return The instance of classification definition (as ENUM type). (NullAllowed: when the column value is null)
*/
public CDef.MemberStatus getMemberStatusCodeAsMemberStatus() {
return CDef.MemberStatus.codeOf(getMemberStatusCode());
}
/**
* Set the value of memberStatusCode as the classification of MemberStatus. <br>
* (会員ステータスコード)MEMBER_STATUS_CODE: {PK, NotNull, CHAR(3), classification=MemberStatus} <br>
* status of member from entry to withdrawal
* @param cdef The instance of classification definition (as ENUM type). (NullAllowed: if null, null value is set to the column)
*/
public void setMemberStatusCodeAsMemberStatus(CDef.MemberStatus cdef) {
setMemberStatusCode(cdef != null ? cdef.code() : null);
}
// ===================================================================================
// Classification Setting
// ======================
/**
* Set the value of memberStatusCode as Formalized (FML). <br>
* Formalized: as formal member, allowed to use all service
*/
public void setMemberStatusCode_Formalized() {
setMemberStatusCodeAsMemberStatus(CDef.MemberStatus.Formalized);
}
/**
* Set the value of memberStatusCode as Withdrawal (WDL). <br>
* Withdrawal: withdrawal is fixed, not allowed to use service
*/
public void setMemberStatusCode_Withdrawal() {
setMemberStatusCodeAsMemberStatus(CDef.MemberStatus.Withdrawal);
}
/**
* Set the value of memberStatusCode as Provisional (PRV). <br>
* Provisional: first status after entry, allowed to use only part of service
*/
public void setMemberStatusCode_Provisional() {
setMemberStatusCodeAsMemberStatus(CDef.MemberStatus.Provisional);
}
// ===================================================================================
// Classification Determination
// ============================
/**
* Is the value of memberStatusCode Formalized? <br>
* Formalized: as formal member, allowed to use all service
* <p>It's treated as case insensitive and if the code value is null, it returns false.</p>
* @return The determination, true or false.
*/
public boolean isMemberStatusCodeFormalized() {
CDef.MemberStatus cdef = getMemberStatusCodeAsMemberStatus();
return cdef != null ? cdef.equals(CDef.MemberStatus.Formalized) : false;
}
/**
* Is the value of memberStatusCode Withdrawal? <br>
* Withdrawal: withdrawal is fixed, not allowed to use service
* <p>It's treated as case insensitive and if the code value is null, it returns false.</p>
* @return The determination, true or false.
*/
public boolean isMemberStatusCodeWithdrawal() {
CDef.MemberStatus cdef = getMemberStatusCodeAsMemberStatus();
return cdef != null ? cdef.equals(CDef.MemberStatus.Withdrawal) : false;
}
/**
* Is the value of memberStatusCode Provisional? <br>
* Provisional: first status after entry, allowed to use only part of service
* <p>It's treated as case insensitive and if the code value is null, it returns false.</p>
* @return The determination, true or false.
*/
public boolean isMemberStatusCodeProvisional() {
CDef.MemberStatus cdef = getMemberStatusCodeAsMemberStatus();
return cdef != null ? cdef.equals(CDef.MemberStatus.Provisional) : false;
}
/**
* means member that can use services <br>
* The group elements:[Formalized, Provisional]
* @return The determination, true or false.
*/
public boolean isMemberStatusCode_ServiceAvailable() {
CDef.MemberStatus cdef = getMemberStatusCodeAsMemberStatus();
return cdef != null && cdef.isServiceAvailable();
}
/**
* Members are not formalized yet <br>
* The group elements:[Provisional]
* @return The determination, true or false.
*/
public boolean isMemberStatusCode_ShortOfFormalized() {
CDef.MemberStatus cdef = getMemberStatusCodeAsMemberStatus();
return cdef != null && cdef.isShortOfFormalized();
}
// ===================================================================================
// Foreign Property
// ================
// ===================================================================================
// Referrer Property
// =================
/** (会員)MEMBER by MEMBER_STATUS_CODE, named 'memberList'. */
protected List<Member> _memberList;
/**
* [get] (会員)MEMBER by MEMBER_STATUS_CODE, named 'memberList'.
* @return The entity list of referrer property 'memberList'. (NotNull: even if no loading, returns empty list)
*/
public List<Member> getMemberList() {
if (_memberList == null) { _memberList = newReferrerList(); }
return _memberList;
}
/**
* [set] (会員)MEMBER by MEMBER_STATUS_CODE, named 'memberList'.
* @param memberList The entity list of referrer property 'memberList'. (NullAllowed)
*/
public void setMemberList(List<Member> memberList) {
_memberList = memberList;
}
/** (会員ログイン)MEMBER_LOGIN by LOGIN_MEMBER_STATUS_CODE, named 'memberLoginList'. */
protected List<MemberLogin> _memberLoginList;
/**
* [get] (会員ログイン)MEMBER_LOGIN by LOGIN_MEMBER_STATUS_CODE, named 'memberLoginList'.
* @return The entity list of referrer property 'memberLoginList'. (NotNull: even if no loading, returns empty list)
*/
public List<MemberLogin> getMemberLoginList() {
if (_memberLoginList == null) { _memberLoginList = newReferrerList(); }
return _memberLoginList;
}
/**
* [set] (会員ログイン)MEMBER_LOGIN by LOGIN_MEMBER_STATUS_CODE, named 'memberLoginList'.
* @param memberLoginList The entity list of referrer property 'memberLoginList'. (NullAllowed)
*/
public void setMemberLoginList(List<MemberLogin> memberLoginList) {
_memberLoginList = memberLoginList;
}
protected <ELEMENT> List<ELEMENT> newReferrerList() { // overriding to import
return new ArrayList<ELEMENT>();
}
// ===================================================================================
// Basic Override
// ==============
@Override
protected boolean doEquals(Object obj) {
if (obj instanceof BsMemberStatus) {
BsMemberStatus other = (BsMemberStatus)obj;
if (!xSV(_memberStatusCode, other._memberStatusCode)) { return false; }
return true;
} else {
return false;
}
}
@Override
protected int doHashCode(int initial) {
int hs = initial;
hs = xCH(hs, asTableDbName());
hs = xCH(hs, _memberStatusCode);
return hs;
}
@Override
protected String doBuildStringWithRelation(String li) {
StringBuilder sb = new StringBuilder();
if (_memberList != null) { for (Member et : _memberList)
{ if (et != null) { sb.append(li).append(xbRDS(et, "memberList")); } } }
if (_memberLoginList != null) { for (MemberLogin et : _memberLoginList)
{ if (et != null) { sb.append(li).append(xbRDS(et, "memberLoginList")); } } }
return sb.toString();
}
@Override
protected String doBuildColumnString(String dm) {
StringBuilder sb = new StringBuilder();
sb.append(dm).append(xfND(_memberStatusCode));
sb.append(dm).append(xfND(_memberStatusName));
sb.append(dm).append(xfND(_description));
sb.append(dm).append(xfND(_displayOrder));
if (sb.length() > dm.length()) {
sb.delete(0, dm.length());
}
sb.insert(0, "{").append("}");
return sb.toString();
}
@Override
protected String doBuildRelationString(String dm) {
StringBuilder sb = new StringBuilder();
if (_memberList != null && !_memberList.isEmpty())
{ sb.append(dm).append("memberList"); }
if (_memberLoginList != null && !_memberLoginList.isEmpty())
{ sb.append(dm).append("memberLoginList"); }
if (sb.length() > dm.length()) {
sb.delete(0, dm.length()).insert(0, "(").append(")");
}
return sb.toString();
}
@Override
public MemberStatus clone() {
return (MemberStatus)super.clone();
}
// ===================================================================================
// Accessor
// ========
/**
* [get] (会員ステータスコード)MEMBER_STATUS_CODE: {PK, NotNull, CHAR(3), classification=MemberStatus} <br>
* 会員ステータスを識別するコード。<br>
* 固定的なデータなので連番とか番号にはせず、データを直接見たときも人が直感的にわかるように、例えば "FML" とかの3桁のコード形式にしている。(3って何会員だっけ?とかの問答をやりたくないので)
* @return The value of the column 'MEMBER_STATUS_CODE'. (basically NotNull if selected: for the constraint)
*/
public String getMemberStatusCode() {
checkSpecifiedProperty("memberStatusCode");
return convertEmptyToNull(_memberStatusCode);
}
/**
* [set] (会員ステータスコード)MEMBER_STATUS_CODE: {PK, NotNull, CHAR(3), classification=MemberStatus} <br>
* 会員ステータスを識別するコード。<br>
* 固定的なデータなので連番とか番号にはせず、データを直接見たときも人が直感的にわかるように、例えば "FML" とかの3桁のコード形式にしている。(3って何会員だっけ?とかの問答をやりたくないので)
* @param memberStatusCode The value of the column 'MEMBER_STATUS_CODE'. (basically NotNull if update: for the constraint)
*/
protected void setMemberStatusCode(String memberStatusCode) {
checkClassificationCode("MEMBER_STATUS_CODE", CDef.DefMeta.MemberStatus, memberStatusCode);
registerModifiedProperty("memberStatusCode");
_memberStatusCode = memberStatusCode;
}
/**
* [get] (会員ステータス名称)MEMBER_STATUS_NAME: {NotNull, VARCHAR(50)} <br>
* 表示用の名称。<br>
* 国際化対応するときはもっと色々考える必要があるかと...ということで英語名カラムがないので、そのまま区分値メソッド名の一部としても利用される。
* @return The value of the column 'MEMBER_STATUS_NAME'. (basically NotNull if selected: for the constraint)
*/
public String getMemberStatusName() {
checkSpecifiedProperty("memberStatusName");
return convertEmptyToNull(_memberStatusName);
}
/**
* [set] (会員ステータス名称)MEMBER_STATUS_NAME: {NotNull, VARCHAR(50)} <br>
* 表示用の名称。<br>
* 国際化対応するときはもっと色々考える必要があるかと...ということで英語名カラムがないので、そのまま区分値メソッド名の一部としても利用される。
* @param memberStatusName The value of the column 'MEMBER_STATUS_NAME'. (basically NotNull if update: for the constraint)
*/
public void setMemberStatusName(String memberStatusName) {
registerModifiedProperty("memberStatusName");
_memberStatusName = memberStatusName;
}
/**
* [get] (説明)DESCRIPTION: {NotNull, VARCHAR(200)} <br>
* 会員ステータスそれぞれの説明。<br>
* 区分値の一つ一つの要素に気の利いた説明があるとディベロッパーがとても助かるので絶対に欲しい。
* @return The value of the column 'DESCRIPTION'. (basically NotNull if selected: for the constraint)
*/
public String getDescription() {
checkSpecifiedProperty("description");
return convertEmptyToNull(_description);
}
/**
* [set] (説明)DESCRIPTION: {NotNull, VARCHAR(200)} <br>
* 会員ステータスそれぞれの説明。<br>
* 区分値の一つ一つの要素に気の利いた説明があるとディベロッパーがとても助かるので絶対に欲しい。
* @param description The value of the column 'DESCRIPTION'. (basically NotNull if update: for the constraint)
*/
public void setDescription(String description) {
registerModifiedProperty("description");
_description = description;
}
/**
* [get] (表示順)DISPLAY_ORDER: {UQ, NotNull, INT(10)} <br>
* UI上のステータスの表示順を示すNO。<br>
* 並べるときは、このカラムに対して昇順のソート条件にする。
* @return The value of the column 'DISPLAY_ORDER'. (basically NotNull if selected: for the constraint)
*/
public Integer getDisplayOrder() {
checkSpecifiedProperty("displayOrder");
return _displayOrder;
}
/**
* [set] (表示順)DISPLAY_ORDER: {UQ, NotNull, INT(10)} <br>
* UI上のステータスの表示順を示すNO。<br>
* 並べるときは、このカラムに対して昇順のソート条件にする。
* @param displayOrder The value of the column 'DISPLAY_ORDER'. (basically NotNull if update: for the constraint)
*/
public void setDisplayOrder(Integer displayOrder) {
registerModifiedProperty("displayOrder");
_displayOrder = displayOrder;
}
/**
* For framework so basically DON'T use this method.
* @param memberStatusCode The value of the column 'MEMBER_STATUS_CODE'. (basically NotNull if update: for the constraint)
*/
public void mynativeMappingMemberStatusCode(String memberStatusCode) {
setMemberStatusCode(memberStatusCode);
}
}
| [
"h031203yama@gmail.com"
] | h031203yama@gmail.com |
30c3f7afab46d7a467cfb55685ceb63a995f1c55 | 8154b67005de67496b37c8e70503bbe67a0e93f8 | /app/src/main/java/com/nextoneday/customview/animation/PropertyAnimationActivity.java | f6d5997568fca6b94d43fab97ccc2ecaf8bb3805 | [] | no_license | NextOneDay/CustomView | 06d1cfa9bb6533a801502a4158010a138bd82f9c | 19210909ed170f6abe0dd71aaff90b66992e89ae | refs/heads/master | 2021-04-18T18:40:12.937320 | 2018-12-06T15:54:31 | 2018-12-06T15:54:31 | 126,299,858 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,912 | java | package com.nextoneday.customview.animation;
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import com.nextoneday.customview.R;
/**
* Created by Administrator on 2018/4/10.
*/
public class PropertyAnimationActivity extends AppCompatActivity implements View.OnClickListener {
private View mView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_property);
mView = findViewById(R.id.view);
Button start = (Button) findViewById(R.id.start);
start.setOnClickListener(this);
}
@SuppressLint("ObjectAnimatorBinding")
private void animatorSet_code() {
AnimatorSet animatorSet = new AnimatorSet();
ObjectAnimator translation = ObjectAnimator.ofFloat(mView, "translation", 0, 100);
translation.setDuration(3000);
ObjectAnimator rotation = ObjectAnimator.ofFloat(mView, "rotation", 10, 360);
rotation.setDuration(3000);
ObjectAnimator alpha = ObjectAnimator.ofFloat(mView, "alpha", 1.0f, 0.5f);
alpha.setDuration(3000);
animatorSet.playTogether(translation,rotation,alpha);
animatorSet.start();
}
private void animatorSet_xml() {
Animator animator = AnimatorInflater.loadAnimator(this, R.animator.set_animator);
animator.setTarget(mView);
animator.setDuration(5000);
animator.start();
}
@Override
public void onClick(View v) {
animatorSet_code();
// animatorSet_xml();
}
}
| [
"nextonedaygg@163.com"
] | nextonedaygg@163.com |
a788e68c00e45ff0b9a51a56edcbdf84f5c4a742 | e3dbc591fe86704d6d73120145ed04502502d1c1 | /src/main/java/com/fstg/hrm/service/CommandeItemService.java | f04bcfb39841eb8cc8ebd1e494710334619cf1b3 | [] | no_license | softcodeur/hrm-FSTG | a162192f79abe2b9824c850d1673245a9fcc968e | 3cc22a0f714124621d172c5a48e4e3fac33521f0 | refs/heads/master | 2022-03-19T17:57:16.281886 | 2020-01-04T12:46:03 | 2020-01-04T12:46:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 327 | java | package com.fstg.hrm.service;
import com.fstg.hrm.bean.CommandeItem;
import java.util.List;
public interface CommandeItemService {
public void save( CommandeItem commandItem);
public List<CommandeItem> findAll();
public CommandeItem update(Long id,CommandeItem commandeItem);
public void deleteById(Long id);
} | [
"beloweb9718@gmail.com"
] | beloweb9718@gmail.com |
7edaf71b7d44d831e7e8938412f02f5020c76155 | 29b2a9b7d2ae3d9250735e3e39581fc4ee0332d4 | /src/main/java/com/xwc1125/telegrambot/model/UserProfilePhotos.java | 585a8bb8a9704daa3da35a7541cd825b4705f3b9 | [
"Apache-2.0"
] | permissive | xwc1125/java-telegram-bot-api | 14d0a461c157641825544ce3a199ef417c2a34ef | 476fc1cd2280ca179ea77ae683a6bc99f7db81e5 | refs/heads/master | 2020-05-13T14:49:27.506347 | 2019-04-16T06:57:32 | 2019-04-16T06:57:32 | 129,072,000 | 0 | 0 | Apache-2.0 | 2019-01-01T13:50:17 | 2018-04-11T09:50:34 | Java | UTF-8 | Java | false | false | 1,247 | java | package com.xwc1125.telegrambot.model;
import java.io.Serializable;
import java.util.Arrays;
/**
* stas
* 8/5/15.
*/
public class UserProfilePhotos implements Serializable {
private final static long serialVersionUID = 0L;
private Integer total_count;
private PhotoSize[][] photos;
public Integer totalCount() {
return total_count;
}
public PhotoSize[][] photos() {
return photos;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UserProfilePhotos that = (UserProfilePhotos) o;
if (total_count != null ? !total_count.equals(that.total_count) : that.total_count != null) return false;
return Arrays.deepEquals(photos, that.photos);
}
@Override
public int hashCode() {
int result = total_count != null ? total_count.hashCode() : 0;
result = 31 * result + Arrays.deepHashCode(photos);
return result;
}
@Override
public String toString() {
return "UserProfilePhotos{" +
"total_count=" + total_count +
", photos=" + Arrays.deepToString(photos) +
'}';
}
}
| [
"xmcr1125@qq.com"
] | xmcr1125@qq.com |
212114468fe806013f450da37c2281d3db432022 | 1bea6bc699627ed9430c17daf9a78615cb8d2bc1 | /eureka-service/src/main/java/eureka/EurekaApp.java | d16b31228c6626ce4854c94ee5e28c7da4e2841d | [] | no_license | HyderYang/spring-cloud | f2f3e4580dd98d02aba7790d338f2b8ad8b62696 | e9f43fab01b4b1c07793f9f4eb92b03050f24c82 | refs/heads/master | 2022-07-15T07:31:31.870752 | 2019-09-04T15:44:19 | 2019-09-04T15:44:19 | 205,705,222 | 0 | 0 | null | 2022-06-21T01:47:27 | 2019-09-01T16:46:29 | Java | UTF-8 | Java | false | false | 447 | java | package eureka;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
/**
* @author: 杨欢
* @created: 2019/9/2 下午4:19
* @description:
*/
@EnableEurekaServer
@SpringBootApplication
public class EurekaApp {
public static void main(String[] args) {
SpringApplication.run(EurekaApp.class);
}
}
| [
"yanghuan0613@gmail.com"
] | yanghuan0613@gmail.com |
ca4dde38fc7567c383358758b211b21ff83ed2ce | d4d982b2f6c0933cc01e2269b1a3e96820324c0f | /src/net/gbicc/xbrl/ent/model/GeneImport.java | 18053e14c54b62b08226db451fb7cc75f21ea50b | [] | no_license | gwfxp/xbrlcore | 48a44b633b3546b360cc1669b7b7360c7ab15183 | 065a5b4ac851e29c250507209321b00a7af1b205 | refs/heads/master | 2021-05-27T06:09:57.238535 | 2014-06-06T10:36:08 | 2014-06-06T10:36:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,554 | java | package net.gbicc.xbrl.ent.model;
public class GeneImport {
/**
* 需要插入数据表的名称
*/
private String tableName;
/**
* 需要插入数据表的字段,字符串形式
*/
private String fieldString;
/**
* 需要插入数据表的值,字符串形式
*/
private String valueString;
/**
* 需要插入数据表的上下文字段
*/
private String contextcolumn;
/**
* 需要插入数据表的上下文值
*/
private String congtextrefvl;
/**
* 需要插入数据表的数据清除语句
*/
private String deleteSqlstr;
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getFieldString() {
return fieldString;
}
public void setFieldString(String fieldString) {
this.fieldString = fieldString;
}
public String getValueString() {
return valueString;
}
public void setValueString(String valueString) {
this.valueString = valueString;
}
public String getContextcolumn() {
return contextcolumn;
}
public void setContextcolumn(String contextcolumn) {
this.contextcolumn = contextcolumn;
}
public String getCongtextrefvl() {
return congtextrefvl;
}
public void setCongtextrefvl(String congtextrefvl) {
this.congtextrefvl = congtextrefvl;
}
public String getDeleteSqlstr() {
return deleteSqlstr;
}
public void setDeleteSqlstr(String deleteSqlstr) {
this.deleteSqlstr = deleteSqlstr;
}
}
| [
"joe.phoenix@gmail.com"
] | joe.phoenix@gmail.com |
6016a9dc2fd1c44917e9d1f6d6a5b52ac8808d67 | 92225460ebca1bb6a594d77b6559b3629b7a94fa | /src/com/kingdee/eas/fdc/invite/supplier/app/SupplierChangeGradeControllerBean.java | 246196b1bdc64095d6f99b1abdabff844e3d069f | [] | no_license | yangfan0725/sd | 45182d34575381be3bbdd55f3f68854a6900a362 | 39ebad6e2eb76286d551a9e21967f3f5dc4880da | refs/heads/master | 2023-04-29T01:56:43.770005 | 2023-04-24T05:41:13 | 2023-04-24T05:41:13 | 512,073,641 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,432 | java | package com.kingdee.eas.fdc.invite.supplier.app;
import org.apache.log4j.Logger;
import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.util.BOSUuid;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;
import java.lang.String;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.eas.fdc.basedata.app.FDCBillControllerBean;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.eas.framework.CoreBaseCollection;
import com.kingdee.eas.framework.CoreBillBaseCollection;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.fdc.invite.supplier.SupplierChangeGradeCollection;
import com.kingdee.eas.fdc.invite.supplier.SupplierStockFactory;
import com.kingdee.eas.fdc.invite.supplier.SupplierStockInfo;
import com.kingdee.eas.fdc.basedata.FDCBillCollection;
import com.kingdee.eas.framework.ObjectBaseCollection;
import com.kingdee.eas.fdc.invite.supplier.SupplierChangeGradeInfo;
public class SupplierChangeGradeControllerBean extends AbstractSupplierChangeGradeControllerBean
{
private static Logger logger =
Logger.getLogger("com.kingdee.eas.fdc.invite.supplier.app.SupplierChangeGradeControllerBean");
protected void _audit(Context ctx, BOSUuid billId) throws BOSException,EASBizException {
super._audit(ctx, billId);
SupplierChangeGradeInfo info=this.getSupplierChangeGradeInfo(ctx, new ObjectUuidPK(billId));
SelectorItemCollection sic=new SelectorItemCollection();
sic.add("grade");
SupplierStockInfo supplier=info.getSupplier();
supplier.setGrade(info.getGrade());
SupplierStockFactory.getLocalInstance(ctx).updatePartial(supplier, sic);
}
protected boolean isUseName() {
return false;
}
} | [
"yfsmile@qq.com"
] | yfsmile@qq.com |
59ed2a23cf731e05ba088c3a07bba0b418391dae | 712a5e8475b6c9276bd4f8f857be95fdf6f30b9f | /android/support/v7/app/AppCompatDelegateImplV14.java | ecf044194c2c44cf4d8763a363bf0f77cb5f38df | [] | no_license | swapnilsen/OCR_2 | b29bd22a51203b4d39c2cc8cb03c50a85a81218f | 1889d208e17e94a55ddeae91336fe92110e1bd2d | refs/heads/master | 2021-01-20T08:46:03.508508 | 2017-05-03T19:50:52 | 2017-05-03T19:50:52 | 90,187,623 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,442 | java | package android.support.v7.app;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.annotation.VisibleForTesting;
import android.support.v7.view.SupportActionModeWrapper.CallbackWrapper;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.ActionMode;
import android.view.Window;
import android.view.Window.Callback;
import com.google.android.gms.ads.AdRequest;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import net.nend.android.NendAdIconLayout;
import net.nend.android.NendIconError;
@TargetApi(14)
@RequiresApi(14)
class AppCompatDelegateImplV14 extends AppCompatDelegateImplV11 {
private static final String KEY_LOCAL_NIGHT_MODE = "appcompat:local_night_mode";
private boolean mApplyDayNightCalled;
private AutoNightModeManager mAutoNightModeManager;
private boolean mHandleNativeActionModes;
private int mLocalNightMode;
class AppCompatWindowCallbackV14 extends AppCompatWindowCallbackBase {
AppCompatWindowCallbackV14(Callback callback) {
super(callback);
}
public ActionMode onWindowStartingActionMode(ActionMode.Callback callback) {
if (AppCompatDelegateImplV14.this.isHandleNativeActionModesEnabled()) {
return startAsSupportActionMode(callback);
}
return super.onWindowStartingActionMode(callback);
}
final ActionMode startAsSupportActionMode(ActionMode.Callback callback) {
Object callbackWrapper = new CallbackWrapper(AppCompatDelegateImplV14.this.mContext, callback);
android.support.v7.view.ActionMode startSupportActionMode = AppCompatDelegateImplV14.this.startSupportActionMode(callbackWrapper);
if (startSupportActionMode != null) {
return callbackWrapper.getActionModeWrapper(startSupportActionMode);
}
return null;
}
}
@VisibleForTesting
final class AutoNightModeManager {
private BroadcastReceiver mAutoTimeChangeReceiver;
private IntentFilter mAutoTimeChangeReceiverFilter;
private boolean mIsNight;
private TwilightManager mTwilightManager;
/* renamed from: android.support.v7.app.AppCompatDelegateImplV14.AutoNightModeManager.1 */
class C02521 extends BroadcastReceiver {
C02521() {
}
public void onReceive(Context context, Intent intent) {
AutoNightModeManager.this.dispatchTimeChanged();
}
}
AutoNightModeManager(TwilightManager twilightManager) {
this.mTwilightManager = twilightManager;
this.mIsNight = twilightManager.isNight();
}
final int getApplyableNightMode() {
this.mIsNight = this.mTwilightManager.isNight();
return this.mIsNight ? 2 : 1;
}
final void dispatchTimeChanged() {
boolean isNight = this.mTwilightManager.isNight();
if (isNight != this.mIsNight) {
this.mIsNight = isNight;
AppCompatDelegateImplV14.this.applyDayNight();
}
}
final void setup() {
cleanup();
if (this.mAutoTimeChangeReceiver == null) {
this.mAutoTimeChangeReceiver = new C02521();
}
if (this.mAutoTimeChangeReceiverFilter == null) {
this.mAutoTimeChangeReceiverFilter = new IntentFilter();
this.mAutoTimeChangeReceiverFilter.addAction("android.intent.action.TIME_SET");
this.mAutoTimeChangeReceiverFilter.addAction("android.intent.action.TIMEZONE_CHANGED");
this.mAutoTimeChangeReceiverFilter.addAction("android.intent.action.TIME_TICK");
}
AppCompatDelegateImplV14.this.mContext.registerReceiver(this.mAutoTimeChangeReceiver, this.mAutoTimeChangeReceiverFilter);
}
final void cleanup() {
if (this.mAutoTimeChangeReceiver != null) {
AppCompatDelegateImplV14.this.mContext.unregisterReceiver(this.mAutoTimeChangeReceiver);
this.mAutoTimeChangeReceiver = null;
}
}
}
AppCompatDelegateImplV14(Context context, Window window, AppCompatCallback appCompatCallback) {
super(context, window, appCompatCallback);
this.mLocalNightMode = -100;
this.mHandleNativeActionModes = true;
}
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (bundle != null && this.mLocalNightMode == -100) {
this.mLocalNightMode = bundle.getInt(KEY_LOCAL_NIGHT_MODE, -100);
}
}
Callback wrapWindowCallback(Callback callback) {
return new AppCompatWindowCallbackV14(callback);
}
public void setHandleNativeActionModesEnabled(boolean z) {
this.mHandleNativeActionModes = z;
}
public boolean isHandleNativeActionModesEnabled() {
return this.mHandleNativeActionModes;
}
public boolean applyDayNight() {
boolean z = false;
int nightMode = getNightMode();
int mapNightMode = mapNightMode(nightMode);
if (mapNightMode != -1) {
z = updateForNightMode(mapNightMode);
}
if (nightMode == 0) {
ensureAutoNightModeManager();
this.mAutoNightModeManager.setup();
}
this.mApplyDayNightCalled = true;
return z;
}
public void onStart() {
super.onStart();
applyDayNight();
}
public void onStop() {
super.onStop();
if (this.mAutoNightModeManager != null) {
this.mAutoNightModeManager.cleanup();
}
}
public void setLocalNightMode(int i) {
switch (i) {
case FirebaseRemoteConfig.LAST_FETCH_STATUS_SUCCESS /*-1*/:
case NendAdIconLayout.HORIZONTAL /*0*/:
case NendIconError.ERROR_ICONVIEW /*1*/:
case FirebaseRemoteConfig.VALUE_SOURCE_REMOTE /*2*/:
if (this.mLocalNightMode != i) {
this.mLocalNightMode = i;
if (this.mApplyDayNightCalled) {
applyDayNight();
}
}
default:
Log.i("AppCompatDelegate", "setLocalNightMode() called with an unknown mode");
}
}
int mapNightMode(int i) {
switch (i) {
case -100:
return -1;
case NendAdIconLayout.HORIZONTAL /*0*/:
ensureAutoNightModeManager();
return this.mAutoNightModeManager.getApplyableNightMode();
default:
return i;
}
}
private int getNightMode() {
return this.mLocalNightMode != -100 ? this.mLocalNightMode : AppCompatDelegate.getDefaultNightMode();
}
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
if (this.mLocalNightMode != -100) {
bundle.putInt(KEY_LOCAL_NIGHT_MODE, this.mLocalNightMode);
}
}
public void onDestroy() {
super.onDestroy();
if (this.mAutoNightModeManager != null) {
this.mAutoNightModeManager.cleanup();
}
}
private boolean updateForNightMode(int i) {
Resources resources = this.mContext.getResources();
Configuration configuration = resources.getConfiguration();
int i2 = configuration.uiMode & 48;
int i3 = i == 2 ? 32 : 16;
if (i2 == i3) {
return false;
}
if (shouldRecreateOnNightModeChange()) {
((Activity) this.mContext).recreate();
} else {
Configuration configuration2 = new Configuration(configuration);
DisplayMetrics displayMetrics = resources.getDisplayMetrics();
configuration2.uiMode = i3 | (configuration2.uiMode & -49);
resources.updateConfiguration(configuration2, displayMetrics);
ResourcesFlusher.flush(resources);
}
return true;
}
private void ensureAutoNightModeManager() {
if (this.mAutoNightModeManager == null) {
this.mAutoNightModeManager = new AutoNightModeManager(TwilightManager.getInstance(this.mContext));
}
}
@VisibleForTesting
final AutoNightModeManager getAutoNightModeManager() {
ensureAutoNightModeManager();
return this.mAutoNightModeManager;
}
private boolean shouldRecreateOnNightModeChange() {
if (!this.mApplyDayNightCalled || !(this.mContext instanceof Activity)) {
return false;
}
try {
if ((this.mContext.getPackageManager().getActivityInfo(new ComponentName(this.mContext, this.mContext.getClass()), 0).configChanges & AdRequest.MAX_CONTENT_URL_LENGTH) == 0) {
return true;
}
return false;
} catch (Throwable e) {
Log.d("AppCompatDelegate", "Exception while getting ActivityInfo", e);
return true;
}
}
}
| [
"swasen@cisco.com"
] | swasen@cisco.com |
18f60fa35a75dba0e5d558c87f8a06230d8d7d05 | ea34e1e848f150f47dbd5dbb794bba7d78c08bea | /app/src/main/java/com/jhonlee/musicpf/view/rank/RankPageAdapter.java | 46b4ef08985fd679cb807b0e5e8135652eca9951 | [] | no_license | JhoneLeedx/Music_PF | ef634bd4ac7eb9e39f1b2254a23071331fc02298 | cc2748de4e07aae3e0a710a368fcc1b30d7e4741 | refs/heads/master | 2021-01-23T03:04:59.854470 | 2017-04-11T06:59:40 | 2017-04-11T06:59:40 | 86,046,812 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 850 | java | package com.jhonlee.musicpf.view.rank;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.util.List;
/**
* Created by JhoneLee on 2017/3/23.
*/
public class RankPageAdapter extends FragmentPagerAdapter {
private String[] titles;
private List<Fragment> mList;
public RankPageAdapter(FragmentManager fm, String[] titles, List<Fragment> mList) {
super(fm);
this.titles = titles;
this.mList = mList;
}
@Override
public Fragment getItem(int position) {
return mList.get(position);
}
@Override
public int getCount() {
return mList.size();
}
@Override
public CharSequence getPageTitle(int position) {
return titles[position % titles.length];
}
}
| [
"lijing930615@live.com"
] | lijing930615@live.com |
d4c206bf3d08f00f5ddad5aed91813440020a5c9 | 71803a80c315f7004bb7afd60026fd68a1b03716 | /src/test/java/Multiple/Payment.java | 802792261c9ddfff00ac7260a865900f19bc9b94 | [] | no_license | Manojmj143/TestNg_project | 1422bb70bf334b8bc72f4873f4a0059cf8ef96bb | 5d126ac76146952bc3f48c22026135fd293eb241 | refs/heads/master | 2023-08-15T08:28:02.772661 | 2021-09-28T15:54:00 | 2021-09-28T15:54:00 | 411,345,929 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 530 | java | package Multiple;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class Payment {
public WebDriver driver;
public Payment(WebDriver driver2) {
this.driver= driver2;
PageFactory.initElements(driver, this);
}
@FindBy(xpath="//body[1]/div[1]/div[2]/div[1]/div[3]/div[1]/div[1]/form[1]/p[1]/button[1]/span[1]")
private WebElement finish;
public WebElement getFinish() {
return finish;
}
}
| [
"manojboss883@gmail.com"
] | manojboss883@gmail.com |
6d64f03021bdc735d9181e0bc0580749c72234e3 | be76c9f8a1e0fbfd5ee668f9ae2e7589f365cd12 | /Corvus.WSClient/test/hk/hku/cecid/corvus/ws/data/DataFactoryUnitTest.java | 7bfe2f0cfbfec304c21c6789d050169b6261e27c | [] | no_license | hostcc/hermes2 | f45d1b73c691b6a095b4f7b3e76620e20394e24e | 16a2026f2c21780e44f77ade2f2624708ae6fe54 | refs/heads/master | 2021-07-12T04:16:58.339723 | 2016-09-29T00:31:03 | 2016-09-29T00:31:03 | 10,525,385 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,421 | java | /*
* Copyright(c) 2005 Center for E-Commerce Infrastructure Development, The
* University of Hong Kong (HKU). All Rights Reserved.
*
* This software is licensed under the GNU GENERAL PUBLIC LICENSE Version 2.0 [1]
*
* [1] http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/
package hk.hku.cecid.corvus.ws.data;
import java.net.URL;
import java.util.Map;
import java.io.UnsupportedEncodingException;
import hk.hku.cecid.testcase.FixtureStore;
import junit.framework.TestCase;
import org.junit.Assert;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import hk.hku.cecid.piazza.commons.util.PropertyTree;
/**
* The <code>DataFactoryUnitTest</code> is unit test of <code>DataFactory</code>.
*
* @author Twinsen Tsang
* @version 1.0.0
* @since JDK5.0, H2O 0908
*/
// TODO: Add negative test-case
public class DataFactoryUnitTest extends TestCase
{
// Instance logger
final Logger logger = LoggerFactory.getLogger(this.getClass());
// Class loader for loading fixture data
private static ClassLoader FIXTURE_LOADER = FixtureStore.createFixtureLoader(false, DataFactoryUnitTest.class);
// Fixture name.
public static final String AS2_ADMIN_DATA_SAMPLE0 = "as2-admin-request.xml";
public static final String AS2_MESSAGE_DATA_SAMPLE0 = "as2-request-load.xml";
public static final String AS2_MESSAGE_DATA_STORE0 = "as2-request-store.xml";
/**
* This is the fixture name for testing the reading capabilities for AS2Partnership in DataFactory.
*/
public static final String AS2_PARTNERSHIP_DATA_LOAD0 = "as2-partnership-load.xml";
/**
* This is the fixture name for testing the storing capabilities for DataFactory.
* This fixture does not contains any data initially.
*/
public static final String AS2_PARTNERSHIP_DATA_STORE0 = "as2-partnership-store.xml";
public static final String EBMS_ADMIN_DATA_SAMPLE0 = "ebms-admin-request.xml";
public static final String EBMS_MESSAGE_DATA_SAMPLE0 = "ebms-request-load.xml";
public static final String EBMS_MESSAGE_DATA_STORE0 = "ebms-request-store.xml";
/**
* This is the fixture name for testing the reading capabilities for EBMSPartnership in DataFactory.
*/
public static final String EBMS_PARTNERSHIP_DATA_LOAD0 = "ebms-partnership-load.xml";
/**
* This is the fixture name for testing the storing capabilities for DataFactory.
* This fixture does not contains any data initially.
*/
public static final String EBMS_PARTNERSHIP_DATA_STORE0 = "ebms-partnership-store.xml";
public static final String EBMS_CONFIG_DATA_SAMPLE0 = "ebms-config-request.xml";
public static final String EBMS_HISTORY_QUERY_DATA_STORE0 = "ebms-history-query-request.xml";
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception
{
super.setUp();
this.logger.info("------- {} START ------", this.getName());
}
public void testCreateAS2MessageData() throws Exception
{
}
/** Test whether the DataFactory able to store AS2 Message Data to the fixture **/
public void testStoreAS2MessageData() throws Exception
{
DataFactory df = DataFactory.getInstance();
AS2MessageData d = new AS2MessageData();
d.setSendEndpoint("http://localhost:8080/corvus/httpd/as2/sender");
d.setRecvEndpoint("http://localhost:8080/corvus/httpd/as2/receiver");
d.setRecvlistEndpoint("http://localhost:8080/corvus/httpd/as2/receiver_list");
d.setType("xml");
d.setMessageIdToRetreive("");
// Use default parameter for storing.
URL storeURL = FIXTURE_LOADER.getResource(AS2_MESSAGE_DATA_STORE0);
// Test method.
df.storeAS2MessageDataToXML(d, storeURL);
// Assertion
PropertyTree assertionTree = new PropertyTree(storeURL);
// All key prefix.
final String[] xPathPrefix = { AS2MessageData.CONFIG_PREFIX, AS2MessageData.PARAM_PREFIX};
// All key set
final String[][] keySet = { AS2MessageData.CONFIG_KEY_SET,AS2MessageData.PARAM_KEY_SET };
this.assertData(d, assertionTree, xPathPrefix, keySet);
}
/** Test whether the DataFactory able to store EBMS Message Data to the fixture **/
public void testStoreEBMSMessageData() throws Exception
{
DataFactory df = DataFactory.getInstance();
EBMSMessageData d = new EBMSMessageData();
d.setSendEndpoint("http://localhost:8080/corvus/httpd/ebms/sender");
d.setRecvEndpoint("http://localhost:8080/corvus/httpd/ebms/receiver");
d.setRecvlistEndpoint("http://localhost:8080/corvus/httpd/ebms/receiver_list");
d.setConversationId("convId");
d.setFromPartyId("fromPartyId");
d.setFromPartyType("fromPartyType");
d.setToPartyId("toPartyId");
d.setToPartyType("toPartyType");
d.setRefToMessageId("");
d.setServiceType("");
d.setMessageIdForReceive("");
// Use default parameter for storing.
URL storeURL = FIXTURE_LOADER.getResource(EBMS_MESSAGE_DATA_STORE0);
// Test method.
df.storeEBMSMessageDataToXML(d, storeURL);
// Assertion
PropertyTree assertionTree = new PropertyTree(storeURL);
// All key prefix.
final String[] xPathPrefix = { EBMSMessageData.CONFIG_PREFIX, EBMSMessageData.PARAM_PREFIX};
// All key set
final String[][] keySet = { EBMSMessageData.CONFIG_KEY_SET,EBMSMessageData.PARAM_KEY_SET};
this.assertData(d, assertionTree, xPathPrefix, keySet);
}
/** Test whether the DataFactory able to create EBMS Partnership Data from the fixture **/
public void testCreateAS2PartnershipData() throws Exception
{
DataFactory df = DataFactory.getInstance();
PropertyTree t = this.getFixtureAsTree(AS2_PARTNERSHIP_DATA_LOAD0);
AS2PartnershipData d = df.createAS2PartnershipFromXML(t);
// All key prefix.
final String[] xPathPrefix = { AS2PartnershipData.PARAM_PREFIX};
// All key set
final String[][] keySet = { AS2PartnershipData.PARAM_KEY_SET };
this.assertData(d, t, xPathPrefix, keySet);
// Assert data field which data-type is not String.
String encryptCert = new String(d.getEncryptCert(), "UTF-8");
assertEquals(encryptCert, "I am testing load cert");
String verifyCert = new String(d.getVerifyCert(), "UTF-8");
assertEquals(verifyCert, "I am verifying load cert");
}
/** Test whether the DataFactory able to store AS2 Partnership Data to the fixture **/
public void testStoreAS2PartnershipData() throws Exception
{
DataFactory df = DataFactory.getInstance();
AS2PartnershipData d = new AS2PartnershipData();
d.setPartnershipId("as2");
d.setIsDisabled(false);
d.setIsSyncReply(false);
d.setSubject("AS2 web service client default subject");
d.setRecipientAddress("http://127.0.0.1:8080/corvus/httpd/as2/inbound");
d.setIsHostnameVerified(false);
d.setReceiptAddress("http://127.0.0.1:8080/corvus/httpd/as2/inbound");
d.setIsReceiptRequired(false);
d.setIsOutboundSignRequired(false);
d.setIsOutboundEncryptRequired(false);
d.setIsOutboundCompressRequired(false);
d.setIsReceiptSignRequired(false);
d.setIsInboundSignRequired(false);
d.setIsInboundEncryptRequired(false);
d.setRetries(3);
d.setRetryInterval(30000);
d.setSignAlgorithm("sha1");
d.setEncryptAlgorithm("rc2");
d.setMicAlgorithm("sha1");
d.setAs2From("as2From");
d.setAs2To("as2To");
d.setVerifyCert(new byte[]{});
d.setEncryptCert(new byte[]{});
// Use default parameter for storing.
URL storeURL = FIXTURE_LOADER.getResource(AS2_PARTNERSHIP_DATA_STORE0);
/*
* We want to test if it is able to convert data-type other than String.
*/
d.setEncryptCert("I am testing cert".getBytes());
d.setVerifyCert ("I am verifying cert".getBytes());
// Test method.
df.storeAS2PartnershipFromXML(d, storeURL);
// Assertion
PropertyTree assertionTree = new PropertyTree(storeURL);
// All key prefix.
final String[] xPathPrefix = { AS2PartnershipData.PARAM_PREFIX};
// All key set
final String[][] keySet = { AS2PartnershipData.PARAM_KEY_SET };
this.assertData(d, assertionTree, xPathPrefix, keySet);
}
/** Test whether the DataFactory able to create EBMS Partnership Data from the fixture **/
public void testCreateEBMSPartnershipData() throws Exception
{
DataFactory df = DataFactory.getInstance();
PropertyTree t = this.getFixtureAsTree(EBMS_PARTNERSHIP_DATA_LOAD0);
EBMSPartnershipData d = df.createEBMSPartnershipFromXML(t);
// All key prefix.
final String[] xPathPrefix = { EBMSPartnershipData.PARAM_PREFIX};
// All key set
final String[][] keySet = { EBMSPartnershipData.PARAM_KEY_SET };
this.assertData(d, t, xPathPrefix, keySet);
// Assert data field which data-type is not String.
String cert = new String(d.getEncryptCert(), "UTF-8");
assertEquals(cert, "I am testing load cert");
}
/** Test whether the DataFactory able to store EBMS Partnership Data to the fixture **/
public void testStoreEBMSPartnershipData() throws Exception
{
DataFactory df = DataFactory.getInstance();
EBMSPartnershipData d = new EBMSPartnershipData();
d.setPartnershipId ("ebms");
d.setCpaId ("ebmscpaid");
d.setService ("http://127.0.0.1:8080/corvus/httpd/ebms/inbound");
d.setAction ("action");
d.setDisabled ("false");
d.setSyncReplyMode ("none");
d.setTransportEndpoint ("http://127.0.0.1:8080/corvus/httpd/ebms/inbound");
d.setTransportProtocol ("http");
d.setAckRequested ("never");
d.setAckSignRequested ("never");
d.setDupElimination ("never");
d.setActor ("");
d.setMessageOrder ("NotGuaranteed");
d.setPersistDuration ("0");
d.setRetries (1);
d.setRetryInterval (30000);
d.setSignRequested ("false");
d.setDsAlgorithm ("");
d.setMdAlgorithm ("");
d.setEncryptAlgorithm ("sha1");
d.setEncryptRequested ("false");
d.setSignCert (new byte[]{});
d.setEncryptCert (new byte[]{});
d.setIsHostnameVerified ("false");
// Use default parameter for storing.
URL storeURL = FIXTURE_LOADER.getResource(EBMS_PARTNERSHIP_DATA_STORE0);
/*
* We want to test if it is able to convert data-type other than String.
*/
d.setEncryptCert("I am testing cert".getBytes());
// Test method.
df.storeEBMSPartnershipFromXML(d, storeURL);
// Assertion
PropertyTree assertionTree = new PropertyTree(storeURL);
// All key prefix.
final String[] xPathPrefix = { EBMSPartnershipData.PARAM_PREFIX};
// All key set
final String[][] keySet = { EBMSPartnershipData.PARAM_KEY_SET };
this.assertData(d, assertionTree, xPathPrefix, keySet);
}
/** Test whether the DataFactory able to load AS2 Administrator Data from the fixture **/
public void testCreateAS2AdminData() throws Exception
{
DataFactory df = DataFactory.getInstance();
AS2AdminData aData = df.createAS2AdminDataFromXML(this.getFixtureAsTree(AS2_ADMIN_DATA_SAMPLE0));
// Fixture dependent assertion
assertEquals("as2Testname" , aData.getUsername());
assertEquals("as2Testpassword" , new String(aData.getPassword()));
assertEquals("http://as2Test:8080/corvus/admin/as2/partnership" , aData.getManagePartnershipEndpoint());
assertEquals("http://as2Test:8080/corvus/admin/as2/repository" , aData.getEnvelopQueryEndpoint());
}
/** Test whether the DataFactory able to load EBMS Administrator Data from the fixture **/
public void testCreateEBMSAdminData() throws Exception
{
DataFactory df = DataFactory.getInstance();
EBMSAdminData aData = df.createEBMSAdminDataFromXML(this.getFixtureAsTree(EBMS_ADMIN_DATA_SAMPLE0));
// Fixture dependent assertion
assertEquals("ebmsTestname" , aData.getUsername());
assertEquals("ebmsTestpassword" , new String(aData.getPassword()));
assertEquals("http://ebmsTest:8080/corvus/admin/ebms/partnership" , aData.getManagePartnershipEndpoint());
assertEquals("http://ebmsTest:8080/corvus/admin/ebms/repository" , aData.getEnvelopQueryEndpoint());
assertEquals(0, aData.getPartnershipOperation());
assertEquals("test-ebms-message-id", aData.getMessageIdCriteria());
assertEquals("INBOX", aData.getMessageBoxCriteria());
}
public void testCreateEBMSConfigData() throws Exception
{
DataFactory df = DataFactory.getInstance();
EBMSAdminData aData = df.createEBMSAdminDataFromXML(this.getFixtureAsTree(EBMS_CONFIG_DATA_SAMPLE0));
// Fixture dependent assertion.
//TODO:
}
public void testCcreateEbmsMessageHistoryQueryDataFromXML ()throws Exception
{
PropertyTree props =
new PropertyTree(
FIXTURE_LOADER.getResourceAsStream(EBMS_HISTORY_QUERY_DATA_STORE0));
DataFactory df = DataFactory.getInstance();
EBMSMessageHistoryRequestData actualData =
df.createEbmsMessageHistoryQueryDataFromXML(props);
Assert.assertTrue("%localhost%".equals(actualData.getMessageId()));
Assert.assertTrue("*box".equals(actualData.getMessageBox()));
Assert.assertTrue(" ".equals(actualData.getConversationId()));
Assert.assertTrue("$-_+*^()!?.,".equals(actualData.getCpaId()));
Assert.assertTrue("1234567890".equals(actualData.getAction()));
Assert.assertTrue("".equals(actualData.getStatus()));
Assert.assertNull(actualData.getService());
}
protected void tearDown() throws Exception {
super.tearDown();
this.logger.info("------- {} END ------", this.getName());
}
/**
* The helper method for loading the fixture from the class loader and transform
* to PropertyTree.
*/
private PropertyTree getFixtureAsTree(String fixtureName) throws Exception
{
URL u = FIXTURE_LOADER.getResource(fixtureName);
if (u == null)
throw new NullPointerException("Missing resource " + fixtureName + " in the classPath.");
return new PropertyTree(u);
}
/**
* Assert whether the data from <code>d</code> and the XML tree <code>expectedTree</code> contains
* same number of fields and content under <code>xPathPrefix</code>.
*
* @param d The KVPairData to assert with the <code>expectedTree</code>.
* @param expectedTree The XML Tree to assert with the <code>d</code>.
* @param xPathPrefix An array contains the XPath prefix used for extracting the data in the node.
* @param keySet An array contains the data key for extracting the data in the KVPairData.
*/
private void assertData(KVPairData d, PropertyTree expectedTree, String[] xPathPrefix, String[][] keySet)
throws UnsupportedEncodingException
{
int len;
String dataValue;
Object expectedDataValue;
Map props = d.getProperties();
// Iterate all key and set the properties.
for (int i = 0; i < keySet.length; i++)
{
len = keySet[i].length;
for (int j = 0; j < len; j++)
{
dataValue = expectedTree.getProperty(xPathPrefix[i] + "/" + keySet[i][j]);
expectedDataValue = props.get(keySet[i][j]);
if (expectedDataValue instanceof byte[])
{
expectedDataValue = new String((byte[])expectedDataValue, "UTF-8");
}
assertEquals(keySet[i][j] + " does not match ", dataValue, expectedDataValue);
logger.info("Data {} with value {} asserted successfully.", keySet[i][j], dataValue);
}
}
}
}
| [
"ilia.sotnikov@asstra.com"
] | ilia.sotnikov@asstra.com |
2173177fe470e217d588f83d1890c32b851a8cae | 0f1a73dc0329cead4fa60981c1c1eb141d758a5d | /kfs-parent/core/src/main/java/org/kuali/kfs/module/cab/dataaccess/PurchasingAccountsPayableReportDao.java | b4be7ce375a7de1e1e4c1b856dc898c1f8f4ff4e | [] | no_license | r351574nc3/kfs-maven | 20d9f1a65c6796e623c4845f6d68834c30732503 | 5f213604df361a874cdbba0de057d4cd5ea1da11 | refs/heads/master | 2016-09-06T15:07:01.034167 | 2012-06-01T07:40:46 | 2012-06-01T07:40:46 | 3,441,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,344 | java | /*
* Copyright 2011 The Kuali Foundation.
*
* Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kuali.kfs.module.cab.dataaccess;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
/**
* The DAO interface that declares methods needed to query the database about GeneralLedgerEntry
*/
public interface PurchasingAccountsPayableReportDao {
/**
* Get GeneralLedgerEntries from the given input values.
*
* @param fieldValues
* @return
*/
Iterator findGeneralLedgers(Map fieldValues);
/**
* Get PurchasingAccountsPayableDocument collection from given query fields.
*
* @param fieldValues
* @return
*/
Collection findPurchasingAccountsPayableDocuments(Map fieldValues);
}
| [
"r351574nc3@gmail.com"
] | r351574nc3@gmail.com |
12300d04c89650cbfddd654580b526e89994aa6f | c330d71fb5a96dc45e23e794c3d0327d71f051ee | /HomeWork-6/src/main/java/su/svn/hiload/socialnetwork/controllers/RestMessageController.java | 2d38c045d66e923eca5b76dcd52647e04ac03824 | [
"Unlicense"
] | permissive | vskurikhin/otus-java-2020-04-VSkurikhin | bb16b669bcf4a0439c03a0ab55ad9c1be9be1b26 | 7634d9e3b2732f11b306ebbbdd9195fed6e9de9a | refs/heads/master | 2022-10-01T07:32:26.927502 | 2020-06-08T04:47:37 | 2020-06-08T04:47:37 | 259,087,791 | 0 | 0 | Unlicense | 2020-06-08T04:47:39 | 2020-04-26T17:09:32 | HTML | UTF-8 | Java | false | false | 1,114 | java | package su.svn.hiload.socialnetwork.controllers;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import su.svn.hiload.socialnetwork.model.Message;
import su.svn.hiload.socialnetwork.services.ReactiveService;
@RestController
public class RestMessageController {
private final ReactiveService reactiveService;
public RestMessageController(ReactiveService reactiveService) {
this.reactiveService = reactiveService;
}
@GetMapping("/public/message/all")
private Flux<Message> messagesAll() {
return reactiveService.searchMessagesAll();
}
@PostMapping("/public/message")
Mono<Message> newMessage(@RequestBody Message message) {
return reactiveService.create(message);
}
@PutMapping("/public/message")
Mono<Message> updateMessage(@RequestBody Message message) {
return reactiveService.update(message);
}
@DeleteMapping("/public/message")
Mono<Void> deleteMessage(@RequestBody Message message) {
return reactiveService.delete(message);
}
}
| [
"vskurikhin@gmail.com"
] | vskurikhin@gmail.com |
eee29c353a6a3e3117aad62539d51588abdc9980 | 81de790988148db3228a5f7c08e39029353b1813 | /src/main/java/org/cojen/tupl/io/WindowsMappedPageArray.java | 2633b2dea02f5a0912fb337282fc3642a22ec033 | [
"Apache-2.0"
] | permissive | truward/Tupl | 13eb06ab21e2c2807d592fd32f1b0673c8e060ca | bdbfca5ef6f4368de1afa25277d3928af215f2cb | refs/heads/master | 2020-12-28T20:09:13.852365 | 2016-12-19T00:15:14 | 2016-12-19T00:15:14 | 43,733,040 | 1 | 0 | null | 2015-10-06T06:11:15 | 2015-10-06T06:11:14 | null | UTF-8 | Java | false | false | 7,387 | java | /*
* Copyright 2015 Cojen.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cojen.tupl.io;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.EnumSet;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.Kernel32Util;
import com.sun.jna.platform.win32.WinNT;
import com.sun.jna.win32.W32APIOptions;
/**
*
*
* @author Brian S O'Neill
*/
class WindowsMappedPageArray extends MappedPageArray {
private static final Kernel32Ex cKernel;
static {
cKernel = (Kernel32Ex) Native.loadLibrary
("kernel32", Kernel32Ex.class, W32APIOptions.UNICODE_OPTIONS);
}
private final File mFile;
private final EnumSet<OpenOption> mOptions;
private final WinNT.HANDLE mFileHandle;
private final WinNT.HANDLE mMappingHandle;
private final boolean mNonDurable;
private volatile boolean mEmpty;
WindowsMappedPageArray(int pageSize, long pageCount,
File file, EnumSet<OpenOption> options)
throws IOException
{
super(pageSize, pageCount, options);
mFile = file;
mOptions = options;
if (file == null) {
long mappingPtr = cKernel.VirtualAlloc
(0, // lpAddress
pageSize * pageCount,
0x1000 | 0x2000, // MEM_COMMIT | MEM_RESERVE
0x04); // PAGE_READWRITE
if (mappingPtr == 0) {
int error = cKernel.GetLastError();
throw new IOException(Kernel32Util.formatMessage(error));
}
setMappingPtr(mappingPtr);
mFileHandle = null;
mMappingHandle = null;
mNonDurable = true;
mEmpty = true;
return;
}
mEmpty = file.length() == 0;
mNonDurable = options.contains(OpenOption.NON_DURABLE);
int access = WinNT.GENERIC_READ;
if (!options.contains(OpenOption.READ_ONLY)) {
access |= WinNT.GENERIC_WRITE;
}
int create = options.contains(OpenOption.CREATE) ? WinNT.OPEN_ALWAYS : WinNT.OPEN_EXISTING;
int flags;
if (mNonDurable) {
flags = WinNT.FILE_ATTRIBUTE_TEMPORARY;
} else {
flags = WinNT.FILE_ATTRIBUTE_NORMAL;
}
WinNT.HANDLE hFile = cKernel.CreateFile
(file.getPath(),
access,
0, // no sharing
null, // security attributes
create,
flags,
null // template file
);
if (hFile == null || hFile == WinNT.INVALID_HANDLE_VALUE) {
int error = cKernel.GetLastError();
throw new FileNotFoundException(Kernel32Util.formatMessage(error));
}
long mappingSize = pageSize * pageCount;
WinNT.HANDLE hMapping = cKernel.CreateFileMapping
(hFile,
null, // security attributes
WinNT.PAGE_READWRITE,
(int) (mappingSize >>> 32),
(int) mappingSize,
null // no name
);
if (hMapping == null || hMapping == WinNT.INVALID_HANDLE_VALUE) {
int error = cKernel.GetLastError();
closeHandle(hFile);
throw toException(error);
}
access = options.contains(OpenOption.READ_ONLY)
? WinNT.SECTION_MAP_READ : WinNT.SECTION_MAP_WRITE;
Pointer ptr = cKernel.MapViewOfFile
(hMapping,
access,
0, // offset high
0, // offset low
mappingSize
);
if (ptr == null) {
int error = cKernel.GetLastError();
closeHandle(hMapping);
closeHandle(hFile);
throw toException(error);
}
mFileHandle = hFile;
mMappingHandle = hMapping;
setMappingPtr(Pointer.nativeValue(ptr));
}
@Override
public long getPageCount() {
return mEmpty ? 0 : super.getPageCount();
}
@Override
public void setPageCount(long count) {
mEmpty = count == 0;
}
@Override
MappedPageArray doOpen() throws IOException {
boolean empty = mEmpty;
WindowsMappedPageArray pa = new WindowsMappedPageArray
(pageSize(), super.getPageCount(), mFile, mOptions);
pa.mEmpty = empty;
return pa;
}
void doSync(long mappingPtr, boolean metadata) throws IOException {
if (!mNonDurable) {
if (!cKernel.FlushViewOfFile(mappingPtr, super.getPageCount() * pageSize())) {
throw toException(cKernel.GetLastError());
}
fsync();
}
mEmpty = false;
}
void doSyncPage(long mappingPtr, long index) throws IOException {
if (!mNonDurable) {
int pageSize = pageSize();
if (!cKernel.FlushViewOfFile(mappingPtr + index * pageSize, pageSize)) {
throw toException(cKernel.GetLastError());
}
fsync();
}
mEmpty = false;
}
void doClose(long mappingPtr) throws IOException {
if (mFileHandle == null) {
if (!cKernel.VirtualFree(mappingPtr, 0, 0x8000)) { // MEM_RELEASE
int error = cKernel.GetLastError();
throw new IOException(Kernel32Util.formatMessage(error));
}
} else {
cKernel.UnmapViewOfFile(new Pointer(mappingPtr));
closeHandle(mMappingHandle);
closeHandle(mFileHandle);
}
}
private static IOException toException(int error) {
return new IOException(Kernel32Util.formatMessage(error));
}
private static void closeHandle(WinNT.HANDLE handle) throws IOException {
cKernel.CloseHandle(handle);
}
private void fsync() throws IOException {
if (mFileHandle != null) {
// Note: Win32 doesn't have a flush metadata flag.
if (!cKernel.FlushFileBuffers(mFileHandle)) {
throw toException(cKernel.GetLastError());
}
}
}
public static interface Kernel32Ex extends Kernel32 {
// Inherited method only supports 32-bit mapping size.
Pointer MapViewOfFile(WinNT.HANDLE hFileMappingObject,
int dwDesiredAccess,
int dwFileOffsetHigh,
int dwFileOffsetLow,
long dwNumberOfBytesToMap);
boolean FlushViewOfFile(long baseAddress, long numberOfBytesToFlush);
long VirtualAlloc(long lpAddress, long dwSize, int flAllocationType, int flProtect);
boolean VirtualFree(long lpAddress, long dwSize, int dwFreeType);
}
}
| [
"broneill@users.noreply.github.com"
] | broneill@users.noreply.github.com |
ab174816b1653e9929bef72dbef23c4b9375dc2d | 81e01bf66ebd3ae8f4f5cc829981c635453ded25 | /src/main/java/com/rquest/test/jsoupdemo/JsoupUtil.java | 89c003288225e04f77363d872091bd1a8479a1e3 | [] | no_license | sl43793390/javaTools | 179afdcaf13e1773aeeb89bd6600e99d94057f78 | c1404dc6ea962e3e2ed65ca4d551fac1490b077a | refs/heads/master | 2022-12-14T05:43:18.306104 | 2020-07-05T01:42:46 | 2020-07-05T01:42:46 | 234,514,817 | 0 | 0 | null | 2022-12-06T00:34:24 | 2020-01-17T09:24:22 | Java | UTF-8 | Java | false | false | 14,813 | java | /**
* JsoupUtil.java
*
* Function:Jsoup utility class.
*
* ver date author
* ──────────────────────────────────
* 1.0 2017/02/22 bluetata
*
* Copyright (c) 2017, [https://github.com/] All Rights Reserved.
*/
package com.rquest.test.jsoupdemo;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
/**
* En:Utils class to parse website html by <code>Jsoup</code></br>
* Jp:ウェブサイトを解析する用ユーティリティクラス</br>
* Zh:Jsoup模拟浏览器解析网页工具类</br>
*
* @since crawler(datasnatch) version(1.0)</br>
* @author bluetata / dietime1943@gmail.com</br>
* @version 1.0</br>
*
* 重构代码:提取getDocument方法,并增加三类方法:getDocumentWithHeaders,
* getDocumentWithData和getDocumentWithCookies以满足在get提交中对不同数据绑定的提交 bluetata 2017/03/22
*
*/
public final class JsoupUtil {
private JsoupUtil() {
}
/**
* 方法说明:模拟浏览器,以String形式返回被访问的url的源码。
*
* @param url 被访问的website. 所传的URL必须以 "http://www."开头
* @return _html 以Stirng类型返回被访问网页的html.如果doc为null的情况方法返回空串""。
* @throws Exception
*/
public static String getHtml(String url) throws Exception {
String _html = "";
Document doc = getDocument(url);
if (doc != null) {
_html = doc.toString().replaceAll(UtilsConstants.AMP, UtilsConstants.AMPERSAND);
}
return _html;
}
/**
* 方法说明:将document对象转换成String类型
*
* @param doc 所要转换的document对象
* @return _html 以Stirng类型返回被访问网页的html.如果doc为null的情况方法返回空串""。
* @throws Exception
*/
public static String covertDoc2Str(Document doc) throws Exception {
return doc == null ? "" : doc.toString().replaceAll(UtilsConstants.AMP, UtilsConstants.AMPERSAND);
}
/**
* 方法说明:get document by override method which is <code>getDocument</code>
*
* @param url visit link
* @return Document doc object
* @throws Exception
*/
public static Document getDocument(String url) throws Exception {
return getDocument(url, null, null);
}
/**
* 方法说明:绑定单header模拟浏览器,返回document对象
*
* @param url 被访问url
* @param headerKey header的key
* @param headerValue header的value
* @return Document 返回document对象
* @throws Exception
*/
public static Document getDocumentWithHeader(String url, String headerKey, String headerValue) throws Exception {
Document doc = null;
if (StringUtils.isEmpty(headerKey) && StringUtils.isEmpty(headerValue)) {
doc = getDocument(url);
} else if (!StringUtils.isEmpty(headerKey) && !StringUtils.isEmpty(headerValue)){
Map<String, String> requestHeader = new HashMap<String, String>();
requestHeader.put(headerKey, headerValue);
doc = getDocumentWithHeaders(url, requestHeader);
} else {
// parameter is error. 参数が不正である、所传参数错误。
throw new IllegalArgumentException("key or value is err"); // TODO hard coding is fixing bluetata 2017/03/20 add
}
return doc;
}
/**
* 方法说明:绑定header集合模拟浏览器,返回document对象
*
* @param url 被访问url
* @param headersMap 绑定header的map集合
* @return Document 返回document对象
* @throws Exception
*/
public static Document getDocumentWithHeaders(String url, Map<String, String> headersMap) throws Exception {
Document doc = null;
if (headersMap != null && headersMap.size() != 0) {
doc = getDocument(url, headersMap, UtilsConstants.REQUEST_HEADERS);
}
return doc;
}
/**
* 方法说明:绑定单data(parameter)模拟浏览器,并返回document对象
*
* @param url 被访问的url
* @param dataKey parameter的key
* @param dataValue parameter的value
* @return Document 返回document对象
* @throws Exception
*/
public static Document getDocumentWithData(String url, String dataKey, String dataValue) throws Exception {
Document doc = null;
if (StringUtils.isEmpty(dataKey) && StringUtils.isEmpty(dataValue)) {
doc = getDocument(url);
} else if (!StringUtils.isEmpty(dataKey) && !StringUtils.isEmpty(dataValue)){
Map<String, String> dataMap = new HashMap<String, String>();
dataMap.put(dataKey, dataValue);
doc = getDocumentWithData(url, dataMap);
} else {
// parameter is error. 参数が不正である、所传参数错误。
throw new IllegalArgumentException("key or value is err"); // TODO hard coding is fixing bluetata 2017/03/20 add
}
return doc;
}
/**
* 方法说明:绑定data(parameters)集合模拟浏览器,并返回document对象
*
* @param url 被访问的url
* @param dataMap parameters的map集合
* @return Document 返回document对象
* @throws Exception
*/
public static Document getDocumentWithData(String url, Map<String, String> dataMap) throws Exception {
Document doc = null;
if (dataMap != null && dataMap.size() != 0) {
doc = getDocument(url, dataMap, UtilsConstants.REQUEST_DATA);
}
return doc;
}
/**
* 方法说明:绑定单cookie模拟浏览器,返回document对象
*
* @param url 被访问url
* @param cookieKey 绑定cookie的key
* @param cookieValue 绑定cookie的value
* @return Document 返回document对象
* @throws Exception
*/
public static Document getDocumentWithCookie(String url, String cookieKey, String cookieValue) throws Exception {
Document doc = null;
if (StringUtils.isEmpty(cookieKey) && StringUtils.isEmpty(cookieValue)) {
doc = getDocument(url);
} else if (!StringUtils.isEmpty(cookieKey) && !StringUtils.isEmpty(cookieValue)){
Map<String, String> cookiesMap = new HashMap<String, String>();
cookiesMap.put(cookieKey, cookieValue);
doc = getDocumentWithCookies(url, cookiesMap);
} else {
// parameter is error. 参数が不正である、所传参数错误。
throw new IllegalArgumentException("key or value is err"); // TODO hard coding is fixing bluetata 2017/03/20 add
}
return doc;
}
/**
* 方法说明:绑定cookies集合模拟浏览器,并返回document对象
*
* @param url 被访问的url
* @param cookiesMap 绑定cookies的map集合
* @return Document 返回document对象
* @throws Exception
*/
public static Document getDocumentWithCookies(String url, Map<String, String> cookiesMap) throws Exception {
Document doc = null;
if (cookiesMap != null && cookiesMap.size() != 0) {
doc = getDocument(url, cookiesMap, UtilsConstants.REQUEST_COOKIES);
}
return doc;
}
/**
* 方法说明:根据绑定的数据type选择绑定数据种类模拟浏览器
*
* @param url request url
* @param bindData bind data
* @param requestType request type: "headers" "data" "cookies" etc.
* @return Document object.
* @throws Exception Exception
*/
public static Document getDocument(String url, Map<String, String> bindData, String requestType) throws Exception {
Document doc = null;
Connection conn = null;
StringWriter strWriter = new StringWriter();
PrintWriter prtWriter = new PrintWriter(strWriter);
// En:get max retry count from properties file(com-constants.properties)
// Jp:プロパティファイルでロックタイムアウトのリトライ回数を取得する Zh:通过properties获取最大retry次数
int maxRetry = Integer.parseInt(PropertyReader.getProperties(SystemConstants.COM_CONSTANTS)
.getProperty(UtilsConstants.MAX_RETRY_COUNT));
// En: get sleep time from properties file Jp:プロパティファイルでロックタイムアウトのスリープ時間を取得する
int sleepTime = Integer.parseInt(PropertyReader.getProperties(SystemConstants.COM_CONSTANTS)
.getProperty(UtilsConstants.SLEEP_TIME_COUNT));
int temp = 0;
// En: if exception is occurred then retry loop is continue to run;
// Jp: 異常を起きる場合、ループを続き実行する。
for (int j = 1; j <= maxRetry; j++) {
try {
if (j != 1) {
Thread.sleep(sleepTime);
}
temp = Integer.parseInt(Math.round(Math.random() * (UserAgent.length - 1)) + "");
conn = Jsoup.connect(url).timeout(10000)
// .userAgent(
// add userAgent. TODO There is a plan to configure userAgent to load that userAgent from a property file.
// "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30");
.userAgent(UserAgent[temp]);
if (bindData != null && bindData.size() != 0 && !StringUtils.isEmpty(requestType)) {
switch (requestType) {
case UtilsConstants.REQUEST_HEADERS:
// adds each of the supplied headers to the request. // bluetata 2017/03/22 add
conn.headers(bindData);
break;
case UtilsConstants.REQUEST_DATA:
// adds all of the supplied data to the request data parameters. // 20170320 bluetata add
conn.data(bindData);
break;
case UtilsConstants.REQUEST_COOKIES:
// adds each of the supplied cookies to the request. // bluetata 2017/03/22 add
conn.cookies(bindData);
break;
default:
// TODO stream etc. logic is adding. bluetata 2017/03/22 add
break;
}
}
doc = conn.get();
// En: normal finish situation,loop is broken.
// Jp: サービスが正常に終了した場合、ループを中止します。
// Zh: 正常终了的情况、终止循环。
break;
} catch (Exception ex) {
// if throw new Exception(ex); dead code is occurred, retry is invalid.
// StackTraceを文字列で取得
ex.printStackTrace(prtWriter);
String stackTrace = strWriter.toString();
if (strWriter != null) {
try {
strWriter.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
if (prtWriter != null) {
prtWriter.close();
}
}
}
return doc;
}
/**
* @return 谷歌浏览器
* @return 火狐浏览器
* @return 猎豹浏览器
* @return 360浏览器
* @return 傲游浏览器
* @return 腾讯TT浏览器
* @return Opera浏览器
* @return IE6、8、9
* @return 世界之窗浏览器
* @return 腾讯QQ浏览器
* @return 苹果浏览器
*/
public static String[] UserAgent = {
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.13 (KHTML, like Gecko) Chrome/24.0.1290.1 Safari/537.13",
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; LBBROWSER)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.12 (KHTML, like Gecko) Maxthon/3.0 Chrome/18.0.966.0 Safari/535.12",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)",
"Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.12",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.1; WOW64; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; qihu theworld)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; QQBrowser/7.0.4350.400)",
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.6 Safari/534.57.2"
};
public static String[] BrowserType = {"谷歌浏览器", "火狐浏览器", "猎豹浏览器", "360浏览器", "傲游浏览器", "腾讯TT浏览器", "Opera浏览器", "IE6浏览器", "IE8浏览器", "IE9浏览器", "世界之窗浏览器", "腾讯QQ浏览器", "苹果浏览器"};
// post 提交--------------------------------------
}
| [
"noreply@github.com"
] | noreply@github.com |
1816e7d7f7994a74b08c22701e7d37f6513ddab7 | aaabffe8bf55973bfb1390cf7635fd00ca8ca945 | /src/main/java/com/microsoft/graph/requests/generated/BaseWorkbookFunctionsAverageARequestBuilder.java | 22ee5eb7132bf1fa7c43ab50aec340bd858900f3 | [
"MIT"
] | permissive | rgrebski/msgraph-sdk-java | e595e17db01c44b9c39d74d26cd925b0b0dfe863 | 759d5a81eb5eeda12d3ed1223deeafd108d7b818 | refs/heads/master | 2020-03-20T19:41:06.630857 | 2018-03-16T17:31:43 | 2018-03-16T17:31:43 | 137,648,798 | 0 | 0 | null | 2018-06-17T11:07:06 | 2018-06-17T11:07:05 | null | UTF-8 | Java | false | false | 2,594 | java | // ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.generated;
import com.microsoft.graph.concurrency.*;
import com.microsoft.graph.core.*;
import com.microsoft.graph.models.extensions.*;
import com.microsoft.graph.models.generated.*;
import com.microsoft.graph.http.*;
import com.microsoft.graph.requests.extensions.*;
import com.microsoft.graph.requests.generated.*;
import com.microsoft.graph.options.*;
import com.microsoft.graph.serializer.*;
import java.util.Arrays;
import java.util.EnumSet;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Base Workbook Functions Average ARequest Builder.
*/
public class BaseWorkbookFunctionsAverageARequestBuilder extends BaseActionRequestBuilder {
/**
* The request builder for this WorkbookFunctionsAverageA
*
* @param requestUrl the request URL
* @param client the service client
* @param requestOptions the options for this request
* @param values the values
*/
public BaseWorkbookFunctionsAverageARequestBuilder(final String requestUrl, final IBaseClient client, final java.util.List<? extends Option> requestOptions, final com.google.gson.JsonElement values) {
super(requestUrl, client, requestOptions);
bodyParams.put("values", values);
}
/**
* Creates the IWorkbookFunctionsAverageARequest
*
* @return the IWorkbookFunctionsAverageARequest instance
*/
public IWorkbookFunctionsAverageARequest buildRequest() {
return buildRequest(getOptions());
}
/**
* Creates the IWorkbookFunctionsAverageARequest with specific requestOptions instead of the existing requestOptions
*
* @param requestOptions the options for the request
* @return the IWorkbookFunctionsAverageARequest instance
*/
public IWorkbookFunctionsAverageARequest buildRequest(final java.util.List<? extends Option> requestOptions) {
WorkbookFunctionsAverageARequest request = new WorkbookFunctionsAverageARequest(
getRequestUrl(),
getClient(),
requestOptions
);
if (hasParameter("values")) {
request.body.values = getParameter("values");
}
return request;
}
}
| [
"caitbal@microsoft.com"
] | caitbal@microsoft.com |
1de9efe737fd73d587a9316700e2ec5512cd70cf | 4f8dae9201da32745663a9b5356377cf1a14128f | /src/main/java/practice/leetcode/oj331to340/OJ332.java | bc32249ecf02e3bc61c1718a4f010448ddf330f5 | [] | no_license | xiaoyue26/july | 09805465e2c2a4432876bb45e85780ba9330940f | a388405d31e1a6cd3d09424d9ce8c3aef8632712 | refs/heads/master | 2021-06-02T02:32:49.672546 | 2020-03-09T07:04:11 | 2020-03-09T07:04:25 | 133,506,411 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,492 | java | package practice.leetcode.oj331to340;
import java.util.*;
/*
* 开头固定是JFK, 出一个字母序最小的路线
* */
public class OJ332 {
private final String FROM = "JFK";
private static class Node {
String to;
int index;
public Node(String to, int index) {
this.to = to;
this.index = index;
}
}
private int getWeight(Node node) {
String str = node.to;
return str.charAt(2) - 'a' + (str.charAt(1) - 'a') * 26 + (str.charAt(0) - 'a') * 26 * 26;
}
public List<String> findItinerary(String[][] tickets) {
List<String> res = new ArrayList<>();
Map<String, List<Node>> map = new HashMap<>();
for (int i = 0; i < tickets.length; i++) {
String from = tickets[i][0];
String to = tickets[i][1];
List<Node> pre = map.getOrDefault(from, new ArrayList<>());
Node node = new Node(to, i);
pre.add(node);
map.put(from, pre);
}
for (Map.Entry entry : map.entrySet()) {
List<Node> v = (List<Node>) entry.getValue();
Collections.sort(v, new Comparator<Node>() {
@Override
public int compare(Node o1, Node o2) {
int i1 = getWeight(o1);
int i2 = getWeight(o2);
return i1 - i2;
}
});
}
// dfs
int count = 0;
String cur = FROM;
res.add(cur);
boolean[] visited = new boolean[tickets.length];
/*while (count < tickets.length) {
List<String> toS = map.get(cur);
if (toS == null || toS.size() == 0) {
// 回溯
return res;
}
cur = toS.remove(0);
res.add(cur);
count++;
}*/
dfs(cur, res, map, count, tickets.length, visited);
return res;
}
private boolean dfs(String cur, List<String> res, Map<String, List<Node>> map
, int count, int maxCount, boolean[] visited) {
if (count >= maxCount) {
return true;
}
List<Node> toList = map.get(cur);
if (toList == null || toList.size() == 0) {
return false;
}
for (Node n : toList) {
int index = n.index;
String to = n.to;
if (visited[index]) {
continue;
}
res.add(to);
visited[index] = true;
boolean flag = dfs(to, res, map, count + 1, maxCount, visited);
if (flag) {
return true;
}
visited[index] = false;
res.remove(res.size() - 1);
}
return false;
}
public static void main(String[] args) {
OJ332 obj = new OJ332();
System.out.println(obj.findItinerary(new String[][]{
{"MUC", "LHR"}
, {"JFK", "MUC"}
, {"SFO", "SJC"}
, {"LHR", "SFO"}
})); //["JFK", "MUC", "LHR", "SFO", "SJC"]
System.out.println(obj.findItinerary(new String[][]{
{"JFK", "SFO"}
, {"JFK", "ATL"}
, {"SFO", "ATL"}
, {"ATL", "JFK"}
, {"ATL", "SFO"}
}));// ["JFK","ATL","JFK","SFO","ATL","SFO"]
// [["EZE","TIA"],["EZE","AXA"],["AUA","EZE"],["EZE","JFK"],["JFK","ANU"],["JFK","ANU"],["AXA","TIA"],["JFK","AUA"],["TIA","JFK"],["ANU","EZE"],["ANU","EZE"],["TIA","AUA"]]
System.out.println(obj.findItinerary(new String[][]{
{"EZE", "TIA"}
, {"EZE", "AXA"}
, {"AUA", "EZE"}
, {"EZE", "JFK"}
, {"JFK", "ANU"}
, {"JFK", "ANU"}
, {"AXA", "TIA"}
, {"JFK", "AUA"}
, {"TIA", "JFK"}
, {"ANU", "EZE"}
, {"ANU", "EZE"}
, {"TIA", "AUA"}
}));
System.out.println(obj.findItinerary(new String[][]{
{"JFK", "KUL"}, {"JFK", "NRT"}, {"NRT", "JFK"}
}));
System.out.println(obj.findItinerary(new String[][]{
{"JFK", "ATL"}
, {"ORD", "PHL"}
, {"JFK", "ORD"}
, {"PHX", "LAX"}
, {"LAX", "JFK"}
, {"PHL", "ATL"}
, {"ATL", "PHX"}
}));
}
} | [
"296671657@qq.com"
] | 296671657@qq.com |
6794843bc59e30ff7d87426dccde402a11fc4311 | ef9c6f6f29276c360254595cfbb6dfa4b89facc6 | /src/test/java/play/canvas/test/TestCanvasBuildValidity.java | d2252e4d3dc24eac4e987a5fed9a8f9efc777f2e | [] | no_license | catalinFlorea/AsciiCanvas | 3dbb8c3617a0ed0dc44f1c59dca00442055cd970 | df5f9f767e5abab2dae10859cd090624a9ac207a | refs/heads/master | 2022-11-10T12:31:03.420403 | 2020-06-21T21:56:52 | 2020-06-21T21:56:52 | 273,779,537 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,087 | java | package play.canvas.test;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import play.canvas.Canvas;
class TestCanvasBuildValidity {
@Test
void testInvalid0WidthAndHeight() {
Throwable exception = assertThrows(IllegalArgumentException.class, () -> new Canvas(0, 0));
assertEquals("Width/Height must be a positive number!", exception.getMessage());
}
@Test
void testInvalidNegativeWidth() {
Throwable exception = assertThrows(IllegalArgumentException.class, () -> new Canvas(-1, 1));
assertEquals("Width/Height must be a positive number!", exception.getMessage());
}
@Test
void testInvalidNegativeHeight() {
Throwable exception = assertThrows(IllegalArgumentException.class, () -> new Canvas(1, -2));
assertEquals("Width/Height must be a positive number!", exception.getMessage());
}
@Test
void testInvalidNegativeHeightAndWidth() {
Throwable exception = assertThrows(IllegalArgumentException.class, () -> new Canvas(1, 0));
assertEquals("Width/Height must be a positive number!", exception.getMessage());
}
}
| [
"catalin.florea@abslbs.com"
] | catalin.florea@abslbs.com |
603f782fd41bbe943ff09441e64b5b86af886b4b | ff8181576481edb6a72f46c2c5fefb76f50eee59 | /src/main/java/com/springcore/EL/Main.java | a23f1573bffcf6bf995cc077c9fac3a9fa02079c | [] | no_license | akgarg0472/SpringCore | 44fa5e18a640502207fb35e45e7645dd901a7483 | b9cfc8fcb11463ab0eb8452d67543455ea84c257 | refs/heads/master | 2023-02-28T05:05:46.184298 | 2021-02-04T17:01:05 | 2021-02-04T17:01:05 | 335,484,334 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,514 | java | package com.springcore.EL;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
public class Main {
public static void main(String[] args) {
// creating IoC container
ApplicationContext context = new ClassPathXmlApplicationContext("ELConfig/ExpressionLanguageConfig.xml");
Programming programming = (Programming) context.getBean("programming");
System.out.println(programming);
ExpressionParser expressionParser = new SpelExpressionParser();
Expression expression = expressionParser.parseExpression("23+18");
System.out.println("Value of expression: " + expression.getValue());
}
}
// expression language is used to evaluate expressions using either @Value("") annotation or by using Spring interfaces for expression language.
// we can use any expression which returns some value same as the field type.
// we can call static method, static variables of a class using expression language
/* syntax of expression language:
- for normal expression: @Value("#{expression}")
- for static method call: @Value("#{ T(class with complete package name).staticMethodName(Parameters) }")
- for static fields call: @Value("#{ T(class with complete package name).staticFieldName }")
*/ | [
"akgarg0472@gmail.com"
] | akgarg0472@gmail.com |
55ffad2b5ac6af5c1f10f69211e00beee860c17c | ef8876ff618e854a2d74f1332c377dc9b7ffa8d5 | /abframe-util/src/main/java/org/abframe/util/DateUtil.java | 973d7862a386adf0e16437f4bcc3aefd988ebb1f | [] | no_license | liubiao240/abframe | 60a84603c492c0b8552064a3ae5a223be8f7ff4e | 5d9cb02d0f5eda2fc9e22c5057aa73d95b5d2fd9 | refs/heads/master | 2021-01-18T07:28:45.933875 | 2015-08-26T10:19:23 | 2015-08-26T10:19:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,853 | java | package org.abframe.util;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class DateUtil {
private final static SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
private final static SimpleDateFormat sdfDay = new SimpleDateFormat("yyyy-MM-dd");
private final static SimpleDateFormat sdfDays = new SimpleDateFormat("yyyyMMdd");
private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/**
* 获取YYYY格式
*
* @return
*/
public static String getYear() {
return sdfYear.format(new Date());
}
/**
* 获取YYYY-MM-DD格式
*
* @return
*/
public static String getDay() {
return sdfDay.format(new Date());
}
/**
* 获取YYYYMMDD格式
*
* @return
*/
public static String getDays() {
return sdfDays.format(new Date());
}
/**
* 获取YYYY-MM-DD HH:mm:ss格式
*
* @return
*/
public static String getTime() {
return sdfTime.format(new Date());
}
/**
* @param s
* @param e
* @return boolean
* @throws
* @Title: compareDate
* @Description: TODO(日期比较,如果s>=e 返回true 否则返回false)
* @author luguosui
*/
public static boolean compareDate(String s, String e) {
if (fomatDate(s) == null || fomatDate(e) == null) {
return false;
}
return fomatDate(s).getTime() >= fomatDate(e).getTime();
}
/**
* 格式化日期
*
* @return
*/
public static Date fomatDate(String date) {
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
try {
return fmt.parse(date);
} catch (ParseException e) {
e.printStackTrace();
return null;
}
}
/**
* 校验日期是否合法
*
* @return
*/
public static boolean isValidDate(String s) {
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
try {
fmt.parse(s);
return true;
} catch (Exception e) {
// 如果throw java.text.ParseException或者NullPointerException,就说明格式不对
return false;
}
}
public static int getDiffYear(String startTime, String endTime) {
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
try {
long aa = 0;
int years = (int) (((fmt.parse(endTime).getTime() - fmt.parse(startTime).getTime()) / (1000 * 60 * 60 * 24)) / 365);
return years;
} catch (Exception e) {
// 如果throw java.text.ParseException或者NullPointerException,就说明格式不对
return 0;
}
}
/**
* <li>功能描述:时间相减得到天数
*
* @param beginDateStr
* @param endDateStr
* @return long
* @author Administrator
*/
public static long getDaySub(String beginDateStr, String endDateStr) {
long day = 0;
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date beginDate = null;
Date endDate = null;
try {
beginDate = format.parse(beginDateStr);
endDate = format.parse(endDateStr);
} catch (ParseException e) {
e.printStackTrace();
}
day = (endDate.getTime() - beginDate.getTime()) / (24 * 60 * 60 * 1000);
//System.out.println("相隔的天数="+day);
return day;
}
/**
* 得到n天之后的日期
*
* @param days
* @return
*/
public static String getAfterDayDate(String days) {
int daysInt = Integer.parseInt(days);
Calendar canlendar = Calendar.getInstance(); // java.util包
canlendar.add(Calendar.DATE, daysInt); // 日期减 如果不够减会将月变动
Date date = canlendar.getTime();
SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateStr = sdfd.format(date);
return dateStr;
}
/**
* 得到n天之后是周几
*
* @param days
* @return
*/
public static String getAfterDayWeek(String days) {
int daysInt = Integer.parseInt(days);
Calendar canlendar = Calendar.getInstance(); // java.util包
canlendar.add(Calendar.DATE, daysInt); // 日期减 如果不够减会将月变动
Date date = canlendar.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("E");
String dateStr = sdf.format(date);
return dateStr;
}
public static void main(String[] args) {
System.out.println(getDays());
System.out.println(getAfterDayWeek("3"));
}
}
| [
"krisibm@163.com"
] | krisibm@163.com |
e5050a34853f5226bdc171fce492ff13643a1527 | ac50fe6ab1d054e2bf38f8731022e3fae5905bc9 | /Commons/src/main/java/com/almi/pgs/game/packets/Packet.java | db7ff45e415cc1a9e545d558faf4fc5d97e9d6ae | [] | no_license | mstasiak92/PGS-Server | 9e8427d821ac5a2353e6cace2653c472d84205dc | 4b622e081752d935d88bad0bca437599b4d1815b | refs/heads/master | 2021-12-13T16:37:08.216946 | 2017-01-18T13:58:03 | 2017-01-18T13:58:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package com.almi.pgs.game.packets;
/**
* Created by Almi on 2016-12-31.
* TLV packet structure:
* Type, Length, Value
*
* Type is represented by packet concrete class,
* Length is common for all packets, hence set up here,
* Value depends on concrete packet class
*
*/
public interface Packet {
}
| [
"michal.stasiak.92@gmail.com"
] | michal.stasiak.92@gmail.com |
413bcf9c1744a5ec3e54e47024643433df14c077 | 2aca2c25ef63596a3f2c3703841c7ece7266d0d1 | /Practice check/admin-service/src/main/java/com/cognizant/truyum/adminservice/service/MenuItemServiceImpl.java | 3e7596304dd94f84c94372828b5b57ec18513d22 | [] | no_license | RishabhGupta15/Cognizant-Internship | a0d4e74bfc2798de6d3519330236a5844978531b | f1ad491fdf51d3c731295e8e5e806ca5061e4e91 | refs/heads/main | 2023-09-03T18:40:53.492566 | 2021-10-12T11:51:11 | 2021-10-12T11:51:11 | 381,082,087 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,719 | java | package com.cognizant.truyum.adminservice.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cognizant.truyum.adminservice.exception.MenuItemNotFoundException;
import com.cognizant.truyum.adminservice.model.MenuItem;
import com.cognizant.truyum.adminservice.repository.MenuItemRepository;
@Service
public class MenuItemServiceImpl implements MenuItemService {
@Autowired
private MenuItemRepository menuItemRepository;
@Override
public List<MenuItem> getAllMenuItems() {
// TODO Auto-generated method stub
List<MenuItem> list = menuItemRepository.findAll();
//System.out.println(list);
return list;
}
@Override
public MenuItem getMenuItem(long id) {
// TODO Auto-generated method stub
return menuItemRepository.findById(id)
.orElseThrow(() -> new MenuItemNotFoundException("menu item with id " + id + " doesn't exist"));
}
@Override
public String editMenuItem(long id, MenuItem menuItem) {
MenuItem item = menuItemRepository.findById(id)
.orElseThrow(() -> new MenuItemNotFoundException("menu item with id " + id + " doesn't exist"));
if (menuItem.getName() != null) {
item.setName(menuItem.getName());
}
if (menuItem.getPrice() != 0.0) {
item.setPrice(menuItem.getPrice());
}
if (menuItem.getCategory() != null) {
item.setCategory(menuItem.getCategory());
}
if (menuItem.getDateOfLaunch() != null) {
item.setDateOfLaunch(menuItem.getDateOfLaunch());
}
item.setActive(menuItem.isActive());
item.setFreeDelivery(menuItem.isFreeDelivery());
menuItemRepository.save(item);
return "MenuItem with the id "+id+" updated successfully";
}
}
| [
"48063952+RishabhGupta15@users.noreply.github.com"
] | 48063952+RishabhGupta15@users.noreply.github.com |
cdeafb9195076f53afdf24051946f7296b1d2c34 | dfa95c875f578d4c60ca9811b91b62584ef716b8 | /quicklearn-app-rest/quicklearn-app-rest-web/src/main/java/com/quicklearn/web/dto/EnrollmentDTO.java | fbbea43e18e18bc768ec1e2da0dd3e04cc95f775 | [
"MIT"
] | permissive | louisgy/quickLearn | 9e323074e21af03a2fa9799c35c63f8ecbbcaf62 | 6796dba9946c7af399b2abc6e414ae9c225659ab | refs/heads/master | 2020-04-13T20:02:17.156532 | 2019-03-22T00:48:19 | 2019-03-22T00:48:19 | 163,419,242 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,300 | java | package com.quicklearn.web.dto;
import java.util.Date;
import javax.validation.constraints.NotNull;
import com.quicklearn.web.validator.CourseSessionExistence;
import com.quicklearn.web.validator.DateOrdering;
import com.quicklearn.web.validator.StudentExistence;
@DateOrdering
public class EnrollmentDTO {
@NotNull
private Date enrolledDate;
private boolean isComplete;
@NotNull
private long grade;
@NotNull
@StudentExistence
private int userId;
@NotNull
@CourseSessionExistence
private int courseSessionId;
public EnrollmentDTO() {
super();
// TODO Auto-generated constructor stub
}
public Date getEnrolledDate() {
return enrolledDate;
}
public void setEnrolledDate(Date enrolledDate) {
this.enrolledDate = enrolledDate;
}
public boolean isComplete() {
return isComplete;
}
public void setComplete(boolean isComplete) {
this.isComplete = isComplete;
}
public long getGrade() {
return grade;
}
public void setGrade(long grade) {
this.grade = grade;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public int getCourseSessionId() {
return courseSessionId;
}
public void setCourseSessionId(int courseSessionId) {
this.courseSessionId = courseSessionId;
}
}
| [
"louis.georgy@gmail.com"
] | louis.georgy@gmail.com |
1c288316440f2024c6592f8fe7955cd234373e97 | aaaa396961346b381478249231d59c3a683f8147 | /src/stillness/WriterOutputStream.java | f3513e09afd025509a18123692f07e37996047ea | [
"Apache-2.0"
] | permissive | cbrisson/stillness | 2778dedcf25a0eea12b53b3133cee58b3e2034af | a375c2e33b848f0bfe5bcba079c7a001f25f69c8 | refs/heads/master | 2021-01-10T13:25:22.740638 | 2015-06-02T21:52:17 | 2015-06-02T21:52:17 | 36,596,013 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,149 | java | /*
* Copyright 2003 The Apache Software Foundation.
*
* 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 stillness;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
public class WriterOutputStream extends OutputStream {
protected Writer writer = null;
/**
* Construct a new WriterOutputStream, bound to the specified writer.
*
* @param w the writer
*/
public WriterOutputStream(Writer w) {
writer = w;
}
/**
* Write a byte to this output stream.
*
* @exception IOException may be thrown
*/
public void write(int c) throws IOException {
writer.write(c);
}
}
| [
"claude@renegat.net"
] | claude@renegat.net |
d9d739667c4eeb3433721300363584d41aea5f95 | ad583ed989bad964055a7529ea25660d0d620268 | /app/src/main/java/com/ufrbuild/mh4x0f/painelufrb/utils/interactors/ProgressDialogStatus.java | b49f3735aa156d2be643274035533e411dc970b3 | [
"Apache-2.0"
] | permissive | UFRBuild/Painel-Aulas-UFRB | 1c92754694cd6e9d7791e9bffad6fc62723371b3 | 27c3a5b21584ab25ab90b5ceb98aa406005db310 | refs/heads/dev | 2022-12-25T12:04:38.632987 | 2022-12-12T23:16:25 | 2022-12-12T23:16:25 | 200,312,273 | 3 | 0 | Apache-2.0 | 2022-12-12T23:16:26 | 2019-08-03T00:12:43 | Java | UTF-8 | Java | false | false | 1,587 | java | /*
This file is part of the Painel de Aulas UFRB Open Source Project.
Painel de Aulas UFRB is licensed under the Apache 2.0.
Copyright 2019 UFRBuild - Marcos Bomfim
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.ufrbuild.mh4x0f.painelufrb.utils.interactors;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.Observer;
import androidx.annotation.Nullable;
public class ProgressDialogStatus extends SingleLiveEvent<Boolean> {
public void observe(LifecycleOwner owner, final ProgressDialogObserver observer) {
super.observe(owner, new Observer<Boolean>() {
@Override
public void onChanged(@Nullable Boolean s) {
if (s != null)
return;
observer.onChanged(s);
}
});
}
public interface ProgressDialogObserver {
/**
* Called when Progress Dialog's state is changed.
* @param status The Progress Dialog's active state, non-null.
*/
void onChanged(Boolean status);
}
} | [
"mh4root@gmail.com"
] | mh4root@gmail.com |
e1147c35f007371d17d178f0e6aab7d12f21270a | 53769d390845e6e5e0f562cb41dfb71000c8a560 | /src/com/zhoug/plugin/android/beans/ResIdBean.java | 25f52b718f73c98d21e9e525973c0663a1a17ada | [] | no_license | zhougan870822/findviews | 702aca7a8d3637b218c154c19370ccc846dd9b1b | 3250806d4e9baa01964bc5f343b6635b1b9da37a | refs/heads/master | 2020-09-06T13:16:13.080132 | 2020-06-12T03:35:39 | 2020-06-12T03:35:39 | 220,434,485 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,283 | java | package com.zhoug.plugin.android.beans;
import com.zhoug.plugin.android.ClassWriter;
public class ResIdBean {
private String name;//标签名,即组件类名
private String id;//标签id
private String _fieldName;//生成的全局变量的名字
private boolean addOnclick=false;
private boolean select=true;//是否生成
public ResIdBean() {
}
public boolean isAddOnclick() {
return addOnclick;
}
public void setAddOnclick(boolean addOnclick) {
this.addOnclick = addOnclick;
}
public boolean isSelect() {
return select;
}
public void setSelect(boolean select) {
this.select = select;
}
public ResIdBean(String name, String id) {
this.name = name;
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getFieldName() {
if(_fieldName ==null){
if(ClassWriter.prefixM){
_fieldName =getId2();
}else{
_fieldName =getId1();
}
}
return _fieldName;
}
public void reFieldName(){
_fieldName=null;
getFieldName();
}
private String getId1() {
String[] split = id.split("_");
String id = "";
for (int i = 0; i < split.length; i++) {
String s1 = split[i];
if (i != 0) {
String first = s1.substring(0, 1);
String last = s1.substring(1);
id += first.toUpperCase() + last;
} else {
id += s1;
}
}
return id;
}
private String getId2() {
String[] split = id.split("_");
String id = "m";
for (int i = 0; i < split.length; i++) {
String s1 = split[i];
String first = s1.substring(0, 1);
String last = s1.substring(1);
id += first.toUpperCase() + last;
}
return id;
}
@Override
public String toString() {
return "name:" + name + ",id=" + id;
}
}
| [
"564169392@qq.com"
] | 564169392@qq.com |
be663215e0ba91fa7464b87669c0538c43831ee1 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Chart-6/org.jfree.chart.util.ShapeList/BBC-F0-opt-50/tests/15/org/jfree/chart/util/ShapeList_ESTest_scaffolding.java | f25cecdecdce0775fcb668ba14df630af9393871 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 3,491 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Oct 20 15:36:43 GMT 2021
*/
package org.jfree.chart.util;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class ShapeList_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.jfree.chart.util.ShapeList";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ShapeList_ESTest_scaffolding.class.getClassLoader() ,
"org.jfree.chart.util.AbstractObjectList",
"org.jfree.chart.util.HashUtilities",
"org.jfree.chart.util.ObjectUtilities",
"org.jfree.chart.util.ShapeList"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ShapeList_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.jfree.chart.util.AbstractObjectList",
"org.jfree.chart.util.ShapeList",
"org.jfree.chart.util.SerialUtilities",
"org.jfree.chart.util.HashUtilities",
"org.jfree.chart.util.ObjectUtilities"
);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
5ce2cfb8e1657dcddb98e58c7aac1ef55a9d0af8 | fedc23b66d26f68eacf4cc04a3ef87bfc716b3e0 | /PPM.java | 82ae3d049df99b9a98cd00c735e682491d688cb1 | [] | no_license | joshuasewhee/PPM | f00b7c02a1939de600395f571e5c7f909deea2a4 | fa2d5279f006835c443d9705c8eeaa66712ad35a | refs/heads/master | 2021-06-09T09:28:35.522858 | 2016-12-01T03:42:19 | 2016-12-01T03:42:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,686 | java | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* Created by Joshua Sew-Hee on 11/21/2016.
*/
public class PPM {
// create an array of Pixels
int[][] r;
int[][] g;
int[][] b;
String magic;
int width, height, depth;
// default constructor
public PPM()
{
magic = "P3";
width = 0;
height = 0;
depth = 0;
r = new int [0][0];
g = new int[0][0];
b = new int[0][0];
}
public void read(String file_name) {
File f = new File(file_name);
Scanner sc = null;
try {
sc = new Scanner(f);
} catch (FileNotFoundException fe) {
System.out.println("File not found!");
}
magic = sc.nextLine();
width = sc.nextInt();
height = sc.nextInt();
depth = sc.nextInt();
r = new int [height][width];
g = new int [height][width];
b = new int [height][width];
for (int i = 0; i < height; i++) {
try {
for (int j = 0; j < width; j++) {
r[i][j] = sc.nextInt();
g[i][j] = sc.nextInt();
b[i][j] = sc.nextInt();
}
} catch (Exception e){
System.out.println("Index out of bounds." + e);
}
}
}
// Accessors
public String getMagic(){
return magic;
}
public int getWidth(){
return width;
}
public int getHeight(){
return height;
}
public int getDepth(){
return depth;
}
//Modifiers
public void setMagic(String m){
this.magic = m;
}
public void setWidth(int w){
this.width = w;
}
public void setHeight(int h){
this.height = h;
}
public void setDepth(int d){
this.depth = d;
}
public void save(String x) throws FileNotFoundException
{
PrintWriter writer = null;
try{
writer = new PrintWriter(x);
} catch (FileNotFoundException e)
{
e.printStackTrace();
}
writer.println(magic);
writer.println(width + " " + height);
writer.println(depth);
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
writer.print(String.format("%4d", r[i][j]));
writer.print(String.format("%4d", g[i][j]));
writer.print(String.format("%4d ", b[i][j]));
}
writer.println();
}
writer.close();
}
}
| [
"jysewhee@mail.lipscomb.edu"
] | jysewhee@mail.lipscomb.edu |
aa43692e0c9fe10cdd009eaca703089201632edf | 7d343ea71b4355f707d1869ed0ce31339dc13f19 | /src/com/company/TxtWorldStatsGenerator.java | e8a29b6827646b4ed36ecbf4dbbae53f6f936cae | [] | no_license | matszach/CaveExplorer | 8c5966592cd607040c90d5789c6f87ba607514a0 | 2dad88ffc7aa9a01695c746af6202580800aca22 | refs/heads/master | 2020-04-19T07:29:12.707461 | 2019-02-12T11:44:33 | 2019-02-12T11:44:33 | 168,048,440 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 952 | java | package com.company;
import java.io.PrintWriter;
public final class TxtWorldStatsGenerator {
private TxtWorldStatsGenerator instance = new TxtWorldStatsGenerator();
private static PrintWriter writer;
private static long[] tileAmountGenerator(int[][]tileTypes){
long[] tileAmount = new long[14];
for(int x = 0; x < tileTypes.length; x++){
for(int y = 0; y < tileTypes[0].length; y++){
tileAmount[tileTypes[x][y]] += 1;
}
}
return tileAmount;
}
public static void printWorldStats(int[][] tileTypes){
try{
writer = new PrintWriter("WorldStatsDestination\\worldStats.txt", "UTF-8");
} catch (Exception e){ }
long[] tileAmount = tileAmountGenerator(tileTypes);
for(long num : tileAmount){
writer.println(num);
}
writer.close();
}
private TxtWorldStatsGenerator(){
}
}
| [
"lkaszubowski@gmail.com"
] | lkaszubowski@gmail.com |
854350c4087b65a8d3c0a3f21d7fee10bd95f2ee | b894ed99f09f16c29b4a9799f876d7a056a3b816 | /src/main/java/com/javaguru/student_vadim_migun/lesson_5/level_4_junior/ArrayOddNumbers.java | 37e5b5496a89383b01b3fbc5f12238102c4feb01 | [] | no_license | javaGuruBY/belarus-jg-java-1-august-2020 | 66a6b532d3058c27055d83499869c9a134aca4ee | 9f307c06b626fb361241920eba4d15f95822f61e | refs/heads/master | 2023-01-24T05:37:23.633305 | 2020-12-10T13:02:49 | 2020-12-10T13:02:49 | 290,787,542 | 2 | 1 | null | 2020-08-28T19:24:07 | 2020-08-27T13:48:01 | Java | UTF-8 | Java | false | false | 932 | java | package com.javaguru.student_vadim_migun.lesson_5.level_4_junior;
/*
Напишите программу, в которой:
- создайте массив произвольной длины
- заполните массив случайными числами
- распечатайте на консоль все элементы массива
- найдите все нечётные числа в массиве и выведети их на консоль.
*/
class ArrayOddNumbers {
public static void main(String[] args) {
int[] array = new int[5];
for (int i = 0; i < array.length; i++) {
array[i] = (int) (Math.random()*100);
System.out.println("Numbers " + i + " = " + array[i]);
}
System.out.println();
for (int j : array) {
if (j % 2 != 0) {
System.out.println("Odd number - " + j);
}
}
}
}
| [
"vadimka193308@gmail.com"
] | vadimka193308@gmail.com |
cc55d11167db1caaba8997298219578314b3a0b7 | 977e7363c953e09c5757d5bd1bdfc1979b0fb878 | /src/main/java/wycc/io/HeapPrinter.java | f06a11c90cd1e4f303142529614bd2dabce9bf54 | [
"Apache-2.0"
] | permissive | Whiley/WhileyCompiler | 1be9ad2d6284d4486d94380296a3698984772ead | 4e1a0ea61aa3729dc7b3cdc8f44996d819873ee0 | refs/heads/main | 2023-02-18T08:56:39.383937 | 2022-08-10T22:10:28 | 2022-08-10T22:10:28 | 1,100,771 | 165 | 32 | Apache-2.0 | 2021-07-25T01:21:11 | 2010-11-21T22:32:44 | Java | UTF-8 | Java | false | false | 2,310 | java | // Copyright 2011 The Whiley Project Developers
//
// 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 wycc.io;
import java.io.PrintWriter;
import wycc.lang.Syntactic;
import wycc.lang.Syntactic.Item;
public class HeapPrinter {
private final PrintWriter out;
/**
* Signals whether or not to show garbage.
*/
private final boolean showGarbage;
public HeapPrinter(PrintWriter out, boolean showGarbage) {
this.out = out;
this.showGarbage = showGarbage;
}
public void print(Syntactic.Heap heap) {
boolean[] reachable = new boolean[heap.size()];
search(heap.getRootItem().getIndex(),heap, reachable);
//
out.println("root=" + heap.getRootItem().getIndex());
for(int i=0;i!=heap.size();++i) {
Item item = heap.getSyntacticItem(i);
if(reachable[i] || showGarbage) {
out.print("#" + i);
out.print(" ");
out.print(item.getClass().getSimpleName());
if(item.size() > 0) {
out.print("(");
for(int j=0;j!=item.size();++j) {
if(j!=0) {
out.print(",");
}
out.print(item.get(j).getIndex());
}
out.print(")");
}
byte[] data = item.getData();
if(data != null && data.length > 0) {
out.print("[");
for(int j=0;j!=data.length;++j) {
if(j!=0) {
out.print(",");
}
out.print("0x" + Integer.toHexString(data[j]));
}
out.print("] ");
// FIXME: there should be a better way of doing this really
out.print(item);
}
out.println();
}
}
out.flush();
}
private void search(int index, Syntactic.Heap heap, boolean[] visited) {
visited[index] = true;
//
Item item = heap.getSyntacticItem(index);
for (int j = 0; j != item.size(); ++j) {
int jth = item.get(j).getIndex();
if(!visited[jth]) {
search(jth, heap, visited);
}
}
}
}
| [
"david.pearce@ecs.vuw.ac.nz"
] | david.pearce@ecs.vuw.ac.nz |
27abfb36fd205629ae83e6f1784b5c2ed3fffbc3 | 141da474d154927e5a9c905ed4e5f5ebc88717ef | /src/main/java/science/mengxin/spring5app/domain/Notes.java | 3166d359052bb0752877eb957aabdfc5b8b2570f | [] | no_license | xmeng1/spring5-app | 4a9d811fd341b4f4f8c5ac85362efcdd79874148 | 7fd391f50753dbee24f055f0f2bfa2e4f1096426 | refs/heads/master | 2020-03-12T18:25:51.078935 | 2019-08-30T07:04:39 | 2019-08-30T07:04:39 | 130,759,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 978 | java | package science.mengxin.spring5app.domain;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
/**
* <p>Date: 25/04/18
*
* @author mengxin
* @version 1.0
*/
@Entity
public class Notes {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToOne
private Recipe recipe;
//more than 256 char
@Lob
private String recipeNotes;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Recipe getRecipe() {
return recipe;
}
public void setRecipe(Recipe recipe) {
this.recipe = recipe;
}
public String getRecipeNotes() {
return recipeNotes;
}
public void setRecipeNotes(String recipeNotes) {
this.recipeNotes = recipeNotes;
}
}
| [
"mengxin.city@gmail.com"
] | mengxin.city@gmail.com |
7cd98ee32f5464eba2cfbd6becc92e17a6f45c7b | e4b4b56b656da76056ef87176b5698947ceb26b1 | /AppInfoSystem/src/cn/appsys/service/AppCategoryServiceImpl.java | c7106470a8660f486e97d4dca54db32c9540a642 | [] | no_license | groupappinfo/appinfosystemproject | 11da85e8f4dadc724401904d65fc7a1c0cf5c36c | 39f253f6d09c9a81168cc5fe011b37c87797f8fb | refs/heads/master | 2020-06-18T06:39:01.689413 | 2017-06-17T08:30:26 | 2017-06-17T08:30:26 | 94,161,933 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 99 | java | package cn.appsys.service;
public class AppCategoryServiceImpl implements AppCategoryService {
}
| [
"1021981156@qq.com"
] | 1021981156@qq.com |
c776f90c8e28fd2d26e33ff807a412aa7c9ed11d | ebc9949ba32df96d18e9645663ee283b2c07133c | /src/main/java/ua/rubezhanskii/javabookshop/dto/CategoryDto.java | bec321c3f07da3be225639bf51882e58e424133d | [] | no_license | VitaliiRubezhanskii/JavaZoneBookShop | 710e2991d35c6c2c6c6b68bfff32a71f56a03708 | 88a7d220b584442daf1a55884ea3eb853d8a7554 | refs/heads/master | 2022-02-05T17:23:21.595813 | 2020-05-02T16:32:33 | 2020-05-02T16:32:33 | 125,268,190 | 0 | 0 | null | 2022-01-21T23:25:38 | 2018-03-14T20:12:21 | Java | UTF-8 | Java | false | false | 252 | java | package ua.rubezhanskii.javabookshop.dto;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import java.util.Set;
@Data
@RequiredArgsConstructor
public class CategoryDto {
private Integer categoryId;
private String category;
}
| [
"Vitalii.Rubezhanskii@gmail.com"
] | Vitalii.Rubezhanskii@gmail.com |
befff4b27ac63f6da5c98496c7ac28e9e950fce7 | b9648eb0f0475e4a234e5d956925ff9aa8c34552 | /google-ads-stubs-v8/src/main/java/com/google/ads/googleads/v8/services/GetCampaignSimulationRequest.java | 0fe19220937db9e9c24bdb18386a150a9c75e795 | [
"Apache-2.0"
] | permissive | wfansh/google-ads-java | ce977abd611d1ee6d6a38b7b3032646d5ffb0b12 | 7dda56bed67a9e47391e199940bb8e1568844875 | refs/heads/main | 2022-05-22T23:45:55.238928 | 2022-03-03T14:23:07 | 2022-03-03T14:23:07 | 460,746,933 | 0 | 0 | Apache-2.0 | 2022-02-18T07:08:46 | 2022-02-18T07:08:45 | null | UTF-8 | Java | false | true | 22,156 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v8/services/campaign_simulation_service.proto
package com.google.ads.googleads.v8.services;
/**
* <pre>
* Request message for
* [CampaignSimulationService.GetCampaignSimulation][google.ads.googleads.v8.services.CampaignSimulationService.GetCampaignSimulation].
* </pre>
*
* Protobuf type {@code google.ads.googleads.v8.services.GetCampaignSimulationRequest}
*/
public final class GetCampaignSimulationRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.ads.googleads.v8.services.GetCampaignSimulationRequest)
GetCampaignSimulationRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use GetCampaignSimulationRequest.newBuilder() to construct.
private GetCampaignSimulationRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private GetCampaignSimulationRequest() {
resourceName_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new GetCampaignSimulationRequest();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private GetCampaignSimulationRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
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;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
resourceName_ = s;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ads.googleads.v8.services.CampaignSimulationServiceProto.internal_static_google_ads_googleads_v8_services_GetCampaignSimulationRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ads.googleads.v8.services.CampaignSimulationServiceProto.internal_static_google_ads_googleads_v8_services_GetCampaignSimulationRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ads.googleads.v8.services.GetCampaignSimulationRequest.class, com.google.ads.googleads.v8.services.GetCampaignSimulationRequest.Builder.class);
}
public static final int RESOURCE_NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object resourceName_;
/**
* <pre>
* Required. The resource name of the campaign simulation to fetch.
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The resourceName.
*/
@java.lang.Override
public java.lang.String getResourceName() {
java.lang.Object ref = resourceName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
resourceName_ = s;
return s;
}
}
/**
* <pre>
* Required. The resource name of the campaign simulation to fetch.
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The bytes for resourceName.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getResourceNameBytes() {
java.lang.Object ref = resourceName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
resourceName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceName_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceName_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceName_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceName_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.ads.googleads.v8.services.GetCampaignSimulationRequest)) {
return super.equals(obj);
}
com.google.ads.googleads.v8.services.GetCampaignSimulationRequest other = (com.google.ads.googleads.v8.services.GetCampaignSimulationRequest) obj;
if (!getResourceName()
.equals(other.getResourceName())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER;
hash = (53 * hash) + getResourceName().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.ads.googleads.v8.services.GetCampaignSimulationRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* Request message for
* [CampaignSimulationService.GetCampaignSimulation][google.ads.googleads.v8.services.CampaignSimulationService.GetCampaignSimulation].
* </pre>
*
* Protobuf type {@code google.ads.googleads.v8.services.GetCampaignSimulationRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:google.ads.googleads.v8.services.GetCampaignSimulationRequest)
com.google.ads.googleads.v8.services.GetCampaignSimulationRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ads.googleads.v8.services.CampaignSimulationServiceProto.internal_static_google_ads_googleads_v8_services_GetCampaignSimulationRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ads.googleads.v8.services.CampaignSimulationServiceProto.internal_static_google_ads_googleads_v8_services_GetCampaignSimulationRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ads.googleads.v8.services.GetCampaignSimulationRequest.class, com.google.ads.googleads.v8.services.GetCampaignSimulationRequest.Builder.class);
}
// Construct using com.google.ads.googleads.v8.services.GetCampaignSimulationRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
resourceName_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.ads.googleads.v8.services.CampaignSimulationServiceProto.internal_static_google_ads_googleads_v8_services_GetCampaignSimulationRequest_descriptor;
}
@java.lang.Override
public com.google.ads.googleads.v8.services.GetCampaignSimulationRequest getDefaultInstanceForType() {
return com.google.ads.googleads.v8.services.GetCampaignSimulationRequest.getDefaultInstance();
}
@java.lang.Override
public com.google.ads.googleads.v8.services.GetCampaignSimulationRequest build() {
com.google.ads.googleads.v8.services.GetCampaignSimulationRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.ads.googleads.v8.services.GetCampaignSimulationRequest buildPartial() {
com.google.ads.googleads.v8.services.GetCampaignSimulationRequest result = new com.google.ads.googleads.v8.services.GetCampaignSimulationRequest(this);
result.resourceName_ = resourceName_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.ads.googleads.v8.services.GetCampaignSimulationRequest) {
return mergeFrom((com.google.ads.googleads.v8.services.GetCampaignSimulationRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.ads.googleads.v8.services.GetCampaignSimulationRequest other) {
if (other == com.google.ads.googleads.v8.services.GetCampaignSimulationRequest.getDefaultInstance()) return this;
if (!other.getResourceName().isEmpty()) {
resourceName_ = other.resourceName_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.ads.googleads.v8.services.GetCampaignSimulationRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.ads.googleads.v8.services.GetCampaignSimulationRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object resourceName_ = "";
/**
* <pre>
* Required. The resource name of the campaign simulation to fetch.
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The resourceName.
*/
public java.lang.String getResourceName() {
java.lang.Object ref = resourceName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
resourceName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* Required. The resource name of the campaign simulation to fetch.
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The bytes for resourceName.
*/
public com.google.protobuf.ByteString
getResourceNameBytes() {
java.lang.Object ref = resourceName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
resourceName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* Required. The resource name of the campaign simulation to fetch.
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @param value The resourceName to set.
* @return This builder for chaining.
*/
public Builder setResourceName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
resourceName_ = value;
onChanged();
return this;
}
/**
* <pre>
* Required. The resource name of the campaign simulation to fetch.
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return This builder for chaining.
*/
public Builder clearResourceName() {
resourceName_ = getDefaultInstance().getResourceName();
onChanged();
return this;
}
/**
* <pre>
* Required. The resource name of the campaign simulation to fetch.
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @param value The bytes for resourceName to set.
* @return This builder for chaining.
*/
public Builder setResourceNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
resourceName_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.ads.googleads.v8.services.GetCampaignSimulationRequest)
}
// @@protoc_insertion_point(class_scope:google.ads.googleads.v8.services.GetCampaignSimulationRequest)
private static final com.google.ads.googleads.v8.services.GetCampaignSimulationRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.ads.googleads.v8.services.GetCampaignSimulationRequest();
}
public static com.google.ads.googleads.v8.services.GetCampaignSimulationRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<GetCampaignSimulationRequest>
PARSER = new com.google.protobuf.AbstractParser<GetCampaignSimulationRequest>() {
@java.lang.Override
public GetCampaignSimulationRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new GetCampaignSimulationRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<GetCampaignSimulationRequest> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<GetCampaignSimulationRequest> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.ads.googleads.v8.services.GetCampaignSimulationRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
b2cd97f5074d5c3c8bd546d701a61befa3e6af6e | 4aa5cab1379be0255de82362b5119146e8a374b6 | /DisplayMessageDialogHandler.java | 9a9dac1c2ede702f354e0ae19e4dddcd40fbc2a9 | [] | no_license | ericso/psu_edu_ist411sp11_topic3excercise_imclientserver | 61be74eed62b85268dc69b3f688e9eff2277b3fd | 851565ad65b250b4f2e5f91ca9318a36587b0bdb | refs/heads/master | 2020-05-19T22:27:20.025727 | 2011-04-23T20:42:50 | 2011-04-23T20:42:50 | 1,609,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,537 | java | package so.eric.im.handler;
import so.eric.im.*;
import so.eric.im.ui.*;
import java.net.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
public class DisplayMessageDialogHandler extends MouseAdapter {
private String clientUsername;
private HashMap<String, InstantMessageDialog> currentConversations;
private ClientMessageGetterSender clientMessageGetterSender;
private int numberOfClicks;
public DisplayMessageDialogHandler(String clientUsername, HashMap<String, InstantMessageDialog> currentConversations, ClientMessageGetterSender clientMessageGetterSender) {
super();
this.clientUsername = clientUsername;
this.currentConversations = currentConversations;
this.clientMessageGetterSender = clientMessageGetterSender;
}
public void mouseClicked(MouseEvent evt) {
// Get the source of the clicks
JList list = (JList) evt.getSource();
// Get the number of clicks
numberOfClicks = evt.getClickCount();
// Check for a double-click
if (numberOfClicks == 2) {
int index = list.locationToIndex(evt.getPoint());
String recipient = (String) list.getSelectedValue();
System.out.println("Talking to " + index + ". " + recipient);
InstantMessageDialog tempDialog = new InstantMessageDialog(null, clientUsername, recipient, clientMessageGetterSender);
// Add the JDialog to the currentConversations HashMap
currentConversations.put(recipient, tempDialog);
tempDialog.setVisible(true);
}
}
} | [
"services@ericso.me"
] | services@ericso.me |
1f86817d4b534ee50fefb7ef9fd12a5e68cc6bc2 | 4f81b43605678c0d37efabdcaebdae12fd294623 | /src/main/java/org/mifos/beyonicIntegration/util/MfiProperties.java | 3e4b3353f70595b313180a694f317ef4b5148675 | [] | no_license | vladimirfomene/beyonic-integration | 0abeca8208293a27a1b1554add3315eac17a2493 | e58343363267c0ac49b5c8705b5c7284e9814d77 | refs/heads/master | 2021-01-20T04:57:44.898304 | 2017-12-02T19:48:33 | 2017-12-02T19:48:33 | 101,400,819 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 496 | java | /**
* MfiProperties.java
* ========================================
* This class has properties for a particular tenant
* @author vladimirfomene
*/
package org.mifos.beyonicIntegration.util;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Data
@Component
public class MfiProperties {
@Value("${mfi.phoneNumber}")
private String phoneNumber;
@Value("${mfi.name}")
private String mfiName;
}
| [
"vladimirfomene@gmail.com"
] | vladimirfomene@gmail.com |
dacf3fc562fee8df418c7aa9f1ff803ce3c21ec6 | 62b4ede0590db689437339d41ec7e41e14b536fe | /src/main/java/nl/hu/ipass/quizschoolapp/webservices/Quiz.java | 7cc8c5015f485168bc68e7c1b3dcc30746a79364 | [] | no_license | JeroenVerkerk/IPASS-Source-Code | f51e97548d5105f8aadf19c8168ced0b3599b640 | df9b3928d48cc5a8d527be40b5163f03ff199ebe | refs/heads/master | 2021-01-13T06:15:34.035800 | 2017-06-21T15:52:24 | 2017-06-21T15:52:24 | 95,018,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,103 | java | package nl.hu.ipass.quizschoolapp.webservices;
public class Quiz {
private int id;
private String vak;
private String niveau;
private String gemaaktDoor;
private String naam;
public Quiz(String vak, String niveau, String gemaakt, String naam) {
this.vak = vak;
this.niveau = niveau;
this.gemaaktDoor = gemaakt;
this.naam = naam;
}
public Quiz(int id, String vak, String niveau, String gemaakt, String naam) {
this.id = id;
this.vak = vak;
this.niveau = niveau;
this.gemaaktDoor = gemaakt;
this.naam = naam;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getVak() {
return vak;
}
public void setVak(String vak) {
this.vak = vak;
}
public String getNiveau() {
return niveau;
}
public void setNiveau(String niveau) {
this.niveau = niveau;
}
public String getGemaaktDoor() {
return gemaaktDoor;
}
public void setGemaaktDoor(String gemaaktDoor) {
this.gemaaktDoor = gemaaktDoor;
}
public String getNaam() {
return naam;
}
public void setNaam(String naam) {
this.naam = naam;
}
}
| [
"jdverkerk@gmail.com"
] | jdverkerk@gmail.com |
454d85218084e103610299790824ea10114465c4 | 31f3e3c27d26de2bfead0845b2c0baba8e3e3b84 | /src/main/java/com/example/drugsafety/repository/DrugDataRepository.java | 61d9d2e8f91f28a17e9f5cf0939f654b29f0fa17 | [] | no_license | vikrant47/DrugSafety | 24bf796d2f969207e90e1f006fea6a495cfe6089 | f158959e0411be1bf15558fe12cc1444e6b454d1 | refs/heads/master | 2020-03-21T07:07:05.217998 | 2018-06-21T11:24:08 | 2018-06-22T06:05:20 | 137,093,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.example.drugsafety.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.example.drugsafety.entity.DrugData;
import com.example.drugsafety.entity.acl.Role;
public interface DrugDataRepository extends JpaRepository<DrugData, Integer>{
public Role findByName(String name);
public Role findByGenericName(String genericName);
}
| [
"vikrant.singh1990@yahoo.in"
] | vikrant.singh1990@yahoo.in |
fd608c799fa74f9935c3bac939019ed1c5ab7c45 | f78c20627e126fea16a3c1fe811597a4a295d7fe | /xland/src/main/java/org/xman/lear/service/FellowServiceImpl.java | a197cd0dd44d61425e1003e98ed6bdb932392034 | [] | no_license | TaylorXian/Learless | 476fc00ce3fe68c41a58f6e604706d9f832a448a | 7ea3e88903b95a78d6e8c4613ceaa1b2fe186eca | refs/heads/master | 2021-01-18T23:14:32.247956 | 2017-06-24T09:02:59 | 2017-06-24T09:02:59 | 3,135,737 | 0 | 0 | null | 2016-10-26T02:44:23 | 2012-01-09T10:36:53 | Java | UTF-8 | Java | false | false | 671 | java | package org.xman.lear.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.xman.lear.domain.Fellow;
import org.xman.lear.domain.FellowExample;
import org.xman.lear.persistence.FellowMapper;
@Service
public class FellowServiceImpl implements FellowService {
@Autowired
private FellowMapper fellowMapper;
public void save(Fellow fellow) {
fellowMapper.insert(fellow);
}
@Override
public List<Fellow> findAll() {
return fellowMapper.selectByExample(null);
}
@Override
public Fellow findByName(String name) {
return fellowMapper.findByName(name);
}
}
| [
"taylorsaltfish@gmail.com"
] | taylorsaltfish@gmail.com |
9c4ab81c34bf9cd52818ed974f14e38399dd67d8 | a3109e5c6ecb38ff3a2f54889874b9df5b4a0340 | /iRemember/src/edu/vuum/mocca/orm/TagsCreator.java | 4f8ce16fcd6991d48fa22ce6909648352e62f651 | [] | no_license | ddieffen/iRemember---Clean | b04a0645b804fcbde64cb1395640034c7ef01ec3 | 1615d732e5b01f02a2dc2b9065b00a2538541cdb | refs/heads/master | 2016-09-06T06:38:58.041511 | 2014-03-30T23:44:00 | 2014-03-30T23:44:00 | 18,275,572 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,746 | java | /*
The iRemember source code (henceforth referred to as "iRemember") is
copyrighted by Mike Walker, Adam Porter, Doug Schmidt, and Jules White
at Vanderbilt University and the University of Maryland, Copyright (c)
2014, all rights reserved. Since iRemember is open-source, freely
available software, you are free to use, modify, copy, and
distribute--perpetually and irrevocably--the source code and object code
produced from the source, as well as copy and distribute modified
versions of this software. You must, however, include this copyright
statement along with any code built using iRemember that you release. No
copyright statement needs to be provided if you just ship binary
executables of your software products.
You can use iRemember software in commercial and/or binary software
releases and are under no obligation to redistribute any of your source
code that is built using the software. Note, however, that you may not
misappropriate the iRemember code, such as copyrighting it yourself or
claiming authorship of the iRemember software code, in a way that will
prevent the software from being distributed freely using an open-source
development model. You needn't inform anyone that you're using iRemember
software in your software, though we encourage you to let us know so we
can promote your project in our success stories.
iRemember is provided as is with no warranties of any kind, including
the warranties of design, merchantability, and fitness for a particular
purpose, noninfringement, or arising from a course of dealing, usage or
trade practice. Vanderbilt University and University of Maryland, their
employees, and students shall have no liability with respect to the
infringement of copyrights, trade secrets or any patents by DOC software
or any part thereof. Moreover, in no event will Vanderbilt University,
University of Maryland, their employees, or students be liable for any
lost revenue or profits or other special, indirect and consequential
damages.
iRemember is provided with no support and without any obligation on the
part of Vanderbilt University and University of Maryland, their
employees, or students to assist in its use, correction, modification,
or enhancement.
The names Vanderbilt University and University of Maryland may not be
used to endorse or promote products or services derived from this source
without express written permission from Vanderbilt University or
University of Maryland. This license grants no permission to call
products or services derived from the iRemember source, nor does it
grant permission for the name Vanderbilt University or
University of Maryland to appear in their names.
*/
package edu.vuum.mocca.orm;
import java.util.ArrayList;
import android.content.ContentValues;
import android.database.Cursor;
import edu.vuum.mocca.provider.MoocSchema;
/**
* TagsCreator is a helper class that does convenience functions for converting
* between the Custom ORM objects, ContentValues, and Cursors.
*
* @author Michael A. Walker
*
*/
public class TagsCreator {
/**
* Create a ContentValues from a provided TagsData.
*
* @param data
* StoryData to be converted.
* @return ContentValues that is created from the StoryData object
*/
public static ContentValues getCVfromTags(final TagsData data) {
ContentValues rValue = new ContentValues();
rValue.put(MoocSchema.Tags.Cols.LOGIN_ID, data.loginId);
rValue.put(MoocSchema.Tags.Cols.STORY_ID, data.storyId);
rValue.put(MoocSchema.Tags.Cols.TAG, data.tag);
return rValue;
}
/**
* Get all of the TagsData from the passed in cursor.
*
* @param cursor
* passed in cursor
* @return ArrayList<TagsData\> The set of TagsData
*/
public static ArrayList<TagsData> getTagsDataArrayListFromCursor(
Cursor cursor) {
ArrayList<TagsData> rValue = new ArrayList<TagsData>();
if (cursor != null) {
if (cursor.moveToFirst()) {
do {
rValue.add(getTagsDataFromCursor(cursor));
} while (cursor.moveToNext() == true);
}
}
return rValue;
}
/**
* Get the first TagsData from the passed in cursor.
*
* @param cursor
* passed in cursor
* @return TagsData object
*/
public static TagsData getTagsDataFromCursor(Cursor cursor) {
long rowID = cursor.getLong(cursor
.getColumnIndex(MoocSchema.Tags.Cols.ID));
long loginId = cursor.getLong(cursor
.getColumnIndex(MoocSchema.Tags.Cols.LOGIN_ID));
long storyId = cursor.getLong(cursor
.getColumnIndex(MoocSchema.Tags.Cols.STORY_ID));
String tag = cursor.getString(cursor
.getColumnIndex(MoocSchema.Tags.Cols.TAG));
// construct the returned object
TagsData rValue = new TagsData(rowID, loginId, storyId, tag);
return rValue;
}
}
| [
"ddieffen@gmail.com"
] | ddieffen@gmail.com |
b6e8d875abbc5901b211675ee3b1075ef914f65f | 7f4157724af82cc5c6607b9123b279682eb32cc5 | /top-auto-sdk/src/main/java/com/dingtalk/api/request/OapiCallCalluserRequest.java | 89bcabc2f6743431237997910d0305041867c770 | [] | no_license | wangyingjief/dingding | 0368880b1471a2bfcfca0611dbc98ff57109ac50 | b00fb55451eb7d0f2165f9599a7be66aee02a8a2 | refs/heads/master | 2020-03-26T00:12:41.233087 | 2018-08-10T16:43:31 | 2018-08-10T16:43:31 | 144,310,543 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,197 | java | package com.dingtalk.api.request;
import com.taobao.api.internal.util.RequestCheckUtils;
import java.util.Map;
import java.util.List;
import com.taobao.api.ApiRuleException;
import com.dingtalk.api.BaseDingTalkRequest;
import com.dingtalk.api.DingTalkConstants;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.TaobaoUtils;
import com.dingtalk.api.response.OapiCallCalluserResponse;
/**
* TOP DingTalk-API: dingtalk.oapi.call.calluser request
*
* @author top auto create
* @since 1.0, 2018.07.25
*/
public class OapiCallCalluserRequest extends BaseDingTalkRequest<OapiCallCalluserResponse> {
/**
* 授权isv套件企业的corpid
*/
private String authedCorpId;
/**
* 授权isv套件企业的员工userid
*/
private String authedStaffId;
/**
* isv套件所属企业下的员工userid
*/
private String staffId;
public void setAuthedCorpId(String authedCorpId) {
this.authedCorpId = authedCorpId;
}
public String getAuthedCorpId() {
return this.authedCorpId;
}
public void setAuthedStaffId(String authedStaffId) {
this.authedStaffId = authedStaffId;
}
public String getAuthedStaffId() {
return this.authedStaffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStaffId() {
return this.staffId;
}
public String getApiMethodName() {
return "dingtalk.oapi.call.calluser";
}
public String getApiCallType() {
return DingTalkConstants.CALL_TYPE_OAPI;
}
public Map<String, String> getTextParams() {
TaobaoHashMap txtParams = new TaobaoHashMap();
txtParams.put("authed_corp_id", this.authedCorpId);
txtParams.put("authed_staff_id", this.authedStaffId);
txtParams.put("staff_id", this.staffId);
if(this.udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public Class<OapiCallCalluserResponse> getResponseClass() {
return OapiCallCalluserResponse.class;
}
public void check() throws ApiRuleException {
RequestCheckUtils.checkNotEmpty(authedCorpId, "authedCorpId");
RequestCheckUtils.checkNotEmpty(authedStaffId, "authedStaffId");
RequestCheckUtils.checkNotEmpty(staffId, "staffId");
}
} | [
"joymting@qq.com"
] | joymting@qq.com |
bbb7aef05e1387562dd0d66221c25226c84d71bd | c3e41080a30e92a8f026371b8a40062766a34cca | /src/yc/java/offer/RectCover.java | 46aac7709aedf358c1f077a1c0d994dfa05ae961 | [] | no_license | ycFw/Algorithm-Practices | f0c7004cc382fdb848abb3f604a4c0659d4aacfe | 8c7cdc852b3791a54848a1ff6d07790d12b03734 | refs/heads/master | 2020-09-15T22:46:53.500998 | 2020-05-03T08:10:47 | 2020-05-03T08:10:47 | 223,574,571 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package yc.java.offer;
/**
* @program: algorithm-practices
* @description: 矩形覆盖
* @author: yc
* @create: 2020-01-19 22:24
**/
public class RectCover {
public int rectCover(int n) {
if (n <= 2)
return n;
int pre2 = 1, pre1 = 2;
int result = 0;
for (int i = 3; i <= n; i++) {
result = pre2 + pre1;
pre2 = pre1;
pre1 = result;
}
return result;
}
}
| [
"2698676480@qq.com"
] | 2698676480@qq.com |
35ac6a66e2634521d148dfe9f68c5dd9a21029c0 | cda40165a916985e079e2a483d271aa505fa1cd6 | /Theja_Dande-logger-exceptionhandling-master/src/main/java/com/epam5/logger_exceptionhandling/App.java | 72edf01a3f6eb2b46ee7d8bc21528148375f52f3 | [
"BSD-2-Clause"
] | permissive | DandeTheja/Exceptions-Logging | 766aea164bc09077c94169bb32ebd39ecfb2e047 | 92d3fb1c27c85239d7599b4debbae8c0bff2c8d6 | refs/heads/master | 2022-11-24T10:03:07.756871 | 2020-07-20T06:46:38 | 2020-07-20T06:46:38 | 281,036,297 | 0 | 0 | BSD-2-Clause | 2020-07-20T08:15:17 | 2020-07-20T06:44:24 | Java | UTF-8 | Java | false | false | 3,463 | java | package com.epam5.logger_exceptionhandling;
import java.util.*;
import infrastructureLayer.InfrastructureLayer;
import domainLayer.DomainLayer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* Hello world!
*
*/
interface UserInterface {
/*
Hence LAYERED ARCHITECTURE and SOLID,DRY,KISS,YAGNA Principles are implemented..!!
*/
}
public class App
{
private static final Logger LOGGER= LogManager.getLogger(App.class);
public static ArrayList<Object> listForInterestDetails= new ArrayList<Object>();
public static ArrayList<Object> listForHousecostDetails = new ArrayList<Object>();
public static void main( String[] args )
{
// TODO Auto-generated method stub
Scanner scanner=new Scanner(System.in);
char choice='Y';
DomainLayer object=new DomainLayer();
InfrastructureLayer object1=new InfrastructureLayer();
int calculate=1;
while(calculate==1) {
LOGGER.debug("You want to calculate Interests(1) or House construction cost(2)= (1/2)\n ");
int interest=scanner.nextInt();
if(interest==1) {
listForInterestDetails.add(interest);
while(choice=='Y') {
LOGGER.debug("Enter the Amount to Calculate Simple Interest and Compound Interest= \n");
double amount=scanner.nextDouble();
listForInterestDetails.add(amount);
LOGGER.debug("Enter the Number of Years to Calculate Simple Interest and Compound Interest= \n");
double noOfYears=scanner.nextDouble();
listForInterestDetails.add(noOfYears);
LOGGER.debug("Enter the Rate of Interest to Calculate Simple Interest and Compound Interest= \n");
double rateOfInterest=scanner.nextDouble();
listForInterestDetails.add(rateOfInterest);
listForInterestDetails.add(object.getSimpleInterest(amount,noOfYears,rateOfInterest));
listForInterestDetails.add(object.getCompoundInterest(amount,noOfYears,rateOfInterest));
LOGGER.debug(object.getSimpleInterest(amount,noOfYears,rateOfInterest)+"\n");
LOGGER.debug(object.getCompoundInterest(amount,noOfYears,rateOfInterest)+"\n");
LOGGER.debug("Want to calculate more of simple and compound interest= (Y/N) \n");
choice=scanner.next().charAt(0);
listForInterestDetails.add(choice);
if(choice=='N') {
break;
}
}}
else {
choice='Y';
while(choice=='Y') {
listForHousecostDetails.add(interest);
LOGGER.debug("Enter type of material=(standard_material, above_standard_material, high_standard_material, high_standard_material_fully_autumated_home) \n");
String materialType=scanner.next();
listForHousecostDetails.add(materialType);
LOGGER.debug("Enter Area of house= \n");
int area=scanner.nextInt();
listForHousecostDetails.add(area);
listForHousecostDetails.add(object.getHouseConstructionCost(materialType,area));
LOGGER.debug(object.getHouseConstructionCost(materialType,area)+"\n");
LOGGER.debug("Want to calculate another house construction cost= (Y/N)\n");
choice=scanner.next().charAt(0);
if(choice=='N')
break;
}
}
LOGGER.debug("Want to calculate more on interest/construction cost= (Yes-1/No-0)\n");
calculate=scanner.nextInt();
if(calculate==0)
break;
}
if(listForInterestDetails.size()>0) {
LOGGER.debug("Operation done while calculating Interests= \n");
object1.userOperation1();}
if(listForInterestDetails.size()>0) {
LOGGER.debug("Operation done while calculating construction cost= \n");
object1.userOperation2();}
}}
| [
"noreply@github.com"
] | noreply@github.com |
47e815c8f5d924483e41643754400378eed574cc | ca19fec3ea5be4da7824f78cfb4e82d434601e94 | /src/lab5/hasWaiters/Consumer.java | 38797618371933da8d811878dbc81d06eae51694 | [] | no_license | werkaaa/Concurrency | 0861512bc3834500f50fdb208d5e7f535dd8448b | 0cda95500b5836d4bc0ab2926c170ea7878ee4f9 | refs/heads/master | 2023-03-22T06:14:02.923438 | 2021-03-10T15:03:41 | 2021-03-10T15:03:41 | 304,652,882 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 658 | java | package lab5.hasWaiters;
public class Consumer implements Runnable{
private Buffer buffer;
private int maxConsumed;
private int id;
public Consumer(int id, Buffer buffer, int maxConsumed){
this.id = id;
this.buffer = buffer;
this.maxConsumed = maxConsumed;
}
private int getRandom(int max){
int min = 1;
int randomNumber = (int) (Math.random() * (max - min + 1) + min);
return randomNumber;
}
@Override
public void run() {
while(true) {
int howMany = this.getRandom(this.maxConsumed);
buffer.consume(howMany, this.id);
}
}
}
| [
"weronika.ormaniec@gmail.com"
] | weronika.ormaniec@gmail.com |
b88994a49d9ef93f14fd407e5fe7f09a5714a687 | 9bcb95c9d8c7c5f135045ae8cefea38325536457 | /ServerRaspberryPi/src/main/java/server/home/board/type/ControllerTvInterface.java | ea23d2be8b197368e9b8797fda8bc8895b4b509e | [] | no_license | lterminiello/tesis-terminiello-sirimarco | c4c8a6eaff9171b209ca763a5503b79d643cbf75 | d1c96992979ac9f6e9ca77d712351ece6c5b7d53 | refs/heads/master | 2021-01-11T01:25:02.942377 | 2018-03-07T03:16:38 | 2018-03-07T03:16:38 | 70,709,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | package server.home.board.type;
public interface ControllerTvInterface extends AbstractControllerInterface{
}
| [
"lucas.terminiello@despegar.com"
] | lucas.terminiello@despegar.com |
4cfb99a4f9cdbe2ebe69436569b089a50c95254e | 8e87640d66f9988c510bc32a1e70cbe7c1191884 | /pTolemy3DViewer/branches/refactor-0.1.1/src/org/ptolemy3d/math/Vector3f.java | ac2fb4bd0389a0352e0a0627e754d9e5f4de9dbb | [] | no_license | mwkorver/ptolemy3d | 5ace8b4c576f30fcd74f9da1202343c31a0b39a4 | 830e65b2f8e3fe0661c5d612b9c5aed7fd5b8d7e | refs/heads/master | 2021-01-22T16:38:12.427010 | 2015-03-23T22:22:31 | 2015-03-23T22:22:31 | 32,748,476 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,670 | java | /**
* Ptolemy3D - a Java-based 3D Viewer for GeoWeb applications.
* Copyright (C) 2008 Mark W. Korver
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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.ptolemy3d.math;
/**
* A vector with 3 components with float precision.
* @author Jerome JOUVIE (Jouvieje) <jerome.jouvie@gmail.com>
* @author Contributors
*/
public final class Vector3f implements Cloneable {
public float x;
public float y;
public float z;
public Vector3f() {
this(0, 0, 0);
}
public Vector3f(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
}
public Vector3f(Vector3f vec) {
this(vec.x, vec.y, vec.z);
}
@Override
public String toString() {
return super.toString()+"("+x+", "+y+", "+z+")";
}
@Override
protected Vector3f clone() {
return new Vector3f(x, y, z);
}
@Override
public boolean equals(Object obj) {
if(this == obj) {
return true;
}
else if(getClass() == obj.getClass()) {
final Vector3f vec = (Vector3f)obj;
return ((vec.x == x) && (vec.y == y) && (vec.z == z));
}
else {
return false;
}
}
@Override
public int hashCode() {
long hash;
hash = 31L + Float.floatToIntBits(x);
hash = 31L * hash + Float.floatToIntBits(y);
hash = 31L * hash + Float.floatToIntBits(z);
return (int)(hash ^ (hash>>32));
}
public final boolean isZero() {
return (x == 0) && (y == 0) && (z == 0);
}
public final boolean isUnit() {
return (x == 1) && (y == 1) && (z == 1);
}
public final float magnitude() {
return (float)Math.sqrt((x * x) + (y * y) + (z * z));
}
public final void normalize() {
final float mag = 1 / magnitude();
x *= mag;
y *= mag;
z *= mag;
}
public final void cross(Vector3f vec1, Vector3f vec2) {
float x = vec1.y * vec2.z - vec1.z * vec2.y;
float y = vec1.z * vec2.x - vec1.x * vec2.z;
float z = vec1.x * vec2.y - vec1.y * vec2.x;
this.x = x;
this.y = y;
this.z = z;
}
public final float dot(Vector3f vec) {
return (x * vec.x) + (y * vec.y) + (z * vec.z);
}
public final Vector3f set(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
return this;
}
public final Vector3f set(Vector3f vec) {
x = vec.x;
y = vec.y;
z = vec.z;
return this;
}
public final Vector3f add(Vector3f vec1, Vector3f vec2) {
x = vec1.x + vec2.x;
y = vec1.y + vec2.y;
z = vec1.z + vec2.z;
return this;
}
public final Vector3f sub(Vector3f vec1, Vector3f vec2) {
x = vec1.x - vec2.x;
y = vec1.y - vec2.y;
z = vec1.z - vec2.z;
return this;
}
public final Vector3f negate() {
x = -x;
y = -y;
z = -z;
return this;
}
public final Vector3f scale(float s) {
x *= s;
y *= s;
z *= s;
return this;
}
public float distance(Vector3f vec) {
float x = (vec.x - this.x);
float y = (vec.y - this.y);
float z = (vec.z - this.z);
return (float)Math.sqrt((x * x) + (y * y) + (z * z));
}
}
| [
"jerome@a6184b05-b731-6c71-0e7b-69934b2a1c39"
] | jerome@a6184b05-b731-6c71-0e7b-69934b2a1c39 |
bfe5a6c0a08854818e643e8326d82368f674e161 | 28a1ef26a95e5751324dbf9ffe690c8ab7970ef7 | /chapter6/core/SimpleContextValve.java | 3c1cee7a72de25f57723852dc18ed28021faa4aa | [] | no_license | pacosonTang/HowTomcatWorks | ff9a420120a5a3100465140ba7432ab952f4c208 | 3e63e995ac7d33539c874fdb9691ca256f769796 | refs/heads/master | 2021-01-21T04:51:12.848251 | 2016-06-08T11:45:53 | 2016-06-08T11:45:53 | 55,671,344 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,682 | java | package com.tomcat.chapter6.core;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.catalina.Context;
import org.apache.catalina.Contained;
import org.apache.catalina.Container;
import org.apache.catalina.HttpRequest;
import org.apache.catalina.Request;
import org.apache.catalina.Response;
import org.apache.catalina.Valve;
import org.apache.catalina.ValveContext;
import org.apache.catalina.Wrapper;
public class SimpleContextValve implements Valve, Contained {
protected Container container;
public void invoke(Request request, Response response, ValveContext valveContext)
throws IOException, ServletException {
// Validate the request and response object types
if (!(request.getRequest() instanceof HttpServletRequest) ||
!(response.getResponse() instanceof HttpServletResponse)) {
return; // NOTE - Not much else we can do generically
}
// Disallow any direct access to resources under WEB-INF or META-INF
HttpServletRequest hreq = (HttpServletRequest) request.getRequest();
String contextPath = hreq.getContextPath();
String requestURI = ((HttpRequest) request).getDecodedRequestURI();
String relativeURI =
requestURI.substring(contextPath.length()).toUpperCase();
Context context = (Context) getContainer();
// Select the Wrapper to be used for this Request
Wrapper wrapper = null;
try {
wrapper = (Wrapper) context.map(request, true);
}
catch (IllegalArgumentException e) {
badRequest(requestURI, (HttpServletResponse) response.getResponse());
return;
}
if (wrapper == null) {
notFound(requestURI, (HttpServletResponse) response.getResponse());
return;
}
// Ask this Wrapper to process this Request
response.setContext(context);
wrapper.invoke(request, response);
}
public String getInfo() {
return null;
}
public Container getContainer() {
return container;
}
public void setContainer(Container container) {
this.container = container;
}
private void badRequest(String requestURI, HttpServletResponse response) {
try {
response.sendError(HttpServletResponse.SC_BAD_REQUEST, requestURI);
}
catch (IllegalStateException e) {
;
}
catch (IOException e) {
;
}
}
private void notFound(String requestURI, HttpServletResponse response) {
try {
response.sendError(HttpServletResponse.SC_NOT_FOUND, requestURI);
}
catch (IllegalStateException e) {
;
}
catch (IOException e) {
;
}
}
} | [
"pacoson@163.com"
] | pacoson@163.com |
c3ddbba8d5b54764c652045716396ec4ef97acce | 4ed13753f5bc20ec143dc25039280f80c3edddd8 | /gosu-core-api/src/main/java/gw/lang/reflect/features/IPropertyReference.java | 908a4af1effbab5b417238bba9bca74563a540b2 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] | permissive | hmsck/gosu-lang | 180a96aab69ff0184700e70876bb0cf10c8a938f | 78c5f6c839597a81ac5ec75a46259cbb6ad40545 | refs/heads/master | 2021-02-13T06:53:30.208378 | 2019-10-31T23:15:13 | 2019-10-31T23:15:13 | 244,672,021 | 0 | 0 | Apache-2.0 | 2020-03-03T15:27:47 | 2020-03-03T15:27:46 | null | UTF-8 | Java | false | false | 245 | java | /*
* Copyright 2014 Guidewire Software, Inc.
*/
package gw.lang.reflect.features;
import gw.lang.reflect.IPropertyInfo;
public interface IPropertyReference<R, T> extends IFeatureReference<R, T>
{
public IPropertyInfo getPropertyInfo();
}
| [
"lboasso@guidewire.com"
] | lboasso@guidewire.com |
74933bdada9c4fa3f779a809aa1cfb51cc207c57 | 7d10796ff34f7bedef0d4be590d0443c939dd0bd | /core/src/com/github/aligator/stuckinaloop/systems/BossSystem.java | f3c8db1516aee92285e2f96fab8788ba83b2c82f | [] | no_license | aligator/StuckInALoop-LudumDare47 | a0eabbd5947bb305c71daabc42b61894cc349b75 | fc11f843f33d549cca539b0157cca3077e6030c9 | refs/heads/master | 2022-12-26T03:23:04.557766 | 2020-10-04T22:23:19 | 2020-10-04T22:23:19 | 300,822,584 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,402 | java | package com.github.aligator.stuckinaloop.systems;
import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.Family;
import com.badlogic.ashley.systems.IteratingSystem;
import com.github.aligator.stuckinaloop.components.*;
public class BossSystem extends IteratingSystem {
public BossSystem() {
super(Family.all(ShootingComponent.class, BodyComponent.class, SpaceShipComponent.class, BossComponent.class).get());
}
@Override
protected void processEntity(Entity entity, float deltaTime) {
BossComponent boss = Mapper.boss.get(entity);
BodyComponent body = Mapper.body.get(entity);
TextureComponent texture = Mapper.texture.get(entity);
// restrict movement in x and instead move up and down
if (!boss.isInFightingPosition && body.body.getPosition().x <= RenderingSystem.getScreenSizeInMeters().x - texture.widthInMeters() / 2 - 3) {
body.body.setLinearVelocity(0f, 5f);
boss.isInFightingPosition = true;
}
if (boss.isInFightingPosition && body.body.getPosition().y + texture.heightInMeters() / 2 >= RenderingSystem.getScreenSizeInMeters().y) {
body.body.setLinearVelocity(0f, -10f);
}
if (boss.isInFightingPosition && body.body.getPosition().y - texture.heightInMeters() / 2 <= 0) {
body.body.setLinearVelocity(0f, 10f);
}
}
}
| [
"johannes.hoermann@tiffinger-thiel.de"
] | johannes.hoermann@tiffinger-thiel.de |
1690dadd5a1eb1fa431faa4e63ae63238a2a9b9f | aeaf0b3d97dc46944731f60c0d8a594471d5eccc | /src/stds/mech/Collision.java | 4d495500e7bfa4835aa9b680b7e0aa0cc72fd931 | [] | no_license | John6923/SimpleTopDownScroller | 7652b1f7c3297c34ff79a73526189d1b27ce04c5 | b75bcbe0aab90922011811ecfd4108a074b1ff87 | refs/heads/master | 2016-09-05T18:22:36.280428 | 2013-11-12T20:24:00 | 2013-11-12T20:24:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,042 | java | package stds.mech;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import stds.constants.Constants;
import stds.constants.GameStage;
import stds.gfx.Dialogue;
@SuppressWarnings("serial")
public abstract class Collision extends Input {
protected void handleKeyPress(){
int xvel = 0;
int yvel = 0;
xvel += rightArrow ? 1 : 0;
xvel -= leftArrow ? 1 : 0;
yvel += downArrow ? 1 : 0;
yvel -= upArrow ? 1 : 0;
switch(yvel){
case 1:
player.setDirection(Constants.DOWN);
break;
case -1:
player.setDirection(Constants.UP);
break;
}
switch(xvel){
case 1:
player.setDirection(Constants.RIGHT);
break;
case -1:
player.setDirection(Constants.LEFT);
break;
}
bump(player.getX() + xvel, player.getY() + yvel);
if(isOpen(player.getX() + xvel, player.getY())){
player.addX(xvel);
}
if(isOpen(player.getX(), player.getY() + yvel)){
player.addY(yvel);
}
rightArrow = leftArrow = downArrow = upArrow = false;
}
private boolean isOpen(int x, int y){
int[] goodvals = {0, 2, 3, 4, 5, 10, 11, 12, 13};
for(int i : goodvals) {
if(terrain[x][y] == i) {
return true;
}
}
return false;
}
private void bump(int x, int y){
int[][] bumpvals = {new int[] {2,3,4,5}, new int[] {6, 7, 8, 9}, new int[] {10,11,12,13}, new int[] {14,15,16,17}, new int[] {18,19,20,21}};
for(int i = 0 ; i< bumpvals.length; i++){
for(int j : bumpvals[i]){
if(j == terrain[x][y]){
switch(i){
case 0:
bumpKey();
break;
case 1:
bumpDoor();
break;
case 2:
bumpSword();
break;
case 3:
bumpDragon();
break;
case 4:
bumpPrincess();
break;
}
}
}
}
}
private void bumpPrincess() {
dialogueTimeout = Constants.DIALOGUE_TIMEOUT;
dialogue = Dialogue.PRINCESS;
customDialogue = true;
Timer t = new Timer(Constants.DIALOGUE_TIMEOUT * Constants.TIMER, new ActionListener(){
public void actionPerformed(ActionEvent e){
gameStage = GameStage.WIN_SCREEN;
}
});
t.setRepeats(false);
t.start();
}
private void bumpDragon() {
if(player.hasSword()){
removeDragon();
dialogue = Dialogue.DRAGON_SLAIN;
}
else{
dialogue = Dialogue.DRAGON;
}
dialogueTimeout = Constants.DIALOGUE_TIMEOUT;
customDialogue = true;
}
private void bumpSword() {
dialogueTimeout = Constants.DIALOGUE_TIMEOUT;
dialogue = Dialogue.SWORD;
customDialogue = true;
}
private void bumpDoor() {
if(player.hasKey()){
removeDoor();
dialogue = Dialogue.DOOR_OPENED;
}
else {
dialogue = Dialogue.DOOR;
}
dialogueTimeout = Constants.DIALOGUE_TIMEOUT;
customDialogue = true;
}
private void bumpKey() {
dialogueTimeout = Constants.DIALOGUE_TIMEOUT;
dialogue = Dialogue.KEY;
customDialogue = true;
}
protected void checkUnlock(){
checkKey();
checkSword();
}
private boolean isOn(int[] goodvals){
for(int i : goodvals) {
if(terrain[player.getX()][player.getY()] == i) {
return true;
}
}
return false;
}
private void checkKey() {
int[] keyvals = {2, 3, 4, 5};
if(isOn(keyvals)){
removeKey();
getKey();
}
}
private void checkSword() {
int[] swordvals = {10,11,12,13};
if(isOn(swordvals)){
getSword();
removeSword();
}
}
private void getKey(){
removeKey();
player.getKey();
}
private void getSword() {
player.getSword();
}
private void removeKey() {
int[] goawayvals = {2,3,4,5};
remove(goawayvals);
}
private void removeSword() {
int[] goawayvals = {10,11,12,13};
remove(goawayvals);
}
private void removeDoor() {
int[] goawayvals = {6,7,8,9};
remove(goawayvals);
}
private void removeDragon() {
int[] goawayvals = {14,15,16,17};
remove(goawayvals);
}
private void remove(int[] goawayvals){
for(int i = 0; i < terrain.length; i++){
for(int j = 0; j < terrain[0].length; j++){
for(int k : goawayvals){
if(terrain[i][j] == k){
terrain[i][j] = 0;
}
}
}
}
}
}
| [
"john6923@live.com"
] | john6923@live.com |
5889e798d6b4f36661f8178d227cd413e47c958f | 1efea98101813282ac12fa296bac88368e4ee11b | /src/kr/go/police/sms/MyMessageDeleteAction.java | 79c11a418f1d7a12ec9ec11cf0b1e594380e1d26 | [] | no_license | everontech/SMS | f5a98284924cdf55b8e904a055071e6d7cf5c55b | 752c9b19841aed9ca745032a8f975362b36ef0b9 | refs/heads/master | 2021-01-18T06:39:10.778269 | 2013-01-11T05:22:51 | 2013-01-11T05:22:51 | null | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,362 | java | package kr.go.police.sms;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import kr.go.police.action.Action;
import kr.go.police.action.ActionForward;
/**
* 문자함 삭제 action
*/
public class MyMessageDeleteAction implements Action {
@Override
public ActionForward execute(HttpServletRequest request,
HttpServletResponse response) throws Exception {
SmsDAO dao = new SmsDAO();
// 그룹인덱스
String groupIndex = (String)request.getParameter("groupIndex");
String index = (String)request.getParameter("index");
if(dao.delMessage(Integer.valueOf(index)) ){
response.setContentType("text/html;charset=euc-kr");
PrintWriter out = response.getWriter();
out.println("<script>");
out.println("alert('문자함을 삭제하였습니다.');");
out.println("window.location.href='./MyMessageAction.sm?groupIndex=" + groupIndex + "' ");
out.println("</script>");
out.close();
return null;
}else{
response.setContentType("text/html;charset=euc-kr");
PrintWriter out = response.getWriter();
out.println("<script>");
out.println("alert('삭제실패!!')");
out.println("history.go(-1);");
out.println("</script>");
out.close();
return null;
}
}
}
| [
"juwan@juwan-PC.(none)"
] | juwan@juwan-PC.(none) |
bb187d4e6f546f7aae7a10a2c9d290c94d1e022c | 928b76753840df16cfce4f5fbdbe046272f689c9 | /febs-common/src/main/java/cc/mrbird/febs/common/config/FebsAuthExceptionConfigure.java | e815f81be6d8c821e26c1d7929d56d3156e7de3b | [] | no_license | inspire90/febs-cloud | 039d761209c11eefd5a575022093cbb51413b29b | 0ec06b7609af4b5e4aee986a8874ad016a0a1e5c | refs/heads/master | 2023-06-01T00:48:56.680255 | 2021-06-24T10:40:05 | 2021-06-24T10:40:05 | 379,204,649 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package cc.mrbird.febs.common.config;
import cc.mrbird.febs.common.handler.FebsAccessDeniedHandler;
import cc.mrbird.febs.common.handler.FebsAuthExceptionEntryPoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
public class FebsAuthExceptionConfigure {
@Bean
@ConditionalOnMissingBean(name = "accessDeniedHandler")
public FebsAccessDeniedHandler accessDeniedHandler() {
return new FebsAccessDeniedHandler();
}
@Bean
@ConditionalOnMissingBean(name = "authenticationEntryPoint")
public FebsAuthExceptionEntryPoint authenticationEntryPoint() {
return new FebsAuthExceptionEntryPoint();
}
}
| [
"st13849375638@163.com"
] | st13849375638@163.com |
3150c4759e0eace7d2b107219c641f3a6c16f4a9 | c323bbc499f3bf1ae2e8af3a2b4f5fb6b68708b7 | /src/n_19_5/EndTest_ChenMang_ThayHung.java | 4eb841c40977d845dc234389dd0e7c27cd438b63 | [] | no_license | 7zism3/KITST_2021 | 6819e5edabcb04745c3a32a7c1e8d1f41c1aeae7 | 9c818fecca40f6dff0542f5267506b69e993c27c | refs/heads/master | 2023-05-18T16:34:38.828553 | 2021-05-30T06:00:49 | 2021-05-30T06:00:49 | 372,128,781 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,385 | java | package n_19_5;
public class EndTest_ChenMang_ThayHung {
public static void main(String args[]) {
int[] a = new int[10];
a[0] = 1;
a[1] = 2;
a[2] = 5;
a[3] = 8;
a[4] = 20;
a[5] = 50;
//a ={ 1, 2, 5, 8, 20, 50 ,0 ,0, 0, 0}
int[] x = { 3, 4, 15, 60 };
// lấy từng phần tử của x
int i=0; int j=0; int n=6;int m=4;
int cuoi=0;
while (i<x.length) {
while (j<=n-1 ) {
if (a[j]<=x[i]) j++;
else break;
}// j=0;
while ((cuoi<=m-1) && (x[cuoi]<a[j])) cuoi++;
// đoạn cần chèn: i, cuoi-1; doan can dich: size=cuoi-i;
int size=cuoi-i;
// n-1 đến j == sang phải size vị trí;
int t=n-1;
while ((size>0) && (t>=j)) {a[t+size]=a[t];t--;}
// chèn đoạn x[ i, cuoi-1];
for (t=j;t<j+size;t++) {a[t]=x[i];i++;}
j=j+size+1;
n=n+size;
i=cuoi;
if (j>n-1) break;
}
/// chèn nốt vào bên phải; ....
for ( i = 0; i < a.length; i++) {
System.out.print(a[i] + " ");
}
}
}
| [
"7zism3@gmail.com"
] | 7zism3@gmail.com |
92c4bce756ebc6107b56f994662d88914ca6c118 | 961234c564180110e57ca85b8471faa03c5636b5 | /eclipse/jsonTest/src/main/main.java | 31cbe62f56f16686da5ebac9ef44e881af038611 | [] | no_license | awedz/uni | 14c45ca99e0866a62db8cf4654cbe149696bbe5f | 35aa047ae98abe90ffa01ef99408eb9bdab312af | refs/heads/master | 2023-01-11T15:59:16.293421 | 2019-08-06T01:45:09 | 2019-08-06T01:45:09 | 157,736,246 | 0 | 0 | null | 2022-12-09T10:48:41 | 2018-11-15T15:53:20 | HTML | UTF-8 | Java | false | false | 699 | java | package main;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
public class main {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
WriteJson();
}
public static void WriteJson() throws Exception
{
JSONObject test = new JSONObject();
test.put("name","aaaa");
test.put("age",100);
JSONArray somearray = new JSONArray();
somearray.add("a1");
somearray.add("a2");
test.put("someArray",somearray);
try {
Files.write(Paths.get("jsonTest.json"),test.toJSONString().getBytes());
} catch (Exception e) {
System.out.println(e);
}
}
}
| [
"kiril.g88@gmail.com"
] | kiril.g88@gmail.com |
04cf145dc88054f86bdbdc85ec82febe5d1d611c | 06a3a07124c9df79c40c0212f4ea81fd46c110ee | /src/main/java/com/ghlabs/snippez/entity/User.java | 8753d3564c2a9a1b162d577e9de687b9fd0684ef | [] | no_license | gunay5858/Snippez | cfdad3257681841c26bd067ac984f603d93b6919 | 643f909222cf1b6315d8ad198d7530eba51eb720 | refs/heads/master | 2023-01-18T13:59:01.477189 | 2020-10-31T09:00:35 | 2020-10-31T09:00:35 | 306,421,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,483 | java | package com.ghlabs.snippez.entity;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Entity
@Getter
@Setter
@NoArgsConstructor
@JsonIdentityInfo(
generator = ObjectIdGenerators.PropertyGenerator.class,
property = "id", scope = User.class)
public class User implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "_seq_user")
@SequenceGenerator(name = "_seq_user", sequenceName = "_seq_user", initialValue = 1, allocationSize=1)
private Long id;
@NotEmpty(message = "Please provide a username")
private String username;
@NotEmpty(message = "Please provide a password")
private String password;
@NotEmpty(message = "Please provide an email")
private String email;
private String avatar = "defaultAvatar.png";
private boolean enabled = true;
private String role;
@ManyToMany(mappedBy = "sharedUsers")
private List<CodeSnippet> sharedSnippets = new ArrayList<>();
@OneToMany(mappedBy = "creator",
targetEntity = Category.class,
cascade = CascadeType.REMOVE,
orphanRemoval = true)
private List<Category> categories = new ArrayList<>();
@OneToMany(mappedBy = "creator",
targetEntity = CodeSnippet.class,
cascade = CascadeType.REMOVE,
orphanRemoval = true)
private List<CodeSnippet> codeSnippets = new ArrayList<>();
@Column(name = "created_at", nullable = false, updatable = false)
private Date createdAt;
@Column(name = "updated_at", nullable = false)
private Date updatedAt;
@PrePersist
private void createdAt() {
this.createdAt = new Date();
this.updatedAt = new Date();
}
@PreUpdate
private void updatedAt() {
this.updatedAt = new Date();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return id.equals(user.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
| [
"adminghlabs.de"
] | adminghlabs.de |
b64cc8273c40a9c902ba4b4f9a32d6697b871eb5 | 6ddbd333fbb0b082eaa44b2a1e6a5b6d08ded7c3 | /test/com/github/rajda/FitnessTest.java | 13578b107e8da5a0984c97157e68ad73095e652b | [
"MIT"
] | permissive | rajda/bee-colony-for-nphard | f3930fd0733b46036a9e37701b0e3064d6517c73 | e50506dbba917125cf50478546b6256887cf7438 | refs/heads/master | 2021-01-10T05:38:24.220865 | 2016-03-09T19:06:37 | 2016-03-09T19:06:37 | 50,693,232 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | package com.github.rajda;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class FitnessTest {
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void testGetValue() throws Exception {
}
} | [
"rajda@interia.pl"
] | rajda@interia.pl |
8ee4aaf9a202fc3b082ce229e771dfdbfd3bc3f3 | c318a447869c76c861eaec319fbc985a59bad122 | /solution/src/main/java/com/feizi/thread/demo/GuessANumber.java | f0bf8d9b37ee3cb23ebd5ec255f5233b347643b2 | [] | no_license | hu1991die/lintcode | 7647adf75660d54aedde45e8d18caa25bb8c24ca | 6527ed369b31010fc7f23ccd0d45392f1bfa0002 | refs/heads/master | 2021-01-20T14:25:11.928797 | 2017-02-22T02:35:57 | 2017-02-22T02:35:57 | 82,751,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 720 | java | /*
* Copyright (c) 2014 Javaranger.com. All Rights Reserved.
*/
package com.feizi.thread.demo;
/**
* @Desc
* @Author feizi
* @Date 2016/11/10 17:57
* @Package_name com.feizi.thread.demo
*/
public class GuessANumber extends Thread {
private int number;
public GuessANumber(int number) {
this.number = number;
}
@Override
public void run() {
int counter = 0;
int guess = 0;
do {
guess = (int) (Math.random() * 100 + 1);
System.out.println(this.getName() + " guesses " + guess);
counter++;
}while (guess != number);
System.out.println("** Correct!" + this.getName() + " in " + counter + "guesses.**");
}
}
| [
"ruanpeng@zhixueyun.com"
] | ruanpeng@zhixueyun.com |
3475bbafd0fa5b377a1f0cf8686a73e3a5f3d499 | 53825aeef71ce9498dc65e5ec9c6bdc71316b5f8 | /src/main/java/bob/command/ListCommand.java | 92e2cb5cd77618b86d914f9f4dfc356f62d757dd | [] | no_license | Caleblyx/ip | db38bce1b51a5ad11fe1a4d91d2f997cad4ef051 | 0ec23d65b88e3787268068f795595e3f7a28f351 | refs/heads/master | 2022-12-17T02:30:20.878905 | 2020-09-17T14:27:21 | 2020-09-17T14:27:21 | 287,751,198 | 0 | 0 | null | 2020-09-10T14:44:12 | 2020-08-15T13:24:27 | Java | UTF-8 | Java | false | false | 926 | java | package bob.command;
import bob.exception.BobIndexOutOfBoundsException;
import bob.Storage;
import bob.TaskList;
import bob.UI;
/**
* This command when executed prints out all tasks on a TaskList.
*/
public class ListCommand extends Command {
/**
* Executes the command by calling on the UI to return the contents of a TaskList in a message.
*
* @param tasks the TaskList consisting of all tasks tracked by Bob.
* @param ui the UI which prints out all messages corresponding to the Command.
* @param storage the Storage which manages all saved data to be updated.
* @return the message provided by the UI.
* @throws BobIndexOutOfBoundsException
*/
@Override
public String execute(TaskList tasks, UI ui, Storage storage) throws BobIndexOutOfBoundsException {
assert tasks != null : "A tasklist should be provided";
return ui.printOutList(tasks);
}
}
| [
"caleblyx@outlook.com"
] | caleblyx@outlook.com |
d9ecc718eb05251638beef28620bd5dd7d7c9f91 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/smallest/e9c6206d3a4862876b0dead881ac55078f11e291f60215ab028651f06fcbee2a591a31a7727037774542df4fe051a89460d85f6067a0b9729ae86e4afe1e6e92/000/mutations/117/smallest_e9c6206d_000.java | c7ac547009973772aa9d2cbbef2f82d16718653b | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,289 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class smallest_e9c6206d_000 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
smallest_e9c6206d_000 mainClass = new smallest_e9c6206d_000 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
DoubleObj a = new DoubleObj (), b = new DoubleObj (), c =
new DoubleObj (), d = new DoubleObj ();
output +=
(String.format ("Please enter 4 numbers separated by spaces > "));
a.value = scanner.nextDouble ();
b.value = scanner.nextDouble ();
c.value = scanner.nextDouble ();
d.value = scanner.nextDouble ();
if (a.value < b.value && a.value < c.value && a.value < d.value) {
output += (String.format ("%.0f is the smallest\n", a.value));
} else if (b.value < a.value && b.value < c.value && b.value < d.value) {
output += (String.format ("%.0f is the smallest\n", b.value));
} else if (c.value < b.value && c.value < a.value && c.value < d.value) {
output += (String.format ("%.0f is the smallest\n", c.value));
} else if ((a.value) < (b.value) && d.value < c.value && d.value < a.value) {
output += (String.format ("%.0f is the smallest\n", d.value));
}
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
cebe11263bafba5082ed2e6972f159b47c7a55b6 | 89b2ea77ac226cdbe74739971c9ef74688d3c9df | /src/main/java/de/flapdoodle/embed/mongo/transitions/ExecutedMongoDumpProcess.java | 2129d73adcb2f3e7294d3399731b60b58c665732 | [
"Apache-2.0"
] | permissive | flapdoodle-oss/de.flapdoodle.embed.mongo | 160e79c7ec59bfbb6689d245ce67adc8b112ea91 | 578d85aa70fb2a4d01301a9dfb4257400f91b9db | refs/heads/main | 2023-07-26T15:24:00.784185 | 2023-07-16T20:58:18 | 2023-07-16T20:58:18 | 4,083,576 | 761 | 169 | Apache-2.0 | 2023-07-02T05:52:29 | 2012-04-20T06:04:38 | Java | UTF-8 | Java | false | false | 1,661 | java | /**
* Copyright (C) 2011
* Michael Mosmann <michael@mosmann.de>
* Martin Jöhren <m.joehren@googlemail.com>
*
* with contributions from
* konstantin-ba@github,Archimedes Trajano (trajano@github)
*
* 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 de.flapdoodle.embed.mongo.transitions;
import de.flapdoodle.embed.process.transitions.Executer;
import de.flapdoodle.embed.process.types.ExecutedProcess;
import de.flapdoodle.embed.process.types.RunningProcess;
import de.flapdoodle.embed.process.types.RunningProcessImpl;
import de.flapdoodle.reverse.StateID;
import de.flapdoodle.reverse.Transition;
import org.immutables.value.Value;
@Value.Immutable
public abstract class ExecutedMongoDumpProcess implements ExecutedProcess {
public static ExecutedMongoDumpProcess stop(RunningProcess process) {
return ImmutableExecutedMongoDumpProcess.builder()
.returnCode(process.stop())
.build();
}
public static Transition<ExecutedMongoDumpProcess> withDefaults() {
return Executer.with(RunningProcessImpl::new, ExecutedMongoDumpProcess::stop)
.destination(StateID.of(ExecutedMongoDumpProcess.class))
.build();
}
}
| [
"michael@mosmann.de"
] | michael@mosmann.de |
ce98750f7b4102b5e2cb40c5b7ffc874095836b2 | b1f8f13cb05e5d605bfcfc5bf486dbf82aa88c0a | /src/columntorow/Archivos.java | 578842aab75f2c97ba9f2320c270e38b5927cb07 | [
"MIT"
] | permissive | tonsquemike/ColumnToRow | 6eadcf4faf9f2ba63f3c41488565fdc719dbe1f3 | fd2f28e47ea1d8009f37f0dcc50dd2e6ac64460b | refs/heads/master | 2021-01-19T00:34:33.094477 | 2016-08-17T23:13:19 | 2016-08-17T23:13:19 | 65,753,873 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,849 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package columntorow;
import java.io.*;
/**
*
* @author Miguel
*/
public class Archivos {
public static int cantidadDePalabras(String nombreArchivo){
File archivo ;
FileReader fr ;
BufferedReader br ;
String linea ;
int i = 0;
try{
archivo = new File( nombreArchivo );
fr = new FileReader( archivo );
br = new BufferedReader( fr );
while( (linea = br.readLine())!= null)
i++;
fr.close();
br.close();
return i;
}catch ( Exception e ){
e.printStackTrace();
}
return 0;
}
public static String[] leerArchivoDeTexto (String nombreArchivo){
File archivo ;
FileReader fr ;
BufferedReader br ;
String linea ;
String []lineas;
int i = 0;
try{
archivo = new File( nombreArchivo );
fr = new FileReader( archivo );
br = new BufferedReader( fr );
while( (linea = br.readLine())!= null)
i++;
fr.close();
br.close();
fr = new FileReader( archivo );
br = new BufferedReader( fr );
lineas = new String [i];
i = 0;
while( (linea = br.readLine())!=null )
lineas[i++] = linea;
fr.close();
br.close();
System.out.println(lineas.length);
return lineas;
}catch ( Exception e ){
e.printStackTrace();
}
return null;
}
public static String leerArchivoTexto ( String nombreArchivo ){
FileReader fr ;
BufferedReader br ;
String linea ;
String cadena ;
try{
fr = new FileReader( nombreArchivo );
br = new BufferedReader( fr );
cadena = "";
while( (linea = br.readLine())!= null )
cadena = cadena.concat(linea+"\r\n");
fr.close();
br.close();
return cadena;
}catch ( Exception e ){
e.printStackTrace();
}
return null;
}
public static boolean escribeArchivo( String nombreArchivo, String[] contenido ){
File ar;
FileWriter fr;
BufferedWriter br;
try{
ar = new File( nombreArchivo );//creacion del objeto archivo
fr = new FileWriter( ar ); //establece que el archvivo es de escritura
br = new BufferedWriter( fr ); //abre un canal entre el archivo y la aplicación
for(int i = 0; i<contenido.length-1; i++)
if(contenido.length>=1)
if(contenido[contenido.length-1]!=null)
br.write(contenido[contenido.length-1]);
br.close();
fr.close();
return true;
}catch(Exception e){
e.printStackTrace();
}
return false;
}
public static boolean escribeArchivo( String nombreArchivo, String cadena ){
File ar;
FileWriter fr;
BufferedWriter br;
try{
ar = new File( nombreArchivo );//creacion del objeto archivo
fr = new FileWriter( ar ); //establece que el archvivo es de escritura
br = new BufferedWriter( fr ); //abre un canal entre el archivo y la aplicación
br.write(cadena);
br.close();
fr.close();
return true;
}catch(Exception e){
e.printStackTrace();
}
return false;
}
public static BufferedWriter addLine(BufferedWriter br, String cadena){
try{
br.write(cadena+"\r\n");
return br;
}catch(Exception e){
e.printStackTrace();
}
return null;
}
public static boolean saveFile(BufferedWriter br){
try{
br.close();
return true;
}catch(Exception e){e.printStackTrace();}
return false;
}
public static BufferedWriter newBuffer( String nomArch )
{
try{
File ar = new File( nomArch );//creacion del objeto archivo
FileWriter fw = new FileWriter( ar ); //establece que el archvivo es de escritura
BufferedWriter bw = new BufferedWriter( fw ); //abre un canal entre el archivo y la aplicación
return bw;
}catch( Exception e ){e.printStackTrace();}
return null;
}
public static void copyTxt( String fuente, String destino){
try{
String []cadena = leerArchivoDeTexto(fuente);
escribeArchivo( fuente,destino );
}catch(Exception e){ e.getMessage(); }
}
}
| [
"tonsquemike@outlook.com"
] | tonsquemike@outlook.com |
ef93f12ab9397c8dfa9ee26b4b86dfb30550b55f | 2fad0dbd92680370e6d766d8f6ee50ba88b6462a | /src/Value.java | 44cf6fc182c6d3ad70ffdb08f5cc6d9b6553c425 | [] | no_license | cd888/InsuranceCalcApplication | 2aace917e88282aee226e9e5e0c21a316e1b9882 | 031c86246e7f47f00935681b91419b4ebb341783 | refs/heads/master | 2021-01-19T22:01:28.243950 | 2017-01-30T10:31:26 | 2017-01-30T10:31:26 | 80,412,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 936 | java | /**
*
* @author Chris Daly
* @version 27/01/2017
* This class is the Value Object class which creates the four variables used in the calculations.
*/
public class Value {
public double np;
public double il;
public double di;
public double pv;
public Value(double pv, double np, double il, double di){
setPv(pv);
setNp(np);
setIl(il);
setDi(di);
}
/**
* This is a constructor for value.
*/
public Value (){
}
/**
* The following methods are the getter and setter methods for the Value class.
* @return
*/
public double getPv() {
return pv;
}
public void setPv(double pv) {
this.pv = pv;
}
public double getNp() {
return np;
}
public void setNp(double np) {
this.np = np;
}
public double getIl() {
return il;
}
public void setIl(double il) {
this.il = il;
}
public double getDi() {
return di;
}
public void setDi(double di) {
this.di = di;
}
}
| [
"c.daly888@gmail.com"
] | c.daly888@gmail.com |
24fd3e4b812750acfd34147275874c4b96904bf6 | 08a4c8bf8123f74a5c711e1371f402fbed693453 | /app/src/main/java/com/example/game/LaserBeamObj.java | 776bdfcecfe9d3668b0926b6d32df70eb32fadce | [] | no_license | FlinkerCode/Game | fc50008386131cb81916b9ed75ae1c88098e0e62 | acd11dbc70205bdd995ef648bf648e6cfcaf3eb8 | refs/heads/master | 2022-12-06T00:57:35.434180 | 2020-08-23T12:51:50 | 2020-08-23T12:51:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | java | package com.example.game;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
public class LaserBeamObj extends GameObject {
private Paint paint;
private float x_player;
private float y_player;
private int damageValue;
public LaserBeamObj(String name, float X, float Y, Sprite image){
super(name,X, Y, image);
paint = new Paint();
paint.setColor(Color.GREEN);
paint.setStrokeWidth(0);
objType = "laser";
damageValue = 0;
}
@Override
public void draw(Canvas canvas){
objSprite.draw(canvas, true);
}
@Override
public int getDamageVal(){
return damageValue;
}
@Override
public void update(){
if (y > 1.1){
exist = false;
}
y = y + 0.017f;
if (Math.abs(x- x_player) < 0.02f && Math.abs(y-y_player) < 0.05f){
damageValue = 10;
exist = false;
}
objSprite.update(x,y);
}
public void setPlayerPos(float x_p, float y_p){
x_player = x_p;
y_player = y_p;
}
}
| [
"tobias.heinzle@hotmail.de"
] | tobias.heinzle@hotmail.de |
ad99ffa55a579ea5435229c48b4cd48e464d5cb0 | 6062156ac530d70135b80dfc14d3a24596503fc2 | /app/src/main/java/com/example/user/navbartemplatejava/util/NetworkUtils.java | 04f7cadfcefd27a2c725c7e1e9279dbfedba5c6e | [] | no_license | toganjr/android-apk | 06af9278e5dc3de8dea958dc01578b54962c551b | f33ebab5fa7f23dfbbea96e49f3f22af0d9a162a | refs/heads/master | 2020-03-25T13:06:02.780898 | 2018-10-18T06:35:07 | 2018-10-18T06:35:07 | 143,808,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 924 | java | package com.example.user.navbartemplatejava.util;
import android.content.Context;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public final class NetworkUtils {
private NetworkUtils() {
// require blank constructor
}
public static Boolean isNetworkConnected(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm != null ? cm.getActiveNetworkInfo() : null;
return activeNetwork != null && activeNetwork.isConnected();
}
public static Boolean isGpsAvailable(Context context) {
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
return locationManager != null && locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}
}
| [
"Yugijr@gmail.com"
] | Yugijr@gmail.com |
2cefb188a0650a7fa55ac3d1817e2917490f2483 | 17bd1a929a29bb0f68ac788b616cf4f0bdfaadcf | /android/app/src/main/java/com/archninjas_rn/MainActivity.java | d724c77074b8ee7a0547ea4f56f6303ce23344f4 | [] | no_license | rodrigoAOliveira/ArchNinjas_RN | 421bc3cc9000acf69ec3e0a7be9754595cbd51c1 | d2b6347d493a413870656dd3e520144163f1ab46 | refs/heads/master | 2020-05-24T03:04:09.486319 | 2019-05-08T18:47:06 | 2019-05-08T18:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 857 | java | package com.archninjas_rn;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "ArchNinjas_RN";
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
}
| [
"enzo.jorge@devninjas.com.br"
] | enzo.jorge@devninjas.com.br |
fb658f4bff7f909deaf663679c6d2a523b0c27e4 | 12f4c837eca56d3fdc64cfbce08c0cf3e8eb18cc | /app/src/main/java/com/example/robertuspamungkas/projectpam16/auth/BaseActivity.java | 0cb5ff977d1c4b22f11373f800e32302ce89632e | [] | no_license | pluntaz/ProjectPam16v1 | 8e259ba12d084860513dcade23ce3f44d65a276d | dbc35ca58c903078f2cbef88b5672e1f6cf919d1 | refs/heads/master | 2020-12-22T20:35:12.572472 | 2020-01-29T07:13:53 | 2020-01-29T07:13:53 | 236,924,632 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 946 | java | package com.example.robertuspamungkas.projectpam16.auth;
import android.app.ProgressDialog;
import android.support.annotation.VisibleForTesting;
import android.support.v7.app.AppCompatActivity;
import com.example.robertuspamungkas.projectpam16.R;
public class BaseActivity extends AppCompatActivity {
@VisibleForTesting
public ProgressDialog mProgressDialog;
public void showProgressDialog() {
if (mProgressDialog == null) {
mProgressDialog = new ProgressDialog(this);
mProgressDialog.setMessage(getString(R.string.loading));
mProgressDialog.setIndeterminate(true);
}
mProgressDialog.show();
}
public void hideProgressDialog() {
if (mProgressDialog != null && mProgressDialog.isShowing()) {
mProgressDialog.dismiss();
}
}
@Override
public void onStop() {
super.onStop();
hideProgressDialog();
}
}
| [
"pluntaz@users.github.com"
] | pluntaz@users.github.com |
0ba292e2bfe1f5d9452df8e55b5a47a4d8b914ea | 7d6c6612690f0be2463002d09901301bafc4aac4 | /src/com/test/Test.java | 12b943ce52e6594eaff99a7427d7838f3e0ea275 | [] | no_license | hnluke/propertyManage | ae24d8b7c16a9440a0918db324b2a08f539ec3ee | df0edec3a51e4a9bed10775631dcf591392f0c4c | refs/heads/master | 2021-05-16T18:37:59.784626 | 2020-05-18T10:14:45 | 2020-05-18T10:14:45 | 250,422,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,422 | java | package com.test;
import com.db.DBConnection;
import com.db.ExcelInDbo;
import com.pojo.Purchase;
import javax.swing.*;
import javax.swing.filechooser.FileSystemView;
import java.io.File;
import java.net.URL;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String[] args) {
int result = 0;
File file = null;
String path = null;
JFileChooser fileChooser = new JFileChooser();
FileSystemView fsv = FileSystemView.getFileSystemView(); //注意了,这里重要的一句
System.out.println(fsv.getHomeDirectory()); //得到桌面路径
fileChooser.setCurrentDirectory(fsv.getHomeDirectory());
fileChooser.setDialogTitle("请选择要上传的文件...");
fileChooser.setApproveButtonText("确定");
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
result = fileChooser.showOpenDialog(null);
if (JFileChooser.APPROVE_OPTION == result) {
path=fileChooser.getSelectedFile().getPath();
System.out.println("path: "+path);
}
List<Purchase> list = new ArrayList<Purchase>();
//list = ExcelInDbo.getAllByExcel(path);
/*//得到数据库表中所有的数据
List<StuEntity> listDb=StuService.getAllByDb();*/
Connection conn = DBConnection.getConnect("c3p0");
String sql = "";
PreparedStatement ps = null;
for(Purchase purchase : list) {
sql = "insert into purchase (p_code, p_assname, p_unit, p_num, p_type," +
" p_model, p_vouno, p_prices) values ('" + purchase.getP_code() +
"', '" + purchase.getP_assname() + "', '" + purchase.getP_unit() +
"', " + purchase.getP_num() + ", '" + purchase.getP_type() +
"', '" + purchase.getP_model() + "', '" + purchase.getP_vouno() +
"', " + purchase.getP_prices() + ")";
try {
ps = conn.prepareStatement(sql);
ps.executeUpdate();
} catch (SQLException e) {
System.out.println("导入失败");
e.printStackTrace();
}
System.out.println("导入成功");
}
}
}
| [
"32723445@qq.com"
] | 32723445@qq.com |
69458d55eca9d7a313fd2a7a838298c8637aa69f | c62726a703d99a8510996e8cfbd152167b9ba80a | /buyerTool/src/main/java/com/nahuo/buyertool/adapter/PicGridViewAdapter.java | 90ae408af283148286f3c3fa78c2ea28cf609427 | [] | no_license | JameChen/buyertools | e16c833d513692ccba9abd69248d1911da172afc | cf0ae14a68bc68c8d1041d788ac6855952b7beb6 | refs/heads/master | 2020-07-12T20:14:46.000632 | 2019-08-28T09:54:24 | 2019-08-28T09:58:16 | 204,896,443 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,364 | java | package com.nahuo.buyertool.adapter;
import java.io.File;
import android.content.Context;
import android.content.res.Resources;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import com.nahuo.library.controls.RecyclingImageView;
import com.nahuo.library.helper.ImageUrlExtends;
import com.nahuo.buyer.tool.R;
import com.squareup.picasso.Picasso;
public class PicGridViewAdapter extends BaseAdapter {
private Context mContext;
private String[] mData;
private int mNumColumns;
private static int[] IMG_SIZES;
private int mGridViewWidth;
private int IMG_SIZE;
private AbsListView.LayoutParams mLayoutParams;
public void setData(String[] urls) {
this.mData = urls;
if(mNumColumns == 0){
mNumColumns = getCount() < 4 ? getCount() : 4;
setNumColumns(mNumColumns == 0 ? 1 : mNumColumns);
}
}
public void setNumColumns(int numColumns){
mNumColumns = numColumns;
int idx = mNumColumns - 1;
idx = idx < 0 ? 0 : idx;
idx = idx >= IMG_SIZES.length ? IMG_SIZES.length - 1 : idx;
IMG_SIZE = IMG_SIZES[idx];
}
public PicGridViewAdapter(Context context) {
this.mContext = context;
Resources res = mContext.getResources();
IMG_SIZES = new int[] { res.getInteger(R.integer.grid_pic_width_big),
res.getInteger(R.integer.grid_pic_width_mid),
res.getInteger(R.integer.grid_pic_width_small) };
}
@Override
public int getCount() {
return mData == null ? 0 : mData.length;
}
@Override
public Object getItem(int position) {
return null == mData ? null : mData[position];
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView;
if (convertView == null) {
mLayoutParams = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,
mGridViewWidth / mNumColumns);
imageView = new RecyclingImageView(mContext);
imageView.setLayoutParams(mLayoutParams);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
} else {
imageView = (ImageView) convertView;
}
String tmpUrl = mData[position];
if (tmpUrl==null || tmpUrl.length()==0)
{
imageView.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,1));
return imageView;
}
File f = new File(tmpUrl);
if (f.exists()) {
Picasso.with(mContext).load(f).placeholder(R.drawable.empty_photo).into(imageView);
} else {
String url = ImageUrlExtends.getImageUrl(tmpUrl, IMG_SIZE);
if(!TextUtils.isEmpty(url)){
Picasso.with(mContext).load(url).placeholder(R.drawable.empty_photo).into(imageView);
}
}
return imageView;
}
public int getGridViewWidth() {
return mGridViewWidth;
}
public void setGridViewWidth(int gridViewWidth) {
mGridViewWidth = gridViewWidth;
}
}
| [
"1210686304@qq.com"
] | 1210686304@qq.com |
15cc7ac16feba17d21be34fabb8855dce2058027 | 32386cc93708c88e412d17ff34c77e84b60cfa8f | /src/main/java/io/github/pascalgrimaud/service/EntityWithServiceImplAndDTOService.java | 9319851d3d7f9a0d540458421ba8ebf53a94a832 | [] | no_license | pascalgrimaud/jhipster180901-react | 8541f150c18d11342d2f9ce52fdb94188000f859 | 71067d687f944c0544e27293ea8fedb5c422e684 | refs/heads/master | 2020-03-27T19:25:07.923308 | 2018-09-01T10:04:34 | 2018-09-01T10:04:34 | 146,987,678 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,069 | java | package io.github.pascalgrimaud.service;
import io.github.pascalgrimaud.service.dto.EntityWithServiceImplAndDTODTO;
import java.util.List;
import java.util.Optional;
/**
* Service Interface for managing EntityWithServiceImplAndDTO.
*/
public interface EntityWithServiceImplAndDTOService {
/**
* Save a entityWithServiceImplAndDTO.
*
* @param entityWithServiceImplAndDTODTO the entity to save
* @return the persisted entity
*/
EntityWithServiceImplAndDTODTO save(EntityWithServiceImplAndDTODTO entityWithServiceImplAndDTODTO);
/**
* Get all the entityWithServiceImplAndDTOS.
*
* @return the list of entities
*/
List<EntityWithServiceImplAndDTODTO> findAll();
/**
* Get the "id" entityWithServiceImplAndDTO.
*
* @param id the id of the entity
* @return the entity
*/
Optional<EntityWithServiceImplAndDTODTO> findOne(Long id);
/**
* Delete the "id" entityWithServiceImplAndDTO.
*
* @param id the id of the entity
*/
void delete(Long id);
}
| [
"pascalgrimaud@gmail.com"
] | pascalgrimaud@gmail.com |
e7a4d93cb70d2d857468b6d51ebc3b48bcdeff13 | 3abc6260ace0e50e76db1ce170da673ea92a9d35 | /mmap-region/src/main/java/org/tools4j/mmap/region/impl/AsyncVolatileStateMachineRegion.java | ff9d20e83029b3c954757606464c3b5acdea6dde | [
"MIT"
] | permissive | kimmking/mmap | 3f5bd7c327c48e5ebf687e8387a246d2036abf7e | 547b472bbd3b0054d44dccbfda40663ea285602b | refs/heads/master | 2020-04-12T04:14:08.771849 | 2018-12-02T11:14:41 | 2018-12-02T11:14:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,362 | java | /**
* The MIT License (MIT)
*
* Copyright (c) 2016-2018 mmap (tools4j), Marco Terzer, Anton Anufriev
*
* 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 org.tools4j.mmap.region.impl;
import java.nio.channels.FileChannel;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import org.agrona.DirectBuffer;
import sun.misc.Contended;
import org.tools4j.mmap.region.api.AsyncRegion;
import org.tools4j.mmap.region.api.AsyncRegionState;
import org.tools4j.mmap.region.api.FileSizeEnsurer;
public class AsyncVolatileStateMachineRegion implements AsyncRegion {
private static final long NULL = -1;
private final Supplier<? extends FileChannel> fileChannelSupplier;
private final IoMapper ioMapper;
private final IoUnmapper ioUnmapper;
private final FileSizeEnsurer fileSizeEnsurer;
private final FileChannel.MapMode mapMode;
private final int length;
private final long timeoutNanos;
private final UnmappedRegionState unmapped;
private final MapRequestedRegionState mapRequested;
private final MappedRegionState mapped;
private final UnMapRequestedRegionState unmapRequested;
@Contended
private volatile AsyncRegionState currentState;
private long position = NULL;
private long address = NULL;
public AsyncVolatileStateMachineRegion(final Supplier<? extends FileChannel> fileChannelSupplier,
final IoMapper ioMapper,
final IoUnmapper ioUnmapper,
final FileSizeEnsurer fileSizeEnsurer,
final FileChannel.MapMode mapMode,
final int length,
final long timeout,
final TimeUnit timeUnits) {
this.fileChannelSupplier = Objects.requireNonNull(fileChannelSupplier);
this.ioMapper = Objects.requireNonNull(ioMapper);
this.ioUnmapper = Objects.requireNonNull(ioUnmapper);
this.fileSizeEnsurer = Objects.requireNonNull(fileSizeEnsurer);
this.mapMode = Objects.requireNonNull(mapMode);
this.length = length;
this.timeoutNanos = timeUnits.toNanos(timeout);
this.unmapped = new UnmappedRegionState();
this.mapRequested = new MapRequestedRegionState();
this.mapped = new MappedRegionState();
this.unmapRequested = new UnMapRequestedRegionState();
this.currentState = unmapped;
if (Integer.bitCount(length) > 1) throw new IllegalArgumentException("length must be power of two");
}
@Override
public boolean wrap(final long position, final DirectBuffer source) {
final int regionOffset = (int) (position & (this.length - 1));
final long regionStartPosition = position - regionOffset;
if (awaitMapped(regionStartPosition)) {
source.wrap(address + regionOffset, this.length - regionOffset);
return true;
}
return false;
}
private boolean awaitMapped(final long position) {
if (this.position != position) {
final long timeOutTimeNanos = System.nanoTime() + timeoutNanos;
while (!map(position)) {
if (timeOutTimeNanos <= System.nanoTime()) return false;
}
}
return true;
}
@Override
public void close() {
if (position > 0) unmap();
}
@Override
public int size() {
return length;
}
@Override
public boolean processRequest() {
final AsyncRegionState readState = this.currentState;
final AsyncRegionState nextState = readState.processRequest();
if (readState != nextState) {
this.currentState = nextState;
return true;
}
return false;
}
@Override
public boolean map(final long regionStartPosition) {
//assert that regionStartPosition is aligned with length
final AsyncRegionState readState = this.currentState;
final AsyncRegionState nextState = readState.requestMap(regionStartPosition);
if (readState != nextState) this.currentState = nextState;
return nextState == mapped;
}
@Override
public boolean unmap() {
final AsyncRegionState readState = this.currentState;
final AsyncRegionState nextState = readState.requestUnmap();
if (readState != nextState) this.currentState = nextState;
return nextState == unmapped;
}
private final class UnmappedRegionState implements AsyncRegionState {
@Override
public AsyncRegionState requestMap(final long regionStartPosition) {
mapRequested.requestedPosition = regionStartPosition;
return mapRequested;
}
@Override
public AsyncRegionState requestUnmap() {
return this;
}
@Override
public AsyncRegionState processRequest() {
return this;
}
}
private final class MapRequestedRegionState implements AsyncRegionState {
private long requestedPosition;
@Override
public AsyncRegionState requestMap(final long regionStartPosition) {
return this;
}
@Override
public AsyncRegionState requestUnmap() {
return this;
}
@Override
public AsyncRegionState processRequest() {
if (address != NULL) {
ioUnmapper.unmap(fileChannelSupplier.get(), address, length);
address = NULL;
}
if (fileSizeEnsurer.ensureSize(requestedPosition + length)) {
address = ioMapper.map(fileChannelSupplier.get(), mapMode, requestedPosition, length);
position = requestedPosition;
requestedPosition = NULL;
return mapped;
} else {
return this;
}
}
}
private final class MappedRegionState implements AsyncRegionState {
@Override
public AsyncRegionState requestMap(final long regionStartPosition) {
if (AsyncVolatileStateMachineRegion.this.position != regionStartPosition) {
mapRequested.requestedPosition = regionStartPosition;
AsyncVolatileStateMachineRegion.this.position = NULL;
return mapRequested;
}
return this;
}
@Override
public AsyncRegionState requestUnmap() {
position = NULL;
return unmapRequested;
}
@Override
public AsyncRegionState processRequest() {
return this;
}
}
private final class UnMapRequestedRegionState implements AsyncRegionState {
@Override
public AsyncRegionState requestMap(final long regionStartPosition) {
return this;
}
@Override
public AsyncRegionState requestUnmap() {
return this;
}
@Override
public AsyncRegionState processRequest() {
ioUnmapper.unmap(fileChannelSupplier.get(), address, length);
address = NULL;
return unmapped;
}
}
}
| [
"terzerm@gmail.com"
] | terzerm@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.