Monthly Archives: November 2008

Adventures with Forks, Boxes, and Ibexes

As I’ve posted before, I’ve been trying to help my pastor with a church management system written in Rails, but I’ve been hitting some roadblocks.  First, I tried developing on my Mac Mini, since Macs are what all the cool kids use to develop for Rails.  Well, that Mini ended up being a media machine, and developing using a television as a monitor was not very pleasant. It’s not an HDTV, and so only capable of 800×600, but even at that resolution, the screen is practically unreadable. 

The most convenient thing for me to do would be to develop on my laptop, since I can take it with me and work with Lowell (my pastor) up at the church on the system when I have problems.  So, I started trying to get the app set up on my Windows machine.  This actually worked fine for a while, but then Lowell ended up adding a couple of gems called “starling” and “workling” that basically create a task queue that you can farm out long-running tasks to.  It works great on Lowell’s Mac and in the production environment.  However, I soon discovered that starling uses “fork()” to achieve its ends, which meant a no-go for me on my Windows machine.

Since I can’t exactly install OSX on my laptop, the only option left was Linux.  As I’ve written about before, at one point I had Ubuntu installed on a partition on my laptop, so I’d been down that road before.  However, I had actually recently removed the Linux install, since I really wasn’t doing anything with it, so I had to go through the install process again (which is actually not all that bad on Ubuntu, for what it’s worth).  I installed Ubuntu version 8.10 (Intrepid Ibex) on a 15 Gb partition and began the environment setup process.

The very next day at work, a coworker happened to mention a virtualization tool he was using called VirtualBox.  I can’t believe I hadn’t heard about this thing before.  I knew about Virtual PC, which Microsoft now gives away for free, but that obviously only allows Windows guest OSes.  VMWare does have a free VM “player” that supports different kinds of guests that they give away, but as far as I know the tools you have to use to create a VM cost money. VirtualBox, developed by Sun, is completely free and allows for a whole slew of both host and guest OSes.  Anywho, I gave it a try, and I was very impressed.  It’s quite performant, and has support for just about everything I think I’d want (networking, USB devices, etc).  Another nice feature is that the virtual disk file can be set up to grow dynamically so that the VM is only taking up the space it needs; no more, no less.

It then became obvious that the 15 Gb partition I was using for my Ubuntu install was kind of a waste of space.  So I started the process of removing the partition I had added just days before.  I want to record what I did to achieve this, mostly as a record for myself in case I need to do it again later.  I used a free tool called GParted, which comes as a bootable CD image, to delete the partition Ubuntu was installed on and resize the main partition to take up the newly freed space.  After that comes the part that I usually forget, which is fix the master boot record.  When you install Ubuntu, you get this thing called GRUB, which is a boot loader that will let you choose which OS to boot up when you turn on your machine.  When you delete the partition with Linux on it, GRUB freaks out and won’t load up an OS.  To fix this, you need your Windows install CD.  Boot from the CD, then (depending on your version of Windows) either start a Recovery Console (XP), or choose “Repair Computer” and then open a console (Vista).  On XP, type “fixmbr” (no quotes), and on Vista, type “bootrec /FixMbr” (again, no quotes).  This will repair your master boot record, and you should be all set after a restart.

Since I’ve been having all this fun the past couple of evenings, I have not gotten as much sleep as I need.  I’m greatly looking forward to the two holidays off work I’ve got coming, as I’m sure you all are.  I hope everyone has a happy Thanksgiving!

November SDNUG Meeting and My First Presentation

The whole meeting this past Monday was kind of an interesting experience for a couple of reasons.  First of all, the pizza never showed up.  I confirmed with the sponsor earlier in the day, but once we had been waiting in the room for about 20 minutes, it was clear there wasn’t going to be any food that night.  It was an honest mistake on the sponsor’s part, but I think I’m going to do things a bit differently from now on.  If I (or another group leader) pay for the pizza, we can be sure it’s going to be there, and I can just work out reimbursement with the sponsor later on.  That way, if there are issues, I’m the only one who has to deal with them, and the group gets to eat.

Also, it was my first time to present at a User Group meeting.  My talk was titled “Debugging Evolved:  An Introduction to Automated Unit Testing”.  I used Roy Osherove’s forthcoming book on the subject, “The Art of Unit Testing”, as an inspiration for the topics I covered, and I highly recommend it.  It’s not due to be published until March ’09, but the unedited draft is available in PDF format through Manning’s MEAP program.  I learned several things based on the experience, plus the feedback I got from the group members.  For one thing, Comp Sci students and user group members are two very different audiences.  This may sound obvious, but it was important in my case. 

I was scheduled to go on a recruiting trip to Harding, my alma mater, around the same time as the November meeting, so I figured I’d kill two birds with one stone.  I wished we had covered automated unit testing in school, so I wanted to give the students there some exposure.  Also, I wanted to be able to bring in some speakers to the Shreveport DNUG to speak on TDD and related practices, but I wanted to make sure that the members had had some exposure to testing frameworks so they wouldn’t get caught up on tools during a presentation on what is really a design topic (TDD, BDD, etc).  I wanted to avoid the scenario of the first Fort Smith DNUG meeting, where we had a great topic and speaker (Raymond Lewallen on BDD), but a lot of people there had never seen a testing framework before, and I think they may have had a hard time following the presentation. 

In the process of creating my talk, however, I had to try to balance the content for students (some of whom had never seen a managed language before, let alone a testing framework in .NET) and the experienced developers at the Shreveport .NET User Group.  In the end, I think it might have been a better idea to do two different presentations, or at least have a much more fleshed out version for SDNUG.  I think a lot of the stuff I was talking about went over the students’ heads, but I got the impression the SDNUG members (understandably) wanted a bit deeper dive into more practical scenarios and potential business value of unit testing. 

I also learned that I need to work on my presentation skills.  I pretty much expected that, though, given that I haven’t given a public presentation since college.  One of the feedback forms I got suggested that I start attending the local Toastmasters group (which is actually held in the same building where I work).  I’ve been to one meeting, but the heavy emphasis on procedure kind of turned me off.  I realize that it’s there to help you learn how to behave appropriately on occasions where such procedure is the standard, but it just seemed a little silly to have someone introduce the person who was going to be introducing everyone else when there were about six or seven people in the room.  I will admit, though, it’s probably a good idea if I’m going to be presenting with any frequency in the future.

Though it was far from the optimal situation, I hope that both the user group members and the Harding students

enjoyed the exposure to unit testing, and that it will pay off when SDNUG brings in some speakers on some more advanced topics.