Skip to content

Instantly share code, notes, and snippets.

@shenie
shenie / download_sources.sh
Created November 26, 2009 05:40
Download sources from maven
#!/bin/bash
prefix="http://mirrors.ibiblio.org/pub/mirrors/maven2"
header="/tmp/$0.header.$$"
find . -name "*.jar" -and ! -name "*sources.jar" | grep -v "siteminder" | \
while read j
do
source_jar=$(echo $j | sed -e's/.jar/-sources.jar/')
import org.junit.Assert;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
public class MapReduce<V, T> {
private Collection<V> collection;
@shenie
shenie / YamlDumper.java
Created August 15, 2008 13:23
yaml dumper using jyaml lib
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.log4j.Logger;
import org.ho.yaml.Yaml;
public class YamlDumper {
private static final Logger LOG = Logger.getLogger(YamlDumper.class);
private final Object object;
public YamlDumper(Object object) {
@shenie
shenie / getStackTraceAsString.java
Created August 14, 2008 13:57 — forked from fuzzylizard/getStackTraceAsString.java
Return stack trace as string
public static String getStackTraceAsString(Exception e) {
StringWriter stackTrace = new StringWriter();
e.printStackTrace(new PrintWriter(stackTrace));
return stackTrace.toString();
}