/* PHP & MySQL Journal */
Posted in: php, software, tip | ( 9 ) Comments
4 Nov 2009Posted in: data, mysql, testing | ( 2 ) Comments
3 Nov 2009One of the most time consuming steps in developing a database based application is test data generation. Imagine you have created a shopping cart application for your client, containing dozens of tables and hundreds of fields. Everything is ready for testing, but the problem is your database is empty. You at least require a modicum of test data in the database to proceed with the testing. You can choose to manually enter a small set of random data into the database, but you lose a couple of precious days in the process. What you require is a data generator that automatically generates test data for your database.
Posted in: puzzles | ( 6 ) Comments
28 Oct 2009Programming is about solving problems. To be precise, solving problems using a computing device. I love solving puzzles as do most programmers. Solving a challenging puzzle or a programming problem gives one a wonderful sense of satisfaction. Starting with this post I’ll be presenting a programming problem every week that will help readers take some time out from their routine work and have some additional fun working on challenging problems. Below is a small problem to kickstart the series:
Posted in: microsoft, testing, tools | ( 2 ) Comments
27 Oct 2009Microsoft Fiddler is a HTTP debugging proxy that lets you log all HTTP traffic between your computer and the internet. Fiddler lets you to inspect all HTTP traffic, set breakpoints, and “fiddle” with incoming or outgoing HTTP data. To run Fiddler you require a Windows machine with .NET 1.1 framework installed.
Posted in: php, tools, visualization | Add comment
14 Oct 2009nWire is a plugin for Eclipse that helps you understand the various components and their relationships in your application. Due to various complex PHP applications being developed – like Magento, Joomla and a wide variety of frameworks, developers finds it hard to understand the underlying architecture and relationships between various components within the application.
Posted in: tools | ( 3 ) Comments
6 Oct 2009E-mails are a pervasive element of most web applications. But many times testing and debugging emails can become a hassle when many of them are involved. Most of the time you just want to be sure that the email part of your application is working fine, without flooding your mail account with test mails.
Posted in: browser, pear | ( 3 ) Comments
3 Oct 2009Every time you use your browser to access a website a User-Agent header is sent to the respective server.
Detecting user agents on the server can be useful for many reasons.
1. Browsers Quirks – Despite the standardization in browsers, there will remain some quirks in various browsers that you will need to iron out on a regular basis.
2. Personalize Content – It may be required to deliver different type of content depending on the browser type (although it is usually not recommended); whether mobile or otherwise.
3. Illegal Access – Prevent bandwidth hogging bots and poorly programmed clients from downloading your content.
Posted in: general | Add comment
23 Sep 2009Hello readers! The blog now has been updated with a new color scheme. The new and the previous one are shown below for comparision. Not that everyone will like it as each has his own favorite color palette. Basically I wanted to give the blog something of a red or maroon finish, but after tinkering a while I decided to settle around earth tones.
Posted in: algorithms, php | ( 1 ) Comment
20 Sep 2009The following small code generates check digit for UPC-A codes. You can use it for example to generate random UPC-A codes.
The check digit is calculated as follows:
1. Add the digits in the odd-numbered positions together and multiply by three.
2. Add the digits in the even-numbered positions to the above result.
3. Find the result modulo 10 (i.e. the remainder when the result is divided by 10).
4. If the result is not zero, subtract the result from ten.
Posted in: data, pear, tools | Add comment
10 Sep 2009I frequently write php code to access various web services and the most common response data I encounter is in xml, which most of the time is not formatted. I use xmlPad to format and analyze xml documents, but many times I need to format xml documents on the production server wherein xmlPad is of no use. What one needs is a library that would allow you to beautify your untidy xml documents within your php code. XML_Beautifier provides that solution.