Saturday, September 10, 2011

Not The Flashy Type

You won't see me wearing the latest trends. In fact I still wear a pair of pants I bought 12 years ago. Their still fine. Faded, a little torn in some areas, but I still like wearing them. It still doesn't expose my privates - it serves the purpose.

It makes me feel good to be in them. It makes me feel sure that when I walk out there and people see me, they would know it's me even if I was covered/hidden from waist up.

"Hi, Dann!", they'd greet me.

I guess I just don't pay much attention to being trendy.

You won't see me in skinny jeans. I fear that they'll rip in half when I accidentally stride or quickly run up the stairs.

You won't see me wearing shades. I think they're very annoying to wear and I have that constant fear that they would break, fragment, and blind me.

I don't dye my hair. My body is enough to tell people I'm a kargador sa pier. Bleaching my hair is a redundancy.

I don't wear v-necks. My chest is fine and well protected where they are inside my shirt. If you want cleavage, look at your obese friend's ass crack.

I don't wear perfume all the time. I forget to spray them on in the morning.

Sometimes, the smell is too strong that It's turned annoying rather than pleasing to people near you.  You become a walking ammonia bottle ready to suffocate unwary strangers. You become an outlaw in elevators and your presence makes your fellow lift riders beg for the doors to open on the next floor.

 LOL.

Maybe I'm just not wired to dress like you, to look like you or smell like you..

Or maybe I'm just poor. o_O

A SIMPLE SOLUTION TO HANDLING PHP FATAL ERRORS

Hey, I'm also a web developer and I encountered a problem while developing a php application - PHP can't handle fatal errors! It just exits after encountering one. Tsk tsk tsk.

Well everybody says that you can't catch php fatal errors.
I have a solution. It utilizes the grep command (for linux and unix users) to check lines that say "PHP".
Though it's does not follow best programming pratices, it still does the job.

First task is to create a separate php script that contains the lines of code you want to catch.

For example:

<?php
non_existent_function_foo_bar();
?>

as test.php

Now write another script to run the first script using exec or the ` ` delimiters.

<?php
$a = exec("php test.php | grep php");
echo $a;
echo "\nMy my it recovered! Excellent solution, dann!";
?>

See what happens:
Well this does not handle variables that you want to pass on to the next script. However, that's trivial. You can pass it as a commandline argument. If you want it more difficult, write to an xml file, or a plain text all the variable values you want to pass then just read them from the next script.

Now you can use this principle to generate an Exception when such errors are encountered or to recover from a fatal error!

Sometimes the most practical solution may not be the most beautiful solution.

Haha!

Thursday, September 1, 2011

Snapshots of Sherwin - Album 1

 <DRAFT:DRAFT:DRAFT:WAG MAARTE>


 
I lost count of the bottles of beer I had. It was past 2 am and a few hours more I should be at work. There were only three of us left in Sarah's : I, Carlo, and Keith. We could hear each other clearly, a feat that can't be achieved a few hours earlier when the place was crawling with students, teachers, and other regulars. However, I barely remembered what we talked about that night.


My cell vibrated. A text message.

"Gcing k p?"

It was Sherwin. I was thinking of ignoring his text. After all, we never actually texted anything sensible to each other. Our usual conversation would be me asking him to come over for beer or him asking me if we can go out for alcohol. We both knew that would mean us going to bed together for the night. However I found myself walking out of Sarah's to reload my cell so that I could text back.

It was drizzling outside and stupid me left behind the umbrella.

+++++++++++++++++++++++++++++++++++++++++++++++

FIRST ENCOUNTER

I met Sherwin through some acquaintances, Don and Alfred. We were drinking then with some high school friends of Don. I was kind of feeling out of place since they were all walk down high school memory lane. They are all from Davao while I am from Batangas.

Hours passed that night and I was drifting away from the conversations. I was seconds from leaving out of boredom when an unexpected visitor arrived - Sherwin. I stopped and glued myself back to my seat the second I saw his face.

He was cute - Yeah, maybe because of the yellow light from the lamp near us. Everybody looks cute under yellow light. He was buffed - or maybe it was just the illusion caused by well formed fat under his tight shirt.I was being to critical of his looks but nonetheless I ogled at him, hoping it will ease the pain of waiting.


A few more bottles were emptied and staring at him wasn't enough for me. I got curious and asked his friends if he was straight. I wondered if it could be worth hitting on him. At least I would have had something more to do that night.

They said he was straight. I replied, "Not until verified."

+++++++++++++++++++++++++++++++++++++++++++++++

The drops shortly turned to a barrage of cold pellets targeted at me. I held my phone close to my chest hoping it will not get wet as I walked unprotected through the torrential downpour. The voices of my Sarah's friends were drowned by the rain as I faded away in a curtain of water.