Linked List implementation in PHP

Data structures are one of the core elements of computer science and they are also fun to program. But being a web developer the opportunity for implementing them in any application is quite rare. But then I thought, What the heck! I can just code for the joy of it, and it will also help me brush up on my DS skills. So here it is, a single linked list implementation in PHP for whoever may care. I will be posting other data structure and algorithm implementations here, so keeping watching. The code is given below.

Read More

Benchmarking PHP code

Code tuning is an essential part of programming. But most programmers would rather try to complete the project in hand then spend time optimizing a piece of code. A well tuned and optimized code block can speedup your application by an order of magnitude or even more.

Many people confuse profiling with benchmarking. A profiler is a analysis tool that lets you measure the performance of code at runtime. Profiling an application lets you find bottlenecks in your application code. You can find which part of your code is taking most of the time, you can than optimize that part of code. For example if there are 4 functions in your application, profiling may report the following distribution:

Read More

Adding HeatMaps to your website

ClickHeat is a wonderful PHP software that lets you add Heatmaps for your webpages. Heatmaps are visual representation of clicks on a HTML page, showing hot and cold click zones. It can be useful to see at a glance which webpage areas are getting the most clicks as this areas get redder in color while the areas receiving less clicks are white. The software has many options to tweak, and the heatmaps can be added on a per page basis.

A sample heatmap image is shown below. You can also use the clickheat class in your own PHP applications. The software doesn’t require any database, only GD graphics library must be enabled on the server, which in most cases already is.

You can view a heatmap for the index page for this site here. I’ve presently only added click log for the index page, so try clicking on the index page links to update the heatmap.

username : visitor
password: visitor

If you don’t see any changes in the heatmap, click on the “log my clicks” link in the right corner or try logging out and then logging in again.


Read More

Which is the most popular version of PHP today

The graphic below displays the market share of each PHP version as on march 2008. The blue graph represents the sum of all preceding versions.

PHP 5.2.5 now is the most popular version of PHP followed closely by PHP 4.4.8 and 4.4.7. This information can be helpful if you are planning on creating an Open source project or are thinking of moving past the version 4 mark in your professional career but are hesitant regarding the version 5 support on servers. (more…)

Read More

Microsoft Live Mesh. The exciting world ahead!

The basic principle: To make this multi-device world easier for users and developers.

Microsoft Live Mesh is a “software-plus-services” platform that enables PCs, mobiles and other devices to work with each other through the Internet, enabling individuals and organizations to manage, access, share and sync their files, data and applications seamlessly on the Web and across their world of devices. Live Mesh is a Software + Services platform rather then an application. (more…)

Read More

Item based collaborative filtering in PHP

Most people are familiar with recommendation systems on websites, wherein after you select an item you are presented with a list of similar items other people purchased . Amazon being the popular one and also one of the first to use it. Below is shown a snapshot from Amazon.

Collaborative filtering algorithms work by searching a large group of users or items and finding a smaller llist from it with tastes similar to yours. (more…)

Read More

6 books to master PHP

PHP is a wonderful dynamic language, and the addition of Unicode support, namespaces in the upcoming version 6 will make it even better.
If you are new to PHP or are thinking of moving to PHP form other language then the following list of books will provide you with the required knowledge to become a seasoned PHP programmer. Of course, the list is subjective and you may have a different list of books in mind. (more…)

Read More

Google Pagerank in PHP

Due to recent changes made by Google in its Page Rank processing the following library doesn’t work. However you can try to use the following api made available by

Mark Woodman has created a nifty class which lets you query Google pagerank info in PHP 5 and above. The complete classes are available here.

The minimum classes required are ‘cacher.class.php‘ and ‘google_pagerank.class.php‘.

Sample code is shown below. (more…)

Read More

Faceted browsing for Mozilla Thunderbird

MIT’s Simile project has a new addition to their open source tools, ‘Seek‘. Seek adds a faceted browsing feature for Thunderbird, which lets you search through email or RSS feeds easily.

A faceted classification scheme allows one to assign multiple classes to an object rather then a single predefined taxonomic class. Facets are more commonly used by web pages in navigation. Take an example of computer monitors. When you visit a website that sell monitors, you will usually see them classified by ‘Company’, ‘Screen size’, ‘Color’, Price’ etc. rather then a long list of monitors. All these are facets or dimensions of the product. One person may search by ‘Company’, another by ‘Price’. (more…)

Read More