technology and zen of life

“A heisenbug (named after the Heisenberg Uncertainty Principle) is a computer bug that disappears or alters its characteristics when an attempt is made to study it.”

Student Rockstar

FYI: This one is a great to participate contest for college students of India. Have a look at the website to know the details.

Student Rockstar

Good Luck!

Microsoft contests Information

Thought of sharing information about ongoing contests.

1. Microsoft High Performance Computing Scholars program

Prizes: Student Awards of $1000 and Faculty Research Grants worth  $5,000, many more prizes can be avaialed just by registering.

Target Audience: All undergraduate, postgraduate, diploma and training students (along with supervising Faculty) of India.

Duration of contest: 15th May 2007 to 30th June 2007

2. Win 1 in 3 copies of Microsoft Expression Studio Commemorative Editions

Prizes: Microsoft Expression Studio Commemorative Editions

Target Audience: General

Duration of Contest: Running..till 6th of July 2007

3. Win with Windows

Prizes: Cafe coffee day vouchers.

Target Audience: General

Duration of Contest: July 2 to July 14, 2007

4. Project Shutter Photo Contest!

Microsoft has initiated a Photography Contest – the Project Shutter Photo Contest! This is aimed at enthusiasts with an eye for photogenic visuals across three themes that best represent the individual’s locality – Food, Culture and Architecture. There are tons of goodies up for grabs, including a T-Shirt every 30-minutes through the next 12 days.

Be sure to check out their gallery to find some of coolest pics.

Good Luck!

Puzzle 1 : Take a chill pill!

This is one of the Microsoft interview questions, should be easier to answer as writing a code is not required. :)

“You have 5 jars of pills. Each pill weighs 10 gram, except for contaminated pills contained in one jar, where each pill weighs 9 gm. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?”

By scale I mean a digital weight measuring machine.

SOLUTION:

1. Mark the jars with numbers 1, 2, 3, 4, and 5.
2. Take 1 pill from jar 1, take 2 pills from jar 2, take 3 pills from jar 3, take 4 pills from jar 4 and take 5 pills from jar 5.
3. Put all of them on the scale at once and take the measurement.
4. Now, subtract the measurement from 150 ( 1*10 + 2*10 + 3*10 + 4*10 + 5*10)
5. The result will give you the jar number which has contaminated pill.

Algortihm Challenge 1: No division!

I have decided to come up with series of challenges n problems which are algorithmic in nature and are asked in interviews of reputed companies like Microsoft, Google.

This one was asked in a Google interview recently. Try to answer it in your comments. I will post the solutions if no one comes up with the right answer (let’s hope not).

“You have an unordered array X of N integers. Find the array M containing N elements where M_i is the product of all integers in X except for X_i. You may not use division. You can use extra memory.

What is the best way of doing this?”

Example:

N=4

X = {2, 5, 3, 7}

M_0 = 5*3*7 = 105

M_1 = 2*3*7 = 42

M_2 = 2*5*7 = 70

M_3 = 2*5*3 = 30

M = {105, 42, 70, 30}

(hint: There are solutions faster than O(N^2))

NOTE: while posting solution put your code (if any) inside <code></code> tags.


SOLUTION:
Thanks for your efforts. The solution presented here runs in O(N) time. Yes O(N), and thats what an interviewer would expect you to come up with, in less than an hour.

Form two arrays P and Q such that
P[1] = 1
P[i] = X[1] * X[2] * … * X[i-1] for 1 < i <= N
 
and
 
Q[i]  = X[i+1]*X[i+2]*… * X[N] for 1 <= i < N
Q[N] = 1
 
Set M[i] = P[i]*Q[i]
 
Both P and Q (i.e. M) can be found in O(N) time.

Once can access corresponding code snippet here.

Windows : Map a Path to a Drive letter

Ever wondered if you could assign your favorite directories lying deep under a large chain of directories, as seperate drives?

This post is going to tell you how to refer to a path like “D:\workspace\topcoder\development\javaprojects\” as simply “T:”

First let me tell you the manual way of doing it using the command prompt.

Suppose the path is “D:\workspace\topcoder\development\javaprojects\” and we want it to map to a drive letter say “T:”, then all we need to do is to open the command prompt and type the following command.

subst T: "D:\workspace\topcoder\development\javaprojects\"

Now, instead of typing the full path, you can reach this directory by typing the letter of the virtual drive, followed by a colon, as follows:

T:

You will see that a new drive entry is created under your “My Computer” as “T:” which maps to the desired folder. After doing this we can refer to a path like “D:\workspace\topcoder\development\javaprojects\ProjectABC” as simply “T:\ProjectABC\”

If you want to delete this drive then just issue the following command.

subst T: \d

Points to remember:

  1. This is not a permanent mapping as the mapping will be lost after you restart windows or log off. (You can create a batch file for this and put it on startup to have your drive everytime you log on to windows. Read further to know how to avoid this.)
  2. The commands like chkdsk, diskcomp, diskcopy, fomrat, label and recover, do not work and should not be used on drives created with subst command.
  3. To see more details of the command. Type: subst /?

Now, for the people who hate command line stuffs, there’s a nice little tool available called Visual Subst. It uses the API similar to the console ‘subst’ utility, but makes it easier to create and remove virtual drives in a GUI way. This tool also allows you to persist the virtual drive mapping on windows restart.

Note: This works with Windows 2000/XP as well as Windows Vista platforms.

Extra Note (Added for my own safety) : I am not responsible if anything goes wrong, while trying out the commands or softwares presented here.

Microsoft launches Silverlight


Recently Microsoft announced Silverlight (previously codenamed “WPF/E”).

It is said to be a cross-browser, cross-platform plug-in for delivering the next generation of media experiences and rich interactive applications (RIAs) for the Web.

The current Download page for Silverlight offers the February 2007 Community Technology Preview (CTP) of the Silverlight Client, which is intended for developers and designers. The client is quite small in size. (1.09MB) and installed very quickly.

I also downloaded the Silverlight Community Technology Preview Sample Pack and experienced some Silverlight samples running locally on my computer and I must say that they are quite interesting.

The Silverlight is offering support for XAML for building rich media experiences on the web.

Read Tim Sneath’s MSDN blog for ten reasons why you might want to use Silverlight.

It must be brought to your attention that people have already started talking about Silverlight, being a competitor of Flash.

Microsoft offering FREE Virtual classroom sessions

Through Developer Virtual Classrooms, which is called to be “The Ultimate Online Training Environment“, Microsoft is offering FREE classroom sessions on WPF (Windows Presentation Foundation). As it is said, with the Developer Virtual Classrooms, you can enjoy the benefits of live human interaction from the comforts of your desktop. (Well! Let’s see if it is true.)

Followings are the parts of the WPF courses as listed on the site.

  1. Introduction to WPF
  2. Introduction to WPF Controls
  3. Data Binding in WPF
  4. Resources & Styling in WPF
  5. Deployment of WPF Applications

Important Dates:
Virtual classroom sessions will commence from April 23, 2007 to April 27, 2007.

Registrations Close at 1800hrs on Thursday 19th April. Limited Seats are available so hurry. Read the rest of this entry »

Dreaded Blue Screen Of Death

Blue screen of death (BSOD) is the worst that can happen to your windows machine. You might be just listening to some songs on your PC and there it is the blue screen of death. Here are a few steps on how to handle the BSOD’s.

1. Check the Event logs
To view the event logs right click on “my computer”, “manage”, “event viewer”. Here you will find different categories and a list of logs for each. All the errors your system reports are logged in here. You want to search in System, Application categories and look for any details with a red error symbol by them.
To research them, the best way is to look inside the details provided. There is a link in there that tells you to “click for more details”. Do it. It’ll take you to the Microsoft site with some possible causes and solutions.

If the crashes seem related to a particular piece of hardware in your system, you have the lead. Firstly update the drivers for that hardware and if that doesn’t help look for hardware errors. Read the rest of this entry »

Email Subscription

Disclaimer

The views expressed on this blog are personal. We do not claim to be a representative voice of the views of any organisation whatsoever. We are not responsible for the content present on the blogs to which we have linked.Views expressed are solely that of the author and does not reflect a collective opinion of contributors.