Roku

I got a Roku box a few days ago – to replace my Google TV in my living room.  The Roku is definitely less powerful, can’t browse the web quite as well – but has been pretty enjoyable.  For the things it does, the Roku outperforms.  Netflix, Amazon Prime, and Hulu all felt pretty hacked into Google TV, but the Roku gives them a much more solid feel.

TV is a pretty exciting space, looking forward to what’s coming next – seems like it may be one of the next big battlegrounds as we head towards making computers even more ubiquitous.

Sopatrack Update

With this whole CISPA mess heating up, I thought it’d be good to write an update post (here’s the original) about a recent update that was made to Randy’s site, Sopatrack.

With the new update, comes a lot more data to view, and the expansion (despite the name) beyond SOPA to other bills in Congress.  The re-design really helps to make the raw data more clear.  My favorite page is the bills page, which breaks down funding on supporting and opposing sides for each bill.

Check it out, and keep your congresspeople responsible!

Arduino: Combination Lock Opener

So I’ve started in on my first Arduino project – an automatic combination lock opener.  It’ll automatically turn and guess the combination for a Master lock like this.  It’ll have a screen to display its current combination attempt, and will spin the dial itself.  I thought for a while about it, and I think I have some really neat ideas to make it more interesting:

  1. An optimization can be made by taking advantage of the lock’s imperfect positioning, and instead of trying every number, trying every other number first.
  2. Based on where 1 spin ends, you can make the next move you choose to make start close to the end position of your last move.
  3. The last turn, you can spin the lock and continually attempt opening, without re-trying the combinations.

So, my hopes are that with these optimizations, I can go from:

  • 1st dial – 40 possibilities
  • 2nd dial – 40 possibilities
  • 3rd dial – 40 possibilities
  • 40 * 40 * 40 = 64000 combinations

To:

  • 1st dial – 20 possibilities
  • 2nd dial – 20 possibilities
  • 3rd dial – spinning as I go
  • 20 * 20 * 1 = 400 combinations

I’ll post here updates as I have them, and hopefully soon we’ll have a cool combination lock unlocker.

Async.js is Boss

A JavaScript library I really like is async by caolan.  It makes common tasks for multiple async operations really natural, which is especially useful for Node programming.

Check it out!

Finding the Caller in Ruby

In Ruby, it can be really useful to know, in the flow of execution, the call stack within a certain method.  For that we have Kernel#caller.

#caller returns an Array representing the current call stack, where each element is a String like “file:line in ‘name’”.  Here’s an example:

def actually_do_it
  caller.join("\n")
end

def do_it
  actually_do_it
end

puts do_it

which will output:

ex.rb:8:in `do_it'
ex.rb:11:in `<main>'