Posts

Showing posts from 2009

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.

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

"Hey, that was our logo!"

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.

Quest for a netbook pack

Image
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 …

Getting a new (or used) washer and dryer?

Image
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:

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.