Interview Questions Headline Animator

Friday, January 25, 2008

Do it Smart: SVCUTIL Error

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.

Wednesday, January 23, 2008

Do it Smart: Switch between Windows (Vista Ultimate)

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... :)

Thursday, January 10, 2008

Configuring ASP.Net 3.5 applications for IIS 7 on Vista

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

Thursday, January 03, 2008

Software Quality Metrics

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".

The architect shall be thy savior...!!!

“When we are outsourcing software projects to India, we are not looking at cheaper rates. We are looking at credibility.” And that’s a truth. Credibility in delivery, quality and scalability. Its credibility that really makes software more economical. I have been working in the consulting business for over 3 years now and what I have noticed is there is a bit of lack of credibility in the consulting business these days... in fact the business module is changing in such a way that businesses don’t want to deliver quality products. Of course this is not what they are ever going to admit, but that’s how it works.

“I don’t want to write code to test my code”. Most of the outsourced projects are based on the fixed bid system and the only way to maintain margins is to deliver as early as possible. This means the estimates are extremely tight. Simple best practices like writing automated test cases, re-factoring, etc are ignored and the quality of the deliverables suffers. The margins are kept and then later on when the client has issues with the product, a new maintenance project is initiated.

“There is money in the maintenance business”. I was talking to a colleague who happens to be a middle management guy and he insinuated towards saying that delivering below average quality product was intentional or else the company loses on maintenance. He was talking to me saying we don’t really require technical architects and technology people much in the consulting business for this very reason. I had a pretty long debate with him regarding this.

“The consulting business needs spectacles”. It is simple. We are no longer the only country that provides outsourcing and consulting services to the “Big Client” viz. USA. China is coming up as a big threat with its large developer population. Once they bridge the communication and the language barrier, they would be a major threat. Not only the Asia Pacific region, Germany and Russia and some other European nations are also coming up really fast as outsourcing service providers. If we want to compete with them and maintain a respectable stature in the consulting business we will have to give the clients credibility. Not just in delivery but in quality, availability and scalability of our products. There is more money in the maintenance projects. But wouldn’t it be a very short sighted view of the world? The clients that outsource projects to countries like India can see what’s happening. If it is lucrative for us, it is not so lucrative for them and eventually they are going to go for countries that deliver credible products.

“I hate the code editor; I love Office Outlook and Office Excel”. Besides that I met a guy at my gym and he told me that he is working for one of the biggest consulting companies in India (Name withheld) today, has 2 years of experience and wants to move into management. He says he is already quite done with programming and doesn’t want to go into the technical arena. Majority of the developers want to move into management as quickly as possible and nobody really wants to work on technology or on the architecture side. Because there is more money in management.

“An architect? But we are into software construction not building construction…!” The consulting business today needs to take roles like technical architect and technology specialists more seriously. These are the people who can foster best practices, provide quality technology solutions and save the industry from going down into the depths of hell.

Puzzle...

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.