Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jexp's full-sized avatar
🐉
Watching the chamaeleon.

Michael Hunger jexp

🐉
Watching the chamaeleon.
View GitHub Profile
Hi Michael,
Jon and I were geeking out on "The New Space Opera". Here are some of the titles and authors.
* Peter F. Hamilton: The Night's Dawn, Pandora's Star/Judas Unchained, The Void Trilogy
* Dan Simmons: Hyperion/The Fall of Hyperion, Endymion/The Rise of Endymion. Avoid Olympos/Illium, they're silly.
* Alistair Reynolds: Everything, beginning with Revelation Space.
* Iain M. Banks: Any of the Culture novels. The Algebraist is slightly off-kilter but enjoyable.
* Charles Stross: Glasshouse, Accelerando.
@jexp
jexp / Volnitsky.java
Created February 13, 2011 23:15
Some implementation spikes of the Volnitsky substring search algorithm in java
import sun.misc.Unsafe;
import java.util.Arrays;
import java.util.Random;
/**
* @author mh
* @since 12.02.11
*/
public class StringSearcher {
@jexp
jexp / Neo4j Template API
Created February 19, 2011 21:57
Request for Feedback on Spring Data Graph Template API
public interface Neo4jOperations {
<T> T doInTransaction(GraphTransactionCallback<T> callback);
<T> T execute(GraphCallback<T> callback);
Node getReferenceNode();
Node getNode(long id);
Node createNode(Property... props);
@jexp
jexp / gist:922874
Created April 16, 2011 04:41
vcap startup issue
ynagzet:cf mh$ ping vcap.me
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.068 ms
ynagzet:cf mh$ bin/vcap start router
router : RUNNING
ynagzet:cf mh$ bin/vcap start cloud_controller
cloud_controller : RUNNING
ynagzet:cf mh$ bin/vcap start redis
redis_gateway : RUNNING
@jexp
jexp / neo4j.sh
Created June 7, 2011 12:33
Neo4j server startup script replacement for MacOS
#!/bin/sh
### BEGIN INIT INFO
# Provides: neo4j
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
function abspath() { pushd . > /dev/null; if [ -d "$1" ]; then cd "$1"; dirs -l +0; else cd "`dirname \"$1\"`"; cur_dir=`dirs -l +0`; if [ "$cur_dir" == "/" ]; then echo "$cur_dir`basename \"$1\"`"; else echo "$cur_dir/`basename \"$1\"`"; fi; fi; popd > /dev/null; }
@jexp
jexp / imdb.roo
Created July 7, 2011 13:44
Spring Data Graph Roo Addon Sample Script for Movies and Actors
pgp trust --keyId 0x29C2D8FD
addon install bundle --bundleSymbolicName org.springframework.datastore.neo4j.roo.addon;1.1.0
project --topLevelPackage org.neo4j.imdb
graph setup --provider NEO4J --databaseLocation target/imdb
graph entity --class ~.model.Movie
field string title
field number --fieldName year --type java.lang.Integer --permitReservedWords --primitive
graph entity --class ~.model.Actor
@jexp
jexp / gist:1124816
Created August 4, 2011 09:19
How to store a directory tree in the Neo4j Graph Database
private static final RelationshipType SUB_DIR = DynamicRelationshipType.withName("SUB_DIR");
public void storePath(String path) {
Node dir = graphDb.getReferenceNode();
for (String name : path.split(File.separator)) {
dir = obtainSubDir(dir, name);
}
}
package org.neo4j.performance.wiki;
/**
* @author mh
* @since 18.07.11
*/
import org.apache.commons.io.FileUtils;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
@jexp
jexp / gist:1618465
Created January 16, 2012 01:23
Cypher Time Tree Queries
start year = node:time(year='2011')
match year -[m:MONTH]-> month <-[:OCCURRED]-data
where m.month => 1 and m.month <= 11
return data
month could also be the relationship-type instead of :MONTH and filter on that:
start year = node:time(year='2011')
match year -[m]-> month <-[:OCCURRED]-data
@jexp
jexp / gist:3166249
Created July 23, 2012 21:09
webex event center crashlog
Process: Event Center [22627]
Path: /Users/mh/Library/Application Support/WebEx Folder/1126/Event Center.app/Contents/MacOS/Event Center
Identifier: com.webex.eventcenter
Version: ??? (12.27.23.0)
Code Type: X86 (Native)
Parent Process: Google Chrome Helper EH [22518]
Date/Time: 2012-07-23 21:20:01.200 +0100
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6