Wednesday, December 31, 2008

Prep time

What would news years be without Hot Dog surprise? Here it is, coming together.

Happy New Year All - Shira and I wish you the very best!

-Ben (from Shira's cell phone)

Caption Me

I'll get us started:

"Yet another example of the apartment rental paper trying to take out
their competition. Bastards."

--Ben

Finding A Voice

NPR's Ketzel Lavine is out of a job. She has essentially lost her voice which allowed her to interact and influence millions of people.

But, thanks to the power of blogging, she has her voice back.

That's the thing that continues to amaze me about blogging. Not to many years ago, only the very few had the privilege to share their ideas with the masses. Now, anyone with an Internet connection and some moxie can do this.

Amazing.

Ms. Levine, I wish you lots of luck in your next adventure - don't forget to enjoy the ride!

Tuesday, December 30, 2008

More Windows Debugging Tips From Dell

Every time I call Dell I seem to learn something new about debugging Windows. Here's what I learned tonight:

You can analyze Blue Screen Of Death Dumps to figure out what caused the crash.. What you need to download is Microsoft Debugger. Once installed, you can run it and choose to load a crash dump (Control + D). You'll want to load a dump file from:

  c:\Windows\Minidump\

They'll be all sorts of gibberish on the screen, with the final line saying where the BSOD happened.

I'm not sure how much mileage I'll get out of this tool. However, I really like knowing that I can actually do something when a Blue Screen Of Death actually happens (other than cuss out Microsoft, of course).

You can run hardware diagnostics on your Dell Laptop easily. Just hold down the Fn and hit the power button. This should take you into a diagnostics mode and start running tests. Eventually, you'll get a mode where you can choose custom tests.

This might be useful for dealing with Dell hardware that's unknown or out of warranty. How cool would it be to know that the laptop is dead because of bad memory, instead of just needing an install of Windows?

I'm still pleased with the support Dell provided. I wish they had a magic wand they could wave over my laptop to stop it from crashing. And I also wish the solution wasn't just "Sir, you're going to have to reinstall windows." But alas, that's life in the Windows world, no?

Perhaps this is the perfect excuse to install Linux and see how long I last before I have to give in and install Windows? Hmmm...if I could only live without the latest Microsoft Office formats...that could just work...

The Gaza War - Online

There's no doubt about, this latest conflict (war?) in Gaza is definitely playing out online. There are quite a few creative and impressive resources online - here's just a handful I've more or less stumbled upon:

  • ElectronicIntifada.net - "The Electronic Intifada (EI), found at electronicIntifada.net, publishes news, commentary, analysis, and reference materials about the Israeli-Palestinian Conflict from a Palestinian perspective." Depending on your perspective, this is either a news site or a propaganda site. It's definitely polished.
  • Twitter: @QassamCount - a live feed of rocket strikes from Hamas into Israel. Just about an hour ago, a town near where I spent a few months living, was hit.
  • Photos from The Guardian - War is truly hell.
  • Twitter: @israelconsulate - this is a twitter stream that's answering questions from folks on Twitter about Israel's actions. I think it's very well done, and is nothing short of remarkable considering the questions have to be answered in under 140 characters. This one is worth checking out.
  • Twitter: @AJGaza - Al Jazeera's news feed about Gaza. It definitely has a news feel to it, as facts about both Hamas and Israel are being shared.
  • YouTube video of Humanitarian aid - The video isn't particularly high quality, but that certainly gives it authenticity. I'm sure there's plenty more video on both sides showing the conflict. The war even continues into the comments, as people respond to how impressed or not, they are to video.
  • Live Twitter Chatter - See what people are talking about with respect to Gaza. This always makes for interesting reading.
  • Online Petition - Here's an online petition asking for Israel to not stop their war. Like most of the above content, it's compelling stuff.

Oy, what a mess this is. And thanks to the Internet, you can follow along like never before.

Monday, December 29, 2008

Dave Barry on '08

Here's Dave Barry's 2008 Year in Review. It's funny stuff. Like say, how McCain chose Palin:

Meanwhile John McCain, at a strategy session at a golf resort, tells his top aides to prepare a list of potential running mates, stressing that he wants somebody ''who is completely, brutally honest.'' Unfortunately, because of noise from a lawn mower, the aides think McCain said he wants somebody ''who has competed in a beauty contest.'' This will lead to trouble down the road.

Or how Obama handled his nomination:

Barack Obama, continuing to shake up the establishment, selects as his running mate Joe Biden, a tireless fighter for change since he was first elected to the U.S. Senate in 1849. The Democratic Party gathers in Denver to formally nominate Obama, who descends from his Fortress of Solitude to mesmerize the adoring crowd with an acceptance speech objectively described by The New York Times as ``comparable to the Gettysburg Address, only way better.''

Really, it's funny stuff. Except for the 700 billion dollar bailout. That part isn't so much funny as scary.

A Strategy Just Crazy Enough To Work - The A11 Offense

Yesterday, I had a driveway moment as I listened to Weekend America talk about high school football. I'm not much of a football fan, but this story really caught my attention:

The Piedmont High Football team in California was getting a regular wallop in its division from larger schools and competitors - until its coaches brainstormed a new and brilliant offensive strategy. Taking advantage of some loopholes in high school ball rules, they devised a crazy new offense called the A-11 that takes advantage of the "scrimmage kick" formation.

Here's how it looks:

From high above in the bleachers, the basic A-11 formation looks something like this: Three receivers are out wide to the right, three receivers are wide to the left. There's a center with two players on either side. Two quarterbacks are in the shotgun formation, seven yards behind the center, who snaps the ball. So there are players spread out the entire width of the field, eliminating the tight offensive line formation often used in football.

Like I said, I don't know much about football - but even I know that having two players poised to be quarterback is unusual.

The overall strategy is simple:

We are going to make the defense think about what's happening. It doesn't matter to us whether they think a trick play is coming because it is - on every play something different is going to be coming at you. We want to make one of those great plays that wins the football game on every play.

And here's the thing - the strategy works. Sure, the team doesn't always win - but it's leveled the playing field in a serious way, so that even on nights the team loses, they are competing.

To me, this seems like a wonderful case study for businesses to examine. Rather than lamenting about how Wal-Mart or Amazon is bigger and stronger, why not look closely at the rules and see where you can play smarter. Why not "make one of those great plays that wins the football game on every play?"

Listen to the story here:

Sunday, December 28, 2008

Happy #8

Happy 8th, and final night of Chanukah!

Here's to a bright and successful season for all!

--Ben

Saturday, December 27, 2008

Supermarket Observations

Don't tell me I don't know how to live it up on a Saturday night! The
wife and I hit Giant for some quality shopping time. Strangely, the
place was empty. What, people have better things to do on a Saturday
night than grocery shop?

Here are some observations...

Observation #1: Michael Phelps on the cover of Frosted Flakes. Really? I
mean, I get the cover of Wheaties, but Frosted Flakes? How do they make
you an athlete? The second ingredient is sugar, and the fourth is high
fructose corn syrup.

Though, Kellogs does get credit - I found the ingredients on their
website in 1 Google Search. At least they don't hide the facts.

Observation #2: Wye River Crabbers - Baked Cheddar Cheese Crackers are
Kosher. Finally, Jews can enjoy the taste of crab (with cheddar cheese
no less!) and not viloate the bible while doing so. (As, crab is most
certainly not Kosher)

I love modern food technology!

--Ben

Recipe: David's Quick and Easy Cholent

David spent some time last Friday night taking me through the recipe he uses for making cholent. Cholent, for the uninitiated, is a stew like meal you can start on Friday night and eat on Saturday for lunch. This allows you to have a hot meal on Shabbat without actually doing any cooking.

If memory serves me, here's how David makes his very tasty cholent. This recipe will serve a small group - say 4 - 6 people.

  • Cover the bottom of the crock pot in a thing layer of dry barley
  • Add in a can of Great Northern Beans
  • Dice up some veggies into large chunks, such as potatoes, onions and carrots. Add to the crock pot.
  • Season with salt, pepper, ketchup and pretty much anything else you have lying around. David says it's not easy to over-season cholent - I'm sure I can rise to this challenge
  • Optional: drop in some raw chicken, beef or sausage
  • Add some sort of liquid. Be creative here - beer, OJ, etc. works great. The exact amount to add is tricky. It should cover the beans, but leave a good portion of the cholent uncovered. You can remove water by taking the water that's condensed on the cover and shaking it out over the sink.
  • Cook on low from Friday night till Saturday lunch

Enjoy!

If you follow the above, and it's a disaster - that's my fault. If it taste great, that's all Dave.

David: apologies if this was a family / secret recipe. Don't worry, not that many people read my blog, so it's really still a secret. Mostly. ;-)

Thursday, December 25, 2008

A New Satellite Office

The pier across from Caesars - it's got comfy chairs, a gorgeous view and free WiFi. I'm sold on this as a new satellite office.

Man, it's times like this that I truly love self/work-from-anywhere employment.

--Ben

Seeing The Light

Technically, it was actually seeing the lighthouse. The Absecon Lighthouse in Atlantic City, to be exact. It wasn't open (the nerve - what is today a holiday or something?), so we had to forgo the 228 steps to the top.

With that AC landmark visited, the next up is clearly Lucy, the Giant Elephant. She's a bit of a run than the lighthouse was. But, I'm sure she's worth it.

Wednesday, December 24, 2008

Jews And Their Gelt

So, it's night #4 with Hanukkah, and you may still be wondering what to get that Jewish friend of yours. Well, you've still got time. And I'm here to tell you - the traditional gift is...a money.

That's right, the standard item that's seemingly always been given to kids is coins or money, known in Yiddish as Gelt (the word for money). I don't recall ever hearing a good reason for this, and so this year, I decided I'd do a bit of investigation on the topic. Here's what I learned.

  • Giving money is fairly old tradition. It's documented as far back as 1683, which isn't half bad.
  • It's pretty clear that the notion of kids getting Hanukkah gifts is based on original concept of giving gelt, plus the influence of Christmas. I guess I have my Christian neighbors to thank for all those goodies my parents got me.
  • Somewhere along the lines, someone came up with the idea that you could make chocolate coins, hence the common tradition of giving chocolate gelt. With the way our economy is, the chocolate gelt is probably worth more than a handful of coins it represents.
  • This year there was a recall of chocolate gelt due to potential melamine tainting.
  • Like a number of Jewish customs, we understand that the tradition has been around for some time - yet the exact reason for this tradition isn't known. You might think this would be a problem. But, in fact, it gives creative license to Rabbis and others to examine the tradition for what you can learn from it, rather than pigeon-holing the tradition into one specific meaning. Here are some explanations for giving gelt:
    • Wikipedia suggests the tradition evolved out of a tradition of parents giving money to their student's teachers, with the students eventually holding onto the cash. Or, they suggest giving out money was a way to raise Hanukkah awareness (think an early, and effective, marketing campaign).
    • Chabad talks about how Chanukah gelt celebrates the freedom and mandate to channel material wealth toward spiritual ends.
    • Aish.com talks about how Chanukah gelt represents our potential for a good future, even when there's war, bloodshed and other terrible things around us
    • Harav Nosson Dovid Rabinowich suggests that the gelt is a reward and inspiration for good behavior from children
    The beautiful part is that all the above opinions are to some degree right.
  • Gelt, especially the chocolate kind, is handy to have around for the gambling game of dreidel. Though, playing the game is a topic of a future blog post, no doubt.
  • Finally, for just a good laugh, I suggest you read this cute story. It's not about Chanukah gelt per se - just the chocolate coins. But still, it's quite funny.

Here's to a year of prosperity and learning. Oh, and we should all have plenty of gelt.

A New Christmas Eve Tradition

Like many Jews, our Christmas Eve tradition used to be pretty standard: go out for Chinese food, and hit a movie.

This year, we're trying something a bit different. We've made our way to Atlantic City, and are celebrating the holiday in the 24hr, never affected by anything, bubble of the casino.

This place is still plenty busy. My guess is many a fellow member of the tribe is no doubt here as well.

It wasn't exactly our usual Chinese food, but we made do with the readily available Pizza and Subs. Note: the french fries served as stand ins for the latkes.

And here's a shot of old Saint Nick working at the casino. I'm at a loss for words on this, so please add your captions to to the comments:

Merry Christmas, Happy 4th night of Hanukkah and just a good Wednesday night to you!

Hope Santa can break away from the casino long enough to bring you whatever you've been wishing for.

Chanukah Night 3 - Taco Style

Tonight we celebrated night 3 of Chanukah with our friends Lauren and Nick. Nick made his family's traditional Chanukah treat: potato tacos. They have all the tastyness of traditional latkes, but allow you to add salsa and guacamole. Mmm, mmm, good.

Lauren made perfectly decorated and perfectly tasting brownies as desert. She managed to make them both Chanukah and Shira-Birthday oriented.

We've been so fortunate to spend Chanukah celebrating with friends this year. Lauren and Nick, thanks so much for hosting us.

Happy Chanukah ya'll - hope you're seeing the light.

Tire Woes? Just Tires May Be Able To Help

While checking our tire pressure we noticed that one of tires was especially low on air. Of course it had a leak. And of course, the leak wasn't repairable using a $3.00 patch. Nope, we would need at least one new tire.

We ended up buying and having the tire installed by Just Tires located at 3530 CARLYN SPRING RD, BAILEYS CROSSROADS , VA, 22041 - (703)931-8670.

Here's what they got right that earned them this blog post recommendation:

  • They had the tire in stock in their warehouse that nobody else had, including Tire Rack
  • They shipped it out to their store immediately and it arrived when promised
  • When we showed up to drop off the car, we arrived an hour after they closed. We managed to get the attention of a guy in the garage section, working on the car, and he politely let us in and allowed us to drop off the car. All while being quite cheerful about it.
  • When we called up to clarify which tire needed to be swapped out, they made sure the mechanic got this information
  • The car was ready when promised

They guys just nailed it - going out of their way to provide excellent customer service, even when it wasn't convenient for them. They've certainly earned us as customers.

Tuesday, December 23, 2008

To Vaccinate or Not? A Story To Put The Question In Context

This American Life did a wonderful story on a measles epidemic, and in doing so, brought up the question about whether or not kids should get vaccinated. Quick, if you act now, you can listen to the free podcast here.

Not only is it good story telling, but it makes an honest attempt at covering the argument from all angles. They even found a mom who was resisting getting vaccinated, and then had strong words against the family who didn't get vaccinated - which is exactly the path she was headed down.

What I found most telling was how clear they were on the topic of evidence that the vaccine does harm to children. Specifically, they addressed the article I've heard of where vaccines are linked to autism. Apparently, that paper has been withdrawn by the majority of its authors:

In 1998, Andrew Wakefield headed a group of researchers in publishing a much-disputed study that suggested a possible link between autism and the measles-mumps-rubella (MMR) vaccine. Since then, several studies have found no clear evidence to link MMR and autism, and all major health organizations - including the American Academy of Pediatrics, the National Institutes of Health, the Centers for Disease Control and Prevention, and the World Health Organization - have rejected Dr. Wakefield's claims. Still, fear of the MMR vaccine has caused some parents to avoid immunizing their children, leaving them susceptible to diseases that once killed thousands.

Now, 10 out of its 13 authors are retracting, or taking back, the controversial 1998 study. The Lancet, the journal in which the 1998 study was published, printed the retraction in the March 6 issue. The authors write: "We wish to make it clear that in this paper no causal link was established between MMR vaccine and autism as the data were insufficient. However, the possibility of such a link was raised and consequent events have had major implications for public health. In view of this, we consider now is the appropriate time that we should together formally retract the interpretation placed upon these findings in the paper."

This page continues to outline 3 reasons why the study was "critically flawed."

Yes, there is evidence presented to show that autism and vaccines are linked. Though, science, it appears, is quite clearly on the side of vaccination, as that evidence isn't based on firm scientific ground. The reasons to avoid vaccination, as presented in the story, had more to do with trust of the system, which of course is nearly impossible to tackle.

This is definitely worth a listen, if only as an example of how an issue like this can be played out so strongly.

The Onion Pokes Fun At Prop 8

The Onion's take on Prop 8 is hilarious:

Activists on both sides of the gay marriage debate were shocked this November, when a typographical error in California's Proposition 8 changed the state constitution to restrict marriage to a union between "one man and one wolfman," instantly nullifying every marriage except those comprised of an adult male and his lycanthrope partner.

Read the whole story. Every once and while I read an article of theirs which is just brilliant - I'd put this one in that category.

Monday, December 22, 2008

Upgrade of the day: Gimp 2.6

I don't know when it came out, but boy am I glad I upgraded to Gimp 2.6.

There are a bunch of improvements - but the one I immediately noticed was the text tool was more sophisiticated. It's now possible to have it specify a bounding box, and wrap the text within it.

This isn't mentioned on the 2.6 release notes, so perhaps my previous version of Gimp was so ancient it didn't have this?

I've also noticed the improved file loading dialog. I found this to be glitchy in Vista with the older version.

Gimp is still nowhere near as polished as Adobe Photoshop. But it's incredibly capable, and has some cool extension capabilities. Oh yeah, and it's free. Which if you're a small business or just interested in goofing around, might make a real difference to you.

What are you waiting for? Go get the upgrade.

Have they not been paying attention?

Have these people not been paying attention?

Take my buddies over here on the Left. Are they really that shocked that Obama asked Rick Warren to give the invocation at the inauguration? I can sort of see responding with strong worded letters, but posts like this?

Well, Obama's not listening to us anyway. We're the now-marginalized dirty hippies he gets praised for slapping. Whatever.

Come on, seriously. Here's a candidate that campaigned under the notion of bridging divisions, and it honestly never occurred to you that he'd involve people that you hate? How about putting this a little bit in perspective. He's asked Warren to give an Innovcation, and at just a few days prior, nominated his highest ranking gay member of his administration yet. Now, tell me which one of these actions speak louder? Besides, I don't need to defend Obama, he's done a fine job of that himself.

And take my buddies over at the media. Get this, because Obama has had such few leaks in his administration, it means that he's tight lipped and will control information and the press more than Bush.

Really? Seriously?

First, Obama ran a relatively leak free campaign. Are you now surprise he wants to run a leak free administration?

Second, to me, a leak is a sign of sloppiness. The fact that the media may depend on them for a living, doesn't make them any less of a bad thing. As a business person, if I had leaks in my organization that allowed my strategy to get out, I'd be pissed. And not only that, but I'd read it as though someone wasn't on board or understanding of the strategy.

Finally, what about the effort at change.gov. Lord knows, it's not perfect, it does at the very least represent an honest attempt to be open with people.

And since when did a promise of transparency mean exclusive access to media? We're living in an age where Obama can, and should be transparent without going through the media. It's almost like the media is disappointed they are getting their idea of transparency, versus what actually transparency could be expected.

Should the media spar with Obama? Of course they should. They should beat him up as much as possible. But let's keep this all in perspective.

A Dose Of American History

Today, Shira, her Mom and our friend Ron, all hit the American History Museum. While the museum was good, I have to say, I wasn't totally impressed. It felt more like a collection of cool - and random - stuff, rather than a cohesive storytelling experience.

There could be a number of reasons for this:

  • The museum is just finishing years of renovations and a good portion of it isn't open. The result is that many of the exhibits are crammed into smaller spaces than usual and have been truncated.
  • This is the Smithsonian I know the best - so perhaps the Wow factor has just been warn down a little?
  • The lobby where we first arrived and got oriented was filled with random items - from a dental chair used earlier this century to an original C3P0 costume. Cool stuff, but not really tied together in a strong way.
  • We just came off a trip to the Newsuem - so perhaps they set the bar so high, the Smithsonian couldn't top it?

Don't get me wrong - the museum was good. It's just I expect great things when I walk into a Smithsonian and I didn't feel like I was blown away.

I did take an hour'ish long guided tour, and that helped. Though, that was more useful prep for my next trip to the musuem, rather than this trip.

Here are a few photos from our visit...


Here's Ron, the CPA, raging against the IRS. Get it all out Ron, you'll feel better if you do:

See, this is what I mean. In one room I found a neat exhibit on Jewish immigrants (here's a prayer book from the 1800's). In another a funny portrait of Stephen Colbert. Yes, they get points for diversity..but still...

Every history museum needs at least one flamethrower. Here's the Smithsonian's. It's from their WWII exhibit. The war exhibit was gigantic, and was worthy of a multi hour trip all its own.

See that grin on Shira's face? That's because she was beating the system. After checking out a handful of exhibits, she retired to the lobby where she watched TV yanked from our TiVo on her Archos. She had hours of TV available to her, there was no rush from her perspective.

Us on the way out of the museum. Tired, and with our brains bursting with new information. Did I mention it was a bit chilly outside?

Saturday, December 20, 2008

Another Newsuem Trip

Previously, we hit the Newseum with my parents, and it was a bast. On Friday, we returned with Shira's Mom and our friend Ron. It was, again, outstanding.

When my parents were here, we did the museum from the bottom up, and this latest trip, we did it from the top floor down. Which just so happens to be the recommended approach. The collection of newspapers and short movies on the top floor is absolutely amazing. Each event in our history is represented with a page from the newspaper. It's a wonderful way to take in history.

Even the cafeteria was more impressive than a typical museum cafe. It wasn't cheap, but the food was fresh and tasty.

The Newseum continues to get two thumbs up. Check out photos here or in the slideshow below:

Thursday, December 18, 2008

Holiday Eating Tip

I'm not a big calorie counter myself, but with the holidays approaching it's always worth a thought or two. After all, Hanukkah is coming, and it features donuts as a traditional food to eat.

I found this article on the topic to be a good read, and I especially like this tip:

THE biggest calorie burning tip: Make sure to get in a good workout the morning of your holiday party, or rather, parties. You can see from the chart above what a difference even just a half an hour can make. And, you are not just going to burn during that alloted time, you will burn more calories all day long.

It seems obvious after the fact, but I guess I had never thought about it in quite this way. This one, I'm going to try to do next time I'm planning to be surrounded by tempting goodies.

Cool Scheme Undergrad Projects

Grant highlighted a post that came across the PLT-Scheme group. Mainly, that students had completed an ecletic set of final projects.

These were fun and inspiring to read about. Thinking back to my undergrad days, we never seemed to do anything as novel as say integrate with a iRobot or embed code in a C++ game engine. All I can seem to recall are programs about trees and such. Though, I'm probably thinking back to those very early days of CS113, and Modula 2 (*shiver*).

I'd actually like to see the source code for these projects, as I'm curious about some of the approaches taken.

Cool stuff.

Wednesday, December 17, 2008

Marketing Chutzpah Award

And the winner of the 2008 Marketing Chutzpah Award goes to... Yellow
Book!

They win because they publish thousands of 1000+ page books, drop them
in front lawns even though the owner hasn't asked for them - and then
has the nerve to write " An eco-friendly company" on their cover.

Nice.

--Ben

Tuesday, December 16, 2008

Gotcha Of The Day - Submitting Raw XML To PHP

This shouldn't have been tricky - but it stumped me for just long enough to declare it a Gotcha Of The Day.

I'm working on a Flex app, and wanted to POST some basic XML to a PHP script so that it could slurp in the data. Nothing too exotic there. By default PHP hides the whole complexity of reading in a POST, and just provides you with $_POST. However, in this case, I didn't want to use URL encoded values.

After poking around, I found this useful example. It makes use of the magic file php://input.

So, suppose I POST'ed the following XML from Flex:

  <lunch>
   <main>Chicken leftovers</main>
   <side>soy chips</side>
   <desert>Tofuti</desert>
   <drink>H2O</drink>
  </lunch>

(See where my head's currently at?)

I can use the following code:

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  $meal= new SimpleXMLElement(file_get_contents('php://input'));
}

This not only reads in the post manually, but also creates a SimpleXML object. Which means I can then do:

  record_meal($meal->main, $meal->side, $meal->drink, $meal->desert);

I'm really loving how SimpleXML parses the objects that Flex creates using it's SimpleXMLEncoder. This means that while the transport mechanism is XML, I can keep thinking in terms of objects.

Instant Oatmeal Tip

I'm probably the lasts person on the planet to figure this out. But, on the unlikely chance this isn't true, here's a tip to make instant oatmeal taste better.

Turns out, there's a significant difference between adding boiling water to your oatmeal, and microwaving both the oatmeal and room temperature water together.

For my entire life, I've always added hot water to instant oatmeal and the result has always been so-so. The oatmeal never really cooks, and you either end up with sludge or a soupy mixture.

Because of my sleep deprived haze this morning, I actually read the instructions on the oatmeal box and microwaved the water and oatmeal together for a minute. The result was actually cooked oatmeal that had a nice consistency (well, if you like oatmeal).

This is a brand new day for my oatmeal eating. Whoo!

Thanks to LiveWell360 for all her mentions of oatmeal, which reminded me I should try eating it again. That, and I'm out of other food to eat.

Monday, December 15, 2008

A DC Winter

Folks are skating at Pentagon Row. and the Christmas music is playing.
It's also 66 degrees and I'm in shorts and a t-shirt.

Ahhh, this is my kind of DC winter. I know it won't last, but I can
enjoy it for now.

--Ben

AdSense Out To Get Me In Trouble With The Wife

I'm reading my work e-mail using Google Apps, and noticed the following AdSense results:

Whoa, ads for string bikini's?! Think of all the ways I could get in trouble with this by the wife:

  • You've been surfing for string bikinis when you should be working? You bastard!
  • What, you think I'm just some object you can squeeze into some fantasy outfit you've got in mind? You bastard!
  • What, you don't think I'd look good in a string bikini? You bastard!

And probably more...

And what triggered these ads? An e-mail with the subject password token generates long string. I'm innocent, really.

Sunday, December 14, 2008

The Tire Gauge Irony

Driving around, looking for a place to add air to my tires, reminded me of the whole Tire Gauge incident during the presidential campaign. You know, the one where McCain's team created custom tire gauges and said that was Obama's energy policy.

It struck me today of the irony in that act. Here's the Republican party, the one who wants less government, mocking the idea the individuals can take action in this energy crisis, and instead is pushing the notion that all you really need to do is trust Government and Big Companies to fix the problem (aka: Drill, Baby, Drill!).

Hmmm, that's actually more than ironic, that's disgraceful.

Yes, it was a cute move. But in the big picture, it was really sad.

--Ben

Air as missed business opportunity

Today Shira and I drove around to 5 gas stations before we found one that would allow us to pay for the privileged if filling up our tires with air. It's not that the other 4 gas stations didn't offer air, it's that the compressors were all out of order.

If you ask me, this is a silly business move. Think about it, properly filled tires means better gas mileage. Which means, as a gas station, you can use this as a selling advantage - "fill up with us, and check your air for free - you'll get better gas mileage." Who could turn that down?

If I owned a gas station I would: (a) make sure I had a working air compressor, (b) offer access to it for free and (c) offer free tire gauges by the pumps with my name on it, (d) encourage employees to help check tire pressure for free.

Who doesn't love a freebie like a tire gauge? And one that will help you save money, no less.

We're talking about air - a resource that's still free. C'mon, think of the marketing campaign you could build around this.

I know, I know, gas stations don't work this way. They don't need relationships with customers, they just need to be in the right location. But, if that's what all your competition thinks, it seems to me now is the perfect time to do something different.

--Ben

Review: Los Tios

Shira and I were on the lookout for a new restaurant to try, so we browsed through the Washington Post Restaurant Reviews. There was a promising review for Los Tios (2615 Mt. Vernon Ave., Alexandria, VA 22301) a tex-mex place not too far from us. We gave it a try.

The service was good, with a fresh and warm supply of chips constantly being refreshed. We tried a corn cake thing as an appetizer and it was awesome. More desert than appetizer, actually.

Shira's fajitas were nothing special. Though, I'm not sure how you make veggie fajitas special.

And there's my fish. As you can see from the attached photo, when the menu called for fried fish, they meant it. Head, tail and everything in between. And it was tasty, too.

Overall, I liked the place more than Shira. I found it authentic, and was pleased with intriguing options on the menu.

I should also mention, that like the review said, this is a kid friendly location. Which is to say it's quite loud with lots of kids. But, Shira and I could still carry on a conversation.

I give Los Tios 7.5/10 for authenticity and shear shock and awe value.

See the review at: http://www.washingtonpost.com/gog/restaurants/los-tios,1120611/map.html

--Ben

Friday, December 12, 2008

The Simons Take The Potomac

Today, Dave and I tackled a 10 mile run along the Potomac. It was a bit
windy but the rain held off, and the scenery was perfect.

As if to put us in our place, we ran by Army folks doing an exercise
that involved shlepping each other (!) and heavy looking chains around.
Suddenly, our 10 mile run felt a little less impressive.

Still, it was a great start to the day. Now it's time to go back to
bed...

--Ben

Thursday, December 11, 2008

The Speedy Evoluation of Change.gov

When I first discovered change.gov, I was impressed. The site had an impressive amount of information about the plans of the next administration, a blog and had some basic interactivity where you could apply for a job or suggest a story.

But, thinking more about it, what had the Obama team really done? They had put up a nice website. Is that really that impressive?

Before my criticism could really settle in, they added a new feature. They asked for suggestions about fixing the health care industry. And sure enough, people responded - 5,000 of them actually. This was impressive, as they were turning the site from strictly an information source into a place where people could give specific feedback on a specific issue. When was the last time the Bush presidency reached out to me and asked me my opinion on a topic?

But, thinking more about it, how useful was this? Can I really read through 5000 comments? Does my comment in the batch of 5000 really matter? Is this just an exercise in making me feel better?

And again, before my criticism could settle in, the Obama team published a video statement about their findings. If the video is to be believed, they went through each comment and people's voice's really did matter. They also presented a graphic to try to make sense of it all.

But, thinking more about it, is this whole comment and get their video response back truly useful? And again, before my criticism could step in, they launched Open for Questions. This is an area of the site where you can not only submit a question, but rate the ones you'd like responses to. Aha! Now we're talking. Let's put the wisdom of the crowds to use to find the most important questions we want answered.

This time, I didn't even have a chance to think about the criticism, someone else did that for me. Ben Smith, of Politico, reports that "Blagojevich questions censored on Transition site." According to Smith, pro-Obama fans were gaming the system by marking the Blagojevich questions as inappropriate. Turns out, the system isn't flawless. Never mind that there's no evidence that the Obama team is "censoring" anything and that all questions are being archived here. That's not the point, the point is that it isn't the system isn't perfect.

And what has the Change.gov team done? They've issued this statement:

Pilot projects like "Open for Questions" depend on feedback from users to better understand how to make participation intuitive and productive. In case you missed the link at the bottom of the Open for Questions page, we have a feedback form for any ideas or comments you have about the tool.

Participation in Open for Questions outpaced our expectations, and we're looking forward to rolling it out again next week. We're tremendously excited about the promise of tools like this that offer Americans a level of access that has historically been hard to come by. By voting questions up, users have been able to convey to our team which major issues -- like the auto industry, health care, ethical standards, and others -- are the most important to this community.

In other words, they get it. The system didn't work as smoothly as they liked. They are going to be giving this a try next week. Hmmm, honesty - I could learn to like this.

Looking back, I realize that it isn't the individual changes to the site which are impressive. Sure, they're novel. But, they're going to have kinks associated with them. What I find impressive, and exciting, is how the team appears to be moving a Startup Speed to leverage technology. Remember, this is a .gov site we are talking about here, and they've moved faster than many companies. They're also being more open than many companies. This, I give them big time credit for.

Looking for a room to rent in the DC area?

My brother's moving into a place in Maryland, and he and a friend are looking for a roommate to join them.

Here's the description from the cragislist ad:

Two professionals, late 20's, seek third roommate for shared house. One is 26-year-old middle school teacher, female. The other is a 29-year-old NIH post-doc, male. Both are laid back and friendly, enjoy dinners with friends and exploring downtown. Non-smokers. No drugs. Really good taste in beer and wine. Clean, but not neat freaks. Social, but not a frat house. And a 12-pound miniature schnauzer named Spud will be moving in too.

The fine print also mentions that they are seeking someone who wants a Kosher kitchen.

And here are some photos. Just look at the backyard on this place:

Let me tell you - this is quite an opportunity. My brother and his friend are the kind of people you want to live with. They're neat, generous, responsible, love to barbecue and are most definitely not a freaks.

So, if you're looking for a place in the DC area, drop them a line.

PLT-Scheme Foreign Functions Tip

I'm my spare time, I'm still kicking around the idea of integrating PLT-Scheme and Tcl/Tk. While poking around looking for more foreign function interface examples, I came upon a fix to in issue I ran into last time I was playing around.

The problem is this: when I imported the foreign.ss library, I lost the ability to describe function contracts. That is, I can't do:

#lang scheme
(require scheme/foreign)
(unsafe!)

(define c-string-length 
  (get-ffi-obj "strlen" #f (_fun _string -> _int)))

(provide/contract
 [c-string-length (-> string? string?)]))

That's because the -> is a conflict - it's used by both the contract and foreign libraries.

Luckily, I stumbled on this example here, which elegantly solves this problem. See:

#lang scheme
(require scheme/foreign
         (rename-in scheme/contract [-> -->]))
(unsafe!)

(define c-string-length 
  (get-ffi-obj "strlen" #f (_fun _string -> _int)))

(provide/contract
 [c-string-length (--> string? string?)])

I forget that the module system let's you play games like this to fix import conflicts. It's also a good reminder that while contracts feel like they are built in, they're just like any other library you can import.

Speaking of foreign function Tcl/Tk interfaces, I have to say I'm impressed with Tkx. This Perl module has a clever means of passing Perl callbacks to Tcl code. It also has some conventions that make it easy to write Perl looking code, yet have it translate seamlessly into Tcl. I'm thinking of it as inspiration.

Review: Five Biblical Portraits

One aspect of the bible that I've always thought lent it credibility was how insistent it was on recording the flaws of its players. I mean, seriously, if you were going to record the life of a people's first king would it include his becoming delusional, falling out of favor with G-d, and committing suicide (which is way not Kosher)? It just seems like there would be a natural tendency to leave those details out. Yet, the Bible consistently goes there.

Elie Wiesel tackles just this topic by diving into the biographies of Joshua, Elijah, Saul, Jeremiah and Jonah. All of these characters have flaws, and Wiesel digs into them to help us understand and reconcile the good and bad of their lives and behavior.

The book is remarkably readable, and I found myself not being able to put it down. At 150 pages, it's a quick read. Wiesel's approach of asking more questions than he can answer really does work here.

I have to admit, I also found the book very educational. While the 5 books of Moses are a regular staple at shul, I don't often dig very thoroughly into other books and characters featured in the full Bible. This was a fun way to get a flavor for these persons, and I look forward to going back to the source text to learn more.

If you have even a passing interest of the Bible (or have a thing for flawed people), it's worth picking the book up. You'll see a depth and complexity of character that can easily be overlooked. I give the book a 9/10 for being just an all around great read.

Wednesday, December 10, 2008

The Crazy or Brilliant Cabinet Pick

Could this report be true? Could Obama really be bringing on Steven Chu as energy secretary? I was expecting Democrats and Republicans, Blacks, Jews and Hispanics in the cabinet - but an Academic? Wow, someone's really pushing the limits here.

The report lists that various Democrats are uneasy with the choice. I wonder if that's a clue as to how tricky this nomination might be to pass?

Personally, I'm excited by it. But that's not a surprise, as I come from a family of academics (being in business means the black sheep of the family, if you will). I like the idea of taking someone who is immensely knowledgeable about a topic, and putting them in charge. I also think it shows a real commitment to try something different in the energy front. This is definitely not business as usual.

Of course, the question becomes is he the right man for the job? That I'm not sure of yet. But, I certainly wouldn't disqualify him for lack of political experience. There are plenty of folks in Washington who can tell you how politics works. There are far fewer nobelaureates.

I wonder if my excitement is partially the the way some Republicans felt when Palin was nominated. That is, here's a person who's both an outsider and a has a profile that fits with an ideal I respect and appreciate. Given that, I should be doubly careful about jumping on this bandwagon till I find out if the profile actually matches up to the person.

Update: There's a lengthy interview of Chu on YouTube - so far, it's an interesting listen. As another connection I just learned: Chu went to Univerisity of Rochester - a school that my Dad taught at, and I grew up a few miles from.

Optimistic Marketing

So, I'm munching away on a package of pumpkin seeds (thanks Mom!), and it occurs to me, these have to be the saltiest food I've ever eaten.

Curious what the damage is, I check the package's sodium content. It's 5mg, which is 0% of your daily value.

Hmmm...I think, that can't possibly be right. And then I read the fine print at the end of the packaging:

Eating the shell as well would bring the sodium to 540mg (23% of the daily value)

Ahh, that's more like it! Nearly a quarter of my sodium intake for the in a convenient .75oz bag.

Now, are you telling me that the company went through all the trouble of salting the heck out of the shell, and then assumes you aren't going to eat it? I suppose they were telling the truth, but come on.

Only a marketer could think there's nothing wrong with presenting the facts this way.

Tuesday, December 09, 2008

Guns For Cameras - A Clever Promotion

Adrants is carrying a story about a Toronto camera store and the Toronto police offering a Guns for Camera exchange. What I especially liked about it was how the person who handed in the gun got free photography lessons in exchange.

This was definitely a smart marketing move on the part of Henry's. I'm surprised more retailers don't do community outreach programs like this.

I'm actually a fan of target shooting. So, what I really need, is a Camera for Guns program. Or even better, Cell phone for Guns program. I could drop off an old Sidekick, and in exchange get a hand gun.

If any state could pull it off, it would be Virginia. You don't have to be licensed to own or carry a gun, and if you can put up with the fact that you need to register it with the state police, Machine Guns are legal.

Only in America.

Geek Heaven

My TiVo hacking happens to be working out better than even I imagined.

I've installed MFS_ftp, which allows me to FTP to my TiVo and download shows through a regular FTP client. See what I mean?

I also stumbled upon TyTools, which is another UI to grab content from the TiVo in an even more clear way.

And perhaps the most important find of them all - MPlayer for Windows can play the download .ty files right out of the box. That means that all my hacking actually served a purpose.

The geek side of me is still most impressed by the fact that I can telnet to my TiVo.

Truly, I feel like a Geek in a geek candy store, with an all you can eat geek special going on.

Mesmerizing Videos

Here's a couple of videos I just couldn't turn stop watching. The first is courtesy of EndTheRoboCalls:

The second is from CoolTools. Turns out, you can buy Heelys for adults. Tempting, but I know I'd be on my tuchas in just matter of seconds. Look at these kids go:

And The TiVo Is Hacked - In A Good Way

Last night, I started the process of hacking my TiVo. At the time, it left me with a non-working TiVo and a non-working Linux sever. My plan was to tackle this later today after I got some Real Work done. But alas, with the particular Linux server down, my network wasn't working. Something was going to have to get fixed.

The problem I was running into last night was that a typical TiVo drive isn't trivially mounted on a X86 Linux box. Apparently, it's PowerPC and the drive needs to be mounted with byte swapping in effect. The good news is that the MFSLive CD, a small CD to boot and mount TiVo partitions will do this byte swapping for you. But, only if the drive was a secondary IDE master or slave.

The upshot of this all means that I had to coax two very short IDE cables into hooking things up just right. This morning, I managed to find just the right combination.

With the TiVo drive mounted, I was able to copy various unix tools to it, and most importantly, turn on the telnet daemon.

Once this was done, I put the drive back in the TiVo, booted it up - and amazingly, was able to telnet to the server. Using the built in text2osd I was able to send the following message to the screen:

Now the real fun can begin.

It just never ceases to amaze me that a situation that was so grim 6 hours ago, so seamlessly came together now. The moral of the story: when in doubt, leave it and get some sleep.

Step 1: Make The Problem Worse

So, tonight I had big plans to hack my Tivo. In order to do so, I just needed to copy a few files to it's hard drive. How difficult could this possibly be?

At the moment, my Tivo and Linux server that I was using to do the copy are in pieces. The Linux server not only doesn't recognize the Tivo drive, but now doesn't recognize its own drives.

I've managed to turn two devices to door stops in just about an hour.

And yet, I'm totally not surprised. For me, the first step of any hacking project is always: make the problem worse. Well, mission accomplished.

Now, let's hope that tomorrow can bring with it step #2: get it all working again. We'll see. I just know that tonight's not the night I'll be getting this to work.

Monday, December 08, 2008

Anatomy of a phishing attack: The Secret Video attack

A few days ago, my brother calls my cell phone. He got a strange message from a Facebook friend. He wasn't near a computer, and was curious if I could check it out. He forwarded me on the message, which is mostly below:

From: Facebook 
Date: Fri, Dec 5, 2008 at 10:07 AM
Subject: Ben's Brother's Friend sent you a message on Facebook...
To: Ben's Brother

Zvi sent you a message.

Subject: I was surprised to see you on this video.

"W O W
http://www.facebook.com/l.php?u=http://geocities.com%2Fynufgzhmf%2Findex.htm%3F5cch5f%3D9d980760651eb5176d1117c8b4885b63"

Uh, oh - this doesn't sound good. Who's nightmares don't include some video clip of you being shown on the web that you'd rather didn't exist? I clicked on the URL, expecting the worst, and was created with the following page:

OK, I thought - my Flash Player is out of date. No biggie, I'll just update it and then I'll get to see this incrementing video.

I click on the link and flash_update.exe is downloaded to my system.

As I'm about to double click on the executable, my brain finally catches up to my fingers and I realize maybe this isn't such a great idea. This page looks a little sketchy. It then occurs to me, if my Flash Player is really out of date, the safe way to upgrade it is to visit Adobe.

And so that's what I did. I headed over to the Flash Player download area. Sure enough, my Flash Player was out of date. Perhaps I was being a little too paranoid.

I then visited the site again, and as you might imagine, it said I was still out of date. At this point, I realized that this is definitely not a video site, and is a sort of virus or phishing attack. A well executed one at that. Here are some signs that confirmed it:

  • The URL was: http://122.55.185.237:7777/dt/?. The fact that there wasn't a recognizable domain name was a sure clue something was up
  • I inspected the HTML, and the fact that it was personalized with a name, is actually done on the fly. The URL query string argument ch=F0F2EFE6E9ECE5AEE1EBAE... contains, among other things, the name of the person to show as their page. This is cleverly done, as the page has the look of one that's specific to the person who sent out the Facebook e-mail.
  • The page was trying to look like YouTube, but of course, it wasn't YouTube. In fact, there was a typo in the title, which said YuoTube. Why can't spammers spell?

In the end, no harm was done because I never ran the flash_update.exe file they had me download. But, if I had run this, I'd be in a bad way.

The moral of the story is simple: don't run a .exe from any website you don't trust.

The way this attack integrates Facebook, Flash and the general fear that we'll show up on the internet in a compromising position, is nothing short of genius. Evil genius.

It's a dangerous world out there, so be careful.

Sunday, December 07, 2008

Dinner With The Boys

It's been too long since I've had dinner with the boys, and tonight I got change that. It wasn't the whole crew, but none the less, we had a great time.

I was especially impressed by Spencer, who I handed my Sidekick to, and he tapped out and sent himself an e-mail. It's amazing how fearless kids are with technology, just jumping in and figuring it out.

Jon Stewart Asks The Tough Questions - About Blogging

Last night, I watched the Daily Show episode where Jon Stewart interviewed Arianna Huffington on the topic of blogging. Arianna described blogging as:

Blogging is not about perfectionism. Blogging is about intimacy, immediacy, transparency and sharing your thoughts.

When Jon asked if he should be producing a blog, even if meant publishing the crap that wasn't good enough for the show, she answered with a definite yes.

While some of the points in the interview were fine, overall, I wasn't impressed. Given the chance to explain this to Mr. Stewart, here's what I'd say:

Jon, bubalah, you asked about blogging? Well, blogging is simple.

  Blogging = A Personal Publishing Platform

Let's break that down. Starting with the simpler part, it's a publishing platform. You already have a publishing platform, it's called the Daily Show. You also happen to be fairly unique in this respect, the vast majority of the people on planet earth do not have an outlet that regularly reaches 1 million people. For those people, a free blog levels the playing field and gives them a mechanism for getting content out on a massive scale.

The Personal part of blogging refers to the fact that each blogger (or the organization that the person is blogging for) can decide the rules of the blog. If they want to follow journalistic rigor that would make the New York Times look like slackers, that's fine. If they want to invent their content and publish complete lies, that's OK too. It's up to the blogger to decide what content should be published - and the title "blogger" doesn't need to influence this.

To address Arianna's points directly I would say:

  • Yes, blogging can be a first draft of history filled with immediacy and transparency. And perhaps this is even what a "classic" blog is (whatever that means). But it's hardly worth limting yourself to this definition.
  • No, Jon probably does not need a blog. He has a perfectly adequate method for getting his views across. But, if he ever felt limited in this respect, he too could start a blog in just a few minutes.

The complete interview is below.

Saturday, December 06, 2008

Details On The Obama Plan - From Crisis To Opportunity?

Today, in Obama's weekly address he started to reveal some details of his upcoming stimulus plan. Take a look:

The cliff notes version is that the plan will consist of:

  • A massive effort to make public buildings more energy efficient
  • A massive investment in infrastructure
  • A plan to modernize and upgrade school buildings across the country
  • A push to add more broadband lines
  • A plan to modernize the health care system by leveraging electronic medical records and other technology

None of this is actually anything new, in that these are ideas he's been talking about throughout his campaign. What is new is the notion that these programs are going to be the ones he comes out of the gate with.

I have to say, I'm impressed. He's managed to link health care, education and energy to either creating new jobs or cutting waste. Who can't get behind these efforts?

These strike me as both effective and plausible actions to take. While the suggestion of making our government buildings more energy efficient isn't as sexy as, say an electric car, this is something we can today and on a large scale. Consider the trivial move of replacing incandescent light bulbs with compact florescent bulbs:

According to the Union of Concerned Scientists, if every U.S. household replaced just one regular incandescent light bulb with a compact fluorescent light bulb, it would prevent 90 billion pounds of greenhouse gas emissions from power plants, the equivalent of taking 7.5 million cars off the road. And the U.S. Environmental Protection Agency says that by replacing regular light bulbs with compact fluorescent light bulbs at the same minimal rate, Americans would save enough energy to light more than 2.5 million homes for a year.

It seems to me like entrepreneurs would do well in helping to meet the above program's needs. Heck, what about the companies that manufacture all these new light bulbs or insulation?

Of course, the big question is, can the Obama administration pull this off without a huge amounts of abuse of the system. That remains to be seen. And while I have lots of other questions (like, when can I read the details of the plan?), my biggest one is -- why the heck haven't we been doing these programs for the last 4 years?

Oh, and one issue I do have with Obama's address. He mentions:

As we renew our schools and highways, we’ll also renew our information superhighway. It is unacceptable that the United States ranks 15th in the world in broadband adoption. Here, in the country that invented the internet, every child should have the chance to get online, and they’ll get that chance when I’m President – because that’s how we’ll strengthen America’s competitiveness in the world.

Uh, didn't Tim (not Al) invent the Internet? And isn't he English?

DC By Night

Here's a couple of snapshots I took on my run tonight. Of course, my battery pack died before I could really capture all the photos I wanted to. Still, it was a gorgeous night.

Friday, December 05, 2008

One Lucky Birthday

I could think of no better venue than to celebrate Shira's birthday than Atlantic City. In what appears to be a new trend, we really enjoyed visting AC during the week and off season. It was a bit chilly outside, but the sun was shining bright and wasn't nearly as chilly as it could have been.

As a treat for Shira, I broke from usual tradition of working in the room while she plays Blackjack, and spent the day playing with her. In return, she went easy on me, let me eat every meal, take bathroom breaks and even took time out to watch a movie with me (no, not one of those movies that don't show up on your hotel bill. We watched Click).

It's amazing how I can stand behind Shira and easily know what the recommended move she should make (hit, stay, double or split). Yet, when I sit down, and cards are being thrown my way, I completely blank. That's why it's nice having Shira right next to me - she can remind me of the finer details.

Serious Blackjack players tend to have pretty strict etiquette about how they play. For example, it's legal, but rude, to jump into a around that's going well - you're better off waiting till the next time a shuffle occurs (and the "shoe" is ended). Observing these rules isn't usually a problem. Till, last night, when I hit the amount of money I wanted to make and decided to stop playing. Whoa, the table was not pleased. The person most annoyed? Shira. How could I stop playing in the middle of a shoe when the cards were flowing so well? Easy, I hit the amount of money I made and wanted to walk away a winner. I'm all for following etiquette, but (a) this whole notion that the cards care who's sitting at the table is pure superstition, and (b) the only way to insure you'll have money is to stop.

I doubt I'll be able to pull that move again and live to tell about it.

Like I said, Shira was kind enough to step away from the tables and take a break by watching Click. She couldn't have picked a more appropriate movie to watch if she had tried. We were expecting goofy Adam Sandler. And yes, we got goofy. But we also got a story about a man who chose work over family and lived to regret it. It was one uncomfortable film to watch, as I've given many of the same excuses about missing events for work.

All in all, we had a fantastic time. And I do believe, Shira very much enjoyed her birthday. Mission accomplished. Here's a few photos.

Thursday, December 04, 2008

Happy Birthday Babe!

Happy Birthday Babe (aka Shira, aka Ben's wife)!

On this day, I'm so glad your parents had you, and that you could move into the same town I grew up in, and then into the same 4th grade class, and then didn't have anything romantically to do with me until we were living 385 miles apart without a car between us, and then married me, and then made me the happiest man on the planet. That was just so generous of them, no?

Thanks to the power of scheduled posting, I'll be able to put up this message without having to actually blog on your birthday. Isn't that nice?

I really do love you babe, and would be truly lost without you. Thanks for spending another year of your life with me. Here's to many more!

Happy Birthday!

-Ben

Wednesday, December 03, 2008

PHP Mystery Solved: @ notation not working

The "@" notation in PHP is both powerful and dangerous. It allows you to temporarily ignore the error from a command.

It's what allows you to say:

  @session_start();

And not have to worry that an error has been raised because the session has been started.

Strangely, when I put my own error handler in place, this notation stopped working. That is, my error handler would be invoked with a E_WARNING in the above code.

I finally got this one figured out today. And of course, it's even fairly sensible. A commenter on the PHP docs explained it well:

I was confused as to what the @ symbol actually does, and after a few experiments have concluded the following:

* the error handler that is set gets called regardless of what level the error reporting is set on, or whether the statement is preceeded with @

* it is up to the error handler to impart some meaning on the different error levels. You could make your custom error handler echo all errors, even if error reporting is set to NONE.

* so what does the @ operator do? It temporarily sets the error reporting level to 0 for that line. If that line triggers an error, the error handler will still be called, but it will be called with an error level of 0

I updated my error handler from saying:

 function smart_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
   // echo stuff to the screen
   // or send e-mail
 }

 function smart_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
   // we've been asked not to report errors, so we'll listen.
   if(error_reporting() == 0) {
     return true;
   }

   // echo stuff to the screen
   // or send e-mail
 }

The condition above checks to see if the @ notation is in effect, and if it is, it quietly ignores the error.

Not only does this make sense, but it's also a more powerful implementation than if the error handler wasn't invoked during an @ function call.

Gotcha Of The Day - Wordpress failing on Vista witih fsockopen timeout

I accidentally turned on error checking for E_WARNING in Wordpress and was greeted with the following message:

PHP Warning: fsockopen(): unable to connect to localhost:80 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)

What the heck? The web server is obviously running, or I wouldn't have been able to see the error in the first place. And the fsockopen code couldn't be more straightforward.

Google to the rescue! I found PHP bug 44335, where a user complains of the exact same issue.

The solution turned out to be simple. On Windows Vista, there is a file that contains specific hostname to IP addresses. It's found at:

 C:\Windows\system32\drivers\etc\hosts

Inside mine, it said:

127.0.0.1       localhost
::1            localhost

The first line is standard - it says to associate the name localhost with the standard loopback address. The second line turned out to be the culprit. I removed that line, and everything worked as normal.

Strange. But, I'll take it.

Some thoughts on the Obama Transition

I read this article talking about the way the Obama team has been using their announcements to raise cash, and it got me thinking. And here are some of those thoughts...

Thought 1: Why does Obama keep asking me for money?. I mean he won and all, why is he continuing the trend of turning good and bad news into a plea for cash? A little digging showed me that during the Clinton to Bush transition of 2000 "[the Bush transition team] spent $5 million allocated by PTA as well as another $4.7 million in private funds."

In other words, it's not unusual to have millions of dollars come from private sources to fund the transition. But why me?

Well, if you're not going to have individuals provide, then you're going to expect companies to deliver. And if you're going to involve companies, the question of what the companies expect in return comes up.

So, if we give money to the transition then the president is beholden to us. Hmmm, that's actually the way it's supposed to be - right?

Thought 2: Please, tell me I never took this attitude with Bush? Here's an especially juicy comment from the above article:

All part of the Neverending Campaign that will be the Obama Presidency.

You didn't think the candidate built on image alone with no record of actually running anything would actually try to get anything done, did you?

[more that's been trimmed]

Whoa - the guy isn't president yet, and this particular citizen is already annoyed that he hasn't done anything. Wouldn't it be a problem if he was doing something, as he isn't president? Surely, I hope when Bush beat Gore I didn't behave like my mind was already made up?

Thought 3:What's up with all these press conferences? Seems like every few days Obama is announcing yet another position and holding another press conference. Is this sort of thing normal?

Of course it is. Check out Bush's list of transition press conferences. I guess I'm just paying more attention this time.

Thought 4:Did Bush really just say that?. When Obama was asked:

"Hundreds of your friends are wondering what you're going to do because they're in desperate straights from the standpoints of their budgets,"

Obama answered, among other statements:

Now you mentioned, sort of, my friends. I want to be clear friendship doesn't come into this. That's part of the old way of doing business.

Fair enough - nothing too exotic there. Now, look at Bush's announcement of Joe Allbaugh as head of FEMA:

Today, it is my honor to report to the nation that the remainder of the "triangle" has agreed to serve in my administration. First, Joe Allbaugh: Joe has been a loyal, strong friend who has agreed to become the director of FEMA, the Federal Emergency Management Agency.

FEMA is an incredibly important part of a president's team. The person who runs FEMA is someone who must have the trust of the president, because the person who runs FEMA really is the first voice often times that someone whose lives have been turned upside down hears from.

In other words, the most important criteria to President-Elect Bush was loyalty and friendship. Amazing. Not experience and not their ability to push back. But, perhaps I'm being too critical - after all, it's only FEMA we are talking about. How important could FEMA really be?

There, with all that said, I feel much better.