Archives for October 2007

RubyConf 2007

I’m really geeked to go to RubyConf this year. A very needed get-away from the hubbub around the office. As a typical dork, I went ahead and threw RubyConf’s schedule in “iCal and exported it” in case anyone else needs it.

If you’re planning on attending RubyConf send me an email, and perhaps we can chat over a beer.

Cloning Debian Parallels VMs

We’re in the process of migrating our servers onto a new infrastructure. Namely beefy servers running Virtuozzo. I’ve been a fan of Parallels for a while, and recently fired up a Debian VM, playing with grsecurity. Since this involved recompiling the kernel, and I’m not the most savvy admin, I pragmatically cloned the VM so I could backup in case crap happened.

Well, crap happened, and I rendered the install unbootable. No biggy, next time I won’t delete the linux kernel from /boot. As soon as I fired up the clone though, I noticed I couldn’t connect to my host machine nor the internet. After about 30 min of me trying to figure out what was wrong, and IM’d Dustin, our server admin.

After another 30 min of investigating, we found the solution. Apparently upon cloning a VM, Parallels changes the network interface.

  • First Install – eth0
  • First Clone – eth1
  • Clone I was working on – eth2

A quick solution:

Run ifconfig -a to find out what interface your VM is on

Update /etc/network/interfaces and change eth0 with the correct interface.

Reboot the VM: shutdown -h now then use Parallels to reset the VM.

Everything should work dandy after that. Bear in mind, I’m still running Parallels 2, so this may have changed in Parallels 3.

The Daily Commute

On average, I drive 150 miles roundtrip each day for work. Obviously there a helluva lot of negatives with that commute. However this was a great “opportunity” to turn a negative into a positive. (Yes, I’m using quotes because it wasn’t easy).

Negatives

  • Gas consumption.
  • Wear and tear on the car.
  • Having to get up earlier to compensate for travel time
  • 1 – 1.5 hour drive each way

Initially, I really hated the drive. After a few months I’ve grown accustomed to, but I’ve been able to tweak some of the negatives into positives

Positives

  • -Gas consumption-
    • I drive a Saturn, which gets me between 32 – 37 MPG. Still costs around $260 a month in gas though. ** Janson and I carpool, which saves a bit of gas
  • -Wear and tear on the car- This is still a bit of a sticky point.
    • Switching vehicles with a carpooler will in addition to the above, not stress a single vehicle. It also has a benefit of not having to pass around money.
  • -Having to get up earlier to compensate for travel time-
    • This was probably the hardest for me as I’m generally a night owl. And Janson can attest, I still need work in this area. I can only deceive myself in that if we ever move closer, I have a habit of waking earlier and being more productive
  • -1 – 1.5 hour drive each way-
    • This was probably the biggest win. I enjoy listening to the “Freebeer and Hotwings Show” in the mornings, but aside from that it’s really nice to be able to turn off the radio, and just think. This will help you organize your day to come, or chew on some things in the evening.
    • With a coworker carpooler, you can talk about hurdles or lessons learned.

How playing with a Rubik’s Cube has made me a better developer

My brother in law bought a Rubik’s Cube at a yardsale for a quarter. He was playing around with it when he and his wife stopped by our house. I’ve never personally owned a cube, but I had seen them around (more so when I was younger).

From here on out, I’m going to refer to the Rubik’s Cube as a cube, and each of the individual cubes on the cube as a cubie.

However while he was playing with it, I became a bit intrigued, and even tried turning a few. I sucked at it. He left it at my house and I dinked around with it. After a while, I the cheated, googling for a solution.

In case you haven’t heard of different strategies to solve a cube, one strategy suggests solving one side (the top), and then solving the next two layers. You then flip it around, and do some rotating hackery to finish the puzzle.

I solved it once using that resource, but I was far from being able to do it on my own. I gave it back to him, (after reseting the cube of course), and forgot about it for a couple weeks.

We saw each other again, and he passed the cube back to me. Instead of immediately cracking open the laptop, I tried to finish the first half on my own. And even though I knew where cubies were supposed to go, it was still hard as hell. I would find a cubie, and keep wanting to pick it up (outside of the cube) and replace it with the cubie that was taking its spot. A lot of cursing ensued.

After 30 minutes working on the same cubie, I accidently moved it to the correct position. I deciphered how I did it, and then an “Aha” moment hit. I was looking at the puzzle in the wrong way. A quote from The Matrix popped in my head.

*Spoon Kid – _”Do not try to bend the spoon. That’s impossible. Instead… only try to realize the truth.”_ *Neo – _”What truth?”_ *Spoon Kid – _”There is no spoon.”_ *Neo – _”There is no spoon?”_ *Spoon Kid – _”Then you’ll see, that it’s not the spoon that bends, it is only yourself.”_

A bit enigmatic for a toy, true. But it nailed the idea. I was trying to force the cubie into the spot, and instead of forcing it, I needed to look at the puzzle differently to see how the cube itself can shift to accommodate the cubie. Which generally meant rotating a side that I wouldn’t have thought about before. After that, first half of the puzzle fit together easily.

The next day, I thought more about the cube. Most of my frustrations with programming and/or customer requests have similarities. I try to force a different way of thinking or designing code into a tool that doesn’t easily accommodate it, or think what the customer is really asking for it too complicated / costly to implement. By stepping back and either turning the problem “on its head”, forgetting the “mental baggage” I was bringing from a different language / paradigm, or suggesting an alternate solution that will take the customer 80-90% of the way, I become much more effective.

Now I only mentioned solving the first half of the puzzle. A much easier approach to independently solve the second half was to memorize the algorithms, and that wasn’t exactly a walk in the park for me. But it stretched my memory muscles, which if you know me you’ll already know I’m pretty weak in that department, and it provided the satisfaction of being able to complete the puzzle. The next step would be to analyze each of the algorithms and actually understand how they really work.

Playing with a Rubik’s Cube, is a great way to experience looking at a problem in a different light in order to solve it.