January 2008 - Posts

Ok, this is a complete no brainer...

SVCUTIL Error: "'svcutil' is not recognized as an internal or external command, operable program or batch file."

This means you don't have svcutil in your environment variable path. So to run this you would have to give the entire path of where svcutil lies. Which would be "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\svcutil.exe". Alternatively, you need to concatenate the directory in which svcutil.exe lies in your Operating Environment Variable Path.

In Windows Vista, Open Windows Explorer (Windows + E), right click on "Computer" and go to "properties". Under "Computer Name, Domain and Workgroup Settings", click on "Change Settings", you will get a security warning, click "Continue".

You will see the System Properties Dialog. Go to "Advanced" Tab and click "Environment Variables" button at the bottom. Look for "Path" under "System Variables" list and click "Edit". at the end of the Variable Value, Concatenate ";C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\;". The ';' is the separator for variables.

Now open command prompt and type in svcutil and click enter. You would be able to see svcutil run. you don't have to give the entire path any more.

Now this is a smart looking feature... if you look at your quick launch tool bar on your Vista machine... You should see something called "Switch between windows"... We miss this most of the times...

Before you click on it, take a guess what's going to happen... and then click... I am sure you would be pleasantly surprised... :)

Ok, it is complicated... There are some issues. So I am logging everything that I can as I do it.

1st Error: "configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false". "

This issue can be resolved only if you have Administrative Access on your machine. Go to %windir%\system32\inetsrv\config\applicationHost.config Edit. if it says you do not have have permissions to open it, click start -> Inetmgr -> go to the directory in which you want to give permissions. Right Click -> Edit Permissions -> Security Tab -> Advanced Edit Users(<your userid>\Users) and give full access. I don't quite know how this works, but it did work for me. after that, Edit the applicationhost.config search for <section name="handlers" overrideModeDefault="Deny" /> and update it to <section name="handlers" overrideModeDefault="Allow" />

Save the document and that error will go away. The next error that I encountered is:

2nd Error: "The page you are requesting cannot be served because of the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognized, and is not allowed."

Now I am wondering, if IIS doesn't understand .aspx, there is something majorly wrong. First thing I do is go to control panel -> Uninstall a program -> Turn Windows Features on and off. I open the Internet Information Server branch -> World Wide Web Service Branch -> Application Development Features, this is what I see...

image

I change it into this:

image

That should take care of the handlers issue... now let's move on...

3rd Error: Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:

Line 45:             ASP.NET to identify an incoming user. 
Line 46:         -->
Line 47: 		<authentication mode="Windows"/>
Line 48: 		<!--
Line 49:             The <customErrors> section enables configuration 

Source File: D:\Projects\POC\MAD\web.config    Line: 47

So I go to to IIS Manager, right click on the application and convert to application. Do a quick F5 on my browser... and voila...!!! It works...!!!

image

 

Coding Horror: The Danger of Naïveté

Posted by Nilotpal Das | with no comments

I attended a session by one of our senior managers. He defines Software quality metrics as 2 things.

  1. Did we deliver what was required?
  2. Was it 0 defect software?

If the answer to both these questions is "Yes" then that according to him is a good quality software. Now that is a bare minimum required for every software company in the world. And that is what is expected as a bare minimum in Microsoft. But even if we achieve that much, it would be given good credit and would be a huge target achieved. For the simple reason that every software gets old. And it is not feasible to write new software every time we need an upgrade or new features. Even at Microsoft we face "Legacy Code" issues.

But that's not the point of discussion here. These two quality metrics cover a lot of other things; like the first point itself covers Performance, Usabilty, Capability, Reliability, Stability, Scalability. And the second point covers issues like the application performing the way a user wants it to. So it could be a soft bug, like not a bug according to specifications document, but the user just thought the application would behave in a different way. So technically this is a good definition about quality metrics.

But there are some other metrics which I think I should mention here. I am not trying to say that My Senior Manager has missed out on these points, Just elaborating on what he might not been able to say in the session, considering the time constraint or perhaps respecting the intelligence of all engineers present (assuming they already know). "Considering all the other factors to be constant", like the laws of economics (law of demand, supply, etc) More things need to be considered. Let me elaborate.

I divide software quality into 3 main constants

  1. Product Quality
  2. Process Quality
  3. Maintenance Quality

Product Quality: This basically covers what is mentioned above. But a couple of more things. Like how quickly can we change the software? Extend it, Expand its scope? If there is a lot of hard work and if the application is resilient to change, then that's perhaps a foul smell. I understand the "Legacy Code" constraint and other real world issues; and hence I mentioned, "considering all the other factors to be constant" meaning in a utopian scenario.

Process Quality: When I say process, I am basically talking about profitability. How can we write high quality code while we maintain profits? The process / system should be able to take up most of the production responsibilities. Not only there should be minimal redundant code, there should also be minimal redundant effort. Automation / Re-use / Smart tools are the key to building a good process. I am not talking about the Microsoft MSF, CMM, RUP or any such processes. I am just talking about a process that makes software development quick. Quicker delivery results in more profitability.

Maintenance Quality: How can we build software so that removing / replacing / adding a component / feature is not a nightmare? How can we improve maintainability? This is something that cannot be found in any functional or non functional requirement document. This again increases the profitability of the company and elaborating this would be an insult to the reader's intelligence.

Now the question is, all this is true in the utopian scenario, how can we get into the real world? Well we (Microsoft) are already doing an amazing job on that. We are evangelizing the Individual Contributor stream as much as possible, We need more architects. More people who can design, review code and really foster quality work.

The old adage holds true here in software engineering more than anywhere else. "Knowledge is Power".

Posted by Nilotpal Das | with no comments

One of my managers, who also happens to be a pretty smart guy, and I were having a discussion today. We were talking about various interesting subjects including Engineering subjects like Natural Language Processing (NLP) and AI. And he asked me, "How do we make a computer smart enough to be able to solve a puzzle?" Now the puzzle could be a mathematical puzzle, a logical puzzle or even a language puzzle. And just to give me an example he asked me a puzzle.

What is a 2 digit number, that, when multiplied with 9, gives a 3 digit number. Now the first digit of the 3 digit answer is the same as the first digit of the original 2 digit number and the last digit of the 3 digit answer is the same as the 2nd digit of the original 2 digit number and the 2nd digit of the 3 digit answer is 0.

so if XY * 9 = X0Y, what is X and Y?

Now the problems is quite simple and I could solve it in the time required by me to leave from my desk to my bike parked below. And that's like less than 2 minutes. The issue here is how did you approach this problem and how do you make a computer arrive to the best approach.

So this is a question to all readers. Please solve this problem and tell me how you solved it and what approach you took.

More Posts