Wednesday, March 21, 2012

On mathematical maturity

I have heard this term being thrown at students ever so often that it's entered my common vocabulary now. Nevertheless I didn't realize this loaded term had an entire page on wikipedia dedicated to it -> http://en.wikipedia.org/wiki/Mathematical_maturity In short, it's just the ability to deal with proofs. What then is a proof, I'd ask. A formal definition doesn't matter really. As Scott Aaronson of MIT likes to put it, it is sort of useless "for when you’re doing your homework...a proof is an argument that can withstand all criticism from a highly caffeinated adversary." Works!

P vs NP and Chekhov

 Just like Chekhov said, 'Every happy family is alike. Each unhappy one is unhappy in its own way.'
- Dr. Sampath Kannan (talking about P and NP class problems)

Thursday, September 2, 2010

Arrogance...huh?

So many times have I heard people at work imply in words that developers /programmers /coders /technologists  tend to be arrogant and I often wonder if it has any truth to it.The more I think about it the more it seems to the contrary.
Being in the field of technology is supremely humbling. By the sheer rate of obsolescence, it ensures that even in a limited scope of one's field it's rather difficult to claim to be a know-all. The good thing about that is that it urges one to rejuvenate that thirst for new things which IMO should be the single most significant reason to want to be in this field to start with.It's certainly not for the faint of the heart narcissists.

Wednesday, September 1, 2010

Java HotSpot Compiler optimization causes missing stack traces

I recently started looking into the JVM internals and have been having a good time discovering a few things. Will keep documenting interesting stuff as and when I find them.


A particularly interesting JVM optimization is that if a certain type of exception is thrown a number of times closely together, the compiler optimizes the code to return the same exception instance, with an empty stack trace. It's easy to reproduce this behavior in a few lines. I saw this happening using JRE 1.5 on my machine.Looks like this is true for all kinds of Exceptions. Tried it for NullPointerExceptions, ClassCastException and ArrayOutOfBoundsException and it held true.


Although a useful optimization, missing stack traces in a production or any troubleshooting scenario can be baffling. To avoid missing stack traces , using -Xint flag or JAVA_COMPILER=false could force the VM to run in an interpreted mode at an obvious cost of performance. 
Another workaround is that with the JVM flag -XX:-OmitStackTraceInFastThrow we can disable the performance optimization of the JVM for this use case. If this flag is set, the stacktrace will be available.From the Sun release notes:
"The compiler in the server VM now provides correct stack backtraces for all "cold" built-in exceptions. For performance purposes, when such an exception is thrown a few times, the method may be recompiled. After recompilation, the compiler may choose a faster tactic using preallocated exceptions that do not provide a stack trace. To disable completely the use of preallocated exceptions, use this new flag: -XX:-OmitStackTraceInFastThrow."


This has enticed me to look into JVM optimizations in details. More on that soon.

Wednesday, February 10, 2010

RubyConf India , 2010

India is all set to host the first ever RubyConf on March 20-21, 2010. And ThoughtWorks is all the more part of the Ruby history in India by virtue of being the Platinum and technology sponsor.
RubyConf is a community event that brings together Ruby enthusiasts from across India (and even some international participants - yes people are flying down for this from as far as LA!!). It usually happens internationally and is now happening for the FIRST time in India.It features prominent authors and speakers such as Chad Fowler, Ola Bini and Nick Sieger.TW is the main sponsor and organizer supported by Ruby Central and co-sponsors.
A great platform to network and learn abt the latest in the Ruby world.No wonder 200 delegates from the Ruby community will attend and we're almost sold out even before the first week of opening registrations.




I'm supporting RubyConf India 2010

Thursday, December 17, 2009

Glims for Safari

Firefox was a clear winner this far... the sheer configurability and the usability edge it had over Safari. Being a Mac user , Safari was the natural choice though... the easy integration with OSX (Keychain et al) was indeed convenient. Easily faster and lighter than Firefox , Safari 4 would be the perfect browser what with its slowly but steadily growing list of plugins ...if only Apple could have done away with the usability issues that turn me off in v4.
However, what saved the day is Glims.(Get it here). Here is a quick and dirty list of things that I used to miss the most that make the Safari experience so much better now.

  • Adding and managing search engines. Lets me add shortcuts and keywords like in FF.
  • Undo Close Tab (Command-Z). Big convenience for the clumsy me.
  • Autocomplete in forms
  • Saving tabs from last session
  • Better managed download folders - dated downloads
  • Closes download window by default . Small detail but liked it.
  • Suggested search previews in the search toolbar. Jazzier than FF if not better.
  • Tab navigation using . and ,
None of these are things which make it better than FF but all of them definitely bring it at par with its interface.
Next on my list to improve my Safari window are SafariStand , FLVR (or VideoBox now) and TabExpose

Tuesday, December 15, 2009

First day with Windows 7

Finally found time to install and start running Win 7 on my Apple machine. A quick upgrade to Bootcamp made sure the installation went on pretty smoothly. At the end of it , the only problem I'm stuck with is the missing drivers (the trackpad refuses to work for one). Will get around to it sometime.

So the much hyped user interface is actually good. Though being a Mac user , I didn't find anything remarkable in any of the new razzmatazz. The OS is noticeably faster , cleaner, shinier. For anyone used to the old Windows interface, a few changes could take a day or so to get used to (have seen people fumble a little with the new Control Panel layout, similarly with the IIS management ), but all in all refreshing changes.

A funny thing happened ,though , when the Win7 machines were first plugged into the LAN, the PCs refused to connect. Suspecting a larger network issue , our sysadmin set out to unravel why. Turned out when the Win7 machines sent out a gratuitous ARP request, they actually received a response...each time! And not because of some IP conflict. Looked like the machine ended up responding to its own gratuitous ARP creating an appearance of another machine on the network with the same IP. A registry tweak finally resolved the issue but has to be done on each Win7 machine to let it log on to the network.

This is more a cute-funny mistake than a bug probably but for market leaders on desktop OSs , as a colleague puts it... "banta nahi Bhai"("It's not done, dude").