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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
760d0a5c01587a8cbf62d0ec360f804876da3a35 | 84eb0c02978cda09a76e58e76ed1502fab80b4e8 | /core/src/main/java/com/zhuolu/cmd/core/factory/CmdFactory.java | 3bf8a94c4e8ce44d05a694f2d97131f5909396ef | [] | no_license | Robin1995Yu/cmd | 0149cf905c96f0df4cf746b2b54c83b5ff89feca | a60764ad217f2215e2fbe62f56fae162eb5ae1ca | refs/heads/master | 2023-07-25T12:25:03.286160 | 2021-09-08T11:29:24 | 2021-09-08T11:29:24 | 390,411,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | package com.zhuolu.cmd.core.factory;
import com.zhuolu.cmd.core.entry.cmd.Cmd;
import com.zhuolu.cmd.core.CmdRuntime;
import java.util.List;
/**
* 命令工厂
* @author zhuolu
*/
public interface CmdFactory {
/**
* 命令名 这个名字必须全局唯一
* @return 当前工厂对应的命令名
*/
String getName();
/**
* 获取命令的工厂方法
* @param previous 这个命令的上一个命令 如果当前命令是第一个 则为null
* @param param 命令的参数
* @param cmdRuntime 当前命令所对应的CmdRuntime
* @return 命令
* @see com.zhuolu.cmd.core.CmdRuntime
*/
Cmd getCmd(Cmd previous, List<String> param, CmdRuntime cmdRuntime);
}
| [
"yuzhongnan@come-future.com"
] | yuzhongnan@come-future.com |
424b159c52f41be3e4ab4210ea0d450cda881151 | 0ee3a1e6444d900630c4ac0f09fc30febbd7718e | /src/expensav20/GUI/AltaConceptos.java | a71ec664e98312240de30c119b23bc355db5512f | [] | no_license | javierpicco/Expensas | 9910bb09eee36a7ef7c6b4c9d0c1163a46f1e3e2 | 38647b61b82a06b5c1f9a1b40a878e073a71ad1c | refs/heads/master | 2020-04-05T22:49:01.346763 | 2017-11-20T20:10:54 | 2017-11-20T20:10:54 | 34,583,255 | 1 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 25,967 | java | /*
* AltaConceptos.java
*
* Created on 20 de diciembre de 2007, 19:52
*/
package expensav20.GUI;
import java.text.ParseException;
import java.util.Iterator;
import java.util.List;
import javax.swing.ComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.event.ListDataListener;
import javax.swing.text.MaskFormatter;
import model.Coeficiente;
import model.Concepto;
import model.TipoConcepto;
/**
*
* @author Javier
*/
public class AltaConceptos extends javax.swing.JFrame {
private ConsultaConcepto cc= new ConsultaConcepto();
private Concepto conceptoUpdated = new Concepto();
/** Creates new form AltaConceptos */
public AltaConceptos() {
initComponents();
this.jCmb_Coeficiente.setModel(new ComboCoeficientesModel());
this.jCmb_TpoConcepto.setModel(new ComboTipoConceptosModel());
this.jCmb_Coeficiente.updateUI();
this.jCmb_TpoConcepto.updateUI();
try {
MaskFormatter mascara_prioridad = new MaskFormatter("##");
mascara_prioridad.setValueContainsLiteralCharacters(false);
mascara_prioridad.install(this.jFTxt_Prioridad);
} catch (ParseException ex) {
ex.printStackTrace();
}
}
public AltaConceptos(Concepto conc,ConsultaConcepto cc) {
initComponents();
this.jCmb_Coeficiente.setModel(new ComboCoeficientesModel());
this.jCmb_TpoConcepto.setModel(new ComboTipoConceptosModel());
this.jCmb_Coeficiente.updateUI();
this.jCmb_TpoConcepto.updateUI();
try {
MaskFormatter mascara_prioridad = new MaskFormatter("##");
mascara_prioridad.setValueContainsLiteralCharacters(false);
mascara_prioridad.install(this.jFTxt_Prioridad);
} catch (ParseException ex) {
ex.printStackTrace();
}
this.jTxt_Nombre.setText(conc.getNombre());
System.out.print(conc.getOrigen());
if(conc.getOrigen().indexOf("Debe")!=-1){
this.jCmb_Origen.setSelectedIndex(0);
}
else{
this.jCmb_Origen.setSelectedIndex(1);
}
if(conc.getCoeficiente()!=null){
this.jCmb_Coeficiente.setSelectedIndex(this.buscarCoeficienteCombo(conc.getCoeficiente()));
}
this.jFTxt_Prioridad.setText(String.valueOf(conc.getPrioridad()));
this.jChk_Descripcion.setSelected(conc.isDescripcion());
this.jChk_IG.setSelected(conc.isIg());
this.jChk_IVA.setSelected(conc.isIva());
if(!conc.getCoeficiente().isDistribuible() && conc.getOrigen().indexOf("Haber")==-1){
this.jCmb_TpoConcepto.setEnabled(true);
this.jCmb_TpoConcepto.setSelectedIndex(this.buscarTipoConceptoCombo(conc.getTipoConcepto()));
}
this.setConceptoUpdated(conc);
this.setCc(cc);
this.jCmb_Coeficiente.updateUI();
this.jCmb_Origen.updateUI();
if (this.getConceptoUpdated().getNombre().indexOf("Expensas")!=-1){
this.jCmb_Coeficiente.setEnabled(false);
this.jTxt_Nombre.setEnabled(false);
this.jCmb_Origen.setEnabled(false);
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Código Generado ">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jTxt_Nombre = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jCmb_Origen = new javax.swing.JComboBox();
jLabel4 = new javax.swing.JLabel();
jCmb_Coeficiente = new javax.swing.JComboBox();
jChk_Descripcion = new javax.swing.JCheckBox();
jChk_IG = new javax.swing.JCheckBox();
jChk_IVA = new javax.swing.JCheckBox();
jFTxt_Prioridad = new javax.swing.JFormattedTextField();
jCmb_TpoConcepto = new javax.swing.JComboBox();
jLabel5 = new javax.swing.JLabel();
jBtn_Aceptar = new javax.swing.JButton();
jBtn_Cancelar = new javax.swing.JButton();
jBtn_Salir = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Alta de Conceptos");
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Conceptos"));
jLabel1.setText("Nombre:");
jLabel2.setText("Prioridad:");
jLabel3.setText("Origen:");
jCmb_Origen.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Debe", "Haber" }));
jCmb_Origen.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCmb_OrigenActionPerformed(evt);
}
});
jLabel4.setText("Coeficiente:");
jCmb_Coeficiente.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Coeficiente A", "Coeficiente B", "Coeficiente C" }));
jCmb_Coeficiente.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCmb_CoeficienteActionPerformed(evt);
}
});
jCmb_Coeficiente.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
jCmb_CoeficienteFocusLost(evt);
}
});
jChk_Descripcion.setText("Incluye Descripci\u00f3n");
jChk_Descripcion.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jChk_Descripcion.setMargin(new java.awt.Insets(0, 0, 0, 0));
jChk_IG.setText("Aplica Ingresos Brutos");
jChk_IG.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jChk_IG.setMargin(new java.awt.Insets(0, 0, 0, 0));
jChk_IG.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jChk_IGActionPerformed(evt);
}
});
jChk_IG.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
jChk_IGPropertyChange(evt);
}
});
jChk_IVA.setText("Incluye IVA I.G.");
jChk_IVA.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jChk_IVA.setEnabled(false);
jChk_IVA.setMargin(new java.awt.Insets(0, 0, 0, 0));
jCmb_TpoConcepto.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Coeficiente A", "Coeficiente B", "Coeficiente C" }));
jCmb_TpoConcepto.setEnabled(false);
jLabel5.setText("Tipo Conc.:");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel1))
.addGap(16, 16, 16)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jFTxt_Prioridad, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jCmb_Origen, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jTxt_Nombre)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jChk_Descripcion)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jChk_IVA)
.addComponent(jChk_IG)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCmb_TpoConcepto, 0, 209, Short.MAX_VALUE)
.addComponent(jCmb_Coeficiente, 0, 209, Short.MAX_VALUE))))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jTxt_Nombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jFTxt_Prioridad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(jCmb_Origen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jCmb_Coeficiente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jCmb_TpoConcepto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(12, 12, 12)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jChk_Descripcion)
.addComponent(jChk_IG, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jChk_IVA)
.addContainerGap())
);
jBtn_Aceptar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/expensav20/GUI/Icons/tick.png")));
jBtn_Aceptar.setText("Aceptar");
jBtn_Aceptar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtn_AceptarActionPerformed(evt);
}
});
jBtn_Cancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/expensav20/GUI/Icons/cross.png")));
jBtn_Cancelar.setText("Cancelar");
jBtn_Cancelar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtn_CancelarActionPerformed(evt);
}
});
jBtn_Salir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/expensav20/GUI/Icons/door_out.png")));
jBtn_Salir.setText("Salir");
jBtn_Salir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtn_SalirActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(36, Short.MAX_VALUE)
.addComponent(jBtn_Aceptar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBtn_Cancelar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBtn_Salir)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBtn_Salir)
.addComponent(jBtn_Cancelar)
.addComponent(jBtn_Aceptar))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jCmb_CoeficienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCmb_CoeficienteActionPerformed
if (this.jCmb_Coeficiente.getSelectedIndex()!=-1){
Coeficiente coe=(Coeficiente)((ComboCoeficientesModel)this.jCmb_Coeficiente.getModel()).getLst().get(this.jCmb_Coeficiente.getSelectedIndex());
if (!coe.isDistribuible()){
this.jCmb_TpoConcepto.setEnabled(true);
}
else{
this.jCmb_TpoConcepto.setEnabled(false);
}
}
}//GEN-LAST:event_jCmb_CoeficienteActionPerformed
private void jCmb_CoeficienteFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jCmb_CoeficienteFocusLost
if (this.jCmb_Coeficiente.getSelectedIndex()!=-1){
Coeficiente coe=(Coeficiente)((ComboCoeficientesModel)this.jCmb_Coeficiente.getModel()).getLst().get(this.jCmb_Coeficiente.getSelectedIndex());
if (!coe.isDistribuible()){
this.jCmb_TpoConcepto.setEnabled(true);
}
else{
this.jCmb_TpoConcepto.setEnabled(false);
}
}
}//GEN-LAST:event_jCmb_CoeficienteFocusLost
private void jBtn_CancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtn_CancelarActionPerformed
this.limpiar();
}//GEN-LAST:event_jBtn_CancelarActionPerformed
private void jCmb_OrigenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCmb_OrigenActionPerformed
if ((String)this.jCmb_Origen.getSelectedItem()=="Haber"){
this.jCmb_Coeficiente.setSelectedIndex(-1);
this.jCmb_Coeficiente.setEnabled(false);
}
else{
this.jCmb_Coeficiente.setEnabled(true);
}
}//GEN-LAST:event_jCmb_OrigenActionPerformed
private void jBtn_AceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtn_AceptarActionPerformed
if (this.validateFields()==false)
return;
Concepto con=new Concepto();
if ((String)this.jCmb_Origen.getSelectedItem()=="Debe")
con.setCoeficiente((Coeficiente)((ComboCoeficientesModel)this.jCmb_Coeficiente.getModel()).getLst().get(this.jCmb_Coeficiente.getSelectedIndex()));
con.setNombre(this.jTxt_Nombre.getText());
con.setIg(this.jChk_IG.isSelected());
con.setIva(this.jChk_IVA.isSelected());
con.setDescripcion(this.jChk_Descripcion.isSelected());
con.setOrigen((String)this.jCmb_Origen.getSelectedItem());
if (this.jFTxt_Prioridad.getText().trim().length()>0)
con.setPrioridad(Integer.parseInt(this.jFTxt_Prioridad.getText().trim()));
TipoConcepto tpoCon=new TipoConcepto();
if(this.jCmb_TpoConcepto.isEnabled()){
tpoCon=(TipoConcepto)((ComboTipoConceptosModel)this.jCmb_TpoConcepto.getModel()).getLst().get(this.jCmb_TpoConcepto.getSelectedIndex());
}
con.setTipoConcepto(tpoCon);
if(this.getConceptoUpdated().getCodigo()==0){
con.guardar();
if (con.getCodigo()!=0){
JOptionPane.showMessageDialog(this.getContentPane(),"El concepto fue guardado correctamente");
this.limpiar();
}
else{
JOptionPane.showMessageDialog(this.getContentPane(),"Ocurrió un error, por favor intente nuevamente");
}
this.jTxt_Nombre.requestFocus();
}
else{
con.setCodigo(this.getConceptoUpdated().getCodigo());
if(con.modificar()!=0){
JOptionPane.showMessageDialog(this.getContentPane(),"El concepto se modificó correctamente");
this.getCc().actualizar();
}
else{
JOptionPane.showMessageDialog(this.getContentPane(),"Ocurrió un problema, por favor intente nuevamente");
}
}
}//GEN-LAST:event_jBtn_AceptarActionPerformed
private void jChk_IGActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jChk_IGActionPerformed
if (this.jChk_IG.isSelected()){
this.jChk_IVA.setEnabled(true);
}
else{
this.jChk_IVA.setSelected(false);
this.jChk_IVA.setEnabled(false);
}
}//GEN-LAST:event_jChk_IGActionPerformed
private void jChk_IGPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jChk_IGPropertyChange
}//GEN-LAST:event_jChk_IGPropertyChange
private void jBtn_SalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtn_SalirActionPerformed
this.setVisible(false);
this.dispose();
}//GEN-LAST:event_jBtn_SalirActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new AltaConceptos().setVisible(true);
}
});
}
// Declaración de varibales -no modificar//GEN-BEGIN:variables
private javax.swing.JButton jBtn_Aceptar;
private javax.swing.JButton jBtn_Cancelar;
private javax.swing.JButton jBtn_Salir;
private javax.swing.JCheckBox jChk_Descripcion;
private javax.swing.JCheckBox jChk_IG;
private javax.swing.JCheckBox jChk_IVA;
private javax.swing.JComboBox jCmb_Coeficiente;
private javax.swing.JComboBox jCmb_Origen;
private javax.swing.JComboBox jCmb_TpoConcepto;
private javax.swing.JFormattedTextField jFTxt_Prioridad;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jTxt_Nombre;
// Fin de declaración de variables//GEN-END:variables
class ComboCoeficientesModel implements ComboBoxModel{
Coeficiente coe=new Coeficiente();
protected Object selected;
private List lst;
ComboCoeficientesModel(){
this.setLst(coe.buscarActivos());
}
public void setSelectedItem(Object item) {
this.selected=item;
}
public Object getSelectedItem() {
return this.selected;
}
public String getElementAt(int index) {
Coeficiente coef=new Coeficiente();
coef=(Coeficiente)getLst().get(index);
return coef.getDenominacion();
}
public int getSize() {
return getLst().size();
}
public void addListDataListener(ListDataListener l) {
}
public void removeListDataListener(ListDataListener l) {
}
public List getLst() {
return lst;
}
public void setLst(List lst) {
this.lst = lst;
}
}
class ComboTipoConceptosModel implements ComboBoxModel{
TipoConcepto tc=new TipoConcepto();
protected Object selected;
private List lst;
ComboTipoConceptosModel(){
this.setLst(tc.buscarTodos());
}
public void setSelectedItem(Object item) {
this.selected=item;
}
public Object getSelectedItem() {
return this.selected;
}
public String getElementAt(int index) {
TipoConcepto tc=new TipoConcepto();
tc=(TipoConcepto)getLst().get(index);
return tc.getDescripcion();
}
public int getSize() {
return getLst().size();
}
public void addListDataListener(ListDataListener l) {
}
public void removeListDataListener(ListDataListener l) {
}
public List getLst() {
return lst;
}
public void setLst(List lst) {
this.lst = lst;
}
}
public void limpiar(){
this.jTxt_Nombre.setText("");
this.jFTxt_Prioridad.setText("");
this.jChk_Descripcion.setSelected(false);
this.jChk_IG.setSelected(false);
this.jChk_IVA.setSelected(false);
this.jCmb_TpoConcepto.setSelectedIndex(-1);
this.jCmb_TpoConcepto.setEnabled(false);
}
//Método para validar Empty Fields
private boolean validateFields(){
if (this.jTxt_Nombre.getText().trim().length()==0||this.jTxt_Nombre.getText().trim().length()>30){
JOptionPane.showMessageDialog(this.getContentPane(),"El nombre no puede estar vacío o contener mas de 30 caracteres");
this.jTxt_Nombre.requestFocus();
return false;
}
if ((String)this.jCmb_Origen.getSelectedItem()=="Debe"){
if (this.jCmb_Coeficiente.getSelectedIndex()==-1){
JOptionPane.showMessageDialog(this.getContentPane(),"Debe seleccionar un coeficiente");
this.jCmb_Coeficiente.requestFocus();
return false;
}
}
else{
this.jCmb_Coeficiente.setSelectedIndex(-1);
}
if(this.jCmb_TpoConcepto.isEnabled()){
if(this.jCmb_TpoConcepto.getSelectedIndex()==-1){
JOptionPane.showMessageDialog(this.getContentPane(),"Debe seleccionar un tipo de concepto previamente");
this.jCmb_TpoConcepto.requestFocus();
return false;
}
}
return true;
}
public ConsultaConcepto getCc() {
return cc;
}
public void setCc(ConsultaConcepto cc) {
this.cc = cc;
}
public Concepto getConceptoUpdated() {
return conceptoUpdated;
}
public void setConceptoUpdated(Concepto conceptoUpdated) {
this.conceptoUpdated = conceptoUpdated;
}
public int buscarCoeficienteCombo(Coeficiente coe)
{
List lst=((ComboCoeficientesModel)this.jCmb_Coeficiente.getModel()).getLst();
Iterator it=lst.iterator();
int index=0;
while (it.hasNext()){
Coeficiente coef = (Coeficiente)it.next();
if (coef.getCodigo()==coe.getCodigo()){
return index;
}
index++;
}
return -1;
}
public int buscarTipoConceptoCombo(TipoConcepto tc)
{
List lst=((ComboTipoConceptosModel)this.jCmb_TpoConcepto.getModel()).getLst();
Iterator it=lst.iterator();
int index=0;
while (it.hasNext()){
TipoConcepto tc2 = (TipoConcepto)it.next();
if (tc.getCodigo()==tc2.getCodigo()){
return index;
}
index++;
}
return -1;
}
}
| [
"picco77@gmail.com"
] | picco77@gmail.com |
8822391fffb19b0998e6b8c49bef221d624fe73f | 33c47b3d2c4caf02e38ae4cf67ef2cc8581a326d | /jbox2d-testbed/src/main/java/org/jbox2d/testbed/tests/Server2.java | a64acdbf95bf65a5761426702e986e2fc9e4812f | [
"BSD-2-Clause"
] | permissive | amrrus/SpaceBattle-physicsServer | 772023e03eba164cc878960993b409b9b148ac64 | 4e2f9e1aa549fd2f8011bb67cc8fe679f1bbf0da | refs/heads/master | 2021-09-13T04:02:20.960203 | 2018-04-02T12:19:05 | 2018-04-02T12:19:05 | 125,087,161 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,034 | java | package org.jbox2d.testbed.tests;
import java.util.ArrayList;
import java.util.List;
import org.jbox2d.collision.shapes.CircleShape;
import org.jbox2d.common.MathUtils;
import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.Body;
import org.jbox2d.dynamics.BodyDef;
import org.jbox2d.dynamics.BodyType;
import org.jbox2d.dynamics.FixtureDef;
import org.jbox2d.testbed.framework.TestbedSettings;
import org.jbox2d.testbed.framework.TestbedTest;
import Server.BottomPlayerEntity;
import Server.Connection;
import Server.EntityFactory;
import Server.GameContactListener;
import Server.TopPlayerEntity;
public class Server2 extends TestbedTest {
private BottomPlayerEntity botPlayer;
private TopPlayerEntity topPlayer;
private EntityFactory ef;
private Integer cont;
private Connection conn;
private List<Body> asteroidsToRemove;
private List<Body> shotsToRemove;
private static final long BULLET_TAG = 1;
Body m_bullet;
public Long getTag(Body argBody) {
if(argBody == m_bullet){
return BULLET_TAG;
}
return super.getTag(argBody);
}
public void processBody(Body argBody, Long argTag) {
if(argTag == BULLET_TAG){
m_bullet = argBody;
return;
}
super.processBody(argBody, argTag);
}
public boolean isSaveLoadEnabled() {
return true;
}
public void initTest(boolean argDeserialized) {
if(argDeserialized){
return;
}
// Set null gravity
getWorld().setGravity(new Vec2(0,0));
// parameter init (to clic on interface)
m_bullet = null;
this.conn = new Connection();
this.ef = new EntityFactory(getWorld(),this.conn);
this.asteroidsToRemove = new ArrayList<Body>();
this.shotsToRemove = new ArrayList<Body>();
getWorld().setContactListener(new GameContactListener(this.ef,this.asteroidsToRemove,this.shotsToRemove));
this.ef.createWorldBorder();
this.ef.createFieldLimit();
this.botPlayer = this.ef.createBottomPlayer();
this.topPlayer = this.ef.createTopPlayer();
this.cont = 0;
}
public void keyPressed(char argKeyChar, int argKeyCode) {
switch (argKeyChar) {
case ',':
if (m_bullet != null) {
getWorld().destroyBody(m_bullet);
m_bullet = null;
}
{
CircleShape shape = new CircleShape();
shape.m_radius = 0.25f;
FixtureDef fd = new FixtureDef();
fd.shape = shape;
fd.density = 20.0f;
fd.restitution = 0.05f;
BodyDef bd = new BodyDef();
bd.type = BodyType.DYNAMIC;
bd.bullet = true;
bd.position.set(-31.0f, 5.0f);
m_bullet = getWorld().createBody(bd);
m_bullet.createFixture(fd);
m_bullet.setLinearVelocity(new Vec2(400.0f, 0.0f));
}
break;
}
}
public void step(TestbedSettings settings){
super.step(settings);//process contacts
cont++;
if (cont %150==0){
ef.createBottomShot();
ef.createTopShot();
}
if (cont%200==0) {
ef.createAsteroid(new Vec2(0,0), new Vec2(MathUtils.randomFloat(-2, 2),MathUtils.randomFloat(-2, 2)),MathUtils.randomFloat(0.2f, 1.3f));
}
//delete bodies
for (Body a : this.asteroidsToRemove) {
ef.deleteAsteroid(a);
}
for (Body s : this.shotsToRemove) {
ef.deleteShot(s);
}
this.asteroidsToRemove.clear();
this.shotsToRemove.clear();
botPlayer.updateMove();
topPlayer.updateMove();
}
/**
* @see org.jbox2d.testbed.framework.TestbedTest#getTestName()
*/
@Override
public String getTestName() {
return "Server 2";
}
}
| [
"antoniomanuel.r.r@gmail.com"
] | antoniomanuel.r.r@gmail.com |
80936f2a5297171f85984a471d91da4349531b0a | 116baab0751f47fe042a286a0ed24e01fe559ab8 | /Lesson2/src/MethodOverloadingDemo.java | a91f8c4f50dfb371a825c5327d0fbce2b1493bdc | [] | no_license | bbreddy21/Java_Learning | e707e96a61f26606eae4f2af2c022fdb6bb46e6f | 35069d53dc6509eb7aa44d23aaad5bf388a77765 | refs/heads/master | 2023-02-15T04:51:08.500083 | 2021-01-17T16:16:06 | 2021-01-17T16:16:06 | 321,350,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 726 | java |
public class MethodOverloadingDemo {
// Calculate area of rectangle
private void area(int length, int breadth) {
System.out.println("Area of Rectangle : " + (length * breadth));
}
// Calculate area of circle
public double area(int radious) {
return Math.PI * radious * radious;
}
// Calculate area of square
void area(double length) {
System.out.println("Area of square: " + (length * length));
}
public static void main(String[] args) {
// TODO Auto-generated method stub
// Instantiate an object
MethodOverloadingDemo mod = new MethodOverloadingDemo();
mod.area(30, 40);
double areaofcirlce = mod.area(25);
System.out.println("Area of circle: " + areaofcirlce);
mod.area(25.05);
}
}
| [
"bbreddy@adobe.com"
] | bbreddy@adobe.com |
50d3398a2cfb194b18d5031697319086eb1abc25 | b35e42618890b01f01f5408c05741dc895db50a2 | /opentsp-dongfeng-modules/opentsp-dongfeng-monitor/dongfeng-monitor-core/src/main/java/com/navinfo/opentsp/dongfeng/monitor/entity/HyCarEntity.java | 3241d182a488f93f52999d577bdc4feba2e4be88 | [] | no_license | shanghaif/dongfeng-huanyou-platform | 28eb5572a1f15452427456ceb3c7f3b3cf72dc84 | 67bcc02baab4ec883648b167717f356df9dded8d | refs/heads/master | 2023-05-13T01:51:37.463721 | 2018-03-07T14:24:03 | 2018-03-07T14:26:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,320 | java | package com.navinfo.opentsp.dongfeng.monitor.entity;
import javax.persistence.*;
import java.math.BigInteger;
import java.sql.Timestamp;
/**
* @Author liusanhu@aerozhonghuan.com
* @Date 2017/3/8
*/
@Entity
@Table(name = "hy_car")
public class HyCarEntity {
private BigInteger carId;
private int districtId;
private String carCph;
private Integer carColor;
private BigInteger carTerminal;
private BigInteger carTeamId;
private Integer carState;
private String carPw;
private String carAccountName;
private String carAutoNumber;
private BigInteger carDate;
private String carPlace;
private String carCompany;
private Integer delFlag;
private Integer carType;
private Integer carTrade;
private Integer carServiceStop;
private BigInteger serviceBegin;
private BigInteger serviceEnd;
private BigInteger nettingTime;
private BigInteger nettingLog;
private BigInteger nettingLat;
private String chassisNum;
private String structureNum;
private String oilCapacity;
private Integer lockStauts;
private BigInteger carTerminalId;
private Integer autoFlag;
private Integer tamperStatue;
private String operateCommon;
private String operateUser;
private BigInteger operateDate;
private Integer tamperNoticeStatus;
private BigInteger offlineTime;
private BigInteger removalTime;
private BigInteger registerTime;
private String operateIp;
private BigInteger carFkdate;
private Integer batteryType;
private Integer batteryBatches;
private String carModelCode;
private BigInteger onlineTime;
private String carModel;
private BigInteger warehouseLog;
private BigInteger warehouseLat;
private BigInteger warehouseTime;
private String orderNumber;
private Timestamp syncTime;
private String lockMethod;
private String qrCode;
private BigInteger financingCompany;
private BigInteger payType;
private BigInteger createAccountId;
@Id
@Column(name = "CAR_ID", nullable = false, columnDefinition="bigint")
public BigInteger getCarId() {
return carId;
}
public void setCarId(BigInteger carId) {
this.carId = carId;
}
@Basic
@Column(name = "DISTRICT_ID", nullable = false)
public int getDistrictId() {
return districtId;
}
public void setDistrictId(int districtId) {
this.districtId = districtId;
}
@Basic
@Column(name = "CAR_CPH", nullable = true, length = 50)
public String getCarCph() {
return carCph;
}
public void setCarCph(String carCph) {
this.carCph = carCph;
}
@Basic
@Column(name = "CAR_COLOR", nullable = true)
public Integer getCarColor() {
return carColor;
}
public void setCarColor(Integer carColor) {
this.carColor = carColor;
}
@Basic
@Column(name = "CAR_TERMINAL", nullable = true, columnDefinition="bigint")
public BigInteger getCarTerminal() {
return carTerminal;
}
public void setCarTerminal(BigInteger carTerminal) {
this.carTerminal = carTerminal;
}
@Basic
@Column(name = "CAR_TEAM_ID", nullable = true, columnDefinition="bigint")
public BigInteger getCarTeamId() {
return carTeamId;
}
public void setCarTeamId(BigInteger carTeamId) {
this.carTeamId = carTeamId;
}
@Basic
@Column(name = "CAR_STATE", nullable = true)
public Integer getCarState() {
return carState;
}
public void setCarState(Integer carState) {
this.carState = carState;
}
@Basic
@Column(name = "CAR_PW", nullable = true, length = 50)
public String getCarPw() {
return carPw;
}
public void setCarPw(String carPw) {
this.carPw = carPw;
}
@Basic
@Column(name = "CAR_ACCOUNT_NAME", nullable = true, length = 50)
public String getCarAccountName() {
return carAccountName;
}
public void setCarAccountName(String carAccountName) {
this.carAccountName = carAccountName;
}
@Basic
@Column(name = "CAR_AUTO_NUMBER", nullable = true, length = 50)
public String getCarAutoNumber() {
return carAutoNumber;
}
public void setCarAutoNumber(String carAutoNumber) {
this.carAutoNumber = carAutoNumber;
}
@Basic
@Column(name = "CAR_DATE", nullable = true, columnDefinition="bigint")
public BigInteger getCarDate() {
return carDate;
}
public void setCarDate(BigInteger carDate) {
this.carDate = carDate;
}
@Basic
@Column(name = "CAR_PLACE", nullable = true, length = 200)
public String getCarPlace() {
return carPlace;
}
public void setCarPlace(String carPlace) {
this.carPlace = carPlace;
}
@Basic
@Column(name = "CAR_COMPANY", nullable = true, length = 200)
public String getCarCompany() {
return carCompany;
}
public void setCarCompany(String carCompany) {
this.carCompany = carCompany;
}
@Basic
@Column(name = "DEL_FLAG", nullable = true)
public Integer getDelFlag() {
return delFlag;
}
public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}
@Basic
@Column(name = "CAR_TYPE", nullable = true)
public Integer getCarType() {
return carType;
}
public void setCarType(Integer carType) {
this.carType = carType;
}
@Basic
@Column(name = "CAR_TRADE", nullable = true)
public Integer getCarTrade() {
return carTrade;
}
public void setCarTrade(Integer carTrade) {
this.carTrade = carTrade;
}
@Basic
@Column(name = "CAR_SERVICE_STOP", nullable = true)
public Integer getCarServiceStop() {
return carServiceStop;
}
public void setCarServiceStop(Integer carServiceStop) {
this.carServiceStop = carServiceStop;
}
@Basic
@Column(name = "SERVICE_BEGIN", nullable = true, columnDefinition="bigint")
public BigInteger getServiceBegin() {
return serviceBegin;
}
public void setServiceBegin(BigInteger serviceBegin) {
this.serviceBegin = serviceBegin;
}
@Basic
@Column(name = "SERVICE_END", nullable = true, columnDefinition="bigint")
public BigInteger getServiceEnd() {
return serviceEnd;
}
public void setServiceEnd(BigInteger serviceEnd) {
this.serviceEnd = serviceEnd;
}
@Basic
@Column(name = "NETTING_TIME", nullable = true, columnDefinition="bigint")
public BigInteger getNettingTime() {
return nettingTime;
}
public void setNettingTime(BigInteger nettingTime) {
this.nettingTime = nettingTime;
}
@Basic
@Column(name = "NETTING_LOG", nullable = true, columnDefinition="bigint")
public BigInteger getNettingLog() {
return nettingLog;
}
public void setNettingLog(BigInteger nettingLog) {
this.nettingLog = nettingLog;
}
@Basic
@Column(name = "NETTING_LAT", nullable = true, columnDefinition="bigint")
public BigInteger getNettingLat() {
return nettingLat;
}
public void setNettingLat(BigInteger nettingLat) {
this.nettingLat = nettingLat;
}
@Basic
@Column(name = "CHASSIS_NUM", nullable = true, length = 100)
public String getChassisNum() {
return chassisNum;
}
public void setChassisNum(String chassisNum) {
this.chassisNum = chassisNum;
}
@Basic
@Column(name = "STRUCTURE_NUM", nullable = true, length = 100)
public String getStructureNum() {
return structureNum;
}
public void setStructureNum(String structureNum) {
this.structureNum = structureNum;
}
@Basic
@Column(name = "OIL_CAPACITY", nullable = true, length = 100)
public String getOilCapacity() {
return oilCapacity;
}
public void setOilCapacity(String oilCapacity) {
this.oilCapacity = oilCapacity;
}
@Basic
@Column(name = "LOCK_STAUTS", nullable = true, columnDefinition="int")
public Integer getLockStauts() {
return lockStauts==null?0:lockStauts;
}
public void setLockStauts(Integer lockStauts) {
this.lockStauts = lockStauts;
}
@Basic
@Column(name = "CAR_TERMINAL_ID", nullable = true, columnDefinition="bigint")
public BigInteger getCarTerminalId() {
return carTerminalId;
}
public void setCarTerminalId(BigInteger carTerminalId) {
this.carTerminalId = carTerminalId;
}
@Basic
@Column(name = "AUTO_FLAG", nullable = true)
public Integer getAutoFlag() {
return autoFlag;
}
public void setAutoFlag(Integer autoFlag) {
this.autoFlag = autoFlag;
}
@Basic
@Column(name = "TAMPER_STATUE", nullable = true)
public Integer getTamperStatue() {
return tamperStatue;
}
public void setTamperStatue(Integer tamperStatue) {
this.tamperStatue = tamperStatue;
}
@Basic
@Column(name = "OPERATE_COMMON", nullable = true, length = 200)
public String getOperateCommon() {
return operateCommon;
}
public void setOperateCommon(String operateCommon) {
this.operateCommon = operateCommon;
}
@Basic
@Column(name = "OPERATE_USER", nullable = true, length = 200)
public String getOperateUser() {
return operateUser;
}
public void setOperateUser(String operateUser) {
this.operateUser = operateUser;
}
@Basic
@Column(name = "OPERATE_DATE", nullable = true, columnDefinition="bigint")
public BigInteger getOperateDate() {
return operateDate;
}
public void setOperateDate(BigInteger operateDate) {
this.operateDate = operateDate;
}
@Basic
@Column(name = "tamper_notice_status", nullable = true)
public Integer getTamperNoticeStatus() {
return tamperNoticeStatus;
}
public void setTamperNoticeStatus(Integer tamperNoticeStatus) {
this.tamperNoticeStatus = tamperNoticeStatus;
}
@Basic
@Column(name = "OFFLINE_TIME", nullable = true, columnDefinition="bigint")
public BigInteger getOfflineTime() {
return offlineTime;
}
public void setOfflineTime(BigInteger offlineTime) {
this.offlineTime = offlineTime;
}
@Basic
@Column(name = "REMOVAL_TIME", nullable = true, columnDefinition="bigint")
public BigInteger getRemovalTime() {
return removalTime;
}
public void setRemovalTime(BigInteger removalTime) {
this.removalTime = removalTime;
}
@Basic
@Column(name = "REGISTER_TIME", nullable = true, columnDefinition="bigint")
public BigInteger getRegisterTime() {
return registerTime;
}
public void setRegisterTime(BigInteger registerTime) {
this.registerTime = registerTime;
}
@Basic
@Column(name = "OPERATE_IP", nullable = true, length = 100)
public String getOperateIp() {
return operateIp;
}
public void setOperateIp(String operateIp) {
this.operateIp = operateIp;
}
@Basic
@Column(name = "CAR_FKDATE", nullable = true, columnDefinition="bigint")
public BigInteger getCarFkdate() {
return carFkdate;
}
public void setCarFkdate(BigInteger carFkdate) {
this.carFkdate = carFkdate;
}
@Basic
@Column(name = "BATTERY_TYPE", nullable = true)
public Integer getBatteryType() {
return batteryType;
}
public void setBatteryType(Integer batteryType) {
this.batteryType = batteryType;
}
@Basic
@Column(name = "BATTERY_BATCHES", nullable = true)
public Integer getBatteryBatches() {
return batteryBatches;
}
public void setBatteryBatches(Integer batteryBatches) {
this.batteryBatches = batteryBatches;
}
@Basic
@Column(name = "car_model_code", nullable = true, length = 20)
public String getCarModelCode() {
return carModelCode;
}
public void setCarModelCode(String carModelCode) {
this.carModelCode = carModelCode;
}
@Basic
@Column(name = "online_time", nullable = true, columnDefinition="bigint")
public BigInteger getOnlineTime() {
return onlineTime;
}
public void setOnlineTime(BigInteger onlineTime) {
this.onlineTime = onlineTime;
}
@Basic
@Column(name = "CAR_MODEL", nullable = true, length = 100)
public String getCarModel() {
return carModel;
}
public void setCarModel(String carModel) {
this.carModel = carModel;
}
@Basic
@Column(name = "WAREHOUSE_LOG", nullable = true, columnDefinition="bigint")
public BigInteger getWarehouseLog() {
return warehouseLog;
}
public void setWarehouseLog(BigInteger warehouseLog) {
this.warehouseLog = warehouseLog;
}
@Basic
@Column(name = "WAREHOUSE_LAT", nullable = true, columnDefinition="bigint")
public BigInteger getWarehouseLat() {
return warehouseLat;
}
public void setWarehouseLat(BigInteger warehouseLat) {
this.warehouseLat = warehouseLat;
}
@Basic
@Column(name = "WAREHOUSE_TIME", nullable = true, columnDefinition="bigint")
public BigInteger getWarehouseTime() {
return warehouseTime;
}
public void setWarehouseTime(BigInteger warehouseTime) {
this.warehouseTime = warehouseTime;
}
@Basic
@Column(name = "order_number", nullable = true, length = 60)
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
@Basic
@Column(name = "sync_time", nullable = true)
public Timestamp getSyncTime() {
return syncTime;
}
public void setSyncTime(Timestamp syncTime) {
this.syncTime = syncTime;
}
@Basic
@Column(name = "lock_method", nullable = true, length = 20)
public String getLockMethod() {
return lockMethod;
}
public void setLockMethod(String lockMethod) {
this.lockMethod = lockMethod;
}
@Basic
@Column(name = "qr_code", nullable = true, length = 50)
public String getQrCode() {
return qrCode;
}
public void setQrCode(String qrCode) {
this.qrCode = qrCode;
}
@Basic
@Column(name = "financing_company", nullable = true, columnDefinition="bigint")
public BigInteger getFinancingCompany() {
return financingCompany;
}
public void setFinancingCompany(BigInteger financingCompany) {
this.financingCompany = financingCompany;
}
@Basic
@Column(name = "pay_type", nullable = true, columnDefinition="bigint")
public BigInteger getPayType() {
return payType;
}
public void setPayType(BigInteger payType) {
this.payType = payType;
}
@Basic
@Column(name = "CREATE_ACCOUNT_ID", nullable = true, columnDefinition="bigint")
public BigInteger getCreateAccountId() {
return createAccountId;
}
public void setCreateAccountId(BigInteger createAccountId) {
this.createAccountId = createAccountId;
}
}
| [
"zhangtiantong@aerozhonghuan.com"
] | zhangtiantong@aerozhonghuan.com |
a11baa78aa2d974b2ff9118c7cbe7a130ceb732c | 53ab5187556e8bab67ce9cc3202e55f6a42f0b15 | /src/lib/ui/factories/MyListsPageObjectFactory.java | 97a72eb1b951f947e67f32768733f05fa028e528 | [
"Apache-2.0"
] | permissive | MaximLyamin/JavaTestAutomation | 322cfb156a358118dc275d3f0e785c1ed8f995d2 | 5de66226fcc4a4b4b793b71a7c23ce014977398a | refs/heads/main | 2023-02-25T04:46:03.501127 | 2021-01-24T16:13:13 | 2021-01-24T16:13:13 | 320,309,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package lib.ui.factories;
import io.appium.java_client.AppiumDriver;
import lib.Platform;
import lib.ui.MyListsPageObject;
import lib.ui.android.AndroidMyListsPageObject;
import lib.ui.ios.iOSMyListsPageObject;
public class MyListsPageObjectFactory {
public static MyListsPageObject get(AppiumDriver driver) {
if (Platform.getInstance().isAndroid()) {
return new AndroidMyListsPageObject(driver);
} else {
return new iOSMyListsPageObject(driver);
}
}
}
| [
"maxim.lyamin@kaspersky.com"
] | maxim.lyamin@kaspersky.com |
2c9b6e77d839b4934596b760d664a146c75760d2 | a33d5aa2d176876e3a0a246e8064317ba2fab8f2 | /src/sortByCategory/DP/No_376_WiggleMaxLength.java | 4772b4e6d9a8af8773449ed40c4e9cd7178b0fa4 | [] | no_license | NWPUWuHaiBo/Leetcode | f1fbfe25dcdf3d5bfd8775f12b5a288bdab12fdd | 1d0aa92cdb42b9867b1284334e30f6ff3b05b1a6 | refs/heads/master | 2020-12-23T11:01:57.716922 | 2020-06-28T02:21:08 | 2020-06-28T02:21:08 | 237,130,191 | 0 | 0 | null | 2020-12-04T14:25:38 | 2020-01-30T03:16:42 | Java | UTF-8 | Java | false | false | 1,048 | java | package sortByCategory.DP;
/**
* @author haiboWu
* @create 2020-04-22 11:11
*/
public class No_376_WiggleMaxLength {
public int wiggleMaxLength(int[] nums) {
if(nums==null||nums.length==0)return 0;
int up[]=new int[nums.length];
int down[]=new int[nums.length];
for (int i = 1; i < nums.length; i++) {
for (int j = 0; j < i; j++) {
if(nums[i]<nums[j]){
down[i]=Math.max(down[i],up[j]+1);
}else if(nums[i]>nums[j]){
up[i]=Math.max(up[i],down[j]+1);
}
}
}
return 1+Math.max(down[nums.length-1],up[nums.length-1]);
}
public int wiggleMaxLength2(int[] nums){
if(nums==null||nums.length==0)return 0;
int down=1,up=1;
for (int i = 1; i < nums.length; i++) {
if(nums[i]>nums[i-1]){
up=down+1;
}else if(nums[i]<nums[i-1]){
down=up+1;
}
}
return Math.max(up,down);
}
}
| [
"1598345816@qq.com"
] | 1598345816@qq.com |
5e3b71267a3b2d8241957309775b6c1b4b749e8c | bd5377852d775d833705cbea26805d83d06c067a | /android/app/src/main/java/com/example/shoppesta/MainActivity.java | e1bc39375e2b79d10c731875b27c1d1e21a6abbc | [] | no_license | ahmed00012/shoppesta | 82b7bb3948fa11a0e490adf596b1dccc6bbb0fd7 | 5b02824a5a60edd8a322993081d0afab8afd9e81 | refs/heads/master | 2020-09-28T07:48:05.464091 | 2019-12-08T20:28:46 | 2019-12-08T20:28:46 | 226,726,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 366 | java | package com.example.shoppesta;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
| [
"52130117+ahmed00012@users.noreply.github.com"
] | 52130117+ahmed00012@users.noreply.github.com |
30fd75433608d20c782a70784231a1ba368f6615 | f12f2eae2bd29b80077f26aca27e4b67badc3b83 | /android/app/src/main/java/com/ninestream/SplashActivity.java | 47d81858d547e22ec320650e8b819b9eecc9c24c | [] | no_license | Tingomobile/9stream | 647e95bbd8f9a5be8b3830e01297cc2ae886df0d | 95db4e5fb07479476a1da3d4cbc00394f1c3a784 | refs/heads/master | 2020-03-30T04:52:07.284574 | 2018-11-15T18:42:20 | 2018-11-15T18:42:20 | 150,766,383 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 423 | java | package com.ninestream;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
finish();
}
}
| [
"tingo2@Tingos-MacBook-Pro-3.local"
] | tingo2@Tingos-MacBook-Pro-3.local |
f054a830a895dd5ec49e45213a6c67320c4b1036 | 660bcd600102f4d95f565d66f89d427553b9b76f | /src/main/java/com/liftmania/Lift.java | 2665da948da150e32c75b6bb690c4a8a81d00e4a | [] | no_license | 6samurai/VerTech_ModelJUnit | d2255cbc5368de00c3bf68c8748c3e0e8e969035 | 8c006416526a4f3b8739730c6ee3bb6d9470839f | refs/heads/master | 2020-04-20T22:10:17.362827 | 2019-04-26T14:44:25 | 2019-04-26T14:44:25 | 169,130,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,257 | java | package com.liftmania;
public class Lift {
int id;
boolean moving=false;
int floor = 0;
boolean doorsOpen = false;
boolean moveUp =true;//false implies that lift is moving downward
boolean betweenFloors = false;
public boolean getBetweenFloors(){
return betweenFloors;
}
public void setBetweenFloors(boolean betweenFloors){
this.betweenFloors = betweenFloors;
}
public int getId() {
return id;
}
public boolean getIsMovingUp() {
return moveUp;
}
public void setIsMovingUp(boolean moveUp) {
this.moveUp = moveUp;
}
public boolean isMoving() {
return moving;
}
public void setMoving(boolean moving) {
this.moving = moving;
}
public Lift(int id) {
this.id = id;
}
public void setFloor(int floor) {
this.floor = floor;
}
public int getFloor() {
return floor;
}
public boolean isOpen() {
return doorsOpen;
}
public void closeDoors() {
doorsOpen = false;
}
public void openDoors() {
doorsOpen = true;
}
/**
* Calculates the distance of a lift from a particular floor
*
* @param floor
* - The floor number to measure distance to.
* @return
*/
public int distanceFromFloor(int floor) {
//return Math.abs(this.floor - floor);
return this.floor - floor;
}
}
| [
"christzammit93@gmail.com"
] | christzammit93@gmail.com |
459492994bf2eb8a62b8bf5dd8b4d98fd7395dfc | 322ad0d0aebeb3b67f82104b63207d6ac8c89c3d | /app/src/main/java/buy/win/com/winbuy/view/fragment/AttentionFragment.java | e8c1fbe0d6ae50f36661e25cee1a1678acd6c2e9 | [] | no_license | WUKIMDA/WinBuy | 468aad81df2927b9fca22f8251a80ee11467e644 | 67f7bdaacf0b0b33bdbeba7a0d37eb9eab8a6312 | refs/heads/master | 2020-08-29T00:49:52.730188 | 2017-06-21T00:52:43 | 2017-06-21T00:52:43 | 94,383,971 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 824 | java | package buy.win.com.winbuy.view.fragment;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.ButterKnife;
import buy.win.com.winbuy.R;
/**
* Created by 林特烦 on 2017/6/16.
*/
public class AttentionFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View rootView = View.inflate(getActivity(), R.layout.fragment_more_attention, null);
ButterKnife.bind(this, rootView);
return rootView;
}
@Override
public void onDestroyView() {
super.onDestroyView();
ButterKnife.unbind(this);
}
}
| [
"584393321@qq.com"
] | 584393321@qq.com |
db6884fac6a851884414eed4bcc1c4026ed1ea98 | 8b290fb5bb213c8fe83031f8d90ab4a59ab77d42 | /sale/alpssalefulfilmentprocess/src/com/bp/alps/fulfilmentprocess/actions/returns/PrintPackingLabelAction.java | 1556d19ea17bc34f94a5f8ec22fe933f295fd5f3 | [] | no_license | SSJLYY/SR2 | f5a05df0b6f8333890e5b91a95f99e6c260b447a | e69bc5295c9a7e995462e2eec989d06983e2b938 | refs/heads/master | 2020-03-30T06:04:40.417452 | 2018-10-24T03:14:50 | 2018-10-24T03:14:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,031 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2017 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package com.bp.alps.fulfilmentprocess.actions.returns;
import de.hybris.platform.processengine.action.AbstractProceduralAction;
import de.hybris.platform.returns.model.ReturnProcessModel;
import org.apache.log4j.Logger;
/**
* Mock implementation for printing packing label for the ReturnRequest
*/
public class PrintPackingLabelAction extends AbstractProceduralAction<ReturnProcessModel>
{
private static final Logger LOG = Logger.getLogger(PrintPackingLabelAction.class);
@Override
public void executeAction(final ReturnProcessModel process)
{
LOG.info("Process: " + process.getCode() + " in step " + getClass().getSimpleName());
}
}
| [
"18621616775@163.com"
] | 18621616775@163.com |
a1e713e501aeea7e7d31939ce2b23d4842101496 | e17bc90ede39fc9308e42bd7af03e8f0f6980ced | /src/main/java/com/lmm/template/StringDisplay.java | c2dce9b0e6c2b218051b766a7de4f4c7f1ecd9bd | [] | no_license | lmmProject/design_pattern | 7ac63f54f417db8f52ba8b2b17b8f515a57f6c52 | b19e68e4c0aa271b6e9a25ce4b68bf27ae33fc69 | refs/heads/master | 2020-03-29T13:14:57.694376 | 2018-12-13T08:31:01 | 2018-12-13T08:31:01 | 149,945,616 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 744 | java | package com.lmm.template;
/**
* @Author: lmm
* @Date: Created in 2018/9/25
* @Description:
*/
public class StringDisplay extends AbstractDisplay {
private String string;
private int width;
public StringDisplay (String string){
this.string = string;
this.width = string.getBytes().length;
}
@Override
public void open() {
printLine();
}
@Override
public void print() {
System.out.println("|"+string+"|");
}
@Override
public void close() {
printLine();
}
private void printLine(){
System.out.print("+");
for (int i = 0; i < width; i++){
System.out.print("-");
}
System.out.println("+");
}
}
| [
"752634866@qq.com"
] | 752634866@qq.com |
c82eecec63d9a140a6dd98ce84d48a81a37aacf9 | c4623aa95fb8cdd0ee1bc68962711c33af44604e | /src/com/google/android/gms/internal/jd$a.java | 8a92452803cb1b2b38e18066a582a70f3ed472bf | [] | no_license | reverseengineeringer/com.yelp.android | 48f7f2c830a3a1714112649a6a0a3110f7bdc2b1 | b0ac8d4f6cd5fc5543f0d8de399b6d7b3a2184c8 | refs/heads/master | 2021-01-19T02:07:25.997811 | 2016-07-19T16:37:24 | 2016-07-19T16:37:24 | 38,555,675 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 973 | java | package com.google.android.gms.internal;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.ConstantState;
final class jd$a
extends Drawable
{
private static final a a = new a();
private static final a b = new a(null);
public void draw(Canvas paramCanvas) {}
public Drawable.ConstantState getConstantState()
{
return b;
}
public int getOpacity()
{
return -2;
}
public void setAlpha(int paramInt) {}
public void setColorFilter(ColorFilter paramColorFilter) {}
private static final class a
extends Drawable.ConstantState
{
public int getChangingConfigurations()
{
return 0;
}
public Drawable newDrawable()
{
return jd.a.a();
}
}
}
/* Location:
* Qualified Name: com.google.android.gms.internal.jd.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
b6a5f3c23b2bd8483af3c2c0514dfd5c603745b6 | 6a7f6b5a22fa435a77a62b891c0178e5673da92a | /app/src/main/java/li/lingfeng/ltsystem/tweaks/entertainment/BilibiliDisableTeenModeHint.java | 3b1cf6b4d95b992c810de97695f3900d3738d7e1 | [] | no_license | bluesky139/LTweaksSystem | 7327f041559570effa39c8e66729448112e8b0fd | 662118fadfa9f795d7d9948d0778c66a0b0b2325 | refs/heads/master | 2022-10-05T11:57:41.172178 | 2022-10-04T04:11:22 | 2022-10-04T04:11:22 | 162,210,562 | 25 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,081 | java | package li.lingfeng.ltsystem.tweaks.entertainment;
import android.content.Intent;
import li.lingfeng.ltsystem.ILTweaks;
import li.lingfeng.ltsystem.R;
import li.lingfeng.ltsystem.lib.MethodsLoad;
import li.lingfeng.ltsystem.prefs.PackageNames;
import li.lingfeng.ltsystem.tweaks.TweakBase;
import li.lingfeng.ltsystem.utils.Logger;
@MethodsLoad(packages = PackageNames.BILIBILI, prefs = R.string.key_bilibili_disable_teen_mode_hint)
public class BilibiliDisableTeenModeHint extends TweakBase {
private static final String TEEN_MODE_DIALOG_ACTIVITY = "com.bilibili.teenagersmode.ui.TeenagersModeDialogActivity";
@Override
public void android_app_Activity__startActivityForResult__Intent_int_Bundle(ILTweaks.MethodParam param) {
param.before(() -> {
Intent intent = (Intent) param.args[0];
if (intent.getComponent() != null && intent.getComponent().getClassName().equals(TEEN_MODE_DIALOG_ACTIVITY)) {
Logger.v("Disable teen mode dialog hint.");
param.setResult(null);
}
});
}
}
| [
"bluesky139@gmail.com"
] | bluesky139@gmail.com |
c0986db9dfbaa10eb727e897dd86fcc229eaeef1 | fae8a82a660cc1884e0ebb9bb2acb91e4444626a | /2.JavaCore/src/com/javarush/task/task20/task2001/Solution.java | 0a875dd9b3d9ad646df7a1caac260382aa406b4f | [] | no_license | EdKayl/JavaRush | 71eedc834048dd553fa0606a1a8ea9bce8388da2 | fd9a4181f2fca591d8e10e470d7d8fca290c6a94 | refs/heads/master | 2021-01-18T12:56:39.015219 | 2017-09-26T17:21:00 | 2017-09-26T17:21:00 | 100,367,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,646 | java | package com.javarush.task.task20.task2001;
import java.io.*;
import java.util.*;
/*
Читаем и пишем в файл: Human
*/
public class Solution {
public static void main(String[] args) {
//исправьте outputStream/inputStream в соответствии с путем к вашему реальному файлу
try {
File your_file_name = File.createTempFile("human", null);
OutputStream outputStream = new FileOutputStream(your_file_name);
InputStream inputStream = new FileInputStream(your_file_name);
Human ivanov = new Human("Ivanov", new Asset("home"), new Asset("car"));
ivanov.save(outputStream);
outputStream.flush();
Human somePerson = new Human();
somePerson.load(inputStream);
//check here that ivanov equals to somePerson - проверьте тут, что ivanov и somePerson равны
if(ivanov.equals(somePerson)) System.out.println("yes");
inputStream.close();
} catch (IOException e) {
//e.printStackTrace();
System.out.println("Oops, something wrong with my file");
} catch (Exception e) {
//e.printStackTrace();
System.out.println("Oops, something wrong with save/load method");
}
}
public static class Human {
public String name;
public List<Asset> assets = new ArrayList<>();
public Human() {
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Human human = (Human) o;
if (name != null ? !name.equals(human.name) : human.name != null) return false;
return assets != null ? assets.equals(human.assets) : human.assets == null;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (assets != null ? assets.hashCode() : 0);
return result;
}
public Human(String name, Asset... assets) {
this.name = name;
if (assets != null) {
this.assets.addAll(Arrays.asList(assets));
}
}
public void save(OutputStream outputStream) throws Exception {
//implement this method - реализуйте этот метод
PrintWriter out = new PrintWriter(outputStream);
out.println(this.name);
out.println(assets.size());
if(assets.size() > 0) {
for(Asset asset : assets) {
out.println(asset.getName() + "|" + asset.getPrice());
}
}
out.close();
}
public void load(InputStream inputStream) throws Exception {
//implement this method - реализуйте этот метод
Scanner scanner = new Scanner(inputStream);
this.name = scanner.nextLine();
int arrSize = Integer.parseInt(scanner.nextLine());
if(arrSize > 0) {
for(int i = 0; i < arrSize; i++) {
String[] tokens = scanner.nextLine().split("\\|");
String name = tokens[0];
double price = Double.parseDouble(tokens[1]);
Asset asset = new Asset(name);
asset.setPrice(price);
this.assets.add(asset);
}
}
scanner.close();
}
}
}
| [
"edk2005@yandex.ru"
] | edk2005@yandex.ru |
9878a63701016197efa1c63d9ff9ad645cc03d29 | a1b4eccf3192d372eb2715f38f1a6005c28ff6fa | /src/test/java/Target/TestTargetDetailPage.java | 3dbce1bf9bd241e46c35c181325cce2c582cb16b | [] | no_license | aobando123/proyecto_qa | eefdde0109075a724246b56cb9379e1f65fb7925 | cf4cb6d16194abc8a63d2d487915955cebdcd9c3 | refs/heads/master | 2023-04-10T11:32:20.784396 | 2021-04-30T03:03:31 | 2021-04-30T03:03:31 | 343,256,269 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 716 | java | package Target;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class TestTargetDetailPage extends BaseTest{
public TargetDetailPage TDP;
public TargetSearchPage TSP;
@BeforeMethod
public void methodLevelSetUp()
{
TDP = new TargetDetailPage(driver);
TSP = new TargetSearchPage(driver);
}
@Test
public void testDisplayDetailItem() throws InterruptedException {
TSP.searchItem("microphone");
Assert.assertTrue(TDP.getDetailElement());
}
@Test
public void testNotDetailFoundItem() throws InterruptedException {
Assert.assertTrue(TDP.getNotFoundElement());
}
}
| [
"jsolanom@ucenfotec.ac.cr"
] | jsolanom@ucenfotec.ac.cr |
5ec098156ef1e198c5a2eaeb39560c2bed7cc700 | bdd58056ca19a24ab8f3d56dbd1d64f4d5542661 | /app/src/main/java/com/unocinco/QuestDay.java | 6d1e2702b6afce9bc9713384215eeffe3ac5d179 | [] | no_license | justvaclav/UnoCinco | 4e59aa9fe5dfac17ae76904883511c10702213b6 | 5118a757cb47cfc2fa7fd810db18f76b5862b3b6 | refs/heads/master | 2020-03-18T12:37:21.973452 | 2018-05-24T15:24:51 | 2018-05-24T15:24:51 | 134,734,887 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,578 | java | package com.unocinco;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link QuestDay.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link QuestDay#newInstance} factory method to
* create an instance of this fragment.
*/
public class QuestDay extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private OnFragmentInteractionListener mListener;
public QuestDay() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment QuestDay.
*/
// TODO: Rename and change types and number of parameters
public static QuestDay newInstance(String param1, String param2) {
QuestDay fragment = new QuestDay();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_quest_day2, container, false);
}
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
}
| [
"39595190+justvaclav@users.noreply.github.com"
] | 39595190+justvaclav@users.noreply.github.com |
cc7d9129e0c9f06619e1bd4216cdb658b6aab465 | e631ff6830b062b38c3d47e0a3681c031d78878f | /CourseDemo/src/edu/wust/JDBC/model/student.java | b9575d23a7ad756251d499e87ecea4026ae74cc1 | [] | no_license | guxi/CourseDemo | bc4447ecac8c4340fe27adb3c41b6befdd4f500e | 7467f7b64afe308f00eb1fa4713960106c5c0e68 | refs/heads/master | 2021-01-23T08:49:30.390746 | 2017-10-01T03:38:39 | 2017-10-01T03:38:39 | 102,556,704 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,154 | java | package edu.wust.JDBC.model;
import java.util.Date;
public class student {
private String studentNo;
private Date birthday;
private String classNo;
private String nation;
private String native_;
private String sex;
private String studentName;
/////////////////////////////////
public String getStudentNo() {
return studentNo;
}
public void setStudentNo(String studentNo) {
this.studentNo = studentNo;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getClassNo() {
return classNo;
}
public void setClassNo(String classNo) {
this.classNo = classNo;
}
public String getNation() {
return nation;
}
public void setNation(String nation) {
this.nation = nation;
}
public String getNative_() {
return native_;
}
public void setNative_(String native_) {
this.native_ = native_;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
}
| [
"guxi@live.com"
] | guxi@live.com |
aded6be8eb5d87fd3ddb74a4db68d77b7af54557 | fe08cf9d0c20181250f1d4ca3910c9c3ead4c585 | /module/core/src/main/java/zut/cs/core/rest/ConnectionController.java | f25a5fe20c0f63747d5d0190924744b6edebbebb | [] | no_license | zut-huangtang/zutnp_paltform | 7d1c97bd889192ed2048baf4613702e6f5d8e7b9 | 47277aa20a0aaaaa2d5fe33c4841a0efc721d7fc | refs/heads/master | 2020-08-10T20:55:36.237759 | 2019-10-11T08:12:48 | 2019-10-11T08:12:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,723 | java | package zut.cs.core.rest;
import zut.cs.core.base.rest.GenericController;
import zut.cs.core.domain.Connection;
import zut.cs.core.domain.TableMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import zut.cs.core.service.ConnectionManager;
import zut.cs.core.service.TableMessageManager;
import java.util.ArrayList;
import java.util.List;
/*
Authod:NoOne!
*/
@Controller
@RequestMapping("/Connection")
public class ConnectionController extends GenericController<Connection, Long, ConnectionManager> {
ConnectionManager connectionManager;
@Autowired
public void setConnectionManager(ConnectionManager connectionManager) {
this.connectionManager = connectionManager;
this.manager = this.connectionManager;
}
//+++++++++
@Autowired
TableMessageManager tableMessageManager;
@RequestMapping(value = "/list")
@ResponseBody
public List<Connection> list() {
List<Connection> connectionList = new ArrayList<Connection>();
connectionList = this.connectionManager.findAll();
return connectionList;
}
@PostMapping(value = "/add", consumes = "application/json;charset=UTF-8", produces = {"application/json"})
@ResponseBody
public Boolean add(@RequestBody Connection connection,
//++++++++
@RequestParam("TableMessageName") String TableMessageName) {
TableMessage tableMessage = this.tableMessageManager.findByTableName(TableMessageName);
if (tableMessage != null) {
System.out.println("hhhhh,找到了tableMessage");
if (this.connectionManager.findByConnectionName(connection.getConnectionName()) == null) {
System.out.println("hhhhh,connectionManager不为空");
connection.setTableMessage(tableMessage);
this.connectionManager.save(connection);
//
int a = tableMessage.getSonNumber();
if (connection.getTableConnectionSonTableName() != null) {
a = a + 1;
System.out.println("hhhhh,这里更改了son" + a);
}
tableMessage.setSonNumber(a);
this.tableMessageManager.save(tableMessage);
if (this.connectionManager.findByConnectionName(connection.getConnectionName()) != null) {
return true;
}
}
} else {
System.out.println(",表为空,不能建立属性在找到之后返回空");
return false;
}
return false;
}
@ResponseBody
@PostMapping(value = "/updata", consumes = "application/json")
public boolean updata(@RequestBody Connection connection,
@RequestParam("ConnectionName") String ConnectionName) {
if (this.connectionManager.findByConnectionName(ConnectionName) == null) {
return false;
} else {
this.connectionManager.updata(connection);
return true;
}
}
@ResponseBody
@PostMapping(value = "/check/{Connectionname}")
public Connection findConnection(@PathVariable @RequestParam("ConnectionName") String ConnectionName) {
if (this.connectionManager.findByConnectionName(ConnectionName) != null) {
return this.connectionManager.findByConnectionName(ConnectionName);
}
return null;
}
@ResponseBody
@PostMapping(value = "/delete")
public boolean delete(@PathVariable @RequestParam("ConnectionName") String ConnectionName) {
if (this.connectionManager.findByConnectionName(ConnectionName) == null) {
return false;
} else {
Connection connection = this.connectionManager.findByConnectionName(ConnectionName);
Long id = connection.getId();
if (connection.getTableConnectionPropsOneOrTwo() == true) {
TableMessage tableMessage = this.tableMessageManager.findByTableName(connection.getTableConnectionParentTableName());
if (tableMessage != null) {
int a = tableMessage.getSonNumber() - 1;
tableMessage.setSonNumber(a);
this.tableMessageManager.save(tableMessage);
} else {
return false;
}
}
this.connectionManager.delete(id);
if ((this.connectionManager.findByConnectionName(ConnectionName) == null) == true) {
return true;
}
}
return false;
}
}
| [
"1959724905@qq.com"
] | 1959724905@qq.com |
3d78d79866cb10a8f676d4f9f534e6538e695a9f | 0837424a8a3a22caaab3fe82a6c1c3208fdbfb3b | /Garage/src/garage/Motorbike.java | 92d65db67ecbf0ae9e874918a55444f6d8ae4a74 | [] | no_license | raihanp123/Garage-Exercise | 82d0fdb7b70771179ad421e43c9a128d5999039a | 24147c53b2e570c04773a6c618f5694d374e3de8 | refs/heads/main | 2023-06-17T00:37:34.615117 | 2021-07-07T15:39:34 | 2021-07-07T15:39:34 | 383,783,697 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 462 | java | package garage;
public class Motorbike extends Vehicle {
private int handlebarMirrors;
public Motorbike(int id, int numberOfWheels, String colour, String make, int numberOfRadioStations) {
super(id, numberOfWheels, colour, make);
this.setHandlebarMirrors(handlebarMirrors);
}
public int getHandlebarMirrors() {
return handlebarMirrors;
}
public void setHandlebarMirrors(int handlebarMirrors) {
this.handlebarMirrors = handlebarMirrors;
}
}
| [
"raihan-p@outlook.com"
] | raihan-p@outlook.com |
df689e2d3a3c0d3f40fa2dda0832c6117937c68f | bad652c9f471465cee3e2a4c7967097e98d3f130 | /src/main/java/com/tcw/common/NewCarRegisterService.java | 5de516c23d9f873345765dab0a8c60f00b5699b7 | [] | no_license | myliuzhen/ershouche-m_maven | c5974919859333881f56f3bc62c8ccf0488ce002 | e884c84b462923a93f7c845e28240462e561e53c | refs/heads/master | 2021-01-10T06:56:16.701069 | 2016-03-02T08:06:44 | 2016-03-02T08:06:44 | 52,944,097 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,496 | java | package com.tcw.common;
import java.util.Date;
import org.apache.log4j.Logger;
import com.tuanche.crm.bean.Member;
import com.tuanche.crm.common.BizCodes;
import com.tuanche.crm.common.Sources;
import com.tuanche.crm.exception.CrmException;
import com.tuanche.crm.service.member.IMemberRegisterService;
import com.tuanche.crm.service.member.impl.MemberRegisterServiceImpl;
/**
* 新车报名服务类
*
*/
public class NewCarRegisterService implements Runnable{
private Logger log = Logger.getLogger(this.getClass());
private String phone;
public NewCarRegisterService(String phone){
this.phone = phone;
}
@Override
public void run() {
Member member = new Member();
member.setPhone(Long.parseLong(phone)); //手机号码
member.setBizCode(BizCodes.EMAICHE_BIZ_CODE); //来源系统编码
member.setSource(Sources.SOURCE_WAP); //注册来源
try{
//MemberRegisterServiceImpl 建议用spring管理 一遍后面发布成dubbo服务时好替换
IMemberRegisterService service = new MemberRegisterServiceImpl();
member = service.registerMember(member);
}catch(CrmException e){
Date date = new Date();
log.error("二手车报名调用新车接口失败,报名电话:"+phone+",时间:"+CommonUtils.formatDate(date, "yyyy/MM/dd HH:mm:ss"));
log.error("Caused by: com.tuanche.crm.exception.CrmException: the user has exist");
}
System.out.println("------------------调用新车报名接口服务返回memberId:"+member.getId());
}
}
| [
"liuzhen@tuanche.com"
] | liuzhen@tuanche.com |
2fbc53c12f9cee674d696263665941b103bd1d11 | 7cd1e4b892a2eb11ebe7c8d21506e10ab435b2f7 | /flimhub/flimhub/src/main/java/com/ticketbooking/api/flimhub/web/LocationController.java | 5390d2a254eb05f2d2110b9faba9ce55ee5a5232 | [] | permissive | DhanaPriyaCSE/movie-booking | 231baa4fdeb3c6e2b5b30977ffcb01c74fd90fc5 | 597c647f81b731a137ad6571f0d86bb15ec1864b | refs/heads/master | 2021-08-08T12:07:53.443686 | 2020-06-08T03:42:17 | 2020-06-08T03:42:17 | 188,643,209 | 0 | 0 | Apache-2.0 | 2019-05-26T05:18:49 | 2019-05-26T05:18:49 | null | UTF-8 | Java | false | false | 2,066 | java | package com.ticketbooking.api.flimhub.web;
import com.ticketbooking.api.flimhub.model.Location;
import com.ticketbooking.api.flimhub.repository.LocationRepository;
import com.ticketbooking.api.flimhub.service.LocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
import java.util.List;
import java.util.Optional;
@RestController
@RequestMapping("/api")
public class LocationController {
@Autowired
private LocationRepository locationRepository;
@RequestMapping(value="/locations ", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public List<Location> getAllLocation(){
return (List<Location>) locationRepository.findAll();
}
@RequestMapping(value="/locations ", method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity<Location> createLocation(@RequestBody Location location){
Location createdLocation = locationRepository.save(location);
return Optional.ofNullable(createdLocation)
.map(u -> ResponseEntity.ok().body(u))
.orElse (ResponseEntity.notFound().build());
}
@RequestMapping(value="/locations ", method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity<Location> CreateLocation(@RequestBody Location location){
Location createdLocation = locationRepository.save(location);
return Optional.ofNullable(createdLocation)
.map(u -> ResponseEntity.ok().body(u))
.orElse (ResponseEntity.notFound().build());
}
}
| [
"DhanaPriya.K@mrcooper.com"
] | DhanaPriya.K@mrcooper.com |
0a92038d1132c8be6f2be701aa42c4ab95858b94 | 3630ac87f39a4c7508dd9b48007f2cc2bd7cc43f | /SampleMaven/src/test/java/org/testngpara/ExecutableParaWithHard.java | a47defdf67d333cc467b87645b5e66fc3962b5a0 | [] | no_license | Yedhu1991/Cucumber | 39d5701a7d4ae935321fb0dc8a8e2174158aabf3 | d22718bc996493ba46ad318f1d3ef906d189cb24 | refs/heads/master | 2022-12-05T01:35:02.326445 | 2020-09-04T09:07:02 | 2020-09-04T09:07:02 | 292,794,059 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,782 | java | package org.testngpara;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptException;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
import org.testng.Assert;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import org.testng.asserts.SoftAssert;
public class ExecutableParaWithHard {
@Parameters({"url","username","password"})
@Test
//used Assert(hard assert)
public void test1(String ur,String un,String pas) throws AWTException, InterruptedException {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Yedhu\\eclipse-workspace\\SampleMaven\\div\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get(ur);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
Robot r=new Robot();
r.keyPress(KeyEvent.VK_ENTER);
r.keyRelease(KeyEvent.VK_ENTER);
Assert.assertTrue(driver.getTitle().contains("Next Generation"));
WebElement uname = driver.findElement(By.id("userName"));
uname.sendKeys(un);
Assert.assertEquals("yedhumon123", un);
WebElement upas = driver.findElement(By.id("usrPwd"));
upas.sendKeys(pas);
Assert.assertEquals("Yedhu123456", pas);
WebElement upascon = driver.findElement(By.id("cnfUsrPwd"));
upascon.sendKeys(pas);
Assert.assertEquals("Yedhu323456", pas);
Thread.sleep(4000);
driver.quit();
}
@Parameters({"url","username","password"})
@Test
public void test2(String ur,String un,String pas) throws AWTException {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Yedhu\\eclipse-workspace\\SampleMaven\\div\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get(ur);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
Robot r=new Robot();
r.keyPress(KeyEvent.VK_ENTER);
r.keyRelease(KeyEvent.VK_ENTER);
SoftAssert s=new SoftAssert();
s.assertTrue(driver.getTitle().contains("Next Generation"));
WebElement uname = driver.findElement(By.id("userName"));
uname.sendKeys(un);
s.assertEquals("yedhumon123", un);
WebElement upas = driver.findElement(By.id("usrPwd"));
upas.sendKeys(pas);
s.assertEquals("Yedhu10023456", pas);
WebElement upascon = driver.findElement(By.id("cnfUsrPwd"));
upascon.sendKeys(pas);
s.assertEquals("Yedhu123456", pas);
//s.assertAll();
}
}
| [
"monyedhu@gmail.com"
] | monyedhu@gmail.com |
922129b0bd7403a77e858a989d007a5618aacf53 | 165ed219e683925abee5b84c78668c239f580058 | /mats-impl-jms/src/main/java/com/stolsvik/mats/impl/jms/JmsMatsJmsSessionHandler_Simple.java | 46481a1d5bc7aaae3528dbd51d79d2e15954028e | [
"Apache-2.0"
] | permissive | staale/mats | e3c2aae79283d1b6fcc30fd320d92c227936fa88 | b589330ad49b3a8652f8281ecd2df6f2ddd4f72a | refs/heads/master | 2021-08-10T15:29:58.236808 | 2020-04-28T08:01:56 | 2020-04-28T08:01:56 | 184,655,072 | 0 | 0 | null | 2019-05-02T21:40:03 | 2019-05-02T21:40:03 | null | UTF-8 | Java | false | false | 9,719 | java | package com.stolsvik.mats.impl.jms;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.Connection;
import javax.jms.MessageProducer;
import javax.jms.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.stolsvik.mats.impl.jms.JmsMatsTransactionManager.JmsMatsTxContextKey;
/**
* A dead simple implementation of {@link JmsMatsJmsSessionHandler} which does nothing of pooling nor connection
* sharing. For StageProcessors (endpoints), this actually is one of the interesting options: Each StageProcessor has
* its own Connection with a sole Session. But for Initiators, it is pretty bad: Each initiation constructs one
* Connection (with a sole Session), and then closes the whole thing down after the initiation is done (message(s) is
* sent).
*/
public class JmsMatsJmsSessionHandler_Simple implements JmsMatsJmsSessionHandler, JmsMatsStatics {
private static final Logger log = LoggerFactory.getLogger(JmsMatsJmsSessionHandler_Simple.class);
private final JmsConnectionSupplier _jmsConnectionSupplier;
public JmsMatsJmsSessionHandler_Simple(JmsConnectionSupplier jmsConnectionSupplier) {
_jmsConnectionSupplier = jmsConnectionSupplier;
}
@Override
public JmsSessionHolder getSessionHolder(JmsMatsInitiator<?> initiator) throws JmsMatsJmsException {
JmsSessionHolder jmsSessionHolder = getSessionHolder_internal(initiator);
if (log.isDebugEnabled()) log.debug(LOG_PREFIX + "getSessionHolder(...) for Initiator [" + initiator
+ "], returning [" + jmsSessionHolder + "].");
return jmsSessionHolder;
}
@Override
public JmsSessionHolder getSessionHolder(JmsMatsStageProcessor<?, ?, ?, ?> stageProcessor)
throws JmsMatsJmsException {
JmsSessionHolder jmsSessionHolder = getSessionHolder_internal(stageProcessor);
if (log.isDebugEnabled()) log.debug(LOG_PREFIX + "getSessionHolder(...) for StageProcessor [" + stageProcessor
+ "], returning [" + jmsSessionHolder + "].");
return jmsSessionHolder;
}
private AtomicInteger _numberOfOutstandingConnections = new AtomicInteger(0);
@Override
public int closeAllAvailableSessions() {
/* nothing to do here, as each SessionHolder is an independent connection */
// Directly return the number of outstanding connections.
return _numberOfOutstandingConnections.get();
}
private JmsSessionHolder getSessionHolder_internal(JmsMatsTxContextKey txContextKey) throws JmsMatsJmsException {
Connection jmsConnection;
try {
jmsConnection = _jmsConnectionSupplier.createJmsConnection(txContextKey);
}
catch (Throwable t) {
throw new JmsMatsJmsException("Got problems when trying to create a new JMS Connection.", t);
}
// We now have an extra JMS Connection - "count it"
_numberOfOutstandingConnections.incrementAndGet();
// Starting it right away, as that could potentially also give "connection establishment" JMSExceptions
try {
jmsConnection.start();
}
catch (Throwable t) {
try {
_numberOfOutstandingConnections.decrementAndGet();
jmsConnection.close();
}
catch (Throwable t2) {
log.error(LOG_PREFIX + "Got " + t2.getClass().getSimpleName() + " when trying to close a JMS Connection"
+ " after it failed to start. [" + jmsConnection + "]. Ignoring.", t);
}
throw new JmsMatsJmsException("Got problems when trying to start a new JMS Connection.", t);
}
// ----- The JMS Connection is gotten and started.
// :: Create JMS Session and stick it in a Simple-holder
Session jmsSession;
try {
jmsSession = jmsConnection.createSession(true, Session.SESSION_TRANSACTED);
}
catch (Throwable t) {
try {
_numberOfOutstandingConnections.decrementAndGet();
jmsConnection.close();
}
catch (Throwable t2) {
log.error(LOG_PREFIX + "Got " + t2.getClass().getSimpleName() + " when trying to close a JMS Connection"
+ " after it failed to create a new Session. [" + jmsConnection + "]. Ignoring.", t2);
}
throw new JmsMatsJmsException(
"Got problems when trying to create a new JMS Session from a new JMS Connection ["
+ jmsConnection + "].", t);
}
// :: Create The default MessageProducer, and then stick the Session and MessageProducer in a SessionHolder.
try {
MessageProducer messageProducer = jmsSession.createProducer(null);
return new JmsSessionHolder_Simple(jmsConnection, jmsSession, messageProducer);
}
catch (Throwable t) {
try {
_numberOfOutstandingConnections.decrementAndGet();
jmsConnection.close();
}
catch (Throwable t2) {
log.error(LOG_PREFIX + "Got " + t2.getClass().getSimpleName() + " when trying to close a JMS Connection"
+ " after it failed to create a new MessageProducer from a newly created JMS Session. ["
+ jmsConnection + ", " + jmsSession + "]. Ignoring.", t2);
}
throw new JmsMatsJmsException("Got problems when trying to create a new MessageProducer from a new JMS"
+ " Session [" + jmsSession + "] created from a new JMS Connection [" + jmsConnection + "].", t);
}
}
private static final Logger log_holder = LoggerFactory.getLogger(JmsSessionHolder_Simple.class);
public class JmsSessionHolder_Simple implements JmsSessionHolder {
private final Connection _jmsConnection;
private final Session _jmsSession;
private final MessageProducer _messageProducer;
public JmsSessionHolder_Simple(Connection jmsConnection, Session jmsSession, MessageProducer messageProducer) {
_jmsConnection = jmsConnection;
_jmsSession = jmsSession;
_messageProducer = messageProducer;
}
@Override
public void isSessionOk() throws JmsMatsJmsException {
if (_shutDown.get()) {
throw new JmsMatsJmsException("SessionHolder is shut down.");
}
JmsMatsMessageBrokerSpecifics.isConnectionLive(_jmsConnection);
}
@Override
public Session getSession() {
if (log_holder.isDebugEnabled()) log_holder.debug(LOG_PREFIX + "getSession() on SessionHolder [" + this
+ "], returning directly.");
return _jmsSession;
}
@Override
public MessageProducer getDefaultNoDestinationMessageProducer() {
return _messageProducer;
}
private AtomicBoolean _shutDown = new AtomicBoolean();
@Override
public void close() {
boolean alreadyShutdown = _shutDown.getAndSet(true);
if (alreadyShutdown) {
if (log.isDebugEnabled()) log.debug(LOG_PREFIX + "When trying to close [" + this
+ "], it was already shut down.");
return;
}
if (log_holder.isDebugEnabled()) log_holder.debug(LOG_PREFIX + "close() on SessionHolder [" + this
+ "] - closing JMS Connection.");
try {
_numberOfOutstandingConnections.decrementAndGet();
_jmsConnection.close();
}
catch (Throwable t) {
log_holder.warn("Got problems when trying to close the JMS Connection due to .close() invoked.", t);
}
}
@Override
public void release() {
boolean alreadyShutdown = _shutDown.getAndSet(true);
if (alreadyShutdown) {
if (log.isDebugEnabled()) log.debug(LOG_PREFIX + "When trying to release [" + this
+ "], it was already shut down.");
return;
}
if (log_holder.isDebugEnabled()) log_holder.debug(LOG_PREFIX + "release() on SessionHolder [" + this
+ "] - closing JMS Connection.");
try {
_numberOfOutstandingConnections.decrementAndGet();
_jmsConnection.close();
}
catch (Throwable t) {
log_holder.warn("Got problems when trying to close the JMS Connection due to .release() invoked.", t);
}
}
@Override
public void crashed(Throwable t) {
boolean alreadyShutdown = _shutDown.getAndSet(true);
if (alreadyShutdown) {
if (log.isDebugEnabled()) log.debug(LOG_PREFIX + "When trying to crash [" + this
+ "], it was already shut down.");
return;
}
if (log_holder.isDebugEnabled()) log_holder.debug(LOG_PREFIX + "crashed() on SessionHolder [" + this
+ "] - closing JMS Connection.", t);
try {
_numberOfOutstandingConnections.decrementAndGet();
_jmsConnection.close();
}
catch (Throwable t2) {
log_holder.warn(LOG_PREFIX + "Got problems when trying to close the JMS Connection due to a"
+ " \"JMS Crash\" (" + t.getClass().getSimpleName() + ": " + t.getMessage() + ").", t2);
}
}
}
}
| [
"endre@stolsvik.com"
] | endre@stolsvik.com |
bf9024551a00915f55809d31ed8f638f55cf45a9 | 2f2e02b6f0ce5b52ce7a68a2267460f61008ec3c | /src/chap2/Reservation.java | 4a6a1a1fae98aa413620dcea92b9eb8bfee08491 | [] | no_license | sjaqjwor/Object | 6000f2e505c381c43799ab2da149a30b0b25c250 | 66b8912e372f5084ed3d56301b9417cb96036faf | refs/heads/master | 2020-06-27T04:51:15.586765 | 2019-08-05T10:22:26 | 2019-08-05T10:22:26 | 199,848,639 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package chap2;
public class Reservation {
private Customer customer;
private Screening screening;
private Money fee;
private int audienceCount;
public Reservation(Customer customer, Screening screening, Money fee, int audienceCount) {
this.customer=customer;
this.screening=screening;
this.fee=fee;
this.audienceCount=audienceCount;
}
}
| [
"lsklsk45@naver.com"
] | lsklsk45@naver.com |
a7a855a1d800851a26dab231593ff2f1ccdd0fd8 | 015c41af5805fd1375050ff6e8958466af94ce18 | /app/mk/ck/energy/csm/model/codecs/AddressLocationCodec.java | a3a35a0876e841e2f873fe97537d7809461058eb | [] | no_license | rkupriyanetc/csm-db-transfer | 18334319abdd63e6b8b4be61a50b2b264c4d5349 | 1ba911e465975cbe09d8a7af293fbc2d6ebdc915 | refs/heads/master | 2021-01-13T01:50:52.416839 | 2016-01-16T12:29:05 | 2016-01-16T12:29:05 | 41,441,841 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,001 | java | package mk.ck.energy.csm.model.codecs;
import java.util.List;
import mk.ck.energy.csm.model.AddressLocation;
import org.bson.BsonArray;
import org.bson.BsonReader;
import org.bson.BsonValue;
import org.bson.BsonWriter;
import org.bson.Document;
import org.bson.codecs.Codec;
import org.bson.codecs.CollectibleCodec;
import org.bson.codecs.DecoderContext;
import org.bson.codecs.DocumentCodec;
import org.bson.codecs.EncoderContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AddressLocationCodec implements CollectibleCodec< AddressLocation > {
protected static final Logger LOGGER = LoggerFactory.getLogger( AddressLocationCodec.class );
private static final String DB_FIELD_ID = "_id";
private static final String DB_FIELD_LOCATION = "location";
private static final String DB_FIELD_LOCATION_TYPE = "location_type";
private static final String DB_FIELD_ADMINISTRATIVE_CENTER_TYPE = "administrative_type";
private static final String DB_FIELD_REFERENCE_TO_TOP_ADDRESS = "top_address_id";
private final Codec< Document > documentCodec;
public AddressLocationCodec() {
this.documentCodec = new DocumentCodec();
}
public AddressLocationCodec( final Codec< Document > codec ) {
this.documentCodec = codec;
}
@Override
public void encode( final BsonWriter writer, final AddressLocation value, final EncoderContext encoderContext ) {
final Document document = new Document( DB_FIELD_ID, value.getId() );
document.append( DB_FIELD_LOCATION, value.getLocation() );
document.append( DB_FIELD_LOCATION_TYPE, value.getString( DB_FIELD_LOCATION_TYPE ) );
final String addrTop = value.getTopAddressId();
if ( addrTop != null && !addrTop.isEmpty() )
document.append( DB_FIELD_REFERENCE_TO_TOP_ADDRESS, addrTop );
final Object o = value.get( DB_FIELD_ADMINISTRATIVE_CENTER_TYPE );
if ( o != null )
document.append( DB_FIELD_ADMINISTRATIVE_CENTER_TYPE, o );
documentCodec.encode( writer, document, encoderContext );
}
@Override
public Class< AddressLocation > getEncoderClass() {
return AddressLocation.class;
}
@Override
public AddressLocation decode( final BsonReader reader, final DecoderContext decoderContext ) {
final Document document = documentCodec.decode( reader, decoderContext );
final AddressLocation addr = AddressLocation.create();
addr.setId( document.getString( DB_FIELD_ID ) );
addr.put( DB_FIELD_LOCATION, document.getString( DB_FIELD_LOCATION ) );
addr.put( DB_FIELD_LOCATION_TYPE, document.getString( DB_FIELD_LOCATION_TYPE ) );
addr.setTopAddressId( document.getString( DB_FIELD_REFERENCE_TO_TOP_ADDRESS ) );
List< ? > list = null;
final Object o = document.get( DB_FIELD_ADMINISTRATIVE_CENTER_TYPE );
if ( o == null )
addr.setAdministrativeCenterType( null );
else
try {
if ( List.class.isInstance( o ) ) {
list = List.class.cast( o );
list = addr.listStringAsBsonArray( addr.extractAsListStringValues( list ) );
} else
if ( BsonArray.class.isInstance( o ) )
list = BsonArray.class.cast( o );
addr.setAdministrativeCenterType( list );
}
catch ( final ClassCastException cce ) {
LOGGER.warn( "Error casting array of AdministrativeCenterType {}", o );
}
return addr;
}
@Override
public boolean documentHasId( final AddressLocation document ) {
return document.getId() == null;
}
@Override
public AddressLocation generateIdIfAbsentFromDocument( final AddressLocation document ) {
if ( documentHasId( document ) ) {
document.createId();
return document;
} else
return document;
}
@Override
public BsonValue getDocumentId( final AddressLocation document ) {
if ( !documentHasId( document ) )
throw new IllegalStateException( "The document does not contain an _id" );
return BsonValue.class.cast( document.getId() );
}
}
| [
"rvk@Handy"
] | rvk@Handy |
c04df33c756e7fd5142c3b1e45b664a6a8fdb563 | 785b3fd41a1c941f71719ec3dbfcbc86b88a77d3 | /src/com/authorprofiling/extractfeatureswordsForAge/Main.java | 039d59318301bce838adf35411f3e0b8887315d5 | [] | no_license | santoshkosgi/AuthorProfiling | f5d67b203b509763521efba14e71dda70a9b37dc | 492c89a8875208f3d350d0c709b99fe7912ee15f | refs/heads/master | 2021-01-23T16:37:32.041665 | 2013-09-23T07:44:53 | 2013-09-23T07:44:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,475 | java | package com.authorprofiling.extractfeatureswordsForAge;
import java.io.IOException;
public class Main {
static String sourcePath = "/home/santosh/Downloads/AP/Experiment1/index/Age/3.txt";
static String sourcePathFor10s = "/home/santosh/Downloads/AP/Experiment1/index/Age/10s.txt";
static String destFolderFor10s = "/home/santosh/Downloads/AP/Experiment1/index/Age/10s/";
static String sourcePathFor20s = "/home/santosh/Downloads/AP/Experiment1/index/Age/20s.txt";
static String destFolderFor20s = "/home/santosh/Downloads/AP/Experiment1/index/Age/20s/";
static String sourcePathFor30s = "/home/santosh/Downloads/AP/Experiment1/index/Age/30s.txt";
static String destFolderFor30s = "/home/santosh/Downloads/AP/Experiment1/index/Age/30s/";
public static void main(String argv[]) throws IOException {
MaxOccurence maxOccurence = new MaxOccurence();
sortFeatures Sortfeatures = new sortFeatures();
maxOccurence.maxOccurence(sourcePath,sourcePathFor10s,sourcePathFor20s,sourcePathFor30s);
Sortfeatures.SortFeatures(sourcePathFor10s,destFolderFor10s);
Sortfeatures.SortFeatures(sourcePathFor20s,destFolderFor20s);
Sortfeatures.SortFeatures(sourcePathFor30s,destFolderFor30s);
MergeBasedOnFrequency mergeBasedOnFrequency = new MergeBasedOnFrequency();
mergeBasedOnFrequency.mergeBasedOnFrequency(destFolderFor10s);
mergeBasedOnFrequency.mergeBasedOnFrequency(destFolderFor20s);
mergeBasedOnFrequency.mergeBasedOnFrequency(destFolderFor30s);
}
}
| [
"santoshkosgi@gmail.com"
] | santoshkosgi@gmail.com |
d726f95fd8f127fe92f6c4e94e44b73c66357419 | 07fa44ae1ab3fbbc7570131213f312cc1e3fd210 | /MovieProject/src/main/java/net/viralpatel/maven/MovieActionServlet.java | 5e4f4c923f64f4d7ecfcba0321a5182195c8617c | [] | no_license | mcdanielryan/SampleMovieProject | 322ba5a85bbdb27dfda567ade7c5745aff341966 | 29a237d2602fe5bb29c2dfc0c2ae084fb212aedd | refs/heads/master | 2021-01-11T15:19:12.674066 | 2017-01-29T04:25:59 | 2017-01-29T04:25:59 | 80,328,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,702 | java | package net.viralpatel.maven;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* Servlet implementation class MovieActionServlet
*/
public class MovieActionServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public MovieActionServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try{
Movie localMovie = ExternalMovieInformation.getMovieInformation(request.getParameter("movieName"));
request.setAttribute("movieName", localMovie.getTitle().toString());
request.setAttribute("movieGenre", localMovie.getGenre().toString());
request.setAttribute("movieRating", localMovie.getRated().toString());
request.setAttribute("moviePoster", localMovie.getPoster().toString());
response.setContentType("text/html");
request.getRequestDispatcher("/movie.jsp").forward(request, response);
}catch(Exception e){
System.out.println("Something happened Error: " + e);
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
| [
"mcdanielryanb@gmail.com"
] | mcdanielryanb@gmail.com |
8234027fb28649a8f3969f94b8f7aa6e9c3cb43c | c9ceeb7c6dd9390236085a54b671eab864218a73 | /src/main/java/com/vinayak/contactBookApp/exception/ResourceNotFoundException.java | 925cd0a6b875df78843171dc85703ebc0af9eaaa | [] | no_license | vinayak3022/ContactBookApp | e39a8ae7cb6e152c617d551777248f60adc99b15 | 48e484ae5fcadde6b2e9bcfa0e52082b1ffe18ac | refs/heads/master | 2020-04-04T18:33:47.391583 | 2018-11-05T11:29:13 | 2018-11-05T11:29:13 | 156,168,664 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 892 | java | package com.vinayak.contactBookApp.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class ResourceNotFoundException extends RuntimeException {
private String resourceName;
private String fieldName;
private Object fieldValue;
public ResourceNotFoundException( String resourceName, String fieldName, Object fieldValue) {
super(String.format("%s not found with %s : '%s'", resourceName, fieldName, fieldValue));
this.resourceName = resourceName;
this.fieldName = fieldName;
this.fieldValue = fieldValue;
}
public String getResourceName() {
return resourceName;
}
public String getFieldName() {
return fieldName;
}
public Object getFieldValue() {
return fieldValue;
}
} | [
"vinayak@ninjacart.com"
] | vinayak@ninjacart.com |
8e48047b170a7aabf181b4e3fc6257e65c151780 | 513e032b3791f1ede289b52aa30e3156e1223c8d | /18OneToManyDemo/src/com/omkar/pojo/Course.java | 798ae39588bcd1236f5694d435963af41cee3a90 | [] | no_license | omkargupte/Hibernate-Applications | 568d71d60a91677e26b5a014c5070b4a626c8622 | a05966297989de68c80eba4fff12dd578c9dcfff | refs/heads/master | 2020-04-03T22:09:44.470450 | 2018-11-21T18:57:22 | 2018-11-21T18:57:22 | 155,592,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 448 | java | package com.omkar.pojo;
public class Course {
private int cno;
private String cname;
public Course()
{
}
public int getCno() {
return cno;
}
public void setCno(int cno) {
this.cno = cno;
}
public String getCname() {
return cname;
}
public void setCname(String cname) {
this.cname = cname;
}
@Override
public String toString() {
return "Course [cno=" + cno + ", cname=" + cname + "]";
}
}
| [
"Omkar Gupte@192.168.0.8"
] | Omkar Gupte@192.168.0.8 |
0460ec6174f83f06edc77b0663e8ee4351170c48 | a4178e5042f43f94344789794d1926c8bdba51c0 | /iwxxm2Converter/src/schemabindings/schemabindings21/org/isotc211/_2005/gco/MemberNameType.java | f68358c9a5e2581a4889fc45a303839ddeebadd5 | [
"Apache-2.0"
] | permissive | moryakovdv/iwxxmConverter | c6fb73bc49765c4aeb7ee0153cca04e3e3846ab0 | 5c2b57e57c3038a9968b026c55e381eef0f34dad | refs/heads/master | 2023-07-20T06:58:00.317736 | 2023-07-05T10:10:10 | 2023-07-05T10:10:10 | 128,777,786 | 11 | 7 | Apache-2.0 | 2023-07-05T10:03:12 | 2018-04-09T13:38:59 | Java | UTF-8 | Java | false | false | 3,157 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.02.27 at 12:41:52 PM MSK
//
package schemabindings21.org.isotc211._2005.gco;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* A MemberName is a LocalName that references either an attribute slot in a record or recordType or an attribute, operation, or association role in an object instance or type description in some form of schema. The stored value "aName" is the returned value for the "aName()" operation.
*
* <p>Java class for MemberName_Type complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MemberName_Type">
* <complexContent>
* <extension base="{http://www.isotc211.org/2005/gco}AbstractObject_Type">
* <sequence>
* <element name="aName" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType"/>
* <element name="attributeType" type="{http://www.isotc211.org/2005/gco}TypeName_PropertyType"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MemberName_Type", propOrder = {
"aName",
"attributeType"
})
public class MemberNameType
extends AbstractObjectType
{
@XmlElement(required = true)
protected CharacterStringPropertyType aName;
@XmlElement(required = true)
protected TypeNamePropertyType attributeType;
/**
* Gets the value of the aName property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getAName() {
return aName;
}
/**
* Sets the value of the aName property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setAName(CharacterStringPropertyType value) {
this.aName = value;
}
public boolean isSetAName() {
return (this.aName!= null);
}
/**
* Gets the value of the attributeType property.
*
* @return
* possible object is
* {@link TypeNamePropertyType }
*
*/
public TypeNamePropertyType getAttributeType() {
return attributeType;
}
/**
* Sets the value of the attributeType property.
*
* @param value
* allowed object is
* {@link TypeNamePropertyType }
*
*/
public void setAttributeType(TypeNamePropertyType value) {
this.attributeType = value;
}
public boolean isSetAttributeType() {
return (this.attributeType!= null);
}
}
| [
"moryakovdv@gmail.com"
] | moryakovdv@gmail.com |
15307e44679c86d9359e946ea41e6f4b2df91b8d | 1ebd71e2179be8a2baec90ff3f326a3f19b03a54 | /hybris/bin/platform/ext/core/testsrc/de/hybris/platform/core/threadregistry/DefaultSuspendResultUnitTest.java | e7c9bed27b1e773144ab7b06e1fc2c3bc3aede9c | [] | no_license | shaikshakeeb785/hybrisNew | c753ac45c6ae264373e8224842dfc2c40a397eb9 | 228100b58d788d6f3203333058fd4e358621aba1 | refs/heads/master | 2023-08-15T06:31:59.469432 | 2021-09-03T09:02:04 | 2021-09-03T09:02:04 | 402,680,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,180 | java | /*
* Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved.
*/
package de.hybris.platform.core.threadregistry;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.core.suspend.SuspendResult;
import de.hybris.platform.core.suspend.SystemStatus;
import org.junit.Test;
@UnitTest
public class DefaultSuspendResultUnitTest
{
@Test
public void shouldReturnNullResumeTokenWhenSystemIsSuspended()
{
final SuspendResult result = DefaultSuspendResult.systemIsSuspendedOrWaiting(SystemStatus.SUSPENDED);
assertThat(result).isNotNull();
assertThat(result.getCurrentStatus()).isSameAs(SystemStatus.SUSPENDED);
assertThat(result.getResumeToken()).isNull();
}
@Test
public void shouldReturnNullResumeTokenWhenSystemIsWaiting()
{
final SuspendResult result = DefaultSuspendResult.systemIsSuspendedOrWaiting(SystemStatus.WAITING_FOR_SUSPEND);
assertThat(result).isNotNull();
assertThat(result.getCurrentStatus()).isSameAs(SystemStatus.WAITING_FOR_SUSPEND);
assertThat(result.getResumeToken()).isNull();
}
@Test
public void shouldReturnNullResumeTokenWhenSystemIsWaitingForUpdate()
{
final SuspendResult result = DefaultSuspendResult.systemIsSuspendedOrWaiting(SystemStatus.WAITING_FOR_UPDATE);
assertThat(result).isNotNull();
assertThat(result.getCurrentStatus()).isSameAs(SystemStatus.WAITING_FOR_UPDATE);
assertThat(result.getResumeToken()).isNull();
}
@Test
public void shouldThrowIllegalArgumentExceptionWhenSystemIsRunningAndTokenIsNotGiven()
{
assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> DefaultSuspendResult.systemIsSuspendedOrWaiting(SystemStatus.RUNNING));
}
@Test
public void shouldReturnResumeTokenWhenSystemHasBeenSuspended()
{
final SuspendResult result = DefaultSuspendResult.systemHasBeenRequestedToSuspend(SystemStatus.RUNNING, "TEST");
assertThat(result).isNotNull();
assertThat(result.getCurrentStatus()).isSameAs(SystemStatus.RUNNING);
assertThat(result.getResumeToken()).isEqualTo("TEST");
}
}
| [
"sauravkr82711@gmail.com"
] | sauravkr82711@gmail.com |
2ea8e52f627f84d8ca089158bf13c957032d5f36 | 5d77f500ea22886806e5e89568337231c7adc210 | /src/com/huawei/basic/android/im/logic/friend/IFriendLogic.java | 1641a8f8651ea0efaa1605c55b6503c1b8efd617 | [] | no_license | zlb20048/RCS_BaseLine | 0eb602de7d39084e877fbfe76f284c408a01fc69 | b18cf7eeefeb0468480ac9ecebf2ceb5da3ca28b | refs/heads/master | 2020-05-17T18:54:40.293863 | 2014-01-15T11:15:48 | 2014-01-15T11:15:48 | 15,932,946 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 6,815 | java | /*
* 文件名: IFriendLogic.java
* 版 权: Copyright Huawei Tech. Co. Ltd. All Rights Reserved.
* 描 述: [该类的简要描述]
* 创建人: 刘鲁宁
* 创建时间:Feb 11, 2012
*
* 修改人:
* 修改时间:
* 修改内容:[修改内容]
*/
package com.huawei.basic.android.im.logic.friend;
import java.util.ArrayList;
import com.huawei.basic.android.im.logic.model.ContactInfoModel;
import com.huawei.basic.android.im.logic.model.ContactSectionModel;
/**
* 好友模块的logic接口<BR>
* @author 刘鲁宁
* @version [RCS Client V100R001C03, Feb 11, 2012]
*/
public interface IFriendLogic
{
/**
* 添加分组入口<BR>
* @param sectionName 组名
* @param sectionNotes 分组备注
* @param friendSysIdList 好友sysId列表
*/
void addSection(String sectionName, String sectionNotes,
ArrayList<String> friendSysIdList);
/**
* 分组添加成员入口<BR>
* @param sectionId 分组ID
* @param friendIdList 好友sysId列表
*/
void addContactsToSection(String sectionId, ArrayList<String> friendIdList);
/**
* 删除分组入口<BR>
* @param sectionId 分组ID
*/
void deleteSection(String sectionId);
/**
* 获取好友列表入口<BR>
* 首先根据时间戳发起联网请求,然后查询数据库,返回好友列表
* @param isNeedHandleFriendManagerData 是否需要处理找朋友小助手数据
* @param friendUserId 好友ID
*/
void getAllContactList(boolean isNeedHandleFriendManagerData,
String friendUserId);
/**
* 异步获取好友分组列表入口 <BR>
* 分组中包括好友列表,通过Message的方式返回数据
*/
void getContactSectionListWithFriendListAsyn();
/**
* 获取好友分组列表入口<BR>
* 分组中不关联好友列表
* @return 分组列表
*/
ArrayList<ContactSectionModel> getContactSectionList();
/**
* 获取好友列表<BR>
* @return 好友列表
*/
ArrayList<ContactInfoModel> getContactInfoListFromDb();
/**
* 根据分组ID获取好友列表入口<BR>
* @param sectionId 分组ID
* @return 分组ID对用的好友列表
*/
ArrayList<ContactInfoModel> getContactListBySectionId(String sectionId);
/**
* 根据好友的HitalkID获取本地好友详情入口<BR>
*
* @param friendUserID 好友的HiTalkID
* @return 好友的数据模型对象
*/
ContactInfoModel getContactInfoByFriendUserId(String friendUserID);
/**
* 同步获取分组列表入口<BR>
* 分组中包括好友列表数据
* @return 分组列表
*/
ArrayList<ContactInfoModel> getAllContactListFromDb();
/**
* 根据认识的人加载更多好友入口<BR>
*/
void loadMoreFriendByKnownPerson();
/**
*
* 附近查找加载更多好友入口<BR>
* [功能详细描述]
*/
void loadMoreFriendByLocation();
/**
*
* 清除位置信息<BR>
* [功能详细描述]
*/
void removeLocationInfo();
/**
* 根据ID加载更多的好友入口<BR>
* @param startIndex
* 加载数据开始下标
* @param recordCount
* 记录条数
* @param searchValue
* 查询关键字
*/
void loadMoreFriendById(int startIndex, int recordCount, String searchValue);
/**
* 根据详细信息加载更多好友入口<BR>
* @param startIndex
* 开始加载记录下标
* @param recordCount
* 返回记录条数
* @param searchValue
* 查询关键字
*/
void loadMoreFriendByDetail(int startIndex, int recordCount,
String searchValue);
/**
* 更新分组名称入口<BR>
* @param sectionName 组名
* @param sectionId 分组ID
*/
void updateSectionName(String sectionName, String sectionId);
/**
* 把组员移除分组入口<BR>
* @param sysIdList 要移除该分组的好友的SysId列表
* @param sectionId 分组ID
*/
void removeMemberFromSection(ArrayList<String> sysIdList, String sectionId);
/**
* 移动分组入口<BR>
* @param accountId 账号
* @param newSectionId 目标分组ID
* @param oldSectionId 当前所在分组ID
*/
void removeToSection(String accountId, String newSectionId,
String oldSectionId);
/**
* 同步头像图标入口<BR>
* @param contactInfo 联系人信息模型
*/
void syncFaceIcon(ContactInfoModel contactInfo);
/**
* 更新服务器备注信息入口<BR>
* @param contactInfoModel 数据库对象
* @param friendMemoName 备注名
* @param friendMemoPhone 电话
* @param friendMemoEmail 邮件地址
*/
void sendFriendMemo(ContactInfoModel contactInfoModel,
String friendMemoName, String friendMemoPhone,
String friendMemoEmail);
/**
* 添加分组时判断分组名是否存在入口
* @param sectionName 组名
* @return 是否存在
*/
boolean sectionNameExist(String sectionName);
/**
* 添加通过hiTalkID监听数据库单条好友信息的监听入口<BR>
*
* @param hiTalkID 好友的HitalkID
*/
void registerObserverByID(String hiTalkID);
/**
*
* 移除通过hiTalkID移除数据库单条好友信息的监听入口<BR>
*
* @param hiTalkID 好友的HitalkID
*/
void unRegisterObserverByID(String hiTalkID);
/**
*
* 根据HiTalk详情信息获取入口<BR>
*
* @param hiTalkID 好友的hiTalkID
* @param contactType 联系人类型
* [通讯录 LOCAL_CONTACT = 0,
* HiTalk类型 HITALK_CONTACT = 1,
* 好友类型 FRIEND_CONTACT = 2]
*/
void updateContactDetails(String hiTalkID, int contactType);
/**
* 编辑分组名时判断编辑后的名字其他分组的名字是否相同入口
* @param beforeSectionName 之前分组名
* @param newSectionName 新分组名
* @return 是否相同
*/
boolean otherSectionNameExist(String beforeSectionName,
String newSectionName);
/**
* 好友是否在好友列表中存在<BR>
* @param friendSysId 好友的sysId
* @return 是否存在
*/
boolean isFriendExist(String friendSysId);
}
| [
"zixiangliu@pateo.com.cn"
] | zixiangliu@pateo.com.cn |
87fced7b43a76158daacea24ca82bc334018f3c1 | eb66f417e8cc29518926f8e41cb56f099f9b4d13 | /src/test/java/com/moe/designpattern/event/EnvironmentCreateEventTest.java | 8565931ed891ee40c4666b8a5967affe4c568407 | [] | no_license | ericwang14/event-driven-pattern | 3e8fe2e2b27ef530e06bb1f3e8854f4314ee2910 | bcbe4506118dc5cbc4a4cb02b51814edb70b29d7 | refs/heads/master | 2021-06-24T15:31:00.694433 | 2017-09-12T06:25:17 | 2017-09-12T06:25:17 | 103,227,024 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,152 | java | package com.moe.designpattern.event;
import com.moe.designpattern.model.Environment;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
public class EnvironmentCreateEventTest {
private Environment environment;
@Before
public void setup() {
environment = new Environment("test", "test");
}
@After
public void tearDown() {
environment = null;
}
@Test
public void testCreate() {
EnvironmentCreateEvent event = new EnvironmentCreateEvent(environment);
assertNotNull(event);
assertEquals("test", event.getEnvironment().getLocation());
EnvironmentCreateEvent event1 = new EnvironmentCreateEvent(environment);
EnvironmentCreateEvent event2 = new EnvironmentCreateEvent(new Environment("test1", "test"));
assertEquals(event, event1);
assertEquals(event1, event);
assertNotEquals(event2, event);
assertEquals(EventType.ENVIRONMENT_CREATE, event.getType());
}
}
| [
"yeak2001@gmail.com"
] | yeak2001@gmail.com |
51618c6f196a5cc1b320e6fc91c3d69f2c94bf63 | 25baed098f88fc0fa22d051ccc8027aa1834a52b | /src/main/java/com/ljh/service/UndrugDetailService.java | 8db0bbbdbf2d3f9defdf22b2d60fb6cca77e4751 | [] | no_license | woai555/ljh | a5015444082f2f39d58fb3e38260a6d61a89af9f | 17cf8f4415c9ae7d9fedae46cd9e9d0d3ce536f9 | refs/heads/master | 2022-07-11T06:52:07.620091 | 2022-01-05T06:51:27 | 2022-01-05T06:51:27 | 132,585,637 | 0 | 0 | null | 2022-06-17T03:29:19 | 2018-05-08T09:25:32 | Java | UTF-8 | Java | false | false | 288 | java | package com.ljh.service;
import com.ljh.bean.UndrugDetail;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 非药品明细表 服务类
* </p>
*
* @author ljh
* @since 2020-10-26
*/
public interface UndrugDetailService extends IService<UndrugDetail> {
}
| [
"37681193+woai555@users.noreply.github.com"
] | 37681193+woai555@users.noreply.github.com |
1b9dbc9d34f88eaf0d995dd9c5e5ef77d9ca18f5 | 8109f096b2ee06326362d91fe5c2d469d1a1ca3e | /app/src/test/java/thomas/rejsedagbog/ExampleUnitTest.java | 0fb3d2dfdda2d558d8d177a92e71d2863ab65772 | [] | no_license | tempular/rejsedagbog | 338be6a45a327f9e7e426f8f006c92fbd6839822 | 981062a9a2f2966e1efe34f74b8ff350196fac0a | refs/heads/master | 2020-04-05T07:37:23.472358 | 2018-11-08T09:24:19 | 2018-11-08T09:24:19 | 156,682,714 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 379 | java | package thomas.rejsedagbog;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"zejgon@gmail.com"
] | zejgon@gmail.com |
e1a647332c87fc44fb4ba170955f1d919fae20b2 | 64eda994ea3c59a827ddb6c565d65af81b899131 | /src/shildt/edition5/chapter6/theory/blockObj/PassObjDemo.java | 62cd0be52fa1ba7fc663a3d99f5e85ad0bc671ff | [] | no_license | Vorting/Advanced_Java | 1e6276b3f7fef6687bee02548ddd3c65fb8786ca | 781dd3010ef74a9534c68aa4a08702f6bdc720fe | refs/heads/master | 2022-09-28T12:13:40.690481 | 2022-09-14T15:28:51 | 2022-09-14T15:28:51 | 205,119,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 495 | java | package shildt.edition5.chapter6.theory.blockObj;
public class PassObjDemo {
public static void main(String[] args) {
Block ob1 = new Block(10, 2, 5);
Block ob2 = new Block(10, 2, 5);
Block ob3 = new Block(4, 5, 5);
System.out.println("ob1 same dimensions as ob2: " + ob1.sameBlock(ob2));
System.out.println("ob1 same dimensions as ob3: " + ob1.sameBlock(ob3));
System.out.println("ob1 same volume as ob3: " + ob1.sameVolume(ob3));
}
}
| [
"ya.warkus@gmail.com"
] | ya.warkus@gmail.com |
127e7a23b381f60b024ac792082765dbe7c93f96 | 2bc632566111a862409fde27dca6e21de696bf69 | /src/test/java/com/example/demo/repository/CategoryRepositoryTest.java | 000d1b9321563209aec92677ad54d51fc3c10799 | [] | no_license | ohbyungkwon/springBootClass | b3fdc941aa98a6c6eda7180fcd338b11927671ba | aafd73684e22e44d7c4908b91d2f46d21b2e1309 | refs/heads/master | 2022-04-27T20:43:59.773263 | 2022-03-20T12:40:25 | 2022-03-20T12:40:25 | 160,748,742 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,952 | java | //package com.example.demo.repository;
//
//import com.example.demo.domain.LargeCategory;
//import com.example.demo.domain.SmallCategory;
//import com.example.demo.domain.SmallestCategory;
//import com.example.demo.domain.enums.Category;
//import com.example.demo.dto.CategoryDto;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.test.annotation.Rollback;
//import org.springframework.test.context.junit4.SpringRunner;
//import org.springframework.transaction.annotation.Transactional;
//
//import javax.persistence.EntityManager;
//
//import java.lang.reflect.InvocationTargetException;
//
//import static org.junit.Assert.*;
//
//@Transactional
//@SpringBootTest
//@RunWith(SpringRunner.class)
//public class CategoryRepositoryTest {
//
// @Autowired
// private CategoryRepository categoryRepository;
//
// @Autowired
// private EntityManager entityManager;
//
// @Test
// @Rollback(value = false)
// public void createSingleCategory() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
// CategoryDto.createSingle large = new CategoryDto.createSingle();
// large.setCategory(Category.LARGE);
// large.setTitle("의류");
// LargeCategory largeCategory = categoryRepository.createSingleCategory(large, LargeCategory.class);
//
// CategoryDto.createSingle small = new CategoryDto.createSingle();
// small.setCategory(Category.SMALL);
// small.setTitle("코트");
// small.setLargeCategoryId(largeCategory.getId());
// SmallCategory smallCategory = categoryRepository.createSingleCategory(small, SmallCategory.class);
//
// CategoryDto.createSingle smallest = new CategoryDto.createSingle();
// smallest.setCategory(Category.SMALLEST);
// smallest.setTitle("맥코트");
// smallest.setSmallCategoryId(smallCategory.getId());
// SmallestCategory smallestCategory = categoryRepository.createSingleCategory(smallest, SmallestCategory.class);
//
// System.out.println("DONE");
// }
//
// @Test
// @Rollback(value = false)
// public void create(){
// SmallestCategory smallestCategory = new SmallestCategory();
// smallestCategory.setTitle("맥코드");
//
// SmallCategory smallCategory = new SmallCategory();
// smallCategory.setTitle("코드");
// smallCategory.getSmallestCategory().add(smallestCategory);
// smallestCategory.setSmallCategory(smallCategory);
//
// LargeCategory largeCategory = new LargeCategory();
// largeCategory.setTitle("의휴");
// largeCategory.getSmallCategory().add(smallCategory);
// smallCategory.setLargeCategory(largeCategory);
//
// entityManager.persist(largeCategory);
// }
//} | [
"ohbg555@gmail.com"
] | ohbg555@gmail.com |
23d4ffe3e9b804871557f5d6b6636068686a8e8d | e1b97d667b3d23b0a31e500818621973683c9c7b | /DIT012/Labs/week2/week2/src/samples/slides/MoveOneLeft.java | ae48d27a0503353feb6ba43a14b6dd6de0366258 | [] | no_license | ketric/DIT012 | 05e00f78b53db20a4a3345e40c5f562a53e226b5 | a87414ffe0a01b476406e8590b139ebc11b050ec | refs/heads/master | 2020-03-19T00:22:44.831267 | 2018-05-30T17:31:25 | 2018-05-30T17:31:25 | 135,476,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 553 | java | package samples.slides;
import java.util.Arrays;
import static java.lang.System.out;
/**
* Move all elements one index to left
*/
public class MoveOneLeft {
public static void main(String[] args) {
new MoveOneLeft().program();
}
void program() {
int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9}; // Declare and initialize
int first = arr[0];
for (int i = 1; i < arr.length; i++) {
arr[i-1] = arr[i];
}
arr[arr.length-1] = first;
out.println(Arrays.toString(arr));
}
}
| [
"kennyle1996@hotmail.com"
] | kennyle1996@hotmail.com |
bde24d7a2b41be4c7f180dfda94008b652a01d75 | 881835ef24b3093f687f4c6362cc3c37f143698a | /src/com/zaijiadd/app/order/service/impl/OrderInfoServiceImpl.java | 06da44b1610f1de9a8e635d9165207c4eb8f36a2 | [] | no_license | IcemanCoding/zjdd-supply | a93e8a95e68d514513bdeca7bf8c5b96a1484c65 | 31c48414a4ea6f6f6e1d4211ba001e8895e6e5b2 | refs/heads/master | 2021-01-18T00:52:42.394550 | 2015-11-16T10:02:45 | 2015-11-16T10:02:45 | 46,266,205 | 1 | 1 | null | 2015-12-04T05:54:00 | 2015-11-16T09:55:27 | Java | UTF-8 | Java | false | false | 3,497 | java | package com.zaijiadd.app.order.service.impl;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import com.zaijiadd.app.common.utils.StringUtils;
import com.zaijiadd.app.external.service.AlipayResponseService;
import com.zaijiadd.app.order.dao.OrderInfoDAO;
import com.zaijiadd.app.order.entity.OrderInfoEntity;
import com.zaijiadd.app.order.service.OrderInfoService;
import com.zaijiadd.app.product.dao.ProductInfoDAO;
import com.zaijiadd.app.product.entity.ProductInfoEntity;
import com.zaijiadd.app.user.dao.UserInfoDAO;
import com.zaijiadd.app.utils.constants.ConstantsForOrder;
public class OrderInfoServiceImpl implements OrderInfoService {
@Autowired
private ProductInfoDAO productInfoDao;
@Autowired
private OrderInfoDAO orderInfoDao;
@Autowired
private UserInfoDAO userInfoDao;
@Autowired
private AlipayResponseService alipayResponseService;
@Override
public Map<String, Object> buildOrderInfo( String zaijiaddId, String productId, String transCode, String transAmount, String subject ) {
Map<String, Object> res = new HashMap<String, Object>();
/*
* 1、check productId is exist, and get Entity
*/
ProductInfoEntity productInfoEntity = productInfoDao.getProductInfo( productId );
if ( productInfoEntity == null ) {
return null;
}
/*
* 2、query user_info get user_id by zaijiadd_id
*/
Integer userId = userInfoDao.isUserInfoExist( zaijiaddId );
/*
* 3、build orderId
*/
String orderId = StringUtils.buildOrderId( userId.toString() );
orderId = "123456789";
/*
* 4、build order_info data
*/
OrderInfoEntity orderInfoEntity = new OrderInfoEntity();
orderInfoEntity.setAmount( productInfoEntity.getAmount() );
orderInfoEntity.setOrderId( orderId );
orderInfoEntity.setProductId( productId );
orderInfoEntity.setTransCode( transCode );
orderInfoEntity.setTransStatus( ConstantsForOrder.TRANS_STATUS_HANDLE );
orderInfoEntity.setUserId( userId );
orderInfoDao.insertOrderInfo( orderInfoEntity );
String sign = alipayResponseService.getSign( transAmount, orderId, subject );
res.put( "orderId", orderId );
res.put( "sign", sign );
return res;
}
@Override
public Map<String, Object> buildOrderInfo( String zaijiaddId,
String productId, String transCode ) {
Map<String, Object> res = new HashMap<String, Object>();
/*
* 1、check productId is exist, and get Entity
*/
ProductInfoEntity productInfoEntity = productInfoDao.getProductInfo( productId );
if ( productInfoEntity == null ) {
return null;
}
/*
* 2、query user_info get user_id by zaijiadd_id
*/
Integer userId = userInfoDao.isUserInfoExist( zaijiaddId );
/*
* 3、build orderId
*/
String orderId = StringUtils.buildOrderId( userId.toString() );
/*
* 4、build order_info data
*/
OrderInfoEntity orderInfoEntity = new OrderInfoEntity();
orderInfoEntity.setAmount( productInfoEntity.getAmount() );
orderInfoEntity.setOrderId( orderId );
orderInfoEntity.setProductId( productId );
orderInfoEntity.setTransCode( transCode );
orderInfoEntity.setTransStatus( ConstantsForOrder.TRANS_STATUS_HANDLE );
orderInfoEntity.setUserId( userId );
orderInfoDao.insertOrderInfo( orderInfoEntity );
res.put( "orderId", orderId );
return res;
}
}
| [
"371562311@qq.com"
] | 371562311@qq.com |
5023112d04c85adfc3e3a51aacb8cd4377317da0 | 6e21528fe1a8873b20dc244e3ad8b692778dba09 | /C206_CaseStudy/src/cca_category.java | 050df725411450f170ddfcd38089d0a334e9c657 | [] | no_license | Destiny28191/C206_CaseStudy_Team2 | 1235167d2f6d28370f2f3beab3706680d1ab594b | cf4f7689814905d206458a8ac6f9ca12fc643a0a | refs/heads/master | 2023-07-04T19:36:47.996077 | 2021-08-14T13:49:07 | 2021-08-14T13:49:07 | 385,522,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 630 | java | import java.util.ArrayList;
public class cca_category {
private String category;
public cca_category(String category) {
super();
this.category = category;
}
public String getcategory() {
return category;
}
public void setcategory(String category) {
this.category = category;
}
public void displaycat() {
String output = String.format("%-25s\n", category);
System.out.println(output);
}
public static boolean add(ArrayList<cca_category> catList, cca_category cCAcategory) {
catList.add(cCAcategory);
return true;
}
}
| [
"Deston@DESKTOP-A37O10E"
] | Deston@DESKTOP-A37O10E |
48e0781a83ce32fba2b5a50e17afcbc0fd7111a6 | 059c98bfe4985a14527ba58d457111601480b49e | /bootpay/src/main/java/kr/co/bootpay/IScriptFunction.java | b7d4edd5cac0583185f03b6ddd6d4d8dddc74b3d | [
"MIT"
] | permissive | bootpay/client_android_java | 279947b00f5557fa70dd8ed6198d82b2c5833fc6 | 562106687f15ef050f9d405411c1a7bc6e588d83 | refs/heads/master | 2022-06-02T08:29:43.231991 | 2022-04-07T08:14:44 | 2022-04-07T08:14:44 | 101,718,447 | 9 | 9 | MIT | 2018-01-26T07:57:24 | 2017-08-29T04:20:04 | Java | UTF-8 | Java | false | false | 440 | java | package kr.co.bootpay;
import android.webkit.JavascriptInterface;
public interface IScriptFunction {
@JavascriptInterface
void error(String String);
@JavascriptInterface
void close(String var1);
@JavascriptInterface
void cancel(String var1);
@JavascriptInterface
void ready(String var1);
@JavascriptInterface
void confirm(String var1);
@JavascriptInterface
void done(String var1);
}
| [
"jungler@cvdv.me"
] | jungler@cvdv.me |
7a8edd9484ece170915837e59d379fae79a1e87f | cf3c5b4d00e95647b5cb247a380beb6221e432bd | /src/main/java/com/ssu/Kuzmin/SportCentre/dao/LessonDao.java | 3717caca5233f230c3d092583369bfbf89e7686c | [] | no_license | KuzminDS/SportCentre | 1227a9d121f4d9c3186154134e729cc83057e528 | 74970717fc672361afec298b924e407e7e193ca1 | refs/heads/master | 2023-06-04T00:26:19.502482 | 2021-05-29T16:16:14 | 2021-05-29T16:16:14 | 370,046,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package com.ssu.Kuzmin.SportCentre.dao;
import com.ssu.Kuzmin.SportCentre.entity.Gym;
import com.ssu.Kuzmin.SportCentre.entity.Lesson;
import java.util.List;
public class LessonDao extends Dao<Lesson> {
public LessonDao() {
super(Lesson.class);
}
}
| [
"dima251200@yandex.ru"
] | dima251200@yandex.ru |
0d1dbe3bea404dbae68fe9504a90ef9efba45537 | b0d96d53ab2e5a2bd152862aa137502dfc1763d3 | /src/test/java/com/assignment/bookstore/controller/book/GetAllBooksOperationTest.java | a59144db6466304ed42fb7a5e4363661837e721d | [] | no_license | jacksparw/spring-boot-bookstore | 845bdadc1e92e7a1faf284210f723c6de9fd9d4e | f51e37ed1099627cf2220d53345206a495d0e5e0 | refs/heads/master | 2022-04-11T04:47:45.239480 | 2020-04-04T19:29:56 | 2020-04-04T19:29:56 | 251,592,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,939 | java | package com.assignment.bookstore.controller.book;
import capital.scalable.restdocs.AutoDocumentation;
import capital.scalable.restdocs.jackson.JacksonResultHandlers;
import capital.scalable.restdocs.response.ResponseModifyingPreprocessors;
import com.assignment.bookstore.TestUtil;
import com.assignment.bookstore.beans.dto.AuthorDTO;
import com.assignment.bookstore.beans.dto.book.BookDTO;
import com.assignment.bookstore.beans.dto.book.BookResponseDTO;
import com.assignment.bookstore.controller.BookController;
import com.assignment.bookstore.exception.NoDataFoundException;
import com.assignment.bookstore.service.BookService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.restdocs.RestDocumentationContextProvider;
import org.springframework.restdocs.RestDocumentationExtension;
import org.springframework.restdocs.cli.CliDocumentation;
import org.springframework.restdocs.http.HttpDocumentation;
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
import org.springframework.restdocs.operation.preprocess.Preprocessors;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@ExtendWith({MockitoExtension.class, RestDocumentationExtension.class, SpringExtension.class})
@AutoConfigureRestDocs(outputDir = "target/generated-snippets")
@WebMvcTest(BookController.class)
class GetAllBooksOperationTest {
private @MockBean BookService bookService;
private @Autowired WebApplicationContext webApplicationContext;
private MockMvc mockMvc;
private BookDTO validBookDTO;
private AuthorDTO validAuthorDTO;
@BeforeEach
public void setup(RestDocumentationContextProvider restDocumentation){
validBookDTO = BookDTO.builder()
.title("DummyBook")
.price(BigDecimal.TEN)
.isbn("1")
.build();
validAuthorDTO = AuthorDTO.builder()
.authorName("Dummy Author")
.description("This is Dummy Author")
.build();
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext)
.apply(documentationConfiguration(restDocumentation))
.alwaysDo(JacksonResultHandlers.prepareJackson(TestUtil.mapper))
.alwaysDo(MockMvcRestDocumentation.document("{method-name}",
Preprocessors.preprocessRequest(),
Preprocessors.preprocessResponse(
ResponseModifyingPreprocessors.replaceBinaryContent(),
ResponseModifyingPreprocessors.limitJsonArrayLength(TestUtil.mapper),
Preprocessors.prettyPrint())))
.apply(MockMvcRestDocumentation.documentationConfiguration(restDocumentation)
.uris()
.withScheme("http")
.withHost("localhost")
.withPort(8080)
.and().snippets()
.withDefaults(CliDocumentation.curlRequest(),
HttpDocumentation.httpRequest(),
HttpDocumentation.httpResponse(),
AutoDocumentation.requestFields(),
AutoDocumentation.responseFields(),
AutoDocumentation.pathParameters(),
AutoDocumentation.requestParameters(),
AutoDocumentation.description(),
AutoDocumentation.methodAndPath(),
AutoDocumentation.section()))
.build();
}
@Test
void testGetAllBook() throws Exception {
List<BookDTO> bookDTOList = new ArrayList<>();
bookDTOList.add(validBookDTO);
BookResponseDTO responseDTO = new BookResponseDTO(validAuthorDTO, bookDTOList);
Mockito.when(bookService.getBooks()).thenReturn(Arrays.asList(responseDTO));
mockMvc.perform(get("/books"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.status").value("success"))
.andExpect(jsonPath("$.message").value("Book Details"))
.andExpect(jsonPath("$.data[:1].author.authorName").value("Dummy Author"))
.andExpect(jsonPath("$.data[:1].books[:1].title").value("DummyBook"));
}
@Test
void testGetAllBook_NoBooks() throws Exception {
Mockito.when(bookService.getBooks()).thenThrow(new NoDataFoundException("No Book Found"));
mockMvc.perform(get("/books"))
.andExpect(status().isNotFound())
.andExpect(jsonPath("$.status").value("failure"))
.andExpect(jsonPath("$.message").value("No Book Found"));
}
} | [
"himanshu.tomar@netent.com"
] | himanshu.tomar@netent.com |
23b9d5ceb310ab8073d548d31ceb0ff513cf44d5 | f5ed8774d8fd5f24b887b19bcbf85540421efe24 | /app0604/src/app0604/tree/xml/Pet.java | 455674005d79190ac9a51c6de23a30cc21281a69 | [] | no_license | zino1187/korea202102_javaworkspace | 84b9e553817cc62e6a6ac7e1f60111ae939b7946 | ad42b6a473b400de6b4b4d28f40753d5484955d7 | refs/heads/master | 2023-06-01T04:34:37.608211 | 2021-06-07T23:55:49 | 2021-06-07T23:55:49 | 362,066,936 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package app0604.tree.xml;
//한마리의 반려동물을 담을 VO 정의
public class Pet {
private String type;
private String name;
private int age;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
| [
"zino1187@gmail.com"
] | zino1187@gmail.com |
b0f2e4917e6e4a4dbe717491ecb998e57b895804 | 27d38c570f2c3923f45c18fc6f767e07f3453688 | /src/TADs/arrayList/ArrayList.java | 3219af125c3a3e9ef0bedc452bf6e153b9c82573 | [] | no_license | juancruzcarrau/ObligatorioProgII | 5e6259fb15560d9db995be14b83976cd37bc78c6 | 7ed7d93224199bf75e4cc17173622c552d3aa120 | refs/heads/master | 2023-05-29T17:29:47.858633 | 2021-06-25T00:49:49 | 2021-06-25T00:49:49 | 372,288,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 183 | java | package TADs.arrayList;
public interface ArrayList<T> {
void add(T value);
T get(int index);
int size();
int remove(int index);
boolean contains(T value);
}
| [
"juancruzcarrau1@gmail.com"
] | juancruzcarrau1@gmail.com |
009a2a2980516bbd5a37c87c516fb3f19f708bf5 | de9fb3359c1d1a4072149694539a1ced86590b05 | /mods-suite/src/com/satori/mods/suite/RtmSubscribeModStats.java | f73f2ab2bb25e9eda7d6da792cf0386204f76311 | [
"BSD-2-Clause"
] | permissive | andrey-ko/satori-composer | 00b7320db10f37927678ffbb3c51377622891302 | 789b09d7490bf8f78ab0b9304151213be7343b46 | refs/heads/master | 2021-04-29T13:47:44.927692 | 2018-06-07T02:22:20 | 2018-06-07T02:22:20 | 138,615,801 | 0 | 0 | null | 2018-06-25T15:42:49 | 2018-06-25T15:42:48 | null | UTF-8 | Java | false | false | 956 | java | package com.satori.mods.suite;
import com.satori.mods.core.stats.*;
public class RtmSubscribeModStats implements IStatsProvider {
public int recv = 0;
public int sent = 0;
public int succeeded = 0;
public int failed = 0;
public StatsAvg infly = new StatsAvg();
public RtmSubscribeModStats() {
}
public RtmSubscribeModStats(RtmSubscribeModStats other) {
recv = other.recv;
succeeded = other.succeeded;
failed = other.failed;
}
// IStatsProvider implementation
@Override
public void collect(IStatsCollector collector) {
collector.sum("recv", recv);
collector.sum("sent", sent);
collector.sum("sent.err", failed);
collector.sum("sent.ok", succeeded);
collector.avg("infly", infly);
}
@Override
public void suppress() {
reset();
}
// public methods
public void reset() {
sent = 0;
recv = 0;
succeeded = 0;
failed = 0;
infly.suppress();
}
}
| [
"akolomentsev@satori.com"
] | akolomentsev@satori.com |
641ff151c451391f50d01bc0c4a8e153d9e08354 | aae5a4fe3ade429fb3b8ca6baaa80fb333abebf5 | /src/bankingProjDemo/UserAccountDetail.java | 0c9a0e430961481c2126827651b81942b2138cab | [] | no_license | b115030/BankingSystemusingOOP | b2cc12c597aa766d60278614be3b28d2b36155b4 | 3aeb1093c9513d10e9a3ff4ded1dd747dfdff97f | refs/heads/master | 2022-12-15T02:10:55.801626 | 2020-09-25T12:39:36 | 2020-09-25T12:39:36 | 298,565,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | package bankingProjDemo;
public class UserAccountDetail {
int basicAmt;
public UserAccountDetail(int x) {
this.basicAmt=x;
}
public int getBasicAmt() {
return basicAmt;
}
public int additionalAmt(int totalAmt) {
return totalAmt-basicAmt;
}
public void showC() {
System.out.println("--class UsreAccountDetail");
}
public int rateAmt(int r) {
int res=0;
try {
res = this.basicAmt/r;
}
catch(Exception e) {
System.out.println("exception generated , try later !"+e);
}
finally {
return res;
}
}
}
| [
"iitiangokul@gmail.com"
] | iitiangokul@gmail.com |
77afd0f7bff4968eee45c60caea8cd0d87b1e9e2 | 352163a8f69f64bc87a9e14471c947e51bd6b27d | /bin/platform/ext/core/testsrc/de/hybris/platform/test/HJMPTest.java | 1fed77859610b2f5db2af8482fa33385e5422138 | [] | no_license | GTNDYanagisawa/merchandise | 2ad5209480d5dc7d946a442479cfd60649137109 | e9773338d63d4f053954d396835ac25ef71039d3 | refs/heads/master | 2021-01-22T20:45:31.217238 | 2015-05-20T06:23:45 | 2015-05-20T06:23:45 | 35,868,211 | 3 | 5 | null | null | null | null | UTF-8 | Java | false | false | 15,784 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2013 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*
*
*/
package de.hybris.platform.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import de.hybris.bootstrap.annotations.IntegrationTest;
import de.hybris.platform.core.Constants;
import de.hybris.platform.core.PK;
import de.hybris.platform.core.Registry;
import de.hybris.platform.core.Tenant;
import de.hybris.platform.jalo.JaloSystemException;
import de.hybris.platform.jalo.product.Product;
import de.hybris.platform.jalo.product.ProductManager;
import de.hybris.platform.persistence.EJBInvalidParameterException;
import de.hybris.platform.persistence.EJBItemNotFoundException;
import de.hybris.platform.persistence.SystemEJB;
import de.hybris.platform.persistence.hjmp.HJMPUtils;
import de.hybris.platform.persistence.property.EJBProperty;
import de.hybris.platform.persistence.property.OldPropertyJDBC;
import de.hybris.platform.persistence.property.OldPropertyJDBC.DumpPropertyConverter;
import de.hybris.platform.persistence.test.TestItemHome;
import de.hybris.platform.persistence.test.TestItemRemote;
import de.hybris.platform.testframework.HybrisJUnit4Test;
import de.hybris.platform.util.Config;
import de.hybris.platform.util.Utilities;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@IntegrationTest
public class HJMPTest extends HybrisJUnit4Test
{
static final Logger LOG = Logger.getLogger(HJMPTest.class.getName());
private TestItemRemote remote;
private TestItemHome home;
@Before
public void setUp() throws Exception
{
try
{
home = (TestItemHome) Registry.getCurrentTenant().getPersistencePool()
.getHomeProxy(Registry.getPersistenceManager().getJNDIName(Constants.TC.TestItem));
remote = home.create();
}
catch (final de.hybris.platform.util.jeeapi.YCreateException e)
{
e.printStackTrace();
}
}
@After
public void tearDown() throws Exception
{
if (remote != null)
{
try
{
remote.remove();
}
catch (final Exception e)
{
// can't help it
}
}
}
@Test
public void testMoveDumpProps()
{
final String propName = "dumpPropBalhFasel";
final Integer propValue = Integer.valueOf(123456);
boolean removed = false;
try
{
remote.setProperty(propName, propValue);
assertEquals(propValue, remote.getProperty(propName));
OldPropertyJDBC.moveDumpData(Constants.TC.TestItem, propName,
Registry.getPersistenceManager().getItemDeployment(Constants.TC.TestItem).getDumpPropertyTableName(),
new DumpPropertyConverter()
{
@Override
public boolean convert(final PK itemPK, final PK typePK, final EJBProperty dumpProp)
{
assertEquals(remote.getPK(), itemPK);
assertEquals(remote.getComposedType().getPK(), typePK);
assertEquals(propName, dumpProp.getName());
assertEquals(propValue, dumpProp.getValue());
assertNull(dumpProp.getLang());
return true;
}
});
removed = true;
}
finally
{
if (!removed)
{
remote.removeProperty(propName);
}
}
}
@Test
public void testWriteReadValues()
{
LOG.debug(">>> testWriteReadValues()");
final Float floatValue = new Float(1234.5678f);
/* conv-LOG */LOG.debug(">>> Float (" + floatValue + ") <<<");
remote.setFloat(floatValue);
assertEquals(floatValue, remote.getFloat());
final Double doubleValue = new Double(2234.5678d);
/* conv-LOG */LOG.debug(">>> Double (" + doubleValue + ") <<<");
remote.setDouble(doubleValue);
assertEquals(doubleValue, remote.getDouble());
final Character characterValue = Character.valueOf('g');
/* conv-LOG */LOG.debug(">>> Character (" + characterValue + ") <<<");
remote.setCharacter(characterValue);
assertEquals(characterValue, remote.getCharacter());
final Integer integerValue = Integer.valueOf(3357);
/* conv-LOG */LOG.debug(">>> Integer (" + integerValue + ") <<<");
remote.setInteger(integerValue);
assertEquals(integerValue, remote.getInteger());
final Long longValue = Long.valueOf(4357L);
/* conv-LOG */LOG.debug(">>> Long (" + longValue + ") <<<");
remote.setLong(longValue);
assertEquals(longValue, remote.getLong());
final Calendar now = Utilities.getDefaultCalendar();
now.set(Calendar.MILLISECOND, 0);
/* conv-LOG */LOG.debug(">>> Date (" + now + ", ms=" + now.getTime() + ")<<<");
remote.setDate(now.getTime());
final java.util.Date got = remote.getDate();
/* conv-LOG */LOG.debug(">>> found (" + got.getTime() + ")<<<");
assertEquals(now.getTime(), got);
// try to get 123,4567 as big decimal
final BigDecimal bigDecimalValue = BigDecimal.valueOf(1234567, 4);
/* conv-LOG */LOG.debug(">>> BigDecimal (" + bigDecimalValue + ")<<<");
remote.setBigDecimal(bigDecimalValue);
assertTrue(remote.getBigDecimal().compareTo(bigDecimalValue) == 0);
final java.sql.Timestamp timestamp = new java.sql.Timestamp(now.getTime().getTime());
/* conv-LOG */LOG.debug(">>> Timestamp (" + timestamp + ", ms=" + timestamp.getTime() + ")<<<");
remote.setDate(timestamp);
final java.util.Date got2 = remote.getDate();
/* conv-LOG */LOG.debug(">>> found (" + got2.getTime() + ")<<<");
assertEquals(now.getTime(), got2);
final String str = "Alles wird gut!";
/* conv-LOG */LOG.debug(">>> String (" + str + ")<<<");
remote.setString(str);
assertEquals(str, remote.getString());
final String longstr = "Alles wird lange gut!";
/* conv-LOG */LOG.debug(">>> Long String (" + longstr + ")<<<");
remote.setLongString(longstr);
assertEquals(longstr, remote.getLongString());
//put 50000 chars into it
String longstr2 = "";
for (int i2 = 0; i2 < 5000; i2++)
{
longstr2 += "01234567890";
}
remote.setLongString(longstr2);
assertEquals(longstr2, remote.getLongString());
/*
* remote.setString( "" ); assertEquals( "" , remote.getString() ); remote.setString( null ); assertNull(
* remote.getString() ); remote.setLongString( "" ); assertEquals( "" , remote.getLongString() );
* remote.setLongString( null ); assertNull( remote.getLongString() );
*/
final Boolean booleanValue = Boolean.TRUE;
/* conv-LOG */LOG.debug(">>> Boolean (" + booleanValue + ")<<<");
remote.setBoolean(booleanValue);
assertEquals(booleanValue, remote.getBoolean());
final float floatValue2 = 5234.5678f;
/* conv-LOG */LOG.debug(">>> float (" + floatValue2 + ") <<<");
remote.setPrimitiveFloat(floatValue2);
assertTrue(">>> float (" + floatValue2 + ") <<<", floatValue2 == remote.getPrimitiveFloat());
final double doubleValue2 = 6234.5678d;
/* conv-LOG */LOG.debug(">>> double (" + doubleValue2 + ") <<<");
remote.setPrimitiveDouble(doubleValue2);
assertTrue(">>> double (" + doubleValue2 + ") <<<", doubleValue2 == remote.getPrimitiveDouble());
final int integerValue2 = 7357;
/* conv-LOG */LOG.debug(">>> int (" + integerValue2 + ") <<<");
remote.setPrimitiveInteger(integerValue2);
assertTrue(integerValue2 == remote.getPrimitiveInteger());
final long longValue2 = 8357L;
/* conv-LOG */LOG.debug(">>> long (" + longValue2 + ") <<<");
remote.setPrimitiveLong(longValue2);
assertTrue(">>> long (" + longValue2 + ") <<<", longValue2 == remote.getPrimitiveLong());
final byte byteValue = 123;
/* conv-LOG */LOG.debug(">>> byte (" + byteValue + ") <<<");
remote.setPrimitiveByte(byteValue);
assertTrue(">>> byte (" + byteValue + ") <<<", byteValue == remote.getPrimitiveByte());
final boolean booleanValue2 = true;
/* conv-LOG */LOG.debug(">>> boolean (" + booleanValue2 + ") <<<");
remote.setPrimitiveBoolean(booleanValue2);
assertTrue(">>> boolean (" + booleanValue2 + ") <<<", booleanValue2 == remote.getPrimitiveBoolean());
final char characterValue2 = 'g';
/* conv-LOG */LOG.debug(">>> char (" + characterValue2 + ") <<<");
remote.setPrimitiveChar(characterValue2);
assertTrue(">>> char (" + characterValue2 + ") <<<", characterValue2 == remote.getPrimitiveChar());
final ArrayList list = new ArrayList();
LOG.debug(">>> Serializable with standard classes (" + list + ") <<<");
remote.setSerializable(list);
assertEquals(list, remote.getSerializable());
if (!Config.isOracleUsed())
{
try
{
final HashMap bigtest = new HashMap();
LOG.debug(">>> Serializable with standard classes (big thing) <<<");
final byte[] byteArray = new byte[100000];
bigtest.put("test", byteArray);
remote.setSerializable(bigtest);
final Map longtestret = (Map) remote.getSerializable();
assertTrue(longtestret.size() == 1);
final byte[] byteArray2 = (byte[]) longtestret.get("test");
assertTrue(byteArray2.length == 100000);
}
catch (final Exception e)
{
throw new JaloSystemException(e, "Unable to write big serializable object, db: " + Config.getDatabase() + ".", 0);
}
}
/* conv-LOG */LOG.debug(">>> Serializable (null) <<<");
remote.setSerializable(null);
assertNull(remote.getSerializable());
// try
// {
// final Dummy dummy = new Dummy();
// /*conv-LOG*/ LOG.debug(">>> Serializable with custom classes ("+dummy+") <<<");
// remote.setSerializable( dummy );
// final Serializable x = remote.getSerializable();
// assertTrue( dummy.equals( x ) || x == null );
// if( x == null )
// /*conv-LOG*/ LOG.debug(">>> ok, we're still unable of writing non-serverside classes to database : read NULL ");
// }
// catch( Exception e )
// {
// /*conv-LOG*/ LOG.debug(">>> ok, we're still unable of writing non-serverside classes to database : " + e );
// }
//
// search
//
try
{
/* conv-LOG */LOG.debug(">>> Search ( " + str + ", " + integerValue2 + " ) <<<");
home.finderTest(str, integerValue2);
}
catch (final Exception e)
{
e.printStackTrace();
fail("TestItem not found!");
}
//
// 'null' tests
//
/* conv-LOG */LOG.debug(">>> String (null) <<<");
remote.setString(null);
assertNull(remote.getString());
/* conv-LOG */LOG.debug(">>> Character (null) <<<");
remote.setCharacter(null);
assertNull(remote.getCharacter());
/* conv-LOG */LOG.debug(">>> Integer (null) <<<");
remote.setInteger(null);
assertNull(remote.getInteger());
/* conv-LOG */LOG.debug(">>> Date (null) <<<");
remote.setDate(null);
assertNull(remote.getDate());
/* conv-LOG */LOG.debug(">>> Double (null) <<<");
remote.setDouble(null);
assertNull(remote.getDouble());
/* conv-LOG */LOG.debug(">>> Float (null) <<<");
remote.setFloat(null);
assertNull(remote.getFloat());
}
public static final class Dummy implements java.io.Serializable
{
// DOCTODO Document reason, why this block is empty
}
@Test
public void testMissingPKLookupNoRetry()
{
final PK nonExistingProductPK = PK.createFixedPK(Constants.TC.Product, System.nanoTime());
final long TIMEOUT = 10 * 1000;
final Object token = HJMPUtils.disablePKLookupRetry();
try
{
assertLess("Lookup took to long", measurePKLookup(nonExistingProductPK, false), TIMEOUT);
}
finally
{
HJMPUtils.restorPKLookupRetry(token);
}
}
@Test
public void testMissingPKLookupDoRetry()
{
final PK nonExistingProductPK = PK.createFixedPK(Constants.TC.Product, System.nanoTime());
final long TIMEOUT = 10 * 1000;
final Object token = HJMPUtils.enablePKLookupRetry(TIMEOUT, 500);
try
{
assertGreaterEquals("lookup was to short", measurePKLookup(nonExistingProductPK, false), TIMEOUT);
}
finally
{
HJMPUtils.restorPKLookupRetry(token);
}
}
@Test
public void testHiddenPKLookupWithRetry()
{
final PK nonExistingProductPK = PK.createFixedPK(Constants.TC.Product, System.nanoTime());
final long TIMEOUT = 30 * 1000;
final Object token = HJMPUtils.enablePKLookupRetry(TIMEOUT, 500);
try
{
// start lookup in own thread -> must wait since PK doesnt exist yet
final AtomicReference<Boolean> success = startPKLookupInOtherThread(nonExistingProductPK);
// wait for 5 seconds to allow a decent amount of turns
Thread.sleep(5 * 1000);
assertNull("Result available before end of lookup retry period", success.get()); // still no result
// now create product with exactly that pk -> now lookup should succeed eventually
final Product product = ProductManager.getInstance().createProduct(null, nonExistingProductPK, "PPP");
assertTrue(product.isAlive());
final PK createdPK = product.getPK();
assertEquals(createdPK, nonExistingProductPK); // sanity check
// wait for lookup result for 10 seconds
final long maxWait = System.currentTimeMillis() + TIMEOUT;
while (success.get() == null && System.currentTimeMillis() < maxWait)
{
Thread.sleep(500);
}
assertEquals("Wrong retry lookup result", Boolean.TRUE, success.get());
}
catch (final Exception e)
{
fail(e.getMessage());
}
finally
{
HJMPUtils.restorPKLookupRetry(token);
}
}
private AtomicReference<Boolean> startPKLookupInOtherThread(final PK pk)
{
final Tenant tenant = Registry.getCurrentTenantNoFallback();
final AtomicReference<Boolean> success = new AtomicReference<Boolean>(null);
final Thread thread = new Thread()
{
@Override
public void run()
{
Registry.setCurrentTenant(tenant);
try
{
assertNotNull(SystemEJB.getInstance().findRemoteObjectByPK(pk));
success.set(Boolean.TRUE);
}
catch (final EJBItemNotFoundException e)
{
success.set(Boolean.FALSE);
}
catch (final Exception e)
{
success.set(Boolean.FALSE);
fail(e.getMessage());
}
}
};
thread.start();
return success;
}
private void assertGreaterEquals(final String message, final long long1, final long long2)
{
assertTrue((StringUtils.isNotEmpty(message) ? message : "") + " expected " + long1 + " >= " + long2, long1 >= long2);
}
private void assertLess(final String message, final long long1, final long long2)
{
assertTrue((StringUtils.isNotEmpty(message) ? message : "") + " expected " + long1 + " < " + long2, long1 < long2);
}
private long measurePKLookup(final PK pk, final boolean pkExists)
{
final long time1 = System.currentTimeMillis();
try
{
SystemEJB.getInstance().findRemoteObjectByPK(pk);
assertTrue("lookup succeeded but PK should not exist", pkExists);
}
catch (final EJBItemNotFoundException e)
{
assertFalse("PK existed but lookup failed", pkExists);
}
catch (final EJBInvalidParameterException e)
{
fail(e.getMessage());
}
return System.currentTimeMillis() - time1;
}
}
| [
"yanagisawa@gotandadenshi.jp"
] | yanagisawa@gotandadenshi.jp |
eb2c45b855d51b0413c2a303fd27cd292ef6498a | 1003b35c41d70085919a02392d7a55bdc90a6346 | /src/main/java/com/system/started/socketio/SocketEventListener.java | 34acd7ab916063da77ef3aa7f6a72679eeec085a | [] | no_license | IOExceptioner/Server-Management-System | 8cf7ff4e91c4b752cd226d1087878a111873864a | 2d6ee3bf3bb544d1228eee32891a4075e20a4220 | refs/heads/master | 2023-03-15T10:46:23.977367 | 2019-04-02T02:49:38 | 2019-04-02T02:49:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,512 | java | package com.system.started.socketio;
import java.util.HashMap;
import org.springframework.beans.factory.annotation.Autowired;
import com.corundumstudio.socketio.AckRequest;
import com.corundumstudio.socketio.SocketIOClient;
import com.corundumstudio.socketio.SocketIOServer;
import com.corundumstudio.socketio.listener.DataListener;
import com.vlandc.oss.common.JsonHelper;
public class SocketEventListener implements ISocketIOListener, DataListener<String> {
@Autowired
private SocketIOClientManager socketIOClientManager;
private SocketIOServer server;
public void setServer(SocketIOServer server) {
this.server = server;
}
public void initListener() {
server.addEventListener("socketioEvent", String.class, this);
}
public void onData(SocketIOClient client, String messageJson, AckRequest ackSender) throws Exception {
HashMap<String, Object> messageMap = JsonHelper.fromJson(HashMap.class, messageJson);
String loginId = (String) messageMap.get("loginId");
socketIOClientManager.addConnection(loginId, client);
String eventType = (String) messageMap.get("type");
if (eventType.equals("REGISTER_NOTIFICATION")) {
String notificationType = (String) messageMap.get("notificationType");
socketIOClientManager.registerNotification(notificationType, client);
} else if (eventType.equals("UNREGISTER_NOTIFICATION")) {
String notificationType = (String) messageMap.get("notificationType");
socketIOClientManager.unRegisterNotification(notificationType, client);
}
}
} | [
"thelovelybugfly@foxmail.com"
] | thelovelybugfly@foxmail.com |
5034c8e18a519a4ee5437dc3687fdf774926c007 | 90a160267d675223685c21511ab89729e6fce4c4 | /src/org/issmd/picky/DefaultCodecFactory.java | f14b44718e797661776de810347347f96320ed99 | [
"MIT"
] | permissive | x1n13y84issmd42/Picky | 464f72470e807f8c835114c25983f7ef2539d033 | 43839fb968f09f9cc9747ea7d40157067f929820 | refs/heads/master | 2020-05-04T21:33:10.613933 | 2014-10-27T15:22:25 | 2014-10-27T15:22:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 688 | java | package org.issmd.picky;
import java.util.ArrayList;
import java.util.List;
/**
* Facade thing. Sequentially checks all codec factories and uses one of them to create a codec.
* @author Eugene S. Merkoulov
*
*/
public class DefaultCodecFactory {
private static List<ICodecFactory> availableCodecs = new ArrayList<ICodecFactory>();
public static <T> Codec<T> CreateCodec(Class<T> c)
{
availableCodecs.add(new StringCodec.Factory());
availableCodecs.add(new NumericCodec.Factory());
availableCodecs.add(new ObjectCodec.Factory());
for (ICodecFactory factory : availableCodecs)
{
if (factory.Can(c))
return factory.CreateCodec(c);
}
return null;
}
}
| [
"gaddeena@gmail.com"
] | gaddeena@gmail.com |
732940a91c3aca9f852216242dbc52f6f374196f | 46e3415499f5823445c0314b774343ac9cc99c74 | /gulimall-product/src/main/java/com/whut/gulimall/product/service/impl/SpuInfoServiceImpl.java | 30e85fc101e07dccf8f80bc3e44c574d106986a7 | [] | no_license | fyun123/gulimall | 8bd5b53bd0dd6baa290216d20c44d9e5e8c3b2c8 | 7b68865c0cef10d77f77e299337982de3c8dbc15 | refs/heads/main | 2023-04-16T08:20:37.190500 | 2021-04-08T05:34:56 | 2021-04-08T05:34:56 | 331,545,895 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,701 | java | package com.whut.gulimall.product.service.impl;
import com.alibaba.fastjson.TypeReference;
import com.whut.common.constant.ProductConstant;
import com.whut.common.to.SkuHasStockTo;
import com.whut.common.to.SkuReductionTo;
import com.whut.common.to.SpuBoundsTo;
import com.whut.common.to.es.SkuEsModel;
import com.whut.common.utils.R;
import com.whut.gulimall.product.entity.*;
import com.whut.gulimall.product.feign.CouponFeignService;
import com.whut.gulimall.product.feign.SearchFeignService;
import com.whut.gulimall.product.feign.WareFeignService;
import com.whut.gulimall.product.service.*;
import com.whut.gulimall.product.vo.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.whut.common.utils.PageUtils;
import com.whut.common.utils.Query;
import com.whut.gulimall.product.dao.SpuInfoDao;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
@Service("spuInfoService")
public class SpuInfoServiceImpl extends ServiceImpl<SpuInfoDao, SpuInfoEntity> implements SpuInfoService {
@Autowired
private SpuInfoDescService descService;
@Autowired
private SpuImagesService spuImagesService;
@Autowired
private AttrService attrService;
@Autowired
private ProductAttrValueService valueService;
@Autowired
private SkuInfoService skuInfoService;
@Autowired
private SkuImagesService skuImagesService;
@Autowired
private SkuSaleAttrValueService skuSaleAttrValueService;
@Autowired
private CouponFeignService couponFeignService;
@Autowired
private BrandService brandService;
@Autowired
private CategoryService categoryService;
@Autowired
private WareFeignService wareFeignService;
@Autowired
private SearchFeignService searchFeignService;
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<SpuInfoEntity> page = this.page(
new Query<SpuInfoEntity>().getPage(params),
new QueryWrapper<SpuInfoEntity>()
);
return new PageUtils(page);
}
@Transactional
@Override
public void saveSpuInfo(SpuSaveVo vo) {
//1 保存spu基本信息`pms_spu_info`
SpuInfoEntity spuInfoEntity = new SpuInfoEntity();
BeanUtils.copyProperties(vo,spuInfoEntity);
spuInfoEntity.setCreateTime(new Date());
spuInfoEntity.setUpdateTime(new Date());
this.saveBaseSpuInfo(spuInfoEntity);
//2 保存spu的描述图片信息`pms_spu_info_desc`
List<String> decript = vo.getDecript();
SpuInfoDescEntity spuInfoDescEntity = new SpuInfoDescEntity();
spuInfoDescEntity.setSpuId(spuInfoEntity.getId());
spuInfoDescEntity.setDecript(String.join(",", decript));
descService.saveSpuInfoDesc(spuInfoDescEntity);
//3 保存spu的图片集`pms_spu_images`
List<String> images = vo.getImages();
spuImagesService.saveImages(spuInfoEntity.getId(),images);
//4 保存spu的规格参数`pms_product_attr_value`
List<BaseAttrs> baseAttrs = vo.getBaseAttrs();
List<ProductAttrValueEntity> collect = baseAttrs.stream().map((attr) -> {
ProductAttrValueEntity valueEntity = new ProductAttrValueEntity();
valueEntity.setAttrId(attr.getAttrId());
AttrEntity attrEntity = attrService.getById(attr.getAttrId());
valueEntity.setAttrName(attrEntity.getAttrName());
valueEntity.setAttrValue(attr.getAttrValues());
valueEntity.setQuickShow(attr.getShowDesc());
valueEntity.setSpuId(spuInfoEntity.getId());
return valueEntity;
}).collect(Collectors.toList());
valueService.saveProAttr(collect);
//5 保存spu的积分信息`gulimall_sms`-->`sms_spu_bounds`
Bounds bounds = vo.getBounds();
SpuBoundsTo spuBoundsTo = new SpuBoundsTo();
BeanUtils.copyProperties(bounds, spuBoundsTo);
spuBoundsTo.setSpuId(spuInfoEntity.getId());
R r = couponFeignService.saveSpuBounds(spuBoundsTo);
if (r.getCode() != 0) {
log.error("远程保存spu积分信息失败");
}
//6 保存当前spu对应的sku信息
//6.1 sku基本信息`pms_sku_info`
/**
* private String skuName;
* private BigDecimal price;
* private String skuTitle;
* private String skuSubtitle;
*/
List<Skus> skus = vo.getSkus();
if (skus != null && skus.size() > 0) {
skus.forEach((sku)->{
String defaultImag = "";
for (Images image : sku.getImages()){
if (image.getDefaultImg() == 1){
defaultImag = image.getImgUrl();
}
}
SkuInfoEntity skuInfoEntity = new SkuInfoEntity();
BeanUtils.copyProperties(sku,skuInfoEntity);
skuInfoEntity.setBrandId(spuInfoEntity.getBrandId());
skuInfoEntity.setCatalogId(spuInfoEntity.getCatalogId());
skuInfoEntity.setSaleCount(0L);
skuInfoEntity.setSpuId(spuInfoEntity.getId());
skuInfoEntity.setSkuDefaultImg(defaultImag);
skuInfoService.saveSkuInfo(skuInfoEntity);
//6.2 sku的图片信息`pms_sku_images`
Long skuId = skuInfoEntity.getSkuId();
List<SkuImagesEntity> imagesEntities = sku.getImages().stream().map((img) -> {
SkuImagesEntity skuImagesEntity = new SkuImagesEntity();
skuImagesEntity.setSkuId(skuId);
skuImagesEntity.setImgUrl(img.getImgUrl());
skuImagesEntity.setDefaultImg(img.getDefaultImg());
return skuImagesEntity;
}).filter((imagesEntity -> {
// true需要,false过滤
return StringUtils.isEmpty(imagesEntity.getImgUrl());
})).collect(Collectors.toList());
skuImagesService.saveBatch(imagesEntities);
//6.3 sku的销售属性信息`pms_sku_sale_attr_value`
List<Attr> attrs = sku.getAttr();
List<SkuSaleAttrValueEntity> saleAttrValueEntities = attrs.stream().map((attr) -> {
SkuSaleAttrValueEntity skuSaleAttrValueEntity = new SkuSaleAttrValueEntity();
BeanUtils.copyProperties(attr, skuSaleAttrValueEntity);
skuSaleAttrValueEntity.setSkuId(skuId);
return skuSaleAttrValueEntity;
}).collect(Collectors.toList());
skuSaleAttrValueService.saveBatch(saleAttrValueEntities);
//6.4 sku的优惠满减信息`gulimall_sms`-->`sms_sku_ladder`/`sms_sku_full_reduction`/`sms_member_price`
SkuReductionTo skuReductionTo = new SkuReductionTo();
BeanUtils.copyProperties(sku,skuReductionTo);
skuReductionTo.setSkuId(skuId);
if (skuReductionTo.getFullCount() > 0 || skuReductionTo.getFullPrice().compareTo(new BigDecimal("0")) == 1) {
R r1 = couponFeignService.saveSkuReduction(skuReductionTo);
if (r1.getCode() != 0) {
log.error("远程保存sku优惠信息失败");
}
}
});
}
}
@Override
public void saveBaseSpuInfo(SpuInfoEntity spuInfoEntity) {
this.baseMapper.insert(spuInfoEntity);
}
@Override
public PageUtils queryPageByCondition(Map<String, Object> params) {
QueryWrapper<SpuInfoEntity> wrapper = new QueryWrapper<>();
String key = (String) params.get("key");
if (!StringUtils.isEmpty(key)){
wrapper.and((w)->{
w.eq("id",key).or().like("spu_name",key);
});
}
String status = (String) params.get("status");
if (!StringUtils.isEmpty(status)){
wrapper.eq("publish_status",status);
}
String brandId = (String) params.get("brandId");
if (!StringUtils.isEmpty(brandId) && !"0".equalsIgnoreCase(brandId)){
wrapper.eq("brand_id",brandId);
}
String catelogId = (String) params.get("catelogId");
if (!StringUtils.isEmpty(catelogId) && !"0".equalsIgnoreCase(catelogId)){
wrapper.eq("catalog_id",catelogId);
}
IPage<SpuInfoEntity> page = this.page(
new Query<SpuInfoEntity>().getPage(params),
wrapper
);
return new PageUtils(page);
}
@Override
public void up(Long spuId) {
// 1. 查出当前spuId对应的所有sku信息,品牌的名字
List<SkuInfoEntity> skus = skuInfoService.getSkusBySpuId(spuId);
//4、查询sku所有可用来被检索的规格属性
// 获取所有属性
List<ProductAttrValueEntity> baseAttrs = valueService.baseAttrlistforspu(spuId);
List<Long> attrIds = baseAttrs.stream().map(attr -> {
return attr.getAttrId();
}).collect(Collectors.toList());
System.out.println("所有属性"+baseAttrs);
// 获取可检索属性
List<Long> searchAttrIds = attrService.selectSearchAttrs(attrIds);
Set<Long> idSet = new HashSet<>(searchAttrIds);
List<SkuEsModel.Attrs> attrsList = baseAttrs.stream().filter(item -> {
return idSet.contains(item.getAttrId());
}).map(item -> {
SkuEsModel.Attrs attrs = new SkuEsModel.Attrs();
BeanUtils.copyProperties(item, attrs);
return attrs;
}).collect(Collectors.toList());
// 1、发送远程调用,,库存系统查询是否有库存
List<Long> skuIds = skus.stream().map(SkuInfoEntity::getSkuId).collect(Collectors.toList());
Map<Long, Boolean> stockMap = null;
try{
R skuHasStock = wareFeignService.getSkuHasStock(skuIds);
stockMap = skuHasStock.getData("data",new TypeReference<List<SkuHasStockTo>>(){}).stream().collect(Collectors.toMap(SkuHasStockTo::getSkuId, SkuHasStockTo::getHasStock));
}catch (Exception e){
log.error("库存服务查询异常",e);
}
// 2. 封装每个sku信息
Map<Long, Boolean> finalStockMap = stockMap;
List<SkuEsModel> upProducts = skus.stream().map(sku -> {
// 组装需要的数据
SkuEsModel esModel = new SkuEsModel();
BeanUtils.copyProperties(sku,esModel);
// skuPrice skuImg,
esModel.setSkuPrice(sku.getPrice());
esModel.setSkuImg(sku.getSkuDefaultImg());
//hasStock,hotScore
// 设置库存信息
if (finalStockMap == null){
esModel.setHasStock(true);
} else {
esModel.setHasStock(finalStockMap.get(sku.getSkuId()));
}
//TODO 2、热度评分
esModel.setHotScore(0L);
//3、查询品牌和分类的名字
// brandName;brandImg;
BrandEntity brand = brandService.getById(esModel.getBrandId());
esModel.setBrandName(brand.getName());
esModel.setBrandImg(brand.getLogo());
// brandName;brandImg;catalogName;
CategoryEntity category = categoryService.getById(esModel.getCatalogId());
esModel.setCatalogName(category.getName());
//设置检索属性
esModel.setAttrs(attrsList);
return esModel;
}).collect(Collectors.toList());
// 将数据发送给es进行保存
R r = searchFeignService.productStatusUp(upProducts);
if (r.getCode() == 0){
//远程调用成功
baseMapper.updateSpuStatus(spuId, ProductConstant.StatusEnum.SPU_UP.getCode());
} else {
// 远程调用失败
// TODO 重复调用?接口幂等性,重试机制?
}
}
@Override
public SpuInfoEntity getSpuInfoBySkuId(Long skuId) {
SkuInfoEntity byId = skuInfoService.getById(skuId);
SpuInfoEntity spuInfoEntity = getById(byId.getSpuId());
return spuInfoEntity;
}
} | [
"1184384017@qq.com"
] | 1184384017@qq.com |
fe938e3507e266f35d0f126d1548b4b0a8fc4c6c | 5b8efa5c90880c1e4ddb62c902e512eeacbbbf96 | /SocialApp/src/main/java/di/uoa/gr/m151/socialapp/service/UserService.java | a802887dc34ea904dbf49eef4f6b4b05daca58f7 | [
"MIT"
] | permissive | fmemis/DiSocialApp | a037392cbbc502334211c079544da8272e8a4c15 | 100f01e904a5e3dfffa1f96343e6a0a342aaac12 | refs/heads/main | 2023-05-09T11:28:26.571302 | 2021-06-02T11:42:06 | 2021-06-02T11:42:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 648 | java | package di.uoa.gr.m151.socialapp.service;
import di.uoa.gr.m151.socialapp.DTO.UserDTO;
import di.uoa.gr.m151.socialapp.entity.User;
import org.springframework.security.core.userdetails.UserDetailsService;
import java.util.List;
public interface UserService extends UserDetailsService {
User findByUserName(String userName);
User save(User appUser);
User update(User user);
List<User> findAllUsers(Integer page);
boolean userExists(String username);
UserDTO fillUserDTO(User user);
public UserDTO fillEnhancedUserDTO(User user, Boolean includeRatings, Boolean includeFeedPosts);
List<UserDTO> searchUsers(String usernamePart);
}
| [
"fotis1204@windowslive.com"
] | fotis1204@windowslive.com |
e1650fc83b3ea290c850cbac2ffb400dc0e50f09 | ca166266f163df3b8057409f97ae28e5cb77c89b | /src/net/slipcor/pvparena/updater/ModulesUpdater.java | 18c61dc848cb0427ed3982dd4db5fbf2d2bac827 | [] | no_license | Mori01231/pvparena | cb5457a67c550a7a080347d66d2286c069343a8e | 18cdc9e8fed82fbd1674f4deebddc3eb26c0bf37 | refs/heads/master | 2022-12-28T23:58:57.753885 | 2020-10-13T19:46:07 | 2020-10-13T19:46:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,873 | java | package net.slipcor.pvparena.updater;
import com.google.gson.JsonObject;
import net.slipcor.pvparena.PVPArena;
import net.slipcor.pvparena.arena.Arena;
import net.slipcor.pvparena.core.Language;
import org.bukkit.command.CommandSender;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.List;
import static net.slipcor.pvparena.core.Language.MSG;
/**
* Manage modules versions and updates
*/
public class ModulesUpdater extends AbstractUpdater {
private final static String API_URL = "https://api.github.com/repos/Eredrim/pvparena_modules/releases/latest";
private static final String CONFIG_NODE = "update.modules";
/**
* Construct a modules updater
* @param msgList Reference to UpdateChecker message list
*/
public ModulesUpdater(List<String> msgList) {
super(msgList, CONFIG_NODE);
}
/**
* Run modules updaters : checks version and downloads update according to config
* @throws IOException Exception if can't connect to github API
*/
protected void runUpdater() throws IOException {
String currentVersion = this.getModulesVersion();
URL githubApi = new URL(API_URL);
URLConnection connection = githubApi.openConnection();
JsonObject versionJson = getVersionJson(connection.getInputStream());
String onlineVersion = getOnlineVersionFromJson(versionJson);
if(isUpToDate(currentVersion, onlineVersion)) {
LOG.info("PVP Arena modules are up to date");
} else {
String updateInfo = getAnnounceMessage(MSG.UPDATER_MODULES.toString(), onlineVersion, currentVersion);
LOG.info(updateInfo);
if(this.updateMode == UpdateMode.ANNOUNCE) {
this.updateMsgList.add(updateInfo);
} else if(this.updateMode == UpdateMode.DOWNLOAD ) {
String filename = getFilenameFromJson(versionJson);
LOG.info("Downloading modules update...");
try {
downloadAndUnpackModules(getDownloadUrlFromJson(versionJson), filename);
String updateSuccess = getSuccessMessage(MSG.UPDATER_MODULES.toString(), onlineVersion);
LOG.info(updateSuccess);
this.updateMsgList.add(updateSuccess);
} catch (IOException e) {
LOG.warning("Error during modules update");
e.printStackTrace();
}
}
}
}
public static void downloadModulePack(CommandSender sender) {
try {
URL githubApi = new URL(API_URL);
URLConnection connection = githubApi.openConnection();
JsonObject versionJson = getVersionJson(connection.getInputStream());
String onlineVersion = getOnlineVersionFromJson(versionJson);
String filename = getFilenameFromJson(versionJson);
Arena.pmsg(sender, Language.parse(MSG.UPDATER_DOWNLOADING, Language.parse(MSG.UPDATER_MODULES)));
downloadAndUnpackModules(getDownloadUrlFromJson(versionJson), filename);
String updateSuccess = getSuccessMessage(MSG.UPDATER_MODULES.toString(), onlineVersion);
LOG.info(updateSuccess);
} catch (IOException e) {
String errorMsg = Language.parse(MSG.UPDATER_DOWNLOAD_ERROR, Language.parse(MSG.UPDATER_MODULES));
Arena.pmsg(sender, errorMsg);
LOG.warning(errorMsg);
e.printStackTrace();
}
}
/**
* Get current modules version based on version.lock
* @return version string (x.x.x format)
*/
private String getModulesVersion() {
File lockFile = new File(this.getFilesFolder(), "version.lock");
if(lockFile.exists()) {
try {
List<String> lines = Files.readAllLines(lockFile.toPath(), Charset.defaultCharset());
return lines.get(0);
} catch (IOException e) {
e.printStackTrace();
}
}
return "0.0.0";
}
/**
* Downloads new module package and unpack it
* @param downloadUrlStr Download url
* @param filename Packge file name
* @throws IOException
*/
private static void downloadAndUnpackModules(String downloadUrlStr, String filename) throws IOException {
URL downloadUrl = new URL(downloadUrlStr);
File dataFolder = PVPArena.instance.getDataFolder();
File zipFile = new File(dataFolder, filename);
if (zipFile.exists()) {
zipFile.delete();
}
ReadableByteChannel readableByteChannel = Channels.newChannel(downloadUrl.openStream());
FileOutputStream outputStream = new FileOutputStream(zipFile);
outputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
outputStream.close();
deleteDirectory(getFilesFolder());
ZipUtil.unzip(zipFile, dataFolder);
zipFile.delete();
}
/**
* Returns PVP Arena "files" folder
* @return "files" folder
*/
private static File getFilesFolder() {
return new File(PVPArena.instance.getDataFolder().getPath() + "/files");
}
/**
* Removes recusively a directory
* @param directoryToBeDeleted directory to be deleted
*/
private static void deleteDirectory(File directoryToBeDeleted) {
File[] allContents = directoryToBeDeleted.listFiles();
if (allContents != null) {
for (File file : allContents) {
deleteDirectory(file);
}
}
directoryToBeDeleted.delete();
}
}
| [
"Eredrim@users.noreply.github.com"
] | Eredrim@users.noreply.github.com |
fe7de64c0f6361357dc23fbf3f38d45face75e33 | 6c7d9b30d662bd4f96fe63f8633f086c42ce7863 | /discover_user_hibernate/src/main/java/com/ada/user/data/entity/UserInfo.java | 6cc656f207a253b479d6d48b13dc4fecbf5f895c | [] | no_license | designreuse/discover | c4821c6f5eb12515aabaa19ea0cd904ce4479144 | 9cf358b69fb11c89358c4a5e9ec6a80041c6c161 | refs/heads/master | 2020-03-12T12:58:18.546746 | 2017-10-26T10:38:14 | 2017-10-26T10:38:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,153 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.ada.user.data.entity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* 用户
*
* @author ada
*
*/
@Entity
@Table(name = "user_info")
public class UserInfo extends AbstractUser {
public static UserInfo fromId(Long id) {
UserInfo result = new UserInfo();
result.setId(id);
return result;
}
}
| [
"2287046966@qq.com"
] | 2287046966@qq.com |
15fe026a962d6997846613a8c0a4db18ad391ad1 | f5c58550743d4e9acfec5598fc65ae957082c4cc | /app/src/main/java/com/youli/huangpuwenjuantest2017_11_15/MainActivity.java | 5a8424f01a5e3ce908d57bd1bd2506bfc4484e41 | [] | no_license | 2381447237/wenJuan | 0f213baa5ff28b420bdd381a54866416de5ab295 | 4717cf4edfe67ae59560744baa7089b2c22a233d | refs/heads/master | 2021-08-18T23:50:18.885770 | 2017-11-24T07:54:10 | 2017-11-24T07:54:10 | 111,502,501 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,706 | java | package com.youli.huangpuwenjuantest2017_11_15;
import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.youli.huangpuwenjuantest2017_11_15.adapter.QuestionListAdapter;
import com.youli.huangpuwenjuantest2017_11_15.bean.NaireListInfo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class MainActivity extends Activity {
private ListView lv;
private QuestionListAdapter adapter;
private List<NaireListInfo> data=new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lv= (ListView) findViewById(R.id.question_lv);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent=new Intent(MainActivity.this,NaireDetailActivity.class);
intent.putExtra("wenjuan",data.get(position));
startActivity(intent);
}
});
getLocalData();
}
private void getLocalData(){
try {
InputStream is=getAssets().open("myjson2.txt");
final String text=readTextFromSDcard(is);
runOnUiThread(new Runnable() {
@Override
public void run() {
Gson gson=new Gson();
data=gson.fromJson(text,new TypeToken<LinkedList<NaireListInfo>>(){}.getType());
adapter=new QuestionListAdapter(MainActivity.this,data);
lv.setAdapter(adapter);
}
});
} catch (IOException e) {
e.printStackTrace();
}
}
private String readTextFromSDcard(InputStream is) throws IOException {
InputStreamReader reader=new InputStreamReader(is,"GBK");
BufferedReader bufferedReader=new BufferedReader(reader);
StringBuffer buffer=new StringBuffer("");
String str;
while ((str=bufferedReader.readLine())!=null){
buffer.append(str);
buffer.append("\n");
}
return buffer.toString();
}
}
| [
"2381447237@qq.com"
] | 2381447237@qq.com |
b25f8ee586b17b7c628757106fc337dd5ed2f6e6 | 6605971413d9d840b63420626241d85a9cb4bad0 | /src/main/java/common/pageobject/pages/SearchPage.java | 5f2a425055148c55b7ecefeb5ce06377b6aba600 | [] | no_license | navinislam/serenity-example | 58f0253d36da9f07cd281f982d23a60381c8a791 | f721870b8359c4d6efc4dd1edb7eb5c9dfe8a424 | refs/heads/master | 2020-03-22T21:00:37.697014 | 2018-07-20T13:21:02 | 2018-07-20T13:21:02 | 140,649,213 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,011 | java | package common.pageobject.pages;
import net.serenitybdd.core.annotations.findby.FindBy;
import net.serenitybdd.core.pages.PageObject;
import net.serenitybdd.core.pages.WebElementFacade;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import java.util.List;
public class SearchPage extends PageObject{
@FindBy(partialLinkText="login-button")
WebElementFacade loginButton;
/*
SELECTORS
*/
private static final String PRINTED_CHIFFON_DRESS= "css: a.product-name[title='Printed Chiffon Dress'] ";
private static final String PRODUCTS= "css: a.product-name";
/*
ACTIONS
*/
public void clickOnDress(){
$(PRINTED_CHIFFON_DRESS).click();
}
public boolean checkResultsExist(){
List<WebElement> myElements = getDriver().findElements(By.cssSelector("a.product-name"));
if(myElements.size()>0){
return true;
}
else {
return false;
}
}
}
| [
"navin.islam@gmail.com"
] | navin.islam@gmail.com |
ab60e9277319aefe43d40b8bde3ce59d3fb74a90 | b348afa62a486eb4e71b644090dfededc5690da5 | /jd1/src/com/whty/platform/modules/hongcheng/utils/ClassLoaderUtil.java | 8b68c861e579998dac41e9d18e955689d44ac28d | [] | no_license | wanghuale/jd | 91ed7ecc016151c71882861a4ad5259a9b5b0c94 | 4e9c9c59b594e8191722ed2691dbd10d7b692a3c | refs/heads/master | 2021-01-15T09:32:19.485081 | 2014-02-11T14:52:42 | 2014-02-11T14:52:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,318 | java | package com.whty.platform.modules.hongcheng.utils;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
/**
* 打为jar包后也能找到配置文件,并以流的方式读取。
*
* @author cx
* @date 2010-11-17 下午04:36:20
*/
public class ClassLoaderUtil {
public static URL getResource(String resourceName, Class<?> callingClass) {
URL url = Thread.currentThread().getContextClassLoader()
.getResource(resourceName);
if (url == null) {
url = ClassLoaderUtil.class.getClassLoader().getResource(
resourceName);
}
if (url == null) {
ClassLoader cl = callingClass.getClassLoader();
if (cl != null) {
url = cl.getResource(resourceName);
}
}
if ((url == null)
&& (resourceName != null)
&& ((resourceName.length() == 0) || (resourceName.charAt(0) != '/'))) {
return getResource('/' + resourceName, callingClass);
}
// if (url != null) {
// logger.info("配置文件路径为= " + url.getPath());
// }
return url;
}
public static InputStream getResourceAsStream(String resourceName,
Class<?> callingClass) {
URL url = getResource(resourceName, callingClass);
try {
return (url != null) ? url.openStream() : null;
} catch (IOException e) {
System.out.println("未知的路径:"+url);
return null;
}
}
} | [
"huaywang163@163.com"
] | huaywang163@163.com |
888c7ed01ad00d1227b9a39cbdd2054a1ff60517 | 460fee9fd3ea14442aed7c012ee959c033990ae1 | /server/SoundChatServer/src/com/dyz/persist/util/GlobalData.java | 9e55a42c507a95ce28f4a4733f8c3902406590fc | [] | no_license | woodyfairy/majiang | c718ac2c59476c9a43ad6c771bccc19a8827d2d5 | 4e1296e183710058c6df510931f982f00e4a0902 | refs/heads/master | 2020-03-21T07:37:12.462955 | 2018-10-10T02:26:33 | 2018-10-10T02:26:33 | 138,290,006 | 0 | 0 | null | 2018-06-22T10:31:28 | 2018-06-22T10:31:28 | null | UTF-8 | Java | false | false | 114 | java | package com.dyz.persist.util;
/**
* Created by kevin on 2016/6/21.
*/
public class GlobalData {
}
| [
"smileking67@gmail.com"
] | smileking67@gmail.com |
5d5d69a286286d1f11f2ecb657922c850c68291b | f3184ac0f910c1028ddc7d631a91a2d45a012730 | /src/main/java/rs/ac/metropolitan/kanbanbackend/ServletInitializer.java | 8105dfba92bf4f0dae6c246dd4279acf3a7ce334 | [] | no_license | davidivanovic22/kanban-backend | 57bdd040f90156650a3898e3025ab9367f1fb2e6 | 3b675d67b22ebca918fe9319b817f94c939eafa2 | refs/heads/main | 2023-02-20T23:01:21.490077 | 2021-01-23T16:50:54 | 2021-01-23T16:50:54 | 332,250,073 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | package rs.ac.metropolitan.kanbanbackend;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(KanbanBackendApplication.class);
}
}
| [
"ivanovicdavid788@gmail.com"
] | ivanovicdavid788@gmail.com |
fcf28a19b815e94b79835c77e8bfcb2f2eb4ce2c | 4b19fd85deb137e21ec18f9ec661eff790277db4 | /hotelhunt_v1/WEB-INF/classes/LoginUtil.java | f7861a8403b5ee86c92d13a177da5402404c982c | [] | no_license | AgarwalVivek/EnterpriseWebApplication | 891c5ad5de0dce1d7054526854ca77bf4e321620 | 4ef54f265afb5250c672ebc368aab85060da588c | refs/heads/master | 2021-09-04T13:12:27.455476 | 2018-01-19T02:49:15 | 2018-01-19T02:49:15 | 115,777,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,150 | java | import java.io.*;
import javax.servlet.http.*;
public class LoginUtil {
HttpServletRequest req;
HttpSession session;
public LoginUtil(HttpServletRequest req) {
this.req = req;
this.session = req.getSession(true);
}
public boolean validation(String username, String password){
if((username==null|| username=="" || username==" ")&&(password==null||password=="" || password==" ")){
session.setAttribute("missing", "PLEASE ENTER USERNAME and PASSWORD");
return false;
} else if(username==null|| username=="" || username==" "){
session.setAttribute("missing", "PLEASE ENTER USERNAME");
return false;
} else if(password==null|| password=="" || password==" "){
session.setAttribute("missing", "PLEASE ENTER PASSWORD");
return false;
} else{
return true;
}
}
public boolean isLoggedin(){
if (session.getAttribute("username")==null)
return false;
return true;
}
public void logout(){
session.removeAttribute("logged");
session.removeAttribute("username");
session.removeAttribute("user");
}
}
| [
"vivekagarwal@Viveks-MBP.attlocal.net"
] | vivekagarwal@Viveks-MBP.attlocal.net |
5e767073b2b803ac2f2e211311a66eca7e72bc65 | f620b56bad4aa2f99b48896f58e28ef15a3e16b8 | /app/src/main/java/popmovies/com/example/android/baking_app/fragments/RecipeFragment.java | 223f8136952909b78d8a34f43a85d90cd8222fb0 | [] | no_license | seth-wat/baking-app | 412ba08a8ca5909bafa4b6aad5fc74eab6b1371d | 8036350c174c2752f96b3263d90ec6f903bd9274 | refs/heads/master | 2021-07-09T21:36:57.027474 | 2017-10-09T12:07:44 | 2017-10-09T12:07:44 | 103,969,584 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,411 | java | package popmovies.com.example.android.baking_app.fragments;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.parceler.Parcels;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import popmovies.com.example.android.baking_app.R;
import popmovies.com.example.android.baking_app.adapters.StepAdapter;
import popmovies.com.example.android.baking_app.data.Recipe;
import popmovies.com.example.android.baking_app.data.Step;
/**
* This fragment contains a list of ingredients and steps
* when a step is clicked it will pass data to the Fragment
* that displays step details.
*/
public class RecipeFragment extends Fragment {
private Recipe recipe;
private onStepSelectedListener mCallback;
private Unbinder unbinder;
private StepAdapter stepAdapter;
private boolean isTablet = false;
private int positionToRestore;
/*
Constants for saving state.
*/
public static final String IS_TABLET_OUT = "is_tablet_out";
public static final String RECIPE_OUT = "recipe_out";
public static final String POSITION_OUT = "position_out";
@BindView(R.id.ingredients_text_view) TextView ingredientsTextView;
@BindView(R.id.steps_recycler_view) RecyclerView stepsRecyclerView;
public RecipeFragment() {
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_recipe, container, false);
unbinder = ButterKnife.bind(this, rootView);
if (savedInstanceState != null) {
if (savedInstanceState.containsKey(RECIPE_OUT)) {
recipe = Parcels.unwrap((Parcelable) savedInstanceState.get(RECIPE_OUT));
isTablet = (Boolean) savedInstanceState.get(IS_TABLET_OUT);
mCallback = (onStepSelectedListener) getContext();
positionToRestore = (Integer) savedInstanceState.get(POSITION_OUT);
}
}
//Loop over the ingredient list and add them to the TextView.
for (int i = 0; i < recipe.getIngredients().size(); i++) {
if (i == 0) {
ingredientsTextView.setText("- " + recipe.getIngredients().get(i).getIngredient());
} else {
ingredientsTextView.setText(ingredientsTextView.getText() + "\n" +
"- " + recipe.getIngredients().get(i).getIngredient());
}
}
/*
Set the layout manager/adapter for the RecyclerView and pass in the steps
as well as the onStepSelectedListener implemented in RecipeActivity to
facilitate communication between this fragment and the host activity.
*/
LinearLayoutManager stepLayoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);
stepsRecyclerView.setLayoutManager(stepLayoutManager);
stepAdapter = new StepAdapter(getContext(), recipe.getSteps(), mCallback, isTablet, positionToRestore);
stepsRecyclerView.setAdapter(stepAdapter);
return rootView;
}
public void setRecipe(Recipe recipe) {
this.recipe = recipe;
}
public interface onStepSelectedListener {
void onStepSelected(List<Step> steps, int position);
}
public void setmCallback(onStepSelectedListener mCallback) {
this.mCallback = mCallback;
}
public void setTabletMode(boolean bool) {
isTablet = bool;
}
@Override
public void onSaveInstanceState(Bundle outState) {
outState.putBoolean(IS_TABLET_OUT, isTablet);
outState.putParcelable(RECIPE_OUT, Parcels.wrap(recipe));
positionToRestore = stepAdapter.getLastPosition();
outState.putInt(POSITION_OUT, positionToRestore);
super.onSaveInstanceState(outState);
}
public void setPositionToRestore(int i) {
positionToRestore = i;
}
}
| [
"seth.personal.smtp@gmail.com"
] | seth.personal.smtp@gmail.com |
4b84120483541f6343145aa3ff96f59266c640ed | 1eb9b60252d46cbbc5793625cdd7cdfe222eaf37 | /src/main/java/calculators/Calculator.java | 23fe2de3109ba020195db2bfa62911a644a023db | [] | no_license | Sazarov/Nth-digit-of-Pi | 9af75cf53045029a7f9eaf1021ceb23502687945 | 290a254782f585391bf93b9d76647cee8e1353bc | refs/heads/master | 2020-04-28T11:35:51.036358 | 2019-03-21T13:47:10 | 2019-03-21T13:47:10 | 175,247,718 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 186 | java | package calculators;
import java.math.BigDecimal;
public interface Calculator {
public BigDecimal calculate();
public void setPrecision(int precision);
public int getPrecision();
}
| [
"s.c.azarov@gmail.com"
] | s.c.azarov@gmail.com |
149f9ea2b689d2752d2b4df54f31633a11244cbe | 32c94d12413ba6fe6734e8b1b81361618964d1ca | /src/main/java/br/iss/ecommerce/servlet/adm/Parametro_Edit.java | f4b7968db5f81479ddbdd8f790c60385087ba920 | [] | no_license | pimball12/eCommerce-ISS | fc623129d3a373b08f44267dabe65e901e9d8746 | dbc82ff9fbcb0f1a35315a39b449ea562f240c68 | refs/heads/master | 2021-08-30T17:51:06.378362 | 2017-12-18T22:09:19 | 2017-12-18T22:09:19 | 105,576,884 | 0 | 0 | null | 2017-12-18T20:28:44 | 2017-10-02T19:38:58 | HTML | UTF-8 | Java | false | false | 1,272 | java | package br.iss.ecommerce.servlet.adm;
import java.io.IOException;
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 br.iss.ecommerce.dao.GradeDAO;
import br.iss.ecommerce.dao.ParametroDAO;
import br.iss.ecommerce.domain.Grade;
import br.iss.ecommerce.domain.Parametro;
@WebServlet("/adm/parametro/edit")
public class Parametro_Edit extends HttpServlet {
private static final long serialVersionUID = 1L;
public Parametro_Edit() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
request.setAttribute("page_title", "Parametros");
request.setAttribute("page_description", "Parametros gerais do sistema.");
ParametroDAO parametroDAO = new ParametroDAO();
Parametro parametro = parametroDAO.getFirstOrCreate();
request.setAttribute("parametro", parametro);
request.getRequestDispatcher("/view/admin/parametro_form.jsp").forward(request, response);
} catch (Exception e) {
response.getWriter().append("Error: " + e.getMessage());
}
}
}
| [
"luizjunior2005@gmail.com"
] | luizjunior2005@gmail.com |
b88f23e948bf5b478badf278e72a7950fd68c705 | 31f5a48e4d6e6da2e84a02f2e8e9d36183a2061d | /src/exercises/RectangleArea.java | fe65558c8c972840cc91f2fc2f0a009ee1ccb6a3 | [] | no_license | TerrelRJones/java-web-dev-exercises | df5d5b1afd55197e73d9b30ab375a054fb07761d | 591e214e8eb76287cd2d66fa1abbc9d183c4b71a | refs/heads/master | 2023-08-14T12:12:02.030878 | 2021-09-28T23:17:52 | 2021-09-28T23:17:52 | 400,027,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 499 | java | package exercises;
import java.util.Scanner;
public class RectangleArea {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter width of rectangle: ");
int width = input.nextInt();
System.out.println("Enter height of rectangle: ");
int height = input.nextInt();
input.close();
int area = width * height;
System.out.println("The area of your rectangle is " + area);
}
}
| [
"TerrelRJones@gmail.com"
] | TerrelRJones@gmail.com |
1f8043360de2bd1275f03a51c5fcb715244fdd74 | e2fc93c0731b3ad9f30adceb126996a20d28ad52 | /src/main/java/org/zooffice/sm/package-info.java | ebb7775b61f1c980dc0a969d9ea2b0f50b2794a1 | [] | no_license | maoyubin/zooffice_template | 1639e82205f0bc895519c5fb7800cd0c1245463f | fcbb21f4a656d0889911d19fac3d9c1eaefe437a | refs/heads/master | 2020-04-17T10:01:32.521036 | 2016-09-07T03:14:27 | 2016-09-07T03:14:27 | 67,567,201 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 79 | java | /**
* zooffice custom security manager package.
*/
package org.zooffice.sm;
| [
"maoyb@nhn.com"
] | maoyb@nhn.com |
3d74dc20aeacbaadce14f4482154c41f12f7bcc5 | 7aa1c9700bc2b975b4fcb263a2438fec2f28e3ad | /JavaSource/com/acminds/acuteauto/persistence/entities/AbstractModel.java | e16562c826f2b93ecd40d066dedce58e1e1cef7c | [] | no_license | Letractively/acuteauto | b6c3a3f2fe3042e5bc4c46ee0570ab0f7c84234c | e6549c732f19cae6304f2ee6e9f2c6c33cce78be | refs/heads/master | 2021-01-10T16:55:01.020512 | 2012-07-20T09:55:05 | 2012-07-20T09:55:05 | 45,890,490 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,424 | java | package com.acminds.acuteauto.persistence.entities;
// Generated May 13, 2012 8:21:43 PM by Hibernate Tools 3.4.0.CR1
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.CascadeType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;
import com.acminds.acuteauto.persistence.dto.*;
/**
* Model generated by customhbm2java
*/
@MappedSuperclass
public abstract class AbstractModel extends
com.acminds.acuteauto.persistence.BaseDTO implements
java.io.Serializable {
private static final long serialVersionUID = 1L;
private Integer modelId;
private Make make;
private String name;
private String description;
private int yearStart;
private Integer yearEnd;
private List<Vehicle> vehicles = new ArrayList<Vehicle>(0);
private List<TradeinInfo> tradeinInfos = new ArrayList<TradeinInfo>(0);
private List<Style> styles = new ArrayList<Style>(0);
private List<FindVehicle> findVehicles = new ArrayList<FindVehicle>(0);
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "MODEL_ID", unique = true, nullable = false)
public Integer getModelId() {
return this.modelId;
}
public void setModelId(Integer modelId) {
this.modelId = modelId;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "MAKE_ID", nullable = false)
public Make getMake() {
return this.make;
}
public void setMake(Make make) {
this.make = make;
}
@Column(name = "NAME", nullable = false, length = 60)
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "DESCRIPTION", length = 100)
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
@Column(name = "YEAR_START", nullable = false)
public int getYearStart() {
return this.yearStart;
}
public void setYearStart(int yearStart) {
this.yearStart = yearStart;
}
@Column(name = "YEAR_END")
public Integer getYearEnd() {
return this.yearEnd;
}
public void setYearEnd(Integer yearEnd) {
this.yearEnd = yearEnd;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "model")
public List<Vehicle> getVehicles() {
return this.vehicles;
}
public void setVehicles(List<Vehicle> vehicles) {
this.vehicles = vehicles;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "model")
public List<TradeinInfo> getTradeinInfos() {
return this.tradeinInfos;
}
public void setTradeinInfos(List<TradeinInfo> tradeinInfos) {
this.tradeinInfos = tradeinInfos;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "model", cascade = {CascadeType.ALL})
public List<Style> getStyles() {
return this.styles;
}
public void setStyles(List<Style> styles) {
this.styles = styles;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "model")
public List<FindVehicle> getFindVehicles() {
return this.findVehicles;
}
public void setFindVehicles(List<FindVehicle> findVehicles) {
this.findVehicles = findVehicles;
}
}
| [
"Mansur.Md@gmail.com"
] | Mansur.Md@gmail.com |
55954d031e2a424dbfb385eebc22f998d0c5ded2 | f4ff062912f15702d132f983f1297e2fd5bcc7de | /model/ColourList.java | 5a870b6cada9a17c407eead116cdb2095a1d801c | [] | no_license | mingjiongliao/JavaMVC | c90491139829cc1f874381fa9e6496680d863d0e | 393a22b9b29091fcea7a252d075c5977b9882fc1 | refs/heads/master | 2022-03-29T15:39:15.157007 | 2020-01-04T21:05:07 | 2020-01-04T21:05:07 | 231,827,983 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 490 | java | package application.model;
import java.util.ArrayList;
public class ColourList {
private ArrayList<Colour> cl;
public ArrayList<Colour> getCl() {
return cl;
}
// public void sort() {
// Collections.sort(cl);
// }
public ColourList() {
cl = new ArrayList<Colour>();
for (int i = 0; i < 10; i++) {
cl.add(new Colour());
}
}
public static void main(String[] args) {
ColourList cl = new ColourList();
for (Colour c : cl.getCl()) {
System.out.println(c);
}
}
}
| [
"22457102+mingjiongliao@users.noreply.github.com"
] | 22457102+mingjiongliao@users.noreply.github.com |
72054a36cfe7a3377100279072d6afa2eb863252 | d4373084381d981ce5957c1f6d1012fc9212905c | /src/Evaluate.java | 1fd5f87c1cd1ad95a16ffc66c17e006326744c8d | [] | no_license | satriaardiperdana-2020/TesJavaCode | 599b957776e0c240f7eadc3f306ba588caea5fc2 | 8178b86397fbf9a203db2284d2e4fe46614af174 | refs/heads/master | 2023-02-21T11:06:24.752709 | 2021-01-23T13:25:34 | 2021-01-23T13:25:34 | 332,213,324 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | class Evaluate
{
public static void main(String[] args)
{
int[] arr = new int[] {0 , 1, 2, 3, 4, 5, 6, 7, 8, 9};
int n = 6;
n = arr[arr[n] / 2];
System.out.println(arr[n] / 2);
}
} | [
"satria.a.perdana@alfadigital.id"
] | satria.a.perdana@alfadigital.id |
4776aa8a3ef985fb744baccc52c65c633631adc9 | e89ea04fd3185a767b041e4f841569674336435f | /src/main/java/com/greatwall/clientapi/service/ClientService.java | 4173ba0d494bf025b3ff02270f0bce3d25f000de | [] | no_license | wangtiankeji/CYB | f5edc80a132f1e24a6d2102cef66ed272e560875 | eb78cd95a77aff858a2170c7eb1f0a3fed760b1b | refs/heads/master | 2016-09-05T21:18:44.664454 | 2015-08-26T09:27:39 | 2015-08-26T09:27:39 | 41,238,647 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package com.greatwall.clientapi.service;
import com.greatwall.recharge.dto.Consume;
public interface ClientService {
public String searchState(Consume consume) throws Exception;
}
| [
"fudk_k@sina.com"
] | fudk_k@sina.com |
4ba1cb666b3142b1a408bff2d6a0271bf232e695 | 2be9e1ae8b83c4213928d557aff5042f38363e33 | /hospital-service/src/main/java/com/llw/hospital/ds/listener/TableDataChangeListener.java | 78d9e72ce230168fa5bba733766eaf022a6dc8a6 | [] | no_license | gaoxiaofei90/hospital-parent | 389ef4a3a6617ee92624a520ebacbf040cd90ba9 | c46dff5304698581a4886ea0f7888a6f09cce173 | refs/heads/master | 2022-07-10T20:12:31.865361 | 2020-03-05T06:46:35 | 2020-03-05T06:46:35 | 244,821,151 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,538 | java | package com.llw.hospital.ds.listener;
import com.jcl.common.spring.context.AppContextHolder;
import com.jcl.orm.monitor.listener.event.TableDataChangeEvent;
import com.llw.cache.CacheClient;
import com.llw.cache.TableAssociatedCacheService;
import com.llw.hospital.common.base.constants.BaseConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;
import java.util.Map;
/**
* 监听表数据变化并自动刷新缓存
*/
@Component
public class TableDataChangeListener {
private Logger logger = LoggerFactory.getLogger(TableDataChangeListener.class);
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT,fallbackExecution = true)
public void refreshCache(TableDataChangeEvent event){
Map<String, TableAssociatedCacheService> allCacheServices = AppContextHolder.getBeansOfType(TableAssociatedCacheService.class);
if(!allCacheServices.isEmpty()){
for(TableAssociatedCacheService cacheService:allCacheServices.values()){
if(cacheService.associatedWith(event.getTableName())){
logger.info("通知增量刷新缓存{}",cacheService.getCacheName());
CacheClient.refresh(cacheService.getCacheName()+"?"+ BaseConstants.CACHE_REFRESH_TYPE+"="+BaseConstants.CACHE_REFRESH_TYPE_DELTA);
}
}
}
}
}
| [
"1821464821@qq.com"
] | 1821464821@qq.com |
7bd6e80090fb0d0a82cd320ae078b7529f868902 | 977623a1a19f9225274d8d07a208b4508bd18084 | /siebog/test/siebog/agents/test/hacontractnet/HAContractNet.java | dfb4d8caea477eaa3c3732bc0a85da872f686281 | [
"Apache-2.0"
] | permissive | ElsevierKnowledgeBasedSystems/KNOSYS-D-15-01003 | 8793fb74dee1a4c408d0aba2c2d83858cc04c2bd | d196cacf2c2506aad930f1e30060c6f689002e7e | refs/heads/master | 2020-12-26T00:45:57.170095 | 2016-03-18T12:33:33 | 2016-03-18T12:33:33 | 55,842,098 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,223 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may
* obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied.
*
* See the License for the specific language governing permissions
* and limitations under the License.
*/
package siebog.agents.test.hacontractnet;
import siebog.SiebogClient;
import siebog.agents.AID;
import siebog.agents.Agent;
import siebog.agents.AgentClass;
import siebog.interaction.ACLMessage;
import siebog.interaction.Performative;
import siebog.utils.ObjectFactory;
/**
*
* @author <a href="mitrovic.dejan@gmail.com">Dejan Mitrovic</a>
*/
public class HAContractNet {
private static final int NUM_PARTICIPANTS = 16;
public static void main(String[] args) {
SiebogClient.connect("localhost");
AID[] participants = createParticipants();
AID initiator = createInitiator();
start(initiator, participants);
}
private static AID[] createParticipants() {
AID[] aids = new AID[NUM_PARTICIPANTS];
AgentClass pcls = new AgentClass(Agent.SIEBOG_MODULE, Participant.class.getSimpleName());
for (int i = 0; i < NUM_PARTICIPANTS; i++)
aids[i] = ObjectFactory.getAgentManager().startServerAgent(pcls, "P" + i, null);
return aids;
}
private static AID createInitiator() {
AgentClass icls = new AgentClass(Agent.SIEBOG_MODULE, Initiator.class.getSimpleName());
return ObjectFactory.getAgentManager().startServerAgent(icls, "I", null);
}
private static void start(AID initiator, AID[] participants) {
ACLMessage msg = new ACLMessage(Performative.REQUEST);
msg.receivers.add(initiator);
msg.contentObj = participants;
ObjectFactory.getMessageManager().post(msg);
}
}
| [
"mitrovic.dejan@gmail.com"
] | mitrovic.dejan@gmail.com |
a29a6f8001bc772898694714788629de92e40f6b | 900cc3d78a80407260c663c1c22fd6756fcfe9cf | /src/org/aerogear/android/datamanager/Store.java | d41e8cbf42fbc59307dedb0765d815881726a778 | [] | no_license | qmx/aerogear-android | 5431956e3e39b74f8d4b65d8abc4e968175d9fa6 | d03c06e992a6dd54c11d40a8fa5a277738bf2545 | refs/heads/master | 2020-12-29T03:07:21.727249 | 2012-10-31T19:21:24 | 2012-10-31T20:10:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,935 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2012, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.aerogear.android.datamanager;
import org.aerogear.android.impl.datamanager.StoreType;
import java.io.Serializable;
import java.util.Collection;
/**
* Represents an abstraction layer for a storage system.
*/
public interface Store<T> {
/**
* Returns the type of the underlying 'store implementation'
*
* @return StoreType
*/
public StoreType getType();
/**
* Reads all the data from the underlying storage system.
*
* @return List of T
*/
public Collection<T> readAll();
/**
* Reads a specific object/record from the underlying storage system.
*
* @param id id from the desired object
* @return T
*/
public T read(Serializable id);
/**
* Saves the given object in the underlying storage system.
*
* @param item Object to save
*/
public void save(T item);
/**
* Resets the entire storage system.
*/
public void reset();
/**
* Removes a specific object/record from the underlying storage system.
*
* @param id Id of item to remote
*/
public void remove(Serializable id);
}
| [
"bruno@abstractj.org"
] | bruno@abstractj.org |
575fede354b09075ae0874566c8155073dbf869c | cb8ac20de0c4147de6e6e7118a5ae3d178faab50 | /modules/web/src/com/company/schedule/web/screens/group/GroupEdit.java | af60f5d34a19ae073ea40159c1958f8d308dd570 | [] | no_license | iBaklanovRepos/CUBAschedule | 535468d52e22a512d1c7e0c628a59c378ce2e5c9 | 8160adebd393e40271ccf33dfcb13f518b5443fb | refs/heads/master | 2022-11-19T05:50:44.497940 | 2020-07-24T04:16:58 | 2020-07-24T04:16:58 | 281,708,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 879 | java | package com.company.schedule.web.screens.group;
import com.company.schedule.entity.Lesson;
import com.company.schedule.entity.Student;
import com.haulmont.cuba.gui.model.CollectionContainer;
import com.haulmont.cuba.gui.model.CollectionLoader;
import com.haulmont.cuba.gui.screen.*;
import com.company.schedule.entity.Group;
import javax.inject.Inject;
@UiController("schedule_Group.edit")
@UiDescriptor("group-edit.xml")
@EditedEntityContainer("groupDc")
public class GroupEdit extends StandardEditor<Group> {
@Inject
private CollectionLoader<Student> studentsDl;
@Inject
private CollectionLoader<Lesson> lessonsDl;
@Subscribe
public void onBeforeShow(BeforeShowEvent event) {
studentsDl.setParameter("group", getEditedEntity());
lessonsDl.setParameter("group", getEditedEntity());
getScreenData().loadAll();
}
} | [
"ibaklanov9(@gmail.com"
] | ibaklanov9(@gmail.com |
36df91cec7d9ccc2951b5fda0cb14971ee26895e | f93f48da6ae079b1df55c9c56960a1e0ae5a2557 | /src/main/java/com/couchbase/client/vbucket/config/ConfigFactory.java | af83b4e2be16fa9d6f069550c9cc812d86ba24ad | [] | no_license | aquto/couchbase-java-client-old | 6820d6c9b9ef0a9a33b264677af9d467d6462b81 | 7e5e2c827c30f33b187f1aea8e31286cbc3394f1 | refs/heads/master | 2020-03-30T20:49:37.773083 | 2013-09-19T13:56:30 | 2013-09-19T13:56:30 | 12,920,778 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,405 | java | /**
* Copyright (C) 2009-2013 Couchbase, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING
* IN THE SOFTWARE.
*/
package com.couchbase.client.vbucket.config;
import java.io.File;
import org.codehaus.jettison.json.JSONObject;
/**
* A ConfigFactory.
*/
public interface ConfigFactory {
Config create(File file);
Config create(String data);
Config create(JSONObject jsonObject);
}
| [
"chris@aquto.com"
] | chris@aquto.com |
8738c9759b2edcd5247bc12f9412c44301bcf978 | 89a91da1fad4407b53d219a8617bc67774d6d831 | /src/main/java/ui/MainSplitPane.java | 652e1bc02ffbc34820ba6e4453dfe422cf2f731e | [
"Apache-2.0"
] | permissive | WinfredWang/RabbitVT | 56c224600fe6c142642fced1037e7275231a52c2 | a56b04b55898a42736d634d5170e646d312c5cdd | refs/heads/master | 2021-01-11T07:23:03.556314 | 2016-10-26T13:27:01 | 2016-10-26T13:27:01 | 71,997,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | package ui;
import java.awt.Component;
import javax.swing.JSplitPane;
/**
* @author Winfred
* @date 2016年10月26日
* @version V1.0
*/
public class MainSplitPane extends JSplitPane {
/**
*
*/
private static final long serialVersionUID = 9065716299183324950L;
/**
* @param newOrientation
* @param newLeftComponent
* @param newRightComponent
*/
public MainSplitPane(Component newLeftComponent, Component newRightComponent) {
super(JSplitPane.HORIZONTAL_SPLIT);
setDividerSize(1);
setDividerLocation(50);
setOneTouchExpandable(true);
setContinuousLayout(true);
setVisible(true);
setLeftComponent(newLeftComponent);
setRightComponent(newRightComponent);
}
}
| [
"wangqiyong@126.com"
] | wangqiyong@126.com |
3b6d40a987c13b5d7bacd99a919a0fec6fb4098c | 61df35426afbddaa5241af3eef83637325305847 | /android/calendar/Cell.java | 1133e507ffde6b2c54cce49c2a4c95760ff9162f | [] | no_license | xiaoza/cc | 49f79681628ae3141e07093fd6a259686fdb66cb | 461e5ea3b50dac5b8e73bc7cff6f1c1b1d8afd03 | refs/heads/master | 2020-04-27T19:39:48.525179 | 2015-09-24T15:06:36 | 2015-09-24T15:06:36 | 17,931,355 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,467 | java | package com.meiyebang.meiyebang.pad.view.calendar;
import android.graphics.Rect;
import android.graphics.RectF;
/**
* Created by yuzhen on 15/6/10.
*/
public class Cell {
private int columnKey;
private String columnName;
private int rowKey;
private String rowName;
private RectF rectF;
public Cell(int columnKey, String columnName, int rowKey, String rowName) {
this.columnKey = columnKey;
this.columnName = columnName;
this.rowKey = rowKey;
this.rowName = rowName;
}
public int getColumnKey() {
return columnKey;
}
public void setColumnKey(int columnKey) {
this.columnKey = columnKey;
}
public String getColumnName() {
return columnName;
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public int getRowKey() {
return rowKey;
}
public void setRowKey(int rowKey) {
this.rowKey = rowKey;
}
public String getRowName() {
return rowName;
}
public void setRowName(String rowName) {
this.rowName = rowName;
}
public RectF getRectF() {
return rectF;
}
public void setRectF(RectF rectF) {
this.rectF = rectF;
}
public Rect getRect() {
if (rectF != null) {
return new Rect((int)rectF.left, (int)rectF.top, (int)rectF.right, (int)rectF.bottom);
}
return null;
}
}
| [
"yuzhen@meiyebang.com"
] | yuzhen@meiyebang.com |
2cb2bbb274ca9d06cfcf39b943478e1aecb3b5dd | dd9c1e4c425e63eac48fe7e8664efd2dc3a44ffa | /src/main/java/entropy/vjob/builder/plasma/ComposedSet.java | 3e5d980d5034fb2c0f9bb81ca9346dc74f544162 | [] | no_license | BeyondTheClouds/Entropy | 7dc7568405d312fd374d0e569d0cc93d847ee99e | 3bc25b33a82c4153216537b76081f810a1ce8cb1 | refs/heads/master | 2016-09-06T04:23:40.161012 | 2014-12-15T19:41:42 | 2014-12-15T19:41:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,968 | java | /*
* Copyright (c) 2010 Ecole des Mines de Nantes.
*
* This file is part of Entropy.
*
* Entropy is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Entropy is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Entropy. If not, see <http://www.gnu.org/licenses/>.
*/
package entropy.vjob.builder.plasma;
import entropy.configuration.ManagedElement;
import entropy.configuration.ManagedElementSet;
/**
* An abstract set that is a composition of two sets.
*
* @author Fabien Hermenier
*/
public abstract class ComposedSet<T extends ManagedElement> implements VJobSet<T> {
private String label;
/**
* The first set.
*/
private VJobSet<T> left;
/**
* The second set.
*/
private VJobSet<T> right;
private static final String LPARA = "(";
private static final String RPARA = ")";
/**
* Make a new composition.
*
* @param h the first set
* @param t the second set
*/
public ComposedSet(VJobSet<T> h, VJobSet<T> t) {
this.left = h;
this.right = t;
}
/**
* Make a new labelled composition.
*
* @param id the label of the composite
* @param h the first set
* @param t the second set
*/
public ComposedSet(String id, VJobSet<T> h, VJobSet<T> t) {
this(h, t);
label = id;
}
/**
* Get the first set.
*
* @return the first set
*/
public VJobSet<T> leftOperand() {
return this.left;
}
/**
* Get the second set.
*
* @return the second set
*/
public VJobSet<T> rightOperand() {
return this.right;
}
/**
* Textual representation of the set.
*
* @return the description of the first set, then the operation, then the second set
*/
public String toString() {
/**
* We use parenthesis when the left or the right operand is a ComposedSet, with a different operator.
*/
boolean usePara = false;
StringBuilder b = new StringBuilder();
if (leftOperand() instanceof ComposedSet && !((ComposedSet) leftOperand()).operator().equals(operator())) {
usePara = true;
}
if (usePara) {
b.append(LPARA);
}
b.append(leftOperand().pretty());
if (usePara) {
b.append(RPARA);
}
b.append(operator());
usePara = false;
if (rightOperand() instanceof ComposedSet && !((ComposedSet) rightOperand()).operator().equals(operator())) {
usePara = true;
}
if (usePara) {
b.append(LPARA);
}
b.append(rightOperand().pretty());
if (usePara) {
b.append(RPARA);
}
return b.toString();
}
@Override
public String pretty() {
if (label != null) {
return label;
}
return definition();
}
@Override
public String definition() {
return toString();
}
/**
* The operation between the first and the second set.
*
* @return the textual representation of the operator
*/
public abstract String operator();
@Override
public void setLabel(String id) {
label = id;
}
@Override
public String getLabel() {
return label;
}
@Override
public ManagedElementSet getElements() {
return flatten();
}
}
| [
"jonathan.pastor@me.com"
] | jonathan.pastor@me.com |
989c516980210702ed18c455e4d6dfddeadafd68 | 70438a1aecb2bacbc97f5694cfd1e4c5b4d94f60 | /education/src/main/java/com/education/domain/Menu.java | f73bd97511f21f583896fdbf43d8bfdd97a94125 | [] | no_license | cuiyongwei/taifan | d0009ec19fa5e0c600520245fe3365dd48c50a27 | 2aecb6c7db6889e52a3a5d8692c92a2dcdcc930a | refs/heads/master | 2020-04-12T14:52:17.258813 | 2019-02-18T01:09:30 | 2019-02-18T01:09:30 | 162,564,088 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,550 | java | package com.education.domain;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 菜单表 后端 菜单和资源是多对多的关系、
* 菜单是1对应多个资源
*/
public class Menu implements Serializable {
private String id;
private String code;
private String name;
private String icon;
private String url;
private String parentid;//节点
private String type;
private int order;
private String status;
private String description;
private String createdby;
private Date createdon;//时间
private String updatedby;
private Date updatedon;
private String isleaf;
private String defaultmenus;
private List nodes = new ArrayList();
@ApiModelProperty(value="Resources资源集合",hidden=true)
private List<Resources> resources;//在一的一方引入多的一方的集合
public Menu() {
}
public List getNodes() {
return nodes;
}
public void setNodes(List nodes) {
this.nodes = nodes;
}
public String getParentid() {
return parentid;
}
public void setParentid(String parentid) {
this.parentid = parentid;
}
public List<Resources> getResources() {
return resources;
}
public void setResources(List<Resources> resources) {
this.resources = resources;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getOrder() {
return order;
}
public void setOrder(int order) {
this.order = order;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCreatedby() {
return createdby;
}
public void setCreatedby(String createdby) {
this.createdby = createdby;
}
public Date getCreatedon() {
return createdon;
}
public void setCreatedon(Date createdon) {
this.createdon = createdon;
}
public String getUpdatedby() {
return updatedby;
}
public void setUpdatedby(String updatedby) {
this.updatedby = updatedby;
}
public Date getUpdatedon() {
return updatedon;
}
public void setUpdatedon(Date updatedon) {
this.updatedon = updatedon;
}
public String getIsleaf() {
return isleaf;
}
public void setIsleaf(String isleaf) {
this.isleaf = isleaf;
}
public String getDefaultmenus() {
return defaultmenus;
}
public void setDefaultmenus(String defaultmenus) {
this.defaultmenus = defaultmenus;
}
@Override
public String toString() {
return "Menu{" +
"id='" + id + '\'' +
", code='" + code + '\'' +
", name='" + name + '\'' +
", icon='" + icon + '\'' +
", url='" + url + '\'' +
", parentid='" + parentid + '\'' +
", type='" + type + '\'' +
", order=" + order +
", status='" + status + '\'' +
", description='" + description + '\'' +
", createdby='" + createdby + '\'' +
", createdon=" + createdon +
", updatedby='" + updatedby + '\'' +
", updatedon=" + updatedon +
", isleaf='" + isleaf + '\'' +
", defaultmenus='" + defaultmenus + '\'' +
", nodes=" + nodes +
", resources=" + resources +
'}';
}
}
| [
"1337344642@qq.com"
] | 1337344642@qq.com |
2e13d96324b6b4c50c9fb8f8d84de4206fc008c2 | b572b4c007ee66efc2192daf3a7e679635250ae5 | /SourceCode/BackEnd/Meeting-Interactive-System/src/cn/whxlover/dao/searchDao.java | 10d8269bb390ede972ce2de424f6dfc05a442492 | [] | no_license | lovernan/meeting-Interactive-System | 82eb4f68fe5edf57bdd24679840c187bccfcb339 | 1c7d2c4683550f83b3d1b3911396b9b57ffa0332 | refs/heads/master | 2020-03-12T09:35:50.415053 | 2018-04-22T10:18:21 | 2018-04-22T10:18:21 | 130,556,070 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 255 | java | package cn.whxlover.dao;
import java.sql.SQLException;
import java.util.List;
import cn.whxlover.domain.user;
public interface searchDao {
List<user> search(String text) throws SQLException;
String searchid(String username) throws SQLException;
}
| [
"1796501485@qq.com"
] | 1796501485@qq.com |
52a00f05c7da13a80abceb2c80ecb363109b0c54 | 37a8d2be48f8fe6e61ab5308ae585b9c4015b778 | /src/main/java/com/puboot/service/impl/BizArticleLookServiceImpl.java | 40aa35c2430c3bc4fa6fca9a7a2a1d19e1c682b7 | [
"MIT"
] | permissive | jiujiuchen/OnlyYou | dee571431fa3034333c1eecebd08affd0f71ce81 | d9cb88fc241cd6fa99358941a609ca87b7c9818c | refs/heads/master | 2022-10-02T19:27:26.726870 | 2019-11-12T08:14:21 | 2019-11-12T08:14:21 | 221,163,965 | 0 | 0 | null | 2022-09-01T23:15:39 | 2019-11-12T08:09:58 | JavaScript | UTF-8 | Java | false | false | 887 | java | package com.puboot.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.puboot.mapper.BizArticleLookMapper;
import com.puboot.model.BizArticleLook;
import com.puboot.service.BizArticleLookService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* @author Linzhaoguan
* @version V1.0
* @date 2019年9月11日
*/
@Service
@AllArgsConstructor
public class BizArticleLookServiceImpl extends ServiceImpl<BizArticleLookMapper, BizArticleLook> implements BizArticleLookService {
private final BizArticleLookMapper articleLookMapper;
@Override
public int checkArticleLook(Integer articleId, String userIp, Date lookTime) {
return articleLookMapper.checkArticleLook(articleId, userIp, lookTime);
}
}
| [
"17186784453@163.com"
] | 17186784453@163.com |
086a55e446261d0c41eed178791dc6e999f20ad1 | f0bc85f536e443a5da58cc5fef793594fc274eb8 | /src/test/java/com/shop/book/repository/BookRepositoryTest.java | 4ccef4de9925f557db695109fe2fa639a63bf250 | [] | no_license | connectraj25/onlinestore | d67c40fc8b4637a8c7aa4c19dffe81882a4a91a4 | aee47cf924750bff66245a5d94d4e7e8c1f9f641 | refs/heads/master | 2023-06-14T07:12:41.113136 | 2021-07-09T14:00:33 | 2021-07-09T14:00:33 | 384,453,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,670 | java | package com.shop.book.repository;
import com.shop.book.entity.Book;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.jupiter.api.Assertions.*;
@RunWith(SpringRunner.class)
@DataJpaTest
class BookRepositoryTest {
@Autowired
private TestEntityManager entityManager;
@Autowired
private BookRepository bookRepository;
@Test
void should_find_books_by_isbn() {
Book book1 = new Book();
book1.setId(10L);
book1.setName("You are a perfect Man");
book1.setDescription("Sample Desc");
book1.setAuthor("Raju");
book1.setType("comic");
book1.setPrice(25.0);
book1.setIsbn("1234567433");
book1.setQuantity(2);
entityManager.persist(book1);
Book book2 = new Book();
book2.setId(11L);
book2.setName("You are a perfect Man");
book2.setDescription("Sample Desc");
book2.setAuthor("Raju");
book2.setType("comic");
book2.setPrice(25.0);
book2.setIsbn("1234567433");
book2.setQuantity(2);
entityManager.persist(book2);
Book foundBook = bookRepository.findByIsbn(book2.getIsbn()).get();
org.assertj.core.api.Assertions.assertThat(foundBook).isEqualTo(book2);
}
//
// @Test
// void findByAuthorOrName() {
// }
} | [
"connectraj25@gmail.com"
] | connectraj25@gmail.com |
d35ad6be307a57c0f1ad91d829f2dc1e1bdd2ad7 | 640e01baac8e12ba9091eeaf9a4b70556b0e39b6 | /tomacat/src/main/java/org/apache/naming/factory/webservices/ServiceRefFactory.java | 039e6240eeb1816c8993d1b0bc44d8b0bc9b6903 | [] | no_license | lenmoyouziJiangjun/JavaLearn | 25467eebb2b134e5314db63bd0066ffa96d737ed | f696a455efa5cf138411fa24d667db546be788f0 | refs/heads/master | 2021-06-04T15:41:16.163939 | 2021-04-11T12:05:58 | 2021-04-11T12:05:58 | 90,931,129 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 15,414 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.naming.factory.webservices;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.RefAddr;
import javax.naming.spi.ObjectFactory;
import javax.wsdl.Definition;
import javax.wsdl.Port;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.handler.Handler;
import javax.xml.rpc.handler.HandlerChain;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.HandlerRegistry;
import org.apache.naming.HandlerRef;
import org.apache.naming.ServiceRef;
/**
* Object factory for Web Services.
*
* @author Fabien Carrion
*/
public class ServiceRefFactory implements ObjectFactory {
/**
* Create a new serviceref instance.
*
* @param obj The reference object describing the webservice
*/
@Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable<?,?> environment) throws Exception {
if (obj instanceof ServiceRef) {
ServiceRef ref = (ServiceRef) obj;
// ClassLoader
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
if (tcl == null) {
tcl = this.getClass().getClassLoader();
}
ServiceFactory factory = ServiceFactory.newInstance();
javax.xml.rpc.Service service = null;
// Service Interface
RefAddr tmp = ref.get(ServiceRef.SERVICE_INTERFACE);
String serviceInterface = null;
if (tmp != null) {
serviceInterface = (String) tmp.getContent();
}
// WSDL
tmp = ref.get(ServiceRef.WSDL);
String wsdlRefAddr = null;
if (tmp != null) {
wsdlRefAddr = (String) tmp.getContent();
}
// PortComponent
Hashtable<String,QName> portComponentRef = new Hashtable<>();
// Create QName object
QName serviceQname = null;
tmp = ref.get(ServiceRef.SERVICE_LOCAL_PART);
if (tmp != null) {
String serviceLocalPart = (String) tmp.getContent();
tmp = ref.get(ServiceRef.SERVICE_NAMESPACE);
if (tmp == null) {
serviceQname = new QName(serviceLocalPart);
} else {
String serviceNamespace = (String) tmp.getContent();
serviceQname = new QName(serviceNamespace,
serviceLocalPart);
}
}
Class<?> serviceInterfaceClass = null;
// Create service object
if (serviceInterface == null) {
if (serviceQname == null) {
throw new NamingException
("Could not create service-ref instance");
}
try {
if (wsdlRefAddr == null) {
service = factory.createService( serviceQname );
} else {
service = factory.createService( new URL(wsdlRefAddr),
serviceQname );
}
} catch (Exception e) {
NamingException ex = new NamingException("Could not create service");
ex.initCause(e);
throw ex;
}
} else {
// Loading service Interface
try {
serviceInterfaceClass = tcl.loadClass(serviceInterface);
} catch(ClassNotFoundException e) {
NamingException ex = new NamingException("Could not load service Interface");
ex.initCause(e);
throw ex;
}
if (serviceInterfaceClass == null) {
throw new NamingException
("Could not load service Interface");
}
try {
if (wsdlRefAddr == null) {
if (!Service.class.isAssignableFrom(serviceInterfaceClass)) {
throw new NamingException("service Interface should extend javax.xml.rpc.Service");
}
service = factory.loadService( serviceInterfaceClass );
} else {
service = factory.loadService( new URL(wsdlRefAddr),
serviceInterfaceClass,
new Properties() );
}
} catch (Exception e) {
NamingException ex = new NamingException("Could not create service");
ex.initCause(e);
throw ex;
}
}
if (service == null) {
throw new NamingException
("Cannot create service object");
}
serviceQname = service.getServiceName();
serviceInterfaceClass = service.getClass();
if (wsdlRefAddr != null) {
try {
WSDLFactory wsdlfactory = WSDLFactory.newInstance();
WSDLReader reader = wsdlfactory.newWSDLReader();
reader.setFeature("javax.wsdl.importDocuments", true);
Definition def = reader.readWSDL((new URL(wsdlRefAddr)).toExternalForm());
javax.wsdl.Service wsdlservice = def.getService(serviceQname);
@SuppressWarnings("unchecked") // Can't change the API
Map<String,?> ports = wsdlservice.getPorts();
Method m = serviceInterfaceClass.getMethod("setEndpointAddress",
new Class[] { String.class, String.class });
for (String portName : ports.keySet()) {
Port port = wsdlservice.getPort(portName);
String endpoint = getSOAPLocation(port);
m.invoke(service, new Object[]{port.getName(), endpoint});
portComponentRef.put(endpoint, new QName(port.getName()));
}
} catch (Exception e) {
if (e instanceof InvocationTargetException) {
Throwable cause = e.getCause();
if (cause instanceof ThreadDeath) {
throw (ThreadDeath) cause;
}
if (cause instanceof VirtualMachineError) {
throw (VirtualMachineError) cause;
}
}
NamingException ex = new NamingException("Error while reading Wsdl File");
ex.initCause(e);
throw ex;
}
}
ServiceProxy proxy = new ServiceProxy(service);
// Use port-component-ref
for (int i = 0; i < ref.size(); i++) {
if (ServiceRef.SERVICEENDPOINTINTERFACE.equals(ref.get(i).getType())) {
String serviceendpoint = "";
String portlink = "";
serviceendpoint = (String) ref.get(i).getContent();
if (ServiceRef.PORTCOMPONENTLINK.equals(ref.get(i + 1).getType())) {
i++;
portlink = (String) ref.get(i).getContent();
}
portComponentRef.put(serviceendpoint, new QName(portlink));
}
}
proxy.setPortComponentRef(portComponentRef);
// Instantiate service with proxy class
Class<?>[] serviceInterfaces = serviceInterfaceClass.getInterfaces();
Class<?>[] interfaces = Arrays.copyOf(serviceInterfaces, serviceInterfaces.length + 1);
interfaces[interfaces.length - 1] = javax.xml.rpc.Service.class;
Object proxyInstance = null;
try {
proxyInstance = Proxy.newProxyInstance(tcl, interfaces, proxy);
} catch (IllegalArgumentException e) {
proxyInstance = Proxy.newProxyInstance(tcl, serviceInterfaces, proxy);
}
// Use handler
if (ref.getHandlersSize() > 0) {
HandlerRegistry handlerRegistry = service.getHandlerRegistry();
List<String> soaproles = new ArrayList<>();
while (ref.getHandlersSize() > 0) {
HandlerRef handlerRef = ref.getHandler();
HandlerInfo handlerInfo = new HandlerInfo();
// Loading handler Class
tmp = handlerRef.get(HandlerRef.HANDLER_CLASS);
if ((tmp == null) || (tmp.getContent() == null)) {
break;
}
Class<?> handlerClass = null;
try {
handlerClass = tcl.loadClass((String) tmp.getContent());
} catch(ClassNotFoundException e) {
break;
}
// Load all datas relative to the handler : SOAPHeaders, config init element,
// portNames to be set on
List<QName> headers = new ArrayList<>();
Hashtable<String,String> config = new Hashtable<>();
List<String> portNames = new ArrayList<>();
for (int i = 0; i < handlerRef.size(); i++) {
if (HandlerRef.HANDLER_LOCALPART.equals(handlerRef.get(i).getType())) {
String localpart = "";
String namespace = "";
localpart = (String) handlerRef.get(i).getContent();
if (HandlerRef.HANDLER_NAMESPACE.equals(handlerRef.get(i + 1).getType())) {
i++;
namespace = (String) handlerRef.get(i).getContent();
}
QName header = new QName(namespace, localpart);
headers.add(header);
} else if (HandlerRef.HANDLER_PARAMNAME.equals(handlerRef.get(i).getType())) {
String paramName = "";
String paramValue = "";
paramName = (String) handlerRef.get(i).getContent();
if (HandlerRef.HANDLER_PARAMVALUE.equals(handlerRef.get(i + 1).getType())) {
i++;
paramValue = (String) handlerRef.get(i).getContent();
}
config.put(paramName, paramValue);
} else if (HandlerRef.HANDLER_SOAPROLE.equals(handlerRef.get(i).getType())) {
String soaprole = "";
soaprole = (String) handlerRef.get(i).getContent();
soaproles.add(soaprole);
} else if (HandlerRef.HANDLER_PORTNAME.equals(handlerRef.get(i).getType())) {
String portName = "";
portName = (String) handlerRef.get(i).getContent();
portNames.add(portName);
}
}
// Set the handlers informations
handlerInfo.setHandlerClass(handlerClass);
handlerInfo.setHeaders(headers.toArray(new QName[headers.size()]));
handlerInfo.setHandlerConfig(config);
if (!portNames.isEmpty()) {
for (String portName : portNames) {
initHandlerChain(new QName(portName), handlerRegistry,
handlerInfo, soaproles);
}
} else {
Enumeration<QName> e = portComponentRef.elements();
while(e.hasMoreElements()) {
initHandlerChain(e.nextElement(), handlerRegistry, handlerInfo, soaproles);
}
}
}
}
return proxyInstance;
}
return null;
}
/**
* @param port analyzed port
* @return Returns the endpoint URL of the given Port
*/
private String getSOAPLocation(Port port) {
String endpoint = null;
@SuppressWarnings("unchecked") // Can't change the API
List<ExtensibilityElement> extensions = port.getExtensibilityElements();
for (ExtensibilityElement ext : extensions) {
if (ext instanceof SOAPAddress) {
SOAPAddress addr = (SOAPAddress) ext;
endpoint = addr.getLocationURI();
}
}
return endpoint;
}
private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry,
HandlerInfo handlerInfo, List<String> soaprolesToAdd) {
HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName);
@SuppressWarnings("unchecked") // Can't change the API
Iterator<Handler> iter = handlerChain.iterator();
while (iter.hasNext()) {
Handler handler = iter.next();
handler.init(handlerInfo);
}
String[] soaprolesRegistered = handlerChain.getRoles();
String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()];
int i;
for (i = 0;i < soaprolesRegistered.length; i++) {
soaproles[i] = soaprolesRegistered[i];
}
for (int j = 0; j < soaprolesToAdd.size(); j++) {
soaproles[i+j] = soaprolesToAdd.get(j);
}
handlerChain.setRoles(soaproles);
handlerRegistry.setHandlerChain(portName, handlerChain);
}
}
| [
"511424150@qq.com"
] | 511424150@qq.com |
56ec121c5c6ecf04c9eb0cde1a87ecf249f82605 | 5854fd7ed559cbc06fd2160b01c038f242626ecc | /collections/src/com/home/cloning/Test1.java | 0b90768f8099adf0041e2dd47e5fb2c5a0d7aa9a | [] | no_license | mohannautiyal/May2020 | 8d762a760c4296f8ef526ec5359aac49c5bf27fe | 9e5481135533c9b0eec75ed8bbe8b3ef3945d951 | refs/heads/master | 2022-12-27T16:09:16.458685 | 2020-05-31T15:15:40 | 2020-05-31T15:15:40 | 260,514,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 150 | java | package com.home.cloning;
public class Test1 {
int a;
int b;
public static void main(String[] args) throws CloneNotSupportedException {
}
}
| [
"mohannautiyal80@gmail.com"
] | mohannautiyal80@gmail.com |
c3fa30e751bbac20f1d8c43c91ff899ca6e65e3a | 5d62b6a311c7e2be7d9193185a34190466c32840 | /src/main/java/com/keysoft/mongodb/model/Release.java | 38a1f03538a39641cb90f5465cc260a1e1b93583 | [] | no_license | pravinyo/spring-mongo | 368f45905b6caf4adab411772d6c321000cd0a75 | d5a11e9b694fb905ad8154a9a46fc86ea71421df | refs/heads/main | 2023-04-10T11:51:02.700706 | 2021-04-23T17:03:21 | 2021-04-23T17:03:21 | 359,338,641 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,867 | java | package com.keysoft.mongodb.model;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import java.time.ZonedDateTime;
import java.util.List;
@Document
public class Release {
@Id
private String id;
private String name;
private String description;
@Field("release_tickets")
private List<Ticket> tickets;
private ZonedDateTime releaseDate;
@Transient //don't save in db
private Double estimatedCosts;
public Release() {
}
public Release(String name, String description, List<Ticket> tickets, ZonedDateTime releaseDate) {
this.name = name;
this.description = description;
this.tickets = tickets;
this.releaseDate = releaseDate;
}
public ZonedDateTime getReleaseDate() {
return releaseDate;
}
public void setReleaseDate(ZonedDateTime releaseDate) {
this.releaseDate = releaseDate;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Ticket> getTickets() {
return tickets;
}
public void setTickets(List<Ticket> tickets) {
this.tickets = tickets;
}
public Double getEstimatedCosts() {
return tickets.size() * 15.2; //dollars
}
public void setEstimatedCosts(Double estimatedCosts) {
this.estimatedCosts = estimatedCosts;
}
}
| [
"pravinyo12@gmail.com"
] | pravinyo12@gmail.com |
613ee0f961202a1c114224bfdd9e1a11807dd63a | ccdddb0d677b10619f0ba4b26ce6cfe2729e586a | /app/models/Submitter.java | 19a55ce60fc5f75e0b3c14d9d9bc7e93f6f8cce1 | [
"Apache-2.0"
] | permissive | nmldiegues/palm | f16fb126f79fe46619e14fac7078101f09f5f2d6 | 8f5c3f0ef7b293c32b97b8b9d87e241d4fdea834 | refs/heads/master | 2021-01-01T18:17:24.186720 | 2015-09-09T15:56:08 | 2015-09-09T15:56:08 | 1,984,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | package models;
import javax.persistence.Entity;
@Entity
public class Submitter extends Role {
@Override
public String toString() {
return "Submitter";
}
@Override
public boolean isAdmin() {
return false;
}
}
| [
"nmld@ist.utl.pt"
] | nmld@ist.utl.pt |
14e93725531181e6429018ebd0d21435d6595155 | 4dc2dd751f05aaa53d24133e06f10b4d99c97de8 | /app/src/main/java/com/kck4156/uisample/MainActivity.java | 314e80303d76f74ea55b88d1bcfb7f29369d4a28 | [] | no_license | airtaxi/JiHwaJa | 131968d3c0917f67aed3d5ae949ad7f70deab28a | 67750e1d5b7dd775d2f62ac6f7a585a06f2a426b | refs/heads/master | 2020-03-17T03:08:14.359363 | 2018-06-14T02:16:35 | 2018-06-14T02:16:35 | 133,221,614 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,009 | java | package com.kck4156.uisample;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
public static String TAG = "JiHwaJa";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FindMyo.mMyo = null;
}
public void onClick(View view) {
if(FindMyo.mMyo != null) {
Intent intent = new Intent(this, MyoPrint.class);
startActivity(intent);
finish();
} else {
Toast.makeText(this, "연결된 MYO가 없습니다. 상단의 버튼을 클릭하여 MYO에 연결해주세요", Toast.LENGTH_LONG).show();
}
}
public void onBTButtonClick(View view) {
Intent intent = new Intent(this, FindMyo.class);
startActivity(intent);
}
}
| [
"kck4156@gmail.com"
] | kck4156@gmail.com |
a188e4416d33a452cbd675f48a618dd6c848224c | aadb901d1c0597dd86d4e59e611dd47ae2f1d71c | /src/main/java/com/emailvalidationapi/controller/MessageController.java | 7718c62856b6ba7edb3a5512f1bf0ed09a9c75cb | [] | no_license | MaheshKonduri/email-validation | 57db8a73572ba61b8c4bac7314af6eac1c7a3f7b | 9d1ae6acc602c8319b8c1cd5232ca7600b9a4c5a | refs/heads/master | 2022-12-18T16:15:35.334540 | 2020-09-17T19:20:48 | 2020-09-17T19:20:48 | 296,421,011 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 611 | java | package com.emailvalidationapi.controller;
import com.emailvalidationapi.model.Message;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@RestController
public class MessageController {
@GetMapping("/message")
Message send(){
return new Message("Hello here is first message :");
}
@PostMapping("/message")
Message echo(@RequestBody Message message){
return message;//("Hey here post method call ");
}
}
//DB details
//SYSTEM
//Mahesh@1715
//Oracle Enterprise Manager Database Express URL: https://localhost:5500/em | [
"m.konduri@outlook.com"
] | m.konduri@outlook.com |
d488742df7651417b0fd170c1075866960f4cfbd | e1aca5024f6d52c5db2286531cd3c10ef19e4d1b | /QuizActivity.java | 6839399960a3daf5a9adb2d8d51d4bdbe73042a2 | [] | no_license | a493203176/GeoQuiz | 23affe2298cae523d385de05e5122804c8bf3457 | 8b88fa361f33089195de14773d4209819ca803e7 | refs/heads/master | 2021-04-06T08:59:07.500973 | 2018-03-11T09:13:46 | 2018-03-11T09:13:46 | 124,740,660 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,852 | java | package com.aiyu.ceoquiz;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class QuizActivity extends AppCompatActivity {
private Button mTrueButton;
private Button mFlaseButton;
private TextView mQuestionTestView;
private Button mNextButtion;
private Question[] mQuestionBand = new Question[] {
new Question(R.string.question_anstralia,true),
new Question(R.string.question_mideast,false),
new Question(R.string.question_americas,true),
new Question(R.string.question_asia,true),
};
private int mCurrentIndex = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz);
mQuestionTestView = (TextView) findViewById(R.id.question_text_view);
mTrueButton = (Button) findViewById(R.id.true_button);
mTrueButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Toast toast = Toast.makeText(QuizActivity.this, R.string.conrrent_toast, Toast.LENGTH_SHORT);
// toast.setGravity(Gravity.TOP, 0, 0);
// toast.show();
checkAnswer(true);
}
});
mFlaseButton = (Button) findViewById(R.id.false_button);
mFlaseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Toast toast = Toast.makeText(QuizActivity.this, R.string.inconrrect_toast, Toast.LENGTH_SHORT);
// toast.setGravity(Gravity.TOP, 0, 0);
// toast.show();
checkAnswer(false);
}
});
mNextButtion = (Button) findViewById(R.id.next_button);
mNextButtion.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mCurrentIndex = (mCurrentIndex + 1) % mQuestionBand.length;
updateQuestion();
}
});
updateQuestion();
}
private void updateQuestion() {
int question = mQuestionBand[mCurrentIndex].getTextResid();
mQuestionTestView.setText(question);
}
private void checkAnswer(boolean userPressceTrue) {
boolean answerIsTrue = mQuestionBand[mCurrentIndex].isAnswerTrue();
int messageResId = 0;
if (userPressceTrue == answerIsTrue) {
messageResId = R.string.conrrent_toast;
} else {
messageResId = R.string.inconrrect_toast;
}
Toast.makeText(this, messageResId, Toast.LENGTH_SHORT).show();
}
}
| [
"zhoutengfei.1234@qq.com"
] | zhoutengfei.1234@qq.com |
ce2034eb1ec2a406a5aca23ae4d34ee81299ffe2 | 826bdb859556bbd1f8bc5b9840155e89b5c48b06 | /diagram-ta/src/main/java/org/openflexo/technologyadapter/diagram/metamodel/DiagramPaletteObject.java | 894d4d9f3b57d5c3e4402a37cc20dd0758d1c7e6 | [] | no_license | openflexo-team/openflexo-diagram | ea74203a2c8a43f057886881b1bf6920207be2e9 | 6c258ad508020e655d571aa9889aa907f5d6cfd3 | refs/heads/2.0.0 | 2023-05-25T14:38:34.971027 | 2020-07-01T13:54:10 | 2020-07-01T13:54:10 | 184,215,808 | 0 | 0 | null | 2021-01-14T20:43:27 | 2019-04-30T07:43:45 | Java | UTF-8 | Java | false | false | 3,569 | java | /**
*
* Copyright (c) 2014, Openflexo
*
* This file is part of Flexodiagram, a component of the software infrastructure
* developed at Openflexo.
*
*
* Openflexo is dual-licensed under the European Union Public License (EUPL, either
* version 1.1 of the License, or any later version ), which is available at
* https://joinup.ec.europa.eu/software/page/eupl/licence-eupl
* and the GNU General Public License (GPL, either version 3 of the License, or any
* later version), which is available at http://www.gnu.org/licenses/gpl.html .
*
* You can redistribute it and/or modify under the terms of either of these licenses
*
* If you choose to redistribute it and/or modify under the terms of the GNU GPL, you
* must include the following additional permission.
*
* Additional permission under GNU GPL version 3 section 7
*
* If you modify this Program, or any covered work, by linking or
* combining it with software containing parts covered by the terms
* of EPL 1.0, the licensors of this Program grant you additional permission
* to convey the resulting work. *
*
* This software is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* See http://www.openflexo.org/license.html for details.
*
*
* Please contact Openflexo (openflexo-contacts@openflexo.org)
* or visit www.openflexo.org if you need additional information.
*
*/
package org.openflexo.technologyadapter.diagram.metamodel;
import java.util.logging.Logger;
import org.openflexo.foundation.technologyadapter.TechnologyObject;
import org.openflexo.pamela.annotations.Getter;
import org.openflexo.pamela.annotations.ImplementationClass;
import org.openflexo.pamela.annotations.ModelEntity;
import org.openflexo.pamela.annotations.Setter;
import org.openflexo.pamela.annotations.XMLAttribute;
import org.openflexo.technologyadapter.diagram.DiagramTechnologyAdapter;
@ModelEntity(isAbstract = true)
@ImplementationClass(DiagramPaletteObject.DiagramPaletteObjectImpl.class)
public interface DiagramPaletteObject extends TechnologyObject<DiagramTechnologyAdapter> {
public static final String NAME = "name";
public abstract DiagramPalette getPalette();
public abstract DiagramSpecification getDiagramSpecification();
public DiagramPaletteFactory getFactory();
/**
* Return name of this diagram element
*
* @return
*/
@Getter(value = NAME)
@XMLAttribute
public String getName();
/**
* Sets name of this diagram element
*
* @param aName
*/
@Setter(value = NAME)
public void setName(String aName);
public static abstract class DiagramPaletteObjectImpl extends FlexoObjectImpl implements DiagramPaletteObject {
private static final Logger logger = Logger.getLogger(DiagramPaletteObjectImpl.class.getPackage().getName());
@Override
public abstract DiagramPalette getPalette();
@Override
public abstract DiagramSpecification getDiagramSpecification();
@Override
public final DiagramPaletteFactory getFactory() {
return getPalette().getResource().getFactory();
}
@Override
public DiagramTechnologyAdapter getTechnologyAdapter() {
if (getPalette() != null) {
if (getPalette().getResource() != null) {
return getPalette().getResource().getTechnologyAdapter();
}
}
else {
logger.warning("INVESTIGATE : cannot get TA for a PaletteObject with null Palette! : " + this.getName());
}
return null;
}
}
}
| [
"sylvain@openflexo.org"
] | sylvain@openflexo.org |
57fb1996c99696c39a4cc1ce63ca859874c62e50 | 10c9924570dc00ad111b538533e69b3d18c89cfc | /pontus-redaction-common/src/main/java/kmy/regex/tools/Subst.java | 52ded52d9cd3372181b4a9843414e91c9275310d | [
"Apache-2.0"
] | permissive | uk-gov-mirror/UKHomeOffice.redaction | 1f7f8860166dac82459d0fc4091e2646f1f9b6d8 | dfe0c1477aec81a06425ca32805f7518684000ae | refs/heads/master | 2021-10-25T05:19:23.436361 | 2019-04-01T21:20:16 | 2019-04-01T21:20:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,087 | java | /*
Copyright (c) Peter Sorotokin, 1998-2000
See file "License.html" for terms of usage and
redistribution.
*/
package kmy.regex.tools;
import java.io.Reader;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Vector;
import java.util.Enumeration;
import kmy.regex.util.Replacer;
public class Subst
{
private static void processInput( BufferedReader in, Replacer rep )
throws IOException
{
String line;
while( (line = in.readLine()) != null )
System.out.println( rep.process( line ) );
}
public static void main( String[] args )
{
int last = 0;
int flags = 0;
while( last < args.length && args[last].startsWith( "-" ) )
{
String option = args[last++];
if( option.equals( "--" ) )
break;
if( option.equals( "-g" ) || option.equals( "--global" ) )
flags |= Replacer.GLOBAL_FLAG;
else
last = args.length; // to force help info
}
if( args.length == last )
{
System.err.println( "Usage: java kmy.regex.util.Subst regex rep [ file ... ]" );
System.err.println( "\tuse perl syntax for regular expressions" );
System.err.println();
System.err.println( "Options:" );
System.err.println( "\t-g --global - replace all occurrences, not only first in line" );
return;
}
Replacer rep;
try
{
String re = args[last++];
String sub = args[last++];
rep = new Replacer( re, sub, flags );
}
catch( Exception e )
{
e.printStackTrace();
return;
}
boolean processStdin = last == args.length;
do
{
try
{
Reader input;
if( processStdin || args[last].equals( "-" ) )
input = new InputStreamReader( System.in );
else
{
input = new FileReader( args[last] );
}
BufferedReader lineReader = new BufferedReader( input );
processInput( lineReader, rep );
}
catch( IOException e )
{
System.err.println( "File reading error: " + e.getMessage() );
}
last++;
}
while( last < args.length );
}
}
| [
"lmartins@pontusnetworks.com"
] | lmartins@pontusnetworks.com |
f6ec6061c0574c3ea07e1a47518dddce1c9cfbde | 66c0c6c87ba2763c13c7ecd624d00581e254f6c7 | /BookStoreBackend/BookStoreBackend/src/tk/bryanyap/bookstore/Recommendations.java | 62b1e00594d36f5ff5d9e723ea689f8047a1214c | [] | no_license | bryanyap/BookStoreBackend | b849d5426d98edc8722a34e421115da0f9eb8f1d | 14b9941907b18178ae9541fb09c870a1926de586 | refs/heads/master | 2021-01-20T11:58:02.048255 | 2014-12-17T14:43:45 | 2014-12-17T14:43:45 | 26,654,510 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,993 | java | package tk.bryanyap.bookstore;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.jdt.core.compiler.InvalidInputException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
@Path("/recommendations")
public class Recommendations {
@POST
@Produces(MediaType.APPLICATION_XML)
@Consumes
public String getCustomer(String input) {
try {
return Database.queryToXML(generateQuery(input));
} catch (ParserConfigurationException e) {
return Database.error(e);
} catch (SAXException e) {
return Database.error(e);
} catch (IOException e) {
return Database.error(e);
} catch (InvalidInputException e) {
return Database.error(e);
}
}
private String generateQuery(String xmlString)
throws ParserConfigurationException, SAXException, IOException,
InvalidInputException {
String isbn = "";
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder;
dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(new ByteArrayInputStream(xmlString
.getBytes()));
NodeList nList = doc.getElementsByTagName("recommendation");
for (int temp = 0; temp < 1; temp++) {
Node nNode = nList.item(temp);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;
isbn = eElement.getElementsByTagName("isbn").item(0)
.getTextContent();
}
}
// String query = "SELECT " + "o1.isbn13 AS chosen_book, "
// + "b1.title AS chosen_book_title, "
// + "o2.isbn13 AS also_bought, "
// + "b2.title AS also_bought_title, "
// + "COUNT(o2.isbn13) AS pair_sales_count " + "FROM books b1 "
// + "LEFT JOIN orders o1 ON o1.ISBN13=b1.ISBN13 "
// + "LEFT JOIN orders o2 ON "
// + "(o1.login_name=o2.login_name AND o1.isbn13 <> o2.isbn13) "
// + "LEFT JOIN books b2 ON o2.ISBN13=b2.ISBN13 "
// + "WHERE o1.isbn13='" + isbn + "' " + "GROUP BY o2.isbn13 "
// + "ORDER BY COUNT(o2.isbn13) " + "DESC;";
String query2 = "SELECT o2.isbn13 AS also_bought, "
+ "b2.title AS also_bought_title, "
+ "b2.authors AS also_bought_authors, "
+ "COUNT(o2.isbn13) AS pair_sales_count "
+ "FROM books b1 LEFT JOIN orders o1 ON o1.ISBN13 = b1.ISBN13 "
+ "LEFT JOIN orders o2 ON "
+ "(o1.login_name = o2.login_name AND o1.isbn13 <> o2.isbn13) "
+ "LEFT JOIN books b2 ON o2.ISBN13 = b2.ISBN13 "
+ "WHERE o1.isbn13 = '" + isbn + "' " + "GROUP BY o2.isbn13 "
+ "ORDER BY COUNT(o2.isbn13) " + "DESC;";
return query2;
}
}
| [
"bryanyap2002@hotmail.com"
] | bryanyap2002@hotmail.com |
700eab1f4bc44539f773bfa06035a90ca8c2497e | efd66db36bd087634242bf79517eab9691acc513 | /hjmall-mbg/src/main/java/com/hand/hjmall/mapper/CmsMemberReportMapper.java | 6671150206c6c7f19bdcbc57ed928e3c18bc46d8 | [] | no_license | sing0113/HDProject | 361a9d007c6d1e2c753280745325eb1d75cb502a | 179cb14fa75453e3e9d23b54473411a9e041a02f | refs/heads/master | 2020-04-25T04:19:53.764921 | 2019-03-06T02:10:49 | 2019-03-06T02:10:49 | 172,507,064 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package com.hand.hjmall.mapper;
import com.hand.hjmall.model.CmsMemberReport;
import com.hand.hjmall.model.CmsMemberReportExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsMemberReportMapper {
int countByExample(CmsMemberReportExample example);
int deleteByExample(CmsMemberReportExample example);
int insert(CmsMemberReport record);
int insertSelective(CmsMemberReport record);
List<CmsMemberReport> selectByExample(CmsMemberReportExample example);
int updateByExampleSelective(@Param("record") CmsMemberReport record, @Param("example") CmsMemberReportExample example);
int updateByExample(@Param("record") CmsMemberReport record, @Param("example") CmsMemberReportExample example);
} | [
"1450649035@qq.com"
] | 1450649035@qq.com |
eb6279ac0f012c244de062aeca5117620fcd19f5 | bb12ced419e62aa735042674cfac3025cc8b6946 | /src/main/supermarket/StockItem.java | 5bc2c3bd1348e0a8a566a44575bec9fc708709fc | [] | no_license | PimGroeneveld/Supermarket | 96d63e5e175cb2507ec5ab52c6de34d1254b1f6e | bafaf2f05a01825084aaf6b90cfe3b7bd0db97ba | refs/heads/master | 2020-04-18T12:27:56.379693 | 2019-01-25T11:04:06 | 2019-01-25T11:04:06 | 167,534,294 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 563 | java | package main.supermarket;
public class StockItem {
private String itemName;
private double itemPrice;
public StockItem(String itemName, double itemPrice) {
this.itemName = itemName;
this.itemPrice = itemPrice;
}
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public double getItemPrice() {
return itemPrice;
}
public void setItemPrice(double itemPrice) {
this.itemPrice = itemPrice;
}
}
| [
"pimgroeneveld92@gmail.com"
] | pimgroeneveld92@gmail.com |
471453464601c60af6d76e0d7ef182dba912e3af | 6d5ba12284262ca118ebc852b3d06eb8c3438bd5 | /AndroidStudioProjects/Inzynierka/app/src/main/java/lyjak/anna/inzynierka/viewmodel/report/GeneratePdf.java | 07d7f944dd6d5f706587622a7c08f1b34c719805 | [] | no_license | annalyjak/Inzynierka | b9fd69f7b1e55363b1eaabfe75dd799949c2ed89 | 0feceefd5d0821e4b6f788c6564e30e364669d23 | refs/heads/master | 2021-10-16T10:48:34.343827 | 2019-02-10T18:05:09 | 2019-02-10T18:05:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,203 | java | package lyjak.anna.inzynierka.viewmodel.report;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Environment;
import android.util.Log;
import com.itextpdf.text.Chunk;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.pdf.PdfWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import lyjak.anna.inzynierka.model.reports.Car;
import lyjak.anna.inzynierka.model.reports.TypeOfTransport;
import lyjak.anna.inzynierka.model.realmObjects.Route;
import lyjak.anna.inzynierka.model.modelDTO.ActualRouteForReportDTO;
import lyjak.anna.inzynierka.model.modelDTO.PlannedRouteForReportDTO;
/**
*
* Created by Anna on 28.10.2017.
*/
public class GeneratePdf {
private static final String TAG = GeneratePdf.class.getSimpleName();
private AdditionalFields additionalFields;
private Combustion combustion;
private TimeTripInfo timeTripInfo;
private Bitmap bitmap;
private int x = 70;
private int y = 70;
private Document document;
private File directory;
private File file;
private PdfWriter writer;
private Context context;
GeneratePdf(Context context) {
this.context = context;
}
public GeneratePdf(Context context, AdditionalFields mAdditionalFields) {
this.context = context;
this.additionalFields = mAdditionalFields;
}
void init(String fileName) throws IOException, DocumentException {
directory = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_DOCUMENTS);
// pageNumber = 1;
file = new File(directory, fileName);
if(!file.exists())
{
file.createNewFile();
} else {
file.delete();
file.createNewFile();
}
document = new Document(PageSize.A4);
writer = PdfWriter.getInstance(document, new FileOutputStream(file));
document.open();
}
private File save() {
document.close();
Log.i(TAG, "Plik " + file + " zapisany poprawnie");
return file;
}
private Chunk getEmptyParagraph() {
return Chunk.NEWLINE;
}
void setBitmap(Bitmap bitmap) {
this.bitmap = bitmap;
}
public void setCombustion(Combustion combustion) {
this.combustion = combustion;
}
public void setTimeTripInfo(TimeTripInfo timeTripInfo) {
this.timeTripInfo = timeTripInfo;
}
File generateBuissnesTripReport(TypeOfTransport type,
PlannedRouteForReportDTO route,
ActualRouteForReportDTO actualRoute,
String fileName) {
try {
BuissnesTripPdfTable buissnesTripReport = new BuissnesTripPdfTable(context);
PlannedRoutePdfTable plannedReport = new PlannedRoutePdfTable(context);
AcctualRoutePdfTable acctualReport = new AcctualRoutePdfTable(context, bitmap);
init(fileName);
document.add(buissnesTripReport.getBasicTitleHeader());
document.add(buissnesTripReport.createTypeOfTransport(type.getShortName()));
if (combustion != null) {
document.add(buissnesTripReport.createCombustionInfo(combustion));
}
if (additionalFields.isPersonalDataAboutEmployee()) {
document.add(buissnesTripReport.createPersonalDataTable());
} else {
Log.i("", "additionalFields.isPersonalDataAboutEmployee() - is false");
}
if (additionalFields.isPurposeOfTravel()) {
document.add(buissnesTripReport.createPurposeOfTravelTable());
}
if (additionalFields.isFeeding()) {
document.add(buissnesTripReport.createFeedingTable());
}
if (additionalFields.isAccomodation()) {
document.add(buissnesTripReport.createAccommodation());
}
if (additionalFields.isPublicTransport()) {
document.add(buissnesTripReport.createTravelCost());
}
if (additionalFields.isHospital()) {
document.add(buissnesTripReport.createHospitlization());
}
if(additionalFields.isOther()) {
document.add(buissnesTripReport.createAnother());
} else {
Log.i("", "additionalFields.isOther() - is false");
}
document.add(buissnesTripReport.createEndingSummary());
document.add(getEmptyParagraph());
document.add(buissnesTripReport.createFinalSignaturesSpace());
document.add(buissnesTripReport.createFinalSignaturesExplanation());
document.newPage(); //TRASA ZAPLANOWANA
document.add(plannedReport.createTripReportTitle());
document.add(getEmptyParagraph());
document.add(plannedReport.createPlannedInfoHeader());
document.add(getEmptyParagraph());
document.add(plannedReport.createPlannedInfo(route, type));
document.add(getEmptyParagraph());
document.add(plannedReport.createPlannedTable(new PlannedRouteReportInfo(route)));
document.newPage(); //TRASA ZREALIZOWANA
document.add(acctualReport.createAcctuallInfoHeader());
document.add(getEmptyParagraph());
document.add(acctualReport.createAcctuallInfo(actualRoute));
return save();
} catch (IOException | DocumentException e) {
e.printStackTrace();
}
return null;
}
File generatePlannedRouteReport(PlannedRouteForReportDTO route, String fileName) {
try {
PlannedRoutePdfTable plannedReport = new PlannedRoutePdfTable(context);
init(fileName);
document.add(plannedReport.createTripReportTitle());
document.add(getEmptyParagraph());
document.add(plannedReport.createPlannedInfoHeader());
document.add(getEmptyParagraph());
document.add(plannedReport.createPlannedInfo(route, new Car()));
document.add(getEmptyParagraph());
document.add(plannedReport.createPlannedTable(new PlannedRouteReportInfo(route)));
if(bitmap != null) {
document.newPage();
document.add(plannedReport.createBitmap(bitmap));
}
return save();
} catch (IOException | DocumentException e) {
e.printStackTrace();
}
return null;
}
File generateAcctualRouteReport(ActualRouteForReportDTO route, String fileName) {
try {
AcctualRoutePdfTable acctualReport = new AcctualRoutePdfTable(context, bitmap);
init(fileName);
document.add(acctualReport.createAcctuallInfoHeader());
document.add(acctualReport.createAcctuallInfo(route));
return save();
} catch (IOException | DocumentException e) {
e.printStackTrace();
}
return null;
}
}
| [
"annaluizalyjak@gmail.com"
] | annaluizalyjak@gmail.com |
da83848fd6dc1d4736528c923c82bfe2cc0452c2 | 1194b6e971d15c73e351264d702e135e25ebadb0 | /app/src/main/java/me/timos/thuanle/utils/MainActivity.java | 63a4c4dfd4309d9c3f7b8080f03524aa05622a68 | [] | no_license | ldt116/AndroidUtilsVietnamese | 9dcb08f7cbee78fc25b06b91af1ce48ce620daf7 | 47d58dd73617a7b88502bafefbe60efa0096aea6 | refs/heads/master | 2020-05-29T22:34:15.823183 | 2017-02-21T02:16:47 | 2017-02-21T02:16:47 | 82,612,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 633 | java | package me.timos.thuanle.utils;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import me.timos.thuanle.utils.vietnamese.StringUtils;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv = (TextView) findViewById(R.id.tv);
tv.setText(StringUtils.removeAccent("Cộng Hòa Xã Hội Chủ Nghĩa Việt Nam\n" +
"Độc Lập - Tự Do - Hạnh Phúc"));
}
}
| [
"thuanle@hcmut.edu.vn"
] | thuanle@hcmut.edu.vn |
97bf1654c5de1a1c8a26dd4fdcc6aff50868cf5c | 3c747973c31075ee1a7c7a9f53a074d81075159f | /app/src/main/java/com/covid19/andhrapradesh/login_global.java | eda82016b5c42faa55fa99949b426145862a9cc7 | [] | no_license | covidtracker192/Andhra-Pradesh | 1acd996c9f482a1484804c6c5cc9d7762c4aeb0e | 54f2b79106a728bb196d517511cce6b31da8c91d | refs/heads/master | 2022-11-12T13:33:29.715751 | 2020-06-24T20:04:32 | 2020-06-24T20:04:32 | 274,402,332 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,314 | java | package com.covid19.andhrapradesh;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
public class login_global extends AppCompatActivity {
ImageView worker, user;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_global);
worker = findViewById(R.id.imageView33);
user = findViewById(R.id.imageView34);
user.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(isOnline()){
Intent intent = new Intent(login_global.this, user_verification.class);
startActivity(intent);
finish();
}
else{
Toast.makeText(login_global.this, "Check your Internet Connection!", Toast.LENGTH_SHORT).show();
}
}
});
worker.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(isOnline()){
Intent intent = new Intent(login_global.this, login_worker.class);
startActivity(intent);
finish();
}
else{
Toast.makeText(login_global.this, "Check your Internet Connection!", Toast.LENGTH_SHORT).show();
}
}
});
}
protected boolean isOnline() {
ConnectivityManager cm = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netInfo.isConnectedOrConnecting()) {
return true;
} else {
return false;
}
}
public void onBackPressed()
{
finish();
}
}
| [
"belwadi.anirudh18@siesgst.ac.in"
] | belwadi.anirudh18@siesgst.ac.in |
cfe4fc242ce8535cc4bfd75ad14f60fa912d1240 | 365267d7941f76c97fac8af31a788d8c0fb2d384 | /src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java | e27bc5d0a8953d8ac738c20b1c197bcd3326cebc | [
"MIT"
] | permissive | potomy/client | 26d8c31657485f216639efd13b2fdda67570d9b5 | c01d23eb05ed83abb4fee00f9bf603b6bc3e2e27 | refs/heads/master | 2021-06-21T16:02:26.920860 | 2017-08-02T02:03:49 | 2017-08-02T02:03:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,852 | java | package net.minecraft.network.play.server;
import net.minecraft.entity.DataWatcher;
import net.minecraft.network.INetHandler;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.INetHandlerPlayClient;
import java.io.IOException;
import java.util.List;
public class S1CPacketEntityMetadata extends Packet
{
private int field_149379_a;
private List field_149378_b;
public S1CPacketEntityMetadata() {}
public S1CPacketEntityMetadata(int p_i45217_1_, DataWatcher p_i45217_2_, boolean p_i45217_3_)
{
this.field_149379_a = p_i45217_1_;
if (p_i45217_3_)
{
this.field_149378_b = p_i45217_2_.getAllWatched();
}
else
{
this.field_149378_b = p_i45217_2_.getChanged();
}
}
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer p_148837_1_) throws IOException
{
this.field_149379_a = p_148837_1_.readInt();
this.field_149378_b = DataWatcher.readWatchedListFromPacketBuffer(p_148837_1_);
}
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer p_148840_1_) throws IOException
{
p_148840_1_.writeInt(this.field_149379_a);
DataWatcher.writeWatchedListToPacketBuffer(this.field_149378_b, p_148840_1_);
}
public void processPacket(INetHandlerPlayClient p_148833_1_)
{
p_148833_1_.handleEntityMetadata(this);
}
public List func_149376_c()
{
return this.field_149378_b;
}
public int func_149375_d()
{
return this.field_149379_a;
}
public void processPacket(INetHandler p_148833_1_)
{
this.processPacket((INetHandlerPlayClient)p_148833_1_);
}
}
| [
"dav.nico@orange.fr"
] | dav.nico@orange.fr |
e5293a8948ec931e1a390e2d8d7a018657d63ecf | 110979672646001f575e54a0d656ed67876efa81 | /androidx/appcompat/widget/DrawableUtils.java | 692a3402f37c8c03231f5222f7ea49c6700e4656 | [] | no_license | zgc135/how-to-ask-for-leave | fe425cf4f43e8d8dd9d7a378b680d5a7a1e7fa91 | c934c0fcd427f4bba587c713463d6ce185d5797d | refs/heads/main | 2023-01-04T01:11:40.001907 | 2020-10-24T13:39:30 | 2020-10-24T13:39:30 | 307,993,489 | 9 | 3 | null | 2020-10-28T11:23:02 | 2020-10-28T11:23:01 | null | UTF-8 | Java | false | false | 6,775 | java | package androidx.appcompat.widget;
import android.graphics.Insets;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableContainer;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.ScaleDrawable;
import android.os.Build;
import android.util.Log;
import androidx.appcompat.graphics.drawable.DrawableWrapper;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.graphics.drawable.WrappedDrawable;
import java.lang.reflect.Field;
public class DrawableUtils {
private static final int[] CHECKED_STATE_SET = {16842912};
private static final int[] EMPTY_STATE_SET = new int[0];
public static final Rect INSETS_NONE = new Rect();
private static final String TAG = "DrawableUtils";
private static final String VECTOR_DRAWABLE_CLAZZ_NAME = "android.graphics.drawable.VectorDrawable";
private static Class<?> sInsetsClazz;
static {
if (Build.VERSION.SDK_INT >= 18) {
try {
sInsetsClazz = Class.forName("android.graphics.Insets");
} catch (ClassNotFoundException unused) {
}
}
}
private DrawableUtils() {
}
public static Rect getOpticalBounds(Drawable drawable) {
if (Build.VERSION.SDK_INT >= 29) {
Insets opticalInsets = drawable.getOpticalInsets();
Rect rect = new Rect();
rect.left = opticalInsets.left;
rect.right = opticalInsets.right;
rect.top = opticalInsets.top;
rect.bottom = opticalInsets.bottom;
return rect;
}
if (sInsetsClazz != null) {
try {
Drawable unwrap = DrawableCompat.unwrap(drawable);
Object invoke = unwrap.getClass().getMethod("getOpticalInsets", new Class[0]).invoke(unwrap, new Object[0]);
if (invoke != null) {
Rect rect2 = new Rect();
for (Field field : sInsetsClazz.getFields()) {
String name2 = field.getName();
char c = 65535;
switch (name2.hashCode()) {
case -1383228885:
if (name2.equals("bottom")) {
c = 3;
break;
}
break;
case 115029:
if (name2.equals("top")) {
c = 1;
break;
}
break;
case 3317767:
if (name2.equals("left")) {
c = 0;
break;
}
break;
case 108511772:
if (name2.equals("right")) {
c = 2;
break;
}
break;
}
if (c == 0) {
rect2.left = field.getInt(invoke);
} else if (c == 1) {
rect2.top = field.getInt(invoke);
} else if (c == 2) {
rect2.right = field.getInt(invoke);
} else if (c == 3) {
rect2.bottom = field.getInt(invoke);
}
}
return rect2;
}
} catch (Exception unused) {
Log.e(TAG, "Couldn't obtain the optical insets. Ignoring.");
}
}
return INSETS_NONE;
}
static void fixDrawable(Drawable drawable) {
if (Build.VERSION.SDK_INT == 21 && VECTOR_DRAWABLE_CLAZZ_NAME.equals(drawable.getClass().getName())) {
fixVectorDrawableTinting(drawable);
}
}
public static boolean canSafelyMutateDrawable(Drawable drawable) {
if (Build.VERSION.SDK_INT < 15 && (drawable instanceof InsetDrawable)) {
return false;
}
if (Build.VERSION.SDK_INT < 15 && (drawable instanceof GradientDrawable)) {
return false;
}
if (Build.VERSION.SDK_INT < 17 && (drawable instanceof LayerDrawable)) {
return false;
}
if (drawable instanceof DrawableContainer) {
Drawable.ConstantState constantState = drawable.getConstantState();
if (!(constantState instanceof DrawableContainer.DrawableContainerState)) {
return true;
}
for (Drawable canSafelyMutateDrawable : ((DrawableContainer.DrawableContainerState) constantState).getChildren()) {
if (!canSafelyMutateDrawable(canSafelyMutateDrawable)) {
return false;
}
}
return true;
} else if (drawable instanceof WrappedDrawable) {
return canSafelyMutateDrawable(((WrappedDrawable) drawable).getWrappedDrawable());
} else {
if (drawable instanceof DrawableWrapper) {
return canSafelyMutateDrawable(((DrawableWrapper) drawable).getWrappedDrawable());
}
if (drawable instanceof ScaleDrawable) {
return canSafelyMutateDrawable(((ScaleDrawable) drawable).getDrawable());
}
return true;
}
}
private static void fixVectorDrawableTinting(Drawable drawable) {
int[] state = drawable.getState();
if (state == null || state.length == 0) {
drawable.setState(CHECKED_STATE_SET);
} else {
drawable.setState(EMPTY_STATE_SET);
}
drawable.setState(state);
}
public static PorterDuff.Mode parseTintMode(int i, PorterDuff.Mode mode) {
if (i == 3) {
return PorterDuff.Mode.SRC_OVER;
}
if (i == 5) {
return PorterDuff.Mode.SRC_IN;
}
if (i == 9) {
return PorterDuff.Mode.SRC_ATOP;
}
switch (i) {
case 14:
return PorterDuff.Mode.MULTIPLY;
case 15:
return PorterDuff.Mode.SCREEN;
case 16:
return PorterDuff.Mode.ADD;
default:
return mode;
}
}
}
| [
"Veneno520"
] | Veneno520 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.