November 29, 2007

Learn LINQ with Microsoft Press's "Introducing Microsoft LINQ"

This is the most amazing book I could get hold of for learning the far more amazing technology called LINQ (Language Integrated Query) in C# 3.0. For those who don't know what LINQ is, check out the wikipedia article at http://en.wikipedia.org/wiki/LINQ

A quick and dirty intro to the topic is provided by Claudio at his blog Cool LINQ Stuff

So those of you wanting to really dive in deep should read the above mentioned book. Here is a link that I could get hold of.

http://files-upload.com/files/648872/Microsoft.Press.Introducing.Microsoft.LINQ.May.2007.chm
http://www.megaphile.com/file/12514/Microsoft-Press-Introducing-Microsoft-LINQ-May-2007-eBook-BBL-rar.html

A function to convert Number to Words

I made this function a long time back to test my coding skills. It's written in C#, however the logic could be ported to any other programming language that supports recussion.

The function takes a double as input and returns a string. For example, if the input is 5532, the return would be a string “Five Thousand Five Hundred Thirty Two”. It takes a double as input and returns a string. Numbers up to Zillions are supported! Decimal numbers are also supported. The algorithm being highly scalable, you may add any representation scheme as and when required. As of now it follows American standards. But it can be scaled to the Indian standards of Lacs and Crores very easily. Even the Number system may be changed to any Base (Hexadecimal/Octal etc).

Message me if you want it.

November 15, 2007

USB Hard disk partition corruption problem solved

Hey now this is worth blogging. I was having a lot of trouble with my USB hard disk recently. It is a 80GB hard disk where I store my music, movies and software backups. Now the problem was, at times my hard disk would just freeze up and not respond for really long times. Giving in to frustration I would either turn off my laptop in the hard way or else jerk off the USB cable. And yeah the USB Hard disk wouldn't spare me for my brutality... The next time I would plug in my hard disk, it would just show the then used partition as 'Local Disk'. Now just think of it... 25 GB of movies and music all gone.

TestDisk by CGSecurity to the rescue!!! It's free, open source and hell powerful! Ok now let me tell you the steps with which I could recover my lost partitions:

* run TestDisk,
* select the harddisk, the partition type
* choose Advanced
* select the partition
* choose Type,
* enter the value corresponding to the previous filesystem
* choose Boot
* choose RebuildBS
* List
* If you can see your files, choose Write and confirm

There you go! Unplug your hard disk and then reconnect. You should see your partition now. If these steps did not work for you, try the Analyze method. Now once recently, my friend's USB hard disk was not showing any partitions at all! So we used the Analyze method and rebuilt the partitions. Amazing!

All the posts