Wednesday, 28 December 2011

Installing Kinect SDK on Windows XP.

Kinect is Microsoft idea of "Bulk Advertising". They managed to promote two of their major products in their production line with a cheap, yet feature-rich piece of hardware. Note : If you're a gamer looking to buy a kinect, I suggest you leave this blog, but if you are interested in hacking the Kinect, continue reading.

  


Cheap camera, combined with free software and licenses really helped the Kinect penetrate the market. There was just one problem with this. The Kinect SDK installs only on  Windows 7. It is a significant investment to obtain Windows 7, its licenses, Visual Studio 2010 and its licenses just to work with one piece of hardware. Atleast, I wouldn't pay for it. So I went on to download the Kinect SDK to see it for myself. I thought maybe a few features might work and that's all I might need for now. Who knows?

So I downloaded the KinectSDK-v1.0-beta2-x86.msi- its a 20.8 MB file that takes around 5 mins to downlaod on a decent broadband connection. After downloading, I double clicked on the file to see what happens, I also had plans of choosing "Custom Install" and trying out various combiantions of sub-packages to see if a few features worked and others did not. Well, The installer started and this screen came:-


This showed that the installer checks for the OS-version before even starting. So I did a little research to edit windows pakage installers, and found this great software that allows you to edit Windows installers - these typical .msi file editors. Orca is a freeware and is available at the first link in google search for "orca download". This is the a picture of KinectSDK-v1.0-beta2-x86.msi opened with orca:-





After browsing through the tables with Orca, I found this interesting one called LaunchCondition.You can see it here:-



This table stores the pre-requisite information. There it was, a description line saying, it requires Windows 7 or higher. But what do you change it to? I thought, let's simply make the condition field Installer OR VersionNT >= 0, and that's exactly what I did. It sounded logical at that point. It is checking for the version. If I say >= 0, XP is obviously not less than 0, right?



Fingers crossed, I saved the edited installer and started the setup again. Voila! It worked. It actually worked. I'm going to test teh SDK out now. Adios!

Tuesday, 24 May 2011

GOLD

Gold is a hot commodity in today's world but is even hotter in Byteland. In Byteland the monetary policy is very peculiar. This is the situation faced there : http://www.codechef.com/problems/COINS/

Okay, normally, the person approaching the problem figures if the sum of n/2 , n/3 and n/4 is greater than n, then voila! sorry, that's too easy. Consider n/2 to be a.The fact that when considering a as a/2, a/3 and a/4, the sum could be greater than a has been missed. The same is the case with n/3 and n/4 and its n/2, n/3 and n/4 and so on.....But how does one solve such a problem?

The solution dawned upon me after a long time. There is no linear data structure, that can hold an arbitrary number of values and be useful for this program.A tree is one possible solution.But again, the complexity of traversing and then removing nodes and replacing them by larger values is too high. The simplest solution is to use a recursive function that does the job for you. No large data structures are needed because the recursive functions stack will suffice. So after going on to code with this technique, i discovered that i got the solution.But, the CodeChef judges are very difficult to please, they were not just looking for the solution, but wanted the answer to be found within 5s and 64MB of memory.This is when i fell in love with coding more than ever. After a lot of thinking i somehow realized that if i cache the data which has already been calculated, then it would save time of computing the same  values each time. So , after caching and submitting and anxiously waiting for the result, i was indeed happy to see an accepted solution. if you want my code, e-mail me at quakerr90@gmail.com

Hello World!

I wasn't new to coding when i started coding on codechef. Even though i started coding there, months ago, only now  have i actively started participating in their practice and contest sessions.This blog is meant to be a journal of the events that occur with me and codechef.

Off i go to codechef then....