Skip to content

Instantly share code, notes, and snippets.

View khotyn's full-sized avatar
😌
Focusing

Khotyn Huang khotyn

😌
Focusing
View GitHub Profile
@khotyn
khotyn / ReadFromClasspath.java
Created December 1, 2011 09:05
How to read a file as InputStream from the classpath without using any third party library?
package com.khotyn.test;
import java.io.InputStream;
/**
* Read a file from the classpath without using any third party library.
*
* @author khotyn 2011-12-1 下午5:03:21
*/
public class ReadFromClasspath {
@khotyn
khotyn / ThisEscape.java
Created November 29, 2011 14:16
This pointer escape while creating a new Object
public class ThisEscape {
public static Escape escape;
public static void main(String[] args) throws InterruptedException {
new Thread(new Runnable() {
@Override
public void run() {
try {
new ThisEscape().test();
@khotyn
khotyn / Test.java
Created November 29, 2011 01:34
Get operating system name using Java
package com.khotyn.test;
/**
* Quick Test
*
* @author khotyn 2011-11-29 上午9:34:25
*/
public class Test {
public static void main(String[] args) {
@khotyn
khotyn / rej.sh
Created November 28, 2011 03:41
How to start rej in Linux
java -jar rej.jar