07 August, 2012
Of course I'm still very serious about running and do at least 50-60 km per week, but preparing and planning for an event seems like way too much work at this stage.
12 June, 2011
1. The Galway City Marathon on 28th August (Update: cancelled)
2. The Dublin Marathon on 31st October (Update: finished in 3:52h)
3. The Clonakilty Waterfront Marathon on 10th December (Update: finished in 4:10h, it was really cold and hilly!)
08 June, 2011
It's not so much about what he says. Most of it has been said before.
But the fact that he is a dying man with nothing to gain, makes it all sound so real and honest that it hurts.
And it's totally amazing how you finish watching a little sad, but also smiling and full of energy and love for life. And even if you cried (I guess most people do) you've also laughed a lot. A cocktail of feelings that will stick in your brain for days.
08 April, 2011
It's supposed to be the most scenic but also the hardest in Ireland. And I'm also running in Vibram FiveFingers so should be fun :)
01 August, 2010
After a few months break I'm back to working on a project written mainly in Erlang and I'll be posting the most interesting pieces online to a small open-source project at Google Code, ErlAZ - Erlang A to Z.
The first module I'm uploading is an implementation of the Treap data structure.
What is a Treap?
It's a binary search tree where each node, in addition to its key and value, contains a number, called priority, assigned to it at insertion time.
All nodes are sorted horizontally by their key (so that a greater key is always to the right of a smaller one) and vertically by their priority (so that all parents of any given node up to the root have a higher priority than the node).
By choosing the priorities uniformly distributed across all keys (for example randomly), in the long run the treap will have the characteristic of a well-balanced tree, without having to re-balance it periodically.
I implemented my version as a drop-in replacement for the dict module, with all the dict functions having exactly the same signiture and behaviour, but working on treaps and performing according to the underlying tree structure vs. the hashtable used in dict.
There are also a few additional functions that use the ordered nature of the tree to allow querying and iterating over the keys in a sorted manner (which is pretty much the point of using a treap anyway), as well as functions for splitting the treap in two by a key (the first sub-treap contains all nodes with keys less or equal to the given key and the second - all nodes with greater keys) and for merging back a splitted treap.
The treap module comes with well documented functions and an extensive EUnit test suit (in a separate module treap_test), which contains tests and examples for the usage of each function.
As always all the code I release is covered by the New BSD License unless stated otherwise.
This means you are free to use it in any way you like, so help yourself:
- ErlAZ trunk - The ErlAZ project's root with the Makefile for building the code and its documentation.
- treap.erl - The treap module.
- treap_test.erl - The treap_test module with all the EUnit tests.