The Red Hot Erlang Blog
Close

This is a blog application written in Erlang.

It is a complete rewrite of the blog code that appeared in the TWT experiment. Now it is making use of the SGTE template engine. The Ajax code is of course making use of jQuery but, compared to the TWT code, it is now more lightweight and is not using any synchronous operation.

If you would like to try it out or just look at the code, you will find the git repository here.
To checkout the code with git, run:


      git clone git://www.tornkvist.org/eblog
    

Note that this is still work in progress...

Who:
Comment:


QLC power

I've been doing some more work on my query DSL (described in an earlier post) for an internal project at my work.

I had a number of 2GB sized Mnesia disk_only tables that I wanted to traverse in a QLC query as one single table. Writing a QLC handler solved that very nicely:

tables() ->
    Tables = all_tables(),
    TF = fun() -> next(Tables) end,
    InfoFun = fun(keypos) -> 2;
                 (_)      -> undefined
              end,
    qlc:table(TF, [{info_fun, InfoFun}]).


next([T|_] = Tables) ->
    next(Tables, mnesia:dirty_first(T));
next([]) ->
    [].

next([_|Ts], '$end_of_table') ->
    next(Ts);
next([T|_] = Tables, Key) ->
    [hd(mnesia:dirty_read(T, Key)) |
     fun() -> next(Tables, mnesia:dirty_next(T,Key)) end];
next([], '$end_of_table') ->
    [].

So now I can make QLC queries like:

[T#tab.name || T <- my:tables(), T#tab.age > 42]

Hurray for QLC!

--Tobbe

prevnextpermalinkadd comment

3 Jul 2009 (14:08:31)
QLC power
7 Apr 2009 (14:38:57)
The importance of side-effect free coding
7 Apr 2009 (04:37:26)
Seethrough and Nitrogen
21 Mar 2009 (01:57:05)
RFC 4226 - HMAC-Based One-Time Password Algorithm
8 Mar 2009 (00:32:33)
The OTP docs.
4 Mar 2009 (07:37:29)
A frontend to xref
20 Feb 2009 (09:23:50)
Tracing with Redbug
12 Feb 2009 (01:07:17)
Erlang OpenID implementation
Red Hot Chili