Skip to content

Instantly share code, notes, and snippets.

View jpt1122's full-sized avatar

Jay Thakkar jpt1122

  • My Dream
  • Ahmedabad
View GitHub Profile
/*
1000 milliseconds = 1 second
60 seconds = 1 minute
60 minutes = 1 hour
24 hours = 1 day
*/
package com.jpt.dateExample;
import java.text.SimpleDateFormat;
@jpt1122
jpt1122 / ZipUtil.java
Last active March 23, 2020 14:38
Zip and Unzip are a very common activities for a computer user. A user normally uses the zip utility to compress a directory to create a zip file. There are many ready-made software such as winzip,7zip, and winrar that are available to achieve this. However, it is also possible to protect the zip file with a password so that the end user has to …
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.util.Arrays;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@jpt1122
jpt1122 / SphereAndBox
Last active December 31, 2015 14:49
To compile JavaFX with 3D features you have to get the early access version of the JDK8. At the moment as far as I know there is only a windows support for the 3D features, but a build for Mac and Linux will soon be released. (Luckily enough 3D support also works for a virtualized Windows running on Mac - this is how i got to the screeenshots.) …
package application;
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.geometry.Point3D;
import javafx.scene.Group;
import javafx.scene.PerspectiveCamera;
import javafx.scene.PointLight;
import javafx.scene.Scene;
import javafx.scene.image.Image;