Sunday, November 23, 2008

Buggy Softwares

In software's world , It is not always all softwares are written in a good ways , sometimes there are modules written in poor way and weak design , this is leading to cause many bugs , and those bugs never finish , I mean whenever you fix any bug , the application starts raising new bugs caused by your latest bug fixing and then you go and fix this new bug and the series will never finish and you will end up fixing bugs for the rest of your life .

Now if you had faced somthing like this before then you better take a decision from the begining by scraping the whole module and rebuilding new one with full undestanding about your needs , yes this might delay you some times in the begining but for sure this going to save very much of your time in future .

Saturday, November 22, 2008

Tip for SQL code reviewers

One of the primary tasks for any development lead or a tech lead is it to have a code review on written code by other developers , accepting code without reviewing it , may cause a serious problems specially in environment where heavy transactions are always happening.

There are many tips and ways to do this task , but let me focus here on one part only which is SQL stored procedures , the best practices here is to test the IO reads and writes , this can be performed by Below statement:

SET STATISTICS IO ON
Exec USP_YourStoredProcedure @param1

If you set the statistics to ON this will cause SQL Server to display information regarding the amount of disk activity generated by Transact-SQL statements.

the result of the above execution will give you number of reads and writes for the written SP , now the lower of above numbers you get is the best SP you have .

The following lists describes the output items

Table : Name of the table.
Scan count :Number of index or table scans performed.
logical reads : Number of pages read from the data cache.
physical reads : Number of pages read from disk.
read-ahead reads : Number of pages placed into the cache for the query.
lob logical reads :Number of text, ntext, image, or large value type (varchar(max), nvarchar(max), varbinary(max)) pages read from the data cache.
lob physical reads : Number of text, ntext, image or large value type pages read from disk.
lob read-ahead : reads Number of text, ntext, image or large value type pages placed into the cache for the query.

We should always focus on logical read as it is the main factor to identify any serious problem , now lets say that you have executed SP with 10,0000 logical reads , then it is for sure that you have to go and rewrite some logic in the SP or to assign a proper index on columns referred in the joins or where condition .

Tuesday, November 4, 2008

Is your software secure enough?

A Few days ago I started up my laptop , but my windows vista didn't allow me to login as normal because I didn't purchase the original copy of vista, I have been prompt by windows vista to enter the Licence key or to startup the windows with limited access ( only Internet explorer was open with black background ) and no desktop was appearing , so I selected the second option as I was not ready to enter the licence number , the moment I entered the IE , I did few simple steps and I had my windows vista run with fully desktop functions, it was a legal cracking to windows vista by exploiting a whole in IE .

These steps were :
1- type c: in IE address bar
2- search for windows folder
3- search and run the explorer.exe command

and you will have your desktop running , actually it might be a facility from microsoft to allow people to browse their desktops event if they dont have a valid serial number , but what if it is not ment by microsoft ?

Now if you are a software developer or a an architect you have to keep in mind that always there will be some one thirsty to find any whole in your system , and once he found this wholoe he will exploit it to get in to areas where you dont hem to be there .

Friday, October 24, 2008

Why do we blog ?

When I was about to start my own blog , I was wondering why do I need to blog while others are doing the same ?

The answer for this question for me is : few years ago in 2003 I have published an article in code project about converting dates between Hijri calendar and Gregorian calendar and when I posted this article I was not expecting this number of viewers and repliers from the community about it , I was feeling very happy whenever any one is telling me " thanks : your code has helped a lot " , this feeling is true actor which pushed me to start my own blog and share knowledge with the community .

This is about me , so what about you ?