Skip to content

Instantly share code, notes, and snippets.

View carlosdlf's full-sized avatar

Carlos DLF carlosdlf

View GitHub Profile
package reflection;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class MAin {
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="pe.backend_backend_ejb_1.0-SNAPSHOTPU" transaction-type="JTA">
<jta-data-source>java:/PostgresDS</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<shared-cache-mode>NONE</shared-cache-mode>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="create"/>
</properties>
</persistence-unit>
public class Decoder {
public static void main(String[] args) {
RootDecoder rootDecoder = new RootDecoder();
List<DecodedData> zxc = rootDecoder
.decode("5F34010182023C009F100706010A03A0B0009F26082F1D19F97D74AF009F360203975F2A020604950580800400009A031708019C01309F02060000000000009F03060000000000009F1A0206049F33036040209F3704BA6FF67F", "EMV", "constructed");
for (DecodedData decodedData : zxc) {
System.out.println("tag ->"+decodedData.component1() + " desc ->" + decodedData.component2() + " valor -> " + decodedData.component3());
}
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
<script>
function checkFile(fieldObj)
{
var FileName = fieldObj.value;
var FileExt = FileName.substr(FileName.lastIndexOf('.')+1);
var FileSize = fieldObj.files[0].size;
var FileSizeMB = (FileSize/2097152).toFixed(2);
// aca van las extensiones validas
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
public static List<String> fileList(String directory) {
List<String> fileNames = new ArrayList<>();
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(Paths.get(directory))) {
for (Path path : directoryStream) {
fileNames.add(path.toString());
public static StringBuilder readFile(File $f) throws IOException {
StringBuilder sb = new StringBuilder();
BufferedReader br = null;
try {
String sCurrentLine;
br = new BufferedReader(new FileReader($f));
while ((sCurrentLine = br.readLine()) != null) {
sb.append(sCurrentLine).append("\n");
@carlosdlf
carlosdlf / README.md
Created May 26, 2016 23:29 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

/**
* Created by clarico on 21/04/2016.
*
* https://projecteuler.net/problem=546
*
*/
public class P546 {
public static void main(String[] args) {
package edu.cibertec.jadd.jaxws;
import javax.jws.WebMethod;
import javax.jws.WebService;
/**
* Created by Java-VS on 15/04/2016.
*/
@WebService