Scapegoat Tree April 20, 2008
Posted by Ananth in Computer Science, Programming.add a comment
Paper by Rivest et al:
http://cg.scs.carleton.ca/~morin/teaching/5408/refs/gr93.pdf
And the mandatory sucky applet:
http://people.ksp.sk/~kuko/bak/index.html
Found this out while lifelessly grokking around boost:
http://www.boost.org/doc/libs/1_35_0/doc/html/intrusive/sg_set_multiset.html
Balanced Trees are better than unbalanced because of bounded worst-case O(log n) search time. And AVL is the simplest balanced tree. Red-Black is better than AVL because worst-case O(1) rebalancing during (Updated) insertions are guaranteed. But Scapegoats are even better because they gaurantee O(1) rebalancing AND don’t need the extra field for storing the color of the node. Strange that I have not even heard of a 1993 data structure that sounds practical enough.
Exploring Python Bytecode December 30, 2007
Posted by Ananth in Open Source, Programming, Python.9 comments
For the past month or so, I’ve been trying to understand what appears to be a black art mostly because of lacking documentation - Python bytecode generation and peephole optimization. Some notes from the study for the benefit of IRC-mate ‘jstatm’ and anyone else living on similar planes of insanity.
(more…)
Netbeans with GTK Widgets November 23, 2007
Posted by Ananth in Programming, Solaris.4 comments
Netbeans users on Solaris and Linux, who hate, detest and despise the horrible looking default Java UI, ought to add this line to ~/.bash_profile
alias netbeans=’/opt/netbeans/bin/netbeans -laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel’
Update: Netbeans 6.0 users should type “–laf” instead “-laf” (Two hyphens before ‘laf’ instead of one)
Visual Call Graph using DTrace November 14, 2007
Posted by Ananth in Open Source, Operating Systems, Programming, Solaris.6 comments
Here is an example of how incredibly powerful DTrace can be. I had to solve a problem where a nice high-level overview of the code flow in a single threaded userland application would save me some pain the backside. Lo and Behold, Dtrace - The Universal Hammer for every nail.
Here is a simple visual call graph generator using 5 lines of DTrace combined with the outstanding Graphviz graphics library.
Beautiful Code October 12, 2007
Posted by Ananth in Computer Science, Programming.2 comments
For the last two weeks, I’ve spent every ounce of my spare time trying to finish “Beautiful Code”. There will be two kinds of people: Those who think its a pointless piece of non-sense and Those who find the book a religious experience . Sharing as they did, some of their most intense experiences of programming and profound insights into the art, were legendary modern day programmers who stand tall to inspire us all: Brian Kerninghan, Karl Fogel, John Bentley, Charles Petzold, Greg Kroah-Hartman, Simon Peyton Jones and Bryan Cantrill.
The two best chapters in the book were: Beautiful Debugging & A Spoonful of Sewage.
I am ordering a hard copy so that I can pray to the book everyday
Guido on the GIL September 11, 2007
Posted by Ananth in Programming, Python, Rants.1 comment so far
Juergen Brendel who commented on my post, about the Global Interpreter Lock, wrote a open letter pleading Guido to consider removing the GIL. Guido gave a seasoned response on his blog today - Anyone willing to do the hard work is free to submit a patch for Py3K AND prove that it does not affect single threaded performance. A fair call on Guido’s part and very generous of him to respond to yet-another-rant-about-the-GIL.
LFY August 2007 August 10, 2007
Posted by Ananth in Open Source, Operating Systems, Programming, Solaris.3 comments
I had my DTrace article published in this month’s edition of Linux for You. It is a gentle introduction to the curious Unix programmer. I can’t reprint the article on the blog. But if you aren’t convinced about looking into DTrace yet, read on….
SunSpot Rules ! July 2, 2007
Posted by Ananth in Device Drivers, Open Source, Operating Systems, Programming, Solaris.2 comments
While the rest of the world drooled over the iPhone, I got to play around with a SunSPOT today. W00t !
0.99 - 0.90 - 0.09 = ? May 8, 2007
Posted by Ananth in Computer Science, Mathematics, Open Source, Programming.7 comments
I’d interviewed a few folks on Python lately as a favor for a friend. Without laboring into details, there is one question that seems to baffle most candidates consistently. The first time I had to ask this question was because I couldn’t think of anything else “sane” at that point in time - and since the reaction by the (otherwise smart) candidate gave rise to a vicious notion of a entertainment, I kept repeating the question to every single person I interviewed subsequently !
Question: If the expression (0.99 - 0.90 - 0.09) were to be evaluated by the cpython interpreter, what would be the result ?
Floccinaucinihilipilification April 6, 2007
Posted by Ananth in Computer Science, General, Programming.7 comments
Computing is interesting because it is fraught with problems. The argument that those problems are not interesting because they are man-made, is fallacious because problems of living and day-to-day life aren’t created by god either and they are usually more pointless. But that is besides the subject, which is actually something that sounds mundane but is frighteningly complicated to implement: “How to validate an Email Address ?”
kexec: The Recursive Rebooter April 1, 2007
Posted by Ananth in Linux, Open Source, Operating Systems, Programming.add a comment
I recently came across an interesting hack in the linux kernel called “kexec”. exec() loads a userland program by overwriting the address space of the process calling the syscall. kexec is supposed to do the same with the kernel. Replace the running copy of a kernel with a newly specificed kernel.
Wanted - Dtracers ! March 8, 2007
Posted by Ananth in Computer Science, Open Source, Programming.add a comment
Are you good at Dtrace ? You might have a job in hand ! Here is something that appeared in the Times of India supplement yesterday.
Its a pleasant surprise that DTrace is now a hot job skill in the Indian Market too ! Of course it helps to know the similar family of tools like CodeAnalyst, VTune, oprofile, valgrind, SystemTap, Perftools ….
Errr.. What is Programmer Friendly ? December 20, 2006
Posted by Ananth in Computer Science, General, Linux, Open Source, Operating Systems, Programming, Solaris.4 comments
Every conversation with geeks not working in Sun this week has been about ZFS and ZFS making it to Mac OS X - Leopard. I get thoroughly drilled on Sun’s financial strategy and how we plan to make money rather than being asked about instantaneous snapshots and self-healing capabilities of ZFS. Thats one of the disadvantages of working for a “Non-Profit Organization” (of which we are very proud, anyway)
Barcamp December 2, 2006
Posted by Ananth in Open Source, Programming.add a comment
I attended Barcamp Bangalore today. Was there to rant (as usual) on OpenSolaris. Barcamp is supposed to be a Web 2.0 ish place and you find a lot of doods who talk about RoR, Agile, Xtreme Programming, Springs, JUnit and such. It is a world far far far removed from my own domain of Operating Systems where I am still confused about a few AMD instructions and libc bindings. Nevertheless, Web 2.0 is one of the areas where OpenSolaris can have a really strong presence. Companies like Joyent have proved just that. So that was my excuse to spend the weekend at BarCamp.
FOSS.IN Report December 1, 2006
Posted by Ananth in Linux, Open Source, Programming, Solaris.1 comment so far
A Month of Madness November 14, 2006
Posted by Ananth in General, Linux, Open Source, Operating Systems, Programming, Rants.1 comment so far
It might well go down in history as the month that changed the World. Or atleast the part of the world that me and my fellow humans who get paid for creating strings of ones and zeroes are primarily concerned with.
OOM::Kill Me Not October 26, 2006
Posted by Ananth in Linux, Operating Systems, Programming.1 comment so far
Funny mail archived on LWN that draws an analogy to the working of the infamous OOM on Linux.
Preparing for Web 2.0 September 3, 2006
Posted by Ananth in Programming.add a comment
No one knows what exactly “Web 2.0″ is. But everybody seems to preparing for it. I am too energetic to be left behind !
DTrace on Mac OSX August 8, 2006
Posted by Ananth in Programming, Solaris.3 comments
Another feather to the DTrace cap. DTrace has been ported to MacOS !!!
Guido on Python 3000 August 4, 2006
Posted by Ananth in Programming.2 comments
Guido van Rossum explains the Philosophy, Process, Features and Timeline for Python 3
http://video.google.com/videoplay?docid=-6459339159268485356

