Skip to content

Instantly share code, notes, and snippets.

View zho's full-sized avatar

Joandi Leonardus zho

View GitHub Profile
@zho
zho / JPA Sample
Last active August 29, 2015 14:21
JPA Sample
import java.util.List;
import java.util.UUID;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
public class TestJavaApp {
private static String PERSISTENCE_UNIT_NAME = "DEFAULT_PU";
private static EntityManagerFactory factory;
@zho
zho / JamodJ2ModTCP
Created May 14, 2015 09:41
J2mod / Jamod read 4 TCP slave sample
import com.ghgande.j2mod.modbus.io.ModbusTCPTransaction;
import com.ghgande.j2mod.modbus.msg.ReadMultipleRegistersRequest;
import com.ghgande.j2mod.modbus.msg.ReadMultipleRegistersResponse;
import com.ghgande.j2mod.modbus.net.TCPMasterConnection;
import java.net.InetAddress;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
did:3:kjzl6cwe1jw14a9u3pcb8rtks3feypkkt2ff0ld8khhtfqg8nym5f3yixidnkwm