Archive for May 14th, 2006

14 May 2006

How do you put a giraffe into a refrigerator?

No Comments Fun & Humorous

This quiz consists of four questions that tell you whether or not you are qualified to be software professional. You must rely on your common sense to answer them correctly. To see the answer of questions, drag mouse from “Start Drag” to “End Drag”.

Question 1: How do you put a giraffe into a refrigerator?
Answer:
Start Drag |

Open the refrigerator and put in the giraffe, and close the door.
This question tests whether you tend to do simple things in an overly complicated way.

|End Drag

Question 2: How do you put an elephant into a refrigerator?
Answer:
Start Drag |

WRONG!!!! Open the refrigerator, take out the giraffe, put in the elephant and close the door.
This question tests your ability to think through the repercussions of you previous actions

|End Drag

Question 3: The Lion King is hosting an animal conference. All the animals attend except one. Which animal does not attend?
Answer:
Start Drag |

The Elephant. The elephant is in the refrigerator. You just put him there.
OK, even if you didn’t answer the first three questions correctly, you still have one more chance to show your true abilities.

|End Drag

Question: There is a river you must cross but it is inhabited by crocodiles. How do you manage it?
Answer:
Start Drag |

You swim across. All the crocodiles are attending the Animal Meeting.
This question tests whether you learn quickly from your mistakes.

|End Drag

According to Andersen Consulting Worldwide, around 90% of the professionals they tested got all of the questions wrong.

But many pre-school children got several correct answers. Andersen Consulting says this conclusively disproves the theory that most professionals have the brains of a four year old.

14 May 2006

Debugging JavaScript using Visual Studio

No Comments ASP.NET

I really like inbuilt JavaScript debugger of Visual Studio which works like charm with IE browser, and which is rarely used by most of web developers. Most usually opt to put alert in code to test or evaluate value of JavaScript objects.

For debugging JavaScript, all you need to do is to enable script debugging in IE and place some junk characters in your JavaScript code where you want to debug and you are through. Using VS you can step into, step over, place break point in your JavaScript code, adding watch for any object, or even if you want to evaluate any JavaScript object using QuickWatch.

To start debugging, as I said earlier, you need to enable script debugging in IE. Navigate to following in IE:
Tools > Internet Options… > Advanced Tab

In the settings TreeView, check off the node “Disable Script Debugging (Internet Explorer)”.

Now go back to your code and place a string with some junk characters (like “sdsdasd”) in your JavaScript code where your want to debug. I always prefer to use “_test” as standard to put junk string as it help me to find all junk string in code when I am done with debugging. After placing junk string in your code, start your web application and operate it till you reach at that junk string in JavaScript code. IE will then automatically shift you to VS with an error message “Microsoft JScript runtime error: ‘_test’ is undefined”. Click on “Break” button and now your are in debug mode. Move the cursor to the next line of that junk string and set it as next statement (right click anywhere on that line & click “Set Next Statement”:Ctrl+F9). Now you can debug your JavaScript code as you were doing for C#/VB.NET.

Javascript Debugging

Update:
You can also place debugger; keyword as script break point instead of that junk string to start debugging process.