Sandip's Programming Zen

An attempt to share tech/coding experiences

Archive for January 2008

Registration Form Fields Popularity

leave a comment »

Recently I have found an interesting post on Get Elastic blog. It is a must read if you not just a registration form user but much more than that. It gives an insight on registration form field’s popularity and also offers some suggestion on what should and shouldn’t be done.

According to that “Password” field is most popular ((with 100% frequency)) registration field and Captcha field was least popular (with 1% frequency)

Advertisements

Written by Sandip

January 30, 2008 at 6:17 pm

Posted in E-Commerce

Tagged with ,

Batch file Backup Utility

leave a comment »

For long I have been using a simple batch file to keep backup of important content on my PC. It is a very simple & flexible solution and you don’t have to install anything. However, the batch file is using a command line compressing utility called FBZIP you can download it from here, which you have to keep along with batch file.

You can run the bath file manually or schedule it according to your backup strategy

Following is the code for batch file.

@echo off

:: variables

set backup_drive=D:\Backup

set backupcmd=xcopy /s /c /d:12-31-2007 /e /h /i /r /y

set Fbackupcmd=xcopy /s /c /e /h /i /r /y

 

echo ### Backing up Desktop contents…

%backupcmd% “C:\Documents and Settings\…\Desktop” “%backup_drive%\Desktop”

echo ### Backing up My Docs

%Fbackupcmd% “C:\Documents and Settings\…..\My Documents” “%backup_drive%\MyDocs”

echo ### Compressing Backup Folder…

fbzip.exe -a -p -r “%backup_drive%\Backup_%date:~-4,4%%date:~-7,2%%date:~0,2%.zip” “%backup_drive%”

echo Backup Complete!

@pause

In following line, date is used to check differences of target and destination folders only after specified date.
set backupcmd=xcopy /s /c /d:12-31-2007 /e /h /i /r /y

If you want to keep it simple then remove the date part (as follows), it will just check all differences regardless of date stamp.

set backupcmd=xcopy /s /c /d /e /h /i /r /y

Written by Sandip

January 30, 2008 at 10:22 am

Solution: Timeout expired – Connection Pool Error

with 8 comments

“Timeout expired. The timeout period elapsed prior to obtaining a
connection from the pool. This may have occurred because all pooled
connections were in use and max pool size was reached.”

How many times you have got above error? I have got it number of time but I was not troubled much as I did last time.

We have done following to resolve error (in sequence):

  1. Tried to check obvious code if we can find faulty code.
  2. Ran SQL profiler on Live scenario and gather as much data as possible
  3. Checked SQL server log for possible error messages.
  4. Checked Eventviewer for application error messages.
  5. Tried increasing connection pool value in web.config

None of above helped in our case at last we checked sql locks in syslocks table in master database which continuously holding lock on one of our primary tables. Some how lock was created and never removed during a simple update query, normally sql server creates lock on table when any insert/update/delete transaction is in progress.
We commented that update query and locking issue is gone and everything worked perfectly, no time out errors now.

As of now we don’t have any idea why a simple update query which was working normally, suddenly creating a permanent lock on a table, if I will find out with the help of my team will update here.

I suggest if you ever encounter this error try to follow the steps in the sequence I have mentioned above and narrow down the possibilities.

Update: If you want to set timeout property in DTS package than you can use timeout property shown in the screenshot below:

 

Written by Sandip

January 29, 2008 at 7:06 pm

VS 2008 Web Deployment Project Support Released

with 2 comments

ScottGu’s Blog just reported that they have released support for VS 2008 Web Development Projects.

Find more details on ScottGu’s Blog.

VS 2008 Web Deployment Project (WDP) is new version in line with VS 2005 WDP. If you are not aware about VS 2005 WDP then again refer ScottGu’s old post.

The new WDP is shipping with new features on top of existing features of VS 2005 WDP.

You can download it from here.

Written by Sandip

January 29, 2008 at 7:21 am

Posted in .Net

A free software everyday

leave a comment »

Few days back one of my friend Chetan told me about this website and after reviewing for few days I should refer this to readers.

GiveAwayofTheDay is the website which gives away a free software everyday (for non-commercial use of course). A commercial software is available for download free or charge for 24 hours otherwise have to be bought.

Currently softwares comes for download are small utility kind of tools but as popularity may grow in future who knows bigger commerical apps can also be downloaded freely someday! Till then keep looking you may find some useful tool for personal use.

Written by Sandip

January 26, 2008 at 5:27 pm

Posted in Softwares

.Net Videos

leave a comment »

I just found out a new website which offers .Net programming videos on various subjects ranging from beginning concepts to advance programming.

I find it useful to learn some concepts really fast.

Written by Sandip

January 26, 2008 at 4:43 am

Posted in .Net

Tagged with , ,

Test-Driven Development (TDD)

leave a comment »

This IEEE paper finds out during their research that test -first method of programming gives more productivity then any other method. They wrote that formalizing a piece of functionality as a test and code it in such a way that the test passes.

“We found that test-first students on average wrote more tests and, in turn, students who wrote more tests tended to be more productive. We also observed that the minimum quality increased linearly with the number of programmer tests, independent of the development strategy employed.”

Paper explains why TDD offers more productivity:

We believe that the observed productivity advantage of Test-First subjects is due to a number of synergistic effects:

  • Better task understanding. Writing a test before implementing the underlying functionality requires
    the programmer to express the functionality unambiguously.
  • Better task focus. Test-First advances one test case at a time. A single test case has a limited scope. Thus, the programmer is engaged in a decomposition process in which larger pieces of functionality are broken down to smaller, more manageable chunks. While developing the functionality for a single test, the cognitive load of the programmer is lower.
  • Faster learning. Less productive and coarser decomposition strategies are quickly abandoned in favor of more productive, finer ones.
  • Lower rework effort. Since the scope of a single test is limited, when the test fails, rework is easier. When rework immediately follows a short burst of testing and implementation activity, the problem context is still fresh in the programmer’s mind. With a high number of focused tests, when a test fails, the root cause is more easily pinpointed. In addition, more frequent regression testing shortens the feedback cycle. When new functionality interferes with old functionality, this situation is revealed faster. Small problems are detected before they become serious and costly.

Test-First also tends to increase the variation in productivity. This effect is attributed to the relative difficulty of the technique, which is supported by the subjects’ responses to the post-questionnaire and by the observation that higher skill subjects were able to achieve more significant productivity benefits.

To learn more read the full paper available in downloadable pdf.