Archive for October, 2007

Recharge your programming batteries – Tips

October 31st, 2007 15 comments

Many of us in the field of programming and development go through a phase where we completely blank out. Our minds don’t work, our logic seems to have lost its track and we are not able to make any progress with projects. If this has happened to you and continues to happen to you… then you are not alone.

A lot of programmers and developers go through this phase on a continuous basis. I go through it at times. You could blame it on the module, your stress levels, family & personal issues, etc. But, no matter what; we still need to deliver projects on time. Clients are least interested to know what your personal problems are. They want their deliveries on time. Wouldn’t you?

Read more…

Categories: Programming Tags:

PHP5 Tutorial on Arrays

October 31st, 2007 7 comments

This PHP5 tutorial discusses about PHP arrays.

What is an array?
Generally speaking an array is continuous allocation of memory of similar data types.

This means that you can define a single array variable which can hold multiple values at the same time. These multiple values are retrieved using an index number. Don’t worry if you did not get this… more explanation ahead.

The same definition mentioned above is also applicable for PHP as well, with an exception that it can store data of different data types in one array.

Memory representation of an array


In the above diagram, you can see that variable $a has been allocated 5 slots of memory in which data can be stored. Each of these slots / boxes are referred using an index number that starts from 0. A common mistake for people learning arrays is to consider the starting position of an array as 1.

Read more…

Categories: PHP, PHP Tutorials Tags:

Tips to get article ideas for your blog

October 27th, 2007 Comments off

If you wish to start a blog or already have a blog and have this issue that you keep running out of ideas, I recommend that you consider the tips mentioned below to help you generate ideas for your blog posts.

1. Discuss issues with other people
When you discuss issues in your area of specialization, you get to know problems faced by other people. The moment a discussion starts; you should make mental notes. Once out of that discussion; jot the notes on text editor or a piece of paper. Using these notes you can create a new blog post based on the problems/issues discussed.

2. Research on a common pain point
Identify a pain point in your field of specialization. There could be many such pain points or problems for which people need help or solutions. To give you an example, I belong to the technical field and the pain points that I have identified are code optimization, query optimization, response times, server loads, etc.. So, identify such pain points in your field of specialization as well. Give it a thought or use Google to research. A good source is to visit forums where problems are discussed.

3. Publish solutions to problems that you faced
Build blog post ideas on the basis of the problems that you face in your day to day professional or personal life. I see no harm in publishing solutions to the problems that you dealt with. Creating a post on the basis of your solutions also serves as a repository that you could refer to later when faced with a similar problem. Beware, that you don’t expose information that is a trade secret of your company.

4. Publish analysis on news articles
Analyze news articles in general or in the area of your specialization. Don’t just copy paste articles on your site. This won’t do good to you. Analyze the article and post your understanding, concerns and reviews. A lot of blog authors publish blog articles based on their analysis of news article published on news site.

Please leave behind a comment below if you have more blog post ideas that you wish to share or disagree with some.

Getting a proper web hosting package with your required domain names is little difficult task. You will find a lot of dedicated server hosting companies offer web site design cheap domain names. You need to select the reasonable one.

Categories: Blogs, General, Research Tags:

PHP5 OOPS Tutorial __get() and __set()

October 26th, 2007 2 comments

This article talks about the use of __get() (double underscore – get()) and __set() (double underscore – set()) PHP5 OOPS magic methods.

By default PHP is a Loosely typed language and therefore it is not necessary to declare variables before using them. This also holds true for using class members. Look at an example below.

Read more…

Why should every programmer upgrade knowledge

October 26th, 2007 3 comments

In this age of competition and business flourishing, gone are those days when employers would look at someone specialized to execute projects. Though this still holds true for Architect level positions, but; employers expect a little more from programmers and software engineers.

Today knowing an array of technologies help you get a job of your choice and also helps you to negotiate a better pay package. The reason why employers prefer multi-talented employees is because not all projects is to be developed using a particular technology or language. Further, many software installations are the outcome of successful integration of various sub-systems written in different technologies.

So the question is how do you keep adding to your knowledge? How do you learn so many things and retain information? Where do you meet people to share information with you?

Read more…

Categories: General Tags:

Is it 12 or 13?

October 26th, 2007 Comments off

An interesting play with graphics. Check it out.





Categories: Humor Tags:

PHP5 Tutorial – Magic Methods – __toString() method

October 25th, 2007 2 comments

PHP5 provides a magic method by the name of __toString() (double underscore followed by toString()) which is useful for debugging purposes.

The __toString() method is automatically called when an object in PHP5 is converted into a string for the purpose of display or concatenation.

Read more…

5 practical tips to secure your web applications

October 25th, 2007 2 comments

security.jpgKeep these practical tips in mind when developing code for your web applications. Examples shown are written in PHP and can be implemented in any language.

  1. Prevent SQL Injection attacks
  2. Provide additional security with backend validations
  3. Validate Combo Box and List Box data
  4. Convert HTML code into its entity form
  5. Capture errors and show custom error page

Read more…

Categories: PHP, Research, Security Tags:

How to swap 2 variables without temp variable

October 23rd, 2007 5 comments

Swapping 2 variables requires a third temp variable, this is how it is implemented with 3 variables (I have implemented this in PHP, the same logic can be used in any language):


$a = 5;
$b = 7;
$temp = $a;
$a = $b;
$b = $temp;

echo “$a : $b”;


Read more…

Categories: Programming Tags:

Difference between MySQL delete and truncate table

October 23rd, 2007 5 comments

Both remove records from the table, so what is the difference. Very simple, read along.

For this article, I will use a ‘friends’ table.

delete from friends;


truncate table friends;

Read more…

Categories: MySQL Tags: