blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
72f20d97bcd0685774016466841cbe2ea42ab17f
5a3cd347d006d82e1c32a43758eb0c8233283bbc
/S2S3H3/main/com/net355/models/Log.java
43c4e4d2c4a815dab9cc2995e88fbca1d4936cf1
[]
no_license
naxiaoli/Net355Base
2f762cb325649f2a33b1c5e0d73d87aa4e6879ad
b0e40ddb8112557aa0e5ceaeaae8946a33e2c06e
refs/heads/master
2020-12-24T12:04:20.736763
2011-12-22T11:39:00
2011-12-22T11:39:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,900
java
package com.net355.models; // Generated Dec 21, 2011 3:28:17 PM by Hibernate Tools 3.4.0.CR1 import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * Log generated by hbm2java */ @Entity @Table(name = "log", catalog = "net355") public class Log implements java.io.Serializable { private String logId; private String logType; private String logOpType; private String logClass; private String logOpId; private String logTarget; private String logDesc; private Date addTime; private String state; public Log() { } public Log(String logId) { this.logId = logId; } public Log(String logId, String logType, String logOpType, String logClass, String logOpId, String logTarget, String logDesc, Date addTime, String state) { this.logId = logId; this.logType = logType; this.logOpType = logOpType; this.logClass = logClass; this.logOpId = logOpId; this.logTarget = logTarget; this.logDesc = logDesc; this.addTime = addTime; this.state = state; } @Id @Column(name = "log_id", unique = true, nullable = false, length = 32) public String getLogId() { return this.logId; } public void setLogId(String logId) { this.logId = logId; } @Column(name = "log_type", length = 2) public String getLogType() { return this.logType; } public void setLogType(String logType) { this.logType = logType; } @Column(name = "log_op_type", length = 2) public String getLogOpType() { return this.logOpType; } public void setLogOpType(String logOpType) { this.logOpType = logOpType; } @Column(name = "log_class", length = 2) public String getLogClass() { return this.logClass; } public void setLogClass(String logClass) { this.logClass = logClass; } @Column(name = "log_op_id", length = 32) public String getLogOpId() { return this.logOpId; } public void setLogOpId(String logOpId) { this.logOpId = logOpId; } @Column(name = "log_target", length = 32) public String getLogTarget() { return this.logTarget; } public void setLogTarget(String logTarget) { this.logTarget = logTarget; } @Column(name = "log_desc", length = 400) public String getLogDesc() { return this.logDesc; } public void setLogDesc(String logDesc) { this.logDesc = logDesc; } @Temporal(TemporalType.TIMESTAMP) @Column(name = "add_time", length = 19) public Date getAddTime() { return this.addTime; } public void setAddTime(Date addTime) { this.addTime = addTime; } @Column(name = "state", length = 2) public String getState() { return this.state; } public void setState(String state) { this.state = state; } }
96d42c6dee6a8ad357b83c5816c77e9c8dd4aeb6
867edbfdaa5bb7fb550a89acbbef37913111a901
/src/main/java/com/jin10/spidermanage/entity/Link.java
0d44707aaf0eefb42d029b22d511f4160dc33466
[]
no_license
Raofy/spider-manage
f224bb0be3f7a50282fc5a12a7de84902dfb987c
e0923a834853239edf0a9220e5fe10ee51655491
refs/heads/master
2023-03-09T10:49:29.459129
2021-03-01T01:28:44
2021-03-01T01:28:44
304,601,762
0
1
null
null
null
null
UTF-8
Java
false
false
861
java
package com.jin10.spidermanage.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonProperty; import com.jin10.spidermanage.bean.label.InsertBody; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; import static com.baomidou.mybatisplus.annotation.IdType.AUTO; @Data @EqualsAndHashCode() @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) public class Link implements Serializable { @TableId(type = AUTO) private Integer id; /** * 链接 */ private String link; /** * 标签ID */ private Integer labelId; public Link(int add, String link) { this.labelId = add; this.link = link; } }
ebac7b1276ce8b11d85ab3d6a4d2dffb622f2c0a
fff8d45864fdca7f43e6d65acbe4c1f469531877
/erp_desktop_all/src_cartera/com/bydan/erp/cartera/presentation/swing/jinternalframes/auxiliar/report/CobrarSaldosVencidosModel.java
8aa4de0d1daec9984774ebed066c2f1a06870015
[ "Apache-2.0" ]
permissive
jarocho105/pre2
26b04cc91ff1dd645a6ac83966a74768f040f418
f032fc63741b6deecdfee490e23dfa9ef1f42b4f
refs/heads/master
2020-09-27T16:16:52.921372
2016-09-01T04:34:56
2016-09-01T04:34:56
67,095,806
1
0
null
null
null
null
UTF-8
Java
false
false
30,811
java
/* *AVISO LEGAL © Copyright *Este programa esta protegido por la ley de derechos de autor. *La reproduccion o distribucion ilicita de este programa o de cualquiera de *sus partes esta penado por la ley con severas sanciones civiles y penales, *y seran objeto de todas las sanciones legales que correspondan. *Su contenido no puede copiarse para fines comerciales o de otras, *ni puede mostrarse, incluso en una version modificada, en otros sitios Web. Solo esta permitido colocar hipervinculos al sitio web. */ package com.bydan.erp.cartera.presentation.swing.jinternalframes.auxiliar.report; import com.bydan.erp.seguridad.business.entity.Usuario; import com.bydan.erp.seguridad.business.entity.Opcion; import com.bydan.erp.seguridad.business.entity.PerfilOpcion; import com.bydan.erp.seguridad.business.entity.PerfilCampo; import com.bydan.erp.seguridad.business.entity.PerfilAccion; import com.bydan.erp.seguridad.business.entity.ParametroGeneralSg; import com.bydan.erp.seguridad.business.entity.ParametroGeneralUsuario; import com.bydan.erp.seguridad.business.entity.Modulo; import com.bydan.erp.seguridad.business.entity.Accion; //import com.bydan.erp.seguridad.business.entity.PerfilAccion; import com.bydan.erp.seguridad.util.SistemaConstantesFunciones; import com.bydan.erp.seguridad.util.SistemaConstantesFuncionesAdditional; import com.bydan.erp.seguridad.business.logic.SistemaLogicAdditional; //import com.bydan.erp.cartera.util.CobrarSaldosVencidosConstantesFunciones; import com.bydan.erp.cartera.util.report.CobrarSaldosVencidosParameterReturnGeneral; //import com.bydan.erp.cartera.util.report.CobrarSaldosVencidosParameterGeneral; import com.bydan.framework.erp.business.dataaccess.ConstantesSql; import com.bydan.framework.erp.business.entity.Classe; import com.bydan.framework.erp.business.entity.DatoGeneral; import com.bydan.framework.erp.business.entity.DatoGeneralMinimo; import com.bydan.framework.erp.business.entity.GeneralEntity; import com.bydan.framework.erp.business.entity.Mensajes; //import com.bydan.framework.erp.business.entity.MaintenanceType; import com.bydan.framework.erp.util.MaintenanceType; import com.bydan.framework.erp.util.FuncionesReporte; import com.bydan.framework.erp.business.logic.DatosCliente; import com.bydan.framework.erp.business.logic.Pagination; import com.bydan.erp.cartera.presentation.swing.jinternalframes.report.CobrarSaldosVencidosBeanSwingJInternalFrame; import com.bydan.framework.erp.presentation.desktop.swing.TablaGeneralTotalModel; import com.bydan.framework.erp.presentation.desktop.swing.DateConverter; import com.bydan.framework.erp.presentation.desktop.swing.DateConverterFromDate; import com.bydan.framework.erp.presentation.desktop.swing.DateRenderer; import com.bydan.framework.erp.presentation.desktop.swing.DateEditorRenderer; import com.bydan.framework.erp.presentation.desktop.swing.BooleanRenderer; import com.bydan.framework.erp.presentation.desktop.swing.BooleanEditorRenderer; import com.bydan.framework.erp.presentation.desktop.swing.TextFieldRenderer; import com.bydan.framework.erp.presentation.desktop.swing.*; //import com.bydan.framework.erp.presentation.desktop.swing.TextFieldEditorRenderer; import com.bydan.framework.erp.presentation.desktop.swing.HeaderRenderer; import com.bydan.framework.erp.presentation.desktop.swing.JInternalFrameBase; import com.bydan.framework.erp.presentation.desktop.swing.FuncionesSwing; import com.bydan.framework.erp.presentation.desktop.swing.MainJFrame; import com.bydan.framework.erp.resources.imagenes.AuxiliarImagenes; import com.bydan.erp.cartera.resources.reportes.report.AuxiliarReportes; import com.bydan.erp.cartera.util.*; import com.bydan.erp.cartera.util.report.*; import com.bydan.erp.cartera.business.logic.*; import com.bydan.erp.cartera.business.logic.*; import com.bydan.erp.seguridad.business.logic.*; //EJB //PARAMETROS //EJB PARAMETROS import com.bydan.framework.erp.business.logic.*; import com.bydan.framework.erp.util.*; import com.bydan.erp.cartera.business.entity.*; import com.bydan.erp.cartera.business.entity.report.*; //import com.bydan.framework.erp.business.entity.ConexionBeanFace; //import com.bydan.framework.erp.business.entity.Mensajes; import com.bydan.erp.cartera.presentation.swing.jinternalframes.*; import com.bydan.erp.seguridad.presentation.swing.jinternalframes.*; import java.net.NetworkInterface; import java.net.InterfaceAddress; import java.net.InetAddress; import javax.naming.InitialContext; import java.lang.Long; import java.util.Date; import java.util.Enumeration; import java.util.Iterator; import java.util.Set; import java.util.HashSet; import java.util.List; import java.util.ArrayList; import java.io.Serializable; import java.util.Hashtable; import java.io.File; import java.io.FileInputStream; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.FileOutputStream; import java.io.InputStream; import java.io.BufferedReader; import java.io.FileReader; import java.util.HashMap; import java.util.Map; import java.io.PrintWriter; import java.sql.SQLException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.stream.StreamSource; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.w3c.dom.Document; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.w3c.dom.Node; import org.w3c.dom.Element; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; //import org.hibernate.collection.PersistentBag; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.util.JRLoader; import net.sf.jasperreports.engine.export.JRHtmlExporter; import net.sf.jasperreports.j2ee.servlets.BaseHttpServlet; import net.sf.jasperreports.engine.JRExporterParameter; import net.sf.jasperreports.engine.data.JRBeanArrayDataSource; import net.sf.jasperreports.view.JasperViewer; import org.apache.log4j.Logger; import com.bydan.framework.erp.business.entity.Reporte; //VALIDACION import org.hibernate.validator.ClassValidator; import org.hibernate.validator.InvalidValue; import net.sf.jasperreports.engine.JREmptyDataSource; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperPrintManager; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.JasperRunManager; import net.sf.jasperreports.engine.export.JExcelApiExporter; import net.sf.jasperreports.engine.export.JRCsvExporter; import net.sf.jasperreports.engine.export.JRRtfExporter; import net.sf.jasperreports.engine.export.JRXlsExporter; import net.sf.jasperreports.engine.export.JRXlsExporterParameter; import net.sf.jasperreports.engine.util.JRSaver; import net.sf.jasperreports.engine.xml.JRXmlWriter; import com.bydan.erp.cartera.presentation.web.jsf.sessionbean.*; import com.bydan.erp.cartera.presentation.web.jsf.sessionbean.report.*; import com.bydan.erp.cartera.presentation.swing.jinternalframes.report.CobrarSaldosVencidosJInternalFrame; import com.bydan.erp.cartera.presentation.swing.jinternalframes.report.CobrarSaldosVencidosDetalleFormJInternalFrame; import java.util.EventObject; import java.util.EventListener; import javax.swing.*; import javax.swing.border.Border; import javax.swing.event.*; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableModel; import javax.swing.table.TableColumn; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import java.awt.*; import java.awt.event.*; import org.jdesktop.beansbinding.Binding.SyncFailure; import org.jdesktop.beansbinding.BindingListener; import org.jdesktop.beansbinding.Bindings; import org.jdesktop.beansbinding.BeanProperty; import org.jdesktop.beansbinding.ELProperty; import org.jdesktop.beansbinding.AutoBinding.UpdateStrategy; import org.jdesktop.beansbinding.PropertyStateEvent; import org.jdesktop.swingbinding.JComboBoxBinding; import org.jdesktop.swingbinding.SwingBindings; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import com.bydan.erp.cartera.business.entity.*; import com.bydan.erp.seguridad.business.entity.*; import com.bydan.erp.cartera.util.*; import com.bydan.erp.seguridad.util.*; import com.bydan.erp.cartera.presentation.web.jsf.sessionbean.*; import com.bydan.erp.seguridad.presentation.web.jsf.sessionbean.*; @SuppressWarnings("unused") public class CobrarSaldosVencidosModel extends FocusTraversalPolicy implements TableModel, Serializable,PropertyChangeListener { private static final long serialVersionUID = 1L; public JInternalFrameBase jInternalFrameBase; private String[] columnNames = { Constantes2.S_SELECCIONAR ,CobrarSaldosVencidosConstantesFunciones.LABEL_ID ,CobrarSaldosVencidosConstantesFunciones.LABEL_NUMEROFACTURA ,CobrarSaldosVencidosConstantesFunciones.LABEL_NOMBREGRUPOCLIENTE ,CobrarSaldosVencidosConstantesFunciones.LABEL_CODIGO ,CobrarSaldosVencidosConstantesFunciones.LABEL_NOMBRE ,CobrarSaldosVencidosConstantesFunciones.LABEL_FECHA ,CobrarSaldosVencidosConstantesFunciones.LABEL_FECHAVENCE ,CobrarSaldosVencidosConstantesFunciones.LABEL_FECHAEMISION ,CobrarSaldosVencidosConstantesFunciones.LABEL_SALDO ,CobrarSaldosVencidosConstantesFunciones.LABEL_TELEFONOTELEFONO ,CobrarSaldosVencidosConstantesFunciones.LABEL_DESCRIPCION }; public List<CobrarSaldosVencidos> cobrarsaldosvencidoss; //NO SE UTILIZA public CobrarSaldosVencidosModel(List<CobrarSaldosVencidos> cobrarsaldosvencidoss,JInternalFrameBase jInternalFrameBase) { this.cobrarsaldosvencidoss=cobrarsaldosvencidoss; this.jInternalFrameBase=jInternalFrameBase; } public CobrarSaldosVencidosModel(JInternalFrameBase jInternalFrameBase) { this.cobrarsaldosvencidoss=new ArrayList<CobrarSaldosVencidos>(); this.jInternalFrameBase=jInternalFrameBase; } @Override public String getColumnName(int columnIndex) { return columnNames[columnIndex]; } @Override public int getRowCount() { return this.cobrarsaldosvencidoss.size(); } @Override public int getColumnCount() { return this.columnNames.length; } @Override public Object getValueAt(int rowIndex, int columnIndex) { switch (columnIndex) { case 0: return this.cobrarsaldosvencidoss.get(rowIndex).getIsSelected(); case 1: return this.cobrarsaldosvencidoss.get(rowIndex).getId(); case 2: return this.cobrarsaldosvencidoss.get(rowIndex).getnumero_factura(); case 3: return this.cobrarsaldosvencidoss.get(rowIndex).getnombre_grupo_cliente(); case 4: return this.cobrarsaldosvencidoss.get(rowIndex).getcodigo(); case 5: return this.cobrarsaldosvencidoss.get(rowIndex).getnombre(); case 6: return this.cobrarsaldosvencidoss.get(rowIndex).getfecha(); case 7: return this.cobrarsaldosvencidoss.get(rowIndex).getfecha_vence(); case 8: return this.cobrarsaldosvencidoss.get(rowIndex).getfecha_emision(); case 9: return this.cobrarsaldosvencidoss.get(rowIndex).getsaldo(); case 10: return this.cobrarsaldosvencidoss.get(rowIndex).gettelefono_telefono(); case 11: return this.cobrarsaldosvencidoss.get(rowIndex).getdescripcion(); default: return null; } } @Override public Class<?> getColumnClass(int columnIndex) { switch (columnIndex) { case 0: return Boolean.class; case 1: return Long.class; case 2: return String.class; case 3: return String.class; case 4: return String.class; case 5: return String.class; case 6: return Date.class; case 7: return Date.class; case 8: return Date.class; case 9: return Double.class; case 10: return String.class; case 11: return String.class; default: return String.class; } } @Override public boolean isCellEditable(int rowIndex, int columnIndex) { switch (columnIndex) { case 0: return true; case 1: return true; case 2: return true; case 3: return true; case 4: return true; case 5: return true; case 6: return true; case 7: return true; case 8: return true; case 9: return true; case 10: return true; case 11: return true; default: return true; } } @Override public void setValueAt(Object value, int rowIndex, int columnIndex) { CobrarSaldosVencidos cobrarsaldosvencidos = this.cobrarsaldosvencidoss.get(rowIndex); Boolean esCampoValor=false; String sTipo=""; CobrarSaldosVencidosBeanSwingJInternalFrame cobrarsaldosvencidosBeanSwingJInternalFrame=(CobrarSaldosVencidosBeanSwingJInternalFrame)this.jInternalFrameBase; switch (columnIndex) { case 0: try {cobrarsaldosvencidos.setIsSelected((Boolean) value);} catch (Exception e) {e.printStackTrace();} break; case 1: try {cobrarsaldosvencidos.setId((Long) value);} catch (Exception e) {e.printStackTrace();} break; case 2: try {cobrarsaldosvencidos.setnumero_factura((String) value);} catch (Exception e) {e.printStackTrace();} break; case 3: try {cobrarsaldosvencidos.setnombre_grupo_cliente((String) value);} catch (Exception e) {e.printStackTrace();} break; case 4: try {cobrarsaldosvencidos.setcodigo((String) value);} catch (Exception e) {e.printStackTrace();} break; case 5: try {cobrarsaldosvencidos.setnombre((String) value);} catch (Exception e) {e.printStackTrace();} break; case 6: try {cobrarsaldosvencidos.setfecha((Date) value);} catch (Exception e) {e.printStackTrace();} break; case 7: try {cobrarsaldosvencidos.setfecha_vence((Date) value);} catch (Exception e) {e.printStackTrace();} break; case 8: try {cobrarsaldosvencidos.setfecha_emision((Date) value);} catch (Exception e) {e.printStackTrace();} break; case 9: try {cobrarsaldosvencidos.setsaldo((Double) value);esCampoValor=true;} catch (Exception e) {e.printStackTrace();} break; case 10: try {cobrarsaldosvencidos.settelefono_telefono((String) value);} catch (Exception e) {e.printStackTrace();} break; case 11: try {cobrarsaldosvencidos.setdescripcion((String) value);} catch (Exception e) {e.printStackTrace();} break; } fireTableCellUpdated(rowIndex, columnIndex); if(esCampoValor) { jInternalFrameBase.procesoActualizarFilaTotales(esCampoValor,sTipo); } } //PARTE PARA EL PROPERTYVALORCHANGELISTENER //public JInternalFrameBase jInternalFrameBase; /* public CobrarSaldosVencidosModel(JInternalFrameBase jInternalFrameBase) { this.jInternalFrameBase=jInternalFrameBase; } */ @Override public void propertyChange(PropertyChangeEvent evt) { try { this.jInternalFrameBase.procesoActualizarFilaTotales(); } catch (Exception e) { e.printStackTrace(); } } //PARTE PARA EL PROPERTYVALORCHANGELISTENER FIN /*FUNCIONES PARA FOCUS TRAVERSAL POLICY*/ private Component componentTab=new JTextField(); private CobrarSaldosVencidosDetalleFormJInternalFrame cobrarsaldosvencidosJInternalFrame=null; public CobrarSaldosVencidosModel(CobrarSaldosVencidosDetalleFormJInternalFrame cobrarsaldosvencidosJInternalFrame) { this.cobrarsaldosvencidosJInternalFrame=cobrarsaldosvencidosJInternalFrame; } public Component getComponentAfter(Container focusCycleRoot, Component component) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonActualizarToolBarCobrarSaldosVencidos(); if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.getjButtonActualizarToolBarCobrarSaldosVencidos())) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonEliminarToolBarCobrarSaldosVencidos(); return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.getjButtonEliminarToolBarCobrarSaldosVencidos())) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonCancelarToolBarCobrarSaldosVencidos(); return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.getjButtonCancelarToolBarCobrarSaldosVencidos())) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jComboBoxid_grupo_clienteCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextAreadescripcionCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jComboBoxTiposAccionesFormularioCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jComboBoxTiposAccionesFormularioCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jButtonEliminarCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jButtonEliminarCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jButtonActualizarCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jButtonActualizarCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jButtonCancelarCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jComboBoxid_grupo_clienteCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jComboBoxid_empresaCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jComboBoxid_empresaCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextFieldnumero_facturaCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextFieldnumero_facturaCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextAreanombre_grupo_clienteCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextAreanombre_grupo_clienteCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextFieldcodigoCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextFieldcodigoCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextAreanombreCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextAreanombreCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jDateChooserfechaCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jDateChooserfechaCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jDateChooserfecha_venceCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jDateChooserfecha_venceCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jDateChooserfecha_emisionCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jDateChooserfecha_emisionCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextFieldsaldoCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextFieldsaldoCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextAreatelefono_telefonoCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextAreatelefono_telefonoCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextAreadescripcionCobrarSaldosVencidos; return componentTab; } return componentTab; } public Component getComponentBefore(Container focusCycleRoot, Component component) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonActualizarToolBarCobrarSaldosVencidos(); if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.getjButtonEliminarToolBarCobrarSaldosVencidos())) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonActualizarToolBarCobrarSaldosVencidos(); return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.getjButtonCancelarToolBarCobrarSaldosVencidos())) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonEliminarToolBarCobrarSaldosVencidos(); return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jComboBoxid_grupo_clienteCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonCancelarToolBarCobrarSaldosVencidos(); return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jComboBoxTiposAccionesFormularioCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextAreadescripcionCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jButtonEliminarCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jComboBoxTiposAccionesFormularioCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jButtonActualizarCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jButtonEliminarCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jButtonCancelarCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jButtonActualizarCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jComboBoxid_empresaCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jComboBoxid_grupo_clienteCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextFieldnumero_facturaCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jComboBoxid_empresaCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextAreanombre_grupo_clienteCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextFieldnumero_facturaCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextFieldcodigoCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextAreanombre_grupo_clienteCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextAreanombreCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextFieldcodigoCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jDateChooserfechaCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextAreanombreCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jDateChooserfecha_venceCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jDateChooserfechaCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jDateChooserfecha_emisionCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jDateChooserfecha_venceCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextFieldsaldoCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jDateChooserfecha_emisionCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextAreatelefono_telefonoCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextFieldsaldoCobrarSaldosVencidos; return componentTab; } if(component!=null && component.equals(this.cobrarsaldosvencidosJInternalFrame.jTextAreadescripcionCobrarSaldosVencidos)) { componentTab=this.cobrarsaldosvencidosJInternalFrame.jTextAreatelefono_telefonoCobrarSaldosVencidos; return componentTab; } return componentTab; } public Component getDefaultComponent(Container focusCycleRoot) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonActualizarToolBarCobrarSaldosVencidos(); return componentTab; } public Component getFirstComponent(Container focusCycleRoot) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonActualizarToolBarCobrarSaldosVencidos(); return componentTab; } public Component getLastComponent(Container focusCycleRoot) { componentTab=this.cobrarsaldosvencidosJInternalFrame.getjButtonCancelarToolBarCobrarSaldosVencidos(); return componentTab; } public CobrarSaldosVencidosDetalleFormJInternalFrame getcobrarsaldosvencidosJInternalFrame() { return this.cobrarsaldosvencidosJInternalFrame; } public void setcobrarsaldosvencidosJInternalFrame(CobrarSaldosVencidosDetalleFormJInternalFrame cobrarsaldosvencidosJInternalFrame) { this.cobrarsaldosvencidosJInternalFrame=cobrarsaldosvencidosJInternalFrame; } public Component getComponentTab() { return this.componentTab; } public void setComponentTab(Component componentTab) { this.componentTab=componentTab; } /*FUNCIONES PARA FOCUS TRAVERSAL POLICY FIN*/ /*FUNCIONES PARA AbstractTableModel*/ /* Notas: * Si Cambia version se copia variables y metodos que no son sobreescritos en esta clase.(Usa Jdk 8) * Se copia del Jdk javax.swing.table.AbstractTableModel * Los argumentos usados es de tipo Interface TableModel no de Clase AbstractTableModel * Si se cambia y/o actualiza jdj, toca actualizar el código nuevamente */ protected EventListenerList listenerList = new EventListenerList(); public int findColumn(String columnName) { for (int i = 0; i < getColumnCount(); i++) { if (columnName.equals(getColumnName(i))) { return i; } } return -1; } public void addTableModelListener(TableModelListener l) { listenerList.add(TableModelListener.class, l); } public void removeTableModelListener(TableModelListener l) { listenerList.remove(TableModelListener.class, l); } public TableModelListener[] getTableModelListeners() { return listenerList.getListeners(TableModelListener.class); } public void fireTableDataChanged() { fireTableChanged(new TableModelEvent(this)); } public void fireTableStructureChanged() { fireTableChanged(new TableModelEvent(this, TableModelEvent.HEADER_ROW)); } public void fireTableRowsInserted(int firstRow, int lastRow) { fireTableChanged(new TableModelEvent(this, firstRow, lastRow, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT)); } public void fireTableRowsUpdated(int firstRow, int lastRow) { fireTableChanged(new TableModelEvent(this, firstRow, lastRow, TableModelEvent.ALL_COLUMNS, TableModelEvent.UPDATE)); } public void fireTableRowsDeleted(int firstRow, int lastRow) { fireTableChanged(new TableModelEvent(this, firstRow, lastRow, TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE)); } public void fireTableCellUpdated(int row, int column) { fireTableChanged(new TableModelEvent(this, row, row, column)); } public void fireTableChanged(TableModelEvent e) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==TableModelListener.class) { ((TableModelListener)listeners[i+1]).tableChanged(e); } } } public <T extends EventListener> T[] getListeners(Class<T> listenerType) { return listenerList.getListeners(listenerType); } /*FUNCIONES PARA AbstractTableModel FIN*/ }
c3db3e8b2e5663e24df978ff1d6f4cd96aa910d9
01eddf1600be383b7ca3454195b804cd3426b607
/Code/SBDatabase/JDBC/src/Connect.java
4274f59fac7c5f5feee01e6ec1a0473ac252474b
[]
no_license
491Project/491Project
5e5f99aa40ac104322441d5ffc4b1a85471843b6
946249e531cdb77f15ed3ee8e366060f5493b9ed
refs/heads/master
2020-12-21T23:45:33.876740
2020-12-18T03:34:58
2020-12-18T03:34:58
236,603,781
0
0
null
null
null
null
UTF-8
Java
false
false
1,915
java
import java.sql.*; public class Connect { public static void main(String[] args) { Connect connectObject = new Connect(); // Creating object to access our method connectObject.createConnection(); } /** * Creates a connection to the MySQL server, studdibuddi * Creates necessary objects to execute query and then displays the results of a SELECT query * @author Tanner Mindrum * @since 3/24/2020 */ void createConnection() { try { // Loads MySQL driver to our program Class.forName("com.mysql.jdbc.Driver"); // Establish database connection Connection conn = DriverManager.getConnection("jdbc:mysql://studibuddi.cvo8hcorg85o.us-west-1.rds.amazonaws.com" + ":3306/studibuddi?user=" + "masterbuddi" + "&password=myMasterPass"); // String jdbcUrl = "jdbc:postgresql://" + hostname + ":" + port + "/" + dbName + "?user=" + userName + "&password=" + password; // Create a Statement object Statement stmt = conn.createStatement(); // Create a ResultSet object and assign it the values retrieved from a query String email = "[email protected]"; PreparedStatement myStmt = conn.prepareStatement("DELETE FROM Post"); //myStmt.setString(1, email); myStmt.executeUpdate(); myStmt.close(); // Print each student's ID and name /* if (rs.next()) { System.out.println(rs.first()); }*/ //System.out.println(rs.first()); /* while (rs.next()) { System.out.println(rs.getString("bEmail")); }*/ System.out.println("\n\nDatabase connection successful."); } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); } } }
3efca57e4324b0510c7868d248dfbf74a67e43e1
21d33bd4b59166770f97ceca609574ac24081f72
/SQLiteTest/app/build/generated/not_namespaced_r_class_sources/debug/r/androidx/constraintlayout/widget/R.java
1997398ab294296361df6dce4011c53f31fdaa09
[]
no_license
tjkcrazy1st/study
34ee3351f3135509fcab09c621934eb5eb58611a
52375455bfc7c408d0a0e3717225b26164578a75
refs/heads/master
2022-12-26T22:54:40.133596
2020-07-18T17:12:45
2020-07-18T17:12:45
203,307,787
0
0
null
2022-12-10T06:42:15
2019-08-20T05:46:16
Java
UTF-8
Java
false
false
19,455
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.constraintlayout.widget; public final class R { private R() {} public static final class attr { private attr() {} public static final int barrierAllowsGoneWidgets = 0x7f020037; public static final int barrierDirection = 0x7f020038; public static final int chainUseRtl = 0x7f020046; public static final int constraintSet = 0x7f020059; public static final int constraint_referenced_ids = 0x7f02005a; public static final int content = 0x7f02005b; public static final int emptyVisibility = 0x7f020077; public static final int layout_constrainedHeight = 0x7f02009a; public static final int layout_constrainedWidth = 0x7f02009b; public static final int layout_constraintBaseline_creator = 0x7f02009c; public static final int layout_constraintBaseline_toBaselineOf = 0x7f02009d; public static final int layout_constraintBottom_creator = 0x7f02009e; public static final int layout_constraintBottom_toBottomOf = 0x7f02009f; public static final int layout_constraintBottom_toTopOf = 0x7f0200a0; public static final int layout_constraintCircle = 0x7f0200a1; public static final int layout_constraintCircleAngle = 0x7f0200a2; public static final int layout_constraintCircleRadius = 0x7f0200a3; public static final int layout_constraintDimensionRatio = 0x7f0200a4; public static final int layout_constraintEnd_toEndOf = 0x7f0200a5; public static final int layout_constraintEnd_toStartOf = 0x7f0200a6; public static final int layout_constraintGuide_begin = 0x7f0200a7; public static final int layout_constraintGuide_end = 0x7f0200a8; public static final int layout_constraintGuide_percent = 0x7f0200a9; public static final int layout_constraintHeight_default = 0x7f0200aa; public static final int layout_constraintHeight_max = 0x7f0200ab; public static final int layout_constraintHeight_min = 0x7f0200ac; public static final int layout_constraintHeight_percent = 0x7f0200ad; public static final int layout_constraintHorizontal_bias = 0x7f0200ae; public static final int layout_constraintHorizontal_chainStyle = 0x7f0200af; public static final int layout_constraintHorizontal_weight = 0x7f0200b0; public static final int layout_constraintLeft_creator = 0x7f0200b1; public static final int layout_constraintLeft_toLeftOf = 0x7f0200b2; public static final int layout_constraintLeft_toRightOf = 0x7f0200b3; public static final int layout_constraintRight_creator = 0x7f0200b4; public static final int layout_constraintRight_toLeftOf = 0x7f0200b5; public static final int layout_constraintRight_toRightOf = 0x7f0200b6; public static final int layout_constraintStart_toEndOf = 0x7f0200b7; public static final int layout_constraintStart_toStartOf = 0x7f0200b8; public static final int layout_constraintTop_creator = 0x7f0200b9; public static final int layout_constraintTop_toBottomOf = 0x7f0200ba; public static final int layout_constraintTop_toTopOf = 0x7f0200bb; public static final int layout_constraintVertical_bias = 0x7f0200bc; public static final int layout_constraintVertical_chainStyle = 0x7f0200bd; public static final int layout_constraintVertical_weight = 0x7f0200be; public static final int layout_constraintWidth_default = 0x7f0200bf; public static final int layout_constraintWidth_max = 0x7f0200c0; public static final int layout_constraintWidth_min = 0x7f0200c1; public static final int layout_constraintWidth_percent = 0x7f0200c2; public static final int layout_editor_absoluteX = 0x7f0200c4; public static final int layout_editor_absoluteY = 0x7f0200c5; public static final int layout_goneMarginBottom = 0x7f0200c6; public static final int layout_goneMarginEnd = 0x7f0200c7; public static final int layout_goneMarginLeft = 0x7f0200c8; public static final int layout_goneMarginRight = 0x7f0200c9; public static final int layout_goneMarginStart = 0x7f0200ca; public static final int layout_goneMarginTop = 0x7f0200cb; public static final int layout_optimizationLevel = 0x7f0200ce; } public static final class id { private id() {} public static final int bottom = 0x7f070022; public static final int end = 0x7f070037; public static final int gone = 0x7f07003e; public static final int invisible = 0x7f070048; public static final int left = 0x7f07004a; public static final int packed = 0x7f070058; public static final int parent = 0x7f070059; public static final int percent = 0x7f07005b; public static final int right = 0x7f07005f; public static final int spread = 0x7f070077; public static final int spread_inside = 0x7f070078; public static final int start = 0x7f07007d; public static final int top = 0x7f07008c; public static final int wrap = 0x7f070092; } public static final class styleable { private styleable() {} public static final int[] ConstraintLayout_Layout = { 0x10100c4, 0x101011f, 0x1010120, 0x101013f, 0x1010140, 0x7f020037, 0x7f020038, 0x7f020046, 0x7f020059, 0x7f02005a, 0x7f02009a, 0x7f02009b, 0x7f02009c, 0x7f02009d, 0x7f02009e, 0x7f02009f, 0x7f0200a0, 0x7f0200a1, 0x7f0200a2, 0x7f0200a3, 0x7f0200a4, 0x7f0200a5, 0x7f0200a6, 0x7f0200a7, 0x7f0200a8, 0x7f0200a9, 0x7f0200aa, 0x7f0200ab, 0x7f0200ac, 0x7f0200ad, 0x7f0200ae, 0x7f0200af, 0x7f0200b0, 0x7f0200b1, 0x7f0200b2, 0x7f0200b3, 0x7f0200b4, 0x7f0200b5, 0x7f0200b6, 0x7f0200b7, 0x7f0200b8, 0x7f0200b9, 0x7f0200ba, 0x7f0200bb, 0x7f0200bc, 0x7f0200bd, 0x7f0200be, 0x7f0200bf, 0x7f0200c0, 0x7f0200c1, 0x7f0200c2, 0x7f0200c4, 0x7f0200c5, 0x7f0200c6, 0x7f0200c7, 0x7f0200c8, 0x7f0200c9, 0x7f0200ca, 0x7f0200cb, 0x7f0200ce }; public static final int ConstraintLayout_Layout_android_orientation = 0; public static final int ConstraintLayout_Layout_android_maxWidth = 1; public static final int ConstraintLayout_Layout_android_maxHeight = 2; public static final int ConstraintLayout_Layout_android_minWidth = 3; public static final int ConstraintLayout_Layout_android_minHeight = 4; public static final int ConstraintLayout_Layout_barrierAllowsGoneWidgets = 5; public static final int ConstraintLayout_Layout_barrierDirection = 6; public static final int ConstraintLayout_Layout_chainUseRtl = 7; public static final int ConstraintLayout_Layout_constraintSet = 8; public static final int ConstraintLayout_Layout_constraint_referenced_ids = 9; public static final int ConstraintLayout_Layout_layout_constrainedHeight = 10; public static final int ConstraintLayout_Layout_layout_constrainedWidth = 11; public static final int ConstraintLayout_Layout_layout_constraintBaseline_creator = 12; public static final int ConstraintLayout_Layout_layout_constraintBaseline_toBaselineOf = 13; public static final int ConstraintLayout_Layout_layout_constraintBottom_creator = 14; public static final int ConstraintLayout_Layout_layout_constraintBottom_toBottomOf = 15; public static final int ConstraintLayout_Layout_layout_constraintBottom_toTopOf = 16; public static final int ConstraintLayout_Layout_layout_constraintCircle = 17; public static final int ConstraintLayout_Layout_layout_constraintCircleAngle = 18; public static final int ConstraintLayout_Layout_layout_constraintCircleRadius = 19; public static final int ConstraintLayout_Layout_layout_constraintDimensionRatio = 20; public static final int ConstraintLayout_Layout_layout_constraintEnd_toEndOf = 21; public static final int ConstraintLayout_Layout_layout_constraintEnd_toStartOf = 22; public static final int ConstraintLayout_Layout_layout_constraintGuide_begin = 23; public static final int ConstraintLayout_Layout_layout_constraintGuide_end = 24; public static final int ConstraintLayout_Layout_layout_constraintGuide_percent = 25; public static final int ConstraintLayout_Layout_layout_constraintHeight_default = 26; public static final int ConstraintLayout_Layout_layout_constraintHeight_max = 27; public static final int ConstraintLayout_Layout_layout_constraintHeight_min = 28; public static final int ConstraintLayout_Layout_layout_constraintHeight_percent = 29; public static final int ConstraintLayout_Layout_layout_constraintHorizontal_bias = 30; public static final int ConstraintLayout_Layout_layout_constraintHorizontal_chainStyle = 31; public static final int ConstraintLayout_Layout_layout_constraintHorizontal_weight = 32; public static final int ConstraintLayout_Layout_layout_constraintLeft_creator = 33; public static final int ConstraintLayout_Layout_layout_constraintLeft_toLeftOf = 34; public static final int ConstraintLayout_Layout_layout_constraintLeft_toRightOf = 35; public static final int ConstraintLayout_Layout_layout_constraintRight_creator = 36; public static final int ConstraintLayout_Layout_layout_constraintRight_toLeftOf = 37; public static final int ConstraintLayout_Layout_layout_constraintRight_toRightOf = 38; public static final int ConstraintLayout_Layout_layout_constraintStart_toEndOf = 39; public static final int ConstraintLayout_Layout_layout_constraintStart_toStartOf = 40; public static final int ConstraintLayout_Layout_layout_constraintTop_creator = 41; public static final int ConstraintLayout_Layout_layout_constraintTop_toBottomOf = 42; public static final int ConstraintLayout_Layout_layout_constraintTop_toTopOf = 43; public static final int ConstraintLayout_Layout_layout_constraintVertical_bias = 44; public static final int ConstraintLayout_Layout_layout_constraintVertical_chainStyle = 45; public static final int ConstraintLayout_Layout_layout_constraintVertical_weight = 46; public static final int ConstraintLayout_Layout_layout_constraintWidth_default = 47; public static final int ConstraintLayout_Layout_layout_constraintWidth_max = 48; public static final int ConstraintLayout_Layout_layout_constraintWidth_min = 49; public static final int ConstraintLayout_Layout_layout_constraintWidth_percent = 50; public static final int ConstraintLayout_Layout_layout_editor_absoluteX = 51; public static final int ConstraintLayout_Layout_layout_editor_absoluteY = 52; public static final int ConstraintLayout_Layout_layout_goneMarginBottom = 53; public static final int ConstraintLayout_Layout_layout_goneMarginEnd = 54; public static final int ConstraintLayout_Layout_layout_goneMarginLeft = 55; public static final int ConstraintLayout_Layout_layout_goneMarginRight = 56; public static final int ConstraintLayout_Layout_layout_goneMarginStart = 57; public static final int ConstraintLayout_Layout_layout_goneMarginTop = 58; public static final int ConstraintLayout_Layout_layout_optimizationLevel = 59; public static final int[] ConstraintLayout_placeholder = { 0x7f02005b, 0x7f020077 }; public static final int ConstraintLayout_placeholder_content = 0; public static final int ConstraintLayout_placeholder_emptyVisibility = 1; public static final int[] ConstraintSet = { 0x10100c4, 0x10100d0, 0x10100dc, 0x10100f4, 0x10100f5, 0x10100f7, 0x10100f8, 0x10100f9, 0x10100fa, 0x101011f, 0x1010120, 0x101013f, 0x1010140, 0x101031f, 0x1010320, 0x1010321, 0x1010322, 0x1010323, 0x1010324, 0x1010325, 0x1010326, 0x1010327, 0x1010328, 0x10103b5, 0x10103b6, 0x10103fa, 0x1010440, 0x7f020037, 0x7f020038, 0x7f020046, 0x7f02005a, 0x7f02009a, 0x7f02009b, 0x7f02009c, 0x7f02009d, 0x7f02009e, 0x7f02009f, 0x7f0200a0, 0x7f0200a1, 0x7f0200a2, 0x7f0200a3, 0x7f0200a4, 0x7f0200a5, 0x7f0200a6, 0x7f0200a7, 0x7f0200a8, 0x7f0200a9, 0x7f0200aa, 0x7f0200ab, 0x7f0200ac, 0x7f0200ad, 0x7f0200ae, 0x7f0200af, 0x7f0200b0, 0x7f0200b1, 0x7f0200b2, 0x7f0200b3, 0x7f0200b4, 0x7f0200b5, 0x7f0200b6, 0x7f0200b7, 0x7f0200b8, 0x7f0200b9, 0x7f0200ba, 0x7f0200bb, 0x7f0200bc, 0x7f0200bd, 0x7f0200be, 0x7f0200bf, 0x7f0200c0, 0x7f0200c1, 0x7f0200c2, 0x7f0200c4, 0x7f0200c5, 0x7f0200c6, 0x7f0200c7, 0x7f0200c8, 0x7f0200c9, 0x7f0200ca, 0x7f0200cb }; public static final int ConstraintSet_android_orientation = 0; public static final int ConstraintSet_android_id = 1; public static final int ConstraintSet_android_visibility = 2; public static final int ConstraintSet_android_layout_width = 3; public static final int ConstraintSet_android_layout_height = 4; public static final int ConstraintSet_android_layout_marginLeft = 5; public static final int ConstraintSet_android_layout_marginTop = 6; public static final int ConstraintSet_android_layout_marginRight = 7; public static final int ConstraintSet_android_layout_marginBottom = 8; public static final int ConstraintSet_android_maxWidth = 9; public static final int ConstraintSet_android_maxHeight = 10; public static final int ConstraintSet_android_minWidth = 11; public static final int ConstraintSet_android_minHeight = 12; public static final int ConstraintSet_android_alpha = 13; public static final int ConstraintSet_android_transformPivotX = 14; public static final int ConstraintSet_android_transformPivotY = 15; public static final int ConstraintSet_android_translationX = 16; public static final int ConstraintSet_android_translationY = 17; public static final int ConstraintSet_android_scaleX = 18; public static final int ConstraintSet_android_scaleY = 19; public static final int ConstraintSet_android_rotation = 20; public static final int ConstraintSet_android_rotationX = 21; public static final int ConstraintSet_android_rotationY = 22; public static final int ConstraintSet_android_layout_marginStart = 23; public static final int ConstraintSet_android_layout_marginEnd = 24; public static final int ConstraintSet_android_translationZ = 25; public static final int ConstraintSet_android_elevation = 26; public static final int ConstraintSet_barrierAllowsGoneWidgets = 27; public static final int ConstraintSet_barrierDirection = 28; public static final int ConstraintSet_chainUseRtl = 29; public static final int ConstraintSet_constraint_referenced_ids = 30; public static final int ConstraintSet_layout_constrainedHeight = 31; public static final int ConstraintSet_layout_constrainedWidth = 32; public static final int ConstraintSet_layout_constraintBaseline_creator = 33; public static final int ConstraintSet_layout_constraintBaseline_toBaselineOf = 34; public static final int ConstraintSet_layout_constraintBottom_creator = 35; public static final int ConstraintSet_layout_constraintBottom_toBottomOf = 36; public static final int ConstraintSet_layout_constraintBottom_toTopOf = 37; public static final int ConstraintSet_layout_constraintCircle = 38; public static final int ConstraintSet_layout_constraintCircleAngle = 39; public static final int ConstraintSet_layout_constraintCircleRadius = 40; public static final int ConstraintSet_layout_constraintDimensionRatio = 41; public static final int ConstraintSet_layout_constraintEnd_toEndOf = 42; public static final int ConstraintSet_layout_constraintEnd_toStartOf = 43; public static final int ConstraintSet_layout_constraintGuide_begin = 44; public static final int ConstraintSet_layout_constraintGuide_end = 45; public static final int ConstraintSet_layout_constraintGuide_percent = 46; public static final int ConstraintSet_layout_constraintHeight_default = 47; public static final int ConstraintSet_layout_constraintHeight_max = 48; public static final int ConstraintSet_layout_constraintHeight_min = 49; public static final int ConstraintSet_layout_constraintHeight_percent = 50; public static final int ConstraintSet_layout_constraintHorizontal_bias = 51; public static final int ConstraintSet_layout_constraintHorizontal_chainStyle = 52; public static final int ConstraintSet_layout_constraintHorizontal_weight = 53; public static final int ConstraintSet_layout_constraintLeft_creator = 54; public static final int ConstraintSet_layout_constraintLeft_toLeftOf = 55; public static final int ConstraintSet_layout_constraintLeft_toRightOf = 56; public static final int ConstraintSet_layout_constraintRight_creator = 57; public static final int ConstraintSet_layout_constraintRight_toLeftOf = 58; public static final int ConstraintSet_layout_constraintRight_toRightOf = 59; public static final int ConstraintSet_layout_constraintStart_toEndOf = 60; public static final int ConstraintSet_layout_constraintStart_toStartOf = 61; public static final int ConstraintSet_layout_constraintTop_creator = 62; public static final int ConstraintSet_layout_constraintTop_toBottomOf = 63; public static final int ConstraintSet_layout_constraintTop_toTopOf = 64; public static final int ConstraintSet_layout_constraintVertical_bias = 65; public static final int ConstraintSet_layout_constraintVertical_chainStyle = 66; public static final int ConstraintSet_layout_constraintVertical_weight = 67; public static final int ConstraintSet_layout_constraintWidth_default = 68; public static final int ConstraintSet_layout_constraintWidth_max = 69; public static final int ConstraintSet_layout_constraintWidth_min = 70; public static final int ConstraintSet_layout_constraintWidth_percent = 71; public static final int ConstraintSet_layout_editor_absoluteX = 72; public static final int ConstraintSet_layout_editor_absoluteY = 73; public static final int ConstraintSet_layout_goneMarginBottom = 74; public static final int ConstraintSet_layout_goneMarginEnd = 75; public static final int ConstraintSet_layout_goneMarginLeft = 76; public static final int ConstraintSet_layout_goneMarginRight = 77; public static final int ConstraintSet_layout_goneMarginStart = 78; public static final int ConstraintSet_layout_goneMarginTop = 79; public static final int[] LinearConstraintLayout = { 0x10100c4 }; public static final int LinearConstraintLayout_android_orientation = 0; } }
4b1e6f05bde442319dfb4c2c6b6480fcc506c0a9
cef055e549e5fa5a387808c5068df700f85e71fd
/Sean/mymod/entity/lavaslime/MyRenderLavaSlime.java
0fb4b207daf62a7d849a95ac2961ad8fd7d6709b
[]
no_license
SheepTester/mods
950ca2e49bbdddeab6e5ffbb74fc6facead37dff
a5549dda9ea923bf40d837e49b4d4a9c5af3f708
refs/heads/master
2021-02-11T16:52:55.449793
2020-03-03T01:23:09
2020-03-03T01:23:09
244,512,396
2
0
null
null
null
null
UTF-8
Java
false
false
2,056
java
package mymod.entity.lavaslime; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityMagmaCube; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class MyRenderLavaSlime extends RenderLiving { private static final ResourceLocation magmaCubeTextures = new ResourceLocation("mymod:textures/entity/MyLavaSlime.png"); private ModelBase scaleAmount; public MyRenderLavaSlime(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) { super(par1ModelBase, par3); this.scaleAmount = par2ModelBase; } protected ResourceLocation getMagmaCubeTextures(MyEntityLavaSlime par1EntityMagmaCube) { return magmaCubeTextures; } protected void scaleMagmaCube(MyEntityLavaSlime par1EntityMagmaCube, float par2) { int i = par1EntityMagmaCube.getSlimeSize(); float f1 = (par1EntityMagmaCube.prevSquishFactor + (par1EntityMagmaCube.squishFactor - par1EntityMagmaCube.prevSquishFactor) * par2) / ((float)i * 0.5F + 1.0F); float f2 = 1.0F / (f1 + 1.0F); float f3 = (float)i; GL11.glScalef(f2 * f3, 1.0F / f2 * f3, f2 * f3); } /** * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: * entityLiving, partialTickTime */ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { this.scaleMagmaCube((MyEntityLavaSlime)par1EntityLivingBase, par2); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(Entity par1Entity) { return this.getMagmaCubeTextures((MyEntityLavaSlime)par1Entity); } }
216cc1308bd34f9de7c0d3f2e983389b115f85e9
fe1eec7197b7708fe278fa0b9a449a0c19b04830
/src/main/java/com/example/demo/SimpleController.java
945f9b318696b467d52ad146de6aa084abb9231f
[ "MIT" ]
permissive
zxnord/UdemyMicroservicesLab1
04eefca33e31a4ccecae41d129c7696dd21a7a50
48456161d38269aac86f8cd4256f3f5a5825b886
refs/heads/master
2021-07-06T01:20:54.243460
2017-10-01T05:02:18
2017-10-01T05:02:18
105,419,888
0
0
null
2017-10-01T05:09:53
2017-10-01T04:48:40
Shell
UTF-8
Java
false
false
255
java
package com.example.demo; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class SimpleController { @GetMapping("/") public String simpleMethod() { return "hello"; } }
b81f7ac3088d783a5400256e57885e68ff22139b
85c2a8deaf030e4606f437c263b959feda949422
/src/main/java/cheanxin/service/ProductLogService.java
3101ca56745cf77810a48a586bcb9d08a3f73937
[]
no_license
wangzefei/cheanxin
ab7df1b0de65e2fbb97f51bdb399fb2339ba0457
813dd76eb2b1a3beec305d87daae4565e20d0559
refs/heads/master
2021-01-21T11:10:53.098277
2017-02-28T07:21:51
2017-02-28T07:21:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
187
java
package cheanxin.service; import cheanxin.domain.ProductLog; /** * Created by 273cn on 16/12/21. */ public interface ProductLogService { ProductLog save(ProductLog productLog); }
6870a7d70834a0a639487c21a3b8a22cc34ca102
e6f5ddc2a2051d2765608b357607dc81948a334c
/practice/app/src/main/java/com/eomcs/lang/ex04/Exam0412.java
aee32eee3b2fdab3c7d75b708e3d58d7d4122c6f
[]
no_license
hanseul777/other-study
31fb8c913863e42a3c02849df1885f79a13123a5
06d7de120796e6cef429d1ec2886a5b597e66222
refs/heads/main
2023-06-21T09:05:56.846046
2021-07-28T09:13:52
2021-07-28T09:13:52
376,265,727
0
0
null
null
null
null
UTF-8
Java
false
false
1,262
java
package com.eomcs.lang.ex04; //# 정수 변수 - 변수와 리터럴의 크기 // public class Exam0412 { public static void main(String[] args) { //4바이트 정수 리터럴 ==> byte, short 변수 //- 4바이트 리터럴인 경우 메모리 크기에 상관없이 저장할 수만 있다면 // byte(1바이트), short(2바이트) 메모리에 값을 저장해도 컴파일 오류가 발생하지 않는다. // byte b; short s; b = 127; // 4바이트 리터럴 ==> 1바이트 메모리 // (127자체는 int로 4byte라서 b보다 크지만 b의 범위에 들어가있기 때문에 가능하다는 말) s = 32767; // 4바이트 리터럴 ==> 2바이트 메모리 //- 단, 리터럴을 메모리에 저장할 수 없다면 컴파일 오류가 발생한다. //b = 128; // 1바이트 크기를 초과하는 값 //s = 32768; // 2바이트 크기를 초과하는 값 //8바이트 정수 리터럴 //- 8바이트 리터럴인 경우 값이 크고 작음에 상관없이 // byte(1바이트), short(2바이트), int(4바이트) 메모리에 값을 저장하려하면 컴파일 오류가 발생한다. //b = 127L; //s = 32757L; //int i = 100L; } }
9cfd0e67bd66b8931ef59912b2e9e2741e7ccce6
4812d93e1cadc9e5b82d1e371e2fb32dbfefd5b6
/MediaService/src/test/java/com/example/demo/MediaServiceApplicationTests.java
5fa9db429ca990e58135f1298cf7b476bb2acc96
[]
no_license
shubhra1986/Pixogram-FullStackProject
666350baaf11cb81eaa5a4860c98bc57335232f3
a819a161fa4d7744c926606b8328f770e647861d
refs/heads/main
2023-07-04T03:29:24.367060
2021-08-13T13:16:23
2021-08-13T13:16:23
395,637,687
0
0
null
null
null
null
UTF-8
Java
false
false
214
java
package com.example.demo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class MediaServiceApplicationTests { @Test void contextLoads() { } }
2ed578cb94b82e84f75103c606d6cbe363bb91c7
24ced149efd54e356a62aa12dfebdaebabc50b0d
/src/main/java/com/nine/one/yuedu/read/mapper/WxToAuthuserMapper.java
ac17c65df1dceab695c411ff88d511985d90d8bf
[]
no_license
SolickLwz/91readHistory
09f293d5cd3c5fee65346ed97490740ec1c0afff
d97781da35515da3398642a6a89eac1f1838df1a
refs/heads/master
2023-02-28T03:14:07.922034
2021-02-04T07:55:58
2021-02-04T07:55:58
335,847,891
0
0
null
null
null
null
UTF-8
Java
false
false
382
java
package com.nine.one.yuedu.read.mapper; import com.nine.one.yuedu.read.entity.WxToAuthuser; import org.apache.ibatis.annotations.Param; import tk.mybatis.MyMapper; public interface WxToAuthuserMapper extends MyMapper<WxToAuthuser> { WxToAuthuser selectOneByOpenId(@Param("openid")String openid); WxToAuthuser selectAuthorUserByUnionid(@Param("unionid") String unionid); }
e0f9ab377ff454fa065389249e94c62cc0ea3624
bafef4d22ff1dd32392134f5c2d286c0c90ad750
/src/WavesEasy.java
884f2df985dd05e9197a9d9dbaebef3fef434e47
[]
no_license
diogoka/TFPOO
19bd928f19b7069e1a26bb46124775cedd5a02e2
94ba1cd27fc46423e9ffc39c54c989b1b75b08fe
refs/heads/main
2023-01-21T16:15:03.657639
2020-12-02T16:04:23
2020-12-02T16:04:23
316,049,669
0
0
null
null
null
null
UTF-8
Java
false
false
5,602
java
package src; import java.util.LinkedList; import java.util.List; public final class WavesEasy { private static String[][] waves = new String[][] { new String[]{ " ", " ", " ", " ", " ", " ", " ", " 1 1 1 1 ", " ", " ", " ", }, new String[]{ " ", " ", " 0 0 ", " ", " 1 1 1 1 1 1 ", " ", " 1 1 1 1 1 1 ", " ", " ", " ", " ", }, new String[]{ " 0 0 0 0 0 0 0 ", " ", " 1 1 1 1 1 1 1 1 ", " ", " ", " ", " ", " 1 1 1 ", " ", " ", " ", }, new String[]{ " ", " ", " 0 ", " 1 1 0 1 1 ", " 0 ", " ", " ", " ", " ", " ", " ", }, new String[]{ " 0 0 0 ", " ", " 0 ", " 1 1 1 ", " 1 0 1 ", " 1 ", " 0 ", " ", " ", " ", " ", }, new String[]{ " ", " 111 111 ", " 111 111 ", " 00 ", " 11 11 ", " 0 00 00 0 ", " ", " ", " ", " ", " ", }, new String[]{ " ", " 0000 0000 ", " 0 0 1 2 1 1 1 1 ", " 1 1 0 1 1 1 1 ", " 1 1 1 1 0 1 1 0 ", " ", " 3 ", " ", " ", " ", " ", }, new String[]{ " 0 0 0 ", " ", " 2 3 1 3 1 3 2 ", " ", " 1 1 1 1 1 1 1 1 ", " 1 101 1 101 1 ", " 1 1 3 1 1 0 3 0 ", " ", " ", " ", " ", }, }; public static List<StormTrooper> getWaveStorm(int index) { List<StormTrooper> enemies = new LinkedList<>(); if (waves.length == 0) return enemies; if (index < 0) { index = 0; } else if (index >= waves.length) { index = waves.length - 1; } String[] wave = waves[index]; int cellY = Params.GAME_HEIGHT / wave.length; for (int y = 0; y < wave.length; y++) { String line = wave[y]; int cellX = Params.GAME_WIDTH / line.length(); for (int x = 0; x < line.length(); x++) { switch (line.charAt(x)) { case '0': enemies.add(new DarthVader(x * cellX, y * cellY, 1)); break; case '1': enemies.add(new GroupStormTrooper(x * cellX, y * cellY, 1)); break; case '2': enemies.add(new TimerStormTrooper(x * cellX, y * cellY, 5 + (int)Math.floor(Math.random() * 10), 1)); break; case '3': enemies.add(new DeathStar(x * cellX, y * cellY, 2)); break; } } } return enemies; } }
dec8c1d0086013ff345933dc6d0939cee66d9c13
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
/SQuirrel_SQL/rev4007-4212/right-trunk-4212/test/src/net/sourceforge/squirrel_sql/fw/dialects/SybaseDialectTest.java
981aaa1451b93024c40f24c213a48f162d49f641
[]
no_license
joliebig/featurehouse_fstmerge_examples
af1b963537839d13e834f829cf51f8ad5e6ffe76
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
refs/heads/master
2016-09-05T10:24:50.974902
2013-03-28T16:28:47
2013-03-28T16:28:47
9,080,611
3
2
null
null
null
null
UTF-8
Java
false
false
380
java
package net.sourceforge.squirrel_sql.fw.dialects; public class SybaseDialectTest extends DialectTestCase { private SybaseDialectExt dialect = null; @Override public void setUp() throws Exception { super.setUp(); dialect = new SybaseDialectExt(); } public void testGetTypeNameInt() { testAllTypes(dialect); } }
ed3923003970f574631a32d1be2f0711f79bb581
a0dd13abb30c99ad0c9f83d8395b209080aa1cdc
/src/main/java/com/narss/warproduction/dao/BuildingInformationDAOImpl.java
c81d2a5b53e7148b7ca5712190779f96258dc457
[]
no_license
AKotb/NARSS_WarProduction_10thDistrict
6d2c1aa8a051046f9cb8f46b50782cf1ac4bcd62
ad925db6047a88dc3d4b88bcbe23fc2339efa35d
refs/heads/master
2023-03-30T21:04:14.078817
2021-04-05T07:34:36
2021-04-05T07:34:36
325,272,986
0
0
null
null
null
null
UTF-8
Java
false
false
2,215
java
/** * */ package com.narss.warproduction.dao; import java.util.List; import javax.persistence.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.narss.warproduction.entity.BuildingInformation; /** * @author ahmed.kotb * */ @Repository public class BuildingInformationDAOImpl implements BuildingInformationDAO { @Autowired SessionFactory factory; @SuppressWarnings({ "unchecked", "finally" }) public List<BuildingInformation> getAllBuildingsInformation() { List<BuildingInformation> buildingsInformation = null; try { Session session = factory.getCurrentSession(); Query q = session.createQuery("FROM BuildingInformation"); buildingsInformation = q.getResultList(); } catch (Exception e) { e.printStackTrace(); } finally { return buildingsInformation; } } @SuppressWarnings({ "unchecked", "finally" }) public BuildingInformation getBuildingInformation(String biBuildingBarcode) { List<BuildingInformation> buildingsInformation = null; try { Session session = factory.getCurrentSession(); Query q = session.createQuery("FROM BuildingInformation WHERE biBuildingBarcode = :biBuildingBarcode"); q.setParameter("biBuildingBarcode", biBuildingBarcode); buildingsInformation = q.getResultList(); } catch (Exception e) { e.printStackTrace(); } finally { return buildingsInformation.get(0); } } public boolean addBuildingInformation(BuildingInformation buildingInformation) { Session session = factory.getCurrentSession(); session.save(buildingInformation); return true; } public boolean updateBuildingInformation(BuildingInformation buildingInformation) { Session session = factory.getCurrentSession(); session.saveOrUpdate(buildingInformation); return true; } public boolean deleteBuildingInformation(String biBuildingBarcode) { Session session = factory.getCurrentSession(); BuildingInformation bi = session.get(BuildingInformation.class, biBuildingBarcode); session.delete(bi); return true; } }
6f88cded4e360029a1bcdd480b68c8c83ddca1ce
0b97f38cdd95ce583e26273f0bb58fda2278a4f1
/app/src/main/java/com/meutia/pizzaphd/Fragments/Jumlahtotal.java
ed59a59cbd3a4215cd73025f507bab3b00ee637d
[]
no_license
MeutiaKhanandiya/PizzaPHD
59638bf9bc15a68c81307e8e478ea6b0b042eddb
2c6f9eba60ddb34914cf4a069d28b217cca0a2cc
refs/heads/master
2020-08-13T12:13:38.153416
2019-10-14T06:39:10
2019-10-14T06:39:10
214,966,625
0
0
null
null
null
null
UTF-8
Java
false
false
1,061
java
package com.meutia.pizzaphd.Fragments; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.meutia.pizzaphd.Activities.OrderActivity; import com.meutia.pizzaphd.R; public class Jumlahtotal extends Fragment { View view; OrderActivity items; public Jumlahtotal() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment view = inflater.inflate(R.layout.fragment_jumlahtotal, container, false); TextView textView = (TextView) view.findViewById(R.id.textData); Bundle data = this.getArguments(); items = data.getParcelable("shop"); String dat = items.getNama()+" Total biaya anda "+items.getJumlah(); textView.setText(dat); return view; } }
fe5155b43fca7363045021344fda6a1047a207d3
d31881b6792fe82de31d61e69264657bcca84f59
/src/main/java/com/codnos/dbgp/api/SystemInfo.java
4c6527a67802e222d77466114e986c62a5f19b1f
[ "Apache-2.0" ]
permissive
Codnos/dbgp-interfaces
a8c95859e691f0f7c5e34d0a3911d1b2887b9e48
8d15f35e7496163aac41e8451e851a6847e1741d
refs/heads/master
2020-07-06T01:16:06.328163
2017-11-15T08:35:55
2017-11-15T08:35:55
73,971,568
1
0
null
null
null
null
UTF-8
Java
false
false
1,623
java
/* * Copyright 2016 Codnos Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.codnos.dbgp.api; public class SystemInfo { private final String appId; private final String ideKey; private final String session; private final String language; private final String protocolVersion; private final String fileUri; public SystemInfo(String appId, String ideKey, String session, String language, String protocolVersion, String fileUri) { this.appId = appId; this.ideKey = ideKey; this.session = session; this.language = language; this.protocolVersion = protocolVersion; this.fileUri = fileUri; } public String getAppId() { return this.appId; } public String getIdeKey() { return this.ideKey; } public String getSession() { return this.session; } public String getLanguage() { return this.language; } public String getProtocolVersion() { return this.protocolVersion; } public String getFileUri() { return this.fileUri; } }
698c471b847176baeee7b3257c6de02240fc6af5
519805101582e016dbe90a573ea75053b64e1877
/KullaniciServisi/src/com/vektorel/rest/Person.java
41b5fc2f4df94ff5eb717e2f6f938f2cb8a7b3ec
[]
no_license
OmerYILMAZ61/service
9de72032ce31c3c454aeda19e8d561055e852612
4d5913318abec161e9a35fd615f4f31357f1f94b
refs/heads/master
2021-01-22T08:02:37.383274
2017-05-27T13:16:26
2017-05-27T13:16:26
92,599,302
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package com.vektorel.rest; public class Person { int id; String name; public Person() { } public Person(int id, String name) { this.id = id; this.name = name; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "vektorel@lab8-4" ]
vektorel@lab8-4
6aac75879130f77b380fd240113c5c9eec71bfee
c8f6b4b4a643e9aeacecc50bebea7102cd4132e7
/Android/FunFace/FunFace/src/com/daimajia/slider/library/SliderTypes/BaseSliderView.java
17f994887b892c97d405bafa26c0e89d675a749c
[]
no_license
paulomcnally/visva
c475a5c166662f7a2ac05413aec01021582a226e
e7bbf0559ffd77f7abcb6ba96fae9606a6e4876c
refs/heads/master
2021-01-22T10:21:43.082568
2015-07-05T18:08:58
2015-07-05T18:08:58
40,391,742
0
0
null
null
null
null
UTF-8
Java
false
false
8,376
java
package com.daimajia.slider.library.SliderTypes; import java.io.File; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import com.squareup.picasso.Callback; import com.squareup.picasso.Picasso; import com.squareup.picasso.RequestCreator; import com.visva.android.app.funface.R; /** * When you want to make your own slider view, you must extends from this class. * BaseSliderView provides some useful methods. * I provide two example: {@link com.daimajia.slider.library.SliderTypes.DefaultSliderView} and * {@link com.daimajia.slider.library.SliderTypes.TextSliderView} * if you want to show progressbar, you just need to set a progressbar id as @+id/loading_bar. */ public abstract class BaseSliderView { protected Context mContext; private Bundle mBundle; /** * Error place holder image. */ private int mErrorPlaceHolderRes; /** * Empty imageView placeholder. */ private int mEmptyPlaceHolderRes; private String mUrl; private File mFile; private int mRes; protected OnSliderClickListener mOnSliderClickListener; private boolean mErrorDisappear; private ImageLoadListener mLoadListener; private String mDescription; private Picasso mPicasso; /** * Scale type of the image. */ private ScaleType mScaleType = ScaleType.Fit; public enum ScaleType{ CenterCrop, CenterInside, Fit, FitCenterCrop } protected BaseSliderView(Context context) { mContext = context; } /** * the placeholder image when loading image from url or file. * @param resId Image resource id * @return */ public BaseSliderView empty(int resId){ mEmptyPlaceHolderRes = resId; return this; } /** * determine whether remove the image which failed to download or load from file * @param disappear * @return */ public BaseSliderView errorDisappear(boolean disappear){ mErrorDisappear = disappear; return this; } /** * if you set errorDisappear false, this will set a error placeholder image. * @param resId image resource id * @return */ public BaseSliderView error(int resId){ mErrorPlaceHolderRes = resId; return this; } /** * the description of a slider image. * @param description * @return */ public BaseSliderView description(String description){ mDescription = description; return this; } /** * set a url as a image that preparing to load * @param url * @return */ public BaseSliderView image(String url){ if(mFile != null || mRes != 0){ throw new IllegalStateException("Call multi image function," + "you only have permission to call it once"); } mUrl = url; return this; } /** * set a file as a image that will to load * @param file * @return */ public BaseSliderView image(File file){ if(mUrl != null || mRes != 0){ throw new IllegalStateException("Call multi image function," + "you only have permission to call it once"); } mFile = file; return this; } public BaseSliderView image(int res){ if(mUrl != null || mFile != null){ throw new IllegalStateException("Call multi image function," + "you only have permission to call it once"); } mRes = res; return this; } /** * lets users add a bundle of additional information * @param bundle * @return */ public BaseSliderView bundle(Bundle bundle){ mBundle = bundle; return this; } public String getUrl(){ return mUrl; } public boolean isErrorDisappear(){ return mErrorDisappear; } public int getEmpty(){ return mEmptyPlaceHolderRes; } public int getError(){ return mErrorPlaceHolderRes; } public String getDescription(){ return mDescription; } public Context getContext(){ return mContext; } /** * set a slider image click listener * @param l * @return */ public BaseSliderView setOnSliderClickListener(OnSliderClickListener l){ mOnSliderClickListener = l; return this; } /** * When you want to implement your own slider view, please call this method in the end in `getView()` method * @param v the whole view * @param targetImageView where to place image */ protected void bindEventAndShow(final View v, ImageView targetImageView){ final BaseSliderView me = this; v.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(mOnSliderClickListener != null){ mOnSliderClickListener.onSliderClick(me); } } }); if (targetImageView == null) return; if (mLoadListener != null) { mLoadListener.onStart(me); } Picasso p = (mPicasso != null) ? mPicasso : Picasso.with(mContext); RequestCreator rq = null; if(mUrl!=null){ rq = p.load(mUrl); }else if(mFile != null){ rq = p.load(mFile); }else if(mRes != 0){ rq = p.load(mRes); }else{ return; } if(rq == null){ return; } if(getEmpty() != 0){ rq.placeholder(getEmpty()); } if(getError() != 0){ rq.error(getError()); } switch (mScaleType){ case Fit: rq.fit(); break; case CenterCrop: rq.fit().centerCrop(); break; case CenterInside: rq.fit().centerInside(); break; } rq.into(targetImageView,new Callback() { @Override public void onSuccess() { if(v.findViewById(R.id.loading_bar) != null){ v.findViewById(R.id.loading_bar).setVisibility(View.INVISIBLE); } } @Override public void onError() { if(mLoadListener != null){ mLoadListener.onEnd(false,me); } if(v.findViewById(R.id.loading_bar) != null){ v.findViewById(R.id.loading_bar).setVisibility(View.INVISIBLE); } } }); } public BaseSliderView setScaleType(ScaleType type){ mScaleType = type; return this; } public ScaleType getScaleType(){ return mScaleType; } /** * the extended class have to implement getView(), which is called by the adapter, * every extended class response to render their own view. * @return */ public abstract View getView(); /** * set a listener to get a message , if load error. * @param l */ public void setOnImageLoadListener(ImageLoadListener l){ mLoadListener = l; } public interface OnSliderClickListener { public void onSliderClick(BaseSliderView slider); } /** * when you have some extra information, please put it in this bundle. * @return */ public Bundle getBundle(){ return mBundle; } public interface ImageLoadListener{ public void onStart(BaseSliderView target); public void onEnd(boolean result,BaseSliderView target); } /** * Get the last instance set via setPicasso(), or null if no user provided instance was set * * @return The current user-provided Picasso instance, or null if none */ public Picasso getPicasso() { return mPicasso; } /** * Provide a Picasso instance to use when loading pictures, this is useful if you have a * particular HTTP cache you would like to share. * * @param picasso The Picasso instance to use, may be null to let the system use the default * instance */ public void setPicasso(Picasso picasso) { mPicasso = picasso; } }
fe233a57d74b74df0ad7d4e6c790041353d07c97
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.minihd.qq/assets/exlibs.1.jar/classes.jar/mbq.java
a4eec41bf25bd6ee0ca08b11613a170786094d03
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
4,834
java
import android.database.Cursor; import android.os.Parcel; import com.tencent.qphone.base.util.QLog; import cooperation.qzone.model.CoverCacheData; import cooperation.qzone.model.CoverCacheData.GameCoverInfo; import cooperation.qzone.model.CoverCacheData.PackageInfo; import cooperation.qzone.model.DbCacheData.DbCreator; import cooperation.qzone.model.DbCacheData.Structure; public final class mbq implements DbCacheData.DbCreator { public int a() { return 9; } public CoverCacheData a(Cursor paramCursor) { CoverCacheData localCoverCacheData = new CoverCacheData(); localCoverCacheData.uin = paramCursor.getLong(paramCursor.getColumnIndex("uin")); localCoverCacheData.coverId = paramCursor.getString(paramCursor.getColumnIndex("coverId")); localCoverCacheData.type = paramCursor.getString(paramCursor.getColumnIndex("type")); localCoverCacheData.local_url = paramCursor.getString(paramCursor.getColumnIndex("local_url")); localCoverCacheData.isJigsawOpen = paramCursor.getInt(paramCursor.getColumnIndex("jigsaw")); Object localObject = paramCursor.getBlob(paramCursor.getColumnIndex("urls")); try { localParcel = Parcel.obtain(); localParcel.unmarshall((byte[])localObject, 0, localObject.length); localParcel.setDataPosition(0); localCoverCacheData.urls = localParcel.readHashMap(getClass().getClassLoader()); localParcel.recycle(); localObject = paramCursor.getBlob(paramCursor.getColumnIndex("package_info")); } catch (Exception localException3) { try { localParcel = Parcel.obtain(); localParcel.unmarshall((byte[])localObject, 0, localObject.length); localParcel.setDataPosition(0); localCoverCacheData.packageInfo = ((CoverCacheData.PackageInfo)localParcel.readParcelable(getClass().getClassLoader())); localParcel.recycle(); localObject = paramCursor.getBlob(paramCursor.getColumnIndex("game_cover_info")); } catch (Exception localException3) { try { Parcel localParcel = Parcel.obtain(); localParcel.unmarshall((byte[])localObject, 0, localObject.length); localParcel.setDataPosition(0); localCoverCacheData.gameCoverInfo = ((CoverCacheData.GameCoverInfo)localParcel.readParcelable(getClass().getClassLoader())); localParcel.recycle(); paramCursor = paramCursor.getBlob(paramCursor.getColumnIndex("photo_wall")); } catch (Exception localException3) { try { do { for (;;) { localObject = Parcel.obtain(); ((Parcel)localObject).unmarshall(paramCursor, 0, paramCursor.length); ((Parcel)localObject).setDataPosition(0); localCoverCacheData.photoWall = ((Parcel)localObject).readArrayList(getClass().getClassLoader()); ((Parcel)localObject).recycle(); return localCoverCacheData; localException1 = localException1; if (QLog.isColorLevel()) { QLog.e("CoverCacheData", 2, "failed to read cover.urls:", localException1); continue; localException2 = localException2; if (QLog.isColorLevel()) { QLog.e("CoverCacheData", 2, "failed to read cover.packageInfo:", localException2); } } } localException3 = localException3; } while (!QLog.isColorLevel()); QLog.e("CoverCacheData", 2, "failed to read cover.gameCoverInfo:", localException3); } catch (Exception paramCursor) { while (!QLog.isColorLevel()) {} QLog.e("CoverCacheData", 2, "failed to read cover.photoWall:", paramCursor); } } } } return localCoverCacheData; } public String a() { return null; } public DbCacheData.Structure[] a() { return new DbCacheData.Structure[] { new DbCacheData.Structure("uin", "INTEGER"), new DbCacheData.Structure("coverId", "TEXT"), new DbCacheData.Structure("type", "TEXT"), new DbCacheData.Structure("local_url", "TEXT"), new DbCacheData.Structure("urls", "BLOB"), new DbCacheData.Structure("package_info", "BLOB"), new DbCacheData.Structure("game_cover_info", "BLOB"), new DbCacheData.Structure("photo_wall", "BLOB"), new DbCacheData.Structure("jigsaw", "INTEGER") }; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.1.jar\classes.jar * Qualified Name: mbq * JD-Core Version: 0.7.0.1 */
9e05df2c55731ab9ec6017d5f089f4c563e079b2
ac0e385c8fef7ba14fa67546a122ba969843462c
/app/src/main/java/com/example/util/CommonUtil.java
b586d9fa4664595c5b91cda36ca132f8fa884d9b
[]
no_license
luqx3/OLLY
3a64395d401b7a9f1a41086557faecc28cfc09bc
a728e07b20bfa1c05bb95ccfcc6757c357b9f513
refs/heads/master
2021-01-20T00:33:42.448819
2017-04-23T14:44:49
2017-04-23T14:44:49
89,148,826
0
0
null
null
null
null
UTF-8
Java
false
false
2,262
java
package com.example.util; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Environment; import android.view.Display; import android.view.WindowManager; import android.widget.Toast; /** * Created by HP on 2016/12/16. */ public class CommonUtil { private static final CommonLog log = LogFactory.createLog(); public static boolean hasSDCard() { String status = Environment.getExternalStorageState(); if (!status.equals(Environment.MEDIA_MOUNTED)) { return false; } return true; } public static String getRootFilePath() { if (hasSDCard()) { return Environment.getExternalStorageDirectory().getAbsolutePath() + "/";// filePath:/sdcard/ } else { return Environment.getDataDirectory().getAbsolutePath() + "/data/"; // filePath: /data/data/ } } public static boolean checkNetState(Context context){ boolean netstate = false; ConnectivityManager connectivity = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); if(connectivity != null) { NetworkInfo[] info = connectivity.getAllNetworkInfo(); if (info != null) { for (int i = 0; i < info.length; i++) { if (info[i].getState() == NetworkInfo.State.CONNECTED) { netstate = true; break; } } } } return netstate; } public static void showToask(Context context, String tip){ Toast.makeText(context, tip, Toast.LENGTH_SHORT).show(); } public static int getScreenWidth(Context context) { WindowManager manager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); return display.getWidth(); } public static int getScreenHeight(Context context) { WindowManager manager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); return display.getHeight(); } }
914e2b6584c535ff37bd9f33800f0f473de6e790
74e8c7369e980925e4054b536bef3b1d89cb5b09
/src/test/java/com/harcyah/kata/codingbat/recursion1/countX/CountXTest.java
aa70762e13c905d7cdab942483110aa483996073
[]
no_license
ninaParis/code-kata-java
c649aebb5c6b80a564ee2d196ec7d7eaa890ea90
9db16627818a03554dee99cd2158d1dc9c7c2bc6
refs/heads/master
2023-08-24T02:22:26.123973
2021-10-14T17:53:41
2021-10-14T17:53:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
816
java
package com.harcyah.kata.codingbat.recursion1.countX; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; public class CountXTest { @Test public void testCountX() { CountX countX = new CountX(); assertThat(countX.countX("xxhixx")) .isEqualTo(4); assertThat(countX.countX("xhixhix")) .isEqualTo(3); assertThat(countX.countX("hi")) .isEqualTo(0); assertThat(countX.countX("h")) .isEqualTo(0); assertThat(countX.countX("x")) .isEqualTo(1); assertThat(countX.countX("")) .isEqualTo(0); assertThat(countX.countX("hihi")) .isEqualTo(0); assertThat(countX.countX("hiAAhi12hi")) .isEqualTo(0); } }
491ae4455f14e028f05583a4399c343dcb82633e
3212993261e85a755aa55ef7c7add46064feb045
/src/GUI/ChooseAgents.java
d9f1eb6cb891f04be925d1e1a25ff70d83964506
[]
no_license
ye7ia10/RiskGame_AI
e357ff654cbe7042620697378f62175f63606176
94f37c2c5f221803c070a2d9db85e6e72197f1ef
refs/heads/master
2023-02-23T20:12:27.363387
2021-01-21T18:50:16
2021-01-21T18:50:16
331,722,952
0
0
null
null
null
null
UTF-8
Java
false
false
8,391
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package GUI; import agents.AStarPlayer; import agents.Agent; import agents.AggressivePlayer; import agents.GreedyPlayer; import agents.HumanPlayer; import agents.MinMaxPlayer; import agents.PacifistPlayer; import agents.PassivePlayer; import agents.RealTimeAstartPlayer; import java.awt.Color; import riskgame.GamePlay; /** * * @author mostafanabil198 */ public class ChooseAgents extends javax.swing.JFrame { int play; boolean egypt; /** * Creates new form ChooseAgents */ public ChooseAgents() { initComponents(); } public ChooseAgents(int play, boolean egypt) { initComponents(); this.play = play; this.egypt = egypt; if(play == 1){ player1lbl.setText("Choose Oppenent"); player2panel.setVisible(false); } else if(play == 2) { player1lbl.setText("Choose Player 1"); player2lbl.setText("Choose Player 2"); } } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); player2panel = new javax.swing.JPanel(); player2lbl = new javax.swing.JLabel(); player2select = new javax.swing.JComboBox<String>(); player1panel = new javax.swing.JPanel(); player1lbl = new javax.swing.JLabel(); player1select = new javax.swing.JComboBox<String>(); jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setPreferredSize(new java.awt.Dimension(950, 600)); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel1.setFont(new java.awt.Font("Ubuntu", 1, 40)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 0, 0)); jLabel1.setText("RISK GAME"); getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 20, -1, -1)); player2panel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); player2lbl.setFont(new java.awt.Font("Ubuntu", 1, 30)); // NOI18N player2lbl.setText("Choose Player"); player2panel.add(player2lbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, -1, -1)); player2select.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "A* Agent", "Passive Agent", "Aggressive Agent", "Nearly Pacifist Agent", "Greedy Agent", "Realtime A* Agent", "Minimax Agent" })); player2panel.add(player2select, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 80, 264, -1)); getContentPane().add(player2panel, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 250, 660, 200)); player1panel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); player1lbl.setFont(new java.awt.Font("Ubuntu", 1, 30)); // NOI18N player1lbl.setText("Choose Player"); player1panel.add(player1lbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, -1, -1)); player1select.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Aggressive Agent", "Passive Agent", "Nearly Pacifist Agent", "Greedy Agent", "A* Agent", "Realtime A* Agent", "Minimax Agent" })); player1panel.add(player1select, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 80, 264, -1)); getContentPane().add(player1panel, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 70, 760, 200)); jButton1.setFont(new java.awt.Font("Ubuntu", 1, 25)); // NOI18N jButton1.setText("Start Game"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 470, 200, 60)); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed Agent[] players = new Agent[2]; if(play == 1){ players[0] = new HumanPlayer(); players[1] = getAgent(player1select.getSelectedItem().toString()); } else if(play == 2) { players[0] = getAgent(player1select.getSelectedItem().toString()); players[1] = getAgent(player2select.getSelectedItem().toString()); } players[0].setColor(Color.ORANGE); players[1].setColor(Color.cyan); GamePlay.getInstance().setPlayers(players); GamePlay.getInstance().assignTerritories(); this.setVisible(false); if(egypt){ EgyptMap frame = new EgyptMap(play); frame.setVisible(true); frame.setLocationRelativeTo(null); }else{ USMap frame = new USMap(play); frame.setVisible(true); frame.setLocationRelativeTo(null); } }//GEN-LAST:event_jButton1ActionPerformed private Agent getAgent(String agentName){ Agent agent = null; switch(agentName){ case "Passive Agent": agent = new PassivePlayer(); break; case "Aggressive Agent": agent = new AggressivePlayer(); break; case "Nearly Pacifist Agent": agent = new PacifistPlayer(); break; case "Greedy Agent": agent = new GreedyPlayer(); break; case "A* Agent": agent = new AStarPlayer(); break; case "Realtime A* Agent": agent = new RealTimeAstartPlayer(); break; case "Minimax Agent": agent = new MinMaxPlayer(); break; } return agent; } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(ChooseAgents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(ChooseAgents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(ChooseAgents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(ChooseAgents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ChooseAgents().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel player1lbl; private javax.swing.JPanel player1panel; private javax.swing.JComboBox<String> player1select; private javax.swing.JLabel player2lbl; private javax.swing.JPanel player2panel; private javax.swing.JComboBox<String> player2select; // End of variables declaration//GEN-END:variables }
134631c73b162a1f32e7f4da7b31f1d93b66cfc0
632c0f23e02f621c8bae083b93b596e088591e11
/app/src/main/java/hartigo/mobilearn/WelcomeActivity.java
00bf0b1b812a3f7711a507649743bc5c9976df11
[]
no_license
ammar-javed/MobiLearn
a6dea81270b0ba40a619e42590bb472acff2af6a
a91b3f6532eafd31b27a188b6924d9ebb6508a8b
refs/heads/master
2016-09-06T12:47:06.949876
2014-11-24T04:58:34
2014-11-24T04:58:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,652
java
package hartigo.mobilearn; import android.app.Activity; import android.app.ActionBar; import android.app.Fragment; import android.app.FragmentManager; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.view.Gravity; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.support.v4.widget.DrawerLayout; import android.widget.ArrayAdapter; import android.widget.TextView; public class WelcomeActivity extends Activity implements NavigationDrawerFragment.NavigationDrawerCallbacks { /** * Fragment managing the behaviors, interactions and presentation of the navigation drawer. */ private NavigationDrawerFragment mNavigationDrawerFragment; /** * Used to store the last screen title. For use in {@link #restoreActionBar()}. */ private CharSequence mTitle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_welcome); mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer); mTitle = getTitle(); // Set up the drawer. mNavigationDrawerFragment.setUp( R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout)); } @Override public void onNavigationDrawerItemSelected(int position) { // update the main content by replacing fragments FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); } public void onSectionAttached(int number) { switch (number) { case 1: mTitle = getString(R.string.insert_sort); break; } } public void restoreActionBar() { ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setDisplayShowTitleEnabled(true); actionBar.setTitle(mTitle); } @Override public boolean onCreateOptionsMenu(Menu menu) { if (!mNavigationDrawerFragment.isDrawerOpen()) { // Only show items in the action bar relevant to this screen // if the drawer is not showing. Otherwise, let the drawer // decide what to show in the action bar. getMenuInflater().inflate(R.menu.welcome, menu); restoreActionBar(); return true; } return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } /** * A placeholder fragment containing a simple view. */ public static class PlaceholderFragment extends Fragment { /** * The fragment argument representing the section number for this * fragment. */ private static final String ARG_SECTION_NUMBER = "section_number"; /** * Returns a new instance of this fragment for the given section * number. */ public static PlaceholderFragment newInstance(int sectionNumber) { PlaceholderFragment fragment = new PlaceholderFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); fragment.setArguments(args); return fragment; } public PlaceholderFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_welcome, container, false); return rootView; } @Override public void onAttach(Activity activity) { super.onAttach(activity); ((WelcomeActivity) activity).onSectionAttached( getArguments().getInt(ARG_SECTION_NUMBER)); } } }
e7de17f2d0eea76ec690f0689db92cd9bc34b227
48c84d2445bb4370493ecde74b744165a7eab243
/apps/agent/src/main/java/com/fix/agent/utils/FilePathUtils.java
9fa8be8fceb47e93e10c32bafad1502d9e63ee7b
[ "MIT" ]
permissive
OElabed/vagrant-development-tools
f54e0f2a10e963f54594635a60da8f0759c6d932
38a3ad3e99cad5dc037f74d04b5c09562607656e
refs/heads/master
2021-09-20T23:46:43.987162
2018-08-16T23:09:04
2018-08-16T23:09:46
104,942,000
0
0
null
null
null
null
UTF-8
Java
false
false
829
java
package com.fix.agent.utils; import java.net.URL; import java.nio.file.Paths; /** * Created by OELABED on 08/10/2017. */ public class FilePathUtils { public static String getPathFromResource(String relativePath) { URL urlFile = Thread.currentThread().getContextClassLoader().getResource(relativePath); return urlFile.getPath(); } public static String getTailFilePath(String basePath, String tailFolderName, String tailName) { return Paths.get(basePath, tailFolderName, tailName).toString(); } public static String getFolderPath(String basePath, String moduleName) { return Paths.get(basePath, moduleName).toString(); } public static String concatenatePath(String directory , String filename) { return Paths.get(directory, filename).toString(); } }
220abccade6a10e38b26defc9ab11361e8919d90
b1eee7989acdad29096ef323a7609b5af2828792
/AppDyC/DaoDyC/src/main/java/mx/gob/sat/siat/dyc/util/excepcion/DycDaoExcepcion.java
f30241cd85ac96452b3b8b8158fa3649248a0671
[]
no_license
xtaticzero/AppDyC
2185e5d25840ddbb73d0de6c6c0d61a497a6cdfa
1562a358558323ef6adb84fb0e70ba7560200bda
refs/heads/master
2021-09-09T21:50:41.930101
2018-03-19T21:38:45
2018-03-19T21:38:45
73,757,634
1
0
null
null
null
null
UTF-8
Java
false
false
1,536
java
/* * Todos los Derechos Reservados 2016 SAT. * Servicio de Administracion Tributaria (SAT). * * Este software contiene informacion propiedad exclusiva del SAT considerada * Confidencial. Queda totalmente prohibido su uso o divulgacion en forma. */ package mx.gob.sat.siat.dyc.util.excepcion; import java.util.List; import mx.gob.sat.siat.dyc.util.constante.IDycCodigoError; import mx.gob.sat.siat.dyc.util.recurso.DycLogUtil; import mx.gob.sat.siat.dyc.vo.DycLogEstadoVariable; /** * * @author GAER8674 */ public class DycDaoExcepcion extends DycBaseExcepcion{ public DycDaoExcepcion(IDycCodigoError codigoError, List<DycLogEstadoVariable> estadoVariables) { super(codigoError.getDescripcion()+DycLogUtil.generarMsgEstadoVariables(estadoVariables)); this.setCodigoError(codigoError); this.setEstadoVariables(estadoVariables); } public DycDaoExcepcion(IDycCodigoError codigoError, List<DycLogEstadoVariable> estadoVariables, Throwable cause) { super(codigoError.getDescripcion()+DycLogUtil.generarMsgEstadoVariables(estadoVariables), cause); this.setCodigoError(codigoError); this.setEstadoVariables(estadoVariables); } public DycDaoExcepcion(IDycCodigoError codigoError, List<DycLogEstadoVariable> estadoVariables, DycBaseExcepcion cause) { super(codigoError.getDescripcion()+DycLogUtil.generarMsgEstadoVariables(estadoVariables), cause); this.setCodigoError(codigoError); this.setEstadoVariables(estadoVariables); } }
6eb1ce950714bb358822862ff84436891ad240ac
c49397b38260183aa16ff567644bc9e73a07e94f
/src/com/itamar/smartStopLights/training.java
c31f952dc2c0e5c563ca28f4593e4784a610b632
[]
no_license
itamar-t/SmartStopLights
d564c652ebe30f5bad88d189f6bff21e20fa3520
d07d43d0ec3e5810d9b1aa3fbaf4efcc46872df6
refs/heads/master
2021-01-16T22:05:35.181508
2016-07-27T12:52:34
2016-07-27T12:52:34
64,300,113
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package com.itamar.smartStopLights; import java.text.SimpleDateFormat; import java.util.Date; public class training { public static void main(String[] args){ Date dNow = new Date( ); SimpleDateFormat ft = new SimpleDateFormat ("yyyy/MM/dd 'at' HH:mm:ss zzz"); System.out.println("Current Date: " + ft.format(dNow)); } }
758c90734252f71a1a0783a21172e215fe8b6a3e
c13d59b58e579d90c280580e2a3484c4607b608c
/src/test/java/org/adactlocator/AdactHotelLoginPage.java
2aa9f33094a7c7a20dc9807b9fe4a160b387c680
[]
no_license
chitraselvam/MyFirstGitRepo
6b26f890314196f9caf8c2c10993e9d93bc21fbb
169117ad3c9130dd0a8d8b29655d2e4f643d9533
refs/heads/master
2023-06-24T15:32:55.093907
2021-07-26T02:38:06
2021-07-26T02:38:06
389,338,475
0
0
null
null
null
null
UTF-8
Java
false
false
681
java
package org.adactlocator; import org.base.LibGlobal; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class AdactHotelLoginPage extends LibGlobal { public AdactHotelLoginPage() { PageFactory.initElements(driver, this); } @FindBy(id="username") private WebElement txtUserName; @FindBy(id="password") private WebElement txtPassword; @FindBy(id="login") private WebElement btnLogin; public WebElement getTxtUserName() { return txtUserName; } public WebElement getTxtPassword() { return txtPassword; } public WebElement getBtnLogin() { return btnLogin; } }
47139ee3617119a1f6041626f8dbf738a949b33c
d00af6c547e629983ff777abe35fc9c36b3b2371
/jboss-all/testsuite/src/main/org/jboss/test/exception/ExceptionTesterLocal.java
df52d5323e4de64718a5554cf7011ad75799d7fd
[]
no_license
aosm/JBoss
e4afad3e0d6a50685a55a45209e99e7a92f974ea
75a042bd25dd995392f3dbc05ddf4bbf9bdc8cd7
refs/heads/master
2023-07-08T21:50:23.795023
2013-03-20T07:43:51
2013-03-20T07:43:51
8,898,416
1
1
null
null
null
null
UTF-8
Java
false
false
729
java
package org.jboss.test.exception; import javax.ejb.EJBLocalObject; import javax.ejb.FinderException; public interface ExceptionTesterLocal extends EJBLocalObject { public void applicationExceptionInTx() throws ApplicationException; public void applicationErrorInTx(); public void ejbExceptionInTx(); public void runtimeExceptionInTx(); public void applicationExceptionNewTx() throws ApplicationException; public void applicationErrorNewTx(); public void ejbExceptionNewTx(); public void runtimeExceptionNewTx(); public void applicationExceptionNoTx() throws ApplicationException; public void applicationErrorNoTx(); public void ejbExceptionNoTx(); public void runtimeExceptionNoTx(); }
37bd2e5971b923d46d8ff118512bf78c3948db4a
6ac609f970abc3a5d97454076f03bca28bef3e5e
/src/main/java/proxy/dynamic/DynamicInvocationHandler.java
faa99642e28c29b4980497bcb0d06ca18724e3c6
[]
no_license
ykavi/design-pattern-learning
0f1b1310c5aa509bf0bc2533d606417c26ac85bc
8b82858e4333e09f5e153776e89ce1bc4dafaf37
refs/heads/master
2022-02-19T08:57:19.289684
2019-09-16T14:03:21
2019-09-16T14:03:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
306
java
package proxy.dynamic; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; public class DynamicInvocationHandler implements InvocationHandler { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return proxy; } }
4d92e02467465e9ff9dae0017521a1cd3f6e40f3
5a02342412dfeae1286b2a60082b3477427ed171
/HomeworkPlus/HomeworkPlus/src/com/meldrum/domain/shape/StandardQuestionWrapper.java
750205feabdd0b7961384d0966189692f5677df1
[]
no_license
SMeldrum08/HomeworkApp2
fec09983429347028d643edf57777e6d58f1cf34
a4389466fc9d2d69f27c3a6adc1b0b939d0ebd41
refs/heads/master
2020-04-10T05:32:55.397303
2016-09-26T13:16:47
2016-09-26T13:16:47
68,004,129
0
0
null
null
null
null
UTF-8
Java
false
false
1,762
java
package com.meldrum.domain.shape; public class StandardQuestionWrapper { String questionNumber; String encodedQuestionImage; String notAccurate = "Diagram <b>NOT</b> accurately drawn"; String centralEquation; String[] preImageLines; String[] postImageLines; String answerBox; String answer; public String getQuestionNumber() { return questionNumber; } public void setQuestionNumber(String questionNumber) { this.questionNumber = questionNumber; } public String getEncodedQuestionImage() { return encodedQuestionImage; } public void setEncodedQuestionImage(String encodedQuestionImage) { this.encodedQuestionImage = encodedQuestionImage; } public String getNotAccurate() { return notAccurate; } public void setNotAccurate(String notAccurate) { this.notAccurate = notAccurate; } public String getCentralEquation() { return centralEquation; } public void setCentralEquation(String centralEquation) { this.centralEquation = centralEquation; } public String[] getPreImageLines() { return preImageLines; } public void setPreImageLines(String[] preImageLines) { this.preImageLines = preImageLines; } public String getAnswerBox() { return answerBox; } public void setAnswerBox(String answerBox) { this.answerBox = answerBox; } public String getAnswer() { return answer; } public void setAnswer(String answer) { this.answer = answer; } public String[] getPostImageLines() { return postImageLines; } public void setPostImageLines(String[] postImageLines) { this.postImageLines = postImageLines; } }
c1fec12bf9b39b266584ecc599dfde596124f54f
8d25cc9ec25dca93a22bd96fac2181e306fed89e
/H4/src/be/pxl/h4/exoef3/H4ExOef3.java
b09e1d652a7c1bb68f654b18ae03a7d8a04b7dd0
[]
no_license
DriesThoelen/Programming-Basics
bad06e51c207024e67993395a3b3368487484e88
e940b598c6f4f912aa69ec09e5aeb2c0a6215d82
refs/heads/master
2021-08-16T09:46:42.625642
2017-11-19T14:17:11
2017-11-19T14:17:11
111,301,577
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
package be.pxl.h4.exoef3; public class H4ExOef3 { public static void main(String[] args) { for (int count = 1; count < 101; count++) { int kwcount = count * count; System.out.printf("%10s%10s\n", count, kwcount); } } }
f1ed13a9ed2c28018f4ed948f721d219280117a9
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_3ac1002a13233c5fe3c05bc41377822862a52e46/Crawler/9_3ac1002a13233c5fe3c05bc41377822862a52e46_Crawler_s.java
9b12b6238af1c9e32d5478f85a673f31c6b11ac3
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,706
java
package model.http.crawler; import java.net.MalformedURLException; import java.net.URL; import java.util.HashSet; import java.util.Queue; import java.util.Set; import java.util.concurrent.LinkedBlockingQueue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import model.http.HttpGet; import model.http.crawler.extractorjoint.Extractor; import model.http.crawler.extractorjoint.ExtractorJoint; import model.http.crawler.persistentbuffer.PersistentBuffer; public class Crawler implements ICrawler { private static final Logger log = (Logger) LoggerFactory .getLogger(Crawler.class); private String crawlNamespace; private String dataNamespace; private Queue<URL> dataBuffer = new LinkedBlockingQueue<URL>(); private HttpGet httpCon; private PersistentBuffer crawlBuffer; private ExtractorJoint factory; public Crawler(PersistentBuffer model, ExtractorJoint factory2, String crawlNamespace, String dataNamespace) { init(factory2, model, httpCon, crawlNamespace, dataNamespace); } private void init(ExtractorJoint factory2, PersistentBuffer model, HttpGet httpCon, String crawlNamespace, String dataNamespace) { this.factory = factory2; this.httpCon = httpCon; this.crawlNamespace = crawlNamespace; this.dataNamespace = dataNamespace; this.crawlBuffer = model; } public String getDataNamespace() { return dataNamespace; } public String getCrawlNamespace() { return crawlNamespace; } /* (non-Javadoc) * @see model.http.crawler.ICrawler#getNext(int) */ public Set<URL> getNext(int count) { while (this.dataBuffer.size() < count && !this.crawlBuffer.isEmpty()) try { crawlNextURL(); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } Set<URL> urls = new HashSet<URL>(); while (urls.size() < count && !this.crawlBuffer.isEmpty()) urls.add(this.dataBuffer.poll()); return urls; } private void crawlNextURL() throws MalformedURLException { URL next = this.crawlBuffer.poll(); if(next != null) { log.debug("Crawling: " + next.toExternalForm()); Extractor<URL> extract = factory.create(next); Set<URL> links = extract.get(); for (URL link : links) { if (link.toExternalForm().matches(this.dataNamespace)) { log.debug("Found new data: " + link.toExternalForm()); this.dataBuffer.add(link); } else if (link.toExternalForm().matches(this.crawlNamespace)) { log.debug("Found new url to crawl: " + link.toExternalForm()); this.crawlBuffer.add(link); } } } } }
a151e585534c038c74083dd98e93663bd4a70e05
a122438cc2e02f4863c673680df2403f72a915ef
/src/main/java/GUI/CommandLine.java
c80f7c7b4b5e756b7f10a0ce4ce3a4eaea76b675
[]
no_license
Seacant/Battleship
fbd6f1faae54be1ab3513927e28e0924cd149db8
9ecb1b73e2205f99fc3c724aed6d9cb5e65d2a0e
refs/heads/master
2021-06-02T04:49:14.304491
2016-08-08T19:05:52
2016-08-08T19:05:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
670
java
package GUI; import java.util.*; import tech.tfletch.battleship.*; public class CommandLine extends GUI{ private Scanner s = new Scanner(System.in); public String promptUser(String question){ System.out.println(question+": "); if(!s.hasNextLine()){ System.err.println("Something is wrong with STDIN. I'm out"); System.exit(66); //EX_NOINPUT as defined by sysexits.h } return s.nextLine(); } public void draw(Object s){ System.out.println(s); } public void cls(){ // Default console size is 80x24, so 24 newlines will clear it. System.out.print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); } }
c42d2c5d79b503c5af1779ea3572f9ed74e738ad
1d520775a8e41b61f78fc8c720772a92562d562f
/src/main/java/rmugattarov/abstract_classes/override_abstract_class_methods/ConcreteClass.java
f6ef15c97530fba8669cbc9380ac27b4e0a3516d
[]
no_license
rmugattarov/test
7e0557e2221740f1bdc730d0ac9e83eb8e3118cd
e09d1359c8feef46bceb4982e1d76886daf7180a
refs/heads/master
2022-07-26T12:35:17.072481
2022-01-10T08:59:32
2022-01-10T08:59:32
48,986,565
0
0
null
2022-06-29T19:19:33
2016-01-04T09:17:18
Java
UTF-8
Java
false
false
361
java
package rmugattarov.abstract_classes.override_abstract_class_methods; /** * Created by rmugattarov on 04.10.2016. */ public class ConcreteClass extends AbstractClass { @Override public void printSmth() { System.out.println("ConcreteClass"); } public static void main(String[] args) { new ConcreteClass().printSmth(); } }
a5aa7a20f90081dd72987670dce1ae4ebc2091cb
8039a99ee2bdb0348d8f009b3ea1c303e80df258
/spring-jpa-relations/src/main/java/com/hmago/learn/spring/springjparelations/entity/Student.java
16571ba8f1e56af62e82c5e0b1291b2be193f1f2
[]
no_license
Hmago/hands-on-spring
1418946a500e11179cc70fd39500aea8173dd8b9
91210a3b4670d83fc7bf982dccae7bfdd85ee072
refs/heads/master
2020-11-25T00:47:51.843725
2020-06-20T11:08:18
2020-06-20T11:08:18
228,415,504
0
0
null
null
null
null
UTF-8
Java
false
false
477
java
package com.hmago.learn.spring.springjparelations.entity; import lombok.Builder; import lombok.Data; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.OneToMany; import java.util.Set; /** * @author harshit.mago */ @Entity @Data @Builder public class Student extends AbstractEntity { @Column(nullable = false) private String name; @OneToMany(mappedBy = "student") private Set<CourseStudentMapping> courseMapping; }
9f70ab81a502449f500806ccee5a9a6d381465d6
c04d30a6faaba0f57836b81a827f9fea1141497b
/app/src/main/java/cn/runvision/facedetect/SetServerIP.java
f3096782dddd2042a9cd0736261f10056eb239e0
[]
no_license
FZYdesign/FaceDetectToServer
191311bab4f0369642434b85eef946f24f30f592
5ead81759b2dd8f33c8bbdaa2b0d6f79a219680b
refs/heads/master
2021-05-12T07:09:42.742618
2016-12-07T07:45:21
2016-12-07T07:45:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,779
java
package cn.runvision.facedetect; import android.app.Activity; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.text.Editable; import android.view.Display; import android.view.Gravity; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.view.Window; import android.widget.Button; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.Toast; import cn.runvision.utils.FaceNative; public class SetServerIP extends Activity { EditText edit_svrip; EditText edit_port; Button bnt_setServer; Button bnt_return; private Thread newThread; //声明一个子线程 public static ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏 //getActionBar().setBackgroundDrawable(this.getResources().getDrawable(R.drawable.action_bar_bg)); setContentView(R.layout.activity_setsvr); bnt_setServer = (Button)findViewById(R.id.btn_setserverip); bnt_return = (Button)findViewById(R.id.btn_return); edit_svrip = (EditText)findViewById(R.id.edit_server_ip); edit_port = (EditText)findViewById(R.id.edit_port); SharedPreferences sharedPreferences = getSharedPreferences("serversettings", this.MODE_PRIVATE); String serverip = sharedPreferences.getString("serverip", "116.205.1.86"); int port = sharedPreferences.getInt("port", 32108); edit_svrip.setText(serverip); edit_port.setText(Integer.toString(port)); Editable ea = edit_svrip.getText(); edit_svrip.setSelection(ea.length()); progressBar=new ProgressBar(this,null,android.R.attr.progressBarStyleLarge); progressBar.setIndeterminateDrawable(getResources().getDrawable(R.drawable.progressbar)); Display currDisplay = getWindowManager().getDefaultDisplay();//获取屏幕当前分辨率 int round = currDisplay.getWidth()/4; int displayWidth = currDisplay.getWidth()/2 - round/2; int displayHeight = currDisplay.getHeight()/4 - round/2-5; addContentView(progressBar, new LayoutParams(round,round)); bnt_setServer.setWidth(round); bnt_return.setWidth(round); progressBar.setX(displayWidth); progressBar.setY(displayHeight); progressBar.setVisibility(View.INVISIBLE); } private Handler handler = new Handler() { Toast toast; boolean bSave; public void handleMessage(Message msg) { switch (msg.what) { case 1: SharedPreferences settings = getSharedPreferences("serversettings",SetServerIP.MODE_PRIVATE); Editor editor = settings.edit();//获取编辑器 editor.putString("serverip", edit_svrip.getText().toString()); editor.putInt("port", Integer.valueOf(edit_port.getText().toString())); bSave = editor.commit();//提交修改 //Toast.makeText(this, "参数保存成功!", //Toast.LENGTH_SHORT).show(); if(true == bSave) { toast= Toast.makeText(getApplicationContext(), "服务器设置成功!", Toast.LENGTH_SHORT); }else { toast= Toast.makeText(getApplicationContext(), "参数保存失败!", Toast.LENGTH_SHORT); } toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); break; case 2: toast= Toast.makeText(getApplicationContext(), "服务器ip设置失败,请联系管理员。", Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); break; } progressBar.setVisibility(View.INVISIBLE); bnt_setServer.setEnabled(true); super.handleMessage(msg); } }; public void set_return(View v) { SetServerIP.this.finish(); } public void set_Server(View v) { bnt_setServer.setEnabled(false); progressBar.setVisibility(View.VISIBLE); FaceNative.SetServerIP(edit_svrip.getText().toString().getBytes(), Integer.valueOf(edit_port.getText().toString()), 1); new Thread() { @Override public void run() { //这里写入子线程需要做的工作 //timeout 60s long start_time = System.currentTimeMillis()/1000; while(true) { if(FaceNative.getServerSockFlag() == 1) { Message message = new Message(); message.what = 1; handler.sendMessage(message); break; } if(System.currentTimeMillis()/1000 - start_time >= 30) { Message message = new Message(); message.what = 2; handler.sendMessage(message); break; } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }.start(); } }
0a33d1a2e3f78c15db290a29f4aa08bebfb437b7
7a651f59e07aef996c39b3990a9610c5e4ddf811
/e3-manager-web/src/main/java/cn/e3/manager/controller/PageController.java
323d874d110c88f573aba242107de3ae7ef4ff33
[]
no_license
itYuanWang/e3mall
6a6b088c867850ada6549cc5dd7bc654baf83f03
a187639bc86c962684a73073af7b58a04375aeb7
refs/heads/master
2021-08-23T20:53:54.409648
2017-12-06T13:54:21
2017-12-06T13:54:21
112,992,183
0
0
null
null
null
null
UTF-8
Java
false
false
364
java
package cn.e3.manager.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class PageController { @RequestMapping("{page}") public String showPage(@PathVariable String page){ return page; } }
48765e8cd0d935a3e297c5d43bcc3c1411d84e30
28553273411deb5626f487f2a0d8a847f928df40
/spring-demo-one/src/com/luv2code/springdemo/TrackCoach.java
b94309d61206ea39e452f5980f18d2dac4520f91
[]
no_license
tonikwater/spring_hibernate_course
a09192ffe8ead33a117f386b8a55a3d20ec7329f
ea4af48a79e32191c911edb436399f460324f87e
refs/heads/master
2023-06-27T15:19:39.265823
2021-08-02T20:48:40
2021-08-02T20:48:40
360,872,432
0
0
null
null
null
null
UTF-8
Java
false
false
862
java
package com.luv2code.springdemo; public class TrackCoach implements Coach { // define a private field for the dependency private FortuneService fortuneService; // define a constructor for dependency injection public TrackCoach(FortuneService theFortuneService) { fortuneService = theFortuneService; } @Override public String getDailyWorkout() { return "Run a hard 5k"; } @Override public String getDailyFortune() { // use my fortuneService to get a fortune return String.format("Track: %s", fortuneService.getFortune()); } // add an init method public void doMyStartupStuff() { System.out.println("TrackCoach: inside method doMyStartupStuff"); } // add a destroy method public void doMyCleanupStuff() { System.out.println("TrackCoach: inside method doMyCleanupStuff"); } }
e27fd6fb58c9b4cedebc94fe77543bb7683f1ec0
42e05ca369411e8fbcccb7a644476e63507ea06c
/src/Modelo/Ventas.java
811f2d9e3e735db480e628e41c7c5b8c16dcd466
[]
no_license
PabloR9080/TiendaVideojuegos
744bd714709bdc3dc84062007488d8a8563fd649
893ec387b7673ea5521f028f554ebbe2cdb69e43
refs/heads/master
2023-07-24T04:20:43.926315
2021-01-12T23:49:22
2021-01-12T23:49:22
329,155,721
1
0
null
2023-07-08T01:20:31
2021-01-13T01:08:29
null
UTF-8
Java
false
false
2,227
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Modelo; import java.util.ArrayList; /** * * @author lenin */ public class Ventas implements PorPagar{ private String folio; private String idCliente; private String matricula; private ArrayList<Producto> productos; private Fecha fecha; private Hora hora; public Ventas(String folio, String idCliente, String matricula, ArrayList<Producto> productos, Fecha fecha, Hora hora) { this.folio = folio; this.idCliente = idCliente; this.matricula = matricula; this.productos = productos; this.fecha = fecha; this.hora = hora; } public String getFolio() { return folio; } public void setFolio(String folio) { this.folio = folio; } public String getIdCliente() { return idCliente; } public void setIdCliente(String idCliente) { this.idCliente = idCliente; } public String getMatricula() { return matricula; } public void setMatricula(String matricula) { this.matricula = matricula; } public ArrayList<Producto> getProductos() { return productos; } public void setProductos(ArrayList<Producto> productos) { this.productos = productos; } public Fecha getFecha() { return fecha; } public void setFecha(Fecha fecha) { this.fecha = fecha; } public Hora getHora() { return hora; } public void setHora(Hora hora) { this.hora = hora; } @Override public double obtenerMontoPago() { double total = 0.0; for(int i = 0; i < productos.size(); i++){ total = total + productos.get(i).getPrecio()*productos.get(i).getCantComprar(); } return total; } @Override public String toString() { return "Folio: " + getFolio() + ", idCliente: " + getIdCliente() + ", matricula: " + getMatricula() + ", productos: " + getProductos() + ", fecha: " + getFecha() + ", hora: " + getHora(); } }
dab185f77b8a5c9788f6f73853c265adbec6bf46
df12a758dbdd3ac81aaa0330cf7b32a4f130d0f4
/Work3/HW/src/main/java/HW4_Andrey/Main.java
4b8a67be2ec5aeec769dc97ecad2a652551fbb0c
[]
no_license
Tati1909/Java3
8780944b680ee74487a675f5fa55c8b4709294c4
fb2f337ffecd5dcd05d1ede0879762315dcb58a9
refs/heads/master
2023-04-08T08:26:41.256158
2021-03-26T10:23:46
2021-03-26T10:23:46
347,349,965
0
0
null
2021-03-29T11:38:03
2021-03-13T11:19:38
Java
UTF-8
Java
false
false
1,940
java
package HW4_Andrey; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class Main { private static final Object key = new Object(); private static volatile char curChar = 'A'; public static void main(String[] args) { ExecutorService executorService = Executors.newFixedThreadPool(3); executorService.submit(() -> { try { for (int i = 0; i < 5; i++) { synchronized (key) { while (curChar != 'A') { key.wait(); } System.out.print('A'); curChar = 'B'; key.notifyAll(); } } } catch (Exception ex) { ex.printStackTrace(); } }); executorService.submit(() -> { try { for (int i = 0; i < 5; i++) { synchronized (key) { while (curChar != 'B') { key.wait(); } System.out.print('B'); curChar = 'C'; key.notifyAll(); } } } catch (Exception ex) { ex.printStackTrace(); } }); executorService.submit(() -> { try { for (int i = 0; i < 5; i++) { synchronized (key) { while (curChar != 'C') { key.wait(); } System.out.print('C'); curChar = 'A'; key.notifyAll(); } } } catch (Exception ex) { ex.printStackTrace(); } }); } }
a6bca5fe8fecb44ba8e9224766b3263349f1ab75
f9c73b1f38fa5cb37c6468d7c40def8d80ecca89
/src/com/googlecode/totallylazy/callables/CountingCallable1.java
d70a6b18bc79905ffe5e3d7e8e5fe316713413fc
[]
no_license
danielbodart/totallylazy
884a642667b74444ac1fc3b30446e6e99066f0d5
0e3bb3d2086911d9492a73e3af37e66bbc7bbbc7
refs/heads/master
2020-12-31T07:11:01.498214
2015-05-15T11:12:32
2015-05-15T11:12:32
35,155,042
1
0
null
2015-05-06T11:12:10
2015-05-06T11:12:09
null
UTF-8
Java
false
false
933
java
package com.googlecode.totallylazy.callables; import com.googlecode.totallylazy.Callable1; import com.googlecode.totallylazy.Function1; import java.util.HashMap; import java.util.Map; public final class CountingCallable1<T,R> extends Function1<T,R> { private final Map<T, Integer> count = new HashMap<T, Integer>(); private final Callable1<? super T, ? extends R> callable; private CountingCallable1(Callable1<? super T, ? extends R> callable) { this.callable = callable; } public final R call(T t) throws Exception { count.put(t, count(t) + 1); return callable.call(t); } public final int count(T t) { if(!count.containsKey(t)){ count.put(t, 0); } return count.get(t); } public static <T,R> CountingCallable1<T,R> counting(Callable1<? super T,? extends R> callable) { return new CountingCallable1<T,R>(callable); } }
fc9a73282263dec7e37e8e0425981bd6637c5739
855862d70f4eb1f0bb5643c41f5bd1e48f5c73b0
/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/augments/ns/vld/norev/deviated/constituent/cpd/id/ConstituentCpdIdBuilder.java
b2ddaa9dd533c0f8a1909cd345fff5284470b921
[]
no_license
openslice/io.openslice.sol005nbi.osm10
547c407ce2fd0d39753bce6ad24df1fa7144fe21
7ce7638d8ebba962fe0329e0a181b7d54d464ca7
refs/heads/develop
2023-08-31T05:46:54.627867
2023-08-25T07:02:41
2023-08-25T07:02:41
403,761,611
0
1
null
2023-08-25T07:02:42
2021-09-06T21:22:06
Java
UTF-8
Java
false
false
11,484
java
package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.augments.ns.vld.norev.deviated.constituent.cpd.id; import com.google.common.base.MoreObjects; import java.lang.Class; import java.lang.Deprecated; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; import org.opendaylight.yangtools.yang.binding.Augmentation; import org.opendaylight.yangtools.yang.binding.AugmentationHolder; import org.opendaylight.yangtools.yang.binding.CodeHelpers; import org.opendaylight.yangtools.yang.binding.DataObject; /** * Class that builds {@link ConstituentCpdIdBuilder} instances. Overall design of the class is that of a * <a href="https://en.wikipedia.org/wiki/Fluent_interface">fluent interface</a>, where method chaining is used. * * <p> * In general, this class is supposed to be used like this template: * <pre> * <code> * ConstituentCpdIdBuilder createTarget(int fooXyzzy, int barBaz) { * return new ConstituentCpdIdBuilderBuilder() * .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build()) * .setBar(new BarBuilder().setBaz(barBaz).build()) * .build(); * } * </code> * </pre> * * <p> * This pattern is supported by the immutable nature of ConstituentCpdIdBuilder, as instances can be freely passed around without * worrying about synchronization issues. * * <p> * As a side note: method chaining results in: * <ul> * <li>very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is * on the stack, so further method invocations just need to fill method arguments for the next method * invocation, which is terminated by {@link #build()}, which is then returned from the method</li> * <li>better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is * very localized</li> * <li>better optimization oportunities, as the object scope is minimized in terms of invocation (rather than * method) stack, making <a href="https://en.wikipedia.org/wiki/Escape_analysis">escape analysis</a> a lot * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely * eliminated</li> * </ul> * * @see ConstituentCpdIdBuilder * @see Builder * */ public class ConstituentCpdIdBuilder implements Builder<ConstituentCpdId> { private Object _constituentBaseElementId; private Object _constituentCpdId; private IpAddress _ipAddress; private ConstituentCpdIdKey key; Map<Class<? extends Augmentation<ConstituentCpdId>>, Augmentation<ConstituentCpdId>> augmentation = Collections.emptyMap(); public ConstituentCpdIdBuilder() { } public ConstituentCpdIdBuilder(ConstituentCpdId base) { if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") Map<Class<? extends Augmentation<ConstituentCpdId>>, Augmentation<ConstituentCpdId>> aug =((AugmentationHolder<ConstituentCpdId>) base).augmentations(); if (!aug.isEmpty()) { this.augmentation = new HashMap<>(aug); } } this.key = base.key(); this._constituentBaseElementId = base.getConstituentBaseElementId(); this._constituentCpdId = base.getConstituentCpdId(); this._ipAddress = base.getIpAddress(); } public ConstituentCpdIdKey key() { return key; } public Object getConstituentBaseElementId() { return _constituentBaseElementId; } public Object getConstituentCpdId() { return _constituentCpdId; } public IpAddress getIpAddress() { return _ipAddress; } @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) public <E$$ extends Augmentation<ConstituentCpdId>> E$$ augmentation(Class<E$$> augmentationType) { return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); } public ConstituentCpdIdBuilder withKey(final ConstituentCpdIdKey key) { this.key = key; return this; } public ConstituentCpdIdBuilder setConstituentBaseElementId(final Object value) { this._constituentBaseElementId = value; return this; } public ConstituentCpdIdBuilder setConstituentCpdId(final Object value) { this._constituentCpdId = value; return this; } public ConstituentCpdIdBuilder setIpAddress(final IpAddress value) { this._ipAddress = value; return this; } /** * Add an augmentation to this builder's product. * * @param augmentation augmentation to be added * @return this builder * @throws NullPointerException if {@code augmentation} is null */ public ConstituentCpdIdBuilder addAugmentation(Augmentation<ConstituentCpdId> augmentation) { return doAddAugmentation(augmentation.implementedInterface(), augmentation); } /** * Add or remove an augmentation to this builder's product. * * @param augmentationType augmentation type to be added or removed * @param augmentationValue augmentation value, null if the augmentation type should be removed * @return this builder * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. */ @Deprecated(forRemoval = true) public ConstituentCpdIdBuilder addAugmentation(Class<? extends Augmentation<ConstituentCpdId>> augmentationType, Augmentation<ConstituentCpdId> augmentationValue) { return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); } /** * Remove an augmentation from this builder's product. If this builder does not track such an augmentation * type, this method does nothing. * * @param augmentationType augmentation type to be removed * @return this builder */ public ConstituentCpdIdBuilder removeAugmentation(Class<? extends Augmentation<ConstituentCpdId>> augmentationType) { if (this.augmentation instanceof HashMap) { this.augmentation.remove(augmentationType); } return this; } private ConstituentCpdIdBuilder doAddAugmentation(Class<? extends Augmentation<ConstituentCpdId>> augmentationType, Augmentation<ConstituentCpdId> augmentationValue) { if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentationValue); return this; } @Override public ConstituentCpdId build() { return new ConstituentCpdIdImpl(this); } private static final class ConstituentCpdIdImpl extends AbstractAugmentable<ConstituentCpdId> implements ConstituentCpdId { private final Object _constituentBaseElementId; private final Object _constituentCpdId; private final IpAddress _ipAddress; private final ConstituentCpdIdKey key; ConstituentCpdIdImpl(ConstituentCpdIdBuilder base) { super(base.augmentation); if (base.key() != null) { this.key = base.key(); } else { this.key = new ConstituentCpdIdKey(base.getConstituentBaseElementId(), base.getConstituentCpdId()); } this._constituentBaseElementId = key.getConstituentBaseElementId(); this._constituentCpdId = key.getConstituentCpdId(); this._ipAddress = base.getIpAddress(); } @Override public ConstituentCpdIdKey key() { return key; } @Override public Object getConstituentBaseElementId() { return _constituentBaseElementId; } @Override public Object getConstituentCpdId() { return _constituentCpdId; } @Override public IpAddress getIpAddress() { return _ipAddress; } private int hash = 0; private volatile boolean hashValid = false; @Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + Objects.hashCode(_constituentBaseElementId); result = prime * result + Objects.hashCode(_constituentCpdId); result = prime * result + Objects.hashCode(_ipAddress); result = prime * result + Objects.hashCode(augmentations()); hash = result; hashValid = true; return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DataObject)) { return false; } if (!ConstituentCpdId.class.equals(((DataObject)obj).implementedInterface())) { return false; } ConstituentCpdId other = (ConstituentCpdId)obj; if (!Objects.equals(_constituentBaseElementId, other.getConstituentBaseElementId())) { return false; } if (!Objects.equals(_constituentCpdId, other.getConstituentCpdId())) { return false; } if (!Objects.equals(_ipAddress, other.getIpAddress())) { return false; } if (getClass() == obj.getClass()) { // Simple case: we are comparing against self ConstituentCpdIdImpl otherImpl = (ConstituentCpdIdImpl) obj; if (!Objects.equals(augmentations(), otherImpl.augmentations())) { return false; } } else { // Hard case: compare our augments with presence there... for (Map.Entry<Class<? extends Augmentation<ConstituentCpdId>>, Augmentation<ConstituentCpdId>> e : augmentations().entrySet()) { if (!e.getValue().equals(other.augmentation(e.getKey()))) { return false; } } // .. and give the other one the chance to do the same if (!obj.equals(this)) { return false; } } return true; } @Override public String toString() { final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConstituentCpdId"); CodeHelpers.appendValue(helper, "_constituentBaseElementId", _constituentBaseElementId); CodeHelpers.appendValue(helper, "_constituentCpdId", _constituentCpdId); CodeHelpers.appendValue(helper, "_ipAddress", _ipAddress); CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); return helper.toString(); } } }
a443ddd189151bd86541f2dec45356d55c52b22c
bec4678751b7e54a08780d52c087bf1d6a462bc7
/src/java/dunggla/cars/CarsDAO.java
7529a7756094e4516ec5e044e22e40c0b48e4ca2
[]
no_license
AnhDung23/CarRental
bcfa267224a982a8c4b6692c0826234c5fe4c360
d30e0ef4a03d4831befed403524ee19da73419ab
refs/heads/master
2022-04-30T06:05:02.296270
2020-04-15T07:53:57
2020-04-15T07:53:57
255,844,239
0
0
null
null
null
null
UTF-8
Java
false
false
8,485
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package dunggla.cars; import dunggla.utils.DBUntilies; import java.io.Serializable; import java.sql.Connection; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.naming.NamingException; /** * * @author Admin */ public class CarsDAO implements Serializable { private Connection con; private PreparedStatement stmt; private ResultSet rs; // Close connection with SQL Server private void closeConnection() throws SQLException { if (rs != null) { rs.close(); } if (stmt != null) { stmt.close(); } if (con != null) { con.close(); } } private List<CarsDTO> list; public List<CarsDTO> getList() { return list; } // Get list all car public void showAllbyMember() throws NamingException, SQLException { con = DBUntilies.makeConnection(); try { if (con != null) { String sql = "Select carName, color, price, quantity, categoryID, status " + "From Cars"; stmt = con.prepareStatement(sql); rs = stmt.executeQuery(); while (rs.next()) { String carName = rs.getString("carName"); String color = rs.getString("color"); int price = rs.getInt("price"); int quantity = rs.getInt("quantity"); int categoryID = rs.getInt("categoryID"); String status = rs.getString("status"); CarsDTO dto = new CarsDTO(carName, color, price, quantity, categoryID, status); if (this.list == null) { this.list = new ArrayList<>(); } this.list.add(dto); } } } finally { closeConnection(); } } // Get amount in stock public int getAmountInStock(int price) throws NamingException, SQLException { con = DBUntilies.makeConnection(); int amount = 0; try { if (con != null) { String sql = "Select quantity " + "From Cars " + "Where price = ?"; stmt = con.prepareStatement(sql); stmt.setInt(1, price); rs = stmt.executeQuery(); if (rs.next()) { amount = rs.getInt("quantity"); } } } finally { closeConnection(); } return amount; } // Get detail of a car public CarsDTO getCarDetail(int priceFind) throws NamingException, SQLException { con = DBUntilies.makeConnection(); CarsDTO dto = null; try { if (con != null) { String sql = "Select carName, color, price, quantity, categoryID, status " + "From Cars " + "Where price = ?"; stmt = con.prepareStatement(sql); stmt.setInt(1, priceFind); rs = stmt.executeQuery(); if (rs.next()) { String carName = rs.getString("carName"); String color = rs.getString("color"); int price = rs.getInt("price"); int quantity = rs.getInt("quantity"); int categoryID = rs.getInt("categoryID"); String status = rs.getString("status"); dto = new CarsDTO(carName, color, priceFind, quantity, categoryID, status); } } } finally { closeConnection(); } return dto; } // Get list car search all information public void searchByName(String nameSearch, int amount, String stt) throws NamingException, SQLException { con = DBUntilies.makeConnection(); try { if (con != null) { String sql = "Select carName, color, price, quantity, categoryID, status " + "From Cars " + "Where carName like ? and quantity >= ? and status = ?"; stmt = con.prepareStatement(sql); stmt.setString(1, "%" + nameSearch + "%"); stmt.setInt(2, amount); stmt.setString(3, stt); rs = stmt.executeQuery(); while (rs.next()) { String carName = rs.getString("carName"); String color = rs.getString("color"); int price = rs.getInt("price"); int quantity = rs.getInt("quantity"); int categoryID = rs.getInt("categoryID"); String status = rs.getString("status"); CarsDTO dto = new CarsDTO(carName, color, price, quantity, categoryID, status); if (this.list == null) { this.list = new ArrayList<>(); } this.list.add(dto); } } } finally { closeConnection(); } } // Get list car search by category public void searchByCate(int cateID, int amount, String stt) throws NamingException, SQLException { con = DBUntilies.makeConnection(); try { if (con != null) { String sql = "Select carName, color, price, quantity, categoryID, status " + "From Cars " + "Where quantity >= ? and categoryID = ? and status = ?"; stmt = con.prepareStatement(sql); stmt.setInt(1, amount); stmt.setInt(2, cateID); stmt.setString(3, stt); rs = stmt.executeQuery(); while (rs.next()) { String carName = rs.getString("carName"); String color = rs.getString("color"); int price = rs.getInt("price"); int quantity = rs.getInt("quantity"); int categoryID = rs.getInt("categoryID"); String status = rs.getString("status"); CarsDTO dto = new CarsDTO(carName, color, price, quantity, categoryID, status); if (this.list == null) { this.list = new ArrayList<>(); } this.list.add(dto); } } } finally { closeConnection(); } } // Get list car search by category and name public void searchByNameAndCate(String nameSearch, int cateID, int amount, String stt) throws NamingException, SQLException { con = DBUntilies.makeConnection(); try { if (con != null) { String sql = "Select carName, color, price, quantity, categoryID, status " + "From Cars " + "Where quantity >= ? and categoryID = ? and status = ? and carName like ? "; stmt = con.prepareStatement(sql); stmt.setInt(1, amount); stmt.setInt(2, cateID); stmt.setString(3, stt); stmt.setString(4, "%" + nameSearch + "%"); rs = stmt.executeQuery(); while (rs.next()) { String carName = rs.getString("carName"); String color = rs.getString("color"); int price = rs.getInt("price"); int quantity = rs.getInt("quantity"); int categoryID = rs.getInt("categoryID"); String status = rs.getString("status"); CarsDTO dto = new CarsDTO(carName, color, price, quantity, categoryID, status); if (this.list == null) { this.list = new ArrayList<>(); } this.list.add(dto); } } } finally { closeConnection(); } } }
241a59415792d2651b0b158f8300172df5519469
0dfdc50a9298fe6540cd7e491a2850289525c05b
/2. SSC - CSC 143/1B. Inheritance - Zoo/src/Giraffe.java
d9e3e2f40407626814b68ebe28961b6b2daada7d
[]
no_license
montseawebtwo/CS-Assignments
5858b503aba1d2965557e32025ee312cb4484b54
b4d180622c23161d85f6ef0fb729616ca695ccf5
refs/heads/master
2020-08-02T18:23:10.114822
2019-06-04T02:45:37
2019-06-04T02:45:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
// Ari Madian // Ravi Gandham CSC 143 W19 public class Giraffe extends Animal { public Giraffe() { super(); } public void Talk() { System.out.println("What do giraffes say?"); } public String ToString() { return "Giraffe"; } }
99bdc93c154ea4b858799194506fe179759c744b
19d35271befddc64cd0b636e708cf6d9a48b514a
/Fcbayern/app/src/main/java/cn/fcbayern/android/common/MyPreference.java
e01a314d396b028c050f441ee638d88928be2875
[]
no_license
chengchao156/Fcbayern
a01206326e072eda229df643809c98f6acb3d3a5
01ec4d5c925c31f05a5d364f399e64c16d354d34
refs/heads/master
2021-01-11T03:01:59.950708
2017-03-13T06:27:10
2017-03-13T06:27:10
70,864,636
0
0
null
null
null
null
UTF-8
Java
false
false
1,563
java
package cn.fcbayern.android.common; import android.content.Context; import android.preference.Preference; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import cn.fcbayern.android.R; /** * Created by chenzhan on 15/6/1. */ public class MyPreference extends Preference { private String mValue; private int mActionVisible; public MyPreference(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } public MyPreference(Context context, AttributeSet attrs) { super(context, attrs); } public MyPreference(Context context) { super(context); } @Override protected View onCreateView(ViewGroup parent) { View view = LayoutInflater.from(getContext()).inflate(R.layout.list_setting_item, parent, false); return view; } @Override protected void onBindView(View view) { TextView name = (TextView) view.findViewById(R.id.name); name.setText(getTitle()); TextView value = (TextView) view.findViewById(R.id.value); value.setText(mValue); View action = view.findViewById(R.id.action); action.setVisibility(mActionVisible); super.onBindView(view); } public void setValue(String text) { mValue = text; notifyChanged(); } public void setActionFlagVisible(int visible) { mActionVisible = visible; notifyChanged(); } }
44837f1436b8a0155ce9f594520cea735d4acaf9
4d6f8467ba47f75ec24d78a794f6851c9b7f1fda
/src/main/java/hello/model/User.java
17238784b111d042715b73c12e4f78d13bc24b9c
[]
no_license
keykode20/mycms
b747c064b3a47c7467c2483b24ecdf4c79d20a5e
19a3de6575486ad559b544a2953529cb5141f457
refs/heads/master
2022-12-06T11:28:26.747389
2019-07-10T23:45:08
2019-07-10T23:45:08
195,892,091
0
0
null
2022-12-04T02:12:30
2019-07-08T22:04:06
CSS
UTF-8
Java
false
false
716
java
package hello.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity // This tells Hibernate to make a table out of this class public class User { @Id @GeneratedValue(strategy= GenerationType.AUTO) private Integer id; private String name; private String email; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
d54819cd4759d7a44ccae904e8d0a5f79c879313
278e621bf03f51a58e96694461dc2284dd4625ab
/src/main/java/com/jaaaelu/gzw/design/patterns/versionByHeadFirst/commandPattern/demo/StereoOffCommand.java
179346472d536b19a24d3a413e25e28092db9348
[]
no_license
GzwJaaaelu/DesignPatterns
e7f33214e1c236410764ba8c6a9b8e50fe84e9ce
e56442b62c200e2a5e8863f3f64abd86cb44e352
refs/heads/master
2020-03-07T03:01:56.806201
2018-06-29T09:11:09
2018-06-29T09:11:09
127,224,085
0
0
null
null
null
null
UTF-8
Java
false
false
435
java
package com.jaaaelu.gzw.design.patterns.versionByHeadFirst.commandPattern.demo; public class StereoOffCommand implements Command { private Stereo stereo; public StereoOffCommand(Stereo stereo) { this.stereo = stereo; } @Override public void execute() { stereo.off(); } @Override public void undo() { stereo.on(); stereo.setCD(); stereo.setVolume(11); } }
79bb3147f9c5f8e5c9ba5c32aba12b70a6a0dbb8
d25da2472ce37bef326d54a997245b8c9bb9e88c
/Spring/mvc1/services/BookService.java
3d86a471682f06fe4799f9089794baa2353f0ed2
[]
no_license
AlaaMansourn/java
6e5e0f1d52b3dbb53724c403c459fa65e3e1b353
2fdfd4eac7408be69788aa5b6108565d32025836
refs/heads/main
2023-05-30T20:02:02.672709
2021-06-29T20:11:04
2021-06-29T20:11:04
375,476,476
0
0
null
null
null
null
UTF-8
Java
false
false
1,243
java
package com.codingdojo.mvc1.services; import java.util.List; import java.util.Optional; import org.springframework.stereotype.Service; import com.codingdojo.mvc1.models.Book; import com.codingdojo.mvc1.repositories.BookRepository; @Service public class BookService { private final BookRepository bookRepository; public BookService(BookRepository bookRepository) { this.bookRepository = bookRepository; } // returns all the books public List<Book> allBooks() { return bookRepository.findAll(); } // creates a book public Book createBook(Book b) { return bookRepository.save(b); } // retrieves a book public Book findBook(Long id) { Optional<Book> optionalBook = bookRepository.findById(id); if(optionalBook.isPresent()) { return optionalBook.get(); } else { return null; } } //update a book public Book updateBook(Book b ) { return bookRepository.save(b); } public Void deleteBook(Long id) { book b = bookrepository.findById(id); bookRepository.delete(b); } }
bb10525c6455bd22f947860b9e0b2c627b1c0625
3e7678ec380cbd85441dcd7ac18d50c18ce0b766
/app/src/main/java/com/example/timer/MainActivity.java
9687fe8d9464e166ba440eda99f7968b1a6e70a2
[]
no_license
Anuj12499/Ticker
6d9a7ef372c2fd8a094a2fe1c0c89bfd64f31b89
6bce85008a30b49e49c7f69d2e6ad71c47c9fbb7
refs/heads/master
2023-01-04T03:05:59.440867
2020-10-30T12:06:06
2020-10-30T12:06:06
308,618,991
1
0
null
null
null
null
UTF-8
Java
false
false
5,463
java
package com.example.timer; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.preference.PreferenceManager; import android.content.Intent; import android.content.SharedPreferences; import android.media.MediaPlayer; import android.os.Bundle; import android.os.CountDownTimer; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.SeekBar; import android.widget.TextView; public class MainActivity extends AppCompatActivity { private SeekBar seek; private TextView text; private boolean timerOn; private Button button; private CountDownTimer timer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); seek=findViewById(R.id.seekBar); text=findViewById(R.id.textView); seek.setMax(600); seek.setProgress(60); timerOn=false; button=findViewById(R.id.button); seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String minutes; String seconds; int min,sec; min=progress/60; sec=progress%60; if(min<10) { minutes="0"+String.valueOf(min); } else { minutes=String.valueOf(min); } if(sec<10) { seconds="0"+String.valueOf(sec); } else { seconds=String.valueOf(sec); } text.setText(minutes+":"+seconds); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); } public void start(View view){ if(!timerOn) { button.setText("Stop"); seek.setEnabled(false); timerOn = true; timer = new CountDownTimer(seek.getProgress() * 1000, 1000) { @Override public void onTick(long millisUntilFinished) { String minutes; String seconds; int min, sec; int progress = (int) millisUntilFinished / 1000; min = progress / 60; sec = progress % 60; if (min < 10) { minutes = "0" + String.valueOf(min); } else { minutes = String.valueOf(min); } if (sec < 10) { seconds = "0" + String.valueOf(sec); } else { seconds = String.valueOf(sec); } text.setText(minutes + ":" + seconds); } @Override public void onFinish() { SharedPreferences sharedPreferences= PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); if(sharedPreferences.getBoolean("enable sound",true)) { MediaPlayer player; String melodyName=sharedPreferences.getString("timer_melody","bell"); if(melodyName.equals("bell")) { player = MediaPlayer.create(getApplicationContext(), R.raw.bell); } else if(melodyName.equals("alarm_siren")) { player = MediaPlayer.create(getApplicationContext(), R.raw.siren); } else { player = MediaPlayer.create(getApplicationContext(), R.raw.horn); } player.start(); } resetTimer(); } }; timer.start(); } else { resetTimer(); } } public void resetTimer() { timer.cancel(); text.setText("00:60"); button.setText("Start"); seek.setEnabled(true); timerOn=false; seek.setProgress(60); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater menuInflater=getMenuInflater(); menuInflater.inflate(R.menu.timer_menu,menu); return true; } @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { int id=item.getItemId(); if(id==R.id.action_settings1) { Intent openSettings=new Intent(this,SettingsActivity.class); startActivity(openSettings); return true; } else if(id==R.id.action_settings2) { Intent openAbout=new Intent(this,AboutActivity.class); startActivity(openAbout); return true; } return super.onOptionsItemSelected(item); } }
975e6bad86ecd43d3c05089bd357d765f7d5db09
a5d94a908094e30ba50caaabbc6dfa683d0da7c2
/src/main/java/com/kubernetes/k8sHelloWorld/K8sHelloWorldApplication.java
171e862fcec8ea1a48e1f38de6681e326cad4442
[]
no_license
nitinkc/K8SHelloWorld
0c883ef7bf4a8acaed07799fec2a26a606d43962
349b156b39b3059722185280d47efede55bb2bac
refs/heads/master
2022-09-15T07:28:38.212608
2020-06-01T16:42:17
2020-06-01T16:42:17
267,462,602
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package com.kubernetes.k8sHelloWorld; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class K8sHelloWorldApplication { public static void main(String[] args) { SpringApplication.run(K8sHelloWorldApplication.class, args); } }
5633083d3bfb32618f3d15b868a76831a216425e
688d8c056a37c097b4561d305dac6b428c80791d
/core/src/main/java/cn/leancloud/callback/RequestMobileCodeCallback.java
6cd839f80060726a47416e87534ed285954536c2
[ "Apache-2.0" ]
permissive
weakish/java-unified-sdk
6c1ff0fa016ec5f0307eded5fe4335c7128a8f7f
a76885e2072a24d5286890b8abfc6700c79e7812
refs/heads/master
2020-06-19T00:46:21.657059
2019-07-09T10:16:14
2019-07-09T10:16:14
196,508,822
0
0
Apache-2.0
2019-07-12T04:30:27
2019-07-12T04:30:27
null
UTF-8
Java
false
false
342
java
package cn.leancloud.callback; import cn.leancloud.AVException; import cn.leancloud.types.AVNull; public abstract class RequestMobileCodeCallback extends AVCallback<AVNull> { public abstract void done(AVException e); @Override protected final void internalDone0(AVNull t, AVException avException) { this.done(avException); } }
8ba500adee5b1a4df3d3ead3485bcb39aeb9c227
7559bead0c8a6ad16f016094ea821a62df31348a
/src/com/vmware/vim25/InvalidDeviceOperation.java
690cd34743cd41b1ac41000d521fca6789f1f2d5
[]
no_license
ZhaoxuepengS/VsphereTest
09ba2af6f0a02d673feb9579daf14e82b7317c36
59ddb972ce666534bf58d84322d8547ad3493b6e
refs/heads/master
2021-07-21T13:03:32.346381
2017-11-01T12:30:18
2017-11-01T12:30:18
109,128,993
1
1
null
null
null
null
UTF-8
Java
false
false
2,285
java
package com.vmware.vim25; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for InvalidDeviceOperation complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="InvalidDeviceOperation"> * &lt;complexContent> * &lt;extension base="{urn:vim25}InvalidDeviceSpec"> * &lt;sequence> * &lt;element name="badOp" type="{urn:vim25}VirtualDeviceConfigSpecOperation" minOccurs="0"/> * &lt;element name="badFileOp" type="{urn:vim25}VirtualDeviceConfigSpecFileOperation" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "InvalidDeviceOperation", propOrder = { "badOp", "badFileOp" }) public class InvalidDeviceOperation extends InvalidDeviceSpec { protected VirtualDeviceConfigSpecOperation badOp; protected VirtualDeviceConfigSpecFileOperation badFileOp; /** * Gets the value of the badOp property. * * @return * possible object is * {@link VirtualDeviceConfigSpecOperation } * */ public VirtualDeviceConfigSpecOperation getBadOp() { return badOp; } /** * Sets the value of the badOp property. * * @param value * allowed object is * {@link VirtualDeviceConfigSpecOperation } * */ public void setBadOp(VirtualDeviceConfigSpecOperation value) { this.badOp = value; } /** * Gets the value of the badFileOp property. * * @return * possible object is * {@link VirtualDeviceConfigSpecFileOperation } * */ public VirtualDeviceConfigSpecFileOperation getBadFileOp() { return badFileOp; } /** * Sets the value of the badFileOp property. * * @param value * allowed object is * {@link VirtualDeviceConfigSpecFileOperation } * */ public void setBadFileOp(VirtualDeviceConfigSpecFileOperation value) { this.badFileOp = value; } }
20e5d0d5f3c0f2f68e3e19269f551c1e8a573173
ffd8ba9eb4dd01884c03175b6bc6febd4d2eadd5
/eclipse_workbench/USTGlobal/src/dev/com/abstraction/Abstraction.java
ed77301ac8fc6e3b6dcd8508acf2a4a04fbb3895
[]
no_license
tarageorge26/USTGlobal-HTD-Generic-24jul19--TARAGEORGE-
82591d64f5fc15f19639ebb40165a15f68a8af8b
31b0864e90552507bb5f2023b1f8d2e2225e9577
refs/heads/master
2023-01-11T13:03:55.805808
2019-09-29T09:12:04
2019-09-29T09:12:04
209,932,948
0
0
null
2023-01-07T17:40:43
2019-09-21T05:55:39
JavaScript
UTF-8
Java
false
false
318
java
package dev.com.abstraction; public class Abstraction extends AbstractExample{ @Override void display() { System.out.println("this is implemented abstract method overriden in subclass"); } public static void main(String[] args) { Abstraction a = new Abstraction(); a.display(); a.show(); } }
7a656313221aa7a2629e9b5c721850258aa0ea81
a1527497613b7ff619ded90448a00e7e072b18e9
/app/src/main/java/custom/android/common/GoogleLogTags.java
066cca67535ead0a1086e274dfd3753f2bce0526
[]
no_license
SiKang123/SmsTest
370383339971f5c8deef09c8f35a409681bee9e1
5ddac0c9fa3531a4b8e1f9bb51b9721f557accd7
refs/heads/master
2020-04-12T03:01:05.657121
2018-12-28T10:52:41
2018-12-28T10:52:41
162,260,965
0
0
null
null
null
null
UTF-8
Java
false
false
4,577
java
package custom.android.common; import android.util.EventLog; public class GoogleLogTags { public static final int C2DM = 204005; public static final int GLS_ACCOUNT_SAVED = 205009; public static final int GLS_ACCOUNT_TRIED = 205008; public static final int GLS_AUTHENTICATE = 205010; public static final int GOOGLE_HTTP_REQUEST = 203002; public static final int GOOGLE_MAIL_SWITCH = 205011; public static final int GTALKSERVICE = 204001; public static final int GTALK_CONNECTION = 204002; public static final int GTALK_CONN_CLOSE = 204003; public static final int GTALK_HEARTBEAT_RESET = 204004; public static final int SETUP_COMPLETED = 205007; public static final int SETUP_IO_ERROR = 205003; public static final int SETUP_NO_DATA_NETWORK = 205006; public static final int SETUP_REQUIRED_CAPTCHA = 205002; public static final int SETUP_RETRIES_EXHAUSTED = 205005; public static final int SETUP_SERVER_ERROR = 205004; public static final int SETUP_SERVER_TIMEOUT = 205001; public static final int SYNC_DETAILS = 203001; public static final int SYSTEM_UPDATE = 201001; public static final int SYSTEM_UPDATE_USER = 201002; public static final int VENDING_RECONSTRUCT = 202001; private GoogleLogTags() { } public static void writeSystemUpdate(int status, int downloadResult, long bytes, String url) { EventLog.writeEvent(SYSTEM_UPDATE, new Object[]{Integer.valueOf(status), Integer.valueOf(downloadResult), Long.valueOf(bytes), url}); } public static void writeSystemUpdateUser(String action) { EventLog.writeEvent(SYSTEM_UPDATE_USER, action); } public static void writeVendingReconstruct(int changes) { EventLog.writeEvent(VENDING_RECONSTRUCT, changes); } public static void writeSyncDetails(String authority, int send, int recv, String details) { EventLog.writeEvent(SYNC_DETAILS, new Object[]{authority, Integer.valueOf(send), Integer.valueOf(recv), details}); } public static void writeGoogleHttpRequest(long elapsed, int status, String appname, int reused) { EventLog.writeEvent(GOOGLE_HTTP_REQUEST, new Object[]{Long.valueOf(elapsed), Integer.valueOf(status), appname, Integer.valueOf(reused)}); } public static void writeGtalkservice(int eventtype) { EventLog.writeEvent(GTALKSERVICE, eventtype); } public static void writeGtalkConnection(int status) { EventLog.writeEvent(GTALK_CONNECTION, status); } public static void writeGtalkConnClose(int status, int duration) { EventLog.writeEvent(GTALK_CONN_CLOSE, new Object[]{Integer.valueOf(status), Integer.valueOf(duration)}); } public static void writeGtalkHeartbeatReset(int intervalAndNt, String ip) { EventLog.writeEvent(GTALK_HEARTBEAT_RESET, new Object[]{Integer.valueOf(intervalAndNt), ip}); } public static void writeC2Dm(int packetType, String persistentId, int streamId, int lastStreamId) { EventLog.writeEvent(C2DM, new Object[]{Integer.valueOf(packetType), persistentId, Integer.valueOf(streamId), Integer.valueOf(lastStreamId)}); } public static void writeSetupServerTimeout() { EventLog.writeEvent(SETUP_SERVER_TIMEOUT, new Object[0]); } public static void writeSetupRequiredCaptcha(String action) { EventLog.writeEvent(SETUP_REQUIRED_CAPTCHA, action); } public static void writeSetupIoError(String status) { EventLog.writeEvent(SETUP_IO_ERROR, status); } public static void writeSetupServerError() { EventLog.writeEvent(SETUP_SERVER_ERROR, new Object[0]); } public static void writeSetupRetriesExhausted() { EventLog.writeEvent(SETUP_RETRIES_EXHAUSTED, new Object[0]); } public static void writeSetupNoDataNetwork() { EventLog.writeEvent(SETUP_NO_DATA_NETWORK, new Object[0]); } public static void writeSetupCompleted() { EventLog.writeEvent(SETUP_COMPLETED, new Object[0]); } public static void writeGlsAccountTried(int status) { EventLog.writeEvent(GLS_ACCOUNT_TRIED, status); } public static void writeGlsAccountSaved(int status) { EventLog.writeEvent(GLS_ACCOUNT_SAVED, status); } public static void writeGlsAuthenticate(int status, String service) { EventLog.writeEvent(GLS_AUTHENTICATE, new Object[]{Integer.valueOf(status), service}); } public static void writeGoogleMailSwitch(int direction) { EventLog.writeEvent(GOOGLE_MAIL_SWITCH, direction); } }
dfffc64c346c6109b309de43045fba07e5ffd777
fd2aa6ef1ce68b42b357d5380ca26d7c636dbb78
/src/com/digiarea/closure/model/Output.java
f2608b709ddaa45935af6842b7622043e4fb7125
[ "Apache-2.0", "CC-BY-3.0" ]
permissive
DigiArea/closurefx-builder
d718b4a2371e0df7f7ae743ff8005cae66cbc291
33c26671f2deb3fdcc6833338a8b1019489448cf
refs/heads/master
2021-01-20T04:29:59.726134
2015-02-15T17:06:33
2015-02-15T17:06:33
15,201,897
3
0
null
null
null
null
UTF-8
Java
false
false
2,780
java
package com.digiarea.closure.model; import java.io.IOException; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import com.digiarea.closure.model.visitor.GenericVisitor; import com.digiarea.closure.model.visitor.VoidVisitor; import com.digiarea.zippy.ZippyBuffer; public class Output extends Node { private StringProperty path = new SimpleStringProperty(this, "path"); private StringProperty file = new SimpleStringProperty(this, "file"); public final String getPath() { return path.get(); } public final void setPath(String path) { this.path.set(path); } public final String getFile() { return file.get(); } public final void setFile(String file) { this.file.set(file); } public Output() { super(); } public Output(String path, String file) { super(); this.path.set(path); this.file.set(file); } public StringProperty pathProperty() { return path; } public StringProperty fileProperty() { return file; } @Override public <C> void accept(VoidVisitor<C> v, C ctx) throws Exception { v.visit(this, ctx); } @Override public <R, C> R accept(GenericVisitor<R, C> v, C ctx) throws Exception { return v.visit(this, ctx); } public final int sizeOfOutput(final boolean isExternal) { int size = isExternal ? 1 : 0; if (this.getPath() != null) { size += 1; size += ZippyBuffer.sizeOfString(this.getPath()); } if (this.getFile() != null) { size += 1; size += ZippyBuffer.sizeOfString(this.getFile()); } size += 1; return size; } public final void writeOutput(final ZippyBuffer writer, final boolean isExternal) throws IOException { if (isExternal) { writer.writeRawVarInt(50); } if (this.getPath() != null) { writer.writeRawVarInt(1); writer.writeString(this.getPath()); } if (this.getFile() != null) { writer.writeRawVarInt(2); writer.writeString(this.getFile()); } writer.writeRawVarInt(0); } public static Output readOutput(final ZippyBuffer reader) throws IOException { final Output packet = new Output(); int sector; while ((sector = reader.readSector()) != 0) { switch(sector) { case 1: packet.setPath(reader.readString()); break; case 2: packet.setFile(reader.readString()); break; } } return packet; } }
4c4846640811231bda4ced65de9785fe0ac68057
92ee1ec311f38cf09285ee5ec9efc85f9067ac53
/BankingPackage/DataFiles/GenerateAccounts.java
1cb07befc1ae8407cf601aad552e098deab85297
[]
no_license
GuAiden/learning-java
a3381def248b432cd3171fde83d81374ca791527
3e8d839886d34989a546c8df64590f93919f6e53
refs/heads/master
2022-12-11T01:17:00.674402
2020-09-09T08:54:09
2020-09-09T08:54:09
290,401,318
1
0
null
null
null
null
UTF-8
Java
false
false
2,799
java
package BankingPackage.DataFiles; import BankingPackage.Account; import BankingPackage.AccountActions; import java.util.HashSet; import java.util.Random; import java.util.Set; import java.util.stream.IntStream; import BankingPackage.FileManagement.*; public class GenerateAccounts { final String name_chars = "abcdefghijklmnopqrstuvwxyz"; final String pass_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; final Random rand = new Random(); final Set<String> name_identifiers = new HashSet<String>(); final Set<Integer> id_identifiers = new HashSet<Integer>(); public static void main(String args[]) { GenerateAccounts generate = new GenerateAccounts(); // Generate 1000 accounts, for (int i = 0; i < 900; i++) { int id = generate.idGenerate(i); String pass = generate.passGenerate(); String name = generate.nameGenerate(); int balance = generate.balGenerate(); String account_details = Integer.toString(id) + " " + pass + " " + name + " " + Integer.toString(balance); String filePath = FileHandle.createFile(); FileWrite.appendAccount(filePath, account_details); } } public String nameGenerate() { StringBuilder name = new StringBuilder(); while (name.toString().length() == 0) { // Set the random name length int length = rand.nextInt(5) + 5; // For every letter up to the name length, assign a random char. for (int i = 0; i < length; i++) { name.append(name_chars.charAt(rand.nextInt(name_chars.length()))); } // If such a name already exists, reset the stringbuilder if (name_identifiers.contains(name.toString())) { name = new StringBuilder(); } } name_identifiers.add(name.toString()); return name.toString(); } // We don't care about unique passwords, so just use whatever public String passGenerate() { StringBuilder pass = new StringBuilder(); int length = rand.nextInt(10) + 5; for (int i = 0; i < length; i++) { pass.append(pass_chars.charAt(rand.nextInt(pass_chars.length()))); } return pass.toString(); } public int idGenerate(int index) { IntStream idList = rand.ints(3000, 1000, 10000); int[] idArray = idList.toArray(); int id = idArray[index]; if (id_identifiers.contains(id)) { id = idGenerate(index); } id_identifiers.add(id); return id; } public int balGenerate() { int balance = rand.nextInt(10000); return balance; } }
ad0c920646c24638c5bef21ca2958bdecd3604bb
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
/aliyun-java-sdk-live/src/main/java/com/aliyuncs/live/Endpoint.java
584459994eb45713367ee51a9a1828aa879344bb
[ "Apache-2.0" ]
permissive
aliyun/aliyun-openapi-java-sdk
a263fa08e261f12d45586d1b3ad8a6609bba0e91
e19239808ad2298d32dda77db29a6d809e4f7add
refs/heads/master
2023-09-03T12:28:09.765286
2023-09-01T09:03:00
2023-09-01T09:03:00
39,555,898
1,542
1,317
NOASSERTION
2023-09-14T07:27:05
2015-07-23T08:41:13
Java
UTF-8
Java
false
false
4,129
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.live; import java.util.HashMap; public class Endpoint { public static HashMap<String, String> endpointMap = new HashMap<String, String>() { { put("cn-shanghai-internal-test-1", "live.aliyuncs.com"); put("cn-shenzhen-su18-b01", "live.aliyuncs.com"); put("cn-beijing", "live.aliyuncs.com"); put("cn-shanghai-inner", "live.aliyuncs.com"); put("cn-hangzhou-internal-prod-1", "live.aliyuncs.com"); put("cn-north-2-gov-1", "live.aliyuncs.com"); put("cn-yushanfang", "live.aliyuncs.com"); put("cn-qingdao-nebula", "live.aliyuncs.com"); put("cn-beijing-finance-pop", "live.aliyuncs.com"); put("cn-wuhan", "live.aliyuncs.com"); put("cn-zhangjiakou", "live.aliyuncs.com"); put("us-west-1", "live.aliyuncs.com"); put("cn-zhangbei", "live.aliyuncs.com"); put("rus-west-1-pop", "live.aliyuncs.com"); put("cn-shanghai-et15-b01", "live.aliyuncs.com"); put("cn-hangzhou-bj-b01", "live.aliyuncs.com"); put("cn-zhangbei-na61-b01", "live.aliyuncs.com"); put("ap-northeast-1", "live.aliyuncs.com"); put("cn-huhehaote-nebula-1", "live.aliyuncs.com"); put("cn-shanghai-et2-b01", "live.aliyuncs.com"); put("ap-southeast-1", "live.aliyuncs.com"); put("ap-southeast-2", "live.aliyuncs.com"); put("ap-southeast-3", "live.aliyuncs.com"); put("ap-southeast-5", "live.aliyuncs.com"); put("us-east-1", "live.aliyuncs.com"); put("cn-shenzhen-inner", "live.aliyuncs.com"); put("cn-zhangjiakou-na62-a01", "live.aliyuncs.com"); put("cn-beijing-gov-1", "live.aliyuncs.com"); put("cn-wulanchabu", "live.aliyuncs.com"); put("ap-south-1", "live.aliyuncs.com"); put("cn-shenzhen-st4-d01", "live.aliyuncs.com"); put("cn-haidian-cm12-c01", "live.aliyuncs.com"); put("cn-qingdao", "live.aliyuncs.com"); put("cn-hongkong-finance-pop", "live.aliyuncs.com"); put("cn-shanghai", "live.aliyuncs.com"); put("cn-shanghai-finance-1", "live.aliyuncs.com"); put("cn-hongkong", "live.aliyuncs.com"); put("eu-central-1", "live.aliyuncs.com"); put("cn-shenzhen", "live.aliyuncs.com"); put("cn-zhengzhou-nebula-1", "live.aliyuncs.com"); put("eu-west-1", "live.aliyuncs.com"); put("cn-hangzhou-internal-test-1", "live.aliyuncs.com"); put("eu-west-1-oxs", "live.aliyuncs.com"); put("cn-beijing-finance-1", "live.aliyuncs.com"); put("cn-hangzhou-internal-test-3", "live.aliyuncs.com"); put("cn-hangzhou-internal-test-2", "live.aliyuncs.com"); put("cn-shenzhen-finance-1", "live.aliyuncs.com"); put("me-east-1", "live.aliyuncs.com"); put("cn-chengdu", "live.aliyuncs.com"); put("cn-hangzhou-test-306", "live.aliyuncs.com"); put("cn-hangzhou-finance", "live.aliyuncs.com"); put("cn-beijing-nu16-b01", "live.aliyuncs.com"); put("cn-edge-1", "live.aliyuncs.com"); put("cn-huhehaote", "live.aliyuncs.com"); put("cn-fujian", "live.aliyuncs.com"); put("ap-northeast-2-pop", "live.aliyuncs.com"); put("cn-hangzhou", "live.aliyuncs.com"); } }; public static String endpointRegionalType = "regional"; }
d616491469917fe41d9b5c5099adc5a3b1eb932a
31ff23f45952d797dea7d0d11fb55154b5b685df
/src/main/java/com/t2tierp/model/bean/vendas/VendaOrcamentoCabecalho.java
2a7894de0d8c4ad0121e383245fefc756a6f4001
[]
no_license
antonioishac/nfe
dfa59d79d66af1d49a2801915dea91b5ddaa9898
a5948acbad7e146813d82aceba3b9d02f67e976c
refs/heads/master
2020-04-23T07:15:55.005269
2019-02-16T12:27:55
2019-02-16T12:27:55
171,001,380
0
0
null
null
null
null
UTF-8
Java
false
false
7,741
java
/* * The MIT License * * Copyright: Copyright (C) 2014 T2Ti.COM * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * The author may be contacted at: [email protected] * * @author Claudio de Barros (T2Ti.com) * @version 2.0 */ package com.t2tierp.model.bean.vendas; import com.t2tierp.model.bean.cadastros.Cliente; import com.t2tierp.model.bean.cadastros.Transportadora; import com.t2tierp.model.bean.cadastros.Vendedor; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @Entity @Table(name = "VENDA_ORCAMENTO_CABECALHO") public class VendaOrcamentoCabecalho implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "ID") private Integer id; @Column(name = "TIPO") private String tipo; @Column(name = "CODIGO") private String codigo; @Temporal(TemporalType.DATE) @Column(name = "DATA_CADASTRO") private Date dataCadastro; @Temporal(TemporalType.DATE) @Column(name = "DATA_ENTREGA") private Date dataEntrega; @Temporal(TemporalType.DATE) @Column(name = "VALIDADE") private Date validade; @Column(name = "TIPO_FRETE") private String tipoFrete; @Column(name = "VALOR_SUBTOTAL") private BigDecimal valorSubtotal; @Column(name = "VALOR_FRETE") private BigDecimal valorFrete; @Column(name = "TAXA_COMISSAO") private BigDecimal taxaComissao; @Column(name = "VALOR_COMISSAO") private BigDecimal valorComissao; @Column(name = "TAXA_DESCONTO") private BigDecimal taxaDesconto; @Column(name = "VALOR_DESCONTO") private BigDecimal valorDesconto; @Column(name = "VALOR_TOTAL") private BigDecimal valorTotal; @Column(name = "OBSERVACAO") private String observacao; @Column(name = "SITUACAO") private String situacao; @JoinColumn(name = "ID_VENDA_CONDICOES_PAGAMENTO", referencedColumnName = "ID") @ManyToOne(optional = false) private CondicoesPagamento condicoesPagamento; @JoinColumn(name = "ID_TRANSPORTADORA", referencedColumnName = "ID") @ManyToOne private Transportadora transportadora; @JoinColumn(name = "ID_CLIENTE", referencedColumnName = "ID") @ManyToOne(optional = false) private Cliente cliente; @JoinColumn(name = "ID_VENDEDOR", referencedColumnName = "ID") @ManyToOne(optional = false) private Vendedor vendedor; public VendaOrcamentoCabecalho() { } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTipo() { return tipo; } public void setTipo(String tipo) { this.tipo = tipo; } public String getCodigo() { return codigo; } public void setCodigo(String codigo) { this.codigo = codigo; } public Date getDataCadastro() { return dataCadastro; } public void setDataCadastro(Date dataCadastro) { this.dataCadastro = dataCadastro; } public Date getDataEntrega() { return dataEntrega; } public void setDataEntrega(Date dataEntrega) { this.dataEntrega = dataEntrega; } public Date getValidade() { return validade; } public void setValidade(Date validade) { this.validade = validade; } public String getTipoFrete() { return tipoFrete; } public void setTipoFrete(String tipoFrete) { this.tipoFrete = tipoFrete; } public BigDecimal getValorSubtotal() { return valorSubtotal; } public void setValorSubtotal(BigDecimal valorSubtotal) { this.valorSubtotal = valorSubtotal; } public BigDecimal getValorFrete() { return valorFrete; } public void setValorFrete(BigDecimal valorFrete) { this.valorFrete = valorFrete; } public BigDecimal getTaxaComissao() { return taxaComissao; } public void setTaxaComissao(BigDecimal taxaComissao) { this.taxaComissao = taxaComissao; } public BigDecimal getValorComissao() { return valorComissao; } public void setValorComissao(BigDecimal valorComissao) { this.valorComissao = valorComissao; } public BigDecimal getTaxaDesconto() { return taxaDesconto; } public void setTaxaDesconto(BigDecimal taxaDesconto) { this.taxaDesconto = taxaDesconto; } public BigDecimal getValorDesconto() { return valorDesconto; } public void setValorDesconto(BigDecimal valorDesconto) { this.valorDesconto = valorDesconto; } public BigDecimal getValorTotal() { return valorTotal; } public void setValorTotal(BigDecimal valorTotal) { this.valorTotal = valorTotal; } public String getObservacao() { return observacao; } public void setObservacao(String observacao) { this.observacao = observacao; } public String getSituacao() { return situacao; } public void setSituacao(String situacao) { this.situacao = situacao; } public CondicoesPagamento getCondicoesPagamento() { return condicoesPagamento; } public void setCondicoesPagamento(CondicoesPagamento condicoesPagamento) { this.condicoesPagamento = condicoesPagamento; } public Transportadora getTransportadora() { return transportadora; } public void setTransportadora(Transportadora transportadora) { this.transportadora = transportadora; } public Cliente getCliente() { return cliente; } public void setCliente(Cliente cliente) { this.cliente = cliente; } public Vendedor getVendedor() { return vendedor; } public void setVendedor(Vendedor vendedor) { this.vendedor = vendedor; } @Override public String toString() { return "com.t2tierp.model.bean.vendas.VendaOrcamentoCabecalho[id=" + id + "]"; } }
50a7f56ec82ce18a72807fce5f3a907442bb2901
11cf550cff802a2f7a4780a8322e3e7402fc03e4
/src/main/java/com/mywebapp/pizza/repository/OrderRepository.java
ea529233e45fd3c9965d3dba87139bcca5267b72
[]
no_license
dwerd101/test1
d1f8127f0abe7aed9d12c3fd4b8cfbe00c386b74
4327547b8fc256f3486c099ea069a4659b5dad47
refs/heads/master
2023-04-06T16:21:42.386056
2021-04-20T07:55:17
2021-04-20T07:55:17
359,730,698
0
0
null
null
null
null
UTF-8
Java
false
false
275
java
package com.mywebapp.pizza.repository; import com.mywebapp.pizza.model.Order; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface OrderRepository extends JpaRepository<Order,Long> { }
cced454b37d154e3574dd2a4a8b426f6e83d7963
7421545efbc404ae267fbdf2aaea7d182c0333f8
/prov/src/main/jdk1.4/org/bouncycastle/jcajce/provider/asymmetric/rsa/PSSSignatureSpi.java
bc860312609034c0257233b5d17d67f2a0cdc02d
[ "Apache-2.0", "MIT" ]
permissive
hannesa2/bouncycastle
a414716c3cb5f8f33e136caff436ab7cd1196b25
ef1033a701769af4ad4b0c81efcb4730989509b3
refs/heads/openkeychain-master-old
2023-03-04T11:53:02.010134
2018-02-13T13:05:05
2018-02-13T13:05:05
339,003,876
0
0
NOASSERTION
2021-02-15T11:20:00
2021-02-15T07:56:14
null
UTF-8
Java
false
false
11,227
java
package org.bouncycastle.jcajce.provider.asymmetric.rsa; import java.io.ByteArrayOutputStream; import java.security.AlgorithmParameters; import java.security.InvalidKeyException; import java.security.InvalidParameterException; import java.security.PrivateKey; import java.security.PublicKey; import java.security.SecureRandom; import java.security.Signature; import java.security.SignatureException; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.PSSParameterSpec; import org.bouncycastle.crypto.AsymmetricBlockCipher; import org.bouncycastle.crypto.CryptoException; import org.bouncycastle.crypto.Digest; import org.bouncycastle.crypto.digests.SHA1Digest; import org.bouncycastle.crypto.digests.SHA224Digest; import org.bouncycastle.crypto.digests.SHA256Digest; import org.bouncycastle.crypto.digests.SHA384Digest; import org.bouncycastle.crypto.digests.SHA512Digest; import org.bouncycastle.crypto.digests.SHA512tDigest; import org.bouncycastle.crypto.engines.RSABlindedEngine; import org.bouncycastle.crypto.params.ParametersWithRandom; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.jcajce.util.BCJcaJceHelper; import org.bouncycastle.jcajce.util.JcaJceHelper; public class PSSSignatureSpi extends Signature { private final JcaJceHelper helper = new BCJcaJceHelper(); private AlgorithmParameters engineParams; private PSSParameterSpec paramSpec; private AsymmetricBlockCipher signer; private Digest contentDigest; private Digest mgfDigest; private int saltLength; private byte trailer; private boolean isRaw; private org.bouncycastle.crypto.signers.PSSSigner pss; private byte getTrailer( int trailerField) { if (trailerField == 1) { return org.bouncycastle.crypto.signers.PSSSigner.TRAILER_IMPLICIT; } throw new IllegalArgumentException("unknown trailer field"); } private void setupContentDigest() { if (isRaw) { this.contentDigest = new NullPssDigest(mgfDigest); } else { this.contentDigest = mgfDigest; } } protected PSSSignatureSpi( String name, AsymmetricBlockCipher signer, Digest digest) { super(name); this.signer = signer; this.mgfDigest = digest; if (digest != null) { this.saltLength = digest.getDigestSize(); } else { this.saltLength = 20; } if (paramSpec != null) { this.saltLength = paramSpec.getSaltLength(); } this.isRaw = false; setupContentDigest(); } // care - this constructor is actually used by outside organisations protected PSSSignatureSpi( String name, AsymmetricBlockCipher signer, Digest digest, boolean isRaw) { super(name); this.signer = signer; this.mgfDigest = digest; if (digest != null) { this.saltLength = digest.getDigestSize(); } else { this.saltLength = 20; } if (paramSpec != null) { this.saltLength = paramSpec.getSaltLength(); } this.isRaw = isRaw; setupContentDigest(); } protected void engineInitVerify( PublicKey publicKey) throws InvalidKeyException { if (!(publicKey instanceof RSAPublicKey)) { throw new InvalidKeyException("Supplied key is not a RSAPublicKey instance"); } pss = new org.bouncycastle.crypto.signers.PSSSigner(signer, contentDigest, mgfDigest, saltLength); pss.init(false, RSAUtil.generatePublicKeyParameter((RSAPublicKey)publicKey)); } protected void engineInitSign( PrivateKey privateKey, SecureRandom random) throws InvalidKeyException { if (!(privateKey instanceof RSAPrivateKey)) { throw new InvalidKeyException("Supplied key is not a RSAPrivateKey instance"); } pss = new org.bouncycastle.crypto.signers.PSSSigner(signer, contentDigest, mgfDigest, saltLength); pss.init(true, new ParametersWithRandom(RSAUtil.generatePrivateKeyParameter((RSAPrivateKey)privateKey), random)); } protected void engineInitSign( PrivateKey privateKey) throws InvalidKeyException { if (!(privateKey instanceof RSAPrivateKey)) { throw new InvalidKeyException("Supplied key is not a RSAPrivateKey instance"); } pss = new org.bouncycastle.crypto.signers.PSSSigner(signer, contentDigest, mgfDigest, saltLength); pss.init(true, RSAUtil.generatePrivateKeyParameter((RSAPrivateKey)privateKey)); } protected void engineUpdate( byte b) throws SignatureException { pss.update(b); } protected void engineUpdate( byte[] b, int off, int len) throws SignatureException { pss.update(b, off, len); } protected byte[] engineSign() throws SignatureException { try { return pss.generateSignature(); } catch (CryptoException e) { throw new SignatureException(e.getMessage()); } } protected boolean engineVerify( byte[] sigBytes) throws SignatureException { return pss.verifySignature(sigBytes); } protected void engineSetParameter( AlgorithmParameterSpec params) throws InvalidParameterException { if (params instanceof PSSParameterSpec) { PSSParameterSpec newParamSpec = (PSSParameterSpec)params; this.engineParams = null; this.paramSpec = newParamSpec; this.saltLength = paramSpec.getSaltLength(); if (mgfDigest == null) { switch (saltLength) { case 20: this.mgfDigest = new SHA1Digest(); break; case 28: this.mgfDigest = new SHA224Digest(); break; case 32: this.mgfDigest = new SHA256Digest(); break; case 48: this.mgfDigest = new SHA384Digest(); break; case 64: this.mgfDigest = new SHA512Digest(); break; } setupContentDigest(); } } else { throw new InvalidParameterException("Only PSSParameterSpec supported"); } } protected AlgorithmParameters engineGetParameters() { if (engineParams == null) { try { engineParams = helper.createAlgorithmParameters("PSS"); engineParams.init(new PSSParameterSpec(saltLength)); } catch (Exception e) { throw new RuntimeException(e.toString()); } } return engineParams; } /** * @deprecated replaced with <a href = "#engineSetParameter(java.security.spec.AlgorithmParameterSpec)"> */ protected void engineSetParameter( String param, Object value) { throw new UnsupportedOperationException("engineSetParameter unsupported"); } protected Object engineGetParameter( String param) { throw new UnsupportedOperationException("engineGetParameter unsupported"); } static public class nonePSS extends PSSSignatureSpi { public nonePSS() { super("NONEwithRSAandMGF1", new RSABlindedEngine(), null, true); } } static public class PSSwithRSA extends PSSSignatureSpi { public PSSwithRSA() { super("SHA1withRSAandMGF1", new RSABlindedEngine(), null); } } static public class SHA1withRSA extends PSSSignatureSpi { public SHA1withRSA() { super("SHA1withRSAandMGF1", new RSABlindedEngine(), new SHA1Digest()); } } static public class SHA224withRSA extends PSSSignatureSpi { public SHA224withRSA() { super("SHA224withRSAandMGF1", new RSABlindedEngine(), new SHA224Digest()); } } static public class SHA256withRSA extends PSSSignatureSpi { public SHA256withRSA() { super("SHA256withRSAandMGF1", new RSABlindedEngine(), new SHA256Digest()); } } static public class SHA384withRSA extends PSSSignatureSpi { public SHA384withRSA() { super("SHA384withRSAandMGF1", new RSABlindedEngine(), new SHA384Digest()); } } static public class SHA512withRSA extends PSSSignatureSpi { public SHA512withRSA() { super("SHA512withRSAandMGF1", new RSABlindedEngine(), new SHA512Digest()); } } static public class SHA512_224withRSA extends PSSSignatureSpi { public SHA512_224withRSA() { super("SHA512(224)withRSAandMGF1", new RSABlindedEngine(), new SHA512tDigest(224)); } } static public class SHA512_256withRSA extends PSSSignatureSpi { public SHA512_256withRSA() { super("SHA512(256)withRSAandMGF1", new RSABlindedEngine(), new SHA512tDigest(256)); } } private class NullPssDigest implements Digest { private ByteArrayOutputStream bOut = new ByteArrayOutputStream(); private Digest baseDigest; private boolean oddTime = true; public NullPssDigest(Digest mgfDigest) { this.baseDigest = mgfDigest; } public String getAlgorithmName() { return "NULL"; } public int getDigestSize() { return baseDigest.getDigestSize(); } public void update(byte in) { bOut.write(in); } public void update(byte[] in, int inOff, int len) { bOut.write(in, inOff, len); } public int doFinal(byte[] out, int outOff) { byte[] res = bOut.toByteArray(); if (oddTime) { System.arraycopy(res, 0, out, outOff, res.length); } else { baseDigest.update(res, 0, res.length); baseDigest.doFinal(out, outOff); } reset(); oddTime = !oddTime; return res.length; } public void reset() { bOut.reset(); baseDigest.reset(); } public int getByteLength() { return 0; } } }
ec2011e9ce406013c1c16247feb80e1b9df334f3
5d38518b5021b1a8d80ab573a43984d7b5f9a05c
/app/src/main/java/com/moon/pimsnewoffline/Fragments/Home_pims.java
08fd55ecd86a8b9cb19a4a888aadb76af3338418
[]
no_license
moontasirul/PIMS_offline
2217295007fe52b48e99cc2c6936f31c2f8acd87
8836882c7920468959023b1df68590085f8a5c26
refs/heads/master
2020-05-30T08:42:11.069772
2016-10-01T10:58:42
2016-10-01T10:58:42
69,732,142
1
0
null
null
null
null
UTF-8
Java
false
false
182
java
package com.moon.pimsnewoffline.Fragments; import android.support.v4.app.Fragment; /** * Created by TM-Markting on 9/28/2016. */ public class Home_pims extends Fragment { }
c9bdf9032e7de7e0837b91e5a3c9764240c661d1
a9b8e8528ee5e1ebd7c277433e1e4a65d6b7368f
/JDB/src/main/java/com/jemylibs/sedb/ZCOL/_String.java
59f4808097a1ae57047adf43a5fc24c2eeda49d4
[]
no_license
gitjemy/fxFramework
263128d9c2bcbe9d2eee0fa39493a1cdb7c596e8
a0164b476ac091d7aed43244e52c2e22e932b4c1
refs/heads/master
2020-12-03T09:40:38.882676
2020-02-09T22:12:47
2020-02-09T22:12:47
231,268,398
0
0
null
null
null
null
UTF-8
Java
false
false
1,422
java
package com.jemylibs.sedb.ZCOL; import com.jemylibs.gdb.Query.ZQ.Equal; import com.jemylibs.gdb.Query.ZQ.Like; import com.jemylibs.gdb.ZCOL.CreateTable; import com.jemylibs.gdb.ZSqlRow; import com.jemylibs.gdb.helpers.Link; import com.jemylibs.gdb.properties.WritableProperty; import java.sql.ResultSet; import java.sql.SQLException; public class _String<E extends ZSqlRow> extends SqlCol<E, String> { public final short Size; public _String(String name, int Size, boolean not_null, WritableProperty<E, String> property) { super(name, property, not_null); this.Size = (short) Size; } public _String(String name, int Size, WritableProperty<E, String> property) { super(name, property, false); this.Size = (short) Size; } public _String(String Name, short size, String title) { super(Name, new WritableProperty<>(Name, title)); this.Size = size; } @Override public String get(ResultSet resultSet) throws SQLException { return resultSet.getString(name); } @Override protected void create(CreateTable CreateTable, Link link) { CreateTable.first.add("`" + name + "` VARCHAR(" + Size + ")" + (not_null ? " NOT NULL" : "")); } @Override public Equal equal(String val) { return new Equal(this, val); } public Like like(String val) { return new Like(this, val); } }
e24cb1c760446d0236b7ffea466c39f8d83d996c
3e3c45ea65b0786767427c58fd9dfb114a514fa1
/app/src/main/java/com/snippet/widget/Tab1Fragment.java
380efaa05a6262d59678449aa9648bb06ee37b7d
[ "Apache-2.0" ]
permissive
markus2610/android-snippets
f64d111969be7c201354f115b1656157d8347f4e
cc07229501576796b8995be86c462bf301935795
refs/heads/master
2020-12-28T10:35:55.879688
2014-09-15T15:53:47
2014-09-15T15:53:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,345
java
/* * Copyright 2014 Soichiro Kashima * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.snippet.widget; import com.snippet.R; import com.snippet.widget.actionbar.ActionBarFragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; public class Tab1Fragment extends ActionBarFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setHasOptionsMenu(true); } @Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { if (container == null) { return null; } View view = inflater.inflate(R.layout.fragment_tab1, container, false); // Write view customization codes here return view; } @Override public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) { // Note: We must inflate main for action bar first, then call super // to hide options main for Android 2.x. inflater.inflate(R.menu.fragment_tab1, menu); super.onCreateOptionsMenu(menu, inflater); } @Override public boolean onOptionsItemSelected(final MenuItem item) { int itemId = item.getItemId(); if (itemId == R.id.menu_tab1) { Toast.makeText(getActivity(), "Menu tab1", Toast.LENGTH_SHORT).show(); return true; } else if (itemId == R.id.menu_tab1_2) { Toast.makeText(getActivity(), "Menu tab1-2", Toast.LENGTH_SHORT).show(); return true; } return false; } }
4a8f62b3395d06b73ee482fd056657f0f0357b0a
5c3ffa5bb05090f5a4f156d942f65fff5c596c6c
/src/main/java/es/upm/miw/pd/composite/expression/ExpresionBinaria.java
554a2e2c51fcc96d15416e93a142b0d8ee340b94
[]
no_license
ajaragoneses/PD.ECP2.Patrones.Alvaro.Aragoneses
bf0d24a26b7a5e96629c38427358b62333486419
3c2df99bf5c819662e66c8ab5fa090c1ecf9f318
refs/heads/master
2016-08-05T20:32:52.743968
2014-10-24T12:37:00
2014-10-24T12:37:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
349
java
package es.upm.miw.pd.composite.expression; public abstract class ExpresionBinaria extends Expresion { protected Expresion operando_1; protected Expresion operando_2; protected String simbolo_operacion; @Override public String toString(){ return "("+this.operando_1.toString()+this.simbolo_operacion+this.operando_2.toString()+")"; } }
709a0e59c57390c740c1856a70da645d7dd9fda6
1e52e2db2f19ab8648f7d7359d46614dccf82272
/src/main/java/com/zeroten/javaless/proxy/User2Dao.java
628194c3253e20c44f191e9e7d882468e6a2f5b3
[]
no_license
huanbaoi/java_les
e60f0ce3e5312dfad516f73a706041fe64cacf79
919cf86383a659ef2f173113ab68aaad22277101
refs/heads/master
2020-11-23T23:18:07.010760
2020-01-16T14:54:34
2020-01-16T14:54:34
227,860,323
0
0
null
2020-10-13T18:11:57
2019-12-13T14:43:55
Java
UTF-8
Java
false
false
189
java
package com.zeroten.javaless.proxy; public class User2Dao { public boolean save(User user) { System.out.println("保存成功" + user.toString()); return true; } }
b0dc70c13627851edd94d7f1a0fecf46603f67d2
dc373f2fba5de556035d3cf68e7440b19d8b18e0
/app/src/main/java/gokenya/safari/com/Safaris/KenyaSafariBeach.java
daa10a0c7a9d5b99bc3ce89124841acce7fb2af3
[]
no_license
MkReuben/GoKenyaSafari
98c2a1563f2d535d018ef449a074ee680dd33e56
2604786ab883ca9b7b64813d00f52e20087f72dc
refs/heads/master
2020-12-28T15:40:56.811050
2020-02-05T07:29:08
2020-02-05T07:29:08
238,391,770
4
0
null
null
null
null
UTF-8
Java
false
false
1,809
java
package gokenya.safari.com.Safaris; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; import gokenya.safari.com.R; public class KenyaSafariBeach extends AppCompatActivity { private ImageView call; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_kenya_safari_beach); call=findViewById(R.id.callus); call.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "+254723321938")); if (ContextCompat.checkSelfPermission(KenyaSafariBeach.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(KenyaSafariBeach.this, new String[]{Manifest.permission.CALL_PHONE},1); } else { startActivity(intent); } } }); String [] kenyasafaribeach=getResources().getStringArray(R.array.kenya_safaris_and_beach); ListView listView=(ListView)findViewById(R.id.kenya_safari_beach); ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,kenyasafaribeach); listView.setAdapter(adapter); } }
daf58c538d58b35db408915ad6ab774c145e6a1c
e8e48a96f2aba9040f4f55ab61efaab1a9eb6a23
/Leetcode/439-ternary-expression-parser/Solution.java
4af0d0e1be059bf8bc281f12f4c81c1c3fe799b4
[]
no_license
arnabs542/algorithmic-problems
67342172c2035d9ffb2ee2bf0f1901e651dcce12
5d19d2e9cddc20e8a6949ac38fe6fb73dfc81bf4
refs/heads/master
2021-12-14T05:41:50.177195
2017-04-15T07:42:41
2017-04-15T07:42:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,299
java
/* Given a string representing arbitrarily nested ternary expressions, calculate the result of the expression. You can always assume that the given expression is valid and only consists of digits 0-9, ?, :, T and F (T and F represent True and False respectively). Note: The length of the given string is ≤ 10000. Each number will contain only one digit. The conditional expressions group right-to-left (as usual in most languages). The condition will always be either T or F. That is, the condition will never be a digit. The result of the expression will always evaluate to either a digit 0-9, T or F. Example 1: Input: "T?2:3" Output: "2" Explanation: If true, then result is 2; otherwise result is 3. Example 2: Input: "F?1:T?4:5" Output: "4" Explanation: The conditional expressions group right-to-left. Using parenthesis, it is read/evaluated as: "(F ? 1 : (T ? 4 : 5))" "(F ? 1 : (T ? 4 : 5))" -> "(F ? 1 : 4)" or -> "(T ? 4 : 5)" -> "4" -> "4" Example 3: Input: "T?T?F:5:3" Output: "F" Explanation: The conditional expressions group right-to-left. Using parenthesis, it is read/evaluated as: "(T ? (T ? F : 5) : 3)" "(T ? (T ? F : 5) : 3)" -> "(T ? F : 3)" or -> "(T ? F : 5)" -> "F" -> "F" */ // Recursive public class Solution { int start; int n; public String parse(String expression) { if(start + 1 < n && expression.charAt(start + 1) == '?'){ // T or F char c = expression.charAt(start); // skip the T/F and ? start += 2; String trueResult = parse(expression); // skip : start++; String falseResult = parse(expression); return c == 'T' ? trueResult : falseResult; } else{ start += 1; // return the 1 char letter return expression.substring(start-1, start); } } public String parseTernary(String expression) { n = expression.length(); start = 0; return parse(expression); } } // Stack class Solution2 { public String parseTernary(String expression) { Deque<Character> stk = new LinkedList<>(); for(int i=expression.length()-1; i>=0; i--){ char c = expression.charAt(i); // If this character is either T or F // evaluate if(!stk.isEmpty() && stk.peekFirst() == '?'){ // pop ? stk.pop(); // true value char a = stk.pop(); // pop : stk.pop(); // false value char b = stk.pop(); if(c == 'T') stk.push(a); else stk.push(b); } else{ stk.push(c); } } return String.valueOf(stk.pop()); } } class Solution3 { public String parseTernary(String expression) { Deque<String> stk = new LinkedList<>(); int n = expression.length(); int i = n-1; StringBuilder str = new StringBuilder(); while(i >= 0){ char c = expression.charAt(i); if(c == ':'){ if(str.length() > 0){ stk.addFirst(str.toString()); } str.setLength(0); } else if(c == '?'){ if(str.length() > 0){ stk.addFirst(str.toString()); str.setLength(0); } i--; c = expression.charAt(i); String a = stk.removeFirst(); String b = stk.removeFirst(); if(c == 'T'){ stk.addFirst(a); } else{ stk.addFirst(b); } } else{ str.setLength(0); str.append(c); } i--; } return stk.removeFirst(); } }
7af5e36823bb1b3af3413e8ee51b8213f0b6dcf9
a95444338757eaf926e91532622b0b429fdb32e8
/src/pro3/Main1.java
ca2fe1f667a6b5e1fbdd9bdcd8a31b272fc2a3e5
[]
no_license
souring001/Shape-Drawing
bf4ebdf95460947299180c908bff55402d9173ce
4b54b71e9d1ac81cdd553dfc743b45d7f7a968ac
refs/heads/master
2021-01-22T08:52:51.274166
2017-05-28T05:06:36
2017-05-28T05:06:36
92,640,590
0
0
null
null
null
null
UTF-8
Java
false
false
2,068
java
package pro3; import pro3.shape.*; import pro3.target.*; /** 動く自動車を描画するデモ */ public class Main1{ /** メインメソッド * @param args このプログラムでは値は使用されません */ public static void main(String[] args){ ShapeManager sm = new ShapeManager(); Target target; target = new WindowTarget("DisplayShapes"); // target = new TextTarget(System.out); Attribute bodycolor = new Attribute(); Attribute tirecolor = new Attribute(); Attribute lampcolor = new Attribute(); Attribute windowcolor = new Attribute(); Attribute black = new Attribute(); bodycolor.setColor(255, 0, 0); tirecolor.setColor(0, 0, 0); lampcolor.setColor(255, 255, 0); int lampi=0; windowcolor.setColor(0, 255, 255); black.setColor(0, 0, 0); black.setFill(false); while(true){ for(int i=-190;i<330;i++){ lampi = (lampi+4)%256; lampcolor.setColor(lampi, lampi, 0); target.clear(sm); Shape s; s = new Rectangle(0, 118+i, 125, 72, 25); s.setAttribute(bodycolor); sm.put(s); s = new Rectangle(1, 118+i, 95, 50, 30); s.setAttribute(bodycolor); sm.put(s); s = new Rectangle(2, 138+i, 100, 30, 28); s.setAttribute(windowcolor); sm.put(s); s = new Circle(3, 185+i, 130, 4); s.setAttribute(lampcolor); sm.put(s); s = new Circle(4, 170+i,150,15); s.setAttribute(tirecolor); sm.put(s); s = new Circle(5, 135+i,150,15); s.setAttribute(tirecolor); sm.put(s); s = new Rectangle(10, 40+i,120,60,5); s.setAttribute(black); sm.put(s); s = new Rectangle(11, 30+i,140,60,5); s.setAttribute(black); sm.put(s); s = new Rectangle(12, 45+i,150,60,5); s.setAttribute(black); sm.put(s); target.draw(sm); target.flush(); try{ Thread.sleep(10); }catch(InterruptedException e){ } } } } }
74fbcbe0991c56a775bc18bef77f11d0899fbac7
5a43be54e9d1890e69f0bd6e78dd0da301820fd9
/easy/Find-The-Highest-Score/Find-The-Highest-Score.java
5d36df75a36bb56212b7d8446ffa7221d6915956
[]
no_license
ronmelcuba10/CodeEval
26ab1412675f397544acb4550337aeb579f31ed4
cf342a47db8f6b0718d21b35dfefb2cfc27d542d
refs/heads/master
2021-01-21T04:50:39.930868
2016-06-10T17:05:26
2016-06-10T17:05:26
51,757,087
0
0
null
null
null
null
UTF-8
Java
false
false
1,128
java
import java.io.*; public class Main { public static void main (String[] args) throws IOException { File file = new File(args[0]); BufferedReader buffer = new BufferedReader(new FileReader(file)); String line; while ((line = buffer.readLine()) != null) { line = line.trim(); // Process line of input Here GetNums(line); } } static void GetNums(String line){ String[] artists = line.split("\\|"); int arts = artists.length; int cate = artists[0].trim().split(" ").length; int[][] eval = new int[arts][cate]; for(int i=0;i<arts;i++){ String[] cateStr = artists[i].trim().split(" "); for(int j=0;j<cate;j++){ eval[i][j] = Integer.valueOf(cateStr[j]); } } int max; for(int i=0;i<cate;i++){ max=eval[0][i];; for(int j=0;j<arts;j++){ if(eval[j][i]>max) max=eval[j][i]; } System.out.print(max + " "); } System.out.println(); } }
ffc18c6abc99300c4b7d6860369fdfd5bc355eee
09c0498d9ab6534c705e23a3876cd9dc7f4bf291
/src/day18/WebtableTesting2.java
0931db8b261e57a87b0608333d248634d26277fa
[]
no_license
SaiKrishna12/May25Batch
3d8b5c1d3eb9bb4b7e35c5ed330452f94edb354c
0dac1f36ae8bf0446375e02616383ff5e9fb577f
refs/heads/master
2020-06-06T14:27:20.340585
2015-07-10T14:37:19
2015-07-10T14:37:19
39,013,168
0
0
null
null
null
null
UTF-8
Java
false
false
960
java
package day18; import org.openqa.selenium.By; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.firefox.internal.ProfilesIni; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class WebtableTesting2 { FirefoxDriver driver; @BeforeMethod public void setUp() { ProfilesIni pr=new ProfilesIni(); FirefoxProfile fp=pr.getProfile("SeleniumUser"); driver=new FirefoxDriver(fp); driver.get("http://www.timeanddate.com/worldclock/"); } @Test public void webtableTest() { String part1="html/body/div[1]/div[7]/section[2]/div[1]/table/tbody/tr["; String part2="]/td["; String part3="]"; for(int i=1;i<=37;i++) { for(int j=1;j<=8;j++) { String x=driver.findElement(By.xpath (part1+i+part2+j+part3)).getText(); System.out.print(x+" "); } System.out.println(); } } }
f14504426e45193a83c8d99a4df0821d574957c1
1fcb62696ec7413cc6a2e5c8c67d430d51a665c7
/src/iso-tc211-xml/src/generated/java/org/isotc211/iso19139/gmd/MDIdentifierType.java
fd2c289cc5ba57b84bb51cdda07a780f3a67e37d
[ "BSD-2-Clause", "BSD-3-Clause" ]
permissive
florianesser/excel-adapter
cd1836dad969e6b481396997a3f4abd4e38029e9
16b98486da3702ee958c5c0155a77520a0722906
refs/heads/master
2021-01-08T08:11:40.938728
2019-05-24T10:02:34
2019-05-24T10:02:34
241,966,970
0
0
NOASSERTION
2020-02-20T19:06:34
2020-02-20T19:06:34
null
UTF-8
Java
false
false
2,866
java
/** */ package org.isotc211.iso19139.gmd; import org.isotc211.iso19139.gco.AbstractObjectType; import org.isotc211.iso19139.gco.CharacterStringPropertyType; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>MD Identifier Type</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link org.isotc211.iso19139.gmd.MDIdentifierType#getAuthority <em>Authority</em>}</li> * <li>{@link org.isotc211.iso19139.gmd.MDIdentifierType#getCode <em>Code</em>}</li> * </ul> * * @see org.isotc211.iso19139.gmd.GMDPackage#getMDIdentifierType() * @model extendedMetaData="name='MD_Identifier_Type' kind='elementOnly'" * @generated */ public interface MDIdentifierType extends AbstractObjectType { /** * Returns the value of the '<em><b>Authority</b></em>' containment reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Authority</em>' containment reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Authority</em>' containment reference. * @see #setAuthority(CICitationPropertyType) * @see org.isotc211.iso19139.gmd.GMDPackage#getMDIdentifierType_Authority() * @model containment="true" * extendedMetaData="kind='element' name='authority' namespace='##targetNamespace'" * @generated */ CICitationPropertyType getAuthority(); /** * Sets the value of the '{@link org.isotc211.iso19139.gmd.MDIdentifierType#getAuthority <em>Authority</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Authority</em>' containment reference. * @see #getAuthority() * @generated */ void setAuthority(CICitationPropertyType value); /** * Returns the value of the '<em><b>Code</b></em>' containment reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Code</em>' containment reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Code</em>' containment reference. * @see #setCode(CharacterStringPropertyType) * @see org.isotc211.iso19139.gmd.GMDPackage#getMDIdentifierType_Code() * @model containment="true" required="true" * extendedMetaData="kind='element' name='code' namespace='##targetNamespace'" * @generated */ CharacterStringPropertyType getCode(); /** * Sets the value of the '{@link org.isotc211.iso19139.gmd.MDIdentifierType#getCode <em>Code</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Code</em>' containment reference. * @see #getCode() * @generated */ void setCode(CharacterStringPropertyType value); } // MDIdentifierType
9a141f9eb27d3b02667f7100ca1e8f1cde625a96
906c2d12bfa64e6a67414170e147262fe969145a
/src/TextRedactor.java
d284564c3541ecd9553861014895fd561dbf4004
[]
no_license
whimzey/Text_Redactor
6f220a9ed3681400451b40a762bdd9fcaf6ed7e0
eb504f8141f3e6f897d812994be3275b2e7bfb7c
refs/heads/master
2021-01-10T02:15:12.248481
2016-02-23T08:49:08
2016-02-23T08:49:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,666
java
import javax.swing.*; import java.awt.*; import java.io.*; /** * Created by ������� �����-������ on 08.05.2015. */ public class TextRedactor { private File lastfile; public void build() { JFrame frame = new JFrame("Text"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setBounds(100, 100, 400, 300); JTextArea textArea = new JTextArea(); textArea.setLineWrap(true); JScrollPane scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); JMenuBar menu = new JMenuBar(); JMenu menubar = new JMenu("Menu"); JMenuItem open = new JMenuItem("Open"); JMenuItem newfile = new JMenuItem("New"); JMenuItem save = new JMenuItem("Save"); JMenuItem saveAs = new JMenuItem("Save as"); menubar.add(newfile); menubar.add(open); menubar.add(save); menubar.add(saveAs); menu.add(menubar); frame.add(BorderLayout.CENTER, scrollPane); frame.setJMenuBar(menu); frame.setVisible(true); newfile.addActionListener(e -> { JFrame quest = new JFrame("Please, choose"); quest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); quest.setBounds(100, 100, 400, 300); JLabel issaving = new JLabel("Save file before closing?"); JPanel panel = new JPanel(); JButton ok = new JButton("OK"); JButton no = new JButton("No"); panel.add(ok); panel.add(no); ok.addActionListener(e1 -> { JFileChooser chooser = new JFileChooser(); int returnValue = chooser.showOpenDialog(frame); try { if (returnValue == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); PrintWriter writer = new PrintWriter(file); writer.println(textArea.getText()); writer.close(); } } catch (IOException g) { g.printStackTrace(); } }); no.addActionListener(e1 -> { quest.dispose(); lastfile = null; textArea.setText(""); }); quest.add(BorderLayout.CENTER, issaving); quest.add(BorderLayout.SOUTH,panel); quest.setVisible(true); lastfile = null; textArea.setText(""); }); open.addActionListener(e -> { JFileChooser chooser = new JFileChooser(); int returnValue = chooser.showOpenDialog(frame); if (returnValue == JFileChooser.APPROVE_OPTION) { try { File file = chooser.getSelectedFile(); String path = file.getAbsolutePath(); BufferedReader reader = new BufferedReader( new InputStreamReader(new FileInputStream(path)) ); String text; while ((text = reader.readLine()) != null) { textArea.setText(textArea.getText() + text + "\n"); } lastfile = file; reader.close(); } catch (IOException d) { d.printStackTrace(); } } }); saveAs.addActionListener(e -> { JFileChooser chooser = new JFileChooser(); int returnValue = chooser.showOpenDialog(frame); try { if (returnValue == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); PrintWriter writer = new PrintWriter(file); writer.println(textArea.getText()); writer.close(); } } catch (IOException g) { g.printStackTrace(); } }); save.addActionListener(e -> { try { if (lastfile != null) { PrintWriter writer = new PrintWriter(lastfile); writer.println(textArea.getText()); writer.close(); } else { JFileChooser chooser = new JFileChooser(); int returnValue = chooser.showOpenDialog(frame); try { if (returnValue == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); PrintWriter writer = new PrintWriter(file); writer.println(textArea.getText()); writer.close(); } } catch (IOException g) { g.printStackTrace(); } } } catch (IOException g) { g.printStackTrace(); } }); } }
9b825b0ab789675a11d039c1f2f4452d7d26bd4e
fc577d19015f269c78468989163d62e49bb2cc71
/src/java/ModeloDAO/CategoriaDAO.java
edd3cd6856c9efbac4c440629a9480d77ce1a0ab
[]
no_license
Nicole-nrvp/Proyecto2242760
8efe5f54586eb2fec765119925b037c272f770ca
9f460dde0cb43b1d12dbc960685f0314a75871d6
refs/heads/master
2023-06-12T03:58:01.952881
2021-07-03T03:55:04
2021-07-03T03:55:04
378,148,099
0
0
null
null
null
null
UTF-8
Java
false
false
2,683
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ModeloDAO; import ModeloVO.CategoriaVO; import Util.Conexión; import java.sql.*; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author usuario */ public class CategoriaDAO extends Conexión{ private Connection conexion; private PreparedStatement puente; private ResultSet mensajero; private boolean operaciones = false; private String sql; public CategoriaDAO (){ } public ArrayList<CategoriaVO> listar(){ ArrayList<CategoriaVO>listaCategorias= new ArrayList<>(); try { conexion= this.obtenerConexión(); sql="select * from categoria"; puente = conexion.prepareStatement(sql); mensajero = puente.executeQuery(); while(mensajero.next()){ CategoriaVO catVO = new CategoriaVO(mensajero.getString(1), mensajero.getString(2)); listaCategorias.add(catVO); } } catch (Exception e) { Logger.getLogger(CategoriaDAO.class.getName()).log(Level.SEVERE, null,e); }finally{ try { this.cerrarConexión(); } catch (SQLException e) { Logger.getLogger(CategoriaDAO.class.getName()).log(Level.SEVERE, null,e); } } return listaCategorias; } public ArrayList<CategoriaVO> listarCategoria(String tipo){ ArrayList<CategoriaVO>listaTipo= new ArrayList<>(); try { conexion= this.obtenerConexión(); sql="SELECT * FROM `categoria` WHERE CATIPO=? "; puente = conexion.prepareStatement(sql); puente.setString(1, tipo); mensajero = puente.executeQuery(); while(mensajero.next()){ CategoriaVO catVO = new CategoriaVO(mensajero.getString(1), mensajero.getString(2)); listaTipo.add(catVO); } } catch (Exception e) { Logger.getLogger(CategoriaDAO.class.getName()).log(Level.SEVERE, null,e); }finally{ try { this.cerrarConexión(); } catch (SQLException e) { Logger.getLogger(CategoriaDAO.class.getName()).log(Level.SEVERE, null,e); } } return listaTipo; } }
ac07daeedfa6b4f379a1079ba6b85e83cadb9516
8b9b454cffd5f60776ae9743f8fdd0e8663628bc
/quill/src/main/java/com/aaaaahhhhhhh/bananapuncher714/quill/resourcepack/ZipWrapper.java
e8e1b793598a764907c8c361c854967d12915fec
[ "MIT" ]
permissive
MineInAbyss/Quill
68c69a7d625b4150d1f8f45f0dafb04117635595
d9940025453c099d818427368c1f1b3cd47388f4
refs/heads/master
2023-06-27T19:57:02.131946
2021-07-22T23:39:29
2021-07-22T23:39:29
343,574,836
0
0
null
null
null
null
UTF-8
Java
false
false
4,655
java
package com.aaaaahhhhhhh.bananapuncher714.quill.resourcepack; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.file.CopyOption; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.OpenOption; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.zip.ZipException; import java.util.zip.ZipOutputStream; import javax.imageio.ImageIO; public class ZipWrapper { protected final Path zipFile; protected FileSystem zipfs; public ZipWrapper( Path resource ) throws IOException { zipFile = resource; Files.createDirectories( resource.getParent() ); if ( !Files.exists( resource ) ) { ZipOutputStream out = new ZipOutputStream( Files.newOutputStream( resource ) ); out.close(); } } public Path getFile() { return zipFile; } public boolean contains( String path ) throws ZipException, IOException { FileSystem zipfs = getZipfs(); Path internal = zipfs.getPath( path ); return Files.exists( internal ); } public void addImage( String path, BufferedImage image, OpenOption... options ) throws IOException { FileSystem zipfs = getZipfs(); Path internal = zipfs.getPath( path ); if ( internal.getParent() != null ) { Files.createDirectories( internal.getParent() ); } ByteArrayOutputStream os = new ByteArrayOutputStream(); ImageIO.write( image, "png", os ); Files.write( internal, os.toByteArray(), options ); } public void addElement( String path, byte[] write, OpenOption... options ) throws IOException { FileSystem zipfs = getZipfs(); Path internal = zipfs.getPath( path ); if ( internal.getParent() != null ) { Files.createDirectories( internal.getParent() ); } Files.write( internal, write, options ); } public void addElement( String path, File file, CopyOption... options ) throws IOException { FileSystem zipfs = getZipfs(); Path external = Paths.get( file.getAbsolutePath() ); Path internal = zipfs.getPath( path ); if ( internal.getParent() != null ) { Files.createDirectories( internal.getParent() ); } Files.copy( external, internal, options ); } public void addElement( String path, Path file, CopyOption... options ) throws IOException { FileSystem zipfs = getZipfs(); Path internal = zipfs.getPath( path ); if ( internal.getParent() != null ) { Files.createDirectories( internal.getParent() ); } Files.copy( file, internal, options ); } public InputStream readElement( String path, OpenOption... options ) throws IOException { FileSystem zipfs = getZipfs(); Path internal = zipfs.getPath( path ); if ( internal != null ) { if ( Files.exists( internal ) ) { return Files.newInputStream( internal, options ); } } return null; } public void removeElement( String path, File callback, CopyOption... options ) throws IOException { FileSystem zipfs = getZipfs(); Path internal = zipfs.getPath( path ); if ( internal != null ) { if ( !Files.exists( internal ) ) { return; } if ( callback != null ) { callback.getParentFile().mkdirs(); Files.move( internal, Paths.get( callback.getAbsolutePath() ), options ); } else { Files.delete( internal ); } } } public List< String > listElements( String path ) throws IOException { FileSystem zipfs = getZipfs(); Path internal = zipfs.getPath( path ); if ( internal != null ) { if ( !Files.exists( internal ) ) { return null; } List< String > files = new ArrayList< String >(); for ( Path file: Files.newDirectoryStream( internal ) ) { files.add( file.getFileName().toString() ); } return files; } return null; } public List< String > walkElements( String path ) throws IOException { FileSystem zipfs = getZipfs(); Path internal = zipfs.getPath( path ); if ( internal != null ) { if ( !Files.exists( internal ) ) { return null; } List< String > files = new ArrayList< String >(); Files.walk( internal ).forEach( file -> { files.add( internal.relativize( file ).toString() ); } ); return files; } return null; } private FileSystem getZipfs() throws IOException { if ( zipfs == null ) { zipfs = FileSystems.newFileSystem( zipFile, ( ClassLoader ) null ); } return zipfs; } public boolean close() throws IOException { if ( zipfs != null && zipfs.isOpen() ) { zipfs.close(); zipfs = null; return true; } zipfs = null; return false; } }
0843dde50471a1449ae0d3ca3a5c2d460e932e58
d9d96ef1880ab53366430e20de97dafe87fa30c8
/小贷平台反编译/cashloan-base/cashloan-cl/src/main/java/com/cashloan/cl/mapper/SmsTplMapper.java
6b39a448d11707bb944f801867cd0fb81f1d6392
[]
no_license
zxxroot/ymzl
22dbf6042bba091fd6978776aef7f3481c00759c
8b6174c65803db7892c091a35b36d9a3d958bbe3
refs/heads/master
2020-05-15T11:52:25.487428
2019-04-19T10:35:37
2019-04-19T10:35:37
182,246,163
0
1
null
null
null
null
UTF-8
Java
false
false
277
java
package com.cashloan.cl.mapper; import com.cashloan.cl.domain.SmsTpl; import com.rongdu.cashloan.core.common.mapper.BaseMapper; import com.rongdu.cashloan.core.common.mapper.RDBatisDao; @RDBatisDao public abstract interface SmsTplMapper extends BaseMapper<SmsTpl, Long> {}
83f9f1acf2ca8d9f903d36948e24acde7a1f7056
194b1340172892d5d299f5e4c11ca3680ac74ce2
/msk2/src/main/java/com/krishagni/openspecimen/msk2/services/CarsStudyImporter.java
93e1f1e3f1331f58af23004304808c062462fe09
[]
no_license
krishagni/os-extensions
05f92686f043f09ec81195f97a596d34bb62684d
7521d163887fc2db6707470a922d5b441d65911f
refs/heads/master
2023-09-01T04:56:14.111973
2023-08-28T12:32:31
2023-08-28T12:32:31
40,657,853
1
5
null
2022-02-09T08:27:05
2015-08-13T12:35:44
Java
UTF-8
Java
false
false
113
java
package com.krishagni.openspecimen.msk2.services; public interface CarsStudyImporter { void importStudies(); }
a7100a11c14edd91dad545c37680b1a3a5f04912
34e94a9a16abde4b096a6e3f4e1ad19151ee7969
/src/main/java/com/camel/kafka/KafkaCamelSpringApplication.java
2e2f1047112109ccdf27c7725e893159568a978f
[]
no_license
suhabb/Hercules
15f226e94d32dcd9f61887dc0382a7a095e21ab5
e0a5e2ecc8e60fd1ccf5bea02005993cd14ae66b
refs/heads/master
2022-10-05T19:29:07.451953
2020-04-06T21:24:05
2020-04-06T21:24:05
158,084,578
0
0
null
2022-09-22T19:09:37
2018-11-18T13:05:29
Java
UTF-8
Java
false
false
327
java
package com.camel.kafka; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class KafkaCamelSpringApplication { public static void main(String[] args) { SpringApplication.run(KafkaCamelSpringApplication.class, args); } }
0d87a76582deacb2b497e1aec4070bd125ae689c
0c88d5531ea92fcc7ff891f81be5048634161831
/src/main/java/com/bbs/pojo/PageDTO.java
b52e1a2faa4ac7269f093262cb3c4075b99b72b3
[ "LicenseRef-scancode-unknown-license-reference", "MulanPSL-1.0", "LicenseRef-scancode-mulanpsl-1.0-en" ]
permissive
cnnf/spring-boot-BBS
fb5f291a6181f1d21efcafb8cc1ff8e55d995b76
1237e86606c05dfdeeeace2da8d538da287107ae
refs/heads/master
2022-10-22T13:39:07.620832
2020-06-11T09:16:33
2020-06-11T09:16:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,346
java
package com.bbs.pojo; import lombok.Data; import java.util.ArrayList; import java.util.List; /** * 分页实体类 */ @Data public class PageDTO { private List<Question> questions; private boolean showLast; private boolean showFirstPage; private boolean showNext; private boolean showEndPage; private Integer page = 0; //默认为0 private List<Integer> pages; /** * 计算分页 */ public void count (){ if (this.questions.size() % 10 != 0){ this.page = this.questions.size() / 10+1; }else{ this.page = this.questions.size() /10; } } /** * 给list 循环赋值 (有多少页循环多少次) */ public void quesListSize(){ this.pages = new ArrayList<>(); for (int i=0;i<this.page ; i++){ this.pages.add(1); } } /** * 快捷 页 赋值 */ public void showOrhide(){ if (this.page == 0){ this.showLast = false; this.showFirstPage = false; this.showEndPage = true; this.showNext = true; }else if(this.page == this.pages.size()){ this.showLast = true; this.showFirstPage = true; this.showEndPage = false; this.showNext = false; } } }
1c66f11695aa964f64c4ea3bf4d7480af9ca9566
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes8.dex_source_from_JADX/com/facebook/reviews/feed/ReviewsFeedInlineReviewController.java
60d3b1e6fe06ce1ff73a8edbd7b57a3abe8037d9
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
2,024
java
package com.facebook.reviews.feed; import android.app.Activity; import android.view.View; import android.view.View.OnClickListener; import com.facebook.analytics.CurationMechanism; import com.facebook.loom.logger.LogEntry.EntryType; import com.facebook.loom.logger.Logger; import com.facebook.reviews.analytics.ReviewsLogger; import com.facebook.user.model.User; import javax.inject.Inject; import javax.inject.Provider; /* compiled from: Trying to replace a story without id */ public class ReviewsFeedInlineReviewController { public final Provider<User> f21554a; public final ReviewsFeedComposerLauncherAndHandler f21555b; public final ReviewsLogger f21556c; /* compiled from: Trying to replace a story without id */ public class C23051 implements OnClickListener { final /* synthetic */ String f21550a; final /* synthetic */ Activity f21551b; final /* synthetic */ String f21552c; final /* synthetic */ ReviewsFeedInlineReviewController f21553d; public C23051(ReviewsFeedInlineReviewController reviewsFeedInlineReviewController, String str, Activity activity, String str2) { this.f21553d = reviewsFeedInlineReviewController; this.f21550a = str; this.f21551b = activity; this.f21552c = str2; } public void onClick(View view) { int a = Logger.a(2, EntryType.UI_INPUT_START, 479566455); this.f21553d.f21556c.b("reviews_feed", this.f21550a); this.f21553d.f21555b.m25113a(this.f21551b, CurationMechanism.INLINE_REVIEW, this.f21550a, this.f21552c); Logger.a(2, EntryType.UI_INPUT_END, -2124251837, a); } } @Inject public ReviewsFeedInlineReviewController(Provider<User> provider, ReviewsFeedComposerLauncherAndHandler reviewsFeedComposerLauncherAndHandler, ReviewsLogger reviewsLogger) { this.f21554a = provider; this.f21555b = reviewsFeedComposerLauncherAndHandler; this.f21556c = reviewsLogger; } }
29c7add8f95b9405c23b8b64ec02d2368b4e30f4
1a652622bd70b676bc5b3444cc263e9a199ba178
/app/src/main/java/com/kkopite/videoaudiostudy/c2/AudioActivity.java
822d2cce93800d7ea26083b41f8efd88e7b261a0
[]
no_license
action-hong/VideoAudioStudy
e146d82a195197bd6fff320dd34e929915f4e815
6d7891396bbfe34f7cf2a517761827d682cb1140
refs/heads/master
2020-03-19T13:51:21.587677
2018-06-14T10:00:55
2018-06-14T10:00:55
136,597,843
1
1
null
null
null
null
UTF-8
Java
false
false
6,579
java
package com.kkopite.videoaudiostudy.c2; import android.os.Bundle; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import com.kkopite.videoaudiostudy.R; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class AudioActivity extends AppCompatActivity implements View.OnClickListener, AudioCapture.OnAudioFrameCapturedListener, AudioEncoder.OnAudioEncodedListener, AudioDecoder.OnAudioDecodedListener { private Button mBtnCapture; private Button mBtnStop; private Button mBtnPlay; // TODO 1 音频PCM 采集, 播放(PS: 录的声音大一点, 不然还以为是没有成功) // TODO 2 读写音频 wav 文件 private AudioPlayer mPlayer = new AudioPlayer(); private AudioCapture mAudioCapture = new AudioCapture(); private AudioEncoder mAudioEncoder = new AudioEncoder(); private AudioDecoder mAudioDecoder = new AudioDecoder(); private File mWavDir; private List<byte[]> datas = new ArrayList<>(); private byte[] audios; private Button mBtnStopPlay; private WavFileWriter mWriter = new WavFileWriter(); private WavFileReader mReader = new WavFileReader(); private String mFilePath; private static final int SAMPLES_PER_FRAME = 1024; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_audio); initView(); } private void initView() { mBtnCapture = (Button) findViewById(R.id.btn_capture); mBtnStop = (Button) findViewById(R.id.btn_stop); mBtnPlay = (Button) findViewById(R.id.btn_play); mBtnCapture.setOnClickListener(this); mBtnStop.setOnClickListener(this); mBtnPlay.setOnClickListener(this); mAudioCapture.setAudioFrameCapturedListener(this); mBtnStopPlay = (Button) findViewById(R.id.btn_stop_play); mBtnStopPlay.setOnClickListener(this); File file = new File(Environment.getExternalStorageDirectory(), getPackageName()); if (!file.exists()) { file.mkdir(); } mWavDir = file; mAudioDecoder.open(); mAudioEncoder.open(); mAudioEncoder.setAudioEncodedListener(this); mAudioDecoder.setAudioDecodedListener(this); new Thread(mEncodeRenderRunnable).start(); new Thread(mDecodeRenderRunnable).start(); mAudioCapture.startCapture(); mPlayer.startPlayer(); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_capture: datas.clear(); try { mFilePath = generateFilePath(); mWriter.openFile(mFilePath, AudioCapture.DEFAULT_SAMPLE_RATE, 1, 16); } catch (IOException e) { e.printStackTrace(); } mAudioCapture.startCapture(); break; case R.id.btn_stop: mAudioCapture.stopCapture(); // byte[] tmp = new byte[]{}; // for (byte[] data : datas) { // tmp = concatAll(tmp, data); // } // audios = tmp; try { mWriter.closeFile(); } catch (IOException e) { e.printStackTrace(); } break; case R.id.btn_play: try { mReader.openFile(mFilePath); } catch (IOException e) { e.printStackTrace(); } mPlayer.startPlayer(); mIsTestingExit = false; new Thread(AudioPlayRunnable).start(); // for (byte[] data : datas) { // mPlayer.play(data, 0, data.length); // } break; case R.id.btn_stop_play: mIsTestingExit = true; mPlayer.stopPlayer(); break; } } @Override public void onAudioFrameCaptured(byte[] audioData) { datas.add(audioData); mWriter.writeData(audioData, 0, audioData.length); long presentationTimeUs = (System.nanoTime()) / 1000L; mAudioEncoder.encode(audioData, presentationTimeUs); } public static byte[] concatAll(byte[] first, byte[] rest) { int totalLength = first.length; totalLength += rest.length; byte[] result = Arrays.copyOf(first, totalLength); int offset = first.length; System.arraycopy(rest, 0, result, offset, rest.length); return result; } private String generateFilePath() { String name = System.currentTimeMillis() + ".wav"; return new File(mWavDir, name).getPath(); } private volatile boolean mIsTestingExit = false; @Override protected void onPause() { super.onPause(); mIsTestingExit = true; } private Runnable AudioPlayRunnable = new Runnable() { @Override public void run() { // 音乐缓存区大小一般是 一帧的 2~N倍 // 这里去 2倍 // 额 byte[] buffer = new byte[SAMPLES_PER_FRAME * 2]; while (!mIsTestingExit && mReader.readData(buffer, 0, buffer.length) > 0){ mPlayer.play(buffer, 0, buffer.length); } mPlayer.stopPlayer(); try { mReader.closeFile(); } catch (IOException e) { e.printStackTrace(); } } }; @Override public void onFrameEncoded(byte[] encoded, long presentationTimeUs) { mAudioDecoder.decode(encoded, presentationTimeUs); } private Runnable mEncodeRenderRunnable = new Runnable() { @Override public void run() { while (!mIsTestingExit) { mAudioEncoder.retrieve(); } mAudioEncoder.close(); } }; private Runnable mDecodeRenderRunnable = new Runnable() { @Override public void run() { while (!mIsTestingExit) { mAudioDecoder.retrieve(); } mAudioDecoder.close(); } }; @Override public void onFrameDecoded(byte[] decoded, long presentationTimeUs) { mPlayer.play(decoded, 0, decoded.length); } }
a52e3652d617e137b60ab9124f6edc19bce2797d
16e5895cc93d6d013e2a472f0243d54b26b94f87
/back/src/main/java/com/example/gccoffee/model/Product.java
a5be2e9ccea749ca4366e35870de22c3ecaa7af9
[]
no_license
16min99/Coffee
c5aff17b93295902e9d95f94841c24778e563145
85f7a42b7be8b40e46d71f6450db4246a8a9e462
refs/heads/main
2023-08-02T12:50:16.042557
2021-09-30T10:09:01
2021-09-30T10:09:01
410,511,781
0
0
null
null
null
null
UTF-8
Java
false
false
2,126
java
package com.example.gccoffee.model; import java.time.LocalDateTime; import java.util.UUID; public class Product { private final UUID productId; private String productName; private Category category; private long price; private String description; private final LocalDateTime createdAt; private LocalDateTime updatedAt; public Product(UUID productId, String productName, Category category, long price) { this.productId = productId; this.productName = productName; this.category = category; this.price = price; this.createdAt = LocalDateTime.now(); this.updatedAt = LocalDateTime.now(); } public Product(UUID productId, String productName, Category category, long price, String description, LocalDateTime createdAt, LocalDateTime updatedAt) { this.productId = productId; this.productName = productName; this.category = category; this.price = price; this.description = description; this.createdAt = createdAt; this.updatedAt = updatedAt; } public UUID getProductId() { return productId; } public String getProductName() { return productName; } public Category getCategory() { return category; } public long getPrice() { return price; } public String getDescription() { return description; } public LocalDateTime getCreatedAt() { return createdAt; } public LocalDateTime getUpdatedAt() { return updatedAt; } public void setProductName(String productName) { this.productName = productName; this.updatedAt = LocalDateTime.now(); } public void setCategory(Category category) { this.category = category; this.updatedAt = LocalDateTime.now(); } public void setPrice(long price) { this.price = price; this.updatedAt = LocalDateTime.now(); } public void setDescription(String description) { this.description = description; this.updatedAt = LocalDateTime.now(); } }
b800f76d79a4bc6832d9cc07340c4152986813e9
a8ba5ff63e4af6c9c26ef9d922e964bd53064adb
/src/main/java/com/santosh/jpacurd/manager/EmployeeManager2Impl.java
19bff99f0e7043e5263b27a952e95303e4ef9785
[]
no_license
santoshjamidev/springboot-crud-operations
b66c646d2fa92ebc27a58691edda1577a99a9c40
3a4583c4cfa28c57570ea69d8f52b9d6643b99df
refs/heads/master
2022-08-17T14:12:07.603898
2020-05-25T01:01:11
2020-05-25T01:01:11
264,778,250
0
0
null
null
null
null
UTF-8
Java
false
false
756
java
package com.santosh.jpacurd.manager; import com.santosh.jpacurd.domain.EmployeeData; import com.santosh.jpacurd.model.Employee; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import java.util.List; @Service @Qualifier(value = "Implementation2") public class EmployeeManager2Impl implements EmployeeManager { @Override public Employee insertEmployeeRecord(EmployeeData employeeData) { return null; } @Override public List<Employee> getAllEmployees() { return null; } @Override public Employee updateExistingRecord(String employeedId, String name) { return null; } } //Component //RestController // Service //Repository
1f8ffc38abe4480dcf03d54a2286461855eb3a20
2048082bb13fd86a72928eefc15bf2302f039ff5
/spring-09/src/main/java/ru/otus/spring/repository/CommentRepositoryJpa.java
fc80f83106735f71fbfc6c0dcfdfa9246de89919
[]
no_license
EvgeniyShipov/spring
da22a81a7bf67f8d7570ae1015e7f51339e26879
e0c4b93603cf17ad8fd74b95c9b9d16e1f04f461
refs/heads/master
2023-01-23T04:42:41.829707
2020-05-29T17:39:08
2020-05-29T17:39:08
224,481,914
1
0
null
2023-01-05T08:47:55
2019-11-27T17:19:53
Java
UTF-8
Java
false
false
1,292
java
package ru.otus.spring.repository; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import ru.otus.spring.domain.Comment; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; import java.util.List; @Transactional @Repository public class CommentRepositoryJpa implements CommentRepository { @PersistenceContext private EntityManager em; @Override public Comment getById(long id) { return em.find(Comment.class, id); } @Override public List<Comment> getByBookId(long idBook) { TypedQuery<Comment> query = em.createQuery("from Comment c where c.book.id = :id_book", Comment.class); query.setParameter("id_book", idBook); return query.getResultList(); } @Override public List<Comment> getAll() { return em.createQuery("from Comment", Comment.class).getResultList(); } @Override public void delete(Comment comment) { em.remove(comment); } @Override public Comment create(Comment comment) { if (comment.getId() == 0) { em.persist(comment); return comment; } return em.merge(comment); } }
9c9b78f82c461a250ef5cd17d69a519c3c317e2a
887a97f6738b7475592dac507e875a53f40d24e3
/src/factory/NYPizzaIngredientFactory.java
e2a0f84425281c2a08b380b1a9486198882ba519
[]
no_license
kmkloor/DesignPatterns
1e88398f04c1ad1475934c1f5df5a1be6f88278a
ee65a47504963a9bc36c65e9d88c6a6553983fdd
refs/heads/master
2020-04-18T17:13:39.275141
2019-01-26T04:40:56
2019-01-26T04:40:56
167,650,360
0
0
null
null
null
null
UTF-8
Java
false
false
597
java
package factory; public class NYPizzaIngredientFactory implements PizzaIngredientFactory { public Dough createDough() { return new ThinCrustDough(); } public Sauce createSauce() { return new MarinaraSauce(); } public Cheese createCheese() { return new ReggianoCheese(); } public Veggies[] createVeggies() { Veggies veggies[] = {new Garlic(), new Onion(), new Mushroom(), new RedPepper()}; return veggies; } public Pepperoni createPepperoni() { return new SlicedPepperoni(); } public Clams createClam() { return new FreshClams(); } }
8dbb00195cc3a730a12a015d4f68c4d8564ab8a6
847c8a6da61efcd68f32128cd760630689001f4c
/JSP/JSP-Blog-V6-master/src/main/java/com/cos/blog/service/user/JoinFormAction.java
11788b6796875abe91e614edc60872da88900bee
[]
no_license
magemac/Github-
db7dace8d7389f8074fe234a4dccfe81f5b9a668
ad0d2772e73230b047c5b3a64cefad1cdd0c45c1
refs/heads/main
2023-06-07T04:12:29.567543
2021-07-03T03:00:10
2021-07-03T03:00:10
363,852,611
0
0
null
null
null
null
UTF-8
Java
false
false
469
java
package com.cos.blog.service.user; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.cos.blog.service.Action; public class JoinFormAction implements Action{ @Override public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.sendRedirect("views/user/joinForm.jsp"); } }
c37b131e145c5c076afec901e358dea6d060137b
a46196eb2b89755478d0c625f5be3c2b94306bf2
/Faculty/Code/ProgramRunner.java
c85fe36a71e9d17605a7262440faee8cb94e7262
[]
no_license
ajaysr047/CodeTest
ac054b863e1e3276b01877740f2d4e66cb62a4f9
f9c560ff0f6e189fd23b466e2bd89c2068f574b4
refs/heads/main
2023-02-14T13:30:40.911858
2021-01-03T16:28:48
2021-01-03T16:28:48
326,440,697
0
0
null
null
null
null
UTF-8
Java
false
false
491
java
class Program { public static boolean isEven(int n) { /* Write your code here. Do not modify this function definition */ return true; } } class ProgramRunner { public static void main(String args[])throws Exception { Program obj = new Program(); if(obj.isEven(16)) System.out.println("Main 1 passed!"); else System.out.println("Main 1 failed!"); if(!obj.isEven(7)) System.out.println("Main 2 passed!"); else System.out.println("Main 2 failed!"); } }
70150e3f0a04824101826ed89722c3472b102117
27b052c54bcf922e1a85cad89c4a43adfca831ba
/src/wS.java
026df6434861ec7683764aa39d843fed5631f588
[]
no_license
dreadiscool/YikYak-Decompiled
7169fd91f589f917b994487045916c56a261a3e8
ebd9e9dd8dba0e657613c2c3b7036f7ecc3fc95d
refs/heads/master
2020-04-01T10:30:36.903680
2015-04-14T15:40:09
2015-04-14T15:40:09
33,902,809
3
0
null
null
null
null
UTF-8
Java
false
false
1,712
java
import java.util.concurrent.Semaphore; import org.json.JSONException; import org.json.JSONObject; public class wS implements Runnable { private String b = null; private String c = null; private JSONObject d = null; private boolean e = false; protected wS(wR paramwR, String paramString1, String paramString2, JSONObject paramJSONObject, boolean paramBoolean) { this.b = paramString1; this.c = paramString2; this.d = paramJSONObject; this.e = paramBoolean; } public void run() { for (;;) { try { wR.a(this.a).acquire(); localJSONObject = new JSONObject(); } catch (InterruptedException localInterruptedException) { JSONObject localJSONObject; int i; String str; localInterruptedException.printStackTrace(); wR.a(this.a).release(); continue; } finally { wR.a(this.a).release(); } try { localJSONObject.put("link", this.b); localJSONObject.put("data", this.c); localJSONObject.put("post_body", this.d); localJSONObject.put("first_session", this.e); i = 1 + this.a.a(); this.a.a(i); str = Integer.toString(i); this.a.a(localJSONObject, str); wR.a(this.a).release(); return; } catch (JSONException localJSONException) { localJSONException.printStackTrace(); wR.a(this.a).release(); } } } } /* Location: C:\Users\dreadiscool\Desktop\tools\classes-dex2jar.jar * Qualified Name: wS * JD-Core Version: 0.7.0.1 */
c6f97a9d91c6f48005d90f704f49c055e40ec912
4ffc3d969399d251589379adf33cce5cec14dd89
/src/com/mrcrayfish/app/activities/ModListActivity.java
2fde6dc9477734795ace1c31b92ff062a2b124ab
[]
no_license
MrCrayfish/TheMrCrayfishApp
40c00e06285e2858222132893d4585735fda7ed9
f8880c1521a23cf0b2bfb1847bbca266412b1883
refs/heads/master
2023-03-24T07:01:08.287187
2015-06-04T16:05:58
2015-06-04T16:05:58
30,744,002
5
0
null
null
null
null
UTF-8
Java
false
false
3,841
java
package com.mrcrayfish.app.activities; import java.util.ArrayList; import android.annotation.SuppressLint; import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.graphics.Typeface; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; import com.mrcrayfish.app.R; import com.mrcrayfish.app.adapters.MenuAdapter; import com.mrcrayfish.app.interfaces.IMenu; import com.mrcrayfish.app.objects.MenuItem; public class ModListActivity extends Activity implements IMenu { private MenuAdapter adapater; public RelativeLayout loadingContainer; private TextView loadingText; private ListView modList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().requestFeature(Window.FEATURE_ACTION_BAR); setContentView(R.layout.activity_mod_menu); overridePendingTransition(R.anim.animation_slide_left_1, R.anim.animation_slide_left_2); setupActionBar(); modList = (ListView) findViewById(R.id.menuList); modList.setDivider(null); modList.setDividerHeight(0); loadingContainer = (RelativeLayout) findViewById(R.id.loadingContainer); loadingText = (TextView) findViewById(R.id.loadingText); adapater = new MenuAdapter(this, getItems()); modList.setAdapter(adapater); getActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onOptionsItemSelected(android.view.MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home) { onBackPressed(); return true; } return super.onOptionsItemSelected(item); } @Override public void onBackPressed() { super.onBackPressed(); overridePendingTransition(R.anim.animation_slide_right_1, R.anim.animation_slide_right_2); } @SuppressLint("InflateParams") public void setupActionBar() { ActionBar ab = getActionBar(); ab.setDisplayShowHomeEnabled(false); ab.setDisplayShowTitleEnabled(false); LayoutInflater inflator = LayoutInflater.from(this); View v = inflator.inflate(R.layout.app_bar, null); Typeface type = Typeface.createFromAsset(getAssets(), "fonts/bebas_neue.otf"); TextView title = (TextView) v.findViewById(R.id.barTitle); title.setTypeface(type); title.setText("Mod List"); ab.setCustomView(v); ab.setDisplayShowCustomEnabled(true); } public ArrayAdapter<MenuItem> getMenuAdapter() { return adapater; } public ArrayList<MenuItem> getItems() { ArrayList<MenuItem> mods = new ArrayList<MenuItem>(); Intent furnitureIntent = new Intent(this, ModActivity.class); setModInfo(furnitureIntent, "cfm", "Furniture Mod"); mods.add(new MenuItem("Furniture Mod", "Chairs, Tables, and more!", R.drawable.chair, furnitureIntent)); Intent skateboardIntent = new Intent(this, ModActivity.class); setModInfo(skateboardIntent, "csm", "Skateboard Mod"); mods.add(new MenuItem("Skateboarding Mod", "Tricks, Flips, Grinds!", R.drawable.ic_skateboard, skateboardIntent)); Intent constructionIntent = new Intent(this, ModActivity.class); setModInfo(constructionIntent, "ccm", "Construction Mod"); mods.add(new MenuItem("Construction Mod", "Create buildings without skill!", R.drawable.ic_hammer, constructionIntent)); Intent tokensIntent = new Intent(this, ModActivity.class); setModInfo(tokensIntent, "ct", "CrayTokens"); mods.add(new MenuItem("CrayTokens", "A simple currency!", R.drawable.ic_token, tokensIntent)); return mods; } public void setModInfo(Intent modInfo, String modId, String mod_name) { modInfo.putExtra("modid", modId); modInfo.putExtra("modname", mod_name); } public TextView getLoadingText() { return loadingText; } }
7d7cbfeb1683d8dbbd09681ec27d0702ab0565b1
70ce89411db5e1aad601a29c5d8540d5e6365a39
/src/com/design/mode/strategy/Strategy.java
9f03fa90d79bf8f38f64194ea6c04d153851eb53
[]
no_license
YouQuDeSoul/DesignModel
597d12277fe3d20555e5f32818ca65c31f0aafd0
9e29b28f7008d891d479cffd383bb515ff61a9eb
refs/heads/master
2021-07-06T03:31:18.233394
2017-09-29T09:41:32
2017-09-29T09:41:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
197
java
package com.design.mode.strategy; /** * The public interface to support varies arithmetic */ public interface Strategy { public void drawText(String s, int lineWidth, int lineCount); }
[ "Computer@Acer" ]
Computer@Acer
d9bbeeb40d5cfe9b83a23b71148cbaee99191fee
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/com/crossoverjie/cim/common/data/construct/SortArrayMapTest.java
1a06ef4059bfd5da9a8fdb84c2255fa991c5de2e
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
5,020
java
package com.crossoverjie.cim.common.data.construct; import java.util.SortedMap; import java.util.TreeMap; import org.junit.Test; public class SortArrayMapTest { @Test public void ad() { SortArrayMap map = new SortArrayMap(); for (int i = 0; i < 9; i++) { map.add(Long.valueOf(i), ("127.0.0." + i)); } map.print(); System.out.println(map.size()); } @Test public void add() { SortArrayMap map = new SortArrayMap(); for (int i = 0; i < 10; i++) { map.add(Long.valueOf(i), ("127.0.0." + i)); } map.print(); System.out.println(map.size()); } @Test public void add2() { SortArrayMap map = new SortArrayMap(); for (int i = 0; i < 20; i++) { map.add(Long.valueOf(i), ("127.0.0." + i)); } map.sort(); map.print(); System.out.println(map.size()); } @Test public void add3() { SortArrayMap map = new SortArrayMap(); map.add(100L, "127.0.0.100"); map.add(10L, "127.0.0.10"); map.add(8L, "127.0.0.8"); map.add(1000L, "127.0.0.1000"); map.print(); System.out.println(map.size()); } @Test public void firstNode() { SortArrayMap map = new SortArrayMap(); map.add(100L, "127.0.0.100"); map.add(10L, "127.0.0.10"); map.add(8L, "127.0.0.8"); map.add(1000L, "127.0.0.1000"); map.sort(); map.print(); String value = map.firstNodeValue(101); System.out.println(value); } @Test public void firstNode2() { SortArrayMap map = new SortArrayMap(); map.add(100L, "127.0.0.100"); map.add(10L, "127.0.0.10"); map.add(8L, "127.0.0.8"); map.add(1000L, "127.0.0.1000"); map.sort(); map.print(); String value = map.firstNodeValue(1); System.out.println(value); } @Test public void firstNode3() { SortArrayMap map = new SortArrayMap(); map.add(100L, "127.0.0.100"); map.add(10L, "127.0.0.10"); map.add(8L, "127.0.0.8"); map.add(1000L, "127.0.0.1000"); map.sort(); map.print(); String value = map.firstNodeValue(1001); System.out.println(value); } @Test public void firstNode4() { SortArrayMap map = new SortArrayMap(); map.add(100L, "127.0.0.100"); map.add(10L, "127.0.0.10"); map.add(8L, "127.0.0.8"); map.add(1000L, "127.0.0.1000"); map.sort(); map.print(); String value = map.firstNodeValue(9); System.out.println(value); } @Test public void add4() { SortArrayMap map = new SortArrayMap(); map.add(100L, "127.0.0.100"); map.add(10L, "127.0.0.10"); map.add(8L, "127.0.0.8"); map.add(1000L, "127.0.0.1000"); map.sort(); map.print(); System.out.println(map.size()); } int count = 1000000; @Test public void add5() { SortArrayMap map = new SortArrayMap(); long star = System.currentTimeMillis(); for (int i = 0; i < (count); i++) { double d = Math.random(); int ran = ((int) (d * 100)); map.add(Long.valueOf((i + ran)), ("127.0.0." + i)); } map.sort(); long end = System.currentTimeMillis(); System.out.println(("???? " + (end - star))); System.out.println(map.size()); } @Test public void add6() { SortArrayMap map = new SortArrayMap(); long star = System.currentTimeMillis(); for (int i = 0; i < (count); i++) { double d = Math.random(); int ran = ((int) (d * 100)); map.add(Long.valueOf((i + ran)), ("127.0.0." + i)); } long end = System.currentTimeMillis(); System.out.println(("???? " + (end - star))); System.out.println(map.size()); } @Test public void add7() { TreeMap<Long, String> treeMap = new TreeMap<Long, String>(); long star = System.currentTimeMillis(); for (int i = 0; i < (count); i++) { double d = Math.random(); int ran = ((int) (d * 100)); treeMap.put(Long.valueOf((i + ran)), ("127.0.0." + i)); } long end = System.currentTimeMillis(); System.out.println(("?? " + (end - star))); System.out.println(treeMap.size()); } @Test public void add8() { TreeMap<Long, String> map = new TreeMap<Long, String>(); map.put(100L, "127.0.0.100"); map.put(10L, "127.0.0.10"); map.put(8L, "127.0.0.8"); map.put(1000L, "127.0.0.1000"); SortedMap<Long, String> last = map.tailMap(101L); if (!(last.isEmpty())) { System.out.println(last.get(last.firstKey())); } else { System.out.println(map.firstEntry().getValue()); } } }
dfc6921617005c9562b5b3c8294d46b70cbee8fc
e8f63d7e068b7351e99872c447731dc06c010add
/src/main/java/com/feng/springfox/web/rest/vm/LoginVM.java
9632c99841ce965f256cab9004a585d841fbfa61
[]
no_license
yao00jun/jhipster-springfox-application
41322e100a6e38d79b3672729c113e3abf8f2cf8
a716258d16678e1cdd0342b4f0ff5ef403fd705b
refs/heads/master
2020-04-19T12:02:20.606597
2019-01-29T16:01:26
2019-01-29T16:01:26
168,180,529
0
0
null
null
null
null
UTF-8
Java
false
false
1,117
java
package com.feng.springfox.web.rest.vm; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; /** * View Model object for storing a user's credentials. */ public class LoginVM { @NotNull @Size(min = 1, max = 50) private String username; @NotNull @Size(min = ManagedUserVM.PASSWORD_MIN_LENGTH, max = ManagedUserVM.PASSWORD_MAX_LENGTH) private String password; private Boolean rememberMe; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public Boolean isRememberMe() { return rememberMe; } public void setRememberMe(Boolean rememberMe) { this.rememberMe = rememberMe; } @Override public String toString() { return "LoginVM{" + "username='" + username + '\'' + ", rememberMe=" + rememberMe + '}'; } }
388ccce8e115b28ce8dc4e17ab41c0cd9b8a2ff6
ed4141e32a82978ebfdb59e6fdf91e07bb972cc0
/src/com/rahulauto/ui/composer/AddCustomerComposer.java
3b9e9b792bd189a1959256d2e2434d540738be51
[]
no_license
rahulrborkar/Rahul-Auto
74ea2046d2fdb35b93fc2ed1413914b7359586e5
3af7f0a854e12b986591706ac80197fba0aa39b6
refs/heads/master
2020-05-02T11:00:48.224578
2012-01-01T12:27:18
2012-01-01T12:27:18
3,000,420
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
package com.rahulauto.ui.composer; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.util.GenericForwardComposer; public class AddCustomerComposer extends GenericForwardComposer { private static final long serialVersionUID = 7085484162107169788L; @Override public void doAfterCompose(Component comp) throws Exception { // TODO Auto-generated method stub super.doAfterCompose(comp); } }
534cfd1a0d09d72676dc8e23f91ac4b640f900df
481759b8125f43f78c35ccb05944086c0c112493
/Sorter.java
785b0714747778f16f0ae9bf5bdd8d350dc50e3c
[]
no_license
bird-cat/Java_OOP_hw2
155ffa2642d9a28c07d519dfdfe037aa3bfdef8f
0f78aacdbdc6d9639bcc1e2d840f3e0ffeb12b42
refs/heads/main
2023-03-06T17:09:25.106090
2021-02-17T15:47:13
2021-02-17T15:47:13
338,026,414
0
0
null
null
null
null
UTF-8
Java
false
false
468
java
package ntu.r09922114.util; import ntu.r09922114.gambling.Card; public class Sorter { public static void bubbleSort(Card [] items) { for (int i = items.length - 1; i > 0; i--) { for (int j = 0; j < i; j++) { if (items[j].compare(items[j + 1]) > 0) { Card tmp = items[j]; items[j] = items[j + 1]; items[j + 1] = tmp; } } } } }
c38215e9c848f192aadcdc389203add4e31bc295
09b7f281818832efb89617d6f6cab89478d49930
/root/projects/alfresco-jlan/source/java/org/alfresco/jlan/server/auth/PasswordEncryptor.java
a9e8502db5939f3b2b91078719282313b1655f44
[]
no_license
verve111/alfresco3.4.d
54611ab8371a6e644fcafc72dc37cdc3d5d8eeea
20d581984c2d22d5fae92e1c1674552c1427119b
refs/heads/master
2023-02-07T14:00:19.637248
2020-12-25T10:19:17
2020-12-25T10:19:17
323,932,520
1
1
null
null
null
null
UTF-8
Java
false
false
13,525
java
/* * Copyright (C) 2006-2010 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco 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. * * Alfresco 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 Alfresco. If not, see <http://www.gnu.org/licenses/>. */ package org.alfresco.jlan.server.auth; import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.Mac; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.SecretKeySpec; import org.alfresco.jlan.debug.Debug; /** * Password Encryptor Class * * <p> * Generates LanMan and NTLMv1 encrypted passwords from the plain text password and challenge key. * * @author GKSpencer */ public class PasswordEncryptor { // Encryption algorithm types public static final int LANMAN = 0; public static final int NTLM1 = 1; public static final int NTLM2 = 2; public static final int MD4 = 3; // Encrpytion algorithm names private final static String[] _algNames = { "LanMan", "NTLMv1", "NTLMv2", "MD4" }; /** * Default constructor */ public PasswordEncryptor() { } /** * Check if the required algorithms are available * * @return boolean */ public static final boolean checkEncryptionAlgorithms() { boolean algOK = false; try { // Check if MD4 is available MessageDigest.getInstance("MD4"); // Check if DES is available Cipher.getInstance("DES"); // Check if HMAC-MD5 is available Mac.getInstance("HMACMD5"); // Indicate required algorithms are available algOK = true; } catch (NoSuchAlgorithmException ex) { } catch (NoSuchPaddingException ex) { } // Return the encryption algorithm status return algOK; } /** * Encrypt the plain text password with the specified encryption key using the specified * encryption algorithm. * * @param plainPwd Plaintext password string * @param encryptKey byte[] Encryption key * @param alg int Encryption algorithm * @param userName String * @param domain String * @return byte[] Encrypted password * @exception NoSuchAlgorithmException If a required encryption algorithm is not available * @exception InvalidKeyException Key is invalid */ public byte[] generateEncryptedPassword(String plainPwd, byte[] encryptKey, int alg, String userName, String domain) throws NoSuchAlgorithmException, InvalidKeyException { // Get the password String pwd = plainPwd; if (pwd == null) pwd = ""; // Determine the encryption algorithm byte[] encPwd = null; MessageDigest md4 = null; int len = 0; byte[] pwdBytes = null; switch (alg) { // LanMan DES encryption case LANMAN: encPwd = P24(pwd, encryptKey); break; // NTLM v1 encryption case NTLM1: // Create the MD4 hash md4 = MessageDigest.getInstance("MD4"); try { pwdBytes = pwd.getBytes("UnicodeLittleUnmarked"); } catch (UnsupportedEncodingException ex) { } md4.update(pwdBytes); byte[] p21 = new byte[21]; System.arraycopy(md4.digest(), 0, p21, 0, 16); // Now use the LM encryption encPwd = P24(p21, encryptKey); break; // NTLM v2 encryption case NTLM2: // Get the MD4 hash of the plaintext password byte[] md4Hash = generateEncryptedPassword(plainPwd, encryptKey, MD4, null, null); // HMAC-MD5 the username + domain string using the MD4 hash as the key Mac hmacMd5 = Mac.getInstance("HMACMD5"); SecretKeySpec key = new SecretKeySpec(md4Hash, 0, md4Hash.length, "MD5"); hmacMd5.init(key); // Build the username + domain string and convert to bytes StringBuffer str = new StringBuffer(); str.append(userName.toUpperCase()); str.append(domain.toUpperCase()); byte[] dataByts = null; try { // Convert the string to a byte array String dataStr = str.toString(); dataByts = dataStr.getBytes("UnicodeLittleUnmarked"); } catch (UnsupportedEncodingException ex) { } // Encrypt the username+domain bytes to generate the NTLMv2 hash encPwd = hmacMd5.doFinal(dataByts); break; // MD4 encryption case MD4: // Create the MD4 hash md4 = MessageDigest.getInstance("MD4"); len = pwd.length(); pwdBytes = new byte[len * 2]; for (int i = 0; i < len; i++) { char ch = pwd.charAt(i); pwdBytes[i * 2] = (byte) ch; pwdBytes[i * 2 + 1] = (byte) ((ch >> 8) & 0xFF); } md4.update(pwdBytes); encPwd = new byte[16]; System.arraycopy(md4.digest(), 0, encPwd, 0, 16); break; } // Return the encrypted password return encPwd; } /** * P16 encryption * * @param pwd java.lang.String * @param s8 byte[] * @return byte[] * @exception NoSuchAlgorithmException If a required encryption algorithm is not available */ public final byte[] P16(String pwd, byte[] s8) throws NoSuchAlgorithmException { // Make a 14 byte string using the password string. Truncate the // password or pad with nulls to 14 characters. StringBuffer p14str = new StringBuffer(); p14str.append(pwd.toUpperCase()); if (p14str.length() > 14) p14str.setLength(14); while (p14str.length() < 14) p14str.append((char) 0x00); // Convert the P14 string to an array of bytes. Allocate a 21 byte buffer as the result is // usually passed // through the P24() method byte[] p14 = p14str.toString().getBytes(); byte[] p16 = new byte[21]; try { // DES encrypt the password bytes using the challenge key Cipher des = Cipher.getInstance("DES"); // Set the encryption seed using the first 7 bytes of the password string. // Generate the first 8 bytes of the return value. byte[] key = generateKey(p14, 0); SecretKeySpec chKey = new SecretKeySpec(key, 0, key.length, "DES"); des.init(Cipher.ENCRYPT_MODE, chKey); byte[] res = des.doFinal(s8); System.arraycopy(res, 0, p16, 0, 8); // Encrypt the second block key = generateKey(p14, 7); chKey = new SecretKeySpec(key, 0, key.length, "DES"); des.init(Cipher.ENCRYPT_MODE, chKey); res = des.doFinal(s8); System.arraycopy(res, 0, p16, 8, 8); } catch (NoSuchPaddingException ex) { p16 = null; } catch (IllegalBlockSizeException ex) { p16 = null; } catch (BadPaddingException ex) { p16 = null; } catch (InvalidKeyException ex) { p16 = null; } // Return the 16 byte encrypted value return p16; } /** * P24 DES encryption * * @param pwd String * @param c8 byte[] * @return byte[] * @exception NoSuchAlgorithmException If a required encryption algorithm is not available */ private final byte[] P24(String pwd, byte[] c8) throws NoSuchAlgorithmException { // Generate the 16 byte encrypted value using the password string and well // known value. byte[] s8 = "KGS!@#$%".getBytes(); byte[] p16 = P16(pwd, s8); // Generate the 24 byte encrypted value return P24(p16, c8); } /** * P24 DES encryption * * @param p21 Plain password or hashed password bytes * @param ch Challenge bytes * @return Encrypted password * @exception NoSuchAlgorithmException If a required encryption algorithm is not available */ private final byte[] P24(byte[] p21, byte[] ch) throws NoSuchAlgorithmException { byte[] enc = null; try { // DES encrypt the password bytes using the challenge key Cipher des = Cipher.getInstance("DES"); // Allocate the output bytes enc = new byte[24]; // Encrypt the first block byte[] key = generateKey(p21, 0); SecretKeySpec chKey = new SecretKeySpec(key, 0, key.length, "DES"); des.init(Cipher.ENCRYPT_MODE, chKey); byte[] res = des.doFinal(ch); System.arraycopy(res, 0, enc, 0, 8); // Encrypt the second block key = generateKey(p21, 7); chKey = new SecretKeySpec(key, 0, key.length, "DES"); des.init(Cipher.ENCRYPT_MODE, chKey); res = des.doFinal(ch); System.arraycopy(res, 0, enc, 8, 8); // Encrypt the last block key = generateKey(p21, 14); chKey = new SecretKeySpec(key, 0, key.length, "DES"); des.init(Cipher.ENCRYPT_MODE, chKey); res = des.doFinal(ch); System.arraycopy(res, 0, enc, 16, 8); } catch (NoSuchPaddingException ex) { Debug.println( ex); enc = null; } catch (IllegalBlockSizeException ex) { Debug.println( ex); enc = null; } catch (BadPaddingException ex) { Debug.println( ex); enc = null; } catch (InvalidKeyException ex) { Debug.println( ex); enc = null; } // Return the encrypted password, or null if an error occurred return enc; } /** * Return the encryption algorithm as a string * * @param alg int * @return String */ public static String getAlgorithmName(int alg) { if (alg >= 0 && alg < _algNames.length) return _algNames[alg]; return "Unknown"; } /** * Make a 7-byte string into a 64 bit/8 byte/longword key. * * @param byt byte[] * @param off int * @return byte[] */ private byte[] generateKey(byte[] byt, int off) { // Allocate the key byte[] key = new byte[8]; // Make a key from the input string key[0] = (byte) (byt[off + 0] >> 1); key[1] = (byte) (((byt[off + 0] & 0x01) << 6) | ((byt[off + 1] & 0xFF) >> 2)); key[2] = (byte) (((byt[off + 1] & 0x03) << 5) | ((byt[off + 2] & 0xFF) >> 3)); key[3] = (byte) (((byt[off + 2] & 0x07) << 4) | ((byt[off + 3] & 0xFF) >> 4)); key[4] = (byte) (((byt[off + 3] & 0x0F) << 3) | ((byt[off + 4] & 0xFF) >> 5)); key[5] = (byte) (((byt[off + 4] & 0x1F) << 2) | ((byt[off + 5] & 0xFF) >> 6)); key[6] = (byte) (((byt[off + 5] & 0x3F) << 1) | ((byt[off + 6] & 0xFF) >> 7)); key[7] = (byte) (byt[off + 6] & 0x7F); for (int i = 0; i < 8; i++) { key[i] = (byte) (key[i] << 1); } return key; } /** * NTLM1 encryption of the MD4 hashed password * * @param p21 byte[] * @param c8 byte[] * @return byte[] * @exception NoSuchAlgorithmException */ public final byte[] doNTLM1Encryption(byte[] p21, byte[] c8) throws NoSuchAlgorithmException { return P24(p21, c8); } /** * NTLM2 encryption of the MD4 hashed password * * @param md4Hash byte[] * @param userName String * @param domain String * @return byte[] * @exception NoSuchAlgorithmException */ public final byte[] doNTLM2Encryption(byte[] md4Hash, String userName, String domain) throws NoSuchAlgorithmException, InvalidKeyException { // Use the MD4 hashed password as the key for HMAC-MD5 Mac hmacMd5 = Mac.getInstance("HMACMD5"); SecretKeySpec key = new SecretKeySpec(md4Hash, 0, md4Hash.length, "MD5"); hmacMd5.init(key); // Build the data to be encrypted StringBuffer str = new StringBuffer(); str.append(userName.toUpperCase()); str.append(domain); String dataStr = str.toString(); byte[] dataByts = null; try { dataByts = dataStr.getBytes("UnicodeLittleUnmarked"); } catch (UnsupportedEncodingException ex) { } // Encrypt the data return hmacMd5.doFinal(dataByts); } /** * LanMan first stage of the encryption * * @param pwd String * @return byte[] * @exception NoSuchAlgorithmException If a required encryption algorithm is not available */ public final byte[] doLanManBaseEncryption(String pwd) throws NoSuchAlgorithmException { // Generate the 16 byte encrypted value using the password string and well // known value. byte[] s8 = "KGS!@#$%".getBytes(); return P16(pwd, s8); } /** * LanMan encryption of a password previously encrypted with the well known value * * @param p21 byte[] * @param c8 byte[] * @return byte[] * @exception NoSuchAlgorithmException */ public final byte[] doLanManEncryption(byte[] p21, byte[] c8) throws NoSuchAlgorithmException { return P24(p21, c8); } /** * MD4 password hashinh * * @param pwdBytes byte[] * @return byte[] */ public final byte[] doMD4Hashing(byte[] pwdBytes) throws NoSuchAlgorithmException, InvalidKeyException { // Create the MD4 hash MessageDigest md4 = MessageDigest.getInstance("MD4"); md4.update(pwdBytes); return md4.digest(); } }
30c1079d1fbdb54c4432ca36169ce9180454a604
10dd9600a7419bae514ceca08491c733141f5ce8
/quiz02/Dictionary.java
bc9244130ab2589594aa9bf36a26b231e3bda299
[]
no_license
ilovetayy/2019_1_OOP
7e1b9a5aea68779dba86af8ef78842b4a4ce9542
a8a5d6ca777907086b1144c3840d71a0125a9f91
refs/heads/main
2023-03-31T22:56:33.576686
2021-04-01T18:23:57
2021-04-01T18:23:57
353,787,476
0
0
null
null
null
null
UTF-8
Java
false
false
441
java
package oop_quiz2; public interface Dictionary { public boolean isEmpty(); public void insertEntry(String word, String definition) throws AlreadyExistInDicException; public void getDefinition(String word) throws EmptyException, NotInDicException; public void removeWord(String word) throws EmptyException, NotInDicException; public void printWords() throws EmptyException ; public void printAll() throws EmptyException ; }
7f5fcab61b81a9e5643a737db871e66943238ab3
fec325d97c7a4ce3980a80a5344178b958dcf5b1
/app/src/main/java/com/android/emergencyapp/util/Log.java
fd1cdc385b04e70e7feb49acb8bc04b18813fed7
[]
no_license
nirajan770/EmergencyApp
a4391e61ed661eb264f6d9c0bb451a8d66cc24b3
652b29c193b5f439d07fbb6e935c152ecb4401db
refs/heads/master
2020-06-04T13:35:07.476412
2015-09-08T15:42:37
2015-09-08T15:42:37
42,121,621
0
0
null
null
null
null
UTF-8
Java
false
false
752
java
package com.android.emergencyapp.util; /** * Helper class to override the native Android Log class * * Created by Nirajan on 8/1/2015. */ public class Log { static final boolean LOG = true; public static void i(String tag, String string) { if (LOG) android.util.Log.i(tag, string); } public static void e(String tag, String string) { if (LOG) android.util.Log.e(tag, string); } public static void d(String tag, String string) { if (LOG) android.util.Log.d(tag, string); } public static void v(String tag, String string) { if (LOG) android.util.Log.v(tag, string); } public static void w(String tag, String string) { if (LOG) android.util.Log.w(tag, string); } }
d103a824ad605a757f76fb8fadeef2decb1eb0de
9d3e1a328b2f867c17f2c28b55ec1634be89a152
/3T/src/main/java/com/kh/iclass/common/util/SHA256Util.java
05863d5ee33e520d4e57bb6c32ddf86a5d4138a5
[]
no_license
jssss93/3T_Final
41800d7b3e2d366a664753adaba4aef06ed24427
9c2578e4c3d68837cfb4ff3177cc8eec32eb95ff
refs/heads/master
2020-03-25T05:03:42.966848
2018-09-28T10:50:03
2018-09-28T10:50:03
143,427,830
3
0
null
2018-09-28T10:50:04
2018-08-03T13:00:15
Java
UTF-8
Java
false
false
615
java
package com.kh.iclass.common.util; import java.security.MessageDigest; public class SHA256Util { public static String hashing(String password) throws Exception { MessageDigest digest = MessageDigest.getInstance("SHA-256"); byte[] hash = digest.digest(password.getBytes("UTF-8")); StringBuffer hexString = new StringBuffer(); for (int i = 0; i < hash.length; i++) { String hex = Integer.toHexString(0xff & hash[i]); if(hex.length() == 1) hexString.append('0'); hexString.append(hex); } return hexString.toString(); } }
f563b62f0a28672cceef9eb9ca555c9d77159a87
3c49129acbd1ea9041a6280dd822335c2558d1e8
/app/src/test/java/com/example/alexey/pixabayapitest/ExampleUnitTest.java
16a714004b6ca17efc7ef3eba0b1d57d1c55dbb9
[]
no_license
lexa1424/PixabayApiTest
d22bb81cf2b0f1f41b5b04f9d146b47965b98a07
789fc57c2b2277b45ac8f8cd785489fc9e76aedf
refs/heads/master
2021-01-13T02:41:36.792399
2017-02-13T14:27:20
2017-02-13T14:27:20
81,482,342
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package com.example.alexey.pixabayapitest; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
8760c7bf8a9e3d39f56e37ad3ad31e3c89789f12
8efe4e3924623c157231b7052eb30060a89a6cba
/app/src/main/java/com/lowworker/android/mvp/views/BeaconsView.java
0df62893363831c124dedab60cd7bbaf342bbd4d
[]
no_license
cbdgit/bleclient
5a52dd81a3f5564538a0b29d6868af16038fc6ea
df3964013542f1b40a0e72a55e14f175c2026446
refs/heads/master
2020-05-23T19:04:54.344775
2015-09-19T15:51:18
2015-09-19T15:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
798
java
package com.lowworker.android.mvp.views; import com.lowworker.android.model.entities.BeaconsWrapper; import com.lowworker.android.model.entities.SubscriptionsWrapper; import com.lowworker.android.model.entities.UserWrapper; import java.util.List; import BLEScut.Beacon; import retrofit.RetrofitError; public interface BeaconsView extends MVPView { void showBeacons(List<Beacon> beaconList); void showLoading(); void hideLoading(); void showError(String error); void hideError(); void changeUserProfile(UserWrapper userWrapper); void saveBeacons(BeaconsWrapper beaconsWrapper); void saveSubscriptions(SubscriptionsWrapper subscriptionsWrapper); void appendBeacons(List<Beacon> beaconList); void showBeaconsFromDatabase(RetrofitError error); }
e2860d05bb070c6b919693b05935d5158ecbbe64
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/86/30.java
45808d841fc8a7584ac9073ac6422ef677778e42
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,304
java
public class jumps { public int error; public int[] c = new int[100]; public int sum; public int xia; } package <missing>; public class GlobalMembers { public static int Main() { jumps[] jump = tangible.Arrays.initializeWithDefaultjumpsInstances(100); int n; int i; int j; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { n = Integer.parseInt(tempVar); } for (i = 0;i < n;i++) { String tempVar2 = ConsoleInput.scanfRead(); if (tempVar2 != null) { jump[i].error = Integer.parseInt(tempVar2); } for (j = 0;j < jump[i].error;j++) { String tempVar3 = ConsoleInput.scanfRead(); if (tempVar3 != null) { jump[i].c[j] = Integer.parseInt(tempVar3); } } } for (i = 0;i < n;i++) { if (jump[i].c[jump[i].error - 1] + jump[i].error * 3 < 60) { jump[i].xia = 60 - jump[i].error * 3; } else { for (j = 0;j < jump[i].error;j++) { if (jump[i].c[j] >= 47 && jump[i].c[j] <= 49) { jump[i].xia = jump[i].c[j]; break; } else if (jump[i].c[j] + (j + 1) * 3 > 60 && jump[i].c[j - 1] + (j) * 3 < 60) { jump[i].xia = 60 - (j) * 3; break; } } } } for (i = 0;i < n;i++) { System.out.printf("%d\n",jump[i].xia); } return 0; } }