This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common; | |
import java.util.function.Consumer; | |
import java.util.function.Function; | |
public class Consumers { | |
/** | |
* <pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common; | |
import java.sql.ResultSet; | |
import java.sql.ResultSetMetaData; | |
import java.sql.SQLException; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class JDBCDebug { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common; | |
import java.io.File; | |
import java.io.FilenameFilter; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.net.URLClassLoader; | |
public class JarFileLoader extends URLClassLoader { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common; | |
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; | |
public class DuckType implements InvocationHandler { | |
public static class Let { | |
private Object object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common; | |
import java.util.Base64; | |
import java.util.Random; | |
public class Crypto { | |
public static String base64encode(String text) { | |
return Base64.getEncoder().encodeToString(text.getBytes()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common; | |
import static java.util.Arrays.asList; | |
import java.awt.Desktop.Action; | |
import java.awt.Point; | |
import java.lang.reflect.Array; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.Collections; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common; | |
public class Format { | |
private static final String[] BYTE_UNITS = new String[] { "b", "Kb", "Mb", "Gb" }; | |
private static final int[] BYTE_STEPS = new int[] { 1024, 1024, 1024, 1024 }; | |
private static final String[] TIME_UNITS = new String[] { "msec", "sec", "min", "h", "day", "week", "year" }; | |
private static final int[] TIME_STEPS = new int[] { 1000, 60, 60, 24, 7, 52, 100 }; | |
public static String format(String[] unit, int[] step, double value) { | |
int i = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common; | |
import java.util.HashMap; | |
import java.util.function.Function; | |
/** | |
* How many times have you written code like this | |
* <blockquote><pre> | |
* List<Integer> value = map.get(key); | |
* if(value == null) { |
NewerOlder