Archive for October, 2007

ZIP Code Nerdiness

Tuesday, October 2nd, 2007

I’ve been playing around with some web services, trying to gather ZIP code data, but quickly realized that it would take forever to gather up all of the US ZIP codes—there are just under 80,000 of them. So I bit the bullet and bought a ZIP code database.

With that, I created a simple ZIP code look-up tool, which displays the city, state, latitude, longitude, etc. for any given ZIP code.

I got even more nerdy, and added a distance calculator tool that gives you distance between two ZIP codes. It’s using the haversine formula, which gives the great-circle distances between two latitude/longitude point.

Here’s are the PHP functions that I use to do the calculation:

function haversine($lat1, $long1, $lat2, $long2, $earth){
  //Point 1 cords
  $lat1 = deg2rad($lat1);
  $long1= deg2rad($long1);
  //Point 2 cords
  $lat2 = deg2rad($lat2);
  $long2= deg2rad($long2);
  //Haversine Formula
  $dlong=$long2-$long1;
  $dlat=$lat2-$lat1;
  $sinlat=sin($dlat/2);
  $sinlong=sin($dlong/2);
  $a=($sinlat*$sinlat)+cos($lat1)*cos($lat2)*($sinlong*$sinlong);
  $c=2*asin(min(1,sqrt($a)));
  $d=round($earth*$c);
  return $d;
}
function getMiles($lat1, $long1, $lat2, $long2){
  return haversine($lat1, $long1, $lat2, $long2, 3960);
}
function getKilometers($lat1, $long1, $lat2, $long2){
  return haversine($lat1, $long1, $lat2, $long2, 6371);
}

Balsamic reduction

Tuesday, October 2nd, 2007

I discovered how to make this a few years ago. It’s ridiculously simple, yet it tastes dam good on everything, and it will make you look like a pro when you are entertaining. Leila is not even 3, but she asks for it (”I want some black dip please”) when she’s eating potatoes, broccoli, carrots, rack of lamb…

All you need is a large bottle of average to decent balsamic vinegar (at least 12 oz or you’ll end up with less than 3 oz of finished product).

Empty your bottle of balsamic vinegar into a heavy bottom saucepan, and put the saucepan on super low heat. The liquid should not even come to a simmer. All you’ll see is a fine mist swaying over the liquid. The fumes do pack a punch, so might want to make this when you’ll be home alone all day.
Once the vinegar has reduced down to just a quarter of its original volume, take it off the heat and let it cool enough that it won’t burn you.

Pour the reduced vinegar into a plastic squeeze bottle, and you’re done. Put the squeeze bottle in the fridge and pull it out went you want to squirt some on a plate. A little goes a long way. It will keep for months.

Madani’s Banana Bread

Monday, October 1st, 2007

Ingredients:

  • 3 or 4 black bananas (super ripe and peeled)
  • 2 eggs
  • ½ cup butter, melted (plus a couple of Tbs to coat bread pan)
  • 1 ¾ cups all purpose flour
  • 1 cup sugar (plus some extra for the bread pan and for dusting)
  • ¼ dark rum
  • ¼ molasses
  • 1 tsp vanilla extract
  • 1 tsp baking soda
  • ½ tsp baking powder
  • ½ cup chopped walnuts or chopped, pitted dates (optional)

Equipment:

  • one large mixing bowl big enough to contain all the ingredients;
  • one medium bowl for the dry ingredients;
  • one glass (oven safe) or metal bread pan (size of an average loaf);
  • a pastry brush (or your clean fingers).

Preheat your over to 375°F.

Prepare the bread pan by coating it with melted butter with the pastry brush (or your clean fingers), then by coating the butter in the pan with a dusting of sugar. This will help when you are going to want to remove the bread from the pan.

Combine the bananas and the eggs in the large mixing bowl. Mix in the melted butter, until you have a consistency resembling that of oatmeal.

Slowly add the sugar to the bananas, butter and eggs while mixing.

Mix in the rum, vanilla and molasses. You don’t have to get rid of all the dark molasses streaks.

In the medium bowl, combine the flour, baking soda and baking powder. Sift the flour mixture into another medium bowl if it appears lumpy.

Slowly add the flour to the large bowl containing the wet ingredients, while mixing. All the flour should become absorbed.

Add the optional walnuts and/or dates, mix until roughly incorporated.

Pour the mixture into the prepared bread pan, leaving about ½ to 1 inch of room for the bread to rise.

(Optional) Dust the top of the bread mixture with some sugar. This will create a crunchy glaze when the bread is baked.

Bake in the preheated oven for 45 to 60 minutes. Test with a wooden skewer inserted into the middle of the bread pan after about 40 minutes. When the skewer comes out clean, the bread is done. Let it cool in the pan on a counter top. When it is cool enough to handle with your bare hands, remove it from the pan and enjoy.