Instantly share code, notes, and snippets.

View Result Guava
"C:\Program Files\Java\jdk1.8.0_51\bin\java" -Didea.launcher.port=7533 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.4\bin" -Dfile.encoding=windows-1252 -classpath "C:\Program Files\Java\jdk1.8.0_51\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_51\jre\lib\ext\jaccess.jar;C
View GuavaArrayTable.java
package com.putracode.guava.collections;
import com.google.common.collect.ArrayTable;
import com.google.common.collect.Lists;
import com.google.common.collect.Table;
import java.util.List;
import static com.putracode.guava.Util.*;
/**
* Created by KrisnaPutra on 2/7/2016.
View Implementasi Mail Util
@Override
public Map<String, Object> sendNotif(List<RequestEmailNotifHelper>requests) {
try {
//TODO: open remark after ready to implemented
HashMap<String, Object> param = new HashMap<>() ;
param.put(IEmailNotifConstans.IMailParamJson.TEMPLATE_ID,4568);
View Implementasi Mail Util
@Override
public Map<String, Object> sendNotif(List<RequestEmailNotifHelper>requests) {
try {
//TODO: open remark after ready to implemented
HashMap<String, Object> param = new HashMap<>() ;
param.put(IEmailNotifConstans.IMailParamJson.TEMPLATE_ID,4568);
View pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mongodb</groupId>
<artifactId>spark-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>M101J</name>
View Pembulatan.java
import java.math.RoundingMode;
import java.math.BigDecimal;
public class Pembulatan
{
public static int pembulatan1000( int nilai ){
BigDecimal _value = new BigDecimal( (double)nilai/1000);
_value= _value.setScale(0,RoundingMode.UP);
return _value.intValue()*1000;
}
public static void main(String []args){
View Kembalian.java
public class Kembalian{
public static void pecahUang(Long nilai){
Long _nilai=nilai;
/*Nilai Pecahan Indonesia*/
Long _100rb=100000L;
Long _50rb =50000L;
Long _20rb =20000L;
Long _10rb = 10000L;
View Main.java
public static void main(String[] args) {
EntityManager em =PersistenceManager.INSTANCE.getEntityManager();
em.getTransaction().begin();
for (int i = 0; i < 10; i++) {
OrderTransaction order=new OrderTransaction();
order.setOrderProduct("Computer No "+i);
//Date With LocalDate
order.setOrderDate(LocalDate.now());
//Time With LocalTime
order.setOrderTime(LocalTime.now());
View order_transaction.sql
CREATE TABLE `order_transaction` (
`orderId` bigint(20) NOT NULL AUTO_INCREMENT,
`OrderProduct` varchar(255) DEFAULT NULL,
`orderCreated` timestamp NULL DEFAULT NULL,
`orderDate` date DEFAULT NULL,
`orderTime` time DEFAULT NULL,
PRIMARY KEY (`orderId`)
)
View hibernate-java8.xml
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-java8</artifactId>
<version>${hibernate.version}</version>
</dependency>