Inactive Code Yet Active

2 comments

I have read that there is a comment preceding the task-switching code in UNIX as –

/*You are not expected to understand this*/

Humorous side of the programmer aside the comment does indicate that there are beasts out there which are difficult to exorcise, isn't?

Well, the reason I recalled the above is due to the fact that I spent  sometime of the day dumbstruck reading some code. I was lead to believe I am not supposed to understand one particular huge function. I was wondering how the code execution path can be in such way the reading informed me while the actual testing showed otherwise.  It was bizarre. I was telling myself that this cannot happen but the code seemed shouting loud that it was possible. But hey! Everything, even if not explainable at the outset should have some explanations and I stuck in to figure it out.  Alas, it was my ignorance of some fact, simple fact.

The function that I was debugging had the following:

           #if 0

            }

           //some statements

          #endif


I wasn't aware that the brace seen above gets accounted for by the editor (vim and source-insight). The editor didn't discount the ‘}’ inside the inactive code and hence when I navigated the conditions and loops I was taken for a ride. An ‘else’ was getting matched with unrelated ‘if’ that had me perplexed.  I had to stare at code and jump the loops and conditionals one by one to understand what the reason for my frustration was.

Some learning there!

A Mathematician’s Apology

0 comments

Reading G.H.Hardy's 'A Mathematician's Apology', I couldn't help myself feel a little unworthy (will elucidate later). Hardy puts forth fitting arguments for mathematics and exalts the act of pursuing mathematics for the sake of mathematics and without being worried about its implications. The treatise was written when he was past his prime. For Hardy, mathematics is a young man’s game and he must have been prodded to write about mathematics for he was believer in doing things and not talk about it. His words might sound condescending but we get to get his mind as he expounds his reasons in the writing.

The function of a mathematician is to do something, to prove new theorems, to add to mathematics, and not to talk about what he or other mathematicians have done. Statesmen despise publicists, painters despise art-critics, and physiologists, physicists, or mathematicians have usually similar feelings: there is no scorn more profound, or on the whole more justifiable, than that of the men who make for the men who explain. Exposition, criticism, appreciation, is work for second-rate minds.

He alludes to the fact the mathematics in its purest form is nothing short of or even better than poetic lines of great depth. And his confidence in his own craft is telling and I couldn't help nodding positively reading the following lines –

I should say at once that my defense of mathematics will be a defense of myself, and that my apology is bound to be to some extent egotistical. I should not think it worthwhile to apologize for my subject if I regarded myself as one of its failures. Some egotism of this sort is inevitable, and I do not feel that it really needs justification. Good work is no done by ‘humble’ men.

Just like how a master poet playing with words brings forth great lines, mathematicians are makers of patterns made of ideas, patterns that are beautiful. He asserts that the patterns must be beautiful and if they aren't they are not worth pursuing. As examples of ideas that are simple yet profound and possessing inherent beauty Hardy describes Euclid’s proof of the existence of infinite primes and Pythagoras proof of irrationality. One cannot disagree. Even a person with no practice in mathematics can see the beauty of the proofs. I liked the lines that Hardy uses why reductio ad absurdum is so appealing for Mathematicians –

 The proof is by reductio ad absurdum, and reductio ad absurdum, which Euclid loved so much, is one of a mathematician’s finest weapons. It is a far finer gambit than any chess gambit: a chess player may offer the sacrifice of a pawn or even a piece, but a mathematician offers the game

The other aspect that Hardy argues and argues he does with rigor is the difference between pure mathematics and applied mathematics. Hardy rates pure mathematics highly and takes comfort with the fact that his and other real mathematician’s work finds no place in utility for mankind. It is useless in making life better, yes, he argues, but at the same time it does play no role in war as does the applied mathematics.

There is one purpose at any rate which the real mathematics may serve in war. When the world is mad, a mathematician may find in mathematics an incomparable anodyne. For mathematics is, of all the arts and sciences, the most austere and the most remote, and a mathematician should be of all men the one who can most easily take refuge where, as Bertrand Russell says, ‘one at least of our nobler impulses can best escape from the dreary exile of the actual world.

 Hardy must be forgiven for having not much foresight! His favourite line of mathematics – Number Theory –plays a crucial role in cryptography and other applications that do practical good as well as evil. Hardy belabours to get the distinction between pure and applied mathematics through and I found it at some places difficult to grasp the gist. Some chapters are pending further reading for better understanding.

Hardy ends the essays with one chapter which in substance touches the life he lived as a mathematician. He considers his collaboration with Littlewood and Ramanujan as his best works and his craft being bound with them.

All my best work since then has been bound up with theirs, and it is obvious that my association with them was the decisive event of my life. I still say to myself when I am depressed, and find myself forced to listen to pompous and tiresome people, ‘Well, I have done one the thing you could never have done, and that is to have collaborated with both Littlewood and Ramanujan on something like equal terms.’

He makes a case for himself and rightly so by acknowledging that he added something to knowledge (even if useless) and helped others do the same.

Reading Hardy’s defense for mathematics and its craftsmen I rued how wrong was it on my part for not taking mathematics seriously. Yes, I knew that mathematics is an art. I could appreciate its beauty (I despised shortening the subject to and calling it 'Max'). But still didn't excel and pursue it. Unlike other art forms like poetry or painting many of us have formal education for mathematics for many years. Still, I failed in mastering the art thus wasting an opportunity. But one can defend that software writing - beautiful software at that and debugging software also to be an art though Hardy would not put anything on par with mathematics! So, I at least have an opportunity by means of my profession to ace in some form of art.

0 comments

Statesmen despise publicists, painters despise art-critics, and physiologists, physicists, or mathematicians have usually similar feelings: there is no scorn more profound, or on the whole more justifiable, than that of the men who make for the men who explain. Exposition, criticism, appreciation, is work for second-rate minds. 

Rereading  G.H Hardy's 'A Mathematician’s Apology'

Following Fish – Delightful Travelogue

5 comments


Samanth Subramanian’s debut work, Following Fish, is a collection of essays which captures the essence of coastal India that is in some way or the other intertwined with fish. The author begins following fish cuisine from Kolkata in search of Bengal’s favorite hilsa fish and along the east coast eventually ending in Mangrol a town in Gujarat on the west coast. The people of Mangrol, even today survive by building boats for fishermen. The author traces the path of fish used in Hyderabad’s famous ‘fish treatment’, does interesting anthropology in Tuticorin in Tamil Nadu, which has a vibrant, largely Christian fishing community, gets high on toddy and karimeen in Kerala, tries hunting for the best fish curry in Mangalore, explores Goans’ fondness for fishing and how the beaches and art of fishing is being lost to overdose of tourism and tries finding the real Mumbaikars — the ‘Kolis’.

How did I, a vegetarian, and one who finds even the smell of fish repulsive get hold of this book which, at the outset, appears to be all about fish cuisine? I read excerpts from the book in the Lounge magazine. The writing about the Kerala toddy shops was lucid and made me realize that the book was not just about the fishes.

What I found interesting was that the book wasn’t just about fish and the delicious cuisine, but also about the people, the places, and their history. All this written in a very elegant manner yet with simplicity.

The most vibrant of all the essays to me was the one on the fishing community in Tuticorin. This essay is a good study of the anthropology of the fishing community which is largely Christian, thanks to Portuguese who set foot here in the sixteenth century and helped the paravas (a caste of fishermen) to overcome their rivals, the kayalar who followed the Islamic faith, thanks to Arabs who arrived in Tuticorin earlier. It was interesting to find overlapping aspects between the Christian faith as is currently followed by the community and the Hindus.  Church rituals include the aradhana, the valakappu ceremony for pregnant women, prostration before the church altar and even to the point of referring to the church as kovil.

I learnt a new word from this essay– syncretism — the fusion of two different belief systems.  In a very delightful way the author renders the life of the community as they live now and the disintegration of hierarchy which was prevalent till the previous generation.

The author’s experiences trying to get good toddy and tasty Karimeen in shops that dot Kerala’s highways made for a humorous read. The author’s auto-rickshaw rides reminded me of my own observations that auto -rickshaw drivers can be very forthcoming in lively conversations if you are willing to listen. The author comes across interesting characters who help him hunt the best toddy.

Another essay that I liked was that of the hunt for the best fish curry in Mangalore. I had visited Mangalore myself and felt that it celebrated a kind of laid back attitude which I liked the most. The shutters of most shops were down at noon and the roads were bereft of traffic. My thoughts on Mangalore were reaffirmed when Samanth Subramanian described the same attitude in Mangalore. He notes that there was a restaurant which had its shutters down indefinitely on the pretext of ongoing roadwork although the restaurant’s door was easily accessible.

Other essays also made for an interesting read, particularly the one on Mumbai and its Koli fishing community. It was interesting to know the origin of the name Mumbai (from Mumba Devi, the patron goddess of the Koli community). The essay on the dying art of fishing in Goa, thanks to excessive fishing and overdoing of activities to increase the influx of tourists has taken a toll on the ecology and the culture.

Overall, this is a delightful little travel book which was written the way I wanted and not a how-to travel guide but one in which people and places speak for themselves.

Japan's Tragedy And Triumph

2 comments
Reading this post of John Cook where he points out how sensible engineering has saved  hundreds of lives in Japan despite massive earth quake I recall reading about such negligence of things which are invisible in Nassim Taleb's book 'Black Swan'.  In the midst of of great tragedy we often neglect things which aren't visible. Appreciating the great engineering work  doesn't come to mind. Taleb refers to that invisible aspects that we ignore as 'Silent Evidence'.  He uses following story  to drive home the point:

Diagoras, a nonbeliever in the gods, was shown painted tablets bearing the portraits of some worshippers who prayed, then survived a subsequent shipwreck. The implication was that praying protects you from drowning.

Diagoras asked, “Where are the pictures of those who prayed, then drowned?”

As we regret the tragic loss of life in Japan, it gives solace to the fact that man has been able to thwart nature's fury, at least to some extent.
 

Synesthesia. Majjige and Mosaru

3 comments
In one of the Reith Lectures the noted neuroscientist, Vilayanur S. Ramachandran talks about a phenomenon called 'Synesthesia'. When people with ‘Synesthesia’ see numerals they tend to associate them with a particular colour. In some cases sound can give raise to sense of smell. Ramachandran , in the lecture also suggested that we are all Synethetes' in a way. If we were to name a shattered pieces of glass and a round egg with names 'Abubba' and 'Kiki', most of us would name the pieces of glass as Kiki and round egg as Abuba. The shapes get associated with the inflections of the sound of words.

Now, this particular piece of information gets reminded to me many times in an interesting manner. In Kannada 'majjige' refers to buttermilk and 'mosaru' refers to curd. But I often get confused and use the word 'majjige' while referring to curd and vice versa! In Tamil the relation is more in line with Synesthesia. The word 'more' refers to buttermilk and 'thayir' refers to curd.

Math Beauty

0 comments





From : http://www.futilitycloset.com