Here are my notes on Rob Harrop’s presentation about functional programming. Why is Functional Important? 1. Simplicity it’s declarative you write what you want to achieve, rather than give instructions how to achieve it express solutions, and you do not worry about individual steps 2. Agility functional fits well with Agile methodology testing is much […]

I needed to transfer a 4GB file the other day. Unfortunately, there is no easy free way to do it. So I went the tech way. How To Upload the file to a server you have access to (e.g. your server slice) via scp: scp my_large_file my_server:. In case your connection breaks up, you can resume […]

A bit of googling directed me to this article, which was about sampling a file. What I really wanted was to remove every fifth line from a file. Here is the input file: 1 00:00:06,244 –> 00:00:09,004 The public has a very romantic idea of what wine’s about. Le public a une idée très romantique du vin. […]

I have really enjoyed reading JavaScript: The Good parts. It has been recommended to me by many friends, and I’m certainly not disappointed. Douglas Crockford did an excellent job. The book is highly opinionated, and that’s a good thing, given that the author is seen as a prolific and talented Javascript expert by his peers. […]

The Service Layer as the New Meme I have read recently a bunch of articles about service-oriented architecture. Or at least that’s how I like to call it. A few months ago, there was the much-discussed Moving on from Rails (and then its follow-up). More on the concrete side, Nicholas J Henry has written a nice blog […]

I have just watched the 27-min introduction on Procs by Peter Cooper, which is really a short section of his RubyReloaded course.   Here are my notes: blocs are essentially nameless functions the block_given? method can be used to find out if a block was passed to the current scope blocks are anonymous functions which […]

I watched a keynote from Robert Martin during the Ruby Midwest 2011 conference. It’s always fun to watch veterans from the field. Here are some thoughts: Decoupling the whole talk is about decoupling the web is just a “delivery mechanism” Ivar Jacobson’s use case driven approach: make the intent of your system obvious architecture: boundary, […]

I bought 6 screencast episodes of Ruby metaprogramming about 3 years ago and only recently have I watched them all. And I must say: it was quite worth it! Just a reminder that it’s never too late 🙂 See below for my notes (which have been approved by Dave Thomas himself). Episode 1 – Objects […]

I’m running Snow Leopard and it seems like a fresh Capistrano install did not forward my ssh credentials when I was deploying my Rails 3 app on a remote server, having my git repo on beanstalk (similar to the popular github). After a lot of googling, I understood the problem and went on to fix […]

Question What would be the output of this code snippet?   Solution The output is “nil”. Here is the reason why, taken from Programming Ruby 2nd edition (p. 86): [W]ritable attributes have a hidden gotcha. Normally, methods within a class can invoke other methods in the same class and its superclasses in functional form (that is, with […]