chenb•log

I don’t mind if I’m incomprehensible

Archive for February 2008

Do They Sell Good Karma on Ebay?

leave a comment »

There are two streets and a parking lot entrance/exit between my apartment and the university campus where I work.  While walking home today, a car hit me at the parking lot entrance.  You do the math.  (Because I sure can’t.)

The Honda Element was creeping out slowly and almost blocked the entire sidewalk, but it came to a complete stop.  So I thought it was okay.  What a naive twenty-something I am.  When I got to the center of the vehicle, it started moving slowly and hit me.  I was wearing a gray hoodie, so I wasn’t exactly camouflaged.

Fortunately–hah, positivity y’all!–he wasn’t one of those Vin Diesel fans I’ve seen around town.  You know, those who stab the go pedal and put on the revs to go twenty meters “quickly”. (Would Paul Walker have been a better reference back there?)

Anyway, no physical damage on me.  Or the car.

Oh yeah, last night I found out that someone egged my car.  I left it for 11 days, so I don’t know when it happened.  (I don’t drive very often, because, as you know, I’m willing to risk getting hit by cars to walk to work.)  And I certainly don’t know who did it.

I’m not angry or anything.  Just mildly annoyed.

On the other hand, a fortune cookie told me that I’ll have an enchanting evening next Thursday.   Ladies?

Advertisements

Written by Barry

February 15, 2008 at 7:01 pm

Posted in General

PHP: lolwut?

with one comment

While I was helping out on a project, I noticed something that’s just so…PHP.

>> class O { var $u; }

>> $f = new O();
O::__set_state(array(
'u' => NULL,
))
>> $f->u = array('c'=>'k');
array (
'c' => 'k',
)
>> empty($f->u->c);
false

Gah! If you are new to the project and combing code to debug something, that’s difficult to notice when $f->u->c is only used in empty() calls within a bunch of if statements. However, PHP does throw a “trying to get property of non-object” notice if you try to access the non-existent value.

Written by Barry

February 1, 2008 at 7:19 pm

Posted in Nerdy