blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6a5ddfd3d78c1613dd55ee022ed4d4ca0edd7cf1 | 1f963af51acdae11068eaeec98264a472aa9ad4b | /src/main/java/alexanderc/es/plugin/kas/Response/ErrorResponse.java | 549d3c9f288feef81dc3a310faaa9765dac2b0cc | [] | no_license | AlexanderC/elasticsearch-key-aware-search | 50bc94ffe57ea61803f95a47d8bef3bd6dd64667 | 88dfb04b07f8f3b28da010836c6b80dd8d33ec24 | refs/heads/master | 2021-01-01T18:02:07.973719 | 2015-04-06T12:15:40 | 2015-04-06T12:15:40 | 25,857,399 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,230 | java | package alexanderc.es.plugin.kas.Response;
import org.elasticsearch.common.text.StringAndBytesText;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.rest.*;
/**
* Created by AlexanderC on 10/28/14.
*/
public class ErrorResponse extends BaseResponse {
public ErrorResponse(final String message, RestStatus status) {
StringBuilder sb = new StringBuilder();
String codePrefix = "2";
if (500 <= status.getStatus() && status.getStatus() <= 599) {
codePrefix = "3";
} else if (400 <= status.getStatus() && status.getStatus() <= 499) {
codePrefix = "4";
}
sb.append("{");
sb.append("\"error\":true,");
sb.append("\"message\":\"%1\",".replace("%1", message.replace("\"", "\\\"").replace("\n", "\\n")));
sb.append("\"code\":").append(codePrefix).append(status.getStatus());
sb.append("}");
StringAndBytesText responseObject = new StringAndBytesText(sb.toString());
this.setBytes(responseObject.bytes());
this.setStatus(status);
}
public static ErrorResponse fromThrowable(Throwable throwable, Boolean debug) {
StringBuilder error = new StringBuilder();
if(debug) {
error.append(throwable.toString());
error.append('\n');
for (StackTraceElement traceElement : throwable.getStackTrace()) {
error.append('\n');
error.append("[");
error.append(traceElement.getFileName());
error.append(":");
error.append(traceElement.getLineNumber());
error.append("] ");
error.append(traceElement.getClassName());
error.append(".");
error.append(traceElement.getMethodName());
error.append("()");
}
} else {
error.append(throwable.getMessage());
}
RestStatus restStatus = RestStatus.INTERNAL_SERVER_ERROR;
if(throwable instanceof ElasticsearchException) {
restStatus = ((ElasticsearchException) throwable).status();
}
return new ErrorResponse(error.toString(), restStatus);
}
}
| [
"alexander.moldova@gmail.com"
] | alexander.moldova@gmail.com |
6f973fc612d3c0ac9a05ea0fa8dd7838a944affb | d206ef7f2d6682525a07edb41c9d53aaa06be3bd | /src/application/Adoption.java | b38c0d206ce8e9e675031d295d690b889e87655c | [] | no_license | PeterBurton/Animal-Shelter-JavaFX | 489161724bc38b15aaf9b8c119bbe5d0d38a3c00 | 50575557c270b28a3b68c6a8dc17a2581f3326b7 | refs/heads/master | 2020-12-14T07:28:46.654171 | 2017-06-15T20:58:22 | 2017-06-15T20:58:22 | 68,367,763 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,532 | java | package application;
import java.time.LocalDate;
public class Adoption extends Category implements java.io.Serializable{
private static final long serialVersionUID = 8762978795694638193L;
private boolean neutered;
private boolean chipped;
private boolean vaccinated;
private String status;
private boolean reserved;
public Adoption(LocalDate date, boolean neutered, boolean chipped, boolean vaccinated, String status, boolean reserved)
{
super(date);
this.neutered=neutered;
this.chipped=chipped;
this.vaccinated=vaccinated;
this.status=status;
this.reserved=reserved;
}
public Adoption(){}
public LocalDate getDate()
{
return super.getDate();
}
public void setDate(LocalDate date)
{
super.setDate(date);
}
public Person getContact()
{
return super.getContact();
}
public void setContact(Person contact)
{
super.setContact(contact);
}
public boolean getReserved() {
return reserved;
}
public void setReserved(boolean reserved) {
this.reserved = reserved;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public boolean getVaccinated() {
return vaccinated;
}
public void setVaccinated(boolean vaccinated) {
this.vaccinated = vaccinated;
}
public boolean getChipped() {
return chipped;
}
public void setChipped(boolean chipped) {
this.chipped = chipped;
}
public boolean getNeutered() {
return neutered;
}
public void setNeutered(boolean neutered) {
this.neutered = neutered;
}
}
| [
"peterburton943@hotmail.com"
] | peterburton943@hotmail.com |
654340ee5c2caeb4cf98defefe72ae2b1788e169 | 1ee296f2911be31165c76de2a32429ada9049ba5 | /src/main/java/test/poc/demostore/management/CheckoutManagement.java | 17eba6c8a669c19c667c99139d7d66d90de0d073 | [] | no_license | Maxcp/demo-store | 7bf61fd3839ebec690d7efab4dc992ce92fb8654 | 1e7859d5d9f04d500e41de7715ef27f64dbbcc6b | refs/heads/master | 2020-07-09T01:35:53.533021 | 2019-08-23T15:49:19 | 2019-08-23T15:49:19 | 203,837,841 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,850 | java | package test.poc.demostore.management;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import test.poc.demostore.exception.DemoStoreException;
import test.poc.demostore.model.Checkout;
import test.poc.demostore.model.Discount;
import test.poc.demostore.model.ProductItem;
import test.poc.demostore.model.request.CheckoutRequest;
import test.poc.demostore.model.request.Item;
import test.poc.demostore.service.DiscountService;
import test.poc.demostore.service.ProductService;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
@Component
public class CheckoutManagement {
private Logger logger = LoggerFactory.getLogger(CheckoutManagement.class);
@Autowired
DiscountService discountService;
@Autowired
ProductService productService;
public Checkout doCheckout(CheckoutRequest checkoutRequest) throws DemoStoreException {
logger.info("Initializing checkout");
checkoutRequest.setItems(aggregateItemsByProductId(checkoutRequest.getItems()));
Checkout checkout = new Checkout();
checkout.setProductItems(setProductItems(checkoutRequest));
checkout.setDiscount(applyDiscounts(checkoutRequest));
logger.info("Checkout finished");
return checkout;
}
private BigDecimal applyDiscounts(CheckoutRequest checkoutRequest) {
logger.info("Applying discounts");
List<Discount> discounts = discountService.getDiscounts();
AtomicReference<BigDecimal> discountPool = new AtomicReference<>(new BigDecimal(0L));
discounts.forEach( d ->
discountPool.updateAndGet(v -> v.add (Objects.requireNonNull(applyDiscounts(d , checkoutRequest.getItems()))))
);
discountPool.get();
logger.info("Discounts applied");
return discountPool.get();
}
private BigDecimal applyDiscounts(Discount discount, List<Item> items) {
AtomicReference<BigDecimal> totalDiscount = new AtomicReference<>(new BigDecimal(0L));
items.forEach( item -> {
if(item.getProductId().equals(discount.getProduct().getId())) {
totalDiscount.updateAndGet(v -> v.add(discount.apply(item.getQuantity())));
}
});
return totalDiscount.get();
}
/**
* Fetch the productItem while validating if it exists
*
* @param checkoutRequest
* @return List of ProductItem
* @throws DemoStoreException
*/
private List<ProductItem> setProductItems(CheckoutRequest checkoutRequest) throws DemoStoreException {
List<ProductItem> productItems = new ArrayList<>();
for (Item item : checkoutRequest.getItems()) {
ProductItem productItem = new ProductItem();
productItem.setProduct(productService.getProductById(item.getProductId()));
productItem.setQuantity(item.getQuantity());
productItems.add(productItem);
}
return productItems;
}
/**
*
* If there are duplicated products in the list it will merge.
* This method must be called before apply the discount.
*
* @param items
* @return List of Item
*/
List<Item> aggregateItemsByProductId(List<Item> items) {
Map<Long,Item> productList = new HashMap<>();
for (Item item : items ){
if (!productList.containsKey(item.getProductId())){
productList.put(item.getProductId(),item);
} else {
productList.get(item.getProductId()).setQuantity( productList.get(item.getProductId()).getQuantity() + item.getQuantity() );
}
}
return new ArrayList<>(productList.values());
}
}
| [
"maximiano.pereira.ext@spms.min-saude.pt"
] | maximiano.pereira.ext@spms.min-saude.pt |
85d4ead46e138686f129ded4a2f8e103788f1698 | 1b15fe5acedc014df2e0ae108a4c929dccf0911d | /src/main/java/com/turk/clusters/slave/SlaveActive.java | cd69bc3b24a30ff1dcf885c9a52cd62f8082b2a0 | [] | no_license | feinzaghi/Capricorn | 9fb9593828e4447a9735079bad6b440014f322b3 | e1fca2926b1842577941b070a826a2448739a2e8 | refs/heads/master | 2020-06-14T11:43:29.627233 | 2017-01-24T03:19:28 | 2017-01-24T03:19:28 | 75,029,435 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,333 | java | package com.turk.clusters.slave;
import net.sf.json.JSONObject;
import org.apache.log4j.Logger;
import com.turk.clusters.model.Register;
import com.turk.config.SystemConfig;
import com.turk.socket.Client;
import com.turk.util.LogMgr;
import com.turk.util.ThreadPool;
/**
* 节点报活
* 1分钟报告一次
* @author Administrator
*
*/
public class SlaveActive implements Runnable{
private static SlaveActive instance;
private boolean stopFlag = false;
private Logger logger = LogMgr.getInstance().getAppLogger("slave");
private Thread thread = new Thread(this, toString());
public static synchronized SlaveActive getInstance()
{
if (instance == null)
{
instance = new SlaveActive();
}
return instance;
}
public void start()
{
this.thread.start();
}
@Override
public void run() {
// TODO Auto-generated method stub
while (!isStop())
{
try
{
Register reg = new Register();
reg.setMsgID(1002); //报活同步消息
reg.setServer(SlaveConfig.getInstance().getSlaveServer());
reg.setPort(SlaveConfig.getInstance().getSlavePort());
reg.setCurrentCltCount(ThreadPool.getInstance().ActiveTaskCount());
reg.setMaxActiveTask(SystemConfig.getInstance().getMaxCltCount());
reg.setMaxCltCount(SystemConfig.getInstance().getMaxThread());
reg.setFlag(SlaveConfig.getInstance().getSlaveFlag());
JSONObject jsonObject = JSONObject.fromObject(reg);
//System.out.println(jsonObject);
logger.debug("1002-MSG:" + jsonObject.toString());
Client clt = new Client(SlaveConfig.getInstance().getMasterServer(),
SlaveConfig.getInstance().getMasterPort());
String Result = clt.SendMsgNetty(jsonObject.toString());
if(Result.equals("Done"))
{
logger.debug("1002-MSG-["+reg.getServer()+"] send success!");
}
Thread.sleep(5*1000L); //5s报告一次
}
catch (InterruptedException ie)
{
this.logger.warn("外界强行中断.");
this.stopFlag = true;
break;
}
catch (Exception e)
{
this.logger.error(this + ": 异常.原因:", e);
break;
}
}
this.logger.debug("节点自动报活扫描线束");
}
public synchronized boolean isStop()
{
return this.stopFlag;
}
public synchronized boolean Stop()
{
this.stopFlag = true;
Register reg = new Register();
reg.setMsgID(1003); //报活同步消息
reg.setServer(SlaveConfig.getInstance().getSlaveServer());
reg.setPort(SlaveConfig.getInstance().getSlavePort());
reg.setCurrentCltCount(ThreadPool.getInstance().ActiveTaskCount());
reg.setMaxActiveTask(SystemConfig.getInstance().getMaxCltCount());
reg.setMaxCltCount(SystemConfig.getInstance().getMaxThread());
reg.setFlag(3);
JSONObject jsonObject = JSONObject.fromObject(reg);
//System.out.println(jsonObject);
logger.debug("1003-MSG:" + jsonObject.toString());
Client clt = new Client(SlaveConfig.getInstance().getMasterServer(),
SlaveConfig.getInstance().getMasterPort());
String Result = clt.SendMsg(jsonObject.toString());
if(Result.equals("Done"))
{
logger.debug("1003-MSG-["+reg.getServer()+"] send success!");
return true;
}
return false;
}
}
| [
"huangxiao227@gmail.com"
] | huangxiao227@gmail.com |
64d6b0c93a33dac273c9cbd06cf54f05bf87500e | f822300fb4f55d00d3fd34298b9d4c324b19705a | /src/main/java/cn/hinson/controller/SysUserController.java | 87a8eec170a7e6e8392f836cd21876622a327a45 | [] | no_license | jenkincstang/springboot_security5_oauth2.0 | e9eff1b0b45e519401c1c832f3c56d0f1799e2d8 | 844240cbb2f237d2277cb871a5ebd0c1734aceb6 | refs/heads/master | 2022-12-08T12:50:32.136443 | 2020-08-30T17:24:39 | 2020-08-30T17:24:39 | 289,246,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,821 | java | package cn.hinson.controller;
import cn.hinson.domain.SysRole;
import cn.hinson.domain.SysUser;
import cn.hinson.dto.UserDto;
import cn.hinson.service.SysRoleService;
import cn.hinson.service.SysUserService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.*;
import java.security.Principal;
import java.util.ArrayList;
import java.util.List;
@RestController
public class SysUserController {
protected final Log logger = LogFactory.getLog(this.getClass());
@Autowired
private final SysUserService sysUserService;
@Autowired
private final SysRoleService sysRoleService;
public SysUserController(SysUserService sysUserService, SysRoleService sysRoleService) {
this.sysUserService = sysUserService;
this.sysRoleService = sysRoleService;
}
@GetMapping("/test")
public String test() {
//访问这个url注册一个username:hinson1 password:password的用户
SysUser sysUser = sysUserService.getUserByName("admin");
if (sysUser == null) {
sysUser = new SysUser();
sysUser.setUsername("admin");
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
String tmp = passwordEncoder.encode("password");
sysUser.setPassword(tmp);
SysRole adminRole = sysRoleService.getSysRoleByName("ROLE_ADMIN");
SysRole userRole = sysRoleService.getSysRoleByName("ROLE_USER");
List<SysRole> roles = new ArrayList<>();
roles.add(adminRole);
roles.add(userRole);
sysUser.setSysRoles(roles);
sysUserService.saveSysUser(sysUser);
}
return "success";
}
// @GetMapping("/login")
// public String login(){
// return ": login";
// }
@GetMapping("/user")
public Principal getUsers(@AuthenticationPrincipal Principal principal) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
System.out.println("AuthenticationPrincipal Name:>>" + authentication.getName());
return principal;
}
@GetMapping("/userManager")
public String getUserManagerInfo() {
return "User Manager Page";
}
@GetMapping("/sysManager")
public String getSystemManagerInfo() {
return "System Manager Page";
}
@GetMapping("/userInfo")
public String getUserInfo() {
return "User Information Page";
}
@PostMapping("/register")
public String register(@RequestBody UserDto userDto) {
System.out.println("Register User");
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
//访问这个url注册一个用户
SysUser existUser = sysUserService.getUserByName(userDto.getUsername());
if (existUser == null) {
SysUser sysUser = new SysUser();
sysUser.setUsername(userDto.getUsername());
sysUser.setPassword(passwordEncoder.encode(userDto.getPassword()));
sysUserService.saveSysUser(sysUser);
} else {
if (existUser.getPassword() == null) {
existUser.setPassword(passwordEncoder.encode(userDto.getPassword()));
sysUserService.saveSysUser(existUser);
} else {
return "User already Exists!";
}
}
return "Register User Success!";
}
}
| [
"jenkincs@163.com"
] | jenkincs@163.com |
2467edc25a32f7bdf14f448553f86080eaad7105 | 0ccf5aede655fa10099118f9494d7492e715b1d6 | /qyt_om/src/main/java/com/qyt/om/adapter/DeviceStateAdapter.java | 30b77b148cbb7eb0c2544f7cea9aaf28b5ad04bb | [] | no_license | wuxiflowing/operationmanager_android | 4a1560217eb0096f3b0712fbd3c5ca941154acf6 | ca488085ac83a65b181646162dec8793f3abf3fd | refs/heads/master | 2020-06-19T01:41:22.700198 | 2020-04-22T14:26:30 | 2020-04-22T14:26:30 | 196,521,472 | 0 | 0 | null | 2020-04-22T14:26:31 | 2019-07-12T06:26:32 | Java | UTF-8 | Java | false | false | 1,428 | java | package com.qyt.om.adapter;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.bangqu.lib.base.BaseSimpleAdapter;
import com.qyt.om.R;
import com.qyt.om.model.InfoMap;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by 15052286501 on 2017/8/29.
*/
public class DeviceStateAdapter extends BaseSimpleAdapter<InfoMap> {
public DeviceStateAdapter(Context mContext, List<InfoMap> mData) {
super(mContext, mData);
}
@Override
protected View getViewAtPosition(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.item_devicestate, null);
viewHolder = new ViewHolder(convertView);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
InfoMap model = mData.get(position);
viewHolder.stateLabel.setText(model.label);
viewHolder.stateValue.setText(model.value);
return convertView;
}
class ViewHolder {
@BindView(R.id.state_value)
TextView stateValue;
@BindView(R.id.state_label)
TextView stateLabel;
ViewHolder(View view) {
ButterKnife.bind(this, view);
}
}
}
| [
"xiaodong.pan@flowring.com"
] | xiaodong.pan@flowring.com |
9d81490d1b5853d4f691d451c4e761eed38ab432 | b62265852762c638febca899d63f38853a2ea677 | /src/main/java/com/example/fingerprint/fragment/FingerprintSetFragment.java | e1dc43cb1c93c6323d04b06adabe53e210709c4e | [] | no_license | 45088648/demo-module | 6e221cef467b8d19f13b523bd3c14bc46991d0dc | 95b085d5bac60e99dfa3f964b8df5f4a25756cd8 | refs/heads/master | 2020-04-11T01:26:39.297029 | 2018-12-12T01:28:18 | 2018-12-12T01:28:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,592 | java | package com.example.fingerprint.fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import com.example.fingerprint.MainActivity;
import com.example.fingerprint.R;
import com.example.fingerprint.tools.StringUtils;
import com.example.fingerprint.tools.UIHelper;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
/**
* A simple {@link Fragment} subclass.
*/
public class FingerprintSetFragment extends Fragment {
private static final String TAG = "FingerprintSetFragment";
private MainActivity mContext;
@ViewInject(R.id.btnSetThreshold)
Button btnSetThreshold;
@ViewInject(R.id.btnGetThreshold)
Button btnGetThreshold;
@ViewInject(R.id.btnSetPacketSize)
Button btnSetPacketSize;
@ViewInject(R.id.btnGetPacketSize)
Button btnGetPacketSize;
@ViewInject(R.id.btnGetBaud)
Button btnGetBaud;
@ViewInject(R.id.btnSetBaud)
Button btnSetBaud;
@ViewInject(R.id.btnReInit)
Button btnReInit;
@ViewInject(R.id.spThreshold)
Spinner spThreshold;
@ViewInject(R.id.spPacketSize)
Spinner spPacketSize;
@ViewInject(R.id.spBaud)
Spinner spBaud;
@ViewInject(R.id.etPSW)
EditText etPSW;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_fingerprint_set,
container, false);
ViewUtils.inject(this, v);
return v;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mContext = (MainActivity) getActivity();
}
@OnClick(R.id.btnSetThreshold)
public void btnSetThreshold_onClick(View v) {
if (mContext.mFingerprint.setReg(5, spThreshold.getSelectedItemPosition() + 1)) {
UIHelper.ToastMessage(mContext,
R.string.fingerprint_msg_set_threshold_succ);
} else {
UIHelper.ToastMessage(mContext,
R.string.fingerprint_msg_set_threshold_fail);
}
}
@OnClick(R.id.btnSetPacketSize)
public void btnSetPacketSize_onClick(View v) {
if (mContext.mFingerprint.setReg(6, spPacketSize.getSelectedItemPosition())) {
UIHelper.ToastMessage(mContext,
R.string.fingerprint_msg_set_PacketSize_succ);
} else {
UIHelper.ToastMessage(mContext,
R.string.fingerprint_msg_set_PacketSize_fail);
}
}
@OnClick(R.id.btnSetBaud)
public void btnSetBaud_onClick(View v) {
int baudrate = StringUtils.toInt(spBaud.getSelectedItem().toString(), -1);
if (mContext.mFingerprint.setReg(4, baudrate / 9600)) {
UIHelper.ToastMessage(mContext,
R.string.fingerprint_msg_set_Baudrate_succ);
mContext.freeFingerprint();
mContext.initFingerprint(baudrate);
} else {
UIHelper.ToastMessage(mContext,
R.string.fingerprint_msg_set_Baudrate_fail);
}
}
@OnClick(R.id.btnReInit)
public void btnReInit_onClick(View v) {
int baudrate = StringUtils.toInt(spBaud.getSelectedItem().toString(), -1);
mContext.freeFingerprint();
mContext.initFingerprint(baudrate);
}
@OnClick(R.id.btnGetThreshold)
public void btnGetThreshold_onClick(View v) {
}
@OnClick(R.id.btnGetPacketSize)
public void btnGetPacketSize_onClick(View v) {
}
@OnClick(R.id.btnSetPSW)
public void btnSetPSW_onClick(View v) {
String strPWD = etPSW.getText().toString().trim();
if (!StringUtils.isNotEmpty(strPWD)) {
UIHelper.ToastMessage(mContext, R.string.rfid_mgs_error_nopwd);
return;
}
if (!mContext.vailHexInput(strPWD)) {
UIHelper.ToastMessage(mContext,
R.string.rfid_mgs_error_nohex);
return;
}
// if (mContext.mFingerprint.setPSW(strPWD)) {
//
// UIHelper.ToastMessage(mContext,
// R.string.fingerprint_msg_set_PSW_succ);
// } else {
// UIHelper.ToastMessage(mContext,
// R.string.fingerprint_msg_set_PSW_fail);
// }
}
@OnClick(R.id.btnVfyPSW)
public void btnVfyPSW_onClick(View v) {
String strPWD = etPSW.getText().toString().trim();
if (!StringUtils.isNotEmpty(strPWD)) {
UIHelper.ToastMessage(mContext, R.string.rfid_mgs_error_nopwd);
return;
}
if (strPWD.length() != 8) {
UIHelper.ToastMessage(mContext,
R.string.uhf_msg_addr_must_len8);
return;
}
if (!mContext.vailHexInput(strPWD)) {
UIHelper.ToastMessage(mContext,
R.string.rfid_mgs_error_nohex);
return;
}
// if (mContext.mFingerprint.vfyPSW(strPWD)) {
//
// UIHelper.ToastMessage(mContext,
// R.string.fingerprint_msg_verify_PSW_succ);
// } else {
// UIHelper.ToastMessage(mContext,
// R.string.fingerprint_msg_verify_PSW_fail);
// }
}
}
| [
"zcs640410"
] | zcs640410 |
00ac6fef60ae1a980fc857263dbfc15ebb190137 | 1d5bf8e505c30bbbe4ab09facc511cba2edf20f0 | /src/it/java2wsdl/src/main/java/org/codehaus/mojo/axistools/test/java2wsdl/Request.java | a9425ba9edb9259f596142b634de1c2594045cfc | [] | no_license | mojohaus/axistools-maven-plugin | 077e1b360e3338fe933726442485d41e3af5237f | 86d48377dd3c4e886a8d600f4e9c6d78d26a1c5c | refs/heads/master | 2023-09-04T06:44:25.016236 | 2022-07-01T22:17:31 | 2023-01-17T23:28:58 | 39,062,787 | 5 | 2 | null | 2023-01-17T23:29:00 | 2015-07-14T08:18:08 | Java | UTF-8 | Java | false | false | 79 | java | package org.codehaus.mojo.axistools.test.java2wsdl;
public class Request
{
}
| [
"benjamin.bentmann@udo.edu"
] | benjamin.bentmann@udo.edu |
cf76f45e098f19d86f9beb677e1e0c7fe3eccaea | 6cd99145a125ef9de59cfe1a09891210d50839d5 | /Project/src/codigo/Hilo.java | d1d65b0a8b382c155a9170e846aeb263cb7d0d99 | [] | no_license | pdegioanni/tpFinalProgConcurrente | db29b2d922c4755b49dc4f52c13d46ef64d3737d | 717b3c3f6aef46b198f510f867f685ed0620d527 | refs/heads/main | 2023-06-16T20:02:39.874548 | 2021-06-11T18:34:23 | 2021-06-11T18:34:23 | 374,467,532 | 0 | 0 | null | 2021-06-11T16:43:17 | 2021-06-06T21:29:39 | HTML | UTF-8 | Java | false | false | 551 | java | package codigo;
public class Hilo implements Runnable {
private String nombre;
private Monitor monitor;
private int secuencia[];
private boolean continuar = true;
public Hilo(String nombre,Monitor monitor,int secuencia[]) {
this.nombre = nombre;
this.monitor = monitor;
this.secuencia = secuencia;
}
public void run() {
while(continuar) {
for(int i=0;i<secuencia.length;i++) {
//System.out.println("Hilo :"+nombre);
monitor.dispararTransicion(secuencia[i]);
}
}
}
public void set_Fin()
{
continuar = false;
}
}
| [
"jonathan.lafalda@gmail.com"
] | jonathan.lafalda@gmail.com |
442693a615522d2442ccec3105101ef7ec6c24dd | 7a2f7a99b05d37c21e5b50954a793886aefba3fd | /src/main/java/com/his/server/GetOutpMrDiagDescResponse.java | 3e651211730b25d3a0098ccdfc767f6de8076ca9 | [] | no_license | 2430546168/HisCloud | 9b2bf6bbb4294f6ca6150bac9834f9d13a42c4a1 | 20ada9b607e37f5fdcdbdae654fc0137d8d2658d | refs/heads/master | 2022-12-22T15:13:27.512402 | 2020-03-30T13:48:38 | 2020-03-30T13:48:38 | 226,229,622 | 1 | 1 | null | 2022-12-16T07:47:10 | 2019-12-06T02:28:57 | Java | GB18030 | Java | false | false | 1,408 | java |
package com.his.server;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>getOutpMrDiagDescResponse complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType name="getOutpMrDiagDescResponse">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getOutpMrDiagDescResponse", propOrder = {
"_return"
})
public class GetOutpMrDiagDescResponse {
@XmlElement(name = "return")
protected String _return;
/**
* 获取return属性的值。
*
* @return
* possible object is
* {@link String }
*
*/
public String getReturn() {
return _return;
}
/**
* 设置return属性的值。
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setReturn(String value) {
this._return = value;
}
}
| [
"myceses@163.cm"
] | myceses@163.cm |
97900996e515a009869ec4c9f7f1781a61f8118e | 6f23e681f48434b3c8dd596fc0cc9a4134056ecb | /isportal/src/com/hansol/isportal/dbservice/dao/DbSvcDAO.java | 4d5764c4b59fb0eb55d788da24481783621f68ea | [] | no_license | frjufvjn/isportal | db082501078b25a188396a3e3f868a9efeee367a | 2aaa23a3228fd877a7803824bddacce04b5ff120 | refs/heads/master | 2023-03-13T23:57:54.999747 | 2022-12-30T22:35:16 | 2022-12-30T22:35:16 | 52,587,844 | 1 | 0 | null | 2023-02-22T08:07:19 | 2016-02-26T07:49:00 | JavaScript | UTF-8 | Java | false | false | 1,554 | java | package com.hansol.isportal.dbservice.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import com.hansol.isportal.dbservice.sqlprovider.DbSvcGetSQL;
public abstract interface DbSvcDAO {
String SQL_GET_SQL = "select sql_desc from tp_db_svc_memory where db_svc_no = #{db_svc_no}";
/*
* 1. Annotation을 활용한 방법
String SQL_SELECT_TEST = "select * from tp_cm_service";
@Select(SQL_SELECT_TEST)
public abstract List<Map<String,Object>> getListTest() throws Exception;*/
/**
* 2. SQL을 가져와서 활용하는 방법
* @return
* @throws Exception
*/
@Select(SQL_GET_SQL)
public abstract String getSqlBySvcNo(Map paramMap) throws Exception;
@SelectProvider(type = DbSvcGetSQL.class, method="getSql")
public abstract List<Map<String,Object>> getListParam(Map paramMap) throws Exception;
@UpdateProvider(type = DbSvcGetSQL.class, method="getSql")
public abstract void doUpdateList(Map paramMap) throws Exception;
@InsertProvider(type = DbSvcGetSQL.class, method="getSql")
public abstract void doInsertList(Map<String,Object> paramMap) throws Exception;
@SelectProvider(type = DbSvcGetSQL.class, method="getSql")
public abstract Map<String,Object> doProcedure(Map<String,Object> paramMap) throws Exception;
}
| [
"PJW@PJW-PC"
] | PJW@PJW-PC |
21ccb94feebc1a9aaa8b1a285e6a11b7a8f91d2e | 425d3e258c60f222d944c3096002b5e08d21252b | /4_Cinema-JSP/Polytech-Cinema-Web/src/main/java/fr/polytech/cinema/forms/CharacterForm.java | 453d7a2e3d4cfe549b9ff447a6ed1677fc843223 | [
"Apache-2.0"
] | permissive | LoicDelorme/Polytech-Cinema | ec6e9483359accaf3ae07979d06262a9d990e2d6 | 2ae3cc0346cae9e9f08e036725a797450c7ba124 | refs/heads/master | 2021-07-23T19:48:55.445601 | 2017-11-03T18:41:36 | 2017-11-03T18:41:36 | 106,658,364 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 558 | java | package fr.polytech.cinema.forms;
public class CharacterForm {
private Integer movieId;
private Integer actorId;
private String name;
public Integer getMovieId() {
return movieId;
}
public void setMovieId(final Integer movieId) {
this.movieId = movieId;
}
public Integer getActorId() {
return actorId;
}
public void setActorId(final Integer actorId) {
this.actorId = actorId;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name == null || name.isEmpty() ? null : name;
}
} | [
"loic.delorme.pro@gmail.com"
] | loic.delorme.pro@gmail.com |
451281b20f4715accca46ac940ad4c17e27e9163 | 70daf318d027f371ada3abeaaa31dd47651640d7 | /src/action/ind/INDStockBatchAction.java | 14cdc366856f4750daf83b84450fc2a79fad8bdf | [] | no_license | wangqing123654/web | 00613f6db653562e2e8edc14327649dc18b2aae6 | bd447877400291d3f35715ca9c7c7b1e79653531 | refs/heads/master | 2023-04-07T15:23:34.705954 | 2020-11-02T10:10:57 | 2020-11-02T10:10:57 | 309,329,277 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,094 | java | package action.ind;
import com.dongyang.action.TAction;
import com.dongyang.data.TParm;
import com.dongyang.db.TConnection;
import jdo.ind.INDTool;
/**
* <p>
* Title: 日结过帐管理
* </p>
*
* <p>
* Description: 日结过帐管理
* </p>
*
* <p>
* Copyright: Copyright (c) 2009
* </p>
*
* <p>
* Company: JavaHis
* </p>
*
* @author zhangy 2009.09.02
* @version 1.0
*/
public class INDStockBatchAction extends TAction {
public INDStockBatchAction() {
}
/**
* 指定部门药品库存手动日结批次作业
* @param parm TParm
* @return TParm
*/
public TParm onIndStockBatch(TParm parm) {
TConnection conn = getConnection();
TParm result = new TParm();
result = INDTool.getInstance().onIndStockBatchByOrgCode(parm, conn);
if (result.getErrCode() < 0) {
err("ERR:" + result.getErrCode() + result.getErrText()
+ result.getErrName());
conn.close();
return result;
}
conn.commit();
conn.close();
return result;
}
}
| [
"1638364772@qq.com"
] | 1638364772@qq.com |
dfd4785d6a3ae1fd900513b768005043a0bef8ed | 14cb2ff4a8126363cfea38b833f2ddeb97ec2656 | /app/src/main/java/com/nbs/app/latihan_sql_lite/BuatBiodata.java | 2b4855951d5943c13ecff3b053f7170a3f1bc110 | [] | no_license | mohamaddenisjs/Prak_Mobile_programming_tugas4 | f3b84ce1953fe597612fe9538e51705283cf0fc8 | 82feb970f0a4eda792cb05c186c2484629df81f4 | refs/heads/master | 2021-01-19T00:41:02.924128 | 2016-11-08T02:31:45 | 2016-11-08T02:31:45 | 73,141,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,519 | java | package com.nbs.app.latihan_sql_lite;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class BuatBiodata extends AppCompatActivity {
protected Cursor cursor;
DataHelper dbHelper;
Button ton1, ton2;
EditText text1, text2, text3, text4, text5, text6, text7;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_buat_biodata);
dbHelper = new DataHelper(this);
text1 = (EditText) findViewById(R.id.editText1);
text2 = (EditText) findViewById(R.id.editText2);
text3 = (EditText) findViewById(R.id.editText3);
text4 = (EditText) findViewById(R.id.editText4);
text5 = (EditText) findViewById(R.id.editText5);
text6 = (EditText) findViewById(R.id.editText6);
text7 = (EditText) findViewById(R.id.editText7);
ton1 = (Button) findViewById(R.id.button1);
ton2 = (Button) findViewById(R.id.button2);
ton1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
SQLiteDatabase db = dbHelper.getWritableDatabase();
db.execSQL("insert into biodata(nim, nama, tgl, jk, alamat, angkatan, jurusan) values('" +
text1.getText().toString()+"','"+
text2.getText().toString() +"','" +
text3.getText().toString()+"','"+
text4.getText().toString() +"','" +
text5.getText().toString() +"','" +
text6.getText().toString() +"','" +
text7.getText().toString() + "')");
Toast.makeText(getApplicationContext(), "Berhasil",
Toast.LENGTH_LONG).show();
MainActivity.ma.RefreshList();
finish();
}
});
ton2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
finish();
}
});
}
}
| [
"mohamaddenisjs@gmail.com"
] | mohamaddenisjs@gmail.com |
d0fbda4377e30d210c966f4d3a880f8978231925 | cb9796cbb14e8edf55a201614a18081c6b927ab3 | /owsproxyserver/src/org/deegree/io/datastore/sql/transaction/UpdateHandler.java | e9b46e780779b3cd8f2081b63bb159a911a14918 | [] | no_license | camptocamp/secureOWS | 40ebe40d9e51ee6ae471e2cb892de41d6cd9516a | 314dc306bdfd0726cd750359f0dcf746d9c87205 | refs/heads/master | 2021-01-23T12:05:15.578330 | 2011-07-21T13:50:05 | 2011-07-21T13:50:05 | 2,041,190 | 6 | 1 | null | null | null | null | UTF-8 | Java | false | false | 33,742 | java | //$Header: /home/deegree/jail/deegreerepository/deegree/src/org/deegree/io/datastore/sql/transaction/UpdateHandler.java,v 1.25 2006/09/20 11:35:41 mschneider Exp $
/*---------------- FILE HEADER ------------------------------------------
This file is part of deegree.
Copyright (C) 2001-2006 by:
EXSE, Department of Geography, University of Bonn
http://www.giub.uni-bonn.de/deegree/
lat/lon GmbH
http://www.lat-lon.de
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact:
Andreas Poth
lat/lon GmbH
Aennchenstraße 19
53177 Bonn
Germany
E-Mail: poth@lat-lon.de
Prof. Dr. Klaus Greve
Department of Geography
University of Bonn
Meckenheimer Allee 166
53115 Bonn
Germany
E-Mail: greve@giub.uni-bonn.de
---------------------------------------------------------------------------*/
package org.deegree.io.datastore.sql.transaction;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.deegree.datatypes.QualifiedName;
import org.deegree.datatypes.Types;
import org.deegree.framework.log.ILogger;
import org.deegree.framework.log.LoggerFactory;
import org.deegree.i18n.Messages;
import org.deegree.io.datastore.DatastoreException;
import org.deegree.io.datastore.FeatureId;
import org.deegree.io.datastore.idgenerator.FeatureIdAssigner;
import org.deegree.io.datastore.schema.MappedFeaturePropertyType;
import org.deegree.io.datastore.schema.MappedFeatureType;
import org.deegree.io.datastore.schema.MappedGeometryPropertyType;
import org.deegree.io.datastore.schema.MappedPropertyType;
import org.deegree.io.datastore.schema.MappedSimplePropertyType;
import org.deegree.io.datastore.schema.TableRelation;
import org.deegree.io.datastore.schema.TableRelation.FK_INFO;
import org.deegree.io.datastore.schema.content.MappingField;
import org.deegree.io.datastore.schema.content.MappingGeometryField;
import org.deegree.io.datastore.schema.content.SimpleContent;
import org.deegree.io.datastore.sql.AbstractRequestHandler;
import org.deegree.io.datastore.sql.StatementBuffer;
import org.deegree.io.datastore.sql.TableAliasGenerator;
import org.deegree.model.feature.Feature;
import org.deegree.model.feature.schema.FeaturePropertyType;
import org.deegree.model.filterencoding.Filter;
import org.deegree.model.spatialschema.Geometry;
import org.deegree.ogcbase.PropertyPath;
import org.deegree.ogcwebservices.wfs.operation.transaction.Insert;
import org.deegree.ogcwebservices.wfs.operation.transaction.Transaction;
import org.deegree.ogcwebservices.wfs.operation.transaction.Update;
/**
* Handler for {@link Update} operations (usually contained in {@link Transaction}
* requests).
*
* @author <a href="mailto:schneider@lat-lon.de">Markus Schneider</a>
* @author last edited by: $Author: mschneider $
*
* @version $Revision: 1.25 $, $Date: 2006/09/20 11:35:41 $
*/
public class UpdateHandler extends AbstractRequestHandler {
private static final ILogger LOG = LoggerFactory.getLogger( UpdateHandler.class );
private SQLTransaction dsTa;
/**
* Creates a new <code>UpdateHandler</code> from the given parameters.
*
* @param dsTa
* @param aliasGenerator
* @param conn
*/
public UpdateHandler( SQLTransaction dsTa, TableAliasGenerator aliasGenerator, Connection conn ) {
super( dsTa.getDatastore(), aliasGenerator, conn );
this.dsTa = dsTa;
}
/**
* Performs an update operation against the associated datastore.
*
* @param ft
* @param properties
* @param filter
* @return number of updated (root) feature instances
* @throws DatastoreException
*/
public int performUpdate( MappedFeatureType ft, Map<PropertyPath, Object> properties,
Filter filter )
throws DatastoreException {
List<FeatureId> fids = determineAffectedFIDs( ft, filter );
LOG.logDebug( "Updating: " + ft );
for ( PropertyPath property : properties.keySet() ) {
Object propertyValue = properties.get( property );
for ( FeatureId fid : fids ) {
LOG.logDebug( "Updating feature: " + fid );
performUpdate( fid, ft, property, propertyValue );
}
}
return fids.size();
}
/**
* Performs an update operation against the associated datastore.
* <p>
* The filter must match exactly one feature instance (or none) which is then replaced
* by the specified replacement feature.
*
* @param mappedFeatureType
* @param replacementFeature
* @param filter
* @return number of updated (root) feature instances (0 or 1)
* @throws DatastoreException
*/
public int performUpdate( MappedFeatureType mappedFeatureType, Feature replacementFeature,
Filter filter )
throws DatastoreException {
LOG.logDebug( "Updating (replace): " + mappedFeatureType );
if ( filter != null ) {
LOG.logDebug( " filter: " + filter.toXML() );
}
List<FeatureId> fids = determineAffectedFIDs( mappedFeatureType, filter );
if ( fids.size() > 1 ) {
String msg = Messages.getMessage( "DATASTORE_MORE_THAN_ONE_FEATURE" );
throw new DatastoreException( msg );
}
DeleteHandler deleteHandler = new DeleteHandler( this.dsTa, this.aliasGenerator, this.conn );
deleteHandler.performDelete( mappedFeatureType, filter );
// identify stored subfeatures / assign feature ids
FeatureIdAssigner fidAssigner = new FeatureIdAssigner( Insert.ID_GEN.GENERATE_NEW );
fidAssigner.assignFID( replacementFeature, this.dsTa );
// TODO remove this hack
fidAssigner.markStoredFeatures();
InsertHandler insertHandler = new InsertHandler( this.dsTa, this.aliasGenerator, this.conn );
List<Feature> features = new ArrayList<Feature>();
features.add( replacementFeature );
insertHandler.performInsert( features );
return fids.size();
}
/**
* Performs the update (replacing of a property) of the given feature instance.
* <p>
* If the selected property is a direct property of the feature, the root feature
* is updated, otherwise the targeted subfeatures have to be determined first.
*
* @param fid
* @param ft
* @param propertyName
* @param replacementValue
* @throws DatastoreException
*/
private void performUpdate( FeatureId fid, MappedFeatureType ft, PropertyPath propertyName,
Object replacementValue )
throws DatastoreException {
LOG.logDebug( "Updating fid: " + fid + ", propertyName: " + propertyName + " -> "
+ replacementValue );
int steps = propertyName.getSteps();
QualifiedName propName = propertyName.getStep( steps - 1 ).getPropertyName();
if ( steps > 2 ) {
QualifiedName subFtName = propertyName.getStep( steps - 2 ).getPropertyName();
MappedFeatureType subFt = this.datastore.getFeatureType( subFtName );
MappedPropertyType pt = (MappedPropertyType) subFt.getProperty( propName );
List<TableRelation> tablePath = getTablePath( ft, propertyName );
List<FeatureId> subFids = determineAffectedFIDs( fid, subFt, tablePath );
for ( FeatureId subFid : subFids ) {
updateProperty( subFid, subFt, pt, replacementValue );
}
} else {
MappedPropertyType pt = (MappedPropertyType) ft.getProperty( propName );
updateProperty( fid, ft, pt, replacementValue );
}
}
/**
* Determines the subfeature instances that are targeted by the given PropertyName.
*
* @param fid
* @param subFt
* @param propertyName
* @return the matched feature ids
* @throws DatastoreException
*/
private List<FeatureId> determineAffectedFIDs( FeatureId fid, MappedFeatureType subFt,
List<TableRelation> path )
throws DatastoreException {
List<FeatureId> subFids = new ArrayList<FeatureId>();
this.aliasGenerator.reset();
String[] tableAliases = this.aliasGenerator.generateUniqueAliases( path.size() + 1 );
String toTableAlias = tableAliases[tableAliases.length - 1];
StatementBuffer query = new StatementBuffer();
query.append( "SELECT " );
appendFeatureIdColumns( subFt, toTableAlias, query );
query.append( " FROM " );
query.append( path.get( 0 ).getFromTable() );
query.append( " " );
query.append( tableAliases[0] );
// append joins
for ( int i = 0; i < path.size(); i++ ) {
query.append( " JOIN " );
query.append( path.get( i ).getToTable() );
query.append( " " );
query.append( tableAliases[i + 1] );
query.append( " ON " );
MappingField[] fromFields = path.get( i ).getFromFields();
MappingField[] toFields = path.get( i ).getToFields();
for ( int j = 0; j < fromFields.length; j++ ) {
query.append( tableAliases[i] );
query.append( '.' );
query.append( fromFields[j].getField() );
query.append( '=' );
query.append( tableAliases[i + 1] );
query.append( '.' );
query.append( toFields[j].getField() );
}
}
query.append( " WHERE " );
MappingField[] fidFields = fid.getFidDefinition().getIdFields();
for ( int i = 0; i < fidFields.length; i++ ) {
query.append( tableAliases[0] );
query.append( '.' );
query.append( fidFields[i].getField() );
query.append( "=?" );
query.addArgument( fid.getValue( i ), fidFields[i].getType() );
if ( i != fidFields.length - 1 ) {
query.append( " AND " );
}
}
PreparedStatement stmt = null;
ResultSet rs = null;
try {
stmt = this.datastore.prepareStatement( conn, query );
rs = stmt.executeQuery();
subFids = extractFeatureIds( rs, subFt );
} catch ( SQLException e ) {
throw new DatastoreException( "Error in determineAffectedFIDs(): " + e.getMessage() );
} finally {
try {
if ( rs != null ) {
try {
rs.close();
} catch ( SQLException e ) {
LOG.logError( "Error closing result set: '" + e.getMessage() + "'.", e );
}
}
} finally {
if ( stmt != null ) {
try {
stmt.close();
} catch ( SQLException e ) {
LOG.logError( "Error closing statement: '" + e.getMessage() + "'.", e );
}
}
}
}
return subFids;
}
/**
* Returns the relations (the "path") that lead from the feature type's table to the
* subfeature table which is targeted by the specified property name.
*
* @param ft source feature type
* @param path property name
* @return relations that lead from the feature type's table to the subfeature table
*/
private List<TableRelation> getTablePath( MappedFeatureType ft, PropertyPath path ) {
List<TableRelation> relations = new ArrayList<TableRelation>();
for ( int i = 1; i < path.getSteps() - 2; i += 2 ) {
QualifiedName propName = path.getStep( i ).getPropertyName();
MappedFeaturePropertyType pt = (MappedFeaturePropertyType) ft.getProperty( propName );
TableRelation[] tableRelations = pt.getTableRelations();
for ( int j = 0; j < tableRelations.length; j++ ) {
relations.add( tableRelations[j] );
}
ft = pt.getFeatureTypeReference().getFeatureType();
}
return relations;
}
/**
* Replaces the specified feature's property with the given value.
*
* @param fid
* @param ft
* @param pt
* @param replacementValue
* @throws DatastoreException
*/
private void updateProperty( FeatureId fid, MappedFeatureType ft, MappedPropertyType pt,
Object replacementValue )
throws DatastoreException {
LOG.logDebug( "Updating property '" + pt.getName() + "' of feature '" + fid + "'." );
if ( !ft.isUpdatable() ) {
String msg = Messages.getMessage( "DATASTORE_FT_NOT_UPDATABLE", ft.getName() );
throw new DatastoreException( msg );
}
TableRelation[] tablePath = pt.getTableRelations();
if ( pt instanceof MappedSimplePropertyType ) {
SimpleContent content = ( (MappedSimplePropertyType) pt ).getContent();
if ( content.isUpdateable() ) {
if ( content instanceof MappingField ) {
updateProperty( fid, tablePath, (MappingField) content, replacementValue );
}
} else {
LOG.logInfo( "Ignoring property '" + pt.getName() + "' in update - is virtual." );
}
} else if ( pt instanceof MappedGeometryPropertyType ) {
MappingGeometryField dbField = ( (MappedGeometryPropertyType) pt ).getMappingField();
Object dbGeometry = this.datastore.convertDeegreeToDBGeometry(
(Geometry) replacementValue,
dbField.getSRS(),
this.conn );
// TODO remove this Oracle hack
if ( this.datastore.getClass().getName().contains( "OracleDatastore" ) ) {
dbField = new MappingGeometryField( dbField.getTable(), dbField.getField(),
Types.STRUCT, dbField.getSRS() );
}
updateProperty( fid, tablePath, dbField, dbGeometry );
} else if ( pt instanceof FeaturePropertyType ) {
updateProperty( fid, ft, (MappedFeaturePropertyType) pt, (Feature) replacementValue );
} else {
throw new DatastoreException( "Internal error: Properties with type '" + pt.getClass()
+ "' are not handled in UpdateHandler." );
}
}
/**
* Updates a simple / geometry property of the specified feature.
* <p>
* Three cases have to be distinguished (which all have to be handled differently):
* <ol>
* <li>property value stored in feature table</li>
* <li>property value stored in property table, fk in property table</li>
* <li>property value stored in property table, fk in feature table</li>
* </ol>
*
* @param fid
* @param tablePath
* @param dbField
* @param replacementValue
* @throws DatastoreException
*/
private void updateProperty( FeatureId fid, TableRelation[] tablePath, MappingField dbField,
Object replacementValue )
throws DatastoreException {
if ( tablePath.length == 0 ) {
updateProperty( fid, dbField, replacementValue );
} else if ( tablePath.length == 1 ) {
TableRelation relation = tablePath[0];
if ( tablePath[0].getFKInfo() == FK_INFO.fkIsToField ) {
Object[] keyValues = determineKeyValues( fid, relation );
if ( keyValues != null ) {
deletePropertyRows( relation, keyValues );
}
insertPropertyRow( relation, keyValues, dbField, replacementValue );
} else {
Object[] oldKeyValues = determineKeyValues( fid, relation );
Object[] newKeyValues = findOrInsertPropertyRow( relation, dbField,
replacementValue );
updateFeatureRow( fid, relation, newKeyValues );
if ( oldKeyValues != null ) {
deleteOrphanedPropertyRows( relation, oldKeyValues );
}
}
} else {
throw new DatastoreException( "Updating of properties that are stored in "
+ "related tables using join tables is not "
+ "supported." );
}
}
private void updateFeatureRow( FeatureId fid, TableRelation relation, Object[] newKeyValues )
throws DatastoreException {
StatementBuffer query = new StatementBuffer();
query.append( "UPDATE " );
query.append( relation.getFromTable() );
query.append( " SET " );
MappingField[] fromFields = relation.getFromFields();
for ( int i = 0; i < newKeyValues.length; i++ ) {
query.append( fromFields[i].getField() );
query.append( "=?" );
query.addArgument( newKeyValues[i], fromFields[i].getType() );
}
query.append( " WHERE " );
appendFIDWhereCondition( query, fid );
LOG.logDebug( "Performing update: " + query.getQueryString() );
PreparedStatement stmt = null;
try {
stmt = this.datastore.prepareStatement( conn, query );
stmt.execute();
} catch ( SQLException e ) {
throw new DatastoreException( "Error in performUpdate(): " + e.getMessage() );
} finally {
if ( stmt != null ) {
try {
stmt.close();
} catch ( SQLException e ) {
LOG.logError( "Error closing statement: '" + e.getMessage() + "'.", e );
}
}
}
}
/**
* Updates a simple / geometry property of the specified feature.
* <p>
* This method handles the case where the property is stored in the feature table itself, so
* a single UPDATE statement is sufficient.
*
* @param fid
* @param dbField
* @param replacementValue
* @throws DatastoreException
*/
private void updateProperty( FeatureId fid, MappingField dbField, Object replacementValue )
throws DatastoreException {
StatementBuffer query = new StatementBuffer();
query.append( "UPDATE " );
query.append( dbField.getTable() );
query.append( " SET " );
query.append( dbField.getField() );
query.append( "=?" );
query.addArgument( replacementValue, dbField.getType() );
query.append( " WHERE " );
appendFIDWhereCondition( query, fid );
LOG.logDebug( "Performing update: " + query.getQueryString() );
PreparedStatement stmt = null;
try {
stmt = this.datastore.prepareStatement( conn, query );
stmt.execute();
} catch ( SQLException e ) {
throw new DatastoreException( "Error in performUpdate(): " + e.getMessage() );
} finally {
if ( stmt != null ) {
try {
stmt.close();
} catch ( SQLException e ) {
LOG.logError( "Error closing statement: '" + e.getMessage() + "'.", e );
}
}
}
}
/**
* Determines the values for the key columns that are referenced by the given table
* relation (as from fields).
*
* @param fid
* @param relation
* @return the values for the key columns
* @throws DatastoreException
*/
private Object[] determineKeyValues( FeatureId fid, TableRelation relation )
throws DatastoreException {
StatementBuffer query = new StatementBuffer();
query.append( "SELECT " );
MappingField[] fromFields = relation.getFromFields();
for ( int i = 0; i < fromFields.length; i++ ) {
query.append( fromFields[i].getField() );
if ( i != fromFields.length - 1 ) {
query.append( ',' );
}
}
query.append( " FROM " );
query.append( relation.getFromTable() );
query.append( " WHERE " );
appendFIDWhereCondition( query, fid );
Object[] keyValues = new Object[fromFields.length];
LOG.logDebug( "determineKeyValues: " + query.getQueryString() );
PreparedStatement stmt = null;
try {
stmt = this.datastore.prepareStatement( conn, query );
ResultSet rs = stmt.executeQuery();
if ( rs.next() ) {
for ( int i = 0; i < keyValues.length; i++ ) {
Object value = rs.getObject( i + 1 );
if ( value != null ) {
keyValues[i] = value;
} else {
keyValues = null;
break;
}
}
} else {
LOG.logError( "Internal error. Result is empty (no rows)." );
throw new SQLException();
}
} catch ( SQLException e ) {
throw new DatastoreException( "Error in performUpdate(): " + e.getMessage() );
} finally {
if ( stmt != null ) {
try {
stmt.close();
} catch ( SQLException e ) {
LOG.logError( "Error closing statement: '" + e.getMessage() + "'.", e );
}
}
}
return keyValues;
}
private void deletePropertyRows( TableRelation relation, Object[] keyValues )
throws DatastoreException {
StatementBuffer query = new StatementBuffer();
query.append( "DELETE FROM " );
query.append( relation.getToTable() );
query.append( " WHERE " );
MappingField[] toFields = relation.getToFields();
for ( int i = 0; i < toFields.length; i++ ) {
query.append( toFields[i].getField() );
query.append( "=?" );
query.addArgument( keyValues[i], toFields[i].getType() );
if ( i != toFields.length - 1 ) {
query.append( " AND " );
}
}
PreparedStatement stmt = null;
LOG.logDebug( "deletePropertyRows: " + query.getQueryString() );
try {
stmt = this.datastore.prepareStatement( conn, query );
stmt.execute();
} catch ( SQLException e ) {
throw new DatastoreException( "Error in performUpdate(): " + e.getMessage() );
} finally {
if ( stmt != null ) {
try {
stmt.close();
} catch ( SQLException e ) {
LOG.logError( "Error closing statement: '" + e.getMessage() + "'.", e );
}
}
}
}
private void insertPropertyRow( TableRelation relation, Object[] keyValues,
MappingField dbField, Object replacementValue )
throws DatastoreException {
if ( keyValues == null ) {
if ( relation.getFromFields().length > 1 ) {
throw new DatastoreException( "Key generation for compound keys is not supported." );
}
// generate new primary key
keyValues = new Object[1];
keyValues[0] = relation.getIdGenerator().getNewId( dsTa );
}
StatementBuffer query = new StatementBuffer();
query.append( "INSERT INTO " );
query.append( relation.getToTable() );
query.append( " (" );
MappingField[] toFields = relation.getToFields();
for ( int i = 0; i < toFields.length; i++ ) {
query.append( toFields[i].getField() );
query.append( ',' );
}
query.append( dbField.getField() );
query.append( ") VALUES (" );
for ( int i = 0; i < toFields.length; i++ ) {
query.append( '?' );
query.addArgument( keyValues[i], toFields[i].getType() );
query.append( ',' );
}
query.append( "?)" );
query.addArgument( replacementValue, dbField.getType() );
PreparedStatement stmt = null;
LOG.logDebug( "insertPropertyRow: " + query.getQueryString() );
try {
stmt = this.datastore.prepareStatement( conn, query );
stmt.execute();
} catch ( SQLException e ) {
throw new DatastoreException( "Error in performUpdate(): " + e.getMessage() );
} finally {
if ( stmt != null ) {
try {
stmt.close();
} catch ( SQLException e ) {
LOG.logError( "Error closing statement: '" + e.getMessage() + "'.", e );
}
}
}
}
/**
* Returns the foreign key value(s) for the row that stores the given property.
* <p>
* If the row already exists, the existing key is returned, otherwise a new row for the
* property is inserted first.
*
* @param relation
* @param dbField
* @param replacementValue
* @return foreign key value(s) for the row that stores the given property
* @throws DatastoreException
*/
private Object[] findOrInsertPropertyRow( TableRelation relation, MappingField dbField,
Object replacementValue )
throws DatastoreException {
Object[] keyValues = null;
if ( dbField.getType() != Types.GEOMETRY ) {
StatementBuffer query = new StatementBuffer();
query.append( "SELECT " );
MappingField[] toFields = relation.getToFields();
for ( int i = 0; i < toFields.length; i++ ) {
query.append( toFields[i].getField() );
if ( i != toFields.length - 1 ) {
query.append( ',' );
}
}
query.append( " FROM " );
query.append( relation.getToTable() );
query.append( " WHERE " );
query.append( dbField.getField() );
query.append( "=?" );
query.addArgument( replacementValue, dbField.getType() );
PreparedStatement stmt = null;
LOG.logDebug( "findOrInsertPropertyRow: " + query.getQueryString() );
try {
stmt = this.datastore.prepareStatement( conn, query );
ResultSet rs = stmt.executeQuery();
if ( rs.next() ) {
keyValues = new Object[toFields.length];
for ( int i = 0; i < toFields.length; i++ ) {
keyValues[i] = rs.getObject( i + 1 );
}
}
} catch ( SQLException e ) {
throw new DatastoreException( "Error in findOrInsertPropertyRow(): "
+ e.getMessage() );
} finally {
if ( stmt != null ) {
try {
stmt.close();
} catch ( SQLException e ) {
LOG.logError( "Error closing statement: '" + e.getMessage() + "'.", e );
}
}
}
if ( keyValues != null ) {
return keyValues;
}
}
if ( relation.getToFields().length > 1 ) {
throw new DatastoreException( "Key generation for compound keys is not supported." );
}
// property does not yet exist (or it's a geometry)
keyValues = new Object[1];
// generate new PK
keyValues[0] = relation.getNewPK( this.dsTa );
insertPropertyRow( relation, keyValues, dbField, replacementValue );
return keyValues;
}
private void deleteOrphanedPropertyRows( TableRelation relation, Object[] keyValues )
throws DatastoreException {
Map<String, Object> keyColumns = new HashMap<String, Object>();
for ( int i = 0; i < keyValues.length; i++ ) {
keyColumns.put( relation.getToFields()[i].getField(), keyValues[i] );
}
DeleteNode node = new DeleteNode( relation.getToTable(), keyColumns );
DeleteHandler deleteHandler = new DeleteHandler( this.dsTa, this.aliasGenerator, this.conn );
if ( deleteHandler.getReferencingRows( node ).size() == 0 ) {
try {
deleteHandler.performDelete( node );
} catch ( SQLException e ) {
throw new DatastoreException( e.getMessage() );
}
}
}
private void updateProperty( @SuppressWarnings("unused")
FeatureId fid, @SuppressWarnings("unused")
MappedFeatureType ft, @SuppressWarnings("unused")
MappedFeaturePropertyType pt, @SuppressWarnings("unused")
Feature replacementFeature ) {
throw new UnsupportedOperationException(
"Updating of feature properties is not implemented yet." );
}
private void appendFIDWhereCondition( StatementBuffer query, FeatureId fid ) {
MappingField[] fidFields = fid.getFidDefinition().getIdFields();
for ( int i = 0; i < fidFields.length; i++ ) {
query.append( fidFields[i].getField() );
query.append( "=?" );
query.addArgument( fid.getValue( i ), fidFields[i].getType() );
if ( i != fidFields.length - 1 ) {
query.append( " AND " );
}
}
}
}
/* ********************************************************************
Changes to this class. What the people have been up to:
$Log: UpdateHandler.java,v $
Revision 1.25 2006/09/20 11:35:41 mschneider
Merged datastore related messages with org.deegree.18n.
Revision 1.24 2006/09/19 14:57:01 mschneider
Fixed warnings, improved javadoc.
Revision 1.23 2006/09/05 14:43:24 mschneider
Adapted due to merging of messages.
Revision 1.22 2006/08/29 15:53:57 mschneider
Changed SimpleContent#isVirtual() to SimpleContent#isUpdateable().
Revision 1.21 2006/08/23 16:35:58 mschneider
Added handling of virtual properties. Virtual properties are skipped on update.
Revision 1.20 2006/08/22 18:14:42 mschneider
Refactored due to cleanup of org.deegree.io.datastore.schema package.
Revision 1.19 2006/08/21 16:42:36 mschneider
Refactored due to cleanup (and splitting) of org.deegree.io.datastore.schema package.
Revision 1.18 2006/08/21 15:46:53 mschneider
Refactored due to cleanup (and splitting) of org.deegree.io.datastore.schema package.
Revision 1.17 2006/08/06 20:49:30 poth
UnsupportedOperationException instead of datastoreException thrown
Revision 1.16 2006/07/26 18:57:29 mschneider
Fixed spelling in method name.
Revision 1.15 2006/06/29 10:26:20 mschneider
Moved identifying of stored features / assigning of feature ids from TransactionHandler here.
Revision 1.14 2006/06/28 08:53:35 poth
*** empty log message ***
Revision 1.13 2006/06/27 08:14:55 poth
bug fix - just log filter if available
Revision 1.12 2006/06/01 16:01:19 mschneider
Added exception that is thrown in case of FeatureProperty updates.
Revision 1.11 2006/05/30 17:04:06 mschneider
Update on geometry properties should work now.
Revision 1.10 2006/05/29 16:39:24 mschneider
Update on simple properties should work now.
Revision 1.9 2006/05/24 15:25:03 mschneider
Update for simple / geometry properties should work now (only when they are stored in the feature table).
Revision 1.8 2006/05/23 22:40:57 mschneider
"Standard" update throws Exception now (to let the user know that it is not fully implemented yet).
Revision 1.7 2006/05/23 16:06:34 mschneider
Changed signature of performUpdate().
Revision 1.6 2006/05/18 15:48:02 mschneider
Added handling of non-standard update (feature replace).
Revision 1.5 2006/05/17 18:28:49 mschneider
Initial work on Update.
Revision 1.4 2006/05/16 16:20:10 mschneider
Added update method for deegree specific update operation.
Revision 1.3 2006/04/18 12:47:40 mschneider
Improved javadoc.
Revision 1.2 2006/04/06 20:25:27 poth
*** empty log message ***
Revision 1.1 2006/02/13 17:54:55 mschneider
Initial version.
********************************************************************** */
| [
"sypasche@d2b8d2de-b12a-0410-86d9-8c904ad3c895"
] | sypasche@d2b8d2de-b12a-0410-86d9-8c904ad3c895 |
2743864d43b0e57d2b897477b68f7f3fa6ec53bf | 36d14c92d0db82b59cf59c38c89b350aef0d7fa2 | /calculation-coordinates/src/main/java/by/mchs/CalculateCoordinateApplication.java | 610294ff6346d39d460120882b7e8e736e85c653 | [] | no_license | vadim1504/mchs-system | 1927e7ca04ee2542edaa5e55762de5baa4c0f59d | 7ae75a74d64e5c6894a45e857a6bfa38535518ab | refs/heads/master | 2021-07-10T20:46:11.134914 | 2017-10-12T20:05:49 | 2017-10-12T20:05:49 | 106,290,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 421 | java | package by.mchs;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@SpringBootApplication
public class CalculateCoordinateApplication{
public static void main(String[] args) {
SpringApplication.run(CalculateCoordinateApplication.class, args);
}
}
| [
"vadi-96@mail.ri"
] | vadi-96@mail.ri |
ac36c4dc814661f10b062b006bb033153df75c2c | d3e47ffaf435eef07614120147deb204fe9e1acc | /src/JavaTechnoStudy/day44/staticFieldInheritance/B.java | 27f35d00eca764d24257b9e6afc4e6efe5ac63fa | [] | no_license | Aykurt24/aykurtsProjects | 94d08fe13d23f403e95309937db043a69d44a6c0 | 130e6c0adf7e6d321df7bf415947829bd8fe82a3 | refs/heads/master | 2022-10-24T18:20:58.562719 | 2020-06-16T15:00:17 | 2020-06-16T15:00:17 | 263,530,839 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | package JavaTechnoStudy.day44.staticFieldInheritance;
public class B extends A {
public B() {
text = "Hello B";
}
}
| [
"doganaykurt@gmail.com"
] | doganaykurt@gmail.com |
f68b3a95464859c9188ff4d1b9ee7701cb7d346b | b9eab531ebbd77ebe785c7cd015cd06197274126 | /app/src/main/java/com/example/pomodoro/Task/Information.java | f7b6f88d7ecb5d41bb2ef758a4c2081050b1f775 | [] | no_license | HoangLong-212/PomodoroApp | d9328c053fcd9b685f8143c4b774f7aaf1e36b02 | 347d02c93a9623c8ed1620bf3836f4915013372c | refs/heads/master | 2023-06-17T23:35:40.683608 | 2021-05-15T05:39:47 | 2021-05-15T05:39:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java | package com.example.pomodoro.Task;
public class Information {
private String id;
private String subject;
// private int IconImage;
public Information(String id, String subject) {
this.id = id;
this.subject = subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public void setId(String id) {
this.id = id;
}
public String getSubject() {
return subject;
}
public String getId() {
return id;
}
}
| [
"19520358@gm.uit.edu.vn"
] | 19520358@gm.uit.edu.vn |
cbdf1a51a2485668a0d3da28067b6c6e4ecf56a1 | 621dfac43a3214de493c32a139ead3b88d37b059 | /notificationapp/src/androidTest/java/ru/mirea/bushina/notificationapp/ExampleInstrumentedTest.java | dffc084e790015310017174c765b11ffd2ad9bed | [] | no_license | JulianaBushina/PracticeTwo | 1c44f376f0d80bfefe7c4ff0ed6b8f39c48debb3 | 441a62e23e911a3cbfe08fcf2120b5cddb3c5997 | refs/heads/master | 2023-08-11T23:17:41.158093 | 2021-10-14T19:14:51 | 2021-10-14T19:14:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 778 | java | package ru.mirea.bushina.notificationapp;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.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.getInstrumentation().getTargetContext();
assertEquals("ru.mirea.bushina.notificationapp", appContext.getPackageName());
}
} | [
"bushina_yv@mail.ru"
] | bushina_yv@mail.ru |
59656db7a0a23000a9915158039b50af27c94341 | 6331d7b7d57799a8eb584672ff33d50cac489143 | /source/zookeeper-learning/zookeeper-learning-web/src/main/java/com/soul/alg/sword/OddNumberMoveFront.java | 5d240c1cfc138d7083805af7713af8516efec207 | [] | no_license | wangkunSE/notes | 9f7def0d91353eb3f42904e5f7a2f52cb2815ba2 | a204010706977a1cc334515e7e40266cdbc34f50 | refs/heads/master | 2022-12-22T08:59:46.438186 | 2020-12-17T02:41:08 | 2020-12-17T02:41:08 | 89,057,798 | 0 | 1 | null | 2022-12-16T10:31:48 | 2017-04-22T09:10:25 | Java | UTF-8 | Java | false | false | 905 | java | package com.soul.alg.sword;
/**
* @author wangkun1
* @version 2018/4/17
*/
public class OddNumberMoveFront {
public static void main(String[] args) {
int[] arr = {-1, -3, 4, 2, -5, -7};
new OddNumberMoveFront().arrayMove(arr);
for (int i : arr) {
System.out.print(i + "\t");
}
}
private void arrayMove(int[] arr) {
if (arr.length <= 0) {
return;
}
int low = 0;
int high = arr.length - 1;
while (low < high) {
while (arr[low] % 2 != 0 && low < high) {
low++;
}
while (arr[high] % 2 == 0 && low < high) {
high--;
}
swap(arr, low, high);
}
}
private void swap(int[] arr, int low, int high) {
int temp = arr[low];
arr[low] = arr[high];
arr[high] = temp;
}
}
| [
"wangkun1@corp.netease.com"
] | wangkun1@corp.netease.com |
c9d9b04d40febc7722984f73208d7ae485068f7c | 17ae052bcfb108575d1719e7833dd3b12f19c3e5 | /src/main/java/com/practica/aeropuerto/Vehiculo.java | 66026d944d697c8160463d2cb74928a37b347b6a | [] | no_license | jnaranjoDev/practicas | e55755a235aecb689a965e286defc2a8b96853ae | 7d006afc8656ddc08892a63553dd0637c18ec56c | refs/heads/master | 2023-07-18T08:58:37.680530 | 2021-08-31T07:39:22 | 2021-08-31T07:39:22 | 399,464,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,609 | java | package com.practica.aeropuerto;
import java.io.Serializable;
/**
* Clase que modela los datos de un vehiculo
* La carga maxima permitida se asigna en kg
*
* @author begonaolea
* @version 1.0.0
*/
public class Vehiculo implements Serializable {
private static final long serialVersionUID = 1L;
//variables de clase - 1 para toda la aplicacion
public static final double CARGA_MAXIMA_DEFECTO = 1000.0;
// atributos - variables de instancia (objeto)
private String matricula;
private double cargaMaxima;
private double cargaActual;
private int numCajas;
//constructores
public Vehiculo(double cargaMaxima, String matricula) {
super();
this.cargaMaxima = cargaMaxima;
this.matricula = matricula;
this.cargaActual = 0;
this.numCajas = 0;
}
//métodos getters y setters
public double getCargaMaxima() {
return cargaMaxima;
}
public void setCargaMaxima(double cargaMaxima) {
this.cargaMaxima = cargaMaxima;
}
public String getMatricula() {
return matricula;
}
public void setMatricula(String matricula) {
this.matricula = matricula;
}
public double getCargaActual() {
return cargaActual;
}
public void setCargaActual(double cargaActual) {
this.cargaActual = cargaActual;
}
public int getNumCajas() {
return numCajas;
}
@Override
public String toString() {
return "Vehiculo [matricula=" + matricula + ", cargaMaxima=" + cargaMaxima + ", cargaActual=" + cargaActual
+ ", numCajas=" + numCajas + "]";
}
public void calcularFuel() {
System.out.println("Calculando el fuel...");
System.out.println();
}
}
| [
"49539139+jnaranjoDev@users.noreply.github.com"
] | 49539139+jnaranjoDev@users.noreply.github.com |
f8e71b9c8cd68988bdba61d731ab09e228146dea | 3d4349c88a96505992277c56311e73243130c290 | /Preparation/processed-dataset/god-class_3_1112/6.java | 2b794bedcb22a723f2e54f853be5a27be09993e9 | [] | no_license | D-a-r-e-k/Code-Smells-Detection | 5270233badf3fb8c2d6034ac4d780e9ce7a8276e | 079a02e5037d909114613aedceba1d5dea81c65d | refs/heads/master | 2020-05-20T00:03:08.191102 | 2019-05-15T11:51:51 | 2019-05-15T11:51:51 | 185,272,690 | 7 | 4 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | private static int zzUnpackTrans(String packed, int offset, int[] result) {
int i = 0;
/* index in packed string */
int j = offset;
/* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
value--;
do result[j++] = value; while (--count > 0);
}
return j;
}
| [
"dariusb@unifysquare.com"
] | dariusb@unifysquare.com |
e894c406f59e9cb1167dc8989b794b1f3aea5369 | 85d165ac867401335a01656a94191cfa8583b41b | /TestNG_DEMO/src/UniqloTest.java | 993b92fc1085fdefc9fe23b8171d6e709b87a252 | [] | no_license | Sriti15/MyGitRepo | 342480e02ef9119f3bfa50903717acb3ebdc74a8 | 8e3bfdac42763fcbf9d4aa9a4cfe91d2cb3fb352 | refs/heads/master | 2022-07-17T09:45:48.239333 | 2019-10-08T14:30:44 | 2019-10-08T14:30:44 | 198,456,874 | 0 | 0 | null | 2022-06-29T17:31:46 | 2019-07-23T15:21:11 | HTML | UTF-8 | Java | false | false | 917 | java |
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class UniqloTest {
WebDriver driver;
@ BeforeMethod
public void open(){
System.setProperty("webdriver.chrome.driver", "C:\\Users\\PSQA\\Desktop\\chromedriver.exe");
driver = new ChromeDriver();
driver.get("https://www.uniqlo.com");
}
@Test(priority=2)
public void LogoTest() throws InterruptedException{
String Test=driver.getTitle();
System.out.println(Test);
Thread.sleep(3000);
}
@Test(priority=1)
public void searchTest() throws InterruptedException{
driver.findElement(By.id("q")).sendKeys("Shirt");
Thread.sleep(3000);
}
@AfterMethod
public void CloseBrowser(){
driver.close();
}
} | [
"PSQA@192.168.1.113"
] | PSQA@192.168.1.113 |
ad956a9d9948ef53f70d08b3b0963264e9264a29 | 21cb8fe6dd9c217f6185865c129d1c58165bc71e | /src/main/java/com/sonihr/aop/AspectJExpressionPointcutAdvisor.java | f7d2d5a8c8c711ce5246887aff3850efa3dde6df | [] | no_license | HuangtianyuCN/SonihrSpring | 8fcf5d13d196fc5a0712ef07010934304cf69822 | 858ecdd52c6930e782bcf4661672834d28624504 | refs/heads/master | 2021-07-04T20:38:40.248757 | 2019-05-27T14:18:54 | 2019-05-27T14:18:54 | 187,324,488 | 3 | 0 | null | 2020-10-13T13:18:29 | 2019-05-18T06:50:36 | Java | UTF-8 | Java | false | false | 643 | java | package com.sonihr.aop;
import org.aopalliance.aop.Advice;
/**
* @author yihua.huang@dianping.com
*/
public class AspectJExpressionPointcutAdvisor implements PointcutAdvisor {
private AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
private Advice advice;
private String expression;
public void setAdvice(Advice advice) {
this.advice = advice;
}
public void setExpression(String expression) {
this.pointcut.setExpression(expression);
}
@Override
public Advice getAdvice() {
return advice;
}
@Override
public Pointcut getPointcut() {
return pointcut;
}
}
| [
"huangtianyucn@hotmail.com"
] | huangtianyucn@hotmail.com |
bd8b34521d734ec2d080a1dc45fe51423ff9d8cd | 52aa959298224025a56c90617329067167e927a8 | /app/src/main/java/cn/bmob/imdemo/db/dao/NewFriendDao.java | 2077070b41ed2a322bd5ab19833dae200e64a343 | [] | no_license | Loading1997/NewIM | f36fb3ed3ade43dc8510c1b88c56084755ed5c70 | 842197298c0d5525f2d3e7ba07f44deac2da4d95 | refs/heads/master | 2022-12-10T22:55:49.826619 | 2020-08-10T23:56:22 | 2020-08-10T23:56:22 | 286,602,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,593 | java | package cn.bmob.imdemo.db.dao;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import cn.bmob.imdemo.db.NewFriend;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.DaoConfig;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "newfriend".
*/
public class NewFriendDao extends AbstractDao<NewFriend, Long> {
public static final String TABLENAME = "newfriend";
/**
* Properties of entity NewFriend.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Id = new Property(0, Long.class, "id", true, "_id");
public final static Property Uid = new Property(1, String.class, "uid", false, "UID");
public final static Property Msg = new Property(2, String.class, "msg", false, "MSG");
public final static Property Name = new Property(3, String.class, "name", false, "NAME");
public final static Property Avatar = new Property(4, String.class, "avatar", false, "AVATAR");
public final static Property Status = new Property(5, Integer.class, "status", false, "STATUS");
public final static Property Time = new Property(6, Long.class, "time", false, "TIME");
};
public NewFriendDao(DaoConfig config) {
super(config);
}
public NewFriendDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"newfriend\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
"\"UID\" TEXT," + // 1: uid
"\"MSG\" TEXT," + // 2: msg
"\"NAME\" TEXT," + // 3: name
"\"AVATAR\" TEXT," + // 4: avatar
"\"STATUS\" INTEGER," + // 5: status
"\"TIME\" INTEGER);"); // 6: time
}
/** Drops the underlying database table. */
public static void dropTable(SQLiteDatabase db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"newfriend\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, NewFriend entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String uid = entity.getUid();
if (uid != null) {
stmt.bindString(2, uid);
}
String msg = entity.getMsg();
if (msg != null) {
stmt.bindString(3, msg);
}
String name = entity.getName();
if (name != null) {
stmt.bindString(4, name);
}
String avatar = entity.getAvatar();
if (avatar != null) {
stmt.bindString(5, avatar);
}
Integer status = entity.getStatus();
if (status != null) {
stmt.bindLong(6, status);
}
Long time = entity.getTime();
if (time != null) {
stmt.bindLong(7, time);
}
}
/** @inheritdoc */
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
/** @inheritdoc */
@Override
public NewFriend readEntity(Cursor cursor, int offset) {
NewFriend entity = new NewFriend( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // uid
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // msg
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // name
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // avatar
cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5), // status
cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6) // time
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, NewFriend entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setUid(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setMsg(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setAvatar(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setStatus(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5));
entity.setTime(cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6));
}
/** @inheritdoc */
@Override
protected Long updateKeyAfterInsert(NewFriend entity, long rowId) {
entity.setId(rowId);
return rowId;
}
/** @inheritdoc */
@Override
public Long getKey(NewFriend entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
}
| [
"lzh@lzhs-MacBook-Pro.local"
] | lzh@lzhs-MacBook-Pro.local |
17e55d6e33e0a63b889adb30a497a547625a303d | 90552f7cfac2eaed7a830a471bb28164e4ac2e73 | /蓝桥杯/乘积最大.java | 3d416b0d34b209523742cb48629654895d814ca9 | [] | no_license | TNT-df/java | 7b20f8f0d684a87c49ac8608bb62e0d9baf97a97 | 065eb36c55c0e0a0d067c38afb8545fb8b1aaf12 | refs/heads/master | 2023-04-09T21:38:31.920761 | 2021-04-24T13:40:17 | 2021-04-24T13:40:17 | 290,117,379 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,573 | java | 给定 N 个整数 A1,A2,…AN。
请你从中选出 K 个数,使其乘积最大。
请你求出最大的乘积,由于乘积可能超出整型范围,你只需输出乘积除以 1000000009 的余数。
注意,如果 X<0, 我们定义 X 除以 1000000009 的余数是负(−X)除以 1000000009 的余数,即:0−((0−x)%1000000009)
输入格式
第一行包含两个整数 N 和 K。
以下 N 行每行一个整数 Ai。
输出格式
输出一个整数,表示答案。
数据范围
1≤K≤N≤105,
−105≤Ai≤105
输入样例1:
5 3
-100000
-10000
2
100000
10000
输出样例1:
999100009
输入样例2:
5 3
-100000
-100000
-2
-100000
-100000
输出样例2:
-999999829
/*
1. 先将数组进行排序。
2.判断数组中是否为全负数。
2.1 若k为奇数,则结果为负数,应从后向前取最大
2.2 若k为偶数,则结果为偶数,应从前向后取最大
3.若既有负数也有正数
3.1 若k为奇数,则 res先存储最大值,按照 偶数处理
3.2 若k为偶数,则分别比较两端,讲大的结果放入乘res,k-2,直到k为0;
*/
import java.util.*;
public class Main{
static final long mod = 1000000009;
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int k = in.nextInt();
long f[] = new long[n];
for(int i = 0;i < n;i++)
f[i] = in.nextLong();
Arrays.sort(f);
long res = 1;
boolean flag = false;
if(f[n - 1] < 0)
flag = false;
else flag = true;
if(!flag){
if((k & 1) == 1){
for(int i = n-1,j = 0;j < k;i--,j++){
res = (res * f[i]) %mod;
}
}else{
for(int i = 0;i<k;i++){
res = (res *f[i]) %mod;
}
}
}else{
int l = 0, r = n -1;
if((k & 1) == 1){
res = f[r--];
k--;
}
while(k > 0){
long temp = f[l] * f[l + 1];
long temp1 = f[r] * f[r - 1];
if(temp > temp1){
res = (res * (temp % mod)) % mod;
l +=2;
}else{
res = (res * (temp1% mod)) %mod;
r -=2;
}
k -= 2;
}
}
System.out.println(res);
}
} | [
"1352465154@qq.com"
] | 1352465154@qq.com |
ace68cb6696496fa66f51ee755fbbde0c083e2ca | 73539ea58e84e17207f54e04bb4ac604b4e6d1bd | /nasaclimate/src/test/java/com/ada/api/nasaclimate/DemoApplicationTests.java | 6a4e7e5ec2d8789de10a229ead7250eff44e53b7 | [] | no_license | Primave/NasaClimate | 240ea509c3abfb31974a411e98b157e3d939b6f5 | 66b42f4f721816a2c2839025c0776aa98e69b8d6 | refs/heads/master | 2022-11-25T19:11:55.888064 | 2020-08-03T16:26:43 | 2020-08-03T16:26:43 | 276,902,149 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 213 | java | package com.ada.api.nasaclimate;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DemoApplicationTests {
@Test
void contextLoads() {
}
}
| [
"iyamoura@hotmail.com"
] | iyamoura@hotmail.com |
5cdac81c7358625447cb1606d8ff0d35b2102113 | a8b883ecf94bf64f48fa62e3e2dff786a0fda695 | /src/main/java/hello/Application.java | 64bf196c0a6c23fef3b956c825aa196e7d625cda | [] | no_license | NetCoder99/SpringGreeting | ba26f0ba28d16c008033f9b337f039028f302de3 | a101b47edcbdf35cce4b15ee9515513ea13ca9c6 | refs/heads/master | 2020-12-07T12:00:07.785215 | 2020-01-09T03:47:11 | 2020-01-09T03:47:11 | 232,716,873 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 615 | java | package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication
public class Application extends SpringBootServletInitializer{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| [
"vs001@cox.net"
] | vs001@cox.net |
c66ed2fdbbf6f53e3b73891e5b9412d7ab9a7c3e | 58f6e72aa09c952bc18e23e12d45c335da478ac5 | /app/src/androidTest/java/com/example/mymusicandroid/ExampleInstrumentedTest.java | 32efac68fb8efc93aeaddfa9da1764907ca1cc57 | [] | no_license | mawei150/myMusic | 1551655cd84de971a2657a0f00099ae5a4a573d7 | a53440b964b78dcc742ef7d3f98f03e23162f8ad | refs/heads/master | 2022-12-31T19:28:41.774649 | 2020-10-19T13:48:07 | 2020-10-19T13:48:07 | 286,508,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package com.example.mymusicandroid;
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.mymusicandroid", appContext.getPackageName());
}
}
| [
"1501627568@qq.com"
] | 1501627568@qq.com |
66c478a02fdcf97b19307dc8e195a2bafdf98ab8 | c4623aa95fb8cdd0ee1bc68962711c33af44604e | /src/android/support/v4/widget/t.java | 5d4e13d4cdb8091bc08d9f17cded47ac1b09230d | [] | no_license | reverseengineeringer/com.yelp.android | 48f7f2c830a3a1714112649a6a0a3110f7bdc2b1 | b0ac8d4f6cd5fc5543f0d8de399b6d7b3a2184c8 | refs/heads/master | 2021-01-19T02:07:25.997811 | 2016-07-19T16:37:24 | 2016-07-19T16:37:24 | 38,555,675 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package android.support.v4.widget;
import android.view.View;
import android.widget.PopupWindow;
class t
{
public static void a(PopupWindow paramPopupWindow, View paramView, int paramInt1, int paramInt2, int paramInt3)
{
paramPopupWindow.showAsDropDown(paramView, paramInt1, paramInt2, paramInt3);
}
}
/* Location:
* Qualified Name: android.support.v4.widget.t
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
08fbb4db847344a850bb92b95beab60e922996e3 | 445615a3d5778cea29d8b049a8f65dc8854de89f | /DiceGame.java | 9c9c401492d3ef97fcfa15969dcad4552074b6df | [] | no_license | kairstenfay/yahtzee | a4331d7b0f08eb6f1356c862eb32b7dfcc998be1 | 0ff5419902448fb5cc4da2d4e3e579d382cfcdf1 | refs/heads/master | 2020-03-25T22:14:42.627215 | 2018-08-09T23:13:58 | 2018-08-09T23:13:58 | 144,212,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,052 | java | import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
// Allows the client to play a game with five 8-sided dice. Provides methods
// for:
// - scoring a given dice roll using a given scoring category (score())
// - suggesting scoring categories that provide the highest scores given a
// dice roll (suggestedCategories())
//
// Note that the indices of the static arrays are important because they are
// used in the construction of the scoring category objects. The categories
// stored in the arrays all have distinct patterns in their scoring logic.
// The major types of patterns are "SumOfX", "XOfAKind", and "Sraight".
// The other three categories are treated as special cases and are considered
// "miscellaneous".
public class DiceGame {
private static final String[] SUM_OF_X = new String[]{"Ones", "Twos", "Threes", "Fours",
"Fives", "Sixes", "Sevens", "Eights"};
private static final String[] X_OF_A_KIND = new String[]{"ThreeOfAKind", "FourOfAKind",
"AllOfAKind"};
private static final String[] STRAIGHT = new String[]{"SmallStraight", "LargeStraight"};
private static final String CHANCE = "Chance";
private static final String FULL_HOUSE = "FullHouse";
private static final String NONE_OF_A_KIND = "NoneOfAKind";
private Map<String, Category> categories; // stores the category and its related object
// Stores the names of the various scoring categories along with their
// object instantiations for future access.
public DiceGame() {
List<String> scoringCategories = new ArrayList<String>();
scoringCategories.addAll(Arrays.asList(SUM_OF_X));
scoringCategories.addAll(Arrays.asList(STRAIGHT));
scoringCategories.addAll(Arrays.asList(X_OF_A_KIND));
scoringCategories.add(CHANCE);
scoringCategories.add(FULL_HOUSE);
scoringCategories.add(NONE_OF_A_KIND);
categories = new HashMap<String, Category>();
for (String category : scoringCategories) {
categories.put(category, getCategory(category));
}
}
// With the given category, returns a new object of type Category that will
// be used for scoring a dice game. This method is index-aware for the
// scoring patterns (other than the "miscellaneous" categories).
// If the given category does not match a category in the set of allowed
// categories, then the method defaults to "Chance".
private Category getCategory(String category) {
// The "SumOfX" scoring pattern takes an index in the constructor that
// converts to the die face important in calculating a score.
for (int i = 0; i < SUM_OF_X.length; i++) {
if(SUM_OF_X[i].equals(category)) {
return new SumOfX(i + 1);
}
}
// The "XOfAKind" scoring pattern takes an index in the constructor that
// converts to the minimum frequency required of any one die face in
// calculating a score.
for (int i = 0; i < X_OF_A_KIND.length; i++) {
if(X_OF_A_KIND[i].equals(category)) {
return new XOfAKind(i + 3);
}
}
// The "Straight" scoring pattern takes an index in the constructor that
// converts to the minimum number of sequential (consecutive) dice in
// calculating a score.
for (int i = 0; i < STRAIGHT.length; i++) {
if (STRAIGHT[i].equals(category)) {
return new Straight(i + 4);
}
}
// The miscellaneous categories do not take parameters in their
// constructor and have their own, deterministic scoring methods.
if ("FullHouse".equals(category)) {
return new FullHouse();
} else if ("NoneOfAKind".equals(category)) {
return new NoneOfAKind();
} else {
return new Chance();
}
}
// Returns the score of a given dice roll according to the scoring rules and
// conditions relating to the given category.
public int score(String category, int[] roll) {
return categories.get(category).score(roll);
}
// Returns an array of suggested scoring categories that would result in the
// highest score, given a dice roll.
public String[] suggestedCategories(int[] roll) {
int maxScore = 0;
List<String> suggestedCategories = new ArrayList<String>();
for (String category : categories.keySet()) {
int score = categories.get(category).score(roll);
if (score == maxScore) {
suggestedCategories.add(category);
} else if (score > maxScore) { // empty list and start fresh
suggestedCategories.clear();
maxScore = score;
suggestedCategories.add(category);
}
}
return suggestedCategories.toArray(new String[suggestedCategories.size()]);
}
} | [
"kairsten.fay@gmail.com"
] | kairsten.fay@gmail.com |
16aa97a36eb00c0fc14ce0418f351317d2a55502 | 95b93c921adf5c09793c41a7f0104374201212ab | /ws-Client/src/main/java/demo/spring/service_large/SayHi26Response.java | e77ed2ba9b9bc7409e1779f0265ba668a39deac2 | [] | no_license | yhjhoo/WS-CXF-AuthTest | d6ad62bdf95af7f4832f16ffa242785fc0a93eb8 | ded10abaefdc2e8b3b32becdc6f5781471acf27f | refs/heads/master | 2020-06-15T02:21:42.204025 | 2015-04-08T00:05:02 | 2015-04-08T00:05:02 | 33,409,007 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,431 | java |
package demo.spring.service_large;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for sayHi26Response complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="sayHi26Response">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "sayHi26Response", propOrder = {
"_return"
})
public class SayHi26Response {
@XmlElement(name = "return")
protected String _return;
/**
* Gets the value of the return property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getReturn() {
return _return;
}
/**
* Sets the value of the return property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setReturn(String value) {
this._return = value;
}
}
| [
"yhjhoo@163.com"
] | yhjhoo@163.com |
b216948c32e48f9863c6370a2ac59171d3a85fdf | 8b2cea97c681b073b6a48a4baaf24e64a7bdbb89 | /app/src/main/java/com/shady/moviesdirectory/Model/Movie.java | 9f4d54e6d0db0e5832f6435f96597b0c269672e2 | [] | no_license | imshahidmahmood/MoviesDirectory | d5a5842e0f7d1220b5dfa02615d5feec945e1f58 | da295f8e8d6e0bd82cff406f6ba5a25d24ea0d81 | refs/heads/master | 2022-05-21T10:02:01.642459 | 2020-04-24T20:04:33 | 2020-04-24T20:04:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,182 | java | package com.shady.moviesdirectory.Model;
import java.io.Serializable;
public class Movie implements Serializable{
private static final long id = 1L;
private String title;
private String director;
private String year;
private String runTime;
private String imdbId;
private String poster;
private String genre;
private String writer;
private String actors;
private String plot;
private String rating;
private String dvdRelease;
private String productionCompany;
private String country;
private String awards;
private String tvRated;
private String movieType;
public Movie() {
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDirector() {
return director;
}
public void setDirector(String director) {
this.director = director;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getRunTime() {
return runTime;
}
public void setRunTime(String runTime) {
this.runTime = runTime;
}
public String getImdbId() {
return imdbId;
}
public void setImdbId(String imdbId) {
this.imdbId = imdbId;
}
public String getPoster() {
return poster;
}
public void setPoster(String poster) {
this.poster = poster;
}
public String getGenre() {
return genre;
}
public void setGenre(String genre) {
this.genre = genre;
}
public String getWriter() {
return writer;
}
public void setWriter(String writer) {
this.writer = writer;
}
public String getActors() {
return actors;
}
public void setActors(String actors) {
this.actors = actors;
}
public String getPlot() {
return plot;
}
public void setPlot(String plot) {
this.plot = plot;
}
public String getRating() {
return rating;
}
public void setRating(String rating) {
this.rating = rating;
}
public String getDvdRelease() {
return dvdRelease;
}
public void setDvdRelease(String dvdRelease) {
this.dvdRelease = dvdRelease;
}
public String getProductionCompany() {
return productionCompany;
}
public void setProductionCompany(String productionCompany) {
this.productionCompany = productionCompany;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getAwards() {
return awards;
}
public void setAwards(String awards) {
this.awards = awards;
}
public String getTvRated() {
return tvRated;
}
public void setTvRated(String tvRated) {
this.tvRated = tvRated;
}
public String getMovieType() {
return movieType;
}
public void setMovieType(String movieType) {
this.movieType = movieType;
}
}
| [
"shahidmahmood.yar@gmail.com"
] | shahidmahmood.yar@gmail.com |
b47f545cd56e395e945ba0f72bbc1d92d4410e65 | 5808048e42d442297c9e328f16e5e3388be1424b | /src/BonusExercises/Dyno.java | 038ba582bd9156d42787c1408051787342bd9361 | [
"MIT"
] | permissive | azurite/AuD-Practice | 3f596eb16bc27c77b48cc8c7a15163aa7b3c564b | 84ca09e2e4f87daf4e4326ff2597570be9ae60ed | refs/heads/master | 2022-02-18T05:57:47.211223 | 2018-02-07T14:15:49 | 2018-02-07T14:15:49 | 117,349,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,713 | java | package BonusExercises;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class Dyno {
private static int indexOf(int[] arr, int elem) {
int lo = 0, hi = arr.length - 1;
while(lo <= hi) {
int mid = lo + (hi - lo) / 2;
if(arr[mid] > elem) {
hi = mid - 1;
}
else if(arr[mid] < elem) {
lo = mid + 1;
}
else {
return mid;
}
}
return -1;
}
private static boolean has(int[] arr, int elem) {
return indexOf(arr, elem) != - 1;
}
public static int solve(final int L, final int D, final int C, final int[] cacti) {
int[] DP = new int[L];
for(int i = 1; i < L; i++) {
if((DP[i - 1] == i - 1 || (i >= D && DP[i - D] == i - D)) && !has(cacti, i)) {
DP[i] = i;
}
else {
DP[i] = DP[i - 1];
}
}
return DP[L - 1];
}
public static void read_and_solve(InputStream in, PrintStream out) {
Scanner scanner = new Scanner(in);
int ntestcases = scanner.nextInt();
for(int testno=0; testno<ntestcases; testno++)
{
int L = scanner.nextInt();
int D = scanner.nextInt();
int C = scanner.nextInt();
int[] cacti = new int[C];
for(int j=0; j<C; j++)
cacti[j] = scanner.nextInt();
out.println(solve(L, D, C, cacti));
}
scanner.close();
}
public static void main(String[] args) {
read_and_solve(System.in, System.out);
}
}
| [
"darkblue.azurite@gmail.com"
] | darkblue.azurite@gmail.com |
47c67b0f0dd35ba99e7bebd6ccccf7323f6db922 | 285691cba03e9a452405c01fc9d29ed8e7181ae4 | /src/test/java/com/mycompany/api/ebankingPortal/configuration/CucumberSpringContextConfiguration.java | 8473af65878980247dbde38750aba1221b3fc3d9 | [] | no_license | goeld/ebankingPortal | e8a8bfb9782908d405f01a8c071523a7a4c08044 | 29cd39351fd1795ee67f8fa91223b58438511fe1 | refs/heads/main | 2023-06-07T19:52:10.976002 | 2021-07-01T10:05:18 | 2021-07-01T10:05:18 | 374,670,303 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 440 | java | package com.mycompany.api.ebankingPortal.configuration;
import io.cucumber.spring.CucumberContextConfiguration;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
@CucumberContextConfiguration
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
public class CucumberSpringContextConfiguration {
} | [
"admin@Admins-MacBook-Pro.local"
] | admin@Admins-MacBook-Pro.local |
c4c157b8b9759f9bacb02f15bb568e2b91b61b32 | 166b8320b94dcf5932062b8ac4f90dc353767d39 | /cdi/extension/src/main/java/org/infinispan/cdi/util/annotatedtypebuilder/AnnotatedMethodImpl.java | 91063e6d441a7ef45b0134ebad3ea23085c1ea7e | [
"Apache-2.0"
] | permissive | Cotton-Ben/infinispan | 87e0caeeba2616dd7eb5a96b896b462ed9de5d67 | 2ba2d9992cd0018829d9ba0b0d4ba74bab49616b | refs/heads/master | 2020-12-31T02:22:26.654774 | 2014-07-11T16:48:15 | 2014-07-11T16:48:15 | 16,557,570 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 781 | java | package org.infinispan.cdi.util.annotatedtypebuilder;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Map;
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.AnnotatedType;
/**
* @author Stuart Douglas
*/
class AnnotatedMethodImpl<X> extends AnnotatedCallableImpl<X, Method> implements AnnotatedMethod<X> {
AnnotatedMethodImpl(AnnotatedType<X> type, Method method, AnnotationStore annotations, Map<Integer, AnnotationStore> parameterAnnotations, Map<Integer, Type> parameterTypeOverrides) {
super(type, method, method.getReturnType(), method.getParameterTypes(), method.getGenericParameterTypes(), annotations, parameterAnnotations, method.getGenericReturnType(), parameterTypeOverrides);
}
}
| [
"galder@zamarreno.com"
] | galder@zamarreno.com |
bff08432277985d382701cc92c1cf07aae2efed2 | f147d865c669debbcfc2bb3289040939ecb9ba20 | /MiddleWare/src/main/java/com/foxleezh/middleware/mvvm/BaseModel.java | 75ddb955bc646ad7ebfcf0d0683b4b34b15fa340 | [] | no_license | foxleezh/BlogApp | 9e8215e18a68f0bec75339c407dc5af85534f5a1 | 949de1f08bc655e72344c7414349f053ea336ae0 | refs/heads/master | 2021-07-05T06:22:20.611663 | 2017-09-24T16:08:41 | 2017-09-24T16:08:41 | 103,729,813 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package com.foxleezh.middleware.mvvm;
import android.os.Parcel;
import android.os.Parcelable;
/**
* Created by foxleezh on 2017/9/24.
* 本类介绍 基类Model,作为MVVM中M的父类
*/
public class BaseModel implements Parcelable {
protected BaseModel(Parcel in) {
}
protected BaseModel() {
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
}
}
| [
"foxleezh@gmail.com"
] | foxleezh@gmail.com |
6caf86a3e715dcfa5910eaf304a7a386494669d8 | 503400de066a94a7d755a7668edb877ab03c41f9 | /src/lesson16/networking/WebSiteReader2.java | f1d4f981ba2387ec5a049adc340bbaef642acd4e | [] | no_license | temo1993/YakovFain | 4e45572f45b18ac2c14751aa657bd935cdb6f3df | 3526230338c2288b8a56851a4f6138213e8462f7 | refs/heads/master | 2021-01-10T02:58:10.426734 | 2016-02-23T08:41:26 | 2016-02-23T08:41:26 | 51,118,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,245 | java | package lesson16.networking;
import java.net.*;
import java.io.*;
public class WebSiteReader2 {
public static void main(String args[]){
String nextLine;
URL url = null;
URLConnection urlConn = null;
InputStreamReader inStream = null;
BufferedReader buff = null;
try{
// index.html is a default URL's file name
url = new URL("http://finance.yahoo.com/q?s=MOT" );
urlConn = url.openConnection();
inStream = new InputStreamReader(
urlConn.getInputStream());
buff = new BufferedReader(inStream);
// Read the entire trading information about Motorolla
// into a String variable
String theWholePage=null;
String currentLine;
while ((currentLine=buff.readLine()) !=null){
theWholePage+=currentLine;
}
System.out.println(theWholePage);
} catch(MalformedURLException e){
System.out.println("Please check the URL:" +
e.toString() );
} catch(IOException e1){
System.out.println("Can't read from the Internet: "+
e1.toString() );
}
}
}
| [
"temo.kiknavelidze@gmail.com"
] | temo.kiknavelidze@gmail.com |
43ad88811f703813accb8aaad0c9af8046957e8c | 8fccdb027e3268313974a1871738d12f9b4a4f04 | /demo02/src/main/java/com/kgc/zjh/pojo/StandardExample.java | 7d13f3dec4f929a7b6a1fcb474467cb67db12bc9 | [
"Apache-2.0"
] | permissive | GL525/GitHub077-StuSystem | 59422b829361c81d6ebc62f2fb5dc3dbad60b674 | c8f3fc902b690727711fa805f4297f330c26e40e | refs/heads/main | 2022-12-30T12:48:57.723662 | 2020-10-12T13:00:22 | 2020-10-12T13:00:22 | 302,935,031 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,509 | java | package com.kgc.zjh.pojo;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class StandardExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StandardExample() {
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));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
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 andStdNumIsNull() {
addCriterion("std_num is null");
return (Criteria) this;
}
public Criteria andStdNumIsNotNull() {
addCriterion("std_num is not null");
return (Criteria) this;
}
public Criteria andStdNumEqualTo(String value) {
addCriterion("std_num =", value, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumNotEqualTo(String value) {
addCriterion("std_num <>", value, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumGreaterThan(String value) {
addCriterion("std_num >", value, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumGreaterThanOrEqualTo(String value) {
addCriterion("std_num >=", value, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumLessThan(String value) {
addCriterion("std_num <", value, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumLessThanOrEqualTo(String value) {
addCriterion("std_num <=", value, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumLike(String value) {
addCriterion("std_num like", value, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumNotLike(String value) {
addCriterion("std_num not like", value, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumIn(List<String> values) {
addCriterion("std_num in", values, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumNotIn(List<String> values) {
addCriterion("std_num not in", values, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumBetween(String value1, String value2) {
addCriterion("std_num between", value1, value2, "stdNum");
return (Criteria) this;
}
public Criteria andStdNumNotBetween(String value1, String value2) {
addCriterion("std_num not between", value1, value2, "stdNum");
return (Criteria) this;
}
public Criteria andZhnameIsNull() {
addCriterion("zhname is null");
return (Criteria) this;
}
public Criteria andZhnameIsNotNull() {
addCriterion("zhname is not null");
return (Criteria) this;
}
public Criteria andZhnameEqualTo(String value) {
addCriterion("zhname =", value, "zhname");
return (Criteria) this;
}
public Criteria andZhnameNotEqualTo(String value) {
addCriterion("zhname <>", value, "zhname");
return (Criteria) this;
}
public Criteria andZhnameGreaterThan(String value) {
addCriterion("zhname >", value, "zhname");
return (Criteria) this;
}
public Criteria andZhnameGreaterThanOrEqualTo(String value) {
addCriterion("zhname >=", value, "zhname");
return (Criteria) this;
}
public Criteria andZhnameLessThan(String value) {
addCriterion("zhname <", value, "zhname");
return (Criteria) this;
}
public Criteria andZhnameLessThanOrEqualTo(String value) {
addCriterion("zhname <=", value, "zhname");
return (Criteria) this;
}
public Criteria andZhnameLike(String value) {
addCriterion("zhname like", value, "zhname");
return (Criteria) this;
}
public Criteria andZhnameNotLike(String value) {
addCriterion("zhname not like", value, "zhname");
return (Criteria) this;
}
public Criteria andZhnameIn(List<String> values) {
addCriterion("zhname in", values, "zhname");
return (Criteria) this;
}
public Criteria andZhnameNotIn(List<String> values) {
addCriterion("zhname not in", values, "zhname");
return (Criteria) this;
}
public Criteria andZhnameBetween(String value1, String value2) {
addCriterion("zhname between", value1, value2, "zhname");
return (Criteria) this;
}
public Criteria andZhnameNotBetween(String value1, String value2) {
addCriterion("zhname not between", value1, value2, "zhname");
return (Criteria) this;
}
public Criteria andVersionIsNull() {
addCriterion("version is null");
return (Criteria) this;
}
public Criteria andVersionIsNotNull() {
addCriterion("version is not null");
return (Criteria) this;
}
public Criteria andVersionEqualTo(String value) {
addCriterion("version =", value, "version");
return (Criteria) this;
}
public Criteria andVersionNotEqualTo(String value) {
addCriterion("version <>", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThan(String value) {
addCriterion("version >", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThanOrEqualTo(String value) {
addCriterion("version >=", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThan(String value) {
addCriterion("version <", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThanOrEqualTo(String value) {
addCriterion("version <=", value, "version");
return (Criteria) this;
}
public Criteria andVersionLike(String value) {
addCriterion("version like", value, "version");
return (Criteria) this;
}
public Criteria andVersionNotLike(String value) {
addCriterion("version not like", value, "version");
return (Criteria) this;
}
public Criteria andVersionIn(List<String> values) {
addCriterion("version in", values, "version");
return (Criteria) this;
}
public Criteria andVersionNotIn(List<String> values) {
addCriterion("version not in", values, "version");
return (Criteria) this;
}
public Criteria andVersionBetween(String value1, String value2) {
addCriterion("version between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andVersionNotBetween(String value1, String value2) {
addCriterion("version not between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andKeyssIsNull() {
addCriterion("keyss is null");
return (Criteria) this;
}
public Criteria andKeyssIsNotNull() {
addCriterion("keyss is not null");
return (Criteria) this;
}
public Criteria andKeyssEqualTo(String value) {
addCriterion("keyss =", value, "keyss");
return (Criteria) this;
}
public Criteria andKeyssNotEqualTo(String value) {
addCriterion("keyss <>", value, "keyss");
return (Criteria) this;
}
public Criteria andKeyssGreaterThan(String value) {
addCriterion("keyss >", value, "keyss");
return (Criteria) this;
}
public Criteria andKeyssGreaterThanOrEqualTo(String value) {
addCriterion("keyss >=", value, "keyss");
return (Criteria) this;
}
public Criteria andKeyssLessThan(String value) {
addCriterion("keyss <", value, "keyss");
return (Criteria) this;
}
public Criteria andKeyssLessThanOrEqualTo(String value) {
addCriterion("keyss <=", value, "keyss");
return (Criteria) this;
}
public Criteria andKeyssLike(String value) {
addCriterion("keyss like", value, "keyss");
return (Criteria) this;
}
public Criteria andKeyssNotLike(String value) {
addCriterion("keyss not like", value, "keyss");
return (Criteria) this;
}
public Criteria andKeyssIn(List<String> values) {
addCriterion("keyss in", values, "keyss");
return (Criteria) this;
}
public Criteria andKeyssNotIn(List<String> values) {
addCriterion("keyss not in", values, "keyss");
return (Criteria) this;
}
public Criteria andKeyssBetween(String value1, String value2) {
addCriterion("keyss between", value1, value2, "keyss");
return (Criteria) this;
}
public Criteria andKeyssNotBetween(String value1, String value2) {
addCriterion("keyss not between", value1, value2, "keyss");
return (Criteria) this;
}
public Criteria andReleaseDateIsNull() {
addCriterion("release_date is null");
return (Criteria) this;
}
public Criteria andReleaseDateIsNotNull() {
addCriterion("release_date is not null");
return (Criteria) this;
}
public Criteria andReleaseDateEqualTo(Date value) {
addCriterionForJDBCDate("release_date =", value, "releaseDate");
return (Criteria) this;
}
public Criteria andReleaseDateNotEqualTo(Date value) {
addCriterionForJDBCDate("release_date <>", value, "releaseDate");
return (Criteria) this;
}
public Criteria andReleaseDateGreaterThan(Date value) {
addCriterionForJDBCDate("release_date >", value, "releaseDate");
return (Criteria) this;
}
public Criteria andReleaseDateGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("release_date >=", value, "releaseDate");
return (Criteria) this;
}
public Criteria andReleaseDateLessThan(Date value) {
addCriterionForJDBCDate("release_date <", value, "releaseDate");
return (Criteria) this;
}
public Criteria andReleaseDateLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("release_date <=", value, "releaseDate");
return (Criteria) this;
}
public Criteria andReleaseDateIn(List<Date> values) {
addCriterionForJDBCDate("release_date in", values, "releaseDate");
return (Criteria) this;
}
public Criteria andReleaseDateNotIn(List<Date> values) {
addCriterionForJDBCDate("release_date not in", values, "releaseDate");
return (Criteria) this;
}
public Criteria andReleaseDateBetween(Date value1, Date value2) {
addCriterionForJDBCDate("release_date between", value1, value2, "releaseDate");
return (Criteria) this;
}
public Criteria andReleaseDateNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("release_date not between", value1, value2, "releaseDate");
return (Criteria) this;
}
public Criteria andImplDateIsNull() {
addCriterion("impl_date is null");
return (Criteria) this;
}
public Criteria andImplDateIsNotNull() {
addCriterion("impl_date is not null");
return (Criteria) this;
}
public Criteria andImplDateEqualTo(Date value) {
addCriterionForJDBCDate("impl_date =", value, "implDate");
return (Criteria) this;
}
public Criteria andImplDateNotEqualTo(Date value) {
addCriterionForJDBCDate("impl_date <>", value, "implDate");
return (Criteria) this;
}
public Criteria andImplDateGreaterThan(Date value) {
addCriterionForJDBCDate("impl_date >", value, "implDate");
return (Criteria) this;
}
public Criteria andImplDateGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("impl_date >=", value, "implDate");
return (Criteria) this;
}
public Criteria andImplDateLessThan(Date value) {
addCriterionForJDBCDate("impl_date <", value, "implDate");
return (Criteria) this;
}
public Criteria andImplDateLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("impl_date <=", value, "implDate");
return (Criteria) this;
}
public Criteria andImplDateIn(List<Date> values) {
addCriterionForJDBCDate("impl_date in", values, "implDate");
return (Criteria) this;
}
public Criteria andImplDateNotIn(List<Date> values) {
addCriterionForJDBCDate("impl_date not in", values, "implDate");
return (Criteria) this;
}
public Criteria andImplDateBetween(Date value1, Date value2) {
addCriterionForJDBCDate("impl_date between", value1, value2, "implDate");
return (Criteria) this;
}
public Criteria andImplDateNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("impl_date not between", value1, value2, "implDate");
return (Criteria) this;
}
public Criteria andPackagePathIsNull() {
addCriterion("package_path is null");
return (Criteria) this;
}
public Criteria andPackagePathIsNotNull() {
addCriterion("package_path is not null");
return (Criteria) this;
}
public Criteria andPackagePathEqualTo(String value) {
addCriterion("package_path =", value, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathNotEqualTo(String value) {
addCriterion("package_path <>", value, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathGreaterThan(String value) {
addCriterion("package_path >", value, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathGreaterThanOrEqualTo(String value) {
addCriterion("package_path >=", value, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathLessThan(String value) {
addCriterion("package_path <", value, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathLessThanOrEqualTo(String value) {
addCriterion("package_path <=", value, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathLike(String value) {
addCriterion("package_path like", value, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathNotLike(String value) {
addCriterion("package_path not like", value, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathIn(List<String> values) {
addCriterion("package_path in", values, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathNotIn(List<String> values) {
addCriterion("package_path not in", values, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathBetween(String value1, String value2) {
addCriterion("package_path between", value1, value2, "packagePath");
return (Criteria) this;
}
public Criteria andPackagePathNotBetween(String value1, String value2) {
addCriterion("package_path not between", value1, value2, "packagePath");
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);
}
}
} | [
"1836418597@qq.com"
] | 1836418597@qq.com |
0693812afa5abcfbea89468807f9743d2e97241d | f77b350dba464b591dc1c193d9378ba912e1d986 | /app/src/main/java/com/groobak/customer/utils/SettingPreference.java | 1da79c59df0dd507a513b39e3eee0241c53a1ba0 | [] | no_license | insoft-developers/groobak_customer | 61b2f9d0440172a1bf9820006f5a450d1a7f19ea | 199f833bbab016b82f9e9f30e2c62c939b083102 | refs/heads/master | 2023-06-17T20:13:16.904662 | 2021-07-16T13:30:21 | 2021-07-16T13:30:21 | 362,054,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,372 | java | package com.groobak.customer.utils;
import android.content.Context;
import android.content.SharedPreferences;
import com.groobak.customer.constants.Constants;
import com.groobak.customer.json.MobilePulsaHealthBPJSResponseModel;
import com.groobak.customer.models.TopUpPlnHistoryModel;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
public class SettingPreference {
private static String CURRENCY = "Rp";
private static String ABOUTUS = "ABOUTUS";
private static String EMAIL = "EMAIL";
private static String PHONE = "PHONE";
private static String WEBSITE = "WEBSITE";
private static String MPSTATUS = "MPSTATUS";
private static String MPACTIVE = "MPACTIVE";
private static String MOBILEPULSAUSERNAME = "MOBILEPULSAUSERNAME";
private static String MOBILEPULSAAPIKEY = "MOBILEPULSAAPIKEY";
private static String CURRENCYTEXT = "CURRENCYTEXT";
private static String PLN_LIST_PAID_SUCCESS ="SUCCESSPAIDLIST";
private static String BPJS_LIST_PAID_SUCCESS = "SUCCESSBPJS";
private static String HARGAPULSA = "HARGAPULSA";
private SharedPreferences pref;
private SharedPreferences.Editor editor;
public SettingPreference(Context context) {
pref = context.getSharedPreferences(Constants.PREF_NAME, Context.MODE_PRIVATE);
}
public void updateCurrency(String string) {
editor = pref.edit();
editor.putString(CURRENCY, string);
editor.commit();
}
public void updateabout(String string) {
editor = pref.edit();
editor.putString(ABOUTUS, string);
editor.commit();
}
public void updateemail(String string) {
editor = pref.edit();
editor.putString(EMAIL, string);
editor.commit();
}
public void updatephone(String string) {
editor = pref.edit();
editor.putString(PHONE, string);
editor.commit();
}
public void updateweb(String string) {
editor = pref.edit();
editor.putString(WEBSITE, string);
editor.commit();
}
public void updatempstatus(String string) {
editor = pref.edit();
editor.putString(MPSTATUS, string);
editor.commit();
}
public void updatempactive(String string) {
editor = pref.edit();
editor.putString(MPACTIVE, string);
editor.commit();
}
public void updateMobilepulsausername(String string) {
editor = pref.edit();
editor.putString(MOBILEPULSAUSERNAME, string);
editor.apply();
}
public void updateMobilepulsaapikey(String string) {
editor = pref.edit();
editor.putString(MOBILEPULSAAPIKEY, string);
editor.apply();
}
public void updatecurrencytext(String string) {
editor = pref.edit();
editor.putString(CURRENCYTEXT, string);
editor.commit();
}
public void updatehargapulsa(String value) {
editor = pref.edit();
editor.putString(HARGAPULSA, value);
editor.apply();
}
public void updatePlnList(TopUpPlnHistoryModel model) {
editor = pref.edit();
List<TopUpPlnHistoryModel> listModel = new ArrayList<>();
String previousStringModel = pref.getString(PLN_LIST_PAID_SUCCESS,"");
if (previousStringModel != null && !previousStringModel.isEmpty()) {
Type listOfMyClassObject = new TypeToken<ArrayList<TopUpPlnHistoryModel>>() {}.getType();
listModel.addAll(new Gson().fromJson(previousStringModel, listOfMyClassObject));
}
listModel.add(0,model);
editor.putString(PLN_LIST_PAID_SUCCESS, new Gson().toJson(listModel));
editor.apply();
}
public void updateBPJSList(MobilePulsaHealthBPJSResponseModel model) {
editor = pref.edit();
List<MobilePulsaHealthBPJSResponseModel> listModel = new ArrayList<>();
String previousStringModel = pref.getString(BPJS_LIST_PAID_SUCCESS,"");
if (!previousStringModel.isEmpty()) {
Type listOfMyClassObject = new TypeToken<ArrayList<MobilePulsaHealthBPJSResponseModel>>() {}.getType();
listModel.addAll(new Gson().fromJson(previousStringModel, listOfMyClassObject));
}
listModel.add(0,model);
String s = new Gson().toJson(listModel);
editor.putString(BPJS_LIST_PAID_SUCCESS, new Gson().toJson(listModel));
editor.apply();
}
public String[] getSetting() {
String[] settingan = new String[15];
settingan[0] = pref.getString(CURRENCY, "$");
settingan[1] = pref.getString(ABOUTUS, "");
settingan[2] = pref.getString(EMAIL, "");
settingan[3] = pref.getString(PHONE, "");
settingan[4] = pref.getString(WEBSITE, "");
settingan[5] = pref.getString(MPSTATUS, "1");
settingan[6] = pref.getString(MPACTIVE, "0");
settingan[7] = pref.getString(MOBILEPULSAUSERNAME, "123");
settingan[8] = pref.getString(MOBILEPULSAAPIKEY, "123");
settingan[9] = pref.getString(CURRENCYTEXT, "USD");
settingan[10] = pref.getString(PLN_LIST_PAID_SUCCESS, "");
settingan[11] = pref.getString(BPJS_LIST_PAID_SUCCESS, "");
settingan[12] = pref.getString(HARGAPULSA, "");
return settingan;
}
} | [
"irdn.software@gmail.com"
] | irdn.software@gmail.com |
02f0a2b34d4893c54a7473f97994ff3d8d9ed5c7 | 79a5f92571fa60b509bf174d44496ea8f45bca28 | /src/main/java/com/pqpo/utils/redis/datasource/RedisOperations.java | 2d60c0cc20debc6dc19f18f101b912e2d85f85f8 | [] | no_license | pqpo/utils.redis | ad28dc7f7c8730f2560044225ba363908712d7aa | 3a8f40cd87aa6de958a3b6792ca46f5657f82180 | refs/heads/master | 2021-01-10T04:39:57.170085 | 2015-12-23T02:01:01 | 2015-12-23T02:01:01 | 45,235,905 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 316 | java | package com.pqpo.utils.redis.datasource;
public interface RedisOperations<K, V> {
public void set(K key,V value);
public V get(K key);
public boolean setnx(K key,V value);
public long incr(K key,long step);
public long derc(K key,long step);
public long del(K keys);
public void disconnect();
}
| [
"linmin.qiu@sihuatech.com"
] | linmin.qiu@sihuatech.com |
c8833df74c36b707d6515b4719fce5c889cc5a2d | 219a4c259c8fdafa25ddb93d872525c47f7206cd | /app/src/main/java/com/example/dependencyinjection/AnimalManager.java | 5d0771bb6bfbea117038c378111d22467db6d478 | [] | no_license | biplane1989/DependencyInjection | aaf13551b04c14962189aa6ae7036e7a75d385b7 | ef85efbf3062fe1d93466efc28d5e3e78415ae25 | refs/heads/master | 2022-07-14T22:51:33.152357 | 2020-05-12T15:53:36 | 2020-05-12T15:53:36 | 263,382,732 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 301 | java | package com.example.dependencyinjection;
import android.util.Log;
public class AnimalManager implements Manager {
Animal animal;
public AnimalManager(Animal animal) {
this.animal = animal;
}
@Override
public String AnimalSong() {
return animal.song();
}
}
| [
"33828788+biplane1989@users.noreply.github.com"
] | 33828788+biplane1989@users.noreply.github.com |
dcb350409b9139ec811ae0b61a2b946ca498bf66 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/26/26_35149db31bcd4364b647ec61fecf26eb082c6da6/Cursor/26_35149db31bcd4364b647ec61fecf26eb082c6da6_Cursor_t.java | d7fbdff4200f3c966048c5e4a5554eb0ed971a13 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 12,598 | java | /**
* Copyright (c) 2009-2013, Lukas Eder, lukas.eder@gmail.com
* All rights reserved.
*
* This software is licensed to you under the Apache License, Version 2.0
* (the "License"); You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* . Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* . Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* . Neither the name "jOOQ" nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.jooq;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Iterator;
import java.util.List;
import org.jooq.conf.Settings;
import org.jooq.exception.DataAccessException;
import org.jooq.exception.MappingException;
/**
* Cursors allow for lazy, sequential access to an underlying JDBC
* {@link ResultSet}. Unlike {@link Result}, data can only be accessed
* sequentially, using an {@link Iterator}, or the cursor's {@link #hasNext()}
* and {@link #fetch()} methods.
* <p>
* Client code must close this {@link Cursor} in order to close the underlying
* {@link PreparedStatement} and {@link ResultSet}
* <p>
* Note: Unlike usual implementations of {@link Iterable}, a <code>Cursor</code>
* can only provide one {@link Iterator}!
*
* @param <R> The cursor's record type
* @author Lukas Eder
*/
public interface Cursor<R extends Record> extends Iterable<R> {
/**
* Get this cursor's fields as a {@link Row}.
*/
Row fieldsRow();
/**
* Get a specific field from this Cursor.
*
* @see Row#field(Field)
*/
<T> Field<T> field(Field<T> field);
/**
* Get a specific field from this Cursor.
*
* @see Row#field(String)
*/
Field<?> field(String name);
/**
* Get a specific field from this Cursor.
*
* @see Row#field(int)
*/
Field<?> field(int index);
/**
* Get all fields from this Cursor.
*
* @see Row#fields()
*/
Field<?>[] fields();
/**
* Check whether this cursor has a next record.
* <p>
* This will conveniently close the <code>Cursor</code>, after the last
* <code>Record</code> was fetched.
*
* @throws DataAccessException if something went wrong executing the query
*/
boolean hasNext() throws DataAccessException;
/**
* Fetch all remaining records as a result.
* <p>
* This will conveniently close the <code>Cursor</code>, after the last
* <code>Record</code> was fetched.
* <p>
* The result and its contained records are attached to the original
* {@link Configuration} by default. Use {@link Settings#isAttachRecords()}
* to override this behaviour.
*
* @throws DataAccessException if something went wrong executing the query
*/
Result<R> fetch() throws DataAccessException;
/**
* Fetch the next couple of records from the cursor.
* <p>
* This will conveniently close the <code>Cursor</code>, after the last
* <code>Record</code> was fetched.
* <p>
* The result and its contained records are attached to the original
* {@link Configuration} by default. Use {@link Settings#isAttachRecords()}
* to override this behaviour.
*
* @param number The number of records to fetch. If this is <code>0</code>
* or negative an empty list is returned, the cursor is
* untouched. If this is greater than the number of remaining
* records, then all remaining records are returned.
* @throws DataAccessException if something went wrong executing the query
*/
Result<R> fetch(int number) throws DataAccessException;
/**
* Fetch the next record from the cursor.
* <p>
* This will conveniently close the <code>Cursor</code>, after the last
* <code>Record</code> was fetched.
* <p>
* The resulting record is attached to the original {@link Configuration} by
* default. Use {@link Settings#isAttachRecords()} to override this
* behaviour.
*
* @return The next record from the cursor, or <code>null</code> if there is
* no next record.
* @throws DataAccessException if something went wrong executing the query
*/
R fetchOne() throws DataAccessException;
/**
* Fetch the next record into a custom handler callback.
* <p>
* This will conveniently close the <code>Cursor</code>, after the last
* <code>Record</code> was fetched.
* <p>
* The resulting record is attached to the original {@link Configuration} by
* default. Use {@link Settings#isAttachRecords()} to override this
* behaviour.
*
* @param handler The handler callback
* @return Convenience result, returning the parameter handler itself
* @throws DataAccessException if something went wrong executing the query
*/
<H extends RecordHandler<? super R>> H fetchOneInto(H handler) throws DataAccessException;
/**
* Fetch results into a custom handler callback.
* <p>
* The resulting records are attached to the original {@link Configuration}
* by default. Use {@link Settings#isAttachRecords()} to override this
* behaviour.
*
* @param handler The handler callback
* @return Convenience result, returning the parameter handler itself
* @throws DataAccessException if something went wrong executing the query
*/
<H extends RecordHandler<? super R>> H fetchInto(H handler) throws DataAccessException;
/**
* Fetch the next record into a custom mapper callback.
* <p>
* This will conveniently close the <code>Cursor</code>, after the last
* <code>Record</code> was fetched.
*
* @param mapper The mapper callback
* @return The custom mapped record
* @throws DataAccessException if something went wrong executing the query
*/
<E> E fetchOne(RecordMapper<? super R, E> mapper) throws DataAccessException;
/**
* Fetch results into a custom mapper callback.
*
* @param mapper The mapper callback
* @return The custom mapped records
* @throws DataAccessException if something went wrong executing the query
*/
<E> List<E> fetch(RecordMapper<? super R, E> mapper) throws DataAccessException;
/**
* Map the next resulting record onto a custom type.
* <p>
* This is the same as calling <code>fetchOne().into(type)</code>. See
* {@link Record#into(Class)} for more details
*
* @param <E> The generic entity type.
* @param type The entity type.
* @see Record#into(Class)
* @see Result#into(Class)
* @throws DataAccessException if something went wrong executing the query
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
*/
<E> E fetchOneInto(Class<? extends E> type) throws DataAccessException, MappingException;
/**
* Map resulting records onto a custom type.
* <p>
* This is the same as calling <code>fetch().into(type)</code>. See
* {@link Record#into(Class)} for more details
*
* @param <E> The generic entity type.
* @param type The entity type.
* @see Record#into(Class)
* @see Result#into(Class)
* @throws DataAccessException if something went wrong executing the query
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
*/
<E> List<E> fetchInto(Class<? extends E> type) throws DataAccessException, MappingException;
/**
* Map the next resulting record onto a custom record.
* <p>
* This is the same as calling <code>fetchOne().into(table)</code>. See
* {@link Record#into(Class)} for more details
* <p>
* The resulting record is attached to the original {@link Configuration} by
* default. Use {@link Settings#isAttachRecords()} to override this
* behaviour.
*
* @param <Z> The generic table record type.
* @param table The table type.
* @see Record#into(Class)
* @see Result#into(Class)
* @throws DataAccessException if something went wrong executing the query
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
*/
<Z extends Record> Z fetchOneInto(Table<Z> table) throws DataAccessException, MappingException;
/**
* Map resulting records onto a custom record.
* <p>
* This is the same as calling <code>fetch().into(table)</code>. See
* {@link Record#into(Class)} for more details
* <p>
* The result and its contained records are attached to the original
* {@link Configuration} by default. Use {@link Settings#isAttachRecords()}
* to override this behaviour.
*
* @param <Z> The generic table record type.
* @param table The table type.
* @see Record#into(Class)
* @see Result#into(Class)
* @throws DataAccessException if something went wrong executing the query
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
*/
<Z extends Record> Result<Z> fetchInto(Table<Z> table) throws DataAccessException, MappingException;
/**
* Explicitly close the underlying {@link PreparedStatement} and
* {@link ResultSet}.
* <p>
* If you fetch all records from the underlying {@link ResultSet}, jOOQ
* <code>Cursor</code> implementations will close themselves for you.
* Calling <code>close()</code> again will have no effect.
*
* @throws DataAccessException if something went wrong executing the query
*/
void close() throws DataAccessException;
/**
* Check whether this <code>Cursor</code> has been explicitly or
* "conveniently" closed.
* <p>
* Explicit closing can be achieved by calling {@link #close()} from client
* code. "Convenient" closing is done by any of the other methods, when the
* last record was fetched.
*/
boolean isClosed();
/**
* Get the <code>Cursor</code>'s underlying {@link ResultSet}.
* <p>
* If you modify the underlying <code>ResultSet</code>, the
* <code>Cursor</code> may be affected and in some cases, rendered unusable.
*
* @return The underlying <code>ResultSet</code>. May be <code>null</code>,
* for instance when the <code>Cursor</code> is closed.
*/
ResultSet resultSet();
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
05d2fddf5d98973d899350672129a2de6331f20a | 7dd8b7ecba67031df4f4ecdbc6939c893ec356a1 | /src/main/java/com/corporate/delivery/dao/OrderStatusDao.java | 494bd36b8d1d07fe3bde56e1b350e48d0238eb3b | [] | no_license | aceexpressdelivery/delivery-core | 014e330ecabbd0850a2dec24d9461448d41359b6 | 99e6c00865670b1121fe970ed87668581365af90 | refs/heads/master | 2020-03-26T22:38:42.371852 | 2018-10-31T09:17:21 | 2018-10-31T09:17:21 | 145,476,378 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 374 | java | package com.corporate.delivery.dao;
import java.util.List;
import com.corporate.delivery.model.order.OrderStatus;
public interface OrderStatusDao {
public List<OrderStatus> getOrderStatus(int userId);
public void insert(OrderStatus orderStatus) ;
public void updateOrderStatus(OrderStatus orderStatus);
public void deleteOrderStatus(OrderStatus orderStatus);
}
| [
"42557008+aceexpressdelivery@users.noreply.github.com"
] | 42557008+aceexpressdelivery@users.noreply.github.com |
43da7568710069bfb9d8177957ff0a618edc0efc | dafcf609f7d98e0dd698a64ef150657150394668 | /Assignment 5/src/test/java/com/gamebuilder/sprite/ActionButtonListnerTest.java | 6ccd7f82bba01c0fcca3acae17851e70c70b5925 | [] | no_license | PulkitMathur/Object-Oriented-Software-Development | ff620060ff846318b588a9fb5660401a485a5f15 | e32ea46ea05a32706b1e51b911de6039f04ec782 | refs/heads/master | 2021-08-23T01:00:52.298123 | 2017-12-02T01:29:30 | 2017-12-02T01:29:30 | 103,326,941 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | //package com.gamebuilder.sprite;
//public class ActionButtonListnerTest {
//}
package com.gamebuilder.sprite;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import static org.mockito.Mockito.*;
import com.gamebuilder.helpers.ActionButtonListener;
import com.gamebuilder.model.SpritePanelModel;
import com.gamebuilder.sprite.GameSprite;
public class ActionButtonListnerTest {
private ActionButtonListener actionButtonListner;
private SpritePanelModel spritePanelModel;
@Before
public void setUp(){
spritePanelModel = new SpritePanelModel();
actionButtonListner = mock(ActionButtonListener.class);
when(actionButtonListner.getSpritePanelModel()).thenReturn(spritePanelModel);
}
@Test
public void testAction(){
assertEquals(actionButtonListner.getSpritePanelModel(),spritePanelModel);
}
} | [
"mathurpulkit93@gmail.com"
] | mathurpulkit93@gmail.com |
6c8a3489b552c0dad6ff51713227771eadf8ecf0 | 8258dd82dece76adbffc1d3429ca63aebf1a2600 | /app/src/main/java/com/mac/runtu/javabean/PropertyCommiteInfo.java | 40b5e0c0e898188d66f1b2bdc140602a9c246fbe | [] | no_license | wuyue0829/Runtu-master02 | 155750550c601e05afe3c5a76140bb92df14fe77 | cc76dde1bf017d2649f5b51a7bf45afc2891df4e | refs/heads/master | 2020-04-11T06:44:44.682500 | 2018-12-13T05:51:04 | 2018-12-13T05:51:04 | 161,590,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,098 | java | package com.mac.runtu.javabean;
import java.io.Serializable;
/**
* Description: 产权流转信息发布
* Copyright : Copyright (c) 2016
* Company :
* Author : 牒倩楠
* Date : 2016/10/31 0031 下午 8:41
*/
public class PropertyCommiteInfo implements Serializable{
/*userUuid,kind(种类),title,content,contacts,phone,city,county,town,village
,area(亩),price(价格),years(年限),exchange(流转方式1为转让,2为转包,3为互换,4为入股,5为出租) uuid
(单独获得第uuid)*/
public String userUuid;
public String kind;
public String title;
public String content;
public String contacts;
public String phone;
public String publisher = "";
public String province ="";
public String city;
public String county = "";
public String town = "";
public String village = "";
public String uuid = "";
public String area;
public String price;
public String years;
public String exchange;
}
| [
"wuyue@wuyuedeiMac.local"
] | wuyue@wuyuedeiMac.local |
8e1e76f710eaa2bb1cf6a0fa55702653cb18036e | cc4655ae8846321314c1de5637df7ef6953c8523 | /src/main/java/com/viching/fastdfs/conn/ConnectionPoolConfig.java | 8e7ec1fef4ce925049169a1e00af29fd3373f81b | [] | no_license | viching/spring-boot-starter-fastdfs | f44e58613f8a98c14affdf9acf4615d0948ee433 | 24616bd0970ccff0ef1ef8d616fc7bbd36dd12ff | refs/heads/master | 2020-03-31T07:14:43.728406 | 2019-04-10T07:10:06 | 2019-04-10T07:10:06 | 152,014,009 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,252 | java | package com.viching.fastdfs.conn;
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
/**
* 连接池配置
*
* @author luhuiguo
*
*/
public class ConnectionPoolConfig extends GenericKeyedObjectPoolConfig {
/** 从池中借出的对象的最大数目 */
public static final int FDFS_MAX_TOTAL = 50;
/** 在空闲时检查有效性, 默认false */
public static final boolean FDFS_TEST_WHILE_IDLE = true;
/**
* 连接耗尽时是否阻塞(默认true)
* false报异常,ture阻塞直到超时
*/
public static final boolean FDFS_BLOCK_WHEN_EXHAUSTED = true;
/**
* 获取连接时的最大等待毫秒数(如果设置为阻塞时BlockWhenExhausted)
* 如果超时就抛异常,小于零:阻塞不确定的时间,默认-1
*/
public static final long FDFS_MAX_WAIT_MILLIS = 100;
public static final long FDFS_MIN_EVICTABLE_IDLETIME_MILLIS = 180000;
/**
* 逐出扫描的时间间隔(毫秒) 每过60秒进行一次后台对象清理的行动
* 如果为负数,则不运行逐出线程, 默认-1
*/
public static final long FDFS_TIME_BETWEEN_EVICTION_RUNS_MILLIS = 60000;
/**
* 每次逐出检查时 逐出的最大数目 如果为负数就是 : 1/abs(n), 默认3
* -1表示清理时检查所有线程
*/
public static final int FDFS_NUM_TESTS_PEREVICTION_RUN = -1;
public ConnectionPoolConfig() {
// 从池中借出的对象的最大数目
setMaxTotal(FDFS_MAX_TOTAL);
// 在空闲时检查有效性
setTestWhileIdle(FDFS_TEST_WHILE_IDLE);
// 连接耗尽时是否阻塞(默认true)
setBlockWhenExhausted(FDFS_BLOCK_WHEN_EXHAUSTED);
// 获取连接时的最大等待毫秒数100
setMaxWaitMillis(FDFS_MAX_WAIT_MILLIS);
// 视休眠时间超过了180秒的对象为过期
setMinEvictableIdleTimeMillis(FDFS_MIN_EVICTABLE_IDLETIME_MILLIS);
// 每过60秒进行一次后台对象清理的行动
setTimeBetweenEvictionRunsMillis(FDFS_TIME_BETWEEN_EVICTION_RUNS_MILLIS);
// 清理时候检查所有线程
setNumTestsPerEvictionRun(FDFS_NUM_TESTS_PEREVICTION_RUN);
setJmxEnabled(false);
}
} | [
"736306559@qq.com"
] | 736306559@qq.com |
b7cdaca23e8426568fce6db3244228da82f6e1b9 | 2a9c9885a528dcfeebf43fcf91f7623154ae0252 | /src/adminAnduserUI/CreateGUIAccountUserView.java | 150023b92a8fda31dfad600909e2648d623d7c90 | [] | no_license | wongkaho2626/PurchaseOrder | 5d676a5d99fda7379fc31a0be47550644bbb5d6c | 1f1f72828d6ed83b703ab7797dec4cf534b6a6ab | refs/heads/master | 2021-10-09T23:18:15.418725 | 2019-01-04T11:33:54 | 2019-01-04T11:33:54 | 106,903,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,571 | java | package adminAnduserUI;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import domain.IRBS;
import domain.MD5;
public class CreateGUIAccountUserView {
private String userID;
private String password;
private String currentPassword;
private JLabel accountLabel;
private JPasswordField currentPasswordField;
private JPasswordField passwordField1;
private JPasswordField passwordField2;
private JButton accountButton;
private JPanel errorPanel;
private JPanel accountPanel;
public CreateGUIAccountUserView(String userID){
this.userID = userID;
initUI();
}
private void initUI() {
setUP();
}
private void setUP() {
accountPanel = new JPanel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
// ************************* accountPanel UI SetUP
// *************************
// ========================= accountPanel Level One UI Create
// =========================
accountLabel = new JLabel("Change your password (User)");
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.ipadx = 200;
gbc.ipady = 30;
gbc.gridx = 0;
gbc.gridy = 0;
gbc.insets = new Insets(5, 5, 5, 5);
accountPanel.add(accountLabel, gbc);
accountLabel = new JLabel("Staff: ");
gbc.gridx = 0;
gbc.gridy = 1;
accountPanel.add(accountLabel, gbc);
accountLabel = new JLabel(userID);
gbc.gridx = 1;
gbc.gridy = 1;
accountPanel.add(accountLabel, gbc);
accountLabel = new JLabel("Current Password: ");
gbc.ipady = 10;
gbc.gridx = 0;
gbc.gridy = 2;
accountPanel.add(accountLabel, gbc);
currentPasswordField = new JPasswordField();
gbc.gridx = 1;
gbc.gridy = 2;
accountPanel.add(currentPasswordField, gbc);
accountLabel = new JLabel("New Password: ");
gbc.ipady = 10;
gbc.gridx = 0;
gbc.gridy = 3;
accountPanel.add(accountLabel, gbc);
passwordField1 = new JPasswordField();
gbc.gridx = 1;
gbc.gridy = 3;
accountPanel.add(passwordField1, gbc);
accountLabel = new JLabel("Reconfirm new Password: ");
gbc.gridx = 0;
gbc.gridy = 4;
accountPanel.add(accountLabel, gbc);
passwordField2 = new JPasswordField();
gbc.gridx = 1;
gbc.gridy = 4;
accountPanel.add(passwordField2, gbc);
accountLabel = new JLabel();
gbc.gridx = 0;
gbc.gridy = 5;
accountPanel.add(accountLabel, gbc);
accountButton = new JButton("Save");
gbc.gridx = 1;
gbc.gridy = 6;
accountPanel.add(accountButton, gbc);
//change account password
accountButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
password = passwordField1.getText();
currentPassword = currentPasswordField.getText();
if(passwordField1.getText().equals("") || passwordField2.getText().equals("")){
JOptionPane
.showMessageDialog(
errorPanel,
"Error: Password field cannot be null, Please try again.",
"Error", JOptionPane.ERROR_MESSAGE);
}else{
IRBS irbs = new IRBS();
MD5 md5 = new MD5();
try{
if(irbs.loginUser(userID, md5.getMD5(currentPassword))){
if(passwordField1.getText().equals(passwordField2.getText())){
irbs.setUserPasswordData(userID, md5.getMD5(password));
JOptionPane
.showMessageDialog(
null,
"Success change the password",
"Success", JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane
.showMessageDialog(
errorPanel,
"Error: New Password are not the same, Please try again.",
"Error", JOptionPane.ERROR_MESSAGE);
}
}else{
JOptionPane
.showMessageDialog(
errorPanel,
"Error: Current password is wrong, Please try again.",
"Error", JOptionPane.ERROR_MESSAGE);
}
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} finally {
try {
irbs.getCon().close();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
currentPasswordField.setText(null);
passwordField1.setText(null);
passwordField2.setText(null);
}
});
}
public JPanel viewPane(){
return accountPanel;
}
}
| [
"wongkaho@172.17.22.60"
] | wongkaho@172.17.22.60 |
8cf6468a6051129e16f1df5c3d20b1c298c1a296 | e1aa7bcf7461d63a710f06d33c01415045187f68 | /AssignmentCustomerProducerApp-61/src/main/java/in/nit/model/Customer.java | d598f3e889519fdae6be90974945149e39f9eee2 | [] | no_license | maheswarareddy529/Webservice | b48982ea7efa9d42a99cf393b13abee7fcd63276 | 2c9d229b5d7d442e356dc7d39b440e72d541f334 | refs/heads/master | 2023-02-27T00:05:38.879670 | 2021-02-02T07:10:18 | 2021-02-02T07:10:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 289 | java | package in.nit.model;
import java.util.List;
import java.util.Map;
import lombok.Data;
@Data
public class Customer {
private Integer custid;
private String custname;
private Map<String,Integer> items;
private Map<String,Integer> card;;
private List<Integer> discount;
}
| [
"karra@192.168.0.5"
] | karra@192.168.0.5 |
8e740bae2e5dd65ff831b26a842411a11bd708de | b30004c4cb8b546ed394a620d700e36012654ae4 | /filters/src/main/java/org/servlet/filters/SessionAttributeFilter.java | 4772c5619ccc52a929553765fd6d10b6a01ffac2 | [
"MIT"
] | permissive | shastrisaurabh/Servlet-Filters | 892139a0b74540710691ebe2a13a5064971d049f | de6e0b6bc487bc7060968f98de28dba0a432160a | refs/heads/master | 2020-04-24T19:14:50.319997 | 2014-09-12T01:35:26 | 2014-09-12T01:35:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,817 | java | package org.servlet.filters;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* <code>SessionAttributeFilter</code> is a filter which can be used to redirect
* requests based on attributes found in the session.
*
* @author shivam
*/
public final class SessionAttributeFilter implements Filter {
/** Init param for setting requireAttribute. */
public static final String REQUIRE_ATTRIBUTE = "requireAttribute";
/** Log for this class. */
private static final Log LOG = LogFactory
.getLog(SessionAttributeFilter.class);
/** Whether attributes are required to exist by this filter. */
private boolean requireAttribute;
/** Used to forward requests. */
private ServletContext context;
/** Session attribute names and values. */
private Map<String, Pattern> attributes = new HashMap<String, Pattern>();
/** Redirect URL for each session attribute. */
private Map<String, String> redirects = new HashMap<String, String>();
/**
* Initialize this filter.
*
* @param config
* <code>FilterConfig</code>
*/
public void init(final FilterConfig config) {
this.context = config.getServletContext();
this.requireAttribute = Boolean.valueOf(
config.getInitParameter(REQUIRE_ATTRIBUTE)).booleanValue();
if (LOG.isDebugEnabled()) {
LOG.debug("requireAttribute = " + this.requireAttribute);
}
final Enumeration<?> e = config.getInitParameterNames();
while (e.hasMoreElements()) {
final String name = (String) e.nextElement();
if (!name.equals(REQUIRE_ATTRIBUTE)) {
final String value = config.getInitParameter(name);
if (LOG.isDebugEnabled()) {
LOG.debug("Loaded attribute name:value " + name + ":"
+ value);
}
final StringTokenizer st = new StringTokenizer(name);
final String attrName = st.nextToken();
final String attrValue = st.nextToken();
this.attributes.put(attrName, Pattern.compile(attrValue));
this.redirects.put(attrName, value);
if (LOG.isDebugEnabled()) {
LOG.debug("Stored attribute " + attrName + " for pattern "
+ attrValue + " with redirect of " + value);
}
}
}
}
/**
* Handle all requests sent to this filter.
*
* @param request
* <code>ServletRequest</code>
* @param response
* <code>ServletResponse</code>
* @param chain
* <code>FilterChain</code>
*
* @throws ServletException
* if an error occurs
* @throws IOException
* if an error occurs
*/
public void doFilter(final ServletRequest request,
final ServletResponse response, final FilterChain chain)
throws IOException, ServletException {
boolean success = false;
String redirect = null;
if (request instanceof HttpServletRequest) {
final HttpSession session = ((HttpServletRequest) request)
.getSession(true);
final Iterator<String> i = this.attributes.keySet().iterator();
boolean loop = true;
while (i.hasNext() && loop) {
final String name = i.next();
final Pattern pattern = this.attributes.get(name);
final Object sessionAttr = session.getAttribute(name);
if (sessionAttr != null) {
final String value = String.valueOf(sessionAttr);
if (pattern.matcher(value).matches()) {
if (LOG.isDebugEnabled()) {
LOG.debug(value + " matches " + pattern.pattern());
}
success = true;
} else {
if (LOG.isDebugEnabled()) {
LOG.debug(value + " does not match "
+ pattern.pattern());
}
redirect = this.redirects.get(name);
success = false;
loop = false;
}
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("No session attribute found for " + name);
}
if (this.requireAttribute) {
redirect = this.redirects.get(name);
success = false;
loop = false;
} else {
success = true;
}
}
}
}
if (!success) {
if (redirect != null && !"".equals(redirect)) {
final StringBuffer url = new StringBuffer(redirect);
if (((HttpServletRequest) request).getRequestURI() != null) {
url.append("?url=").append(
URLEncoder.encode(((HttpServletRequest) request)
.getRequestURI(), "UTF-8"));
if (((HttpServletRequest) request).getQueryString() != null) {
url.append(URLEncoder.encode("?", "UTF-8")).append(
URLEncoder.encode(
((HttpServletRequest) request)
.getQueryString(), "UTF-8"));
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("Forwarding request to " + url.toString());
}
this.context.getRequestDispatcher(url.toString()).forward(
request, response);
return;
} else {
if (response instanceof HttpServletResponse) {
((HttpServletResponse) response)
.sendError(HttpServletResponse.SC_FORBIDDEN,
"Request blocked by filter, unable to perform redirect");
return;
} else {
throw new ServletException(
"Request blocked by filter, unable to perform redirect");
}
}
}
chain.doFilter(request, response);
}
/**
* Called by the web container to indicate to a filter that it is being
* taken out of service.
*/
public void destroy() {
}
} | [
"harshal.ladhe.91@live.co.uk"
] | harshal.ladhe.91@live.co.uk |
e651f9eca31b65549cd4eab555653f396d25e4ad | e9978986deaea6ae9f89c100dfdbb84f152a6f8d | /src/com/company/Person.java | 5d6faf9d2a510a99ca768778d87bfcc92bd62dc2 | [] | no_license | JThorumP/Fitness_Recap | dbb70795a315e345fc34f93795614bf9dcbf3de9 | 7ccd1b96cb995004281c3334040c923ade9661d4 | refs/heads/master | 2020-07-17T11:05:53.008638 | 2019-09-03T06:57:45 | 2019-09-03T06:57:45 | 206,008,104 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,201 | java | package com.company;
public class Person {
private String name;
private String CPR;
private int hours;
private int salary;
private String membership;
public Person(){
}
public Person(String name, String CPR, int hours, int salary){
this.name = name;
this.CPR = CPR;
this.hours = hours;
this.salary = salary;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCPR() {
return CPR;
}
public void setCPR(String CPR) {
this.CPR = CPR;
}
public int getHours() {
return hours;
}
public void setHours(int hours) {
this.hours = hours;
}
public int getSalary() {
return salary;
}
public void setSalary(int salary) {
this.salary = salary;
}
public String getMembership() {
return membership;
}
public void setMembership(String membership) {
this.membership = membership;
}
public String toString(){
return this.name + "\t" + this.CPR + "\t" + this.hours + "\t\t" +this.salary;
}
} | [
"jp@boblberg.dk"
] | jp@boblberg.dk |
cc99c4f036224beebf3bd42a8b2ff2a5d4f8ee45 | 32f18f9d9dbc92a553a9051d672b3b593cf932f3 | /src/com/chongwu/activity/Fragment/CommonViewPageFragment.java | c79f44abbdd6cab9bd8487c6b299f413001888d7 | [] | no_license | zhaozw/ChongWu | 50afcc806d541613b43848fb76c1ee6bf86892c3 | 99a59aaab1844971e5204a4fc986504533287b2c | refs/heads/master | 2021-01-17T23:04:07.580043 | 2014-10-12T05:34:18 | 2014-10-12T05:34:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,745 | java | package com.chongwu.activity.Fragment;
import com.chongwu.R;
import com.chongwu.adapter.CommonFragmentPagerAdapter;
import com.chongwu.widget.common.InsideViewPager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RadioGroup;
/**
* 赏图片段
*
* @author Kaka
*
*/
public abstract class CommonViewPageFragment extends Fragment implements
OnPageChangeListener, android.widget.RadioGroup.OnCheckedChangeListener {
private InsideViewPager viewPager;
private FragmentActivity parentActivity;
private FragmentManager fragmentManager;
private RadioGroup radioGroup;
private View view;
private int[] btns;
@Override
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
parentActivity = getActivity();
fragmentManager = parentActivity.getSupportFragmentManager();
btns = getBtns();
}
/**
* 重写此方法来定义Fragment的view内容
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if (view != null) {
ViewGroup viewGroup = (ViewGroup) view.getParent();
if (viewGroup != null) {
viewGroup.removeView(view);
}
return view;
} else {
view = inflater.inflate(R.layout.common_viewpage, container, false);
//
viewPager = (InsideViewPager) view.findViewById(R.id.viewPager);
viewPager.removeAllViewsInLayout();
viewPager.setViewParent(viewPager.getParent());
viewPager.setOffscreenPageLimit(btns.length);
// 设置viewPager内容
viewPager.setAdapter(getAdapter());
viewPager.setOnPageChangeListener(this);
radioGroup = (RadioGroup) view.findViewById(R.id.radiogroup);
radioGroup.setOnCheckedChangeListener(this);
return view;
}
}
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
for (int i = 0; i < btns.length; i++) {
if (radioGroup.getCheckedRadioButtonId() == btns[i]) {
viewPager.setCurrentItem(i);
}
}
}
@Override
public void onPageScrollStateChanged(int arg0) {
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
@Override
public void onPageSelected(int arg0) {
radioGroup.check(btns[arg0]);
}
public abstract CommonFragmentPagerAdapter getAdapter();
/**
* 获取btn列表
*
* @return
*/
public abstract int[] getBtns();
}
| [
"545482979@qq.com"
] | 545482979@qq.com |
bd22ff10dac2838c32d89438673ad169da6a6ee8 | dfc0ef8c3017ebfe80fe8ee657b4f593330d3ef6 | /Reversed/framework/com/samsung/android/hardware/context/SemContextAutoBrightness.java | ccaf026ca9c9973f2e052fd2174683379ce07580 | [] | no_license | khomsn/SCoverRE | fe079b6006281112ee37b66c5d156bb959e15420 | 2374565740e4c7bfc653b3f05bd9be519e722e32 | refs/heads/master | 2020-04-13T15:36:19.925426 | 2017-06-01T07:31:37 | 2017-06-01T07:31:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,540 | java | package com.samsung.android.hardware.context;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable.Creator;
public class SemContextAutoBrightness extends SemContextEventContext {
public static final int CONFIG_DATA_DOWNLOADED = 1000;
public static final Creator<SemContextAutoBrightness> CREATOR = new C01441();
public static final int EBOOK_MODE = 1;
public static final int NORMAL_MODE = 0;
public static final int UPDATE_MODE = 2;
private Bundle mContext;
static class C01441 implements Creator<SemContextAutoBrightness> {
C01441() {
}
public SemContextAutoBrightness createFromParcel(Parcel parcel) {
return new SemContextAutoBrightness(parcel);
}
public SemContextAutoBrightness[] newArray(int i) {
return new SemContextAutoBrightness[i];
}
}
SemContextAutoBrightness() {
this.mContext = new Bundle();
}
SemContextAutoBrightness(Parcel parcel) {
readFromParcel(parcel);
}
private void readFromParcel(Parcel parcel) {
this.mContext = parcel.readBundle(getClass().getClassLoader());
}
public int getAmbientLux() {
return this.mContext.getInt("AmbientLux");
}
public int getCandela() {
return this.mContext.getInt("Candela");
}
public void setValues(Bundle bundle) {
this.mContext = bundle;
}
public void writeToParcel(Parcel parcel, int i) {
parcel.writeBundle(this.mContext);
}
}
| [
"fonix232@gmail.com"
] | fonix232@gmail.com |
cfd42f5543e78bda8993c6737df914387efff307 | 7e8b0282421afe025ebff538ed34a4eebd1a4672 | /android/app/src/main/java/com/opcaoapp/MainApplication.java | e68ceb2313894f0a42c17e5978de6f51c65c360a | [] | no_license | lumnidev/OpcaoApp | 46d41388cc3118e64c4d2f796a158cb1fd8d7a7c | 5eb279888b733a79523e84c4c6fa0bcadfcc390d | refs/heads/master | 2020-04-26T15:00:06.179666 | 2019-03-19T15:27:12 | 2019-03-19T15:27:12 | 173,633,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,243 | java | package com.opcaoapp;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage(),
new RNGestureHandlerPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
| [
"rafael.jorge09@gmail.com"
] | rafael.jorge09@gmail.com |
f5c78a40858aa260592f944db1689c3a6dfc7faf | a6938a0468a09bdc9686ce7181df54dfdabc375a | /tdyth/src/main/java/cas/iie/nsp/controller/UserController.java | 9cb71ac6232b5e52b09826e9707e01b6789149f4 | [] | no_license | xidian-Merlin/webDemo | e3e5c8d55d8b03a6b558c3b754669282a0196cbf | 4892e075d464f22c7315b2a1eeb00294e35ba7f0 | refs/heads/master | 2021-05-05T05:53:07.770323 | 2018-03-10T13:07:08 | 2018-03-10T13:07:08 | 118,754,123 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,631 | java | package cas.iie.nsp.controller;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import cas.iie.nsp.exception.UserException;
import cas.iie.nsp.model.User;
import cas.iie.nsp.service.IIndexService;
import cas.iie.nsp.service.IUserService;
import cas.iie.nsp.service.impl.IndexServiceImpl;
import cas.iie.nsp.service.impl.UserServiceImpl;
@Controller
@RequestMapping(value="/user")
public class UserController {
private static Logger logger = Logger.getLogger(UserController.class);
// @Autowired
// private UserServiceImpl userService;
@Autowired
private IIndexService indexService;
@Autowired
private IUserService userService;
@RequestMapping(value="/login", method=RequestMethod.POST)
public @ResponseBody Map<String,Object> login(HttpServletRequest request ){
String userName =request.getParameter("username");
String passWord =request.getParameter("password");
Map<String,Object> map=new HashMap<String,Object>();
logger.info("userName====>"+userName);
if (null == userName || "".equals(userName.trim())) {
throw new UserException("用户名不能为空");
}
// User user = userService.getUserByUsername(userName);
//map= indexService.findUserByName(userName);
//logger.info("map===========>"+map.toString());
/*User user=new User();
user.setUsername((String)map.get("userName"));
user.setPassword((String)map.get("password"));
if (null == user) {
throw new UserException("用户名不存在");
}
if (!user.getPassword().equals(passWord)) {
throw new UserException("密码不正确");
}*/
if(userName.equals("admin")){
map.put("result", true);
map.put("message", "登陆成功!");
}else{
map.put("result", false);
map.put("message", "用户名或密码错误!");
}
return map;
}
@RequestMapping(value="/button")
public String button(HttpServletRequest request ){
logger.info("userName====>");
return "user/button";
}
} | [
"994530485@qq.com"
] | 994530485@qq.com |
9ef28cb943f07828aca9d3439323b528086fff16 | ecde13c21233b0ab8dd48bc7c3a792a667b6b84a | /android/app/src/main/java/com/laureatetest/MainActivity.java | 1dddb3a79097ce1040fac09968d8c46ec767765c | [] | no_license | AJjandroZG/laureate-test | cf47e7e1e884d2c102b53cf4d061d4003b4523ef | 6a8f31c6673ead9231e1e2598c75a4f96adc14b6 | refs/heads/master | 2023-03-19T23:16:22.806422 | 2021-03-22T14:37:21 | 2021-03-22T14:37:21 | 350,373,781 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package com.laureatetest;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "LaureateTest";
}
}
| [
"azelaya@yourappland.com"
] | azelaya@yourappland.com |
216ee6386a4cfe5095d70e7f6f43d627a01e9a0f | 416868a35408036de87d580c9d4949808dcbcdfa | /Week9/Inventory.java | a0b8e0421abb90f6340c0ccd26201a332cec7d34 | [] | no_license | mattcosta5651/CSCI362-OpSystems | 1dc7c9132d05e4afdb4a85a938ab076100fad45b | 78163d36d32bc6873b7047673e851941b35f629e | refs/heads/master | 2021-01-11T15:59:25.491297 | 2017-04-27T02:51:46 | 2017-04-27T02:51:46 | 79,973,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,395 | java | import java.util.*;
import java.util.concurrent.*;
public class Inventory{
private final Semaphore paper = new Semaphore(0, true);
private final Semaphore matches = new Semaphore(0, true);
private final Semaphore tobacco = new Semaphore(0, true);
private final Semaphore supplier = new Semaphore(0, true);
private final Semaphore smoker = new Semaphore(0, true);
public void producePaper(){
paper.release();
}
public void produceMatches(){
matches.release();
}
public void produceTobacco(){
tobacco.release();
}
public void consumePaper(){
try{
paper.acquire();
}
catch(Exception e){
e.printStackTrace();
}
}
public void consumeMatches(){
try{
matches.acquire();
}
catch(Exception e){
e.printStackTrace();
}
}
public void consumeTobacco(){
try{
tobacco.acquire();
}
catch(Exception e){
e.printStackTrace();
}
}
public synchronized boolean matchesPermitsAvailable(){return matches.availablePermits() > 0;}
public synchronized boolean paperPermitsAvailable(){return paper.availablePermits() > 0;}
public synchronized boolean tobaccoPermitsAvailable(){return tobacco.availablePermits() > 0;}
public void readyForSmoker(){
}
public void readyForSupplies(){
supplier.release();
}
public void waitForSmoker(){
try{
supplier.acquire();
}
catch(Exception e){
e.printStackTrace();
}
}
}
| [
"matt.costa8723@gmail.com"
] | matt.costa8723@gmail.com |
2d376b39a90e07fe280e4d2bed398e1da18befb4 | f0ee3224df8d0423789492f792a8c725e4d76e4d | /TestServlet/src/com/test/config/InitialisationDaoFactory.java | 35940e6a0b81c35e904d59229a2f377a5e1ed75c | [] | no_license | john26-creator/JavaProject | 69f646e5ea63f11ae4d8cf60efc2172c1b949bc1 | 63ba291422b9b294c217ec23e31c78470d80383f | refs/heads/master | 2020-12-08T19:24:42.490021 | 2020-01-10T15:51:02 | 2020-01-10T15:51:02 | 233,073,386 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 977 | java | package com.test.config;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import com.test.dao.DaoFactory;
public class InitialisationDaoFactory implements ServletContextListener {
private static final String ATT_DAO_FACTORY = "daofactory";
private DaoFactory daoFactory;
@Override
public void contextInitialized( ServletContextEvent event ) {
/* Récupération du ServletContext lors du chargement de l'application */
ServletContext servletContext = event.getServletContext();
/* Instanciation de notre DAOFactory */
this.daoFactory = DaoFactory.getInstance();
/* Enregistrement dans un attribut ayant pour portée toute l'application */
servletContext.setAttribute( ATT_DAO_FACTORY, this.daoFactory );
}
@Override
public void contextDestroyed( ServletContextEvent event ) {
/* Rien à réaliser lors de la fermeture de l'application... */
}
}
| [
"amselme@MASSAGUEL.ccinca.fr"
] | amselme@MASSAGUEL.ccinca.fr |
7007a4c520d1873e9279563e478eebf117e47655 | 5cbddfc8f82670b0aec948090e968f2ccab1de6b | /core-services/src/com/free/coreservices/archiver/ArchiveJob.java | 96de91838cee70d0125bcbc5f9e86bae00c9736d | [] | no_license | thinkman1/miscellaneous | fe1fa4fc7e1b8479b2f13ef22f0d80d2c3b57a55 | 39eaa034cb62fa2e7adaa55e956059816b5c3053 | refs/heads/master | 2021-01-23T06:44:49.938590 | 2014-08-02T18:44:34 | 2014-08-02T18:44:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,760 | java | package com.free.coreservices.archiver;
import java.util.concurrent.TimeUnit;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.omg.CORBA.SystemException;
public class ArchiveJob extends ScheduledJob {
private static final Log LOG = LogFactory.getLog(ArchiveJob.class);
private ArchiveKickoffJob archiveKickoffJob;
private String targetQueue;
private LockManager lockManager;
private String baseDir;
public ArchiveJob() {
setLockDuration(30);
setLockDurationUnit(TimeUnit.SECONDS);
}
@Override
public String getName() {
return "ArchiveJob";
}
public void setLock(LockManager lockManager) {
this.lockManager=lockManager;
}
@Override
public void executeService(ExecutionContext arg0) throws SystemException {
boolean yesLock=lockManager.acquire("ARCHIVE "+baseDir , 2, TimeUnit.MINUTES);
if (yesLock){
try {
LOG.info("start archive publishing");
archiveKickoffJob.publishArchiveMessages(targetQueue);
LOG.info("hang out, we're done with publishing");
// if this runs too fast the other process can get a lock as soon as we're done
TimeUnit.SECONDS.sleep(30);
LOG.info("end archive publish");
} catch (Exception e){
throw new SystemException(e);
} finally {
lockManager.release("ARCHIVE "+baseDir);
}
} else {
LOG.info("could not acquire ARCHIVE "+baseDir );
}
}
public void setArchiveKickoffJob(ArchiveKickoffJob archiveKickoffJob) {
this.archiveKickoffJob = archiveKickoffJob;
}
public void setTargetQueue(String targetQueue) {
this.targetQueue = targetQueue;
}
public void setBaseDir(String baseDir) {
this.baseDir = baseDir;
}
}
| [
"dcai1987@gmail.com"
] | dcai1987@gmail.com |
ece1ea1923f29385b5338afeb3fc2a8c4a52e811 | b8b6b9a3176775ae17eb29bf0f9ed9b8451dea80 | /leetcode/src/DynamicProgramming/HouseRobberThree.java | 02c60aa7b7aaec4da045ea3441a01b0f503b5252 | [] | no_license | qingxian666/ceshi | 2028cb2cdce118ffd60ca55dab9f53318f171820 | eebabbbe641bc6cbe1d0a7cbf77933f1677041f2 | refs/heads/master | 2020-04-20T07:33:18.150438 | 2019-05-02T03:01:48 | 2019-05-02T03:01:48 | 168,713,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 491 | java | package DynamicProgramming;
public class HouseRobberThree {
public int rob(TreeNode root) {
return dfs(root)[0];
}
public static int[] dfs(TreeNode root){
int [] dp = new int [] {0,0};
if(root!=null){
int [] dpL=dfs(root.left);
int [] dpR=dfs(root.right);
dp[1]=dpL[0]+dpR[0];
dp[0]=Math.max(dp[1],dpL[1]+dpR[1]+root.val);
}
return dp;
}
}
| [
"377253672@qq.com"
] | 377253672@qq.com |
6133e37af50d7f6dfb176c038cc99a66f1c83d2c | cf17d74dacb300d93f0f77f3ab4124c09e185287 | /src/main/java/com/example/demo/model/Role.java | 15c7ef6809496a489f748defb46db600f3fbb770 | [] | no_license | yoolbinum/LostFound | 234b45d40c0063fd645ee1921f2eb067c3efe5de | df6ccd156c91f0ba22b702d4b85865bb79bd8567 | refs/heads/master | 2021-01-25T13:08:04.000820 | 2018-03-07T00:40:22 | 2018-03-07T00:40:22 | 123,534,742 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 792 | java | package com.example.demo.model;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
public class Role {
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
public long id;
@Column(unique=true)
private String role;
@ManyToMany(mappedBy="roles")
private List<User> users;
public Role() {
this.users = new ArrayList<>();
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
} | [
"yoolbin.um@gmail.com"
] | yoolbin.um@gmail.com |
3bbcd33f9e7e004778f061de9398fbdf1509b474 | 2c98ad03fbc147f50d348740b9e54ca5cad82ab7 | /src/Beings/Imp.java | ff68934995e288fe22b1de139b8ee2ca40a0046f | [] | no_license | rcooper3307/Overseer | 3c1b561dfdce176760c7f1b3ee7cc726fc8f9944 | e003e80c94fb38198d8ffdc878c1d24735ea0c15 | refs/heads/master | 2020-04-09T20:25:03.273309 | 2018-12-13T13:41:26 | 2018-12-13T13:41:26 | 160,572,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 146 | java | package Beings;
public class Imp extends Being {
public Imp(String title,int xLoc, int yLoc)
{
super(title,xLoc,yLoc);
}
}
| [
"rcooper3307@bths.edu"
] | rcooper3307@bths.edu |
d6c17f9d4fa265fbd1069a2b19410a5fcc2891ed | 55819832e8f7c3e6674e79748e8032533a9ca74c | /src/main/kotlin/application/model/LRUCache.java | bd73f7fb22d4fd7709a647df76b0e02c4b0f5bd7 | [] | no_license | jedlimlx/Cellular-Automaton-Viewer | bd0edaefe7189093c025bc1c85aa1ccc0bb0153a | 92b0b63c3689b5846ed1709e39c91384d05f8b21 | refs/heads/master | 2021-12-07T20:48:21.163455 | 2021-12-04T03:51:02 | 2021-12-04T03:51:02 | 254,280,126 | 12 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,531 | java | package application.model;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;
import java.util.function.BiConsumer;
import java.util.function.Function;
/**
* Implements a least recently used cache with a hashmap and queue
* @param <K> The key of the LRU cache
* @param <V> The values to be stored in the cache
*/
public class LRUCache<K, V> implements Iterable<K>, Iterator<K> {
private int capacity;
private Function<V, Boolean> checkValid;
private BiConsumer<K, V> deleteFunc;
private final Queue<K> keyQueue;
private final HashMap<K, V> hashMap;
/**
* Constructs an LRU cache with the specified capacity
* @param capacity The capacity of the LRU cache
*/
public LRUCache(int capacity) {
this.capacity = capacity;
keyQueue = new LinkedList<>();
hashMap = new HashMap<>();
}
/**
* Sets the a value in the LRU cache
* @param key Key to associate value with
* @param value Value to be set
*/
public void put(K key, V value) {
keyQueue.add(key);
hashMap.put(key, value);
if (hashMap.size() > capacity && capacity != -1) {
K keyToDelete = keyQueue.poll();
if (checkValid != null) {
while (hashMap.get(keyToDelete) == null || !checkValid.apply(hashMap.get(keyToDelete))) {
hashMap.remove(keyToDelete);
keyToDelete = keyQueue.poll();
}
}
if (deleteFunc != null)
deleteFunc.accept(keyToDelete, hashMap.get(keyToDelete));
hashMap.remove(keyToDelete);
}
}
/**
* Removes the a value from the LRU cache
* O(N) removal by the way
* @param key Key to associated with the value
*/
public void remove(K key) {
//keyQueue.remove(key);
hashMap.remove(key);
}
/**
* Gets a value associated with a key
* @param key The key that the value is associated with
* @return Returns the value
*/
public V get(K key) {
return hashMap.get(key);
}
/**
* Checks if the key can be found in the cache
* @param key The key to search for
* @return Returns true if the key is found, false otherwise
*/
public boolean containsKey(K key) {
return hashMap.containsKey(key);
}
/**
* Size of the LRU cache
* @return Returns the size of the LRU cache
*/
public int size() {
return hashMap.size();
}
/**
* Sets the function that should run when a value is deleted
* @param deleteFunc The function to run
*/
public void setDeleteFunc(BiConsumer<K, V> deleteFunc) {
this.deleteFunc = deleteFunc;
}
/**
* Checks if a given value is valid in the LRU cache
* @param checkValid The function to run
*/
public void setCheckValid(Function<V, Boolean> checkValid) {
this.checkValid = checkValid;
}
/**
* Sets the capacity of the LRU cache
* @param capacity Capacity of the LRU cache
*/
public void setCapacity(int capacity) {
this.capacity = capacity;
}
@Override
public Iterator<K> iterator() {
return hashMap.keySet().iterator();
}
@Override
public boolean hasNext() {
return hashMap.keySet().iterator().hasNext();
}
@Override
public K next() {
return hashMap.keySet().iterator().next();
}
} | [
"jedlimlx@outlook.com"
] | jedlimlx@outlook.com |
e1f1a9dbcc0b9b005e4f2924924754dd881006ff | 44432868b36ba44ed9bd392e9f1a3aa49453ac73 | /AndroidJSONParsing/gen/com/androidhive/jsonparsing/R.java | 5bfe30b037eccf8d3e14122be6f491b266a7b2ab | [] | no_license | MayurKJParekh/Android_Apps_Example | 1539f256cff5c0a55504b8bb0d12681daa4929ef | 15d735b1a8dfb75b76c2ef425855191d890439cd | refs/heads/master | 2020-12-28T22:53:41.387120 | 2013-12-12T16:38:36 | 2013-12-12T16:38:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 893 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.androidhive.jsonparsing;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class id {
public static final int name=0x7f050000;
public static final int name_label=0x7f050001;
}
public static final class layout {
public static final int list_item=0x7f030000;
public static final int main=0x7f030001;
public static final int single_list_item=0x7f030002;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}
| [
"singh_dd93@yahoo.in"
] | singh_dd93@yahoo.in |
09008adcac7b18a789da962521693845a10bfa34 | ce29ae639da37c571cbbeac622b5d4ec67fcc58c | /fe/generated-sources/gen-java/com/cloudera/impala/thrift/TLogLevel.java | e3db30a917f72323a3a4d3f5fd1803bcf1d461e9 | [
"Apache-2.0"
] | permissive | dayutianfei/impala-Q | 703de4a0f6581401734b27b1f947ac1db718cb2e | 46af5ff8bf3e80999620db7bf0c9ffc93c8e5950 | refs/heads/master | 2021-01-10T11:54:57.584647 | 2016-02-17T15:39:09 | 2016-02-17T15:39:09 | 48,152,335 | 0 | 1 | null | 2016-03-09T17:02:07 | 2015-12-17T04:29:58 | C++ | UTF-8 | Java | false | true | 1,135 | java | /**
* Autogenerated by Thrift Compiler (0.9.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.cloudera.impala.thrift;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
public enum TLogLevel implements org.apache.thrift.TEnum {
VLOG_3(0),
VLOG_2(1),
VLOG(2),
INFO(3),
WARN(4),
ERROR(5),
FATAL(6);
private final int value;
private TLogLevel(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
public static TLogLevel findByValue(int value) {
switch (value) {
case 0:
return VLOG_3;
case 1:
return VLOG_2;
case 2:
return VLOG;
case 3:
return INFO;
case 4:
return WARN;
case 5:
return ERROR;
case 6:
return FATAL;
default:
return null;
}
}
}
| [
"dayutianfei@gmail.com"
] | dayutianfei@gmail.com |
3b43f4527316d479c0e0dc29973100c2e447f750 | 42505f4c48c56ef0160f9e6316495ec232aeecb8 | /InventoryBillingSystem/src/fbp/model/Login.java | 1f90be0cfadc69304a91411280c3c87566ee7332 | [] | no_license | ankithmjain/Inventory-Billing-System | dc40bdd94d1b3b9cdbe3896b897aa6574a9250b2 | 21c5153dd353e688aac8ba49d39277fba12a6253 | refs/heads/master | 2021-01-10T13:54:53.851297 | 2016-10-26T22:06:51 | 2016-10-26T22:06:51 | 48,592,624 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 676 | java | package fbp.model;
public class Login {
private String username; //UserName at the login page
private String password; //password at the login page
//Empty Default constructor
public Login() {
}
//Fully parameterized constructor
public Login(String username, String password) {
this.username = username;
this.password = password;
}
//Getter Setter methods for each attribute of the class
public String getUserName() {
return username;
}
public void setUserName(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"ajain62@hawk.iit.edu"
] | ajain62@hawk.iit.edu |
305ea564b23942577faaf78bd9f25fa081c89dc2 | aad06dc10d9f086dd8d38d85287234572295c50d | /src/main/java/org/onedatashare/server/model/filesystem/operations/OperationBase.java | 482ddbfe6cb42d0a4c448a89203b42315c0547e9 | [
"Apache-2.0"
] | permissive | didclab/onedatashare | 7611f3944b4cedd145e9de983631f4a387b2bf02 | de44a5bc1a6e829e017b1dd94655690dc6580208 | refs/heads/integration | 2023-08-31T08:45:12.361316 | 2023-08-17T02:35:07 | 2023-08-17T02:35:07 | 149,328,812 | 15 | 10 | Apache-2.0 | 2023-08-29T10:23:38 | 2018-09-18T17:42:24 | Java | UTF-8 | Java | false | false | 307 | java | package org.onedatashare.server.model.filesystem.operations;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OperationBase {
protected String credId;
protected String path;
protected String id;
}
| [
"aashish_jain@live.com"
] | aashish_jain@live.com |
aa2274299a2e839e440d0ce50b26ee72adb5bceb | aa7806b5543a35be5a59cc386194503a30c682e0 | /app/src/main/java/com/umanets/xylaritytestapp/util/DialogFactory.java | 118fecff69ca6aa873f5fb2acfd7b887aaf0c1e0 | [] | no_license | ko3ak1990/xylarityTestApp | 9c5c02387e85f8691f7744df80db001499dab836 | 54cd4c973d07570eb069dcea3dbb0c2a9ce14c2b | refs/heads/master | 2020-12-02T16:14:46.691879 | 2017-07-07T10:54:15 | 2017-07-07T10:54:15 | 96,430,966 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,121 | java | package com.umanets.xylaritytestapp.util;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.support.annotation.StringRes;
import android.support.v7.app.AlertDialog;
import com.umanets.xylaritytestapp.R;
public final class DialogFactory {
public static Dialog createSimpleOkErrorDialog(Context context, String title, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(message)
.setNeutralButton(R.string.dialog_action_ok, null);
return alertDialog.create();
}
public static Dialog createSimpleOkErrorDialog(Context context,
@StringRes int titleResource,
@StringRes int messageResource) {
return createSimpleOkErrorDialog(context,
context.getString(titleResource),
context.getString(messageResource));
}
public static Dialog createGenericErrorDialog(Context context, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
.setTitle(context.getString(R.string.dialog_error_title))
.setMessage(message)
.setNeutralButton(R.string.dialog_action_ok, null);
return alertDialog.create();
}
public static Dialog createGenericErrorDialog(Context context, @StringRes int messageResource) {
return createGenericErrorDialog(context, context.getString(messageResource));
}
public static ProgressDialog createProgressDialog(Context context, String message) {
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setMessage(message);
return progressDialog;
}
public static ProgressDialog createProgressDialog(Context context,
@StringRes int messageResource) {
return createProgressDialog(context, context.getString(messageResource));
}
}
| [
"ievgen@umanets.gmail.com"
] | ievgen@umanets.gmail.com |
acf7042e7a453796ce6f3b66310381e43d1e1b69 | 250080a05f719b0c6bfffa01a74e2b84beb80ecb | /src/main/java/org/cch/napa/entity/impl/LazyResultSetIterableImpl.java | 5adcde6f17b18059a66d39446e8e360f86e9fc05 | [] | no_license | CChampagne/napa | f23d43f2b2e04f8751563a3fe82eb4e911d661d7 | 8e1d86e8062d6c73af7cb82f214b8ee6a4c5a131 | refs/heads/master | 2023-05-24T18:12:19.434033 | 2020-12-21T01:22:38 | 2020-12-21T01:22:38 | 96,152,663 | 1 | 0 | null | 2023-05-23T20:13:44 | 2017-07-03T21:42:13 | Java | UTF-8 | Java | false | false | 2,945 | java | package org.cch.napa.entity.impl;
import org.cch.napa.entity.LazyResultSetIterable;
import org.cch.napa.exceptions.PersistenceException;
import org.cch.napa.exceptions.RuntimePersistenceException;
import org.cch.napa.mapper.RecordMapper;
import java.io.Closeable;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
*
* @param <T> The Object type
*/
class LazyResultSetIterableImpl<T> implements LazyResultSetIterable<T> {
private LazyResultSetIterator<T> iterator;
public LazyResultSetIterableImpl(PreparedStatement preparedStatement, RecordMapper<T> mapper) throws org.cch.napa.exceptions.SQLException {
iterator = new LazyResultSetIterator<T>(preparedStatement, mapper);
}
public Iterator<T> iterator() {
return iterator;
}
public void close() throws IOException {
iterator.close();
}
private class LazyResultSetIterator<T> implements Iterator<T>, Closeable {
private ResultSet resultSet;
private RecordMapper<T> mapper;
private PreparedStatement preparedStatement;
private Boolean hasNext;
private boolean isClosed;
public LazyResultSetIterator(PreparedStatement preparedStatement, RecordMapper<T> mapper) throws org.cch.napa.exceptions.SQLException {
this.preparedStatement = preparedStatement;
try {
this.resultSet = preparedStatement.executeQuery();
} catch (SQLException ex) {
throw new org.cch.napa.exceptions.SQLException("Failed to execute query", ex);
}
this.mapper = mapper;
}
public boolean hasNext() {
if (hasNext != null) return hasNext;
try {
hasNext = resultSet.next();
if(!hasNext && !isClosed) {
isClosed = true;
preparedStatement.close();
}
return hasNext;
} catch (SQLException ex) {
ex.printStackTrace();
return hasNext = false;
}
}
public T next() {
T item = null;
if (hasNext == null) {
hasNext();
}
if(!hasNext) {
throw new NoSuchElementException();
}
hasNext = null;
try {
item = mapper.map(resultSet);
} catch (SQLException ex) {
throw new RuntimePersistenceException(ex);
} catch (PersistenceException ex) {
throw new RuntimePersistenceException(ex);
}
return item;
}
public void remove() {
throw new UnsupportedOperationException();
}
public void close() throws IOException {
}
}
}
| [
"christophe.champagne@gmail.com"
] | christophe.champagne@gmail.com |
f2205b60a5f34fbf08e5f5314a1321b63dc4989c | 3efa417c5668b2e7d1c377c41d976ed31fd26fdc | /src/br/com/mind5/paymentPartner/partnerMoip/orderMoip/info/OrdmoipMergerVisiPayordem.java | d5268f29e07742bc0f586aa459a983d0c8d145b8 | [] | no_license | grazianiborcai/Agenda_WS | 4b2656716cc49a413636933665d6ad8b821394ef | e8815a951f76d498eb3379394a54d2aa1655f779 | refs/heads/master | 2023-05-24T19:39:22.215816 | 2023-05-15T15:15:15 | 2023-05-15T15:15:15 | 109,902,084 | 0 | 0 | null | 2022-06-29T19:44:56 | 2017-11-07T23:14:21 | Java | UTF-8 | Java | false | false | 878 | java | package br.com.mind5.paymentPartner.partnerMoip.orderMoip.info;
import java.util.ArrayList;
import java.util.List;
import br.com.mind5.info.InfoMergerVisitorTemplate;
import br.com.mind5.payment.payOrderItem.info.PayordemInfo;
final class OrdmoipMergerVisiPayordem extends InfoMergerVisitorTemplate<OrdmoipInfo, PayordemInfo> {
@Override public boolean shouldMerge(OrdmoipInfo baseInfo, PayordemInfo selectedInfo) {
return (baseInfo.codOwner == selectedInfo.codOwner &&
baseInfo.codPayOrder == selectedInfo.codPayOrder &&
baseInfo.codPayOrderItem == selectedInfo.codPayOrderItem );
}
@Override public List<OrdmoipInfo> merge(OrdmoipInfo baseInfo, PayordemInfo selectedInfo) {
List<OrdmoipInfo> results = new ArrayList<>();
baseInfo.payordemData = selectedInfo;
results.add(baseInfo);
return results;
}
}
| [
"mmaciel@mind5.com"
] | mmaciel@mind5.com |
edab458159952e67fff2cf939c3ddccf86f5ee45 | b2840fb25fa4b4a72ded285ecf89cbb4faf55dd7 | /src/main/java/com/yangk/selflearn/designpattern/proxy/Subject.java | 54421ba0be5e973bbdcee04ccbaff96c32156483 | [] | no_license | beimingyouyu666/self-learn | f77c95f35dd97c9e2c6fcde8f24f86f44a8d1ae7 | d20b47f034be110316be627f7031105e84b1d923 | refs/heads/master | 2023-06-29T20:11:39.421310 | 2022-04-06T14:13:51 | 2022-04-06T14:13:51 | 219,266,868 | 0 | 0 | null | 2023-06-14T22:26:04 | 2019-11-03T07:36:51 | Java | UTF-8 | Java | false | false | 232 | java | package com.yangk.selflearn.designpattern.proxy;
/**
* @Description 代理类接口
* @Author yangkun
* @Date 2019/10/17
* @Version 1.0
* @blame yangkun
*/
public interface Subject {
void doSomething();
}
| [
"956898043@qq.com"
] | 956898043@qq.com |
aef2d5d93b80b68b2bd6c8a573737e25e6b5d13d | 36155fc6d1b1cd36edb4b80cb2fc2653be933ebd | /lc/src/LC/SOL/Heaters.java | 705972353fab2580f76380c0a93471d721b56942 | [] | no_license | Delon88/leetcode | c9d46a6e29749f7a2c240b22e8577952300f2b0f | 84d17ee935f8e64caa7949772f20301ff94b9829 | refs/heads/master | 2021-08-11T05:52:28.972895 | 2021-08-09T03:12:46 | 2021-08-09T03:12:46 | 96,177,512 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 706 | java | package LC.SOL;
import java.util.Arrays;
public class Heaters {
public class Solution {
public int findRadius(int[] houses, int[] heaters) {
Arrays.sort(houses);
Arrays.sort(heaters);
int i = 0, j = 0;
int ret = 0;
while ( i < houses.length ) {
// find nearest heater
while ( j < heaters.length - 1 && Math.abs( houses[i] - heaters[j] ) >=
Math.abs(houses[i] - heaters[j + 1])) {
j++;
}
ret = Math.max( ret , Math.abs(houses[i] - heaters[j]));
i++;
}
return ret;
}
}
}
| [
"nanhongy@amazon.com"
] | nanhongy@amazon.com |
1b5a968544090d5616920dd4f81126e2efa0709d | 38753e78cb22e380986223442ca0e92997a91108 | /chapter_001/src/test/java/ru/job4j/calculate/CalcTest.java | c8664bfdb3a10a386958ec0377985456d279f3c8 | [
"Apache-2.0"
] | permissive | andrewnnov/job4j | 7f057abcc56d0089f260eb94d19e0088d9dc12f0 | 084acf540450f1daed0d502d4f26c0c4f2b70058 | refs/heads/master | 2021-06-18T00:00:11.784282 | 2021-02-18T19:56:03 | 2021-02-18T19:56:03 | 178,114,626 | 0 | 0 | Apache-2.0 | 2020-10-13T12:37:37 | 2019-03-28T02:55:26 | Java | UTF-8 | Java | false | false | 1,064 | java | package ru.job4j.calculate;
import org.junit.Assert;
import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
public class CalcTest {
@Test
public void when2And2Equal4() {
Calc calc = new Calc();
double expectedRes = 4d;
double actualRes = calc.add(2d, 2d);
assertThat(actualRes, is(expectedRes));
}
@Test
public void when2And2And2Equal6() {
Calc calc = new Calc();
double expectedRes = 6d;
double actualRes = calc.add(2d, 2d, 2d);
assertThat(actualRes, is(expectedRes));
}
@Test
public void when5And5And5Equal15() {
Calc calc = new Calc();
double expectedRes = 15d;
double actualRes = calc.add(5d, 5d, 5d);
assertThat(actualRes, is(expectedRes));
}
@Test
public void when4x4ThenEqual16() {
Calc calc = new Calc();
double expectedRes = 16d;
double actualRes = calc.add(4d, 4d, 4d, 4d);
assertThat(actualRes, is(expectedRes));
}
}
| [
"andrewnnov@yandex.ru"
] | andrewnnov@yandex.ru |
e798175b24cbff0bba130e5ad5f77fee339d8858 | 78eb7d860647c853518d6c1af5b40a7c4c3e5b89 | /src/main/java/avatar/manager/EconomyManager.java | d99b42d8eced9a590b0d1ca5d395d31f394a99a8 | [
"MIT"
] | permissive | Jimmeh94/AvatarSpigot | 4ed4d153d4cdf6745c639f00d62d25a803e10dd6 | 704f4f219963bd3de124beee2c25a4dd29ce52e0 | refs/heads/master | 2021-03-27T15:34:27.025856 | 2017-02-25T06:46:06 | 2017-02-25T06:46:06 | 80,318,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | package avatar.manager;
import avatar.game.user.Account;
import avatar.game.user.UserPlayer;
import java.util.Optional;
public class EconomyManager extends Manager<Account> {
public Optional<Account> findAccount(UserPlayer userPlayer){
for(Account account: objects){
if(account.getOwner() == userPlayer){
return Optional.of(account);
}
}
return Optional.empty();
}
}
| [
"jimmeh.business@gmail.com"
] | jimmeh.business@gmail.com |
02e31934f57a6277a1726e6cf1916111738015ed | 99090fab5893eabd84631c754ad8bdb8e12992af | /app/src/main/java/com/projects/cactus/maskn/navdrawer/AboutAppFragment.java | f606b031629bffb1081b9dce3aa456419be67ff4 | [] | no_license | BishoyAbd/Semsar | d54f7d729b6b9d37f9423c68db6b17cc9da34559 | aaf73a7a635dbb646e868642c692e59e6008069a | refs/heads/master | 2021-05-14T09:00:50.875923 | 2018-01-05T00:20:49 | 2018-01-05T00:20:49 | 116,316,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 890 | java | package com.projects.cactus.maskn.navdrawer;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.projects.cactus.maskn.R;
/**
* Created by bisho on 11/18/2017.
*/
public class AboutAppFragment extends Fragment {
public static final String TAG = "about_app_fragment";
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.about_app_fragment, container, false);
return view;
}
}
| [
"bishoyabd@gmail.com"
] | bishoyabd@gmail.com |
db8febeb6ce8ca7d95bf1ada2ea2806abc4483af | 54556275ca0ad0fb4850b92e5921725da73e3473 | /src/mikera/arrayz/Arrayz.java | ba103d3077cd57ac873f8dfca1797ef8bae0328f | [] | no_license | xSke/CoreServer | f7ea539617c08e4bd2206f8fa3c13c58dfb76d30 | d3655412008da22b58f031f4e7f08a6f6940bf46 | refs/heads/master | 2020-03-19T02:33:15.256865 | 2018-05-31T22:00:17 | 2018-05-31T22:00:17 | 135,638,686 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,544 | java | /*
* Decompiled with CFR 0_129.
*/
package mikera.arrayz;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import mikera.arrayz.Array;
import mikera.arrayz.INDArray;
import mikera.arrayz.NDArray;
import mikera.arrayz.impl.SliceArray;
import mikera.arrayz.impl.ZeroArray;
import mikera.matrixx.Matrix;
import mikera.matrixx.Matrixx;
import mikera.matrixx.impl.StridedMatrix;
import mikera.matrixx.impl.ZeroMatrix;
import mikera.vectorz.AScalar;
import mikera.vectorz.AVector;
import mikera.vectorz.Scalar;
import mikera.vectorz.Vector;
import mikera.vectorz.Vectorz;
import mikera.vectorz.impl.ArrayIndexScalar;
import mikera.vectorz.impl.ArraySubVector;
import mikera.vectorz.impl.ImmutableScalar;
import mikera.vectorz.impl.SparseIndexedVector;
import mikera.vectorz.impl.Vector0;
import mikera.vectorz.impl.ZeroVector;
import mikera.vectorz.util.ErrorMessages;
import mikera.vectorz.util.IntArrays;
import mikera.vectorz.util.VectorzException;
import us.bpsm.edn.parser.Parseable;
import us.bpsm.edn.parser.Parser;
import us.bpsm.edn.parser.Parsers;
public class Arrayz {
public static INDArray create(Object object) {
if (object instanceof INDArray) {
return Arrayz.create((INDArray)object);
}
if (object instanceof double[]) {
return Vector.of((double[])object);
}
if (object instanceof List) {
List list = (List)object;
int n = list.size();
if (n == 0) {
return Vector0.INSTANCE;
}
Object o1 = list.get(0);
if (o1 instanceof AScalar || o1 instanceof Number) {
return Vectorz.create((List)object);
}
if (o1 instanceof AVector) {
return Matrixx.create((List)object);
}
if (o1 instanceof INDArray) {
return SliceArray.create((List)object);
}
ArrayList<INDArray> al = new ArrayList<INDArray>(n);
for (Object o : list) {
al.add(Arrayz.create(o));
}
return Arrayz.create(al);
}
if (object instanceof Number) {
return Scalar.create(((Number)object).doubleValue());
}
if (object.getClass().isArray()) {
return Arrayz.create(Arrays.asList((Object[])object));
}
throw new VectorzException("Don't know how to create array from: " + object.getClass());
}
public static /* varargs */ INDArray newArray(int ... shape) {
int dims = shape.length;
switch (dims) {
case 0: {
return Scalar.create(0.0);
}
case 1: {
return Vector.createLength(shape[0]);
}
case 2: {
return Matrix.create(shape[0], shape[1]);
}
}
return Array.newArray(shape);
}
public static INDArray create(INDArray a) {
int dims = a.dimensionality();
switch (dims) {
case 0: {
return Scalar.create(a.get());
}
case 1: {
return Vector.wrap(a.toDoubleArray());
}
case 2: {
return Matrix.wrap(a.getShape(0), a.getShape(1), a.toDoubleArray());
}
}
return Array.wrap(a.toDoubleArray(), a.getShape());
}
public static /* varargs */ INDArray create(Object ... data) {
return Arrayz.create((Object)data);
}
public static INDArray wrap(double[] data, int[] shape) {
int dlength = data.length;
switch (shape.length) {
case 0: {
return ArrayIndexScalar.wrap(data, 0);
}
case 1: {
int n = shape[0];
if (dlength < n) {
throw new IllegalArgumentException(ErrorMessages.insufficientElements(dlength));
}
if (n == dlength) {
return Vector.wrap(data);
}
return ArraySubVector.wrap(data, 0, n);
}
case 2: {
int rc = shape[0];
int cc = shape[1];
int ec = rc * cc;
if (dlength < ec) {
throw new IllegalArgumentException(ErrorMessages.insufficientElements(dlength));
}
if (ec == dlength) {
return Matrix.wrap(rc, cc, data);
}
return StridedMatrix.wrap(data, shape[0], shape[1], 0, shape[1], 1);
}
}
long eec = IntArrays.arrayProduct(shape);
if ((long)dlength < eec) {
throw new IllegalArgumentException(ErrorMessages.insufficientElements(dlength));
}
if (eec == (long)dlength) {
return Array.wrap(data, shape);
}
return NDArray.wrap(data, shape);
}
public static /* varargs */ INDArray createFromVector(AVector a, int ... shape) {
int dims = shape.length;
if (dims == 0) {
return Scalar.createFromVector(a);
}
if (dims == 1) {
return Vector.createFromVector(a, shape[0]);
}
if (dims == 2) {
return Matrixx.createFromVector(a, shape[0], shape[1]);
}
return Array.createFromVector(a, shape);
}
public static INDArray load(Reader reader) {
Parseable pbr = Parsers.newParseable(reader);
Parser p = Parsers.newParser(Parsers.defaultConfiguration());
return Arrayz.create(p.nextValue(pbr));
}
public static INDArray parse(String ednString) {
return Arrayz.load(new StringReader(ednString));
}
public static INDArray wrapStrided(double[] data, int offset, int[] shape, int[] strides) {
int dims = shape.length;
if (dims == 0) {
return ArrayIndexScalar.wrap(data, offset);
}
if (dims == 1) {
return Vectorz.wrapStrided(data, offset, shape[0], strides[0]);
}
if (dims == 2) {
return Matrixx.wrapStrided(data, shape[0], shape[1], offset, strides[0], strides[1]);
}
if (Arrayz.isPackedLayout(data, offset, shape, strides)) {
return Array.wrap(data, shape);
}
return NDArray.wrapStrided(data, offset, shape, strides);
}
public static boolean isPackedLayout(double[] data, int offset, int[] shape, int[] strides) {
if (offset != 0) {
return false;
}
int dims = shape.length;
int st = 1;
for (int i = dims - 1; i >= 0; --i) {
if (strides[i] != st) {
return false;
}
st *= shape[i];
}
return st == data.length;
}
public static boolean isPackedStrides(int[] shape, int[] strides) {
int dims = shape.length;
int st = 1;
for (int i = dims - 1; i >= 0; --i) {
if (strides[i] != st) {
return false;
}
st *= shape[i];
}
return true;
}
public static INDArray createSparse(INDArray a) {
int dims = a.dimensionality();
if (dims == 0) {
return Scalar.create(a.get());
}
if (dims == 1) {
return Vectorz.createSparse(a.asVector());
}
if (dims == 2) {
return Matrixx.createSparse(Matrixx.toMatrix(a));
}
int n = a.sliceCount();
List<INDArray> slices = a.getSliceViews();
for (int i = 0; i < n; ++i) {
slices.set(i, slices.get(i).sparseClone());
}
return SliceArray.create(slices);
}
public static /* varargs */ INDArray createZeroArray(int ... shape) {
switch (shape.length) {
case 0: {
return ImmutableScalar.ZERO;
}
case 1: {
return ZeroVector.create(shape[0]);
}
case 2: {
return ZeroMatrix.create(shape[0], shape[1]);
}
}
return ZeroArray.create(shape);
}
public static /* varargs */ INDArray createSparseArray(int ... shape) {
switch (shape.length) {
case 0: {
return Scalar.create(0.0);
}
case 1: {
return SparseIndexedVector.createLength(shape[0]);
}
case 2: {
return Matrixx.createSparse(shape[0], shape[1]);
}
}
int sliceCount = shape[0];
int[] subshape = IntArrays.tailArray(shape);
ArrayList<INDArray> slices = new ArrayList<INDArray>(sliceCount);
INDArray sa = Arrayz.createSparseArray(subshape);
slices.add(sa);
for (int i = 1; i < sliceCount; ++i) {
slices.add(sa.sparseClone());
}
SliceArray<INDArray> m = SliceArray.create(slices);
return m;
}
public static void fillRandom(INDArray a, long seed) {
Vectorz.fillRandom(a.asVector(), seed);
}
public static void fillRandom(INDArray a, Random random) {
Vectorz.fillRandom(a.asVector(), random);
}
public static void fillNormal(INDArray a, long seed) {
Vectorz.fillNormal(a.asVector(), seed);
}
public static void fillNormal(INDArray a, Random random) {
Vectorz.fillNormal(a.asVector(), random);
}
}
| [
"voltasalt@gmail.com"
] | voltasalt@gmail.com |
32f058ea9a2cf4d726f3621a5ad5ad359c903320 | 9d7e6fe4cf61160d7e8576bfd19cb518fd6837c0 | /app/src/main/java/com/tangchaoke/yiyoubangjiao/adapter/FindTeacherInPopAdapter.java | ad45b82df461d8a797b9902358e711e8713c59bd | [] | no_license | 2403102119/YiYouBangJiao | 445eb88c03b2b743b54e462aa0696322969c21e4 | 979d5991dc4e689b142845fd1561ae90e9683449 | refs/heads/master | 2020-06-07T01:52:09.020023 | 2019-06-20T09:55:22 | 2019-06-20T09:55:22 | 192,895,027 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,689 | java | package com.tangchaoke.yiyoubangjiao.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.tangchaoke.yiyoubangjiao.R;
import com.tangchaoke.yiyoubangjiao.hg.HGTool;
import java.util.List;
/**
* Created by Administrator on 2018/3/10.
*/
public class FindTeacherInPopAdapter extends RecyclerView.Adapter<FindTeacherInPopAdapter.MyViewHold> {
private LayoutInflater mLayoutInflater;
private Context mContext;
List<String> mGradeList;
private OnItemClickListener mOnItemClickListener;
private int mSelectedPos = -1;//保存当前选中的position 重点!
public void setOnItemCilckLisener(OnItemClickListener mOnItemClickListener) {
this.mOnItemClickListener = mOnItemClickListener;
}
public FindTeacherInPopAdapter(int mSelectedPos, Context mContext, List<String> mGradeList, OnItemClickListener mOnItemClickListener) {
this.mSelectedPos = mSelectedPos;
this.mContext = mContext;
this.mGradeList = mGradeList;
this.mOnItemClickListener = mOnItemClickListener;
this.mLayoutInflater = LayoutInflater.from(mContext);
}
@Override
public MyViewHold onCreateViewHolder(ViewGroup parent, int viewType) {
return new MyViewHold(mLayoutInflater.inflate(R.layout.item_find_teacher_pop, parent, false));
}
@Override
public void onBindViewHolder(MyViewHold holder, int position) {
}
@Override
public void onBindViewHolder(MyViewHold holder, int position, List<Object> payloads) {
super.onBindViewHolder(holder, position, payloads);
if (payloads.isEmpty()) {
//payloads即有效负载,
// 当首次加载或调用notifyDatasetChanged() ,
// notifyItemChange(int position)进行刷新时,
// payloads为empty 即空
holder.mLlOnclick.setBackgroundResource(R.drawable.shape_light_gray_fillet_5);
holder.mTvReleaseGrade.setTextColor(mContext.getResources().getColor(R.color.color666666));
} else {
//当调用notifyItemChange(int position, Object payload)进行布局刷新时,
// payloads不会empty ,
// 所以真正的布局刷新应该在这里实现 重点!
holder.mLlOnclick.setBackgroundResource(R.drawable.shape_light_gray_fillet_5);
holder.mTvReleaseGrade.setTextColor(mContext.getResources().getColor(R.color.color666666));
}
if (!HGTool.isEmpty(mGradeList.get(position))) {
holder.mTvReleaseGrade.setText(mGradeList.get(position));
}
}
@Override
public int getItemCount() {
return mGradeList.size();
}
public class MyViewHold extends RecyclerView.ViewHolder implements View.OnClickListener {
LinearLayout mLlOnclick;
TextView mTvReleaseGrade;
public MyViewHold(View itemView) {
super(itemView);
mLlOnclick = itemView.findViewById(R.id.ll_onclick);
mLlOnclick.setOnClickListener(this);
mTvReleaseGrade = itemView.findViewById(R.id.tv_release_grade);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.ll_onclick:
mOnItemClickListener.onItemClick(getLayoutPosition(), view);
break;
}
}
}
public interface OnItemClickListener {
public void onItemClick(int position, View view);
}
} | [
"m1760016728@163.com"
] | m1760016728@163.com |
b11dbb1c61e91a930cce4d63d14cd0dc30a020d3 | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-ws/results/MATH-51b-1-28-Single_Objective_GGA-WeightedSum/org/apache/commons/math/analysis/solvers/BaseAbstractUnivariateRealSolver_ESTest.java | c1e8e3b5a5a17c6e17217e8703540fe318826d48 | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 821 | java | /*
* This file was automatically generated by EvoSuite
* Fri Jan 17 22:50:36 UTC 2020
*/
package org.apache.commons.math.analysis.solvers;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.apache.commons.math.analysis.solvers.NewtonSolver;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class BaseAbstractUnivariateRealSolver_ESTest extends BaseAbstractUnivariateRealSolver_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
NewtonSolver newtonSolver0 = new NewtonSolver();
// Undeclared exception!
newtonSolver0.doSolve();
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
f6237e930c7d2927ec08077a9afbe996143c32e9 | fb3bfebe89b1725b849caaa2fa173012e106269a | /operators/Bitwise.java | 33203229cf64cd9e1b08b2055942c15d7c51e740 | [] | no_license | Asheshs/Javas | 33474df59d8b489ec1974e79a1af8359229cd633 | 591d89f7ce09c8ceb5750fe1bee761ada83c6493 | refs/heads/master | 2020-04-12T17:45:44.003939 | 2019-02-01T09:11:57 | 2019-02-01T09:11:57 | 162,656,229 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 244 | java | class Bitwise
{
public static void main(String[]args)
{
int a=50;
int b=60;
a = a ^ b;
b = a ^ b;
a = a ^ b;
System.out.println(a);
System.out.println(b);
}
} | [
"asheshfootball@gmail.com"
] | asheshfootball@gmail.com |
1dd29ee648667403f6dd71aa29d3abccfa8ede4f | f124fd4b4f17ca1fde168b9060b33b4d8536cf30 | /blogpessoal-api/src/main/java/org/blogPessoal/blogPessoalapi/model/UsuarioLogin.java | f2348fa9823051fe088c33165f436d2bda2f708b | [] | no_license | witermendonca/BlogPessoal-Back-End-Java | 6bd95d76ae7ba8beb40580c645246d82e66a7c51 | a1c13aad6166fa09bea971431d242748ecfba64a | refs/heads/main | 2023-03-23T18:51:18.837576 | 2021-03-16T22:33:47 | 2021-03-16T22:33:47 | 348,510,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 995 | java | package org.blogPessoal.blogPessoalapi.model;
public class UsuarioLogin {
private long id;
private String nome;
private String usuario;
private String senha;
private String token;
private String foto;
private String tipo;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getUsuario() {
return usuario;
}
public void setUsuario(String usuario) {
this.usuario = usuario;
}
public String getSenha() {
return senha;
}
public void setSenha(String senha) {
this.senha = senha;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getFoto() {
return foto;
}
public void setFoto(String foto) {
this.foto = foto;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
} | [
"witer_m19@hotmail.com"
] | witer_m19@hotmail.com |
0d61ace9dc8dc4bc46e8f088aaf412e33f398f5c | aac6d48cb2456386495ff707d2c9e7731db78b29 | /app/src/main/java/com/udacity/and/popularmovies/models/Movie.java | f75b87ed57ef664589ec053e89558738a3428856 | [] | no_license | GGcNeaR/and-popular-movies-part1 | 2acefdfdc755024a72539d896eb3eff4ba6173d9 | c4b151bc293a83a12bb42e3650d18d6ec28bca2e | refs/heads/master | 2021-01-24T16:14:35.299630 | 2018-02-28T20:13:19 | 2018-02-28T20:13:19 | 123,177,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,895 | java | package com.udacity.and.popularmovies.models;
import android.os.Parcel;
import android.os.Parcelable;
public class Movie implements Parcelable {
public static final String MOVIE_EXTRA = "MOVIE_EXTRA";
private int id;
private String title;
private String overview;
private String posterPath;
private String releaseDate;
private String originalLanguage;
private String originalTitle;
private int[] genreIds;
private int voteCount;
private double voteAverage;
private double popularity;
private String backdropPath;
private boolean isAdult;
public Movie(int id, String title, String overview, String posterPath, String releaseDate,
String originalLanguage, String originalTitle, int[] genreIds,
int voteCount, double voteAverage, double popularity,
String backdropPath, boolean isAdult) {
this.id = id;
this.title = title;
this.overview = overview;
this.posterPath = posterPath;
this.releaseDate = releaseDate;
this.originalLanguage = originalLanguage;
this.originalTitle = originalTitle;
this.genreIds = genreIds;
this.voteCount = voteCount;
this.voteAverage = voteAverage;
this.popularity = popularity;
this.backdropPath = backdropPath;
this.isAdult = isAdult;
}
public int getId() {
return id;
}
public String getTitle() {
return title;
}
public String getOverview() {
return overview;
}
public String getPosterPath() {
return posterPath;
}
public String getReleaseDate() {
return releaseDate;
}
public String getOriginalLanguage() {
return originalLanguage;
}
public String getOriginalTitle() {
return originalTitle;
}
public int[] getGenreIds() {
return genreIds;
}
public int getVoteCount() {
return voteCount;
}
public double getVoteAverage() {
return voteAverage;
}
public double getPopularity() {
return popularity;
}
public String getBackdropPath() {
return backdropPath;
}
public boolean isAdult() {
return isAdult;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(id);
dest.writeString(title);
dest.writeString(overview);
dest.writeString(posterPath);
dest.writeString(releaseDate);
dest.writeString(originalLanguage);
dest.writeString(originalTitle);
dest.writeInt(genreIds.length);
dest.writeIntArray(genreIds);
dest.writeInt(voteCount);
dest.writeDouble(voteAverage);
dest.writeDouble(popularity);
dest.writeString(backdropPath);
dest.writeByte((byte)(isAdult ? 1 : 0));
}
public static final Parcelable.Creator<Movie> CREATOR
= new Parcelable.Creator<Movie>() {
public Movie createFromParcel(Parcel in) {
return new Movie(in);
}
public Movie[] newArray(int size) {
return new Movie[size];
}
};
private Movie(Parcel in) {
this.id = in.readInt();
this.title = in.readString();
this.overview = in.readString();
this.posterPath = in.readString();
this.releaseDate = in.readString();
this.originalLanguage = in.readString();
this.originalTitle = in.readString();
this.genreIds = new int[in.readInt()];
in.readIntArray(this.genreIds);
this.voteCount = in.readInt();
this.voteAverage = in.readDouble();
this.popularity = in.readDouble();
this.backdropPath = in.readString();
this.isAdult = in.readByte() != 0;
}
}
| [
"ggc.near@gmail.com"
] | ggc.near@gmail.com |
345b27820d1e28e4f57a776401a146cc9ed7fb7e | 6592455ae6b2902db48cee095952906159bf3416 | /CU009_JavaIniciacion/src/edu/masterjava/javainiciacion/tarea06/DiscoDuro.java | ca9a431e58aa793bcf56db4b71489282fb8f3500 | [] | no_license | charques/master-java-elite | 1352f7730feda2e226966dd768cf63a774b54294 | 5a979461a5a6b5c4e39147a7848b0da2e07f5918 | refs/heads/master | 2021-01-25T05:21:33.381086 | 2013-10-01T20:38:15 | 2013-10-01T20:38:15 | 13,224,627 | 1 | 0 | null | null | null | null | MacCentralEurope | Java | false | false | 1,972 | java | package edu.masterjava.javainiciacion.tarea06;
/**
*
* Clase que representa un disco duro.
*
* @author carloshernandezarques
*
*/
public class DiscoDuro {
/**
* Número de cilindros.
*/
private int cilindros;
/**
* Número de pistas por cilindro.
*/
private int pistas;
/**
* Número de sectores por pista.
*/
private int sectores;
/**
* Número de bytes por sector.
*/
private int bytes;
/**
* Constructor.
*/
public DiscoDuro(int pCilindros, int pPistas, int pSectores, int pBytes) {
this.cilindros = pCilindros;
this.pistas = pPistas;
this.sectores = pSectores;
this.bytes = pBytes;
}
/**
* Capacidad del disco en Bytes.
*
* @return
*/
public double capacidadB() {
return cilindros * pistas * sectores * bytes;
}
/**
* Capacidad del disco en KB.
*
* @return
*/
public double capacidadKB() {
return capacidadB() / 1024;
}
/**
* Capacidad del disco en MB.
*
* @return
*/
public double capacidadMB() {
return capacidadKB() / 1024;
}
/**
* Capacidad del disco en GB.
*
* @return
*/
public double capacidadGB() {
return capacidadMB() / 1024;
}
/**
* @return the cilindros
*/
public int getCilindros() {
return cilindros;
}
/**
* @param cilindros the cilindros to set
*/
public void setCilindros(int cilindros) {
this.cilindros = cilindros;
}
/**
* @return the pistas
*/
public int getPistas() {
return pistas;
}
/**
* @param pistas the pistas to set
*/
public void setPistas(int pistas) {
this.pistas = pistas;
}
/**
* @return the sectores
*/
public int getSectores() {
return sectores;
}
/**
* @param sectores the sectores to set
*/
public void setSectores(int sectores) {
this.sectores = sectores;
}
/**
* @return the bytes
*/
public int getBytes() {
return bytes;
}
/**
* @param bytes the bytes to set
*/
public void setBytes(int bytes) {
this.bytes = bytes;
}
}
| [
"carloshernandezarques@gmail.com"
] | carloshernandezarques@gmail.com |
93178741690c99ecd135d64435fdb9c718123445 | 1147e74b85f97bd94446db577af45525cf2a69e0 | /src/main/java/ru/gbax/messaging/controller/UserController.java | 9852754ef1e39673a6fa1090b035e188e85e3d4b | [] | no_license | gbax/messaging-rest-service | b52429766097d53040b0d38aa9d75723be98f6f5 | 6d7907264859974a4f353e4cee4e83746dc5c646 | refs/heads/master | 2021-01-25T12:14:05.503475 | 2015-07-26T14:59:23 | 2015-07-26T14:59:23 | 39,728,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,608 | java | package ru.gbax.messaging.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import ru.gbax.messaging.entity.User;
import ru.gbax.messaging.entity.model.ChangePasswordModel;
import ru.gbax.messaging.entity.model.CheckModel;
import ru.gbax.messaging.entity.model.RegistrationDataModel;
import ru.gbax.messaging.entity.model.UserModel;
import ru.gbax.messaging.exceptions.ServiceErrorException;
import ru.gbax.messaging.utils.AuthenticationProvider;
import ru.gbax.messaging.services.UserService;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.Writer;
import java.util.List;
/**
* Контроллер для работы с пользователями
*/
@Controller
@RequestMapping(value = "/user")
public class UserController {
private static final Logger logger = LoggerFactory.getLogger(UserController.class);
@Autowired
private UserService userService;
@Autowired
private AuthenticationProvider authenticationProvider;
/**
* Обработка ошибки на сервере
*
* @param e исключение ServiceErrorException
* @param writer поток для вывода сообщения
* @throws IOException
*/
@ExceptionHandler(ServiceErrorException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ResponseBody
public void handleException(final ServiceErrorException e, Writer writer) throws IOException {
logger.error(e.getMessage(), e);
writer.write(String.format("{\"error\":\"%s\"}", e.getMessage()));
}
@RequestMapping(value = "/checkDuplicate/{login}", method = RequestMethod.GET)
@ResponseBody
public CheckModel checkDuplicate(@PathVariable("login") String login) {
final List<User> usersByLogin = userService.getUsersByLogin(login);
return new CheckModel(usersByLogin.size() > 0);
}
@RequestMapping(value = "/getUsers", method = RequestMethod.GET)
@ResponseBody
public List<UserModel> getUsers() {
return userService.getUsers();
}
@RequestMapping(value = "/getUsersNotInList", method = RequestMethod.GET)
@ResponseBody
public List<UserModel> getUsersNotInList() {
return userService.getUsersNotInList();
}
@RequestMapping(value = "/addNew/{id}", method = RequestMethod.GET)
@ResponseBody
@ResponseStatus(HttpStatus.OK)
public void addNew(@PathVariable("id")Long id) {
userService.addNew(id);
}
@RequestMapping(value = "/deleteFromList/{id}", method = RequestMethod.DELETE)
@ResponseBody
@ResponseStatus(HttpStatus.OK)
public void deleteFromList(@PathVariable("id") Long id) {
userService.deleteFromList(id);
}
@RequestMapping(value = "/register", method = RequestMethod.POST)
@ResponseBody
public CheckModel register(@RequestBody RegistrationDataModel dataModel, HttpServletRequest request) throws ServiceErrorException {
userService.createUser(dataModel);
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(dataModel.getLogin(), dataModel.getPassword());
token.setDetails(new WebAuthenticationDetails(request));
Authentication authentication = this.authenticationProvider.authenticate(token);
logger.debug("Logging in with [{}]", authentication.getPrincipal());
SecurityContextHolder.getContext().setAuthentication(authentication);
return new CheckModel(true);
}
@RequestMapping(value = "/registerFromAdmin", method = RequestMethod.POST)
@ResponseBody
public CheckModel registerFromAdmin(@RequestBody RegistrationDataModel dataModel) throws ServiceErrorException {
userService.createUser(dataModel);
return new CheckModel(true);
}
@RequestMapping(value = "/changePassword", method = RequestMethod.POST)
@ResponseBody
public CheckModel changePassword(@RequestBody ChangePasswordModel changePasswordModel) throws ServiceErrorException {
return userService.changePassword(changePasswordModel);
}
}
| [
"headshrinker88@gmail.com"
] | headshrinker88@gmail.com |
21968bce9755e4c86a519ec491eb7d7177622c5e | dc5459ac2dfd8647cdbed41b2f41607f7007e660 | /app/src/main/java/com/vvm/sh/repositorios/ImagemRepositorio.java | 38c469bfc243c0181a51593340bfd2542644ca2e | [] | no_license | ArtemisSoftware/VVM-SH | 5961540712193620291ecf3427181579bb6229b9 | d433a6821bcd4c4f9a41ab25f664e72251b83d63 | refs/heads/master | 2021-07-05T06:57:05.535395 | 2021-02-22T15:53:14 | 2021-02-22T15:54:10 | 237,837,228 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,107 | java | package com.vvm.sh.repositorios;
import androidx.annotation.NonNull;
import com.vvm.sh.baseDados.dao.ImagemDao;
import com.vvm.sh.baseDados.dao.ResultadoDao;
import com.vvm.sh.baseDados.entidades.ImagemResultado;
import com.vvm.sh.ui.imagens.modelos.ImagemRegisto;
import com.vvm.sh.util.constantes.Identificadores;
import com.vvm.sh.util.constantes.TiposConstantes;
import java.util.List;
import io.reactivex.Completable;
import io.reactivex.Observable;
import io.reactivex.Single;
public class ImagemRepositorio implements Repositorio<ImagemResultado>{
private final ImagemDao imagemDao;
public final ResultadoDao resultadoDao;
public ImagemRepositorio(@NonNull ImagemDao imagemDao, @NonNull ResultadoDao resultadoDao) {
this.imagemDao = imagemDao;
this.resultadoDao = resultadoDao;
}
public Observable<List<ImagemRegisto>> obterImagemLevantamento(int idLevantamento) {
return imagemDao.obterImagemLevantamento(idLevantamento);
}
public Observable<List<ImagemRegisto>> obterGaleria(int id, int origem) {
return imagemDao.obterGaleria(id, origem);
}
public Observable<List<ImagemRegisto>> obterCapasRelatorio(int idTarefa) {
return imagemDao.obterGaleria(idTarefa);
}
public Completable fixarCapaRelatorio(int idTarefa, int idImagem){
Completable removerCapaRelatorio = imagemDao.removerCapaRelatorio(idTarefa);
Completable inserirCapaRelatorio = imagemDao.fixarCapaRelatorio(idImagem);
Completable completable = Completable.concatArray(removerCapaRelatorio, inserirCapaRelatorio);
return completable;
}
public Completable removerCapaRelatorio(int idTarefa){
return imagemDao.removerCapaRelatorio(idTarefa);
}
@Override
public Single<Long> inserir(ImagemResultado item) {
return imagemDao.inserir(item);
}
@Override
public Single<Integer> atualizar(ImagemResultado item) {
return null;
}
@Override
public Single<Integer> remover(ImagemResultado item) {
return imagemDao.remover(item);
}
}
| [
"gustavo.maia@b2b.com.pt"
] | gustavo.maia@b2b.com.pt |
1e5ee16cb687d538f37d5d4e04450bd29c89d902 | 9e8f669d216211ed25cd7208d25f918d8031a335 | /CCMS/src/main/java/com/kh/ccms/community/model/exception/CommunityException.java | b4a33a8b56009f2dc3f7ee16780c5db3e28d98c2 | [] | no_license | CleverCodeMonkeys/ALLIT | d3ce6dfde79a975a09de1e1877b71ca177ca4e6b | 6aa7823e66b7409f8ed5bcc1f7f237600a21d585 | refs/heads/master | 2020-03-24T23:11:33.771249 | 2018-08-08T09:03:38 | 2018-08-08T09:03:38 | 143,122,443 | 0 | 0 | null | 2018-08-08T09:03:39 | 2018-08-01T07:50:20 | JavaScript | UTF-8 | Java | false | false | 299 | java | package com.kh.ccms.community.model.exception;
public class CommunityException extends RuntimeException
{
private static final long serialVersionUID = 155L;
public CommunityException() {}
public CommunityException(String msg)
{
super("게시판 에러 발생" + msg);
}
}
| [
"user2@KH_H"
] | user2@KH_H |
a50f26aea04180f59b7e46109049f367bc080105 | ae9efe033a18c3d4a0915bceda7be2b3b00ae571 | /jambeth/jambeth-test/src/test/java/com/koch/ambeth/query/isin/QueryIsInMassdataTest.java | 1423d6ffcf352c794561fcc7899fb64f6c0814b7 | [
"Apache-2.0"
] | permissive | Dennis-Koch/ambeth | 0902d321ccd15f6dc62ebb5e245e18187b913165 | 8552b210b8b37d3d8f66bdac2e094bf23c8b5fda | refs/heads/develop | 2022-11-10T00:40:00.744551 | 2017-10-27T05:35:20 | 2017-10-27T05:35:20 | 88,013,592 | 0 | 4 | Apache-2.0 | 2022-09-22T18:02:18 | 2017-04-12T05:36:00 | Java | UTF-8 | Java | false | false | 5,089 | java | package com.koch.ambeth.query.isin;
/*-
* #%L
* jambeth-test
* %%
* Copyright (C) 2017 Koch Softwaredevelopment
* %%
* 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.
* #L%
*/
// package com.koch.ambeth.query.isin;
//
// import org.junit.Assert;
// import org.junit.Test;
// import org.junit.experimental.categories.Category;
//
// import com.koch.ambeth.config.ServiceConfigurationConstants;
// import com.koch.ambeth.ioc.annotation.Autowired;
// import com.koch.ambeth.persistence.config.PersistenceConfigurationConstants;
// import com.koch.ambeth.testutil.AbstractInformationBusWithPersistenceTest;
// import com.koch.ambeth.testutil.SQLData;
// import com.koch.ambeth.testutil.SQLDataRebuild;
// import com.koch.ambeth.testutil.SQLStructure;
// import com.koch.ambeth.testutil.TestModule;
// import com.koch.ambeth.testutil.TestProperties;
// import com.koch.ambeth.testutil.TestPropertiesList;
// import com.koch.ambeth.testutil.category.PerformanceTests;
//
// @Category(PerformanceTests.class)
// @TestModule(QueryIsInMassdataTestModule.class)
// @SQLDataRebuild(false)
// @SQLData("QueryIsInMassdata_data.sql")
// @SQLStructure("QueryIsInMassdata_structure.sql")
// @TestPropertiesList({
// @TestProperties(name = PersistenceConfigurationConstants.AutoIndexForeignKeys, value = "false"),
// @TestProperties(name = PersistenceConfigurationConstants.DatabasePoolMaxUsed, value = "20"),
// @TestProperties(name = ServiceConfigurationConstants.mappingFile, value =
// "com/koch/ambeth/query/isin/QueryIsInMassdata_orm.xml"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.cache.DefaultPersistenceCacheRetriever",
// value = "INFO"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.filter.PagingQuery", value = "INFO"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.orm.XmlDatabaseMapper", value = "INFO"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.persistence.EntityLoader", value =
// "INFO"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.persistence.jdbc.JdbcTable", value =
// "INFO"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.persistence.jdbc.JDBCDatabaseWrapper",
// value = "INFO"),
// // @TestProperties(name =
// "ambeth.log.level.com.koch.ambeth.persistence.jdbc.connection.LogPreparedStatementInterceptor",
// value = "INFO"),
// @TestProperties(name =
// "ambeth.log.level.com.koch.ambeth.persistence.jdbc.connection.LogStatementInterceptor", value =
// "INFO"),
// @TestProperties(name =
// "ambeth.log.level.com.koch.ambeth.persistence.jdbc.database.JdbcTransaction", value = "INFO"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.proxy.AbstractCascadePostProcessor",
// value = "INFO"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.cache.CacheLocalDataChangeListener",
// value = "INFO"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.cache.FirstLevelCacheManager", value =
// "INFO"),
// @TestProperties(name = "ambeth.log.level.com.koch.ambeth.service.MergeService", value = "INFO")
// })
// public class QueryIsInMassdataTest extends AbstractInformationBusWithPersistenceTest
// {
// protected static long timeForEquals = 0;
//
// protected static long timeForIsIn = 0;
//
// @Autowired
// protected IChildService childService;
//
// @Test
// public void testTimeForEquals() throws Exception
// {
// long start = System.currentTimeMillis();
// for (int a = 100; a-- > 0;)
// {
// childService.searchForParentWithEquals(10001);
// }
// timeForEquals = System.currentTimeMillis() - start;
// checkTimes();
// }
//
// @Test
// public void testTimeForIsIn() throws Exception
// {
// long start = System.currentTimeMillis();
// for (int a = 100; a-- > 0;)
// {
// childService.getForParentWithIsIn(10002);
// }
// timeForIsIn = System.currentTimeMillis() - start;
// checkTimes();
// }
//
// @Test
// public void testTimeForIsInMoreThan4000() throws Exception
// {
// int[] parentIds = new int[4005]; // Force UNION > 4000
// for (int a = parentIds.length; a-- > 0;)
// {
// parentIds[a] = 10000 + a;
// }
// long start = System.currentTimeMillis();
// childService.getForParentWithIsIn(parentIds);
// timeForIsIn = System.currentTimeMillis() - start;
// checkTimes();
// }
//
// private void checkTimes()
// {
// if (timeForEquals > 0 && timeForIsIn > 0)
// {
// if (timeForEquals < 50)
// {
// Assert.fail("Difference not significant. Use a larger number of entities.");
// }
// if (timeForIsIn > timeForEquals * 1.5)
// {
// Assert.fail("IsIn is to slow: timeForEquals = " + timeForEquals + ", timeForIsIn = " +
// timeForIsIn);
// }
// }
// }
// }
| [
"dennis.koch@bruker.com"
] | dennis.koch@bruker.com |
2e47988898ef68a28c6e4a5be2cc442a4004487f | 26dcf8b7189b608af966cfbc696a5b7b80f25c16 | /core/src/main/java/org/helpj/core/FullPrunedBlockChain.java | a4830b9f7ab7dcf5b05a98c707c3f62099d91dbf | [
"Apache-2.0"
] | permissive | GoHelpFund/helpj | e1d36e4cb24ae90e91b0793ba621006adb978eb3 | 90026e78853254b54caa3a20351939454c84bd10 | refs/heads/master | 2022-10-16T09:14:04.719335 | 2019-09-26T10:00:33 | 2019-09-26T10:00:33 | 210,832,057 | 0 | 0 | Apache-2.0 | 2022-10-05T03:31:42 | 2019-09-25T11:49:33 | Java | UTF-8 | Java | false | false | 27,696 | java | /*
* Copyright 2012 Matt Corallo.
* Copyright 2014 Andreas Schildbach
*
* 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.helpj.core;
import org.helpj.governance.Superblock;
import org.helpj.script.Script;
import org.helpj.script.Script.VerifyFlag;
import org.helpj.store.BlockStoreException;
import org.helpj.store.FullPrunedBlockStore;
import org.helpj.utils.*;
import org.helpj.wallet.Wallet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;
import java.util.concurrent.*;
import static com.google.common.base.Preconditions.checkState;
/**
* <p>A FullPrunedBlockChain works in conjunction with a {@link FullPrunedBlockStore} to verify all the rules of the
* Bitcoin system, with the downside being a large cost in system resources. Fully verifying means all unspent
* transaction outputs are stored. Once a transaction output is spent and that spend is buried deep enough, the data
* related to it is deleted to ensure disk space usage doesn't grow forever. For this reason a pruning node cannot
* serve the full block chain to other clients, but it nevertheless provides the same security guarantees as Bitcoin
* Core does.</p>
*/
public class FullPrunedBlockChain extends AbstractBlockChain {
private static final Logger log = LoggerFactory.getLogger(FullPrunedBlockChain.class);
/**
* Keeps a map of block hashes to StoredBlocks.
*/
protected final FullPrunedBlockStore blockStore;
// Whether or not to execute scriptPubKeys before accepting a transaction (i.e. check signatures).
private boolean runScripts = true;
/**
* Constructs a block chain connected to the given wallet and store. To obtain a {@link Wallet} you can construct
* one from scratch, or you can deserialize a saved wallet from disk using
* {@link Wallet#loadFromFile(java.io.File, WalletExtension...)}
*/
public FullPrunedBlockChain(Context context, Wallet wallet, FullPrunedBlockStore blockStore) throws BlockStoreException {
this(context, new ArrayList<Wallet>(), blockStore);
addWallet(wallet);
}
/**
* Constructs a block chain connected to the given wallet and store. To obtain a {@link Wallet} you can construct
* one from scratch, or you can deserialize a saved wallet from disk using
* {@link Wallet#loadFromFile(java.io.File, WalletExtension...)}
*/
public FullPrunedBlockChain(NetworkParameters params, Wallet wallet, FullPrunedBlockStore blockStore) throws BlockStoreException {
this(Context.getOrCreate(params), wallet, blockStore);
}
/**
* Constructs a block chain connected to the given store.
*/
public FullPrunedBlockChain(Context context, FullPrunedBlockStore blockStore) throws BlockStoreException {
this(context, new ArrayList<Wallet>(), blockStore);
}
/**
* See {@link #FullPrunedBlockChain(Context, Wallet, FullPrunedBlockStore)}
*/
public FullPrunedBlockChain(NetworkParameters params, FullPrunedBlockStore blockStore) throws BlockStoreException {
this(Context.getOrCreate(params), blockStore);
}
/**
* Constructs a block chain connected to the given list of wallets and a store.
*/
public FullPrunedBlockChain(Context context, List<Wallet> listeners, FullPrunedBlockStore blockStore) throws BlockStoreException {
super(context, listeners, blockStore);
this.blockStore = blockStore;
// Ignore upgrading for now
this.chainHead = blockStore.getVerifiedChainHead();
}
/**
* See {@link #FullPrunedBlockChain(Context, List, FullPrunedBlockStore)}
*/
public FullPrunedBlockChain(NetworkParameters params, List<Wallet> listeners,
FullPrunedBlockStore blockStore) throws BlockStoreException {
this(Context.getOrCreate(params), listeners, blockStore);
}
@Override
protected StoredBlock addToBlockStore(StoredBlock storedPrev, Block header, TransactionOutputChanges txOutChanges)
throws BlockStoreException, VerificationException {
StoredBlock newBlock = storedPrev.build(header);
blockStore.put(newBlock, new StoredUndoableBlock(newBlock.getHeader().getHash(), txOutChanges));
return newBlock;
}
@Override
protected StoredBlock addToBlockStore(StoredBlock storedPrev, Block block)
throws BlockStoreException, VerificationException {
StoredBlock newBlock = storedPrev.build(block);
blockStore.put(newBlock, new StoredUndoableBlock(newBlock.getHeader().getHash(), block.transactions));
return newBlock;
}
@Override
protected void rollbackBlockStore(int height) throws BlockStoreException {
throw new BlockStoreException("Unsupported");
}
@Override
protected boolean shouldVerifyTransactions() {
return true;
}
/**
* Whether or not to run scripts whilst accepting blocks (i.e. checking signatures, for most transactions).
* If you're accepting data from an untrusted node, such as one found via the P2P network, this should be set
* to true (which is the default). If you're downloading a chain from a node you control, script execution
* is redundant because you know the connected node won't relay bad data to you. In that case it's safe to set
* this to false and obtain a significant speedup.
*/
public void setRunScripts(boolean value) {
this.runScripts = value;
}
// TODO: Remove lots of duplicated code in the two connectTransactions
// TODO: execute in order of largest transaction (by input count) first
ExecutorService scriptVerificationExecutor = Executors.newFixedThreadPool(
Runtime.getRuntime().availableProcessors(), new ContextPropagatingThreadFactory("Script verification"));
/**
* A job submitted to the executor which verifies signatures.
*/
private static class Verifier implements Callable<VerificationException> {
final Transaction tx;
final List<Script> prevOutScripts;
final Set<VerifyFlag> verifyFlags;
public Verifier(final Transaction tx, final List<Script> prevOutScripts, final Set<VerifyFlag> verifyFlags) {
this.tx = tx;
this.prevOutScripts = prevOutScripts;
this.verifyFlags = verifyFlags;
}
@Nullable
@Override
public VerificationException call() throws Exception {
try {
ListIterator<Script> prevOutIt = prevOutScripts.listIterator();
for (int index = 0; index < tx.getInputs().size(); index++) {
tx.getInputs().get(index).getScriptSig().correctlySpends(tx, index, prevOutIt.next(), verifyFlags);
}
} catch (VerificationException e) {
return e;
}
return null;
}
}
/**
* Get the {@link Script} from the script bytes or return Script of empty byte array.
*/
private Script getScript(byte[] scriptBytes) {
try {
return new Script(scriptBytes);
} catch (Exception e) {
return new Script(new byte[0]);
}
}
/**
* Get the address from the {@link Script} if it exists otherwise return empty string "".
*
* @param script The script.
* @return The address.
*/
private String getScriptAddress(@Nullable Script script) {
String address = "";
try {
if (script != null) {
address = script.getToAddress(params, true).toString();
}
} catch (Exception e) {
}
return address;
}
@Override
protected TransactionOutputChanges connectTransactions(int height, Block block, StoredBlock storedPrev)
throws VerificationException, BlockStoreException {
checkState(lock.isHeldByCurrentThread());
if (block.transactions == null)
throw new RuntimeException("connectTransactions called with Block that didn't have transactions!");
if (!params.passesCheckpoint(height, block.getHash()))
throw new VerificationException("Block failed checkpoint lockin at " + height);
blockStore.beginDatabaseBatchWrite();
LinkedList<UTXO> txOutsSpent = new LinkedList<UTXO>();
LinkedList<UTXO> txOutsCreated = new LinkedList<UTXO>();
long sigOps = 0;
if (scriptVerificationExecutor.isShutdown())
scriptVerificationExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
List<Future<VerificationException>> listScriptVerificationResults = new ArrayList<Future<VerificationException>>(block.transactions.size());
try {
if (!params.isCheckpoint(height)) {
// BIP30 violator blocks are ones that contain a duplicated transaction. They are all in the
// checkpoints list and we therefore only check non-checkpoints for duplicated transactions here. See the
// BIP30 document for more details on this: https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki
for (Transaction tx : block.transactions) {
final Set<VerifyFlag> verifyFlags = params.getTransactionVerificationFlags(block, tx, getVersionTally(), height);
Sha256Hash hash = tx.getHash();
// If we already have unspent outputs for this hash, we saw the tx already. Either the block is
// being added twice (bug) or the block is a BIP30 violator.
if (blockStore.hasUnspentOutputs(hash, tx.getOutputs().size()))
throw new VerificationException("Block failed BIP30 test!");
if (verifyFlags.contains(VerifyFlag.P2SH)) // We already check non-BIP16 sigops in Block.verifyTransactions(true)
sigOps += tx.getSigOpCount();
}
}
Coin totalFees = Coin.ZERO;
Coin coinbaseValue = null;
for (final Transaction tx : block.transactions) {
boolean isCoinBase = tx.isCoinBase();
Coin valueIn = Coin.ZERO;
Coin valueOut = Coin.ZERO;
final List<Script> prevOutScripts = new LinkedList<Script>();
final Set<VerifyFlag> verifyFlags = params.getTransactionVerificationFlags(block, tx, getVersionTally(), height);
if (!isCoinBase) {
// For each input of the transaction remove the corresponding output from the set of unspent
// outputs.
for (int index = 0; index < tx.getInputs().size(); index++) {
TransactionInput in = tx.getInputs().get(index);
UTXO prevOut = blockStore.getTransactionOutput(in.getOutpoint().getHash(),
in.getOutpoint().getIndex());
if (prevOut == null)
throw new VerificationException("Attempted to spend a non-existent or already spent output!");
// Coinbases can't be spent until they mature, to avoid re-orgs destroying entire transaction
// chains. The assumption is there will ~never be re-orgs deeper than the spendable coinbase
// chain depth.
if (prevOut.isCoinbase()) {
if (height - prevOut.getHeight() < params.getSpendableCoinbaseDepth()) {
throw new VerificationException("Tried to spend coinbase at depth " + (height - prevOut.getHeight()));
}
}
// TODO: Check we're not spending the genesis transaction here. Bitcoin Core won't allow it.
valueIn = valueIn.add(prevOut.getValue());
if (verifyFlags.contains(VerifyFlag.P2SH)) {
if (prevOut.getScript().isPayToScriptHash())
sigOps += Script.getP2SHSigOpCount(in.getScriptBytes());
if (sigOps > (height >= params.getDIP0001BlockHeight() ? Block.MAX_BLOCK_SIGOPS_DIP00001 :Block.MAX_BLOCK_SIGOPS))
throw new VerificationException("Too many P2SH SigOps in block");
}
prevOutScripts.add(prevOut.getScript());
blockStore.removeUnspentTransactionOutput(prevOut);
txOutsSpent.add(prevOut);
}
}
Sha256Hash hash = tx.getHash();
for (TransactionOutput out : tx.getOutputs()) {
valueOut = valueOut.add(out.getValue());
// For each output, add it to the set of unspent outputs so it can be consumed in future.
Script script = getScript(out.getScriptBytes());
UTXO newOut = new UTXO(hash,
out.getIndex(),
out.getValue(),
height, isCoinBase,
script,
getScriptAddress(script));
blockStore.addUnspentTransactionOutput(newOut);
txOutsCreated.add(newOut);
}
// All values were already checked for being non-negative (as it is verified in Transaction.verify())
// but we check again here just for defence in depth. Transactions with zero output value are OK.
if (valueOut.signum() < 0 || valueOut.compareTo(params.getMaxMoney()) > 0)
throw new VerificationException("Transaction output value out of range");
if (isCoinBase) {
coinbaseValue = valueOut;
} else {
if (valueIn.compareTo(valueOut) < 0 || valueIn.compareTo(params.getMaxMoney()) > 0)
throw new VerificationException("Transaction input value out of range");
totalFees = totalFees.add(valueIn.subtract(valueOut));
}
if (!isCoinBase && runScripts) {
// Because correctlySpends modifies transactions, this must come after we are done with tx
FutureTask<VerificationException> future = new FutureTask<VerificationException>(new Verifier(tx, prevOutScripts, verifyFlags));
scriptVerificationExecutor.execute(future);
listScriptVerificationResults.add(future);
}
}
boolean feesDontMatch = block.getBlockInflation(height, storedPrev.getHeader().getDifficultyTarget(), false).add(totalFees).compareTo(coinbaseValue) < 0;
if (totalFees.compareTo(params.getMaxMoney()) > 0 || feesDontMatch) {
if(feesDontMatch && !Superblock.isValidBudgetBlockHeight(params, height))
throw new VerificationException("Transaction fees out of range");
}
for (Future<VerificationException> future : listScriptVerificationResults) {
VerificationException e;
try {
e = future.get();
} catch (InterruptedException thrownE) {
throw new RuntimeException(thrownE); // Shouldn't happen
} catch (ExecutionException thrownE) {
log.error("Script.correctlySpends threw a non-normal exception: " + thrownE.getCause());
throw new VerificationException("Bug in Script.correctlySpends, likely script malformed in some new and interesting way.", thrownE);
}
if (e != null)
throw e;
}
} catch (VerificationException e) {
scriptVerificationExecutor.shutdownNow();
blockStore.abortDatabaseBatchWrite();
throw e;
} catch (BlockStoreException e) {
scriptVerificationExecutor.shutdownNow();
blockStore.abortDatabaseBatchWrite();
throw e;
}
return new TransactionOutputChanges(txOutsCreated, txOutsSpent);
}
/**
* Used during reorgs to connect a block previously on a fork
*/
@Override
protected synchronized TransactionOutputChanges connectTransactions(StoredBlock newBlock, StoredBlock storedPrev)
throws VerificationException, BlockStoreException, PrunedException {
checkState(lock.isHeldByCurrentThread());
if (!params.passesCheckpoint(newBlock.getHeight(), newBlock.getHeader().getHash()))
throw new VerificationException("Block failed checkpoint lockin at " + newBlock.getHeight());
blockStore.beginDatabaseBatchWrite();
StoredUndoableBlock block = blockStore.getUndoBlock(newBlock.getHeader().getHash());
if (block == null) {
// We're trying to re-org too deep and the data needed has been deleted.
blockStore.abortDatabaseBatchWrite();
throw new PrunedException(newBlock.getHeader().getHash());
}
TransactionOutputChanges txOutChanges;
try {
List<Transaction> transactions = block.getTransactions();
if (transactions != null) {
LinkedList<UTXO> txOutsSpent = new LinkedList<UTXO>();
LinkedList<UTXO> txOutsCreated = new LinkedList<UTXO>();
long sigOps = 0;
if (!params.isCheckpoint(newBlock.getHeight())) {
for (Transaction tx : transactions) {
Sha256Hash hash = tx.getHash();
if (blockStore.hasUnspentOutputs(hash, tx.getOutputs().size()))
throw new VerificationException("Block failed BIP30 test!");
}
}
Coin totalFees = Coin.ZERO;
Coin coinbaseValue = null;
if (scriptVerificationExecutor.isShutdown())
scriptVerificationExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
List<Future<VerificationException>> listScriptVerificationResults = new ArrayList<Future<VerificationException>>(transactions.size());
for (final Transaction tx : transactions) {
final Set<VerifyFlag> verifyFlags =
params.getTransactionVerificationFlags(newBlock.getHeader(), tx, getVersionTally(), Integer.SIZE);
boolean isCoinBase = tx.isCoinBase();
Coin valueIn = Coin.ZERO;
Coin valueOut = Coin.ZERO;
final List<Script> prevOutScripts = new LinkedList<Script>();
if (!isCoinBase) {
for (int index = 0; index < tx.getInputs().size(); index++) {
final TransactionInput in = tx.getInputs().get(index);
final UTXO prevOut = blockStore.getTransactionOutput(in.getOutpoint().getHash(),
in.getOutpoint().getIndex());
if (prevOut == null)
throw new VerificationException("Attempted spend of a non-existent or already spent output!");
if (prevOut.isCoinbase() && newBlock.getHeight() - prevOut.getHeight() < params.getSpendableCoinbaseDepth())
throw new VerificationException("Tried to spend coinbase at depth " + (newBlock.getHeight() - prevOut.getHeight()));
valueIn = valueIn.add(prevOut.getValue());
if (verifyFlags.contains(VerifyFlag.P2SH)) {
if (prevOut.getScript().isPayToScriptHash())
sigOps += Script.getP2SHSigOpCount(in.getScriptBytes());
if (sigOps > (newBlock.getHeight() >= params.getDIP0001BlockHeight() ? Block.MAX_BLOCK_SIGOPS_DIP00001 :Block.MAX_BLOCK_SIGOPS))
throw new VerificationException("Too many P2SH SigOps in block");
}
// TODO: Enforce DER signature format
prevOutScripts.add(prevOut.getScript());
blockStore.removeUnspentTransactionOutput(prevOut);
txOutsSpent.add(prevOut);
}
}
Sha256Hash hash = tx.getHash();
for (TransactionOutput out : tx.getOutputs()) {
valueOut = valueOut.add(out.getValue());
Script script = getScript(out.getScriptBytes());
UTXO newOut = new UTXO(hash,
out.getIndex(),
out.getValue(),
newBlock.getHeight(),
isCoinBase,
script,
getScriptAddress(script));
blockStore.addUnspentTransactionOutput(newOut);
txOutsCreated.add(newOut);
}
// All values were already checked for being non-negative (as it is verified in Transaction.verify())
// but we check again here just for defence in depth. Transactions with zero output value are OK.
if (valueOut.signum() < 0 || valueOut.compareTo(params.getMaxMoney()) > 0)
throw new VerificationException("Transaction output value out of range");
if (isCoinBase) {
coinbaseValue = valueOut;
} else {
if (valueIn.compareTo(valueOut) < 0 || valueIn.compareTo(params.getMaxMoney()) > 0)
throw new VerificationException("Transaction input value out of range");
totalFees = totalFees.add(valueIn.subtract(valueOut));
}
if (!isCoinBase) {
// Because correctlySpends modifies transactions, this must come after we are done with tx
FutureTask<VerificationException> future = new FutureTask<VerificationException>(new Verifier(tx, prevOutScripts, verifyFlags));
scriptVerificationExecutor.execute(future);
listScriptVerificationResults.add(future);
}
}
boolean feesDontMatch = newBlock.getHeader().getBlockInflation(newBlock.getHeight(), storedPrev.getHeader().getDifficultyTarget(), false).add(totalFees).compareTo(coinbaseValue) < 0;
if (totalFees.compareTo(params.getMaxMoney()) > 0 || feesDontMatch) {
if(feesDontMatch && !Superblock.isValidBudgetBlockHeight(params, newBlock.getHeight()))
throw new VerificationException("Transaction fees out of range");
}
txOutChanges = new TransactionOutputChanges(txOutsCreated, txOutsSpent);
for (Future<VerificationException> future : listScriptVerificationResults) {
VerificationException e;
try {
e = future.get();
} catch (InterruptedException thrownE) {
throw new RuntimeException(thrownE); // Shouldn't happen
} catch (ExecutionException thrownE) {
log.error("Script.correctlySpends threw a non-normal exception: " + thrownE.getCause());
throw new VerificationException("Bug in Script.correctlySpends, likely script malformed in some new and interesting way.", thrownE);
}
if (e != null)
throw e;
}
} else {
txOutChanges = block.getTxOutChanges();
if (!params.isCheckpoint(newBlock.getHeight()))
for (UTXO out : txOutChanges.txOutsCreated) {
Sha256Hash hash = out.getHash();
if (blockStore.getTransactionOutput(hash, out.getIndex()) != null)
throw new VerificationException("Block failed BIP30 test!");
}
for (UTXO out : txOutChanges.txOutsCreated)
blockStore.addUnspentTransactionOutput(out);
for (UTXO out : txOutChanges.txOutsSpent)
blockStore.removeUnspentTransactionOutput(out);
}
} catch (VerificationException e) {
scriptVerificationExecutor.shutdownNow();
blockStore.abortDatabaseBatchWrite();
throw e;
} catch (BlockStoreException e) {
scriptVerificationExecutor.shutdownNow();
blockStore.abortDatabaseBatchWrite();
throw e;
}
return txOutChanges;
}
/**
* This is broken for blocks that do not pass BIP30, so all BIP30-failing blocks which are allowed to fail BIP30
* must be checkpointed.
*/
@Override
protected void disconnectTransactions(StoredBlock oldBlock) throws PrunedException, BlockStoreException {
checkState(lock.isHeldByCurrentThread());
blockStore.beginDatabaseBatchWrite();
try {
StoredUndoableBlock undoBlock = blockStore.getUndoBlock(oldBlock.getHeader().getHash());
if (undoBlock == null) throw new PrunedException(oldBlock.getHeader().getHash());
TransactionOutputChanges txOutChanges = undoBlock.getTxOutChanges();
for (UTXO out : txOutChanges.txOutsSpent)
blockStore.addUnspentTransactionOutput(out);
for (UTXO out : txOutChanges.txOutsCreated)
blockStore.removeUnspentTransactionOutput(out);
} catch (PrunedException e) {
blockStore.abortDatabaseBatchWrite();
throw e;
} catch (BlockStoreException e) {
blockStore.abortDatabaseBatchWrite();
throw e;
}
}
@Override
protected void doSetChainHead(StoredBlock chainHead) throws BlockStoreException {
checkState(lock.isHeldByCurrentThread());
blockStore.setVerifiedChainHead(chainHead);
blockStore.commitDatabaseBatchWrite();
}
@Override
protected void notSettingChainHead() throws BlockStoreException {
blockStore.abortDatabaseBatchWrite();
}
@Override
protected StoredBlock getStoredBlockInCurrentScope(Sha256Hash hash) throws BlockStoreException {
checkState(lock.isHeldByCurrentThread());
return blockStore.getOnceUndoableStoredBlock(hash);
}
}
| [
"github@tirzuman.com"
] | github@tirzuman.com |
18245f4c31a98571c5ae0e3cb0cc50bc1a6ccd7b | c08d42122b0e3bf038e7af31e302d20589c86e32 | /src/main/java/com/xiaxinyu/java/clazz/layout/ClassLayoutTest.java | e2540ec3e6f6df77ce7f5f44c5f26040478ad266 | [
"Apache-2.0"
] | permissive | xiaxinyu/java-core | 6540f015108ae89207b7963b8780c99781ab9f5f | 8980ee6df818c27884026a8737754b35a092f1db | refs/heads/master | 2023-03-31T22:41:08.319295 | 2020-09-29T03:41:31 | 2020-09-29T03:41:31 | 281,342,827 | 1 | 0 | Apache-2.0 | 2021-03-31T22:11:29 | 2020-07-21T08:38:56 | Java | UTF-8 | Java | false | false | 893 | java | package com.xiaxinyu.java.clazz.layout;
import lombok.extern.slf4j.Slf4j;
import org.openjdk.jol.info.ClassLayout;
//import org.openjdk.jol.info.ClassLayout;
/**
* Java 对象布局工具类
*
* @author XIAXINYU3
* @date 2019.12.28
*/
@Slf4j
public class ClassLayoutTest {
//开启(-XX:+UseCompressedOops) 可以压缩指针。
//关闭(-XX:-UseCompressedOops) 可以关闭压缩指针。
public static void print(Object object) {
log.info("HasCode Hex: {}", Integer.toHexString(object.hashCode()));
String layout = ClassLayout.parseInstance(object).toPrintable();
log.info(layout);
}
public static void main(String[] args) {
Object obj = new Object();
print(obj);
System.out.println("******************************************************");
synchronized (obj) {
print(obj);
}
}
}
| [
"xiaxinyu3@crc.com.hk"
] | xiaxinyu3@crc.com.hk |
b0ab90e50bfa61f44ff4082f27d26afa76de9be3 | 1b5d6d0f4830ad26d9099532e06a7a942909c6d1 | /src/uebung_3/TopLevelDemo_v2.java | ba3536a30c9c5c8c33b1e84e44444459ac0490a2 | [] | no_license | matzekFloyd/EPRO3_3 | f48da25341bdae9a7ad16bcc9f2b1e5fef7d8f47 | 8dc53de2b70226b45e7dab490fab6be83099945e | refs/heads/master | 2021-06-09T04:58:25.828351 | 2016-11-25T21:38:43 | 2016-11-25T21:38:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,538 | java | package uebung_3;
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Oracle or the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import static javax.swing.JFrame.EXIT_ON_CLOSE;
/* TopLevelDemo.java requires no other files. */
public class TopLevelDemo_v2 extends JPanel implements ActionListener {
public String bla;
//Deklaration der Instanzvariablen
JLabel yellowLabel = new JLabel();
GeoPainterEK ge;
GraphicsGenerator gg;
int depthcounter = 0;
//Konstruktor
TopLevelDemo_v2() {
yellowLabel.setOpaque(true);
yellowLabel.setBackground(new Color(248, 213, 131));
//yellowLabel.setPreferredSize(new Dimension(200, 180));
yellowLabel.setPreferredSize(new Dimension(500, 500));
//Hinzufuegen des Labels
add(yellowLabel);
ge = new GeoPainterEK();
gg = new GraphicsGenerator(ge.shapesToPaint);
}
public JMenuBar createMenuBar() {
//Create the menu bar. Make it have a green background.
JMenuBar greenMenuBar = new JMenuBar();
greenMenuBar.setOpaque(true);
greenMenuBar.setBackground(new Color(154, 165, 127));
greenMenuBar.setPreferredSize(new Dimension(200, 20));
//Menupunkt hinzufuegen
JMenu menu_file = new JMenu("Farbe");
JMenu menu_file_shape = new JMenu("Form");
greenMenuBar.add(menu_file);
greenMenuBar.add(menu_file_shape);
//Menueeintraege hinzufuegen
JMenuItem item_rot = new JMenuItem("Rot");
JMenuItem item_gruen = new JMenuItem("Gruen");
JMenuItem item_blau = new JMenuItem("Blau");
JMenuItem item_kreis = new JMenuItem("Kreis");
JMenuItem item_rechteck = new JMenuItem("Rechteck");
//1. ActionListener fuer Open anh�ngen
item_rot.addActionListener(this);
item_gruen.addActionListener(this);
item_blau.addActionListener(this);
item_kreis.addActionListener(this);
item_rechteck.addActionListener(this);
menu_file.add(item_rot);
menu_file.add(item_gruen);
menu_file.add(item_blau);
menu_file_shape.add(item_kreis);
menu_file_shape.add(item_rechteck);
// JMenuBar grrenMenuBar zur�ckgeben
return greenMenuBar;
}
/**
* Create the GUI and show it. For thread safety, this method should be
* invoked from the event-dispatching thread. Problem: Das muss eine
* statische Methode sein, um thread-save aufgerufen werden zu koennen
* (siehe Methode main()). Allerdings, eine statische Methode kann nicht mit
* den Instanzvariablen der Klasse interagieren. Wir umgehen das, indem wir
* von JPanel erben, und dieses als ContentPane in unseren Frame geben.
*/
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("TopLevelDemo Version 2");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
/* JPanel MiniPhotoShop als ContentPane, this nicht m�gloch, umweg */
TopLevelDemo_v2 ourTopLevelDemo = new TopLevelDemo_v2();
//Damit k�nnen wir jede Komponente in unserer Hauptklasse adden!
Container pane = frame.getContentPane();
pane.add(ourTopLevelDemo.ge.lp);
frame.setTitle("Simple example");
frame.setSize(1000, 1000);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.setJMenuBar(ourTopLevelDemo.createMenuBar());
//Display the window.
//frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
@Override
public void actionPerformed(ActionEvent e) {
JMenuItem itemClicked;
//Falls es ein MenuItem ist
if (e.getSource() instanceof JMenuItem) {
itemClicked = (JMenuItem) e.getSource();
//Falls es das Item "Rot" war
if (itemClicked.getText() == "Rot") {
yellowLabel.setOpaque(true);
yellowLabel.setBackground(new Color(255, 0, 0));
//Wenn Hintergrundfarbe gewechselt wird, lösche alle im Moment
//gezeichneten Formen
gg.shapesToPaint.clear();
}
if (itemClicked.getText() == "Gruen") {
yellowLabel.setOpaque(true);
yellowLabel.setBackground(new Color(0, 255, 0));
//Wenn Hintergrundfarbe gewechselt wird, lösche alle im Moment
//gezeichneten Formen
gg.shapesToPaint.clear();
}
if (itemClicked.getText() == "Blau") {
yellowLabel.setOpaque(true);
yellowLabel.setBackground(new Color(0, 0, 255));
//Wenn Hintergrundfarbe gewechselt wird, lösche alle im Moment
//gezeichneten Formen
gg.shapesToPaint.clear();
}
if (itemClicked.getText() == "Kreis") {
ge.addCircle(ge.randomPosition(), ge.randomSize(), ge.randomColor(), depthcounter);
//ge.addRandomCircle();
//System.out.println(newCircle.toString());
gg.paintComponent(getGraphics());
depthcounter = depthcounter + 1;
}
if (itemClicked.getText() == "Rechteck") {
ge.addRectangle(ge.randomPosition(), ge.randomPosition(), ge.randomColor(),depthcounter);
//ge.addRandomRectangle();
//System.out.println(newCircle.toString());
gg.paintComponent(getGraphics());
depthcounter = depthcounter + 1;
}
}
}
}
| [
"mathiaspmayrhofer@gmail.com"
] | mathiaspmayrhofer@gmail.com |
6e3eab32ae973030147d7b719e52a11c2f93a76a | c691222c33bf8c2e2a7874a006de570cd7360111 | /src/modulo-05-java/lavanderia/src/main/java/br/com/cwi/crescer/controller/pedido/PedidoFinalizarController.java | ab77fde86870dd109a7e24fc0682afe2353578dd | [] | no_license | angelovianajr/crescer-2015-2 | a9edf0df61c242a40a68d830c9559c4bf289779e | 899f5803a150c2a2ddfe0fe58f2712232c8719eb | refs/heads/master | 2021-05-30T09:18:36.010742 | 2015-12-01T16:22:01 | 2015-12-01T16:22:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,015 | java | package br.com.cwi.crescer.controller.pedido;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import br.com.cwi.crescer.domain.Pedido.SituacaoPedido;
import br.com.cwi.crescer.dto.PedidoDTO;
import br.com.cwi.crescer.service.pedido.PedidoService;
@Controller
@RequestMapping("/pedidos")
public class PedidoFinalizarController {
private PedidoService pedidoService;
@Autowired
public PedidoFinalizarController(PedidoService pedidoService) {
this.pedidoService = pedidoService;
}
@PreAuthorize("hasRole('ADMIN')")
@RequestMapping(path = "/cancelar", method = RequestMethod.POST)
public ModelAndView cancelar(@ModelAttribute("pedido") PedidoDTO pedidoDTO,
final RedirectAttributes redirectAttributes){
pedidoService.cancelarPedido(pedidoDTO.getId());
redirectAttributes.addFlashAttribute("sucesso", "Pedido cancelado com sucesso");
return new ModelAndView("redirect:/pedidos");
}
@RequestMapping(path = "/encerrar", method = RequestMethod.POST)
public ModelAndView encerrar(@ModelAttribute("pedido") PedidoDTO pedidoDTO,
final RedirectAttributes redirectAttributes){
try {
pedidoService.retirarPedido(pedidoDTO.getId());
redirectAttributes.addFlashAttribute("sucesso", "Pedido encerrado com sucesso");
} catch (Exception e) {
redirectAttributes.addFlashAttribute("sucesso", "O Pedido precisa estar PROCESSADO para ser encerrado");
}
return new ModelAndView("redirect:/pedidos");
}
@ModelAttribute("situacoes")
public SituacaoPedido[] comboSituacoes() {
return SituacaoPedido.values();
}
}
| [
"angelojunior50@yahoo.com.br"
] | angelojunior50@yahoo.com.br |
cbd7ea5c52b2d601b65464a208c4ab78efd5892f | 01af2d00bb54f91d3b44d2d4d0b77fe234f1e119 | /recommendation-service/src/main/java/se/magnus/microservices/core/recommendation/services/RecommendationServiceImpl.java | a06c6aebde9b697448c349e3f4cf8dfcaac93bfc | [] | no_license | cirovladimir/microservices-book | 20b3892007b82ca9243beed663c04d9e791fa30b | b7098352254718b5b65b6dbe441963628e825f74 | refs/heads/main | 2023-05-14T18:47:23.503842 | 2021-06-03T05:23:49 | 2021-06-03T05:23:49 | 363,213,302 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,991 | java | package se.magnus.microservices.core.recommendation.services;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import se.magnus.microservices.api.recommendation.Recommendation;
import se.magnus.microservices.api.recommendation.RecommendationService;
import se.magnus.microservices.core.recommendation.persistence.RecommendationEntity;
import se.magnus.microservices.core.recommendation.persistence.RecommendationRepository;
import se.magnus.microservices.util.http.ServiceUtil;
@RestController
public class RecommendationServiceImpl implements RecommendationService {
private final ServiceUtil serviceUtil;
private final RecommendationRepository recommendationRepository;
private final RecommendationMapper recommendationMapper;
public RecommendationServiceImpl(ServiceUtil serviceUtil, RecommendationRepository recommendationRepository,
RecommendationMapper recommendationMapper) {
this.serviceUtil = serviceUtil;
this.recommendationRepository = recommendationRepository;
this.recommendationMapper = recommendationMapper;
}
@Override
public Flux<Recommendation> getRecommendations(int productId) {
return recommendationRepository.findByProductId(productId)
.log()
.map(e->recommendationMapper.toApi(e))
.map(e->{
e.setServiceAddress(serviceUtil.getServiceAddress());
return e;
});
}
@Override
public Recommendation createRecommendation(Recommendation body) {
RecommendationEntity entity = recommendationMapper.toEntity(body);
return recommendationRepository.save(entity)
.log()
.map(e->recommendationMapper.toApi(e))
.toProcessor()
.block();
}
@Override
public void deleteRecommendations(int productId) {
recommendationRepository.deleteAll(recommendationRepository.findByProductId(productId)).toProcessor().block();
}
} | [
"cirovladimir@gmail.com"
] | cirovladimir@gmail.com |
3fa3c8f2091ae99cb87445b8594811bb8d2b7fad | 3e198db790ff0bf26988cfec218b5b91343ca581 | /src/main/java/com/mahe/hitt/utils/IPUtils.java | 9b90c8fc3eca86097eeab94b66bfabdc5c5f741a | [] | no_license | mahe504/EMSGDE | bc4e8190a99c5a386a6f60cd400212d776e48ea0 | 69d6361634f752be2e2d9f22e5641abe9d990ac6 | refs/heads/master | 2022-12-24T04:11:04.735317 | 2019-08-29T08:52:48 | 2019-08-29T08:52:48 | 205,113,430 | 0 | 0 | null | 2022-12-16T11:54:10 | 2019-08-29T08:08:51 | JavaScript | UTF-8 | Java | false | false | 1,640 | java | package com.mahe.hitt.utils;
import javax.servlet.http.HttpServletRequest;
/**
* @Author 马鹤
* @Date 2019/7/9--16:36
* @Description
**/
public class IPUtils {
public static String getIPAddress(HttpServletRequest request) {
String ip = null;
// X-Forwarded-For:Squid 服务代理
String ipAddresses = request.getHeader("X-Forwarded-For");
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
// Proxy-Client-IP:apache 服务代理
ipAddresses = request.getHeader("Proxy-Client-IP");
}
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
// WL-Proxy-Client-IP:weblogic 服务代理
ipAddresses = request.getHeader("WL-Proxy-Client-IP");
}
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
// HTTP_CLIENT_IP:有些代理服务器
ipAddresses = request.getHeader("HTTP_CLIENT_IP");
}
if (ipAddresses == null || ipAddresses.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
// X-Real-IP:nginx服务代理
ipAddresses = request.getHeader("X-Real-IP");
}
// 有些网络通过多层代理,那么获取到的ip就会有多个,一般都是通过逗号(,)分割开来,并且第一个ip为客户端的真实IP
if (ipAddresses != null && ipAddresses.length() != 0) {
ip = ipAddresses.split(",")[0];
}
// 还是不能获取到,最后再通过request.getRemoteAddr();获取
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ipAddresses)) {
ip = request.getRemoteAddr();
}
return ip;
}
}
| [
"1124139223@qq.com"
] | 1124139223@qq.com |
7f9a4388681c8ac28e15a08f1a1ca313e53f1b03 | 6d1c004063749837ec176d8c9dc32262d208b382 | /src/com/virid/ViridDirectory/ViridDirectoryActivity.java | 47ed675a6283b7aa47e81e13da8f50a5ff9e8771 | [] | no_license | rahulyhg/Directory-4 | 3b664b199562102ced6a66a9a4611daf3e5ff3fc | f5f58004b114f1bda28400d7aaea8980f60e8a8c | refs/heads/master | 2021-01-19T20:57:09.042768 | 2012-04-20T18:34:58 | 2012-04-20T18:34:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,761 | java | package com.virid.ViridDirectory;
import android.app.Dialog;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.os.Handler;
import android.text.Html;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import android.widget.Toast;
public class ViridDirectoryActivity extends ListActivity {
private static final int MENU_NEW_CONTACT = 0;
private static final int MENU_HELP = 1;
private static final int MENU_WIPEDB = 2;
protected EditText searchText;
protected SQLiteDatabase db;
protected Cursor cursor;
protected ListAdapter adapter;
protected Dialog mSplashDialog;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MyStateSaver data = (MyStateSaver) getLastNonConfigurationInstance();
if (data != null) {
// Show splash screen if still loading
if (data.showSplashScreen) {
// showSplashScreen();
}
setContentView(R.layout.main);
searchText = (EditText) findViewById(R.id.searchText);
db = (new DatabaseHelper(this)).getWritableDatabase();
// Rebuild your UI with your saved state here
} else {
showSplashScreen();
setContentView(R.layout.main);
searchText = (EditText) findViewById(R.id.searchText);
db = (new DatabaseHelper(this)).getWritableDatabase();
// Do your heavy loading here on a background thread
}
}
// MENUING OPTIONS --------------
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0, MENU_NEW_CONTACT, 0, "New Contact").setIcon(R.drawable.add);
menu.add(0, MENU_HELP, 1, "Help").setIcon(R.drawable.help);
menu.add(0, MENU_WIPEDB, 2, "Clear Database");
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
Intent intent;
switch (item.getItemId()) {
case MENU_NEW_CONTACT:
intent = new Intent(this, NewContact.class);
startActivity(intent);
break;
// case MENU_HELP:
// intent = new Intent(this, Help.class);
// startActivity(intent);
// break;
case MENU_WIPEDB:
wipeDatabase();
break;
}
return false;
}
// -------------------------------
public void onListItemClick(ListView parent, View view, int position,
long id) {
Intent intent = new Intent(this, EmployeeDetails.class);
Cursor cursor = (Cursor) adapter.getItem(position);
intent.putExtra("EMPLOYEE_ID",
cursor.getInt(cursor.getColumnIndex("_id")));
startActivity(intent);
}
public void search(View view) {
// || is the concatenation operation in SQLite
cursor = db
.rawQuery(
"SELECT _id, firstName, lastName, title, \" - \" || department as department FROM viridEmployee WHERE firstName || ' ' || lastName LIKE ?",
new String[] { "%" + searchText.getText().toString()
+ "%" });
adapter = new SimpleCursorAdapter(this, R.layout.employee_list_item,
cursor, new String[] { "firstName", "lastName", "title",
"department" }, new int[] { R.id.firstName,
R.id.lastName, R.id.title, R.id.department });
setListAdapter(adapter);
}
@Override
public Object onRetainNonConfigurationInstance() {
MyStateSaver data = new MyStateSaver();
// Save your important data here
if (mSplashDialog != null) {
data.showSplashScreen = true;
removeSplashScreen();
}
return data;
}
/**
* Removes the Dialog that displays the splash screen
*/
protected void removeSplashScreen() {
if (mSplashDialog != null) {
mSplashDialog.dismiss();
mSplashDialog = null;
}
}
/**
* Shows the splash screen over the full Activity
*/
protected void showSplashScreen() {
mSplashDialog = new Dialog(this, R.style.SplashScreen);
mSplashDialog.setContentView(R.layout.splash);
mSplashDialog.setCancelable(false);
mSplashDialog.show();
TextView splashText = (TextView) mSplashDialog
.findViewById(R.id.splashText);
splashText.setText(Html.fromHtml(getString(R.string.splashText)));
// Set Runnable to remove splash screen just in case
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
removeSplashScreen();
}
}, 3000);
}
/**
* Simple class for storing important data across config changes
*/
private class MyStateSaver {
public boolean showSplashScreen = false;
// Your other important fields here
}
private void wipeDatabase() {
db.delete("viridEmployee", null, null);
Toast.makeText(getApplicationContext(), "Database cleared.", Toast.LENGTH_LONG);
}
} | [
"ppastorek@virid.com"
] | ppastorek@virid.com |
a89382b52848bfbafa12f73d60a9422bd2ea4546 | 6847009063cfa9a08511a4772515eaf3c9e10921 | /huoxin/daimeng_android/daimengLive/src/main/java/com/daimeng/live/widget/CircleImageView.java | 5bf02f9be70e0e796c28406ff0647f90634db08f | [] | no_license | P79N6A/huoxin | 80a92564b34bd9f3afba2042ff8a747d6d3f70dc | 649219a5d15d17dcbc78e900cc44201befc8e321 | refs/heads/master | 2020-05-24T07:26:52.563938 | 2019-05-17T06:18:43 | 2019-05-17T06:18:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,479 | java | package com.daimeng.live.widget;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
import com.daimeng.live.utils.ImageUtils;
import com.daimeng.live.R;
/**
* 鍦嗗舰ImageView缁勪欢
*
*/
public class CircleImageView extends ImageView {
private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
private static final int COLORDRAWABLE_DIMENSION = 1;
private static final int DEFAULT_BORDER_WIDTH = 0;
private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
private final RectF mDrawableRect = new RectF();
private final RectF mBorderRect = new RectF();
private final Matrix mShaderMatrix = new Matrix();
private final Paint mBitmapPaint = new Paint();
private final Paint mBorderPaint = new Paint();
private int mBorderColor = DEFAULT_BORDER_COLOR;
private int mBorderWidth = DEFAULT_BORDER_WIDTH;
private Bitmap mBitmap;
private BitmapShader mBitmapShader;
private int mBitmapWidth;
private int mBitmapHeight;
private float mDrawableRadius;
private float mBorderRadius;
private boolean mReady;
private boolean mSetupPending;
//瑙掓爣
private int mCorner = 0;
//榛樿鏄剧ず鍦嗗舰
private boolean isDisplayCircle = true;
private Bitmap mCornerBitmap;
public CircleImageView(Context context) {
this(context, null);
}
public CircleImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CircleImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
super.setScaleType(SCALE_TYPE);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);
mBorderWidth = a.getDimensionPixelSize(R.styleable.CircleImageView_border_width, DEFAULT_BORDER_WIDTH);
mBorderColor = a.getColor(R.styleable.CircleImageView_border_color, DEFAULT_BORDER_COLOR);
a.recycle();
mReady = true;
if (mSetupPending) {
setup();
mSetupPending = false;
}
}
@Override
public ScaleType getScaleType() {
return SCALE_TYPE;
}
@Override
public void setScaleType(ScaleType scaleType) {
if (scaleType != SCALE_TYPE) {
throw new IllegalArgumentException(String.format("ScaleType %s not supported.", scaleType));
}
}
@Override
protected void onDraw(Canvas canvas) {
if(!isDisplayCircle) {
super.onDraw(canvas);
return;
}
if (getDrawable() == null) {
return;
}
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mDrawableRadius, mBitmapPaint);
if(mBorderWidth != 0){
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mBorderRadius, mBorderPaint);
}
//璁剧疆瑙掓爣
if(mCorner != 0){
canvas.save();
Resources res = getResources();
Bitmap bmp = BitmapFactory.decodeResource(res, mCorner);
// 寰楀埌鏂扮殑鍥剧墖
Bitmap newbm = ImageUtils.scaleBitmap(bmp,40,40);
canvas.drawBitmap(newbm,getMeasuredWidth()-40,getMeasuredHeight()-40,mBitmapPaint);
canvas.restore();
}
if(mCornerBitmap != null){
canvas.save();
// 寰楀埌鏂扮殑鍥剧墖
Bitmap newbm = ImageUtils.scaleBitmap(mCornerBitmap,40,40);
canvas.drawBitmap(newbm,getMeasuredWidth()-40,getMeasuredHeight()-40,mBitmapPaint);
canvas.restore();
}
}
public void setCorner(int img){
mCorner = img;
}
public void setCorner(Bitmap bitmap){
mCornerBitmap = bitmap;
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
setup();
}
public void setDisplayCircle(boolean isDisplayCircle) {
this.isDisplayCircle = isDisplayCircle;
}
public int getBorderColor() {
return mBorderColor;
}
public void setBorderColor(int borderColor) {
if (borderColor == mBorderColor) {
return;
}
mBorderColor = borderColor;
mBorderPaint.setColor(mBorderColor);
invalidate();
}
public int getBorderWidth() {
return mBorderWidth;
}
public void setBorderWidth(int borderWidth) {
if (borderWidth == mBorderWidth) {
return;
}
mBorderWidth = borderWidth;
setup();
}
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
mBitmap = bm;
setup();
}
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
mBitmap = getBitmapFromDrawable(drawable);
setup();
}
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
mBitmap = getBitmapFromDrawable(getDrawable());
setup();
}
private Bitmap getBitmapFromDrawable(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
try {
Bitmap bitmap;
if (drawable instanceof ColorDrawable) {
bitmap = Bitmap.createBitmap(COLORDRAWABLE_DIMENSION, COLORDRAWABLE_DIMENSION, BITMAP_CONFIG);
} else {
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), BITMAP_CONFIG);
}
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
} catch (OutOfMemoryError e) {
return null;
}
}
private void setup() {
if (!mReady) {
mSetupPending = true;
return;
}
if (mBitmap == null) {
return;
}
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mBitmapPaint.setAntiAlias(true);
mBitmapPaint.setShader(mBitmapShader);
mBorderPaint.setStyle(Paint.Style.STROKE);
mBorderPaint.setAntiAlias(true);
mBorderPaint.setColor(mBorderColor);
mBorderPaint.setStrokeWidth(mBorderWidth);
mBitmapHeight = mBitmap.getHeight();
mBitmapWidth = mBitmap.getWidth();
mBorderRect.set(0, 0, getWidth(), getHeight());
mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2, (mBorderRect.width() - mBorderWidth) / 2);
mDrawableRect.set(mBorderWidth, mBorderWidth, mBorderRect.width() - mBorderWidth, mBorderRect.height() - mBorderWidth);
mDrawableRadius = Math.min(mDrawableRect.height() / 2, mDrawableRect.width() / 2);
updateShaderMatrix();
invalidate();
}
private void updateShaderMatrix() {
float scale;
float dx = 0;
float dy = 0;
mShaderMatrix.set(null);
if (mBitmapWidth * mDrawableRect.height() > mDrawableRect.width() * mBitmapHeight) {
scale = mDrawableRect.height() / (float) mBitmapHeight;
dx = (mDrawableRect.width() - mBitmapWidth * scale) * 0.5f;
} else {
scale = mDrawableRect.width() / (float) mBitmapWidth;
dy = (mDrawableRect.height() - mBitmapHeight * scale) * 0.5f;
}
mShaderMatrix.setScale(scale, scale);
mShaderMatrix.postTranslate((int) (dx + 0.5f) + mBorderWidth, (int) (dy + 0.5f) + mBorderWidth);
mBitmapShader.setLocalMatrix(mShaderMatrix);
}
} | [
"15038798393@163.com"
] | 15038798393@163.com |
cab8be099c084b5ce6b6b416d685b6c2868a6c8e | 8cc95271928042194eb2d65838004471492f7bee | /java/neo/exception/PageException.java | 256d1032a71f5d4bdbe70aa7d4e599436f3d1a42 | [] | no_license | jagarian/public_html | 8cc6364bef711c980ee7fe8577a0878627343f76 | c013d95c626585118dd1913f6214183ec1381474 | refs/heads/master | 2016-08-05T16:19:02.016714 | 2013-06-20T13:29:25 | 2013-06-20T13:29:25 | null | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,374 | java | package neo.exception;
/**
* @Class Name : PageException.java
* @파일설명 :
* @Version : 1.0
* @Author : hoon09
* @Copyright : All Right Reserved
**********************************************************************************************
* 작업일 버젼 구분 작업자 내용
* --------------------------------------------------------------------------------------------
* 2005-05-01 1.4 생성 hoon09 source create (삼성전기)
* 2006-11-23 1.4 수정 hoon09 code convention apply (멀티캠퍼스)
* 2009-07-03 1.6 수정 hoon09 code convention apply (국민은행, 펜타시큐리티)
* 2009-09-23 1.7 수정 hoon09 code valid check (푸르덴샬생명보험,뱅뱅)
**********************************************************************************************
*/
public class PageException extends NeoException {
private static final long serialVersionUID = 1L;
public PageException() {
super();
}
public PageException(String msg) {
super(msg);
}
public PageException(String code, String msg) {
super(code, msg);
}
public PageException(String msg, Throwable rootCause) {
super(msg, rootCause);
}
public PageException(String code, String msg, Throwable rootCause) {
super(code, msg, rootCause);
}
public PageException(Throwable rootCause) {
super(rootCause);
}
}
| [
"jagarian@gmail.com"
] | jagarian@gmail.com |
64e9f9f2063cfb34aed3decc42a49c5e340400bf | 77ef22afcc22a5b9978e39bd2845357abd575b78 | /Practice/src/practice02/PTra02_02.java | 493ef824547e76c51d3c6517179f3e1f8f2f26ec | [] | no_license | TakahiroKinebuchi/JavaBasic | 3e0fa88331b36f4a01f6cc1b4886c16a88e36298 | 7faaaedabd5d818e067ac4737bff1f5b6f32359c | refs/heads/master | 2021-01-24T03:38:11.833313 | 2018-03-20T08:45:28 | 2018-03-20T08:45:28 | 122,898,156 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 577 | java | package practice02;
/*
* PTra02_02.java
* 作成 LIKEIT 2017
*------------------------------------------------------------
* Copyright(c) Rhizome Inc. All Rights Reserved.
*/
public class PTra02_02 {
public static void main(String[] args) {
int num = 10;
System.out.println(num);
// ★ 変数numの値に30足した数を出力してください
System.out.println(num + 30);
// ★ 以下のプログラムで40が出力されるようにしてください
num*= 4;
System.out.println(num); // ※※ この行は修正しないでください
}
}
| [
"like.takahiro@gmail.com"
] | like.takahiro@gmail.com |
a7b4409c12c7904f5452a55fdda3c697c3afaa40 | b7b71f62abef0fa54485bac0b8c5dc0e96e4eb4e | /src/dataBase/Connector.java | 44c45f0e2fb5c6483e5e84b0bcce665cbbd48ce7 | [] | no_license | floibach/KBHH_Finances | f91202e6ce5e56e50df6b1c7661c3a4d605236b1 | a46cde7f0c980f60516fac8636d29b78bd48acc1 | refs/heads/master | 2016-09-06T15:06:30.917652 | 2013-06-22T22:27:46 | 2013-06-22T22:27:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package dataBase;
public class Connector
{
public Connector()
{
_amount = 20;
}
private double _amount;
public double getAmount()
{
return _amount;
}
public double booking(Boolean isCredit,double value,String applicator, String reason)
{
int multiplicator = 1;
if(!isCredit)
{
multiplicator = multiplicator * (-1);
}
_amount = _amount + (multiplicator * value);
return _amount;
}
// SELECT *
// FROM KBHH_Amount a
// WHERE (
//
// SELECT MAX( ID )
// FROM `KBHH_Amount`
// ) = a.ID
}
| [
"floibach88@gmail.com"
] | floibach88@gmail.com |
dba7fb4916fec27a236d99ea1f10fd1f37d954f8 | 94138ba86d0dbf80b387064064d1d86269e927a1 | /group20/925290009/第三次作业/com/coderising/download/api/ConnectionException.java | 17373399090c1b3606418ee3a90709c2c91642bc | [] | no_license | DonaldY/coding2017 | 2aa69b8a2c2990b0c0e02c04f50eef6cbeb60d42 | 0e0c386007ef710cfc90340cbbc4e901e660f01c | refs/heads/master | 2021-01-17T20:14:47.101234 | 2017-06-01T00:19:19 | 2017-06-01T00:19:19 | 84,141,024 | 2 | 28 | null | 2017-06-01T00:19:20 | 2017-03-07T01:45:12 | Java | UTF-8 | Java | false | false | 239 | java | package com.coderising.download.api;
public class ConnectionException extends Exception {
/**
*
*/
private static final long serialVersionUID = 4776347926322882920L;
/**
*
*/
public ConnectionException(){
super();
}
}
| [
"wang_lxin@163.com"
] | wang_lxin@163.com |
6954555895a0819eca871a1155051a861132d5db | cbe78ab7c9d6bae97944e654ebbbe492693c2b5c | /src/team/antelope/fg/entity/PersonNeed.java | a128e06152aecc39faf54cd7249206cc192858d2 | [] | no_license | wencaiHua/fragment_server | daaf528952bf204bba6f41a82af560267944bc5d | 9eb309f652e80403e974b5b7ce7d8d0e530d4c8f | refs/heads/master | 2021-09-16T17:19:56.055219 | 2018-06-22T10:25:41 | 2018-06-22T10:25:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,229 | java | package team.antelope.fg.entity;
import java.sql.Timestamp;
/**
* @author uniquelry
* @Description
*/
public class PersonNeed {
private long id;
private long uid;
private String title;
private String content;
private String needtype;
private Timestamp customdate;
private Timestamp requestdate;
private boolean iscomplete;
private boolean isonline;
private String addressdesc;
private String name;
private String email;
private String headimg;
private Float starnum;
private String phonenum;
private int dealnum;
private int fansnum;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getUid() {
return uid;
}
public void setUid(long uid) {
this.uid = uid;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getNeedtype() {
return needtype;
}
public void setNeedtype(String needtype) {
this.needtype = needtype;
}
public Timestamp getCustomdate() {
return customdate;
}
public void setCustomdate(Timestamp customdate) {
this.customdate = customdate;
}
public Timestamp getRequestdate() {
return requestdate;
}
public void setRequestdate(Timestamp requestdate) {
this.requestdate = requestdate;
}
public boolean isIscomplete() {
return iscomplete;
}
public void setIscomplete(boolean iscomplete) {
this.iscomplete = iscomplete;
}
public boolean isIsonline() {
return isonline;
}
public void setIsonline(boolean isonline) {
this.isonline = isonline;
}
public String getAddressdesc() {
return addressdesc;
}
public void setAddressdesc(String addressdesc) {
this.addressdesc = addressdesc;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getHeadimg() {
return headimg;
}
public void setHeadimg(String headimg) {
this.headimg = headimg;
}
public Float getStarnum() {
return starnum;
}
public void setStarnum(Float starnum) {
this.starnum = starnum;
}
public String getPhonenum() {
return phonenum;
}
public void setPhonenum(String phonenum) {
this.phonenum = phonenum;
}
public int getDealnum() {
return dealnum;
}
public void setDealnum(int dealnum) {
this.dealnum = dealnum;
}
public int getFansnum() {
return fansnum;
}
public void setFansnum(int fansnum) {
this.fansnum = fansnum;
}
@Override
public String toString() {
return "PersonNeed [id=" + id + ", uid=" + uid + ", title=" + title + ", content=" + content + ", needtype="
+ needtype + ", customdate=" + customdate + ", requestdate=" + requestdate + ", iscomplete="
+ iscomplete + ", isonline=" + isonline + ", addressdesc=" + addressdesc + ", name=" + name + ", email="
+ email + ", headimg=" + headimg + ", starnum=" + starnum + ", phonenum=" + phonenum + ", dealnum="
+ dealnum + ", fansnum=" + fansnum + "]";
}
}
| [
"uniquelry@qq.com"
] | uniquelry@qq.com |
a43793b9630e0b8fd2687eea42cb67fd761cdc54 | 041e2ceaf45fefe0236a0bf4454991d49da2a5de | /sms-server-api/src/main/java/by/bsu/rfe/smsservice/service/StatisticsService.java | 87929765347ecf916cd89f730137eea3999ff198 | [] | no_license | pavel-luhin/rfe-sms-server | 8465f3aae52ed21d5fe8539f416d001211164631 | ad5f778ac7c3187d590555a0489854182afd4392 | refs/heads/master | 2021-03-30T17:37:56.656786 | 2019-11-04T19:19:56 | 2019-11-04T19:19:56 | 55,432,342 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,096 | java | package by.bsu.rfe.smsservice.service;
import by.bsu.rfe.smsservice.common.dto.StatisticsDTO;
import by.bsu.rfe.smsservice.common.dto.page.PageRequestDTO;
import by.bsu.rfe.smsservice.common.dto.page.PageResponseDTO;
import by.bsu.rfe.smsservice.common.dto.sms.BulkSmsRequestDTO;
import by.bsu.rfe.smsservice.common.dto.sms.CustomSmsRequestDTO;
import by.bsu.rfe.smsservice.common.dto.sms.SmsQueueRequestDTO;
import by.bsu.rfe.smsservice.common.dto.sms.TemplateSmsRequestDTO;
import by.bsu.rfe.smsservice.common.response.SendSmsResponse;
import java.util.List;
/**
* Created by pluhin on 3/20/16.
*/
public interface StatisticsService {
List<StatisticsDTO> getFullStatistics();
PageResponseDTO getStatisticsPage(PageRequestDTO requestDTO);
Long count();
void saveStatistics(BulkSmsRequestDTO requestDTO, SendSmsResponse response);
void saveStatistics(CustomSmsRequestDTO requestDTO, SendSmsResponse response);
void saveStatistics(TemplateSmsRequestDTO requestDTO, SendSmsResponse response);
void saveStatistics(SmsQueueRequestDTO requestDTO, SendSmsResponse response);
}
| [
"pavel.luhin@gmail.com"
] | pavel.luhin@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.