Tuesday, January 30, 2007

What have I been upto?

I've spread myself quite thin, with a lot of code to write, books to read, things to buy and documentation to write.



For now, I have started reading Structure and Interpretation of Computer Programs. I've started reading it, don't skip the foreword or the preface. Be patient with the author and go read it, it's fun!

Meanwhile, I hope to get back to productive coding soon, instead of just reading hundreds and hundreds of papers.

Tuesday, January 23, 2007

One of the hardest problems software faces today

I think the biggest problem is to get users to read the documentation associated with the software.

Try answering these questions and score yourself.

  1. How many times have you seen a question about a problem being repeated?
  2. Why do you they created FAQs?
  3. How many FAQs have you read?
  4. What was the last release notes you read?
  5. Which book did you read last (not related to your course)?
  6. What new techniques did you read and discover in the last two years?
  7. What kind of documentation did you write and share for your last project?
  8. What was the last software manual you read?
  9. What was the ratio of comments to code in
  • Programs you wrote
  • Programs you read


The answers to these questions might not be a simple yes or no, but it will give you a fair idea of how we programmers are lazy and totally ignore documentation.

Sunday, January 14, 2007

Some pictures from our New year and Lohri celebration (A Story!)


Me and my gorgeous wife before we left for the new year party

I sparked off the Lohri celebrations

Popcorn and Peanuts in fire
A Lohri ritual



The flames got higher, lohri had now begun

Ritual walk around the fire

The crowd got bigger as the flames got higher

My brother enjoyed the heat

My in-laws got involved as well
(My brother-in-law, his wife and son)

I had to keep encouraging people

The last round

There was only so much firewood!

It was time for dinner
(The chef was ready!)

Dinner was served, the food was awesome!

My wife's nephew, he came, he saw

He bowed!

Saturday, January 13, 2007

Happy Lohri

Mufli ki khusbu, gurh ki mittaas
Makki ki roti aur sarson ka saag
Dil ki kushi aur apno ka pyar
Mubarak ho apko Lohri ka thyohar!

If the whole thing bounced over you, see http://www.lohrifestival.org/. We are celebrating our first Lohri

Friday, January 12, 2007

Article: A Conversation with John Hennessy and David Patterson

Read A Conversation with John Hennessy and David Patterson published in ACM Queue. It's one of the best articles, I've read lately. They talk about the challenge with parallelism, the free ride software has had, their new book, new projects and much more.

I highly recommend reading the article

Sunday, January 07, 2007

It's prediction time!

It's come a little late this year, but here goes anyway. The list includes technology, business and other predictions for the year 2007

  1. Apple will go back to using the PowerPC
  2. Intel will gain an upper hand over AMD in the 64 bit space
  3. Microsoft (R) Vista (TM) will not be widely accepted, people will expect too much from it
  4. Internet Explorer 7 will do well, but will begin to loose out gradually towards the end of the year
  5. India, Dravid, Chappel and Tendulkar will have a rather forgivable (we'll loose out before the semi-finals) world cup
  6. The world will get ready to move to 128 bit computing, there will be rapid growth towards 1024 bit computing machines
  7. Adobe, Google and Apple will continue to do well
  8. Open source movement will slow down for this year

These predictions are not very scientific, they are based on gut feeling. Feel free to comment on any of the predictions. I'll try and keep the list up to date or add your predictions if I really like them

Monday, January 01, 2007

Have A Great New Year!


Let's all welcome the new year with a big smile! I hope it turns out to be a great year for us, our families and friends, and all of mankind. There are so many things to do, so let's get started!

Thursday, December 28, 2006

Quote of the Day

The creation of standardized, vendor-independent operating systems, such as UNIX and its clone, Linux, lowered the cost and risk of bringing out a new architecture

David Patterson and John Hennessey

Monday, December 25, 2006

A shortcut through time

Written by science writer George Johnson, this book talks about mans quest for the ultimate computing machine, the Quantum Computer.


The books begins with the basic of computing, the language used is quite amusing

"In a typical circuit, there were resistors that, true to their calling, resisted electricity, pinching the flow of electricity"

The book starts off with the authors experience with GENIAC, a mock clone of ENIAC. The author then explains, tinkertoy logic, the book helps the reader discover that computers are more about logic, more than semiconductors that are used to build them. Logic is more important than how it's actually implemented.

The book then dwells into physics, explaining how atoms spin, and how depending on the direction of spin, we can treat the spinning as a boolean quantity as 1, 0 or Φ. Φ represents the state of the atom, when it is spinning in both directions simultaneously.


The introduction to Quantum physics makes a good read and makes me wonder why I slept through Physics in school. Reading further through the book the author aptly states "Human brains are just not equipped to intuitively understand the subatomic rules". The author then takes you to the Aha! Moment, when you realize that the Quantum Computer is so powerful that it can carry out 2n computations simultaneously, where n is the number of computing bits.

The book then introduces the layman to the Turing Machine and computational complexity, followed by Cellular Automata, Shor's Factoring Algorithm and its application to the world of Quantum Computing. No mathematical proofs are included in the book, but the concepts are well illustrated with examples and supporting diagrams.

Cryptography is then introduced along with the challenge of decrypting code, the computational complexity of cryptanalysis and implications of a quantum computer on current security technology is discussed.

What follows is an elegant description of logic gates and reversible logic. The current and state of the art attempts made at building a quantum computer are described in detail. Quantum error correction, its need and challenges is also discussed.

The book closes with chapters on Quantum secrecy and describes how polarized photons are used to implement quantum cryptography. Real life examples of hard problems, like protein folding is discussed. The reader is introduced to the fact that protein folding is a hard problem to solve (see books on NP-Hard) and the mystery surrounding how nature is able to solve the problem so quickly is discussed.

In summary, this is a great book to read. If you know and understand computer science, it will expose you to how, some of the most complicated concepts can explained without the need for complex mathematics. If you do not understand Quantum computing, the concepts exposed will get you interested in the world of Quantum, where the laws of nature are different. Simple Newtonian physics cannot explain what goes on inside an atom. It is this randomness and uncertainty that can change the way we compute today.

Friday, December 01, 2006

Just my lucky day! (errata in The METAFONTbook)

I got this email as a reply for an errata report I sent out

thanks for your report.

I hope I am emailing the correct people for an errata I found in The MetaFont book Volume C, Page 159

yes. you've come to the right place.

Original Text

For example, Appendix B says

def --- = .. tension infinity.. enddef .

Corrected Text (It should be)

For example, Appendix B says

def --- = .. tension infinity .. enddef;

(Note the change from . to ;)

i've verified this; the reference in appendix b
is on p.262. i don't see any earlier reports on
this, so it looks like you're the first.

should this actually be the case, you will be due
a small reward. to deliver it, we'll need a
postal address. i've received word from knuth
that he expects to be looking at reports about
this time next year, so an address that will be
current at that time is what we'll need.
-- bb

Thursday, November 30, 2006

Update: Balbir's Blog: Problem 4.2 Page 85, Introduction to Algorithms

I posted an entry about a possible errata in Introduction to Algorithms at
Balbir's Blog: Problem 4.2 Page 85, Introduction to Algorithms

Well, it's a part of the errata of the book now. Check out http://www.cs.dartmouth.edu/~thc/clrs-2e-bugs/bugs.php the errata reads

Page 85, Problem 4-2. Change the second paragraph of the problem to read, ``Show that if the only way to access information in array A is by this single-bit operation, we can still determine the missing integer in O(n) time. Any entire integer outside of A is still accessible in a single operation.''
Reported by Balbir Singh. Posted 29 November 2006.
Severity level: 3
To be corrected in the eighth printing.
Severity level 3 is "A more significant technical or expository error"

I have not yet figured out how the new solution works (with the new constraint), if anybody else thinks of it, please do comment on it here.

Saturday, November 25, 2006

Is Dravid headed down the Ganguly lane?



© Getty Images

An indifferent performance at Durban (a place with a good amount of Indian support) and in his last dozen matches, is Dravid headed down the Ganguly lane? Is captaincy and planning leaving no time to play and enjoy the game. Is the politics of Indian cricket along with the six thinking hats of Greg Chappell getting too hot for Rahul?

I for one am very skeptical of the Indian batting line up. Sehwag is too adamant to listen to anyone - that's his natural style right? Tendulkar, the poor guy sees everyone getting out and goes into a shell (and gets out!). Kaif and Yuvraj, have no technique while batting. Give them a venue that supports swing and they'll lollypop their wicket to the slips. Dhoni might be ranked high, but it's a miracle when he manages to play the ball where he intends to.

Let's not even discuss the tail-enders

Whenever India comes in to bat, nobody can predict how well they'll do? They are prone to collapsing, known to be panicky and have the killer instinct of a Sparrow. The one thing they are good at is acting, look at their advertisements and you'll see that all of them can almost act. May be the BCCI has an acting academy inside the sports complex.

Is the wall wearing out? I hope not to give up so soon, but I am very frustrated.
I am going to protest, not by not watching the cricket matches, but by not purchasing anything advertised by an Indian cricketer.


How's that???? (If the umpires are looking at this blog :))

Problem 4.2 Page 85, Introduction to Algorithms

Here's my first post that's actually a PDF article. It contains a lot of math and I thought it would be best to convert it to PDF and then post the link here.

Comments on Problem 4.2, Introduction to Algorithms

Enjoy!

Monday, November 20, 2006

Man vs Woman (In Pictures)

Hilarious!! My wife sent them to me




WARNING: there were no copyright notice in the email, I hope I am not violating any :-)

Monday, November 13, 2006

Mathematical Formulae

Ever wondered how large the jungle of Mathematics is? We'll I always loose my way in it, when I try to read through a paper. Mathematics, to me is the plain simple truth, that is put in abstract terms. You get reward points for being terse. It's elegant when you write a premise in one single step. I've been thinking about coming up with a list of simple theorems, I want these to serve as an aid for mapping the more inner paths of the Mathematics jungle.

I have been trying to study discrete mathematics for a while now. Here is one of the most important theorems (see The Art of Computer Programming, Volume 1, Page 41, Third Edition, D.E.Knuth) . The theorem is called Fermat's Theorem and states that

If p is a prime number then





For a good proof, see Knuth's book or Fermat's Little Theorem at Wolfram MathWorld

One of the most interesting applications of this theorem is the RSA algorithm. RSA is used quite extensively in public/private key based cryptosystems.

Checkout the RSA article on Wikipedia

Thursday, November 09, 2006

Ten top things to do after installing a new Linux Distribution

Even though most of distributions have gotten better with look & feel and integration of hardware with Linux, here are the top ten things I usually do after installing a new distribution

  1. Fix the bootloader to set the order of booting the OS
  2. Get the right fonts
  3. Download media players like real or helix and mplayer
  4. Download and install a DVD player
  5. Install Java and the Java Plugin
  6. Install Acrobat Reader
  7. Install Acrobat Flash Plugin
  8. Install TeX, Scribus, Xfig and Inkscape
  9. Install wxMaxima and Scilab
  10. Install development packages like Eric, Kdeveloper & Eclipse
Remember, installing an entirely new distribution requires a lot of patience, googling and sleep. I'll try and walk you through the nuances of the various distributions available. My favourite these days is Ubuntu. It's a great distribution built on top of another great distribution (debian).

Tuesday, November 07, 2006

Symmetry

The book Discover Physics by Benjamin Crowell, talks about symmetry in Physics and in Nature. Wikipedia defines symmetry as

"In formal terms, we say that an object is symmetric with respect to a given mathematical operation, if, when applied to the object, this operation does not change the object or its appearance. Two objects are symmetric to each other with respect to a given group of operations if one is obtained from the other by some of the operations (and vice versa)"

Of the various types of symmetry described in the article, I find the reflection symmetry and rotation symmetry, the easiest to understand.


Reflective Symmetry




Rotation Symmetry
The interesting thing about symmetries is that they apply not only to nature, physics and mathematics, but to computing as well.
Consider that you are writing an API or developing a programming language or a library. By design, you the code needs to be able to undo, what it's allowed to do.
Consider a "C" program
Let's say we carry out the following steps


1. Allocate memory
2. Copy from user
3. Open a file
4. Write to file



What happens in case there is an error in step 4?
We carry out the following steps


1. Close the file
2. Free the allocated memory



We need to do the same when our we are done writing to the file.

Now compare what we did with reflection symmetry. Did you find anything similar? I think we should as a guideline make our API/code symmetric with respect to reflection. In lay man's terms, the code should be able to undo its own effect.

Most programming languages and API are symmetric. "C" has malloc()/free(), open(), close(). "C++" has a constructor and a destructor for each class, so we are mostly good as far as this rule is concerned. "Java" on the other hand, provides a garbage collector to maintain the symmetry. Consider what would happen if you could just allocate memory and never free it up? Open files, but never close them? The system would soon become unstable, the weight would grow on one side (memory, descriptor leaks) and the system would crash.

The symmetry created by the garbage collector makes life easy for the lazy programmer, but losing control over symmetry can throw a system in a non-deterministic state. Consider the case where a system has a lot of memory, the garbage collector never kicks in (of-course a lot depends on the actual algorithm). When a critical application needs to run, it needs most of memory, but to get free memory, the garbage collector starts running, starving the critical application of CPU time, making it wait for its memory demand. All of this could have been avoided (the CPU time overhead), but being in control of symmetry and freeing the memory when not needed.

Coming to rotational symmetry, I am yet to find a good use case for it in computer science (for an average programmer). For those involved in graphical illustrations, we could exploit it to make it easier to draw illustrations.

Tuesday, October 24, 2006

Distracted

Have you ever felt that you don't have the time do what you want to do right away? You feel your holding yourself back, because there are other important things to be done first. Remember time management. Time Management is a emotionless old bloke, who won't let you enjoy your life as a lazy programmer.

Shifting focus across many things, especially when I do not have time to spare is becoming a common habit with me. I am writing this blog entry, when I have absolutely no time to do so :) The interesting part of this obsession to waste all the valuable time is that the moment I actually have time, to do everything I want to; I'll probably end up lazing around and wasting time.

The good thing about the distracted mind is that when I actually get back to doing "what I am supposed to be doing", I feel refreshed. It's like taking a break, a good one.

I have just one more complain. I think life has been extremely unfair on me. During all my exams in school and especially the important ones, there was something interesting going on around the world.

I have some interesting blog entries in draft stage, I hope to post them as soon as I get a little more free from my pressing workload. Who knows, I might decide to get crazy and post them instead of doing "what I am supposed to do" :)

Monday, September 25, 2006

I got here several times

I got to this page several times to write something new, but unfortunately each time I would get distracted by something else. This blog now looks like a toy that a kid grows out of. No, don't worry, I still love blogging and it's something I am passionate about.



While I am here, I might as well tell you that the second edition of the Dragon Book is out. I have admired Al Aho and J D Ullman all my life. I can't wait to get hold of the Indian Edition of the book.

privacy

Some of the policy from the app automation refers to https://rclone.org/privacy/ if you are a general blog reader, follow Google's polic...