Friday, March 27, 2009

Ditched Wishes

The only difference between sticking a steel/aluminium dish from my kitchen, out of the window, instead of the Dish TV antenna, is that I can atleast trouble someone in my opposite building with the reflection from the sun with the kitchen dish. Both, anyway, can't seem to brighten the CRT of my idiot box.

Such pathetic customer service. No SRK, I'm not santusht.

Wednesday, March 11, 2009

Ah, Virtual Memory ...

I seem to be on some sort of a hot treasure trail finding gold at the speed of thought. I found this no-words-to-praise explanation of how the kernel handles virtual memory/paging and all that niceties , written by Jeff Berryman, University of British Columbia, more than 3 decades ago, and lying in many places on the interweb now.
THE PAGING GAME

Rules

1. Each player gets several million things.

2. Things are kept in crates that hold 2048 things each. Things in
the same crate are called crate-mates.

3. Crates are stored either in the workshop or warehouse. The workshop is
almost always too small to hold all the crates.

4. There is only one workshop but there may be several warehouses.
Everybody shares them.

5. Each thing has its own thing number.

6. What you do with a thing is to zark it. Everybody takes turns zarking.

7. You can only zark your things, not anybody else's.

8. Things can only be zarked when they are in the workshop.

9. Only the Thing King knows whether a thing is in the workshop or in a
warehouse.

10. The longer a thing goes without being zarked, the grubbier it
is said to become.

11. The way you get things is to ask the Thing King. He only gives out
things in multiples of eight. This is to keep the royal overhead down.

12. The way you zark a thing is to give it thing number. If you give the
number of a thing that happens to be in a workshop it gets zarked right
away. If it is in a warehouse, the Thing King packs the crate containing
your thing back into the workshop. If there is no room in the workshop, he
first finds the grubbiest crate in the workshop, whether it be yours or
somebody else's, and packs it off with all its crate-mates to a warehouse.
In its place he puts the crate containing your thing. Your thing then gets
zarked and you never knew that it wasn't in the workshop all along.

13. Each player's stock of things have the same numbers as everybody else's.
The Thing King always knows who owns what thing and whose turn it is, so you
can't ever accidentally zark somebody else's thing even if it has the same
number as one of yours. (VS/2)

Notes

1. Traditionally, the Thing King sits at a large, segmented table and is
attended to by pages (the so-called "table pages") whose job it is to help
the king remember where all the things are and who they belong to.

2. One consequence of Rule 13 is that everybody's thing numbers will be
similar from game to game, regardless of the number of players.

3. The Thing King has a few things of his own, some of which move back and
forth between workshop and warehouse just like anybody else's, but some of
which are just too heavy to move out of the workshop.

4. With the given set of rules, oft-zarked things tend to get kept
mostly in the workshop while little-zarked things stay mostly in a warehouse.
This is efficient stock control.

5. Sometimes even the warehouses get full. The Thing King then has to start
piling things on the dump out back. This makes the game slower because it
takes a long time to get things off the dump when they are needed in the
workshop. A forthcoming change in the rules will allow the Thing King to
select the grubbiest things in the warehouses and send them to the dump in
his spare time, thus keeping the warehouses from getting too full. This
means that the most infrequently-zarked things will end up in the dump so
the Thing King won't have to get things from the dump so often. This should
speed up the game when there are a lot of players and the warehouses are
getting full. (Not applicable to VS/1)

LONG LIVE THE THING KING

De-bug-ging

Seemingly, with nothing original that I can think of myself, I am finding lots of things I find here and there pretty interesting. Especially this one on some mailing list that I found via reddit, which describes one of the best ways of debugging ;)

We called it the Rubber Duck method of debugging. It goes like this:

1) Beg, borrow, steal, buy, fabricate or otherwise obtain a rubber duck
(bathtub variety)
2) Place rubber duck on desk and inform it you are just going to go over
some code with it, if that's all right.
3) Explain to the duck what you code is supposed to do, and then go into
detail and explain things line by line
4) At some point you will tell the duck what you are doing next and then
realise that that is not in fact what you are actually doing. The duck
will sit there serenely, happy in the knowledge that it has helped you
on your way.

Works every time.

To think of it, I missed an opportunity to use my cat more effectively ;)

Sunday, March 08, 2009

Sharia, anyone ?

Vir Sanghvi had writen this nice article (as usual) in the Hindustan Times editorial page, regarding the sorry state of Pakistan. There was this small part about the imposition of the Sharia Law in the infamous Swat valley, and Imran Khan's comments on it.

Imran Khan (Keble College, Oxford, 1973-76) even declared that sharia law would be better because justice would be dispensed more swiftly! (I know this is politically incorrect but the Loin of the Punjab’s defence of sharia law reminded me of the famous Private Eye cover when his marriage to Jemima Goldsmith was announced. The Eye carried a picture of Khan speaking to Jemima’s father. “Can I have your daughter’s hand?” Imran was supposedly asking James Goldsmith. “Why? Has she been caught shoplifting?” Goldsmith replied. So much for sharia law.)

Ah, Sharia, how funny you are.

Friday, October 24, 2008

The Renaissance Man

I have often regretted the way I went around doing things in college. Or perhaps I didn't. My main problem was that my mind used to be in a very unsteady state, sometimes agreeing and sometimes disagreeing with itself. The fact that the only one I argued about these things was me myself, was another great source of confusion.

At one end I believed that I didn't get enough from the other side, and at the other end I felt that I wasn't doing much from my side. And on some other end I felt I was in a wrong place with the wrong people who neither had the concept of 'ends' nor starts. There never were any in-between thoughts, only extra dimensions, and all thoughts lurked at obscure corners of these dimensions.

And when I was about to give up, we got a charismatic leader whom I started adoring, and then eventually started loathing for playing double games. But I guess the charisma part did prove one thing; however disoriented and random the followers are, there's always a line of thought some leader can infuse which can give directions. It doesn't really matter whether the system supports it as much.

I guess that's what Barkha Dutt was saying about the renaissance man.

Wednesday, August 06, 2008

too little space

In the lakhs and lakhs of sq.ft. that the company I work for owns, there's no library! That's pretty disappointing. Also, interestingly, the information security policy restricts "downloading and installing of Mozilla Firefox". One's expected to only use MS IE 7, MS Outlook and the likes.

Of course, there are wonderful things like free door step bus service for me who lives 25+ km away from the office, free breakfast, snacks, beverages and awesome lunch (@ 20Rs per day ).

..and that's just the tip of the iceberg, I think.

Thursday, April 10, 2008

Looking back to look ahead

I stumbled upon this quote by Ray Bradbury today,
If you can't read and write you can't think. Your thoughts are dispersed if you don't know how to read and write. You've got to be able to look at your thoughts on paper and discover what a fool you were.

Indeed, what a fool I was when I wrote so many of those previous blog entries in the past two years. I laugh at myself for thinking in the way I did ( and still do :O ). I was barking up the wrong tree after all.

To conclude, another quote from Ray Bradbury,
My stories run up and bite me in the leg— I respond by writing down everything that goes on during the bite. When I finish, the idea lets go and runs off.

Wednesday, April 02, 2008

Counterfeit

And then I stood there with others, wearing those fake graduation robes, hat, and holding that fake degree that I still don't have , posing for the college magazine. They all looked happy even in the fake environment. And I stood there, embarrassed. Even if I had actually completed graduation, I would have been embarrassed to wear those robes. After four years in that place, with those people, I still can't come to terms with calling myself a would be computer engineer. And I guess, whether or not I hold that real degree, I'll always remain an aspiring computer engineer ...