blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bd2f54c1a93903585b2acd5dc251278ab90bfe6f
|
b4bce0209afefea9904098430cd522f114ebde3c
|
/app/src/main/java/com/isysnext/medviewmd/medviewconnect/doctor/DrEditProfilePassword.java
|
ebc61091fffb0d4d4550d2f19c9b38ac40ae6ab1
|
[] |
no_license
|
IsysNextTechnoFuture/MedviewConnect
|
97108b848538756a9b6d61a081dc6b8191ed12e3
|
0b987831538fba25b72be3ac43d5b2aeaf586abe
|
refs/heads/master
| 2020-03-27T16:16:22.240584 | 2018-08-30T15:34:25 | 2018-08-30T15:34:25 | 146,770,585 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 11,464 |
java
|
package com.isysnext.medviewmd.medviewconnect.doctor;
import android.app.ProgressDialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.AppCompatButton;
import android.util.Log;
import android.view.InflateException;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.isysnext.medviewmd.medviewconnect.R;
import com.isysnext.medviewmd.medviewconnect.utils.APIClient;
import com.isysnext.medviewmd.medviewconnect.utils.APIInterface;
import com.isysnext.medviewmd.medviewconnect.utils.AppConstants;
import com.isysnext.medviewmd.medviewconnect.utils.AppSession;
import com.isysnext.medviewmd.medviewconnect.utils.Utilities;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.util.HashMap;
import java.util.Map;
public class DrEditProfilePassword extends Fragment implements AppConstants, View.OnClickListener {
//Declaration of variables
private View parentView;
private Context context;
private Utilities utilities;
private AppSession appSession;
private TextView tvProfile,tvSecurityQuestion;
private EditText etCurrentPassword,etNewPassword, etReTypePassword;
private InputMethodManager mgr;
private AppCompatButton btnChange, btnClose;
private String strCurrentPassword = "", strNewPassword = "", strReTypePassword = "";
APIInterface apiInterface;
ProgressDialog mProgressDialog;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
try {
parentView = inflater.inflate(R.layout.dr_edit_profile_password, container, false);
} catch (InflateException e) {
e.printStackTrace();
}
return parentView;
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
context = getActivity();
utilities = Utilities.getInstance(getActivity());
appSession = new AppSession(context);
initView();
initValues();
}
//Method for initializing view
private void initView() {
tvProfile = (TextView) parentView.findViewById(R.id.tv_profile);
tvProfile.setOnClickListener(this);
tvSecurityQuestion = (TextView) parentView.findViewById(R.id.tv_security_question);
tvSecurityQuestion.setOnClickListener(this);
etCurrentPassword = (EditText) parentView.findViewById(R.id.et_current_password);
etNewPassword = (EditText) parentView.findViewById(R.id.et_new_password);
etReTypePassword = (EditText) parentView.findViewById(R.id.et_retype_password);
btnChange = (AppCompatButton) parentView.findViewById(R.id.btn_change);
btnChange.setOnClickListener(this);
btnClose = (AppCompatButton) parentView.findViewById(R.id.btn_close);
btnClose.setOnClickListener(this);
}
//Method for setting values
private void initValues() {
mgr = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(etCurrentPassword.getWindowToken(), 0);
apiInterface = APIClient.getClient().create(APIInterface.class);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.tv_profile:
showFragment(new DrEditProfileGeneralFragment(),"DrEditProfileGeneral");
break;
case R.id.tv_security_question:
showFragment(new DrEditProfileSecurityFragment(),"DrEditProfileSecurity");
break;
case R.id.btn_change:
getEditTextEnteredValues();
if (isValid()) {
mgr.hideSoftInputFromWindow(etCurrentPassword.getWindowToken(), 0);
callVolleyPassword();
}
break;
case R.id.btn_close:
getActivity().getSupportFragmentManager().popBackStack();
break;
default:
break;
}
}
//Method to validation
public boolean isValid() {
if (strCurrentPassword == null || strCurrentPassword.equals("")) {
utilities.dialogOK(context, getString(R.string.validation_title), getString(R.string.please_enter_password), getString(R.string.ok), false);
etCurrentPassword.requestFocus();
return false;
}
if (strCurrentPassword.length() < 8) {
utilities.dialogOK(context, getString(R.string.validation_title), getString(R.string.please_enter_valid_current_password), getString(R.string.ok), false);
etCurrentPassword.requestFocus();
return false;
}
else if (strNewPassword == null || strNewPassword.equals("")) {
utilities.dialogOK(context, getString(R.string.validation_title), getString(R.string.please_enter_new_password), getString(R.string.ok), false);
etNewPassword.requestFocus();
return false;
}
if (strNewPassword.length() < 8) {
utilities.dialogOK(context, getString(R.string.validation_title), getString(R.string.please_enter_valid_new_password), getString(R.string.ok), false);
etNewPassword.requestFocus();
return false;
}else if (strReTypePassword == null || strReTypePassword.equals("")) {
utilities.dialogOK(context, getString(R.string.validation_title), getString(R.string.please_re_type_password), getString(R.string.ok), false);
etReTypePassword.requestFocus();
return false;
} if (!strReTypePassword.equals(strNewPassword)) {
utilities.dialogOK(context, getString(R.string.validation_title), getString(R.string.new_password_and_retype_password_does_not_match), getString(R.string.ok), false);
etReTypePassword.requestFocus();
return false;
}
return true;
}
//Method for getting values of edit text
private void getEditTextEnteredValues() {
strCurrentPassword = etCurrentPassword.getText().toString().trim();
strNewPassword = etNewPassword.getText().toString().trim();
strReTypePassword = etReTypePassword.getText().toString().trim();
}
//Method for calling volley web service of edit profile password
private void callVolleyPassword() {
if (!utilities.isNetworkAvailable())
utilities.dialogOK(getActivity(), "", getResources().getString(R.string.network_error), getString(R.string.ok), false);
else {
String url =BASE_URL+EDIT_PROFILE_PASSWORD;
mProgressDialog = ProgressDialog.show(context, null, null);
mProgressDialog.setContentView(R.layout.progress_loader);
mProgressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
mProgressDialog.setCancelable(true);
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new com.android.volley.Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.i("TOKAN---------", appSession.getUser().getUinfo().getToken());
Log.i("ResponseA---------", response);
try {
if (mProgressDialog != null && mProgressDialog.isShowing())
mProgressDialog.dismiss();
if (response == null) {
utilities.dialogOK(context, context.getResources().getString(R.string.Whoops), context.getResources().getString(R.string.server_error), context.getString(R.string.ok), false);
} if (response.equals("")) {
utilities.dialogOK(context, getResources().getString(R.string.Whoops),getResources().getString(R.string.server_error), getString(R.string.ok), false);
}
else {
Object object = new JSONTokener(response).nextValue();
if(object instanceof JSONObject) {
JSONObject mJSONObject = new JSONObject(response);
if(mJSONObject.optInt("success")==1)
{
utilities.dialogOK(context, getResources().getString(R.string.Whoops),mJSONObject.optString("message"), getString(R.string.ok), false);
}
else
{
utilities.dialogOK(context, getResources().getString(R.string.Whoops),mJSONObject.optString("message"), getString(R.string.ok), false);
}
}
}
}catch (Exception e) {
e.printStackTrace();
}
}
}, new com.android.volley.Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> params = new HashMap<String, String>();
params.put("current_password",strCurrentPassword);
params.put("new_password",strNewPassword);
Log.i("ServerParameter-------", "" + params);
return params;
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("Authorization", "Bearer " + appSession.getUser().getUinfo().getToken());
Log.i("paramsToken---------", "" + params);
return params;
}
};
//Add the request to the RequestQueue.
Volley.newRequestQueue(context).add(stringRequest);
}
}
//Method for opening fragment
private void showFragment(Fragment targetFragment, String className) {
getActivity().getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, targetFragment, className)
.setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.commit();
}
}
|
[
"[email protected]"
] | |
b1fbd5c9a9caaf1c4a7bb8f41d08f7e91c44dd29
|
581e18f80ce996b16746f9ae2cc275134d2c3e1e
|
/PSTServices/src/th/co/aoe/imake/pst/hibernate/bean/PstRoadPumpType.java
|
f7625730ecf0ce48adb28f7dbd32b0c07ac6f8ca
|
[] |
no_license
|
imakedev/imakedev-pst
|
c663f4b1893682cef40888975fd9e22edb77d582
|
870b1468e551ea9c736fa393829226134b9f2316
|
refs/heads/master
| 2020-05-31T05:40:13.746759 | 2013-12-16T18:04:44 | 2013-12-16T18:04:44 | 39,023,891 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,362 |
java
|
package th.co.aoe.imake.pst.hibernate.bean;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* The persistent class for the PST_ROAD_PUMP_TYPE database table.
*
*/
@Entity
@Table(name="PST_ROAD_PUMP_TYPE",schema="PST_DB")
public class PstRoadPumpType implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="PRPT_ID")
private Long prptId;
@Column(name="PRPT_NAME")
private String prptName;
//bi-directional many-to-one association to PstRoadPump
/*@OneToMany(mappedBy="pstRoadPumpType")
private List<PstRoadPump> pstRoadPumps;*/
public PstRoadPumpType() {
}
public Long getPrptId() {
return this.prptId;
}
public void setPrptId(Long prptId) {
this.prptId = prptId;
}
public String getPrptName() {
return this.prptName;
}
public void setPrptName(String prptName) {
this.prptName = prptName;
}
/*public List<PstRoadPump> getPstRoadPumps() {
return this.pstRoadPumps;
}
public void setPstRoadPumps(List<PstRoadPump> pstRoadPumps) {
this.pstRoadPumps = pstRoadPumps;
}*/
}
|
[
"[email protected]"
] | |
acbb0065252e657fbbc923a13a472be028b54a2e
|
131f14494370c57c241b69875da445fb75af8cd3
|
/src/main/java/fr/univ_poitiers/dptinfo/aaw/mybankweb/web/VirementController.java
|
b313f1e9e736933b789e961b1f4228c5852e05f0
|
[] |
no_license
|
sysyl17/my-bank-web
|
1634315647b3e0454c26cf251ebf189bc7cb1550
|
90cd6c27654f77d3ebfbdd110f2ed55e06c66ee9
|
refs/heads/master
| 2023-05-05T18:16:16.451612 | 2021-05-29T15:58:21 | 2021-05-29T15:58:21 | 368,230,126 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,758 |
java
|
package fr.univ_poitiers.dptinfo.aaw.mybankweb.web;
import fr.univ_poitiers.dptinfo.aaw.mybankweb.model.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping("/api/virement")
public class VirementController {
@Autowired
private VirementRepository virementRepository;
@Autowired
private AccountRepository accountRepository;
@Autowired
private UserRepository userRepository;
@GetMapping
Collection<Virement> getVirements() {
return virementRepository.findAll();
}
/**
* Permet de d'obtenir via la BD la liste des virements recu.
* @param idUser Un identifiant d'utilisateur
* @return Une collection de CompleteAccount qui permet de décrire une ligne de virement pour faciliter l'affichage
* @see CompleteAccount
*/
@GetMapping("/recu/{id}")
Collection<CompleteAccount> getVirementRecu(@PathVariable("id") Integer idUser) {
List<CompleteAccount> all = new ArrayList<>();
List<Virement> virements = virementRepository.findAll();
for (Virement virement : virements) {
Account accVers = accountRepository.findById(virement.getIdCompteVers()).orElseThrow(IllegalArgumentException::new);
if (accVers.getUserId().equals(idUser)) {
CompleteAccount cpAccount = new CompleteAccount();
cpAccount.setId(virement.getId());
cpAccount.setMotif(virement.getMotif());
cpAccount.setMontant(virement.getMontant());
cpAccount.setDate(formatDate(virement.getDate()));
cpAccount.setNomCompteVers(accVers.getName());
cpAccount.setNameUserCompteVers(userRepository.findById(idUser).orElseThrow(IllegalArgumentException::new).getName());
Account accDepuis = accountRepository.findById(virement.getIdCompteDepuis()).orElseThrow(IllegalArgumentException::new);
cpAccount.setNomCompteDepuis(accDepuis.getName());
cpAccount.setNameUserCompteDepuis(userRepository.findById(accDepuis.getUserId()).orElseThrow(IllegalArgumentException::new).getName());
all.add(cpAccount);
}
}
return all;
}
/**
* Permet de d'obtenir via la BD la liste des virements envoyé par le client.
* @param idUser Un identifiant d'utilisateur
* @return Une collection de CompleteAccount qui permet de décrire une ligne de virement pour faciliter l'affichage
* @see CompleteAccount
*/
@GetMapping("/effectue/{id}")
Collection<CompleteAccount> getVirementEffectue(@PathVariable("id") Integer idUser) {
List<CompleteAccount> all = new ArrayList<>();
List<Virement> virements = virementRepository.findAll();
for (Virement virement : virements) {
Account accDepuis = accountRepository.findById(virement.getIdCompteDepuis()).orElseThrow(IllegalArgumentException::new);
if (accDepuis.getUserId().equals(idUser)) {
CompleteAccount cpAccount = new CompleteAccount();
cpAccount.setId(virement.getId());
cpAccount.setMotif(virement.getMotif());
cpAccount.setMontant(virement.getMontant());
cpAccount.setDate(formatDate(virement.getDate()));
cpAccount.setNomCompteDepuis(accDepuis.getName());
cpAccount.setNameUserCompteDepuis(userRepository.findById(accDepuis.getUserId()).orElseThrow(IllegalArgumentException::new).getName());
Account accVers = accountRepository.findById(virement.getIdCompteVers()).orElseThrow(IllegalArgumentException::new);
cpAccount.setNomCompteVers(accVers.getName());
cpAccount.setNameUserCompteVers(userRepository.findById(accVers.getUserId()).orElseThrow(IllegalArgumentException::new).getName());
all.add(cpAccount);
}
}
return all;
}
/**
* Formate une Date sous forme : jj/mm/aa hh:mm .
* @param date La date à formatter
* @return Une date formaté sous forme de String
*/
public String formatDate(Date date){
DateFormat shortDateFormat = DateFormat.getDateTimeInstance(
DateFormat.SHORT,
DateFormat.SHORT);
return shortDateFormat.format(date);
}
}
|
[
"[email protected]"
] | |
78096ce10039f5896f08e05ad35ad365ac3c49ec
|
161ec1a505611bc45cfedce2b8159f1207fe1fda
|
/api/src/main/java/com/xiaohe/mapshow/modules/cloudwaterdeposit/entity/CloudWaterDeposit.java
|
4452a6297ff9742e51314f7b489b5af1b88874a1
|
[] |
no_license
|
HomCatch/mapshow
|
1dc0fc5daea6ed5b56d0b7bc21ae2b3872b2213b
|
522301577e5ad8d0fa2149fa0d339378c763dbe0
|
refs/heads/master
| 2023-01-10T03:25:37.813504 | 2019-08-12T00:32:18 | 2019-08-12T00:32:18 | 200,155,834 | 0 | 1 | null | 2023-01-04T06:06:45 | 2019-08-02T03:08:41 |
TSQL
|
UTF-8
|
Java
| false | false | 4,510 |
java
|
package com.xiaohe.mapshow.modules.cloudwaterdeposit.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* <p>
*
* </p>
*
* @author gmq
* @since 2019-04-19
*/
@Entity
@Table(name="cloud_water_deposit")
@DynamicInsert
@DynamicUpdate
public class CloudWaterDeposit implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Excel(name = "编号")
private Integer id;
/**
* 订单编号
*/
@Excel(name = "订单编号")
private String orderNumber;
/**
* 用户昵称
*/
@Excel(name = "用户昵称")
private String userName;
/**
* 注册手机
*/
@Excel(name = "注册手机")
private String phoneNumber;
/**
* 收货人
*/
@Excel(name = "收货人")
private String receiver;
/**
* 收货地址
*/
@Excel(name = "收货地址")
private String receivAddress;
/**
* 收货手机号
*/
@Excel(name = "收货手机号")
private String receivPhoneNumber;
/**
* 套餐类型
*/
@Excel(name = "套餐类型")
private Integer type;
/**
* 单价
*/
@Excel(name = "单价")
private BigDecimal price;
/**
* 支付方式
*/
@Excel(name = "支付方式")
private Integer payType;
/**
* 押金
*/
@Excel(name = "押金")
private BigDecimal deposit;
/**
* 订单状态
*/
@Excel(name = "订单状态")
private Integer orderType;
/**
* 下单时间
*/
@Excel(name = "下单时间", format = "yyyy-MM-dd HH:mm:ss")
@Temporal(value = TemporalType.TIMESTAMP)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date orderDate;
/**
* 第三方流水号
*/
@Excel(name = "第三方流水号")
private String thirdNumber;
/**
* 设备编号
*/
@Excel(name = "设备编号")
private String deviceId;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
public String getReceivAddress() {
return receivAddress;
}
public void setReceivAddress(String receivAddress) {
this.receivAddress = receivAddress;
}
public String getReceivPhoneNumber() {
return receivPhoneNumber;
}
public void setReceivPhoneNumber(String receivPhoneNumber) {
this.receivPhoneNumber = receivPhoneNumber;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public Integer getPayType() {
return payType;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public BigDecimal getDeposit() {
return deposit;
}
public void setDeposit(BigDecimal deposit) {
this.deposit = deposit;
}
public Integer getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public Date getOrderDate() {
return orderDate;
}
public void setOrderDate(Date orderDate) {
this.orderDate = orderDate;
}
public String getThirdNumber() {
return thirdNumber;
}
public void setThirdNumber(String thirdNumber) {
this.thirdNumber = thirdNumber;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
}
|
[
"[email protected]"
] | |
1cbf8c36b7126e2861758c74125a599d71bddc8e
|
6600a971bb856a37300f08692950c544b352d124
|
/src/main/java/com/capsulewardrobe/services/ItemService.java
|
86a0cb458374124d773d004fa35e0c5ac921efdb
|
[] |
no_license
|
mess3109/capsule
|
ca4d33307a29f5737e63ce438df1d9b215b2f005
|
3557c611d49e2a07c4bb0da2c6761605332e54db
|
refs/heads/master
| 2022-07-17T20:59:07.259565 | 2020-05-10T01:37:02 | 2020-05-10T01:37:02 | 261,635,515 | 0 | 0 | null | 2020-05-10T01:31:32 | 2020-05-06T02:47:16 |
Java
|
UTF-8
|
Java
| false | false | 1,396 |
java
|
package com.capsulewardrobe.services;
import com.capsulewardrobe.exceptions.BadRequestException;
import com.capsulewardrobe.models.Item;
import com.capsulewardrobe.models.ApplicationUser;
import com.capsulewardrobe.repositories.ItemRepository;
import org.springframework.stereotype.Service;
import javax.persistence.EntityNotFoundException;
import static com.capsulewardrobe.services.util.UuidUtility.generateUuid;
@Service
public class ItemService {
private final ItemRepository itemRepository;
private final UserService userService;
public ItemService(ItemRepository itemRepository, UserService userService) {
this.itemRepository = itemRepository;
this.userService = userService;
}
public Item create(String userId, Item item) {
ApplicationUser user = userService.get(userId);
item.setUuid(generateUuid());
item.setUser(user);
return itemRepository.save(item);
}
public Item get(String userId, String itemId) throws BadRequestException {
Item item = itemRepository.findByUuid(itemId).orElseThrow(() -> new EntityNotFoundException("Item not found"));
verifyUser(userId, item);
return item;
}
private void verifyUser(String userId, Item item) throws BadRequestException {
if (!item.getUser().getUuid().equals(userId)) {
throw new BadRequestException("Item " + item + " does not belong to User " + userId);
}
}
}
|
[
"[email protected]"
] | |
8a8ee66dc6552fb01741c68b67900e25a567242d
|
51ba11169469861d4ddccd4b97159b3b61bf5bbf
|
/src/main/java/com/javaex/dao/GalleryDao.java
|
98206489fd2d65c6fd825c97e58b08f83863ef3c
|
[] |
no_license
|
younghotkim/mysite05
|
251a09876b42d0aa1f2119b43fe58c9562bea325
|
67f9aa32d619956393ed4e4e5754eb8d04a7a967
|
refs/heads/master
| 2023-07-29T04:41:12.139840 | 2021-08-20T07:53:21 | 2021-08-20T07:53:21 | 392,353,760 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,095 |
java
|
package com.javaex.dao;
import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.javaex.vo.GalleryVo;
@Repository
public class GalleryDao {
@Autowired
private SqlSession sqlSession;
// 갤러리 저장하기
public int insert(GalleryVo galleryVo) {
System.out.println("GalleryDao/insert");
System.out.println(galleryVo);
return sqlSession.insert("gallery.insert", galleryVo);
}
// 갤러리 리스트
public List<GalleryVo> selectList() {
System.out.println("GalleryDao/selectList");
return sqlSession.selectList("gallery.selectList");
}
// 이미지1개 가져오기
public GalleryVo selectGallery(int no) {
System.out.println("GalleryService/selectGallery");
return sqlSession.selectOne("gallery.select", no);
}
// 갤러리 삭제하기
public int delete(int no) {
System.out.println("GalleryService/deleteGallery");
return sqlSession.delete("gallery.delete", no);
}
}
|
[
"[email protected]"
] | |
1dbbc3ca420a24fbe979685919201f94c1a3e27d
|
4b346cb324e43ea7db506a35d87807c7d1cd2281
|
/src/main/java/com/ECNU/bean/Clock.java
|
23277b0b001ad462d05c36e1f62bc0fa976766e6
|
[] |
no_license
|
bianhan258369/pf-dev
|
f3073ed40e2413add25aad64f92fcb59bd134c31
|
7284444e3b798cc0e16070b58eeda9ee6af46884
|
refs/heads/master
| 2022-02-26T17:11:03.799523 | 2019-10-14T16:06:03 | 2019-10-14T16:06:03 | 201,256,912 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 741 |
java
|
package com.ECNU.bean;
import lombok.Data;
@Data
public class Clock {
private String name;
private String unit;
private int clockType;
public static int PHYSICAL=0;
public static int LOGICAL=1;
private String resolution=null;
private String max=null;
private String offset=null;
private String domainText = null;
private Colour color;
public Clock(String domainText) {
this.name="Default";
this.clockType=PHYSICAL;
this.unit="s";
this.domainText = domainText;
}
public Clock(String name,int type,String unit,String domainText){
this.name=name;
this.clockType=type;
this.unit=unit;
this.domainText = domainText;
}
}
|
[
"[email protected]"
] | |
629f99e113c8e16b6146f0f28ce2a9b73ca1831a
|
b645c760e3a544ca566e0e793122d7ffe2b0644a
|
/fengxin-hengxin-netty/src/main/java/com/fengxin/service/FastDFSService.java
|
755f43165cf97f909ff6d1790265aa680e869f91
|
[] |
no_license
|
a199929abc/Hengxin-Instant-Messaging-App
|
cb09b5660760a7e7df216b15c501707f1a588b4c
|
e6f1a0c9348bc1ed975468d6a465491503cc26a8
|
refs/heads/main
| 2023-07-15T08:50:44.702406 | 2021-08-29T16:31:58 | 2021-08-29T16:31:58 | 344,529,794 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 234 |
java
|
package com.fengxin.service;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
public interface FastDFSService {
public String upload(MultipartFile file) throws Exception;
}
|
[
"[email protected]"
] | |
7cd2e3ad5c5303a3719e42b74f1b90e130214a6c
|
c84a72a539751c5302cf247d2e48b245feae9ced
|
/src/main/java/Consigna/Alquiler.java
|
d556ae3edad24a6007d0c82a3bfad6f8580c2fac
|
[] |
no_license
|
Gnicko/TP-2-Refactoring
|
b9fb25da9862497d96fbbefc044af9f17bbf5e93
|
86910f4fc80335eee3b72779ed157ea6b1044161
|
refs/heads/master
| 2023-04-08T18:04:41.753716 | 2021-04-14T19:19:46 | 2021-04-14T19:19:46 | 358,016,318 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 390 |
java
|
package Consigna;
public class Alquiler {
private CopiaLibro copia;
private int diasAlquilados;
public Alquiler(CopiaLibro copia, int diasAlquilados) {
this.copia = copia;
this.diasAlquilados = diasAlquilados;
}
public int diasAlquilados() {
return this.diasAlquilados;
}
public CopiaLibro copia() {
return this.copia;
}
}
|
[
"[email protected]"
] | |
445e3b08f6df6c1a5d4e569e52b51cac66c2c500
|
768a34eb1cffa664c968e8f3856d203cbe0241a6
|
/JuegoDeMesa/src/Estructuras/LeafNode.java
|
db36aca3ddbbfc025f9e7beda5de0e99cca33750
|
[] |
no_license
|
Daar375/CityPolio
|
8c3bf3f688faa1188a7a34f766be56f1e115a1b8
|
98fefd6b99f7e5ae1474f855f621fe6eb2d79e0f
|
refs/heads/master
| 2021-01-23T14:19:56.199352 | 2017-06-19T00:00:19 | 2017-06-19T00:00:19 | 93,252,535 | 2 | 0 | null | 2017-06-18T09:01:12 | 2017-06-03T14:15:37 |
Java
|
UTF-8
|
Java
| false | false | 2,360 |
java
|
package Estructuras;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
public class LeafNode<Key extends Comparable<Key>, Value> extends TreeNode<Key, Value> {
protected ArrayList<Value> values;
protected LeafNode<Key, Value> nextLeaf;//siguiente hoja
protected LeafNode<Key, Value> previousLeaf;//hoja anterior
//nodo hoja, tiene una llave comparable y el valor de esa llave
public LeafNode(Key firstKey, Value firstValue) {
isLeafNode = true;
keys = new ArrayList<Key>();
values = new ArrayList<Value>();
keys.add(firstKey);
values.add(firstValue);
}
public boolean HasNextLeaf() {//se fija si hay una siguiente hoja en el arbol
if (nextLeaf == null) {
return false;
} else {
return true;
}
}
public ArrayList<Value> getValues() {
return values;
}
public void setValues(ArrayList<Value> values) {
this.values = values;
}
public LeafNode<Key, Value> getNextLeaf() {
return nextLeaf;
}
public void setNextLeaf(LeafNode<Key, Value> nextLeaf) {
this.nextLeaf = nextLeaf;
}
public LeafNode<Key, Value> getPreviousLeaf() {
return previousLeaf;
}
public void setPreviousLeaf(LeafNode<Key, Value> previousLeaf) {
this.previousLeaf = previousLeaf;
}
public LeafNode(List<Key> newKeys, List<Value> newValues) {
isLeafNode = true;
keys = new ArrayList<Key>(newKeys);
values = new ArrayList<Value>(newValues);
}
/**
* insert key/value into this node so that it still remains sorted
*
* @param key
* @param value
*/
public void insertSorted(Key key, Value value) {//inserta un nuevo valor en la hoja
if (key.compareTo(keys.get(0)) < 0) {//lo compara con la primera hoja, si es menor lo inserta de primero
keys.add(0, key);
values.add(0, value);
} else if (key.compareTo(keys.get(keys.size() - 1)) > 0) {//lo compara con la ultima hoja si es mayor lo inserata de ultimo
keys.add(key);
values.add(value);
} else {
ListIterator<Key> iterator = keys.listIterator();
while (iterator.hasNext()) {//va iterando hasta encontrar donde tiene que insertarlo
if (iterator.next().compareTo(key) > 0) {
int position = iterator.previousIndex();
keys.add(position, key);
values.add(position, value);
break;
}
}
}
}
}
|
[
"[email protected]"
] | |
30be98599f8b86c55f1fe32cd93f79e0920f4053
|
8bd4cd295806cb42af7bac6120f376e6a4e4f288
|
/com/google/android/gms/internal/fy.java
|
492e7bd75670c631a2c029fcea33875f47ed9bae
|
[] |
no_license
|
awestlake87/dapath
|
74d95d27854bc75b5d26456621d45eae79d5995b
|
8e83688c9ec6ab9d5b0def17e9dc5b2c6896ea0b
|
refs/heads/master
| 2020-03-13T10:40:49.896330 | 2018-04-26T02:22:12 | 2018-04-26T02:22:12 | 131,088,145 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,851 |
java
|
package com.google.android.gms.internal;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.net.Uri.Builder;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import com.google.android.gms.appindexing.AppIndexApi;
import com.google.android.gms.appindexing.AppIndexApi.AppIndexingLink;
import com.google.android.gms.common.api.C0153a.C0152d;
import com.google.android.gms.common.api.C0153a.C1002b;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.Result;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.internal.ft.C0731a;
import java.util.List;
public final class fy implements AppIndexApi, ft {
private static abstract class C0736a<T> implements Result {
protected final T yA;
private final Status yz;
public C0736a(Status status, T t) {
this.yz = status;
this.yA = t;
}
public Status getStatus() {
return this.yz;
}
}
static class C1085b extends C0736a<ParcelFileDescriptor> implements C0731a {
public C1085b(Status status, ParcelFileDescriptor parcelFileDescriptor) {
super(status, parcelFileDescriptor);
}
}
private static abstract class C1177c<T extends Result> extends C1002b<T, fx> {
public C1177c() {
super(ff.xI);
}
protected abstract void mo3152a(fu fuVar) throws RemoteException;
protected final void m4059a(fx fxVar) throws RemoteException {
mo3152a(fxVar.dR());
}
}
private static final class C1178e extends fw<Status> {
public C1178e(C0152d<Status> c0152d) {
super(c0152d);
}
public void mo1703a(Status status) {
this.yu.mo911a(status);
}
}
class C12371 extends C1177c<C0731a> {
protected void mo3152a(fu fuVar) throws RemoteException {
fuVar.mo1699a(new fw<C0731a>(this, this) {
final /* synthetic */ C12371 yv;
public void mo1704a(Status status, ParcelFileDescriptor parcelFileDescriptor) {
this.yu.mo911a(new C1085b(status, parcelFileDescriptor));
}
});
}
public C0731a m4246b(Status status) {
return new C1085b(status, null);
}
public /* synthetic */ Result mo2535c(Status status) {
return m4246b(status);
}
}
private static abstract class C1238d<T extends Result> extends C1177c<Status> {
private C1238d() {
}
protected /* synthetic */ Result mo2535c(Status status) {
return m4249d(status);
}
protected Status m4249d(Status status) {
return status;
}
}
static Uri m2595a(String str, Uri uri) {
if (!"android-app".equals(uri.getScheme())) {
throw new IllegalArgumentException("Uri scheme must be android-app: " + uri);
} else if (str.equals(uri.getHost())) {
List pathSegments = uri.getPathSegments();
if (pathSegments.isEmpty() || ((String) pathSegments.get(0)).isEmpty()) {
throw new IllegalArgumentException("Uri path must exist: " + uri);
}
String str2 = (String) pathSegments.get(0);
Builder builder = new Builder();
builder.scheme(str2);
if (pathSegments.size() > 1) {
builder.authority((String) pathSegments.get(1));
for (int i = 2; i < pathSegments.size(); i++) {
builder.appendPath((String) pathSegments.get(i));
}
}
builder.encodedQuery(uri.getEncodedQuery());
builder.encodedFragment(uri.getEncodedFragment());
return builder.build();
} else {
throw new IllegalArgumentException("Uri host must match package name: " + uri);
}
}
public PendingResult<Status> m2596a(GoogleApiClient googleApiClient, final fr... frVarArr) {
final String packageName = ((fx) googleApiClient.mo925a(ff.xI)).getContext().getPackageName();
return googleApiClient.mo926a(new C1238d<Status>(this) {
final /* synthetic */ fy yy;
protected void mo3152a(fu fuVar) throws RemoteException {
fuVar.mo1700a(new C1178e(this), packageName, frVarArr);
}
});
}
public PendingResult<Status> view(GoogleApiClient apiClient, Activity activity, Intent viewIntent, String title, Uri webUrl, List<AppIndexingLink> outLinks) {
return m2596a(apiClient, new fr(((fx) apiClient.mo925a(ff.xI)).getContext().getPackageName(), viewIntent, title, webUrl, null, (List) outLinks));
}
public PendingResult<Status> view(GoogleApiClient apiClient, Activity activity, Uri appIndexingUrl, String title, Uri webUrl, List<AppIndexingLink> outLinks) {
return view(apiClient, activity, new Intent("android.intent.action.VIEW", m2595a(((fx) apiClient.mo925a(ff.xI)).getContext().getPackageName(), appIndexingUrl)), title, webUrl, (List) outLinks);
}
public PendingResult<Status> viewEnd(GoogleApiClient apiClient, Activity activity, Intent viewIntent) {
fr frVar = new fr(fr.m2581a(((fx) apiClient.mo925a(ff.xI)).getContext().getPackageName(), viewIntent), System.currentTimeMillis(), 3);
return m2596a(apiClient, frVar);
}
public PendingResult<Status> viewEnd(GoogleApiClient apiClient, Activity activity, Uri appIndexingUrl) {
return viewEnd(apiClient, activity, new Intent("android.intent.action.VIEW", m2595a(((fx) apiClient.mo925a(ff.xI)).getContext().getPackageName(), appIndexingUrl)));
}
}
|
[
"[email protected]"
] | |
eb93e7ef4e660f8d46ec69c8eb07cb52f6c461a2
|
0c591fb0a14df2967639ecdd091c41ca58ccc4b4
|
/com/tado/android/entities/Installation.java
|
8d453b4364372617d3950758a43551f5a5527f13
|
[] |
no_license
|
AleksandrinaKrumova2/Tado
|
8dfa355c0287ba630f175fbae84a033df0a4cfe6
|
19fdac6c4b04edf26360298bd8be43b240a1b605
|
refs/heads/master
| 2020-03-07T22:49:32.201011 | 2018-04-12T13:26:47 | 2018-04-12T13:26:47 | 127,763,263 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,423 |
java
|
package com.tado.android.entities;
public class Installation {
private Device[] devices;
private ServerError[] errors;
private InstallationStatus installationProcess;
private Manufacturer manufacturer;
private ACSettingCommandSetRecording recording;
public ACSettingCommandSetRecording getRecording() {
return this.recording;
}
public void setRecording(ACSettingCommandSetRecording recording) {
this.recording = recording;
}
public Installation(InstallationStatus installationProcess, Device[] devices) {
this.installationProcess = installationProcess;
this.devices = devices;
}
public InstallationStatus getInstallationProcess() {
return this.installationProcess;
}
public void setInstallationProcess(InstallationStatus installationProcess) {
this.installationProcess = installationProcess;
}
public Device[] getDevices() {
return this.devices;
}
public void setDevices(Device[] devices) {
this.devices = devices;
}
public ServerError[] getErrors() {
return this.errors;
}
public void setErrors(ServerError[] errors) {
this.errors = errors;
}
public Manufacturer getManufacturer() {
return this.manufacturer;
}
public void setManufacturer(Manufacturer manufacturer) {
this.manufacturer = manufacturer;
}
}
|
[
"[email protected]"
] | |
66dcf1b89e498968ac1780e5d680ddeab7ecc5b0
|
3a5082bd5d3e70a8f22649cb922826cf41231534
|
/src/main/java/org/folio/validate/value/format/EmailFormatValidator.java
|
c9111208b74b397ce8b70227fb7ccdee532f82b6
|
[
"Apache-2.0"
] |
permissive
|
folio-org/mod-custom-fields
|
5be501865e8e3a8432aea144adb2fbc6993aa118
|
626b37e5f8f18c4ed4029952dbe2d5cb261b3978
|
refs/heads/master
| 2021-07-16T05:35:17.081220 | 2020-07-23T10:47:35 | 2020-07-23T10:47:35 | 202,516,700 | 0 | 2 |
Apache-2.0
| 2020-08-20T09:46:41 | 2019-08-15T09:50:50 |
Java
|
UTF-8
|
Java
| false | false | 521 |
java
|
package org.folio.validate.value.format;
import org.apache.commons.validator.routines.EmailValidator;
public class EmailFormatValidator implements FormatValidator {
private static final String INVALID_FORMAT_MESSAGE = "Invalid Email format: %s";
private static final EmailValidator VALIDATOR = EmailValidator.getInstance();
@Override
public void validate(String value) {
if (!VALIDATOR.isValid(value)) {
throw new IllegalArgumentException(String.format(INVALID_FORMAT_MESSAGE, value));
}
}
}
|
[
"[email protected]"
] | |
6b3d81a249ca1e71963ba10b2192a5573062e200
|
2f75b2efa062c750a7656d746635694235b6c76b
|
/ohgre-wsclientbundle/src/main/java/com/primesw/webservices/GetQuotes.java
|
78f7f168c8e39082eb5f862cd19a78467edd9806
|
[] |
no_license
|
rjammalamadaka/ohgre
|
d64b1a66048aa6c05fa478c7386f4b9b6cfc2132
|
2755c9dc736f0161703e3891f14d55a3c6564509
|
refs/heads/master
| 2020-03-23T22:50:08.535535 | 2018-07-23T13:45:51 | 2018-07-23T13:45:51 | 142,200,555 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,635 |
java
|
package com.primesw.webservices;
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 org.tempuri.quoteservice.QuoteRequest;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://tempuri.org/QuoteService.xsd}QuoteRequest" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"quoteRequest"
})
@XmlRootElement(name = "GetQuotes")
public class GetQuotes {
@XmlElement(name = "QuoteRequest", namespace = "http://tempuri.org/QuoteService.xsd")
protected QuoteRequest quoteRequest;
/**
* Gets the value of the quoteRequest property.
*
* @return
* possible object is
* {@link QuoteRequest }
*
*/
public QuoteRequest getQuoteRequest() {
return quoteRequest;
}
/**
* Sets the value of the quoteRequest property.
*
* @param value
* allowed object is
* {@link QuoteRequest }
*
*/
public void setQuoteRequest(QuoteRequest value) {
this.quoteRequest = value;
}
}
|
[
"[email protected]"
] | |
755ac5896672c43c1e64583880c1dc1a70a048ce
|
f29b99b8c3d9d6f6d4d191716e9b78ec0be16b54
|
/app/src/main/java/com/hfad/ad3lesson2/data/remote/EndPoints.java
|
804dd2145317d3e32a8163d867762255797cd088
|
[] |
no_license
|
CyberN0mad/A3-HW2
|
a00d210cb9299d70df32258e2948939acc9253f5
|
fe2e4de47e8ce4cc450b2f81f168c3311ccd017a
|
refs/heads/master
| 2023-03-16T18:13:36.435004 | 2021-03-04T17:47:40 | 2021-03-04T17:47:40 | 344,563,264 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 316 |
java
|
package com.hfad.ad3lesson2.data.remote;
public class EndPoints {
public static final String END_POINTS = "films";
public static final String END_POINTS_ID = "films/{id}";
public static final String END_POINTS_PEOPLE = "people";
public static final String END_POINTS_PEOPLE_BY_ID = "people/{id}";
}
|
[
"[email protected]"
] | |
07b059abae723bf85a35e6f6a19bdac717dd6a88
|
4b7337fd69e9a6d4cf91ae31d3cc593d16a613b6
|
/CloudCrawlerCore/src/br/mia/unifor/crawler/executer/artifact/VirtualMachineType.java
|
2aa0057880737a9ddc732962c62309fa6d8a90a0
|
[] |
no_license
|
cmendesce/crawler
|
3d9ae3fff3465f1bc5c1b696f233437e537e9a5b
|
9cc0d81011efa3dcf136ef82d3db919db809593f
|
refs/heads/master
| 2021-01-19T07:02:07.895160 | 2016-04-16T16:28:04 | 2016-04-16T16:28:04 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 755 |
java
|
package br.mia.unifor.crawler.executer.artifact;
public class VirtualMachineType extends CrawlerArtifact{
private Integer cpu;
private Integer ram;
private String providerProfile;
private Provider provider;
public Integer getCpu() {
return cpu;
}
public void setCpu(Integer cpu) {
this.cpu = cpu;
}
public Integer getRam() {
return ram;
}
public void setRam(Integer ram) {
this.ram = ram;
}
public String getProviderProfile() {
return providerProfile;
}
public void setproviderProfile(String providerProfile) {
this.providerProfile = providerProfile;
}
public void setProvider(Provider provider) {
this.provider = provider;
}
public Provider getProvider() {
return provider;
}
}
|
[
"vagrant@precise64.(none)"
] |
vagrant@precise64.(none)
|
71b7a6e78fd1502442e23b4e0aa6657279e10c7c
|
a49931ff6cde8806bb48ec0e6c342cf8ad53c076
|
/myHFV2/src/test/java/com/org/myHFV2/FrameworkLib.java
|
8af60caa317fe8c271114de5736e95af89975b3d
|
[] |
no_license
|
AssuranceTech/myHFV2
|
472254fbb2e17db7bdcd820f06360a5948121396
|
81a1a9b5970856512d1bf801b4c572e091adc9fa
|
refs/heads/master
| 2020-12-03T02:18:52.453508 | 2017-07-09T20:47:27 | 2017-07-09T20:47:27 | 95,927,848 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,867 |
java
|
package com.org.myHFV2;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Iterator;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.openqa.selenium.WebDriver;
public class FrameworkLib {
public static void BrowseTests(WebDriver driver) throws IOException {
String excelFilePath = "C://Users//asyedzia//workspace//myHybridFramework-V2//myDatanKeyWordFile.xlsx";
String flowName, testData1, testData2;
FileInputStream inputStream = new FileInputStream(new File(excelFilePath));
Workbook workbook = new XSSFWorkbook(inputStream);
Sheet firstSheet = workbook.getSheetAt(0);
Iterator<Row> iterator = firstSheet.iterator();
while (iterator.hasNext()) {
Row nextRow = iterator.next();
Iterator<Cell> cellIterator = nextRow.cellIterator();
while (cellIterator.hasNext()) {
// Read Flow Name
Cell cell = cellIterator.next();
flowName = cell.getStringCellValue();
// Read Test Data 1
cell = cellIterator.next();
testData1 = cell.getStringCellValue();
// Read Test Data 2
cell = cellIterator.next();
testData2 = cell.getStringCellValue();
//Execute Test
MyAppFuncLib.executeFlow(driver, flowName, testData1, testData2);
break;
}
System.out.println("Next Row");
}
workbook.close();
inputStream.close();
}
}
|
[
"[email protected]"
] | |
e7f228f574e28382c7d3255b7a33411709ea8717
|
1c205e9e3a91cdb4d8e70fba8ad9435d7cce3a0d
|
/gmall-sms/src/main/java/com/atguigu/gmall/sms/controller/SeckillSkuNoticeController.java
|
713f0d048db9b2ff6e1b745d4456fb6f6a6488ac
|
[
"Apache-2.0"
] |
permissive
|
493874980/gmail-hanking
|
edd09bfaccd65f61d35d3523e4af6f785003fa8f
|
9b093d6a5fddeccd4a4b2e4cd43d865fa87d9f5d
|
refs/heads/master
| 2022-07-26T22:28:50.585159 | 2020-02-20T17:52:49 | 2020-02-20T17:52:49 | 240,445,245 | 0 | 0 |
Apache-2.0
| 2022-07-06T20:47:48 | 2020-02-14T06:44:20 |
JavaScript
|
UTF-8
|
Java
| false | false | 2,579 |
java
|
package com.atguigu.gmall.sms.controller;
import java.util.Arrays;
import java.util.Map;
import com.atguigu.core.bean.PageVo;
import com.atguigu.core.bean.QueryCondition;
import com.atguigu.core.bean.Resp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.atguigu.gmall.sms.entity.SeckillSkuNoticeEntity;
import com.atguigu.gmall.sms.service.SeckillSkuNoticeService;
/**
* 秒杀商品通知订阅
*
* @author wxl
* @email [email protected]
* @date 2020-02-21 01:04:18
*/
@Api(tags = "秒杀商品通知订阅 管理")
@RestController
@RequestMapping("sms/seckillskunotice")
public class SeckillSkuNoticeController {
@Autowired
private SeckillSkuNoticeService seckillSkuNoticeService;
/**
* 列表
*/
@ApiOperation("分页查询(排序)")
@GetMapping("/list")
@PreAuthorize("hasAuthority('sms:seckillskunotice:list')")
public Resp<PageVo> list(QueryCondition queryCondition) {
PageVo page = seckillSkuNoticeService.queryPage(queryCondition);
return Resp.ok(page);
}
/**
* 信息
*/
@ApiOperation("详情查询")
@GetMapping("/info/{id}")
@PreAuthorize("hasAuthority('sms:seckillskunotice:info')")
public Resp<SeckillSkuNoticeEntity> info(@PathVariable("id") Long id){
SeckillSkuNoticeEntity seckillSkuNotice = seckillSkuNoticeService.getById(id);
return Resp.ok(seckillSkuNotice);
}
/**
* 保存
*/
@ApiOperation("保存")
@PostMapping("/save")
@PreAuthorize("hasAuthority('sms:seckillskunotice:save')")
public Resp<Object> save(@RequestBody SeckillSkuNoticeEntity seckillSkuNotice){
seckillSkuNoticeService.save(seckillSkuNotice);
return Resp.ok(null);
}
/**
* 修改
*/
@ApiOperation("修改")
@PostMapping("/update")
@PreAuthorize("hasAuthority('sms:seckillskunotice:update')")
public Resp<Object> update(@RequestBody SeckillSkuNoticeEntity seckillSkuNotice){
seckillSkuNoticeService.updateById(seckillSkuNotice);
return Resp.ok(null);
}
/**
* 删除
*/
@ApiOperation("删除")
@PostMapping("/delete")
@PreAuthorize("hasAuthority('sms:seckillskunotice:delete')")
public Resp<Object> delete(@RequestBody Long[] ids){
seckillSkuNoticeService.removeByIds(Arrays.asList(ids));
return Resp.ok(null);
}
}
|
[
"[email protected]"
] | |
edf58de93f9c0305102a6d15b79b47d2929d308f
|
b029f2394001cdd85aef3f4220862ce78a7e4d3a
|
/app/src/main/java/com/example/beeradviser/MyView.java
|
68e0e8fbc7c2f0e2ee66d05648c8bd3fe4fce13f
|
[] |
no_license
|
ZhenyaCrimson/BeerAdviser
|
80bab1149aa0261f7ed6e2a70c91e81592d1bde7
|
b284c360cd16d8c7bbaf4da2a0a84bd38f55cbb4
|
refs/heads/master
| 2022-12-30T01:21:52.130636 | 2020-10-12T11:07:17 | 2020-10-12T11:07:17 | 303,365,035 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,994 |
java
|
package com.example.beeradviser;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.view.View;
/**
* TODO: document your custom view class.
*/
public class MyView extends View {
private String mExampleString; // TODO: use a default from R.string...
private int mExampleColor = Color.RED; // TODO: use a default from R.color...
private float mExampleDimension = 0; // TODO: use a default from R.dimen...
private Drawable mExampleDrawable;
private TextPaint mTextPaint;
private float mTextWidth;
private float mTextHeight;
public MyView(Context context) {
super(context);
init(null, 0);
}
public MyView(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs, 0);
}
public MyView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(attrs, defStyle);
}
private void init(AttributeSet attrs, int defStyle) {
// Load attributes
final TypedArray a = getContext().obtainStyledAttributes(
attrs, R.styleable.MyView, defStyle, 0);
mExampleString = a.getString(
R.styleable.MyView_exampleString);
mExampleColor = a.getColor(
R.styleable.MyView_exampleColor,
mExampleColor);
// Use getDimensionPixelSize or getDimensionPixelOffset when dealing with
// values that should fall on pixel boundaries.
mExampleDimension = a.getDimension(
R.styleable.MyView_exampleDimension,
mExampleDimension);
if (a.hasValue(R.styleable.MyView_exampleDrawable)) {
mExampleDrawable = a.getDrawable(
R.styleable.MyView_exampleDrawable);
mExampleDrawable.setCallback(this);
}
a.recycle();
// Set up a default TextPaint object
mTextPaint = new TextPaint();
mTextPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
mTextPaint.setTextAlign(Paint.Align.LEFT);
// Update TextPaint and text measurements from attributes
invalidateTextPaintAndMeasurements();
}
private void invalidateTextPaintAndMeasurements() {
mTextPaint.setTextSize(mExampleDimension);
mTextPaint.setColor(mExampleColor);
mTextWidth = mTextPaint.measureText(mExampleString);
Paint.FontMetrics fontMetrics = mTextPaint.getFontMetrics();
mTextHeight = fontMetrics.bottom;
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// TODO: consider storing these as member variables to reduce
// allocations per draw cycle.
int paddingLeft = getPaddingLeft();
int paddingTop = getPaddingTop();
int paddingRight = getPaddingRight();
int paddingBottom = getPaddingBottom();
int contentWidth = getWidth() - paddingLeft - paddingRight;
int contentHeight = getHeight() - paddingTop - paddingBottom;
// Draw the text.
canvas.drawText(mExampleString,
paddingLeft + (contentWidth - mTextWidth) / 2,
paddingTop + (contentHeight + mTextHeight) / 2,
mTextPaint);
// Draw the example drawable on top of the text.
if (mExampleDrawable != null) {
mExampleDrawable.setBounds(paddingLeft, paddingTop,
paddingLeft + contentWidth, paddingTop + contentHeight);
mExampleDrawable.draw(canvas);
}
}
/**
* Gets the example string attribute value.
*
* @return The example string attribute value.
*/
public String getExampleString() {
return mExampleString;
}
/**
* Sets the view's example string attribute value. In the example view, this string
* is the text to draw.
*
* @param exampleString The example string attribute value to use.
*/
public void setExampleString(String exampleString) {
mExampleString = exampleString;
invalidateTextPaintAndMeasurements();
}
/**
* Gets the example color attribute value.
*
* @return The example color attribute value.
*/
public int getExampleColor() {
return mExampleColor;
}
/**
* Sets the view's example color attribute value. In the example view, this color
* is the font color.
*
* @param exampleColor The example color attribute value to use.
*/
public void setExampleColor(int exampleColor) {
mExampleColor = exampleColor;
invalidateTextPaintAndMeasurements();
}
/**
* Gets the example dimension attribute value.
*
* @return The example dimension attribute value.
*/
public float getExampleDimension() {
return mExampleDimension;
}
/**
* Sets the view's example dimension attribute value. In the example view, this dimension
* is the font size.
*
* @param exampleDimension The example dimension attribute value to use.
*/
public void setExampleDimension(float exampleDimension) {
mExampleDimension = exampleDimension;
invalidateTextPaintAndMeasurements();
}
/**
* Gets the example drawable attribute value.
*
* @return The example drawable attribute value.
*/
public Drawable getExampleDrawable() {
return mExampleDrawable;
}
/**
* Sets the view's example drawable attribute value. In the example view, this drawable is
* drawn above the text.
*
* @param exampleDrawable The example drawable attribute value to use.
*/
public void setExampleDrawable(Drawable exampleDrawable) {
mExampleDrawable = exampleDrawable;
}
}
|
[
"[email protected]"
] | |
c0dacc2a70099553b5cd801fa95b39a81f2b7e25
|
aeceebd88c27c3d9a692b39b3fd970c63fc1c9c8
|
/day_19/src/tje/component2/ToolTipEx.java
|
f014d910c72c921f56ff17e7d3fcd7b31c59c9a7
|
[] |
no_license
|
shsewonitw/study_Java
|
15a5a6dc0f80e021536749a08eface4f7995866a
|
cea49b84b209c8b2e8220b270f2db8bf25df88e2
|
refs/heads/master
| 2020-06-13T21:59:37.627150 | 2019-07-02T06:25:15 | 2019-07-02T06:25:15 | 194,801,164 | 0 | 0 | null | null | null | null |
UHC
|
Java
| false | false | 1,105 |
java
|
package tje.component2;
import javax.swing.*;
import java.awt.*;
public class ToolTipEx extends JFrame {
Container contentPane;
ToolTipEx() {
setTitle("툴팁 예제");
setDefaultCloseOperation(EXIT_ON_CLOSE);
contentPane = getContentPane();
createToolBar();
setSize(400,200);
setVisible(true);
}
void createToolBar() {
JToolBar bar = new JToolBar("seokwoo Menu");
bar.setBackground(Color.LIGHT_GRAY);
JButton newBtn = new JButton("New");
newBtn.setToolTipText("파일을 생성합니다.");
bar.add(newBtn);
JButton openBtn = new JButton(new ImageIcon("open.jpg"));
openBtn.setToolTipText("파일을 엽니다.");
bar.add(openBtn);
bar.addSeparator();
JButton saveBtn = new JButton("save.jpg");
saveBtn.setToolTipText("파일을 저장합니다.");
bar.add(saveBtn);
bar.add(new JLabel("search"));
JTextField tf = new JTextField("text field");
tf.setToolTipText("찾고자하는 문자열을 입력하세요");
bar.add(tf);
contentPane.add(bar,BorderLayout.NORTH);
}
public static void main(String[] args) {
new ToolTipEx();
}
}
|
[
"[email protected]"
] | |
4953f2584504f9e353ea659ed34f0128347332ad
|
7348ffd6891e9156150c6219e39ec90eb2a09299
|
/red5-parent-1.0.7-RELEASE/red5/src/main/java/org/liveshow/entity/TeahRecorExample.java
|
9bff20fead2dea68d7691b561c31481ddaec3af8
|
[
"Apache-2.0"
] |
permissive
|
Tralyor/liveShowV2
|
af8892a307e5afa6b6f5d3fc7384e664e3d72319
|
702c9195238e4059655a83b82aa9fcb5589a320b
|
refs/heads/master
| 2022-12-21T06:32:00.901024 | 2019-05-31T08:00:35 | 2019-05-31T08:00:35 | 179,617,928 | 1 | 0 | null | 2022-12-10T02:36:33 | 2019-04-05T04:17:00 |
Java
|
UTF-8
|
Java
| false | false | 15,803 |
java
|
package org.liveshow.entity;
import java.util.ArrayList;
import java.util.List;
public class TeahRecorExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TeahRecorExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andClassIdIsNull() {
addCriterion("class_id is null");
return (Criteria) this;
}
public Criteria andClassIdIsNotNull() {
addCriterion("class_id is not null");
return (Criteria) this;
}
public Criteria andClassIdEqualTo(Integer value) {
addCriterion("class_id =", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotEqualTo(Integer value) {
addCriterion("class_id <>", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdGreaterThan(Integer value) {
addCriterion("class_id >", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdGreaterThanOrEqualTo(Integer value) {
addCriterion("class_id >=", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdLessThan(Integer value) {
addCriterion("class_id <", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdLessThanOrEqualTo(Integer value) {
addCriterion("class_id <=", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdIn(List<Integer> values) {
addCriterion("class_id in", values, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotIn(List<Integer> values) {
addCriterion("class_id not in", values, "classId");
return (Criteria) this;
}
public Criteria andClassIdBetween(Integer value1, Integer value2) {
addCriterion("class_id between", value1, value2, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotBetween(Integer value1, Integer value2) {
addCriterion("class_id not between", value1, value2, "classId");
return (Criteria) this;
}
public Criteria andGmtStartIsNull() {
addCriterion("gmt_start is null");
return (Criteria) this;
}
public Criteria andGmtStartIsNotNull() {
addCriterion("gmt_start is not null");
return (Criteria) this;
}
public Criteria andGmtStartEqualTo(String value) {
addCriterion("gmt_start =", value, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartNotEqualTo(String value) {
addCriterion("gmt_start <>", value, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartGreaterThan(String value) {
addCriterion("gmt_start >", value, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartGreaterThanOrEqualTo(String value) {
addCriterion("gmt_start >=", value, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartLessThan(String value) {
addCriterion("gmt_start <", value, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartLessThanOrEqualTo(String value) {
addCriterion("gmt_start <=", value, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartLike(String value) {
addCriterion("gmt_start like", value, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartNotLike(String value) {
addCriterion("gmt_start not like", value, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartIn(List<String> values) {
addCriterion("gmt_start in", values, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartNotIn(List<String> values) {
addCriterion("gmt_start not in", values, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartBetween(String value1, String value2) {
addCriterion("gmt_start between", value1, value2, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtStartNotBetween(String value1, String value2) {
addCriterion("gmt_start not between", value1, value2, "gmtStart");
return (Criteria) this;
}
public Criteria andGmtEndIsNull() {
addCriterion("gmt_end is null");
return (Criteria) this;
}
public Criteria andGmtEndIsNotNull() {
addCriterion("gmt_end is not null");
return (Criteria) this;
}
public Criteria andGmtEndEqualTo(String value) {
addCriterion("gmt_end =", value, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndNotEqualTo(String value) {
addCriterion("gmt_end <>", value, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndGreaterThan(String value) {
addCriterion("gmt_end >", value, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndGreaterThanOrEqualTo(String value) {
addCriterion("gmt_end >=", value, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndLessThan(String value) {
addCriterion("gmt_end <", value, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndLessThanOrEqualTo(String value) {
addCriterion("gmt_end <=", value, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndLike(String value) {
addCriterion("gmt_end like", value, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndNotLike(String value) {
addCriterion("gmt_end not like", value, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndIn(List<String> values) {
addCriterion("gmt_end in", values, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndNotIn(List<String> values) {
addCriterion("gmt_end not in", values, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndBetween(String value1, String value2) {
addCriterion("gmt_end between", value1, value2, "gmtEnd");
return (Criteria) this;
}
public Criteria andGmtEndNotBetween(String value1, String value2) {
addCriterion("gmt_end not between", value1, value2, "gmtEnd");
return (Criteria) this;
}
public Criteria andClassNumIsNull() {
addCriterion("class_num is null");
return (Criteria) this;
}
public Criteria andClassNumIsNotNull() {
addCriterion("class_num is not null");
return (Criteria) this;
}
public Criteria andClassNumEqualTo(Integer value) {
addCriterion("class_num =", value, "classNum");
return (Criteria) this;
}
public Criteria andClassNumNotEqualTo(Integer value) {
addCriterion("class_num <>", value, "classNum");
return (Criteria) this;
}
public Criteria andClassNumGreaterThan(Integer value) {
addCriterion("class_num >", value, "classNum");
return (Criteria) this;
}
public Criteria andClassNumGreaterThanOrEqualTo(Integer value) {
addCriterion("class_num >=", value, "classNum");
return (Criteria) this;
}
public Criteria andClassNumLessThan(Integer value) {
addCriterion("class_num <", value, "classNum");
return (Criteria) this;
}
public Criteria andClassNumLessThanOrEqualTo(Integer value) {
addCriterion("class_num <=", value, "classNum");
return (Criteria) this;
}
public Criteria andClassNumIn(List<Integer> values) {
addCriterion("class_num in", values, "classNum");
return (Criteria) this;
}
public Criteria andClassNumNotIn(List<Integer> values) {
addCriterion("class_num not in", values, "classNum");
return (Criteria) this;
}
public Criteria andClassNumBetween(Integer value1, Integer value2) {
addCriterion("class_num between", value1, value2, "classNum");
return (Criteria) this;
}
public Criteria andClassNumNotBetween(Integer value1, Integer value2) {
addCriterion("class_num not between", value1, value2, "classNum");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
|
[
"[email protected]"
] | |
7fa7dff42e20d4cabd39eb50dcd1fbda3bebccf5
|
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
|
/Fantastle5/src/net/worldwizard/fantastle5/objects/NPlug.java
|
861025a3a40922508ed177a86839736882b03bec
|
[
"Unlicense"
] |
permissive
|
retropipes/older-java-games
|
777574e222f30a1dffe7936ed08c8bfeb23a21ba
|
786b0c165d800c49ab9977a34ec17286797c4589
|
refs/heads/master
| 2023-04-12T14:28:25.525259 | 2021-05-15T13:03:54 | 2021-05-15T13:03:54 | 235,693,016 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 986 |
java
|
/* Fantastle: A Maze-Solving Game
Copyright (C) 2008-2010 Eric Ahnell
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/>.
Any questions should be directed to the author via email at: [email protected]
*/
package net.worldwizard.fantastle5.objects;
import net.worldwizard.fantastle5.generic.GenericPlug;
public class NPlug extends GenericPlug {
// Constructors
public NPlug() {
super('N');
}
}
|
[
"[email protected]"
] | |
a6bf504a5f825b2dac9a096ebd63302d940fb441
|
b75cc09bda54e7b50aeb66770195cdc541f68314
|
/booting-server/src/main/java/com/booting/order/dto/OrderDetailDTO.java
|
80442db981219e9c72dd1e10f391beae37649bc2
|
[] |
no_license
|
284288787/px
|
46de9f5c57daaaee2084ca350065910e8164c053
|
f78f88c6c076ef1861e6adf2ace1322c8e271abb
|
refs/heads/master
| 2022-11-22T04:29:55.019609 | 2020-08-27T09:42:14 | 2020-08-27T09:42:14 | 161,508,370 | 0 | 0 | null | 2022-11-16T06:28:23 | 2018-12-12T15:34:49 |
JavaScript
|
UTF-8
|
Java
| false | false | 1,733 |
java
|
/**create by liuhua at 2017年7月13日 下午2:21:40**/
package com.booting.order.dto;
import java.io.Serializable;
import com.star.framework.aop.annotation.Description;
@Description(name = "订单详情")
public class OrderDetailDTO implements Serializable {
private static final long serialVersionUID = -8730327166078371217L;
private Long id;
private Long orderId;
private Long productId; //购买的产品
private Integer productType; //产品的类型 1套餐 2场地 3优惠券
private String productName; //产品的名称
private Integer price; //单价:实际金额*100
private Integer quantity; //购买的数量
private Integer amount; //总价:单价*数量
public Long getId() {
return id;
}
public Long getOrderId() {
return orderId;
}
public Long getProductId() {
return productId;
}
public Integer getProductType() {
return productType;
}
public String getProductName() {
return productName;
}
public Integer getPrice() {
return price;
}
public Integer getQuantity() {
return quantity;
}
public Integer getAmount() {
return amount;
}
public void setId(Long id) {
this.id = id;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public void setProductType(Integer productType) {
this.productType = productType;
}
public void setProductName(String productName) {
this.productName = productName;
}
public void setPrice(Integer price) {
this.price = price;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public void setAmount(Integer amount) {
this.amount = amount;
}
}
|
[
"[email protected]"
] | |
36bcc30d20f9c43e9a90966fcab6005e0f412d3b
|
feea95498c2e939c3be4bc40e0404326c2471f8e
|
/src/main/java/com/examples/joined_table/Start.java
|
fba7ef401e64e86fb897507012baf3bb87ba2e9f
|
[] |
no_license
|
PavelKorchevskiy/hibernate_examples
|
7581bcc7050b2e4e18cf0b5a9bb46a3c5a894066
|
3fd320dfab275d24680c78827bf16dc20f65e04f
|
refs/heads/master
| 2023-03-11T19:55:00.797162 | 2021-02-25T08:41:20 | 2021-02-25T08:41:20 | 342,176,146 | 0 | 0 | null | 2021-02-27T10:53:48 | 2021-02-25T08:35:36 |
Java
|
UTF-8
|
Java
| false | false | 481 |
java
|
package com.examples.joined_table;
import com.examples.HibernateSessionFactory;
import org.hibernate.Session;
public class Start {
public static void main(String[] args) {
Session session = HibernateSessionFactory.getSessionFactory().openSession();
CatJ cat = new CatJ("Vaska", 24);
DogJ dog = new DogJ("Mumu", false);
session.beginTransaction();
session.save(cat);
session.save(dog);
session.getTransaction().commit();
session.close();
}
}
|
[
"[email protected]"
] | |
7641e1b75476d9641e2f1128f3677080bc857a5b
|
2976c08c7fbe410cadefb9c6787f799bd8c1a201
|
/FlattenBinaryTreetoLinkedList.java
|
9445e73617cfda6c04a4b9cd35d7f698a528643e
|
[] |
no_license
|
givenwong/myLeetCode
|
48a36fac40c27cd23fb0e501d145bbc92f1ad54e
|
c9cf14e77dadaec8188b1363de0dc08236a2866d
|
refs/heads/master
| 2021-01-20T12:34:56.407713 | 2014-08-28T03:50:50 | 2014-08-28T03:50:50 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 840 |
java
|
public class FlattenBinaryTreetoLinkedList {
// flat the binary tree into a linked list in pre-order
public void flatten(TreeNode root) {
root = flattenHelper(root);
}
public TreeNode flattenHelper(TreeNode root) {
if(root == null)
return null;
TreeNode left = flattenHelper(root.left);
TreeNode right = flattenHelper(root.right);
// disconnect root
root.left =null;
root.right =null;
// append left list to root
if(left != null)
root.right = left;
// get the last node
TreeNode scanner = root;
while( scanner.right != null)
scanner = scanner.right;
// append the right list to the end
scanner.right = right;
return root;
}
}
|
[
"[email protected]"
] | |
adc687ff70d9bc13123ade6d5eda003346daac43
|
3e3922fc6057d1880579dfe10224710908fe157c
|
/src/main/java/com/bouncycastle/crypto/ExtendedDigest.java
|
a35910e46cf2ed8866c226326d92857933003241
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
firmboy/sm
|
5392cdb4010676ca759176411ee592d4008e78f1
|
631ca9a5b0e980058def2973b9c43a8096c271ed
|
refs/heads/master
| 2021-07-21T08:35:36.160136 | 2020-11-02T01:11:58 | 2020-11-02T01:11:58 | 226,500,889 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 316 |
java
|
package com.bouncycastle.crypto;
public interface ExtendedDigest
extends Digest
{
/**
* Return the size in bytes of the internal buffer the digest applies it's compression
* function to.
*
* @return byte length of the digests internal buffer.
*/
public int getByteLength();
}
|
[
"[email protected]"
] | |
b6f9cc2530e98f9db552fdf153d69a34e664ba87
|
ab76c7d2c720c8056d000ad4e311b596a84ad43b
|
/app/src/main/java/com/example/flavi/curious_message/MainActivity.java
|
36e3a948e792b531ebb8efd92354b843b6fc2b5e
|
[] |
no_license
|
luanus3/Teste
|
4e0457cb468ece5033f3c6dbb18a18845f31e86b
|
9eaf98ff92532b1ea8e94473fadaf81baf32927a
|
refs/heads/master
| 2021-01-10T07:36:56.622303 | 2016-03-25T14:18:24 | 2016-03-25T14:18:24 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 939 |
java
|
package com.example.flavi.curious_message;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import java.util.Timer;
import java.util.TimerTask;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new Timer().schedule(new TimerTask() {
@Override
public void run() {
finish();
Intent activity_menu = new Intent();
activity_menu.setClass(MainActivity.this, menu.class);
startActivity(activity_menu);
}
}, 6000);
//public void startactivity_menu(View view) {
//Intent activity_menu = new Intent(this, menu.class);
//startActivity(activity_menu);
}
}
|
[
"Flávio Ferreira"
] |
Flávio Ferreira
|
1141dc60c6dfe538748cef49b07e1bd1e0ef2166
|
9ac1afa3df01a902b9000fad41659c233b76f531
|
/source/main/org/usrz/libs/crypto/json/HashedPassword.java
|
cb4859b9b5279c5aecafd8d15bc35c0e517006e9
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
nightwend/java-libs-crypto
|
bd0873f08dd8b5126ac423fb6d03ed7314ee1d80
|
6f1b9352680b5fa75b2882d0f8b0f0a9e914d61f
|
refs/heads/master
| 2020-05-23T08:04:04.970334 | 2014-10-21T08:38:01 | 2014-10-21T08:38:42 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,403 |
java
|
/* ========================================================================== *
* Copyright 2014 USRZ.com and Pier Paolo Fumagalli *
* -------------------------------------------------------------------------- *
* 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.usrz.libs.crypto.json;
import static org.usrz.libs.crypto.utils.CryptoUtils.safeEncode;
import static org.usrz.libs.utils.Check.notNull;
import java.util.Arrays;
import org.usrz.libs.configurations.Password;
import org.usrz.libs.crypto.kdf.KDF;
import org.usrz.libs.crypto.kdf.KDFSpec;
import org.usrz.libs.crypto.utils.ClosingDestroyable;
import org.usrz.libs.crypto.utils.CryptoUtils;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
public class HashedPassword implements ClosingDestroyable {
private boolean destroyed;
private final KDFSpec spec;
private final byte[] hash;
private final byte[] salt;
@JsonCreator
public HashedPassword(@JsonProperty("spec") KDFSpec spec,
@JsonProperty("hash") byte[] hash,
@JsonProperty("salt") byte[] salt) {
this.spec = notNull(spec, "Null spec");
this.hash = notNull(hash, "Null hash");
this.salt = notNull(salt, "Null salt");
destroyed = false;
}
@JsonIgnore
public HashedPassword(KDF kdf, Password password) {
byte[] bytes = null;
try {
bytes = safeEncode(password.get(), false);
spec = kdf.getKDFSpec();
salt = CryptoUtils.randomBytes(spec.getDerivedKeyLength());
hash = kdf.deriveKey(bytes, salt);
} finally {
CryptoUtils.destroyArray(bytes);
}
}
/* ====================================================================== */
@JsonProperty("spec")
public KDFSpec getKDFSpec() {
return spec;
}
@JsonProperty("hash")
public byte[] getHash() {
if (destroyed) throw new IllegalStateException("Destroyed");
return hash;
}
@JsonProperty("salt")
public byte[] getSalt() {
if (destroyed) throw new IllegalStateException("Destroyed");
return salt;
}
/* ====================================================================== */
@JsonIgnore
public boolean validate(KDF kdf, Password password) {
if (destroyed) throw new IllegalStateException("Destroyed");
/* Check the KDF spec we got */
if (!kdf.getKDFSpec().equals(getKDFSpec()))
throw new IllegalArgumentException("KDF spec mismatch");
/* Hash the password */
byte[] bytes = null;
byte[] check = null;
try {
bytes = safeEncode(password.get(), false);
check = kdf.deriveKey(bytes, getSalt());
return Arrays.equals(check, getHash());
} finally {
CryptoUtils.destroyArray(bytes);
CryptoUtils.destroyArray(check);
}
}
/* ====================================================================== */
@Override
public void close() {
if (! destroyed) try {
CryptoUtils.destroyArray(hash);
CryptoUtils.destroyArray(salt);
} finally {
destroyed = true;
}
}
@Override
@JsonIgnore
public boolean isDestroyed() {
return destroyed;
}
}
|
[
"[email protected]"
] | |
129134d9f94e49a35ea4c51f58d9a16c465fb26f
|
0eb105d13403c143b7d3bd8cc56423eed0e71c60
|
/src/main/java/com/mossle/operation/web/ProcessOperationReturnController.java
|
52ca5853f6470d78cda74356e86ee40dad2603d8
|
[
"Apache-2.0"
] |
permissive
|
GilBert1987/Rolmex
|
b83a861ab2e28ea6f06f41552668f6f6a5f47d26
|
a6bb7a15e68c4e37a5588324724a35a2b340d581
|
refs/heads/master
| 2021-10-23T08:51:54.685765 | 2019-03-16T05:02:27 | 2019-03-16T05:02:27 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 23,199 |
java
|
package com.mossle.operation.web;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.mossle.api.form.FormConnector;
import com.mossle.api.form.FormDTO;
import com.mossle.api.humantask.HumanTaskConnector;
import com.mossle.api.humantask.HumanTaskDTO;
import com.mossle.api.humantask.HumanTaskDefinition;
import com.mossle.api.keyvalue.FormParameter;
import com.mossle.api.keyvalue.KeyValueConnector;
import com.mossle.api.keyvalue.Prop;
import com.mossle.api.keyvalue.Record;
import com.mossle.api.store.StoreConnector;
import com.mossle.api.tenant.TenantHolder;
import com.mossle.api.user.UserConnector;
import com.mossle.button.ButtonDTO;
import com.mossle.button.ButtonHelper;
import com.mossle.core.MultipartHandler;
import com.mossle.core.annotation.Log;
import com.mossle.core.auth.CurrentUserHolder;
import com.mossle.core.auth.CustomPasswordEncoder;
import com.mossle.core.mapper.JsonMapper;
import com.mossle.core.spring.MessageHelper;
import com.mossle.operation.persistence.domain.Product;
import com.mossle.operation.persistence.domain.Return;
import com.mossle.operation.persistence.domain.ReturnDTO;
import com.mossle.operation.persistence.manager.ProductManager;
import com.mossle.operation.persistence.manager.ReturnManager;
import com.mossle.operation.service.OperationService;
import com.mossle.operation.service.ReturnService;
import com.mossle.user.persistence.domain.AccountCredential;
import com.mossle.user.persistence.domain.AccountInfo;
import com.mossle.user.persistence.manager.AccountCredentialManager;
import com.mossle.user.persistence.manager.AccountInfoManager;
import com.mossle.user.support.ChangePasswordResult;
import com.mossle.xform.Xform;
import com.mossle.xform.XformBuilder;
/**
* 流程操作.
*
*
*/
@Component
@Controller
@RequestMapping("Return")
@Path("Return")
public class ProcessOperationReturnController {
private static Logger logger = LoggerFactory.getLogger(ProcessOperationController.class);
public static final int STATUS_DRAFT_PROCESS = 0;
public static final int STATUS_DRAFT_TASK = 1;
public static final int STATUS_RUNNING = 2;
private OperationService operationService;
private KeyValueConnector keyValueConnector;
private MessageHelper messageHelper;
private CurrentUserHolder currentUserHolder;
private HumanTaskConnector humanTaskConnector;
private MultipartResolver multipartResolver;
private StoreConnector storeConnector;
private ButtonHelper buttonHelper = new ButtonHelper();
private FormConnector formConnector;
private JsonMapper jsonMapper = new JsonMapper();
private TenantHolder tenantHolder;
private UserConnector userConnector;
private ReturnManager returnManager;
private ProductManager productManager;
private ReturnService returnService;
private AccountInfoManager accountInfoManager;
private AccountCredentialManager accountCredentialManager;
private CustomPasswordEncoder customPasswordEncoder;
//private ReturnShopDetailManager returnShopDetailManager;
/**
* 发起流程.
*/
@RequestMapping("process-operationReturn-startProcessInstance")
@Log(desc = "发起流程", action = "startProcess", operationDesc = "流程中心-我的流程-发起流程-退货")
public String startProcessInstance(HttpServletRequest request, @ModelAttribute ReturnDTO returnDTO,String areaId,String areaName,
String companyId,String companyName,
@RequestParam(value = "proNo") String proNo,//产品编号
@RequestParam(value = "proName") String proName,//产品名称
@RequestParam(value = "shopPVNum") String shopPVNum,//店支付产品数量
@RequestParam(value = "shopReturn") String shopReturn,//店支付退回的数量
@RequestParam(value = "shopProPV") String shopProPV,//店支付退回产品的总pv
@RequestParam(value = "shopRewardNum") String shopRewardNum,//奖励积分产品数量
@RequestParam(value = "rewardReturn") String rewardReturn,//奖励积分退回的数量
@RequestParam(value = "shopRewardPV") String shopRewardPV,//奖励积分退回产品总pv
@RequestParam(value = "shopWalletNum") String shopWalletNum,//个人钱包产品数量
@RequestParam(value = "walletReturn") String walletReturn,//个人钱包退回数量
@RequestParam(value = "shopWalletPV") String shopWalletPV,//个人钱包退回产品总pv
@RequestParam(value = "proPV") String proPV,//产品单价pv
@RequestParam("bpmProcessId") String bpmProcessId, HumanTaskDTO humanTaskDTO,
@RequestParam("businessKey") String businessKey, Model model) throws Exception {
String userId = currentUserHolder.getUserId();
List<Product> proList = new ArrayList<Product>();
String [] proNos = proNo.split(",");
String [] proNames = proName.split(",");
String [] shopPVNums = shopPVNum.split(",");
String [] shopReturns = shopReturn.split(",");
String [] shopProPVs = shopProPV.split(",");
String [] shopRewardNums = shopRewardNum.split(",");
String [] rewardReturns = rewardReturn.split(",");
String [] shopRewardPVs = shopRewardPV.split(",");
String [] shopWalletNums = shopWalletNum.split(",");
String [] walletReturns = walletReturn.split(",");
String [] shopWalletPVs = shopWalletPV.split(",");
String [] proPVs = proPV.split(",");
for(int i = 0;i<proNames.length;i++){
Product product = new Product();
product.setProNo(proNos[i]);
product.setProName(proNames[i]);
product.setShopPVNum(shopPVNums[i]);
product.setShopReNum(shopReturns[i]);
product.setShopPV(shopProPVs[i]);
product.setShopRewardNum(shopRewardNums[i]);
product.setShopRewNum(rewardReturns[i]);
product.setShopRewardPV(shopRewardPVs[i]);
product.setShopWalletNum(shopWalletNums[i]);
product.setShopwalNum(walletReturns[i]);
product.setShopWalletPV(shopWalletPVs[i]);
product.setProPV(proPVs[i]);
proList.add(product);
}
returnService.saveReturn(request,returnDTO, proList,userId,areaId,areaName,companyId,companyName, businessKey);
return "operation/process-operation-startProcessInstance";
}
/** 审批各节点获取外部申请单数据*/
@GET
@Path("getReturnInfo")
public List<ReturnDTO> getReturnById(@QueryParam("id")String id){
List<Return> returnInfo = returnManager.findBy("processInstanceId", id);
List <ReturnDTO> returnDTOList = new ArrayList<ReturnDTO>();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
for(Return getInfo : returnInfo){
ReturnDTO returnDTO = new ReturnDTO();
returnDTO.setWareHouse(getInfo.getWareHouse());
returnDTO.setEmpNo(getInfo.getEmpNo());
returnDTO.setUcode(getInfo.getUcode());
returnDTO.setShopName(getInfo.getShopName());
returnDTO.setShopTel(getInfo.getShopTel());
returnDTO.setReturnDate(formatter.format(getInfo.getReturnDate()));
returnDTO.setOrderNumber(getInfo.getOrderNumber());
returnDTO.setReturnReaon(getInfo.getReturnReaon());
returnDTO.setShopPayStock(getInfo.getShopPayStock());
returnDTO.setPersonPayStock(getInfo.getPersonPayStock());
returnDTO.setRewardIntegralStock(getInfo.getRewardIntegralStock());
returnDTO.setPayType(getInfo.getPayType());
returnDTO.setProcessInstanceId(getInfo.getProcessInstanceId());
returnDTO.setUserId(getInfo.getUserId());
returnDTO.setId(getInfo.getId());
returnDTO.setSubmitTimes(getInfo.getSubmitTimes());
//ckx
returnDTO.setInputApplyCode(getInfo.getInputApplyCode());
returnDTO.setBankDeposit(getInfo.getBankDeposit());
returnDTO.setAccountName(getInfo.getAccountName());
returnDTO.setAccountNumber(getInfo.getAccountNumber());
returnDTOList.add(returnDTO);
}
return returnDTOList;
}
@GET
@Path("getReturnProductInfo")
public List<Product> getReturnProduct(@QueryParam("id")String id){
List<Product> list = null;
Return re = returnManager.findUniqueBy("processInstanceId", id);
if(re != null){
Long returnId = re.getId();
list = (List<Product>) productManager.findBy("returnId", returnId);
}else{
return list;
}
return list;
}
/** 审批各节点获取外部产品申请单数据*/
@GET
@Path("getProductInfo")
public List<Product> getProductById(@QueryParam("id")Long id){
List<Product> productInfo = productManager.findBy("returnId", id);
List <Product> productDTOList = new ArrayList<Product>();
for(Product getInfo : productInfo){
Product product = new Product();
product.setId(getInfo.getId());
product.setProName(getInfo.getProName());
//店支付
product.setShopPVNum(getInfo.getShopPVNum());
product.setShopReNum(getInfo.getShopReNum());
product.setShopPV(getInfo.getShopPV());
//积分奖励
product.setShopRewardNum(getInfo.getShopRewardNum());
product.setShopRewNum(getInfo.getShopRewNum());
product.setShopRewardPV(getInfo.getShopRewardPV());
//个人钱包
product.setShopWalletNum(getInfo.getShopWalletNum());
product.setShopwalNum(getInfo.getShopwalNum());
product.setShopWalletPV(getInfo.getShopWalletPV());
productDTOList.add(product);
}
return productDTOList;
}
/**
* 申请单详情或打印页
* */
@RequestMapping("from-detail")
@Log(desc = "查看详情页", action = "processDetail", operationDesc = "流程中心-退货-详情")
public String formDetail( @RequestParam("processInstanceId") String processInstanceId,Long returnId,
@RequestParam(value = "isPrint", required = false) boolean isPrint,
Model model){
this.getReturnById(processInstanceId);
this.getProductById(returnId);
//审批记录
List<HumanTaskDTO> logHumanTaskDtos = humanTaskConnector
.findHumanTasksForPositionByProcessInstanceId(processInstanceId);
//获得审核详情
logHumanTaskDtos = operationService.settingAuditDuration(logHumanTaskDtos);
model.addAttribute("logHumanTaskDtos", logHumanTaskDtos);
model.addAttribute("isPrint", isPrint);
operationService.copyMsgUpdate(processInstanceId);
return "operation/process/ReturnFormDetail";
}
/**
* 完成任务.
*/
@RequestMapping("process-operationReturnApproval-completeTask")
@Log(desc = "审批流程", action = "confirmProcess", operationDesc = "流程中心-我的审批-待办审批-退货")
public String completeTask(HttpServletRequest request,
RedirectAttributes redirectAttributes,
@RequestParam("processInstanceId") String processInstanceId,
@RequestParam("humanTaskId") String humanTaskId,
String flag
) throws Exception {
try {
returnService.saveReReturn(request, redirectAttributes, processInstanceId, humanTaskId);
} catch (IllegalStateException ex) {
logger.error(ex.getMessage(), ex);
messageHelper.addFlashMessage(redirectAttributes, "任务不存在");
return "redirect:/humantask/workspace-personalTasks.do";
}
return "operation/task-operation-completeTask";
}
//==================================================================================
//验证密码是否正确
@GET
@Path("return-verifyPassword")
public int VerifyPassword(@QueryParam("pwd") String pwd){
Long accountId = Long.parseLong(currentUserHolder.getUserId());
AccountInfo accountInfo = accountInfoManager.get(accountId);
String hql = "from AccountCredential where accountInfo=? and catalog='default'";
AccountCredential accountCredential = accountCredentialManager.findUnique(hql, accountInfo);
ChangePasswordResult changePasswordResult = new ChangePasswordResult();
if (!isPasswordValid(pwd, accountCredential.getOperationPassword())) {
changePasswordResult.setCode("user.user.input.passwordnotcorrect");
changePasswordResult.setMessage("密码错误");
return 0;
}else {
return 1;
}
}
public boolean isPasswordValid(String rawPassword, String encodedPassword) {
if (customPasswordEncoder != null) {
return customPasswordEncoder.matches(rawPassword, encodedPassword);
} else {
return rawPassword.equals(encodedPassword);
}
}
/**
* 申请单详情页
* */
/* @RequestMapping("from-detail")
public String formDetail( @RequestParam("processInstanceId") String processInstanceId){
this.getReturnById(processInstanceId);
return "operation/process/ReturnFormDetail";
}*/
/**
* 回退任务(即驳回事件),前一个任务.
* @throws Exception
*/
/* @RequestMapping("task-operation-rollbackPreviousReturn")
public String rollbackPrevious(HttpServletRequest request,
@RequestParam("humanTaskId") String humanTaskId,String comment) throws Exception {
//this.getReturnById(id);
humanTaskConnector.rollbackPrevious(humanTaskId,comment);
HumanTaskDTO humanTaskDTO = humanTaskConnector.findHumanTask(humanTaskId,comment);//该方法已删除
return "redirect:/humantask/workspace-personalTasks.do";
}*/
/* @RequestMapping("task-operation-ReturnDisagree")
public String disagree(HttpServletRequest request, @RequestParam("humanTaskId") String humanTaskId,String activityId,String comment){
humanTaskConnector.skip("end", activityId, "");
return "redirect:/humantask/workspace-personalTasks.do";
}*/
// ~ ======================================================================
/**
* 通过multipart请求构建formParameter.
*/
public FormParameter buildFormParameter(MultipartHandler multipartHandler) {
FormParameter formParameter = new FormParameter();
formParameter.setMultiValueMap(multipartHandler.getMultiValueMap());
formParameter.setMultiFileMap(multipartHandler.getMultiFileMap());
formParameter.setBusinessKey(multipartHandler.getMultiValueMap()
.getFirst("businessKey"));
formParameter.setBpmProcessId(multipartHandler.getMultiValueMap()
.getFirst("bpmProcessId"));
formParameter.setHumanTaskId(multipartHandler.getMultiValueMap()
.getFirst("humanTaskId"));
formParameter.setComment(multipartHandler.getMultiValueMap()
.getFirst("comment"));
return formParameter;
}
/**
* 把数据先保存到keyvalue里.
*/
public FormParameter doSaveRecord(HttpServletRequest request)
throws Exception {
String userId = currentUserHolder.getUserId();
String tenantId = tenantHolder.getTenantId();
MultipartHandler multipartHandler = new MultipartHandler(
multipartResolver);
FormParameter formParameter = null;
try {
multipartHandler.handle(request);
logger.debug("multiValueMap : {}",
multipartHandler.getMultiValueMap());
logger.debug("multiFileMap : {}",
multipartHandler.getMultiFileMap());
formParameter = this.buildFormParameter(multipartHandler);
String businessKey = operationService.saveDraft(userId, tenantId,
formParameter);
if ((formParameter.getBusinessKey() == null)
|| "".equals(formParameter.getBusinessKey().trim())) {
formParameter.setBusinessKey(businessKey);
}
// TODO zyl 2017-11-16 外部表单不需要保存prop
/*Record record = keyValueConnector.findByCode(businessKey);
record = new RecordBuilder().build(record, multipartHandler,
storeConnector, tenantId);
keyValueConnector.save(record);*/
} finally {
multipartHandler.clear();
}
return formParameter;
}
/**
* 实际确认发起流程.
*/
public String doConfirmStartProcess(FormParameter formParameter, Model model) {
humanTaskConnector.configTaskDefinitions(
formParameter.getBusinessKey(),
formParameter.getList("taskDefinitionKeys"),
formParameter.getList("taskAssignees"));
model.addAttribute("businessKey", formParameter.getBusinessKey());
model.addAttribute("nextStep", formParameter.getNextStep());
model.addAttribute("bpmProcessId", formParameter.getBpmProcessId());
return "operation/process-operation-confirmStartProcess";
}
/**
* 实际显示开始表单.
*/
public String doViewStartForm(FormParameter formParameter, Model model,
String tenantId) throws Exception {
model.addAttribute("formDto", formParameter.getFormDto());
model.addAttribute("bpmProcessId", formParameter.getBpmProcessId());
model.addAttribute("businessKey", formParameter.getBusinessKey());
model.addAttribute("nextStep", formParameter.getNextStep());
List<ButtonDTO> buttons = new ArrayList<ButtonDTO>();
buttons.add(buttonHelper.findButton("saveDraft"));
buttons.add(buttonHelper.findButton(formParameter.getNextStep()));
model.addAttribute("buttons", buttons);
model.addAttribute("formDto", formParameter.getFormDto());
String json = this.findStartFormData(formParameter.getBusinessKey());
if (json != null) {
model.addAttribute("json", json);
}
Record record = keyValueConnector.findByCode(formParameter
.getBusinessKey());
FormDTO formDto = formConnector.findForm(formParameter.getFormDto()
.getCode(), tenantId);
if (record != null) {
Xform xform = new XformBuilder().setStoreConnector(storeConnector)
.setUserConnector(userConnector)
.setContent(formDto.getContent()).setRecord(record).build();
model.addAttribute("xform", xform);
} else {
Xform xform = new XformBuilder().setStoreConnector(storeConnector)
.setUserConnector(userConnector)
.setContent(formDto.getContent()).build();
model.addAttribute("xform", xform);
}
return "operation/process-operation-viewStartForm";
}
/**
* 实际展示配置任务的配置.
*/
public String doTaskConf(FormParameter formParameter, Model model) {
model.addAttribute("bpmProcessId", formParameter.getBpmProcessId());
model.addAttribute("businessKey", formParameter.getBusinessKey());
model.addAttribute("nextStep", formParameter.getNextStep());
List<HumanTaskDefinition> humanTaskDefinitions = humanTaskConnector
.findHumanTaskDefinitions(formParameter
.getProcessDefinitionId());
model.addAttribute("humanTaskDefinitions", humanTaskDefinitions);
return "operation/process-operation-taskConf";
}
/**
* 读取草稿箱中的表单数据,转换成json.
*/
public String findStartFormData(String businessKey) throws Exception {
Record record = keyValueConnector.findByCode(businessKey);
if (record == null) {
return null;
}
Map map = new HashMap();
for (Prop prop : record.getProps().values()) {
map.put(prop.getCode(), prop.getValue());
}
String json = jsonMapper.toJson(map);
return json;
}
// ~ ======================================================================
@Resource
public void setKeyValueConnector(KeyValueConnector keyValueConnector) {
this.keyValueConnector = keyValueConnector;
}
@Resource
public void setMessageHelper(MessageHelper messageHelper) {
this.messageHelper = messageHelper;
}
@Resource
public void setCurrentUserHolder(CurrentUserHolder currentUserHolder) {
this.currentUserHolder = currentUserHolder;
}
@Resource
public void setOperationService(OperationService operationService) {
this.operationService = operationService;
}
@Resource
public void setHumanTaskConnector(HumanTaskConnector humanTaskConnector) {
this.humanTaskConnector = humanTaskConnector;
}
@Resource
public void setMultipartResolver(MultipartResolver multipartResolver) {
this.multipartResolver = multipartResolver;
}
@Resource
public void setStoreConnector(StoreConnector storeConnector) {
this.storeConnector = storeConnector;
}
@Resource
public void setFormConnector(FormConnector formConnector) {
this.formConnector = formConnector;
}
@Resource
public void setTenantHolder(TenantHolder tenantHolder) {
this.tenantHolder = tenantHolder;
}
@Resource
public void setUserConnector(UserConnector userConnector) {
this.userConnector = userConnector;
}
// ~ ======================================================================
@Resource
public void setReturnManager(ReturnManager returnManager) {
this.returnManager = returnManager;
}
@Resource
public void setProductManager(ProductManager productManager) {
this.productManager = productManager;
}
@Resource
public void setReturnService(ReturnService returnService) {
this.returnService = returnService;
}
@Resource
public void setAccountInfoManager(AccountInfoManager accountInfoManager) {
this.accountInfoManager = accountInfoManager;
}
@Resource
public void setAccountCredentialManager(AccountCredentialManager accountCredentialManager) {
this.accountCredentialManager = accountCredentialManager;
}
@Resource
public void setCustomPasswordEncoder(CustomPasswordEncoder customPasswordEncoder) {
this.customPasswordEncoder = customPasswordEncoder;
}
}
|
[
"[email protected]"
] | |
95ccd39353dc8a9355c68d5bb1d22fb1c9dc6546
|
4012bed54c1070d05afa26b534be113b51bd48a6
|
/trunk/ch2/src/main/java/com/pro/spring/ch2/ConfigurableMessageProvider.java
|
bd1ae4465849c401f4d37e27adf4fff6f376cab8
|
[
"MIT"
] |
permissive
|
oscar01mx/Spring-Pro
|
59aad99497686b01c3f2a1a157c0729938e900d6
|
cf32398bdf04efc70bf83c5b427e107b91d5088b
|
refs/heads/master
| 2016-09-05T16:40:00.326464 | 2014-12-19T17:55:38 | 2014-12-19T17:55:38 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 679 |
java
|
package com.pro.spring.ch2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@Service("messageProvider")
public class ConfigurableMessageProvider implements MessageProvider {
private String message;
// public ConfigurableMessageProvider(String message) {
// this.message = message;
// }
//
// @Override
// public String getMessage() {
// return message;
// }
@Autowired
public ConfigurableMessageProvider(String message) {
this.message = message;
}
@Override
public String getMessage() {
return message;
}
}
|
[
"[email protected]"
] | |
5ccb5a7211bdfef8c44810361e3f36f65a27ed36
|
1c7ad6dece31aed0bf699153f0d158975a70001a
|
/src/prueba/Lucha.java
|
b0233d7d7f8f179947164c88116da81b49538fcf
|
[] |
no_license
|
FlavioAAandres/Prueba
|
b71a4405988ec1cad1e25f037f20bbaf99caf631
|
0a84522d0f25bda78b25ce0b04bfb53bd4420200
|
refs/heads/master
| 2021-01-12T12:42:26.423426 | 2016-09-30T07:31:04 | 2016-09-30T07:31:04 | 69,645,319 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,884 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package prueba;
/**
*
* @author Flavio A. Pareja
*/
public class Lucha extends javax.swing.JFrame {
/**
* Creates new form Lucha
*/
public Lucha() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
Jugador1 = new javax.swing.JLabel();
Jugador2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setPreferredSize(new java.awt.Dimension(600, 600));
setResizable(false);
setSize(new java.awt.Dimension(600, 600));
setType(java.awt.Window.Type.POPUP);
getContentPane().setLayout(null);
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
Jugador1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Maps/Jugador.gif"))); // NOI18N
Jugador2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/prueba/Primer.gif"))); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(Jugador1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 334, Short.MAX_VALUE)
.addComponent(Jugador2)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(Jugador1)
.addComponent(Jugador2))
.addContainerGap(28, Short.MAX_VALUE))
);
getContentPane().add(jPanel1);
jPanel1.setBounds(1, 0, 600, 220);
jButton1.setText("Atacar");
getContentPane().add(jButton1);
jButton1.setBounds(10, 230, 65, 23);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Lucha.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Lucha.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Lucha.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Lucha.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Lucha().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel Jugador1;
private javax.swing.JLabel Jugador2;
private javax.swing.JButton jButton1;
private javax.swing.JPanel jPanel1;
// End of variables declaration//GEN-END:variables
}
|
[
"Flavio A. Pareja@DESKTOP-MNA0J65"
] |
Flavio A. Pareja@DESKTOP-MNA0J65
|
48e164037be95ab8b5f00e553a7f46cb847bc58d
|
baef861a6ce7a738878cc1737288bed3006f72b8
|
/SampleFresh/app/src/main/java/cn/sharesdk/demo/platform/tencent/qq/QQShare.java
|
befb7c246e9659a4d6def551af5e145fa0d818a7
|
[
"MIT"
] |
permissive
|
Steadyoung/ShareSDK-for-Android
|
85a2450d54a741ed8cf9fa7e615da284c8bec2db
|
ea22017c83a359b8ec220969b52046b925b080de
|
refs/heads/master
| 2020-07-03T10:23:20.070350 | 2019-07-26T06:28:31 | 2019-07-26T06:28:31 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,604 |
java
|
package cn.sharesdk.demo.platform.tencent.qq;
import com.mob.MobSDK;
import cn.sharesdk.demo.entity.ResourcesManager;
import cn.sharesdk.demo.utils.DemoUtils;
import cn.sharesdk.framework.Platform;
import cn.sharesdk.framework.PlatformActionListener;
import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.tencent.qq.QQ;
import static cn.sharesdk.demo.ShareMobLinkActivity.LINK_TEXT;
import static cn.sharesdk.demo.ShareMobLinkActivity.LINK_URL;
/**
* Created by yjin on 2017/6/22.
*/
public class QQShare {
private PlatformActionListener platformActionListener;
public QQShare(PlatformActionListener mListener){
this.platformActionListener = mListener;
String [] pks = {"com.tencent.mobileqq","com.tencent.mobileqqi","com.tencent.qqlite","com.tencent.minihd.qq","com.tencent.tim"};
DemoUtils.isValidClient(pks);
}
public void shareWebPager(){
Platform platform = ShareSDK.getPlatform(QQ.NAME);
Platform.ShareParams shareParams = new Platform.ShareParams();
shareParams.setText(LINK_TEXT);
shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
shareParams.setTitleUrl(LINK_URL);
shareParams.setShareType(Platform.SHARE_WEBPAGE);
platform.setPlatformActionListener(platformActionListener);
platform.share(shareParams);
}
public void shareImage(){
Platform platform = ShareSDK.getPlatform(QQ.NAME);
Platform.ShareParams shareParams = new Platform.ShareParams();
shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
//shareParams.setImageUrl("http://pic28.photophoto.cn/20130818/0020033143720852_b.jpg");
platform.setPlatformActionListener(platformActionListener);
shareParams.setShareType(Platform.SHARE_IMAGE);
platform.share(shareParams);
}
public void shareMusic(){
Platform platform = ShareSDK.getPlatform(QQ.NAME);
Platform.ShareParams shareParams = new Platform.ShareParams();
shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
shareParams.setTitleUrl(ResourcesManager.getInstace(MobSDK.getContext()).getTitleUrl());
shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
shareParams.setMusicUrl(ResourcesManager.getInstace(MobSDK.getContext()).getMusicUrl());
shareParams.setShareType(Platform.SHARE_MUSIC);
platform.setPlatformActionListener(platformActionListener);
platform.share(shareParams);
}
public void shareWebPager(PlatformActionListener mListener){
Platform platform = ShareSDK.getPlatform(QQ.NAME);
Platform.ShareParams shareParams = new Platform.ShareParams();
shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
shareParams.setTitleUrl(ResourcesManager.getInstace(MobSDK.getContext()).getTitleUrl());
shareParams.setShareType(Platform.SHARE_WEBPAGE);
platform.setPlatformActionListener(mListener);
platform.share(shareParams);
}
public void shareImage(PlatformActionListener mListener){
Platform platform = ShareSDK.getPlatform(QQ.NAME);
Platform.ShareParams shareParams = new Platform.ShareParams();
shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
shareParams.setShareType(Platform.SHARE_IMAGE);
platform.setPlatformActionListener(mListener);
platform.share(shareParams);
}
public void shareMusic(PlatformActionListener mListener){
Platform platform = ShareSDK.getPlatform(QQ.NAME);
Platform.ShareParams shareParams = new Platform.ShareParams();
shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
shareParams.setTitleUrl(ResourcesManager.getInstace(MobSDK.getContext()).getTitleUrl());
shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
shareParams.setMusicUrl(ResourcesManager.getInstace(MobSDK.getContext()).getMusicUrl());
shareParams.setShareType(Platform.SHARE_MUSIC);
platform.setPlatformActionListener(mListener);
platform.share(shareParams);
}
}
|
[
"[email protected]"
] | |
7d0dea49340dc6bd9637924f8bd76fbaaf95c08d
|
a45249dfd2b38f54d93af74f5763e325ef627cb1
|
/spring-01/src/main/java/ru/otus/spring01/service/PersonService.java
|
c4436315e32d79f5b7185dab6c3566e0ca89cea9
|
[] |
no_license
|
AlexLX2/2020-02-otus-spring-Colosov
|
d362172c952f0bf3b699114caf2adccfddaf628c
|
ff001cb89f9b03d7473da0389d23aeed37887a46
|
refs/heads/master
| 2023-01-07T18:52:30.438964 | 2020-06-18T13:42:39 | 2020-06-18T13:42:39 | 246,062,412 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 325 |
java
|
package ru.otus.spring01.service;
import java.util.Map;
public interface PersonService {
String getLastName();
String getFirstName();
int getScore();
String getRowFromConsole();
int getAnswers(Map<String, String> questionMap);
int answer(String question, String answer);
void init();
}
|
[
"[email protected]"
] | |
013143718bd7ac0aa74321a3ef5e937eed5639f7
|
c6f145685b7d5de6b4d9b9460edc9e52d54b9f81
|
/test_cases/CWE259/CWE259_Hard_Coded_Password_connectionFactoryCreateContext/CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53a.java
|
0a6762fa13590083dbed49b0d2ef482c63e2cd28
|
[] |
no_license
|
Johndoetheone/new-test-repair
|
531ca91dab608abd52eb474c740c0a211ba8eb9f
|
7fa0e221093a60c340049e80ce008e233482269c
|
refs/heads/master
| 2022-04-26T03:44:51.807603 | 2020-04-25T01:10:47 | 2020-04-25T01:10:47 | 258,659,310 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,823 |
java
|
/*
* TEMPLATE GENERATED TESTCASE FILE
* @description
* CWE: 259 Hard Coded Password
* BadSource: hardcodedPassword Set data to a hardcoded string
* Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package
* */
package test_cases.CWE259.CWE259_Hard_Coded_Password_connectionFactoryCreateContext;
import testcasesupport.*;
import java.util.Arrays;
import java.util.Properties;
import java.util.logging.Level;
import java.io.*;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSContext;
import javax.jms.JMSProducer;
import javax.jms.Message;
import org.apache.activemq.ActiveMQConnectionFactory;
public class CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53a extends AbstractTestCase
{
public void bad() throws Throwable
{
String data;
/* FLAW: Set data to a hardcoded string */
data = "7e5tc4s3";
(new CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53b()).badSink(data);
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B() throws Throwable
{
String data;
data = ""; /* init data */
/* FIX */
try
{
InputStreamReader readerInputStream = new InputStreamReader(System.in, "UTF-8");
BufferedReader readerBuffered = new BufferedReader(readerInputStream);
/* POTENTIAL FLAW: Read data from the console using readLine */
data = readerBuffered.readLine();
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
(new CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53b()).goodG2BSink(data);
}
/* goodChar() - uses the expected Properties file and a char[] data variable*/
private void goodChar() throws Throwable
{
char[] data = null;
Properties properties = new Properties();
FileInputStream streamFileInput = null;
try
{
streamFileInput = new FileInputStream("src/juliet_test/resources/config.properties");
properties.load(streamFileInput);
data = properties.getProperty("password").toCharArray();
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* clean up stream reading objects */
try
{
if (streamFileInput != null)
{
streamFileInput.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO);
}
}
(new CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53b()).goodCharSink(data);
}
/* goodExpected() - uses the expected Properties file and uses the password directly from it*/
private void goodExpected() throws Throwable
{
Properties properties = new Properties();
FileInputStream streamFileInput = null;
try
{
streamFileInput = new FileInputStream("src/juliet_test/resources/config.properties");
properties.load(streamFileInput);
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* clean up stream reading objects */
try
{
if (streamFileInput != null)
{
streamFileInput.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO);
}
}
(new CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53b()).goodExpectedSink(properties);
}
public void good() throws Throwable
{
goodG2B();
goodChar();
goodExpected();
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"[email protected]"
] | |
d7926f865f16b78d68a1a3df49d96c220fc9d757
|
6cc0464c7957fc91911c2bf65fc93d214add8900
|
/Random_Projects/src/random/PriorityQueueDemo.java
|
a086a77e56f317e2e71c15ebf2cb92d57995f883
|
[] |
no_license
|
BroFro69/randomJavaPrograms
|
8bca5bf2873451db211e50d3d673943c985a16b0
|
44d2243c9a22324de3f182d0c1d71b4a945c9a88
|
refs/heads/master
| 2023-02-27T05:06:18.864115 | 2021-02-12T05:16:29 | 2021-02-12T05:16:29 | 336,428,616 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 661 |
java
|
package random;
// Exmaple from Geeks For Geeks
// Import Libraries
import java.util.*;
public class PriorityQueueDemo {
public static void main(String[]args) {
// Creating empty priority queue
PriorityQueue<Integer> pQueue = new PriorityQueue<Integer>();
// Adding items to the pQueue using add()
pQueue.add(10);
pQueue.add(20);
pQueue.add(15);
// Printing the top element of PriorityQueue
System.out.print(pQueue.peek());
// Printing the top element and removing it
// from the PriorityQueue container
System.out.print(pQueue.poll());
// Printing the top element again
System.out.print(pQueue.peek());
}
}
|
[
"[email protected]"
] | |
15ce98749046263776514cb5aa59e049e40a6afb
|
09bfac4daaca05a2258806ff82b9feaa2477d83c
|
/src/main/java/com/epam/lab/news/configuration/MongoDbConfig.java
|
116f04816eec3d464626b0b90bc67482cdd31fb5
|
[
"Apache-2.0"
] |
permissive
|
piatrovich/news-management
|
c40d4119ccf55cf3811f50bd549bdf97ce77d574
|
56a3521b4170de390f0664c91cdb0e74fed2327d
|
refs/heads/master
| 2016-09-06T00:52:27.019218 | 2014-08-04T08:13:21 | 2014-08-04T08:13:21 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,470 |
java
|
package com.epam.lab.news.configuration;
import com.mongodb.Mongo;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.mongodb.ServerAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
/**
* Defines MongoDB configuration
*
* @author Dzmitry Piatrovich
* @since 0.1.0-alpha
*/
@Configuration
@EnableMongoRepositories(basePackages = "com.epam.lab.news.database.data.repo")
@PropertySource("classpath:pool/mongo.properties")
public class MongoDbConfig extends AbstractMongoConfiguration {
/** Bean for initializing fields using @Value */
private @Autowired PropertySourcesPlaceholderConfigurer configurer;
private @Value("${mongo.database}") String database;
private @Value("${mongo.host}") String host;
private @Value("${mongo.port}") Integer port;
private @Value("${mongo.connections.per.host}") Integer connectionsPerHost;
private @Value("${mongo.threads.multiplier}") Integer threadsMultiplier;
private @Value("${mongo.connect.timeout}") Integer connectTimeout;
private @Value("${mongo.max.wait.time}") Integer maxWaitTime;
private @Value("${mongo.socket.keep.alive}") Boolean socketKeepAlive;
private @Value("${mongo.socket.timeout}") Integer socketTimeout;
/**
* Returns database name.
* Override if You are using own database.
*
* @return Database name
*/
@Override
protected String getDatabaseName() {
return database;
}
/**
* This method return main object for Spring Data layer.
*
* @return MongoTemplate object
* @throws Exception if building object failed
*/
@Bean
public MongoTemplate mongoTemplate() throws Exception {
return new MongoTemplate(mongoDbFactory());
}
/**
* Return factory for creating database instance from Mongo object.
*
* @return SimpleMongoDbFactory object
* @throws Exception
*/
@Bean
public MongoDbFactory mongoDbFactory() throws Exception {
return new SimpleMongoDbFactory(mongo(), getDatabaseName());
}
/**
* Returns Mongo object initialized by custom pool options.
*
* @return Mongo object
* @throws Exception if pool initialization failed
*/
@Override
public Mongo mongo() throws Exception {
MongoClientOptions options = MongoClientOptions.builder()
.connectionsPerHost(connectionsPerHost)
.threadsAllowedToBlockForConnectionMultiplier(threadsMultiplier)
.connectTimeout(connectTimeout)
.maxWaitTime(maxWaitTime)
.socketKeepAlive(socketKeepAlive)
.socketTimeout(socketTimeout)
.build();
return new MongoClient(new ServerAddress(host, port), options);
}
}
|
[
"[email protected]"
] | |
c2707f8944b9af101a9cbf357824c90046cac9f8
|
4bd49b24ef6b020381c9e33075ff4932da6d035e
|
/src/main/java/com/itinna/smalltool/dao/model/NodeType.java
|
ffd6d7a5d5ea1795291e84b2f01d06fb5e081eb7
|
[] |
no_license
|
tinnaxie/biaojiang
|
05ca28dca3cc3c8f3d70fbad8c3ad3669d69bcbb
|
fed325ecce96ee75d318c57b36b11857a52ad2d3
|
refs/heads/master
| 2021-01-19T17:55:20.936003 | 2017-05-22T09:02:00 | 2017-05-22T09:02:00 | 88,241,300 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,564 |
java
|
package com.itinna.smalltool.dao.model;
import java.util.Date;
public class NodeType extends BaseEntity {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column node_type.id
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
private Integer id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column node_type.type
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
private String type;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column node_type.description
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
private String description;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column node_type.creator
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
private String creator;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column node_type.create_time
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
private Date createTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column node_type.modifier
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
private String modifier;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column node_type.modify_time
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
private Date modifyTime;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column node_type.id
*
* @return the value of node_type.id
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column node_type.id
*
* @param id the value for node_type.id
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column node_type.type
*
* @return the value of node_type.type
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public String getType() {
return type;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column node_type.type
*
* @param type the value for node_type.type
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column node_type.description
*
* @return the value of node_type.description
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public String getDescription() {
return description;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column node_type.description
*
* @param description the value for node_type.description
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column node_type.creator
*
* @return the value of node_type.creator
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public String getCreator() {
return creator;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column node_type.creator
*
* @param creator the value for node_type.creator
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public void setCreator(String creator) {
this.creator = creator == null ? null : creator.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column node_type.create_time
*
* @return the value of node_type.create_time
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column node_type.create_time
*
* @param createTime the value for node_type.create_time
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column node_type.modifier
*
* @return the value of node_type.modifier
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public String getModifier() {
return modifier;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column node_type.modifier
*
* @param modifier the value for node_type.modifier
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public void setModifier(String modifier) {
this.modifier = modifier == null ? null : modifier.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column node_type.modify_time
*
* @return the value of node_type.modify_time
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public Date getModifyTime() {
return modifyTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column node_type.modify_time
*
* @param modifyTime the value for node_type.modify_time
*
* @mbggenerated Fri Apr 21 15:31:37 CST 2017
*/
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
}
|
[
"[email protected]"
] | |
76a2e5d6151e445e9cc73cb1adeb0a0cc944c774
|
192f59426e136aef9f653bd3a3745d754d9a3161
|
/app/src/main/java/cbp/marketlist/utils/ContextUtil.java
|
4c1d8c272d8a0c2f726aa20ddfe0d9d5415b0bb8
|
[] |
no_license
|
Kudychen7086/MarketList
|
3f769a865fabe67b3c1e3d4c3ebff57685273d7e
|
cd70fade0eb378b832e744edd05ae20324981273
|
refs/heads/master
| 2020-03-09T17:59:34.726593 | 2018-04-10T11:27:59 | 2018-04-10T11:27:59 | 128,921,362 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 361 |
java
|
package cbp.marketlist.utils;
import android.content.Context;
/**
* 提供全局context
*
* @author cbp
*/
public class ContextUtil {
private static Context context;
public static void init(Context appContext) {
context = appContext.getApplicationContext();
}
public static Context getContext() {
return context;
}
}
|
[
"[email protected]"
] | |
ce07bd8dd2b13c8d29ccf727d557a360e1617aef
|
3227c97cf58d6e67c311cf12139c0670cba1de96
|
/src/main/java/com/papra/magic/web/rest/CategoryResource.java
|
2cd3222bf5ee8dc8a5698c526754aaf7909256a8
|
[] |
no_license
|
arshamsedaghatbin/magic12
|
62d7e75f64ee0114cd4e767fcc1ee8b3d6b4d57f
|
a64a064b2b165a16e41f26526372776cf8e139b4
|
refs/heads/main
| 2023-07-09T16:41:51.639230 | 2021-08-13T09:18:47 | 2021-08-13T09:18:47 | 394,906,510 | 0 | 0 | null | 2021-08-11T07:45:51 | 2021-08-11T07:43:40 |
Java
|
UTF-8
|
Java
| false | false | 8,483 |
java
|
package com.papra.magic.web.rest;
import com.papra.magic.repository.CategoryRepository;
import com.papra.magic.service.CategoryService;
import com.papra.magic.service.dto.CategoryDTO;
import com.papra.magic.web.rest.errors.BadRequestAlertException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.PaginationUtil;
import tech.jhipster.web.util.ResponseUtil;
/**
* REST controller for managing {@link com.papra.magic.domain.Category}.
*/
@RestController
@RequestMapping("/api")
public class CategoryResource {
private final Logger log = LoggerFactory.getLogger(CategoryResource.class);
private static final String ENTITY_NAME = "category";
@Value("${jhipster.clientApp.name}")
private String applicationName;
private final CategoryService categoryService;
private final CategoryRepository categoryRepository;
public CategoryResource(CategoryService categoryService, CategoryRepository categoryRepository) {
this.categoryService = categoryService;
this.categoryRepository = categoryRepository;
}
/**
* {@code POST /categories} : Create a new category.
*
* @param categoryDTO the categoryDTO to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new categoryDTO, or with status {@code 400 (Bad Request)} if the category has already an ID.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PostMapping("/categories")
public ResponseEntity<CategoryDTO> createCategory(@RequestBody CategoryDTO categoryDTO) throws URISyntaxException {
log.debug("REST request to save Category : {}", categoryDTO);
if (categoryDTO.getId() != null) {
throw new BadRequestAlertException("A new category cannot already have an ID", ENTITY_NAME, "idexists");
}
CategoryDTO result = categoryService.save(categoryDTO);
return ResponseEntity
.created(new URI("/api/categories/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* {@code PUT /categories/:id} : Updates an existing category.
*
* @param id the id of the categoryDTO to save.
* @param categoryDTO the categoryDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated categoryDTO,
* or with status {@code 400 (Bad Request)} if the categoryDTO is not valid,
* or with status {@code 500 (Internal Server Error)} if the categoryDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PutMapping("/categories/{id}")
public ResponseEntity<CategoryDTO> updateCategory(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody CategoryDTO categoryDTO
) throws URISyntaxException {
log.debug("REST request to update Category : {}, {}", id, categoryDTO);
if (categoryDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, categoryDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!categoryRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
CategoryDTO result = categoryService.save(categoryDTO);
return ResponseEntity
.ok()
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, categoryDTO.getId().toString()))
.body(result);
}
/**
* {@code PATCH /categories/:id} : Partial updates given fields of an existing category, field will ignore if it is null
*
* @param id the id of the categoryDTO to save.
* @param categoryDTO the categoryDTO to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated categoryDTO,
* or with status {@code 400 (Bad Request)} if the categoryDTO is not valid,
* or with status {@code 404 (Not Found)} if the categoryDTO is not found,
* or with status {@code 500 (Internal Server Error)} if the categoryDTO couldn't be updated.
* @throws URISyntaxException if the Location URI syntax is incorrect.
*/
@PatchMapping(value = "/categories/{id}", consumes = "application/merge-patch+json")
public ResponseEntity<CategoryDTO> partialUpdateCategory(
@PathVariable(value = "id", required = false) final Long id,
@RequestBody CategoryDTO categoryDTO
) throws URISyntaxException {
log.debug("REST request to partial update Category partially : {}, {}", id, categoryDTO);
if (categoryDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
if (!Objects.equals(id, categoryDTO.getId())) {
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
}
if (!categoryRepository.existsById(id)) {
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
}
Optional<CategoryDTO> result = categoryService.partialUpdate(categoryDTO);
return ResponseUtil.wrapOrNotFound(
result,
HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, categoryDTO.getId().toString())
);
}
/**
* {@code GET /categories} : get all the categories.
*
* @param pageable the pagination information.
* @param eagerload flag to eager load entities from relationships (This is applicable for many-to-many).
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of categories in body.
*/
@GetMapping("/categories")
public ResponseEntity<List<CategoryDTO>> getAllCategories(
Pageable pageable,
@RequestParam(required = false, defaultValue = "false") boolean eagerload
) {
log.debug("REST request to get a page of Categories");
Page<CategoryDTO> page;
if (eagerload) {
page = categoryService.findAllWithEagerRelationships(pageable);
} else {
page = categoryService.findAll(pageable);
}
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return ResponseEntity.ok().headers(headers).body(page.getContent());
}
/**
* {@code GET /categories/:id} : get the "id" category.
*
* @param id the id of the categoryDTO to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the categoryDTO, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/categories/{id}")
public ResponseEntity<CategoryDTO> getCategory(@PathVariable Long id) {
log.debug("REST request to get Category : {}", id);
Optional<CategoryDTO> categoryDTO = categoryService.findOne(id);
return ResponseUtil.wrapOrNotFound(categoryDTO);
}
/**
* {@code DELETE /categories/:id} : delete the "id" category.
*
* @param id the id of the categoryDTO to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/categories/{id}")
public ResponseEntity<Void> deleteCategory(@PathVariable Long id) {
log.debug("REST request to delete Category : {}", id);
categoryService.delete(id);
return ResponseEntity
.noContent()
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
.build();
}
}
|
[
"[email protected]"
] | |
ed3931e81a1ac2e463473b605b4c92e84d509e00
|
7773b806ebfc3dca495692a1accc64610a608bda
|
/src/com/example/concurrency/phaser_usage/PhaserExample.java
|
b5c7f9a7b418a829f627e9d0ac19eec7e78c63a1
|
[] |
no_license
|
chintoz/java-concurrency
|
c8780d00e8f15bd6f62aadc31d260a78b19b776c
|
224eb17d8e8001b0031c8508805cb11e073bb76c
|
refs/heads/master
| 2023-05-04T02:45:00.369355 | 2018-12-16T10:03:45 | 2018-12-16T10:03:45 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,328 |
java
|
package com.example.concurrency.phaser_usage;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Phaser;
import java.util.stream.Stream;
/**
* Phaser is a structure similar to CountDownLatch mechanism to coordinate the execution of threads. Phaser is a barrier
* which could be configured dynamically (CountDownLatch is only configurable in object creation).
*/
public class PhaserExample {
public static void main(String[] args) throws InterruptedException {
ExecutorService executorService = Executors.newFixedThreadPool(10);
try {
Phaser phaser = new Phaser();
List<Integer> values = new ArrayList<>();
Stream.generate(() -> new Task(phaser, values))
.limit(10).forEach(executorService::submit);
phaser.arriveAndAwaitAdvance();
values.add(Integer.MAX_VALUE);
System.out.println(String.format("Result after execution should show Integer Max values as last element of the list %s", values));
} finally {
executorService.shutdown();
}
}
/**
* Class Callable which receives Phaser and the list of elements to add Integer values.
*/
public static class Task implements Callable<Void> {
private final Phaser phaser;
private final Random random;
private final List<Integer> values;
public Task(Phaser phaser, List<Integer> values) {
this.phaser = phaser;
this.random = new Random();
this.values = values;
}
@Override
public Void call() throws Exception {
phaser.register();
System.out.println(String.format("Starting thread %s", Thread.currentThread().getName()));
int seconds = random.nextInt(10) + 10;
values.add(seconds);
Thread.sleep(seconds * 1000);
phaser.arriveAndDeregister();
System.out.println(String.format("Thread %s reach the Phaser Deregister. We are in %s arrived parties phase ", Thread.currentThread().getName(), phaser.getArrivedParties()));
return null;
}
}
}
|
[
"[email protected]"
] | |
15e5e54605814da6cd04020bde4be122abcce455
|
8a6453cd49949798c11f57462d3f64a1fa2fc441
|
/aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/transform/GameSessionPlacementMarshaller.java
|
e05245ab5e226678b5fa2aa3efec28ea940a351e
|
[
"Apache-2.0"
] |
permissive
|
tedyu/aws-sdk-java
|
138837a2be45ecb73c14c0d1b5b021e7470520e1
|
c97c472fd66d7fc8982cb4cf3c4ae78de590cfe8
|
refs/heads/master
| 2020-04-14T14:17:28.985045 | 2019-01-02T21:46:53 | 2019-01-02T21:46:53 | 163,892,339 | 0 | 0 |
Apache-2.0
| 2019-01-02T21:38:39 | 2019-01-02T21:38:39 | null |
UTF-8
|
Java
| false | false | 7,404 |
java
|
/*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.gamelift.model.transform;
import java.util.List;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.gamelift.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* GameSessionPlacementMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class GameSessionPlacementMarshaller {
private static final MarshallingInfo<String> PLACEMENTID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PlacementId").build();
private static final MarshallingInfo<String> GAMESESSIONQUEUENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("GameSessionQueueName").build();
private static final MarshallingInfo<String> STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Status").build();
private static final MarshallingInfo<List> GAMEPROPERTIES_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("GameProperties").build();
private static final MarshallingInfo<Integer> MAXIMUMPLAYERSESSIONCOUNT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("MaximumPlayerSessionCount").build();
private static final MarshallingInfo<String> GAMESESSIONNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("GameSessionName").build();
private static final MarshallingInfo<String> GAMESESSIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("GameSessionId").build();
private static final MarshallingInfo<String> GAMESESSIONARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("GameSessionArn").build();
private static final MarshallingInfo<String> GAMESESSIONREGION_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("GameSessionRegion").build();
private static final MarshallingInfo<List> PLAYERLATENCIES_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PlayerLatencies").build();
private static final MarshallingInfo<java.util.Date> STARTTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("StartTime").timestampFormat("unixTimestamp").build();
private static final MarshallingInfo<java.util.Date> ENDTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("EndTime").timestampFormat("unixTimestamp").build();
private static final MarshallingInfo<String> IPADDRESS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("IpAddress").build();
private static final MarshallingInfo<Integer> PORT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Port").build();
private static final MarshallingInfo<List> PLACEDPLAYERSESSIONS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PlacedPlayerSessions").build();
private static final MarshallingInfo<String> GAMESESSIONDATA_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("GameSessionData").build();
private static final MarshallingInfo<String> MATCHMAKERDATA_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("MatchmakerData").build();
private static final GameSessionPlacementMarshaller instance = new GameSessionPlacementMarshaller();
public static GameSessionPlacementMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(GameSessionPlacement gameSessionPlacement, ProtocolMarshaller protocolMarshaller) {
if (gameSessionPlacement == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(gameSessionPlacement.getPlacementId(), PLACEMENTID_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getGameSessionQueueName(), GAMESESSIONQUEUENAME_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getGameProperties(), GAMEPROPERTIES_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getMaximumPlayerSessionCount(), MAXIMUMPLAYERSESSIONCOUNT_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getGameSessionName(), GAMESESSIONNAME_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getGameSessionId(), GAMESESSIONID_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getGameSessionArn(), GAMESESSIONARN_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getGameSessionRegion(), GAMESESSIONREGION_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getPlayerLatencies(), PLAYERLATENCIES_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getStartTime(), STARTTIME_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getEndTime(), ENDTIME_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getIpAddress(), IPADDRESS_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getPort(), PORT_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getPlacedPlayerSessions(), PLACEDPLAYERSESSIONS_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getGameSessionData(), GAMESESSIONDATA_BINDING);
protocolMarshaller.marshall(gameSessionPlacement.getMatchmakerData(), MATCHMAKERDATA_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
|
[
""
] | |
055fb3d406c120ee200a45c7f0c52e63a08f1b1e
|
4e6473153ecde7c7451c94b60bac8836c94e424f
|
/baseio-jms/src/main/java/com/generallycloud/nio/container/jms/server/MQSubscribeServlet.java
|
d9bd4be6643bfe9e749a0887ede9468d01a58bf2
|
[] |
no_license
|
pengp/baseio
|
df07daee2dd2d25c7dbf03f3f6eba0a1768af897
|
dfb5215f4f22f451d80f2435c3e47fc37b4da5cc
|
refs/heads/master
| 2020-06-10T17:16:45.090864 | 2016-12-06T06:13:02 | 2016-12-06T06:13:02 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 518 |
java
|
package com.generallycloud.nio.container.jms.server;
import com.generallycloud.nio.codec.protobase.future.ProtobaseReadFuture;
import com.generallycloud.nio.component.SocketSession;
public class MQSubscribeServlet extends MQServlet {
public static final String SERVICE_NAME = MQSubscribeServlet.class.getSimpleName();
public void doAccept(SocketSession session, ProtobaseReadFuture future, MQSessionAttachment attachment) throws Exception {
getMQContext().subscribeMessage(session, future, attachment);
}
}
|
[
"[email protected]"
] | |
84c31bbe52931bebc8cc1d7528b999c3ed1730c1
|
b4a7832ead2c85d8f90e331dcf3b0aea618563bc
|
/gmall-pms/src/main/java/com/atguigu/gmall/pms/entity/SpuDescEntity.java
|
de820c9e9fbf3170d2901293e9088c7ec89405d6
|
[] |
no_license
|
hlw520/hlw_gmail
|
437a2ae3565ceed234414580c491c5a6d6504cae
|
bda32314fe5cc66642259d374dee3c13e71bc308
|
refs/heads/main
| 2023-06-26T23:01:43.240373 | 2021-07-29T15:41:30 | 2021-07-29T15:41:30 | 390,552,084 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 568 |
java
|
package com.atguigu.gmall.pms.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* spu信息介绍
*
* @author hlw
* @email [email protected]
* @date 2021-07-29 18:36:55
*/
@Data
@TableName("pms_spu_desc")
public class SpuDescEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 商品id
*/
@TableId
private Long spuId;
/**
* 商品介绍
*/
private String decript;
}
|
[
"[email protected]"
] | |
96b4a8e25f31a71806f21857ff5e863a19ce261d
|
226653c7435eee3121b8e634cda958291152a46f
|
/Quarto/src/ai/TrainSet.java
|
3a3cd4b19a43219a2c5cbc44c1d5dfa69bb42dca
|
[] |
no_license
|
PaulinBenoit/QuartoAI
|
be468a32859955a54c1f9d5d631c22190ec697c0
|
9cd551cc09ee6f930ae18ec99df1a76a84095af6
|
refs/heads/master
| 2021-01-09T15:29:54.739241 | 2020-03-01T19:16:00 | 2020-03-01T19:16:00 | 242,356,436 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,764 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ai;
import java.util.ArrayList;
import java.util.Arrays;
/**
*
* @author pauli
*/
public class TrainSet {
public final int INPUT_SIZE;
public final int OUTPUT_SIZE;
//double[][] <- index1: 0 = input, 1 = output || index2: index of element
private ArrayList<double[][]> data = new ArrayList<>();
public TrainSet(int INPUT_SIZE, int OUTPUT_SIZE) {
this.INPUT_SIZE = INPUT_SIZE;
this.OUTPUT_SIZE = OUTPUT_SIZE;
}
public void addData(double[] in, double[] expected) {
if(in.length != INPUT_SIZE || expected.length != OUTPUT_SIZE) return;
data.add(new double[][]{in, expected});
}
public TrainSet extractBatch(int size) {
if(size > 0 && size <= this.size()) {
TrainSet set = new TrainSet(INPUT_SIZE, OUTPUT_SIZE);
Integer[] ids = NetworkTools.randomValues(0,this.size() - 1, size);
for(Integer i:ids) {
set.addData(this.getInput(i),this.getOutput(i));
}
return set;
}else return this;
}
public static void main(String[] args) {
TrainSet set = new TrainSet(3,2);
for(int i = 0; i < 8; i++) {
double[] a = new double[3];
double[] b = new double[2];
for(int k = 0; k < 3; k++) {
a[k] = (double)((int)(Math.random() * 10)) / (double)10;
if(k < 2) {
b[k] = (double)((int)(Math.random() * 10)) / (double)10;
}
}
set.addData(a,b);
}
System.out.println(set);
System.out.println(set.extractBatch(3));
}
@Override
public String toString() {
String s = "TrainSet ["+INPUT_SIZE+ " ; "+OUTPUT_SIZE+"]\n";
int index = 0;
for(double[][] r:data) {
s += index +": "+Arrays.toString(r[0]) +" >-||-< "+Arrays.toString(r[1]) +"\n";
index++;
}
return s;
}
public int size() {
return data.size();
}
public double[] getInput(int index) {
if(index >= 0 && index < size())
return data.get(index)[0];
else return null;
}
public double[] getOutput(int index) {
if(index >= 0 && index < size())
return data.get(index)[1];
else return null;
}
public int getINPUT_SIZE() {
return INPUT_SIZE;
}
public int getOUTPUT_SIZE() {
return OUTPUT_SIZE;
}
}
|
[
"pauli@LAPTOP-FRN1CJ25"
] |
pauli@LAPTOP-FRN1CJ25
|
e7993b37b6a850e81760f0a5a662290dda33966e
|
94e845c36da049daed6e91e011c7d4fb681fc8c7
|
/src/com/company/Producer.java
|
f0002d9cddedda9aece6fdd555da697f2e283af0
|
[] |
no_license
|
CoderBryGuy/ProducerConsumerProject
|
6e21230655c5668b4a5c02e291f63f73f9479e36
|
83c5ea11f4c59282ac2d55ef990ae27e8166cbb4
|
refs/heads/master
| 2022-08-01T17:26:38.911767 | 2020-05-26T17:19:43 | 2020-05-26T17:19:43 | 267,106,093 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,063 |
java
|
package com.company;
import java.util.List;
public class Producer implements Runnable{
List<Integer> questionsList = null;
final int LIMIT = 5;
private int questionNo;
public Producer(List<Integer> questionsList) {
this.questionsList = questionsList;
}
public void readQuestion(int questionNo) throws InterruptedException{
synchronized (questionsList) {
while (questionsList.size() == LIMIT) {
System.out.println("Questions have piled up ..wait for answers");
questionsList.wait();
}
}
synchronized (questionsList){
System.out.println("New Question: " + questionNo);
questionsList.add(questionNo);
Thread.sleep(100);
questionsList.notify();
}
}
@Override
public void run() {
while(true){
try {
readQuestion(questionNo++);
}catch (InterruptedException e){
e.printStackTrace();
}
}
}
}
|
[
"[email protected]"
] | |
cfab2e7a9b1e9e8d9cc39c1f0e813e223c95735e
|
52bf67c18568fd19b2952c019536f4921e29a52a
|
/src/main/java/org/assimbly/gateway/web/rest/ErrorEndpointResource.java
|
01bb1af339527bfe0b6a1ba5e612a7c215d563f8
|
[
"Apache-2.0"
] |
permissive
|
dewice/gateway
|
297f6fa7c14b34e943e29472d0f569ee69ee995c
|
223e8937e401e8ad66cccc89dbee6e11153399cf
|
refs/heads/master
| 2022-10-22T17:19:49.635562 | 2020-05-24T09:22:02 | 2020-05-24T09:22:02 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,927 |
java
|
package org.assimbly.gateway.web.rest;
import org.assimbly.gateway.service.ErrorEndpointService;
import org.assimbly.gateway.web.rest.errors.BadRequestAlertException;
import org.assimbly.gateway.web.rest.util.HeaderUtil;
import org.assimbly.gateway.service.dto.ErrorEndpointDTO;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
/**
* REST controller for managing ErrorEndpoint.
*/
@RestController
@RequestMapping("/api")
public class ErrorEndpointResource {
private final Logger log = LoggerFactory.getLogger(ErrorEndpointResource.class);
private static final String ENTITY_NAME = "errorEndpoint";
private final ErrorEndpointService errorEndpointService;
public ErrorEndpointResource(ErrorEndpointService errorEndpointService) {
this.errorEndpointService = errorEndpointService;
}
/**
* POST /error-endpoints : Create a new errorEndpoint.
*
* @param errorEndpointDTO the errorEndpointDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new errorEndpointDTO, or with status 400 (Bad Request) if the errorEndpoint has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/error-endpoints")
public ResponseEntity<ErrorEndpointDTO> createErrorEndpoint(@RequestBody ErrorEndpointDTO errorEndpointDTO) throws URISyntaxException {
log.debug("REST request to save ErrorEndpoint : {}", errorEndpointDTO);
if (errorEndpointDTO.getId() != null) {
throw new BadRequestAlertException("A new errorEndpoint cannot already have an ID", ENTITY_NAME, "idexists");
}
ErrorEndpointDTO result = errorEndpointService.save(errorEndpointDTO);
return ResponseEntity.created(new URI("/api/error-endpoints/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /error-endpoints : Updates an existing errorEndpoint.
*
* @param errorEndpointDTO the errorEndpointDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated errorEndpointDTO,
* or with status 400 (Bad Request) if the errorEndpointDTO is not valid,
* or with status 500 (Internal Server Error) if the errorEndpointDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/error-endpoints")
public ResponseEntity<ErrorEndpointDTO> updateErrorEndpoint(@RequestBody ErrorEndpointDTO errorEndpointDTO) throws URISyntaxException {
log.debug("REST request to update ErrorEndpoint : {}", errorEndpointDTO);
if (errorEndpointDTO.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
ErrorEndpointDTO result = errorEndpointService.save(errorEndpointDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, errorEndpointDTO.getId().toString()))
.body(result);
}
/**
* GET /error-endpoints : get all the errorEndpoints.
*
* @return the ResponseEntity with status 200 (OK) and the list of errorEndpoints in body
*/
@GetMapping("/error-endpoints")
public List<ErrorEndpointDTO> getAllErrorEndpoints() {
log.debug("REST request to get all ErrorEndpoints");
return errorEndpointService.findAll();
}
/**
* GET /error-endpoints/:id : get the "id" errorEndpoint.
*
* @param id the id of the errorEndpointDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the errorEndpointDTO, or with status 404 (Not Found)
*/
@GetMapping("/error-endpoints/{id}")
public ResponseEntity<ErrorEndpointDTO> getErrorEndpoint(@PathVariable Long id) {
log.debug("REST request to get ErrorEndpoint : {}", id);
Optional<ErrorEndpointDTO> errorEndpointDTO = errorEndpointService.findOne(id);
return ResponseUtil.wrapOrNotFound(errorEndpointDTO);
}
/**
* DELETE /error-endpoints/:id : delete the "id" errorEndpoint.
*
* @param id the id of the errorEndpointDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/error-endpoints/{id}")
public ResponseEntity<Void> deleteErrorEndpoint(@PathVariable Long id) {
log.debug("REST request to delete ErrorEndpoint : {}", id);
errorEndpointService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}
|
[
"[email protected]"
] | |
737a89cae27ad522d4b660b28fa9b4dcfae03f2e
|
a1385d076aba4a103e5973233c3425203c056a58
|
/MyProject/BFUBChannels/src/com/trapedza/bankfusion/fatoms/MGM_InvokeMoneyGram.java
|
8fb1dc1f184dc1832cb2145cfdc2d5593fd933fe
|
[] |
no_license
|
Singhmnish1947/java1.8
|
8ff0a83392b051e5614e49de06556c684ff4283e
|
6b2d4dcf06c5fcbb13c2c2578706a825aaa4dc03
|
refs/heads/master
| 2021-07-10T17:38:55.581240 | 2021-04-08T12:36:02 | 2021-04-08T12:36:02 | 235,827,640 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,440 |
java
|
/* ********************************************************************************
* Copyright(c)2007 Misys Financial Systems Ltd. All Rights Reserved.
*
*
*
*
*
* This software is the proprietary information of Misys Financial Systems Ltd.
* Use is subject to license terms.
*
* ********************************************************************************
*
* $Id: MGM_InvokeMoneyGram.java,v 1.4 2008/08/12 20:13:59 vivekr Exp $
*
* $Log: MGM_InvokeMoneyGram.java,v $
* Revision 1.4 2008/08/12 20:13:59 vivekr
* Merge from 3-3B branch to Head (Ref_Tag_UB-33B_11Aug08)
*
* Revision 1.2.4.1 2008/07/03 17:55:54 vivekr
* Moved from Dublin CVS Head (For BF1.01 package restructuring)
*
* Revision 1.5 2008/06/16 15:21:34 arun
* UB Refactoring -
* 1. Formatted/Organized imports
* 2. BODefinitionException, InvalidExtensionPointException and references removed
* 3. Removed ServerManager deprecated methods/variables
* 4. BankfusionPropertyAccess removed - changed to BankfusionPropertySupport
* 5. Exception Handling refactoring
* 6. General Refactoring
*
* Revision 1.4 2008/06/12 10:51:53 arun
* RIO on Head
*
* Revision 1.2 2007/09/28 12:10:43 vinayac
* Moneygram Refresh Activity Steps
*
*
*
* * Code has been changed for Ref : Raised in SFDC with case reference as 00333384 and CSFE artf39821 Date : 19/06/2009
* Changes are :
* 1. Removed hard coded value to handle timeout period.
* 2. Implemented socket.setSoTimeout method to replace number of while loop.
* 3. Removed commented codes.
* 4. Handled exception for Transaction Time Out period to display proper error message inplace of going offline.
*
*/
package com.trapedza.bankfusion.fatoms;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketTimeoutException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.misys.ub.moneygram.MGM_ExceptionHelper;
import com.misys.ub.moneygram.MGM_ReadProperties;
import com.trapedza.bankfusion.boundary.outward.BankFusionPropertySupport;
import com.trapedza.bankfusion.core.BankFusionException;
import com.trapedza.bankfusion.core.CommonConstants;
import com.trapedza.bankfusion.servercommon.commands.BankFusionEnvironment;
import com.trapedza.bankfusion.steps.refimpl.AbstractMGM_InvokeMoneyGram;
import com.trapedza.bankfusion.steps.refimpl.IMGM_InvokeMoneyGram;
/**
* This fatom sends the xml request to MoneyGram remote server and receives the xml response
* synchronously through a given server ip address and port.
*
* @author nileshk
*
*/
// Time is calculated in Seconds.
public class MGM_InvokeMoneyGram extends AbstractMGM_InvokeMoneyGram implements IMGM_InvokeMoneyGram {
/**
* <code>svnRevision</code> = $Revision: 1.0 $
*/
public static final String svnRevision = "$Revision: 1.0 $";
static {
com.trapedza.bankfusion.utils.Tracer.register(svnRevision);
}
/**
* Logger defined.
*/
private transient final static Log logger = LogFactory.getLog(MGM_InvokeMoneyGram.class.getName());
private String mgRequestXML;
private String mgResponseXML;
private static final char endCharacter = '\u0000';
private int serverPort;
private String address;
protected boolean isTimerStarted;
protected boolean TimeOut;
protected long timerStartTime;
protected long lTimeOut;
private Integer iTimeOut = new Integer(0);
public static final String MONEYGRAM_PROPERTY_FILENAME = "conf/moneygram/moneygram.properties";
public static final String TIMEOUT = "TimeOut";
/**
* Constructor
*
* @param env
*/
public MGM_InvokeMoneyGram(BankFusionEnvironment env) {
super(env);
}
/**
* @see com.trapedza.bankfusion.steps.refimpl.AbstractMGM_InvokeMoneyGram#process(com.trapedza.bankfusion.servercommon.commands.BankFusionEnvironment)
* @param environment
* The BankFusion Environment @
*/
public void process(BankFusionEnvironment environment) {
mgRequestXML = this.getF_IN_InputXML();
lTimeOut = getTimeOut();
String sTimeout = String.valueOf(lTimeOut);
iTimeOut = Integer.valueOf(sTimeout);
try {
mgResponseXML = getMoneyGramResponse(mgRequestXML, environment);
logger.debug("MoneyGram response :" + mgResponseXML);
}
catch (IOException e) {
logger.error("IOException", e);
MGM_ExceptionHelper exceptionHelper = new MGM_ExceptionHelper();
exceptionHelper.throwMoneyGramException(006, environment);
}
catch (Exception e) {
throw new BankFusionException(40507007, new Object[] { e.getLocalizedMessage() }, logger, e);
}
this.setF_OUT_OutputXML(mgResponseXML);
logger.info("MoneyGram response from server received successfully");
}
/**
* This method take the xml string and send it to MoneyGram server and returns the response as
* xml string.
*
* @param reqXML
* @return responseXML @
*/
public String getMoneyGramResponse(String reqXML, BankFusionEnvironment env) throws Exception {
String resXML = CommonConstants.EMPTY_STRING;
serverPort = (this.getF_IN_MoneyGramServerPort()).intValue();
address = this.getF_IN_MoneyGramIPAddress();
InetAddress ipAddress = InetAddress.getByName(address);
logger.info("Invoking remote server");
Socket socket;
socket = new Socket(ipAddress, serverPort);
// This Code has been added to replace manually check time out method.
socket.setSoTimeout(iTimeOut);
logger.debug("Remote server invoked at port no " + serverPort + "and at ip address " + address);
InputStream inputStream = socket.getInputStream();
OutputStream outputStream = socket.getOutputStream();
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream));
bufferedWriter.write(reqXML + endCharacter);
bufferedWriter.flush();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line = null;
try {
while ((line = bufferedReader.readLine()) != null) {
String initialLine = line.trim();
line = initialLine.trim();
resXML += line;
logger.info("getMoneyGramResponse executed successfull");
}
}
catch (SocketTimeoutException ste) {
logger.error(ste);
if (logger.isInfoEnabled())
logger.info("No Response Received from MoneyGram " + ste.getMessage());
throw new BankFusionException(40507007, new Object[] { "Transaction Time Out" }, logger, null);
}
finally {
try {
inputStream.close();
bufferedReader.close();
}
catch (Exception e) {
if (logger.isErrorEnabled()) {
logger.error("Exception occured" + e);
}
}
try{
socket.close();
}catch (Exception e){
logger.error("Exception occured" + e);
}
}
String responseXML = resXML.trim();
return responseXML;
}
long getTimeOut() {
String timeOut = "0.0";
try {
timeOut = BankFusionPropertySupport.getProperty(MGM_ReadProperties.MONEYGRAM_PROPERTY_FILENAME,
MGM_ReadProperties.TIMEOUT, "40000");
}
catch (Exception ioe) {
// General Exception is caught temporary purpose only should be removed once appropriate
// exception
// This will be identified by testing.
if (logger.isInfoEnabled()) {
logger.info("Error reading MoneyGram properties file defaulting TimeOut to 40000" + ioe.getMessage());
}
timeOut = "40000";
logger.error(ioe);
}
if (timeOut == null)
timeOut = "40000";
return Long.valueOf(timeOut);
}
}
|
[
"[email protected]"
] | |
7e337d9105ab55a2609217c6237e91652fb8ac3d
|
2f4deca995608f52fa0337395bbc8891bed2d7c0
|
/src/com/mitrais/rms/servlet/LoginServlet.java
|
f818f0d428cf00a1fd8f240d03660cdb740cc067
|
[] |
no_license
|
aldyanimayazar/rms-case-study
|
46721b480b885f337dc6e4c76eeb4411da19641f
|
11f22c18f7d5d8b015c0d943fff540f73482d90f
|
refs/heads/master
| 2020-04-19T15:24:01.641114 | 2019-01-30T03:41:16 | 2019-01-30T03:41:16 | 168,272,993 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,978 |
java
|
package com.mitrais.rms.servlet;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.mitrais.rms.servlet.Models.ImplUsers;
import com.mitrais.rms.servlet.Models.Users;
import com.mitrais.rms.servlet.Models.UsersDao;
/**
* Servlet implementation class LoginServlet
*/
@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public LoginServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String email = request.getParameter("username");
String pass = request.getParameter("password");
UsersDao usersDao = ImplUsers.getInstance();
List<Users> users = usersDao.authentication(email, pass);
if(users.isEmpty()) {
response.sendRedirect("login.jsp");
} else {
HttpSession session = request.getSession(true);
for (Users getSession : users) {
session.setAttribute("id", getSession.getId());
session.setAttribute("firstname", getSession.getFirstname());
session.setAttribute("lastname", getSession.getLastname());
session.setAttribute("email", getSession.getEmail());
response.sendRedirect("users/main");
}
}
}
}
|
[
"[email protected]"
] | |
1d3b7e2dc84ab9168d73564745a54d2dae2ff0f3
|
4e56f56a1762e00a63c80cf59a57bfd014fed609
|
/time-tracking-backend/data/src/main/java/cz/cvut/fit/timetracking/data/service/WorkRecordDataService.java
|
d0d88682dec15976307c1867da3551c767e71556
|
[] |
no_license
|
raestio/time-tracking
|
661b56024b7e0389e66d5e69ebfd36a5dc1c4e85
|
163401ab739285ad627a4ff88de58c65ed3c31a5
|
refs/heads/master
| 2020-05-01T10:40:56.887336 | 2020-01-22T21:25:11 | 2020-01-22T21:25:23 | 177,425,884 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,133 |
java
|
package cz.cvut.fit.timetracking.data.service;
import cz.cvut.fit.timetracking.data.api.dto.WorkRecordDTO;
import cz.cvut.fit.timetracking.data.api.dto.WorkRecordDTOLight;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;
public interface WorkRecordDataService {
WorkRecordDTOLight createOrUpdate(WorkRecordDTOLight workRecordDTOLight);
WorkRecordDTO createOrUpdate(WorkRecordDTO workRecordDTO);
Optional<WorkRecordDTO> findById(Integer id);
List<WorkRecordDTO> findAllBetween(LocalDateTime fromInclusive, LocalDateTime toExclusive);
List<WorkRecordDTO> findAllBetweenByUserId(LocalDateTime fromInclusive, LocalDateTime toExclusive, Integer userId);
List<WorkRecordDTO> findAllBetweenByProjectId(LocalDateTime fromInclusive, LocalDateTime toExclusive, Integer projectId);
List<WorkRecordDTO> findAllWorkRecordsBetweenByUserIdAndProjectId(LocalDateTime fromInclusive, LocalDateTime toExclusive, Integer userId, Integer projectId);
void deleteById(Integer id);
boolean recordTimesOverlapsWithOtherRecords(LocalDateTime from, LocalDateTime to, Integer userId);
}
|
[
"[email protected]"
] | |
9cd9e1f18bbb274e6a2f3a941f6aa64e231bbc5c
|
8542b634b013b41b3d18399c0f18d00e92cad17e
|
/app/src/main/java/com/ornyxoft/ique/QuestionDialogActivity.java
|
c3c4b61d25cfec167750778e306476948bc0a2a3
|
[] |
no_license
|
daviesray-ornyx/iqueue
|
d22d85da14cc88893665ef6e128864a025ab9b73
|
1fd4e041863dde95df53c14fe59a787fe8f2af35
|
refs/heads/master
| 2020-06-08T14:08:38.780495 | 2014-08-12T02:32:01 | 2014-08-12T02:32:01 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,093 |
java
|
package com.ornyxoft.ique;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.ornyxoft.ique.R;
public class QuestionDialogActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_question_dialog);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.question_dialog, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
|
[
"[email protected]"
] | |
b1cda891c5f38337fed10b953826495af3b871fc
|
2e5bf3a3b5659bce5b1ed8aef6e29f8b8b4fc287
|
/src/test/java/com/graphaware/nlp/integration/GermanPipelineTest.java
|
18019a2dc0d21fc3cde93ea1594d3071617d4036
|
[] |
no_license
|
gym0569/neo4j-nlp-stanfordnlp
|
6766b9eac268d6355b865d8c40e2a4373ffc6814
|
e7e0c73fe480fb8a01c95be5a5ddac54b86bc138
|
refs/heads/master
| 2020-04-22T09:21:01.644609 | 2019-01-03T05:13:26 | 2019-01-03T05:13:26 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,300 |
java
|
package com.graphaware.nlp.integration;
import com.graphaware.nlp.StanfordNLPIntegrationTest;
import org.junit.Test;
import static org.junit.Assert.*;
public class GermanPipelineTest extends StanfordNLPIntegrationTest {
private static String TEXT = "Schon auf den ersten Blick fällt die Wappenbratsche von Steffen Friedel durch ihre extravagante Gestaltung auf. Diese orientiert sich an der Form der f-Löcher einer Campanula von H. Bleffert sowie dem Wirbelkastenkopf der Dancing Masters Violine „Gillott“ 1720 von A. Stradivari. Wie das Design gefielen auch die weiteren Eigenschaften des Instruments: Sowohl die Spielbarkeit als auch die Ansprache überzeugten die Testmusiker in allen Belangen. Ihre Bestbewertungen gaben sie unter anderem für den offenen Klang, das Klangvolumen und die Variabilität. Insgesamt beschrieben die Juroren die Wappenbratsche als innovativ und gefällig. Die zweitbeste Bewertung innerhalb der objektiven Tests und der vierte Rang in der fertigungstechnischen Begutachtung ergänzten die sehr positiven Meinungen. Die Wappenbratsche (Korpuslänge: 415 mm) setzt sich aus hochwertiger tiroler Fichte für die Decke und bosnischem Ahorn für den Boden zusammen. Zargen und Hals entsprechen dem klassischen Geigenbau. Abrundung findet das Instrument durch eine Lackierung mit Leinöllack auf Grundlage von Dammar und Kopal.";
@Test
public void testAnnotatingTextWithDefaultGermanPipeline() {
String q = "CALL ga.nlp.processor.addPipeline({\n" +
"name: \"de-muz-noner\",\n" +
"textProcessor: \"com.graphaware.nlp.processor.stanford.StanfordTextProcessor\",\n" +
"processingSteps: {tokenize: true, ner: true},\n" +
"language: \"german\"\n" +
"})";
executeInTransaction(q, emptyConsumer());
executeInTransaction("CREATE (n:Document) SET n.text = $p0", buildSeqParameters(TEXT), emptyConsumer());
executeInTransaction("MATCH (n:Document)\n" +
"CALL ga.nlp.annotate({pipeline: \"de-muz-noner\", id: id(n), text: n.text, checkLanguage: false})\n" +
"YIELD result MERGE (n)-[:HAS_ANNOTATED_TEXT]->(result) RETURN result", (result -> {
assertTrue(result.hasNext());
}));
}
}
|
[
"[email protected]"
] | |
1837d1f7004d8805e7b23dc8fb942ef3fc4f0660
|
109e1bf1c74055926250d6f7808888c4513e53ac
|
/src/main/java/com/xuyang/crm/file/factory/type/FileType1.java
|
7a4ef775d0b515200ffe0717148011830018bd6c
|
[] |
no_license
|
xyXuYang111/crm
|
4ddced662c00a6d19d9166a477c770ad88403a28
|
581d6bfc073074ece1a4731fb33f94f0196dedad
|
refs/heads/master
| 2022-12-25T00:45:12.762020 | 2019-10-08T01:09:50 | 2019-10-08T01:09:50 | 184,996,291 | 1 | 0 | null | 2022-12-16T04:52:04 | 2019-05-05T07:36:14 |
HTML
|
UTF-8
|
Java
| false | false | 1,443 |
java
|
package com.xuyang.crm.file.factory.type;
import com.xuyang.crm.file.def.FileDef;
import com.xuyang.crm.file.factory.AbstractFile;
import com.xuyang.crm.util.FileUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import java.util.UUID;
/**
* @Auther: 许洋
* @Date: 2019/9/7 22:31
* @Description:
*/
@Component
@Slf4j
@Data
@Scope("prototype")
public class FileType1 extends AbstractFile {
@Override
public void fileUpload() throws Exception {
MultipartFile multipartFile = files.getMultipartFile();
String fileName = multipartFile.getOriginalFilename();
String fileType = FileUtil.fileTyp2(fileName);
String systemName = UUID.randomUUID().toString();
StringBuilder filePathBuilder = new StringBuilder();
filePathBuilder.append(FileDef.FILE_TYPE_1_URL);
filePathBuilder.append(systemName);
filePathBuilder.append(fileType);
files.setFileType("文本");
files.setFilePath(filePathBuilder.toString());
files.setFileName(fileName);
files.setSystemName(systemName + fileType);
files.setFilePath(filePathBuilder.toString());
super.fileUpload();
}
@Override
public void fileDown() throws Exception {
super.fileDown();
}
}
|
[
"[email protected]"
] | |
a986c26bf23ea287cad2ca952e2d1b1d8e1d866f
|
50d6e6aa79654ac8a95fcfaa27442e521fb3c543
|
/src/main/java/com/zl/geekdesign/chain/type3/HandlerA3.java
|
67bdeee904268849fb7f78a2f0945793bdb24f95
|
[] |
no_license
|
longzhang0314/geekdesign
|
0b6cfeae0b14cbea3fe24ec21ac05bbc0d9aa2a0
|
51f4906054a21ee668281e6456cc31978a417d72
|
refs/heads/master
| 2022-07-09T18:39:26.344530 | 2020-10-26T12:32:35 | 2020-10-26T12:32:35 | 251,515,758 | 0 | 0 | null | 2022-06-21T03:10:03 | 2020-03-31T06:11:10 |
Java
|
UTF-8
|
Java
| false | false | 255 |
java
|
package com.zl.geekdesign.chain.type3;
/**
* @author liusha
* @date 2020/10/15
*/
public class HandlerA3 implements IHandler3 {
@Override
public boolean handler() {
boolean handler = false;
// ...
return false;
}
}
|
[
"[email protected]"
] | |
484edff5dc1e3b7f856385432f85218a351e9023
|
7b64add6b19699b564ad7802c5c9fb4dba6ed096
|
/app/src/main/java/ph/roadtrip/roadtrip/bookingmodule/MyBookingsFragmentAdapter.java
|
84dd1188ecf74c14beb742faa152b6b930959bf5
|
[] |
no_license
|
carlbaldemor/roadtripph
|
8daa21e54a8472e195230fa9792dc073c45874f6
|
e974daf3dbe0bf8ed6a5fffde115016660be2fde
|
refs/heads/master
| 2020-07-30T04:10:03.582622 | 2019-11-30T10:36:45 | 2019-11-30T10:36:45 | 210,080,554 | 0 | 0 | null | 2019-09-29T02:26:17 | 2019-09-22T02:40:41 |
Java
|
UTF-8
|
Java
| false | false | 1,257 |
java
|
package ph.roadtrip.roadtrip.bookingmodule;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
public class MyBookingsFragmentAdapter extends android.support.v4.app.FragmentPagerAdapter {
private Context mContext;
public MyBookingsFragmentAdapter(FragmentManager fm) {
super(fm);
}
// This determines the fragment for each tab
@Override
public Fragment getItem(int position) {
if (position == 0) {
return new CurrentBookingFragment();
} else if (position == 1){
return new PendingBookingFragment();
}else {
return new PenaltyBookingFragment();
}
}
// This determines the number of tabs
@Override
public int getCount() {
return 3;
}
// This determines the title for each tab
@Override
public CharSequence getPageTitle(int position) {
// Generate title based on item position
switch (position) {
case 0:
return "Current";
case 1:
return "Pending";
case 2:
return "Penalties";
default:
return null;
}
}
}
|
[
"[email protected]"
] | |
b7b94a2ac976c63788353416cee88f61babc8d34
|
fa272c43bf1a54f31c8d0a32d62dedb49e1f0a41
|
/src/main/java/com/tourGuide/domain/UserPreferences.java
|
f96f0068954ddc5ad1428f7a7df905d7b863a839
|
[] |
no_license
|
Tortique/TourGuide
|
b5c7e3066c7e140890c4bc415be067e5645709d3
|
bc911194dbdd82fccc6d17199e9ac1abe03675df
|
refs/heads/master
| 2023-07-05T22:15:51.237141 | 2021-08-09T12:27:29 | 2021-08-09T12:27:29 | 394,275,961 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,013 |
java
|
package com.tourGuide.domain;
import javax.money.CurrencyUnit;
import javax.money.Monetary;
import org.javamoney.moneta.Money;
public class UserPreferences {
private int attractionProximity = Integer.MAX_VALUE;
private CurrencyUnit currency = Monetary.getCurrency("USD");
private Money lowerPricePoint = Money.of(0, currency);
private Money highPricePoint = Money.of(Integer.MAX_VALUE, currency);
private int tripDuration = 1;
private int ticketQuantity = 1;
private int numberOfAdults = 1;
private int numberOfChildren = 0;
public UserPreferences(int tripDuration, int ticketQuantity, int numberOfAdults, int numberOfChildren) {
this.tripDuration = tripDuration;
this.ticketQuantity = ticketQuantity;
this.numberOfAdults = numberOfAdults;
this.numberOfChildren = numberOfChildren;
}
public UserPreferences() {
}
public void setAttractionProximity(int attractionProximity) {
this.attractionProximity = attractionProximity;
}
public int getAttractionProximity() {
return attractionProximity;
}
public Money getLowerPricePoint() {
return lowerPricePoint;
}
public void setLowerPricePoint(Money lowerPricePoint) {
this.lowerPricePoint = lowerPricePoint;
}
public Money getHighPricePoint() {
return highPricePoint;
}
public void setHighPricePoint(Money highPricePoint) {
this.highPricePoint = highPricePoint;
}
public int getTripDuration() {
return tripDuration;
}
public void setTripDuration(int tripDuration) {
this.tripDuration = tripDuration;
}
public int getTicketQuantity() {
return ticketQuantity;
}
public void setTicketQuantity(int ticketQuantity) {
this.ticketQuantity = ticketQuantity;
}
public int getNumberOfAdults() {
return numberOfAdults;
}
public void setNumberOfAdults(int numberOfAdults) {
this.numberOfAdults = numberOfAdults;
}
public int getNumberOfChildren() {
return numberOfChildren;
}
public void setNumberOfChildren(int numberOfChildren) {
this.numberOfChildren = numberOfChildren;
}
}
|
[
"[email protected]"
] | |
66a8f78076d3df9b309e1942714626b3544803fe
|
97fd02f71b45aa235f917e79dd68b61c62b56c1c
|
/src/main/java/com/tencentcloudapi/tke/v20180525/models/UninstallEdgeLogAgentRequest.java
|
5bd21a9820e05836f6f51cff618e07b25eb0d3a2
|
[
"Apache-2.0"
] |
permissive
|
TencentCloud/tencentcloud-sdk-java
|
7df922f7c5826732e35edeab3320035e0cdfba05
|
09fa672d75e5ca33319a23fcd8b9ca3d2afab1ec
|
refs/heads/master
| 2023-09-04T10:51:57.854153 | 2023-09-01T03:21:09 | 2023-09-01T03:21:09 | 129,837,505 | 537 | 317 |
Apache-2.0
| 2023-09-13T02:42:03 | 2018-04-17T02:58:16 |
Java
|
UTF-8
|
Java
| false | false | 2,016 |
java
|
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.tke.v20180525.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class UninstallEdgeLogAgentRequest extends AbstractModel{
/**
* 集群ID
*/
@SerializedName("ClusterId")
@Expose
private String ClusterId;
/**
* Get 集群ID
* @return ClusterId 集群ID
*/
public String getClusterId() {
return this.ClusterId;
}
/**
* Set 集群ID
* @param ClusterId 集群ID
*/
public void setClusterId(String ClusterId) {
this.ClusterId = ClusterId;
}
public UninstallEdgeLogAgentRequest() {
}
/**
* NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
* and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
*/
public UninstallEdgeLogAgentRequest(UninstallEdgeLogAgentRequest source) {
if (source.ClusterId != null) {
this.ClusterId = new String(source.ClusterId);
}
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "ClusterId", this.ClusterId);
}
}
|
[
"[email protected]"
] | |
d2b014200bb1a3ac7fd865ce63c385e7630e3c7a
|
ac08312ad70727c1b2bc04e54e9e1e213c0eb48b
|
/Buttons/src/Buttons/Habitacion.java
|
014345e8ae7d7f8d128e74fe159f796cd9af400d
|
[
"MIT"
] |
permissive
|
anayarojo/university-java-practices
|
9ae3692223739ab8ba01397f84e3cafe2144257f
|
e48e811898f8282e3fb4e8a25123abd891e2399f
|
refs/heads/master
| 2020-06-21T01:28:26.512298 | 2019-07-17T03:48:02 | 2019-07-17T03:48:02 | 197,309,668 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,541 |
java
|
package Buttons;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JPanel;
public class Habitacion extends javax.swing.JLabel implements MouseListener {
JPanel P=new JPanel();
Color entrar=Color.RED;
Color salir=Color.GRAY;
public Habitacion(){
super();
//se le da un tamaño
this.setPreferredSize(new Dimension(260,60));
//se le coloca una imagen
this.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/On.png")));
//se cambia de cursor default por otro, el de la "manito"
this.setCursor(new Cursor(Cursor.HAND_CURSOR));
//se añade los eventos del mouse
P.setSize(this.getSize());
this.add(P);
this.addMouseListener(this);
}
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
this.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/On.png")));
P.setBackground(entrar);
}
@Override
public void mouseExited(MouseEvent e) {
this.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Off.png")));
P.setBackground(salir);
}
}
|
[
"[email protected]"
] | |
c5c2f9876f70fb5a6c58a9afe56dc4b05ac30a19
|
4312a71c36d8a233de2741f51a2a9d28443cd95b
|
/RawExperiments/TB/Math95/AstorMain-math_95/src/variant-972/org/apache/commons/math/distribution/FDistributionImpl.java
|
a47b7c6e6699ffa7041451a0ff95b65a3583a517
|
[] |
no_license
|
SajjadZaidi/AutoRepair
|
5c7aa7a689747c143cafd267db64f1e365de4d98
|
e21eb9384197bae4d9b23af93df73b6e46bb749a
|
refs/heads/master
| 2021-05-07T00:07:06.345617 | 2017-12-02T18:48:14 | 2017-12-02T18:48:14 | 112,858,432 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,683 |
java
|
package org.apache.commons.math.distribution;
public class FDistributionImpl extends org.apache.commons.math.distribution.AbstractContinuousDistribution implements java.io.Serializable , org.apache.commons.math.distribution.FDistribution {
private static final long serialVersionUID = -8516354193418641566L;
private double numeratorDegreesOfFreedom;
private double denominatorDegreesOfFreedom;
public FDistributionImpl(double numeratorDegreesOfFreedom ,double denominatorDegreesOfFreedom) {
super();
setNumeratorDegreesOfFreedom(numeratorDegreesOfFreedom);
setDenominatorDegreesOfFreedom(denominatorDegreesOfFreedom);
}
public double cumulativeProbability(double x) throws org.apache.commons.math.MathException {
double ret;
if (x <= 0.0) {
ret = 0.0;
} else {
double n = getNumeratorDegreesOfFreedom();
double m = getDenominatorDegreesOfFreedom();
ret = org.apache.commons.math.special.Beta.regularizedBeta(((n * x) / (m + (n * x))), (0.5 * n), (0.5 * m));
}
return ret;
}
public double inverseCumulativeProbability(final double p) throws org.apache.commons.math.MathException {
if (p == 0) {
return 0.0;
}
if (p == 1) {
return java.lang.Double.POSITIVE_INFINITY;
}
return (getGamma().getAlpha()) * 2.0;
}
protected double getDomainLowerBound(double p) {
return 0.0;
}
protected double getDomainUpperBound(double p) {
return java.lang.Double.MAX_VALUE;
}
protected double getInitialDomain(double p) {
double ret;
double d = getDenominatorDegreesOfFreedom();
ret = d / (d - 2.0);
return ret;
}
public void setNumeratorDegreesOfFreedom(double degreesOfFreedom) {
if (degreesOfFreedom <= 0.0) {
throw new java.lang.IllegalArgumentException("degrees of freedom must be positive.");
}
org.apache.commons.math.distribution.FDistributionImpl.this.numeratorDegreesOfFreedom = degreesOfFreedom;
}
public double getNumeratorDegreesOfFreedom() {
return numeratorDegreesOfFreedom;
}
public void setDenominatorDegreesOfFreedom(double degreesOfFreedom) {
if (degreesOfFreedom <= 0.0) {
throw new java.lang.IllegalArgumentException("degrees of freedom must be positive.");
}
org.apache.commons.math.distribution.FDistributionImpl.this.denominatorDegreesOfFreedom = degreesOfFreedom;
}
public double getDenominatorDegreesOfFreedom() {
return denominatorDegreesOfFreedom;
}
}
|
[
"[email protected]"
] | |
8212733817324d0de019016e11a2653451d5ee07
|
ff7e107a5068b07436342353dbf912d587c3840b
|
/flow-master0925---处理/flow-master0925/flow/flow-server/src/main/java/com/zres/project/localnet/portal/cloudNetWork/service/CloudNetAutoCheckService.java
|
b1315d8aca2143d3cb203691480944a6b73b8eb5
|
[] |
no_license
|
lichao20000/resflow-master
|
0f0668c7a6cb03cafaca153b9e9b882b2891b212
|
78217aa31f17dd5c53189e695a3a0194fced0d0a
|
refs/heads/master
| 2023-01-27T19:15:40.752341 | 2020-12-10T02:07:32 | 2020-12-10T02:07:32 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,922 |
java
|
package com.zres.project.localnet.portal.cloudNetWork.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* MCPE设备资源自动核查接口
*
* @author caomm on 2020/11/25
*/
@Service
public class CloudNetAutoCheckService {
private static final Logger logger = LoggerFactory.getLogger(CloudNetAutoCheckService.class);
@Autowired
private CloudNetCommonService cloudNetCommonService;
public Map<String, Object> autoCheck(String request){
Map<String, Object> retMap = new HashMap<>();
Map<String, Object> logMap = new HashMap<>();
try{
logMap.put("interfName", "MCPE设备资源自动核查接口");
logMap.put("url", "/cloudNetWork/interfaceBDW/autoCheck.spr");
logMap.put("content", request);
logMap.put("remark", "接收MCPE设备资源自动核查报文");
JSONObject json = JSON.parseObject(request);
String PROVINCE = json.getString("PROVINCE");
String CITY = json.getString("CITY");
String ADDRESS = json.getString("ADDRESS");
String CUST_ID = json.getString("CUST_ID");
logMap.put("orderNo", CUST_ID);
cloudNetCommonService.insertLogInfo(logMap);
retMap.put("CODE", "0");
retMap.put("MESSAGE", "MCPE设备资源自动核查成功!");
}catch (Exception e){
logger.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>MCPE设备资源自动核查发生异常:{}", e.getMessage());
retMap.put("CODE", "1");
retMap.put("MESSAGE", "MCPE设备资源自动核查发生异常:" + e.getMessage());
}
return retMap;
}
}
|
[
"[email protected]"
] | |
d88a5995ccd87949f4844d35cc5c7e3eb5d691b6
|
9623f83defac3911b4780bc408634c078da73387
|
/powercraft_146/src/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
eca33038f6b5115f0aee92d46e13a6e18554faaf
|
[] |
no_license
|
BlearStudio/powercraft-legacy
|
42b839393223494748e8b5d05acdaf59f18bd6c6
|
014e9d4d71bd99823cf63d4fbdb65c1b83fde1f8
|
refs/heads/master
| 2021-01-21T21:18:55.774908 | 2015-04-06T20:45:25 | 2015-04-06T20:45:25 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 26,138 |
java
|
package net.minecraft.client.gui.inventory;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import codechicken.nei.forge.GuiContainerManager;
import codechicken.nei.forge.IContainerClientSide;
@SideOnly(Side.CLIENT)
public abstract class GuiContainer extends GuiScreen
{
/** Stacks renderer. Icons, stack size, health, etc... */
public static RenderItem itemRenderer = new RenderItem();
/** The X size of the inventory window in pixels. */
public int xSize = 176;
/** The Y size of the inventory window in pixels. */
public int ySize = 166;
/** A list of the players inventory slots. */
public Container inventorySlots;
/**
* Starting X position for the Gui. Inconsistent use for Gui backgrounds.
*/
public int guiLeft;
/**
* Starting Y position for the Gui. Inconsistent use for Gui backgrounds.
*/
public int guiTop;
private Slot theSlot;
/** Used when touchscreen is enabled */
private Slot clickedSlot = null;
private boolean field_90018_r = false;
/** Used when touchscreen is enabled */
private ItemStack draggedStack = null;
private int field_85049_r = 0;
private int field_85048_s = 0;
private Slot returningStackDestSlot = null;
private long returningStackTime = 0L;
/** Used when touchscreen is enabled */
private ItemStack returningStack = null;
private Slot field_92033_y = null;
private long field_92032_z = 0L;
public GuiContainerManager manager;
public GuiContainer(Container par1Container)
{
this.inventorySlots = par1Container;
}
@Override
public void setWorldAndResolution(Minecraft mc, int i, int j)
{
super.setWorldAndResolution(mc, i, j);
if(mc.currentScreen == this)
{
manager = new GuiContainerManager(this);
manager.load();
}
}
/**
* Adds the buttons (and other controls) to the screen in question.
*/
public void initGui()
{
super.initGui();
this.mc.thePlayer.openContainer = this.inventorySlots;
this.guiLeft = (this.width - this.xSize) / 2;
this.guiTop = (this.height - this.ySize) / 2;
}
/**
* Draws the screen and all the components in it.
*/
public void drawScreen(int par1, int par2, float par3)
{
manager.preDraw();
this.drawDefaultBackground();
int var4 = this.guiLeft;
int var5 = this.guiTop;
this.drawGuiContainerBackgroundLayer(par3, par1, par2);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
super.drawScreen(par1, par2, par3);
RenderHelper.enableGUIStandardItemLighting();
GL11.glPushMatrix();
GL11.glTranslatef((float)var4, (float)var5, 0.0F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
this.theSlot = null;
short var6 = 240;
short var7 = 240;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int var9;
boolean objectundermouse = manager.objectUnderMouse(par1, par2);
for (int var13 = 0; var13 < this.inventorySlots.inventorySlots.size(); ++var13)
{
Slot var14 = (Slot)this.inventorySlots.inventorySlots.get(var13);
this.drawSlotInventory(var14);
if (this.isMouseOverSlot(var14, par1, par2) && !objectundermouse)
{
this.theSlot = var14;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
int var8 = var14.xDisplayPosition;
var9 = var14.yDisplayPosition;
this.drawGradientRect(var8, var9, var8 + 16, var9 + 16, -2130706433, -2130706433);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
}
this.drawGuiContainerForegroundLayer(par1, par2);
GL11.glTranslatef(-var4, -var5, 200F);
manager.renderObjects(par1, par2);
GL11.glTranslatef(var4, var5, -200F);
InventoryPlayer var15 = this.mc.thePlayer.inventory;
ItemStack var16 = this.draggedStack == null ? var15.getItemStack() : this.draggedStack;
if (var16 != null)
{
byte var18 = 8;
var9 = this.draggedStack == null ? 8 : 16;
if (this.draggedStack != null && this.field_90018_r)
{
var16 = var16.copy();
var16.stackSize = MathHelper.ceiling_float_int((float)var16.stackSize / 2.0F);
}
this.drawItemStack(var16, par1 - var4 - var18, par2 - var5 - var9);
}
if (this.returningStack != null)
{
float var17 = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F;
if (var17 >= 1.0F)
{
var17 = 1.0F;
this.returningStack = null;
}
var9 = this.returningStackDestSlot.xDisplayPosition - this.field_85049_r;
int var10 = this.returningStackDestSlot.yDisplayPosition - this.field_85048_s;
int var11 = this.field_85049_r + (int)((float)var9 * var17);
int var12 = this.field_85048_s + (int)((float)var10 * var17);
this.drawItemStack(this.returningStack, var11, var12);
}
/*
if (var15.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack())
{
ItemStack var19 = this.theSlot.getStack();
this.drawItemStackTooltip(var19, par1 - var4 + 8, par2 - var5 + 8);
}
*/
manager.renderToolTips(par1, par2);
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
RenderHelper.enableStandardItemLighting();
}
private void drawItemStack(ItemStack par1ItemStack, int par2, int par3)
{
GL11.glTranslatef(0.0F, 0.0F, 32.0F);
this.zLevel = 500.0F;
itemRenderer.zLevel = 500.0F;
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, par1ItemStack, par2, par3);
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8));
this.zLevel = 0.0F;
itemRenderer.zLevel = 0.0F;
}
public List<String> handleTooltip(int mousex, int mousey, List<String> currenttip)
{
return currenttip;
}
public List<String> handleItemTooltip(ItemStack stack, int mousex, int mousey, List<String> currenttip)
{
return currenttip;
}
protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3)
{
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
List var4 = par1ItemStack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
if (!var4.isEmpty())
{
int var5 = 0;
int var6;
int var7;
for (var6 = 0; var6 < var4.size(); ++var6)
{
var7 = this.fontRenderer.getStringWidth((String)var4.get(var6));
if (var7 > var5)
{
var5 = var7;
}
}
var6 = par2 + 12;
var7 = par3 - 12;
int var9 = 8;
if (var4.size() > 1)
{
var9 += 2 + (var4.size() - 1) * 10;
}
if (this.guiTop + var7 + var9 + 6 > this.height)
{
var7 = this.height - var9 - this.guiTop - 6;
}
this.zLevel = 300.0F;
itemRenderer.zLevel = 300.0F;
int var10 = -267386864;
this.drawGradientRect(var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10);
this.drawGradientRect(var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10);
this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10);
this.drawGradientRect(var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10);
this.drawGradientRect(var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10);
int var11 = 1347420415;
int var12 = (var11 & 16711422) >> 1 | var11 & -16777216;
this.drawGradientRect(var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12);
this.drawGradientRect(var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12);
this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11);
this.drawGradientRect(var6 - 3, var7 + var9 + 2, var6 + var5 + 3, var7 + var9 + 3, var12, var12);
for (int var13 = 0; var13 < var4.size(); ++var13)
{
String var14 = (String)var4.get(var13);
if (var13 == 0)
{
var14 = "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + var14;
}
else
{
var14 = "\u00a77" + var14;
}
this.fontRenderer.drawStringWithShadow(var14, var6, var7, -1);
if (var13 == 0)
{
var7 += 2;
}
var7 += 10;
}
this.zLevel = 0.0F;
itemRenderer.zLevel = 0.0F;
}
}
/**
* Draws the text when mouse is over creative inventory tab. Params: current creative tab to be checked, current
* mouse x position, current mouse y position.
*/
protected void drawCreativeTabHoveringText(String par1Str, int par2, int par3)
{
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
int var4 = this.fontRenderer.getStringWidth(par1Str);
int var5 = par2 + 12;
int var6 = par3 - 12;
byte var8 = 8;
this.zLevel = 300.0F;
itemRenderer.zLevel = 300.0F;
int var9 = -267386864;
this.drawGradientRect(var5 - 3, var6 - 4, var5 + var4 + 3, var6 - 3, var9, var9);
this.drawGradientRect(var5 - 3, var6 + var8 + 3, var5 + var4 + 3, var6 + var8 + 4, var9, var9);
this.drawGradientRect(var5 - 3, var6 - 3, var5 + var4 + 3, var6 + var8 + 3, var9, var9);
this.drawGradientRect(var5 - 4, var6 - 3, var5 - 3, var6 + var8 + 3, var9, var9);
this.drawGradientRect(var5 + var4 + 3, var6 - 3, var5 + var4 + 4, var6 + var8 + 3, var9, var9);
int var10 = 1347420415;
int var11 = (var10 & 16711422) >> 1 | var10 & -16777216;
this.drawGradientRect(var5 - 3, var6 - 3 + 1, var5 - 3 + 1, var6 + var8 + 3 - 1, var10, var11);
this.drawGradientRect(var5 + var4 + 2, var6 - 3 + 1, var5 + var4 + 3, var6 + var8 + 3 - 1, var10, var11);
this.drawGradientRect(var5 - 3, var6 - 3, var5 + var4 + 3, var6 - 3 + 1, var10, var10);
this.drawGradientRect(var5 - 3, var6 + var8 + 2, var5 + var4 + 3, var6 + var8 + 3, var11, var11);
this.fontRenderer.drawStringWithShadow(par1Str, var5, var6, -1);
this.zLevel = 0.0F;
itemRenderer.zLevel = 0.0F;
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
RenderHelper.enableStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int par1, int par2) {}
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected abstract void drawGuiContainerBackgroundLayer(float var1, int var2, int var3);
/**
* Draws an inventory slot
*/
protected void drawSlotInventory(Slot par1Slot)
{
int var2 = par1Slot.xDisplayPosition;
int var3 = par1Slot.yDisplayPosition;
ItemStack var4 = par1Slot.getStack();
boolean var5 = par1Slot == this.clickedSlot && this.draggedStack != null && !this.field_90018_r;
if (par1Slot == this.clickedSlot && this.draggedStack != null && this.field_90018_r && var4 != null)
{
var4 = var4.copy();
var4.stackSize /= 2;
}
this.zLevel = 100.0F;
itemRenderer.zLevel = 100.0F;
if (var4 == null)
{
int var6 = par1Slot.getBackgroundIconIndex();
if (var6 >= 0)
{
GL11.glDisable(GL11.GL_LIGHTING);
this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(par1Slot.getBackgroundIconTexture()));
this.drawTexturedModalRect(var2, var3, var6 % 16 * 16, var6 / 16 * 16, 16, 16);
GL11.glEnable(GL11.GL_LIGHTING);
var5 = true;
}
}
if (!var5)
{
manager.renderSlotUnderlay(par1Slot);
GL11.glEnable(GL11.GL_DEPTH_TEST);
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, var4, var2, var3);
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var4, var2, var3);
manager.renderSlotOverlay(par1Slot);
}
itemRenderer.zLevel = 0.0F;
this.zLevel = 0.0F;
}
/**
* Returns the slot at the given coordinates or null if there is none.
*/
public Slot getSlotAtPosition(int par1, int par2)
{
for (int var3 = 0; var3 < this.inventorySlots.inventorySlots.size(); ++var3)
{
Slot var4 = (Slot)this.inventorySlots.inventorySlots.get(var3);
if (this.isMouseOverSlot(var4, par1, par2))
{
return var4;
}
}
return null;
}
/**
* Called when the mouse is clicked.
*/
protected void mouseClicked(int par1, int par2, int par3)
{
super.mouseClicked(par1, par2, par3);
boolean var4 = par3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100;
if (!manager.mouseClicked(par1, par2, par3) && (par3 == 0 || par3 == 1 || var4))
{
Slot var5 = this.getSlotAtPosition(par1, par2);
int var6 = this.guiLeft;
int var7 = this.guiTop;
boolean var8 = (par1 < var6 || par2 < var7 || par1 >= var6 + this.xSize || par2 >= var7 + this.ySize) && var5 == null;
int var9 = -1;
if (var5 != null)
{
var9 = var5.slotNumber;
}
if (var8)
{
var9 = -999;
}
if (this.mc.gameSettings.touchscreen && var8 && this.mc.thePlayer.inventory.getItemStack() == null)
{
this.mc.displayGuiScreen((GuiScreen)null);
return;
}
if (var9 != -1)
{
if (this.mc.gameSettings.touchscreen)
{
if (var5 != null && var5.getHasStack())
{
this.clickedSlot = var5;
this.draggedStack = null;
this.field_90018_r = par3 == 1;
}
else
{
this.clickedSlot = null;
}
}
else
{
boolean var10 = (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54));
manager.handleMouseClick(var5, var9, par3, var4 ? 3 : var10 ? 1 : 0);
}
}
}
}
protected void func_85041_a(int par1, int par2, int par3, long par4)
{
if (this.clickedSlot != null && this.mc.gameSettings.touchscreen)
{
if (par3 == 0 || par3 == 1)
{
Slot var6 = this.getSlotAtPosition(par1, par2);
if (this.draggedStack == null)
{
if (var6 != this.clickedSlot)
{
this.draggedStack = this.clickedSlot.getStack().copy();
}
}
else if (this.draggedStack.stackSize > 1 && var6 != null && this.func_92031_b(var6))
{
long var7 = Minecraft.getSystemTime();
if (this.field_92033_y == var6)
{
if (var7 - this.field_92032_z > 500L)
{
this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0);
this.handleMouseClick(var6, var6.slotNumber, 1, 0);
this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0);
this.field_92032_z = var7 + 750L;
--this.draggedStack.stackSize;
}
}
else
{
this.field_92033_y = var6;
this.field_92032_z = var7;
}
}
}
}
}
/**
* Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is
* mouseMove, which==0 or which==1 is mouseUp
*/
protected void mouseMovedOrUp(int par1, int par2, int par3)
{
if (this.clickedSlot != null && this.mc.gameSettings.touchscreen)
{
if (par3 == 0 || par3 == 1)
{
Slot var4 = this.getSlotAtPosition(par1, par2);
int var5 = this.guiLeft;
int var6 = this.guiTop;
boolean var7 = par1 < var5 || par2 < var6 || par1 >= var5 + this.xSize || par2 >= var6 + this.ySize;
int var8 = -1;
if (var4 != null)
{
var8 = var4.slotNumber;
}
if (var7)
{
var8 = -999;
}
if (this.draggedStack == null && var4 != this.clickedSlot)
{
this.draggedStack = this.clickedSlot.getStack();
}
boolean var9 = this.func_92031_b(var4);
if (var8 != -1 && this.draggedStack != null && var9)
{
this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, par3, 0);
this.handleMouseClick(var4, var8, 0, 0);
if (this.mc.thePlayer.inventory.getItemStack() != null)
{
this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, par3, 0);
this.field_85049_r = par1 - var5;
this.field_85048_s = par2 - var6;
this.returningStackDestSlot = this.clickedSlot;
this.returningStack = this.draggedStack;
this.returningStackTime = Minecraft.getSystemTime();
}
else
{
this.returningStack = null;
}
}
else if (this.draggedStack != null)
{
this.field_85049_r = par1 - var5;
this.field_85048_s = par2 - var6;
this.returningStackDestSlot = this.clickedSlot;
this.returningStack = this.draggedStack;
this.returningStackTime = Minecraft.getSystemTime();
}
this.draggedStack = null;
this.clickedSlot = null;
}
}
else if(par3 >= 0)
manager.mouseUp(par1, par2, par3);
}
private boolean func_92031_b(Slot par1Slot)
{
boolean var2 = par1Slot == null || !par1Slot.getHasStack();
if (par1Slot != null && par1Slot.getHasStack() && this.draggedStack != null && ItemStack.areItemStackTagsEqual(par1Slot.getStack(), this.draggedStack))
{
var2 |= par1Slot.getStack().stackSize + this.draggedStack.stackSize <= this.draggedStack.getMaxStackSize();
}
return var2;
}
/**
* Returns if the passed mouse position is over the specified slot.
*/
private boolean isMouseOverSlot(Slot par1Slot, int par2, int par3)
{
return this.func_74188_c(par1Slot.xDisplayPosition, par1Slot.yDisplayPosition, 16, 16, par2, par3);
}
protected boolean func_74188_c(int par1, int par2, int par3, int par4, int par5, int par6)
{
int var7 = this.guiLeft;
int var8 = this.guiTop;
par5 -= var7;
par6 -= var8;
return par5 >= par1 - 1 && par5 < par1 + par3 + 1 && par6 >= par2 - 1 && par6 < par2 + par4 + 1;
}
public void handleMouseClick(Slot par1Slot, int par2, int par3, int par4)
{
if (par1Slot != null)
{
par2 = par1Slot.slotNumber;
}
if(par2 == -1)
return;
if(this instanceof IContainerClientSide)//send the calls directly to the container bypassing the MPController window send
{
mc.thePlayer.openContainer.slotClick(par2, par3, par4, mc.thePlayer);
}
else
{
this.mc.playerController.windowClick(this.inventorySlots.windowId, par2, par3, par4, this.mc.thePlayer);
}
}
/**
* Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
*/
protected void keyTyped(char par1, int par2)
{
if(par2 == 1)//esc
{
this.mc.thePlayer.closeScreen();
return;
}
if(manager.lastKeyTyped(par2, par1))
{
return;
}
this.func_82319_a(par2);
if (par2 == this.mc.gameSettings.keyBindPickBlock.keyCode && this.theSlot != null && this.theSlot.getHasStack())
{
this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, this.ySize, 3);
}
if(par2 == mc.gameSettings.keyBindInventory.keyCode)
{
mc.thePlayer.closeScreen();
return;
}
}
protected boolean func_82319_a(int par1)
{
if (this.mc.thePlayer.inventory.getItemStack() == null && this.theSlot != null)
{
for (int var2 = 0; var2 < 9; ++var2)
{
if (par1 == 2 + var2)
{
this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, var2, 2);
return true;
}
}
}
return false;
}
/**
* Called when the screen is unloaded. Used to disable keyboard repeat events
*/
public void onGuiClosed()
{
if (this.mc.thePlayer != null)
{
this.inventorySlots.onCraftGuiClosed(this.mc.thePlayer);
}
}
/**
* Returns true if this GUI should pause the game when it is displayed in single-player
*/
public boolean doesGuiPauseGame()
{
return false;
}
/**
* Called from the main game loop to update the screen.
*/
public void updateScreen()
{
super.updateScreen();
manager.guiTick();
if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead)
{
this.mc.thePlayer.closeScreen();
}
}
public void handleKeyboardInput()
{
if (Keyboard.getEventKeyState())
{
if (Keyboard.getEventKey() == 87)
{
this.mc.toggleFullscreen();
return;
}
if(manager.firstKeyTyped(Keyboard.getEventKey(), Keyboard.getEventCharacter()))
return;
this.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey());
}
}
public void handleMouseInput()
{
super.handleMouseInput();
int i = Mouse.getEventDWheel();
if(i != 0)
{
manager.mouseWheel(i > 0 ? 1 : -1);
}
}
public void refresh()
{
manager.refresh();
}
}
|
[
"[email protected]@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c"
] |
[email protected]@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c
|
7d85775b53611be740991dcec66f2f5bf3bd2669
|
484b6b99bbf12e4f0a19522a7a5d15268e7d8d13
|
/java8-test/src/main/java/pers/qianshifengyi/pattern/strategy/ConcreteStrategyC.java
|
e8c928ad409422616a3582e4a28f6421486cfe6f
|
[] |
no_license
|
ptshan/study-tomcat
|
bb2aaea7d637a9259259459f1dc055346e69f14a
|
aa0c16c2fc08e8811e7590b2d10b9a5688e44e3a
|
refs/heads/master
| 2021-01-20T04:15:30.326329 | 2017-11-05T03:26:13 | 2017-11-05T03:26:13 | 89,662,053 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 287 |
java
|
package pers.qianshifengyi.pattern.strategy;
/**
* Created by mountain on 2017/8/6.
*/
public class ConcreteStrategyC implements IStrategy {
@Override
public void algorithmInterface() {
System.out.println("--- ConcreteStrategyC algorithmInterface execute");
}
}
|
[
"[email protected]"
] | |
e6d67164484814d1b401d0ae1ff34e9a2f81a63e
|
41afe2558f0c89b444fee1123ff73abf2396f433
|
/src/main/java/com/alok/chatLogs/service/ChatLogsService.java
|
49d1bd5a1b6a97844ce6b2520f75e979f14adc33
|
[] |
no_license
|
Alok-Hub-07/ChatLogServer
|
56eab0b3bdd6a14558efb4d150156d1933804e4f
|
46bc3eda97de4478d2bca870351bb9d96dbb3fe7
|
refs/heads/main
| 2023-04-03T18:20:25.259306 | 2021-04-13T06:07:26 | 2021-04-13T06:07:26 | 357,439,979 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,238 |
java
|
package com.sumit.chatLogs.service;
import com.sumit.chatLogs.dto.MessageLogReqDTO;
import com.sumit.chatLogs.dto.MessageResponseDTO;
import com.sumit.chatLogs.entity.MessageTbl;
import com.sumit.chatLogs.repo.MessageTblRepo;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import javax.persistence.EntityManager;
import javax.transaction.Transactional;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@Service
public class ChatLogsService {
private final MessageTblRepo messageTblRepo;
private final EntityManager entityManager;
public ChatLogsService(MessageTblRepo messageTblRepo, EntityManager entityManager) {
this.messageTblRepo = messageTblRepo;
this.entityManager = entityManager;
}
@Transactional(Transactional.TxType.REQUIRES_NEW)
public int addMessageLog(MessageLogReqDTO messageLogReqDTO,String user){
MessageTbl messageTbl=new MessageTbl();
messageTbl.setMessage(messageLogReqDTO.getMessage());
messageTbl.setUserId(user);
messageTbl.setSent(messageLogReqDTO.isSent());
messageTbl.setTimestamp(messageLogReqDTO.getMessageTimeAsDate());
messageTbl=messageTblRepo.save(messageTbl);
return messageTbl.getMessageId();
}
@Transactional(Transactional.TxType.REQUIRES_NEW)
public int deleteLogs(String user, Optional<Integer> optionalMesageId){
return messageTblRepo.deleteLog(user,optionalMesageId,entityManager);
}
public List<MessageResponseDTO> getLogs(String user,Optional<Integer> optionalLimit,Optional<Integer>optionalStart){
List<MessageTbl> messageTbls= messageTblRepo.findAllByUserIdAndMessageIdAfterOrderByTimestampDesc(user,optionalStart.orElse(1)-1,PageRequest.of(0,optionalLimit.orElse(10)));
List<MessageResponseDTO> responseDtos=messageTbls.stream().map(messageTbl -> {
MessageResponseDTO responseDto=new MessageResponseDTO();
BeanUtils.copyProperties(messageTbl,responseDto);
return responseDto;
}).collect(Collectors.toList());
return responseDtos;
}
}
|
[
"[email protected]"
] | |
09f5070b7f84f440d34242be600a2b49f7262daf
|
61cd8043ae3a60d3c5b82e29280aef16f52637fc
|
/waterWaveProgress/src/main/java/cn/modificator/waterwave_progress/WaterWaveProgress.java
|
2b23cac7faff35af8da4d8792d2ad68cd437de41
|
[] |
no_license
|
NoAndroids/xxxDemo
|
3512d4b062089837b68c8fb60a9b463c406b2cda
|
fa41329897a0dc5164e949475cf269de2856dea3
|
refs/heads/master
| 2021-01-17T21:14:41.898481 | 2017-03-13T11:08:04 | 2017-03-13T11:08:04 | 84,168,593 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 12,152 |
java
|
package cn.modificator.waterwave_progress;
import java.lang.ref.WeakReference;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.RectF;
import android.graphics.Region;
import android.graphics.Path.Direction;
import android.graphics.Region.Op;
import android.os.Handler;
import android.os.Message;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ProgressBar;
/**
* @author Administrator
*
*/
public class WaterWaveProgress extends View {
// 水的画笔 // 画圆环的画笔// 进度百分比的画笔
private Paint mPaintWater = null, mRingPaint = null, mTextPaint = null;
// 圆环颜色 // 圆环背景颜色 // 当前进度 //水波颜色 // 水波背景色 //进度条和水波之间的距离 //进度百分比字体大小
// //进度百分比字体颜色
private int mRingColor, mRingBgColor, mWaterColor, mWaterBgColor,
mFontSize, mTextColor;
// 进度 //浪峰个数
float crestCount = 1.5f;
int mProgress = 10, mMaxProgress = 100;
// 画布中心点
private Point mCenterPoint;
// 圆环宽度
private float mRingWidth, mProgress2WaterWidth;
// 是否显示进度条 //是否显示进度百分比
private boolean mShowProgress = false, mShowNumerical = true;
/** 产生波浪效果的因子 */
private long mWaveFactor = 0L;
/** 正在执行波浪动画 */
private boolean isWaving = false;
/** 振幅 */
private float mAmplitude = 30.0F; // 20F
/** 波浪的速度 */
private float mWaveSpeed = 0.070F; // 0.020F
/** 水的透明度 */
private int mWaterAlpha = 255; // 255
WaterWaveAttrInit attrInit;
private MyHandler mHandler = null;
private static class MyHandler extends Handler {
private WeakReference<WaterWaveProgress> mWeakRef = null;
private int refreshPeriod = 100;
public MyHandler(WaterWaveProgress host) {
mWeakRef = new WeakReference<WaterWaveProgress>(host);
}
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (mWeakRef.get() != null) {
mWeakRef.get().invalidate();
sendEmptyMessageDelayed(0, refreshPeriod);
}
}
}
public WaterWaveProgress(Context paramContext) {
super(paramContext);
}
public WaterWaveProgress(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public WaterWaveProgress(Context context, AttributeSet attrs,
int defStyleAttr) {
super(context, attrs, defStyleAttr);
attrInit = new WaterWaveAttrInit(context, attrs, defStyleAttr);
init(context);
}
@SuppressLint("NewApi")
private void init(Context context) {
mCenterPoint = new Point();
mRingColor = attrInit.getProgressColor();
mRingBgColor = attrInit.getProgressBgColor();
mWaterColor = attrInit.getWaterWaveColor();
mWaterBgColor = attrInit.getWaterWaveBgColor();
mRingWidth = attrInit.getProgressWidth();
mProgress2WaterWidth = attrInit.getProgress2WaterWidth();
mShowProgress = attrInit.isShowProgress();
mShowNumerical = attrInit.isShowNumerical();
mFontSize = attrInit.getFontSize();
mTextColor = attrInit.getTextColor();
mProgress = attrInit.getProgress();
mMaxProgress = attrInit.getMaxProgress();
// 如果手机版本在4.0以上,则开启硬件加速
if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) {
setLayerType(View.LAYER_TYPE_HARDWARE, null);
// setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
//画圆环
mRingPaint = new Paint();
mRingPaint.setAntiAlias(true);
mRingPaint.setColor(mRingColor); // 圆环颜色
mRingPaint.setStyle(Paint.Style.STROKE);
mRingPaint.setStrokeWidth(mRingWidth); // 圆环宽度
//画水
mPaintWater = new Paint();
mPaintWater.setStrokeWidth(1.0F);
mPaintWater.setColor(mWaterColor);
// mPaintWater.setColor(getResources().getColor(mWaterColor));
mPaintWater.setAlpha(mWaterAlpha);
//画文字
mTextPaint = new Paint();
mTextPaint.setAntiAlias(true);
mTextPaint.setColor(mTextColor);
mTextPaint.setStyle(Paint.Style.FILL);
mTextPaint.setTextSize(mFontSize);
mHandler = new MyHandler(this);
}
public void animateWave() {
if (!isWaving) {
mWaveFactor = 0L;
isWaving = true;
mHandler.sendEmptyMessage(0);
}
}
@SuppressLint({ "DrawAllocation", "NewApi" })
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// 获取整个View(容器)的宽、高
int width = getWidth();
int height = getHeight();
//选择数值最小的做为宽和高
width = height = (width < height) ? width : height;
mAmplitude = width / 20f;
// 圆点坐标
mCenterPoint.x = width / 2;
mCenterPoint.y = height / 2;
{ // 重新设置进度条的宽度和水波与进度条的距离,,至于为什么写在这,我脑袋抽了可以不
mRingWidth = mRingWidth == 0 ? width / 20 : mRingWidth;
mProgress2WaterWidth = mProgress2WaterWidth == 0 ? mRingWidth * 0.6f
: mProgress2WaterWidth;
mRingPaint.setStrokeWidth(mRingWidth);
mTextPaint.setTextSize(mFontSize == 0 ? width / 5 : mFontSize);
if (VERSION.SDK_INT==VERSION_CODES.JELLY_BEAN) {
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}else {
setLayerType(View.LAYER_TYPE_HARDWARE, null);
}
}
RectF oval = new RectF();
oval.left = mRingWidth / 2;
oval.top = mRingWidth / 2;
oval.right = width - mRingWidth / 2;
oval.bottom = height - mRingWidth / 2;
if (isInEditMode()) {
mRingPaint.setColor(mRingBgColor);
canvas.drawArc(oval, -90, 360, false, mRingPaint);
mRingPaint.setColor(mRingColor);
canvas.drawArc(oval, -90, 90, false, mRingPaint);
canvas.drawCircle(mCenterPoint.x, mCenterPoint.y, mCenterPoint.x
- mRingWidth - mProgress2WaterWidth, mPaintWater);
return;
}
// 如果没有执行波浪动画,或者也没有指定容器宽高,就画个简单的矩形
if ((width == 0) || (height == 0) || isInEditMode()) {
canvas.drawCircle(mCenterPoint.x, mCenterPoint.y, width / 2
- mProgress2WaterWidth - mRingWidth, mPaintWater);
return;
}
// 水与边框的距离
float waterPadding = mShowProgress ? mRingWidth + mProgress2WaterWidth
: 0;
// 水最高处
int waterHeightCount = mShowProgress ? (int) (height - waterPadding * 2)
: height;
// 重新生成波浪的形状
mWaveFactor++;
if (mWaveFactor >= Integer.MAX_VALUE) {
mWaveFactor = 0L;
}
// 画进度条背景
mRingPaint.setColor(mRingBgColor);
// canvas.drawArc(oval, -90, 360, false, mRingPaint);
// //和下面效果一样,只不过这个是画个360度的弧,下面是画圆环
canvas.drawCircle(width / 2, width / 2, waterHeightCount / 2
+ waterPadding - mRingWidth / 2, mRingPaint);
mRingPaint.setColor(mRingColor);
// 100为 总进度
canvas.drawArc(oval, -90, (mProgress*1f) / mMaxProgress * 360f, false,
mRingPaint);
// 计算出水的高度
float waterHeight = waterHeightCount * (1 - (mProgress*1f) / mMaxProgress)
+ waterPadding;
int staticHeight = (int) (waterHeight + mAmplitude);
Path mPath = new Path();
mPath.reset();
if (mShowProgress) {
mPath.addCircle(width / 2, width / 2, waterHeightCount / 2,
Direction.CCW);
} else {
mPath.addCircle(width / 2, width / 2, waterHeightCount / 2,
Direction.CCW);
}
// canvas添加限制,让接下来的绘制都在园内
canvas.clipPath(mPath, Op.REPLACE);
Paint bgPaint = new Paint();
bgPaint.setColor(mWaterBgColor);
// 绘制背景
canvas.drawRect(waterPadding, waterPadding, waterHeightCount
+ waterPadding, waterHeightCount + waterPadding, bgPaint);
// 绘制静止的水
canvas.drawRect(waterPadding, staticHeight, waterHeightCount
+ waterPadding, waterHeightCount + waterPadding, mPaintWater);
// 待绘制的波浪线的x坐标
int xToBeDrawed = (int) waterPadding;
int waveHeight = (int) (waterHeight - mAmplitude
* Math.sin(Math.PI
* (2.0F * (xToBeDrawed + (mWaveFactor * width)
* mWaveSpeed)) / width));
// 波浪线新的高度
int newWaveHeight = waveHeight;
while (true) {
if (xToBeDrawed >= waterHeightCount + waterPadding) {
break;
}
// 根据当前x值计算波浪线新的高度
newWaveHeight = (int) (waterHeight - mAmplitude
* Math.sin(Math.PI
* (crestCount * (xToBeDrawed + (mWaveFactor * waterHeightCount)
* mWaveSpeed)) / waterHeightCount));
// 先画出梯形的顶边
canvas.drawLine(xToBeDrawed, waveHeight, xToBeDrawed + 1,
newWaveHeight, mPaintWater);
// 画出动态变化的柱子部分
canvas.drawLine(xToBeDrawed, newWaveHeight, xToBeDrawed + 1,
staticHeight, mPaintWater);
xToBeDrawed++;
waveHeight = newWaveHeight;
}
if (mShowNumerical) {
String progressTxt = String.format("%.0f", (mProgress*1f) / mMaxProgress
* 100f)
+ "%";
float mTxtWidth = mTextPaint.measureText(progressTxt, 0,
progressTxt.length());
canvas.drawText(progressTxt, mCenterPoint.x - mTxtWidth / 2,
mCenterPoint.x * 1.5f - mFontSize / 2, mTextPaint);
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = widthMeasureSpec;
int height = heightMeasureSpec;
width = height = (width < height) ? width : height;
setMeasuredDimension(width, height);
}
/**
* 设置波浪的振幅
*/
public void setAmplitude(float amplitude) {
mAmplitude = amplitude;
}
/**
* 设置水的透明度
*
* @param alpha
* 透明的百分比,值为0到1之间的小数,越接近0越透明
*/
public void setWaterAlpha(float alpha) {
mWaterAlpha = (int) (255.0F * alpha);
mPaintWater.setAlpha(mWaterAlpha);
}
/** 设置水的颜色 */
public void setWaterColor(int color) {
mWaterColor = color;
}
/**
* 设置当前进度
*/
public void setProgress(int progress) {
progress = progress > 100 ? 100 : progress < 0 ? 0 : progress;
mProgress = progress;
invalidate();
}
/** 获取进度 动画时会用到 */
public int getProgress() {
return mProgress;
}
/**
* 设置波浪速度
*/
public void setWaveSpeed(float speed) {
mWaveSpeed = speed;
}
/**
* 是否显示进度条
*
* @paramboolean
*/
public void setShowProgress(boolean b) {
mShowProgress = b;
}
/**
* 是否显示进度值
*
* @paramboolean
*/
public void setShowNumerical(boolean b) {
mShowNumerical = b;
}
/**
* 设置进度条前景色
*
* @param mRingColor
*/
public void setmRingColor(int mRingColor) {
this.mRingColor = mRingColor;
}
/**
* 设置进度条背景色
*
* @param mRingBgColor
*/
public void setmRingBgColor(int mRingBgColor) {
this.mRingBgColor = mRingBgColor;
}
/**
* 设置水波颜色
*
* @param mWaterColor
*/
public void setmWaterColor(int mWaterColor) {
this.mWaterColor = mWaterColor;
}
/**
* 设置水波背景色
*
* @param mWaterBgColor
*/
public void setWaterBgColor(int mWaterBgColor) {
this.mWaterBgColor = mWaterBgColor;
}
/**
* 设置进度值显示字体大小
*
* @param mFontSize
*/
public void setFontSize(int mFontSize) {
this.mFontSize = mFontSize;
}
/**
* 设置进度值显示字体颜色
*
* @param mTextColor
*/
public void setTextColor(int mTextColor) {
this.mTextColor = mTextColor;
}
/**
* 设置进度条最大值
*
* @param mMaxProgress
*/
public void setMaxProgress(int mMaxProgress) {
this.mMaxProgress = mMaxProgress;
}
/**
* 设置浪峰个数
*
* @param crestCount
*/
public void setCrestCount(float crestCount) {
this.crestCount = crestCount;
}
/**
* 设置进度条宽度
*
* @param mRingWidth
*/
public void setRingWidth(float mRingWidth) {
this.mRingWidth = mRingWidth;
}
/**
* 设置水波到进度条之间的距离
*
* @param mProgress2WaterWidth
*/
public void setProgress2WaterWidth(float mProgress2WaterWidth) {
this.mProgress2WaterWidth = mProgress2WaterWidth;
}
}
|
[
"[email protected]"
] | |
d0160eaa6f077566440215f6509586e2ffe432c2
|
a94c6020742cbee98f9e563abff0e39126052cf4
|
/Model/src/main/java/project/custexceptions/FilesException.java
|
21c76f94d852e42149a5a5db9900bd134a4b88b5
|
[] |
no_license
|
Hanna-J-K/SudokuGameProject
|
d6bd263a7933606852e59582313624a6c7e44293
|
27f7bee34a44d80aeb9e7284b89d01babaa9f7c9
|
refs/heads/master
| 2023-04-03T01:22:24.885745 | 2021-04-21T10:14:03 | 2021-04-21T10:14:03 | 360,122,907 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 160 |
java
|
package project.custexceptions;
public class FilesException extends DaoException {
public FilesException(Throwable cause) {
super(cause);
}
}
|
[
"[email protected]"
] | |
1516148e2b766b544f7a81e04d2e4c068e342d9f
|
9dc3fed925c20123cb01bf5983c2a095ddc565e6
|
/bootjpa/src/main/java/com/telusko/demo/model/Alien.java
|
a8820ed44b58e3fa551db6f7579ae621421cb4f9
|
[] |
no_license
|
MdAbuNafeeIbnaZahid/Spring-Learning-from-Telusko-Learnings
|
4a84d93d7588963ccd21ee349d177a3103934f10
|
7430ba8a404483d4260dd088f7818350b8a59077
|
refs/heads/master
| 2020-03-26T21:19:51.466216 | 2018-08-23T11:11:30 | 2018-08-23T11:11:30 | 145,381,192 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 637 |
java
|
package com.telusko.demo.model;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Alien {
@Id
private int aid;
private String aname;
private String tech;
public String getTech() {
return tech;
}
public void setTech(String tech) {
this.tech = tech;
}
public int getAid() {
return aid;
}
public void setAid(int aid) {
this.aid = aid;
}
public String getAname() {
return aname;
}
public void setAname(String aname) {
this.aname = aname;
}
@Override
public String toString() {
return "Alien [aid=" + aid + ", aname=" + aname + ", tech=" + tech + "]";
}
}
|
[
"[email protected]"
] | |
b5dfe972ec97c4f3e5c3e81c46e1310cbbcefe6d
|
53d677a55e4ece8883526738f1c9d00fa6560ff7
|
/com/tencent/mm/boot/svg/a/a/yt.java
|
5af9e25448277f860b8f10d82cf9b074cebad49b
|
[] |
no_license
|
0jinxing/wechat-apk-source
|
544c2d79bfc10261eb36389c1edfdf553d8f312a
|
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
|
refs/heads/master
| 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,697 |
java
|
package com.tencent.mm.boot.svg.a.a;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Paint.Cap;
import android.graphics.Paint.Join;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.os.Looper;
import com.tencent.mm.svg.WeChatSVGRenderC2Java;
import com.tencent.mm.svg.c;
public final class yt extends c
{
private final int height = 36;
private final int width = 36;
public final int a(int paramInt, Object[] paramArrayOfObject)
{
switch (paramInt)
{
default:
case 0:
case 1:
case 2:
}
while (true)
{
paramInt = 0;
while (true)
{
return paramInt;
paramInt = 36;
continue;
paramInt = 36;
}
Canvas localCanvas = (Canvas)paramArrayOfObject[0];
paramArrayOfObject = (Looper)paramArrayOfObject[1];
Object localObject = c.h(paramArrayOfObject);
float[] arrayOfFloat = c.g(paramArrayOfObject);
Paint localPaint1 = c.k(paramArrayOfObject);
localPaint1.setFlags(385);
localPaint1.setStyle(Paint.Style.FILL);
Paint localPaint2 = c.k(paramArrayOfObject);
localPaint2.setFlags(385);
localPaint2.setStyle(Paint.Style.STROKE);
localPaint1.setColor(-16777216);
localPaint2.setStrokeWidth(1.0F);
localPaint2.setStrokeCap(Paint.Cap.BUTT);
localPaint2.setStrokeJoin(Paint.Join.MITER);
localPaint2.setStrokeMiter(4.0F);
localPaint2.setPathEffect(null);
c.a(localPaint2, paramArrayOfObject).setStrokeWidth(1.0F);
localCanvas.save();
localPaint1 = c.a(localPaint1, paramArrayOfObject);
localPaint1.setColor(-1);
arrayOfFloat = c.a(arrayOfFloat, 1.0F, 0.0F, -3864.0F, 0.0F, 1.0F, -2672.0F);
((Matrix)localObject).reset();
((Matrix)localObject).setValues(arrayOfFloat);
localCanvas.concat((Matrix)localObject);
localCanvas.save();
arrayOfFloat = c.a(arrayOfFloat, 1.0F, 0.0F, 3855.0F, 0.0F, 1.0F, 2663.0F);
((Matrix)localObject).reset();
((Matrix)localObject).setValues(arrayOfFloat);
localCanvas.concat((Matrix)localObject);
localCanvas.save();
localPaint1 = c.a(localPaint1, paramArrayOfObject);
localObject = c.l(paramArrayOfObject);
((Path)localObject).moveTo(42.0F, 12.0F);
((Path)localObject).lineTo(42.0F, 24.0F);
((Path)localObject).lineTo(45.0F, 24.0F);
((Path)localObject).lineTo(45.0F, 10.5F);
((Path)localObject).lineTo(45.0F, 9.0F);
((Path)localObject).lineTo(30.0F, 9.0F);
((Path)localObject).lineTo(30.0F, 12.0F);
((Path)localObject).lineTo(42.0F, 12.0F);
((Path)localObject).close();
((Path)localObject).moveTo(12.0F, 42.0F);
((Path)localObject).lineTo(12.0F, 30.0F);
((Path)localObject).lineTo(9.0F, 30.0F);
((Path)localObject).lineTo(9.0F, 43.5F);
((Path)localObject).lineTo(9.0F, 45.0F);
((Path)localObject).lineTo(24.0F, 45.0F);
((Path)localObject).lineTo(24.0F, 42.0F);
((Path)localObject).lineTo(12.0F, 42.0F);
((Path)localObject).close();
WeChatSVGRenderC2Java.setFillType((Path)localObject, 2);
localCanvas.drawPath((Path)localObject, localPaint1);
localCanvas.restore();
localCanvas.restore();
localCanvas.restore();
c.j(paramArrayOfObject);
}
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes2-dex2jar.jar
* Qualified Name: com.tencent.mm.boot.svg.a.a.yt
* JD-Core Version: 0.6.2
*/
|
[
"[email protected]"
] | |
909d01bf03ea643c6f8eaccb1170365b7cb8fc77
|
4c69d158f504460266f4afe68945db796b136deb
|
/microservices/coupon-service/src/main/java/com/microservices/coupons/controllers/CompanyController.java
|
733cef20e1cda45bf8e28c6fc232f20e1ca20e87
|
[] |
no_license
|
rammohan97/DealsAndCoupons-Casestudy
|
2ccfc990b6dfc9c0324a42ada297d269e5939e9e
|
661a25c5bbb89b953fb043cfacaf5d1035488096
|
refs/heads/master
| 2023-06-19T06:50:08.637440 | 2021-06-28T14:22:01 | 2021-06-28T14:22:01 | 381,045,663 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,482 |
java
|
package com.microservices.coupons.controllers;
import com.microservices.coupons.exceptions.CustomException;
import com.microservices.coupons.model.Category;
import com.microservices.coupons.model.Company;
import com.microservices.coupons.model.Coupon;
import com.microservices.coupons.model.ReturnResponse;
import com.microservices.coupons.services.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.ws.rs.Path;
import java.util.ArrayList;
@CrossOrigin
@RestController
@RequestMapping("/companyController")
public class CompanyController {
@Autowired
private CompanyService companyService;
@GetMapping("/hello")
public String test() {
return "Helo";
}
@GetMapping("/getCompanyId/{username}")
public ReturnResponse getCompanyId(@PathVariable("username") String username) throws CustomException {
return new ReturnResponse(companyService.getCompanyId(username));
}
@PostMapping("/addCoupon")
public void addCoupon(@RequestBody Coupon coupon) throws CustomException {
companyService.addCoupon(coupon);
}
@PutMapping("/updateCoupon")
public void updateCoupon(@RequestBody Coupon coupon) throws CustomException {
companyService.updateCoupon(coupon);
}
@DeleteMapping("/deleteCoupon/{id}")
public void deleteCoupon(@PathVariable("id") String couponID) throws CustomException {
companyService.deleteCoupon(couponID);
}
@GetMapping("/getCompanyCoupons/{id}")
public ArrayList<Coupon> getCompanyCoupons(@PathVariable("id") String companyId) throws CustomException {
return companyService.getCompanyCoupons(companyId);
}
@GetMapping("/getCompanyCouponsByCategory/{id}")
public ArrayList<Coupon> getCompanyCoupons(@PathVariable("id") String companyId,
@RequestParam("category") Category category) throws CustomException {
return companyService.getCompanyCoupons(category,companyId);
}
@GetMapping("/getCompanyCouponsByPrice/{id}")
public ArrayList<Coupon> getCompanyCoupons(@PathVariable("id") String companyId,@RequestParam("maxPrice") double maxPrice) throws CustomException {
return companyService.getCompanyCoupons(maxPrice,companyId);
}
@GetMapping("/getCompanyDetails/{id}")
public Company getCompanyDetails(@PathVariable("id") String companyId) throws CustomException {
return companyService.getCompanyDetails(companyId);
}
}
|
[
"[email protected]"
] | |
ccfd8e3632eb672002fd7982a41520210ed7afa9
|
20eb03455a83dec5a1bcabf5eb6ed1a6cbc8c46e
|
/src/automenta/netention/edge/Becomes.java
|
30f97fcbe6bdf0afc4e92c779150b188c6a3bd1b
|
[] |
no_license
|
automenta/old-netention2
|
e7a5871ad45e06d29ceeb3fedc5fd74735607096
|
9f7639e9f95ae354e8b2d8eddd65557c2c56daef
|
refs/heads/master
| 2020-05-18T16:22:51.618885 | 2010-02-13T13:48:11 | 2010-02-13T13:48:11 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 402 |
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package automenta.netention.edge;
/** indicates that something has transformed (become) something else */
public final class Becomes {
private final String name;
public Becomes(String t) {
this.name = t;
}
@Override public String toString() {
return name;
}
}
|
[
"[email protected]"
] | |
a0311ed1d84004bbcf9233cfca25c65916699c77
|
d81e0c0ec741039b7ec655271277a5fe55136096
|
/Strings and Characters/FindLargestNumber.java
|
c40ae0d0684b59d99896c3ddf1b5fc32a131ed95
|
[] |
no_license
|
yanula20/Java-Exercises
|
d61e1903ffe3ba3f5210839e9dc2aa68382c7bb0
|
bcce3baa0f12ab91a8e351016482bdef84b86656
|
refs/heads/master
| 2021-05-09T23:46:28.025420 | 2018-05-07T19:48:33 | 2018-05-07T19:48:33 | 118,809,559 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,782 |
java
|
import java.util.*;
public class FindLargestNumber {
public static void main(String[] args) {
char largestDigit;
Scanner console = new Scanner(System.in);
programIntro();
String text = getUserText(console);
String stringSearch = createStringOfDigits(text);
if(stringSearch.equals("")) {
System.out.println("No digits were found in your entry.");
} else {
largestDigit = findLargestDigitInString(stringSearch);
reportResults(largestDigit);
}
}
public static void programIntro() {
System.out.println("This program finds the largest digit within text entered by the user");
}
public static String getUserText(Scanner console) {
System.out.print("Enter text with digits in any number of places.");
String text = console.nextLine();
return text;
}
public static String createStringOfDigits(String text) {
String zero = "";
char c;
String stringOfDigits = "";
for(int i = 0; i < text.length(); i++) {
c = text.charAt(i);
if(Character.isDigit(c)) {
stringOfDigits = stringOfDigits + c;
}
}if(!stringOfDigits.equals(zero)) {
return stringOfDigits;
}else {
return zero;
}
}
public static char findLargestDigitInString(String stringSearch) {
char digit;
char result = '\0';//invariant; largest digit seen so far
for(int i = 0; i < stringSearch.length(); i++) {
digit = stringSearch.charAt(i);
if((int)digit > result){
result = digit;
}
}
return result;
}
public static void reportResults(char largestDigit) {
System.out.println("The largest digit in your text was " + largestDigit + "!");
}
}
|
[
"[email protected]"
] | |
e7b47af76c029db3dfb8a7df4c7750722cb07faa
|
6bd14132416cf75b4cb8b06485b2406aa581ed18
|
/cashloan-core/src/main/java/com/xindaibao/cashloan/core/common/util/NidGenerator.java
|
f9b8193613830947c85808e551be793d428ba5cc
|
[] |
no_license
|
tanglongjia/cashloan
|
b21e6a5e4dc1c5629fc7167c5fb727a6033ba619
|
9b55e7f1b51b89016750b6d9a732d1e895209877
|
refs/heads/master
| 2020-06-18T06:51:12.348238 | 2018-12-14T03:12:07 | 2018-12-14T03:12:07 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,757 |
java
|
package com.xindaibao.cashloan.core.common.util;
import java.text.SimpleDateFormat;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 编号生成器
* @author
*
*/
public class NidGenerator {
public static final Logger logger = LoggerFactory.getLogger(NidGenerator.class);
protected final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
private static int getHashCode() {
int hashCode = UUID.randomUUID().toString().hashCode();
if (hashCode < 0) {
hashCode = -hashCode;
}
return hashCode;
}
public static String getOrderNo(){
int hashCode = getHashCode();
return String.format("%011d", hashCode);
}
/**
* 评分卡nid
* @return
*/
public static String getCardNid() {
int hashCode = getHashCode();
return "CC" + String.format("%011d", hashCode);
}
/**
*评分项目nid
* @return
*/
public static String getItemNid() {
int hashCode = getHashCode();
return "CI" + String.format("%011d", hashCode);
}
/**
* 评分卡因子nid
* @return
*/
public static String getFactorNid() {
int hashCode = getHashCode();
return "CF" + String.format("%011d", hashCode);
}
/**
* 评分参数nid
* @return
*/
public static String getParamNid() {
int hashCode = getHashCode();
return "CFP" + String.format("%010d", hashCode);
}
public static void main(String[] args) {
logger.info(getCardNid());
logger.info(getItemNid());
logger.info(getFactorNid());
logger.info(getParamNid());
logger.info(getOrderNo());
}
}
|
[
"[email protected]"
] | |
7efa9c5a4908e1dac0f7501ebde6bdfc353f6845
|
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.mm/classes.jar/com/tencent/mm/an/aa.java
|
a436147f958f630c1ff83dd57b9ff26997622af3
|
[] |
no_license
|
tsuzcx/qq_apk
|
0d5e792c3c7351ab781957bac465c55c505caf61
|
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
|
refs/heads/main
| 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 |
Java
|
UTF-8
|
Java
| false | false | 2,861 |
java
|
package com.tencent.mm.an;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.am.c;
import com.tencent.mm.am.c.a;
import com.tencent.mm.am.c.c;
import com.tencent.mm.am.h;
import com.tencent.mm.am.p;
import com.tencent.mm.model.cn;
import com.tencent.mm.network.g;
import com.tencent.mm.network.m;
import com.tencent.mm.network.s;
import com.tencent.mm.protocal.protobuf.cqt;
import com.tencent.mm.protocal.protobuf.cqu;
import com.tencent.mm.sdk.platformtools.Log;
public final class aa
extends p
implements m
{
private h callback;
private cqu owP;
private a<aa> owQ;
private final c rr;
public aa()
{
AppMethodBeat.i(239429);
Log.i("MicroMsg.NetSceneGetReceiptAssisPluginMenu", "NetSceneGetReceiptAssisPluginMenu begin");
c.a locala = new c.a();
locala.funcId = 1769;
locala.uri = "/cgi-bin/mmpay-bin/getreceiptassismenu";
cqt localcqt = new cqt();
localcqt.timestamp = cn.bDv();
locala.otE = localcqt;
locala.otF = new cqu();
locala.otG = 0;
locala.respCmdId = 0;
this.rr = locala.bEF();
AppMethodBeat.o(239429);
}
public aa(a<aa> parama)
{
this();
this.owQ = parama;
}
public final cqu bHa()
{
AppMethodBeat.i(239437);
if (this.owP == null)
{
localcqu = new cqu();
AppMethodBeat.o(239437);
return localcqu;
}
cqu localcqu = this.owP;
AppMethodBeat.o(239437);
return localcqu;
}
public final int doScene(g paramg, h paramh)
{
AppMethodBeat.i(239432);
this.callback = paramh;
int i = dispatch(paramg, this.rr, this);
AppMethodBeat.o(239432);
return i;
}
public final int getType()
{
return 1769;
}
public final void onGYNetEnd(int paramInt1, int paramInt2, int paramInt3, String paramString, s params, byte[] paramArrayOfByte)
{
AppMethodBeat.i(239433);
Log.w("MicroMsg.NetSceneGetReceiptAssisPluginMenu", "errType = %s errCode = %s errMsg = %s", new Object[] { Integer.valueOf(paramInt2), Integer.valueOf(paramInt3), paramString });
if ((paramInt2 == 0) && (paramInt3 == 0)) {
this.owP = ((cqu)c.c.b(((c)params).otC));
}
if (this.callback != null) {
this.callback.onSceneEnd(paramInt2, paramInt3, paramString, this);
}
if (this.owQ != null) {
this.owQ.onNetSceneEndCallback(paramInt2, paramInt3, paramString, this);
}
AppMethodBeat.o(239433);
}
public static abstract interface a<T extends p>
{
public abstract void onNetSceneEndCallback(int paramInt1, int paramInt2, String paramString, T paramT);
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar
* Qualified Name: com.tencent.mm.an.aa
* JD-Core Version: 0.7.0.1
*/
|
[
"[email protected]"
] | |
63e41f73d961def2a24d315bfaf464ebba8ee1e1
|
6500848c3661afda83a024f9792bc6e2e8e8a14e
|
/gp_JADX/com/google/android/libraries/performance/primes/ca.java
|
7991bb783f221d61dcd927ca40ef7f7bd5955aec
|
[] |
no_license
|
enaawy/gproject
|
fd71d3adb3784d12c52daf4eecd4b2cb5c81a032
|
91cb88559c60ac741d4418658d0416f26722e789
|
refs/heads/master
| 2021-09-03T03:49:37.813805 | 2018-01-05T09:35:06 | 2018-01-05T09:35:06 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,570 |
java
|
package com.google.android.libraries.performance.primes;
import android.os.Debug;
import android.os.Process;
import android.os.SystemClock;
import com.google.android.libraries.p326c.p327a.C5916a;
import com.google.android.libraries.performance.primes.metriccapture.C6016h;
import com.google.android.libraries.performance.primes.p337d.C5987a;
import java.io.File;
import java.util.Arrays;
import java.util.Collections;
final class ca implements Runnable {
public final /* synthetic */ bz f29864a;
ca(bz bzVar) {
this.f29864a = bzVar;
}
public final void run() {
int i;
C5987a c5987a;
C5949a c5949a = this.f29864a.f29849a;
int totalPss = C6016h.m27888a(this.f29864a.f29849a.f29613b).getProcessMemoryInfo(new int[]{Process.myPid()})[0].getTotalPss();
c5949a.f29842h.m27811a(totalPss);
if (!ek.f30037a.f30040d) {
long j = c5949a.f29845k.get();
if (j == 0 || j + 86400000 <= SystemClock.elapsedRealtime()) {
i = 1;
if (i != 0) {
c5987a = c5949a.f29842h;
double d = c5949a.f29841g;
if (c5987a.f29935a.size() == 100 || c5987a.f29937c * ((double) ((Integer) Collections.min(c5987a.f29935a)).intValue()) > ((double) ((Integer) Collections.max(c5987a.f29935a)).intValue())) {
i = 0;
} else {
Integer[] numArr = (Integer[]) c5987a.f29935a.toArray(new Integer[c5987a.f29935a.size()]);
Arrays.sort(numArr);
i = numArr[Math.min(numArr.length + -1, (int) ((d * ((double) numArr.length)) - 1.0d))].intValue() <= totalPss ? 1 : 0;
}
if (i != 0 && c5949a.f29844j.tryLock()) {
c5949a.f29845k.set(SystemClock.elapsedRealtime());
try {
Debug.dumpHprofData(dl.m27819b(c5949a.f29613b).getAbsolutePath());
c5949a.f29843i = totalPss;
File b = dl.m27819b(c5949a.f29613b);
Object obj = c5949a.f29613b;
C5916a.m27406a(obj);
File cacheDir = obj.getCacheDir();
String d2 = C6016h.m27892d(obj);
if (d2 != null) {
d2 = d2.replaceAll("[^a-zA-Z0-9\\._]", "_");
d2 = d2.substring(0, Math.min(32, d2.length()));
} else {
d2 = "";
}
c5949a.m27754a(b, new File(cacheDir, new StringBuilder(String.valueOf(d2).length() + 11).append(d2).append("_primes_mhd").toString()));
dl.m27820c(c5949a.f29613b);
} catch (Throwable e) {
C5989do.m27826a("MiniHeapDumpMetric", "Failed to dump hprof data", e, new Object[0]);
} finally {
dl.m27820c(c5949a.f29613b);
c5949a.f29844j.unlock();
}
return;
}
}
}
}
i = 0;
if (i != 0) {
c5987a = c5949a.f29842h;
double d3 = c5949a.f29841g;
if (c5987a.f29935a.size() == 100) {
}
i = 0;
if (i != 0) {
}
}
}
}
|
[
"[email protected]"
] | |
d56127b2bc19847128c9d839df57b1f30d10a98d
|
f353942026e47e491b8b4b28c640e466cd3b8fd1
|
/common/eunit-testfwk/src/main/java-excel/com/ebay/eunit/report/excel/model/Constants.java
|
94151d510dbe5bae2d546745d9ce922ed41198c4
|
[] |
no_license
|
qmwu2000/workshop
|
392c952f7ef66c4da492edd929c47b7a1db3e5fa
|
9c1cc55122f78045aa996d5714635391847ae212
|
refs/heads/master
| 2021-01-17T08:55:54.655925 | 2012-11-13T13:31:14 | 2012-11-13T13:31:14 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,609 |
java
|
package com.ebay.eunit.report.excel.model;
public class Constants {
public static final String ATTR_BOLD = "bold";
public static final String ATTR_COLS = "cols";
public static final String ATTR_CREATE = "create";
public static final String ATTR_FORMAT = "format";
public static final String ATTR_ID = "id";
public static final String ATTR_ITALIC = "italic";
public static final String ATTR_NAME = "name";
public static final String ATTR_OFFSET = "offset";
public static final String ATTR_OUTPUT = "output";
public static final String ATTR_ROWS = "rows";
public static final String ATTR_SIZE = "size";
public static final String ATTR_START_COL = "start-col";
public static final String ATTR_START_ROW = "start-row";
public static final String ATTR_TEMPLATE = "template";
public static final String ATTR_TYPE = "type";
public static final String ELEMENT_TEXT = "text";
public static final String ENTITY_COL = "col";
public static final String ENTITY_DATE_TIME = "date-time";
public static final String ENTITY_EMPTY = "empty";
public static final String ENTITY_FONT = "font";
public static final String ENTITY_FORMAT = "format";
public static final String ENTITY_LABEL = "label";
public static final String ENTITY_NUMBER = "number";
public static final String ENTITY_PATTERN = "pattern";
public static final String ENTITY_ROW = "row";
public static final String ENTITY_SHEET = "sheet";
public static final String ENTITY_WORKBOOK = "workbook";
}
|
[
"[email protected]"
] | |
d67077a199ae9cc8a15e60eca3710f44065049d0
|
9a249360806ca6bae75c575b0021d6d9657e9679
|
/ELTRUT_2/src/gui/CreateMasterFrame.java
|
b461db4d852bfb3dd70c9c79291c64020b319926
|
[] |
no_license
|
PeterMitrano/Genetic-Algorithm
|
62d62a2e9b24665c3e4967a358347a38d988d2fa
|
f60e4effe97811ee21784933d0c3608578a87508
|
refs/heads/master
| 2020-05-25T09:39:58.212374 | 2017-01-24T05:18:06 | 2017-01-24T05:18:06 | 20,512,464 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,020 |
java
|
package gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
public class CreateMasterFrame extends JFrame {
private static final CreateMasterFrame theCreateMasterFrame = new CreateMasterFrame();
public static CreateMasterFrame getInstance() {
return theCreateMasterFrame;
}
private Dimension screenSize;
private CreateMasterControlPanel controlPanel;
private Menu menu;
private CreateMasterFrame() {
super();
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("Create Master");
this.setResizable(false);
screenSize = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation((screenSize.width - WelcomePanel.w) / 2,
(screenSize.height - WelcomePanel.h) / 2);
menu = new Menu(this);
controlPanel = new CreateMasterControlPanel(this);
this.add(controlPanel, BorderLayout.SOUTH);
this.add(ClickableField.getInstance(), BorderLayout.CENTER);
this.add(menu, BorderLayout.NORTH);
this.pack();
}
}
|
[
"[email protected]"
] | |
ceb1ac3c02d660e81d5061a4709b1310e33c38d4
|
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/finder/cgi/f.java
|
8358f7ec9578a238d225b81ec2f97e97bd503992
|
[] |
no_license
|
tsuzcx/qq_apk
|
0d5e792c3c7351ab781957bac465c55c505caf61
|
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
|
refs/heads/main
| 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 |
Java
|
UTF-8
|
Java
| false | false | 2,322 |
java
|
package com.tencent.mm.plugin.finder.cgi;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.am.c.a;
import com.tencent.mm.bx.a;
import com.tencent.mm.plugin.findersdk.b.c;
import com.tencent.mm.protocal.protobuf.ati;
import com.tencent.mm.protocal.protobuf.atj;
import com.tencent.mm.protocal.protobuf.etl;
import com.tencent.mm.protocal.protobuf.kd;
import com.tencent.mm.sdk.platformtools.Log;
import kotlin.Metadata;
@Metadata(d1={""}, d2={"Lcom/tencent/mm/plugin/finder/cgi/CgiFinderAdLiveNotice;", "Lcom/tencent/mm/plugin/findersdk/cgi/FinderCgi;", "Lcom/tencent/mm/protocal/protobuf/FinderAdLiveNoticeResponse;", "userName", "", "noticeId", "contextObj", "Lcom/tencent/mm/protocal/protobuf/FinderReportContextObj;", "(Ljava/lang/String;Ljava/lang/String;Lcom/tencent/mm/protocal/protobuf/FinderReportContextObj;)V", "TAG", "getNoticeId", "()Ljava/lang/String;", "request", "Lcom/tencent/mm/protocal/protobuf/FinderAdLiveNoticeRequest;", "getUserName", "onCgiEnd", "", "errType", "", "errCode", "errMsg", "resp", "scene", "Lcom/tencent/mm/modelbase/NetSceneBase;", "plugin-finder_release"}, k=1, mv={1, 5, 1}, xi=48)
public final class f
extends c<atj>
{
private ati Ayx;
private final String TAG;
private final String hAR;
private final String userName;
public f(String paramString1, String paramString2)
{
super(null);
AppMethodBeat.i(336373);
this.userName = paramString1;
this.hAR = paramString2;
this.TAG = "Finder.CgiFinderAdLiveNotice";
this.Ayx = new ati();
this.Ayx.finderUsername = this.userName;
this.Ayx.hAR = this.hAR;
paramString1 = new c.a();
paramString1.otE = ((a)this.Ayx);
paramString2 = new atj();
paramString2.setBaseResponse(new kd());
paramString2.getBaseResponse().akjO = new etl();
paramString1.otF = ((a)paramString2);
paramString1.uri = "/cgi-bin/micromsg-bin/finderadlivenotice";
paramString1.funcId = 4164;
c(paramString1.bEF());
Log.i(this.TAG, "init userName:" + this.userName + ", noticeId:" + this.hAR);
AppMethodBeat.o(336373);
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes13.jar
* Qualified Name: com.tencent.mm.plugin.finder.cgi.f
* JD-Core Version: 0.7.0.1
*/
|
[
"[email protected]"
] | |
6ee7a37ac21314c53c31a03c60d922730548a8a5
|
502f548aba3cc269540db67e46710f358e452444
|
/src/main/java/com/fivewh/deploy/html/action/OperationAction.java
|
1dff595c08b729507875a3370a8360c8d242bc1f
|
[] |
no_license
|
liu67224657/besl-deploy
|
6c68f25087415826cf49cc7d68f4e755186efc01
|
cf4e9009b0cb3b5f5b7a6cb41fdcdb0da7e8e078
|
refs/heads/master
| 2021-08-06T09:20:41.407243 | 2017-11-04T18:24:25 | 2017-11-04T18:24:25 | 109,518,750 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,329 |
java
|
/**
* (c) 2008 Fivewh.com
*/
package com.fivewh.deploy.html.action;
import com.fivewh.deploy.*;
import java.util.ArrayList;
import java.util.Collection;
/**
* @Auther: <a mailto:[email protected]>Yin Pengyi</a>
*/
public abstract class OperationAction extends AccessCheckAction {
private String env;
private String oper;
private String args;
private String exec;
private String[] hosts = new String[]{};
protected Operation operation;
protected OperationKey operKey;
private OperationEnv operationEnv;
private ExecType execType = ExecType.REFRESH;
private Collection<OperationHost> envAllHosts;
protected Collection<OperationHost> formSelectHosts = new ArrayList<OperationHost>();
private Collection<OperationHost> toolsPlatformHosts;
//////////////////////////////////////////////////////////
public void setEnv(String env) {
this.env = env;
operationEnv = OperationManager.get().getOperationEnv(this.env);
envAllHosts = OperationManager.get().getHostsByEnv(operationEnv).values();
toolsPlatformHosts = OperationManager.get().getToolsplatformHostsByEnv(operationEnv).values();
}
public String getEnv() {
return env;
}
public String getOper() {
return oper;
}
public void setOper(String oper) {
this.oper = oper;
}
public String getExec() {
return exec;
}
public ExecType getExecType() {
return execType;
}
public void setExec(String exec) {
this.exec = exec;
execType = ExecType.getTypeByCode(exec);
}
public String[] getHosts() {
return hosts;
}
public void setHosts(String[] hosts) {
this.hosts = hosts;
}
public String getArgs() {
return args;
}
public void setArgs(String args) {
this.args = args;
}
public boolean isPreview() {
return ExecType.PREVIEW.equals(execType);
}
public boolean isRefresh() {
return ExecType.REFRESH.equals(execType);
}
public boolean isExecute() {
return ExecType.EXECUTE.equals(execType);
}
public boolean isRemove() {
return ExecType.REMOVE.equals(execType);
}
public OperationEnv getOperationEnv() {
return operationEnv;
}
public void setOperationEnv(OperationEnv operationEnv) {
this.operationEnv = operationEnv;
}
public Collection<OperationHost> getEnvAllHosts() {
return envAllHosts;
}
public void setEnvAllHosts(Collection<OperationHost> envAllHosts) {
this.envAllHosts = envAllHosts;
}
public Collection<OperationHost> getToolsPlatformHosts() {
return toolsPlatformHosts;
}
public void setToolsPlatformHosts(Collection<OperationHost> toolsPlatformHosts) {
this.toolsPlatformHosts = toolsPlatformHosts;
}
public Collection<OperationHost> getFormSelectHosts() {
return formSelectHosts;
}
public Operation getOperation() {
return operation;
}
public void setOperation(Operation operation) {
this.operation = operation;
}
public OperationKey getOperKey() {
return operKey;
}
public void setOperKey(OperationKey operKey) {
this.operKey = operKey;
}
}
|
[
"[email protected]"
] | |
d4dc92038a502614e4af642b78b8f441c50187c1
|
484313ec088d0716b120298cc363cf2ac30484b0
|
/inno72-job-core/src/main/java/com/inno72/job/core/rpc/codec/RpcRequest.java
|
8f959f3f5adb428ad158e575d1152e5557ef87fa
|
[] |
no_license
|
pologood/inno72-job-service
|
f7ed1f44787ffc912c0fa94fb363032900918259
|
d92d1af1cf99eb3fde96481c0576cccf4d67be8c
|
refs/heads/master
| 2020-06-01T12:05:22.940599 | 2019-03-12T03:13:58 | 2019-03-12T03:13:58 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,919 |
java
|
package com.inno72.job.core.rpc.codec;
import java.io.Serializable;
import java.util.Arrays;
public class RpcRequest implements Serializable{
private static final long serialVersionUID = 1L;
private String serverAddress;
private long createMillisTime;
private String accessToken;
private String className;
private String methodName;
private Class<?>[] parameterTypes;
private Object[] parameters;
public String getServerAddress() {
return serverAddress;
}
public void setServerAddress(String serverAddress) {
this.serverAddress = serverAddress;
}
public long getCreateMillisTime() {
return createMillisTime;
}
public void setCreateMillisTime(long createMillisTime) {
this.createMillisTime = createMillisTime;
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
public Class<?>[] getParameterTypes() {
return parameterTypes;
}
public void setParameterTypes(Class<?>[] parameterTypes) {
this.parameterTypes = parameterTypes;
}
public Object[] getParameters() {
return parameters;
}
public void setParameters(Object[] parameters) {
this.parameters = parameters;
}
@Override
public String toString() {
return "RpcRequest{" +
"serverAddress='" + serverAddress + '\'' +
", createMillisTime=" + createMillisTime +
", accessToken='" + accessToken + '\'' +
", className='" + className + '\'' +
", methodName='" + methodName + '\'' +
", parameterTypes=" + Arrays.toString(parameterTypes) +
", parameters=" + Arrays.toString(parameters) +
'}';
}
}
|
[
"[email protected]"
] | |
cf1d101f907bdb32531258058ec914fd098d49af
|
08ad8b861a6d095925eeb2fbdc6ceea984a09d76
|
/src/java/bean/loginbean.java
|
49e5373dfc26b2e0b96caa0601597b95dbeae1f9
|
[] |
no_license
|
Leopss1997/web
|
00d9d61801b2fab6920f71163d33783ce78effbe
|
ff3f22bbbd9133622b2c057bea2eeb69b24d6a21
|
refs/heads/master
| 2023-02-15T07:29:35.062846 | 2021-01-08T01:39:34 | 2021-01-08T01:39:34 | 327,766,547 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,683 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package bean;
import dao.usuariodao;
import imp.usuarioDaoImp;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.servlet.http.HttpSession;
import model.Usuario;
import org.primefaces.context.RequestContext;
@ManagedBean
@SessionScoped
public class loginbean{
private String nombreUsuario;
private String password;
private Usuario usuario;
public loginbean() {
this.usuario = new Usuario();
}
public String getNombreUsuario() {
return nombreUsuario;
}
public void setNombreUsuario(String nombreUsuario) {
this.nombreUsuario = nombreUsuario;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
public void login(ActionEvent event){
RequestContext context = RequestContext.getCurrentInstance();
FacesMessage message = null;
boolean loggedln = false;
String ruta="";
usuariodao uDao = new usuarioDaoImp();
this.usuario = uDao.login(this.usuario);
if (this.usuario != null) {
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("usuario", this.usuario.getNombreUsuario());
loggedln = true;
message = new FacesMessage(FacesMessage.SEVERITY_INFO,"Bienvenido",this.usuario.getNombreUsuario());
ruta = "/WEBAPP1/faces/Views/bienvenido.xhtml";
}else{
loggedln = false;
message = new FacesMessage(FacesMessage.SEVERITY_INFO,"Error al ingresar","Datos incorrectos");
this.usuario = new Usuario();
}
FacesContext.getCurrentInstance().addMessage(null, message);
context.addCallbackParam("loggedln", loggedln);
context.addCallbackParam("ruta", ruta);
}
public String cerrarSession(){
this.nombreUsuario = null;
this.password = null;
HttpSession httpSession = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
httpSession.invalidate();
return "/login";
}
}
|
[
"[email protected]"
] | |
ef03eb250eab124f629b1809a8e2f4a5e028e5bc
|
c98ba1b215c4d8a378d9f453d18e2b02d5d0f4c4
|
/HMLoanProcessingAndSanctioning/src/main/java/com/crts/app/hm/main/model/PreviousLoanDetails.java
|
ed84bd75602b9c1652d5a88620df86e995676517
|
[] |
no_license
|
RushabhUttarwar/Firts
|
918c31f7d40ad6d0bed7a25621ebade94e21ee11
|
4475275f035aac79dbd2c45d0c80bf096516c1d5
|
refs/heads/master
| 2023-08-17T13:12:03.248504 | 2020-02-18T12:26:36 | 2020-02-18T12:26:36 | 224,829,688 | 0 | 1 | null | 2023-07-22T22:59:06 | 2019-11-29T10:15:23 |
Java
|
UTF-8
|
Java
| false | false | 1,447 |
java
|
package com.crts.app.hm.main.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class PreviousLoanDetails {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int previousLoanId;
private double preLoanAmount;
private int preTenure;
private int preLoanStatus;
private double remainingEmi;
public int getPreviousLoanId() {
return previousLoanId;
}
public void setPreviousLoanId(int previousLoanId) {
this.previousLoanId = previousLoanId;
}
public double getPreLoanAmount() {
return preLoanAmount;
}
public void setPreLoanAmount(double preLoanAmount) {
this.preLoanAmount = preLoanAmount;
}
public int getPreTenure() {
return preTenure;
}
public void setPreTenure(int preTenure) {
this.preTenure = preTenure;
}
public int getPreLoanStatus() {
return preLoanStatus;
}
public void setPreLoanStatus(int preLoanStatus) {
this.preLoanStatus = preLoanStatus;
}
public double getRemainingEmi() {
return remainingEmi;
}
public void setRemainingEmi(double remainingEmi) {
this.remainingEmi = remainingEmi;
}
@Override
public String toString() {
return "PreviousLoanDetails [previousLoanId=" + previousLoanId + ", preLoanAmount=" + preLoanAmount
+ ", preTenure=" + preTenure + ", preLoanStatus=" + preLoanStatus + ", remainingEmi=" + remainingEmi
+ "]";
}
}
|
[
"[email protected]"
] | |
e90193a03cbd91008550e98fc4aec6759d89cf06
|
b0e832c329132e1a173940b9557f2cb50d301b97
|
/yz/src/com/pay/method/MFramePayType.java
|
3867bc26d449e8b056dfadb59ed5e57b6abb86ea
|
[] |
no_license
|
heyangy123/yz
|
999475f47848b6e5a6eda23b80b4f62b3e6dd50e
|
56884223f976807f92371e247871209bc36c752d
|
refs/heads/master
| 2021-06-19T15:41:57.863083 | 2017-07-18T02:11:58 | 2017-07-18T02:11:58 | 97,539,885 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 123 |
java
|
package com.pay.method;
public enum MFramePayType
implements MPayType
{
NORMAL_BUY,
ali_pay,
wx_pay,
RECHARGE;
}
|
[
"[email protected]"
] | |
5d105c606a8132af874167b136f3b4583d61a918
|
2892711f05661eefb2e3b28b94be7212164b13ce
|
/app/src/main/java/org/willisson/wapp/AlexActivity.java
|
4c1c53063d8dc70f33bf9662f444f7ef3b83e069
|
[] |
no_license
|
AlexWillisson/Wapp
|
275752406e1e6a0a99ec757eaf8b57203208638b
|
4082d6eea7e6c6845d72b3dac190b5731607ca2b
|
refs/heads/master
| 2021-01-13T00:49:16.734510 | 2015-11-28T19:52:54 | 2015-11-28T19:52:54 | 46,952,756 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,485 |
java
|
package org.willisson.wapp;
import android.app.NotificationManager;
import android.app.Notification;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.PowerManager;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.NotificationCompat;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.maps.model.LatLng;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.net.MulticastSocket;
import java.util.ArrayList;
public class AlexActivity extends AppCompatActivity {
public MulticastSocket socket;
public Thread timer, rcv_thread;
public boolean keep_going, multicast_active;
public WifiManager.MulticastLock multicast_lock;
public TextView last_msg_textview;
public AppCompatActivity alex_activity;
NotificationManager nm;
PowerManager pm;
PowerManager.WakeLock wl;
String last_notification;
SharedPreferences prefs;
SharedPreferences.Editor prefs_editor;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_alex);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
nm = (NotificationManager) getSystemService (Context.NOTIFICATION_SERVICE);
alex_activity = this;
pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
multicast_active = false;
last_notification = "";
prefs = getSharedPreferences ("ATW", MODE_PRIVATE);
prefs_editor = prefs.edit ();
if (prefs.getBoolean ("initialized", false) == false) {
send_toast ("initializing");
prefs_editor.putFloat ("13:34lat", 42);
prefs_editor.putFloat ("13:34lon", -71);
prefs_editor.putFloat ("13:44lat", 43);
prefs_editor.putFloat ("13:44lon", -71);
prefs_editor.putFloat ("13:54lat", 43);
prefs_editor.putFloat ("13:54lon", -70);
prefs_editor.putFloat ("14:04lat", 42);
prefs_editor.putFloat ("14:04lon", -70);
prefs_editor.putBoolean ("initialized", true);
prefs_editor.commit ();
}
}
public void save_stuff (View view) {
send_toast ("saving :'" + last_notification);
prefs_editor.putString("last_notification", last_notification);
prefs_editor.commit();
}
public void load_stuff (View view) {
String s = prefs.getString ("last_notification",
"THIS SPACE INTENTIONALLY LEFT BLANK");
send_toast (s);
}
public void dump_loclog (View view) {
int hr, min, idx;
String time, latkey, lonkey;
float lat, lon;
ArrayList<LocLog> hist;
LocLog node;
hist = new ArrayList<LocLog> ();
for (hr = 0; hr < 24; hr++) {
for (min = 0; min < 60; min++) {
time = hr + ":" + String.format ("%02d", min);
latkey = time + "lat";
lonkey = time + "lon";
lat = prefs.getFloat (latkey, 0);
lon = prefs.getFloat (lonkey, 0);
if (lat != 0 && lon != 0) {
hist.add (new LocLog (new LatLng (lat, lon), time));
}
}
}
for (idx = 0; idx < hist.size (); idx++) {
node = hist.get (idx);
Log.i ("WAPP", "loc: " + node.loc + ", time: " + node.tag);
}
}
public void start_multicast (View view) {
if (multicast_active == false) {
multicast_active = true;
rcv_thread_setup ();
wl = pm.newWakeLock (PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, "wltag");
}
}
public void toast_btn (View view) {
send_toast("hello, world");
}
public void sample_notification1 (View view) {
Notification.Builder builder = new Notification.Builder (this)
.setSmallIcon (R.mipmap.ic_launcher)
.setContentTitle ("foo")
.setContentText ("bar baz")
.setOngoing (true);
Notification notification = builder.build ();
nm.notify(42, notification);
last_notification = "bar baz";
}
public void sample_notification2 (View view) {
Notification.Builder builder = new Notification.Builder (this)
.setSmallIcon (R.mipmap.ic_launcher)
.setContentTitle ("bar")
.setContentText ("quuuuux")
.setOngoing (true);
Notification notification = builder.build ();
nm.notify (42, notification);
last_notification = "quuuuux";
}
public void send_toast (String text) {
Context context = getApplicationContext ();
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText (context, text, duration);
toast.show();
}
public void to_map (View view) {
Intent intent = new Intent (this, MapsActivity.class);
startActivity(intent);
}
@Override
protected void onDestroy() {
keep_going = false;
if (wl != null && wl.isHeld ()) {
wl.release ();
}
super.onDestroy();
}
void rcv_thread_setup() {
Log.i("WAPP", "rcv_thread_setup");
if (rcv_thread == null) {
rcv_thread = new Thread() {
public void run() {
udp_setup ();
try {
while (keep_going) {
rcv_step ();
}
} catch (Exception e) {
Log.i("WAPP", "rcv_thread error " + e);
}
}
};
Log.i ("WAPP", "starting rcv_thread");
keep_going = true;
rcv_thread.start();
}
}
void udp_setup () {
Log.i ("WAPP", "doing udp_setup");
try {
if (socket == null) {
Log.i ("WAPP", "creating multicast socket");
socket = new MulticastSocket(20151);
Log.i ("WAPP", "my socket " + socket.getLocalAddress());
WifiManager wifi = (WifiManager)getSystemService(Context.WIFI_SERVICE);
multicast_lock = wifi.createMulticastLock ("WAPP");
Log.i("APP", "about to lock: " + multicast_lock.isHeld());
multicast_lock.acquire();
Log.i("WAPP", "got lock: " + multicast_lock.isHeld() + " " + multicast_lock);
InetAddress maddr = InetAddress.getByName ("224.0.0.1");
socket.joinGroup(maddr);
}
} catch (Exception e) {
Log.i("WAPP", "udp error " + e);
}
}
public int tick_count;
void udp_tick () {
try {
tick_count++;
String msg = "hello " + socket.getLocalAddress() + " " + timer + " " + tick_count;
byte[] xbytes = msg.getBytes();
DatagramPacket xpkt = new DatagramPacket(xbytes, xbytes.length);
socket.send(xpkt);
Log.i("WAPP", "send done");
} catch (Exception e) {
Log.i ("WAPP", "udp_tick error" + e);
}
}
void rcv_step () {
try {
byte[] rbuf = new byte[2000];
DatagramPacket rpkt = new DatagramPacket(rbuf, rbuf.length);
Log.i ("WAPP", "about to call receive");
socket.receive(rpkt);
final String rmsg = new String (rpkt.getData(), 0, rpkt.getLength(), "UTF-8");
Log.i("WAPP", "rcv " + " " + rpkt.getSocketAddress() + " " + rmsg);
Log.i("WAPP", "lock: " + multicast_lock.isHeld() + " " + multicast_lock);
wl.acquire ();
wl.release ();
runOnUiThread (new Runnable() {
public void run() {
Notification.Builder builder
= new Notification.Builder(alex_activity)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("pkt")
.setContentText(rmsg)
.setOngoing(true);
Notification notification = builder.build();
nm.notify(42, notification);
last_notification = rmsg;
}
});
} catch (Exception e) {
Log.i ("WAPP", "rcv_step error " + e);
}
}
}
class LocLog {
public LatLng loc;
public String tag;
public LocLog (LatLng latlng, String title) {
loc = latlng;
tag = title;
}
}
|
[
"[email protected]"
] | |
85584011bf83ea3aea4f88343d7c8fa26c6d5f5a
|
55a356aaccc67fcf172522ea04a0b948935ecb4a
|
/Demo/src/main/java/com/zlq/zhttpclient/MainActivity.java
|
ac9838c7bccdc9480df49f6797e2f0684ff221f1
|
[] |
no_license
|
zhanglq060/ZHttpClient
|
f6e24bfcc0eda22efc339de1260d47902048e287
|
a1f140cfcc7d13d112265cfcb517f821e5685709
|
refs/heads/master
| 2021-01-16T21:05:24.906269 | 2016-08-04T07:44:56 | 2016-08-04T07:44:56 | 61,114,148 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,453 |
java
|
package com.zlq.zhttpclient;
import android.app.Activity;
import android.app.ProgressDialog;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.zlq.zhttpclient.library.TextResponseListener;
import java.io.File;
public class MainActivity extends Activity implements View.OnClickListener{
Button getBtn;
Button postBtn;
Button downloadBtn;
TextView textView;
ImageView imageView;
HttpUtils mHttpUtils;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mHttpUtils = new HttpUtils(this);
getBtn = (Button) findViewById(R.id.request_get_btn);
postBtn = (Button) findViewById(R.id.request_post_btn);
downloadBtn = (Button) findViewById(R.id.request_downloadfile_btn);
textView = (TextView) findViewById(R.id.text);
imageView = (ImageView) findViewById(R.id.image);
getBtn.setOnClickListener(this);
postBtn.setOnClickListener(this);
downloadBtn.setOnClickListener(this);
}
ProgressDialog progressDialog = null;
static Handler handler = new Handler();
@Override
public void onClick(View v) {
textView.setText("");
switch (v.getId()){
case R.id.request_get_btn:
mHttpUtils.get("https://www.baidu.com", null, new TextResponseListener() {
@Override
public void onStart() {
super.onStart();
if(progressDialog == null) progressDialog = new ProgressDialog(MainActivity.this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage("加载中...");
progressDialog.show();
}
@Override
public void onSuccess(int responseCode, String responseContent) {
textView.setVisibility(View.VISIBLE);
imageView.setVisibility(View.GONE);
textView.setText(responseContent);
}
@Override
public void onFailure(int responseCode, String responseContent, Throwable throwable) {
textView.setText(responseContent);
}
@Override
public void onFinish() {
super.onFinish();
progressDialog.dismiss();
}
@Override
public void onCancel() {
super.onCancel();
progressDialog.dismiss();
}
});
break;
case R.id.request_post_btn:
break;
case R.id.request_downloadfile_btn:
//http://f.hiphotos.baidu.com/image/pic/item/f636afc379310a5566becb8fb24543a982261036.jpg
if(progressDialog == null) progressDialog = new ProgressDialog(MainActivity.this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage("加载中...");
progressDialog.show();
new Thread(new Runnable() {
@Override
public void run() {
final File resultFile = mHttpUtils.downloadFile(
"http://f.hiphotos.baidu.com/image/pic/item/f636afc379310a5566becb8fb24543a982261036.jpg",
"/sdcard/zhttpclient_meinv.jpg");
handler.post(new Runnable() {
@Override
public void run() {
if(resultFile != null && resultFile.exists()){
textView.setVisibility(View.GONE);
imageView.setVisibility(View.VISIBLE);
imageView.setImageBitmap(BitmapFactory.decodeFile(resultFile.getPath()));
}
progressDialog.dismiss();
}
});
}
}).start();
break;
}
}
}
|
[
"[email protected]"
] | |
3ff8cedfcc7a2e908f811947a3380090311f646d
|
cc5213eda0222f2a16a82ca1cf815838fd342a47
|
/src/main/java/estimation/controller/FPController.java
|
9f5e8d3891bfe25cb9e27a86e5cc3e541daf0aab
|
[] |
no_license
|
xuawai/crowdsourcing-vue-backend
|
f2af742c9363981221373a538b6db205bf4d61ec
|
64c500e4fd95669b6c1a0b647a892fad327a287c
|
refs/heads/master
| 2021-01-20T08:18:45.325074 | 2017-06-19T05:04:35 | 2017-06-19T05:04:35 | 90,125,961 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,971 |
java
|
package estimation.controller;
import estimation.service.FPService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* Created by xuawai on 15/05/2017.
*/
@RestController
@RequestMapping(value = "/fp")
public class FPController {
@Autowired
FPService fpService;
@RequestMapping(value = "/ufp/{id}", method = RequestMethod.GET)
public int calculateUFP( @PathVariable String id) {
return fpService.calculateUFP(id);
}
@RequestMapping(value = "/fp/{id}", method = RequestMethod.POST)
public int calculateFP(@PathVariable String id, @RequestBody JSONObject jsonObject){
int ufp = fpService.calculateUFP(id);
//其他参数,如语言类型等等
String developmentType = jsonObject.getString("developmentType");
String developmentPlatform = jsonObject.getString("developmentPlatform");
String languageType = jsonObject.getString("languageType");
String DBMS_Used = jsonObject.getString("DBMS_Used");
//这一部分是数字,要转成float之类
String RELY = jsonObject.getString("RELY");
String CPLX = jsonObject.getString("CPLX");
String TIME = jsonObject.getString("TIME");
String SCED = jsonObject.getString("SCED");
//算法
double afp = ufp;
// Development Type
if(developmentType.equalsIgnoreCase("New Development")){
afp = afp * 0.857;
}else if(developmentType.equalsIgnoreCase("Enhancement")){
afp = afp * 0.858;
}else if(developmentType.equalsIgnoreCase("Re-development")){
afp = afp * 0.863;
}
System.out.println("Adjusted by development type:"+afp);
// Development Platform
if(developmentPlatform.equalsIgnoreCase("PC")){
afp = afp * 0.61;
}else if(developmentPlatform.equalsIgnoreCase("MR")){
afp = afp * 1.01;
}else if(developmentPlatform.equalsIgnoreCase("MF")){
afp = afp * 1.06;
}
System.out.println("Adjusted by development platform:"+afp);
// Language Type
if(languageType.equalsIgnoreCase("3GL")){
afp = afp * 1.06;
}else if(languageType.equalsIgnoreCase("4GL")){
afp = afp * 0.87;
}
System.out.println("Adjusted by language type:"+afp);
// COCOMO Cost Driver
double COCOMOKFs[] = {1,1,1,1};
COCOMOKFs[0] = Double.parseDouble(RELY);
COCOMOKFs[1] = Double.parseDouble(CPLX);
COCOMOKFs[2] = Double.parseDouble(TIME);
COCOMOKFs[3] = Double.parseDouble(SCED);
for(int i=0;i<4;i++){
if(COCOMOKFs[i] > 0 && COCOMOKFs[i] != Double.NaN){
afp = afp * COCOMOKFs[i];
}
}
System.out.println("Adjusted by cocomo driver:"+afp);
return (int)afp;
}
}
|
[
"[email protected]"
] | |
ce6dac7be2c0524895b273e258a1d52276ce4e9b
|
c299defd565d14d297b1a6f02cc71702806c56ce
|
/app/src/test/java/com/example/maryam/digitilclock2/ExampleUnitTest.java
|
2493e1d4f92fa5c811a6323b6be7541abfe86dae
|
[] |
no_license
|
elhammohammadi1374/digitalclock1
|
fef8af35cb9344fa7893d77fe4559463d05134bc
|
f359c722d7b784a14a33c58a705c62afe9d36420
|
refs/heads/master
| 2021-04-03T12:15:15.245858 | 2018-03-14T09:14:38 | 2018-03-14T09:14:38 | 125,184,536 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 339 |
java
|
package com.example.maryam.digitilclock2;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
bdabe67f37eacaee1c8a7d6c29fb169bb25b9528
|
3e739e0ac576037d6e9fc742398bba3e07b20c82
|
/app/src/test/java/loginregistration/learn2crack/com/webviewapp/ExampleUnitTest.java
|
e9a16c31a169d6ddb43d4911bb5b4c07f5919f23
|
[] |
no_license
|
CenkCamkiran/Android-WebView-App
|
2106e920da11254f929c68a4696098c74ecbf46e
|
8f0605ca4d75794555b0849619bdee1af87009fc
|
refs/heads/master
| 2022-06-13T14:33:17.265044 | 2020-05-04T15:29:41 | 2020-05-04T15:29:41 | 261,223,519 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 422 |
java
|
package loginregistration.learn2crack.com.webviewapp;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
3a435d7d5fe2799fb9835bc7138bc930f224b50b
|
95e1d755e34a3da8f1627cc1326b419cf2848ad8
|
/spring-netty-client/src/main/java/cn/intellif/springnettyclient/handler/Byte2MessageHandler.java
|
65429139ddf9afacb6595981effc7534d48b9634
|
[] |
no_license
|
yinbucheng/spring-cloud-test
|
fe4263293636efa2f0fff089223123a5468390d2
|
b4ec003f7d4e7ae678c7ed1006967e5195761c0c
|
refs/heads/master
| 2020-03-25T11:26:12.035404 | 2018-12-05T12:05:11 | 2018-12-05T12:05:11 | 143,732,301 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,270 |
java
|
package cn.intellif.springnettyclient.handler;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import java.util.LinkedList;
import java.util.List;
public class Byte2MessageHandler extends ByteToMessageDecoder {
@Override
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception {
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>进入到 Byte2Message中");
//这里我们认为 \n为结束符
byteBuf.markReaderIndex();
List<Byte> buf = new LinkedList<>();
int len = byteBuf.writerIndex()-byteBuf.readerIndex();
int i=0;
boolean flag = false;
while(i<len){
i++;
byte data = byteBuf.readByte();
if(data==10){
flag = true;
break;
}
buf.add(data);
}
if(flag){
int size = buf.size();
byte[] result = new byte[size];
for( i=0;i<size;i++){
result[i]=buf.get(i);
}
list.add(new String(result));
}else{
byteBuf.resetReaderIndex();
}
}
}
|
[
"[email protected]"
] | |
b7ee209541bd6921434699d707fc68e4b6a013dd
|
ad15cec26530025b8ead4486444c03ede3fb4aa4
|
/paywall-spring/src/main/java/org/lightningj/paywall/spring/util/PaywallRuntimeException.java
|
eb6a0c0568ccd7d85a438eead82aae6c7452e59b
|
[
"MIT"
] |
permissive
|
Rui2guo/paywall
|
50ac63afca8f763bcc7404fa89e7517767305293
|
b4c5869f79ba035d21ea13c2479ba660a6576d02
|
refs/heads/master
| 2020-05-14T04:57:42.129426 | 2019-02-24T07:26:54 | 2019-02-24T07:26:54 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,964 |
java
|
/*
* ***********************************************************************
* *
* LightningJ *
* *
* This software is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
* (LGPL-3.0-or-later) *
* License as published by the Free Software Foundation; either *
* version 3 of the License, or any later version. *
* *
* See terms of license at gnu.org. *
* *
*************************************************************************/
package org.lightningj.paywall.spring.util;
/**
* Special RuntimeException used in Spring controllers and filters to
* return correct response data.
*
* @author philip 2019-02-14
*/
public class PaywallRuntimeException extends RuntimeException{
/**
* Constructs a new runtime exception with the specified cause and a
* detail message of <tt>(cause==null ? null : cause.toString())</tt>
* (which typically contains the class and detail message of
* <tt>cause</tt>). This constructor is useful for runtime exceptions
* that are little more than wrappers for other throwables.
*
* @param cause the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A <tt>null</tt> value is
* permitted, and indicates that the cause is nonexistent or
* unknown.)
* @since 1.4
*/
public PaywallRuntimeException(Throwable cause) {
super(cause);
}
}
|
[
"[email protected]"
] | |
c5426fd69ab424ec5acf73bd1c7bdfb907e3e1f0
|
111d2588c39f6ab2f74498a988ab6fde641f2362
|
/roncoo-education-user/roncoo-education-user-service/src/main/java/com/roncoo/education/user/dao/impl/mapper/LogLoginMapper.java
|
984e5d7fb38abf01537117c0d9f26a01f570cec7
|
[
"MIT"
] |
permissive
|
JardelCheung/roncoo-education
|
fe61c76a1c9b8bf1d6813c2a578e60a0430b8f27
|
fde8109a028909b74ee234310697fbf79ad7ac15
|
refs/heads/master
| 2023-07-24T22:49:21.619061 | 2023-06-05T08:22:32 | 2023-06-05T08:22:32 | 394,108,638 | 0 | 0 |
MIT
| 2021-08-09T01:22:20 | 2021-08-09T01:22:19 | null |
UTF-8
|
Java
| false | false | 983 |
java
|
package com.roncoo.education.user.dao.impl.mapper;
import com.roncoo.education.user.dao.impl.mapper.entity.LogLogin;
import com.roncoo.education.user.dao.impl.mapper.entity.LogLoginExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface LogLoginMapper {
int countByExample(LogLoginExample example);
int deleteByExample(LogLoginExample example);
int deleteByPrimaryKey(Long id);
int insert(LogLogin record);
int insertSelective(LogLogin record);
List<LogLogin> selectByExample(LogLoginExample example);
LogLogin selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") LogLogin record, @Param("example") LogLoginExample example);
int updateByExample(@Param("record") LogLogin record, @Param("example") LogLoginExample example);
int updateByPrimaryKeySelective(LogLogin record);
int updateByPrimaryKey(LogLogin record);
}
|
[
"[email protected]"
] | |
56b171b5ee0448b84ab790034d93f1a4ca9fbb9b
|
3fa44ccb6329ad3bf7d18777a3dcfe139b0fc12c
|
/src/main/java/com/bsc/sso/authentication/soap/WebServiceSoap_PortType.java
|
8f0656846b9e155c0d90e9fe07634fcf5a20b5c0
|
[] |
no_license
|
springwindyike/sso-integrator
|
e782f3b84a951806b85fd821cc8a3f5e3e41ff89
|
d03c7aa1a41cf0cec35e2081897a7bd6e8a099df
|
refs/heads/master
| 2022-12-19T19:24:52.367561 | 2020-10-14T12:09:09 | 2020-10-14T12:09:09 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 500 |
java
|
/**
* WebServiceSoap_PortType.java
* <p>
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.bsc.sso.authentication.soap;
public interface WebServiceSoap_PortType extends java.rmi.Remote {
public SsoAuthResponse getAuthToken(String userName, String passWord, boolean isRememberPassword) throws java.rmi.RemoteException;
public SsoCheckResponse checkAuthToken(String token) throws java.rmi.RemoteException;
}
|
[
"[email protected]"
] | |
5860c238764ce6b7308e784c34d8125f58f4a135
|
f8b2c262d33605c17e83b707ff83fd20e7956e89
|
/app/src/main/res/values/mom/fragments/NotoficationFragment.java
|
21efe6694e23270b3c1aee34d4a0c93f4caf71f4
|
[] |
no_license
|
meparam/resideManuWithList
|
ad32fdeaebc1bdaa1fbc81780c643252f4aa6d08
|
6582bbc6bbc947e13ccf3bb0676acabb6c2a2dba
|
refs/heads/master
| 2021-01-13T09:04:42.943717 | 2016-09-29T13:29:17 | 2016-09-29T13:29:20 | 69,569,730 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,522 |
java
|
package vp.mom.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.baoyz.swipemenulistview.SwipeMenuListView;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import vp.mom.R;
import vp.mom.adapters.NotificationNewAdapter;
import vp.mom.app.AppController;
import vp.mom.data.NotificationPojo;
/**
* Created by ApkDev2 on 07-11-2015.
*/
public class NotoficationFragment extends Fragment {
private SwipeMenuListView mListView;
private NotificationNewAdapter mAdapter;
ArrayList<NotificationPojo> bookMArkList;
private vp.mom.api.SessionManager session;
View rootView;
RelativeLayout errorLayout;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.bookmarks_xml, container, false);
bookMArkList=new ArrayList<>();
session=new vp.mom.api.SessionManager(getActivity());
mListView = (SwipeMenuListView) rootView.findViewById(R.id.bookmarklistview);
errorLayout= (RelativeLayout) rootView.findViewById(R.id.error_layout);
errorLayout.setVisibility(View.GONE);
mAdapter = new NotificationNewAdapter(getActivity(),bookMArkList);
mListView.setAdapter(mAdapter);
getData();
return rootView;
}
private void getData() {
AppController.getInstance().getPrefManager().clear();
String tag_string_req = "NOTIFICATION_LIST";
StringRequest strReq = new StringRequest(Request.Method.POST,
vp.mom.api.AppConfig.NOTIFICATION_LIST, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
// Log.e("NOTIFICATION Response:", "NOTIFICATION Response: " + response.toString());
// hideDialog();
if (response != null) {
// commentData.clear();
JSONObject jsonresponse= null;
try {
jsonresponse = new JSONObject(response.toString());
if(jsonresponse.getBoolean("status"))
{
mListView.setVisibility(View.VISIBLE);
errorLayout.setVisibility(View.GONE);
parseJsonFeed(jsonresponse);
}
else
{
mListView.setVisibility(View.GONE);
errorLayout.setVisibility(View.VISIBLE);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e("param", "Login Error: " + error.getMessage());
// hideDialog();
}
}) {
@Override
protected Map<String, String> getParams() {
// Posting parameters to login url
Map<String, String> params = new HashMap<String, String>();
params.put("uid",session.getStringSessionData("uid"));
return params;
}
};
// Adding request to request queue
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
}
/**
* Parsing json reponse and passing the data to feed view list adapter
* */
private void parseJsonFeed(JSONObject response) {
Log.e("BookMarkFragment",""+response);
try {
JSONArray feedArray = response.getJSONArray("items");
for (int i = 0; i < feedArray.length(); i++) {
JSONObject feedObj = (JSONObject) feedArray.get(i);
JSONArray otheruserArray = feedObj.getJSONArray("From_user");
JSONObject otherUsrrData = (JSONObject) otheruserArray.get(0);
NotificationPojo feedItem=new NotificationPojo();
if(!feedObj.getString("product_id").equalsIgnoreCase("0"))
{
JSONObject imageObj= feedObj.getJSONObject("product_details");
feedItem.setProductID(feedObj.getString("product_id"));
feedItem.setProducrImage(imageObj.getString("path"));
}
else
{
feedItem.setProductID(feedObj.getString("product_id"));
}
feedItem.setNotificationMsg(feedObj.getString("PNMsg"));
// feedItem.setTime(feedObj.getString("NDT"));
feedItem.setUserImage(otherUsrrData.getString("photo"));
feedItem.setUserName(otherUsrrData.getString("first_name") + " " + otherUsrrData.getString("last_name"));
feedItem.setUserId(feedObj.getString("Ouid"));
CharSequence timeAgo = DateUtils.getRelativeTimeSpanString(
Long.parseLong(feedObj.getString("timeStamp")),
System.currentTimeMillis(), DateUtils.SECOND_IN_MILLIS);
feedItem.setTime("" + timeAgo);
// BookMarkPojo feeditem=new BookMarkPojo();
//
// feeditem.setProductId(feedObj.getString("product_id"));
// feeditem.setProductTime(feedObj.getString("created"));
// feeditem.setProductDisc(feedObj.getString("description"));
// feeditem.setProductUrl(feedObj.getString("path"));
bookMArkList.add(feedItem);
// Log.e("BookMarkFragment", "" + feedObj.getString("product_id"));
}
// notify data changes to list adapater
} catch (JSONException e) {
Log.e("BookMarkFragment",""+e.toString());
e.printStackTrace();
}
mAdapter.notifyDataSetChanged();
// swipeRefreshLayout.setRefreshing(false);
}
}
|
[
"[email protected]"
] | |
b8bbea083e08b83ea32cc7d2bef02909f5c39ca3
|
691bc837082a1633ff1f36576029ffefb8263b3a
|
/src/Backend/Employee.java
|
44cfbdaa3eb519cba1abdef02393f17fc2062e75
|
[] |
no_license
|
HashimRawther/BPO-java
|
9db82ca2b27b79c126733f1f545785bd61d60d4c
|
14e44a5813ef762e0ede00803904caec2e53e324
|
refs/heads/master
| 2023-06-06T23:56:13.527525 | 2021-06-26T09:43:28 | 2021-06-26T09:43:28 | 380,461,592 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,231 |
java
|
package Backend;
import java.util.Date;
public class Employee {
public int id; //Id of the employee
private int company_id; //Company id
public String first_name;
public String last_name;
public String designation;
public String department;
public Date dob;
public Date doj;
public double salary;
public boolean sal_given;
private int account_number;
public Employee(int id,int company_id,String first_name,String designation,String department,Date dob,Date doj,double salary, int account_number,String last_name) {
this.id=id;
this.company_id=company_id;
this.first_name=first_name;
this.last_name=last_name;
this.designation=designation;
this.department=department;
this.dob=dob;
this.doj=doj;
this.salary=salary;
this.account_number=account_number;
}
public Employee(String first_name, String last_name, String designation, double salary, boolean sal_given, int id) {
this.first_name=first_name;
this.last_name=last_name;
this.designation=designation;
this.salary=salary;
this.sal_given=sal_given;
this.id = id;
}
public String toString() {
return this.first_name+" "+this.last_name+" "+this.dob+" "+this.doj;
}
}
|
[
"[email protected]"
] | |
7384bceaef84112dc20d63367cbf848069b5cb39
|
139960e2d7d55e71c15e6a63acb6609e142a2ace
|
/mobile_app1/module1147/src/main/java/module1147packageJava0/Foo84.java
|
3ae9f9ac841e0fef77e97ec461d9c9b01a90df5f
|
[
"Apache-2.0"
] |
permissive
|
uber-common/android-build-eval
|
448bfe141b6911ad8a99268378c75217d431766f
|
7723bfd0b9b1056892cef1fef02314b435b086f2
|
refs/heads/master
| 2023-02-18T22:25:15.121902 | 2023-02-06T19:35:34 | 2023-02-06T19:35:34 | 294,831,672 | 83 | 7 |
Apache-2.0
| 2021-09-24T08:55:30 | 2020-09-11T23:27:37 |
Java
|
UTF-8
|
Java
| false | false | 391 |
java
|
package module1147packageJava0;
import java.lang.Integer;
public class Foo84 {
Integer int0;
Integer int1;
public void foo0() {
new module1147packageJava0.Foo83().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
|
[
"[email protected]"
] | |
87a043f8e456f2d4528adcb93f513906e6cb88be
|
2ecef5908c27f392cd9ef3f77884d81b0064be1a
|
/src/test/java/info/jultest/test/interpret/PlatformErrorTests.java
|
d8ecc7122c6a4c906e45af72d72a73956264b8a4
|
[] |
no_license
|
zhoux738/JSE
|
478b2419b2fea54890947989a8492489e34b4746
|
3b1d3f9ee4150213fb1589e95db64d375d920539
|
refs/heads/master
| 2022-07-08T12:08:14.006918 | 2021-06-29T20:41:25 | 2021-06-29T20:41:25 | 128,875,987 | 3 | 1 | null | 2022-07-01T22:17:26 | 2018-04-10T04:59:22 |
Java
|
UTF-8
|
Java
| false | false | 1,046 |
java
|
package info.jultest.test.interpret;
import static info.jultest.test.Commons.getScriptFile;
import static info.jultest.test.Commons.makeSimpleEngine;
import org.junit.Test;
import info.jultest.test.Commons;
import info.jultest.test.ExceptionTestsBase;
import info.jultest.test.TestExceptionHandler;
import info.julang.execution.simple.SimpleScriptEngine;
import info.julang.execution.symboltable.VariableTable;
import info.julang.external.exceptions.EngineInvocationError;
public class PlatformErrorTests extends ExceptionTestsBase {
private static final String FEATURE = "PlatformError";
@Test
public void stackOverflowTest() throws EngineInvocationError {
VariableTable gvt = new VariableTable(null);
SimpleScriptEngine engine = makeSimpleEngine(gvt);
engine.getContext().addModulePath(Commons.SRC_REPO_ROOT);
TestExceptionHandler teh = installExceptionHandler(engine);
engine.run(getScriptFile(Commons.Groups.IMPERATIVE, FEATURE, "stackoverflow.jul"));
assertException(teh, "System.StackOverflowException");
}
}
|
[
"[email protected]"
] | |
a27e50cd6903e62135c2cadf2f463e5ea44590c8
|
354bfb31a1a98ab1bcb364ac948131de74b3f4d2
|
/app/src/main/java/shared_preferences/com/sharedpreferences/ActivityOne.java
|
3899272c6d383117dfca655fa66ef0ae6c75102b
|
[] |
no_license
|
Namesake12/SharedPreferences
|
9c02e56ca9f2cb5eb73fac7f9c5be6f656466a86
|
2f83a0f1ad1ab61248d1cb8d90a5dc3b66d1a86f
|
refs/heads/master
| 2021-01-19T03:49:09.428630 | 2017-04-05T17:11:14 | 2017-04-05T17:11:14 | 87,336,087 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 373 |
java
|
package shared_preferences.com.sharedpreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class ActivityOne extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_activity_one);
}
}
|
[
"[email protected]"
] | |
3e667f684a277095cb684bfc4f4a1bd206857081
|
d11ee86e50794031a74409617535a3f84635ffba
|
/app/src/androidTest/java/com/example/travelwithme/ExampleInstrumentedTest.java
|
5bbae393c78d9cd719f57fb6691d389e3fb6e344
|
[] |
no_license
|
SanamMundi/Travel
|
aceb817db0a2bff83c9d7aacdb27ae8797414084
|
e80f996b9bf1c05a3e2e3f2e1691239f3f861223
|
refs/heads/master
| 2022-06-30T09:16:16.641761 | 2020-05-05T02:19:33 | 2020-05-05T02:19:33 | 261,342,922 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 758 |
java
|
package com.example.travelwithme;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.travelwithme", appContext.getPackageName());
}
}
|
[
"[email protected]"
] | |
c70b55433d3939db68df4982cbe9ff7d5e63e1ef
|
e910113e034d4c8a73834d3a57bb60ef1abf5e44
|
/writePreApp_Vertical/src/main/java/com/sj/autolayout/attr/Attrs.java
|
35be8f7929fac9478df42aa4ed54d6bf97995896
|
[] |
no_license
|
ElevenSJ/WritePre
|
70304fb3e2e291d8c0235eb33f4fe7581955bcc5
|
00b1e9ccfe20cc4ed43853d5637cc03dee72ed74
|
refs/heads/master
| 2020-03-10T10:40:53.087020 | 2018-04-13T02:49:00 | 2018-04-13T02:49:00 | 129,338,578 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,102 |
java
|
package com.sj.autolayout.attr;
/**
* Created by zhy on 15/12/5.
* <p/>
* 与attrs.xml中数值对应
*/
public interface Attrs
{
public static final int WIDTH = 1;
public static final int HEIGHT = WIDTH << 1;
public static final int TEXTSIZE = HEIGHT << 1;
public static final int PADDING = TEXTSIZE << 1;
public static final int MARGIN = PADDING << 1;
public static final int MARGIN_LEFT = MARGIN << 1;
public static final int MARGIN_TOP = MARGIN_LEFT << 1;
public static final int MARGIN_RIGHT = MARGIN_TOP << 1;
public static final int MARGIN_BOTTOM = MARGIN_RIGHT << 1;
public static final int PADDING_LEFT = MARGIN_BOTTOM << 1;
public static final int PADDING_TOP = PADDING_LEFT << 1;
public static final int PADDING_RIGHT = PADDING_TOP << 1;
public static final int PADDING_BOTTOM = PADDING_RIGHT << 1;
public static final int MIN_WIDTH = PADDING_BOTTOM << 1;
public static final int MAX_WIDTH = MIN_WIDTH << 1;
public static final int MIN_HEIGHT = MAX_WIDTH << 1;
public static final int MAX_HEIGHT = MIN_HEIGHT << 1;
}
|
[
"[email protected]"
] | |
d8d3c3a28bdd9bed3e5f9ee0ef47021c37efbddc
|
2c539bbfef1d9cc431e0a1a9a1c3bb275e59ea37
|
/RCP/src/spell/widgets/SpellSearchView.java
|
8e0ce199d598014c740b8e387ff654c07dca0da0
|
[] |
no_license
|
Lasombras/SpellCardManager
|
4e3e89332551731f80478f16f6a38bf576af7c11
|
e3f319ec9499a1aae5fa35e81dd3fb47e2be8be8
|
refs/heads/master
| 2016-09-06T16:14:16.668507 | 2013-06-23T20:25:45 | 2013-06-23T20:25:45 | 10,369,905 | 4 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 10,556 |
java
|
package spell.widgets;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import spell.Activator;
import spell.databases.DatabaseManager;
import spell.databases.Session;
import spell.model.Source;
import spell.model.PlayerClass;
import spell.model.School;
import spell.model.Spell;
import spell.model.simple.CardModelLabelProvider;
import spell.model.simple.ISharedModelBoxIds;
import spell.model.simple.SharedSimpleModelBox;
import spell.model.simple.SimpleModelContentProvider;
import spell.model.simple.SpellModelBox;
import spell.search.criteria.SpellSearchCriteria;
import spell.services.ServiceFactory;
import spell.tools.LinkManager;
import spell.tools.LocaleManager;
public class SpellSearchView extends Composite {
private Composite resultComposite = null;
private Composite searchComposite = null;
private Table listResult = null;
private TableViewer listViewer = null;
private Spinner level;
private Text titleField;
private Text originalNameField;
private ImageCombo playerClass;
private ImageCombo school;
private ImageCombo sourceCombo;
private ImageCombo levelLabel;
private Button searchButton;
private PlayerClass[] playerClasses;
private School[] schools;
private Source[] sources;
public void setDefaultButton() {
if(searchButton != null)
this.getShell().setDefaultButton(searchButton);
}
public SpellSearchView(Composite parent, int style) {
super(parent, style);
GridLayout parentGridLayout = new GridLayout();
parentGridLayout.numColumns = 1;
parentGridLayout.marginWidth = parentGridLayout.marginHeight = 0;
GridData parentGridData = new GridData();
parentGridData.horizontalAlignment = GridData.FILL;
parentGridData.grabExcessHorizontalSpace = true;
parentGridData.grabExcessVerticalSpace = true;
parentGridData.verticalAlignment = GridData.FILL;
this.setLayout(parentGridLayout);
this.setLayoutData(parentGridData);
Session session = null;
try {
session = DatabaseManager.getInstance().openSession();
playerClasses = ServiceFactory.getPlayerClassService().getAll(session);
schools = ServiceFactory.getSchoolService().getAll(session);
sources = ServiceFactory.getSourceService().getAll(session);
session.close();
}
catch (Exception e) {e.printStackTrace();}
finally {if(session != null) session.close();}
GridData fieldGridData = new GridData();
fieldGridData.horizontalAlignment = GridData.FILL;
fieldGridData.grabExcessHorizontalSpace = true;
searchComposite = new Composite(this, SWT.NONE);
GridLayout glayout = new GridLayout();
glayout.marginWidth = glayout.marginHeight = 2;
glayout.numColumns = 2;
searchComposite.setLayout(glayout);
searchComposite.setLayoutData(fieldGridData);
Label label = new Label(searchComposite, SWT.NONE);
label.setText(LocaleManager.instance().getMessage("spell") + " : ");
titleField = new Text(searchComposite, SWT.BORDER);
titleField.setLayoutData(fieldGridData);
label = new Label(searchComposite, SWT.NONE);
label.setText(LocaleManager.instance().getMessage("originalName") + " : ");
originalNameField = new Text(searchComposite, SWT.BORDER);
originalNameField.setLayoutData(fieldGridData);
label = new Label(searchComposite, SWT.NONE);
label.setText(LocaleManager.instance().getMessage("sourceName") + " : ");
sourceCombo = new ImageCombo(searchComposite, SWT.BORDER);
sourceCombo.setEditable(false);
sourceCombo.setBackground(titleField.getBackground());
sourceCombo.add("", Activator.getImage(Activator.ICON_CROSS));
for(Source source : sources) {
sourceCombo.add(source.getTitle(), Activator.getImage(Activator.FOLDER_IMAGES + source.getImage()));
}
sourceCombo.setLayoutData(fieldGridData);
label = new Label(searchComposite, SWT.NONE);
label.setText(LocaleManager.instance().getMessage("school") + " : ");
school = new ImageCombo(searchComposite, SWT.BORDER);
school.setEditable(false);
school.setBackground(titleField.getBackground());
school.add("", Activator.getImage(Activator.ICON_CROSS));
for(School schoolItem : schools) {
school.add(schoolItem.getTitle(), Activator.getImage(Activator.FOLDER_IMAGES + schoolItem.getImage()));
}
school.setLayoutData(fieldGridData);
levelLabel = new ImageCombo(searchComposite, SWT.NONE);
levelLabel.setEditable(false);
levelLabel.setBackground(label.getBackground());
levelLabel.add(LocaleManager.instance().getMessage("level") + " >=", null);
levelLabel.add(LocaleManager.instance().getMessage("level") + " =", null);
levelLabel.add(LocaleManager.instance().getMessage("level") + " <=", null);
levelLabel.add(LocaleManager.instance().getMessage("level") + " <>", null);
levelLabel.select(0);
level = new Spinner(searchComposite, SWT.BORDER);
level.setMaximum(20);
level.setMinimum(0);
level.setPageIncrement(5);
level.setIncrement(1);
level.setSelection(0);
level.setLayoutData(fieldGridData);
label = new Label(searchComposite, SWT.NONE);
label.setText(LocaleManager.instance().getMessage("class") + " : ");
playerClass = new ImageCombo(searchComposite, SWT.BORDER);
playerClass.setEditable(false);
playerClass.setBackground(titleField.getBackground());
playerClass.add("", Activator.getImage(Activator.ICON_CROSS));
for(PlayerClass playerClassItem : playerClasses) {
playerClass.add(playerClassItem.getTitle(), Activator.getImage(Activator.FOLDER_IMAGES + playerClassItem.getImage()));
}
playerClass.setLayoutData(fieldGridData);
searchButton = new Button(searchComposite, SWT.PUSH);
searchButton.setText(LocaleManager.instance().getMessage("searchStart"));
searchButton.setImage(Activator.getImage(Activator.ICON_MAGNIFIER));
GridData buttonGridData = new GridData();
buttonGridData.horizontalAlignment = GridData.FILL;
buttonGridData.grabExcessHorizontalSpace = true;
buttonGridData.horizontalSpan = 2;
searchButton.setLayoutData(buttonGridData);
searchButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent arg0) {}
public void widgetSelected(SelectionEvent arg0) {
Session session = null;
try {
SpellSearchCriteria criteria = new SpellSearchCriteria();
criteria.setName(titleField.getText());
criteria.setOriginalName(originalNameField.getText());
criteria.setLevel(level.getSelection());
if(levelLabel.getSelectionIndex() == 0) criteria.setLevelSign(SpellSearchCriteria.GREATHER_THAN);
if(levelLabel.getSelectionIndex() == 1) criteria.setLevelSign(SpellSearchCriteria.EQUAL);
if(levelLabel.getSelectionIndex() == 2) criteria.setLevelSign(SpellSearchCriteria.LEATHER_THAN);
if(levelLabel.getSelectionIndex() == 3) criteria.setLevelSign(SpellSearchCriteria.NOT_EQUAL);
if(school.getSelectionIndex() <= 0)
criteria.setSchoolId(-1);
else
criteria.setSchoolId(schools[school.getSelectionIndex()-1].getId());
if(sourceCombo.getSelectionIndex() <= 0)
criteria.setSourceId(-1);
else
criteria.setSourceId(sources[sourceCombo.getSelectionIndex()-1].getId());
if(playerClass.getSelectionIndex() <= 0)
criteria.setPlayerClassId(-1);
else
criteria.setPlayerClassId(playerClasses[playerClass.getSelectionIndex()-1].getId());
session = DatabaseManager.getInstance().openSession();
listViewer.setInput(new SpellModelBox(ServiceFactory.getSpellService().search(session, criteria)));
session.close();
//setPartName(LocaleManager.instance().getMessage("search") + " (" + listViewer.getTable().getItemCount() + ")");
}
catch (Exception e1) {e1.printStackTrace();}
finally {if(session != null) session.close();}
}
});
resultComposite = new Composite(this, SWT.BORDER );
resultComposite.setLayoutData(parentGridData);
GridLayout gridLayout = new GridLayout();
gridLayout.horizontalSpacing = 0;
gridLayout.marginWidth = 0;
gridLayout.marginHeight = 0;
gridLayout.verticalSpacing = 0;
resultComposite.setLayout(gridLayout);
listResult = new Table(resultComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
listResult.setLayoutData(parentGridData);
listViewer = new TableViewer(listResult);
listViewer.setContentProvider(new SimpleModelContentProvider());
listViewer.setLabelProvider(new CardModelLabelProvider(false));
Transfer[] transferarray = new Transfer[]{TextTransfer.getInstance()};
listViewer.addDragSupport(DND.DROP_COPY, transferarray, new DragSourceListener() {
public void dragFinished(DragSourceEvent event) {}
public void dragSetData(DragSourceEvent event) {
IStructuredSelection selection = (IStructuredSelection) listViewer.getSelection();
Object[] itSel = selection.toArray();
String ids = "";
for(Object item : itSel) {
Spell spell = (Spell)item;
ids += Spell.class.getSimpleName() + "_" + spell.getId() +";";
}
event.data = ids;
}
public void dragStart(DragSourceEvent event) {
event.doit = ! listViewer.getSelection().isEmpty();
}
});
listViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
LinkManager.openSimpleModel(SharedSimpleModelBox.instance().get(ISharedModelBoxIds.BOX_SPELL).get(((Spell) selection.getFirstElement()).getId()));
}
});
//this.setPartName(LocaleManager.instance().getMessage("search") + " (" + listViewer.getTable().getItemCount() + ")");
}
}
|
[
"[email protected]"
] | |
49fae93799b75265a05309261c10f2af766d8215
|
908631ee138cda1e69934a8f03ac6a2d5514348b
|
/PopularMovies/app/src/main/java/com/example/android/popularmovies/Data/MovieContentProvider.java
|
d21871d0f7b576d4e26b0f24465f8469bc697964
|
[] |
no_license
|
veskol1/Popular-Movies-App
|
691f036ceb5d39b8e57a9c1d9c900e1ce017c46d
|
fa9727f4b3f869fbc12f1f2b555dfc39402cbe01
|
refs/heads/master
| 2023-06-24T16:39:57.837667 | 2023-06-19T19:19:42 | 2023-06-19T19:19:42 | 131,072,755 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,728 |
java
|
package com.example.android.popularmovies.Data;
import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.support.annotation.NonNull;
import static com.example.android.popularmovies.Data.MovieContract.MovieEntry.TABLE_NAME;
public class MovieContentProvider extends ContentProvider {
private MovieDbHelper mMovieDbHelper;
@Override
public boolean onCreate() {
Context context = getContext();
mMovieDbHelper = new MovieDbHelper(context);
return true;
}
@Override
public Uri insert(@NonNull Uri uri, ContentValues values) {
final SQLiteDatabase db = mMovieDbHelper.getWritableDatabase();
Uri returnUri; // URI to be returned
long id = db.insert(TABLE_NAME, null, values);
if ( id > 0 )
returnUri = ContentUris.withAppendedId(MovieContract.MovieEntry.CONTENT_URI, id);
else
throw new android.database.SQLException("Failed to insert row into " + uri);
getContext().getContentResolver().notifyChange(uri, null);
return returnUri;
}
@Override
public Cursor query(@NonNull Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) {
final SQLiteDatabase db = mMovieDbHelper.getReadableDatabase();
Cursor retCursor;
retCursor = db.query(TABLE_NAME,
projection,
selection,
selectionArgs,
null,
null,
sortOrder);
retCursor.setNotificationUri(getContext().getContentResolver(), uri);
return retCursor;
}
@Override
public int delete(@NonNull Uri uri, String selection, String[] selectionArgs) {
throw new UnsupportedOperationException("Not yet implemented");
}
@Override
public int update(@NonNull Uri uri, ContentValues values, String selection,
String[] selectionArgs) {
final SQLiteDatabase db = mMovieDbHelper.getWritableDatabase();
int id=0;
id= db.update(TABLE_NAME,values,selection,null);
getContext().getContentResolver().notifyChange(uri, null);
return id;
}
@Override
public String getType(@NonNull Uri uri) {
throw new UnsupportedOperationException("Not yet implemented");
}
}
|
[
"[email protected]"
] | |
3693e2e678afc0933867f27175e3efa659638276
|
fd3b0d1acb7f36fca4a58b4274e8f25440c7bb10
|
/Day1/WhileTest3.java
|
3b12b5a6319c6cd0fd7a2a0d9a6b8e6afe21d740
|
[] |
no_license
|
open1127/JavaPrograming
|
10eb17b0093c7c177c9e3b67603cabeccff18779
|
385ca567cadafac08ec73f2d0763579dcf6677fe
|
refs/heads/main
| 2023-06-22T03:28:17.556740 | 2021-07-14T01:02:16 | 2021-07-14T01:02:16 | 384,922,663 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 186 |
java
|
class WhileTest3
{
public static void main(String[] args)
{
int i= 4, cnt=0;
while(i<=100)
{
cnt=cnt+1;
System.out.println(i+" "+cnt+" ");
i= i+4;
}
}
}
|
[
"[email protected]"
] | |
724b8350dbec09453dc686f0e56de950d4fe692e
|
a178751f97c4498ac1ff18105fe37177af224e70
|
/src/main/java/com/asqint/webLib/controller/AddController.java
|
c7e3f76e81e33a7892eec08287be6238aaf7e2b8
|
[] |
no_license
|
raman-pyzhyu/webLib
|
1fed950e35ef82469c48d09e65e2a7c2d66f5268
|
f6fb6c8d043cbd6fa367ba655fb889b7d2eb66d6
|
refs/heads/master
| 2023-03-23T08:06:34.668930 | 2021-03-16T15:29:06 | 2021-03-16T15:29:06 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,892 |
java
|
package com.asqint.webLib.controller;
import com.asqint.webLib.domain.Book;
import com.asqint.webLib.repos.BookRepo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.UUID;
@Controller
public class AddController {
@Value("${upload.path}")
private String uploadPath;
private final BookRepo bookRepo;
public AddController(BookRepo bookRepo) {
this.bookRepo = bookRepo;
}
@GetMapping("/addBook")
public String main(Map<String, Object> model){
return "addBook";
}
@PostMapping("/addBook")
public String addBook(
@RequestParam String name,
@RequestParam Integer year,
@RequestParam String isbn,
@RequestParam String genre,
@RequestParam String author,
@RequestParam String description,
@RequestParam("file") MultipartFile file,
Map<String, Object> model
) throws IOException {
Book book = new Book(name,year, isbn, genre, author, description);
if(file!=null){
File uploadDir = new File(uploadPath);
if(!uploadDir.exists()){
uploadDir.mkdir();
}
String uuidFilename = UUID.randomUUID().toString();
String resultFilename = uuidFilename + "." + file.getOriginalFilename();
file.transferTo(new File(uploadPath+"/"+resultFilename));
book.setFilename(resultFilename);
}
bookRepo.save(book);
return "addBook";
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.