Archive for July, 2009
Don’t ever…
July 14, 2009 8:58 ammake me type a city and state in a form.

An address form from LinkedIn
If you’re in the US (and I suppose this is true for any country with a robust postal code system) there is a unique mapping of postal code to city.
Writing a web service to turn the postal code into the city and state would be a triviality. I wrote one a few weeks ago just as a test.
There are free and pay lists of zip code -> city mappings which can be loaded in to a DB one one command, and the getting the data is a few lines of PHP. (yeah, I know this isn’t production code, its just a basic example)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <?php $con = mysql_connect("xxx","xxx","xxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("zipcodes", $con); $zipcode = $_GET["zipcode"]; $result = mysql_query("SELECT city, state FROM codes where code='" . $zipcode . "'"); header("Content-type: text/xml"); $xml_output = "<?xml version=\"1.0\"?>\n"; while($row = mysql_fetch_array($result)){ $xml_output .= "\t<citystate>\n"; $xml_output .= "\t\t<city>" . $row['city'] . "</city>\n"; $xml_output .= "\t\t<state>" . $row['state'] . "</state>\n"; $xml_output .= "\t</citystate>\n"; } echo $xml_output; mysql_close($con); ?> |
Categories: Uncategorized
6 Comments »
What I’ve been up to recently
July 7, 2009 7:55 amI’ve put up some unintentionally cryptic tweets / facbook status updates, so I figured I’d update everyone on what I’m up to at the moment.
Between leaving IBM and now a whole lot has gone on. I’ve interviewed with about 10 companies and haven’t found the right fit yet. Because I’ve had relatively low expenses and a decent emergency fund / severance I’ve been taking my time to find something that I’m really passionate about.
Recently I decided that I wanted to give myself a kick to get out of North Carolina, so I made it happen. I put my place up on Craigslist and had quite a bit of interest, but nothing materialized right away. Then I got a note from a couple who were interested if another deal they had fell through. This is where things started to get kinetic.
They decided they wanted the place on Monday 29 June, and wanted to move in on Thursday 2 July. Back to Craigslist I turned and sold off most of my stuff. From Monday to Wednesday I got rid of most of the things in my house worth selling through Craigslist. The rest went to Goodwill (3 full carloads worth). Those of you who know me well will know how freeing a feeling it was to get rid of all that extra stuff.
I was so lucky to have my friend Jessica visiting to help out. She was a dynamo helping to get things packed up.
On Thursday the tenants showed up at noon. Between noon and 4pm Jessica and I packed the car, got the leases signed, did some last minute fix-ups on the house, took showers at the neighbors and drove up to Long Island.
I was also lucky to find time during this whirlwind to say goodbye to some of my good friends in NC. The whole move was much faster than I had hoped it would be, but I’m also not completely divorced from the area, so I’ll surely be back for visits. Some of you might ask what happened to the cats? They are hanging out with my excellent neighbor Christine, who will watch them while I’m sorting out my next move.
A few hours of playing with her kids later I turned up at my uncle’s in Oceanside, dropped off my stuff, drove upstate to see my aunt for her annual 4th of July party and then back down.
So now I’m here in Long Island. I’m hanging out just a 40 minute train ride to NYC so I can interview with companies there. I’m still considering options in California, but I figured that while I’m sorting out what’s next it’s best to be close to friends and family here in NY.
While I’m here I’ll be interviewing, spending time with friends and family, and hanging out on the beach and boardwalk at Long Beach. I forgot how lovely a place it is. If you’re in town and want to hang out, let me know!
Categories: Uncategorized
6 Comments »

