Latest articles under Programming category

Adding script name on SQL queries

Have you ever done SHOW FULL PROCESSLIST on MySQL and found that there are some queries that has been running for a long time? Then you tried to find out from where the query was initiated so that you can debug those script only to find out that there are many similar queries from different [...]

Posted on February 10th, 2009 under General SQL, PHP  •  1 Comment

Keep replication in mind when writing SQL code.

This is something I got "bitten" once, especially if you have a development server with its own database not replicated and production database is replicated. That slight difference is enough to cause production problems that may not be noticeable days after production release. As a wise man say:
When programming SQL statements, be mindful of replication.
Well, [...]

Posted on February 8th, 2009 under General SQL, Quick Tips  •  No Comments

Customizing grep tool to exclude svn.

I mostly do programming by SSH-ing to development server. The code I’m working on are often managed by using SVN. There are many occasions when I need to search all source code to find a particular string. If you’ve worked on a source code that’s managed by SVN before, you’ll pretty soon notice that there [...]

Posted on February 4th, 2009 under General Unix, Quick Tips  •  No Comments

Analyzing data in Unix using PHP CLI.

There are times when I need to quickly gather some quick data in a simple tab based or space based delimited file, most often log files. Also, the files that I work on are often huge, well according to my standard at least … about 1GB. The data that I need is often simple statistics [...]

Posted on February 4th, 2009 under General Unix, PHP  •  No Comments

Floyd-Warshal algorithm in PostgreSQL PL/pgSQL.

This article is an extension of my previous article This time, however, I will write the algorithm completely in PostgreSQL’s PL/pgSQL. For background information and to understand the premise of this post, please glance through my previous post.
Ok now that you’re familiar with what we’re working towards, here’s my assumption of your database structure:

You have [...]

Posted on January 24th, 2009 under General / Algorithm, PostgreSQL, Programming  •  No Comments

Page 3 of 4«1234»