Tim’s Blog

  • Benchmarking Recursion Using Factorial Function

    def fact(n)   (1..n).to_a.inject(1){|f,n| f*n} end def recursive_fact(n)   return n==1 ? n : n * recursive_fact(n-1) end require ‘benchmark’ Benchmark.bm do |b|   b.report(“inject”){1000.times{fact(100)}}   b.report(“recursive”){1000.times{recursive_fact(100)}} end

  • Debug NUnit Tests With Visual Studio

    1. Set a break point in a unit test 2. Open NUnit 3. In Visual Studio, go the tools Menu and choose Attach to Process (or Ctrl-Alt-P) 4. Choose nunit out of the list 5. Run tests. Make sure you run the test where your breakpoint is if you don’t run all tests.

  • Javascript Scoping

    If you understand what’s going on when this runs, then you understand javascript scoping. var x = 5; alert(x); function foo(){alert(x);var x = 10;alert(x);} foo(); alert(x);

  • Parenthesis Syntax

    I’m going to a talk on F# tonight in the Cleveland area. It’s not something I’ll likely get to use in my job, but it’s interesting, and I like to check out different languages. I’ve played around with the language and it seems to have some promise. I like some of the newer functional languages […]

  • Thinking About Steve Yegge’s Hiring Post

    UPDATE: I wrote some more recent things about Steve’s famous google plus post. http://steve-yegge.blogspot.com/2008/06/done-and-gets-things-smart.html I’m a big fan of Steve Yegge and his blog. I was recently rereading some of his posts and the above one had a lot of new meaning for me. At my job, I had recently been involved several interviews of […]

Got any book recommendations?