Interview Questions Headline Animator

Wednesday, December 17, 2008

It's all there in the cloud...!!

So what's this new buzz word... everyone has been talking about it...

Essentially what we are doing is taking our applications and putting them in a cloud. Cloud meaning highly available servers which are provided by huge service providers such as Microsoft, Amazon, etc. Now since I strongly believe that it is business that drives technology, it is the business side that we need to understand first. why do we need it. I have my servers in house, I deploy my apps on my servers, I control and maintain them then why would I want it to be on servers that others control? It is like the analogy that my valuables are in my house, how can it be a better idea to go and put them somewhere else. Well the answer to that question is another question. Do you put all your money under your mattress in your house? Or is it a better idea to go and put them in the bank?

There are many benefits in building the applications from the cloud. Let's take cost for example. The cost of hosting an application on the cloud is just a fraction of what you will have to incur in deploying the application on one of your in-house servers. Along with it comes the maintenance cost. Employing people to maintain the Servers, business continuity planning, and so on and so forth. The list goes on. The Cloud providers on the other hand can provide you all the same services at a fraction of the cost. They work on much much larger scales. So it makes sense for them too.

Another interesting perspective is that, let's say you are an application vendor. You go and talk to a customer to sell your app. Let's say you convince the customer in buying the app. That means you have convinced one person. The person who takes the decisions. Let's say he consults a team before he takes the decision. Even in that case you have convinced that team. And most usually, the people who make the decisions are not the people who end up using your app. And there is no way for them, yet, to find out whether or not the app is good enough for them in their context. So then you go ahead and deploy the app and then start using it. Then the users, find out how much the application was worth in their context and they may or may not like it. Although this is the model we have been working on all these years, it doesn't look like a very effective model does it?

Let's change the scenario. Same application vendor, but this time, he has his application as a software as a service, deployed on the cloud. He just has to go and say, "Well you don't have to guess, I don't have to convince you. Why don't you use the application yourself for a few days and find out?" The users use the app, they like it fine; if they don't, well they don't have to buy it. And of course there is the "pay as you go" model in Software as a service. Just stop paying when you stop using the software.

And the best part is you don't have to go fight it out with your IT for deployment. It's all there in the cloud...!!

Saturday, December 13, 2008

Hot fix for the Entity Framework Bug

I had recently posted about a bug on SQL CE Entity Framework. Please note that the links mentioned in there for the bug and the hot fix are internal to Microsoft. The hot fix shall be released as a KB article in a couple of weeks.

Wednesday, November 26, 2008

SQL Server Compact Edition / Entity Framework bug

I am working on this really smart, smart client application installer. Which smartly installs other pieces of another smart client application as and when required.

It makes sure that only those bits are downloaded that are not already installed. So it takes care of upgrades on its own. So basically we are writing our own "ClickOnce" functionality.
Why are we not using ClickOnce out of the box? Well that would require another post, but let's say we require much more granularity than what "ClickOnce" provides us, on this "Installation Manager", and put it at that.

Anyways, I am doing some book keeping using SQL Server CE on the client machine to maintain account of upgrades and installations. For this I am querying the SQL Server CE database and in the process and I encounter an error that says:

"The ntext and image data types cannot be used in WHERE, HAVING, GROUP BY, ON, or IN clauses, except when these data types are used with the LIKE or IS NULL predicates."

I am not even working on ntext data type. The select query goes something like this:

IQueryable files = entities.FileInfo.Where(fileInfo => fileInfo.FileName.Equals(fileName));

And "FileName" is not an ntext datatype in the entity "fileInfo". It is an nvarchar.
Interestingly, if you fire the same query on the Management Studio (SQL Version of the query of course), it works fine. It only breaks when you use LINQ to SQL or EF.

After a little research I find out that there is a bug in SQL Server 3.5 RTM which was incidentally not resolved even in the "SQL Server Compact 3.5 SP1 English". And later there was an out of the bag release that was made to resolve this issue. So the Hotfix, cannot be installed directly. You need to uninstall "Microsoft SQL Server Compact 3.5 SP1 English" from Add Remove Programs before you install this hotfix.

Once the Hotfix is installed, your query will just work...!

In case if you are wondering whether you need to re-install "Microsoft SQL Server Compact 3.5 SP1 English"? Well, installing it back will remove the hotfix. So DO NOT DO THAT.

Sunday, November 23, 2008

Best RSS Feed Reader

My wife is a writer, and a pretty good one for that matter. Recently she went for a job interview, where she was asked a lot of questions about current affairs, and she doesn't exactly read the news regularly. So I told her she should. But she doesn't like reading the news paper, and I told her about online news. About RSS Feeds and Feed Readers.

So which feed reader do you use. Of course every developer uses one. So what else does a developer use? Internet Explorer and Microsoft Outlook. Post Internet Explorer 7, you can subscribe to RSS Feeds using IE. you can read the posts online on IE. But the beautiful thing is every time you subscribe to a feed on IE, it nicely goes and adds itself on the RSS Feeds folder in Microsoft Outlook. This gives you the offline reading facility of course it also depends on what you are subscribing to. Some of the stuff is just not available offline. Like MSDN Magazine, which just has a one liner and a link to the actual article.

Speaking of which, MSDN Magazine is available online since January 2008. The MSDN Magazine is a fantastic read and is on top of my reading list every month. Some of the articles are just too good. Like for instance, this month my favorites are: The editor's note (which is always a pleasure to read), Thread Management in the CLR, Design for testability, Static Analysis tools for .Net.

Other favorites on my feed reader are:

  1. Ann-Dee's Tic-Tacs (My wife's weblog)
  2. Stack Overflow
  3. Threads watched by Channel 9 Team
  4. Business Week Online - Tech Beat

Wednesday, November 19, 2008

Downloading and installing AdventureWorks Database

I am assuming that you want to write a prototype of some sort for which you want a sample database to work with. And I am assuming that you don't have AdventureWorks on your machine. Putting down quick set of steps:

  1. Go to http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004
  2. Click on AdventureWorksDB.mdi, in case you are looking for the AdventureWorks Database for SQL Server 2005. there are also other sample databases available. This post is specifically for the AdventureWorks database for SQL Server 2005
  3. Accept the Agreement
  4. Download and run the installable.
  5. Open Visual Studio Command Prompt.
  6. Type in SQLCMD and press enter
  7. Type in the command
    "exec sp_attach_db @dbname=N'AdventureWorks', @filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf', @filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf'"



  8. Please note that the Drive could be either C:\ or D:\ depending upon where you have installed the AdventureWorks Database MSI.



 



This will attach the AdventureWorks database. Fire up SQL Server Management Studio and confirm whether Adventure Works exists or not.

Saturday, November 15, 2008

The Sleeping Giant...

I am going to talk about the experience that I went through recently, when I met with a quite dangerous accident. It could have been quite fatal, fortunately, it wasn't. This post is going to be starting from around 2 seconds before I met with the accident to about 5 minutes after the accident. photo

on the 14th of November 2008, around 11.45 AM, I was going to work on my motorcycle. You see there are these lorries that haul huge stones from the stone quarries to wherever they take them, and the lorry drivers are very careless. They never abide the traffic rules. One such lorry driver was driving on the opposite direction and he suddenly decided that he needs to take a 'U' turn, and he did, just 10 or so meters ahead of me. I was driving around 80 Kilometers an hour and didn't have enough reaction time. I applied both the brakes simultaneously, bringing the bike down to around 60 kilometers an hour, and had a head on collision with the lorry. The bikes front went under the lorry I collided with the lorry head on. This is what happened.

The things that went through my mind during those 2 seconds before the collision and 5 minutes after, were quite profound. Now that I reflect upon it, it tells me about the stupendous processing power of the brain, when it is under stress. If only we could channel this power in a productive way. There were important things, and then the silliest things too. I cannot remember the exact sequence of things that my brain ran through, but I will try to list them down, at least as many as I remember (of course I don't remember everything).

So first when I see the lorry coming in, I think.

photo1"What's this guy doing? Is he crazy?"

"Should I just brake or should I turn left? Oh but there is this car and a bike on my left, I can't turn."

"Good I have disk brakes in the front. I won't fall and go under"

"Thank God I am wearing a helmet. I think it should be able to reduce the impact"

"Should I consider turning right?"

"I can't see what's coming from the opposite side."

"Dang... the driver is getting off to run already...!!!"

So that's when I realize that nothing can be done and that the collision is going to happen at a very high speed. That's when I give up and think,

"This month the finances were already down... How am I going to repair the bike..."

"My bike is not registered in Hyderabad. If I launch a complaint with the police, they will confiscate the bike and I would have to pay the road tax to get my bike back."

"I hope my laptop doesn't break, I will have to wait 2 or 3 weeks to get a new one. And I have my external hard drive in the bag. All the data is in it."

"I don't want to be perennially injured. Dang... that would be bad."

"I just got married I have to save myself."

"I had to finish the Click Once API Prototype today. Gone...!!!"

"Shit...! I wish I hadn't sold my car...!"

Now the collision happens...!!! And this is the most interesting part... the bike collides, I fall off and after that the bike goes under. Since the driver has already jumped off the lorry before the collision and run, the lorry slowly climbs over my bike and crushes it. The pictures are after the lorry climbs over the bike. Now the collision was at, at least 60 kilometers an hour so it is hard. I have hit the lorry with my head and chest. You can't imagine the power of the impact. After I fall off, the first thing I do, instinctively is get up. On standing up, I realize that I can't breathe. I feel my lungs are pushed deep into my chest and it pains when I laboriously try to pull in dear oxygen. It takes me around 7 to 10 breaths to pull in oxygen and get my breathing back to normal. During this time my head is going bonkers.

"My wife is going to really scream at me. I better not tell her before I reach home."

"Nothing is going to happen to me. I belong to the demonic tribes of Banasur, Narakasur and Babrubahan. And they were wicked difficult to kill."

"Heck I have been pushing weights in the gym for over 15 years now. This impact isn't going to do me nothing."

"I have to start breathing and then turn around and look at my bike. I have to analyze the damage and the expense this is going to cause me."

"Dang... I tore my jeans... Will have to buy a new one..."

"Oh but the oxygen first... breathe... breathe..."photo2

About 10 seconds later I breathe normally, turn around and look at my bike... I am standing on my legs, firm and strong. I can feel pain in my chest, my shoulder and my right upper thigh, very very close to my genitals. Heck I  just got married, I have to think about everything. I press my chest and see if I feel any sting, to find out if there are any bones broken. Nothing broken. I turn my neck around and check for my spine. No pain there. I take a little jab at my groin. The skin burns, but no internal pain... thankfully. All this time my 10 kg heavy laptop bag is on my back. I offload it carefully. People have started gathering all around me. I cannot see my bike any more because of the crowd. Someone gets me water and 3 people are asking me to sit down on a rock nearby. One local fellow with black clothes on comes to me and gives me an IPhone. He says some "Reddy" wants to talk to me. I take the phone and find out it is Koti. He asks me how I am. dang...! it wasn't more than a minute or perhaps a minute and a half after the collision. How did he find out? I see Pavan from the mailroom. He takes control of the situation. He calls the Ambulance, the police, and picks up my laptop bag. While all this is happening, I am thinking.

"How do I take out my bike before the police arrives?"

"I don't want the police to confiscate my bike."

"I don't think I have the strength to pull my bike out from under the lorry."

"I have to go home to my wife before she comes to know about this whole thing from someone else."

"But I can't leave the bike here. I have to get out of here with the bike."

"Nothing has happened to my hands. I think I will be able to code from home."

"Thank God Ma isn't here. She would have gotten awfully worried looking at me limp."

"Where's my phone? I hope my phone isn't broken."

That's when a guy comes to me and gives me my phone. And I am relieved to see that it isn't broken. Pavan tells me that he will take care of the bike. I get on to the ambulance and they suggest I go to Apollo Hospital and do at the checks.

At Apollo, all the checks are done later and I find out that no bones are broken, and that my diaphragm and liver, which were just under the point of impact are fine. The doctor tells me that I am a strong man and my gym workouts saved me. My friends Vikas and Rajesh come over to the hospital and take me home later in the evening.

Thursday, September 18, 2008

Marriage and the movie maker

I am getting married. That's right. Well I don't know about the other parts of the world, but 32 is a little late to get married for people resident in India. All my friends are married and have children of age ranging from 4 months to 8 years. Most of them started thinking that I am not ever going to get married. But well it is happening. But this blog post is not about that.

A couple of months back, my girl friend (the girl with whom I am getting married silly...!!) received a marriage invite from her friend which was quite innovative. They had made a nice write up with the Shrek Movie poster in the back ground. Sweet nothings about their relationship, about their attitude and chemistry. Being a girl, she was moved and said she wanted something equally innovative for our marriage.  I told her if a picture is worth a thousand words, we make a movie. And we did.

Now to stick the clips together, and to do the editing, I really didn't know what to do. So a friend of mine suggested that I download the ULead Video Studio, which I did, and installed it and used it to create the movie. Dainty little tool it is. The only thing that was left in the movie was the sub titles. Yes I made a movie and the subtitles would describe how the movie relates to our lives. That's when the trial period for Video Studio got over. Now I was in a fix. I didn't want to upload the movie with no subtitles. Talking about it around the cafeteria, Dhananjay, reminded me of the Microsoft Windows Movie Maker.

That's what this blog is all about. I did upload the movie without the subtitles, but as we speak, or rather as I write this, the Movie Maker is publishing the movie with the subtitles. I am going to upload the movie once I reach my workplace. The whole point is Movie Maker is a nice tool, that comes free with Windows since Windows ME. When it was released initially, it faced some poor reviews. But it has come out pretty well it seems.

As Wikipedia quotes it, "Windows Movie Maker in Windows Vista includes new effects and transitions, and support for the DVR-MS file format which Windows Media Center records television in. The HD version in Premium and Ultimate editions of Windows Vista adds support for capturing from HDV camcorders. The capture wizard will create DVR-MS type files from HDV tapes."

Just giving Windows Movie Maker the credit it deserves...

Hosting a WCF Service on IIS

Look for this topic on the Internet. The first thing that you will see is the implementation of the service. I really wouldn't fathom why that is usually done. If I am looking for the subject Hosting a service on IIS, I would assume that the service has already been written and ready, and it is the hosting that I really need the help with. But still I will also follow the standard and go and and tell you the details of how to create a WCF Service.

  1. File -> New -> Website
  2. WCF Service

This will create Service1.svc and IService1.cs. The IService1.cs is the Service Contract, that you need to implement on your Service. Prepare the contract, prepare the Service and then build. Once it builds, you are done with the service.

Now when you are writing an application which requires a WCF Service, you don't really start off with a WCF Service. Just like you don't start writing a Windows Service, with a Windows Service, you don't start a WCF Service application with a WCF Service application. Confused...? What I am trying to say is, in case of a windows service, what I usually do is write the entire application in a Windows Application. Once I am done writing the application, I move the code to a Windows Service, simply because it is much easier to debug a windows application than a windows service. Similarly, I would write a normal multi-layered application, and then once I am done (at least up to a logical completion), I would Create a WCF Service and move the Service Layer (which was not a service layer until now) into the new Service. Of course with it goes all the other layers, which were supposed to be on the database side. Like the Data Access Layer or perhaps the Entities Layer, if you happen to use one.

So coming back to the point how do you really host your service? This article is not really about hosting the service. I would like to write more about the glitches and the obstacles that you have to face when you are hosting the service. In theory, the process of hosting the service is quite simple:

  1. Publish the Service
  2. Open Internet Information Services (IIS) Manager
  3. Create a new application and provide the physical path to the directory into which you published the service

That's it.

Now the glitches:

Server Error in Application “Default Web Site/CallService”

HTTP Error 404.3 - Not Found:

Incase of this error the possible reasons are:

  1. The current version of WCF has not been registered
  2. IIS Scriptmaps are not updated at the IIS Metabase Roots
  3. Existing Scriptmaps are of a lower version

To resolve this issue, you need to take the following steps:

1. Run a command prompt window as administrator. Start, cmd as normal then press CTRL+SHIFT+ENTER
2. Navigate to c:\windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\
3. Run the command ‘ServiceModelReg -i’ - You should receive the results below.
4. Exit

Another error that you most commonly see is this:

"There is no compatible TransportManager found for URI 'http://<your URI>.svc This may be because that you have used an absolute address which points outside of the virtual application. Please use a relative address instead."

The error message might misguide you. There is a possibility that you might have specified an absolute address in the configuration file. But if you go there and check and find that the address is not absolute, then perhaps the error isn't there. For this what you should do is, check if all your IIS Components are installed or not. In my case I discovered that I didn't have 2 things installed. "IIS Metabase and IIS 6 Configuration Compatibility" under Web Management Tools -> IIS 6 Management Compatibility and "Windows Authentication" under World Wide Web Services -> Security.

Last but not the least. If you see any other issues, which you are not able to figure out just by reading the error message on the IE, where you are trying to browse to the service, publish the website once again, using an http:// URI from your Visual Studio project. If the publish fails, even though you might not see any errors on the error window, go to the output window and check. You will see the source of the problem, which is much more clear and easy to understand. This idea was given to my by my good friend Koti who sits next to me.

Friday, August 29, 2008

How much are you worth after all...?

Well It has been a really long time since I blogged about anything. Lots of things happened in the last couple of days...? or should I say Months...? So let me start by telling you about a sweet little discussion that I had with my girlfriend the other day. Well she is quite a proponent of the company that we all know so well... the company that does searches really well, gives away all its services for free, encourages all its users to waste a whole lot of time on the Internet and the company that uses the oldest Internet business model in the books... Ad Business...

Ok don't get me wrong. I really have nothing against Google. Its a nice company. All its products are quite thought over, dandy, simple and very very effective. I have been using Google for all my search requirements for quite some time, until last weekend. I was having a discussion regarding the latest releases of Live search and a friend, whom we closely call "Jeels" or "Jeelani" told me that Google is more like a habit. If you really want to appreciate Live Search, you have to kick the habit. So he asked me to go to \\Jeels\NoGoog\install.cmd or some such location and asked me to install a small utility that he had written, that would redirect all IE searches from http://www.google.com to http://www.live.com. Even the Google toolbar ones, if you have one installed. The first few days were pain. Google is quite a habit I realized.

But then I started noticing that about 80% of the times, I found what I wanted on Live Search. You see I also have Firefox installed and this dandy utility isn't written for Firefox. So I go to Google as the last resort, using Firefox. about 75% of the times, if I didn't find it on Live Search I didn't find it on Google either. I did the math and on a rough order of magnitude Google was only 5% more effective for me than live is. Of course this data is based on my search topic preferences and on a very un-systematic algorithm. But my conclusion, Live may very soon be as good a search engine as Google if it isn't already, and Google may only be the best search engine in the minds of its users.

So why is it that Google gives away all its services for free? In my humble opinion, Google products do not have much business value. The calculation of business value can be based on the amount of money that a user is willing to pay for a service. So let me ask you. How much are you willing to pay for Google Search, Google mail, Google Talk, Orkut or Picasaweb for that matter? Fine Google does huge business but if you look at it from an Engineering perspective, is it such a big deal to manage a few simple, low featured, no frills, web sites? Writing a small low featured chat application and integrating them together?

Google products do not have a return of investment on them and hence free. Besides I prefer a company that makes products that solve some business problem or assist in some chore. Do not mean to make a direct comparison, but there are companies that make pornographic material and spam and make money out of that. Products that waste time and that wouldn't be considered respectable by any user, even if he uses it himself, privately.

Writing applications with the excellence and usability that it sells is quite a job. As an engineer, I also take it to the personal level. No matter how good a job an engineer does, if he doesn't get a good hike, a level rise and a bonus in his annual appraisal, he really hasn't done a good job. How much money do you require, you would ask? well its not the money, I must remind you. I am quite happy financially you know. It is the appreciation. Giving appreciation in emails is quite easy. It is only when you are appreciated monetarily, that you really know your work's worth.

The meaning is two phase. Good appraisal tells you 2 things.

  1. You have performed well
  2. Your performance was truly appreciated by your managers

Which also means that a bad appraisal tells you 2 things.

  1. You could have performed better.
  2. No matter what your managers tell you to pacify you, no matter how many sweet emails they send you, they are not happy with your performance. You may give a 100 excuses to yourself or to your managers, doesn't mean a thing. It didn't work out this year, work for it next year. Period.

Yeah, sounds harsh, But if you fall in that category, if you are not happy with your hike, this really is bad news.

Friday, July 11, 2008

Is Code Folding that bad...?

I am a huge fan of Jeff Atwood and Coding Horror. I usually like his stuff. But I somehow didn't agree too much to his post where he talks about Code Folding (#region). I mean of course I also agree with a few things that he says, so let me put them down here:

 

Things that I do not agree with:

  • "Folding directives are Glorified Comments": We don't fold code to accommodate the editor, we do it to accommodate ourselves. Code folding is more like indexing. I index my code so I know exactly where to go when I am reading it. It is like creating folders for files. I go to a specific file and know I want to check an event handler for example. so I open the Event Handlers Region and reach the exact event handler I require. Besides, I agree that traditional comments are better and more descriptive, but they have a different purpose than #region.
  • "Folding is used to sweep code under the rug": Perspective, perspective... I would call it, "neatly arranging it in a nice closet and closing the doors instead of keeping everything out on an open shelf".
  • "Folding is used to mask excessive length": Nuclear power could cause a nuclear holocaust or it could assist in the creation of an alternative source of power to keep cars running, Air conditioner fans turning and perhaps to achieve warp speed, who knows. Writing short and clean code is a matter of personal discipline just like checking in code into your repository before leaving for home. Even when there were no regions, people did write excessively long and convoluted source code. And #regions wouldn't hide code during inspection or code reviews. Everything would be reviewed when it is reviewed; folded or otherwise. In fact, it might make reviews more convenient. The reviewer unfolds everything and then systematically folds everything that has been reviewed.
  • "Folding can hide deficiencies in your editor": This "scutwork" really helps good programmers to read code. And as I have read somewhere, good programmers read more code than they write. Code folding enables that.

Things that I agree with:

  • "The editor should automatically offer to fold up these common structural blocks to you"
  • "#region is criminally overused"
  • "Code should be written that doesn't need folding to be readable, clear and concise"

 

So Jeff, I love your writing, no questions... And you have a right to your opinions and to what you publish... But be gentle at times man...!

Friday, July 04, 2008

Do it smart: Shortcut Keys

Most interesting short cut keys on Visual Studio 2008:

  • Ctrl + R + R: Rename whatever is selected (Refactoring).
  • Ctrl + K + M: This is to create a new method stub. just call the method as it already exists and then hit the shortcut.
  • Ctrl + ".": Opens the smart tag window and allows you to add Using statements. you can also use it to add a non-existent method into a class. Just call the method as it already exists, click Ctrl + "." and select "Generate Method stub..."

image

  • Alt + Ctrl + E: Most useful. This will open the Exceptions window and let you stop or allow a few exceptions while debugging.

image

  • Ctrl + K + F and Ctrl + K + D: Indents the code properly. so "F" will format the selected code and "D" will indent the entire document.
  • Ctrl + - and Shift + -: Works like the back and forward buttons on the web browser. So if you navigate into a new place using F12 or Shift + F12, you can go back to the original location using this.
  • Ctrl + Tab and then use Arrow Keys: Ctrl + Arrow Keys allow you to take a look at all the windows, tool windows, panels and let you navigate through them. So once you press Ctrl + Tab, it shows you the navigation window. Then you can use the arrow keys to navigate through all the panels windows, etc. You can go up, Down, Left, Right, and you can even see what's in focus.

image

  • F8 and Shift F8: These help you navigate through your search results. Hit it and get surprised.
  • Alt + F6: Moves to the next tool window.
  • Ctrl + F6: Cycles through the MDI child windows one window at a time.

Thursday, July 03, 2008

Funny Behavior of Google Talk

I was booting up my machine. I had just logged in and all the apps were firing up one by one. So I must have fired up something and might be typing into it, when Google Talk fired up in between. So everything that I had imagejust written went into the google talk sign in textbox.

Now, I usually save my user id and password on google talk so it automatically signs in. So, since i had typed in something by mistake into the User ID textbox, the user ID changed. So instead of my real id I had "my" typed into the user id input box. Ideally in a scenario like this, what should happen is it should try to log in and then once it fails, it should quit trying.

What Google talk did instead, is it kept on trying with the same user id and password over and over again, automatically. Now at this point in time, I don't even know something like this is happening in the back ground. So eventually when I come around to Google Talk, I see that the User ID is wrong and the status is "Account Locked". So I type in the correct UserID and I see a CAPTCHA to unlock my account. And interestingly the CAPTCHA doesn't give me an image, but it gives me a long message saying something like, "The service is unavailable at the moment, please try again later". So I wonder what would happen if I type in the entire message as a CAPTCHA input. So I did and interestingly, it solved the CAPTCHA.

Unfortunately all this happened so fast, I didn't take a screen print. Anyways, Now I tried it again. I signed out, typed in "my" into the user id input and tried to log in again. The status showed "Account Locked" which means they had locked out an account whose user id is "my" for trying to sign in with the wrong password more than the specified no. of times. Now I changed the user id to my real user id again and I see the CAPTCHA again, only this time it was a working real CAPTCHA with the image. Now I really wanted to check if this CAPTCHA is a real one or a fake one. Without putting in any input I just clicked Ok and it didn't give me an error message of any sort. It just logged me in.

So there are a no. of issues here:

  1. Log in shouldn't be tried multiple times automatically if the password is wrong. It should wait for User Input
  2. The user id that was locked was "my". After I change the User ID, it shouldn't give me a CAPTCHA because it not my user id that is locked that needs unlocking.
  3. The CAPTCHA should be potent. So the input I give should be properly validated which is not being done in this case. Now this is a special case. but if the CAPTCHA is given it should be validated or it shouldn't be given at all.
  4. In case there are errors and if the CAPTCHA Service is down, it should not show me the error message as a CAPTCHA.

 

So my question is how much would you really pay for a software like Google Talk? Yes I know, there is great power in simplicity. And even though Google talk doesn't provide features like great smileys and stuff, it lets you talk. For free, this is good enough. But how much would you really pay for it? Another question that pops in is would you use a software like this for business communication?

As mentioned in one of the posts, Google gives a lot of importance to the cool factor. Would you really pay for a cool software or a software that could be used for business application? Where's the ROI...? People talk a lot about Google being in competition with Microsoft. I don't really think it stands tall enough.

Wednesday, July 02, 2008

Planning to join Google...? Think again.

Sarang just posted on his blog about this post. And it really impressed me. So I thought it has to be mentioned about on my blog too. I specially like the part where he says that Google's idea of business is to amuse and attract people. And that most of Google's product promote wasted online time.

So this post is about a post that was posted on a Sarang's Blog Post :). Anyways, you should read it yourself.

Thursday, May 22, 2008

Copying the Address on Team Explorer

You go to Team Explorer bar and double click on "Source Control". This fires up the Source Control Explorer. Now you double click a few thousand times to reach the directory that you wanted to reach and you do something that you couldn't have perhaps done from outside the Source Control Explorer, like a file check out perhaps. Now you want to do something with that file which perhaps you can't do from inside the source control explorer like copy pasting some other files in and out of this directory, perhaps. So basically you require the location of the file that you just checked out. so you see this:

 

 image

you will see the thin red marking that marks the location of the file. you want to copy this. Surprisingly it doesn't allow you to select the path and copy paste it into your windows explorer. so how do you Get the path. I asked my good friend who sits next to my cubicle and he says, "Right click on the folder, go to properties, and you get the path there. And this, obviously, is selectable:

image                             image

Now I didn't ask him this question because I didn't know this. That was the first thing that I did. But then there is a splinter inside every programmer's head that doesn't let him rest when things like this happen. I am a Microsoft Technologies Programmer. For so many years I have used Microsoft tools, I know how "they" think. And there has to be a better way. I clicked around like crazy combining it with random Ctrl + C and right clicks. And every few clicks I went to the notepad and Ctrl + V 'ed. That's when I discovered. you double click on the bar that shows the local path and the path gets loaded into the clipboard.

Now there is a pattern that is quite familiar among all Microsoft software. If you find something difficult to work with, you are probably not doing it right. There has to be an easier way that is much more intuitive. A programmer will intuitively double click an area if he wants to select it for copying. Of course that is only if he cannot reach that area with his keyboard (oh we so loathe to take our hands of the keyboard!!!).

Thinking about usability to such excruciating details... I wonder how they do it...!!

Microsoft Rocks...!

Monday, April 28, 2008

If Microsoft Goes Hostile on Yahoo... Amazing Read...

http://blog.pmarca.com/2008/04/if-microsoft-go.html

Joins in LINQ... What do I return?

I want to write a select query that returns all the data in a table? this is how it would go:

IQueryable<Session> sessions = from session in dataContext.Sessions

where (session.EventID.Equals(eventID))

select session;

Now I want to write a select query that joins two tables. This is how it would go:

var x = from s in dataContext.Sessions

from e in dataContext.Events

select new

{

s.SessionName,

s.SessionDescription,

e.EventName

};

So this is the easy part. we just learnt how to write the query. Now consider this. I have a separate data access layer that does all the basic query generation and works as a data interface. I generate the first query here and then in my engine or the middle tier, I refine my query depending on what the UI layer requires. So in a situation like that I have a function in my Data Access Layer that does a table join... what would this function return. I can't return IQueryable<Session> or whatever is the Table Name because I am making a join and so it is no specific table. I am supposed to be returning an anonymous class. How do I return an Anonymous Class from a function. The whole idea of the anonymous class is that the class name is anonymous. So this is what I do.

public object GetSessionAndEventData()

{

if (string.IsNullOrEmpty(this.connectionString))

{

this.connectionString = ConfigurationManager.ConnectionStrings[MADConstants.CONNECTIONSTRING].ToString();

}

if (this.dataContext == null)

{

this.dataContext = new EntitiesDataContext(this.connectionString);

}

var x = from s in dataContext.Sessions

from e in dataContext.Events

select new

{

s.SessionName,

s.SessionDescription,

e.EventName

};

return x;

}

Yes. I just return an object. While I was thinking about this, I did some reading and discovered something quite interesting in the C# 3.0 specification. "Within the same program, two anonymous object initializers, that specify a same sequence of properties of the same names and types, in the same order, will produce the instance of the same anonymous type". The compiler uses the same generated class if there are two object initializers of the same type. This actually makes it possible to cast it back to the original type.

Then what I did was, I just returned an object type from my data access layer, passed it through the middle tier engine, and all the way to UI. here I just bound my datagrid with the object type and voila...! The Datagrid was actually able to bring out the properties and put them in tabular format without requiring any casting.

Don't you just love it when it just works...!

Update on future plans on my career... Just a reminder...

So what do you feel like when you first board the mother ship. Death...! yeah... for someone who has been growing and dreaming and aiming high all his life (only such a person usually boards the mother ship)... where do you go once you join Microsoft...

There are goals like achieving targets, promotions, accolades; growing the ladder... But is that it...? Does life have nothing that big left...? Big enough like the ambition of joining Microsoft...? This is what I went through the first 3 months of my career...

I had to come up with something... So I did... A lot of people had been telling me that I write good... Specially my girl... who happens to be a huge inspiration... So I decided I would write a book... after a lot of thought and pondering... I decided  I would write something on Engineering Excellence... A subject that never goes out of scope. Number of reasons why I decided that... Since this is my first book it would take a lot of time... to even start it... Anyways coming back... spent 5 more months in all this pondering... and I still haven't written a single word or done nothing towards writing... Hell I am too stuck with my stretch initiatives at work and my mundane responsibilities...

So I decided I would start the book in December. Till then I will prepare. Build a monster machine that I have been planning for some time, read, read, read and read...

And then it happened. Ray Ozzie came to Hyderabad Campus... Short talk he gave and I got my next big thing. Joining the Microsoft India Development Center (IDC), which happens to be the products division in India. I will start preparing today itself and it is a one year target... I should be in IDC before 2009 December... I am giving myself enough time because I have to get married somewhere towards the end of 2008, and a honeymoon follows, and then the initial distractions of marriage and setting up a house and so on and so forth.

I also have to work on the monster machine, the book... although working on the book pretty much goes hand in hand with preparing myself for IDC... But still... I am sure IDC would require something more than just Engineering Excellence.

Wednesday, April 09, 2008

Command Copy exited with Code 1

If you get that error message, it is usually because you have configured your application to run some batch copy commands either just before the build of the app or after it. So go to Project Properties -> Build Events and check if there are any pre-build events or post-build events with any copy command. This usually happens when you get a version of legacy code that some other developer has written and are working on some fixes.

First check if there are any discrepancies with the copy command syntax or the directory path mentioned therein. If you can't resolve the error because of constraints such as not being able to change the directory structure, just get rid of the commands for the time-being and continue with your dev. You can later on figure out what the original intent of the previous developer was and go for the solution.

Tuesday, April 08, 2008

login failed for user (Microsoft SQL Server error: 18456)

So you had some problems with your installation of the SQL Server 2005 installation on your machine and now that you have un-installed and installed it, you can't seem to log on to your own machine using basic windows authentication. You can log into other servers but you just can't seem to log on to localhost. So you search the internet for the error message and after going through a whole lot of issues that are vaguely related, like changing authentication type from windows to sql and so on and so forth, you land on my blog.

The Solution: Install Visual Studio 2005 SP2

This was a bug in SQL Server 2005 that was fixed in SP2.

Friday, March 21, 2008

Microsoft Rocks...!

Everyone talks about the workplace of Google... and just look and pictures and say ooh la la...!

Well let's get real...!

http://www.fastcompany.tv/video/the-innovations-microsoft’s-new-research-building

Friday, March 14, 2008

Who are you...?

There was a senior manager from the leadership who had a meeting with the entire team today. He was telling us about his career and about what he had done throughout his career, going a little into the details of a few selected projects, his achievements, some interesting stories of despair, struggle and finally success... Hell leaderships don't even talk about failure now do they... But that doesn't mean they haven't seen any... :)

But while I was listening to it I could make out who that man was? That's the crux of this post? Who are you...? You are not your name... Your name just represents who you are. It is a facade. You can define yourselves with your relationship (Son of ... or Father of ... or Husband or Wife of...) But is that really you...?

You could define yourself with your profession... Senior Developer at Microsoft or Vice President for that matter... But is that really you...?

So I am what I contribute. At home, at work, at play. To my family, to the organization I work for and to the society too. So it seems I am a lot of people :). I always say the ultimate purpose of humanity is to grow. Smarter, stronger and better every passing day. So here are the metrics by which you grow.

You would be recognized by what you contribute to your immediate surrounding. If you contribute directly or indirectly to the business of the organization you work for, if you make it grow, you will grow. If you contribute to your family, if you contribute to your personal passions... They will know you by your contributions... that's what you are...

That's who you are.

Thursday, March 06, 2008

Blogger stops working with Live Writer

I use Microsoft live Writer. I maintain a no. of blogs. One about tech, one about gadgets, one about religion and mythology, one about training my new pet "Boomerang" (a 2 month old yellow Labrador) and so on. So to manage all these blogs, I use live writer. It is pretty cool and dainty. It gives all word like features like spell check and text formatting, manages my photos, if I want to post one along with my Blog Post, and so on. One fine day I realize that one of my blogs on blogger doesn't post the blogs that I am posting through live writer.

imageAfter sniffing around a little I realize that it is the "Captcha" that I somehow need to put while posting my blogs. Since live writer isn't able to solve the "Captcha", it is not being able to post my blogs on that particular blog.

So I click on the link that says "Why do I have this?" and I find out that "Blogger's spam-prevention robots have detected that your blog has characteristics of a spam blog." and that "Since you are an actual person reading this, your blog is probably not a spam blog. Automated spam detection is inherently fuzzy and we sincerely apologise for this false positive."

Now I have absolutely no issues with Blogger thinking that my blog is a spam blog. And in fact I think they are doing a pretty good job trying to prevent spam.

I was just wondering why this happened and how this could be made a little more user friendly. It happened perhaps because I am using Live Writer, which is in a way an automated blog posting engine. Which is exactly what a spam blog would probably use. I think the Blogger Spam Bots are doing the right thing.

So going beyond this point, I started wondering if the live writer in some way could report the issue to the author. I am sure there must be some kind of exception thrown on the blogger side when I was trying to post the entry without solving the "Captcha". Why did live writer not inform me? is that a test case missing in the live writer code? Why does Live Writer give me the feeling that everything is fine and hunky dory? Or is it that there is no way to find out whether the blog has been posted successfully or not? Should I report this? Well what the hell I probably should.

Last but not the least, Blogger is smart enough to store all the posts that didn't solve the "Captcha" as draft. So all my work didn't go a waste. I just had to go to Blogger and solve the "Captcha" individually. I hate to admit it, but I have to appreciate good work when I see it... Even if it is from the "enemy camp". Kudos Google...!!!

Google Calendar Synch... Bro ha ha...


Google launches Calendar Synch. This provides 2 way Synch with your Outlook Calendar. So every time I make an update on my Calendar on outlook, it automatically synchronizes it with the Google Calendar. So if my home
machine has Calendar Synch running, it would also synchronize my home machine outlook calendar with the Google Calendar. So all I have to do is make an update on one of the machines and my desktop, my laptop, my IPhone, everything stays in sync.
So I wonder what I would really do with this. I don't have an IPhone. My Sony Ericsson P990i syncs the Calendar I have on my laptop. I don't maintain my Outlook Calendar anywhere else. Since I carry My phone everywhere. All the Updates that I do I do only on my Phone and My laptop Outlook Calendar more works like a back up of my phone data.
Yes there is one small thing. All the meeting invites that I get, since I don't have the Blackberry service yet, don't get synchronized on the go. But as one of my ex-seniors used to say, "If you can't get in touch with me at home and if you can't get in touch with me at work and if you can't get in touch with me on my cell, don't get in touch with me. I am probably avoiding you."
Ok sounds good. But I do accept that I am not 100% "synched" on the move. So my next phone will facilitate me in doing that.
So considering that Microsoft had a utility like that which would sync windows live, outlook, hotmail calendars, I really ask myself. Do I really need something like that? Would I ever use it? Or is that small icon on my task bar adding more clutter to my windows registry and my installed programs?

Casio's new G-Shock GW-9200

GW-9200.jpgNow isn't that a gadget a man would love to own. Features you ask...? well here you go.

1. 6 Band Atomic Time Synch: This (for dummies) is a synchronization mechanism that tracks proper time depending upon the Earth's Geoid. The principal realization of the Earth's Terrestrial Time.

2. Barometer (Air Pressure range 260 to 1100 hPa)

3. Altimeter (-700 to 10000 meters): Does this also mean that it can go up to -700 meters under water? I wonder.

4. Thermometer (-10 to 60 degrees Celcius): Trust me dude you don't want to go beyond those temperatures.

5. Stopwatch (1/100 seconds, 24 hours with a split)

6. World Time (33 world cities, 29 time zones)

7. Countdown Timer (24 Hours Max)

8. 5 alarms (1 with snooze)

9. Full Auto EL Light (with afterlight): EL meaning Electro Luminescent. The watch has an EL Panel causing the entire watch to glow for easy reading in the darkimage

10. Tough Solar: There is a Solar cell that converts solar energy into electrical energy, which is used to charge the re-chargeable battery of the cell.

11. Geiger Counter (Soon to be added): A Geiger Counter helps in detecting radiation using Alpha and Beta Radiation.

Now should I show this to Nidarshana, what would she say? Is that a watch or is it a room full of machinery. Why do you need a watch that does so much. Why can't a watch just show time and look good and do nothing else. Why does everything in a Man's world have to be so Complicated?

So a Man's world is complicated. And as per her, its a woman's world that's simple... talk about it eh...!

Tuesday, March 04, 2008

Windows Mobiles Rule...!

For a long period of time there was a fad that windows is bad. Open source and anything anti windows was so cool to talk about. Ridiculing Microsoft products was a favorite time killer. People have slowly started realizing that not everything that they hear is true.

I have been using Symbian phones for quite some time now and all of them have been smart phones. Last weekend I attended a friend's marriage and his HTC Touch dual was with me for almost 3 days. This just made me realize how sweet windows mobile is.

It is small things that matter the most like a java application, when run, it gives a security alert. I get a choice to run the app once only or allow for the session or not this time or not this session or not at all. I cannot imagine what security threat it could pose on one run if it didn't on the previous in the same session. Or for that matter what across sessions. If it is safe once, isn't it supposed to be safe always...? Or is it that the OS doesn't recognise the app in the next session...?

Amd why are most of the apps designed for keypad phones and no extensibility for the touch screen browser phones...? I wonder...

A no. Of issue i notice with predictive text, handling, ergonomics, etc. So i conclude. symbian phones are good but when it comes to smart phones and its usability... Windows mobiles rule.

Tuesday, February 26, 2008

Netgear wireless router at home - Issues and Solutions.

Hi,

I have a Sify Broadband connection at home. And I have a Net Gear wireless router. So now we have 4 laptops at home and all of them are connected. Plus I have a friend staying 2 floor above me(I stay on 6th and he stays on 8th) sometimes even he gets connected quite easily.

Problems:

1. Sify has a mac address registered. So when you take a connection for your laptop, Sify registers your laptops Mac address. A wireless router has a different Mac address so doesn’t work.

2. Logging in is a problem so sometimes you have to log in directly with your laptop and then connect your laptop to your router and the router to the external connection.

3. Sify needs a static IP. If you want all your laptops to be connected, you will have to go to dynamic IP once you are connected.

Resolutions

1. Call your Sify personal and ask him to set up your connection for a new Mac address of the router.

2. Go direct and log in. that means you will have to go static IP first, log in and then connect the router and go dynamic IP.

3. Your laptop for which the connection was taken will be the server and which will provide internet to all other machines. This also means you will have to stay connected with the wire while others enjoy a wireless connectivity. One of the machines have to be physically connected to the router as long as the internet is needed.

Switching from dynamic IP to Static IP and back is cumbersome. So I have written 2 batch files for the same.

“Static.bat” changes to static IP. Change the static IP in the file to the IP you require.

----Static.bat-----------------------------------------------------------------------------------

netsh interface ip set address name="Local Area Connection" static 10.14.65.11 255.255.255.0 10.14.65.1 1

netsh interface ip set dns "Local Area Connection" static 202.144.105.4 primary

exit

-------------------------------------------------------------------------------------------------

“Dynamic.bat” changes the machine to dynamic IP. No change is required in this file.

----Static.bat-----------------------------------------------------------------------------------

netsh interface ip set address "Local Area

Connection" dhcp
netsh interface ip set dns "Local Area

Connection" dhcp
exit

-------------------------------------------------------------------------------------------------

Hope this helps.

Friday, February 22, 2008

You are a Juggler...

You are a juggler... Say you have unlimited supply of balls to juggle with... But you decide how many balls to juggle with... But you can't pick up balls while you are juggling... So say there is a man standing near you who at random throws balls at you which you may or may not decide to catch, while you are juggling with whatever you already have.

Let's start with one ball. How long would one ball juggling keep you interested. So you catch another one thrown at you. Let's say you are pragmatic enough to not catch a third ball until you are proficient with the 2 balls you are already juggling. Now let's say the man decides when to throw a ball at you. He is the decision maker and not you. So he might not throw a ball at you for a long time even after you have become proficient with the no. of balls you are already juggling with.

Or he may throw a ball of a different size or color that you may or may not like. So every ball thrown at you is an opportunity. You may like it and you may not. But you hardly have a split second to decide.

Of course you may decide to throw away one of the balls you are juggling with if you don't like it too much. And of course some of the balls are high priority that you must juggle with eternally. And of course you can't catch too many balls at a time or you drop the high priority balls too.

There is a trade off here. You get exceedingly proficient with the existing no. of balls as time passes. There is always a learning curve if you take up a new ball so the juggling proficiency goes down by a magnitude or two (depending on the size and color of the ball) every time you take up a new ball.

Let's call these balls your responsibilities. Let's call the man that throws balls at you fate. Let's call juggling "LIFE". The high priority balls are family and profession. The lower priority balls are things that you are passionate about. And the rest of the balls are what keep the zing in your life.

Like marriage. Every time the marriage ball is thrown at you, you decide to catch or not to catch in a split second based on your existing proficiency with the balls you are already juggling with, and your priorities. This ball is crucial because Mr. Fate may not throw another one at you for a long long time. Boy ain't life complicated...?

I have probably caught too many balls at this time. I am having some serious troubles juggling with family, profession, investments, health, guitar, Boomer (My new pet, a 40 days old cream Labrador), music, gadgets. And I am looking at picking up a couple of more balls to juggle with like marriage, learning sanskrit as a language, Tango and Salsa Lessons.

Am I Superman or what...!!!

Thursday, February 21, 2008

Why can't the developer not think like a user...?

Usability... Microsoft is known for it. She (Microsoft) has given birth to some of the most user friendly software known to man (and woman).

So the question is why oh why do we need a usability engineer. Why can't an Engineer, not think about usability. Sometimes we ignore simple issues like a two digit no. column on a grid is too darn wide and a description column which needs to be wide is too narrow for the description to be visible completely. Why oh why didn't we think about that before we were told by the user?

Because we were too busy churning out the high priority features so that they can be delivered on time. Too busy writing tests to ascertain the credibility of the application. Delivering non functional requirements like reliability, scalability, maintainability, security, and so on and so forth... Too busy designing, coding, testing refactoring... Delivering the bare necessities...

So the width of the column is the smallest thing in usability... there should be stuff thought of that is beyond imagination. Like how to make an application support operation without using the mouse at all. Completely with the keyboard. Or how to provide pointers so the user can intuitively know what to do next. Minimum mouse clicks... and perhaps hundred other pointers only a usability engineer can give you.

So how important is usability? What is the percentage of time that should be devoted to Usability when making the estimates? Inviting responses... Please comment...

Code Performance:

I read coding horror. It is a good blog. I just read about the Graphics Programing Black Book. Yes if you click the link you will see it is freely available at byte.com. Jeff says the book is pretty darn good even if you don't ever do graphics programming, never write code in C and don't know nothin' about Assembly Language. So what the hell... I took a peek...

Excellent example of how humor can make anything more interesting. Specially a book on technology. Without humor and spice, any book would be dry. How beautifully he makes the book worth reading. From Technical standpoint and from a literary perspective too...!

I haven't read the whole book yet, but some beautiful extracts from the few initial chapters.

Chapter 1:

In the early 1970s, as the first hand-held calculatorsw ere hitting the market, I knew a fellow named Irwin. He was a good student, and was planning to be an engineer. Being an engineer back then meant knowing how to use a slide rule, and Irwin could jockey a slipstick with the best of them. In fact, he was so good that he challenged a fellow with a calculator to a duel-and won, becoming a local legend in the process.

When you get right down to it, though, Irwin was spitting into the wind. In a few short years his hard-earned slipstick skills would be worthless, and the entire discipline would be essentially wiped from the face of the earth. What’s more, anyone with half a brain could see that changeover coming, Irwin had basically wasted the considerable effort and time he had spent optimizing his soon-to-be-obsolete skills.

What does all this have to do with programming? Plenty. When you spend time optimizing poorly designed assembly code, or when you count on an optimizing compiler to make your code fast, you’re wasting the optimization, much as Irwin did.

Chapter 3:

When you are pushing the envelope in writing Optimized PC Code, you are likely to become more than a little compulsive about finding approaches that let you wring more speed from your computer. In the process you are bound to make mistakes, which is fine - as long as you watch for those mistakes and learn from them.

A case in point. A few years back, I came across an article about 8088 assembly language called "Optimizing for speed". Now "Optimize" is not a word to be used lightly. Webster's ninth new collegiate dictionary defines "optimize" as "To make as perfect, effective, or functional as possible", which certainly leaves little room for error. The author had, however, chosen a small, well defined 8088 assembly language routine to refine, consisting of about 30 instructions that did nothing more than expand 8 bits to 16 bits by duplicating each bit.

The author of "Optimizing" had clearly fine tuned the code with care, examining alternating instructions sequences and adding up cycles until he arrived at an implementation he calculated to be nearly 50 percent faster than the original routine. In short, he had used all the information at his disposal to improve his code, and had, as a result, saved cycles by the bushel. There was in fact only one slight problem with the optimized version of the routine.

It ran slower than the original version...!!!

Chapter 10:

My grandfather does the New York Times crossword puzzle every Sunday. In Ink. With nary a blemish.

The relevance of which will become apparent in a trice.

What my grandfather is, is a pattern matcher, par excellence. You are a pattern matcher too, so am I. We can't help it; it comes with the territory. Try focusing on text and not reading. Can't do it. Can you hear the voice of someone you know and not recognize it? I can't. And how in the nine billion names of God is it that we are instantly able to recognize one face out of the thousands we have seen in our life times - even years later, from a different angle, and in different light. Although we take them for granted, our pattern making capabilities are a miracle on the order of loaves and fishes.

By "Pattern Matching" I mean more than just recognition, though. I mean that we are generally able to take complex and often seemingly woefully inadequately data, instantaneously match it with an incredibly flexible way, to our past experience, extrapolate, and reach amazing conclusions, something that computers can scarcely do at all. Crossword puzzles are an excellent example; given a couple of letters and a cryptic clue, we are somehow able to come up with one out of several hundred thousand words that we know. Try writing a program to do that! What's more, we don't process data, in a serial brute force way that the computers do. Solutions tend to be virtually instantaneous or not at all. None of thos "N log N" or "n2" execution times for us.

Tuesday, February 19, 2008

Mobile Phone Design Challenges...

So what are the challenges

Facts.

  1. Typing on a soft keyboard is not ergonomic at all. Hard keyboard is required "qwerty" or otherwise
  2. The "qwerty" (if there) keyboard should have buttons big and wide enough to make typing ergonomic.
  3. Screen has to be wide so browsing, emails and other icons can be fitted into the screen comfortably

Challenges:

  1. How do we fit in the keyboard and a wide screen into a phone and keep it compact.
  2. How do we make it look sleek so it sells. Nobody would want to buy a clunky phone.

Attempts:

  1. Nokia Communicator: Too clunky.
  2. Sony Ericsson P800: No "qwerty" keyboard, but pretty promising
    close window to return
  3. Sony Ericsson P910i: "qwerty" keyboard too small and un-ergonomic to be useful.
  4. Sony Ericsson P990i: Very Very Promising. Reduced screen size, but "qwerty" keyboard very ergonomic, though not any bigger.
  5. HTC Touch: No "qwerty" keyboard, but with the touch flow and wide screen, pretty good
  6. HTC Touch Dual: Getting closer. Slider "qwerty" keyboard and touch flow makes it ergonomic, compact and sleek.

And the best ones until now:

  1. HTC Tytn II: Full Slider "qwerty" keyboard, big enough to be ergonomic to type in long emails, sleek and compact enough to sell and Windows Mobile OS makes it Hot cakes.
  2. Sony Ericsson Experia X1: The "arc slider phone" the "arc design" means the side screen slider. Not only does it make this phone the most ergonomic and fully featured phone, it has 2 main edges. It is Super compact and sleek (The geek value, the gizmo touch, et al) and Windows Mobile. Yes Sony Ericsson comes out with a phone with Windows Mobile 6.1 for the first time. Take a peek http://www.sonyericsson.com/x1/?lc=en&cc=IN and http://www.expansys.com/d.aspx?i=163411

How to disable Aero on your Vista Machine

Ok so your hardware sucks and you want performance out of your machine. Yeah I know life is a bitch, gotta deal with it. So you want to disable Aero on your machine so you can get more out of your machine. Go to Start -> Control Panel

Click on "Appearance and Personalization"

image

Click on "Personalization"

image

Click on Windows Color and Appearance

image

Click on "Open Classic appearance properties for more color options"

image

Choose "Windows Vista Basic"

image

Click Apply, Ok and you are done...!!!

Friday, February 08, 2008

Now That's what I call a phone... A Phone...? Err... Ahem...!

Now This is what I call a phone... A Phone...?? err... Ahem...!!!

 

htc_shift_2.jpgIt's been almost a year since we first saw the HTC Shift, the fold-up Windows Vista and Windows Mobile-capable UMPC with a pretty decently-sized keyboard. The touchscreen device is finally getting a release date of sorts from the European Expansys retailer on February 19 at a launch price of 1185 Euros ($1720). That's right, it's about as much as an expensive laptop, which means the potential target of the device might only be getting it for its built-in 3G support. It's also four times the price of an Asus Eee, in case you were counting. [Reg Hardware via Slashgear]


 

View article...

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