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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fd9ec19c41ec789efe0bcec76a94340ef8c1e3ab
|
06be2cb66de4e03136d3405d35ee5d2da7b85250
|
/src/main/java/org/sensoriclife/reports/unusualRiseOfConsumption/firstJob/UnusualRiseOfConsumptionMapper.java
|
30b3cd24b81092e277efad79ce84a30192ba3618
|
[] |
no_license
|
jnphilipp/sensoriclife-reports
|
fee439c84ae91ada2c65a947908ac5310f618288
|
afc60c1fed714decdc9b41f39540632c3d509dbd
|
refs/heads/master
| 2021-01-02T09:34:04.852430
| 2014-06-06T08:39:04
| 2014-06-06T08:39:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,630
|
java
|
package org.sensoriclife.reports.unusualRiseOfConsumption.firstJob;
import java.io.IOException;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.sensoriclife.Config;
import org.sensoriclife.world.ResidentialUnit;
public class UnusualRiseOfConsumptionMapper extends
Mapper<Key, Value, Text, ResidentialUnit> {
public void map(Key k, Value v, Context c) throws IOException,
InterruptedException {
long minTs = Long.parseLong(Config.getProperty("minTimestamp"));
long maxTs = Long.parseLong(Config.getProperty("maxTimestamp"));
String rowId = k.getRow().toString();
Long timestamp = k.getTimestamp();
String family = k.getColumnFamily().toString();
String qualifier = k.getColumnQualifier().toString();
if(family.equals("residential") && qualifier.equals("id"))
{
String counterType = rowId.split("_")[1];
ResidentialUnit flat = new ResidentialUnit();
flat.setTimeStamp(timestamp);
flat.setConsumptionID(rowId);
flat.setCounterType(counterType);
flat.setResidentialID(v.toString());
c.write(new Text(rowId), flat);
}
if (timestamp >= minTs && timestamp <= maxTs) {
if (family.equals("device") && qualifier.equals("amount")) {
String counterType = rowId.split("_")[1];
ResidentialUnit flat = new ResidentialUnit();
flat.setConsumptionID(rowId);
flat.setTimeStamp(timestamp);
flat.setDeviceAmount(Float.parseFloat(v.toString()));
flat.setCounterType(counterType);
c.write(new Text(rowId), flat);
}
}
}
}
|
[
"m.jacob@hotmail.com"
] |
m.jacob@hotmail.com
|
d5cbbf33160391950d813ce55f812489955a09b0
|
d91c3bc6e0ebee01f7dccee28e2e627a2f40acca
|
/CuentasPersonales/generado/org/zathura/cuentas/presentation/backingBeans/CpDetalleMovimientoView.java
|
cd0d335728d6c7ecd3066bcbb7e78ead83a52d3e
|
[] |
no_license
|
fresko/JavaAppDeveloper
|
4dab81f4cbdbc1cf58eaf600f813a60b65db0c96
|
8b24489df4364474750db148a0387c52e3ba889d
|
HEAD
| 2016-09-05T19:12:33.408464
| 2013-10-14T21:23:39
| 2013-10-14T21:23:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 15,387
|
java
|
package org.zathura.cuentas.presentation.backingBeans;
import org.primefaces.component.calendar.*;
import org.primefaces.component.commandbutton.CommandButton;
import org.primefaces.component.inputtext.InputText;
import org.primefaces.event.DateSelectEvent;
import org.primefaces.event.RowEditEvent;
import org.zathura.cuentas.exceptions.*;
import org.zathura.cuentas.personales.*;
import org.zathura.cuentas.personales.dto.CpDetalleMovimientoDTO;
import org.zathura.cuentas.presentation.businessDelegate.BusinessDelegatorView;
import org.zathura.cuentas.utilities.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.TimeZone;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
/**
*
* @author Zathura Code Generator http://code.google.com/p/zathura
*
*/
public class CpDetalleMovimientoView {
private InputText txtAnno;
private InputText txtMes;
private InputText txtObservaciones;
private InputText txtPendiente;
private InputText txtValorMovimiento;
private InputText txtValorPago;
private InputText txtIdMovimiento_CpMovimiento;
private InputText txtIdDetalleMovimiento;
private Calendar txtFehcaRegistro;
private CommandButton btnSave;
private CommandButton btnModify;
private CommandButton btnDelete;
private CommandButton btnClear;
private List<CpDetalleMovimientoDTO> data;
private CpDetalleMovimientoDTO selectedCpDetalleMovimiento;
public CpDetalleMovimientoView() {
super();
}
public void rowEventListener(RowEditEvent e) {
try {
CpDetalleMovimientoDTO cpDetalleMovimientoDTO = (CpDetalleMovimientoDTO) e.getObject();
if (txtAnno == null) {
txtAnno = new InputText();
}
txtAnno.setValue(cpDetalleMovimientoDTO.getAnno());
if (txtMes == null) {
txtMes = new InputText();
}
txtMes.setValue(cpDetalleMovimientoDTO.getMes());
if (txtObservaciones == null) {
txtObservaciones = new InputText();
}
txtObservaciones.setValue(cpDetalleMovimientoDTO.getObservaciones());
if (txtPendiente == null) {
txtPendiente = new InputText();
}
txtPendiente.setValue(cpDetalleMovimientoDTO.getPendiente());
if (txtValorMovimiento == null) {
txtValorMovimiento = new InputText();
}
txtValorMovimiento.setValue(cpDetalleMovimientoDTO.getValorMovimiento());
if (txtValorPago == null) {
txtValorPago = new InputText();
}
txtValorPago.setValue(cpDetalleMovimientoDTO.getValorPago());
if (txtIdMovimiento_CpMovimiento == null) {
txtIdMovimiento_CpMovimiento = new InputText();
}
txtIdMovimiento_CpMovimiento.setValue(cpDetalleMovimientoDTO.getIdMovimiento_CpMovimiento());
if (txtIdDetalleMovimiento == null) {
txtIdDetalleMovimiento = new InputText();
}
txtIdDetalleMovimiento.setValue(cpDetalleMovimientoDTO.getIdDetalleMovimiento());
if (txtFehcaRegistro == null) {
txtFehcaRegistro = new Calendar();
}
txtFehcaRegistro.setValue(cpDetalleMovimientoDTO.getFehcaRegistro());
action_modify();
} catch (Exception ex) {
}
}
public String action_clear() {
if (txtAnno != null) {
txtAnno.setValue(null);
txtAnno.setDisabled(true);
}
if (txtMes != null) {
txtMes.setValue(null);
txtMes.setDisabled(true);
}
if (txtObservaciones != null) {
txtObservaciones.setValue(null);
txtObservaciones.setDisabled(true);
}
if (txtPendiente != null) {
txtPendiente.setValue(null);
txtPendiente.setDisabled(true);
}
if (txtValorMovimiento != null) {
txtValorMovimiento.setValue(null);
txtValorMovimiento.setDisabled(true);
}
if (txtValorPago != null) {
txtValorPago.setValue(null);
txtValorPago.setDisabled(true);
}
if (txtIdMovimiento_CpMovimiento != null) {
txtIdMovimiento_CpMovimiento.setValue(null);
txtIdMovimiento_CpMovimiento.setDisabled(true);
}
if (txtFehcaRegistro != null) {
txtFehcaRegistro.setValue(null);
txtFehcaRegistro.setDisabled(true);
}
if (txtIdDetalleMovimiento != null) {
txtIdDetalleMovimiento.setValue(null);
txtIdDetalleMovimiento.setDisabled(false);
}
if (btnSave != null) {
btnSave.setDisabled(true);
}
if (btnDelete != null) {
btnDelete.setDisabled(true);
}
if (btnModify != null) {
btnModify.setDisabled(true);
}
if (btnClear != null) {
btnClear.setDisabled(false);
}
return "";
}
public void listener_txtFehcaRegistro(DateSelectEvent dse) {
Date inputDate = (Date) txtFehcaRegistro.getValue();
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
FacesContext.getCurrentInstance()
.addMessage("",
new FacesMessage("Fecha Seleccionada " +
dateFormat.format(dse.getDate())));
}
public void listener_txtId() {
CpDetalleMovimiento entity = null;
try {
Long idDetalleMovimiento = new Long(txtIdDetalleMovimiento.getValue()
.toString());
entity = BusinessDelegatorView.getCpDetalleMovimiento(idDetalleMovimiento);
} catch (Exception e) {
// TODO: handle exception
}
if (entity == null) {
txtAnno.setDisabled(false);
txtMes.setDisabled(false);
txtObservaciones.setDisabled(false);
txtPendiente.setDisabled(false);
txtValorMovimiento.setDisabled(false);
txtValorPago.setDisabled(false);
txtIdMovimiento_CpMovimiento.setDisabled(false);
txtFehcaRegistro.setDisabled(false);
txtIdDetalleMovimiento.setDisabled(false);
btnSave.setDisabled(false);
btnDelete.setDisabled(true);
btnModify.setDisabled(true);
btnClear.setDisabled(false);
} else {
txtAnno.setValue(entity.getAnno());
txtAnno.setDisabled(false);
txtFehcaRegistro.setValue(entity.getFehcaRegistro());
txtFehcaRegistro.setDisabled(false);
txtMes.setValue(entity.getMes());
txtMes.setDisabled(false);
txtObservaciones.setValue(entity.getObservaciones());
txtObservaciones.setDisabled(false);
txtPendiente.setValue(entity.getPendiente());
txtPendiente.setDisabled(false);
txtValorMovimiento.setValue(entity.getValorMovimiento());
txtValorMovimiento.setDisabled(false);
txtValorPago.setValue(entity.getValorPago());
txtValorPago.setDisabled(false);
txtIdMovimiento_CpMovimiento.setValue(entity.getCpMovimiento()
.getIdMovimiento());
txtIdMovimiento_CpMovimiento.setDisabled(false);
txtIdDetalleMovimiento.setValue(entity.getIdDetalleMovimiento());
txtIdDetalleMovimiento.setDisabled(true);
btnSave.setDisabled(true);
btnDelete.setDisabled(false);
btnModify.setDisabled(false);
btnClear.setDisabled(false);
}
}
public String action_save() {
try {
BusinessDelegatorView.saveCpDetalleMovimiento(FacesUtils.checkLong(
txtAnno), FacesUtils.checkDate(txtFehcaRegistro),
FacesUtils.checkLong(txtIdDetalleMovimiento),
FacesUtils.checkLong(txtMes),
FacesUtils.checkString(txtObservaciones),
FacesUtils.checkString(txtPendiente),
FacesUtils.checkLong(txtValorMovimiento),
FacesUtils.checkLong(txtValorPago),
FacesUtils.checkLong(txtIdMovimiento_CpMovimiento));
FacesUtils.addInfoMessage(ZMessManager.ENTITY_SUCCESFULLYSAVED);
action_clear();
} catch (Exception e) {
FacesUtils.addErrorMessage(e.getMessage());
}
return "";
}
public String action_delete() {
try {
BusinessDelegatorView.deleteCpDetalleMovimiento(FacesUtils.checkLong(
txtIdDetalleMovimiento));
FacesUtils.addInfoMessage(ZMessManager.ENTITY_SUCCESFULLYDELETED);
action_clear();
} catch (Exception e) {
FacesUtils.addErrorMessage(e.getMessage());
}
return "";
}
public String action_modify() {
try {
BusinessDelegatorView.updateCpDetalleMovimiento(FacesUtils.checkLong(
txtAnno), FacesUtils.checkDate(txtFehcaRegistro),
FacesUtils.checkLong(txtIdDetalleMovimiento),
FacesUtils.checkLong(txtMes),
FacesUtils.checkString(txtObservaciones),
FacesUtils.checkString(txtPendiente),
FacesUtils.checkLong(txtValorMovimiento),
FacesUtils.checkLong(txtValorPago),
FacesUtils.checkLong(txtIdMovimiento_CpMovimiento));
FacesUtils.addInfoMessage(ZMessManager.ENTITY_SUCCESFULLYMODIFIED);
action_clear();
} catch (Exception e) {
data = null;
FacesUtils.addErrorMessage(e.getMessage());
}
return "";
}
public String actionDeleteDataTableEditable() {
try {
if (txtIdDetalleMovimiento == null) {
txtIdDetalleMovimiento = new InputText();
}
txtIdDetalleMovimiento.setValue(selectedCpDetalleMovimiento.getIdDetalleMovimiento());
BusinessDelegatorView.deleteCpDetalleMovimiento(FacesUtils.checkLong(
txtIdDetalleMovimiento));
data.remove(selectedCpDetalleMovimiento);
FacesUtils.addInfoMessage(ZMessManager.ENTITY_SUCCESFULLYDELETED);
action_clear();
} catch (Exception e) {
FacesUtils.addErrorMessage(e.getMessage());
}
return "";
}
public String action_modifyWitDTO(Long anno, Date fehcaRegistro,
Long idDetalleMovimiento, Long mes, String observaciones,
String pendiente, Long valorMovimiento, Long valorPago,
Long idMovimiento_CpMovimiento) throws Exception {
try {
BusinessDelegatorView.updateCpDetalleMovimiento(anno,
fehcaRegistro, idDetalleMovimiento, mes, observaciones,
pendiente, valorMovimiento, valorPago, idMovimiento_CpMovimiento);
FacesUtils.addInfoMessage(ZMessManager.ENTITY_SUCCESFULLYMODIFIED);
} catch (Exception e) {
//renderManager.getOnDemandRenderer("CpDetalleMovimientoView").requestRender();
FacesUtils.addErrorMessage(e.getMessage());
throw e;
}
return "";
}
public InputText getTxtAnno() {
return txtAnno;
}
public void setTxtAnno(InputText txtAnno) {
this.txtAnno = txtAnno;
}
public InputText getTxtMes() {
return txtMes;
}
public void setTxtMes(InputText txtMes) {
this.txtMes = txtMes;
}
public InputText getTxtObservaciones() {
return txtObservaciones;
}
public void setTxtObservaciones(InputText txtObservaciones) {
this.txtObservaciones = txtObservaciones;
}
public InputText getTxtPendiente() {
return txtPendiente;
}
public void setTxtPendiente(InputText txtPendiente) {
this.txtPendiente = txtPendiente;
}
public InputText getTxtValorMovimiento() {
return txtValorMovimiento;
}
public void setTxtValorMovimiento(InputText txtValorMovimiento) {
this.txtValorMovimiento = txtValorMovimiento;
}
public InputText getTxtValorPago() {
return txtValorPago;
}
public void setTxtValorPago(InputText txtValorPago) {
this.txtValorPago = txtValorPago;
}
public InputText getTxtIdMovimiento_CpMovimiento() {
return txtIdMovimiento_CpMovimiento;
}
public void setTxtIdMovimiento_CpMovimiento(
InputText txtIdMovimiento_CpMovimiento) {
this.txtIdMovimiento_CpMovimiento = txtIdMovimiento_CpMovimiento;
}
public Calendar getTxtFehcaRegistro() {
return txtFehcaRegistro;
}
public void setTxtFehcaRegistro(Calendar txtFehcaRegistro) {
this.txtFehcaRegistro = txtFehcaRegistro;
}
public InputText getTxtIdDetalleMovimiento() {
return txtIdDetalleMovimiento;
}
public void setTxtIdDetalleMovimiento(InputText txtIdDetalleMovimiento) {
this.txtIdDetalleMovimiento = txtIdDetalleMovimiento;
}
public List<CpDetalleMovimientoDTO> getData() {
try {
if (data == null) {
data = BusinessDelegatorView.getDataCpDetalleMovimiento();
}
} catch (Exception e) {
e.printStackTrace();
}
return data;
}
public void setData(List<CpDetalleMovimientoDTO> cpDetalleMovimientoDTO) {
this.data = cpDetalleMovimientoDTO;
}
public CpDetalleMovimientoDTO getSelectedCpDetalleMovimiento() {
return selectedCpDetalleMovimiento;
}
public void setSelectedCpDetalleMovimiento(
CpDetalleMovimientoDTO cpDetalleMovimiento) {
this.selectedCpDetalleMovimiento = cpDetalleMovimiento;
}
public CommandButton getBtnSave() {
return btnSave;
}
public void setBtnSave(CommandButton btnSave) {
this.btnSave = btnSave;
}
public CommandButton getBtnModify() {
return btnModify;
}
public void setBtnModify(CommandButton btnModify) {
this.btnModify = btnModify;
}
public CommandButton getBtnDelete() {
return btnDelete;
}
public void setBtnDelete(CommandButton btnDelete) {
this.btnDelete = btnDelete;
}
public CommandButton getBtnClear() {
return btnClear;
}
public void setBtnClear(CommandButton btnClear) {
this.btnClear = btnClear;
}
public TimeZone getTimeZone() {
return java.util.TimeZone.getDefault();
}
}
|
[
"juan.paz.h@gmail.com"
] |
juan.paz.h@gmail.com
|
2fb79fdba9974d1cc1ebd2a26ef239ff6eef5e3f
|
0af07b1b789eb918fe2ba0bddbf199c6606cd7f8
|
/hello-service/src/main/java/com/yinjian/vo/UserVO.java
|
003abae0a067b47de48d6604b4e2425fe4484cd1
|
[] |
no_license
|
maybeyj/hello-springboot
|
641aa355e9040c255ef7c95f76184f3c2854e8ab
|
dede7d1a6955d8815897d441c160a54fa2bbf63a
|
refs/heads/master
| 2020-04-17T03:11:11.610512
| 2019-01-24T03:58:48
| 2019-01-24T03:58:48
| 165,966,447
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,169
|
java
|
package com.yinjian.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
* @author: Yin Jian
* @create: 2019-01-22 14:47
*/
@ApiModel("用户VO")
public class UserVO {
@ApiModelProperty(hidden = true)
private Long id;
@ApiModelProperty(hidden = true)
private Date gmtCreate;
@ApiModelProperty(hidden = true)
private Date gmtModified;
@ApiModelProperty(value = "用户名",example = "yinjian")
private String userName;
@ApiModelProperty(value = "密码",example = "abc123")
private String password;
@ApiModelProperty(value = "盐")
private String salt;
@ApiModelProperty(value = "状态")
private Boolean status;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
public Date getGmtModified() {
return gmtModified;
}
public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}
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;
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
public Boolean getStatus() {
return status;
}
public void setStatus(Boolean status) {
this.status = status;
}
@Override
public String toString() {
return "UserDO{" +
"id=" + id +
", gmtCreate=" + gmtCreate +
", gmtModified=" + gmtModified +
", userName='" + userName + '\'' +
", password='" + password + '\'' +
", salt='" + salt + '\'' +
", status=" + status +
'}';
}
}
|
[
"616786733@qq.com"
] |
616786733@qq.com
|
2ce36e985f8428bcc72051ae3b3b4f7f44c6725f
|
416ae56a986d55054ee7ba35d27f6aeb90bcd761
|
/android/app/src/main/java/com/myrndemo/rn/ReactNativeReactPackage.java
|
b417bbb5cc43df23de4aab44c98bb3449904a914
|
[] |
no_license
|
SinglerZhou/MyRnDemo
|
cd85403b75a22ec751be476d92379081120ce321
|
82f89ea3a1a630b7cfbc131d107b0eb5fcefab45
|
refs/heads/master
| 2023-06-28T17:34:55.932504
| 2021-07-27T16:16:08
| 2021-07-27T16:16:08
| 390,024,182
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 784
|
java
|
package com.myrndemo.rn;
import androidx.annotation.NonNull;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class ReactNativeReactPackage implements ReactPackage {
@NonNull
@Override
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(new ReactNativeUtil(reactContext));
}
@NonNull
@Override
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}
|
[
"804738536@qq.com"
] |
804738536@qq.com
|
45bfa95f440c924f3328fc5d2e4f817dd0e05863
|
7df70c58ab16580df377b80528fed128263fb8c9
|
/src/main/java/com/borisov/spring/components/framework/Benchmark.java
|
b8486f7819f589ed813f2506ae75b26bbcdbd84c
|
[] |
no_license
|
vladosby/Hibernate
|
be7509f47cd8dd7b5972a4e8f93732c4f2b73405
|
d3e32e3b9ea7634d47ca54e8713337189ede5fd3
|
refs/heads/master
| 2021-01-19T02:07:22.363807
| 2016-07-27T12:58:29
| 2016-07-27T12:58:29
| 42,090,998
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 249
|
java
|
package com.borisov.spring.components.framework;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Created by vladosby on 04.10.2015.
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface Benchmark {
}
|
[
"vlad@mail.by"
] |
vlad@mail.by
|
2f4a06f902959a8fb5e24a6282f7e398f9643f14
|
168a3798ad5ebab0831cc3ad8d0bce0aa696e238
|
/app/src/main/java/com/example/infocovid_19/ui/menu/menu_bantuan/adapter/AdapterBantuan.java
|
cc966e8ddd63163a8ae57720b98ba0f4e023e3fa
|
[
"Apache-2.0"
] |
permissive
|
margiyanto/COVID19
|
3623eb377ff1148326c5dd7eb4396b06f2928c48
|
84bb2782018c7039315f0991ce83a23bfe702fc7
|
refs/heads/master
| 2022-11-22T03:23:05.502984
| 2020-07-16T14:58:05
| 2020-07-16T14:58:05
| 280,181,815
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,042
|
java
|
package com.example.infocovid_19.ui.menu.menu_bantuan.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.example.infocovid_19.R;
import com.example.infocovid_19.ui.menu.menu_informasi.adapter.AdapterInformasi;
import com.example.infocovid_19.ui.menu.menu_informasi.model.PojoInformasi;
import java.util.List;
import de.hdodenhof.circleimageview.CircleImageView;
public class AdapterBantuan extends RecyclerView.Adapter<AdapterBantuan.ViewHolder> {
private List<PojoInformasi> list;
private static OnItemClickListener onItemClickListener;
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
public AdapterBantuan.OnItemClickListener getOnItemClickListener() {
return onItemClickListener;
}
public interface OnItemClickListener {
void onItemClick(View view, int position);
}
public AdapterBantuan(List<PojoInformasi> list) {
this.list = list;
}
@NonNull
@Override
public AdapterBantuan.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_item_informasi, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
PojoInformasi result = list.get(position);
Context context = holder.itemView.getContext();
holder.title.setText(result.getTitle());
holder.bgImage.setImageResource(result.getColorBg());
Glide.with(context)
.load(result.getImage())
.centerCrop()
.into(holder.image);
}
@Override
public int getItemCount() {
return list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private ImageView image;
private CircleImageView bgImage;
private TextView title;
private CardView container;
public ViewHolder(@NonNull View itemView) {
super(itemView);
image = itemView.findViewById(R.id.iv_row_image);
bgImage = itemView.findViewById(R.id.iv_bg_image);
title = itemView.findViewById(R.id.tv_row_name);
container = itemView.findViewById(R.id.container);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int position = ViewHolder.super.getAdapterPosition();
onItemClickListener.onItemClick(view, position);
}
});
}
}
}
|
[
"margiyanto570@gmail.com"
] |
margiyanto570@gmail.com
|
7b14ff0b8751c7ce5ac3624211a5804b1945a979
|
e8a666a9b55e3612e070aa0001f9b72f99e0d751
|
/src/ca/reivax/javablocks/easyfake/internal/FakeOverrideHandler.java
|
2e351aa9e2024efc6c36d4c163e2ed6224bacf31
|
[] |
no_license
|
domtoupin/java-blocks
|
e0ef4da72a1b2a270c77c3eeb2e71860a5ea7c0d
|
afaa9263e4aed765bbce136b555db5aebc1c53ed
|
refs/heads/master
| 2020-12-02T16:33:38.064276
| 2011-10-20T16:14:14
| 2011-10-20T16:14:14
| 46,501,221
| 0
| 0
| null | 2015-11-19T15:28:28
| 2015-11-19T15:28:28
| null |
UTF-8
|
Java
| false
| false
| 1,484
|
java
|
package ca.reivax.javablocks.easyfake.internal;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import ca.reivax.javablocks.easyfake.FakeMethod;
import ca.reivax.javablocks.easyfake.FakeOverride;
import ca.reivax.javablocks.easyfake.FakeReturn;
import javassist.util.proxy.MethodHandler;
public class FakeOverrideHandler implements MethodHandler, FakeOverride
{
private Map<Method, FakeMethod<?>> methodBodies = new HashMap<Method, FakeMethod<?>>();
private Method lastMethod;
private boolean record = true;
@Override
public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Throwable
{
if (method.getDeclaringClass().equals(FakeOverride.class))
{
return method.invoke(this, args);
}
else
{
if (methodBodies.containsKey(method))
{
return methodBodies.get(method).fake(args);
}
else
{
lastMethod = method;
if (!record)
{
try
{
return proceed.invoke(self, args);
}
catch (InvocationTargetException e)
{
throw e.getTargetException();
}
}
else
{
return null;
}
}
}
}
@Override
public void with(FakeMethod body)
{
methodBodies.put(lastMethod, body);
}
@Override
public void andReturn(Object returnValue)
{
methodBodies.put(lastMethod, new FakeReturn(returnValue));
}
@Override
public void startFaking()
{
record = false;
}
}
|
[
"ebelanger@ebelanger-laptop.(none)"
] |
ebelanger@ebelanger-laptop.(none)
|
c90db7a64aa17545214cc8dfea9900e6cee8262b
|
f0dc24933115b48e6113f5555a987eae27e6a66c
|
/src/com/huige/tzfe/MainActivity.java
|
4351d6a15c724f4c4e316736bf05a1a3587ede4e
|
[] |
no_license
|
zhengwenhui/szfe
|
da8c8bda70b42734ac49ebff4610a1bd63102f2e
|
abb903274f60d8fe538a79827cc2462bbbec4c86
|
refs/heads/master
| 2021-01-22T16:56:46.251555
| 2014-11-07T10:02:04
| 2014-11-07T10:02:04
| null | 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 9,154
|
java
|
package com.huige.tzfe;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends Activity implements PrintInterface{
private int direction;
private GameManager game;
private GestureDetector gestureDetector;
private View.OnTouchListener gestureListener;
private TextView stepTextView;
private TextView scoreTextView;
private TableView tableLayout;
private View clingView;
private View snowFallView;
private Typeface mAndroidClockMonoThin, mAndroidClockMonoBold;
static String FIRST_RUN_CLING_DISMISSED_KEY = "FIRST_RUN_CLING_DISMISSED_KEY";
private SharedPreferences mSharedPrefs;
boolean openCling = false;
int clingStep = 0;
int clingCount = 0;
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//AdManager.getInstance(this).init("03412307dfefb843", "80cf970036505cd6", false);
setContentView(R.layout.activity_main);
tableLayout = (TableView)findViewById(R.id.table);
cling();
stepTextView = (TextView)findViewById(R.id.step);
scoreTextView = (TextView)findViewById(R.id.score);
snowFallView = (SnowFallView)findViewById(R.id.snow);
TypefaceSet();
// Gesture detection
gestureDetector = new GestureDetector(this, new MyGestureDetector());
gestureListener = new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
return gestureDetector.onTouchEvent(event);
}
};
tableLayout.setOnTouchListener(gestureListener);
game = (GameManager)getLastNonConfigurationInstance();
if( null == game ){
game = new GameManager(this,this);
}
else{
game.setPrintInterface(MainActivity.this);
}
tableLayout.setDraw(game.grid.cells);
//AdView adView = new AdView(this, AdSize.FIT_SCREEN);
//LinearLayout adLayout=(LinearLayout)findViewById(R.id.adLayout);
//adLayout.addView(adView);
}
private void cling(){
mSharedPrefs = getSharedPreferences(FIRST_RUN_CLING_DISMISSED_KEY,
Context.MODE_PRIVATE);
openCling = mSharedPrefs.getBoolean(FIRST_RUN_CLING_DISMISSED_KEY, true);
if(openCling){
clingView = findViewById(R.id.cling);
clingView.setVisibility(View.VISIBLE);
SharedPreferences.Editor editor = mSharedPrefs.edit();
editor.putBoolean(FIRST_RUN_CLING_DISMISSED_KEY,false);
editor.commit();
}
}
@Override
public Object onRetainNonConfigurationInstance() {
return game;
}
class MyGestureDetector extends SimpleOnGestureListener {
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
//Log.i(TAG, "onFling v x:"+velocityX+",y:"+velocityY);
//Log.i(TAG, "e1 x:"+e1.getX()+",y:"+e1.getY());
//Log.i(TAG, "e2 x:"+e2.getX()+",y:"+e2.getY());
float xInterval = e1.getX() - e2.getX();
float yInterval = e1.getY() - e2.getY();
float xIntervalAbs = Math.abs(xInterval);
float yIntervalAbs = Math.abs(yInterval);
direction = -1;
if( xIntervalAbs > Util.SWIPE_MIN_DISTANCE && xIntervalAbs > yIntervalAbs*2){
if( xInterval > 0 ){
//Log.i(TAG, "left");
direction = 3;
}
else{
//Log.i(TAG, "right");
direction = 1;
}
}
if( yIntervalAbs > Util.SWIPE_MIN_DISTANCE && yIntervalAbs > xIntervalAbs*2){
if( yInterval > 0 ){
//Log.i(TAG, "up");
direction = 0;
}
else{
//Log.i(TAG, "down");
direction = 2;
}
}
//Log.i(TAG, tableLayout.isAnimation() ? "is Animation " : "not Animation");
if( direction >= 0 && !tableLayout.isAnimation()){
game.Move(direction);
}
return false;
}
@Override
public boolean onDown(MotionEvent e) {
//Log.v(TAG, "onDown");
return true;
}
}
/*private void print(){
tableLayout.invalidate();
}*/
public void onClickUndo(View view){
if( game.undo ){
game.undoMove(direction);
//print();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
private void TypefaceSet(){
mAndroidClockMonoThin = Typeface.createFromAsset(
getAssets(), "fonts/AndroidClockMono-Thin.ttf");
mAndroidClockMonoBold = Typeface.createFromAsset(
getAssets(), "fonts/AndroidClockMono-Bold.ttf");
/*mAndroidClockMonoLight = Typeface.createFromAsset(
getAssets(), "fonts/AndroidClockMono-Light.ttf");
mRobotoLabel= Typeface.create("sans-serif-condensed", Typeface.BOLD);*/
stepTextView.setTypeface(mAndroidClockMonoThin);
scoreTextView.setTypeface(mAndroidClockMonoBold);
}
@Override
public void printSteps(int step) {
// TODO Auto-generated method stub
//getString(R.string.step);
stepTextView.setText(getString(R.string.step)+step);
}
@Override
public void printScore(int score) {
// TODO Auto-generated method stub
//getString(R.string.score);
scoreTextView.setText(getString(R.string.score)+score);
}
@Override
public void moveView(final Tile from, final Tile to) {
//Log.e(TAG, "Activity moveView");
//Log.e(TAG, "from["+from.heigth+","+from.width+"]:"+from.value+" > to["+to.heigth+","+to.width+"]:"+to.value+"\n");
}
@Override
public void moveViewsSetp(Object[] from, Object[] to, int direction) {
// TODO Auto-generated method stub
//Log.e(TAG, "Activity moveViewsSetp");
tableLayout.moveViewsStepAnimation(from, to, game.getParameter(direction));
}
@Override
public void addRandomTile(Tile newTile) {
// TODO Auto-generated method stub
int cling2 = 0;
//StringBuffer sb = new StringBuffer("\n");
if( null != game){
Tile[][] cells = game.grid.cells;
for (int h = 0; h < 4; h++) {
/*for (int w = 0; w < 4; w++) {
sb.append(String.format(" %2d ", cells[h][w].previousValue));
}
sb.append(" >>>> ");*/
for (int w = 0; w < 4; w++) {
//sb.append(String.format(" %2d ", cells[h][w].value));
if(openCling){
if(clingStep == 1 && cells[h][w].value == 4){
cling2 = 4;
}
}
}
//sb.append("\n");
//Log.e(TAG, "sb.toString(): "+sb.toString());
}
}
if(openCling){
if( clingStep == 0){
clingCount++;
clingView.setBackgroundResource(R.drawable.cling1);
if(clingCount == 2){
clingStep = 1;
}
}
else if( clingStep == 1){
if(cling2 == 4){
clingView.setBackgroundResource(R.drawable.cling2);
clingStep = 2;
}
else{
clingView.setBackgroundResource(0);
clingStep = 1;
}
}
else if( clingStep == 2){
clingView.setBackgroundResource(R.drawable.cling3);
clingStep = 3;
}
else if( clingStep == 3){
clingView.setVisibility(View.GONE);
clingStep = 0;
openCling = false;
}
//tableLayout.invalidate();
}
tableLayout.addRandomTile(newTile);
}
@SuppressLint("NewApi")
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
// TODO Auto-generated method stub
switch (item.getItemId()) {
/*case R.id.action_settings:
setTitle("action_settings");
break;*/
case R.id.action_restart:
//setTitle("action_restart");
game.restart();
tableLayout.invalidate();
break;
case R.id.action_history:
Intent intent = new Intent(this, HistoryActivity.class);
startActivity(intent);
break;
}
return true;
}
public void onClickButton(View view){
this.onBackPressed();
}
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
game.saveHistory();
game.closeHistoryDB();
super.onDestroy();
}
@Override
public void gameResult(int flag) {
// TODO Auto-generated method stub
String message = "";
switch (flag) {
case PrintInterface.GAME_OVER:
message = "游戏结束\n";
break;
case PrintInterface.GAME_SUCCESS:
message = "游戏成功\n";
break;
default:
break;
}
StringBuilder strBuilder = new StringBuilder();
strBuilder.append(getString(R.string.score));
strBuilder.append(game.score);
strBuilder.append(", ");
strBuilder.append(getString(R.string.step));
strBuilder.append(game.step);
snowFallView.setVisibility(View.VISIBLE);
Dialog dialog = new Dialog(this, R.style.Theme_dialog);
dialog.setContentView(R.layout.layout_dialog);
dialog.show();
TextView mMessage = (TextView) dialog.findViewById(R.id.message);
mMessage.setText(message+strBuilder.toString());
dialog.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
// TODO Auto-generated method stub
snowFallView.setVisibility(View.INVISIBLE);
}
});
}
}
|
[
"zhengwenhui@outlook.com"
] |
zhengwenhui@outlook.com
|
8e5c6bb9dd229ca30524fd6b7467276b795cddc7
|
85ca7a41cc0f22a0bdbab78d1fe13b1220c7f55f
|
/Library/src/test/java/com/project/online_library/OnlineLibraryApplicationTests.java
|
59da51e9c398ea1d75ccae3a72dee20ce3a4d14c
|
[] |
no_license
|
AnaNikolasevic/SEP_UPP_UDD
|
e155edb46279d37e0ac72e2cfe80c55e0e6e9e10
|
73dd23fb0d374fef8cfaad17eea269a18dc80625
|
refs/heads/master
| 2023-04-12T06:32:59.789159
| 2021-04-16T13:38:13
| 2021-04-16T13:38:13
| 322,241,132
| 0
| 0
| null | 2021-02-02T17:56:30
| 2020-12-17T09:14:35
|
Java
|
UTF-8
|
Java
| false
| false
| 234
|
java
|
package com.project.online_library;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class OnlineLibraryApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"23nikolasevic@gmail.com"
] |
23nikolasevic@gmail.com
|
144b6cd091f98d984baf850a2bcf6cf11a6b5b2a
|
d0594e029d23feee895220424fcbdb8e673352c8
|
/src/main/java/com/mmall/concurrencyTeacher/example/aqs/CyclicBarrierExample1.java
|
e6904d92af33e14e13c37434d41cf4ffe9207b44
|
[] |
no_license
|
crashiers/concurrency
|
f988d9156a4bc3f5d3d3d050ff17afd8459ccb6b
|
4076d7278a6bdb6a948698f8747bb02399ed1f42
|
refs/heads/master
| 2020-04-16T06:39:35.812099
| 2018-07-19T07:57:54
| 2018-07-19T07:57:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,040
|
java
|
package com.mmall.concurrencyTeacher.example.aqs;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Slf4j
public class CyclicBarrierExample1 {
private static CyclicBarrier barrier = new CyclicBarrier(5);
public static void main(String[] args) throws Exception {
ExecutorService executor = Executors.newCachedThreadPool();
for (int i = 0; i < 10; i++) {
final int threadNum = i;
Thread.sleep(1000);
executor.execute(() -> {
try {
race(threadNum);
} catch (Exception e) {
log.error("exception", e);
}
});
}
executor.shutdown();
}
private static void race(int threadNum) throws Exception {
Thread.sleep(1000);
log.info("{} is ready", threadNum);
barrier.await();
log.info("{} continue", threadNum);
}
}
|
[
"HelloMrXu@foxmail.com"
] |
HelloMrXu@foxmail.com
|
f6277d2b77a67e07e55e76c330b034b838b568d2
|
ab78f083f37ffe92bcfd1f212317677d33d27f73
|
/storage-service/src/main/java/com/alibaba/fescar/storage/StorageBootstrap.java
|
ed1403d6a22f6084faceb46eb3f5fad665d83af1
|
[] |
no_license
|
justein/spring-cloud-fescar
|
a35ca78f98196be3bfd80c45fc671919244f461f
|
3e2b72ddc43ef9d54803963575c9d14efaa28994
|
refs/heads/master
| 2020-05-15T23:01:32.551573
| 2019-04-22T08:57:38
| 2019-04-22T08:57:38
| 182,541,288
| 4
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 666
|
java
|
package com.alibaba.fescar.storage;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
/**
* @author Lyn
* @since 1.0
*/
@EnableDiscoveryClient
@SpringBootApplication
public class StorageBootstrap {
public static void main(String[] args) {
new SpringApplicationBuilder(StorageBootstrap.class)
.web(WebApplicationType.SERVLET)
.run(args);
}
}
|
[
"james_gosling@163.com"
] |
james_gosling@163.com
|
6415b3f6b8646efb74aa9c7440fde6d5ed76acb6
|
3c10140462caad91640395baa66df532d8fa0ed9
|
/ThrusterV2 - Copy/src/java/thruster/controllers/LoginController.java
|
44fd2c5af99175273379e887a92b14b2af6720d9
|
[] |
no_license
|
senalwijeratne/Thruster2.0
|
6c9a64193e244a1499fc610f7f34da79fa00a8a6
|
a07f6f5f51a9c897421dc72d314d515d9f7133f6
|
refs/heads/master
| 2021-01-21T19:51:07.837961
| 2017-05-23T13:26:33
| 2017-05-23T13:26:33
| 92,164,980
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,566
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package thruster.controllers;
import java.io.IOException;
import java.io.PrintWriter;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import thruster.dao.UserDao;
import thruster.servlets.encryption;
import thruster.models.User;
import thruster.dao.LoginDao;
/**
*
* @author Rimzan
*/
public class LoginController extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet LoginController</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet LoginController at " + request.getContextPath() + "</h1>");
out.println("</body>");
out.println("</html>");
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
response.setContentType("text/html;charset=UTF-8");
User user = new User();
LoginDao p =new LoginDao();
user.setEmail(request.getParameter("email"));
String password = request.getParameter("password");
encryption enc = new encryption();
String passEnc = enc.encrypting(password);
String salt = enc.Salt();
String fullPassword = passEnc+salt;
user.setSaltedpw(fullPassword);
LoginDao dao = new LoginDao();
String result = dao.loginAuth(user);
if(result.equals("success"))
{
//session creation ///
//String userID = dao.getUid(request.getParameter("email"), password);
HttpSession session = request.getSession();
String email = user.getEmail();
String password2 = fullPassword;
// System.out.println("The Email inside login controller is : "+email);
// System.out.println("The Password inside login controller is : "+password2);
String stringID = p.getUid(email,password2);
System.out.println("result of UID in LOGINController : "+stringID);
session.setAttribute("userid",stringID);
System.out.println("test");
System.out.println(session.getAttribute("userid"));
/////to be used anywhere///
// String uID = session.getAttribute(userID);
/////////////////////////////////
if(email.equals("admin@gmail.com")){
getServletContext().getRequestDispatcher("../Admin/admin.jsp").forward(request,response);
}else{
getServletContext().getRequestDispatcher("/Success.jsp").forward(request,response);
// response.sendRedirect("Success.jsp");
}
}
else{
response.sendRedirect("tryagain.jsp");
}
} catch (NoSuchAlgorithmException ex) {
Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
} catch (NoSuchPaddingException ex) {
Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
} catch (InvalidKeyException ex) {
Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
} catch (IllegalBlockSizeException ex) {
Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
} catch (BadPaddingException ex) {
Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
|
[
"1khwan.m0@gmail.com"
] |
1khwan.m0@gmail.com
|
96e856745f16bcb7d3a74afd8a5129a3fd91c8fa
|
e11f1810fcb84f625b51d4bd3ed2822846bcd3fb
|
/src/test/java/com/forketyfork/yandexalgo/assignment1/AmbulanceTest.java
|
0d9cc566608fbc7812f80daeef0d2c3dd7281127
|
[] |
no_license
|
forketyfork/yandex-algos
|
2111d33746c73d1a3567bf9a84424ac8e06de9d3
|
492d401393ecd317188e87b66e46a9208cd8a859
|
refs/heads/main
| 2023-08-15T19:56:45.866790
| 2021-09-30T12:06:22
| 2021-09-30T12:06:22
| 374,298,195
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,672
|
java
|
package com.forketyfork.yandexalgo.assignment1;
import java.util.List;
import java.util.stream.Stream;
import lombok.AllArgsConstructor;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import static org.assertj.core.api.Assertions.assertThat;
class AmbulanceTest {
@AllArgsConstructor
private static class TestCase {
private final int k1;
private final int m;
private final int k2;
private final int p2;
private final int n2;
private final List<Integer> expected;
}
public static Stream<TestCase> source() {
return Stream.of(
new TestCase(89, 20, 41, 1, 11, List.of(2, 3)),
new TestCase(11, 1, 1, 1, 1, List.of(0, 1)),
new TestCase(3, 2, 2, 2, 1, List.of(-1, -1)),
new TestCase(5, 20, 2, 1, 1, List.of(1, 0)),
new TestCase(1, 1, 1, 1, 1, List.of(1, 1)),
new TestCase(11, 2, 4, 1, 2, List.of(0, 2)),
new TestCase(41, 10, 41, 1, 10, List.of(-1, -1)),
new TestCase(1000, 1, 449, 449, 1, List.of(1000, 1)), // test 006
new TestCase(753, 10, 1000, 1, 1, List.of(1, 1)), // test 009
new TestCase(10, 3, 50, 1, 50, List.of(-1, -1)) // test 023
);
}
@ParameterizedTest
@MethodSource("source")
void test(TestCase testCase) {
assertThat(Ambulance.calculate(
testCase.k1,
testCase.m,
testCase.k2,
testCase.p2,
testCase.n2
)).isEqualTo(testCase.expected);
}
}
|
[
"petunin@crxmarkets.com"
] |
petunin@crxmarkets.com
|
54e713ce04ca4f6f1633b4988740b3f6785cb3e1
|
80a3c5aa93d24755da2d3ef64db42fdd7b167a8e
|
/profiles-api/om-api/src/main/java/org/uncertweb/api/om/io/JSONObservationParser.java
|
c823ca0d28f0c46436cdf05036b56ddff8e25c82
|
[] |
no_license
|
52North/UncertWeb
|
2f796354b987cd82048ee5cdfdbbc00065f334ef
|
26d85a6809f3f7ab30154269803c229aa5bdb3a9
|
refs/heads/master
| 2020-05-21T16:46:41.296051
| 2016-09-19T16:11:50
| 2016-09-19T16:11:50
| 63,933,712
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 17,762
|
java
|
package org.uncertweb.api.om.io;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import org.apache.xmlbeans.XmlException;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.uncertml.IUncertainty;
import org.uncertml.exception.UncertaintyParserException;
import org.uncertml.io.JSONParser;
import org.uncertweb.api.gml.Identifier;
import org.uncertweb.api.gml.io.JSONGeometryDecoder;
import org.uncertweb.api.om.DQ_UncertaintyResult;
import org.uncertweb.api.om.TimeObject;
import org.uncertweb.api.om.observation.AbstractObservation;
import org.uncertweb.api.om.observation.BooleanObservation;
import org.uncertweb.api.om.observation.CategoryObservation;
import org.uncertweb.api.om.observation.DiscreteNumericObservation;
import org.uncertweb.api.om.observation.Measurement;
import org.uncertweb.api.om.observation.ReferenceObservation;
import org.uncertweb.api.om.observation.TextObservation;
import org.uncertweb.api.om.observation.UncertaintyObservation;
import org.uncertweb.api.om.observation.collections.BooleanObservationCollection;
import org.uncertweb.api.om.observation.collections.CategoryObservationCollection;
import org.uncertweb.api.om.observation.collections.DiscreteNumericObservationCollection;
import org.uncertweb.api.om.observation.collections.IObservationCollection;
import org.uncertweb.api.om.observation.collections.MeasurementCollection;
import org.uncertweb.api.om.observation.collections.ReferenceObservationCollection;
import org.uncertweb.api.om.observation.collections.TextObservationCollection;
import org.uncertweb.api.om.observation.collections.UncertaintyObservationCollection;
import org.uncertweb.api.om.result.BooleanResult;
import org.uncertweb.api.om.result.CategoryResult;
import org.uncertweb.api.om.result.IntegerResult;
import org.uncertweb.api.om.result.MeasureResult;
import org.uncertweb.api.om.result.ReferenceResult;
import org.uncertweb.api.om.result.TextResult;
import org.uncertweb.api.om.result.UncertaintyResult;
import org.uncertweb.api.om.sampling.SpatialSamplingFeature;
import com.vividsolutions.jts.geom.Geometry;
/**
* parser for parsing observations according to the UncertWeb observation profile encoded in JSON
*
* @author staschc
*
*/
public class JSONObservationParser implements IObservationParser{
@Override
public AbstractObservation parseObservation(String jsonObs)
throws IllegalArgumentException, MalformedURLException,
URISyntaxException, XmlException, UncertaintyParserException, JSONException {
AbstractObservation result = null;
JSONObject obs = new JSONObject(jsonObs);
JSONObject jobs =null;
String typeName =null;
////////////////////////
//check type and retrieve observation JSON object
//obs is measurement
if (obs.has(Measurement.NAME)){
typeName=Measurement.NAME;
jobs = obs.getJSONObject(Measurement.NAME);
}
else if (obs.has(BooleanObservation.NAME)){
typeName=BooleanObservation.NAME;
jobs=obs.getJSONObject(BooleanObservation.NAME);
}
else if (obs.has(CategoryObservation.NAME)){
typeName=CategoryObservation.NAME;
jobs=obs.getJSONObject(CategoryObservation.NAME);
}
else if (obs.has(DiscreteNumericObservation.NAME)){
typeName=DiscreteNumericObservation.NAME;
jobs=obs.getJSONObject(DiscreteNumericObservation.NAME);
}
else if (obs.has(ReferenceObservation.NAME)){
typeName=ReferenceObservation.NAME;
jobs=obs.getJSONObject(ReferenceObservation.NAME);
}
else if (obs.has(TextObservation.NAME)){
typeName=TextObservation.NAME;
jobs=obs.getJSONObject(TextObservation.NAME);
}
else if (obs.has(UncertaintyObservation.NAME)){
typeName=UncertaintyObservation.NAME;
jobs=obs.getJSONObject(UncertaintyObservation.NAME);
}
else{
throw new IllegalArgumentException("Observation type is not supported by JSON parser!");
}
/////////////////////////////
//parse common properties
Identifier identifier =null;
if (jobs.has("identifier")){
identifier = parseIdentifier(jobs.getJSONObject("identifier"));
}
TimeObject phenomenonTime = parseTime(jobs.getJSONObject("phenomenonTime"));
TimeObject resultTime = parseTime(jobs.getJSONObject("resultTime"));
TimeObject validTime = null;
if (jobs.has("validTime")){
validTime = parseTime(jobs.getJSONObject("validTime"));
}
URI procedureURI = new URI(jobs.getString("procedure"));
URI obsPropURI = new URI(jobs.getString("observedProperty"));
JSONObject jfoi = jobs.getJSONObject("featureOfInterest").getJSONObject("SF_SpatialSamplingFeature");
SpatialSamplingFeature foi = parseSamplingFeature(jfoi);
DQ_UncertaintyResult[] resultQuality = null;
if (jobs.has("resultQuality")){
resultQuality = parseResultQuality(jobs.getJSONArray("resultQuality"));
}
//parse results
if (typeName.equals(Measurement.NAME)){
JSONObject jresult = jobs.getJSONObject("result");
String uom = jresult.getString("uom");
double value = jresult.getDouble("value");
MeasureResult mresult = new MeasureResult(value,uom);
result = new Measurement(identifier,null,phenomenonTime,resultTime,validTime,procedureURI,obsPropURI,foi,resultQuality,mresult);
}
else if (typeName.equals(BooleanObservation.NAME)){
BooleanResult bresult = new BooleanResult(jobs.getBoolean("result"));
result = new BooleanObservation(identifier,null,phenomenonTime,resultTime,validTime,procedureURI,obsPropURI,foi,resultQuality,bresult);
}
else if (typeName.equals(CategoryObservation.NAME)){
JSONObject jresult = jobs.getJSONObject("result");
String codeSpace = jresult.getString("codeSpace");
String value = jresult.getString("value");
CategoryResult cresult = new CategoryResult(value,codeSpace);
result = new CategoryObservation(identifier,null,phenomenonTime,resultTime,validTime,procedureURI,obsPropURI,foi,resultQuality,cresult);
}
else if (typeName.equals(ReferenceObservation.NAME)){
JSONObject jresult = jobs.getJSONObject("result");
String href = jresult.getString("href");
String role = jresult.getString("role");
ReferenceResult rresult = new ReferenceResult(href,role);
result = new ReferenceObservation(identifier,null,phenomenonTime,resultTime,validTime,procedureURI,obsPropURI,foi,resultQuality,rresult);
}
else if (typeName.equals(DiscreteNumericObservation.NAME)){
IntegerResult iresult = new IntegerResult(new BigInteger(jobs.getString("result")));
result = new DiscreteNumericObservation(identifier,null,phenomenonTime,resultTime,validTime,procedureURI,obsPropURI,foi,resultQuality,iresult);
}
else if (typeName.equals(TextObservation.NAME)){
TextResult tresult = new TextResult(jobs.getString("result"));
result = new TextObservation(identifier,null,phenomenonTime,resultTime,validTime,procedureURI,obsPropURI,foi,resultQuality,tresult);
}
else if (typeName.equals(UncertaintyObservation.NAME)){
JSONObject juncertainty = jobs.getJSONObject("result");
IUncertainty uncertainty = new JSONParser().parse(juncertainty.getJSONObject("value").toString());
UncertaintyResult uresult = new UncertaintyResult(uncertainty);
result = new UncertaintyObservation(identifier,null,phenomenonTime,resultTime,validTime,procedureURI,obsPropURI,foi,resultQuality,uresult);
}
return result;
}
@Override
public IObservationCollection parseObservationCollection(String jsonObsCol)
throws XmlException, URISyntaxException, IllegalArgumentException,
MalformedURLException, UncertaintyParserException, JSONException {
JSONObject job = new JSONObject(jsonObsCol);
//BooleanObservationCollection
if (job.has(BooleanObservationCollection.NAME)){
JSONArray obsArray = job.getJSONArray(BooleanObservationCollection.NAME);
List<BooleanObservation> resultArray = new ArrayList<BooleanObservation>(obsArray.length());
for (int i=0;i<obsArray.length();i++){
resultArray.add((BooleanObservation)parseObservation(obsArray.getJSONObject(i).toString()));
}
return new BooleanObservationCollection(resultArray);
}
//CategoryObservaationCollection
else if (job.has(CategoryObservationCollection.NAME)){
JSONArray obsArray = job.getJSONArray(CategoryObservationCollection.NAME);
List<CategoryObservation> resultArray = new ArrayList<CategoryObservation>(obsArray.length());
for (int i=0;i<obsArray.length();i++){
resultArray.add((CategoryObservation)parseObservation(obsArray.getJSONObject(i).toString()));
}
return new CategoryObservationCollection(resultArray);
}
//DiscreteNumericObservation
else if (job.has(DiscreteNumericObservationCollection.NAME)){
JSONArray obsArray = job.getJSONArray(DiscreteNumericObservationCollection.NAME);
List<DiscreteNumericObservation> resultArray = new ArrayList<DiscreteNumericObservation>(obsArray.length());
for (int i=0;i<obsArray.length();i++){
resultArray.add((DiscreteNumericObservation)parseObservation(obsArray.getJSONObject(i).toString()));
}
return new DiscreteNumericObservationCollection(resultArray);
}
//MeasurementCollection
else if (job.has(MeasurementCollection.NAME)){
JSONArray obsArray = job.getJSONArray(MeasurementCollection.NAME);
List<Measurement> resultArray = new ArrayList<Measurement>(obsArray.length());
for (int i=0;i<obsArray.length();i++){
resultArray.add((Measurement)parseObservation(obsArray.getJSONObject(i).toString()));
}
return new MeasurementCollection(resultArray);
}
//ReferenceObservationCollection
else if (job.has(ReferenceObservationCollection.NAME)){
JSONArray obsArray = job.getJSONArray(ReferenceObservationCollection.NAME);
List<ReferenceObservation> resultArray = new ArrayList<ReferenceObservation>(obsArray.length());
for (int i=0;i<obsArray.length();i++){
resultArray.add((ReferenceObservation)parseObservation(obsArray.getJSONObject(i).toString()));
}
return new ReferenceObservationCollection(resultArray);
}
//TextObservationCollection
else if (job.has(TextObservationCollection.NAME)){
JSONArray obsArray = job.getJSONArray(TextObservationCollection.NAME);
List<TextObservation> resultArray = new ArrayList<TextObservation>(obsArray.length());
for (int i=0;i<obsArray.length();i++){
resultArray.add((TextObservation)parseObservation(obsArray.getJSONObject(i).toString()));
}
return new TextObservationCollection(resultArray);
}
//UncertaintyObservationCollection
else if (job.has(UncertaintyObservationCollection.NAME)){
JSONArray obsArray = job.getJSONArray(UncertaintyObservationCollection.NAME);
List<UncertaintyObservation> resultArray = new ArrayList<UncertaintyObservation>(obsArray.length());
for (int i=0;i<obsArray.length();i++){
resultArray.add((UncertaintyObservation)parseObservation(obsArray.getJSONObject(i).toString()));
}
return new UncertaintyObservationCollection(resultArray);
}
//type of collection not supported
else {
throw new IllegalArgumentException("ObservationCollection Type is not supported by JSONParser!");
}
}
@Override
public IObservationCollection parse(String jsonString) throws XmlException,
URISyntaxException, IllegalArgumentException,
MalformedURLException, UncertaintyParserException, JSONException {
JSONObject job = new JSONObject(jsonString);
IObservationCollection result = null;
//if string is an collection, invoke method for parsing observations
if (job.has(BooleanObservationCollection.NAME)||
job.has(CategoryObservationCollection.NAME)||
job.has(DiscreteNumericObservationCollection.NAME)||
job.has(MeasurementCollection.NAME)||
job.has(ReferenceObservationCollection.NAME)||
job.has(TextObservationCollection.NAME)||
job.has(UncertaintyObservationCollection.NAME)){
result = parseObservationCollection(jsonString);
}
//observation is single observation
else if (job.has(Measurement.NAME)){
List<Measurement> members = new ArrayList<Measurement>();
members.add((Measurement)parseObservation(jsonString));
result = new MeasurementCollection(members);
}
else if (job.has(BooleanObservation.NAME)){
List<BooleanObservation> members = new ArrayList<BooleanObservation>();
members.add((BooleanObservation)parseObservation(jsonString));
result = new BooleanObservationCollection(members);
}
else if (job.has(CategoryObservation.NAME)){
List<CategoryObservation> members = new ArrayList<CategoryObservation>();
members.add((CategoryObservation)parseObservation(jsonString));
result = new CategoryObservationCollection(members);
}
else if (job.has(DiscreteNumericObservation.NAME)){
List<DiscreteNumericObservation> members = new ArrayList<DiscreteNumericObservation>();
members.add((DiscreteNumericObservation)parseObservation(jsonString));
result = new DiscreteNumericObservationCollection(members);
}
else if (job.has(ReferenceObservation.NAME)){
List<ReferenceObservation> members = new ArrayList<ReferenceObservation>();
members.add((ReferenceObservation)parseObservation(jsonString));
result = new ReferenceObservationCollection(members);
}
else if (job.has(TextObservation.NAME)){
List<TextObservation> members = new ArrayList<TextObservation>();
members.add((TextObservation)parseObservation(jsonString));
result = new TextObservationCollection(members);
}
else if (job.has(UncertaintyObservation.NAME)){
List<UncertaintyObservation> members = new ArrayList<UncertaintyObservation>();
members.add((UncertaintyObservation)parseObservation(jsonString));
result = new UncertaintyObservationCollection(members);
}
return result;
}
/**
* parses a JSON representation of an resultQuality array
*
* @param jsonArray
* array containing the resultQuality elements
* @return Returns internal representation of resultQuality (currently ONLY containinig uncertainties!)
* @throws JSONException
* if parsing fails
*/
private DQ_UncertaintyResult[] parseResultQuality(JSONArray jsonArray) throws JSONException{
DQ_UncertaintyResult[] result = null;
if (jsonArray!=null){
result = new DQ_UncertaintyResult[jsonArray.length()];
for (int i=0;i<jsonArray.length();i++){
JSONObject jobject = jsonArray.getJSONObject(i);
String uom = jobject.getString("uom");
JSONArray values = jobject.getJSONArray("values");
IUncertainty[] uncertainties = new IUncertainty[values.length()];
for (int j=0;j<values.length();j++){
JSONObject juncertainty = values.getJSONObject(j);
try {
uncertainties[j] = new JSONParser().parse(juncertainty.toString());
} catch (UncertaintyParserException e) {
throw new IllegalArgumentException(e.getMessage());
}
}
result[i]=new DQ_UncertaintyResult(uncertainties,uom);
}
}
return result;
}
/**
* helper method for identifier in JSON representation
*
* @param jsonObject
* identifier encoded in JSON
* @return Returns internal representation of identifier
* @throws URISyntaxException
* if parsing of codespace fails
* @throws JSONException
* if parsing fails
*/
private Identifier parseIdentifier(JSONObject jsonObject) throws URISyntaxException, JSONException {
URI codeSpace = new URI(jsonObject.getString("codeSpace"));
String value = jsonObject.getString("value");
return new Identifier(codeSpace, value);
}
/**
* helper method for parsing a spatial sampling feature in JSON representation
*
* @param jfoi
* spatial sampling feature encoded in JSON
* @return Returns internal representation of spatial sampling feature
* @throws IllegalArgumentException
* if parsing fails
* @throws JSONException
* if parsing fails
* @throws URISyntaxException
*/
private SpatialSamplingFeature parseSamplingFeature(JSONObject jfoi) throws IllegalArgumentException, JSONException, URISyntaxException {
Geometry geom;
try {
geom = new JSONGeometryDecoder().parseUwGeometry(jfoi.getString("shape"));
} catch (XmlException e) {
throw new IllegalArgumentException(e);
}
String sampledFeature = jfoi.getString("sampledFeature");
Identifier identifier =null;
if (jfoi.has("identifier")){
identifier = parseIdentifier(jfoi.getJSONObject("identifier"));
}
return new SpatialSamplingFeature(identifier, sampledFeature, geom);
}
/**
* helper method for parsing a time object encoded in JSON
*
* @param jsonObject
* time object encoded in JSON
* @return Returns internal representation of timeobject
* @throws JSONException
* if parsing fails
*/
private TimeObject parseTime(JSONObject jsonObject) throws JSONException {
//time is TimePeriod, has to be checked first, as it also contains TimeInstants.
if (jsonObject.has("TimePeriod")) {
JSONObject jtimePeriod = jsonObject.getJSONObject("TimePeriod");
JSONObject jbegin = jtimePeriod.getJSONObject("begin").getJSONObject("TimeInstant");
JSONObject jend = jtimePeriod.getJSONObject("end").getJSONObject("TimeInstant");
TimeObject toBegin = parseTimeInstant(jbegin);
TimeObject toEnd = parseTimeInstant(jend);
return new TimeObject(toBegin.getDateTime(),toEnd.getDateTime());
}
//time is TimeInstant
else {
JSONObject jti = jsonObject.getJSONObject("TimeInstant");
return parseTimeInstant(jti);
}
}
/**
* helper method for parsing a time instant encoded in JSON
*
* @param jinstant
* time instant encoded in JSON
* @return Returns internal representation of time instant
* @throws JSONException
* if parsing fails
*/
private TimeObject parseTimeInstant(JSONObject jinstant) throws JSONException {
return new TimeObject(jinstant.getString("timePosition"));
}
}
|
[
"c.autermann@52north.org"
] |
c.autermann@52north.org
|
ed8e1cd91ef4526f4d6034f7df6c415f178a0599
|
9e5ddea641bcda696ea46f752e2e04d857509086
|
/Simulation Structure Layer/org.eclipse.RSG.framework.editor/src/rsgf/mw/presentation/MwActionBarContributor.java
|
3c10bdc6e8a0491d66b832a4bb578760832e5d77
|
[] |
no_license
|
doyennehoney/md2sef
|
d444c4d33a7513916e93f49624c3de9dfec81ed3
|
28bb75992f4fe870cf122381065842bda089be13
|
refs/heads/master
| 2021-08-26T03:52:34.798017
| 2017-11-21T14:13:25
| 2017-11-21T14:13:25
| 111,410,403
| 0
| 0
| null | 2017-11-20T15:18:47
| 2017-11-20T12:55:07
| null |
UTF-8
|
Java
| false
| false
| 13,927
|
java
|
/**
*/
package rsgf.mw.presentation;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
import org.eclipse.emf.edit.ui.action.ControlAction;
import org.eclipse.emf.edit.ui.action.CreateChildAction;
import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
import org.eclipse.emf.edit.ui.action.LoadResourceAction;
import org.eclipse.emf.edit.ui.action.ValidateAction;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.SubContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import rsgf.tree.presentation.RSGEditorPlugin;
/**
* This is the action bar contributor for the Mw model editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class MwActionBarContributor
extends EditingDomainActionBarContributor
implements ISelectionChangedListener {
/**
* This keeps track of the active editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IEditorPart activeEditorPart;
/**
* This keeps track of the current selection provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ISelectionProvider selectionProvider;
/**
* This action opens the Properties view.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IAction showPropertiesViewAction =
new Action(RSGEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
@Override
public void run() {
try {
getPage().showView("org.eclipse.ui.views.PropertySheet");
}
catch (PartInitException exception) {
RSGEditorPlugin.INSTANCE.log(exception);
}
}
};
/**
* This action refreshes the viewer of the current editor if the editor
* implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IAction refreshViewerAction =
new Action(RSGEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
@Override
public boolean isEnabled() {
return activeEditorPart instanceof IViewerProvider;
}
@Override
public void run() {
if (activeEditorPart instanceof IViewerProvider) {
Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
if (viewer != null) {
viewer.refresh();
}
}
}
};
/**
* This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
* generated for the current selection by the item provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> createChildActions;
/**
* This is the menu manager into which menu contribution items should be added for CreateChild actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createChildMenuManager;
/**
* This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
* generated for the current selection by the item provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> createSiblingActions;
/**
* This is the menu manager into which menu contribution items should be added for CreateSibling actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createSiblingMenuManager;
/**
* This creates an instance of the contributor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MwActionBarContributor() {
super(ADDITIONS_LAST_STYLE);
loadResourceAction = new LoadResourceAction();
validateAction = new ValidateAction();
controlAction = new ControlAction();
}
/**
* This adds Separators for editor additions to the tool bar.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
toolBarManager.add(new Separator("mw-settings"));
toolBarManager.add(new Separator("mw-additions"));
}
/**
* This adds to the menu bar a menu and some separators for editor additions,
* as well as the sub-menus for object creation items.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void contributeToMenu(IMenuManager menuManager) {
super.contributeToMenu(menuManager);
IMenuManager submenuManager = new MenuManager(RSGEditorPlugin.INSTANCE.getString("_UI_MwEditor_menu"), "rsgf.mwMenuID");
menuManager.insertAfter("additions", submenuManager);
submenuManager.add(new Separator("settings"));
submenuManager.add(new Separator("actions"));
submenuManager.add(new Separator("additions"));
submenuManager.add(new Separator("additions-end"));
// Prepare for CreateChild item addition or removal.
//
createChildMenuManager = new MenuManager(RSGEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
submenuManager.insertBefore("additions", createChildMenuManager);
// Prepare for CreateSibling item addition or removal.
//
createSiblingMenuManager = new MenuManager(RSGEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
submenuManager.insertBefore("additions", createSiblingMenuManager);
// Force an update because Eclipse hides empty menus now.
//
submenuManager.addMenuListener
(new IMenuListener() {
public void menuAboutToShow(IMenuManager menuManager) {
menuManager.updateAll(true);
}
});
addGlobalActions(submenuManager);
}
/**
* When the active editor changes, this remembers the change and registers with it as a selection provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setActiveEditor(IEditorPart part) {
super.setActiveEditor(part);
activeEditorPart = part;
// Switch to the new selection provider.
//
if (selectionProvider != null) {
selectionProvider.removeSelectionChangedListener(this);
}
if (part == null) {
selectionProvider = null;
}
else {
selectionProvider = part.getSite().getSelectionProvider();
selectionProvider.addSelectionChangedListener(this);
// Fake a selection changed event to update the menus.
//
if (selectionProvider.getSelection() != null) {
selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
}
}
}
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void selectionChanged(SelectionChangedEvent event) {
// Remove any menu items for old selection.
//
if (createChildMenuManager != null) {
depopulateManager(createChildMenuManager, createChildActions);
}
if (createSiblingMenuManager != null) {
depopulateManager(createSiblingMenuManager, createSiblingActions);
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
Object object = ((IStructuredSelection)selection).getFirstElement();
EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
newChildDescriptors = domain.getNewChildDescriptors(object, null);
newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
}
// Generate actions for selection; populate and redraw the menus.
//
createChildActions = generateCreateChildActions(newChildDescriptors, selection);
createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
if (createChildMenuManager != null) {
populateManager(createChildMenuManager, createChildActions, null);
createChildMenuManager.update(true);
}
if (createSiblingMenuManager != null) {
populateManager(createSiblingMenuManager, createSiblingActions, null);
createSiblingMenuManager.update(true);
}
}
/**
* This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
* and returns the collection of these actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
Collection<IAction> actions = new ArrayList<IAction>();
if (descriptors != null) {
for (Object descriptor : descriptors) {
actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
}
}
return actions;
}
/**
* This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
* and returns the collection of these actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
Collection<IAction> actions = new ArrayList<IAction>();
if (descriptors != null) {
for (Object descriptor : descriptors) {
actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
}
}
return actions;
}
/**
* This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
* by inserting them before the specified contribution item <code>contributionID</code>.
* If <code>contributionID</code> is <code>null</code>, they are simply added.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
if (actions != null) {
for (IAction action : actions) {
if (contributionID != null) {
manager.insertBefore(contributionID, action);
}
else {
manager.add(action);
}
}
}
}
/**
* This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
if (actions != null) {
IContributionItem[] items = manager.getItems();
for (int i = 0; i < items.length; i++) {
// Look into SubContributionItems
//
IContributionItem contributionItem = items[i];
while (contributionItem instanceof SubContributionItem) {
contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
}
// Delete the ActionContributionItems with matching action.
//
if (contributionItem instanceof ActionContributionItem) {
IAction action = ((ActionContributionItem)contributionItem).getAction();
if (actions.contains(action)) {
manager.remove(contributionItem);
}
}
}
}
}
/**
* This populates the pop-up menu before it appears.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void menuAboutToShow(IMenuManager menuManager) {
super.menuAboutToShow(menuManager);
MenuManager submenuManager = null;
submenuManager = new MenuManager(RSGEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
populateManager(submenuManager, createChildActions, null);
menuManager.insertBefore("edit", submenuManager);
submenuManager = new MenuManager(RSGEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
populateManager(submenuManager, createSiblingActions, null);
menuManager.insertBefore("edit", submenuManager);
}
/**
* This inserts global actions before the "additions-end" separator.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void addGlobalActions(IMenuManager menuManager) {
menuManager.insertAfter("additions-end", new Separator("ui-actions"));
menuManager.insertAfter("ui-actions", showPropertiesViewAction);
refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
menuManager.insertAfter("ui-actions", refreshViewerAction);
super.addGlobalActions(menuManager);
}
/**
* This ensures that a delete action will clean up all references to deleted objects.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean removeAllReferencesOnDelete() {
return true;
}
}
|
[
"doyennehoney@gmail.com"
] |
doyennehoney@gmail.com
|
a697e6d1a32679c39920d6921f1a92093eeb470e
|
68ced78466a79d3658a69ea5d98208c967f60a5d
|
/src/test/java/com/outfittery/stylistbooking/controller/CustomerControllerTest.java
|
1a384f807bb4c9c83a6547551166109d0c92e48b
|
[] |
no_license
|
nolines/spring-playground-stylist-reservation-app
|
e5bb6de20ebeba63b2e19a6003d328335dc28fe5
|
9ec3fc9d466ea0540a330aaa89b8c4bbb1cdc2cf
|
refs/heads/master
| 2020-04-13T20:54:22.275518
| 2018-12-28T19:33:44
| 2018-12-28T19:33:44
| 163,442,700
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,584
|
java
|
package com.outfittery.stylistbooking.controller;
import com.outfittery.stylistbooking.controller.dto.CustomerDto;
import com.outfittery.stylistbooking.service.CustomerService;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.MockitoAnnotations.initMocks;
public class CustomerControllerTest {
@Mock private CustomerService customerServiceMock;
@InjectMocks private CustomerController underTest;
@Before
public void setUp() {
initMocks(this);
}
@Test
public void shouldCreateCustomer() {
underTest.create(createCustomerDto());
Mockito.verify(customerServiceMock, Mockito.times(1)).createNewCustomer(any(CustomerDto.class));
}
@Test
public void shouldGetCustomer() throws Exception {
underTest.get("anyId");
Mockito.verify(customerServiceMock, Mockito.times(1)).getCustomer("anyId");
}
@Test
public void shouldGetAllCustomer() throws Exception {
underTest.getAll();
Mockito.verify(customerServiceMock, Mockito.times(1)).getAll();
}
@Test
public void shouldDeleteCustomer() {
underTest.delete("anyId");
Mockito.verify(customerServiceMock, Mockito.times(1)).deleteCustomer("anyId");
}
//TODO:asd
@Test
public void shouldUpdateCustomer() {}
private CustomerDto createCustomerDto() {
CustomerDto customerDto = new CustomerDto();
customerDto.setName("anyName");
customerDto.setEmail("anyEmail");
return customerDto;
}
}
|
[
"cemre.cevik@siemens.com"
] |
cemre.cevik@siemens.com
|
625e9dabb70cbc4a03d5aef1a39e0c27874d1a53
|
1b33bb4e143b18de302ccd5f107e3490ea8b31aa
|
/learn.java/src/main/java/oc/p/_8/_2_PatternsAndPrinciples/implementingPolymorphism/castingObjectReference/pex/I2.java
|
4121e0be524e6c9d3e2ab71ce2df6f926ee4d503
|
[] |
no_license
|
cip-git/learn
|
db2e4eb297e36db475c734a89d18e98819bdd07f
|
b6d97f529ed39f25e17b602c00ebad01d7bc2d38
|
refs/heads/master
| 2022-12-23T16:39:56.977803
| 2022-12-18T13:57:37
| 2022-12-18T13:57:37
| 97,759,022
| 0
| 1
| null | 2020-10-13T17:06:36
| 2017-07-19T20:37:29
|
Java
|
UTF-8
|
Java
| false
| false
| 112
|
java
|
package oc.p._8._2_PatternsAndPrinciples.implementingPolymorphism.castingObjectReference.pex;
interface I2
{
}
|
[
"ciprian.dorin.tanase@ibm.com"
] |
ciprian.dorin.tanase@ibm.com
|
911656cfec40d084ffb3a78fa5e830489611d62c
|
2b7ac19420bb172237828652453f95c7f0479085
|
/src/main/java/com/kekellisson/componentGenerator/configuration/ApplicationConfig.java
|
d1b9588bff47f485903c746e3f8e0632d7f2e88e
|
[] |
no_license
|
kellisson/UseCaseGenerator
|
4a620a34f1c8df8ea92b13a5852551b87aac0ecc
|
c8700b854cf6fa1215eaf85a9c6e1fc12127ef7d
|
refs/heads/master
| 2023-08-15T23:41:10.530674
| 2021-10-19T23:46:38
| 2021-10-19T23:46:38
| 419,125,245
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 595
|
java
|
package com.kekellisson.componentGenerator.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import freemarker.template.Version;
@Configuration
@ComponentScan("com.kekellisson.componentGenerator")
@PropertySource("classpath:application.properties")
public class ApplicationConfig {
@Bean
public Version getVersionConfig() {
return freemarker.template.Configuration.VERSION_2_3_29;
}
}
|
[
"kellisson@outlook.com"
] |
kellisson@outlook.com
|
2539b164837ce3ab745e5cedee844b4ae98937b4
|
421f0a75a6b62c5af62f89595be61f406328113b
|
/generated_tests/model_seeding/83_xbus-net.sf.xbus.base.core.timeoutcall.ThreadFactoryUser-1.0-10/net/sf/xbus/base/core/timeoutcall/ThreadFactoryUser_ESTest.java
|
d45214bb1cf43737e77e58273b6abb27bcf921eb
|
[] |
no_license
|
tigerqiu712/evosuite-model-seeding-empirical-evaluation
|
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
|
11a920b8213d9855082d3946233731c843baf7bc
|
refs/heads/master
| 2020-12-23T21:04:12.152289
| 2019-10-30T08:02:29
| 2019-10-30T08:02:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 673
|
java
|
/*
* This file was automatically generated by EvoSuite
* Sat Oct 26 02:16:40 GMT 2019
*/
package net.sf.xbus.base.core.timeoutcall;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class ThreadFactoryUser_ESTest extends ThreadFactoryUser_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
|
[
"pderakhshanfar@bsr01.win.tue.nl"
] |
pderakhshanfar@bsr01.win.tue.nl
|
126d1788ed8551d79294508fa524807b754e7b2d
|
3b06f6271d102f114c6d56a9cd8f5424f0921fdc
|
/src/main/java/com/mm/app/service/AssuranceService.java
|
5cb3a682dfcdba8c62d6aac90049dbb10d071de1
|
[] |
no_license
|
ehayanis/easypharma
|
f4d652718ad92bba086dc76882018153f52f541d
|
a12326541a3c6f73f58be08afe93fc3bcffa271f
|
refs/heads/master
| 2020-03-30T05:09:29.341045
| 2019-06-30T19:43:03
| 2019-06-30T19:43:03
| 40,325,484
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 481
|
java
|
package com.mm.app.service;
import java.util.List;
import com.mm.app.model.Assurance;
import com.mm.app.model.AssuranceClient;
import com.mm.app.view.TypeAssurance;
public interface AssuranceService {
public List<Assurance> getAssurances();
public Assurance findAssurance(int id);
public AssuranceClient findAssuranceByCoverCard(String covercard);
public List<Assurance> getAssurancesByCriteria(String criteria, TypeAssurance typeAssurance);
}
|
[
"hayani.mehdi149@gmail.com"
] |
hayani.mehdi149@gmail.com
|
a9d2d98df6ab6c65d027101a0858e8f4eb783054
|
6e27f74679dc612fce0c4557f068c65c4bddf563
|
/src/main/java/com/responseschema/validator/service/ServiceRequestTransformation.java
|
714380271f5c6908a65cf546be203e96e4658020
|
[
"MIT"
] |
permissive
|
saiashok/ResponseSwaggerSchemaValidator
|
ad7e55ac79bdae053a575b57afd8d8da45f840f2
|
95e108c1975d7879e8c4274a94156e812064e440
|
refs/heads/master
| 2023-04-27T17:59:54.070238
| 2019-07-24T02:07:59
| 2019-07-24T02:07:59
| 198,536,095
| 0
| 0
|
MIT
| 2023-04-14T17:49:31
| 2019-07-24T01:38:12
|
Java
|
UTF-8
|
Java
| false
| false
| 983
|
java
|
package com.responseschema.validator.service;
import java.util.ArrayList;
import java.util.List;
import com.responseschema.validator.model.JsonRequestPayload;
import com.responseschema.validator.model.ToolRequest;
public class ServiceRequestTransformation {
JsonRequestPayload jsonRequestPL;
public ServiceRequestTransformation() {
}
public ServiceRequestTransformation(JsonRequestPayload jsonRequest) {
this.jsonRequestPL = jsonRequest;
}
public List<ToolRequest> convertJsonToObject(){
JsonRequestPayload jsonRequestPL= this.jsonRequestPL;
List<ToolRequest> lis = new ArrayList<ToolRequest>();
ToolRequest v = new ToolRequest();
v.setOperationName(jsonRequestPL.getOperationName());
v.setOperationType(jsonRequestPL.getOperationType());
v.setApiResponse(jsonRequestPL.getResponse());
v.setSwagger(jsonRequestPL.getSwaggerFileLocation());
v.setStatusCode(jsonRequestPL.getStatusCode());
lis.add(v);
return lis;
}
}
|
[
"reddysaiashok29@gmail.com"
] |
reddysaiashok29@gmail.com
|
9d73ada8c1382da6e41bb3f0a578f7a260865b37
|
8346452d0f89e7cf61d2601ad3b33906d0ca4584
|
/src/com/wyc/factorymethod/example/ex1/Animal.java
|
c4718501d9dcfadbe583349773b53ed5a2c0630b
|
[] |
no_license
|
beautifulsakuragrass/design
|
d2e9347005730e838cb65cdf2b1c7c6261f15bd0
|
09cb9262b01db2d099765c115d670d1094b79570
|
refs/heads/master
| 2020-07-10T10:52:44.550802
| 2019-10-05T03:02:30
| 2019-10-05T03:02:30
| 204,227,818
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 193
|
java
|
package com.wyc.factorymethod.example.ex1;
/**
* 抽象产品:动物类
*
* @author wyc
* @date 2019/8/27
*/
public interface Animal {
/**
* 展示
*/
void show();
}
|
[
"yuancong_wang@163.com"
] |
yuancong_wang@163.com
|
c48f586dbb3161d96556ca60a0268208abc3ad6e
|
132f967072b1a0de08719cdbf513ec318b064203
|
/src/Person.java
|
f63c7458cd49da745853889f1a901b21978b087d
|
[
"Apache-2.0"
] |
permissive
|
Gurupremrajpal/CST338_InfinityWar
|
5420da86b0646acbcaf20694c21160db7a9bfcdf
|
5846065cf421b902bbf47c72515987b637c4b382
|
refs/heads/master
| 2023-04-09T00:19:58.658471
| 2021-04-18T06:36:24
| 2021-04-18T06:36:24
| 359,064,693
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 354
|
java
|
public abstract class Person {
int power;
String location;
public int getPower() {
return power;
}
public void setPower(int power) {
this.power = power;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
}
|
[
"Gurupremrajpal@github.com"
] |
Gurupremrajpal@github.com
|
b0ed9f45f54fb135b39a92d3b4d8a8f90c9cf3f6
|
50296ea1ad5429af599df6f00baf761ab34e262e
|
/src/main/java/util/TabSeparatedToExcel.java
|
5104c45e86b7b08c45a70c5191ae4b1c634efae3
|
[] |
no_license
|
JessedeDoes/SimpleLexicalStatistics
|
c082b33d2388976f49b4b78ad82e5595962df369
|
97a2517ac9febd6f2acb5eefe21c8ea6bacd1c28
|
refs/heads/master
| 2021-01-18T23:17:02.612561
| 2018-03-08T13:59:20
| 2018-03-08T13:59:20
| 33,173,582
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,651
|
java
|
package util;
import java.io.*;
import java.util.*;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.format.CellFormat;
import jxl.read.biff.BiffException;
import jxl.format.Alignment;
import jxl.write.Label;
import jxl.write.Number;
import jxl.write.WritableCellFeatures;
import jxl.write.WritableCellFormat;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;
/**
* Add a bunch of tab-separated files as separate sheets to an excel sheet.
* Command line:
* <pre>
* java TabSeparatedToExcel <excel file to write> args
* </pre>
* each arg consists (separated by ":") of
* <pre>
* <sheetName>:<fileName>:<column names>
* </pre>
* Column names are separated by "/".
*
* <p>
* There is a half-baked attempt to write a column which is completely numerical as excel numbers to the sheet.
* @author does
*/
public class TabSeparatedToExcel
{
WritableWorkbook wworkbook;
String[] columnNames = {};
private boolean hasColumnNames;
public static void main(String[] args)
{
TabSeparatedToExcel ts2e = new TabSeparatedToExcel();
ts2e.export(args);
}
public TabSeparatedToExcel()
{
}
public void export(String[] args)
{
try
{
wworkbook = Workbook.createWorkbook(new File(args[0]));
for (int i=1; i < args.length; i++)
{
String a = args[i];
String sheetName = a;
sheetName = sheetName.replaceAll(".*[/\\\\]", "");
String fileName = a;
String columns = null;
hasColumnNames = false;
if (a.contains(":"))
{
String[] z = a.split(":");
sheetName = z[0]; fileName=z[1];
if (z.length > 2)
{
columns =z[2];
columnNames = columns.split("/");
hasColumnNames = true;
}
};
WritableSheet wsheet = wworkbook.createSheet(sheetName, i-1);
List<List<String>> content = new ArrayList<List<String>>();
BufferedReader b = new BufferedReader(new FileReader(fileName));
String line;
int nCols = 0;
int offset = hasColumnNames?1:0;
if (hasColumnNames)
{
for (int x=0; x < columnNames.length; x++)
{
Label l = new Label(x, 0, columnNames[x]);
try
{
wsheet.addCell(l);
} catch (RowsExceededException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriteException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
while ((line = b.readLine()) != null)
{
String[] cols = line.split("\t");
if (cols.length > nCols)
{
nCols = cols.length;
}
List<String> l = Arrays.asList(cols);
content.add(l);
}
for (int j=0; j < nCols; j++)
{
boolean contentMaybeNumber = true;
boolean contentMaybeInteger = true;
for (int k=0; k < content.size(); k++)
{
try
{
Double d = Double.parseDouble(content.get(k).get(j));
try
{
Integer x = Integer.parseInt(content.get(k).get(j));
} catch (Exception e)
{
contentMaybeInteger = false;
}
} catch (Exception e)
{
//System.err.println("column " + j + " is not numerical");
contentMaybeNumber = false;
}
}
for (int k=0; k < content.size(); k++)
{
try
{
String cell = content.get(k).get(j);
if (contentMaybeNumber && contentMaybeInteger)
{
Number number = new Number(j, k+offset, Integer.parseInt(cell ));
wsheet.addCell(number);
} else if (contentMaybeNumber)
{
Number number = new Number(j, k+offset, Double.parseDouble(cell ));
wsheet.addCell(number);
} else
{
Label label = new Label(j, k+offset, cell);
//checkColumnProperties(label,j);
wsheet.addCell(label); // here we need to retrieve special formats first...
}
} catch (Exception e)
{
//e.printStackTrace();
}
}
}
}
try
{
wworkbook.write();
wworkbook.close();
} catch (WriteException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void checkColumnProperties(Cell cell, int column, int row)
{
// TODO Auto-generated method stub
//WritableCellFeatures cf = label.getWritableCellFeatures()
//cf.s
//label.
//CellFormat x;
//x.
//label.setCellFormat(cf);
WritableCellFormat newFormat = null;
WritableCellFormat cellFormatObj = new WritableCellFormat();
CellFormat readFormat = cell.getCellFormat() == null ? cellFormatObj
: cell.getCellFormat();
newFormat = new WritableCellFormat(readFormat);
//newFormat.setBackground(Colour.WHITE);
//newFormat.setBorder(jxl.format.Border.BOTTOM,jxl.format.BorderLineStyle.THIN);
try
{
newFormat.setAlignment(Alignment.CENTRE);
} catch (WriteException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
// en dan:
//WritableSheet s = workbook.getSheet(0);
//column, row , where you wan the new format , note newFormat is passed as parameter.
//sheet.addCell(new Label(column, row, request.getRuleId(), copyCellFormat(s, column, newFormat)));
}
public void setColumnProperty(String name)
{
}
}
|
[
"jesse.dedoes@inl.nl"
] |
jesse.dedoes@inl.nl
|
d648cdd93e7fc60da3dd9a231e8ab2065b992e26
|
30b48d0d64218325600fbc490c2e5d684780f15b
|
/src/main/java/com/nlzh/architecture/service/ArchitectureTextService.java
|
542995047a4a1ae8e21cc0dc3d6d90e704c5b858
|
[] |
no_license
|
1352148827/SuperSystem
|
5e97cc63e90ae5c3942e20b81681af69a61dc834
|
972c52e25e423797ba17063b025d935c35cd49d0
|
refs/heads/master
| 2020-03-14T22:54:48.203802
| 2018-05-02T10:00:20
| 2018-05-02T10:00:20
| 131,831,664
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 388
|
java
|
package com.nlzh.architecture.service;
import com.nlzh.architecture.pojo.ArchitectureText;
public interface ArchitectureTextService {
int deleteByPrimaryKey(Long architectureTextId);
int insert(ArchitectureText architectureText);
ArchitectureText selectByPrimaryKey(Long architectureTextId);
int updateByPrimaryKey(ArchitectureText architectureText);
}
|
[
"1352148827@qq.com"
] |
1352148827@qq.com
|
cc11d2eed68378122d0531069cd170a4ae9d9cad
|
644545878c2f3c5ef3d613c9d93e4056762c1e02
|
/src/main/java/pl/oczadly/spring/topics/domain/user/management/entity/exception/NicknameExistsException.java
|
900b2b5a0f9b74047d7db929cb2bb3d7348c62b6
|
[] |
no_license
|
Pawlllosss/SeminarsAppBackend
|
c25deee08e42b9306bc0edc04dca548c821749f4
|
d732266d65704408ab5c32cdcf55c6be9a1d408b
|
refs/heads/master
| 2020-06-19T21:42:12.052898
| 2019-12-08T21:55:44
| 2019-12-08T22:20:30
| 196,884,377
| 0
| 0
| null | 2019-12-08T22:20:32
| 2019-07-14T21:18:24
|
Java
|
UTF-8
|
Java
| false
| false
| 272
|
java
|
package pl.oczadly.spring.topics.domain.user.management.entity.exception;
public class NicknameExistsException extends RuntimeException {
public NicknameExistsException(String nickname) {
super("User with nickname " + nickname + " already exists.");
}
}
|
[
"oczadlypawe@gmail.com"
] |
oczadlypawe@gmail.com
|
e4c75c82b71368a34e5e0b52ff000045e6d1dc4e
|
d763b638c43f888061c5cf67b220863325065eec
|
/Lab11-12.1/src/main/java/by/punko/builder/PersonBuilder.java
|
6aa61489e76c2829249222b6b25fe58bd8d874cc
|
[] |
no_license
|
AlinaPunko/Java-labs-1.0
|
08c3cd7eeff7887a6297672b2310eb368720beae
|
c90e14fe949b623a6bd467abb659c844b2dd7e6a
|
refs/heads/master
| 2020-07-24T09:23:24.834618
| 2019-09-11T18:28:05
| 2019-09-11T18:28:05
| 207,880,743
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,027
|
java
|
package main.java.by.punko.builder;
import main.java.by.punko.exception.RepositoryException;
import main.java.by.punko.model.Person;
import main.java.by.punko.repository.dbconstants.PersonTableConstants;
import java.sql.ResultSet;
import java.sql.SQLException;
public class PersonBuilder implements Builder <Person>{
@Override
public Person build(ResultSet resultSet) throws RepositoryException {
try {
int id = resultSet.getInt(PersonTableConstants.ID.getFieldName());
String name =
resultSet.getString(PersonTableConstants.NAME.getFieldName());
String phone =
resultSet.getString(PersonTableConstants.PHONE.getFieldName());
String email =
resultSet.getString(PersonTableConstants.EMAIL.getFieldName());
return new Person(id, name, phone, email);
} catch (SQLException exception) {
throw new RepositoryException(exception.getMessage(), exception);
}
}
}
|
[
"punko.alina2000@gmail.com"
] |
punko.alina2000@gmail.com
|
9479e6bcf90d0d04caca123918594d2a7e80280c
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_146b2f98c2d276bcb8b7f1e6a20586a63fd3a57b/JaasTest/2_146b2f98c2d276bcb8b7f1e6a20586a63fd3a57b_JaasTest_s.java
|
d2757fa3979550f16eecbde1674204fd847ce133
|
[] |
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
| 2,653
|
java
|
/**********************************************************************************
* $URL$
* $Id$
***********************************************************************************
*
* Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
*
* Licensed under the Educational Community License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/ecl1.php
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**********************************************************************************/
import javax.security.auth.*;
import javax.security.auth.callback.*;
import javax.security.auth.login.*;
import com.sun.security.auth.callback.TextCallbackHandler;
/*
* JaasTest -- attempts to authenticate a user and reports success or an error message
* Argument: LoginContext [optional, default is "JaasAuthentication"]
* (must exist in "login configuration file" specified in ${java.home}/lib/security/java.security)
*
* Seth Theriault (slt@columbia.edu)
* Academic Information Systems, Columbia University
* (based on code from various contributors)
*
*/
public class JaasTest {
public static void main(String[] args) {
String testcontext = "";
if (null == args || args.length != 1) {
testcontext = "JaasAuthentication";
} else testcontext = args[0];
System.out.println("\nLoginContext for testing: " + testcontext);
System.out.println("Enter a username and password to test this LoginContext.\n");
LoginContext lc = null;
try {
lc = new LoginContext(testcontext, new TextCallbackHandler());
} catch (LoginException le) {
System.err.println("Cannot create LoginContext. " + le.getMessage());
System.exit(-1);
} catch (SecurityException se) {
System.err.println("Cannot create LoginContext. " + se.getMessage());
System.exit(-1);
}
try {
// attempt authentication
lc.login();
lc.logout();
} catch (LoginException le) {
System.err.println("\nAuthentication FAILED.");
System.err.println("Error message:\n --> " + le.getMessage());
System.exit(-1);
}
System.out.println("Authentication SUCCEEDED.");
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
2c69c1fdf2052d4e4bfa340bdd75db20377b82b7
|
edc969506adf2b809a3ff0eaa9a4abb418472bf2
|
/ThreadPractice/src/AccountSavings.java
|
55e595143c1b73b8aaca8791eaea1c8bac99a3da
|
[] |
no_license
|
seancampbell3161/JavaLearning
|
a60ddca8ff23d523dae60050212cd65823ec8a52
|
200548bd5d8d0d49529fb7cc9b3fb246c9f00877
|
refs/heads/main
| 2023-06-29T05:35:45.571315
| 2021-08-04T20:51:56
| 2021-08-04T20:51:56
| 379,388,781
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,837
|
java
|
public class AccountSavings {
public double annualInterestRate = 0.053;
private double savingsBalance = 10;
private double interest = 0;
public synchronized void compoundInterest() {
interest = savingsBalance * Math.pow( 1 + (annualInterestRate / 12),12 ) - savingsBalance;
savingsBalance += interest;
}
public void runThreads() {
Thread t1 = new Thread(
new Runnable() {
@Override
public void run() {
try {
for(int i = 0; i < 50; i++) {
compoundInterest();
System.out.println(savingsBalance);
}
Thread.sleep(3000);
} catch(InterruptedException e) {
e.printStackTrace();
}
}
});
Thread t2 = new Thread(
new Runnable() {
@Override
public void run() {
for(int i = 0; i < 25; i++) {
compoundInterest();
System.out.println("Thread 2");
}
}
}
);
t1.start();
t2.start();
try {
t1.join();
// t2.join();
} catch(InterruptedException e) {
e.printStackTrace();
}
System.out.println("savings balance is " + savingsBalance +
" and annual intereste rate is " + (annualInterestRate *100) + "%");
}
public static void main(String[] args) {
AccountSavings account = new AccountSavings();
account.runThreads();
}
}
|
[
"sean.campbell3161@gmail.com"
] |
sean.campbell3161@gmail.com
|
605a03cfbe0784f16881c0ade68906efe30649eb
|
22cdb1895bf950a81e2106a10224d9b34ce5eac3
|
/demoiselleshiro/src/main/java/br/tjce/demoiselleshiro/domain/EntidadesHasPerfiPK.java
|
fade99eeb87e59535c18405cabb0bd38119f0be6
|
[] |
no_license
|
armando-couto/demoiselle-shiro
|
b0b12eeea09164d50aca0258da289db9484d1604
|
07588cc677c9dcb0ea97e86cb9e5a1274019d621
|
refs/heads/master
| 2023-07-24T21:58:44.262508
| 2023-07-18T11:45:33
| 2023-07-18T11:45:33
| 8,528,437
| 2
| 1
| null | 2023-07-18T11:45:35
| 2013-03-02T23:00:01
|
Java
|
UTF-8
|
Java
| false
| false
| 1,435
|
java
|
package br.tjce.demoiselleshiro.domain;
import java.io.Serializable;
import javax.persistence.*;
/**
* The primary key class for the entidades_has_perfis database table.
*
*/
@Embeddable
public class EntidadesHasPerfiPK implements Serializable {
//default serial version id, required for serializable classes.
private static final long serialVersionUID = 1L;
@Column(name="entidades_id")
private int entidadesId;
@Column(name="perfis_id")
private int perfisId;
public EntidadesHasPerfiPK() {
}
public EntidadesHasPerfiPK(int entidadesId, int perfisId) {
super();
this.entidadesId = entidadesId;
this.perfisId = perfisId;
}
public int getEntidadesId() {
return this.entidadesId;
}
public void setEntidadesId(int entidadesId) {
this.entidadesId = entidadesId;
}
public int getPerfisId() {
return this.perfisId;
}
public void setPerfisId(int perfisId) {
this.perfisId = perfisId;
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof EntidadesHasPerfiPK)) {
return false;
}
EntidadesHasPerfiPK castOther = (EntidadesHasPerfiPK)other;
return
(this.entidadesId == castOther.entidadesId)
&& (this.perfisId == castOther.perfisId);
}
public int hashCode() {
final int prime = 31;
int hash = 17;
hash = hash * prime + this.entidadesId;
hash = hash * prime + this.perfisId;
return hash;
}
}
|
[
"armando-couto@hotmail.com"
] |
armando-couto@hotmail.com
|
4684698b5d4e1ef2c42e2a5749e884200542507c
|
5d3d59975d4eb95e83b82c3f1c945553c877299c
|
/290/EmployeeType.java
|
cfadae192b426ff7ee4c49a23cda045b49402b74
|
[] |
no_license
|
halfer53/UCI-assignments
|
7504737dec36a00649c875bea8ef1763e8703bfb
|
89784793e986e4301d0470ab091d69ff156bb9df
|
refs/heads/master
| 2021-01-22T22:21:03.494206
| 2017-08-27T09:15:07
| 2017-08-27T09:15:07
| 85,535,048
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 343
|
java
|
package jyinterface.interfaces;
import org.python.core.PyList;
import jyinterface.interfaces.DependentType;
public interface EmployeeType {
public String getEmployeeFirst();
public String getEmployeeLast();
public String getEmployeeId();
public PyList getDependents();
public void addDependent(DependentType dependent);
}
|
[
"brucetansh@gmail.com"
] |
brucetansh@gmail.com
|
6983c2f2027c5a135dc2dddb61f0e067a552e853
|
63e0cd899972adbb117a17d8d40eef8fefb56d62
|
/spring_framework/s4-09-mongodb-oid-serialization/src/main/java/com/sc/repository/OrderRepository.java
|
d3ad86185672429b03d677c51c3ae7c39e05d61e
|
[] |
no_license
|
sherazc/playground
|
8b90e1f7b624a77a3f3e9cf5f71eecf984aa8180
|
7fe926d2564b12d96f237b253511dd7c2a302b64
|
refs/heads/master
| 2023-08-16T17:22:29.564713
| 2023-08-16T04:34:52
| 2023-08-16T04:34:52
| 87,116,642
| 2
| 1
| null | 2023-05-04T18:25:45
| 2017-04-03T20:15:15
|
PHP
|
UTF-8
|
Java
| false
| false
| 303
|
java
|
package com.sc.repository;
import java.util.List;
import com.sc.modal.Order;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;
public interface OrderRepository extends MongoRepository<Order, String> {
List<Order> findByUserId(ObjectId userId);
}
|
[
"sheraz@mbp.com"
] |
sheraz@mbp.com
|
bdfed875c547211eb8b8913032b6efc7679cb747
|
2cc4f993ec641e3d58792765e659bf4ced18bff8
|
/app/src/main/java/com/bawei/redchild/baby_info/fragment/BabyFragment.java
|
28edd09a84360436751ef49618e4f71e67729f83
|
[] |
no_license
|
BringEveryAimRise/RedChild5
|
e4bb5b0ff9cde2f6287b4a14962787cbeb350a56
|
f7600d7ff91cb57b493c271c576b71fa66a91e73
|
refs/heads/master
| 2021-01-23T02:06:11.187648
| 2017-05-31T12:53:28
| 2017-05-31T12:53:28
| 92,908,014
| 0
| 4
| null | 2017-05-31T10:40:21
| 2017-05-31T05:31:32
|
Java
|
UTF-8
|
Java
| false
| false
| 5,428
|
java
|
package com.bawei.redchild.baby_info.fragment;
import android.content.Intent;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import com.bawei.redchild.HomeActivity;
import com.bawei.redchild.R;
import com.bawei.redchild.base.BaseFragment;
/**
* Effect :
* <p>
* Created by Administrator
* Time by 2017/5/19 0019
*/
public class BabyFragment extends BaseFragment implements View.OnClickListener{
private ImageView boy_animator,girl_animator;
private ImageView boy_checked,girl_checked;
private RotateAnimation boy_rotate,girl_rotate;
private int tag=0;
/**
* 绑定布局文件
*
* @return 布局文件ID
*/
@Override
protected int attachLayoutRes() {
return R.layout.babyinfo_fragment_baby;
}
/**
* 初始化 view控件
*/
@Override
protected void initView() {
//获取 toolbar
final Toolbar toolbar = (Toolbar) getActivity().findViewById(R.id.activity_babyinfo_toolbar);
final ImageView back = (ImageView) toolbar.findViewById(R.id.activity_babyinfo_back);
back.setVisibility(View.VISIBLE);
back.findViewById(R.id.activity_babyinfo_back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//回退
getActivity().getSupportFragmentManager().popBackStack();
//隐藏 回退
back.setVisibility(View.INVISIBLE);
}
});
getActivity().findViewById(R.id.iv_frag_baby_boy).setOnClickListener(this);
getActivity().findViewById(R.id.iv_frag_baby_girl).setOnClickListener(this);
getActivity().findViewById(R.id.btn_frag_baby_affirm).setOnClickListener(this);
boy_animator = (ImageView) getActivity().findViewById(R.id.iv_frag_baby_boy_animator);
boy_checked = (ImageView) getActivity().findViewById(R.id.iv_frag_baby_boy_check);
girl_animator = (ImageView) getActivity().findViewById(R.id.iv_frag_baby_girl_animator);
girl_checked = (ImageView) getActivity().findViewById(R.id.iv_frag_baby_girl_check);
//初始化 动画
initAnimator();
}
private void initAnimator() {
//动画
boy_rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
boy_rotate.setDuration(4000);
boy_rotate.setRepeatCount(-1);
girl_rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
girl_rotate.setDuration(4000);
girl_rotate.setRepeatCount(-1);
}
/**
* boy 男孩动画
*/
private void addBoyAnimator() {
//清除动画
girl_animator.clearAnimation();
//开始旋转动画
boy_animator.startAnimation(boy_rotate);
}
private void addGirlAnimator() {
//清除动画
boy_animator.clearAnimation();
//开始旋转动画
girl_animator.startAnimation(girl_rotate);
}
public void addAinimation(ImageView imageView){
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(4000);
rotateAnimation.setRepeatCount(-1);
imageView.startAnimation(rotateAnimation);
}
/**
* Called when a view has been clicked.
*
* @param v The view that was clicked.
*/
@Override
public void onClick(View v) {
//弊屏多次触控
if(v.getId()!=tag){
switch (v.getId()){
case R.id.iv_frag_baby_boy:
tag=R.id.iv_frag_baby_boy;
//显示 男孩
boy_animator.setVisibility(View.VISIBLE);
boy_checked.setVisibility(View.VISIBLE);
//隐藏 女孩
girl_animator.setVisibility(View.INVISIBLE);
girl_checked.setVisibility(View.INVISIBLE);
addBoyAnimator();
// addAinimation(boy_animator);
break;
case R.id.iv_frag_baby_girl:
tag=R.id.iv_frag_baby_girl;
//显示 女孩
girl_animator.setVisibility(View.VISIBLE);
girl_checked.setVisibility(View.VISIBLE);
//隐藏 男孩
boy_animator.setVisibility(View.INVISIBLE);
boy_checked.setVisibility(View.INVISIBLE);
// addAinimation(girl_animator);
addGirlAnimator();
break;
case R.id.btn_frag_baby_affirm:
tag=R.id.btn_frag_baby_affirm;
//跳转到主页面
Intent intent = new Intent(getActivity(), HomeActivity.class);
intent.putExtra("state",2);
intent.putExtra("birthdate","20170519");
intent.putExtra("sex","男");
intent.putExtra("name","刘宏亮");
startActivity(intent);
getActivity().finish();
break;
}
}
}
}
|
[
"bringeveryaimrise@outlook.com"
] |
bringeveryaimrise@outlook.com
|
5a3fbc612d5475dbbc74afca071308c6fb877610
|
1a3b78a1087f6cfaf6d88c159512d392062ef153
|
/src/test/java/com/github/microcatalog/repository/CustomAuditEventRepositoryIT.java
|
422418877beff18a2896b13c240e9c46a4ac3302
|
[
"MIT"
] |
permissive
|
HalasNet/microservice-catalog
|
122a69dc258a0bc488128ce467e6fccdb5a90d67
|
8c4d42931fffc82c69a7f57207e47f6bfdc7677a
|
refs/heads/master
| 2023-06-10T15:23:59.570862
| 2021-07-01T07:30:34
| 2021-07-01T07:30:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,600
|
java
|
package com.github.microcatalog.repository;
import com.github.microcatalog.MicrocatalogApp;
import com.github.microcatalog.config.Constants;
import com.github.microcatalog.config.audit.AuditEventConverter;
import com.github.microcatalog.domain.PersistentAuditEvent;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpSession;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static com.github.microcatalog.repository.CustomAuditEventRepository.EVENT_DATA_COLUMN_MAX_LENGTH;
/**
* Integration tests for {@link CustomAuditEventRepository}.
*/
@SpringBootTest(classes = MicrocatalogApp.class)
@Transactional
public class CustomAuditEventRepositoryIT {
@Autowired
private PersistenceAuditEventRepository persistenceAuditEventRepository;
@Autowired
private AuditEventConverter auditEventConverter;
private CustomAuditEventRepository customAuditEventRepository;
@BeforeEach
public void setup() {
customAuditEventRepository = new CustomAuditEventRepository(persistenceAuditEventRepository, auditEventConverter);
persistenceAuditEventRepository.deleteAll();
Instant oneHourAgo = Instant.now().minusSeconds(3600);
PersistentAuditEvent testUserEvent = new PersistentAuditEvent();
testUserEvent.setPrincipal("test-user");
testUserEvent.setAuditEventType("test-type");
testUserEvent.setAuditEventDate(oneHourAgo);
Map<String, String> data = new HashMap<>();
data.put("test-key", "test-value");
testUserEvent.setData(data);
PersistentAuditEvent testOldUserEvent = new PersistentAuditEvent();
testOldUserEvent.setPrincipal("test-user");
testOldUserEvent.setAuditEventType("test-type");
testOldUserEvent.setAuditEventDate(oneHourAgo.minusSeconds(10000));
PersistentAuditEvent testOtherUserEvent = new PersistentAuditEvent();
testOtherUserEvent.setPrincipal("other-test-user");
testOtherUserEvent.setAuditEventType("test-type");
testOtherUserEvent.setAuditEventDate(oneHourAgo);
}
@Test
public void addAuditEvent() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("test-value");
assertThat(persistentAuditEvent.getAuditEventDate().truncatedTo(ChronoUnit.MILLIS))
.isEqualTo(event.getTimestamp().truncatedTo(ChronoUnit.MILLIS));
}
@Test
public void addAuditEventTruncateLargeData() {
Map<String, Object> data = new HashMap<>();
StringBuilder largeData = new StringBuilder();
for (int i = 0; i < EVENT_DATA_COLUMN_MAX_LENGTH + 10; i++) {
largeData.append("a");
}
data.put("test-key", largeData);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
String actualData = persistentAuditEvent.getData().get("test-key");
assertThat(actualData.length()).isEqualTo(EVENT_DATA_COLUMN_MAX_LENGTH);
assertThat(actualData).isSubstringOf(largeData);
assertThat(persistentAuditEvent.getAuditEventDate().truncatedTo(ChronoUnit.MILLIS))
.isEqualTo(event.getTimestamp().truncatedTo(ChronoUnit.MILLIS));
}
@Test
public void testAddEventWithWebAuthenticationDetails() {
HttpSession session = new MockHttpSession(null, "test-session-id");
MockHttpServletRequest request = new MockHttpServletRequest();
request.setSession(session);
request.setRemoteAddr("1.2.3.4");
WebAuthenticationDetails details = new WebAuthenticationDetails(request);
Map<String, Object> data = new HashMap<>();
data.put("test-key", details);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("remoteAddress")).isEqualTo("1.2.3.4");
assertThat(persistentAuditEvent.getData().get("sessionId")).isEqualTo("test-session-id");
}
@Test
public void testAddEventWithNullData() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", null);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("null");
}
@Test
public void addAuditEventWithAnonymousUser() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent(Constants.ANONYMOUS_USER, "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
@Test
public void addAuditEventWithAuthorizationFailureType() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "AUTHORIZATION_FAILURE", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
}
|
[
"ternovich@gmail.com"
] |
ternovich@gmail.com
|
094bab70ce6fcead28c5d761e9b8f22ee7bbd47e
|
e55fe2e1fb7f3090dd136997d3a29c2386e01a53
|
/src/main/scala/cn/chenc/fsm/otherdemo/javafsmdemos/demo3/State0.java
|
42e2d3ea9fbe760fe546ccdd23d9ef4b817651fe
|
[] |
no_license
|
wuzedong/fsmDemos
|
f1c72cf760b71ce67e9b68bdb274f78b00541115
|
135c8b5d206d4fe047136c5aacd6c9709d1e800b
|
refs/heads/master
| 2021-04-16T17:31:46.852045
| 2016-09-19T11:13:44
| 2016-09-19T11:13:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 323
|
java
|
package cn.chenc.fsm.otherdemo.javafsmdemos.demo3;
/**
* Created by ChenC on 2016/9/6.
*/
enum State0{
// OFF{
// @Override void power(){
// }
// @Override void power(){
// }
// },
// FANONLY{ },
// COOL{ };
// public abstract void power();
// public abstract void cool();
}
|
[
"ccoiusu@163.com"
] |
ccoiusu@163.com
|
1892a126bdaa7bbcd8150208f9d49463e7994003
|
acae1a673e42c881fc8af74a3d1059d4130cf316
|
/src/libra/common/kmermatch/KmerMatchRecordReader.java
|
1ee052f580657d25e593df5bc426cc2cd50b4cb4
|
[
"Apache-2.0"
] |
permissive
|
ashwin41291/libra
|
db84e78848525e214c82ee7b0ea78e06b5e302d8
|
c0b75cb092641bc6fc4913df2eacc3e5a67c6c77
|
refs/heads/master
| 2020-12-24T07:52:22.551707
| 2016-11-10T10:06:28
| 2016-11-10T10:15:31
| 73,358,917
| 0
| 0
| null | 2016-11-10T07:51:39
| 2016-11-10T07:51:38
| null |
UTF-8
|
Java
| false
| false
| 2,903
|
java
|
/*
* Copyright 2016 iychoi.
*
* 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 libra.common.kmermatch;
import java.io.IOException;
import libra.common.hadoop.io.datatypes.CompressedSequenceWritable;
import libra.preprocess.common.kmerhistogram.KmerRangePartition;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
/**
*
* @author iychoi
*/
public class KmerMatchRecordReader extends RecordReader<CompressedSequenceWritable, KmerMatchResult> {
private static final Log LOG = LogFactory.getLog(KmerMatchRecordReader.class);
private Path[] inputIndexPath;
private KmerJoiner joiner;
private Configuration conf;
private KmerMatchResult curResult;
@Override
public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException {
if(!(split instanceof KmerMatchInputSplit)) {
throw new IOException("split is not an instance of KmerMatchIndexSplit");
}
KmerMatchInputSplit kmerIndexSplit = (KmerMatchInputSplit) split;
this.conf = context.getConfiguration();
this.inputIndexPath = kmerIndexSplit.getIndexFilePath();
KmerRangePartition partition = kmerIndexSplit.getPartition();
this.joiner = new KmerJoiner(this.inputIndexPath, partition, context);
}
@Override
@SuppressWarnings("unchecked")
public boolean nextKeyValue() throws IOException, InterruptedException {
this.curResult = this.joiner.stepNext();
if(this.curResult != null) {
return true;
}
return false;
}
@Override
public CompressedSequenceWritable getCurrentKey() {
if(this.curResult != null) {
return this.curResult.getKey();
}
return null;
}
@Override
public KmerMatchResult getCurrentValue() {
return this.curResult;
}
@Override
public float getProgress() throws IOException {
return this.joiner.getProgress();
}
@Override
public synchronized void close() throws IOException {
this.joiner.close();
}
}
|
[
"iychoi@email.arizona.edu"
] |
iychoi@email.arizona.edu
|
6db594dcede49f1e89fc2988d34997628b12cb2f
|
1cb8b74f13f39ab99970a1c959bb692df6b43169
|
/app/src/main/java/com/example/anwar/uiuxmovie/fragment/HomeFragment.java
|
b8c427b852a5daf8623d80c51ca5621a3b29d1f2
|
[] |
no_license
|
anwar907/UI-UX-Movie
|
db680df1ce64911196e4b56ae7796cc9a995bfd4
|
42c47bf975f016ad744d4784a899411ae19121a0
|
refs/heads/master
| 2020-03-28T03:51:04.966716
| 2018-09-06T13:19:40
| 2018-09-06T13:19:40
| 147,675,781
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,723
|
java
|
package com.example.anwar.uiuxmovie.fragment;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.anwar.uiuxmovie.R;
/**
* A simple {@link Fragment} subclass.
*/
public class HomeFragment extends Fragment {
ViewPager mViewPager;
TabLayout mTablayout;
public HomeFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_home, container, false);
mViewPager = view.findViewById(R.id.view_pager);
mViewPager.setAdapter(new sliderAdapter(getChildFragmentManager()));
mTablayout = view.findViewById(R.id.tab_layout);
mTablayout.setupWithViewPager(mViewPager);
mTablayout.post(new Runnable() {
@Override
public void run() {
mTablayout.setupWithViewPager(mViewPager);
}
});
mTablayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
mViewPager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
return view;
}
private class sliderAdapter extends FragmentPagerAdapter {
String now_playing = getResources().getString(R.string.now_playing);
String up_coming = getResources().getString(R.string.up_coming);
final String tabs[] = {now_playing, up_coming};
public sliderAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return new NowPlayingFragment();
case 1:
return new UpComingFragment();
}
return null;
}
@Override
public int getCount() {
return tabs.length;
}
@Override
public CharSequence getPageTitle(int position) {
return tabs[position];
}
}
}
|
[
"rilltheend@gmail.com"
] |
rilltheend@gmail.com
|
cd09a107b95c8ea6c0dd54b7455700d41691f73a
|
f730a781005acf3cd1b137981b7fb8a551ae3df3
|
/src/cn/zju/edu/dao/DBHelper.java
|
216ab31f33f686559efb70a7236c11df4c0f7354
|
[
"BSD-3-Clause"
] |
permissive
|
pangjiuzala/wordFinder
|
01eef4ab742f8b56d3c65fc8c3b08b0db3ef03d6
|
737966c3e3b7c0392339fdfb449546f748b8d36b
|
refs/heads/master
| 2020-12-24T05:54:43.928150
| 2017-11-21T07:36:35
| 2017-11-21T07:36:35
| 84,960,361
| 3
| 1
| null | null | null | null |
GB18030
|
Java
| false
| false
| 1,584
|
java
|
package cn.zju.edu.dao;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import cn.zju.edu.util.DBConnection;
public class DBHelper {
public static void createtable() throws SQLException {
/* 创建historyresult表,存放预测结果 */
String sql = "DROP TABLE IF EXISTS `historyresult`;";
String sqls = "CREATE TABLE `historyresult` (`id` int(100) NOT NULL AUTO_INCREMENT,truevalue varchar(100) DEFAULT NULL,predictvalue int(100) DEFAULT NULL ,PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=gbk";
Connection conn = (Connection) DBConnection.getConnection();
Statement st = conn.createStatement();
st.execute(sql);
st.execute(sqls);
}
public static void createtableresult() throws SQLException {
/* 创建historyresult表,存放预测结果 */
String sql = "DROP TABLE IF EXISTS `result`;";
String sqls = "CREATE TABLE `result` (`id` int(100) NOT NULL AUTO_INCREMENT,truevalue varchar(100) DEFAULT NULL,predictvalue int(100) DEFAULT NULL ,PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=gbk";
Connection conn = (Connection) DBConnection.getConnection();
Statement st = conn.createStatement();
st.execute(sql);
st.execute(sqls);
}
public static void cleartable() throws SQLException {
Connection conn = (Connection) DBConnection.getConnection();
Statement st = conn.createStatement();
st.executeUpdate("DROP TABLE historyresult");// 清空数据库重复内容
// st.execute("ALTER table historyresult AUTO_INCREMENT = 1");//
// 设置初始字段为1
}
}
|
[
"fightingliu@tencent.com"
] |
fightingliu@tencent.com
|
6d3fee47d4adc4745668b6e36f94dd3dce494848
|
1822b17a30fdbf928fd5848193d76ed9cf996f38
|
/src/main/java/nl/suriani/jadeval/models/StateSet.java
|
6e6b1aa4d7b93ffb6f98526603379fdc316dfe51
|
[
"MIT"
] |
permissive
|
TristanoSuriani/jadeval
|
448e765d5051c8684d77924938a306573506a918
|
c7008e7977e7c0110ca00eefcd80959a86911324
|
refs/heads/master
| 2023-01-14T16:17:47.019876
| 2020-11-12T21:50:11
| 2020-11-12T21:50:11
| 287,472,781
| 0
| 0
|
MIT
| 2020-09-08T13:02:11
| 2020-08-14T07:34:41
|
Java
|
UTF-8
|
Java
| false
| false
| 328
|
java
|
package nl.suriani.jadeval.models;
import java.util.ArrayList;
import java.util.List;
public class StateSet {
private List<String> states;
public StateSet(List<String> states) {
this.states = states;
}
public StateSet() {
this.states = new ArrayList<>();
}
public List<String> getStates() {
return states;
}
}
|
[
"tristano.suriani@ordina.nl"
] |
tristano.suriani@ordina.nl
|
1bd9dd1aee82c90e2792ab22fb22f35665ab28e6
|
6c1c18f95d0bfe3e300c775ecacd296cb0ec176e
|
/lotterylib/src/main/java/com/android/residemenu/lt_lib/enumdata/core/JczqHhdgEnum.java
|
cea3e1de476091b8d85606ac31f7d01b7ccc7a15
|
[] |
no_license
|
winnxiegang/save
|
a7ea6a3dcee7a9ebda8c6ad89957ae0e4d3c430d
|
16ad3a98e8b6ab5d17acacce322dfc5e51ab3330
|
refs/heads/master
| 2020-03-13T04:27:26.650719
| 2018-04-26T01:18:59
| 2018-04-26T01:18:59
| 130,963,368
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,617
|
java
|
/**
* BenchCode.com Inc.
* Copyright (c) 2005-2009 All Rights Reserved.
*/
package com.android.residemenu.lt_lib.enumdata.core;
import com.android.residemenu.lt_lib.enumdata.EnumBase;
import com.android.residemenu.lt_lib.enumdata.core.jczq.JczqScoreEnum;
import com.android.residemenu.lt_lib.utils.lang.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author cold
*
* @version $Id: JczqHhggOptionEnum.java, v 0.1 2013-6-1 下午04:59:05 cold Exp $
*/
public enum JczqHhdgEnum implements HhggEnum {
RQSPF_WIN("让胜", RaceResultEnum.WIN, LotterySubTypeEnum.JCZQ_RQSPF),
RQSPF_DRAW("让平", RaceResultEnum.DRAW, LotterySubTypeEnum.JCZQ_RQSPF),
RQSPF_LOST("让负", RaceResultEnum.LOST, LotterySubTypeEnum.JCZQ_RQSPF),
SPF_WIN("胜", JczqSpfEnum.SPF_WIN, LotterySubTypeEnum.JCZQ_SPF),
SPF_DRAW("平", JczqSpfEnum.SPF_DRAW, LotterySubTypeEnum.JCZQ_SPF),
SPF_LOST("负", JczqSpfEnum.SPF_LOST, LotterySubTypeEnum.JCZQ_SPF),
BF_S_1_0("1:0", JczqScoreEnum.S_1_0, LotterySubTypeEnum.JCZQ_BF),
BF_S_2_0("2:0", JczqScoreEnum.S_2_0, LotterySubTypeEnum.JCZQ_BF),
BF_S_2_1("2:1", JczqScoreEnum.S_2_1, LotterySubTypeEnum.JCZQ_BF),
BF_S_3_0("3:0", JczqScoreEnum.S_3_0, LotterySubTypeEnum.JCZQ_BF),
BF_S_3_1("3:1", JczqScoreEnum.S_3_1, LotterySubTypeEnum.JCZQ_BF),
BF_S_3_2("3:2", JczqScoreEnum.S_3_2, LotterySubTypeEnum.JCZQ_BF),
BF_S_4_0("4:0", JczqScoreEnum.S_4_0, LotterySubTypeEnum.JCZQ_BF),
BF_S_4_1("4:1", JczqScoreEnum.S_4_1, LotterySubTypeEnum.JCZQ_BF),
BF_S_4_2("4:2", JczqScoreEnum.S_4_2, LotterySubTypeEnum.JCZQ_BF),
BF_S_5_0("5:0", JczqScoreEnum.S_5_0, LotterySubTypeEnum.JCZQ_BF),
BF_S_5_1("5:1", JczqScoreEnum.S_5_1, LotterySubTypeEnum.JCZQ_BF),
BF_S_5_2("5:2", JczqScoreEnum.S_5_2, LotterySubTypeEnum.JCZQ_BF),
BF_S_W_O("胜其他", JczqScoreEnum.S_W_O, LotterySubTypeEnum.JCZQ_BF),
BF_S_0_0("0:0", JczqScoreEnum.S_0_0, LotterySubTypeEnum.JCZQ_BF),
BF_S_1_1("1:1", JczqScoreEnum.S_1_1, LotterySubTypeEnum.JCZQ_BF),
BF_S_2_2("2:2", JczqScoreEnum.S_2_2, LotterySubTypeEnum.JCZQ_BF),
BF_S_3_3("3:3", JczqScoreEnum.S_3_3, LotterySubTypeEnum.JCZQ_BF),
BF_S_D_O("平其他", JczqScoreEnum.S_D_O, LotterySubTypeEnum.JCZQ_BF),
BF_S_0_1("0:1", JczqScoreEnum.S_0_1, LotterySubTypeEnum.JCZQ_BF),
BF_S_0_2("0:2", JczqScoreEnum.S_0_2, LotterySubTypeEnum.JCZQ_BF),
BF_S_1_2("1:2", JczqScoreEnum.S_1_2, LotterySubTypeEnum.JCZQ_BF),
BF_S_0_3("0:3", JczqScoreEnum.S_0_3, LotterySubTypeEnum.JCZQ_BF),
BF_S_1_3("1:3", JczqScoreEnum.S_1_3, LotterySubTypeEnum.JCZQ_BF),
BF_S_2_3("2:3", JczqScoreEnum.S_2_3, LotterySubTypeEnum.JCZQ_BF),
BF_S_0_4("0:4", JczqScoreEnum.S_0_4, LotterySubTypeEnum.JCZQ_BF),
BF_S_1_4("1:4", JczqScoreEnum.S_1_4, LotterySubTypeEnum.JCZQ_BF),
BF_S_2_4("2:4", JczqScoreEnum.S_2_4, LotterySubTypeEnum.JCZQ_BF),
BF_S_0_5("0:5", JczqScoreEnum.S_0_5, LotterySubTypeEnum.JCZQ_BF),
BF_S_1_5("1:5", JczqScoreEnum.S_1_5, LotterySubTypeEnum.JCZQ_BF),
BF_S_2_5("2:5", JczqScoreEnum.S_2_5, LotterySubTypeEnum.JCZQ_BF),
BF_S_L_O("负其他", JczqScoreEnum.S_L_O, LotterySubTypeEnum.JCZQ_BF),
BQC_WW("胜胜", JczqHalfFullRaceResultEnum.WW, LotterySubTypeEnum.JCZQ_BQC),
BQC_WD("胜平", JczqHalfFullRaceResultEnum.WD, LotterySubTypeEnum.JCZQ_BQC),
BQC_WL("胜负", JczqHalfFullRaceResultEnum.WL, LotterySubTypeEnum.JCZQ_BQC),
BQC_DW("平胜", JczqHalfFullRaceResultEnum.DW, LotterySubTypeEnum.JCZQ_BQC),
BQC_DD("平平", JczqHalfFullRaceResultEnum.DD, LotterySubTypeEnum.JCZQ_BQC),
BQC_DL("平负", JczqHalfFullRaceResultEnum.DL, LotterySubTypeEnum.JCZQ_BQC),
BQC_LW("负胜", JczqHalfFullRaceResultEnum.LW, LotterySubTypeEnum.JCZQ_BQC),
BQC_LD("负平", JczqHalfFullRaceResultEnum.LD, LotterySubTypeEnum.JCZQ_BQC),
BQC_LL("负负", JczqHalfFullRaceResultEnum.LL, LotterySubTypeEnum.JCZQ_BQC),
JQS_G0("0球", JczqGoalsEnum.G0, LotterySubTypeEnum.JCZQ_JQS),
JQS_G1("1球", JczqGoalsEnum.G1, LotterySubTypeEnum.JCZQ_JQS),
JQS_G2("2球", JczqGoalsEnum.G2, LotterySubTypeEnum.JCZQ_JQS),
JQS_G3("3球", JczqGoalsEnum.G3, LotterySubTypeEnum.JCZQ_JQS),
JQS_G4("4球", JczqGoalsEnum.G4, LotterySubTypeEnum.JCZQ_JQS),
JQS_G5("5球", JczqGoalsEnum.G5, LotterySubTypeEnum.JCZQ_JQS),
JQS_G6("6球", JczqGoalsEnum.G6, LotterySubTypeEnum.JCZQ_JQS),
JQS_G7("7球+", JczqGoalsEnum.G7, LotterySubTypeEnum.JCZQ_JQS), ;
;
private int value;
private LotterySubTypeEnum subType;
private String message;
private EnumBase realResultEnum;
private JczqHhdgEnum(String message, EnumBase realResultEnum, LotterySubTypeEnum subType) {
this.message = message;
this.subType = subType;
this.realResultEnum = realResultEnum;
}
public static JczqHhdgEnum valueOfRealResultEnumValue(EnumBase realResultEnum) {
for (JczqHhdgEnum option : JczqHhdgEnum.values()) {
if (option.realResultEnum == realResultEnum)
return option;
}
return null;
}
public static List<JczqHhdgEnum> valueOfRealResultEnumValues(List<EnumBase> realResultEnums) {
List<JczqHhdgEnum> returnList = new ArrayList<JczqHhdgEnum>();
for (EnumBase enumBase : realResultEnums) {
returnList.add(valueOfRealResultEnumValue(enumBase));
}
return returnList;
}
/**
* 根据玩法,与真实的枚举名称获得枚举
*
* @param subType
* @param option
* @return
*/
public static JczqHhdgEnum valueOfSubTypeRealName(LotterySubTypeEnum subType, String option) {
for (JczqHhdgEnum hhdgEnum : JczqHhdgEnum.values()) {
if (hhdgEnum.subType == subType && StringUtils.equals(hhdgEnum.realResultEnum.name(), option)) {
return hhdgEnum;
}
}
return null;
}
public static List<JczqHhdgEnum> valueOfSubTypeRealNames(LotterySubTypeEnum subType, List<String> options) {
List<JczqHhdgEnum> returnList = new ArrayList<JczqHhdgEnum>();
for (String otpion : options) {
returnList.add(valueOfSubTypeRealName(subType, otpion));
}
return returnList;
}
public LotterySubTypeEnum subType() {
return this.subType;
}
/*
* (non-Javadoc)
*
* @see com.bench.common.enums.EnumBase#message()
*/
public String message() {
// TODO Auto-generated method stub
return message;
}
/*
* (non-Javadoc)
*
* @see com.bench.common.enums.EnumBase#value()
*/
public Number value() {
// TODO Auto-generated method stub
return value;
}
public EnumBase realResultEnum() {
// TODO Auto-generated method stub
return realResultEnum;
}
}
|
[
"1272108979@qq.com"
] |
1272108979@qq.com
|
4e2302f1048808a51bbb15d007d4ec1efbc98912
|
2efc9dade76ccde695f89542cdcb784cbc6fb639
|
/app/src/main/java/com/sum/scanner/mysuccessfulthesis/fragments/CaptureFragment.java
|
9d9994faa0e6f750b146d659e300d136fa431b07
|
[] |
no_license
|
llastivka/code-scanner
|
cfbbf162c12753431587b49dce90bfbd037dd1a1
|
b34a4d4ae05482dfb8eda4163f893ba4f9a5aa4e
|
refs/heads/master
| 2020-04-08T09:29:05.216873
| 2018-12-05T20:52:32
| 2018-12-05T20:52:32
| 159,226,160
| 0
| 0
| null | 2019-02-26T23:01:37
| 2018-11-26T20:08:21
|
Java
|
UTF-8
|
Java
| false
| false
| 11,946
|
java
|
package com.sum.scanner.mysuccessfulthesis.fragments;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.sum.scanner.mysuccessfulthesis.MainActivity;
import com.sum.scanner.mysuccessfulthesis.database.DatabaseHelper;
import com.sum.scanner.mysuccessfulthesis.R;
import com.sum.scanner.mysuccessfulthesis.views.LineView;
import java.util.logging.Logger;
public class CaptureFragment extends Fragment {
private static final Logger logger = Logger.getLogger(CaptureFragment.class.getName());
DatabaseHelper historyDB;
private Context mContext;
private Activity mFragmentActivity;
private ViewGroup rootLayout;
private ImageView angle1, angle2, angle3, angle4;
private int xDelta[] = new int[4];
private int yDelta[] = new int[4];
private int layoutWidth;
private int layoutHeight;
private final int angleSideInDp = 40;
private int angleSide;
boolean gotLayoutMeasures = false;
private int minLeft, minTop, maxLeft, maxTop;
private LineView[] lines = new LineView[4];
private int[] xCoordinates = new int[4];
private int[] yCoordinates = new int[4];
@Override
public void onAttach(Context context) {
super.onAttach(context);
mContext = context;
mFragmentActivity = getActivity();
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.capture_fragment, container, false);
byte[] imageBytes = ((MainActivity) getActivity()).getImageBytes();
if (imageBytes != null) {
logger.info("Decoding image bytes array into bitmap");
ImageView image = view.findViewById(R.id.camera_capture);
// I added 2 lines to manifest to avoid this error but still consider some scaling later
// BitmapFactory.Options options = new BitmapFactory.Options();
// options.inSampleSize = 2;
Bitmap decodedBitmap = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);
Bitmap rotatedBitmap = rotate(decodedBitmap);
image.setImageBitmap(rotatedBitmap);
} else {
logger.info("Image bytes array is null");
}
angleSide = ((MainActivity) mFragmentActivity).getDpMeasure(mContext, angleSideInDp);
prepareAngles(view);
Button tryAgainButton = view.findViewById(R.id.try_again_capture_button);
tryAgainButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((MainActivity) mFragmentActivity).changeFragments(new CameraFragment(), getString(R.string.code_scanner));
}
});
Button anglesReadyButton = view.findViewById(R.id.angles_ready_button);
anglesReadyButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//here are the coordinates of the four angles to use for decoding later (for now they are just logged out)
logger.info("xCoordinates[0] : " + xCoordinates[0]);
logger.info("yCoordinates[0] : " + yCoordinates[0]);
logger.info("xCoordinates[1] : " + xCoordinates[1]);
logger.info("yCoordinates[1] : " + yCoordinates[1]);
logger.info("xCoordinates[2] : " + xCoordinates[2]);
logger.info("yCoordinates[2] : " + yCoordinates[2]);
logger.info("xCoordinates[3] : " + xCoordinates[3]);
logger.info("yCoordinates[3] : " + yCoordinates[3]);
decode();
}
});
return view;
}
private void decode() {
//decoding is happening here
historyDB = new DatabaseHelper(mContext);
String tmpResult = "http://www.pja.edu.pl/en/news/student-pjatk-zwyciezca-w-hackathonie-hackyeah";
boolean inserted = historyDB.insertRecord(tmpResult);
if (inserted) {
logger.info("Decoded result is successfully inserted to the database");
} else {
logger.warning("Insertion to the database failed!");
}
((MainActivity) mFragmentActivity).changeToResultFragments(tmpResult);
}
private Bitmap rotate(Bitmap decodedBitmap) {
logger.info("Rotating image bitmap");
int width = decodedBitmap.getWidth();
int height = decodedBitmap.getHeight();
Matrix matrix = new Matrix();
matrix.setRotate(90);
return Bitmap.createBitmap(decodedBitmap, 0, 0, width, height, matrix, true);
}
private void prepareAngles(final View view) {
rootLayout = view.findViewById(R.id.angles_layout);
angle1 = rootLayout.findViewById(R.id.angle1);
angle2 = rootLayout.findViewById(R.id.angle2);
angle3 = rootLayout.findViewById(R.id.angle3);
angle4 = rootLayout.findViewById(R.id.angle4);
angle1.setOnTouchListener(new ChoiceTouchListener(0));
angle2.setOnTouchListener(new ChoiceTouchListener(1));
angle3.setOnTouchListener(new ChoiceTouchListener(2));
angle4.setOnTouchListener(new ChoiceTouchListener(3));
ViewTreeObserver vto = rootLayout.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (!gotLayoutMeasures) {
layoutWidth = rootLayout.getWidth();
layoutHeight = rootLayout.getHeight();
minLeft = 0 - angleSide / 2;
minTop = 0 - angleSide / 2;
maxLeft = layoutWidth - angleSide / 2;
maxTop = layoutHeight - angleSide / 2;
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) angle1.getLayoutParams();
layoutParams.setMargins(layoutWidth / 4 - angleSide / 2, layoutHeight / 4 - angleSide / 2, 0, 0);
angle1.setLayoutParams(layoutParams);
layoutParams = (RelativeLayout.LayoutParams) angle2.getLayoutParams();
layoutParams.setMargins(layoutWidth / 4 * 3 - angleSide / 2, layoutHeight / 4 - angleSide / 2, 0, 0);
angle2.setLayoutParams(layoutParams);
layoutParams = (RelativeLayout.LayoutParams) angle4.getLayoutParams();
layoutParams.setMargins(layoutWidth / 4 - angleSide / 2, layoutHeight / 4 * 3 - angleSide / 2, 0, 0);
angle4.setLayoutParams(layoutParams);
layoutParams = (RelativeLayout.LayoutParams) angle3.getLayoutParams();
layoutParams.setMargins(layoutWidth / 4 * 3 - angleSide / 2, layoutHeight / 4 * 3 - angleSide / 2, 0, 0);
angle3.setLayoutParams(layoutParams);
//setting initial position of lines (left margins basically)
xCoordinates[0] = layoutWidth / 4;
yCoordinates[0] = layoutHeight / 4;
xCoordinates[1] = layoutWidth / 4 * 3;
yCoordinates[1] = layoutHeight / 4;
xCoordinates[2] = layoutWidth / 4 * 3;
yCoordinates[2] = layoutHeight / 4 * 3;
xCoordinates[3] = layoutWidth / 4;
yCoordinates[3] = layoutHeight / 4 * 3;
lines[0] = view.findViewById(R.id.line1);
lines[1] = view.findViewById(R.id.line2);
lines[2] = view.findViewById(R.id.line3);
lines[3] = view.findViewById(R.id.line4);
for (int i = 0; i < lines.length; i++) {
int pointId1 = i;
int pointId2 = i + 1 > lines.length - 1 ? 0 : i + 1;
PointF pointA = new PointF(xCoordinates[pointId1], yCoordinates[pointId1]);
PointF pointB = new PointF(xCoordinates[pointId2], yCoordinates[pointId2]);
lines[i].setPointA(pointA);
lines[i].setPointB(pointB);
lines[i].draw();
}
gotLayoutMeasures = true;
}
}
});
}
private final class ChoiceTouchListener implements View.OnTouchListener {
private int angleId;
public ChoiceTouchListener(int angleId) {
this.angleId = angleId;
}
public boolean onTouch(View view, MotionEvent event) {
final int X = (int) event.getRawX();
final int Y = (int) event.getRawY();
logger.info("0) angleId: " + angleId);
logger.info("X: " + X);
logger.info("Y: " + Y);
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
RelativeLayout.LayoutParams lParams = (RelativeLayout.LayoutParams) view.getLayoutParams();
xDelta[angleId] = X - lParams.leftMargin;
yDelta[angleId] = Y - lParams.topMargin;
xCoordinates[angleId] = lParams.leftMargin;
yCoordinates[angleId] = lParams.topMargin;
break;
case MotionEvent.ACTION_UP:
break;
case MotionEvent.ACTION_POINTER_DOWN:
break;
case MotionEvent.ACTION_POINTER_UP:
break;
case MotionEvent.ACTION_MOVE:
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) view
.getLayoutParams();
layoutParams.setMargins(X - xDelta[angleId], Y - yDelta[angleId], -250, -250);
if (layoutParams.leftMargin < minLeft) {
layoutParams.leftMargin = minLeft;
}
if (layoutParams.leftMargin > maxLeft) {
layoutParams.leftMargin = maxLeft;
}
if (layoutParams.topMargin < minTop) {
layoutParams.topMargin = minTop;
}
if (layoutParams.topMargin > maxTop) {
layoutParams.topMargin = maxTop;
}
int lineId1 = angleId;
int lineId2 = angleId - 1 < 0 ? 3 : angleId - 1;
//redrawing line
xCoordinates[angleId] = layoutParams.leftMargin + angleSide / 2;
yCoordinates[angleId] = layoutParams.topMargin + angleSide / 2;
PointF currentAnglePoint = new PointF(layoutParams.leftMargin + angleSide / 2, layoutParams.topMargin + angleSide / 2);
lines[lineId1].setPointA(currentAnglePoint);
lines[lineId2].setPointB(currentAnglePoint);
lines[lineId1].draw();
lines[lineId2].draw();
view.setLayoutParams(layoutParams);
break;
}
rootLayout.invalidate();
return true;
}
}
}
|
[
"lenalastivka@gmail.com"
] |
lenalastivka@gmail.com
|
c310d2486bcf0ad2e0c94d1f25d2ae0e2e96c6c5
|
206c14200ab018259425ccc43293ad74eb4b4ad5
|
/src/by/it/titkovskaya/jd02_03/IUseBasket.java
|
f8e8b6676c80702fc910bd384877d57a22f3e151
|
[] |
no_license
|
skosirskiy/JD2018-12-10
|
f8100069e443bf6b2b908cbe4e4ee830a0d9306a
|
5401cf0c65a3ec749fe64d351864d7bbf659dd74
|
refs/heads/master
| 2020-04-22T16:35:52.402236
| 2019-03-11T09:58:20
| 2019-03-11T09:58:20
| 162,407,220
| 0
| 0
| null | 2018-12-19T08:34:04
| 2018-12-19T08:34:04
| null |
UTF-8
|
Java
| false
| false
| 213
|
java
|
package by.it.titkovskaya.jd02_03;
public interface IUseBasket {
void takeBasket(); //взял корзину
void putGoodsToBasket(); //положил выбранный товар в корзину
}
|
[
"i.titkovskaya@gmail.com"
] |
i.titkovskaya@gmail.com
|
d3de92ea9168e7e7945c21e239aee9df7d742a14
|
3d9abe7bbaa19ecc7b0e5760e4eb99c14f888573
|
/src/main/java/condo/models/AdminAccount.java
|
3800724bd45d0971e5b714144323c8e3dd7bd20a
|
[] |
no_license
|
Pachara2001/condo-parcel-management-application
|
ba72feb28aad9d560b297a6fd12adcb09806c611
|
e71812982902481ee521560927fa3818661c19a1
|
refs/heads/master
| 2023-04-04T13:20:44.345039
| 2021-04-07T10:18:58
| 2021-04-07T10:18:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 924
|
java
|
package condo.models;
import java.util.ArrayList;
public class AdminAccount extends Account {
public AdminAccount(String username,String password){
super(username,password);
}
public void addStaff(String username, String password, String name, String picturePath, ArrayList<StaffAccount> staff) {
for(StaffAccount s : staff){
if(username.equalsIgnoreCase(s.getUsername())) throw new IllegalArgumentException("This username already exists.");
}
StaffAccount newStaff = new StaffAccount(username,password,name,"Allowed","01/01/0001 00:00:01","0",picturePath);
staff.add(newStaff);
}
public void editStaffPermission(StaffAccount staff){
if(staff.getPermission().equalsIgnoreCase("Not allowed")){
staff.setPermission("Allowed");
staff.setAttempt(0);}
else staff.setPermission("Not allowed");
}
}
|
[
"Pachara.sr@ku.th"
] |
Pachara.sr@ku.th
|
87bbd1acec470dc5f8011681bf2b482d181163d3
|
bc5d295240da97bd1f29be0aeaf6bd8bae7f7344
|
/restservice/src/test/java/com/itguai/restservice/ExampleUnitTest.java
|
aedd8b6d491fe9468a5ee8fed7a9210fd4d56bfb
|
[] |
no_license
|
resir/AndroidBlank
|
54d919f438b852b9af8127aa652d6305749f65d4
|
41fd9ca1114c6df0342c2a78fe9dd523d651b7df
|
refs/heads/master
| 2021-01-22T17:34:03.457503
| 2016-07-29T08:12:47
| 2016-07-29T08:12:47
| 64,463,271
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 315
|
java
|
package com.itguai.restservice;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"程建云"
] |
程建云
|
729a7c73e4fdc7a6aab81e2677566d527c30e6eb
|
2ad894a00050c6de0e1bde54455a99e4df8bf996
|
/ATHIFA AYESHA_844784/afternoon_handson/microservices/handson/app2/src/main/java/com/example/app2/App2Controller.java
|
7e0ac4603694b98306c14ce04a32f746c3584a26
|
[] |
no_license
|
athifaayesha-25/cts-handson-nov20
|
93b0a6b2e09b4a42a8d577e6916762cdf79389aa
|
824372d34ea9751ac0d6b1417e3679b8b6b76665
|
refs/heads/master
| 2023-01-27T23:25:01.767255
| 2020-12-09T10:54:10
| 2020-12-09T10:54:10
| 315,531,189
| 0
| 0
| null | 2020-11-24T05:46:41
| 2020-11-24T05:46:36
| null |
UTF-8
|
Java
| false
| false
| 885
|
java
|
package com.example.app2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
@RestController
@RequestMapping("m2")
public class App2Controller {
// to call another service
@Autowired
private RestTemplate restTemplate;
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
@GetMapping
public String greetings() {
LOG.info("::::: greetings in m2 ::::::::");
String response = null;
response = restTemplate.getForObject("http://localhost:8083/m3", String.class);
LOG.info(":::::::Response is: "+response+":::::::::::");
return response;
}
}
|
[
"athifaayesha2@gmail.com"
] |
athifaayesha2@gmail.com
|
ee332713e39b56538a8ad456b234320dd1c8dece
|
018b1af0d08050959b6c37c2566ff0305d2ef7f9
|
/app/src/androidTest/java/com/example/sammengistu/readtome/TestDaveDawson.java
|
d7a4de818c7a0c594471c0b21bed55d6fb27e9d9
|
[] |
no_license
|
sam321pbs/ReadToMe
|
b3f0b72626009a31858fcb3f12c7cc0f879dacf1
|
6fbc7f78111d7f07328bec812d94d85d5cc47525
|
refs/heads/master
| 2021-01-17T08:29:46.681712
| 2017-05-31T23:03:32
| 2017-05-31T23:03:32
| 39,485,281
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,080
|
java
|
package com.example.sammengistu.readtome;
import com.example.sammengistu.readtome.activities.MyLibraryActivity;
import com.example.sammengistu.readtome.bookpages.EPubFileConverterToBook;
import com.example.sammengistu.readtome.models.Book;
import com.example.sammengistu.readtome.models.Library;
import com.example.sammengistu.readtome.models.PageOfBook;
import com.robotium.solo.Solo;
import android.content.Context;
import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
import java.util.ArrayList;
import java.util.List;
public class TestDaveDawson extends
ActivityInstrumentationTestCase2<MyLibraryActivity> {
private Solo mSolo;
MyLibraryActivity mMyLibraryActivity;
EPubFileConverterToBook mEPubBookDaveDawson;
List<PageOfBook> mPageOfBooksDaveDawson;
List<String> mChapterNamesDaveDawson;
private Context mContext;
private String mBookText = "Believing that he had said more than enough, and that to so much as open his mouth would invite sudden disaster, Dawson ignored the worried, questioning eyes fixed upon him, and let his own gaze wander about the room. The first thing he noted was that there were windows on two sides." +
" Windows that had steel shutters for blackout curtains. They were so fitted into the sash frame that when drawn they kept out both light and air. And bullets too, no doubt. But apart from the windows the room wasn't any different from scores of London apartment living rooms that he had seen. " +
"But no! There was one big, big difference. Hanging on the wall to his right was a framed photograph of the lowest form of life ever to be born. A framed photograph of Adolf (Slaughter the women and children, too) Hitler. Just to see the photograph made Dave Dawson sick to his stomach, and he quickly took his eyes from it. " +
"And then the side door opened and the thick-set man came into the room. " +
"\"In a few minutes, dog traitors!\" he rasped at the two prisoners. \"In a few minutes Herr Baron will be here.\"" +
"\"And after that where will you be, I wonder!\" Dawson couldn't keep himself from saying. " +
"The thick-set man blinked, frowned, and turned to his partner. Hans frowned, too, and his voice sounded definitely worried as he spoke." +
"\"The swine is trying to make us believe it is all a mistake, Erich,\" he said. \"But there is no mistake, no?\"" +
"The man called Erich switched his beady eyes back to Dawson's face again. It seemed as though he had a moment of doubt; then it was gone as his lips slid back in a cruel smile. “No, there is no mistake!\" he said harshly. \"Too long " +
"were we together in Herr Himmler's training school not to recognize you at once, even though you have changed a lot. No, Hans. Do not let what the dog says worry you. Come, Hans. Let us enjoy some schnapps before Herr Baron arrives. Keep your eye on them. I will get the bottle and the glasses.\"";
public TestDaveDawson() {
super(MyLibraryActivity.class);
}
@Override
public void setUp() throws Exception {
mMyLibraryActivity = getActivity();
mContext = getInstrumentation().getTargetContext();
mSolo = new Solo(getInstrumentation(), getActivity());
Library library = new Library(getActivity());
List<Book> allBooks = library.getMyLibrary();
for (Book book : allBooks){
Log.i("Test", "File name = " + book.getEPubFile().getName());
if (book.getEPubFile().getName().equals("dave_dawson_with_the_eighth.epub")){
mEPubBookDaveDawson = new EPubFileConverterToBook(mContext,
book.getEPubFile());
}
}
super.setUp();
}
@Override
public void tearDown() throws Exception {
mSolo.finishOpenedActivities();
}
public void testGetChapterNamesForDaveDawson() throws Exception {
mChapterNamesDaveDawson = new ArrayList<>();
mPageOfBooksDaveDawson = mEPubBookDaveDawson.getPagesOfTheBook();
for (PageOfBook pageOfBook : mPageOfBooksDaveDawson){
if (!pageOfBook.getChapterOfBook().equals(PageOfBook.PAGE_HAS_NO_CHAPTER)){
mChapterNamesDaveDawson.add(pageOfBook.getChapterOfBook());
}
}
assertEquals(mChapterNamesDaveDawson.get(0), "DAVE DAWSON WITH THE EIGHTH AIR FORCE");
assertEquals(mChapterNamesDaveDawson.get(1), "DAVE DAWSON WITH THE EIGHTH AIR FORCE");
assertEquals(mChapterNamesDaveDawson.get(2), "CHAPTER ONE Junk Wings");
assertEquals(mChapterNamesDaveDawson.get(3), "CHAPTER TWO Blitz Scars");
assertEquals(mChapterNamesDaveDawson.get(4), "CHAPTER THREE The Dead Can't Breathe");
assertEquals(mChapterNamesDaveDawson.get(5), "CHAPTER FOUR Herr Baron No Face");
assertEquals(mChapterNamesDaveDawson.get(6), "CHAPTER FIVE Satan's Pawns");
}
public void testTwoPages() throws Exception {
mPageOfBooksDaveDawson = mEPubBookDaveDawson.getPagesOfTheBook();
StringBuilder pageTextsb = new StringBuilder();
int countPages = 0;
boolean temp = false;
for (PageOfBook pageOfBook : mPageOfBooksDaveDawson){
if (pageOfBook.getChapterOfBook()
.equals("CHAPTER FOUR Herr Baron No Face") || temp){
temp = true;
pageTextsb.append(pageOfBook.getPageText());
countPages++;
if (countPages == 2){
break;
}
}
}
StringBuilder twohundredWords = new StringBuilder();
StringBuilder actualsb = new StringBuilder();
String pageTextArrays [] = pageTextsb.toString().split(" ");
String [] actualArray = mBookText.split(" ");
for (int i = 0; i < 199; i++){
twohundredWords.append(pageTextArrays[i] + " ");
actualsb.append(actualArray[i] + " ");
}
assertEquals(actualsb.toString(), twohundredWords.toString());
}
}
|
[
"sam321pbs@gmail.com"
] |
sam321pbs@gmail.com
|
6ae888b26c42b7fc58705d685df0e61328432c5a
|
dfdcabb891e69aaefe6aeab2304b9f4741b4a5af
|
/reactive-jhipster/gateway/src/main/java/com/okta/developer/gateway/aop/logging/LoggingAspect.java
|
5dc04e92da8441a2ce3aebbf04a3832cc0d0a31b
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
StefanScherer/java-microservices-examples
|
23a0b9aaca5ece13ca46f24bcdbb0341bf715c79
|
64df95742c71d55f297b32faa3c3789edb3aba35
|
refs/heads/main
| 2023-04-20T01:33:13.537920
| 2021-04-29T15:15:41
| 2021-04-29T15:15:41
| 365,267,825
| 1
| 1
|
Apache-2.0
| 2021-05-07T14:56:06
| 2021-05-07T14:56:05
| null |
UTF-8
|
Java
| false
| false
| 4,208
|
java
|
package com.okta.developer.gateway.aop.logging;
import java.util.Arrays;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles;
import tech.jhipster.config.JHipsterConstants;
/**
* Aspect for logging execution of service and repository Spring components.
*
* By default, it only runs with the "dev" profile.
*/
@Aspect
public class LoggingAspect {
private final Environment env;
public LoggingAspect(Environment env) {
this.env = env;
}
/**
* Pointcut that matches all repositories, services and Web REST endpoints.
*/
@Pointcut(
"within(@org.springframework.stereotype.Repository *)" +
" || within(@org.springframework.stereotype.Service *)" +
" || within(@org.springframework.web.bind.annotation.RestController *)"
)
public void springBeanPointcut() {
// Method is empty as this is just a Pointcut, the implementations are in the advices.
}
/**
* Pointcut that matches all Spring beans in the application's main packages.
*/
@Pointcut(
"within(com.okta.developer.gateway.repository..*)" +
" || within(com.okta.developer.gateway.service..*)" +
" || within(com.okta.developer.gateway.web.rest..*)"
)
public void applicationPackagePointcut() {
// Method is empty as this is just a Pointcut, the implementations are in the advices.
}
/**
* Retrieves the {@link Logger} associated to the given {@link JoinPoint}.
*
* @param joinPoint join point we want the logger for.
* @return {@link Logger} associated to the given {@link JoinPoint}.
*/
private Logger logger(JoinPoint joinPoint) {
return LoggerFactory.getLogger(joinPoint.getSignature().getDeclaringTypeName());
}
/**
* Advice that logs methods throwing exceptions.
*
* @param joinPoint join point for advice.
* @param e exception.
*/
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
logger(joinPoint)
.error(
"Exception in {}() with cause = \'{}\' and exception = \'{}\'",
joinPoint.getSignature().getName(),
e.getCause() != null ? e.getCause() : "NULL",
e.getMessage(),
e
);
} else {
logger(joinPoint)
.error(
"Exception in {}() with cause = {}",
joinPoint.getSignature().getName(),
e.getCause() != null ? e.getCause() : "NULL"
);
}
}
/**
* Advice that logs when a method is entered and exited.
*
* @param joinPoint join point for advice.
* @return result.
* @throws Throwable throws {@link IllegalArgumentException}.
*/
@Around("applicationPackagePointcut() && springBeanPointcut()")
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
Logger log = logger(joinPoint);
if (log.isDebugEnabled()) {
log.debug("Enter: {}() with argument[s] = {}", joinPoint.getSignature().getName(), Arrays.toString(joinPoint.getArgs()));
}
try {
Object result = joinPoint.proceed();
if (log.isDebugEnabled()) {
log.debug("Exit: {}() with result = {}", joinPoint.getSignature().getName(), result);
}
return result;
} catch (IllegalArgumentException e) {
log.error("Illegal argument: {} in {}()", Arrays.toString(joinPoint.getArgs()), joinPoint.getSignature().getName());
throw e;
}
}
}
|
[
"matt.raible@okta.com"
] |
matt.raible@okta.com
|
666000b66d23c620d8cba5bec018575f352f179b
|
dced6934051557291c50f3811ecea336d0db6cee
|
/app/src/main/java/sherly/jwork_android/BonusRequest.java
|
cbf57f43d2004c209c2c797b27b9fb3543850c0f
|
[] |
no_license
|
SherlySyahrial/jwork-android
|
043270d53ced60e564230eaea6a9c922964ce137
|
69035cbeef0f2895e7e31670f28d5cc5bfedda30
|
refs/heads/main
| 2023-06-11T06:28:14.698325
| 2021-07-01T02:22:24
| 2021-07-01T02:22:24
| 371,355,240
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,189
|
java
|
package sherly.jwork_android;
import com.android.volley.AuthFailureError;
import com.android.volley.Response;
import com.android.volley.toolbox.StringRequest;
import java.util.HashMap;
import java.util.Map;
/**
* Class BonusRequest, berfungsi untuk melakukan request bonus dalam bentuk url
* @author Sherly
* @version 28-06-2021
*/
public class BonusRequest extends StringRequest {
private Map<String,String> params;
private static final String URL = "http://10.0.2.2:8080/bonus/";
/**
* Bonus Request untuk mendapatkan promo sesuai kode yang dimasukkan
* @param referralCode yang mau didapatkan
* @param listener response yang dilakukan dari objek pada view
*/
public BonusRequest(String referralCode, Response.Listener<String> listener) {
super(Method.GET, URL + referralCode, listener, null);
params = new HashMap<>();
}
/**
* Mengembalikan parameter map dari POST yang dipakai sebagai request
* @return Parameter request
* @throws AuthFailureError jika ada kesalahan autentikasi
*/
@Override
public Map<String, String> getParams() throws AuthFailureError {
return params;
}
}
|
[
"sherly82@ui.ac.id"
] |
sherly82@ui.ac.id
|
e6439e270c234d23a7afe03b7d7bb9f280cde694
|
b838441c75c347a51d451318f3fbd18a37b84c3b
|
/src/es/upm/dit/apsv/webLab/servlet/LoginServlet.java
|
ca4836ffcc7656cfecdc0ac7d7f61d11ad14c430
|
[] |
no_license
|
argueztest/APSV
|
54ef545bd03bee27e3b74d7cb3a273b734e6ef40
|
5c9579a7e21bd960eb0bbd0c20aed8ca21d2dc74
|
refs/heads/master
| 2021-08-30T12:20:30.903571
| 2017-12-17T23:01:11
| 2017-12-17T23:01:11
| 112,257,004
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,183
|
java
|
package es.upm.dit.apsv.webLab.servlet;
import java.io.IOException;
import java.util.Collection;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import es.upm.dit.apsv.webLab.dao.ResearcherDAO;
import es.upm.dit.apsv.webLab.dao.ResearcherDAOImpl;
import es.upm.dit.apsv.webLab.model.Researcher;
@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet{
/**
* Constant parameters
*/
private static final long serialVersionUID = 1L;
private static final String admin = "admin";
private static final String adminPassword = "admin";
/**
* Default constructor.
*/
public LoginServlet() {
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException {
String email = req.getParameter("email");
String pwd = req.getParameter("pwd");
System.out.println("Researcher requested email:" + email + " pass:" + pwd);
ResearcherDAOImpl dao = ResearcherDAOImpl.getInstance();
Researcher r = dao.searchUser(email, pwd);
System.out.println("Researcher found email:" + r.getEmail() + " pass:" + r.getPassword());
if (admin.equals(email) && adminPassword.equals(pwd)) {
System.out.println("RootView");
// dummy Researcher for the root user
req.getSession().setAttribute("user", new Researcher("0", admin, admin, "", ""));
resp.sendRedirect("/APSV/RootView.jsp");
} else if (r != null && email.equals(r.getEmail()) && pwd.equals(r.getPassword())){
System.out.println("ViewProfile");
req.getSession().setAttribute("user", r);
req.getSession().setAttribute("researcher", r);
resp.sendRedirect("/APSV/ViewProfile.jsp");
} else{
System.out.println("Index");
resp.sendRedirect(req.getContextPath() + "/index.html");
}
}
}
|
[
"age.apps.dev@gmail.com"
] |
age.apps.dev@gmail.com
|
335d95a5a27cb39044345cb76fb7b086fb86d238
|
4ae3d2b2fb7965b1bffe17295fcd1ac04176c919
|
/me/TechsCode/UltraPermissions/dependencies/commons/io/filefilter/DirectoryFileFilter.java
|
716cff7980ec098b8687a3829fa798d68d512cea
|
[] |
no_license
|
artificialai223/EnderPermissions
|
9c69379f04a808b96a9aeebf85a70bdbaf656359
|
ba8470be0bf0eec9fbdbc44b967b0cf6aec9a83d
|
refs/heads/master
| 2022-12-18T14:55:47.730827
| 2020-09-26T18:21:25
| 2020-09-26T18:21:25
| 298,872,816
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 658
|
java
|
package me.TechsCode.EnderPermissions.dependencies.commons.io.filefilter;
import java.io.File;
import java.io.Serializable;
public class DirectoryFileFilter extends AbstractFileFilter implements Serializable
{
private static final long serialVersionUID = -5148237843784525732L;
public static final IOFileFilter DIRECTORY;
public static final IOFileFilter INSTANCE;
protected DirectoryFileFilter() {
}
@Override
public boolean accept(final File file) {
return file.isDirectory();
}
static {
DIRECTORY = new DirectoryFileFilter();
INSTANCE = DirectoryFileFilter.DIRECTORY;
}
}
|
[
"airstrikeminecraft@gmail.com"
] |
airstrikeminecraft@gmail.com
|
7173b68b90dcd29df56e9a1a58fc84cf6e05f398
|
f35c4b721584e2934bee5f718b6a551013d13677
|
/springsecurityejemplo/src/main/java/com/ipartek/formacion/spring/springsecurityejemplo/configuraciones/WebSecurityConfig.java
|
26773470972a344720143eb2138920e09bdf8e03
|
[] |
no_license
|
georgegutir/CursoJava
|
eddec72b185a01a3c045376d15e8f3d02c4d9ddd
|
ddecf9b50352a59499a4b8d555157ab97f76e56f
|
refs/heads/master
| 2023-04-24T07:43:52.727566
| 2021-05-10T10:33:56
| 2021-05-10T10:33:56
| 317,520,256
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,378
|
java
|
package com.ipartek.formacion.spring.springsecurityejemplo.configuraciones;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.core.userdetails.User;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/", "/home").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.permitAll()
.and()
.logout()
.permitAll();
}
/**
* Cambiamos la siguiente función para realizar la misma acción de seguridad pero ya con bbdd MySQL
* (usando DataSourse y JDBC)
*/
// @Bean
// @Override
// protected UserDetailsService userDetailsService() {
// UserDetails user =
// User.withDefaultPasswordEncoder()
// .username("user")
// .password("password")
// .roles("USER")
// .build();
//
// return new InMemoryUserDetailsManager(user);
// }
// https://www.baeldung.com/spring-security-jdbc-authentication
@Autowired
private DataSource dataSource;
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth)
throws Exception {
auth.jdbcAuthentication().dataSource(dataSource).passwordEncoder(new BCryptPasswordEncoder())
.usersByUsernameQuery("select email,password,1 "
+ "from usuarios "
+ "where email = ?")
.authoritiesByUsernameQuery("select email,rol "
+ "from usuarios "
+ "where email = ?");
}
// https://www.browserling.com/tools/bcrypt
// CREATE TABLE users (
// username VARCHAR(50) NOT NULL,
// password VARCHAR(100) NOT NULL,
// enabled TINYINT NOT NULL DEFAULT 1,
// PRIMARY KEY (username)
// );
//
// CREATE TABLE authorities (
// username VARCHAR(50) NOT NULL,
// authority VARCHAR(50) NOT NULL,
// FOREIGN KEY (username) REFERENCES users(username)
// );
//
// CREATE UNIQUE INDEX ix_auth_username
// on authorities (username,authority);
// -- User user/pass
// INSERT INTO users (username, password, enabled)
// values ('user',
// '$2a$10$8.UnVuG9HHgffUDAlk8qfOuVGkqRzgVymGe07xd00DMxs.AQubh4a',
// 1);
//
// INSERT INTO authorities (username, authority)
// values ('user', 'ROLE_USER');
}
|
[
"JORGE@LAPTOP-5V5S80CS"
] |
JORGE@LAPTOP-5V5S80CS
|
c599e6049d6f0feb5f95019ad179241cddfd4a04
|
295431c6610e208c38131801d75873eda8fa50e2
|
/src/main/java/TestExtends/Dog2.java
|
74935dc623fc17c43958b8eb0f22e83f28d7402b
|
[] |
no_license
|
st-feng/DataStructure
|
b29dac90fbf11af8e0a1ecc47522f65e7b001636
|
482f9712113780e574e0352f4fce0465635b4130
|
refs/heads/master
| 2022-12-29T09:16:36.982632
| 2020-03-10T11:23:15
| 2020-03-10T11:23:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 549
|
java
|
package TestExtends;
public class Dog2 extends Animal implements Hobby{
String nickname;
Dog2(String str,int age,String nickname){
super(str,age);
this.nickname = nickname;
}
public String[] getHobby() {
System.out.println("Dogs' hobbies are: ");
String [] str = {"bone","meat","rice","bread"};
for(int i=0; i<str.length ; i++) {
System.out.println(str[i]);
}
return str;
}
public String run() {
return nickname + " run by four feet";
}
}
|
[
"xcf0810@126.com"
] |
xcf0810@126.com
|
8f7aa36e6fe2f4a504d4d6110c35104a08d29d9d
|
716f0e212831fca22c199d41542914fd5cd2b27b
|
/app/src/main/java/com/ada/twitter/adapters/TimelineFragmentAdapter.java
|
09fa889d8d04b7b43981bbd255f064020d8e2c86
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
adajazbor/Twitter
|
3de3454e46941858f1ff1605c64612b588d30f65
|
62ae725e6a9b5cf3fdd2b8a70ccfdd5000d5c9c0
|
refs/heads/master
| 2021-01-11T10:21:04.480615
| 2016-11-07T13:51:09
| 2016-11-07T13:51:09
| 72,327,145
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,000
|
java
|
package com.ada.twitter.adapters;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import com.ada.twitter.fragments.HomeTweetListFragment;
import com.ada.twitter.fragments.MentionsTweetListFragment;
/**
* Created by ada on 11/5/16.
*/
public class TimelineFragmentAdapter extends FragmentStatePagerAdapter {
final int PAGE_COUNT = 2;
private String tabTitles[] = new String[] { "HOME", "MENTIONS"};
public TimelineFragmentAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
if (position == 0) {
return new HomeTweetListFragment();
} else {
return new MentionsTweetListFragment();
}
}
@Override
public int getCount() {
return PAGE_COUNT;
}
@Override
public CharSequence getPageTitle(int position) {
return tabTitles[position];
}
}
|
[
"jazboria@gene.com"
] |
jazboria@gene.com
|
ae5163aeb0d8b0159e9e1e73fbd1dadebf8ce482
|
5854f1fee1b2396b33e6cc830e79fca9103ca42d
|
/app/src/main/java/com/example/dictionary/Word.java
|
3d72697b662a05ea69d59c64d241654939124abd
|
[] |
no_license
|
ChernikovVictor/Dictionary
|
af2926d2b51347dbebf55c793dc6ac4951a9bdce
|
ef719889b140a461087b404bed6c074c32288e73
|
refs/heads/master
| 2020-08-15T17:03:07.563869
| 2020-03-13T19:38:24
| 2020-03-13T19:38:24
| 215,376,580
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 532
|
java
|
package com.example.dictionary;
import java.io.Serializable;
public class Word implements Serializable
{
private String name;
private String translation;
public Word(){ this("", ""); }
public Word(String name, String translation)
{
this.name = name;
this.translation = translation;
}
public String getName(){ return name; }
public String getTranslation(){ return translation; }
@Override
public String toString()
{
return name + " - " + translation;
}
}
|
[
"victorchernikov252@gmail.com"
] |
victorchernikov252@gmail.com
|
976b1ba130f0e262b8578b3a3520d2ee9e43ae40
|
bdcdcf52c63a1037786ac97fbb4da88a0682e0e8
|
/src/test/java/io/akeyless/client/model/CreateAuthMethodEmailOutputTest.java
|
01b56b685537fea7de6805085c6f773d2d4db8b9
|
[
"Apache-2.0"
] |
permissive
|
akeylesslabs/akeyless-java
|
6e37d9ec59d734f9b14e475ce0fa3e4a48fc99ea
|
cfb00a0e2e90ffc5c375b62297ec64373892097b
|
refs/heads/master
| 2023-08-03T15:06:06.802513
| 2023-07-30T11:59:23
| 2023-07-30T11:59:23
| 341,514,151
| 2
| 4
|
Apache-2.0
| 2023-07-11T08:57:17
| 2021-02-23T10:22:38
|
Java
|
UTF-8
|
Java
| false
| false
| 1,300
|
java
|
/*
* Akeyless API
* The purpose of this application is to provide access to Akeyless API.
*
* The version of the OpenAPI document: 2.0
* Contact: support@akeyless.io
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.akeyless.client.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for CreateAuthMethodEmailOutput
*/
public class CreateAuthMethodEmailOutputTest {
private final CreateAuthMethodEmailOutput model = new CreateAuthMethodEmailOutput();
/**
* Model tests for CreateAuthMethodEmailOutput
*/
@Test
public void testCreateAuthMethodEmailOutput() {
// TODO: test CreateAuthMethodEmailOutput
}
/**
* Test the property 'accessId'
*/
@Test
public void accessIdTest() {
// TODO: test accessId
}
}
|
[
"github@akeyless.io"
] |
github@akeyless.io
|
6176da6dd048b1d7bf5e615571ad6d16ef9d49be
|
94b088a3673cec83ef62e442976a27463d1fb4cc
|
/LinearFunctionCalculator/app/src/main/java/com/jbstudios/linearfunctioncalculator/MainActivity.java
|
72a249e3b0c1872a2b6c39dda0f3d8813e67367b
|
[] |
no_license
|
jzollinger4627/JZJDBC
|
a7aa7064572ee6d1add8c09a5eb7684a30c6651e
|
53acdc400f77e137a154eec197f614016df1d278
|
refs/heads/master
| 2020-05-23T17:57:15.263557
| 2019-05-15T17:52:52
| 2019-05-15T17:52:52
| 186,877,657
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,437
|
java
|
package com.jbstudios.linearfunctioncalculator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import org.w3c.dom.Text;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button calculate = (Button) findViewById(R.id.Calculate);
calculate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
calc();
}
});
}
private void calc() {
double m = (Double.parseDouble(((EditText) findViewById(R.id.Y2)).getText().toString())-Double.parseDouble(((EditText) findViewById(R.id.Y1)).getText().toString()))/
(Double.parseDouble(((EditText) findViewById(R.id.X2)).getText().toString())-Double.parseDouble(((EditText) findViewById(R.id.X1)).getText().toString()));
double b = Double.parseDouble(((EditText) findViewById(R.id.Y1)).getText().toString())-(Math.abs(Double.parseDouble(((EditText) findViewById(R.id.X1)).getText().toString()))*m);
((TextView) findViewById(R.id.MResult)).setText(m + "");
((TextView) findViewById(R.id.BResult)).setText(b + "");
}
}
|
[
"jzoll4627@westada.org"
] |
jzoll4627@westada.org
|
ba5c3638072342958705622cf13f407723aceff0
|
1b08e6ca4e12ecd2d6139f75ecc7850e142531bf
|
/MRBayes/src/bayes/BayesTest1.java
|
c46e1c3ae7edc321e89053a7690d5741e3391c42
|
[] |
no_license
|
hanchensu/adrd
|
3105782d444e16dac83d2033d3210c79da3c7fb0
|
a85fc207bb9404280b625cba7e121c8ab80812c1
|
refs/heads/master
| 2020-05-18T18:05:18.959884
| 2013-11-28T02:26:38
| 2013-11-28T02:26:38
| 11,578,817
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,166
|
java
|
package bayes;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class BayesTest1 implements Tool {
protected Configuration _conf = new Configuration();
@Override
public Configuration getConf() {
return _conf;
}
@Override
public void setConf(Configuration conf) {
_conf = conf;
}
public static class TestMapper extends Mapper<Object, Text, Text, Text> {
static Map<String, Double> mfCnt = null;
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
// final int THRESHOLD = Integer.parseInt(context.getConfiguration().get("feacnt.threshold", "200"));
// final int randomRate = Integer.parseInt(context.getConfiguration().get("randomRate", "10"));
// Random random = new Random();
// int n = random.nextInt(randomRate);
// if( n != 1) {
// return;
// }
if (mfCnt == null) {
mfCnt = new HashMap<String, Double>();
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(context.getConfiguration().get("train.res"))));
String str;
while ((str = br.readLine()) != null) {
String[] splits = str.split("\\p{Blank}+");
mfCnt.put(splits[0], Double.parseDouble(splits[1]));
}
br.close();
}
final int TOP_NUM = Integer.parseInt(context.getConfiguration().get("threshold.top"));
final int BOTTOM_NUM = Integer.parseInt(context.getConfiguration().get("threshold.bottom"));
int NUM_ALL = Integer.parseInt(context.getConfiguration().get("num.divide").split("_")[0]);
int NUM_TEST = Integer.parseInt(context.getConfiguration().get("num.divide").split("_")[1]);
int lineno = Integer.parseInt(value.toString().split("#", 2)[0]);
if (lineno % NUM_ALL != NUM_TEST)
return;
String line = value.toString().split("#", 2)[1];
String[] splits = line.split("\\p{Blank}+");
String gender = splits[0];
List<Double> femaleRates = new ArrayList<Double>();
gender = "0".equals(gender) ? "M" : "F";
for (String seg : splits) {
String[] kv = seg.split(":");
if (kv.length != 2)
continue;
if (mfCnt.containsKey(kv[0])) {
femaleRates.add(mfCnt.get(kv[0]));
}
}
Collections.sort(femaleRates,new Comparator<Double>(){
public int compare(Double b1, Double b2) {
if( b2 > b1) return 1;
if (b2.equals(b1) ) return 0;
return -1;
}
});
double rate = 1.0;
if(femaleRates.size() >= BOTTOM_NUM + TOP_NUM) {
for(int i = 0; i < TOP_NUM; i++) {
rate*=femaleRates.get(i);
}
for(int i = femaleRates.size() - 1; i > femaleRates.size() - 1 - BOTTOM_NUM; i--) {
rate*=femaleRates.get(i);
}
context.write(new Text(rate+" "+gender), new Text());
}
}
}
@Override
public int run(String[] args) throws Exception {
Job job = new Job(_conf, "Bayes Test");
job.setJarByClass(BayesTest1.class);
job.setMapperClass(TestMapper.class);
job.setMapOutputKeyClass(Text.class);
job.setMapOutputValueClass(Text.class);
job.setNumReduceTasks(0);
System.out.println(_conf.get("bayes.testinput"));
System.out.println(_conf.get("bayes.testoutput"));
FileInputFormat.addInputPaths(job, _conf.get("bayes.testinput"));
FileOutputFormat.setOutputPath(job, new Path(_conf.get("bayes.testoutput")));
// System.out.println(job.waitForCompletion(true) ? 0 : 1);
return job.waitForCompletion(true) ? 0 : 1;
}
public static void main(String[] args) throws Exception {
int ret = ToolRunner.run(new BayesTest1(), args);
if (ret != 0) {
System.err.println("Job Failed!");
System.exit(ret);
}
}
}
|
[
"hanchensu@sohu-inc.com"
] |
hanchensu@sohu-inc.com
|
24d8f70e64d3c3e416faafaea6cd2c7a5706e674
|
586967aa7fd2f69697ce0be6a72594bf9100d396
|
/src/keyWords/web/service/IKeyWordsService.java
|
008550b91e01bbbf36ebd0574b6a26674ce477b9
|
[] |
no_license
|
dallar/HDFJ
|
37903739a9925549c7705b76aca0f0355cd1fb49
|
48744bb87520d4a1aa4ad6866dbd15025db1de17
|
refs/heads/master
| 2020-12-25T14:14:12.596570
| 2016-12-05T01:58:36
| 2016-12-05T01:58:36
| 67,000,047
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 166
|
java
|
package keyWords.web.service;
import keyWords.web.dao.IBaseDao;
import keyWords.web.entity.JqSegBt;
public interface IKeyWordsService extends IBaseDao<JqSegBt>{
}
|
[
"段雷"
] |
段雷
|
1185b1f6e1c2dec8859b8d60f5838f246f019440
|
3d18b4b21777178e5912618024b106c33bd17517
|
/mobsters-controllers/src/main/java/com/lvl6/mobsters/controller/SetFacebookIdController.java
|
c936a0a128154224f74b7d5fb415acf379279ef8
|
[] |
no_license
|
levelsix/mobsters-server-cass
|
827819688436ed7752c508472893477795ed6c56
|
f6227a28baf56ddd2bd1d40237dcea648de61b66
|
refs/heads/master
| 2021-05-27T07:49:42.089208
| 2014-03-18T09:25:22
| 2014-03-18T09:25:22
| 14,414,272
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,108
|
java
|
package com.lvl6.mobsters.controller;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.lvl6.mobsters.eventprotos.EventUserProto.SetFacebookIdRequestProto;
import com.lvl6.mobsters.eventprotos.EventUserProto.SetFacebookIdResponseProto;
import com.lvl6.mobsters.eventprotos.EventUserProto.SetFacebookIdResponseProto.Builder;
import com.lvl6.mobsters.eventprotos.EventUserProto.SetFacebookIdResponseProto.SetFacebookIdStatus;
import com.lvl6.mobsters.events.RequestEvent;
import com.lvl6.mobsters.events.request.SetFacebookIdRequestEvent;
import com.lvl6.mobsters.events.response.SetFacebookIdResponseEvent;
import com.lvl6.mobsters.noneventprotos.MobstersEventProtocolProto.MobstersEventProtocolRequest;
import com.lvl6.mobsters.noneventprotos.UserProto.MinimumUserProto;
import com.lvl6.mobsters.po.nonstaticdata.User;
import com.lvl6.mobsters.services.user.UserService;
@Component
public class SetFacebookIdController extends EventController {
private static Logger log = LoggerFactory.getLogger(new Object() { }.getClass().getEnclosingClass());
@Autowired
protected UserService userService;
public SetFacebookIdController() {
numAllocatedThreads = 1;
}
@Override
public RequestEvent createRequestEvent() {
return new SetFacebookIdRequestEvent();
}
@Override
public int getEventType() {
return MobstersEventProtocolRequest.C_SET_FACEBOOK_ID_EVENT_VALUE;
}
@Override
protected void processRequestEvent(RequestEvent event) throws Exception {
//stuff client sent
SetFacebookIdRequestProto reqProto =
((SetFacebookIdRequestEvent) event).getSetFacebookIdRequestProto();
//get the values client sent
MinimumUserProto sender = reqProto.getSender();
String fbId = reqProto.getFbId();
if (fbId != null && fbId.isEmpty()) {
fbId = null;
}
//uuid's are not strings, need to convert from string to uuid, vice versa
String userIdString = sender.getUserUuid();
UUID userId = UUID.fromString(userIdString);
//response to send back to client
Builder responseBuilder = SetFacebookIdResponseProto.newBuilder();
responseBuilder.setStatus(SetFacebookIdStatus.FAIL_OTHER);
SetFacebookIdResponseEvent resEvent =
new SetFacebookIdResponseEvent(userIdString);
resEvent.setTag(event.getTag());
try {
//get whatever we need from the database
User user = getUserService().getUserWithId(userId);
if (fbId != null && user != null) {
responseBuilder.setStatus(SetFacebookIdStatus.SUCCESS);
} else {
responseBuilder.setStatus(SetFacebookIdStatus.FAIL_OTHER);
}
//write to client
resEvent.setSetFacebookIdResponseProto(responseBuilder.build());
log.info("Writing event: " + resEvent);
getEventWriter().handleEvent(resEvent);
boolean isDifferent = checkIfNewTokenDifferent(user.getFacebookId(), fbId);
//update the facebook id
if (isDifferent) {
getUserService().updateFacebookId(user, fbId);
}
} catch (Exception e) {
log.error("exception in SetFacebookIdController processRequestEvent", e);
try {
//try to tell client that something failed
responseBuilder.setStatus(SetFacebookIdStatus.FAIL_OTHER);
resEvent.setSetFacebookIdResponseProto(responseBuilder.build());
getEventWriter().handleEvent(resEvent);
} catch (Exception e2) {
log.error("exception2 in SetFacebookIdController processRequestEvent", e2);
}
}
}
private boolean checkIfNewTokenDifferent(String oldToken, String newToken) {
boolean oldTokenIsNothing = oldToken == null || oldToken.length() == 0;
boolean newTokenIsNothing = newToken == null || newToken.length() == 0;
if (oldTokenIsNothing && newTokenIsNothing) {
return false;
}
if (!oldTokenIsNothing && !newTokenIsNothing) {
return !oldToken.equals(newToken);
}
return true;
}
public UserService getUserService() {
return userService;
}
public void setUserService(UserService userService) {
this.userService = userService;
}
}
|
[
"aweezy90@gmail.com"
] |
aweezy90@gmail.com
|
0b52f9d4ec9177e39fdfedb32eb28bf85f13f084
|
a01d8c5012f9b95b09c7ba396f953b32f75c86b3
|
/android/app/src/main/java/com/simpleretail/MainApplication.java
|
72ad57694d41919268adc25bb30d2a253e46876c
|
[] |
no_license
|
ahmedfouad2016/SimpleRetail
|
bd14516bc05fbafc5927595e02515a023e8a5b29
|
14181e56ee43b1a75a98508ed68483ac6f62d6a4
|
refs/heads/master
| 2022-12-14T16:17:07.286864
| 2019-06-10T06:09:51
| 2019-06-10T06:09:51
| 191,107,257
| 0
| 0
| null | 2022-12-10T18:39:03
| 2019-06-10T06:07:50
|
Objective-C
|
UTF-8
|
Java
| false
| false
| 1,048
|
java
|
package com.simpleretail;
import android.app.Application;
import com.facebook.react.ReactApplication;
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()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
|
[
"ahmed_fouad.mahmoud@yahoo.com"
] |
ahmed_fouad.mahmoud@yahoo.com
|
9497a610a077da172c9110be9f3d64e95bfeb5e8
|
b681e3c342eda5a337edcd7d4127fc8d8e8d4f9e
|
/app/src/main/java/com/example/covid_19tracker/ui/timeline/IndiaTimelineAdapter.java
|
108d32220f028d045786cff7bc15c2b1c6685267
|
[] |
no_license
|
Viren-Patil/COVID-19-Tracker
|
4b397fef29009e619a6ba1c1b9f437dc19f80f7b
|
0f83309c0f644c93485df8974c214ba5dec76213
|
refs/heads/master
| 2022-05-23T07:30:32.360263
| 2020-05-01T13:04:22
| 2020-05-01T13:04:22
| 256,285,580
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,898
|
java
|
package com.example.covid_19tracker.ui.timeline;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.covid_19tracker.R;
import org.w3c.dom.Text;
import java.util.ArrayList;
public class IndiaTimelineAdapter extends RecyclerView.Adapter<IndiaTimelineAdapter.ViewHolder> {
ArrayList<IndiaTimeline> indiaTimelines;
public IndiaTimelineAdapter(ArrayList<IndiaTimeline> indiaTimelines){
this.indiaTimelines = indiaTimelines;
}
@NonNull
@Override
public IndiaTimelineAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_list_timeline, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull IndiaTimelineAdapter.ViewHolder holder, int position) {
IndiaTimeline indiaTimeline = indiaTimelines.get(position);
holder.tvDate.setText(indiaTimeline.getmDate());
holder.tvTotalTimelineConfirm.setText(indiaTimeline.getmTotalTimelineConfirm());
holder.tvTotalTimelineDeaths.setText(indiaTimeline.getmTotalTimelineDeaths());
}
@Override
public int getItemCount() {
return indiaTimelines.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
TextView tvDate, tvTotalTimelineConfirm, tvTotalTimelineDeaths;
public ViewHolder(@NonNull View itemView) {
super(itemView);
tvDate = itemView.findViewById(R.id.tvDate);
tvTotalTimelineConfirm = itemView.findViewById(R.id.tvTotalTimelineConfirm);
tvTotalTimelineDeaths = itemView.findViewById(R.id.tvTotalTimelineDeaths);
}
}
}
|
[
"viren.p2000@gmail.com"
] |
viren.p2000@gmail.com
|
844a34affc6703fc7b54f91b230c5a5e4f635fec
|
eb22758e3c99869235d19c6adb98b3c355ae5cf5
|
/src/lourenco/tech/parsers/XML2Document.java
|
996bb091bae4384e1f0ec015bbe2dc09cf9a6970
|
[] |
no_license
|
glourenco/javaexamples
|
364ccb94827183813968b25dab3e9002895597bf
|
4a5c37345c850a28fd9e673e493605a21b823f7d
|
refs/heads/master
| 2021-01-19T07:56:32.590078
| 2017-08-21T09:23:10
| 2017-08-21T09:23:10
| 100,648,260
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,935
|
java
|
package lourenco.tech.parsers;
import com.mongodb.MongoClient;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import org.bson.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
public class XML2Document {
List<Document> docList = new ArrayList<>();
public static void main(String[] args) {
XML2Document xml2Doc = new XML2Document();
List<Document> xMLDocList = xml2Doc.objectify("C:\\tmp\\example.xml");
MongoClient mongoClient = new MongoClient("localhost");
MongoDatabase database = mongoClient.getDatabase("dbname");
MongoCollection<Document> collection = database.getCollection("xmlcollection");
collection.insertMany(xMLDocList);
for(Document found : collection.find()){
System.out.println(found.toJson());
}
}
private List<Document> objectify(String xmlFile) {
try {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
org.w3c.dom.Document document = docBuilder.parse(new File(xmlFile));
getChildren(document.getDocumentElement(), null);
} catch ( IOException | ParserConfigurationException ex) {
Logger.getLogger(XML2Document.class.getName()).log(Level.SEVERE, null, ex);
} catch (org.xml.sax.SAXException e) {
e.printStackTrace();
}
return docList;
}
public void getChildren(Node node, String parent) {
String newParent = node.getNodeName();
Document nodeDoc = new Document();
nodeDoc.put("parent", parent);
nodeDoc.put("tagname", newParent);
NamedNodeMap nodeAttrs = node.getAttributes();
Document docAttrs = new Document();
for (int j = 0; j < nodeAttrs.getLength(); j++) {
Node attr = nodeAttrs.item(j);
docAttrs.put(attr.getNodeName(), attr.getNodeValue());
}
nodeDoc.put("attributes", docAttrs);
if (node.hasChildNodes()) {
nodeDoc.put("value",node.getFirstChild().getNodeValue());
}
nodeDoc.put("date",new Date());
docList.add(nodeDoc);
NodeList nodeList = node.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node currentNode = nodeList.item(i);
if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
getChildren(currentNode, newParent);
}
}
}
}
|
[
"gon.lourenco@gmail.com"
] |
gon.lourenco@gmail.com
|
7283954cb9a08afbcd79930bffa33e419dcc11ae
|
d71e879b3517cf4fccde29f7bf82cff69856cfcd
|
/ExtractedJars/Health_com.huawei.health/javafiles/android/support/v7/widget/helper/ItemTouchUIUtilImpl$Gingerbread.java
|
1c979f650586cda77519ef25e20e641800e2d56e
|
[
"MIT"
] |
permissive
|
Andreas237/AndroidPolicyAutomation
|
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
|
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
|
refs/heads/master
| 2020-04-10T02:14:08.789751
| 2019-05-16T19:29:11
| 2019-05-16T19:29:11
| 160,739,088
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,191
|
java
|
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package android.support.v7.widget.helper;
import android.graphics.Canvas;
import android.support.v7.widget.RecyclerView;
import android.view.View;
// Referenced classes of package android.support.v7.widget.helper:
// ItemTouchUIUtil, ItemTouchUIUtilImpl
static class ItemTouchUIUtilImpl$Gingerbread
implements ItemTouchUIUtil
{
private void draw(Canvas canvas, RecyclerView recyclerview, View view, float f, float f1)
{
canvas.save();
// 0 0:aload_1
// 1 1:invokevirtual #22 <Method int Canvas.save()>
// 2 4:pop
canvas.translate(f, f1);
// 3 5:aload_1
// 4 6:fload 4
// 5 8:fload 5
// 6 10:invokevirtual #26 <Method void Canvas.translate(float, float)>
recyclerview.drawChild(canvas, view, 0L);
// 7 13:aload_2
// 8 14:aload_1
// 9 15:aload_3
// 10 16:lconst_0
// 11 17:invokevirtual #32 <Method boolean RecyclerView.drawChild(Canvas, View, long)>
// 12 20:pop
canvas.restore();
// 13 21:aload_1
// 14 22:invokevirtual #35 <Method void Canvas.restore()>
// 15 25:return
}
public void clearView(View view)
{
view.setVisibility(0);
// 0 0:aload_1
// 1 1:iconst_0
// 2 2:invokevirtual #43 <Method void View.setVisibility(int)>
// 3 5:return
}
public void onDraw(Canvas canvas, RecyclerView recyclerview, View view, float f, float f1, int i, boolean flag)
{
if(i != 2)
//* 0 0:iload 6
//* 1 2:iconst_2
//* 2 3:icmpeq 17
draw(canvas, recyclerview, view, f, f1);
// 3 6:aload_0
// 4 7:aload_1
// 5 8:aload_2
// 6 9:aload_3
// 7 10:fload 4
// 8 12:fload 5
// 9 14:invokespecial #47 <Method void draw(Canvas, RecyclerView, View, float, float)>
// 10 17:return
}
public void onDrawOver(Canvas canvas, RecyclerView recyclerview, View view, float f, float f1, int i, boolean flag)
{
if(i == 2)
//* 0 0:iload 6
//* 1 2:iconst_2
//* 2 3:icmpne 17
draw(canvas, recyclerview, view, f, f1);
// 3 6:aload_0
// 4 7:aload_1
// 5 8:aload_2
// 6 9:aload_3
// 7 10:fload 4
// 8 12:fload 5
// 9 14:invokespecial #47 <Method void draw(Canvas, RecyclerView, View, float, float)>
// 10 17:return
}
public void onSelected(View view)
{
view.setVisibility(4);
// 0 0:aload_1
// 1 1:iconst_4
// 2 2:invokevirtual #43 <Method void View.setVisibility(int)>
// 3 5:return
}
ItemTouchUIUtilImpl$Gingerbread()
{
// 0 0:aload_0
// 1 1:invokespecial #13 <Method void Object()>
// 2 4:return
}
}
|
[
"silenta237@gmail.com"
] |
silenta237@gmail.com
|
8e6d4b98b5db2c740a0033807e4ffe96203312d4
|
535b4fec57768d1aa78cc2452af6ca4f75cdddd4
|
/src/christmas2014/Question2_2014.java
|
5f198905b74af264e6ef3083eb7ce50517cad9f1
|
[] |
no_license
|
daithi2101/CollegeOOP
|
8e6480c96cd34a376cd4ee53d99f1158ea7e076f
|
91a9bafc76287086f651410ef9e904d9051173fd
|
refs/heads/master
| 2020-06-17T13:23:42.538364
| 2016-12-15T23:42:51
| 2016-12-15T23:42:51
| 75,004,506
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,150
|
java
|
package christmas2014;
import java.util.Scanner;
/*
* Created by David O Connor on 28/11/2016.
*/
public class Question2_2014 {
public static void main(String[] args) {
int number;
Scanner input = new Scanner(System.in);
System.out.print("Please enter a positive whole number: ");
number = input.nextInt();
if(number <= 0) {
System.out.print("\nError: the number is not positive .... exiting program now");
} else {
if(number % 2 == 0)
System.out.print("\nThe number entered is even");
else
System.out.print("\nThe number entered is odd");
if(number % 10 == 0)
System.out.print("\nThe number ends in a zero");
else
System.out.print("\nThe number does not end in a zero");
if(number >= 1 && number <= 255)
System.out.print("\nThe corresponding ASCII code this number is " + (char)number);
else
System.out.print("\nThere is no corresponding ASCII code for this number");
}
input.close();
}
}
|
[
"daithi2101@hotmail.com"
] |
daithi2101@hotmail.com
|
84df6c172f4b84a387b704b71168f39a5a47f74f
|
cbea23d5e087a862edcf2383678d5df7b0caab67
|
/aws-java-sdk-panorama/src/main/java/com/amazonaws/services/panorama/model/CreateNodeFromTemplateJobRequest.java
|
cb382ecfcf2e87d44fbd5edbb172978286f64afc
|
[
"Apache-2.0"
] |
permissive
|
phambryan/aws-sdk-for-java
|
66a614a8bfe4176bf57e2bd69f898eee5222bb59
|
0f75a8096efdb4831da8c6793390759d97a25019
|
refs/heads/master
| 2021-12-14T21:26:52.580137
| 2021-12-03T22:50:27
| 2021-12-03T22:50:27
| 4,263,342
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 15,197
|
java
|
/*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.panorama.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/panorama-2019-07-24/CreateNodeFromTemplateJob" target="_top">AWS
* API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateNodeFromTemplateJobRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The type of node.
* </p>
*/
private String templateType;
/**
* <p>
* An output package name for the node.
* </p>
*/
private String outputPackageName;
/**
* <p>
* An output package version for the node.
* </p>
*/
private String outputPackageVersion;
/**
* <p>
* A name for the node.
* </p>
*/
private String nodeName;
/**
* <p>
* A description for the node.
* </p>
*/
private String nodeDescription;
/**
* <p>
* Template parameters for the node.
* </p>
*/
private java.util.Map<String, String> templateParameters;
/**
* <p>
* Tags for the job.
* </p>
*/
private java.util.List<JobResourceTags> jobTags;
/**
* <p>
* The type of node.
* </p>
*
* @param templateType
* The type of node.
* @see TemplateType
*/
public void setTemplateType(String templateType) {
this.templateType = templateType;
}
/**
* <p>
* The type of node.
* </p>
*
* @return The type of node.
* @see TemplateType
*/
public String getTemplateType() {
return this.templateType;
}
/**
* <p>
* The type of node.
* </p>
*
* @param templateType
* The type of node.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TemplateType
*/
public CreateNodeFromTemplateJobRequest withTemplateType(String templateType) {
setTemplateType(templateType);
return this;
}
/**
* <p>
* The type of node.
* </p>
*
* @param templateType
* The type of node.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TemplateType
*/
public CreateNodeFromTemplateJobRequest withTemplateType(TemplateType templateType) {
this.templateType = templateType.toString();
return this;
}
/**
* <p>
* An output package name for the node.
* </p>
*
* @param outputPackageName
* An output package name for the node.
*/
public void setOutputPackageName(String outputPackageName) {
this.outputPackageName = outputPackageName;
}
/**
* <p>
* An output package name for the node.
* </p>
*
* @return An output package name for the node.
*/
public String getOutputPackageName() {
return this.outputPackageName;
}
/**
* <p>
* An output package name for the node.
* </p>
*
* @param outputPackageName
* An output package name for the node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateNodeFromTemplateJobRequest withOutputPackageName(String outputPackageName) {
setOutputPackageName(outputPackageName);
return this;
}
/**
* <p>
* An output package version for the node.
* </p>
*
* @param outputPackageVersion
* An output package version for the node.
*/
public void setOutputPackageVersion(String outputPackageVersion) {
this.outputPackageVersion = outputPackageVersion;
}
/**
* <p>
* An output package version for the node.
* </p>
*
* @return An output package version for the node.
*/
public String getOutputPackageVersion() {
return this.outputPackageVersion;
}
/**
* <p>
* An output package version for the node.
* </p>
*
* @param outputPackageVersion
* An output package version for the node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateNodeFromTemplateJobRequest withOutputPackageVersion(String outputPackageVersion) {
setOutputPackageVersion(outputPackageVersion);
return this;
}
/**
* <p>
* A name for the node.
* </p>
*
* @param nodeName
* A name for the node.
*/
public void setNodeName(String nodeName) {
this.nodeName = nodeName;
}
/**
* <p>
* A name for the node.
* </p>
*
* @return A name for the node.
*/
public String getNodeName() {
return this.nodeName;
}
/**
* <p>
* A name for the node.
* </p>
*
* @param nodeName
* A name for the node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateNodeFromTemplateJobRequest withNodeName(String nodeName) {
setNodeName(nodeName);
return this;
}
/**
* <p>
* A description for the node.
* </p>
*
* @param nodeDescription
* A description for the node.
*/
public void setNodeDescription(String nodeDescription) {
this.nodeDescription = nodeDescription;
}
/**
* <p>
* A description for the node.
* </p>
*
* @return A description for the node.
*/
public String getNodeDescription() {
return this.nodeDescription;
}
/**
* <p>
* A description for the node.
* </p>
*
* @param nodeDescription
* A description for the node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateNodeFromTemplateJobRequest withNodeDescription(String nodeDescription) {
setNodeDescription(nodeDescription);
return this;
}
/**
* <p>
* Template parameters for the node.
* </p>
*
* @return Template parameters for the node.
*/
public java.util.Map<String, String> getTemplateParameters() {
return templateParameters;
}
/**
* <p>
* Template parameters for the node.
* </p>
*
* @param templateParameters
* Template parameters for the node.
*/
public void setTemplateParameters(java.util.Map<String, String> templateParameters) {
this.templateParameters = templateParameters;
}
/**
* <p>
* Template parameters for the node.
* </p>
*
* @param templateParameters
* Template parameters for the node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateNodeFromTemplateJobRequest withTemplateParameters(java.util.Map<String, String> templateParameters) {
setTemplateParameters(templateParameters);
return this;
}
/**
* Add a single TemplateParameters entry
*
* @see CreateNodeFromTemplateJobRequest#withTemplateParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateNodeFromTemplateJobRequest addTemplateParametersEntry(String key, String value) {
if (null == this.templateParameters) {
this.templateParameters = new java.util.HashMap<String, String>();
}
if (this.templateParameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.templateParameters.put(key, value);
return this;
}
/**
* Removes all the entries added into TemplateParameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateNodeFromTemplateJobRequest clearTemplateParametersEntries() {
this.templateParameters = null;
return this;
}
/**
* <p>
* Tags for the job.
* </p>
*
* @return Tags for the job.
*/
public java.util.List<JobResourceTags> getJobTags() {
return jobTags;
}
/**
* <p>
* Tags for the job.
* </p>
*
* @param jobTags
* Tags for the job.
*/
public void setJobTags(java.util.Collection<JobResourceTags> jobTags) {
if (jobTags == null) {
this.jobTags = null;
return;
}
this.jobTags = new java.util.ArrayList<JobResourceTags>(jobTags);
}
/**
* <p>
* Tags for the job.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setJobTags(java.util.Collection)} or {@link #withJobTags(java.util.Collection)} if you want to override
* the existing values.
* </p>
*
* @param jobTags
* Tags for the job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateNodeFromTemplateJobRequest withJobTags(JobResourceTags... jobTags) {
if (this.jobTags == null) {
setJobTags(new java.util.ArrayList<JobResourceTags>(jobTags.length));
}
for (JobResourceTags ele : jobTags) {
this.jobTags.add(ele);
}
return this;
}
/**
* <p>
* Tags for the job.
* </p>
*
* @param jobTags
* Tags for the job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateNodeFromTemplateJobRequest withJobTags(java.util.Collection<JobResourceTags> jobTags) {
setJobTags(jobTags);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getTemplateType() != null)
sb.append("TemplateType: ").append(getTemplateType()).append(",");
if (getOutputPackageName() != null)
sb.append("OutputPackageName: ").append(getOutputPackageName()).append(",");
if (getOutputPackageVersion() != null)
sb.append("OutputPackageVersion: ").append(getOutputPackageVersion()).append(",");
if (getNodeName() != null)
sb.append("NodeName: ").append(getNodeName()).append(",");
if (getNodeDescription() != null)
sb.append("NodeDescription: ").append(getNodeDescription()).append(",");
if (getTemplateParameters() != null)
sb.append("TemplateParameters: ").append("***Sensitive Data Redacted***").append(",");
if (getJobTags() != null)
sb.append("JobTags: ").append(getJobTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateNodeFromTemplateJobRequest == false)
return false;
CreateNodeFromTemplateJobRequest other = (CreateNodeFromTemplateJobRequest) obj;
if (other.getTemplateType() == null ^ this.getTemplateType() == null)
return false;
if (other.getTemplateType() != null && other.getTemplateType().equals(this.getTemplateType()) == false)
return false;
if (other.getOutputPackageName() == null ^ this.getOutputPackageName() == null)
return false;
if (other.getOutputPackageName() != null && other.getOutputPackageName().equals(this.getOutputPackageName()) == false)
return false;
if (other.getOutputPackageVersion() == null ^ this.getOutputPackageVersion() == null)
return false;
if (other.getOutputPackageVersion() != null && other.getOutputPackageVersion().equals(this.getOutputPackageVersion()) == false)
return false;
if (other.getNodeName() == null ^ this.getNodeName() == null)
return false;
if (other.getNodeName() != null && other.getNodeName().equals(this.getNodeName()) == false)
return false;
if (other.getNodeDescription() == null ^ this.getNodeDescription() == null)
return false;
if (other.getNodeDescription() != null && other.getNodeDescription().equals(this.getNodeDescription()) == false)
return false;
if (other.getTemplateParameters() == null ^ this.getTemplateParameters() == null)
return false;
if (other.getTemplateParameters() != null && other.getTemplateParameters().equals(this.getTemplateParameters()) == false)
return false;
if (other.getJobTags() == null ^ this.getJobTags() == null)
return false;
if (other.getJobTags() != null && other.getJobTags().equals(this.getJobTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTemplateType() == null) ? 0 : getTemplateType().hashCode());
hashCode = prime * hashCode + ((getOutputPackageName() == null) ? 0 : getOutputPackageName().hashCode());
hashCode = prime * hashCode + ((getOutputPackageVersion() == null) ? 0 : getOutputPackageVersion().hashCode());
hashCode = prime * hashCode + ((getNodeName() == null) ? 0 : getNodeName().hashCode());
hashCode = prime * hashCode + ((getNodeDescription() == null) ? 0 : getNodeDescription().hashCode());
hashCode = prime * hashCode + ((getTemplateParameters() == null) ? 0 : getTemplateParameters().hashCode());
hashCode = prime * hashCode + ((getJobTags() == null) ? 0 : getJobTags().hashCode());
return hashCode;
}
@Override
public CreateNodeFromTemplateJobRequest clone() {
return (CreateNodeFromTemplateJobRequest) super.clone();
}
}
|
[
""
] | |
8182a7db5bcbb183fa9c292403c0afda4a3029ef
|
f164b56ed542b35b257c947b59ff79c708c72009
|
/Shohan/src/shamim/interfaceimplement/App.java
|
c6c22881588ca1cffa5d17ed656b5f49be19bea9
|
[] |
no_license
|
MAYURIGAURAV/CoreJavaNew
|
f1593b27cb8800e1bd8833aec8ba495d53e21f90
|
e1cd5825acde15c797c6ce9c777758a5db01bcfa
|
refs/heads/master
| 2020-03-24T04:59:17.180787
| 2017-10-30T12:26:30
| 2017-10-30T12:26:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 790
|
java
|
package shamim.interfaceimplement;
public class App implements InterfaceExample, InterfaceExample2 {
@Override
public void method1() {
int x = 10;
int y = 20;
int z = x+y;
System.out.println(z);
}
@Override
public void method2() {
}
public static void main(String[] args) {
App obj = new App();
obj.method1();
}
@Override
public void method3() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void method4() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
|
[
"shamimsjava@gmail.com"
] |
shamimsjava@gmail.com
|
5355451f423a920ce0446f82c8523da5344dcae6
|
0d74f7300f49e4981cac318b14f47483dee79ee5
|
/src/main/java/calllog/webservices/calllog_ws/payunit/Payunit_Controller.java
|
0846eb09e37abb3e0cc47f215a2e87425e31ec7b
|
[] |
no_license
|
kanithanew/webservicecalllog
|
97ea244e0e61b0051625ea4e54caf2c455ab6e51
|
23c9a6b617799727b58e4b0820145410ce82df69
|
refs/heads/master
| 2020-04-16T12:38:12.983330
| 2019-01-30T10:53:20
| 2019-01-30T10:53:20
| 165,589,321
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 754
|
java
|
package calllog.webservices.calllog_ws.payunit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import javax.validation.Valid;
import java.net.URI;
import java.util.List;
import java.util.Optional;
@RestController
@RequestMapping("/payunit")
public class Payunit_Controller {
@Autowired
Payunit_Service payunit_Service;
@GetMapping(params = "payunit")
public List<Payunit> getPayUnit(@RequestParam(value = "payunit") String payunit) {
return payunit_Service.retrievePayunit(payunit);
}
}
|
[
"kanithanew@gmail.com"
] |
kanithanew@gmail.com
|
b36049d75c488d369acf15133e9f8845fd8cd283
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/google--error-prone/d6494a8eadecc6b2e70c7976fb5256c42669cbe7/before/ErrorReporter.java
|
14a4e0d8db51b5de97deb350f8e1c6aaeb0cf9fa
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 910
|
java
|
/*
* Copyright 2011 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.errorprone;
import com.google.errorprone.checkers.ErrorChecker.AstError;
/**
* Strategies for making our errors appear to the user and break their build.
* @author alexeagle@google.com (Alex Eagle)
*/
public interface ErrorReporter {
void emitError(AstError error);
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
0316c4ec462ef0c809b0f3c82d2c75a9bb6979f0
|
5cf95ef73900dd42f636e113beb819fa373008ca
|
/src/main/java/com/soft/mikessolutions/machineservice/services/implementations/MachineServiceImpl.java
|
22b9494350bf8c996381551cc4b54fea00ad128f
|
[] |
no_license
|
BaduraMike/mrns-machine-service
|
d0c8471943462519527231e5e7b540351e34f2c7
|
bfa45f82daf09d360de676ed7ee07ac19f764827
|
refs/heads/master
| 2020-07-16T05:57:54.919934
| 2019-09-10T22:21:20
| 2019-09-10T22:21:20
| 205,734,256
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,304
|
java
|
package com.soft.mikessolutions.machineservice.services.implementations;
import com.soft.mikessolutions.machineservice.entities.Machine;
import com.soft.mikessolutions.machineservice.exceptions.MachineNotFoundException;
import com.soft.mikessolutions.machineservice.repositories.MachineRepository;
import com.soft.mikessolutions.machineservice.services.MachineService;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class MachineServiceImpl implements MachineService {
private final MachineRepository machineRepository;
MachineServiceImpl(MachineRepository machineRepository) {
this.machineRepository = machineRepository;
}
@Override
public List<Machine> findAll() {
return machineRepository.findAll();
}
@Override
public Machine findById(Long id) {
return machineRepository.findById(id)
.orElseThrow(() -> new MachineNotFoundException(id));
}
@Override
public Machine save(Machine machine) {
return machineRepository.save(machine);
}
@Override
public void delete(Machine machine) {
machineRepository.delete(machine);
}
@Override
public void deleteById(Long id) {
machineRepository.deleteById(findById(id).getId());
}
}
|
[
"badura.mike@gmail.com"
] |
badura.mike@gmail.com
|
6ab1c753a78307700ca78e398df72083216def9e
|
d4d752743bb97eb4d3f288b4ea357103a582dcff
|
/Java/src/Elemento.java
|
42852ed7dcf03e2bfe048ea1e53e4848d6095a5c
|
[] |
no_license
|
eduardobs17/CompresorHuffmanBytes
|
9e61bf15c3f8ba7d6c3321e3b0770cbbf2ffee98
|
94465bf6cdfc725c618c1e7f9da33ee5e35b3783
|
refs/heads/master
| 2020-05-24T14:18:53.465791
| 2019-05-31T04:07:39
| 2019-05-31T04:07:39
| 187,307,233
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 699
|
java
|
/**
* Esta clase es un complemento de la clase lista, pues permite realizar los 'enlaces' entre los objetos.
* El tipo de dato que esta clase usa debe ser igual al tipo de dato de la clase lista.
* @author Eduardo Biazzetti - B40999.
*/
class Elemento<T> {
Elemento<T> anterior;
T objeto;
Elemento<T> siguiente;
/**
* Constructor de la clase Elemento. Inicialmente está aislado, pues siguiente y anterior son nulos.
* @param nuevoObjeto el objeto de tipo T que esta instancia de elemento va a almacenar (y futuramente enlazar en una lista).
*/
Elemento(T nuevoObjeto) {
objeto = nuevoObjeto;
siguiente = null;
anterior = null;
}
}
|
[
"eduardobs17@outlook.com"
] |
eduardobs17@outlook.com
|
23dce9ab08482589eb1bb375a0da070263087500
|
8176f384d0678357dabebc522b717518ec4c9153
|
/wetnet-web/src/main/java/net/wedjaa/wetnet/util/WetnetWebUtils.java
|
a795448b3ec3f425e0e1e0e59df741a98748856b
|
[] |
no_license
|
ingegnerietoscane/WetNet-Interface
|
abb21ec4d2de0c8212ab48ca39a35a51db0ce04d
|
d1f328c68b7c978ae26467d53621967b4f44ac49
|
refs/heads/master
| 2021-06-11T11:31:04.143584
| 2021-03-18T15:19:34
| 2021-03-18T15:19:34
| 136,630,787
| 0
| 0
| null | 2020-06-15T22:30:27
| 2018-06-08T14:40:25
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 904
|
java
|
/**
*
*/
package net.wedjaa.wetnet.util;
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.logging.Logger;
import net.wedjaa.wetnet.business.domain.Districts;
/**
* @author massimo ricci
*
*/
public class WetnetWebUtils {
protected static final Logger logger = Logger.getLogger("WetnetWebUtils");
/**
* Data una lista di distretti come parametro in input, genera una
* mappa [key, value] del tipo [idDistricts, name]
* @param districtsList
* @return districtsMap
*/
public static SortedMap<Long, String> getDistrictsMap(List<Districts> districtsList){
SortedMap<Long, String> districtsMap = new TreeMap<Long, String>();
if (districtsList != null){
for (int i = 0; i < districtsList.size(); i++){
Districts d = districtsList.get(i);
districtsMap.put(d.getIdDistricts(), d.getName());
}
}
return districtsMap;
}
}
|
[
"daniele.montagni@iagica.it"
] |
daniele.montagni@iagica.it
|
aa45f38eb1bcc8fabeb0622dd076ba9ee88b108a
|
8b3587f818392a2a73bc5b90727fce0efa53e3d7
|
/app/build/generated/source/r/debug/android/support/v4/R.java
|
3c8668a22fc4ab20af4a9bc9e7886c7c61e122a9
|
[] |
no_license
|
sgitay/ConfirmU_dilip_25july
|
3319de4775b181f43c82160f00fbbb81ec948d8e
|
726a038b0dd12750221e2cb130b5a4cbd9f2f7cc
|
refs/heads/master
| 2020-03-31T18:36:57.755009
| 2018-10-10T17:53:21
| 2018-10-10T17:53:21
| 152,465,564
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,998
|
java
|
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.v4;
public final class R {
public static final class attr {
public static int font = 0x7f0400f6;
public static int fontProviderAuthority = 0x7f0400f8;
public static int fontProviderCerts = 0x7f0400f9;
public static int fontProviderFetchStrategy = 0x7f0400fa;
public static int fontProviderFetchTimeout = 0x7f0400fb;
public static int fontProviderPackage = 0x7f0400fc;
public static int fontProviderQuery = 0x7f0400fd;
public static int fontStyle = 0x7f0400fe;
public static int fontWeight = 0x7f0400ff;
}
public static final class bool {
public static int abc_action_bar_embed_tabs = 0x7f050001;
}
public static final class color {
public static int notification_action_color_filter = 0x7f06006e;
public static int notification_icon_bg_color = 0x7f06006f;
public static int notification_material_background_media_default_color = 0x7f060070;
public static int primary_text_default_material_dark = 0x7f06007b;
public static int ripple_material_light = 0x7f060080;
public static int secondary_text_default_material_dark = 0x7f060081;
public static int secondary_text_default_material_light = 0x7f060082;
}
public static final class dimen {
public static int compat_button_inset_horizontal_material = 0x7f08007c;
public static int compat_button_inset_vertical_material = 0x7f08007d;
public static int compat_button_padding_horizontal_material = 0x7f08007e;
public static int compat_button_padding_vertical_material = 0x7f08007f;
public static int compat_control_corner_material = 0x7f080080;
public static int notification_action_icon_size = 0x7f080092;
public static int notification_action_text_size = 0x7f080093;
public static int notification_big_circle_margin = 0x7f080094;
public static int notification_content_margin_start = 0x7f080095;
public static int notification_large_icon_height = 0x7f080096;
public static int notification_large_icon_width = 0x7f080097;
public static int notification_main_column_padding_top = 0x7f080098;
public static int notification_media_narrow_margin = 0x7f080099;
public static int notification_right_icon_size = 0x7f08009a;
public static int notification_right_side_padding_top = 0x7f08009b;
public static int notification_small_icon_background_padding = 0x7f08009c;
public static int notification_small_icon_size_as_large = 0x7f08009d;
public static int notification_subtext_size = 0x7f08009e;
public static int notification_top_pad = 0x7f08009f;
public static int notification_top_pad_large_text = 0x7f0800a0;
}
public static final class drawable {
public static int notification_action_background = 0x7f0900e9;
public static int notification_bg = 0x7f0900ea;
public static int notification_bg_low = 0x7f0900eb;
public static int notification_bg_low_normal = 0x7f0900ec;
public static int notification_bg_low_pressed = 0x7f0900ed;
public static int notification_bg_normal = 0x7f0900ee;
public static int notification_bg_normal_pressed = 0x7f0900ef;
public static int notification_icon_background = 0x7f0900f0;
public static int notification_template_icon_bg = 0x7f0900f1;
public static int notification_template_icon_low_bg = 0x7f0900f2;
public static int notification_tile_bg = 0x7f0900f3;
public static int notify_panel_notification_icon_bg = 0x7f0900f4;
}
public static final class id {
public static int action0 = 0x7f0c0005;
public static int action_container = 0x7f0c000d;
public static int action_divider = 0x7f0c000f;
public static int action_image = 0x7f0c0010;
public static int action_text = 0x7f0c0016;
public static int actions = 0x7f0c0017;
public static int async = 0x7f0c0029;
public static int blocking = 0x7f0c0032;
public static int cancel_action = 0x7f0c0045;
public static int chronometer = 0x7f0c005a;
public static int end_padder = 0x7f0c008c;
public static int forever = 0x7f0c009b;
public static int icon = 0x7f0c00a8;
public static int icon_group = 0x7f0c00a9;
public static int info = 0x7f0c00b0;
public static int italic = 0x7f0c00b9;
public static int line1 = 0x7f0c00c9;
public static int line3 = 0x7f0c00ca;
public static int media_actions = 0x7f0c00d5;
public static int normal = 0x7f0c00de;
public static int notification_background = 0x7f0c00df;
public static int notification_main_column = 0x7f0c00e0;
public static int notification_main_column_container = 0x7f0c00e1;
public static int right_icon = 0x7f0c0102;
public static int right_side = 0x7f0c0103;
public static int status_bar_latest_event_content = 0x7f0c0132;
public static int tag_transition_group = 0x7f0c013a;
public static int text = 0x7f0c013d;
public static int text2 = 0x7f0c013f;
public static int time = 0x7f0c0146;
public static int title = 0x7f0c0147;
}
public static final class integer {
public static int cancel_button_image_alpha = 0x7f0d0003;
public static int status_bar_notification_info_maxnum = 0x7f0d0007;
}
public static final class layout {
public static int notification_action = 0x7f0f0045;
public static int notification_action_tombstone = 0x7f0f0046;
public static int notification_media_action = 0x7f0f0047;
public static int notification_media_cancel_action = 0x7f0f0048;
public static int notification_template_big_media = 0x7f0f0049;
public static int notification_template_big_media_custom = 0x7f0f004a;
public static int notification_template_big_media_narrow = 0x7f0f004b;
public static int notification_template_big_media_narrow_custom = 0x7f0f004c;
public static int notification_template_custom_big = 0x7f0f004d;
public static int notification_template_icon_group = 0x7f0f004e;
public static int notification_template_lines_media = 0x7f0f004f;
public static int notification_template_media = 0x7f0f0050;
public static int notification_template_media_custom = 0x7f0f0051;
public static int notification_template_part_chronometer = 0x7f0f0052;
public static int notification_template_part_time = 0x7f0f0053;
}
public static final class string {
public static int status_bar_notification_info_overflow = 0x7f1500a3;
}
public static final class style {
public static int TextAppearance_Compat_Notification = 0x7f160107;
public static int TextAppearance_Compat_Notification_Info = 0x7f160108;
public static int TextAppearance_Compat_Notification_Info_Media = 0x7f160109;
public static int TextAppearance_Compat_Notification_Line2 = 0x7f16010a;
public static int TextAppearance_Compat_Notification_Line2_Media = 0x7f16010b;
public static int TextAppearance_Compat_Notification_Media = 0x7f16010c;
public static int TextAppearance_Compat_Notification_Time = 0x7f16010d;
public static int TextAppearance_Compat_Notification_Time_Media = 0x7f16010e;
public static int TextAppearance_Compat_Notification_Title = 0x7f16010f;
public static int TextAppearance_Compat_Notification_Title_Media = 0x7f160110;
public static int Widget_Compat_NotificationActionContainer = 0x7f160186;
public static int Widget_Compat_NotificationActionText = 0x7f160187;
}
public static final class styleable {
public static int[] FontFamily = { 0x7f0400f8, 0x7f0400f9, 0x7f0400fa, 0x7f0400fb, 0x7f0400fc, 0x7f0400fd };
public static int FontFamily_fontProviderAuthority = 0;
public static int FontFamily_fontProviderCerts = 1;
public static int FontFamily_fontProviderFetchStrategy = 2;
public static int FontFamily_fontProviderFetchTimeout = 3;
public static int FontFamily_fontProviderPackage = 4;
public static int FontFamily_fontProviderQuery = 5;
public static int[] FontFamilyFont = { 0x01010532, 0x0101053f, 0x01010533, 0x7f0400f6, 0x7f0400fe, 0x7f0400ff };
public static int FontFamilyFont_android_font = 0;
public static int FontFamilyFont_android_fontStyle = 1;
public static int FontFamilyFont_android_fontWeight = 2;
public static int FontFamilyFont_font = 3;
public static int FontFamilyFont_fontStyle = 4;
public static int FontFamilyFont_fontWeight = 5;
}
}
|
[
"predictably.user@gmail.com"
] |
predictably.user@gmail.com
|
134008bef9cd8f2b85ededd9ecdda9f9c90eeef4
|
f1850fad88e5178fe60996dc3407520543a26df6
|
/Jose/Demo 2.3 (1).4564RC3 Alpha 3 Extreme Edition/src/gpawidget/ColorZone.java
|
aa3e97d06f4b2d9f5392a8871b174dbcb49d6464
|
[] |
no_license
|
deborahdeleon01/SEFinalProject_Group1
|
d31b8d456b6676b54cef71f253560ff5ceac6872
|
4b63e31b8f0e25f72154b55e8b31010972efbb76
|
refs/heads/master
| 2021-05-01T00:28:30.538138
| 2016-12-13T23:24:53
| 2016-12-13T23:24:53
| 71,600,605
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,849
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gpawidget;
import javafx.scene.paint.Color;
/**
* @author MQ0162246
*/
public class ColorZone {
private Color[] colors = null;
private double[] values = null;
private int[] valuesDegrees = null;
public ColorZone(Color[] mycolors, double[] myvalues) {
colors = mycolors;
values = myvalues;
}
public int[] calcDegrees() {
double sum = 0;
int[] degrees = null;
//Convert percntagfe to 0-180 degrees length
degrees = new int[values.length];
for (int i = 0; i < values.length; i++) {
double cSize = values[i];
sum += cSize;
}
for (int i = 0; i < values.length; i++) {
int cSize = Math.round((float) ((values[i] / sum) * 180));
degrees[i] = cSize;
}
valuesDegrees = degrees;
return degrees;
}
/**
* @return the colors
*/
public Color[] getColors() {
return colors;
}
/**
* @param colors the colors to set
*/
public void setColors(Color[] colors) {
this.colors = colors;
}
/**
* @return the values
*/
public double[] getValues() {
return values;
}
/**
* @param values the values to set
*/
public void setValues(double[] values) {
this.values = values;
}
/**
* @return the valuesDegrees
*/
public int[] getValuesDegrees() {
return valuesDegrees;
}
/**
* @param valuesDegrees the valuesDegrees to set
*/
public void setValuesDegrees(int[] valuesDegrees) {
this.valuesDegrees = valuesDegrees;
}
}
|
[
"Jose.Ballesteros01@utrgv.edu"
] |
Jose.Ballesteros01@utrgv.edu
|
35f315cc83c2c1ab93a0c1cde66f5883b294d9a6
|
b28d60148840faf555babda5ed44ed0f1b164b2c
|
/java/misshare_cloud-multi-tenant/common-entity/src/main/java/com/qhieco/request/web/OrderRefundRequest.java
|
4e2b5d02b0d0de1eb67973f50dbac83d47f9e6d7
|
[] |
no_license
|
soon14/Easy_Spring_Backend
|
e2ec16afb1986ea19df70821d96edcb922d7978e
|
49bceae4b0c3294945dc4ad7ff53cae586127e50
|
refs/heads/master
| 2020-07-26T16:12:01.337615
| 2019-04-09T08:15:37
| 2019-04-09T08:15:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 547
|
java
|
package com.qhieco.request.web;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @author 王宇 623619462@qq.com
* @version 2.0.1 创建时间: 18-3-30 上午9:46
* <p>
* 类说明:
* ${description}
*/
@Data
public class OrderRefundRequest extends QueryPaged{
private String phone;
private BigDecimal feeMax;
private BigDecimal feeMin;
private String tradeNo;
private Integer state;
private List<Integer> channel;
private Long startCreateTime;
private Long endCreateTime;
}
|
[
"k2160789@163.com"
] |
k2160789@163.com
|
01dd1dc6fd5913d30103608ab22568960a3d93f5
|
1c9589d4e3bc1523ba1e745a2155433e4bd4b85c
|
/src/com/javarush/test/level36/lesson04/big01/model/ModelData.java
|
9bc54948e668fedf11c19c22c120210c40057e31
|
[] |
no_license
|
Adeptius/JavaRushHomeWork
|
230a7dfd48b063bf7e62d5b50e7fc3f4b529fc0a
|
ee587724a7d579463d5deb5211b8e2f4bf902fdb
|
refs/heads/master
| 2020-05-22T06:42:56.780076
| 2019-09-12T15:43:25
| 2019-09-12T15:43:25
| 65,140,116
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 922
|
java
|
package com.javarush.test.level36.lesson04.big01.model;
import com.javarush.test.level36.lesson04.big01.bean.User;
import java.util.List;
/**
* Created by Владелец on 10.08.2016.
*/
public class ModelData {
private List<User> users;
private User activeUser;
private boolean displayDeletedUserList;
public boolean isDisplayDeletedUserList() {
return displayDeletedUserList;
}
public void setDisplayDeletedUserList(boolean displayDeletedUserList) {
this.displayDeletedUserList = displayDeletedUserList;
}
public User getActiveUser()
{
return activeUser;
}
public void setActiveUser(User activeUser)
{
this.activeUser = activeUser;
}
public void setUsers(List<User> users) {
this.users = users;
}
public List<User> getUsers() {
return users;
}
}
|
[
"adeptius@gmail.com"
] |
adeptius@gmail.com
|
89ad033bffd3cc20981d7da997a73ff03642984c
|
8d4df76c2055593b7f0b8f096f3288e13e6d2330
|
/HuixinApp/src/main/java/com/king/photo/model/PowerNetHistoryModel.java
|
20e5f1266911a2e2d69765e248d002d8f2ff1ad5
|
[] |
no_license
|
ZSQ970509/HuixinApp
|
c789335ec8d0349405a0478a56f6f7ff875accd5
|
f40b2a03131195a9c59265b94e299d6bc5804011
|
refs/heads/master
| 2020-03-27T08:11:56.018035
| 2019-02-28T01:52:33
| 2019-02-28T01:52:33
| 118,546,936
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,138
|
java
|
package com.king.photo.model;
public class PowerNetHistoryModel {
private String RecordID;
private String CamseqID;
private String Status;
private String NetDownTime;
private String NetOnTime;
/**
* @return the recordID
*/
public String getRecordID() {
return RecordID;
}
/**
* @param recordID
* the recordID to set
*/
public void setRecordID(String recordID) {
RecordID = recordID;
}
/**
* @return the camseqID
*/
public String getCamseqID() {
return CamseqID;
}
/**
* @param camseqID
* the camseqID to set
*/
public void setCamseqID(String camseqID) {
CamseqID = camseqID;
}
/**
* @return the status
*/
public String getStatus() {
return Status;
}
/**
* @param status
* the status to set
*/
public void setStatus(String status) {
Status = status;
}
public String getNetDownTime() {
return NetDownTime;
}
public void setNetDownTime(String netDownTime) {
NetDownTime = netDownTime;
}
public String getNetOnTime() {
return NetOnTime;
}
public void setNetOnTime(String netOnTime) {
NetOnTime = netOnTime;
}
}
|
[
"1037557632@qq.com"
] |
1037557632@qq.com
|
281ba9aa02744137813608649cda978ebcd0fcae
|
ef23d9b833a84ad79a9df816bd3fd1321b09851e
|
/L2J_SunriseProject_Data/dist/game/data/scripts/handlers/actionshifthandlers/L2NpcActionShift.java
|
0199c51620e6a3b4c47994114607c2d709830f3d
|
[] |
no_license
|
nascimentolh/JBlueHeart-Source
|
c05c07137a7a4baf5fe8a793375f1700618ef12c
|
4179e6a6dbd0f74d614d7cc1ab7eb90ff41af218
|
refs/heads/master
| 2022-05-28T22:05:06.858469
| 2020-04-26T15:22:17
| 2020-04-26T15:22:17
| 259,045,356
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 14,822
|
java
|
/*
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.actionshifthandlers;
import l2r.Config;
import l2r.gameserver.data.xml.impl.ItemData;
import l2r.gameserver.enums.InstanceType;
import l2r.gameserver.handler.IActionShiftHandler;
import l2r.gameserver.instancemanager.WalkingManager;
import l2r.gameserver.model.Elementals;
import l2r.gameserver.model.L2DropCategory;
import l2r.gameserver.model.L2DropData;
import l2r.gameserver.model.L2Object;
import l2r.gameserver.model.actor.L2Attackable;
import l2r.gameserver.model.actor.L2Character;
import l2r.gameserver.model.actor.L2Npc;
import l2r.gameserver.model.actor.instance.L2PcInstance;
import l2r.gameserver.model.items.L2Item;
import l2r.gameserver.model.stats.BaseStats;
import l2r.gameserver.model.stats.Stats;
import l2r.gameserver.network.serverpackets.NpcHtmlMessage;
import l2r.util.StringUtil;
public class L2NpcActionShift implements IActionShiftHandler
{
/**
* Manage and Display the GM console to modify the L2NpcInstance (GM only).<BR>
* <BR>
* <B><U> Actions (If the L2PcInstance is a GM only)</U> :</B><BR>
* <BR>
* <li>Set the L2NpcInstance as target of the L2PcInstance player (if necessary)</li>
* <li>Send a Server->Client packet MyTargetSelected to the L2PcInstance player (display the select window)</li>
* <li>If L2NpcInstance is autoAttackable, send a Server->Client packet StatusUpdate to the L2PcInstance in order to update L2NpcInstance HP bar</li>
* <li>Send a Server->Client NpcHtmlMessage() containing the GM console about this L2NpcInstance</li><BR>
* <BR>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : Each group of Server->Client packet must be terminated by a ActionFailed packet in order to avoid that client wait an other packet</B></FONT><BR>
* <BR>
* <B><U> Example of use </U> :</B><BR>
* <BR>
* <li>Client packet : Action</li><BR>
* <BR>
*/
@Override
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact)
{
// Check if the L2PcInstance is a GM
if (activeChar.getAccessLevel().isGm())
{
// Set the target of the L2PcInstance activeChar
activeChar.setTarget(target);
final NpcHtmlMessage html = new NpcHtmlMessage();
html.setFile(activeChar.getHtmlPrefix(), "data/html/admin/npcinfo.htm");
html.replace("%objid%", String.valueOf(target.getObjectId()));
html.replace("%class%", target.getClass().getSimpleName());
html.replace("%id%", String.valueOf(((L2Npc) target).getTemplate().getId()));
html.replace("%lvl%", String.valueOf(((L2Npc) target).getTemplate().getLevel()));
html.replace("%name%", String.valueOf(((L2Npc) target).getTemplate().getName()));
html.replace("%tmplid%", String.valueOf(((L2Npc) target).getTemplate().getId()));
html.replace("%aggro%", String.valueOf((target instanceof L2Attackable) ? ((L2Attackable) target).getAggroRange() : 0));
html.replace("%hp%", String.valueOf((int) ((L2Character) target).getCurrentHp()));
html.replace("%hpmax%", String.valueOf(((L2Character) target).getMaxHp()));
html.replace("%mp%", String.valueOf((int) ((L2Character) target).getCurrentMp()));
html.replace("%mpmax%", String.valueOf(((L2Character) target).getMaxMp()));
html.replace("%patk%", String.valueOf((int) ((L2Character) target).getPAtk(null)));
html.replace("%matk%", String.valueOf((int) ((L2Character) target).getMAtk(null, null)));
html.replace("%pdef%", String.valueOf((int) ((L2Character) target).getPDef(null)));
html.replace("%mdef%", String.valueOf((int) ((L2Character) target).getMDef(null, null)));
html.replace("%accu%", String.valueOf(((L2Character) target).getAccuracy()));
html.replace("%evas%", String.valueOf(((L2Character) target).getEvasionRate(null)));
html.replace("%crit%", String.valueOf(((L2Character) target).getCriticalHit(null, null)));
html.replace("%rspd%", String.valueOf(((L2Character) target).getRunSpeed()));
html.replace("%aspd%", String.valueOf(((L2Character) target).getPAtkSpd()));
html.replace("%cspd%", String.valueOf(((L2Character) target).getMAtkSpd()));
html.replace("%str%", String.valueOf(((L2Character) target).getSTR()));
html.replace("%dex%", String.valueOf(((L2Character) target).getDEX()));
html.replace("%con%", String.valueOf(((L2Character) target).getCON()));
html.replace("%int%", String.valueOf(((L2Character) target).getINT()));
html.replace("%wit%", String.valueOf(((L2Character) target).getWIT()));
html.replace("%men%", String.valueOf(((L2Character) target).getMEN()));
html.replace("%loc%", String.valueOf(target.getX() + " " + target.getY() + " " + target.getZ()));
html.replace("%heading%", String.valueOf(((L2Character) target).getHeading()));
html.replace("%collision_radius%", String.valueOf(((L2Character) target).getTemplate().getfCollisionRadius()));
html.replace("%collision_height%", String.valueOf(((L2Character) target).getTemplate().getfCollisionHeight()));
html.replace("%dist%", String.valueOf((int) activeChar.calculateDistance(target, true, false)));
byte attackAttribute = ((L2Character) target).getAttackElement();
html.replace("%ele_atk%", Elementals.getElementName(attackAttribute));
html.replace("%ele_atk_value%", String.valueOf(((L2Character) target).getAttackElementValue(attackAttribute)));
html.replace("%ele_dfire%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.FIRE)));
html.replace("%ele_dwater%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.WATER)));
html.replace("%ele_dwind%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.WIND)));
html.replace("%ele_dearth%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.EARTH)));
html.replace("%ele_dholy%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.HOLY)));
html.replace("%ele_ddark%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.DARK)));
if (((L2Npc) target).getSpawn() != null)
{
html.replace("%territory%", ((L2Npc) target).getSpawn().getSpawnTerritory() == null ? "None" : ((L2Npc) target).getSpawn().getSpawnTerritory().getName());
if (((L2Npc) target).getSpawn().isTerritoryBased())
{
html.replace("%spawntype%", "Random");
html.replace("%spawn%", ((L2Npc) target).getSpawn().getX(target) + " " + ((L2Npc) target).getSpawn().getY(target) + " " + ((L2Npc) target).getSpawn().getZ(target));
}
else
{
html.replace("%spawntype%", "Fixed");
html.replace("%spawn%", ((L2Npc) target).getSpawn().getX() + " " + ((L2Npc) target).getSpawn().getY() + " " + ((L2Npc) target).getSpawn().getZ());
}
html.replace("%loc2d%", String.valueOf((int) target.calculateDistance(((L2Npc) target).getSpawn().getLocation(target), false, false)));
html.replace("%loc3d%", String.valueOf((int) target.calculateDistance(((L2Npc) target).getSpawn().getLocation(target), true, false)));
if (((L2Npc) target).getSpawn().getRespawnMinDelay() == 0)
{
html.replace("%resp%", "None");
}
else if (((L2Npc) target).getSpawn().hasRespawnRandom())
{
html.replace("%resp%", String.valueOf(((L2Npc) target).getSpawn().getRespawnMinDelay() / 1000) + "-" + String.valueOf((((L2Npc) target).getSpawn().getRespawnMaxDelay() / 1000) + " sec"));
}
else
{
html.replace("%resp%", String.valueOf(((L2Npc) target).getSpawn().getRespawnMinDelay() / 1000) + " sec");
}
}
else
{
html.replace("%territory%", "<font color=FF0000>--</font>");
html.replace("%spawntype%", "<font color=FF0000>--</font>");
html.replace("%spawn%", "<font color=FF0000>null</font>");
html.replace("%loc2d%", "<font color=FF0000>--</font>");
html.replace("%loc3d%", "<font color=FF0000>--</font>");
html.replace("%resp%", "<font color=FF0000>--</font>");
}
if (((L2Npc) target).hasAI())
{
html.replace("%ai_intention%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Intention:</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getAI().getIntention().name()) + "</td></tr></table></td></tr>");
html.replace("%ai%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>AI</font></td><td align=right width=170>" + ((L2Npc) target).getAI().getClass().getSimpleName() + "</td></tr></table></td></tr>");
html.replace("%ai_type%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>AIType</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getAiType()) + "</td></tr></table></td></tr>");
html.replace("%ai_clan%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>Clan & Range:</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getTemplate().getAIDataStatic().getClan()) + " " + String.valueOf(((L2Npc) target).getTemplate().getAIDataStatic().getClanRange()) + "</td></tr></table></td></tr>");
html.replace("%ai_enemy_clan%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Enemy & Range:</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getTemplate().getAIDataStatic().getEnemyClan()) + " " + String.valueOf(((L2Npc) target).getTemplate().getAIDataStatic().getEnemyRange()) + "</td></tr></table></td></tr>");
html.replace("%ai_can_random_walk%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>Random Walk:</font></td><td align=right width=170>" + !((L2Npc) target).isNoRndWalk() + "</td></tr></table></td></tr>");
}
else
{
html.replace("%ai_intention%", "");
html.replace("%ai%", "");
html.replace("%ai_type%", "");
html.replace("%ai_clan%", "");
html.replace("%ai_enemy_clan%", "");
html.replace("%ai_can_random_walk%", "");
}
final String routeName = WalkingManager.getInstance().getRouteName((L2Npc) target);
if (!routeName.isEmpty())
{
html.replace("%route%", "<tr><td><table width=270 border=0><tr><td width=100><font color=LEVEL>Route:</font></td><td align=right width=170>" + routeName + "</td></tr></table></td></tr>");
}
else
{
html.replace("%route%", "");
}
activeChar.sendPacket(html);
}
else if (Config.ALT_GAME_VIEWNPC)
{
// Set the target of the L2PcInstance activeChar
activeChar.setTarget(target);
final NpcHtmlMessage html = new NpcHtmlMessage();
int hpMul = Math.round((float) (((L2Character) target).getStat().calcStat(Stats.MAX_HP, 1, (L2Character) target, null) / BaseStats.CON.calcBonus((L2Character) target)));
if (hpMul == 0)
{
hpMul = 1;
}
final StringBuilder html1 = StringUtil.startAppend(1000, "<html><body>" + "<br><center><font color=\"LEVEL\">[Combat Stats]</font></center>" + "<table border=0 width=\"100%\">" + "<tr><td>Max.HP</td><td>", String.valueOf(((L2Character) target).getMaxHp() / hpMul), "*", String.valueOf(hpMul), "</td><td>Max.MP</td><td>", String.valueOf(((L2Character) target).getMaxMp()), "</td></tr>" + "<tr><td>P.Atk.</td><td>", String.valueOf(((L2Character) target).getPAtk(null)), "</td><td>M.Atk.</td><td>", String.valueOf(((L2Character) target).getMAtk(null, null)), "</td></tr>" + "<tr><td>P.Def.</td><td>", String.valueOf(((L2Character) target).getPDef(null)), "</td><td>M.Def.</td><td>", String.valueOf(((L2Character) target).getMDef(null, null)), "</td></tr>" + "<tr><td>Accuracy</td><td>", String.valueOf(((L2Character) target).getAccuracy()), "</td><td>Evasion</td><td>", String.valueOf(((L2Character) target).getEvasionRate(null)), "</td></tr>" + "<tr><td>Critical</td><td>", String.valueOf(((L2Character) target).getCriticalHit(null, null)), "</td><td>Speed</td><td>", String.valueOf(((L2Character) target).getRunSpeed()), "</td></tr>" + "<tr><td>Atk.Speed</td><td>", String.valueOf(((L2Character) target).getPAtkSpd()), "</td><td>Cast.Speed</td><td>", String.valueOf(((L2Character) target).getMAtkSpd()), "</td></tr>" + "<tr><td>Race</td><td>", ((L2Npc) target).getTemplate().getRace().toString(), "</td><td></td><td></td></tr>" + "</table>" + "<br><center><font color=\"LEVEL\">[Basic Stats]</font></center>" + "<table border=0 width=\"100%\">" + "<tr><td>STR</td><td>", String.valueOf(((L2Character) target).getSTR()), "</td><td>DEX</td><td>", String.valueOf(((L2Character) target).getDEX()), "</td><td>CON</td><td>", String.valueOf(((L2Character) target).getCON()), "</td></tr>" + "<tr><td>INT</td><td>", String.valueOf(((L2Character) target).getINT()), "</td><td>WIT</td><td>", String.valueOf(((L2Character) target).getWIT()), "</td><td>MEN</td><td>", String.valueOf(((L2Character) target).getMEN()), "</td></tr>" + "</table>");
if (!((L2Npc) target).getTemplate().getDropData().isEmpty())
{
StringUtil.append(html1, "<br><center><font color=\"LEVEL\">[Drop Info]</font></center>" + "<br>Rates legend: <font color=\"ff9999\">50%+</font> <font color=\"00ff00\">30%+</font> <font color=\"0066ff\">less than 30%</font>" + "<table border=0 width=\"100%\">");
for (L2DropCategory cat : ((L2Npc) target).getTemplate().getDropData())
{
for (L2DropData drop : cat.getAllDrops())
{
final L2Item item = ItemData.getInstance().getTemplate(drop.getId());
if (item == null)
{
continue;
}
final String color;
if (drop.getChance() >= 500000)
{
color = "ff9999";
}
else if (drop.getChance() >= 300000)
{
color = "00ff00";
}
else
{
color = "0066ff";
}
StringUtil.append(html1, "<tr>", "<td><img src=\"" + item.getIcon() + "\" height=32 width=32></td>" + "<td><font color=\"", color, "\">", item.getName(), "</font></td>", "<td>", (drop.isQuestDrop() ? "Quest" : (cat.isSweep() ? "Sweep" : "Drop")), "</td>", "</tr>");
}
}
html1.append("</table>");
}
html1.append("</body></html>");
html.setHtml(html1.toString());
activeChar.sendPacket(html);
}
return true;
}
@Override
public InstanceType getInstanceType()
{
return InstanceType.L2Npc;
}
}
|
[
"luizh.nnh@gmail.com"
] |
luizh.nnh@gmail.com
|
0c10f91052c46cc99abc208cde2f97f0292a8223
|
3658f2faa65fb122c6584a0e2a59c685b77bb3bc
|
/src/main/java/com/cyp/controller/Descrption.java
|
c6946a23d028a74da20e6a4bb43b36a606ea2e01
|
[] |
no_license
|
tjetccyp/serverlet
|
64e5859971592fc84f39bbc265a88d2946b24580
|
b48cc4aa83f885de7a7e7019054817033bc56dc6
|
refs/heads/master
| 2022-12-26T01:49:33.187291
| 2020-09-29T02:30:30
| 2020-09-29T02:30:30
| 299,484,000
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 986
|
java
|
package com.cyp.controller;
import com.cyp.domain.Product;
import com.cyp.service.ProductService;
import com.cyp.service.impl.ProductServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
public class Descrption extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("UTF-8");
resp.setCharacterEncoding("UTF-8");
PrintWriter out=resp.getWriter();
String id=req.getParameter("id");
ProductService productService=new ProductServiceImpl();
Product product=productService.findProductById(Integer.parseInt(id));
req.setAttribute("product",product);
req.getRequestDispatcher("descrption.jsp").forward(req,resp);
}
}
|
[
"1769117205@qq.com"
] |
1769117205@qq.com
|
33cbbebb06de4392476a9a77e55b1bf8a54be717
|
b4a63faa7965e8049a541b94fcf1020cf0fee3cf
|
/src/main/java/com/comfeco/demo/exception/ModeloNotFoundException.java
|
fb38139c34a8dad89b2018d7ffb0dbde3debbd71
|
[] |
no_license
|
Comunidad-de-Programadores/Team-Angular-8-Comfeco-Backend
|
3d160ea5ffc37916a7b254200c7b31d9f657b628
|
985710cf88f637156ccad073a6e4cdfc00e20fe2
|
refs/heads/main
| 2023-03-18T21:28:17.591586
| 2021-03-21T04:13:51
| 2021-03-21T04:13:51
| 349,897,852
| 0
| 0
| null | 2021-03-21T04:15:07
| 2021-03-21T04:15:07
| null |
UTF-8
|
Java
| false
| false
| 262
|
java
|
package com.comfeco.demo.exception;
public class ModeloNotFoundException extends RuntimeException{
/**
*
*/
private static final long serialVersionUID = 1L;
public ModeloNotFoundException(String mensaje) {
super(mensaje);
}
}
|
[
"renatocastillopingo@gmail.com"
] |
renatocastillopingo@gmail.com
|
7c27e57233ba9342af65972cedf89fdde0e7570d
|
260b622340b63898d53e336e2772f3249b0dd255
|
/src/view/panels/AuthenticatedState2.java
|
746439542cb0fe3eb1485df06ea29a26fb07ddfc
|
[] |
no_license
|
phalves/PHAMST3
|
63d6f5148a30fde740a1df1740d67da091b5df95
|
0cdc0cc0754f23b1723c71276a93d5cf1610ab2e
|
refs/heads/master
| 2021-01-23T03:28:30.672401
| 2013-10-14T16:50:53
| 2013-10-14T16:50:53
| null | 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 10,532
|
java
|
package view.panels;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.Signature;
import java.security.SignatureException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Random;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import model.User;
import model.authentication.PasswordTree;
import view.MainFrame;
import controller.Conversor;
import controller.FileTool;
import controller.MainController;
import controller.authentication.AuthenticationState;
import controller.dbutils.DBUtils;
public class AuthenticatedState2 extends JPanel implements AuthenticationState {
private JLabel pathLabel;
private String caminhoArquivo = "";
private JPasswordField secretText;
private JLabel warning;
DBUtils dbUtils = DBUtils.getDBUtilsInstace();
MainController controller = MainController.getMainControllerInstace();
User currentUser = controller.getCurrentUser();
public AuthenticatedState2() {
super(null);
this.setSize(MainFrame.WIDTH, MainFrame.HEIGHT);
dbUtils.connect();
dbUtils.logMessage(4001, currentUser.getName());
dbUtils.disconnect();
JLabel fileLabel = new JLabel("Selecione o arquivo de chave privada: ");
fileLabel.setBounds(20, 20, 230, 40);
this.add(fileLabel);
pathLabel = new JLabel("Nenhum arquivo selecionado.");
pathLabel.setBounds(130, 50, 400, 40);
pathLabel.setFont(new Font("Serif", Font.PLAIN, 12));
this.add(pathLabel);
JLabel secretLabel = new JLabel("Frase secreta:");
secretLabel.setBounds(20, 100, 100, 20);
this.add(secretLabel);
secretText = new JPasswordField();
secretText.setBounds(20, 120, 250, 25);
this.add(secretText);
JButton fileButton = new JButton("Selecionar");
fileButton.setBounds(20, 60, 100, 20);
fileButton.addActionListener(new FileButtonActionListener());
this.add(fileButton);
JButton btnConfirma = new JButton("Confirmar");
btnConfirma.setBounds(20, 175, 250, 30);
btnConfirma.addActionListener(new ConfirmButtonActionListener());
this.add(btnConfirma);
warning = new JLabel("");
warning.setBounds(20, 220, 300, 30);
warning.setFont(new Font("Serif", Font.PLAIN, 15));
warning.setForeground(Color.RED);
this.add(warning);
}
private class FileButtonActionListener implements ActionListener {
@Override
/*
* Inicia o atributo da classe do tipo File
* passando o path do arquivo selecionado.
*/
public void actionPerformed(ActionEvent e) {
JFileChooser arquivo = new JFileChooser();
arquivo.setDialogTitle("Selecione o arquivo de chave privada");
int retorno = arquivo.showOpenDialog(null);
if(retorno == JFileChooser.APPROVE_OPTION){
caminhoArquivo = arquivo.getSelectedFile().getAbsolutePath();
pathLabel.setText(caminhoArquivo);
}
}
}
private class ConfirmButtonActionListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
// UNCOMMENT TO GENERATE PUB/PRV KEY
/*
try {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(1024);
KeyPair keyPair = keyPairGenerator.generateKeyPair();
System.out.println(Conversor.byteArrayToHexString(keyPair.getPublic().getEncoded()));
byte[] test = "lhlhlh".getBytes("UTF8");
SecureRandom secureRandom = new SecureRandom(test);
KeyGenerator keyGen = KeyGenerator.getInstance("DES");
keyGen.init(56, secureRandom);
Key key = keyGen.generateKey();
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] cipherText = cipher.doFinal(keyPair.getPrivate().getEncoded());
FileOutputStream fos = new FileOutputStream("C:\\Users\\Paulo\\workspace\\INF1416-G7-SecurityMaster\\LHTC.pvtkey");
fos.write(cipherText, 0, cipherText.length);
fos.flush();
fos.close();
} catch (NoSuchAlgorithmException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (NoSuchPaddingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (InvalidKeyException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IllegalBlockSizeException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (BadPaddingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
*/
// Reads binary file containing privateKey data - GOAL: get pvtKey bytes into memory
if(!caminhoArquivo.equals("")) {
byte[] pvtKeyEncryptedBytes = FileTool.readBytesFromFile(caminhoArquivo);
String passphrase = new String(secretText.getPassword());
try {
byte[] secureRandomSeed = passphrase.getBytes("UTF8");
SecureRandom secureRandom = new SecureRandom(secureRandomSeed);
KeyGenerator keyGen = KeyGenerator.getInstance("DES");
keyGen.init(56, secureRandom);
Key key = keyGen.generateKey();
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] pvtKeyBytes = cipher.doFinal(pvtKeyEncryptedBytes);
// Reads hexString of publicKey from DB - GOAL: get pblKey bytes into memory
dbUtils.connect();
String hexPublicKeyString = dbUtils.selectPublicKey(currentUser.getName());
dbUtils.disconnect();
byte[] pblKeyBytes = Conversor.hexStringToByteArray(hexPublicKeyString);
// Generates array of 512 random bytes
byte[] randomBytes = new byte[512];
new Random().nextBytes(randomBytes);
// Calls the Spec classes to create the keys' specs
PKCS8EncodedKeySpec pvtKeySpec = new PKCS8EncodedKeySpec(pvtKeyBytes);
X509EncodedKeySpec pblKeySpec = new X509EncodedKeySpec(pblKeyBytes);
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
PrivateKey pvtKey = keyFactory.generatePrivate(pvtKeySpec);
PublicKey pblKey = keyFactory.generatePublic(pblKeySpec);
currentUser.setPrivateKey(pvtKey);
// Sign the array of random bytes
Signature signature = Signature.getInstance("MD5WithRSA");
signature.initSign(pvtKey);
signature.update(randomBytes);
byte[] signedBytes = signature.sign();
// Verify the signature
signature.initVerify(pblKey);
signature.update(randomBytes);
controller = MainController.getMainControllerInstace();
String userName = currentUser.getName();
dbUtils.connect();
if (signature.verify(signedBytes)) {
dbUtils.logMessage(4003, userName);
dbUtils.logMessage(4002, userName);
dbUtils.setNumberOfAttempts(Integer.valueOf(0), userName, DBUtils.STATE_2);
dbUtils.incrementAccess(userName);
dbUtils.disconnect();
controller = MainController.getMainControllerInstace();
controller.setContentPane("next");
} else {
int numberOfAttempts = dbUtils.getNumberOfAttempts(userName, DBUtils.STATE_2);
numberOfAttempts++;
if(numberOfAttempts == 1) dbUtils.logMessage(4004, userName);
else if(numberOfAttempts == 2) dbUtils.logMessage(4005, userName);
else if(numberOfAttempts == 3) dbUtils.logMessage(4006, userName);
if(numberOfAttempts < 3) { //Se ainda não errou pela 3a vez
dbUtils.setNumberOfAttempts(numberOfAttempts, userName, DBUtils.STATE_2);
warning.setText("Senha errada. Número de tentativas: " + numberOfAttempts);
} else {
dbUtils.logMessage(4007, userName);
dbUtils.logMessage(4002, userName);
dbUtils.setNumberOfAttempts(0, userName, DBUtils.STATE_2);
dbUtils.blockUser(userName);
controller.restartAuthenticationContext();
}
}
dbUtils.disconnect();
} catch (NoSuchAlgorithmException e1) {
e1.printStackTrace();
} catch (InvalidKeySpecException e1) {
e1.printStackTrace();
} catch (InvalidKeyException e1) {
e1.printStackTrace();
} catch (SignatureException e1) {
e1.printStackTrace();
} catch (UnsupportedEncodingException e2) {
e2.printStackTrace();
} catch (NoSuchPaddingException e1) {
e1.printStackTrace();
} catch (IllegalBlockSizeException e1) {
e1.printStackTrace();
} catch (BadPaddingException e1) {
MainController controller = MainController.getMainControllerInstace();
User currentUser = controller.getCurrentUser();
String userName = currentUser.getName();
dbUtils.connect();
int numberOfAttempts = dbUtils.getNumberOfAttempts(userName, DBUtils.STATE_2);
numberOfAttempts++;
if(numberOfAttempts == 1) dbUtils.logMessage(4004, userName);
else if(numberOfAttempts == 2) dbUtils.logMessage(4005, userName);
else if(numberOfAttempts == 3) dbUtils.logMessage(4006, userName);
if(numberOfAttempts < 3) { //Se ainda não errou pela 3a vez
dbUtils.setNumberOfAttempts(numberOfAttempts, userName, DBUtils.STATE_2);
warning.setText("Senha errada. Número de tentativas: " + numberOfAttempts);
} else {
dbUtils.logMessage(4007, userName);
dbUtils.logMessage(4002, userName);
dbUtils.setNumberOfAttempts(0, userName, DBUtils.STATE_2);
dbUtils.blockUser(userName);
controller.restartAuthenticationContext();
}
}
}
}
}
}
|
[
"ph.alves@live.com"
] |
ph.alves@live.com
|
c9ce7e93cceb46ecba95537425b9c012b01c7f35
|
970bfa533bd3da0598575fe2133feee728d639d5
|
/src/main/java/com/springboottest/demo/controller/UserController.java
|
d0124642a5d3f1b6ab9974f6126e9a11342b3107
|
[] |
no_license
|
ubeleus77/new3.1.3
|
6c6c1e59f39a2bc9a6292f703b7b28ed9010f6ab
|
774e55cb3e6bbc2060ca8634bba18a21d489898a
|
refs/heads/master
| 2023-06-25T07:19:02.070606
| 2021-07-23T14:27:55
| 2021-07-23T14:27:55
| 388,827,939
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,297
|
java
|
package com.springboottest.demo.controller;
import com.springboottest.demo.entity.User;
import com.springboottest.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class UserController {
private final UserService userService;
@Autowired
public UserController(UserService userService) {
this.userService = userService;
}
@GetMapping("")
public String index() {
return "redirect:/user";
}
@GetMapping("/login")
public String login() {
return "login";
}
@GetMapping("/user")
public String showProfile(Model model,
Authentication aut) {
User user = userService.getUserByEmail(aut.getName());
model.addAttribute("user", user);
return "user";
}
@GetMapping("/admin")
public String admin(Model model,
Authentication aut) {
User user = userService.getUserByEmail(aut.getName());
model.addAttribute("userAuthentication", user);
return "show";
}
}
|
[
"ubeleus7@gmail.com"
] |
ubeleus7@gmail.com
|
d1db78a9b2fd1256b7a99bfe93e59ec86a9e087a
|
bcdfb35b55705bf2fbeb605641910a575e46255d
|
/src/test/java/ww/RunningFeatureFile.java
|
cdb90468b228f56ff96f290c543ef84c87b69370
|
[] |
no_license
|
ahmed1102003/WWProjectQ123
|
d3f98130fa4b92e9c432b9a39c17a6bac5833cc7
|
2e5c18222bef0c80ab82a8f3378235f4a4164237
|
refs/heads/master
| 2020-04-01T05:01:28.912683
| 2018-10-13T15:51:35
| 2018-10-13T15:51:35
| 152,886,905
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 420
|
java
|
package ww;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.*;
@RunWith(Cucumber.class)
@CucumberOptions(format = { "pretty", "html:target/test-report", "json:target/test-report.json",
"junit:target/test-report.xml" }, features = {
// this for login page
"src/test/BDD/Testing_Valid_Zipcode_search_result.feature",
})
public class RunningFeatureFile {
}
|
[
"ahmed1102003@yahoo.com"
] |
ahmed1102003@yahoo.com
|
28da2551df4b15a4f65ccc6f545e366c1817e2ea
|
3462c74ccd7968006046e27f4c9f857238fc69c5
|
/app/src/main/java/com/example/dima/demomaps/CallDialog.java
|
ea699aa69a3b4208399b30ed095f1c18dfd282c1
|
[] |
no_license
|
dimitrtrifonov/DemoMaps
|
0f30b789b684c9fce689614bf8304d9ae771ab3d
|
9b03b0286b4226406c77531a87c22dd9c51ce69b
|
refs/heads/master
| 2021-01-22T03:13:58.781277
| 2015-09-13T20:11:19
| 2015-09-13T20:11:19
| 42,403,691
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,170
|
java
|
package com.example.dima.demomaps;
import android.app.AlertDialog;
import android.app.Dialog;
import android.support.v4.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
/**
* Created by Dima on 9/11/2015.
*/
public class CallDialog extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the Builder class for convenient dialog construction
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setMessage(getArguments().get("dialog").toString())
.setNeutralButton(R.string.ok, new DialogInterface.OnClickListener() {
boolean isClicked = false;
public void onClick(DialogInterface dialog, int id) {
//NoInternetConnectionDialog.this.isButtonClicked();
getActivity().finish();
}
});
// Create the AlertDialog object and return it
return builder.create();
}
}
|
[
"dimitr.trifonov@gmail.com"
] |
dimitr.trifonov@gmail.com
|
1565fed9d2b3f5655c9f80e18eebc8e2d61d0e78
|
8beda19bbd1581e55c6ef5a2523d2aecf6654be7
|
/src/main/java/org/codexio/rentacar/service/RentService.java
|
da9b395022a37eba65739fa87587253ce78ad704
|
[
"Unlicense"
] |
permissive
|
team-emy/RentACar
|
5d62b69d4744d0ee7451aa1e0b1f29cd218e87ad
|
95f7fb9637325952f5941dab322ea12ef648de0e
|
refs/heads/master
| 2020-06-01T01:31:29.039778
| 2019-06-15T22:09:52
| 2019-06-15T22:09:52
| 190,577,020
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 400
|
java
|
package org.codexio.rentacar.service;
import org.codexio.rentacar.domain.models.service.RentServiceModel;
import java.util.List;
public interface RentService {
RentServiceModel createRent(RentServiceModel rentServiceModel, String carId, String username);
List<RentServiceModel> findAllMyRents(String myUsername);
List<RentServiceModel> getRentsByMe(String myUsername);
}
|
[
"emkata_87@mail.bg"
] |
emkata_87@mail.bg
|
4fb08c2d7563b839d66d386a3ba12ca857e4eb17
|
8269336103b274000bb0bf4f05c779dac3c461a6
|
/INF111-TP2-Groupe37/NotationUS.java
|
1b6c096562f898f16403486f8cf57f86bc959286
|
[] |
no_license
|
beto984/INF111
|
90d3288209d2a42674fd8092ad3bccd5829f2245
|
59de46d233daae43869e5cdcfb789ffac048997d
|
refs/heads/master
| 2020-12-20T08:25:34.164897
| 2020-04-16T14:58:54
| 2020-04-16T14:58:54
| 236,014,543
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,542
|
java
|
/**
* @Author : Frédéric Boulanger
* Supelec - Département Informatique
* 3 rue Joliot-Curie
* 91192 Gif-sur-Yvette cedex, France
*
* frederic.boulanger@supelec.fr
*
* @Adapation norme inf111 : Pierre Bélisle
* @version : Hiver 2020
**/
/**
* La notation US représente les notes par une lettre :
* A = la
* B = si
* C = do
* D = ré
* E = mi
* F = fa
* G = sol
*
* Un bémol est indiqué par un 'b' placé après la note.
* Un dièse est indiqué par un '#' placé après la note.
*
* L'octave dans laquelle se trouve la note est indiquée
* par un chiffre situé après le nom de la note.
*
* Les changements d'octave se font sur la note do.
* Le do situé une ligne en-dessous de la clef de sol est noté "C4"
* et "B4" désigne le si situé sur la 3e ligne de la clef de sol.
*
* Le do qui se situe juste au dessus est noté "C5".
* Ainsi, "C2" désigne le do grave du violoncelle, situé sur
* la deuxième ligne en-dessous de la clef de fa, alors
* que "Eb6" désigne le mi bémol aigu situé sur la 3e ligne
* au-dessus de la clef de sol.
*
* Ces numéros d'octave débutent à 0, "C0" étant la note
* la plus grave pouvant étre représentée. Ils sont supérieurs
* d'une unité aux numéros d'octave de la notation française, qui
* utilise le numéro -1 pour l'octave la plus grave.
*/
class NotationUS {
// Valeur d'un demi-ton = 1/12 d'octave.
private static final double demiton_ = Math.pow(2, 1.0/12); // racine 12e de 2
// Fréquence du la4
private final double diapason_;
// Fréquence du do "du milieu"
private final double C4_;
/**
* Crée une nouvelle notation US avec diapason
* comme fréquence de la note "A4" (2e interligne de la clef de sol).
*
* @param diapason est la fréquence en Hertz du la du 2e interligne
* de la clef de sol.
*/
public NotationUS(double diapason) {
diapason_ = diapason;
// On détermine la fréquence du do qui est à
// une tierce (3 demi-tons) moins une octave de la note.
C4_ = diapason_ * Math.pow(demiton_, 3) / 2;
}
/**
* Détermine la fréquence d'une note notée en ABC.
*/
public double frequence(String note) {
// On commence par déterminer à combien de demi-tons
// du do C4 se trouve la note.
int offsetC = 0;
try {
offsetC = demiTonsDo(note);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
double freq = C4_;
if (offsetC > 0) {
// Si la note est au-dessus.
while (offsetC >= 12) {
// On multiplie sa fréquence par 2 pour chaque octave.
freq *= 2;
offsetC -= 12;
}
while (offsetC > 0) {
// Puis on la multiplie par 1/12 d'octave pour chaque demi-ton.
freq *= demiton_;
offsetC --;
}
} else if (offsetC < 0) {
// Si la note est en-dessous du do, on fait l'inverse.
while (offsetC <= -12) {
freq /= 2;
offsetC += 12;
}
while (offsetC < 0) {
freq /= demiton_;
offsetC ++;
}
}
return freq;
}
/**
* Détermine à combien de demi-tons du do C4 se trouve
* une note notée en ABC.
*/
private int demiTonsDo(String note) {
int offsetC = 0;
int idx = 0;
while (idx < note.length()) {
switch (note.charAt(idx)) {
case 'b' : // bémol
offsetC --;
break;
case '#' : // dièze
offsetC ++;
break;
case 'C' :
break;
case 'D' :
offsetC += 2;
break;
case 'E' :
offsetC += 4;
break;
case 'F' :
offsetC += 5;
break;
case 'G' :
offsetC += 7;
break;
case 'A' :
offsetC += 9;
break;
case 'B' :
offsetC += 11;
break;
default:
if (!Character.isDigit(note.charAt(idx))) {
throw new Error("Symbole invalide dans un nom de note" + note);
}
// On trouve le numéro d'octave.
int i = Integer.parseInt("" + note.charAt(idx));
// Notre octave de référence est l'octave 4,
// et il y a 12 demi-tons par octave.
offsetC += (i - 4) * 12;
}
idx++;
}
return offsetC;
}
}
|
[
"beto984@gmail.com"
] |
beto984@gmail.com
|
fb9ced6d1be8fa0fb0dcf2834b381e26d56de734
|
2dc55280583e54cd3745fad4145eb7a0712eb503
|
/stardust-engine-base/src/main/java/org/eclipse/stardust/common/EqualPredicate.java
|
d6f6cc8a04d145e1c33d111b9d29cae7a4d31037
|
[] |
no_license
|
markus512/stardust.engine
|
9d5f4fd7016a38c5b3a1fe09cc7a445c00a31b57
|
76e0b326446e440468b4ab54cfb8e26a6403f7d8
|
refs/heads/master
| 2022-02-06T23:03:21.305045
| 2016-03-09T14:56:01
| 2016-03-09T14:56:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,203
|
java
|
/*******************************************************************************
* Copyright (c) 2015 SunGard CSA LLC and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* SunGard CSA LLC - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.stardust.common;
/**
* This predicate accepts all elements which are equal to fixed value.
*
* @author Stephan.Born
*
* @param <E>
*/
public class EqualPredicate<E> implements Predicate<E>
{
private final E value;
/**
* Constructs predicate which accepts all elements which are equal to given value.
*
* @param value value to compare elements with
*/
public EqualPredicate(E value)
{
if (value == null)
{
new IllegalArgumentException();
}
this.value = value;
}
@Override
public boolean accept(E o)
{
return value.equals(o);
}
}
|
[
"stephan.born@sungard.com"
] |
stephan.born@sungard.com
|
3d2553be5e308c23e4c87ea61cdf43bdba8d5627
|
e3507573a9540a3c55c282084ffc3f0ad0425778
|
/Food/src/main/java/com/rest/food/model/repository/ISedeRepository.java
|
a7f839290e247f20fc407f5cf9e89be3090f7a2c
|
[] |
no_license
|
DUNKE28/Open_Source
|
f43486a007a5f5605cf0b4134848b0bb21547f23
|
558cafa64b2f15c4d7419fdc379375dc3d9cd1ca
|
refs/heads/master
| 2020-05-18T21:18:26.640282
| 2019-06-30T20:25:06
| 2019-06-30T20:25:06
| 184,656,790
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 214
|
java
|
package com.rest.food.model.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.rest.food.model.Sede;
public interface ISedeRepository extends JpaRepository<Sede, Integer> {
}
|
[
"rodolfoarias449@gmail.com"
] |
rodolfoarias449@gmail.com
|
7b1c6db983435c7fd38afd16e5d03282a6d18088
|
5539c9f8201770b21ce301a6b4fba5dc9e405f95
|
/app/src/main/java/com/bynry/courseoneapp/Fragments/CollectionFragment.java
|
e68e8c04109ae79dcd9d364af682a6691ec90899
|
[] |
no_license
|
salonimonde/CourseOneApp
|
042483d9f78316f64985a922178d717f14b4d0c7
|
b3060b3ed52498f7b8a0a81d3a4e4f32dddb8123
|
refs/heads/master
| 2022-11-28T05:37:25.624253
| 2020-08-04T13:41:38
| 2020-08-04T13:41:38
| 283,747,328
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,359
|
java
|
package com.bynry.courseoneapp.Fragments;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bynry.courseoneapp.Adapters.PhotosAdapter;
import com.bynry.courseoneapp.Models.Collection;
import com.bynry.courseoneapp.Models.Photo;
import com.bynry.courseoneapp.R;
import com.bynry.courseoneapp.Utils.GlideApp;
import com.bynry.courseoneapp.Webservices.ApiInterface;
import com.bynry.courseoneapp.Webservices.ServiceGenerator;
import org.w3c.dom.Text;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import de.hdodenhof.circleimageview.CircleImageView;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class CollectionFragment extends Fragment {
private final String TAG = CollectionFragment.class.getSimpleName();
@BindView(R.id.fragment_collection_username)
TextView username;
@BindView(R.id.fragment_collection_description)
TextView description;
@BindView(R.id.fragment_collection_user_avatar)
CircleImageView userAvatar;
@BindView(R.id.fragment_collection_title)
TextView title;
@BindView(R.id.fragment_collection_progress_bar)
ProgressBar progressBar;
@BindView(R.id.fragment_collection_recycler_view)
RecyclerView recyclerView;
private List<Photo> photos = new ArrayList<>();
private PhotosAdapter photosAdapter;
private Unbinder unbinder;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_collection, container, false);
unbinder = ButterKnife.bind(this, view);
//RecyclerView
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(linearLayoutManager);
photosAdapter = new PhotosAdapter(getActivity(), photos);
recyclerView.setAdapter(photosAdapter);
Bundle bundle = getArguments();
int collectionId = bundle.getInt("collectionId");
showProgressBar(true);
getInformationOfCollection(collectionId);
getPhotosOfCollection(collectionId);
return view;
}
private void getInformationOfCollection(int collectionId) {
ApiInterface apiInterface = ServiceGenerator.createService(ApiInterface.class);
Call<Collection> call = apiInterface.getInformationOfCollection(collectionId);
call.enqueue(new Callback<Collection>() {
@Override
public void onResponse(Call<Collection> call, Response<Collection> response) {
if (response.isSuccessful()) {
Collection collection = response.body();
title.setText(collection.getTitle());
description.setText(collection.getDescription());
username.setText(collection.getUser().getUserName());
GlideApp.with(getActivity())
.load(collection.getUser().getProfileImage().getSmall())
.into(userAvatar);
} else {
Log.d(TAG, "Fail " + response.message());
}
showProgressBar(false);
}
@Override
public void onFailure(Call<Collection> call, Throwable t) {
Log.d(TAG, "Fail " + t.getMessage());
showProgressBar(false);
}
});
}
private void getPhotosOfCollection(int collectionId) {
ApiInterface apiInterface = ServiceGenerator.createService(ApiInterface.class);
Call<List<Photo>> call = apiInterface.getPhotosOfCollection(collectionId);
call.enqueue(new Callback<List<Photo>>() {
@Override
public void onResponse(Call<List<Photo>> call, Response<List<Photo>> response) {
if (response.isSuccessful()) {
photos.addAll(response.body());
photosAdapter.notifyDataSetChanged();
} else {
Log.d(TAG, "Fail " + response.message());
}
showProgressBar(false);
}
@Override
public void onFailure(Call<List<Photo>> call, Throwable t) {
Log.d(TAG, "Fail " + t.getMessage());
showProgressBar(false);
}
});
}
private void showProgressBar(boolean isShowing) {
if (isShowing) {
progressBar.setVisibility(View.VISIBLE);
recyclerView.setVisibility(View.GONE);
} else {
progressBar.setVisibility(View.GONE);
recyclerView.setVisibility(View.VISIBLE);
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}
|
[
"saloni.monde@bynry.com"
] |
saloni.monde@bynry.com
|
6f77a2835d928dd3009a02d6db270c01a661b939
|
de172a962990d068dd340b01b9e1aa75e700e17e
|
/src/test/java/pageobjects/BasePage.java
|
be740ca3350016e790454937b943707f15bf67b4
|
[] |
no_license
|
barisgul/SeleniumTestNG
|
bd1ecf816b4a11e1b0718475f538f4341ff25bdf
|
ddc440b284e55717f553a32ac94d299408f5795e
|
refs/heads/master
| 2023-05-14T09:51:22.207703
| 2019-11-18T20:05:31
| 2019-11-18T20:05:31
| 222,310,921
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 253
|
java
|
package pageobjects;
import org.openqa.selenium.WebDriver;
public abstract class BasePage {
public static WebDriver driver;
public static boolean result;
public BasePage(WebDriver driver) {
BasePage.driver=driver;
BasePage.result=true;
}
}
|
[
"bariss.gull@gmail.com"
] |
bariss.gull@gmail.com
|
ce2f8dbc9a0f2d59e06226e86449ff66a5375fb8
|
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
|
/src/chosun/ciis/se/boi/rec/SE_BOI_2700_MPART_CDCURRecord.java
|
01ebb890c31f4b141ffc95e43d2a4f4e06aa78cd
|
[] |
no_license
|
nosmoon/misdevteam
|
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
|
1829d5bd489eb6dd307ca244f0e183a31a1de773
|
refs/heads/master
| 2020-04-15T15:57:05.480056
| 2019-01-10T01:12:01
| 2019-01-10T01:12:01
| 164,812,547
| 1
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 1,414
|
java
|
/***************************************************************************************************
* 파일명 : .java
* 기능 :
* 작성일자 :
* 작성자 : 심정보
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.se.boi.rec;
import java.sql.*;
import chosun.ciis.se.boi.dm.*;
import chosun.ciis.se.boi.ds.*;
/**
*
*/
public class SE_BOI_2700_MPART_CDCURRecord extends java.lang.Object implements java.io.Serializable{
public String dept_cd;
public String dept_nm;
public String supr_dept_cd;
public SE_BOI_2700_MPART_CDCURRecord(){}
public void setDept_cd(String dept_cd){
this.dept_cd = dept_cd;
}
public void setDept_nm(String dept_nm){
this.dept_nm = dept_nm;
}
public void setSupr_dept_cd(String supr_dept_cd){
this.supr_dept_cd = supr_dept_cd;
}
public String getDept_cd(){
return this.dept_cd;
}
public String getDept_nm(){
return this.dept_nm;
}
public String getSupr_dept_cd(){
return this.supr_dept_cd;
}
}
/* 작성시간 : Tue Dec 02 19:46:24 KST 2014 */
|
[
"DLCOM000@172.16.30.11"
] |
DLCOM000@172.16.30.11
|
e7a7639fb3d93bd874d4f3eb656588810d955bc3
|
bd0087722fb801dc7726aa4c66eaeeed01ba7d1b
|
/src/main/java/DTOs/schedule/ScheduleDTO.java
|
21d57f9f1331130e398ea6cd123537044ae8d17f
|
[] |
no_license
|
timmyly7/TIC2002
|
4fb1a67c4cfd8b038ae6f50b62d6a548611faea5
|
ae0843c2164f7c6c86a037fd86ca8cf78e799f57
|
refs/heads/master
| 2020-04-02T06:30:23.043730
| 2018-11-12T11:15:44
| 2018-11-12T11:15:44
| 154,153,231
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,529
|
java
|
package DTOs.schedule;
import DTOs.Constant;
import java.text.SimpleDateFormat;
import java.util.Date;
public class ScheduleDTO extends TaskDTO {
private Date startDatetime;
private Date endDatetime;
public Date getStartDatetime() {
return startDatetime;
}
public void setStartDatetime(Date startDatetime) {
this.startDatetime = startDatetime;
}
public Date getEndDatetime() {
return endDatetime;
}
public void setEndDatetime(Date endDatetime) {
this.endDatetime = endDatetime;
}
public ScheduleDTO(Integer id, String description, Integer status, Date startDatetime, Date endDatetime) {
super(id, description, status);
this.startDatetime = startDatetime;
this.endDatetime = endDatetime;
}
public ScheduleDTO(Date startDatetime, Date endDatetime) {
this.startDatetime = startDatetime;
this.endDatetime = endDatetime;
}
public ScheduleDTO() {
}
@Override
public String toString() {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd MMM yyyy hh:mm");
String message = "Schedule Event " +getId()+" --> Description : "+getDescription()+
" start at " + simpleDateFormat.format(startDatetime) +
", end at =" + simpleDateFormat.format(endDatetime);
if (endDatetime.before(new Date())){
message = Constant.ANSI_YELLOW+message+" This event is already over.";
};
return message;
}
}
|
[
"walkawayly@gmail.com"
] |
walkawayly@gmail.com
|
3987341ed4b207d9b23fd06ea254364b0a977887
|
9efa74cbf54f6c0a10105d2fd19d84ed1d65344e
|
/app/src/main/java/com/animationexample/rocketlaunch/animationactivities/RotateRocket.java
|
49d3dd888555fe6e7679d6a69155028e7fc7b1e6
|
[
"Apache-2.0"
] |
permissive
|
nazmulidris/animationexample
|
8804dac34c18ed99e63496532595095f02f23a02
|
c52e64c0dcf6bbefd87b78a7a750618705af48df
|
refs/heads/master
| 2021-09-28T17:51:13.779045
| 2018-11-19T00:44:41
| 2018-11-19T00:44:41
| 106,748,257
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,450
|
java
|
/*
* Copyright 2017 Nazmul Idris. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.animationexample.rocketlaunch.animationactivities;
import android.animation.ValueAnimator;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
public class RotateRocket extends BaseAnimationActivity {
@Override
protected void onStartAnimation() {
ValueAnimator animator = ValueAnimator.ofFloat(0, 360);
animator.addUpdateListener(
valueAnimator -> {
float rotationValue = (float) animator.getAnimatedValue();
mRocket.setRotation(rotationValue);
});
animator.setInterpolator(new FastOutSlowInInterpolator());
animator.setDuration(DEFAULT_ANIMATION_DURATION);
animator.start();
}
protected String getDisplayMessage() {
return "FastOutSlowInInterpolator";
}
}
|
[
"nazmul@google.com"
] |
nazmul@google.com
|
59e4088b2ae42ee15a2b469fb86806fb0fd940f3
|
4b4df51041551c9a855468ddf1d5004a988f59a2
|
/data_structure/java/dict.java
|
5d5b4dc883fd93c4741106a5f52519840135bd4f
|
[] |
no_license
|
yennanliu/CS_basics
|
99b7ad3ef6817f04881d6a1993ec634f81525596
|
035ef08434fa1ca781a6fb2f9eed3538b7d20c02
|
refs/heads/master
| 2023-09-03T13:42:26.611712
| 2023-09-03T12:46:08
| 2023-09-03T12:46:08
| 66,194,791
| 64
| 40
| null | 2022-08-20T09:44:48
| 2016-08-21T11:11:35
|
Python
|
UTF-8
|
Java
| false
| false
| 1,201
|
java
|
import java.util.*;
public class Dict {
public static void main(String[] args)
{
// Initializing a Dictionary
Dictionary geek = new Hashtable();
// put() method
geek.put("123", "Code");
geek.put("456", "Program");
// elements() method :
for (Enumeration i = geek.elements(); i.hasMoreElements();)
{
System.out.println("Value in Dictionary : " + i.nextElement());
}
// get() method :
System.out.println("\nValue at key = 6 : " + geek.get("6"));
System.out.println("Value at key = 456 : " + geek.get("123"));
// isEmpty() method :
System.out.println("\nThere is no key-value pair : " + geek.isEmpty() + "\n");
// keys() method :
for (Enumeration k = geek.keys(); k.hasMoreElements();)
{
System.out.println("Keys in Dictionary : " + k.nextElement());
}
// remove() method :
System.out.println("\nRemove : " + geek.remove("123"));
System.out.println("Check the value of removed key : " + geek.get("123"));
System.out.println("\nSize of Dictionary : " + geek.size());
}
}
|
[
"f339339@gmail.com"
] |
f339339@gmail.com
|
926ca2b7929d901ef3f226aeddf310ba21b9d569
|
fca96c217bfe7020f1b2ce85b81fa578476ee78e
|
/ifs-resources/src/test/java/org/innovateuk/ifs/finance/resource/cost/LabourCostTest.java
|
0d4d06e0931c7ed6e460649404a3cdacc99b0f21
|
[
"MIT"
] |
permissive
|
NunoAlexandre/innovation-funding-service
|
63171de2778b38aa52eb4edc3ae3574a01ff950d
|
d55dc49ea3b101598453e319ffda8896fff78aef
|
refs/heads/development
| 2021-07-09T10:10:05.683114
| 2017-10-06T15:04:48
| 2017-10-06T15:04:48
| 106,114,984
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,350
|
java
|
package org.innovateuk.ifs.finance.resource.cost;
import org.innovateuk.ifs.finance.resource.cost.LabourCost;
import org.junit.Before;
import org.junit.Test;
import java.math.BigDecimal;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
public class LabourCostTest {
LabourCost labourCost;
private Long id;
private String key;
private String role;
private BigDecimal grossAnnualSalary;
private Integer labourDays;
private String description;
@Before
public void setUp() throws Exception {
id = 0L;
key = "Labour";
role = "Manager";
grossAnnualSalary = new BigDecimal(50000);
labourDays = new Integer(168);
description = "";
labourCost = new LabourCost(id, key, role, grossAnnualSalary, labourDays, description);
}
@Test
public void labourCostShouldReturnCorrectBaseAttributesTest() throws Exception {
assert(labourCost.getId().equals(id));
assert(labourCost.getRole().equals(role));
assert(labourCost.getGrossAnnualSalary().equals(grossAnnualSalary));
assert(labourCost.getLabourDays().equals(labourDays));
assert(labourCost.getDescription().equals(description));
}
@Test
public void getRateTest() throws Exception {
Integer workingDaysPerYear = new Integer(232);
BigDecimal ratePerDay = labourCost.getRate(workingDaysPerYear);
BigDecimal expected = new BigDecimal(215.51724).setScale(5, BigDecimal.ROUND_HALF_EVEN);
assertEquals(expected, ratePerDay);
}
@Test
public void rateNullLabourDaysTest() throws Exception {
Integer workingDaysPerYear = null;
BigDecimal ratePerDay = labourCost.getRate(workingDaysPerYear);
assertNull(ratePerDay);
}
@Test
public void rateWithDivisionByZeroLabourDaysTest() throws Exception {
int workingDaysPerYear = 0;
BigDecimal ratePerDay = labourCost.getRate(workingDaysPerYear);
assertEquals(BigDecimal.ZERO, ratePerDay);
}
@Test
public void getRateWithoutGrossAnnualSalaryTest() throws Exception {
int workingDaysPerYear = 50;
labourCost.setGrossAnnualSalary(BigDecimal.ZERO);
BigDecimal ratePerDay = labourCost.getRate(workingDaysPerYear);
assertEquals(labourCost.getRate(), ratePerDay);
}
@Test
public void getLabourCostTotalTest() throws Exception {
Integer workingDaysPerYear = new Integer(232);
BigDecimal totalLabourCost = labourCost.getTotal(workingDaysPerYear);
BigDecimal expected = new BigDecimal(36206.89632).setScale(5, BigDecimal.ROUND_HALF_EVEN);
BigDecimal totalStoredLabourCost = labourCost.getTotal();
assertEquals(expected, totalLabourCost);
assertEquals(expected, totalStoredLabourCost);
}
@Test
public void getLabourCostTotalWithoutLabourDaysTest() throws Exception {
Integer workingDaysPerYear = new Integer(232);
labourCost.setLabourDays(null);
BigDecimal totalLabourCost = labourCost.getTotal(workingDaysPerYear);
assertEquals(BigDecimal.ZERO, totalLabourCost);
}
@Test
public void setRoleTest() throws Exception {
labourCost.setRole("Developer");
assertEquals("Developer", labourCost.getRole());
}
}
|
[
"rderegt@worthit.nl"
] |
rderegt@worthit.nl
|
ea66269ccd099e309f686fd0bf6658cfd157be1d
|
3c863b8bb0ff824777c4f46576f0aae4b13cc96f
|
/TestandoFor.java
|
fffd5b0492fa7f92bb7db4f111d1f756a084e291
|
[] |
no_license
|
adrianovp/java_19
|
3bf718d1a9ceded882dbac8ad3dd040b260e1d53
|
27809788ad1bc8edafa21f04c3814f164472c060
|
refs/heads/master
| 2023-05-12T01:24:24.267082
| 2021-05-26T15:15:54
| 2021-05-26T15:15:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 216
|
java
|
public class TestandoFor{
public static void main(String args[]){
for (int valor = 1; valor <= 10 ; valor = valor + 1 ){
System.out.println("valor = "+valor);
}
}
}
|
[
"isidro@professorisidro.com.br"
] |
isidro@professorisidro.com.br
|
858e5c2e7ec8a1aeae1168b378b6aa03d6a7344f
|
b7fb0e384c4c8eee1ca037e2092e5a8dc0657aba
|
/dynamicreport.parent/dynamicreport.report.provider/src/main/java/com/lakala/dynamicreport/report/controller/CfgParamController.java
|
b84ff07538b7bb9f391455f50d56f54512f0e938
|
[] |
no_license
|
lklfintech/dynamicreport
|
65f7079f58cabb6595d59d82b3b4a4f734bcc3c1
|
850863209632e86d6568563135b05cc1e34df2a1
|
refs/heads/master
| 2022-11-21T01:05:53.599161
| 2020-06-10T09:02:52
| 2020-06-10T09:02:52
| 221,116,295
| 1
| 1
| null | 2022-11-15T23:37:17
| 2019-11-12T02:52:18
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 7,944
|
java
|
/*
* Copyright (c) 2019-2021, LaKaLa.
* <p>
* 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
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.lakala.dynamicreport.report.controller;
import com.lakala.dynamicreport.common.constants.StatusConstants;
import com.lakala.dynamicreport.common.controller.BaseController;
import com.lakala.dynamicreport.common.model.PageBean;
import com.lakala.dynamicreport.common.model.ResultJson;
import com.lakala.dynamicreport.report.model.CfgComponentType;
import com.lakala.dynamicreport.report.model.CfgPageParam;
import com.lakala.dynamicreport.report.model.CfgParam;
import com.lakala.dynamicreport.report.query.CfgPageParamQuery;
import com.lakala.dynamicreport.report.query.CfgParamQuery;
import com.lakala.dynamicreport.report.service.ICfgComponentTypeService;
import com.lakala.dynamicreport.report.service.ICfgPageParamService;
import com.lakala.dynamicreport.report.service.ICfgParamService;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Collections;
import java.util.List;
/**
* <p>
* 报表参数controller
* </p>
*
* @author lkl金融
* @since 2019-09-16
*/
@RestController
@RequestMapping("/cfg/param")
@Api(tags = "报表参数管理",description = "报表参数控制器(CfgParamController)")
public class CfgParamController extends BaseController {
private final Logger log = LoggerFactory.getLogger(CfgParamController.class);
@Autowired
private ICfgParamService cfgParamService;
@Autowired
private ICfgComponentTypeService cfgComponentTypeService;
@Autowired
private ICfgPageParamService cfgPageParamService;
@ApiOperation(value = "分页")
@RequiresPermissions("cfgParam:query")
@GetMapping(value = "/list")
public PageBean<CfgParam> list(@ApiParam(name = "query",value = "报表参数查询对象",required = true) CfgParamQuery query) {
PageBean<CfgParam> pb = new PageBean<>();
Page<CfgParam> page = cfgParamService.findCfgParamCriteria(query);
pb.setRowsCount(page.getTotalElements());
pb.setPageTotal(page.getTotalPages());
pb.setData(page.getContent());
return pb;
}
@ApiOperation(value = "查询所有数据")
@RequiresPermissions("cfgParam:query")
@GetMapping(value = "/list-all")
public List<CfgParam> listAll(@ApiParam(name = "query",value = "报表参数查询对象",required = true) CfgParamQuery query) {
return cfgParamService.findCfgParam(query);
}
@ApiOperation(value = "查询单条数据")
@RequiresPermissions("cfgParam:query")
@ApiImplicitParams({
@ApiImplicitParam(name = "id",value = "数据主键",paramType = "path",dataType="String",required = true)
})
@GetMapping(value = "/list/{id}")
public CfgParam getOne(@PathVariable String id ) {
return cfgParamService.findOne(id);
}
@ApiOperation(value = "保存数据")
@RequiresPermissions("cfgParam:saveOrUpdate")
@PostMapping(value = "/save")
public ResultJson save(@ApiParam(name = "cfgParam",value = "报表参数对象",required = true) CfgParam cfgParam,
HttpServletRequest request) {
// 保存
try {
if(cfgParam.getType()==null||cfgParam.getType().getId()==null){
cfgParam.setType(null);
}else{
CfgComponentType cfgComponentType = cfgComponentTypeService.findOne(cfgParam.getType().getId());
cfgParam.setType(cfgComponentType);
}
cfgParamService.save(cfgParam);
return success("保存成功");
} catch (Exception e) {
log.error("保存失败", e);
return failure("保存失败" + e.getMessage(),e);
}
}
@ApiOperation(value = "删除数据")
@RequiresPermissions("cfgParam:delete")
@ApiImplicitParams({
@ApiImplicitParam(name = "id",value = "报表参数ID",paramType = "path",required = true)
})
@DeleteMapping(value = "/{id}")
public ResultJson delete(@PathVariable String id) {
try {
cfgParamService.batchDelete(id);
return success("刪除成功");
} catch (Exception e) {
log.error("刪除失败", e);
return failure("刪除失败" + e.getMessage(), e);
}
}
@ApiOperation(value = "更新数据")
@RequiresPermissions("cfgParam:saveOrUpdate")
@PutMapping(value = "/update")
public ResultJson update(@ApiParam(name = "cfgParam",value = "报表参数对象",required = true) CfgParam cfgParam,
HttpServletRequest request) {
try {
CfgParam updateObj=cfgParamService.findOne(cfgParam.getId());
if(cfgParam.getType()==null||cfgParam.getType().getId()==null){
updateObj.setType(null);
}else{
CfgComponentType cfgComponentType = cfgComponentTypeService.findOne(cfgParam.getType().getId());
updateObj.setType(cfgComponentType);
}
updateObj.setName(cfgParam.getName());
updateObj.setParamName(cfgParam.getParamName());
updateObj.setLabel(cfgParam.getLabel());
updateObj.setLen(cfgParam.getLen());
updateObj.setFormat(cfgParam.getFormat());
updateObj.setRequired(cfgParam.getRequired());
if(cfgParam.getDataList()!=null&&cfgParam.getDataList().getId()!=null){
updateObj.setDataList(cfgParam.getDataList());
}else{
updateObj.setDataList(null);
}
updateObj.setStatus(cfgParam.getStatus());
cfgParamService.update(updateObj);
return success("更新成功");
} catch (Exception e) {
log.error("更新失败", e);
return failure("更新失败" + e.getMessage());
}
}
@ApiOperation(value = "报表关联多个参数")
@RequiresPermissions("cfgPage:relateParam")
@ApiImplicitParams({
@ApiImplicitParam(name = "id",value = "报表参数ID",required = true),
@ApiImplicitParam(name = "ids",value = "页面参数ids",required = true),
@ApiImplicitParam(name = "vos",value = "页面对象字符串",required = true),
@ApiImplicitParam(name = "allIds",value = "新的关联页面",required = true)
})
@PostMapping(value = "/save-params")
public ResultJson saveParams(String id, String ids,String vos, String allIds) {
try {
cfgPageParamService.save(id, ids,vos, allIds);
return success("报表关联参数成功");
} catch (Exception e) {
log.error("[CfgParamController : saveParams]" + "id:" + id + "ids:" + ids, e);
return failure("更新失败" + e.getMessage());
}
}
@ApiOperation(value = "查询报表关联多个参数")
@GetMapping(value = "/realte-param")
public List<CfgParam> queryRealteParam(@ApiParam(name = "cfgParamQuery",value = "报表参数查询对象",required = true) CfgParamQuery cfgParamQuery) {
cfgParamQuery.setStatus(StatusConstants.ACTIVE);
List<CfgParam> cfgParams = cfgParamService.findCfgParam(cfgParamQuery);
// 设置参数是否已选择及参数默认值
CfgPageParamQuery cfgPageParamQuery = new CfgPageParamQuery();
cfgPageParamQuery.setPage(cfgParamQuery.getPage());
List<CfgPageParam> cfgPageParams = cfgPageParamService.findCfgPageParam(cfgPageParamQuery);
for (CfgParam cfgParam : cfgParams) {
for (CfgPageParam cfgPageParam : cfgPageParams) {
if (cfgParam.getId().equals(cfgPageParam.getParam().getId())) {
cfgParam.setSelected(true);
cfgParam.setParamValue(cfgPageParam.getParamValue());
cfgParam.setSequence(cfgPageParam.getSequence());
break;
}
}
}
Collections.sort(cfgParams);
return cfgParams;
}
}
|
[
"liuyang_sz@lakala.com"
] |
liuyang_sz@lakala.com
|
70f4ba1351fe759b9151b025e352838be55a881e
|
b259e5630cb47110ecabba7c54232e3a7d279a71
|
/src/main/java/cn/tongyouhui/control/service/ControlService.java
|
8d4b4106a988f386ed3cd430004eb8a1b2d89272
|
[] |
no_license
|
ZHENGJerry/tyhdistributor
|
b0838393cd45f9718d70ad1d96a3294a69a14d0e
|
89716ef1a2423a7dc119044195dd8aaec604ddcf
|
refs/heads/master
| 2021-01-23T02:48:37.397904
| 2017-03-24T02:36:33
| 2017-03-24T02:36:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 562
|
java
|
package cn.tongyouhui.control.service;
import cn.tongyouhui.control.vo.ControlRegister;
import cn.tongyouhui.control.vo.LoginVo;
public interface ControlService {
//将数据插入到表中
public void insertLoginInfo(ControlRegister controlRegister);
//根据用户名和密码查看该用户是否存在
public LoginVo login(LoginVo loginVo);
//根据id和角色查询用户
public ControlRegister selectInfoByIdAndRole1(String log_username, String role1);
//根据id查询是否可以注册
public LoginVo getUserByUsername(String reg_username);
}
|
[
"by6886432@163.com"
] |
by6886432@163.com
|
62cebebb80faac2dbddce97ab360a415b032e6fc
|
295c0f4aaecd04f36ec51e1a81b37d7bfb56005f
|
/com.javacc.ls/src/main/java/Pattern.java
|
df794f8d16a951e81f56df27efb045144f66a90e
|
[] |
no_license
|
farbodsz/javacc21-ls
|
e78dc0cce2c91c024cb05dbee1c18539b3322a1c
|
ca6796569300d393b0cd9960ac97236010f2778c
|
refs/heads/main
| 2023-03-30T04:10:24.377098
| 2021-01-23T08:49:11
| 2021-01-23T18:00:25
| 351,169,019
| 0
| 0
| null | 2021-03-24T17:34:31
| 2021-03-24T17:34:30
| null |
UTF-8
|
Java
| false
| false
| 2,889
|
java
|
import java.util.ArrayList;
import java.util.List;
public class Pattern {
private String include;
private String match;
private String name;
private String begin;
private String end;
private List<Pattern> patterns;
public String getInclude() {
return include;
}
public void setInclude(String include) {
this.include = include;
}
public String getMatch() {
return match;
}
public void setMatch(String match) {
this.match = match;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBegin() {
return begin;
}
public void setBegin(String begin) {
this.begin = begin;
}
public String getEnd() {
return end;
}
public void setEnd(String end) {
this.end = end;
}
public List<Pattern> getPatterns() {
if (patterns == null) {
patterns = new ArrayList<>();
}
return patterns;
}
public void addPatternInclude(String include) {
addPatternInclude(include, true);
}
public void addPatternInclude(String include, boolean insertHash) {
Pattern pattern = new Pattern();
pattern.setInclude((insertHash ? "#" : "") + include);
if (!getPatterns().contains(pattern)) {
getPatterns().add(pattern);
}
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((begin == null) ? 0 : begin.hashCode());
result = prime * result + ((end == null) ? 0 : end.hashCode());
result = prime * result + ((include == null) ? 0 : include.hashCode());
result = prime * result + ((match == null) ? 0 : match.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((patterns == null) ? 0 : patterns.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Pattern other = (Pattern) obj;
if (begin == null) {
if (other.begin != null)
return false;
} else if (!begin.equals(other.begin))
return false;
if (end == null) {
if (other.end != null)
return false;
} else if (!end.equals(other.end))
return false;
if (include == null) {
if (other.include != null)
return false;
} else if (!include.equals(other.include))
return false;
if (match == null) {
if (other.match != null)
return false;
} else if (!match.equals(other.match))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (patterns == null) {
if (other.patterns != null)
return false;
} else if (!patterns.equals(other.patterns))
return false;
return true;
}
}
|
[
"azerr@redhat.com"
] |
azerr@redhat.com
|
ba5d019da7f2d9386d7b981d6cf0eedf5af17646
|
028d6009f3beceba80316daa84b628496a210f8d
|
/uidesigner/com.nokia.sdt.uimodel.tests/src/com/nokia/sdt/uimodel/tests/TestsPlugin.java
|
4e572d1e5b366a478419fc92b95626faa7576c31
|
[] |
no_license
|
JamesLinus/oss.FCL.sftools.dev.ide.carbidecpp
|
fa50cafa69d3e317abf0db0f4e3e557150fd88b3
|
4420f338bc4e522c563f8899d81201857236a66a
|
refs/heads/master
| 2020-12-30T16:45:28.474973
| 2010-10-20T16:19:31
| 2010-10-20T16:19:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,125
|
java
|
/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
package com.nokia.sdt.uimodel.tests;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
import java.util.*;
/**
* The main plugin class to be used in the desktop.
*/
public class TestsPlugin extends Plugin {
//The shared instance.
private static TestsPlugin plugin;
//Resource bundle.
private ResourceBundle resourceBundle;
/**
* The constructor.
*/
public TestsPlugin() {
super();
plugin = this;
}
/**
* This method is called upon plug-in activation
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
resourceBundle = null;
}
/**
* Returns the shared instance.
*/
public static TestsPlugin getDefault() {
return plugin;
}
/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found.
*/
public static String getResourceString(String key) {
ResourceBundle bundle = TestsPlugin.getDefault().getResourceBundle();
try {
return (bundle != null) ? bundle.getString(key) : key;
} catch (MissingResourceException e) {
return key;
}
}
/**
* Returns the plugin's resource bundle,
*/
public ResourceBundle getResourceBundle() {
try {
if (resourceBundle == null)
resourceBundle = ResourceBundle.getBundle("com.nokia.sdt.uimodel.tests.TestsPluginResources");
} catch (MissingResourceException x) {
resourceBundle = null;
}
return resourceBundle;
}
}
|
[
"Deepak.Modgil@Nokia.com"
] |
Deepak.Modgil@Nokia.com
|
5d5e53360ff0b72c27b204cc54740ca1dd3587b6
|
faca9384fbd25624aed7e8a415b82dc431e6d874
|
/car-rental/src/main/java/com/msci/carrental/client/util/TextDecoratorInterface.java
|
608ae3d62cefee09f8f96742e55aad29f8004cc9
|
[
"MIT"
] |
permissive
|
nemethakos/car-rental
|
a1331683651cedc4bce1edb28b04fa3887e47b9b
|
b3a8248d9c7239757b50ddaf63fe064a96b75606
|
refs/heads/master
| 2022-02-23T15:39:20.206835
| 2022-02-20T21:58:10
| 2022-02-20T21:58:10
| 101,323,262
| 0
| 0
|
MIT
| 2022-02-20T20:56:54
| 2017-08-24T17:57:04
|
Java
|
UTF-8
|
Java
| false
| false
| 415
|
java
|
package com.msci.carrental.client.util;
public interface TextDecoratorInterface {
/**
* The implementor of this interface returns a {@link String} (decoration) for
* the {@link DecorationType}
*
* @param decorationType
* the {@link DecorationType}
* @return the {@link String} for the {@link DecorationType}
*/
String getDecorationFor(DecorationType decorationType);
}
|
[
"nemeth.akos@gmail.com"
] |
nemeth.akos@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.