In order to fix code many a times one needs to search for terms, function names, defect/case ID's etc in SQR/SQC/INC (henceforth referred to as SQR files) files.
TextPad allows one to search thorough folders containing files having certain terms (e.g a defect ID or a case number) which is suspected to be related to a bug. However this process is often very slow as TextPad needs to open each and every file one by one and parse through it.
If there was a way by which we could index all terms in SQR files and store them upfront the amount of time required to search problem areas in SQR's and fix them could be drastically reduced.
Fortunately there are two free tools one could use to index these files. The first is an open source tool called Lucene and the second is Microsoft's Indexing Service that comes by default with the Windows XP operating system.
Lucene though very powerful needs knowledge of Java to build an application which would fit our needs.
Microsoft Indexing Server on the other hand is simpler to configure. The service can be accessed through Control Panel --> Administrative Tools --> Computer Maintainence. All one needs to do is create a new Catalog and add the directories which have the SQR files. The indexing service keeps a track of any changes made to the files and updates the indexes automatically. However, one needs an IFilter implementation to read SQR files even though SQR files are as good as text files. There is one workaround though. Change the file extension from .SQR to .SQR.TXT.
If you want to search on the index, all one needs to do is query the catalog and presto you can search through all the code that resides in your SQR files. Only those files which have the term would show up in the search results.
To take it one step further one could write a program to use this index and highlight terms in the file.
Interfacing Java with Microsoft Excel has always been a pain for software engineers.
The Apache foundation came out wit POI a Java API To Access Microsoft Format Files but it had its own limitations and the learning curve was a bit steep.
While looking for other ready made libraries I came across "jexcel". Its a simple library which can do quite a bit for its size. Its very easy to use and can manipulate existing excel files having formatted information as well as create new files with custom information and formats based on pure coding or a template.
If your existing libraries or custom developed tool does not do its job or does not do its job well I highly recommend giving this a shot.
Also check out http://jexcelapi.sourceforge.net/ and http://www.andykhan.com/jexcelapi/tutorial.html for a quick tutorial on how to use it.
An web development requires a server configuration.
If the configuration also involves a database server it adds up to the complexity of getting one cofigured to work with your web server.
XAMPP to the rescue.
XAMPP supports MySql, PHP as well as Perl. Its similar to the Wamp Server but I personally had some problems with Wamp. XAMPP on the other hand was pretty simple and worked without any problems. I use it very often when I need to continue with my PHP development pet projects and carry it along in my thumb drive wherever I go.
Yes I know there are numerous articles and forums out there which talk about this.
Why am I writing about this again?
That's because there is still some doubt out there on how to get PHP to work with Lighty.
In this blog post I would be providing the configuration files as well for Lighty and PHP whcih is missing in all the forms and general discussions out there. This would help folks get started faster.
You can download the files here:- PHP.ini, lighttpd-inc.conf
The PHP version I am using is 5.2.6 and the Lighty version is 1.4.19-1 which I downloaded from WLMP project. The good thing is they have already complied LightTPD to work with windows.
The link to download LightTPD is http://en.wlmp-project.net/downloads.php.
The idea is to start PHP in fastCGI mode. That way you are opening a port that PHP listens to and whenever Lighty gets a PHP request it just forwards the same to be executed as a PHP script.
The important part of the Lighty configuration file is mod_fastcgi which exists in server.modules. Remove the hash(#) before mod_fastcgi in the config file.
The next important part is:-
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"host" => "127.0.0.1",
"port" => 1879,
"docroot" => "c:/LightTPD/htdocs/"
)
)
)
What's happening here is that I am asking Lighty to forward all php requests on to port 1879 on the host ip 127.0.0.1 which is a localhost ip. Also what's important is you mention the docroot location of where the php files would be located. (This part is important.)
Lets talk about the php.ini file for now.
Here are the important parts of the file:-
Force Redirect should be set to enabled for security reasons.
cgi.force_redirect = 1
Fix Path info should also be turned on as is spoken of in the Lighty documentation
cgi.fix_pathinfo=1
Once you have setup your configuration files what you need to do is make sure you do not have any other webservers running on port 81. The reason I use port 81 is because of IIS. IIS is very greedy when it comes to port 80 and does not allow one to change the listening port.
An easy way to find out if any severs are listening on port 81 is to run the command netstat -a and look for any entries for port 81. I am assuming that you have not yet started Lighty.
Once we have confirmed that nothing is listening on port 81 we can fire up Lighty and type in http://localhost:81. If you get a page telling you about Lighty and stuff you have completed the first hurdle of getting a basic http server running with the new configuration file.
Once again assuming you have completed the previous step type php-cgi.exe -b 127.0.0.1:1879 through the command line. Of course before running this command I am assuming that you have changed he path to the location where the php home directory resides. Also make sure that you have php-cgi.exe in the home directory. If you do not have it don't fret. Just download the zip version of the PHP installation and extract php-cgi to the folder.
Once you are done create a file having the function phpinfo() in a file ending with .php in the htdocs folder.
If everything has gone well you should see all the details of your php server on typing the name of the php file after the localhost url.
Hope this helps.