Skip to content

Instantly share code, notes, and snippets.

View spmallette's full-sized avatar

stephen mallette spmallette

View GitHub Profile
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes">
<ibiblio name="local" root="file:${user.home}/.m2/repository/" m2compatible="true"/>
<ibiblio name="central" root="https://repo1.maven.org/maven2/" m2compatible="true"/>
</chain>
</resolvers>
</ivysettings>
@spmallette
spmallette / raw-neo4jgraph-batched.groovy
Last active August 29, 2015 14:05
test out driver for "batch loading"
import org.apache.commons.lang.RandomStringUtils
g = Neo4jGraph.open('/tmp/neo4j-test')
vertexCount = 500
edgeCount = 5000
rand = new Random()
ids = new java.util.concurrent.CopyOnWriteArrayList()
clock(1) {
(0..<vertexCount).each{
def v = g.addVertex('name',RandomStringUtils.random(32),'age',rand.nextInt(99)+1,'description',RandomStringUtils.random(256))
if (it % 100 == 0) g.tx().commit()
@spmallette
spmallette / env.txt
Last active August 29, 2015 14:05
hadoop config
export HADOOP_PREFIX="/home/smallette/jvm/hadoop-1.2.1"
export HADOOP_HOME=$HADOOP_PREFIX
export HADOOP_CONF_DIR=$HADOOP_PREFIX/conf
export HADOOP_MAPRED_HOME=$HADOOP_PREFIX
export HADOOP_COMMON_HOME=$HADOOP_PREFIX
export HADOOP_HDFS_HOME=$HADOOP_PREFIX
export CLASSPATH=$CLASSPATH:$HADOOP_CONF_DIR
export GIRAPH_HOME=/usr/local/giraph-1.0.0
@spmallette
spmallette / titan-building-notes
Last active August 29, 2015 14:02
Building TinkerPop and Aurelius Stacks
# generate documentation
mvn -pl titan-dist package

Keybase proof

I hereby claim:

  • I am spmallette on github.
  • I am spmallette (https://keybase.io/spmallette) on keybase.
  • I have a public key whose fingerprint is B076 D269 AF15 8264 2135 88BA F7A9 2444 A376 2BC4

To claim this, I am signing this object:

@spmallette
spmallette / gist:eee03b57e92ec85ac0f4
Last active August 29, 2015 14:00
Decoding Permanent Locking Exception
gremlin> b = [ 64, 0, 0, 0, 0, 0, 0, 202 ] as byte[]
==>[B@150858bb
gremlin> r = new com.thinkaurelius.titan.diskstorage.util.ReadArrayBuffer(b)
==>64-0-0-0-0-0-0-202
gremlin> com.thinkaurelius.titan.graphdb.database.idhandling.VariableLong.readPositive(r)
==>36028797018964042
gremlin> ks = new com.thinkaurelius.titan.graphdb.database.serialize.kryo.KryoSerializer(true)
==>com.thinkaurelius.titan.graphdb.database.serialize.kryo.KryoSerializer@2ba74026
gremlin> x = ks.getDataOutput(40, true).writeObjectNotNull("10000000038529").getStaticBuffer()
public class EZMap<T> {
public static void main(String[] args) {
Map<String,Object> m = hashMap(
bob -> 5,
TheGimp -> 8,
incredibleKoolAid -> "James Taylor",
heyArnold -> new Date()
);
System.out.println(m);
}
@espeed
espeed / binary16-uuid.clj
Last active July 3, 2024 02:09
Random UUID compressed into a Binary 16 byte array in Clojure.
;; Random UUID compressed into a Binary 16 byte array in Clojure.
;; by James Thornton, http://jamesthornton.com
(ns espeed.uuid
(require [clojure.data.codec.base64 :as b64]))
(defn uuid4 [] (java.util.UUID/randomUUID))
(defn uuid-as-byte-array []
@spmallette
spmallette / tinkergraph-save-times-sizes.groovy
Last active December 15, 2015 22:08
Comparison of TinkerGraph serialization options.
types = [(TinkerGraph.FileType.GRAPHSON) : '/tmp/tg/graphson',
(TinkerGraph.FileType.GML) : '/tmp/tg/gml',
(TinkerGraph.FileType.GRAPHML) : '/tmp/tg/graphml',
(TinkerGraph.FileType.JAVA) : '/tmp/tg/java']
m = [:]
types.each{ gt ->
graph = new TinkerGraph(gt.value, gt.key);
graph.createKeyIndex("index", Vertex.class);
@spmallette
spmallette / gist:4463879
Created January 5, 2013 21:53
two shell lines to restart a cassandra cluster
pssh -i -h hosts.txt ps aux | grep cassandra | awk '{ print $2 }' |xargs sudo kill
pssh -i -h hosts.txt sudo /usr/local/apache-cassandra-1.1.2/bin/cassandra