Archive for January, 2008


Monday, January 14th, 2008

As a christmas present from work, I got an apple ipod touch! iTouch for short. It’s almost like an iphone, except it’s not a phone. I was super stoked for about 15-30 minutes, but afterwards, I realized that I would most likely never use it solely as a music player. The fragility and relative cost of it makes me hesitant to take it anywhere.

Although¬†the fact that it has wifi access and a mobi browser makes it nifty to have in case I really¬†have to surf the web out of nowhere, but besides that, I don’t know when I’d use it.

It’s still cool to have though, I just wish I could think of more uses for it and justify carrying it around with me everywhere.


Sunday, January 6th, 2008

Today, while reading some of my PHP books, I’ve came across a simple and clear definition for what a “factory” is and I decided to share it.

A factory is a class or method with the responsibility for generating objects.

I’m obviously not writing this post for those who are already well-versed in the ways of the coders, but for those who are trying to become well-versed, and are seeking clarification wherever they can find it. I hope you guys find this helpful.


Friday, January 4th, 2008

What are timeouts? Besides a form of punishment for misbehaving kids, time outs are a threshold for scripts. When you set a time out, you basically tell the script that if the execution time of the task exceeds a certain amount, do something; normally, error out. The utilization of time outs are important, especially if you’re connecting to another box for your script.

If the timeout is unlimited by default, when you connect to something that is currently down, or its location changed, that one component of your script might run on indefintely, and it is definitely something you don’t want. Therefore it is wise to put timeouts on any scripts that utilize connections whether it is ftp, mysql, or etc.

There are many ways to set time outs, just to name a few, for PHP, some of the time outs can be set via the php.ini file, the ini_set function, or the class/object’s built in timeout functions. Regardless of form, the utilization of timeouts can be a real headache saver.