Friday, April 27, 2007

Recommended reading for developers

Another list from "Coding Horror" - programming and human factors by Jeff Atwood.

Blog here.

Reading list here.


Thursday, April 19, 2007

ASP : Deploying web site from Visual Studio 5

From the ASP solution,

File / Add / New Project / Setup and Deployment / Web Setup Project

Type in a name and enter "OK".

The entry will now be in "Solution Explorer". Right-click and select "Add / Project Output". Ensure "Content Files" is selected and click "OK".

Now we want to build it. Right-click again and select build. This will create the .msi file in the directory.


SOAP : Asynchronous web service

Had to implement an asynchronous web service which did not need to be real-time so no response was needed.

Had me a bit puzzled until I realised that a web service can return void!

i.e. in ASP:

public void webMethod(Some parameter)

compiles and runs no problem.

So what does it return?

The WSDL shows:

s:element name="webMethodResponse"
s:complexType /

So it actually returns null!


Wednesday, April 11, 2007

Windows : Getting a file list

Often need to put a list of files into a Word document or some such.

One way is to activate the command prompt (DOS box), navigate to the required directory and type:

dir /ON /B > dir.txt

The /ON option lists the files in alphabetic order. Further options are:

/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date/time (oldest first)
G Group directories first - Prefix to reverse order

The /B option uses a bare format (i.e. no heading information or summary).

The pipe option (>) sends the results to a file called dir.txt in the current directory.

From here, it can be cut & pasted into the Word document.

BTW, if you ever need to get information about a DOS command, type:

help "command"

e.g. help dir


Unix : sum

Often transfer large files around using FTP or whatever e.g. ear and war files and it's useful to see if they were transferred without error.

sum is a useful utility to use for this.

It calculates and prints a 16-bit checksum for the named file and the number of 512-byte blocks in the file.

sum abcd.ear
05612 25680