Archive for October, 2008

Baby 2.0

XKCD

Even though I posted the news on FaceBook, it appears that there are still a few folks out there in the dark.  I’m pregnant again.  Due in mid April.

Lilli and her new sibling will be 13 months apart.  Anyone know a good babysitter?

Add comment October 31st, 2008

Win/Fail

Fail

This post is meant for my non-tech friends out there who are often unfamiliar with internet trends and memes.  I feel its my duty to help them keep up with their kids.  Not that I’m trendy or cool by any means, simply because I pick up odds and ends because I work at a trendy and cool place with people much more hip than I. 

I recently needed to explain this phrase to my husband when I started laughing hysterically at the recent photo taken at a Senate hearing on the financial crisis.  The article from SLATE does a nice job of explaining the origins of this meme.  

Safe to say, that this simple one line phrase is an elequent desciption of our current economy.  I’m hoping that we don’t end up having to graduate to ‘Epic Fail’.

Add comment October 16th, 2008

each_with_index

You won’t find each_with_index in the ruby Array class documentation. But this handy little method allows you to iterate through an array while also keeping track of which element you’re on.

It works something like this:
my_array.each_with_index do
|a, index| puts "#{a} is located at index #{index}"
end

Sure beats typing
i=0; i++; i<(array.size -1)

2 comments October 15th, 2008

Do you twitter?

While most of my non-techie friends are just discovering FaceBook, I’m hoping that they’ll get the bug for online social networking and move on to Twitter.

Twitter is a website that helps friends, family, and co-workers communicate quickly and easily through short updates. Users let one another know what they’re up to by answering one question: What are you doing? Using 140 characters or less, members provide the Reader’s Digest “short answer” to that question.

Once you’re a “twitterer” its a short leap to joining TwitterMoms. This a place where twittering moms can meet and network with other moms who twitter.

As I was seeking out geeky moms more like myself on Twittermom, I came upon the Techmamas group created by TechMama blogger Beth Blecherman. There are currently 140 members… oh, 141 I just joined!

Are there any other twitter sites out there for twittering women in tech?

2 comments October 10th, 2008

Nested Sets and Scope

A colleague and I both had this same issue working with BNS and since there wasn’t much about it on the net, I figured I’d share.

Each TLD in my nested set will be its own tree root. And multiple tree roots in a nested set require a scope.


acts_as_nested_set :scope => :root

The ruby on rails wiki mentions scope using a root_id column, but you’ll notice in the example that the root records have a root_id of nil. This just doesn’t work.

When you attempt to move_to_child_of your new node record after create, you’ll recieve this error:

Impossible move, target node cannot be inside moved tree.

Now, we couldn’t find any documentation anywhere but after much trial and error my colleague discovered that populating the root_id of a root record with its own id, resolves the issue.


root = Domain.new
subdomains.each_with_index do |subdomain, index|
node = Domain.find_by_subdomain_and_parent_id(subdomain, parent.id)
if node.nil?
node = Domain.create(:subdomain => subdomain, root_id => root.id)
if parent.new_record? #is this a root record?
node.root_id = node.id # <-------------------------------- populate root for root records
node.save
root = node
else
node.move_to_child_of parent.id
end
end
parent = node
end

2 comments October 3rd, 2008


RSS Berkman Gender & Tech

RSS Tweets

Tags

Meta