Blogs

An Introduction to AJAX

Of all the buzzwords to enter the computer lexicon in the past couple of years, Ajax may be the “buzziest.” Ajax, which stands for Asynchronous JavaScript and XML (or not, depending upon whom you ask), changes the client/server relationship so that server interactions can take place without any apparent action on the part of the client. In truth, Ajax is just a label given to functionality that’s been present for years, but sometimes a good label helps, and when a powerhouse like Google uses Ajax (for Gmail, Google Suggest, and more), people pay attention.

Using Benchmark

As the name implies, this is a simple class for benchmarking code. Benchmarking, in case you’re not familiar, is the process of timing how long code blocks, entire scripts, or whole applications take to run. Doing so can be a useful tool for finding bottlenecks in your sites and improving performance.

I’ll say up front that the Benchmark class is nice and simple, but the documentation for it is lacking. There is simply no end-user documentation available.

Benchmarking is a good way to give you an understanding of execution tendencies:
is it generally better to do this or that? When it comes time to really fine-tune your applications, you should benchmark your exact code (i.e., what you’ve written versus alternative methods) on the server it will run on. Only then will you know for certain that you’ve got the best performance
possible.

Using COM with PHP

Added in PHP 4 is support for COM on Windows operating systems. COM, which
stands for Component Object Module, is a technology developed by Microsoft to control its applications via a programming language, notably Visual Basic. It is related to other Microsoft technologies such as OLE (Object Linking and Embedding) and ActiveX.

Microsoft has defined every function and attribute that an application—such as Word or Excel—has as an object with methods and properties. Using the proper notation, you can then control the application with Visual Basic or, in this case, PHP. You begin by creating a new object using the name of the application and PHP’s com() function.

$word = new COM(‘word.application’);

You can set the application to run either visibly on the computer or invisibly by setting the Visible value (this step is not required).

$word->Visible = 1; // Visible

Once the application is running, you begin by creating a new document.

Establishing a cron

A cron is a service on Unix servers that allows tasks to be scheduled and executed automatically. The cron application runs constantly and will, according to instructions, carry out its orders. These orders are stored in a file called crontab. This file is a to-do list that contains lines that might look like this:

30 22 * * * lynx --dump http://www.kiran.org.in > /dev/null

The crontab format dictates that each line contain six fields separated by spaces or tabs. The first five fields represent, in order, minutes, hours, days, months, and day of the week (from 0 to 6, with 0 being Sunday).
Notice that you can specify the day of operation as either a day of the month (1–31) or a day of the week (Sunday through Saturday), the latter being date-indifferent.

Tips on Web Page Caching

■ Note that caching is, in theory, a very good thing, designed to minimize unnecessary server requests. If properly controlled, caches are great for both the server and the client.

■ If you have cURL installed on your system, you can run this command to see a
page’s headers:
curl --head http://www.example.com/page.php

■ If your applications make use of sessions, you can adjust session caching with the session_cache_limit() function. See the manual for more information.

■ Page caching can also be affected using the META tags, placed within an HTML
document’s head. This may not work as reliably with some browsers as the
header() method.

■ Client/server performance can also be improved—for large scripts—using Zlib
output compression or the function ob_gzhandler() . See the PHP manual
for more on both.

Server-Side Caching

There is an alternative type of caching you can use to affect the client/server

Cumulus Tag Cloud

Kiran Says

I love work environment which is:

Informal yet professional
Demanding yet rewarding
Challenging yet inspiring
Mediocrity is not an option
Having fun is serious business
Making mistakes is human
Forgiveness is Company Policy

Travelling Sucks