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
import java.util.Properties; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class PlaceholderProperties extends Properties { | |
private static final long serialVersionUID = 1L; | |
private static final Pattern PARAMETER_PATTERN = Pattern.compile("\\$\\{([^}]*)\\}"); | |
public PlaceholderProperties() { | |
super(); |
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
import java.lang.reflect.*; | |
public class ToStringBuilder { | |
private final StringBuilder sb = new StringBuilder(32); | |
private final Object object; | |
private final boolean formatted; | |
public static String reflection(Object object) { | |
return reflection(object, true); | |
} |
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
<%@page contentType="text/html" pageEncoding="utf-8" trimDirectiveWhitespaces="true" %> | |
<%@page import="java.util.*" %> | |
<%@page import="java.io.*" %> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>samples</title> |
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
-Xms512m | |
-Xmx512m | |
-Xmn128m | |
-XX:PermSize=256m | |
-XX:MaxPermSize=256m | |
-XX:-UseAdaptiveSizePolicy | |
-XX:+DisableExplicitGC | |
-Xverify:none | |
-XX:+UseParallelGC | |
-XX:+UseParallelOldGC |
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
document.onkeydown = function(evt) { | |
var isie = (document.all) ? true : false; | |
var key; | |
var srcobj; | |
// if the agent is an IE browser, it is easy to do this. | |
if (isie) { | |
key = event.keyCode; | |
srcobj = event.srcElement; | |
} else { | |
key = evt.which; |
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
TypeNotPresentException | |
NullPointerException | |
IllegalArgumentException | |
IllegalStateException | |
UnsupportedOperationException | |
SecurityException | |
java.util.NoSuchElementException | |
java.util.MissingResourceException | |
java.lang.reflect.UndeclaredThrowableException | |
java.nio.charset.UnsupportedCharsetException |
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
public class Base62 { | |
private static final char[] digitsChar = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray(); | |
private static final int BASE = digitsChar.length; | |
private static final int FAST_SIZE = 'z'; | |
private static final int[] digitsIndex = new int[FAST_SIZE + 1]; | |
static { | |
for (int i = 0; i < FAST_SIZE; i++) { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<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.github.subchen</groupId> | |
<artifactId>jetbrick-parent</artifactId> | |
<version>1.0.0</version> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 | |
http://maven.apache.org/xsd/assembly-1.1.2.xsd"> | |
<id>all-in-one</id> | |
<formats> | |
<format>jar</format> |
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
D:\temp>%JAVA_HOME%\bin\java -cp .;%JAVA_HOME%\lib\sa-jdi.jar sun.jvm.hotspot.CLHSDB | |
hsdb> attach 23296 | |
Attaching to process 23296, please wait... | |
hsdb> class StringTest | |
StringTest @0x00000000fb077268 | |
hsdb> whatis 0x00000000fb077268 | |
Address 0x00000000fb077268: In perm generation perm [0x00000000fae00000,0x00000000fb077e50,0x00000000fc2c0000) space capacity = 21757952, 11.895604880459338 u | |
sed | |
hsdb> inspect 0x00000000fb077268 | |
instance of InstanceKlass for StringTest @ 0x00000000fb077268 @ 0x00000000fb077268 (size = 592) |