<neo4j:config storeDirectory="/var/neo4j" base-package="graph.model" />Everything worked fine until I embedded my project in a larger Spring project which loads around 15 or so top level application context files for all the modules. Suddenly my configuration started throwing exceptions:
<neo4j:repositories base-package="graph.repositories"/>
Saturday, September 27, 2014
Spring Data Neo4j Namespace Configuration Fails on Reload
I started a graph DB project using Neo4j a couple of weeks ago and decided to use Spring Data Neo4j to make my life easier. I got my app up without much hassle using the Spring Data Neo4j namespace configuration to configure my application in XML. This is quickly done with just 2 lines of XML:
Friday, August 8, 2014
Syntax Highlighting for Groovy in Kate
Groovy has been my scripting language of choice for some time now and since I'm running KDE I'm using Kate for quick scripts. And even though Groovy has been around for quite some time and Kate supports a myriad of syntax highlighting modes, Groovy for some odd reason isn't one that comes bundled with Kate out of the box. At least not up to my current KDE version 4.13.2 running on Ubuntu derivatives - neither on (K)Ubuntu nor my latest install of Mint 17 KDE.
Thankfully Kate's syntax highlighting is extendible and the Groovy project provides plugins for various editors including kate. Unfortunately the instructions on this page have never worked for me on an Ubuntu based system. The path names listed on that plugin page weren't correct with any install of KDE out of the repository.
To make Groovy syntax highlighting work, I instead had to place the groovy.xml file into
~/.kde/share/apps/katepart/syntax/
in order to make it available for a single user or in
/usr/share/kde4/apps/katepart/syntax
to make it available system wide. Restart Kate, here you go. It gets picked up automatically when you save a .groovy file and resides in the Tools -> Highlighting -> Sources menu.
Thankfully Kate's syntax highlighting is extendible and the Groovy project provides plugins for various editors including kate. Unfortunately the instructions on this page have never worked for me on an Ubuntu based system. The path names listed on that plugin page weren't correct with any install of KDE out of the repository.
To make Groovy syntax highlighting work, I instead had to place the groovy.xml file into
~/.kde/share/apps/katepart/syntax/
in order to make it available for a single user or in
/usr/share/kde4/apps/katepart/syntax
to make it available system wide. Restart Kate, here you go. It gets picked up automatically when you save a .groovy file and resides in the Tools -> Highlighting -> Sources menu.
Thursday, November 28, 2013
Making Java Groovy

Working in an almost Java-only environment have been interested in Groovy for quite some time. Most Java developers know the problem: You have all kinds of libraries or at least code snippets that already capture your business logic. But if you want to run a quick script to make use of it, you either have to create a full blown Java app with all it's draw-backs, or go for some other scripting language that can do the trick with as little code as possible; for my quick-and-dirty scripts I usually resorted to one of bash, PHP or Perl. For more complicated tasks I bit the bullet I wrote Java app, bundled into one big jar with a myriad of command line parameters to be able to switch environment, figure out best settings and what not.
Tuesday, August 27, 2013
Loops in Message Routing/Graphs
This topic seems to be so beat down even to me that it was somewhat surprising to actually come across a real life example where a major corporation seemed to have not paid attention to it. Even more surprising if this happens to a company which's whole business is about routing: USPS.
I recently ordered something online that was supposed to be delivered by USPS, which was tasked to just complete "the last mile". Now I made a mistake and had the package shipped to my office but accidentally had typed in the zip code of my home address (which are only about 7 miles apart from each other). Looking at the online tracking app, I could not believe what is happening:
Wednesday, August 7, 2013
Don' forget about IOPS on RDS
A lot of things a slightly different when you run your application on cloud services like AWS. Take database servers: Increased load can always change the performance of DB look-ups and writes. Larger tables can lead to slow queries if the tables are not indexed right, a lot of writes may cause unexpected locking, etc.
However if you use Amazon's AWS there is another important factor you should not loose sight of: IOPS. This measures the number of I/O operations between the database server and its storage, which is attached as network storage.
It's somewhat unclear if/how Amazon throttles the throughput if you don't reserve IOPS. You might be at the mercy of other RDS instances that are running on the machine and probably some kind of rate limit AWS implicitly imposes.
Graph Traversal: Breadth First Search
Breadth First Search (BFS) is a fundamental graph-traversal technique and you could use it of find it being used in a wide range of applications. For a full explanation of the technique check this link, or this link.
The parent array in BFS is very useful for finding interesting paths through a graph; the parent relation defines a TREE OF DISCOVERY with the starting node as the root of the tree.
Because vertices are discovered in order of increasing distance from the root, the tree of discovery contains minimum-length paths from the root to each node.
The time complexity of a BFS implementation is: O(M + N) , that is, it runs in linear time as a function of the sum of the cardinalities of the vertex and edge sets.
Two example application problems where BFS plays a role are:
The parent array in BFS is very useful for finding interesting paths through a graph; the parent relation defines a TREE OF DISCOVERY with the starting node as the root of the tree.
Because vertices are discovered in order of increasing distance from the root, the tree of discovery contains minimum-length paths from the root to each node.
The time complexity of a BFS implementation is: O(M + N) , that is, it runs in linear time as a function of the sum of the cardinalities of the vertex and edge sets.
Two example application problems where BFS plays a role are:
- Connected Components
- Two-Coloring (Bipartite checking)
Tuesday, August 6, 2013
Graph Traversals: Generic Implementation
Recently I had to go back and dive deep into the fundamental elements involved in graph traversal algorithms; specifically, I wanted to get refreshingly clear in my head the essence of these and related techniques. I found that the approach taken in the book I always recommend was right on target to allow me to reach my objective. The approach Prof. Skiena proposes is captured somewhat in the implementation we describe in this and the next two posts in this series.
Base Classes
All graph traversals share a certain "philosophy", in the sense that they are trying to achieve a goal (traverse the graph), and to do so they maintain some state (e.g. discovered, time, ...) and use some appropriate data structure explicitly (queue) or implicitly (stack). The idea is then to abstract those commonalities as much as possible and provide "entry" points to the implementation by means of an API (function/method calls), which enable the tailoring of a generic implementation to the solution specific to a given problem.
Subscribe to:
Posts (Atom)