Google Reader

I use google reader as my RSS feed-reader, just so I can access it anywhere.

Today I found out that you can also insert clips from google reader into your own site, like the below ’starred items’:


Quite nice!

Living at the server side

It has been a long while since my last blog post. A lot of stuff has happened in my personal life, but I have a feeling that it has calmed down significantly enough for me to enjoy my life once again.

I have been reading some books lately, all programming related:

iPhone SDK Development: this is a Beta book from the pragmatic programmers group… it is not yet finished but what I read so far is quite interesting. The book tries to easy you into iPhone development, it kind of succeeds, however since it is a beta book it has a lot of small errors…. and that makes it hard to follow along, since you are regularly trying to find out why something is not working and thinking you did not pay enought attention :S…. luckily the errata section on the website helps a lot! In the end this will be a great book to start your own development, I am sure!

Programming Erlang: a very good book to get you into Erlang programming! I would recommend this book to anyone interested in learning Erlang. The book starts with a gentle introduction into the language itself and the change of mindset needed with functional programming after which it nicely covers everything from distribution of code over several nodes, storing data in the various database possibilities and creating distributed, fault tolerant and concurrent systems using the Open Telecom Platform (OTP).

Erlang in practice: not really a book, it is a set of screencasts exploring the process of writing an erlang chat server. Takes you through all the steps; setting up, distributing, persisting and adding REST support.

Although the iPhone/Objective-C book is quite interesting I find that I am more attracted to writing server side software. I guess it is because server side software is more of an boolean logic then interfaces (either it works, or it doesn’t).

Although the Erlang package comes with a great Emacs mode for editing erlang software it misses 2 things:

The mode uses Tempo snippet support, while I have found that YA Snippet provides far superior templating.

The other is that flymake is quite a necessity I think. Flymake provides on-the-fly syntax checking of your source code.

I have added the following configuration to my emacs setup to enable it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(add-to-list 'load-path "path-to-erlang-package-emacs-mode")
(require 'erlang-start)
 
(add-to-list 'auto-mode-alist '("\\.erl?$" . erlang-mode))
(add-to-list 'auto-mode-alist '("\\.hrl?$" . erlang-mode))
 
(require 'flymake)
 
(defun flymake-erlang-init ()
  (let* ((temp-file (flymake-init-create-temp-buffer-copy
		     'flymake-create-temp-inplace))
	 (local-file (file-relative-name temp-file
		(file-name-directory buffer-file-name))))
    (list "path-to-eflymake" (list local-file))))
 
(add-to-list 'flymake-allowed-file-name-masks '("\\.erl\\'" flymake-erlang-init))

Lines 1 and 2 setup the erlang mode, 4 and 5 associate this mode with .erl and .hrl (erlang records) files, line 7 loads up flymake and lines 9 up to and including 14 tell flymake how to check erlang files for syntax. I use the eflymake script for this job. Line 16 tells flymake to use this for .erl files.

The eflymake script mentioned is an escript script:

1
2
3
4
5
6
7
8
#!/usr/local/bin/escript
-export([main/1]).
 
main([File_Name]) ->
    compile:file(File_Name, [warn_obsolete_guard, warn_unused_import, 
                             warn_shadow_vars, warn_export_vars,
  			     strong_validation, report,
  			     {i, "../include"}]).

This greatly simplifies the writing of code using our favorite editor ;). During the screencasts of Erlang in Practice (mentioned above) you see the benefit of this extension. The author starts out with a clean Emacs installation it seems and over the various screencasts you see that he adds this extension. In the first couple of sessions you see him make some small mistakes and lateron you see that Emacs warns him and he fixes the code before he gets bitten by it.

While learning Erlang I found that I have a new-found love for server programming. I was kinda dumbed down by the many years of Java programming and was loosing interest in programming server-side really, now with an injection of a new language and “new” ideas I am totally excited to be in this field again… quite awesome what taking some time to learn something new can bring with it!

So, expect some Erlang posts the coming time. I am trying to think of a nice example to illustrate some of the niceties of Erlang and the OTP.

Iron Maiden 2008

Iron Maiden, on their Somewhere Back In Time Tour, passed through The Netherlands once again… and as usual me, Patrick, Leon and Marco went to see them. We have done this ritual the last few times they came through on their different tours. I think this was the 3rd time we saw Maiden as a group actually, while it was the 8th time for me!

Since the first lineups would start aroung 4:30pm / 5pm (lauren harris) we figured it would be a good idea to leave a little bit early. So at 2 we were on our way from Almere to Assen, the TT Circuit, where the concert was being held. Luckily we left early, because for the first in all our concert trips we had big car problems; the coolant hose ruptured when we were a few hundred meters away from the concert grounds!

Luckily for us we were not the only ones with car trouble. A guy (not even 50 meters further down the road) broke down an hour and a half before and had called the ANWB. So after about another 20 minutes waiting the ANWB guy helped us out with patching the cable with some special tape and filling up our coolant tank again.

One very important thing I learned last time at Fields Of Rock was to have some extra supplies for after the concert when you try to get out of the parking lots (it took us 2 hours back then)… these supplies were a welcome thing while standing in the burning sun with a broken car!

When we finally arrived at the concert grounds (around 6pm) first thing to do is grab some drinks and food. The food was actually of good quality, I had a big chicken leg and the other guys had some chicken wrap type of thing and a square (?!) hamburger; they seem to be enjoying it!

Due to the car trouble we missed the first 2 shows really; Lauren Harris and Kamelot which was a shame. Only one act left which was Within Temptation, which was actually very good, they have grown really rapidly from the last time I saw them live! So much even that I went out to get their album today!

Then, finally, the biggest and baddest show I have seen in a long time. Iron Maiden lived up to its name and played an amazing set of old songs that made the crowd go wild from the first sounds of Churchill’s speech! Time flew so fast that I totally forgot to take pictures :(, but I saw Marco use his iPhone, so hopefully he has some good pics to show on his blog.

After the concert we had some drinks to fill up the bodily fluids once again! Standing between 30 000 metal heads, men and women, and going along in the music makes you sweat like crazy!

When the largest part of the 30 000 people crowd is gone you can truely see how large a mess is made during such a concert.

The way back went very smoothly, the Assen-er people seem to know how to deal with large crowds of cars and people and we were quickly on our way, albeit with a gigantic detour through the outer side of Assen/Drente. When we came in it took us 10 minutes to get from the freeway to a parking place, on the way out it took an hour to get back to the freeway because of the weird detour.

All in all a very good experience once again! Loved the concert, loved the crowd!

iPhone wordpress

The iPhone wordpress app was released I noticed today. To celebrate this I am writing this post and attaching a photo I shot yesterday at my dad’s place.

An update Java development environment

As a pre-cursor to my promised larger articles, a post about Emacs and some of the development tweaks I did last week.

The last weeks there has been quite some chatter about development setups. Most notably Sacha Chua figured out that she could be more productive in Emacs then in Eclipse in her current project, read about it here, here and here.

Sometimes it just takes another person to bring back a thought about some feature or another that you go “damn, how could I have forgotten that one?”. Sacha’s posts and the emacswiki have fine-tuned my development process a little more.

Here are the changes I made, first the file-cache usage. I didn’t know about this one and I found it really usefull. It requires the usage of ido-mode though, so it might not be for everyone.

(defun file-cache-ido-find-file (file)
  "Using ido, interactively open file from file cache'.
First select a file, matched using ido-switch-buffer against the contents
in `file-cache-alist'. If the file exist in more than one
directory, select directory. Lastly the file is opened."
  (interactive (list (file-cache-ido-read "File: "
                                          (mapcar
                                           (lambda (x)
                                             (car x))
                                           file-cache-alist))))
  (let* ((record (assoc file file-cache-alist)))
    (find-file
     (expand-file-name
      file
      (if (= (length record) 2)
          (car (cdr record))
        (file-cache-ido-read
         (format "Find %s in dir: " file) (cdr record)))))))
 
(defun file-cache-ido-read (prompt choices)
  (let ((ido-make-buffer-list-hook
         (lambda ()
           (setq ido-temp-list choices))))
    (ido-read-buffer prompt)))
 
(require 'filecache)
(require 'ido)
 
(ido-mode t)
 
(global-set-key (kbd "ESC ESC f") 'file-cache-ido-find-file)

This sets up file-cache and adds a hook to ido for finding a file using file-cache. Pressing ESC ESC f will popup a prompt in the echo area for a name, just type the filename, without directory, and ido will list all files matching without looking if it is in the current directory or not.

I use this a lot with Java projects, using the JDEE mode. In order to adjust the file-cache to the current JDEE project, add the following to your .emacs file.

;; Prevent subversion files form polluting the cache
(add-to-list 'file-cache-filter-regexps "\\.svn-base$")
;; global variable to keep track of current project
(defvar credmp/current-jde-project nil)
 
;; small function to re-create the cache when the project changes
(defun credmp/update-cache ()
  (if (not (string= jde-current-project credmp/current-jde-project))
      (progn
        (file-cache-clear-cache)
        (file-cache-add-directory-using-find (substring jde-current-project 0 (- (length jde-current-project) 6))))
    )
  (setq credmp/current-jde-project jde-current-project)
  )
 
;; add the hook...
(add-hook 'jde-project-hooks 'credmp/update-cache)

One a-ha erlebniss (as the germans call it) was Etags, a usefull TAGS file generating program, which basically creates an index of symbols from your source tree.

In order to use etags you need 2 things, a TAGS file and etags support in Emacs. Generating a TAGS file is easy, if you are on Linux or Mac OS X. How it is done on Windows, I don’t know :)

The shell command to execute:

$ find . -name '*.java' | etags -

And the necessary elisp to use it:

(require 'etags)

Now you can use M-. to jump to a TAG. For in-depth info on TAGS please see section 33 Maintaining of your GNU Emacs manual (C-h i and then m Emacs).

It is quite nice to see our Emacs community so active in enhancing our day to day lives! Keep bringing it!

Blog updates

Alright, after the migration I wrote about earlier I have updated the theme from the standard one to a new one inspired by a blogpost by Jeff Waugh and the sandbox theme.

Support was added for a new Syntax Highlighting plugin, lightbox 2 and Gravatar support in the comments.

I also wanted to let you know about the upcoming series of posts I am preparing. I found that I get the most satisfaction (and response) from writing long, in-depth, articles like the post on my GTD setup. So I have been writing some in-depth stuff on Java programming: the Spring framework, RESTful services and Hibernate.

As it stands now the articles will start with the basics and the end result will be a fully functional service that illustrates a lot of concepts and techniques.

Stay tuned, hopefully the 1st of the articles will be pushed to the blog this week :)

Upgraded wordpress

It’s been a while since the last post and I have several large posts lined up, however before posting those I decided to upgrade wordpress to the latest version.

The upgrade was very uneventfull except for a non-working theme and a surprise delete (due to the ftp software) of my uploads dir…. (also first making this post as a ‘page’…. :) ) but everything should be restored now, except for the theme.

So it is time to update to a normal theme again and post some very nice in-depth articles.

worklog-mode now on github

Since switching to github last weekend I have very pleased with it, so pleased that I also have put worklog onto it.

You can find it on the worklog page on github. I also added the documentation to the wiki.

If anyone wants to work on it, please create a github account and I will add you to the list of collaborators :)

Using github

A while back I advertised I was running my own git repos. Today I switched color-theme-arjen to use github.

This switch will allow anyone to do development on it, to fork it or to just watch it.

Public cloning can be done by issueing the following command:

$ git clone git://github.com/credmp/color-theme-arjen.git

Enjoy!

Kings of Code, a Bunny and a Drivers license

It’s been a while since I posted on my blog and there have been some interesting happenings in my life.

First, last week I finally passed my drivers examn. Almost 12 years later then anyone else, but still sooner then some other people :). To actually get a drivers license in The Netherlands now you first pass the examn, then the CBR (the goverment branch that arranges driver tests) sends your result electronically to the city databases. The next day you can go and request a drivers license at city hall, at this point you are still not allowed to drive however. I now have to way 5 days before actually getting my drivers license, but then a new danger will be on the road! :)

I drove with a very nice organisation called ANWB which I can wholeheartedly recommend. I failed miserably on my first examn; nothing is ever easy ;)

Next up is Kings of Code. eBuddy actually sponsered the event, so pretty much every developer of eBuddy was there listening to the various talks. There were numerous interesting talks:

Peter Paul Koch
I missed out on most of this talk, but PPK had much to say about event handlers. He is quite a natural in giving presentations and everybody I talked to found it very informative (slides)
Folke Lemaitre (Netlog)
netlog.com is one of those sites you hear very little about but then you realise that half the world uses it. A community site much like Hyves or myspace, only not as ugly as those. Folke showed us how they handle scalability of databases and HTML caching. The most interesting part of the discussion was about how they utilized memcached to provide content caching and MySQL read offloading. A two thumbs up presentation from my part.
Mark Birbeck (W3C)
As a representative from the W3C Mark gave an insight into RDFa. I had a long discussion with him afterwards about the feasability of the semantic web.
Nate Abele (CakePHP)
This guy didn’t make a lot of friends during the conference. Apparently the current way to win souls for you PHP project is by telling people how messed up the project lead is for the other project. This talk also spurred a Rails vs PHP ditchotomy (as john resig so aptly called it). Not very productive I think.
Nate Koechley (Yahoo!)
The second Nate was awesome however. He talked about the performance of websites; many things were not new to me but the presentation was awesome nevertheless. I think a lot of the attendees went home with a lot to think about and hopefully it will lead to some better designs on the web.
Open Source Pitches
I didn’t attend most of the OSS pitches, so I have very little to say about this.
Menno van Slooten (eBuddy)
Menno gave a smooth overview on the history of web development and the need to give future web developers education in order to bring the skill level up to the next level.
John Resig (Mozilla)
I spent a fair amount of time talking to John before his talk about processing and some other projects. His talk was about choosing a Javascrip library by comparing 4 different ones. I didn’t find it very usefull, since I have very little to do with Javascript libraries, however a lot of people that I talked to who do have to choose found if very informative. John also showed a project called Sizzle, which he will release soon hopefully.

On a very happy note the Blender Foundation has released it’s second open movie project: Big Buck Bunny. Their website is quite overloaded at the moment, but they also put the movie on Youtube. Very funny and well worth the 10 minutes of my time :). Great job guys!