2009-11-07

Handling Perl DBI errors

Just something I've been working on recently. Previously I would check the result of every DBI statement with RaiseError set and an eval around each statement:



The evals added a lot of repetitive code. DBI database handles have an attribute called HandleError that allows a subroutine to be run when an error is encountered. The code is much cleaner with rollback and confess in the HandleError subroutine.



Also if something different needs to be done with errors for a specific statement the HandleError subroutine can be disabled temporarily by saving it to a temporary variable, setting HandleError to undef, then setting HandleError back to the temporary variable later.

2009-07-27

Google Calendar SMS Notifications and Sprint

I use Google Calendar a lot and since I don't have a smartphone (yet) that can sync with GCal, the only way I can get event notifications is through SMS messages.

Recently GCal SMS notifications to my Sprint phone have become unreliable to the point where I wouldn't get any notifications at all. A quick fix is to change the GCal notifications to send an email, then create a filter for those emails that forwards the message to your phone's email adddress.

Unfortunately there is a long url to scroll through at the beginning of the message, and your name is also at the beginning of the message so the amount of info that gets through is dependent on how long your name is.

For Sprint users, your cell phone's email address is YOUR_NUMBER@messaging.sprintpcs.com

2009-06-05

Comments in PostgreSQL Databases

I'm trying to follow the philosophy of "Comments are good!" While working on my own personal database in postgres, I thought that I should add the notes I made while designing the database. With a quick google I found the COMMENT command. This allows you to add comments to the database, they are even dumped and restored with the schema. Learn something new every day.

2009-05-29

Quest for a netbook pack

Recently I've been looking for a small single strap backpack for my netbook. The search turned out to be rather difficult since I was only able to find suitable packs online and retail locations did not carry the models that I wanted. If I wanted a local store to special order a pack for me I would have had to pre-pay for it. I didn't want to be stuck with a pack that was too large or worse too small.

My requirements for the pack are:

  • Large enough to carry my MSI Wind 10" netbook and it's power adapter

  • Not much larger than the netbook and power adapter

  • Single/Mono Strap backpack style, not a messenger bag style

  • Not a Murse


I created a list of possible bags that fit the first 3 requirements. Since I have no sense of style/fashion the last requirement was not as obvious to me so I recruited my girlfriend to help me with choosing a bag that looked good but wasn't a murse.

Ironically the pack I ended up getting is from the Women's backpack section of REI. "REI The Mini Sling Bag - Women's" fit all of the requirements. My local REI had it in stock so I was able to look at it and make sure the netbook fit before buying it. Also the bag can be worn over either shoulder.





Other bags that I thought about buying:

Osprey Tilt - REI has the Osprey Veer which has the same volume as the Tilt. I tested my netbook out in the Veer and it was a snug fit. Also from the pictures the Tilt looks like the strap is fixed to one side and can't be switched to the other shoulder

Maxpedition Lunada Gearslinger - The dimensions listed suggest that my netbook would fit and there is a comment that someone uses this bag for their netbook. The bag is on the expensive side but you definitely get what you pay for judging by the features/materials listed.

Timberland Single Strap Mini Backpack - this is only sold in pink/grey and they have no current plans to bring back the black/grey option they used to have.

2009-05-11

Getting a new (or used) washer and dryer?

If you plan on getting a new washer make sure you get the shipping bolts from the delivery people, or if you are getting a used one see if the previous owner has kept the shipping bolts. You'll need them if you ever going to move the washer. The shipping bolts for our Samsung WF218ANW look like this

Also if the delivery/install people are stacking the washer and dryer for you get the dryer feet and locking screws as well. Our Samsung DV218AGW dryer feet and locking screws look like this:

2009-03-30

Battery recycling on Maui

Living in Seattle spoiled me with all the options for recycling. Recycling at the University of Washington was especially easy, for example they have bins for electronics recycling all over campus. Now that I'm on Maui I wanted to be responsible and recycle a portable phone battery that no longer worked, but I could not find anything convenient. A quick email to the Maui County Recycling office and they pointed me in the right direction. Long's Drugs will take household batteries (rechargeable or non-rechargeable) at the camera/photo counter. Home Depot will also take other types of batteries such as those for power tools. I'm posting this here so that hopefully next time someone googles for "maui battery recycling" they will find this and a quick answer to where they can recycle their batteries.

PreferenceKey Quirks

PreferenceKey has a few quirks that have tripped me up. One is the reduce(value:nextValue:) implementation. The other is that a PreferenceKe...