1. Listen to Midnight by Dstllry Music.

  2. Clojure Koans - Recursion

    (defn recursive-reverse [coll]
      (loop [coll coll
             acc '() ]
         (if (= (count coll) 0)
           (recur (rest coll) (cons (first coll) acc))

    I struggled with this one for a while - I don’t want to admit it, but honestly even though i have been coding since I was 16 years old - there are still many areas where I am rusty or weak.

    There is actually a surprising amount of low level concepts operating in a list recursive reverse in clojure.

    • tail-call recursion
    • accumulator
    • loop construct

    I have some questions about how this “special form”  loop operates with recur

    I think I need to make sure that I always remember the following :

    • the arity of the recur call must match the arity of the loop form
    • recur must be in the tail position.

    I’m not sure how this loop / recur mechanism is implemented in the JVM - I imaging that the binding created by ‘loop’ is associated with registers that are overwritten as part of the call to ‘recur’. The documentation says the bindings are rebound on call of recur in parallel and the execution of recur - is done in order.

    My questions are

    • Is recur causing some kind of local jump after each binding?
    • What happens with the return address? 
    • If recur doesn’t consume stack - what is going on with the return address? 
    • Is the return address always the same for the same recursive call?

    More importantly - Is there a chapter in Knuth AOC that could help me with this? Any other resources?  

    I feel like I am really missing some context.

  3. You can go fast, you can go smooth, but you are going to have to get out of thinking you can go fast and smooth - if you want to be really fast - you need to start with smooth [ Curtis Schofield : Racing Cars and Developing Software]

  4. Extracting PNG images from EFI firmware February 5, 2012 by RevoGirl - Includes header format of EFI scap file →

  5. media query practices

    I’m currently playing with using a ‘column’ definition and then redeclaring it’s width for each device i’m supporting - tablet, desktop.

    Using the ‘base’ unset media query as lowest common denominator.

  6. Dave goes Erlang - Check the comments for tips from the erlmystros →

  7. Chef + Capistrano + rvm gemset

    I spent the last few days struggling with chef.

    What can i tell you so that you need not have to have the same struggle.

    What ended up confusing me the most:

    Essentially ruby needs to exist on the server side - I use RVM because it is easy to script and i know it well enough. The client side Capistrano script expects the gem bundler to exist on the client side and to be part of the gemset described in Capistrano - this gemset is named ‘blazing_gemset_for_client_xxx’ for the purpose of this post.

    Design problem: 

    [RVM + Chef-Solo ]:: Server Side -> responsible for bootstrapping a fresh ubuntu 10.10 LTS machine into complete ready state (DB+WEB)

    [RVM + Capistrano ]:: Client Side -> cap production deploy should just work as it always does in the regular dev-cycle

    Design Principles:

     Easy to start a new production machine from scratch

     Developers do not need root to deploy

    What is less than vanilla in our setup:

     Had some legacy perl that expected to have apache.

    What web stack did we choose :

     Passenger 3

    What did I end up doing in the end

    1.  Install apache as the same user as is running the rails app (avoid permission issues and isolate user from root )
    2. System Wide RVM
    3. Create Gemset and manually bootstrap bundler into the gemset

    What I wish i could do differently

    1. Didn’t like having to couple the name ‘blazing_gemset_for_client_xxx’ (the rvm gemset that the capistrano script knows about) into the chef scripts

    What I like about what was accomplished 

    1. Implemented a Internet-friendly chef-solo bootstrap script
    2. Installed vim and my jan repo for nicer editing experience server side
    3. discovered the tricky part about capistrano  + chef + rvm

    What was in the way from taking a userland based approach for RVM

    1. Passenger is a server side component that requires a config file with pointers to ruby runtime - because of this - ‘client’ knowledge ended up embedded in the chef repository
    2. Capistrano assumes that a machine is setup in a particular configuration and it’s RVM support did not seem to include bootstrapping a gemset - event if it did - there would be more work to integrate it into passenger


    1. Unicorn runs in a different model and wouldn’t have encountered exactly this same issue
    2. There would still be the issues of coupling gemset name between Capistrano and chef - a detail that i think only one should know about. 

    About Me

    1. I have been a unix script banger since i was a teenager.
    2. I’ve been coding ruby since 2003 and rails since 2005.
    3. I’ve used Capistrano on pretty much every project.
    4. I deploy my node.js scripts with chef and it works ok.
    5. This is my second chef based machine rollout package and my first time integrating it with capistrano.
    6. I just started learning how to plie.

    Footnote 1 :

    I implemented a internet-hostile standalone chef-solo system for unpacking complete systems inside user accounts on lockdown intranet virtual machines as well - this was a build based solution and did not use rvm - but took a userland based ruby approach.

  8. Erlang Rev and Unit Testing

  9. erlang notices

    When using ’export’ a typo of ’exports’ will result in a warning that your functions are not used.

    a function declaration seems to be a collection of ’,’ separated statements ending in a period.

    If a process executes a function with a runtime error then an error report will be generated and the exit value, the error with it will be described.

  10. Dont Root the Robot - jon.oberheide.org - android root exploits and marketplace XSS attacks →