Categories: General

Visual Path Finding

Categories: General

Cool Graphics

April 24, 2013 Leave a comment
Categories: General Tags:

Better Grep

April 24, 2013 Leave a comment

Better Grep

Interesting I like the way it highlights and also puts line numbers.

Categories: General Tags: ,

Elevation Gain

April 21, 2013 Leave a comment

So today when I went out riding I had just one goal in my mind to go over my previous max elevation gained (1800 feet) and I am glad to say I made it to 2332 feet.

http://t.co/X5xxPQqYZN

Categories: General Tags:

Using In Clause with MyBatis and Scala

January 4, 2013 3 comments

Had a bit of struggle to get this to work, logging the solution here so that it will be helpful to someone else. I am using Scala 2.9.1 and mybatis-scala-core 1.0.0.

val findOpenGroups = new SelectListBy[GroupIds,Group] {
def xsql = SELECT h.xxxxxx AS id,
h.xxxxxx AS launchedDate
FROM USA_xxxx_xxxx_xxxx h
WHERE h.new_status = 'Open'
AND h.id IN
<foreach item="item" collection="ids" open="(" separator="," close=")"> 
                {"#{item}"}
            </foreach> 
}

GroupIds is a simple class, just make sure you are using the java.util.List.

class GroupIds(val ids:java.util.List[Int]){}

UPDATE
Frank Martínez pointed out to me that you can also do {"item" ?} instead of {"#{item}"} but you will need to import org.mybatis.scala.mapping.Binding._ Thanks Frank.

Categories: General Tags: ,

Neo4j: Running Embedded Server with WebConsole

October 17, 2011 1 comment

Took me couple of hours to figure this out so blogging it, hopefully it helps someone else.

If you are running Neo4j in embedded mode, you can still get the web console, data browser and other goodies, they do mention this in the manual but what they don’t mention is that you will need 2 extra jars to do this neo4j-server.jar and neo4j-server-static-web.jar and these are not available on neo’s repo, so you will have to clone their source from git and build it locally.

Add them to your pom.xml

<dependency>
  <groupId>org.neo4j.app</groupId>
  <artifactId>neo4j-server</artifactId>
  <version>1.5.M01</version>
</dependency>
<dependency>
 <groupId>org.neo4j.app</groupId>
 <artifactId>neo4j-server</artifactId>
 <version>1.5.M01</version>
 <classifier>static-web</classifier>
</dependency>

Notice the “classifier” in the above code. Below is the code for how you would start it.

EmbeddedGraphDatabase db = new EmbeddedGraphDatabase(<path>);
bootstrapper = new WrappingNeoServerBootstrapper(db);
bootstrapper.start();

UPDATE
Once you get the web console you will be able to run Cypher queries but not Gremlin, to be able to run Gremlin queries too include it into your classpath.

<dependency>
        <groupId>com.tinkerpop</groupId>
	<artifactId>gremlin</artifactId>
	<version>1.3</version>
	<type>jar</type>
	<exclusions>
		<!-- Sail support not needed -->
		<exclusion>
			<groupId>com.tinkerpop.blueprints</groupId>
			<artifactId>blueprints-sail-graph</artifactId>
		</exclusion>
		<!-- Maven support in groovy not needed -->
		<exclusion>
			<groupId>org.codehaus.groovy.maven</groupId>
			<artifactId>gmaven-plugin</artifactId>
		</exclusion>
		<!-- "readline" not needed - we only expose gremlin through webadmin -->
		<exclusion>
			<groupId>jline</groupId>
			<artifactId>jline</artifactId>
		</exclusion>
	</exclusions>
</dependency>
Categories: General, Tech Tags: , ,
Follow

Get every new post delivered to your Inbox.