More Projects

The February Lady Sweater is done and looks like this:

February Lady Sweater

See how it goes nicely with my living room wall?

I’m happy with it overall. The button holes I made were way too big, so I ended up sewing part of them closed. I think I would have made the yoke a little longer if I were to do it over again.

In an effort to use up a bunch of stashed Cascade 220, I’m attempting to knit owls. I’m knitting a size large in hopes of getting an extra small. So far, it’s a little on the big side, but I think it will fit. Otherwise, Sophy gets it in exchange for all the nice things she’s given me. :)

Half Done Owls

A sleeve and body in a pile on the floor

I started knitting a Robin’s Egg Blue hat today for a friend’s neighbor who was just diagnosed with cancer. It’s my first hat, so I’m excited to see how it works out. The hat needs to be done by the end of February, so owls is on hold until it is finished.

Unrelated to knitting, I’ve found a new job! Pretty much the best job ever. I haven’t started yet because there’s still some visa related issues that need to be settled, but I’m looking forward to working on some cool stuff, learning how to be a morning person again, doing Ruby professionally again (even though it’s been a short hiatus) and giving the Erlang book I borrowed back.

I wonder how many programmers besides me use a new job as an excuse to buy cute dresses?

January 31, 2010

inject vs. each_with_object

I tweeted about this a while back, but I thought I’d write about how I ran into problems with inject and how each_with_object made it all better.

So I was originally using inject to create a hash of video game data from an array of div elements I was parsing with hpricot like so:

div_elements.inject({}) do |hash, div_element|
  game_name = div_element.at("//p/a").inner_text
  last_played_online_time = div_element.at("//p/strong").inner_text
  hash[game_name] = last_played_online_time
  hash
end

But sometimes, a user had never played a game online, so the text in the strong element I was checking for the time would contain something like “not played” in this case. I thought I could easily solve this by doing:

div_elements.inject({}) do |hash, div_element|
  game_name = div_element.at("//p/a").inner_text
  last_played_online_time = div_element.at("//p/strong").inner_text
  next if last_played_online_time =~ /not played/i
  hash[game_name] = last_played_online_time
  hash
end

But this was bad. Next would return nil, setting the accumulator to nil and causing bad errors on the next pass through the block. each_with_object did not have this problem. Changing things to use it looked like:

div_elements.each_with_object({}) do |div_element, hash|
  game_name = div_element.at("//p/a").inner_text
  last_played_online_time = div_element.at("//p/strong").inner_text
  next if last_played_online_time =~ /not played/i
  hash[game_name] = last_played_online_time
end

So not that different! But better. I didn’t have to worry about returning the accumulator, making things a little simpler.

December 23, 2009

Being a Girl Programmer

I’ve been ask a couple of times recently what it’s like being a female developer, and it’s one of those questions that I’m probably going to be asked as long as I code. I feel like earlier in my career it was a drawback. I’m pretty shy and I’ve lacked confidence in a lot of areas of life, and I think the combination of these two things and my gender made me seem less smart to some of my coworkers in the past. A couple of years ago, when I was working on my first Rails project, I had a coworker tell me (while drunk at an after work dinner) how he had assumed that I had no skills whatsoever and how surprised he was at how good some code I had written was. Besides that, I’ve had more cases of people assuming that I was more junior than I really am. I don’t think that my gender was the only reason for that, but I think that it’s been part of the problem.

As I’ve gotten older, I’ve realized that I can overcome people’s assumptions or keep them from making them in the first place by both being able to talk about things I know and writing good code. I’m still learning how to express myself better and I feel like I’ve failed a couple times to explain something as well as I wanted, but I’ll get better the more I do it. I don’t think I’ll ever be loud and highly opinionated, but I think that’s a good thing.

Also, I’ve been confused with every other female developer/qa/intern/admin that I’ve ever worked with. Maybe t-shirts with names on them would help with this?

December 13, 2009

Coding and Knitting

I spent Saturday working on my completely useless gem, henrietta_pussycat. I hadn’t looked at it in a long time, so there was a bit of “um, what was I doing?” that I cleaned up. I also added jeweler. I’m happy when I can find ways to avoid dealing with configuration.

There’s a method in henrietta_pussycat called classic_meow_insert. This method should replace all words with “meow” except for the words beautiful, telephone and Mr. Rogers. Replacing everything but beautiful and telephone is easy, not replacing Mr. Rogers is not, since it is really two words. I have yet to come up with a good solution to do this, but I did learn about regular expressions’ negative/positive look-behind and look-ahead. I spent a long time thinking that there must be some magical regular expression that would allow me to replace everything but the words I wanted, but then I realized I was trying to use a regular expression to not match something. That’s not what regular expressions are for! So, I’m still stuck, but I’ve decided that I can’t solve this problem, or at least not completely, with one regular expression.

henrietta_pussycat is on gemcutter and as of me writing this, 13 people have downloaded it. That is crazy.

As for knitting, somehow I’m almost half-way done my so called scarf. It’s the only holiday-ish gift I’m making this year and I’m pretty happy with it thus far. Next up, (after I finish the February Lady sweater) another shrug

December 06, 2009

The blog is up!

After much waffling on how I’d get a new blog on the Internet, I finally went with github pages. It was nice learning about Jekyll and was pretty easy to get things looking the way I wanted. I’m still not quite done, but after working on this all day, I figure I’d write an actual post.

I’ve never really blogged about what I do everyday, so I’ve decided that that is what I’ll do here. I’m excited about being able to talk about knitting projects in detail and interesting programming-related topics. I hope to write about what it’s been like being a female developer as well, since there are so few of us out there.

That’s it! More to come soon. Just to share, dumb bunny comes from my grandfather. He would call me a dumb bunny whenever I did something silly (or stupid) as a child. I’ve always liked it, so here it is :)

November 14, 2009