Latest articles under Programming category

Comparing 2 dates in PHP – A better way

If you Google around for php compare 2 dates, (at the time of this writing) typically they suggest for you to convert the date string into some integer using mktime() or strtotime(). Both the functions returns you Unix timestamp.
Understanding Unix Timestamp
In my other article, I mentioned that one of the golden rule of programming is [...]

Posted on July 11th, 2009 under PHP  •  4 Comments

Remote debugging PHP using Xdebug on MAMP

A development tools such as Microsoft Visual Studio has debugging feature built-in where you can step through the code line by line and watch the variables. There are times when you may want to do the same thing with PHP script running in a remote (or it could be local as well) web server. It [...]

Posted on May 21st, 2009 under MacOS X, PHP  •  1 Comment

Adding new lines to beginning of files.

I needed to do this when I want to debug my scripts for memory usage. My problem at that time was that as I include libraries, for some reasons PHP uses more memory even though I haven’t run a single code (other than require_once).
So my idea is to add memory_get_usage() function call on the beginning [...]

Posted on May 5th, 2009 under General Unix, Quick Tips  •  No Comments

Introduction to merging with SVN

One of the “problem” in using SVN with branches is that you have to figure out which revisions to apply. In most cases, one could not simply take the HEAD version and simply merge that to a branch or TRUNK.
On this page, I’ll attempt to explain why we can’t simply merge the HEAD version. On [...]

Posted on April 3rd, 2009 under General / Algorithm  •  2 Comments

Using PHP Variable Variable.

I’ve known the concept of PHP’s variable-variable from when I start working with PHP years ago. I thought it’s a neat feature that I’m not sure what, if any, it is useful for. Just recently, I found that it’s actually useful for me while generating XML using SimpleXML. If you’ve never heard about variable-variable, then [...]

Posted on March 27th, 2009 under PHP  •  No Comments

Page 2 of 4«1234»