Skip to content

Instantly share code, notes, and snippets.

View HashRaygoza's full-sized avatar

David Raygoza Gómez HashRaygoza

View GitHub Profile
@HashRaygoza
HashRaygoza / iText7.java
Created April 18, 2017 18:41
Crea el documento que usara el manejador de eventos EventoPagina
package mx.hashsoft.itext7;
import com.itextpdf.kernel.events.PdfDocumentEvent;
import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Paragraph;
import java.io.FileNotFoundException;
import java.util.logging.Level;
@HashRaygoza
HashRaygoza / certificado.sh
Last active September 14, 2017 02:26
Creacion de certificado de prueba para Java WebStart
keytool -genkey -keystore myKeystore -alias myself
keytool -selfcert -alias myself -keystore myKeystore
jarsigner -keystore myKeystore Test-1.0.jar myself
@HashRaygoza
HashRaygoza / Test.jnlp
Last active September 14, 2017 04:17
Ejemplo de un archivo JNLP
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://192.168.0.17:8080/Test/" href="Test.jnlp">
<information>
<title>Prueba Java WebStart</title>
<vendor>HashSoftware</vendor>
<homepage href="http://192.168.0.17:8080/Test/" />
<description>Testing Testing</description>
</information>
<security>
<all-permissions />
@HashRaygoza
HashRaygoza / Test2.0.jnlp
Created September 14, 2017 04:52
Ejemplo de una actualización via Java WebStart
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://192.168.0.17:8080/Test/" href="Test.jnlp">
<information>
<title>Prueba Java WebStart</title>
<vendor>HashSoftware</vendor>
<homepage href="http://192.168.0.17:8080/Test/" />
<description>Testing Testing</description>
</information>
<security>
<all-permissions />
@HashRaygoza
HashRaygoza / ReplicaVO.java
Last active October 19, 2017 22:40
Clase VO que conecta con test.replica
/*
* 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 mx.hashsoft.hibernateanotaciones;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
@HashRaygoza
HashRaygoza / FoliosVO.java
Last active October 20, 2017 18:26
Clase VO que conecta con test.folios
/*
* 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 mx.hashsoft.hibernateanotaciones;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
@HashRaygoza
HashRaygoza / DataBaseTester.java
Last active October 20, 2017 18:27
Verifica la existencia de las tablas y columnas de la base de datos basandose en las anotaciones de las clases VO
/*
* 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 mx.hashsoft.hibernateanotaciones;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
@HashRaygoza
HashRaygoza / Calculo.java
Created January 13, 2018 04:20
Clase para demostracion de jUnit 5
package mx.calculo;
public class Calculo {
public double calcular(double s) {
return s*s;
}
public double calcularIVA(double precio){
return precio*016;
}
@HashRaygoza
HashRaygoza / CalculoTest.java
Created January 13, 2018 04:23
Prueba de unidad para demostrar jUnit 5
package mx.calculoTest;
import mx.calculo.Calculo;
import org.junit.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CalculoTest {
package mx.hash.print;
import jssc.SerialPort;
import jssc.SerialPortException;
public class PrinterTest {
public static void main(String[] args) {
SerialPort serialPort = new SerialPort("COM7");