Weekend Gains

    This weekend I was pretty productive. Among other things, I was able to perform a much needed upgrade for my laptop after my hard disk crashed and to bring it at par to the prevailing standards, as well. I bought a 320 GB hard disk (up from 100 GB) and added a RAM module bringing the total RAM to 2.5 GB (up from 1 GB). So it’s a Big Deal :D

    While purchasing the hard disk, I was sure that I don’t need it to fill it up with lots of data (like movies or songs). I would rather use my external hard disk for that. I had planned to use majority of the space for Linuxes (is that the correct plural form?). Why not Windows, you may ask. Especially with the snazzy Windows 7 being already available for Beta?

    Well the reasons are quite simple. Firstly, too many viruses and malware. Especially, if you have removable storage like pendrives or CDs. Next, it’s not very stable. Though Windows XP is a comparatively stable member of the Windows family, I have had more than my share of screen freezes and blue screens. This causes bad sectors and reduces the life of your hard disk. Next, most of the apps I use are open source anyways - Firefox, Open Office, GIMP, Inkscape, Emacs, Foxit etc. Then why not run the same in a better OS like Linux? Lastly, distributions like Ubuntu have become really user-friendly. Vidya and many others who use my laptop really don’t find it difficult or inconvenient to use.

    Well, you must have noticed the plural form of Linux I’d used. This weekend I installed the following OSes and they are all working fine:

    • Ubuntu (Jaunty): Perfect for most multimedia and productivity apps
    • Fedora 11: For trying out Java apps and other enterprisey stuff
    • Arch Linux: An ideal hacker’s OS
    • Windows XP: For the necessary evils like movie playback
    • FreeDOS: This is the good ol' DOS. For classic DOS games and simple low level programming

    I am planning to add a couple of more varied distributions. I am currently thinking of adding Puppy Linux and Rescue CD. Any suggestions?

    Comments →

    Office Diff: An Open Source Diff for Office 2007 or 2003 documents

    This Saturday, I started working on something that many of my colleagues had complained about a long time ago. They work on reports all the time and most of these reports have small changes in each version. They are only interested in seeing what changed rather than read the entire report.

    You might suggest a lot of ‘diff’ tools which can do the job in either Word or Textpad. The issue was that they were working with Excel spreadsheets rather than text files and I couldn’t find any free or open source solution for them. So I ended up creating a new tool called Office Diff. Interestingly, it handles not just Excel, but also all the Office 2007 and 2003 file formats plus PDF and HTML formats as well. It features an intuitive GUI interface and is completely written in Python.

    The next best thing was to open source it. I am using the BSD licence. I found sourceforge a good choice because they support Bazaar, my version control of choice at the moment.

    Please visit Office Diff homepage for screenshots and check out the first release.

    Comments →

    Don't Worry About Zipping Office 2007 Documents

    Old habits die hard. Whenever we have to send huge attachments; the wise ones used to say ‘Don’t clog their mailbox, zip it and send it’. Everyone religiously used to follow the rule and every word document, presentation or excel sheet was zipped before sending. The zipped file would be a good 40% smaller. The mails would reach faster and everyone would be happy in the process.

    Fast forward to 2009, most people now use Office 2007. The new Office is vastly more ….well…new and the preferred file formats all have changed. There is a x at the end of the all filenames so we have .docx, .pptx and .xlsx floating all over the place (how do you pronounce these anyways?!). The documents are still religiously sent as zipped files. Except there is no 40% reduction. Actually it isn’t even 10%. Why?

    Because you cannot zip a file that’s already zipped. Yep…. all the new office documents are already zipped anyways. You can even open them using Winzip by simply renaming their extensions to .zip.

    So folks, next time you mail someone, don’t bother to zip it. There is only the added annoyance of the recipient having to unzip before opening the file.

    Comments →

    20 Truism for Project Management

    Tony Collins has compiled a list of Project Management facts which might very well be the ‘Mythical Man-Month’ for the new era. It explains why so many IT projects fail so aptly that I had to reproduce it here:

    1. Projects with realistic budgets and timetables don’t get approved

    2. Activity in the early stages should be dedicated to finding the correct questions

    3. The more desperate the situation the more optimistic the progress report

    4. A user is somebody who rejects the system because it’s what he asked for

    5. The difference between project success and failure is a good PR company

    6. Nothing is impossible for the person who doesn’t have to do it

    7. Every failing, overly ambitious project, has at its heart a series of successful small ones trying to escape

    8. A freeze on change melts whenever heat is applied

    9. There’s never enough time to do it right first time

    10. You understood what I said, not what I meant

    11. If you don’t know where you’re going, just talk about specifics

    12. If at first you don’t succeed, rename the project

    13. Everyone wants a strong project manager - until they get him

    14. Only idiots own up to what they really know (thank you to President Nixon)

    15. The worst project managers sleep at night

    16. A failing project has benefits which are always spoken of in the future tense

    17. Projects don’t fail in the end; they fail at conception

    18. Visions are usually treatable

    19. Overly ambitious projects can never fail if they have a beginning, middle and no end

    20. In government we never punish error, only its disclosure

    21. The most difficult way is, in the long run, the easiest

    22. A realist is one who’s presciently disappointed in the future

    I am pretty sure most of us can relate to these ;)

    Comments →

    Decoding Google's First Tweet in Python

    Most of you must have read the news that Google finally jumped into the Twitter Bandwagon. In their trademark style, they have chosen to announce this in a cryptic way. Their first tweet was essentially this:

    I’m 01100110 01100101 01100101 01101100 01101001 01101110 01100111 00100000 01101100 01110101 01100011 01101011 01111001 00001010

    I will explain in this post how to crack this simple code with the help of some Python one-liners (Google’s favourite language). If you are a Google aspirant (who isn’t? ;) ), this might help you clear the interview. So pay attention.

    To most people it is immediately obvious that it is a text encoded in binary. Since each binary word is 8 characters long, it is most probably written in the extended 8-bit ASCII code. In fact, it is and you can read this with a simple ASCII chart.

    But they have made it slightly difficult for you by writing in binary. Since most charts would provide you a lookup from decimal or hexadecimal numbers to ASCII representations only. So how do you convert from binary to decimal? It’s quite simple:

    decimal = lambda s: sum(int(j) * pow(2,i) for i,j in enumerate(reversed(s)))
    

    This line defines a function decimal which works in a manner similar to how we would manually convert binary numbers into decimal. Each position is multiplied by increasing powers of two from the right. Then, these numbers are added together. for e.g. ‘1010’ will be 1 * 8 + 0 * 4 + 1 * 2 + 0 * 1 = 10.

    Next, we split the binary part of the tweet string and apply the decimal function on each part

    tweet = "01100110 01100101 01100101 01101100 01101001 01101110 01100111 00100000 01101100 01110101 01100011 01101011 01111001 00001010"
    print ''.join(chr(decimal(s)) for s in tweet.split())
    

    The result is something that you might have already guessed seeing the first 2 words:

    “I’m feeling lucky\n”

    Hope you learnt some interesting python constructs. If there are other ways of decoding this in Python, please comment below.

    Comments →

    « Newer Page 18 of 39 Older »