Friday, October 31, 2008

Candy Corn's Dirty Secret

After years of mindless doodling in the margins of my notebooks during conference calls at work, I was hit by a bolt of inspiration last night and put those doodling skills (and my scanner and Photoshop) to work. I present to you a little comic for Halloween. Enjoy!

Thursday, October 23, 2008

Six Month House-iversary

Six months ago today I moved into my new home in the Fishtown section of Philadelphia. After ten years of watching my money go to landlords each month, last April I finally became a homeowner. Time has flown by and I don't think it has sunk in yet that this place is really mine. I suspect it won't totally sink in until I need to pay for my first major repair. I'll admit Fishtown wasn't my first choice. I would have loved a place in Center City or University City, but they were out of my price range. Fishtown was a good compromise - relatively safe and easy access to the rest of the city via the El. If anything, I wish I had found a place closer to an El station. Walking to the El adds an extra 10-15 minutes to my commute each way. On the other hand, there is a shopping center complete with supermarket, thrift store and a Radio Shack two blocks from my house which is very convenient. I haven't done much to the house yet, including decorating. The house was renovated a couple years ago and didn't need any work for me to move in. The biggest changes so far were adding a railing to the basement steps and installing a microwave over the stove. My dad is much more of a handyman than I am, so he's been a huge help. When I was looking at homes, I look at everything from fixer-uppers to newly remodeled homes. I'm glad I decided to go with something recently renovated. I don't see how I would have found the time and resources to do serious work on a house. There's still quite a few boxes from my apartment I have yet to unpack and my basement is full of stuff from my storage locked that I need to go through (and probably sell a lot of it). I wanted to have a yard sale at the end of summer, but that hasn't happened. Maybe next Spring? Some home projects I hope to tackle in the next few months:
  • Install a dishwasher
  • Install more shelving in the home office
  • Add exterior electrical outlets to the front and back of the house
  • Run a network cable from the home office down through the walls to the basement and up to the living room (for my Mac Mini media center / home server)
  • Put a pond in the backyard (that will have to wait till next Spring)
  • Try some basic X10 home automation
I do worry a little about burglars, so sometime I might try setting a webcam and some motion sensors that can send a message to my phone if something is amiss. I would have to call 911 myself, but its better than paying monthly security-system fees or dealing with false alarms. One downside to having moved in the Spring is that all the nice weather pulled me away from staying inside to work on things. I also spent time every evening tending my garden. Now that cold weather is here, I'll probably be staying indoors more and I can start getting more things done.

Tuesday, October 21, 2008

Don't Make Me Think (About Code)

I'm a stickler for clean, easy to read code. In fact, I'll take clean, incomplete code over working, unreadable code. It's alot easier to finish and maintain clean code than to clean up spaghetti code. One of the best compliments I've ever received in my career was from a coworker who told me that my code was a pleasure to read. While cleaning up some old Java code at work, I came across this line in a random number generator: seed += lastSeed++; I had do a double-take on that line. It's short but ugly and easily confusing. Does lastSeed increment before being added to seed or after? I even checked with a coworker and he wasn't totally sure the order of operations here. (Yes, lastSeed gets incremented *after* being added to seed. I even ran some test code to confirm it.) I'm pretty sure I had questions like these on my college C programming exams. I once read a book about web usability titled Don't Make Me Think by Steve Krug. The point of the book isn't that web sites should be dumbed down to be usable, but that their structure should flow naturally. A user shouldn't have to stop and decipher confusing or ambiguous links. Eg: Do I click "About Us" or "Support" to find a company's mailing address? Likewise, an important aspect of clean code is that it should be obvious how it works. It shouldn't rely on obscure language features or shortcuts. You shouldn't have to stop and ask yourself "Wait, what is this doing?" In the end, I made a simple change to the code: seed += lastSeed; lastSeed++; Yes, I added an extra line of code, but I removed any possible confusion about the order of operations. Sure, it's a simple example, but imagine if this code was being used for financial calculations. It would be way to easy to introduce a bug when it was being done all in one line. Cleaning up these things isn't just a matter of making things safer for junior level programmers (as the Java Ranch Style Guide reasons) - even the most experienced programmers make dumb mistakes. Straightforward code makes life easier for everyone.

Monday, October 20, 2008

Mac Mini Memory Upgrade

After the hard drive in my iMac died, I moved the Ubuntu Linux VMware image that runs my websites to the Mac Mini I have hooked up to my TV. Since it only had 1GB of RAM, I shut off some apps and extra services (both on OS X and inside the VM itself) to save on memory. It performed fine and I decided to let it host my websites permanently, rather than move it back to the iMac or to a dedicated PC I was building. The Mini is quieter, smaller and more power efficient than any PC I could put together. The Mini did need more RAM, so before I took my iMac out to be repaired, I removed its two 1GB sticks of RAM and put in two 512MB sticks I had leftover from previous upgrades. Last night I finally attempted to install the extra RAM into the Mini. I found some Mac Mini disassembly videos and photos online. After upgrading the RAM but before putting the case back on, I booted up the Mini. It booted fine and saw the full two gigs, so I shut it down, snapped the case back on and hooked it back up to the TV. I powered it on, watched it start to boot and walked over to the kitchen to start dinner, then I heard a second start-up chime. Umm, that's probably not good. The Mini finished booting up fine and I tried to pretend that reboot didn't happen. While dinner was in the oven, I fired up Front Row and started watching an HD TV show when the Mini suddenly rebooted again. There was no kernel panic, just a spontaneous reboot. Crap. I figured it was most likely a memory problem, but it could have also been an overheated CPU. I took it back upstairs and ran the hardware diagnostic CD. No problems found. Grrr. I pried open the Mini again. (Luckily the Mini was much easier to pry open the second time.) The RAM looked like it was seated in its slots just fine, but I took it out and put it back in again. Booted the Mini (without case) and tried playing the same video I tried before. It played fine. Started up two HD videos together and still no reboots. Excellent. As I started to put everything back together, the wire for the Airport antenna disconnected from the Airport card. Had to remove the carrier for the optical drive and hard drive again and plug it back in. I did a test boot of the Mini and it couldn't find my wireless network. Since I had run an ethernet cable down to the living room, I really didn't need Airport at the moment and considered leaving it as-is, but I didn't want to have to open this thing again later on if I did need wireless, so I removed the carrier again and disconnected then reconnected the antenna wire. This time Airport worked so I put the cover back on and hooked it back up in my living room. Powered it on and the fan started blasting at full volume. Arggh! I didn't think a little box could make that much noise. Took the Mini apart again and immediately noticed that another small cable had come disconnected from the motherboard. I reconnected it and did some tests without the case. Everything worked fine, so I put the case back on and tried another succesfull test before taking the Mini downstairs. The whole mess took about two hours, and the Mini has been working fine so far. Apps are performing better now with the extra gig of RAM. I will have to go buy two more gigs of RAM to put back in the iMac after the hard drive is replaced, but I will finally be able to use it for photo editing again. Upgrading the Mini wasn't as scarry as replacing the LCD screen on my MacBook, but definitely not something I would recommend the average computer user ever attempt.

Thursday, October 9, 2008

iMac Hard Drive Failure

Well, it finally happened. The hard drive in my iMac died last night. The iMac was acting slow and flakey, so I rebooted it. When it came back on, there was a strange clicking noise and I got the Missing System Folder image on the screen. I wouldn't be so worried about the drive (AppleCare should replace it free) if it weren't for the fact that I was hosting most of my websites on an Ubuntu Linux VMware image running on the iMac. The good news is that my system was backed up via Time Machine to an external firewire hard drive. The bad news is that, to stop my system from slowing to a crawl every time Time Machine ran, I stupidly excluded the VMware image from the regular backups. The most current VM image backup I have is from September 14th, nearly a month ago. Mostly that means a bunch of images are missing from my photolog and from my photo gallery. The original photos are safe on my MacBook so I can repost them. I can probably get recover the post titles and descriptions from Google's cache. I did have a bootable backup of my iMac on a second partition of my Time Machine external drive, so at the moment, the iMac is booted from the backup drive. I should make a backup of my backup drive soon in case it fails too. It feels like I'm flying with one engine at the moment. In the meantime, I'm running the VM image on the Mac Mini I have hooked up to my TV and use as a home media center. Since its usually idle most of the day, this should work fine, although its 1GB of RAM will be a little tight. I don't know how performance will be if I try to watch TV on it. I have no backups running on the Mini, so I need to dig up another external drive for that as well. I haven't found WiFi to be very reliable, so I ran an ethernet cable from my home office down the stairs to the Mini. It's ugly, but works for the moment. Eventually I want to run a cable from the office to the basement, where I could then run it to the Mini or anything else. I had previously purchased parts to build a cheap, plain Linux box that would then run the WM image of my websites but had problems with Ubuntu and the video card (Video card support has always been a problem with Linux for me). The box is noisy and probably eats a lot of power, so I might leave the sites on the Mini permanently once I upgrade the RAM. I've heard tales of failed drives coming back to life one last time by thumping them, or cooling them, or smearing them with goat blood. I'm hoping if I try restarting the iMac several times that I can get the drive to come up long enough to copy over the 8GB Linux VM image. So far no luck.

Tuesday, October 7, 2008

King of Prussia Lego Store Grand Opening

Last Saturday I went to the Grand Opening of the new Lego Store in the King of Prussia Mall, although the store itself had already opened last month. I didn't expect it to be as busy as an Apple Store Grand Opening, so I got there about a half-hour after opening. Oops. The line already stretched down part of the mall and around a corner. I think I was the only lone adult I saw in line (everyone else around me were families). Luckily I had my iPhone with me and the 90 minute wait went by quickly. The store was giving away free commemorative Lego Liberty Bell sets to the first 300 customers who spent over $35. At first I was afraid they had ran out, but they had plenty left by the time I got into the store. I filled up two cups with bricks (I saved 50 cents by reusing cups I had previously filled at another Lego store) and picked up the Cement Mixer set.
Lego Store
Afterwards I headed over to a section of tables where you could help build pieces of a giant Lego Yoda. I assembled a small brick, got a $5 coupon and a certificate signed by Master Builder Dan. I talked briefly with some volunteers who were members of local PA Lego clubs. I'll have to check them out.

Giant Lego Yoda Master Builder Dan

The coupon expires at the end of the month, so I'll probably be make another trip in the next week or two. Hopefully the giant Yoda will still be there. More photos from Grand Opening are up on my photo gallery.

Friday, September 19, 2008

Willowbrook Mall Apple Store Opening

Last weekend I took the train out to north NJ to visit my brother. We went to the opening of the new Apple Store in the Willowbrook Mall in Wayne, NJ (not to be confused with the Apple Store in the Willowbrook Mall in Texas). We got there about an hour before opening. The line wasn't too bad, but I couldn't see how far it went.
Apple Store Line

I took video of the actual opening complete with loud, cheering Apple employees. Maybe I'll get around to cleaning up the video and posting it online soon.
Inside Apple Store
I didn't actually buy anything at the store, but I got my free T-shirt, which brings the size of my Apple Store T-Shirt collection up to, well, two. More photos from the opening are up on my photo gallery. My previous Apple Store opening was Ardmore, PA.

Tuesday, September 2, 2008

Thrift Store Roomba

I found an original model Roomba robotic vacuum cleaner at a local thrift store for $6. It was full of dust and hair and missing the AC adapter, but I figured for $6, it was worth a shot. I noticed that the Roomba has a weird power connector consisting of two inputs. iRobot has their Roomba manuals available as free PDF downloads and the manual shows the special adapter that originally came with the Roomba. They sell replacement AC adapters but they don't come with the double-barrel adapter. I posted to the official Roomba forum, and the best suggestion I got is to look for someone selling one with a broken Roomba on eBay. Given that I don't know if this Roomba even works, I'm not sure if I want to spend much money for a replacement AC adapter. Since I do have some basic electronics and soldering skills, perhaps I can build an adapter myself? Even if I do get the Roomba working, the programming options unfortunately aren't available for original Roomba models. That's no big deal. With the way that cat hair and dust form little tumbleweeds on my (fake) hard woods floors, an automated vacuum would be great. At worst, I can always sell the Roomba on eBay for spare parts.

Wednesday, August 27, 2008

Art of the Brick

Art of the Brick Exhibit Last Sunday I went with my friend Nicole to see Nathan Sawayan's "Art of the Brick" exhibit at the American Swedish Historical Museum (not to be confused with the Ikea) here in Philadelphia. Although I'm more interested in building cityscapes with Lego, Nathan's work is really amazing. I took along my compact camera t take photos, but now I wish I had taken my DSLR instead. I put the photos up on Flickr. After checking out the exhibit and the rest of the museum, Nicole and I headed over to the kids section where they had buckets and buckets of bricks to play with. At first, I wanted to just try building a sphere, but I couldn't get the geometry right and it started to look more like a pyramid. After finding some interesting brown and green pieces, I started building a pair of trees while Nicole made a (peeing) dog, a stream and bridge. I added a waterfall and lamppost to finish off the park and put it on a shelf with other visitors' creations.
Lego Park
I might go back in a few weeks with a camera and tripod to take better photos of the exhibit. I'm curious to see if my park will still be there. (Note: This post is my first test at using MarsEdit.)

Friday, August 15, 2008

Hello World

Hi, I'm Rob, a web developer and software architect living in Philadelphia, PA.

Back in early 2000 I had started a weblog that I authored for a few years. Like many weblogs, it was a mix of personal experiences, links, commentary, political rants, photography, etc. I eventually neglected it and the site disappeared when the free hosting service went away. I started a dedicated photolog a couple years back and have been doing a decent job keeping it updated.

Lately I've found myself wanting to write about technology, programming and projects I've been working on (or planning to work on) so I'm giving regular blogging (God, I hate that word!) another shot. I'm going to avoid writing about personal stuff, which gets weird when you find out family and coworkers are reading it. I'm also going to try to avoid politics, since there's a million political blogs out there already, and, frankly, current American politics just makes me want to emit a steady stream of expletives anyways. I was originally planning to make this only about projects I'm working on, but I could use an outlet for my thoughts on computers and technology as well.