Software

How to shoot yourself in the foot using a functional programming language

03.09.10 | Permalink | Comment?

While preparing for a presentation on Scala, I added some jokes on the functional languages. Here’s the original version and the new editions
Erlang
You create a dozen clones of youself, pass the gun to one another in turn to shoot at each other’s foot
Python
You have to align your foot 10 steps below the gun for it [...]

Tags:

Rails

Selectively load Ruby Facets modules

01.12.10 | Permalink | Comment?

Ruby facets has a lot of useful libraries. Sometimes you only want to load the ones that you need. Here’s a little snippet that you can use

Rails won’t load facets as the ‘lib’ param is false. We then load the libraries manually through initializers. This helps when facets unwittingly clobbers some of the other gems [...]

Tags:

Rails

Testing PDFs with Celerity-Culerity and Cucumber

12.11.09 | Permalink | 1 Comment

Here’re the code to test the content of the pdfs. But first you need the pdf-reader gem.

The feature file is above.

Add the code above as a helper file.

And lastly, the steps. Remember to add a @pdf tag to your feature files.

Rails, Software

Using Cucumber to test Paperclip file attachments

08.31.09 | Permalink | Comment?

I was using thoughtbot’s paperclip to attach files. I realised that paperclip only provide shoulda macros for test::unit. No cucumber macros? In the end, I got to write it. Its very simple.
The feature is shown here:
Define your steps:
As celerity does not have an attach_file method, I got to write my own. You [...]

Tags: , , ,

Rails, Software

Email_Spec Integrated with Action_Mailer_Cache_Delivery

08.20.09 | Permalink | Comment?

For people using the action mailer cache delivery plugin, you can now add the email_spec plugin. The email_spec plugin provides many wonderful helpers to test your emails. Both plugins are now integrated. To use them you need to install both my forks of the plugins:

action_mailer_cache_delivery
email_spec

Install them as plugins following the same instructions from the [...]

Software

Troubleshooting an Eclipse PDE Build

06.10.09 | Permalink | Comment?

In this post, I’ll share what I’ve learnt trying to run an Eclipse PDE build. The specific version is Eclipse 3.2. This took me a while to get right(a few months in fact!). The key to getting it right is getting The Dependencies right. So let’s dive in!

Setting up

I’m following the [...]

Guitar

Fly away – Corrinne May Guitar Chords

11.09.08 | Permalink | 2 Comments

This is a sad sad song. Well it happened to be my best friend’s favourite. Reminds her of her Mom. Anyway this is for you MF!

F major, capo 1

F Am
“When will you be home?” she asks
[...]

Software

Setting up a basic project infrastructure with Redmine, Hudson, VSFTP

10.23.08 | Permalink | Comment?

Here I would like to share with you the steps to set up the basic project infrastructure.
For a project, there’re a few tools which are absolutely necessary to function

File Server
Project Wiki
Continuous Integration Server
Bug/Issue Tracking
Source Control

With these features in mind, I have identified the software necessary to provide all these functionality.

Subversion – Source Control
Redmine – wiki, [...]

Guitar

Plucking patterns for 让夜轻轻落下

10.18.08 | Permalink | 1 Comment

This is a very old song. Its from the ‘Xinyao’ era in ’80s Singapore
where its a mini Renaissance of local Chinese music. I love songs from that era. Here is one of them. You can catch the original song here.
The plucking patterns are improvised by me. For those new to guitar music notation:
p = thumb(duh…)
i [...]

Guitar

Guitar Chords for The Birthday Song – Corrinne May

10.06.08 | Permalink | 5 Comments

The Birthday Song – Corrinne May
Here’s another set of self written chords. I wrote this cos someone wanted to play this song for her best friend. And I thought that’s a worthy cause. So here goes…

G
Don’t worry about that extra line
       Em
That’s creeping up upon your face
     G
It’s just a part of nature’s way
   Em                        [...]

« Previous Entries