Monday, July 10, 2006

To free disk space

  • Empty Recycle Bin
  • Delete unwanted folders
  • Remove files from the following folders
  1. "%SystemDrive%\Documents and Settings\\Local Settings\Temp"
  2. "%SystemRoot%\Temp"
  3. Log and tmp files in "%SystemRoot%"
  • Remove temporary internet files
  1. In IE, Tools -> Options -> Delete Files
  2. In Mozilla, Tools -> Clear Private Data
  • Remove unwanted software
  1. Delete their folders from "Program Files"
  • Delete Service pack and hotfix backups (Do this step with caution)
  1. The patch uninstall data is stored in hidden folders under the main Windows folder. If you click on "Tools" -> "Folder Options" and select the "View" tab, you can click on the radio button next to "Show hidden files and folders". Each patch has its own uninstall folder
  2. To delete the service pack, follow the instructions in the following KB article -
  3. To delete the patches, follow the instructions in the above KB article using folder name as the $NTUninstallKBxxxxxx$ and the corresponding registry entry as KBxxxxxx
  4. Delete the folders in the $hif_mig$ (or something similar) folder
  • Reduce page file size
  1. Right click "My Computer"
  2. Select the "Advanced" Tab
  3. Click on "Settings"button in the "Performance" section
  4. Click on the "Change" button in the "Virtual memory" section
  5. For machines that have multiple drives, move the page file to another drive by setting to "No paging file"
  6. Reduce the initial and maximum page file size, if possible
  • Compress unused folders (available on NTFS volumes - This reduces performance)
  1. Right click on required folder and select Properties
  2. Click on the "Advanced" button
  3. Check the option "Compress contents to save disk space"
  4. When prompted, select "Apply changes to folder, subfolders and files"
  5. If required, do this for the entire drive if a lot of space is required
  6. For non-NTFS folders, use Winzip or WinRAR for the same and do this manually
  • Remove unwanted profiles
  1. For Windows 2003 and XP
  2. Right click "My Computer"
  3. Select the "Advanced" Tab
  4. Click on "Settings"button in the "User Profiles" section and delete all the profiles except your own (or the required ones)
  • For users of MS Office
  1. Delete the MSOCache directory
  2. This is used by Office for "Install on First Use". If this is deleted, "Install on First Use" will require the Office install CD

Improve Windows performance

  1. Ensure that there is enough free space (around 10%) on the boot drive (usually C:)
  2. Defragment the hard disk at frequent intervals (weekly basis)
  3. Set Processor and virtual memory settings
  • For Windows 2003 and XP
  • Right click "My Computer"
  • Select the "Advanced" Tab
  • Click on "Settings"button in the "Performance" section
  • On the "Visual Effects" tab, ensure that the "Adjust for Best performance" is selected
  • On the "Advanced" tab, ensure that both the options are set to "Programs"
  • Click on the "Change" button in the "Virtual memory" section
  • For machines that have multiple drives, Set the %SystemDrive% drive (usually C:) to "No paging file" and Set the Paging file to a different disk from the %SystemDrive% drive. Keep the initial and maximum size to the recommended size
  1. Remove all "Server Roles" unless specifically required (Windows 2003) using "Control Panel -> Administrative Tools -> Configure Your Server"
  2. Stop unnecessary services and either set to Manual or Disable using "Control Panel -> Administrative Tools -> Services"

Saturday, March 25, 2006

Developers say the darnedest things

One of my colleagues sent me the following asking for help:
i mean after creating indexing we have create content source so in which we have to give this content indexes. so it will give index to this content sources but it is not give indexes to that content source

Friday, February 03, 2006

A tip on using VPCs

It would be a good practice for those working on VPCs to share all the drives of the host machine (done via VM additions). This will allow everyone to save their files on the host operating system and be protected from VPC crashes.

Unfortunately for VS.NET users, this will invoke a network drive security exception on the VPC machine because the code is being executed on a network location. To avoid that, follow the information in the article below.
Giving a Mapped Drive .NET FullTrust

I have used a more restrictive variant of the command line:
c:\>caspol -q -machine -addgroup 1 -url “file://y:/my documents/visual studio projects/*” FullTrust -name "AGT-214 Visual Studio Projects"

Friday, November 11, 2005

A very nice set of articles that talks about testing of Whidbey. Excellent read. Enjoy!!!!

Testing ASP.NET 2.0 and Visual Web Developer
Several people have asked for additional testing details after my recent Whidbey Update post where I talked a little about how we are building ASP.NET 2.0 and Visual Web Developer. Some specific questions I’ve been asked include: How do you build and track 105,000 test cases and 505,000 test scenarios? How big is the test team in relation to the dev team? What tools do we use to write and run them? What is the process used to manage all of this? Etc, Etc. Hopefully the below post provide some answers.

Sample documents (Read article first)
Sample Test Plan:
Sample Automated Test Case:

Tracking Bugs
“Can you clarify - how issues are assigned to developers? Does a tester assign issues directly to members of development team, or they assign them to PM who will assign those issues to team members? Or issues are automatically distributed between development groups based on member's workload? What kind of software do you use for issue tracking?”

What Great .NET Developers Ought To Know

Test your expertise in .NET with this questionnaire. This is used internally in MS for interviews.

Tim Heuer, inspired by “What Great .NET Developers Ought to Know”, came up with his own SharePoint version:
what a good sharepoint subject matter expert ought to know...

Monday, November 07, 2005

Cyclomatic Code Complexity Analysis for Microsoft .NET Applications

Please find more information regarding the Cyclomatic Code Complexity Analysis for source code for .NET and VS 2005

Cyclomatic Code Complexity Analysis for Microsoft .NET Applications

CA1502: Avoid Excessive complexity - Code analysis rule in VS2005

The inner works of code coverage instrumentation in VS Team System

Cyclomatic code complexity analysis is supported in FxCop that is integrated with VS 2005 (not in the standalone free tool). The rule reports a violation when the cyclomatic complexity is greater than 25 (which cannot be changed) which sucks

Tuesday, August 30, 2005

Applications for Windows SharePoint Services

Learn about 35 odd new applications that can help address customers'business needs, identify new opportunities, and improve the return oninvestment for portals solutions. These application templates are tailored to address the needs and requirements for specific business processes fororganizations of any size.

Check out the following link:

Monday, May 16, 2005

The Story of Mel

This was posted to Usenet by its author, Ed Nather (utastro!nather), on May 21, 1983.

A recent article devoted to the macho side of programming made the bald and unvarnished statement:

    Real Programmers write in FORTRAN.

Maybe they do now,
in this decadent era of
Lite beer, hand calculators, and ``user-friendly'' software
but back in the Good Old Days,
when the term ``software'' sounded funny
and Real Computers were made out of drums and vacuum tubes,
Real Programmers wrote in machine code.
Not FORTRAN.  Not RATFOR.  Not, even, assembly language.
Machine Code.
Raw, unadorned, inscrutable hexadecimal numbers.

Lest a whole new generation of programmers
grow up in ignorance of this glorious past,
I feel duty-bound to describe,
as best I can through the generation gap,
how a Real Programmer wrote code.
I'll call him Mel,
because that was his name.

I first met Mel when I went to work for Royal McBee Computer Corp.,
a now-defunct subsidiary of the typewriter company.
The firm manufactured the LGP-30,
a small, cheap (by the standards of the day)
drum-memory computer,
and had just started to manufacture
the RPC-4000, a much-improved,
bigger, better, faster --- drum-memory computer.
Cores cost too much,
and weren't here to stay, anyway.
(That's why you haven't heard of the company,
or the computer.)

I had been hired to write a FORTRAN compiler
for this new marvel and Mel was my guide to its wonders.
Mel didn't approve of compilers.

``If a program can't rewrite its own code'',
he asked, ``what good is it?''

Mel had written,
in hexadecimal,
the most popular computer program the company owned.
It ran on the LGP-30
and played blackjack with potential customers
at computer shows.
Its effect was always dramatic.
The LGP-30 booth was packed at every show,
and the IBM salesmen stood around
talking to each other.
Whether or not this actually sold computers
was a question we never discussed.

Mel's job was to re-write
the blackjack program for the RPC-4000.
(Port?  What does that mean?)
The new computer had a one-plus-one
addressing scheme,
in which each machine instruction,
in addition to the operation code
and the address of the needed operand,
had a second address that indicated where, on the revolving drum,
the next instruction was located.

In modern parlance,
every single instruction was followed by a GO TO!
Put that in Pascal's pipe and smoke it.

Mel loved the RPC-4000
because he could optimize his code:
that is, locate instructions on the drum
so that just as one finished its job,
the next would be just arriving at the ``read head''
and available for immediate execution.
There was a program to do that job,
an ``optimizing assembler'',
but Mel refused to use it.

``You never know where it's going to put things'',
he explained, ``so you'd have to use separate constants''.

It was a long time before I understood that remark.
Since Mel knew the numerical value
of every operation code,
and assigned his own drum addresses,
every instruction he wrote could also be considered
a numerical constant.
He could pick up an earlier ``add'' instruction, say,
and multiply by it,
if it had the right numeric value.
His code was not easy for someone else to modify.

I compared Mel's hand-optimized programs
with the same code massaged by the optimizing assembler program,
and Mel's always ran faster.
That was because the ``top-down'' method of program design
hadn't been invented yet,
and Mel wouldn't have used it anyway.
He wrote the innermost parts of his program loops first,
so they would get first choice
of the optimum address locations on the drum.
The optimizing assembler wasn't smart enough to do it that way.

Mel never wrote time-delay loops, either,
even when the balky Flexowriter
required a delay between output characters to work right.
He just located instructions on the drum
so each successive one was just past the read head
when it was needed;
the drum had to execute another complete revolution
to find the next instruction.
He coined an unforgettable term for this procedure.
Although ``optimum'' is an absolute term,
like ``unique'', it became common verbal practice
to make it relative:
``not quite optimum'' or ``less optimum''
or ``not very optimum''.
Mel called the maximum time-delay locations
the ``most pessimum''.

After he finished the blackjack program
and got it to run
(``Even the initializer is optimized'',
he said proudly),
he got a Change Request from the sales department.
The program used an elegant (optimized)
random number generator
to shuffle the ``cards'' and deal from the ``deck'',
and some of the salesmen felt it was too fair,
since sometimes the customers lost.
They wanted Mel to modify the program
so, at the setting of a sense switch on the console,
they could change the odds and let the customer win.

Mel balked.
He felt this was patently dishonest,
which it was,
and that it impinged on his personal integrity as a programmer,
which it did,
so he refused to do it.
The Head Salesman talked to Mel,
as did the Big Boss and, at the boss's urging,
a few Fellow Programmers.
Mel finally gave in and wrote the code,
but he got the test backwards,
and, when the sense switch was turned on,
the program would cheat, winning every time.
Mel was delighted with this,
claiming his subconscious was uncontrollably ethical,
and adamantly refused to fix it.

After Mel had left the company for greener pa$ture$,
the Big Boss asked me to look at the code
and see if I could find the test and reverse it.
Somewhat reluctantly, I agreed to look.
Tracking Mel's code was a real adventure.

I have often felt that programming is an art form,
whose real value can only be appreciated
by another versed in the same arcane art;
there are lovely gems and brilliant coups
hidden from human view and admiration, sometimes forever,
by the very nature of the process.
You can learn a lot about an individual
just by reading through his code,
even in hexadecimal.
Mel was, I think, an unsung genius.

Perhaps my greatest shock came
when I found an innocent loop that had no test in it.
No test.  None.
Common sense said it had to be a closed loop,
where the program would circle, forever, endlessly.
Program control passed right through it, however,
and safely out the other side.
It took me two weeks to figure it out.

The RPC-4000 computer had a really modern facility
called an index register.
It allowed the programmer to write a program loop
that used an indexed instruction inside;
each time through,
the number in the index register
was added to the address of that instruction,
so it would refer
to the next datum in a series.
He had only to increment the index register
each time through.
Mel never used it.

Instead, he would pull the instruction into a machine register,
add one to its address,
and store it back.
He would then execute the modified instruction
right from the register.
The loop was written so this additional execution time
was taken into account ---
just as this instruction finished,
the next one was right under the drum's read head,
ready to go.
But the loop had no test in it.

The vital clue came when I noticed
the index register bit,
the bit that lay between the address
and the operation code in the instruction word,
was turned on ---
yet Mel never used the index register,
leaving it zero all the time.
When the light went on it nearly blinded me.

He had located the data he was working on
near the top of memory ---
the largest locations the instructions could address ---
so, after the last datum was handled,
incrementing the instruction address
would make it overflow.
The carry would add one to the
operation code, changing it to the next one in the instruction set:
a jump instruction.
Sure enough, the next program instruction was
in address location zero,
and the program went happily on its way.

I haven't kept in touch with Mel,
so I don't know if he ever gave in to the flood of
change that has washed over programming techniques
since those long-gone days.
I like to think he didn't.
In any event,
I was impressed enough that I quit looking for the
offending test,
telling the Big Boss I couldn't find it.
He didn't seem surprised.

When I left the company,
the blackjack program would still cheat
if you turned on the right sense switch,
and I think that's how it should be.
I didn't feel comfortable
hacking up the code of a Real Programmer.

This is one of hackerdom's great heroic epics, free verse or no. In a few spare images it captures more about the esthetics and psychology of hacking than all the
scholarly volumes on the subject put together. For an opposing point of view, see the entry for Real Programmer.

[1992 postscript -- the author writes: "The original submission to the net was not in free verse, nor any approximation to it -- it was straight prose style, in non-justified paragraphs. In bouncing around the net it apparently got modified into the `free verse' form now popular. In other words, it got hacked on the net. That
seems appropriate, somehow." The author adds that he likes the `free-verse' version better...]

[1999 update: Mel's last name is now known. The manual for the LGP-30 refers to "Mel Kaye of Royal McBee who did the bulk of the programming [...] of the ACT 1 system".]

It is by caffeine alone that I set my mind in motion,
it is by the cans of cola that thoughts acquire speed,
the hands acquire shaking,
the shaking becomes a warning,
it is by caffeine alone I set my mind in motion. -