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
"Name","Retained Size","Shallow Size" | |
"byte[3703132]","3703144","3703144" | |
"_bytes of org.mortbay.io.ByteArrayBuffer","3703200","56" | |
"_buf of org.mortbay.jetty.HttpConnection$Output","3703256","56" | |
"_out of org.mortbay.jetty.HttpConnection","3705144","104" | |
"_connection of org.mortbay.jetty.nio.SelectChannelConnector$ConnectorEndPoint","3709968","64" | |
"[2985] of java.lang.Runnable[3000]","1886724728","12016" | |
"_jobs of org.mortbay.thread.QueuedThreadPool","1886728176","128" | |
"this$0 of org.mortbay.thread.QueuedThreadPool$PoolThread [Stack Local, Thread, Monitor Used] "4353837@qtp-27187756-191"","2240","112" |
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 Example { | |
public static interface Foo<T extends Bar> { | |
T[] getEnumValues(); | |
} | |
public static interface Bar { | |
} |
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.Arrays; | |
import java.util.Collection; | |
public class Glommer<T> | |
{ | |
public static <T> Glommer<T> glommer() | |
{ | |
return new Glommer<T>(); | |
} |
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 com.ning.compress.lzf.LZFInputStream; | |
import com.ning.compress.lzf.LZFOutputStream; | |
import org.apache.hadoop.io.compress.CompressionCodec; | |
import org.apache.hadoop.io.compress.CompressionInputStream; | |
import org.apache.hadoop.io.compress.CompressionOutputStream; | |
import org.apache.hadoop.io.compress.Compressor; | |
import org.apache.hadoop.io.compress.Decompressor; | |
import java.io.IOException; | |
import java.io.InputStream; |
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
cd src/hadoop-lzo | |
tar xzvf ~/Downloads/lzo-2.05.tar.gz | |
cd lzo-2.05 | |
CFLAGS="-arch x86_64" ./configure --build=x86_64-darwin --enable-shared --disable-asm --prefix=$HOME/hadoop-0.20.2/lzo | |
make -j4 | |
make install | |
cd .. | |
env \ | |
JAVA_HOME=/Library/Java/Home \ | |
C_INCLUDE_PATH=$HOME/hadoop-0.20.2/lzo/include \ |
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 org.codehaus.jackson.map.ObjectMapper; | |
import java.io.IOException; | |
import static org.codehaus.jackson.map.SerializationConfig.Feature.INDENT_OUTPUT; | |
public class JsonPretty { | |
private static final ObjectMapper mapper = new ObjectMapper().configure(INDENT_OUTPUT, true); | |
public static String toPrettyJson(Object instance) | |
{ |
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
Build the code with ASM 4 and Guava 12 as follows: | |
$ javac -cp $HOME/.m2/repository/org/ow2/asm/asm-all/4.0/asm-all-4.0.jar:$HOME/.m2/repository/com/google/guava/guava/12.0/guava-12.0.jar:. FibGeneratedAsm.java | |
Code can be run with: | |
$ ~/jdk-back/1.8.0-mlvm-2012_08_01_10_07/Contents/Home/bin/java -cp $HOME/.m2/repository/org/o/asm/asm-all/4.0/asm-all-4.0.jar:$HOME/.m2/repository/com/google/guava/guava/12.0/guava-12.0.jar:. FibGeneratedAsm | |
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
<dependency> | |
<groupId>io.airlift</groupId> | |
<artifactId>http-server</artifactId> | |
<exclusions> | |
<exclusion> | |
<groupId>org.eclipse.jetty.orbit</groupId> | |
<artifactId>javax.servlet</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> |
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 org.weakref.algorithms.graph; | |
import java.util.ArrayDeque; | |
import java.util.Deque; | |
import java.util.HashMap; | |
import java.util.Map; | |
import static java.lang.String.format; | |
import static java.util.Arrays.asList; |
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 CallException | |
implements Callable<Boolean> | |
{ | |
@Override | |
public Boolean call() | |
throws IOException | |
{ | |
try { | |
if (Math.random() > 0) { | |
throw new IOException("random io failure"); |
OlderNewer