Proper date checking for PHP

Some sites seem to perform a simple date check where they just check if “Day” is a number between 1 to 31, “Month” is a number between 1 to 12 and the “Year” is a valid number.

While this check is inexpensive, it is definitely wrong as you may end up with strange combinations such as “31st April 2010” or you may also wrongly allow “29th February” to occur on non-leap years.

To save yourself some grief, make sure you use the checkdate() function to validate your date data.

Don’t bring your “work face” home

In American sports, some coaches require their players to up their intensity level in important games and “bring their game face”. Likewise in work, you might also adopt a persona in order to make things work smoother in the office. Or you might also be affected by some events at work that dampens your spirits.

By the law of averages, it is inevitable that you will face some issues in work that will probably upset you and it might unwittingly manifest itself passively or aggressively even after you have left the office and gone home. Furthermore, the chances of getting upset may increase depending on the industry you are involved in and the people you have to answer to.

Regardless of whether you had to answer to an immature alpha-male user who has a superiority complex, a supervisor who everyone knows is incompetent but continually attempts to pull the wool over people’s eyes, or a boss who is being manipulated, etc. Just forget about it once you step out of the office. Ultimately family is most important — just ask yourself, who do you think will visit you on a regular basis should something unfortunate happen to you and you end up in a long term stay in the hospital? Your boss, colleagues, friends? I would say the odds are strongly in favour of “family”… I suppose this posting is too late for the “Eat with Family” day, but it is never too late to show appreciation for your loved ones!

Notebook Post-Mortem

It was sometime back that I went on a tirade against a company (sounds like “aged pee”) for their abysmal quality in notebooks and you might have wondered what I have done with the notebook since then.

Well, even though they acknowledged that there were critical engineering and quality issues with that line of notebooks, they were willing to let me trade it in for about 10% of its value so I could purchase another piece of junk that they pass off for a notebook. Once bitten, twice shy. Twice bitten, go and die.

Rather than throw good money after bad (which is what I told the person), I dismantled the entire notebook in a futile attempt to see if anything else other than the RAM and HDD could be salvaged.

Nearly Pickpocketed

This incident happened a few years back when I went on a holiday to Italy with Esh…

We were done with our shopping and we decided to take the Metro back to our hotel as we thought it will be cheap and safe since there were 4 of us travelling together. We were soon to be proven wrong.

The moment we stepped into the train, a group of gypsies immediately surrounded the 3 girls (Esh was with 2 other girls) and I tried to intervene but the gypsies kept getting in my way. They gypsies then all got off the train at the next station and we quickly took an inventory check. One of the girls (not Esh) lost her wallet, and Esh told me that in the confusion they nearly managed to unzip my waist pouch but she pulled their hands back in time!

Who needs villains when you have “heroes” like these?

The word “hero” often conjures up the image of someone in a spandex costume with a cape who swoops in to save the day. In the context of an IT project, it may be someone who is called in to assist or take over the reins due to resource restrictions or some other purpose.

All is well and good if the person turns out to be a real deal and is able to guide the project back even though “all the roads that lead us there are winding, and all the lights that light the way are blinding” (thanks to Oasis).

But of course, there are also self-proclaimed “heroes” who somehow manage to blunder their way to a project conclusion and then spare no effort in trumpeting their “achievements” while all the other members in the project team know that little credit (if any) was due to the person. To use a football analogy, sometimes Manchester United can be playing so well that you can even put your grandma in the first team and they’ll still win the match comfortably. Sufferers of such “heroes” should take comfort that luck, smoke and mirrors can only carry the “hero” so far. The truth will reveal itself sooner rather than later.

My first digicam

I went on a Europe tour during my Uni days and I specially went to buy a digital camera because the tour was expensive and I didn’t want my photos to be screwed up. Bought a FujiFilm FinePix 1440i (or something like that) and 2 16 MB SmartMedia cards that cost me more than $100. Each!

Those were the days that digicams were still unheard of and I was the only one in the tour group wielding one. Quite a few of them were puzzled when they saw me holding the camera away from my face to use the LCD screen instead of using the optical viewfinder.

What’s the alternative to a Table Mountain Tour?

While I was doing my National Service, I had the opportunity to go to South Africa. The exercise went smoothly and we headed for some R&R. One day, we had the choice of either going on a tour to Table Mountain (but we had to pay extra since it was not part of the programme) or explore around on our own.

Well, you wouldn’t believe it but I decided to pass up on the Table Mountain tour because I thought I wouldn’t be interested in seeing a mountain that was like a plateau. However, there was only so much exploring I could do on my own, so with a bunch of guys we decided to catch the latest “blockbuster” that was in the South African cinemas…

G.I. Jane…