PHP: Single Sign On (SSO) Module for KohanaMar 29, 2012

Single Sign On (SSO) is a session/user authentication process that allows a user to access multiple domains with a single username and password. To implement such a system is not easy as we all know that we can not share session information across different domains because of security restrictions. In PHP fortunately there is a very good and simple implementation of sharing session information across multiple domain

How to implement donut caching in PHPAug 5, 2011

High-traffic sites can often benefit from caching of pages, to save processing of the same data over and over again. There are various ways of implementing a cache, the easiest to implement is to use Output buffer (basically if you call ob_start() at the start of your program, it suppresses all output until you specifically flush the output buffer, therefore you can easily get the output of any PHP script, write it to a static (html) file and serve this static file to all upcoming requests for a specified amount of time).

Output buffer works very well for pages which do not change very frequently, but suppose on your website you have to show logged in user's name (somewhere in website header), everything else will be same for all users. In this situation you cannot use Output buffer because you have to check dynamically weather a user is logged in or not. So how do we use cache in this situation? Answer is "Donut caching".

Upgrade PHP From 5.1.6 to latest on CentOS 5.6Jun 10, 2011

Default PHP version on CentOS 5.6 is 5.1.6, in order to use any functionality avaiable above 5.1.6 (such as Nowdoc strings etc.) you must have to upgrade PHP. In the following article I will explain how easily we can upgrade PHP (to latest version) on CentOS. In this post I will use yum to upgrade PHP by using REMI (3rd party) repository.

How to Install Memcached on CentOS 5.6May 6, 2011

Memcached is a general-purpose distributed memory caching system that is used to speed up dynamic database-driven websites by caching data in RAM to reduce the number of times an external data source must be read. Memcached provide a giant hash table (which can be distributed across multiple machines), once table is full new inserts will purge old data in least recently used order.

MySQL – How SELECT statements should be optimizedFeb 25, 2011

Web applications do more read (SELECT) operations from database rather than write (INSERT/UPDATE/DELETE) operations. Usually record inserted only once and viewed millions of times, SELECT statements if not written correctly perform lookup in all table, although MySQL query optimizer analyzes all queries to check if any optimizations can be used to process the query more quickly, but it should be developers top priority to write their SELECT statements correctly and minimize the lookup operation. On heavy traffic websites even a fraction of a second matters, following should be considered for optimizing SELECT queries.

Boosting your productivity - Development tips and tricksFeb 23, 2011

As a developer, my main focus is always on concentrating my logic while coding and avoiding any hindrances or distractions that might cause the quality of coding to degrade. That said, there are always a few quick hacks/changes that I apply to my favorite IDE's when possible, which allow me save a quick few seconds and increase productivity while I write my code. In the following text, I will be describing those changes. While most of them may be applicable to your favorite IDE out there, some are only available in specific applications. The good thing is you can always get hands on an open source IDE or editor, and apply those changes yourself to get them working for you. Let's move on to the list of things that you can also apply to your working environment to increase your productivity.

Mac (Snow Leopard 10.6.2) installation on VirtualBoxJan 22, 2011

If you like working with Mac OS X and you don't have Mac hardware, no problem you can use Mac OS X on your personal PC no need to buy any additional hardware or software. First of all download all of the following prerequisites.

MySQL - If you think you know what is NULL? Think again!Jan 12, 2011

The concept of the NULL value is a common source of confusion among most of the developers. The NULL value can be surprising until you get used to it. Most of the developers think that NULL is the same thing as an empty string "" or 0 and they think that it is not possible to insert a 0 or an empty string into a column defined as NOT NULL. But this is not the case 0 and empty string are values, whereas NULL means "not having a value" or "a missing unknown value". Therefore it is possible to insert a 0 or empty string into a column defined as NOT NULL, as these are in fact NOT NULL.

Apache Configuration for better performanceJan 4, 2011

Configuring your Apache server correctly and getting most out of it can make a huge difference how your website works and impression it makes on its users. Especially on dynamic sites even fraction of a second matters. In this article let's have a look how we can measure and improve Apache server performance.

How to speed up your website (LAMP/WAMP)Dec 23, 2010

In this post I will discuss how to optimize and increase performance of a website.

By following standards, implementing best practices and using few tools and techniques we can significantly improve website performance. It is almost impossible to cover all in one post so let's create a list of tips and we will discuss one by one in detail (in future posts).

CSS: Rounded corner, gradient, drop shadow and opacityDec 22, 2010

As a web developer have you ever deal with a designer who is very fond of using rounded corners, drop shadows, gradients and opacity in his/her designs and made you pull your hairs, during my 2nd job I had experience to deal with such a designer.

Let's have a look how we can create rounded corners, gradient backgrounds, drop shadow box and opacity by following simple CSS techniques.

10 things I hate about Software EngineersDec 21, 2010

  1. Marrying them one must have to compromise with at least one Rival (their PC or laptop).
  2. They can live without everything except their PC, coffee and Google search.
  3. If you tell them about bug in their software they will first try to convince you that it's a feature.
  4. They don't like formal dressing. You will find them wearing jeans and t-shirt most of the time.
  5. They hate working on Saturdays.
Me Hi! My name is Zeeshan Muhammad Khan (nick name Shan) and I am a software engineer, database developer, web developer, programming geek, statistics geek, mathematics geek, system analyst and maintainer of this site. read more

Web Shelf