The Snoopy Inspector

This week we had a very deep and hard to track down bug that was only happening on certain Mac architectures. The problem came down to setting shape object data on ActiveRecord models and then mysteriously having that field become nil.

After setting pry breakpoints in several dozen places we still weren’t any closer to solving the problem. The magic meta that ActiveRecord supplies was making it an impossible exercise of patience to step through what seemed to be several hundred stacks of a statement that was this simple on the outside:

shape = FactoryGirl.create :spatial_rectangle
rect = Shape.new
rect.data = shape

Empty Raise and Rescue

I was helping debug some open source ruby code today and saw a code block that looked like this:

def risky_method
# Logic Here ...
rescue
# Logging and record cleanup
raise
end

Christmas Tree Unlocked

Tonight Cass and I set up our Christmas tree tonight. It’s like opening a time portal every time we set it up. I remember all the Holidays we’ve had together and it’s just an awesome time. Cass says it’s this tree’s last year but part of me hopes that’s not true.

One Year Blogging

Boom! I’ve made it a whole year with my blog. Today is Thanksgiving and I am happy to have kept it going this long. May I find the time and energy to continue contributing to it!

Collecting URLs in Erlang

In chapter 16 of the book “Programming Erlang” Software for a Concurrent World” there is an example of reading through a web page and parsing out all of the anchor tags found in it. Here is the meat of the code that I found myself trying to understand for awhile and would now like to explain:

-export([gather_urls/2]).
-import(lists, [reverse/1, reverse/2, map/2]).
gather_urls("<a href" ++ T, L) ->
{Url, T1} = collect_url_body(T, reverse("<a href")),
gather_urls(T1, [Url|L]);
gather_urls([_|T], L) ->
gather_urls(T, L);
gather_urls([], L) ->
L.
collect_url_body("</a>" ++ T, L) -> {reverse(L, "</a>"), T};
collect_url_body([H|T], L) -> collect_url_body(T, [H|L]);
collect_url_body([], _) -> {[],[]}.

Burgess and Cummings Falls Adventure

Went out to the Burgess and Cummings Falls state parks this weekend. What an amazing set of parks that are fairly close together. Very excited to go back in the summer for some in-water action!

Cosmos Javascript

If you’ve been following my blog you’ll notice a spacy, cosmos background with little stars floating about. I saw this effect on another website and had to replicate it for myself! There isn’t too much going on, but I did enjoy building it. For anyone curious about the source; here is a repo created to help tool it out: Cosmos.

Kerl - Installing Erlang Easier

Installing Erlang has been somewhat of a pain. When trying to make sure I have the version I want, relying on the ppa has not been that great. Thankfully someone has shared with me an amazing tool, kerl.

Endless River Is Here!

I have been a huge Pink Floyd fan for most of my life, and I was pretty happy to hear when the new album “Endless River” was coming out. I decided to pre-order my collectors copy a couple months ago and since it showed up on my doorstep it has been playing non-stop.