To us, here and now, it appears thus

Rants, Ramblings and other things that make life worth living

Bad Error Handling on CBS website.

without comments

Random day of web surfing and I came across this gem - bad error handling on the CBS website . Can you spot it in this screenshot?

screenshot.png

Take a closer look at the Popular Tags section.. now do you see it? Here is a higher resolution image of it.

zoomed in error on the CBS page.

Signing Off,
Vishnu Vyas

Written by admin

March 7th, 2008 at 6:30 am

Posted in Geeky Stuff

Is Eclipse the next Emacs?

with 5 comments

Emacs, for those who know me, I am an big fan of, almost to the point of being religious. And and recently I’ve found another one - Eclipse. Emacs, as most would know is the ultimate editor that is written in a dialect of lisp called elisp (which predates attempts to standardize lisp and common lisp) - was the result of a time and a place where almost every programmer wrote lisp, AI was a buzzword and Symbolics was a household name.

Thus, emacs, naturally was written in the language of its time - lisp. With over 3o years behind its belt, emacs is now a mature multipurpose software application that most people go to the extent of calling it an operating system. The things that made emacs such a huge success story was not only was it written in lisp, the language of the day, it was also extensible in lisp, the language that most programmers who first used emacs knew. Thus, every pet-peeve of almost every programmer was solvable with just a few lines of elisp. Extensibility - Thats what made emacs a huge success. With packages for everything from terminal emulation, remote editing, newsreaders and even a web browser - Emacs is one multipurpose software application.

With, the coming of the AI winter, lisp lost ground and eventually gave way to Java. Java, being severely used in the past 10-20 years has become the lingua franca of the time. And, with Java we have another emacs incarnate, something that’s not only written in Java, also extensible in Java - eclipse. It has the same extensibility as emacs has , though not as mature in terms of extensions as emacs. So, Is Eclipse the next emacs?

Signing Off,
Vishnu Vyas

Written by admin

March 4th, 2008 at 3:48 am

You Know You’re Old When..

without comments

You know you’re old when, that new and upcoming superstar that you think is really hot is actually younger than you are.

Sigh, yet another sad day to reminisce over missed opportunities.

Signing Off,
Vishnu Vyas

Written by admin

February 25th, 2008 at 4:19 am

Internationalization done right!

without comments

Even though Orkut - google’s social networking website neither has the market share or the mindshare rivalling that of Facebook or MySpace, google’s ingenuity never ceases to amaze me. So, what am I talking about? Orkut’s new feature which integrates multiple languages and lets you mix and match as you wish - with nothing more than a simple keystroke

For all those who want to type in thamizh, thanglish or plain old english, orkut can do it in a very “google” fashion with simple phonetic typing, ajaxy pop-up suggestions and switching languages with just one keystroke.

Here is an example of what I am saying and what other “multi-lingual” word processors should emulate .If they get this into google docs, I am thinking its pretty much a done deal for a lot of people who are stuck with a latin keyboard shoe-horned to fit languages that just aren’t immediately compatible with languages like tamizh.

Here is how it looks.

orkut’s multilingual mix and match.

If you look at it, not only does it let you type tamizh in a phonetic sense, it also does away with the problems most phonetic typing schemes have when they are dealing with languages like tamil which have more liquids than I care to count, by simply using a well tested UI idiom - pop up suggestions. Its amazing that they do this in realtime in a web interface.

This is precisely what every one wants. No one, ever actually uses a tamizh all the time. Most of modern Tamizh’s vocabulary is approximately 20% English. And, people can ’scrap’ (orkut’s equivalent to facebook’s wall). each other just the way they would talk in real life. And all it takes to switch between the two is a simple keystroke.

So, Kudos to Google.

Signing Off,
Vishnu Vyas

Written by admin

February 19th, 2008 at 12:07 am

Posted in Geeky Stuff

All Science is Computer Science

without comments

This is in continuation of this post, so for any background and a general introduction of my point of view on this subject take a look there.

My thoughts when I initially wrote the previous post, where much unclear – a bit foggy and nebulous. Now, I believe that I have a more concrete version, or at least one that is a little less foggy. My study of the fundamentals of computer science has grounded my faith in the fact that this is as fundamental a science, as much as physics or mathematics, if not more. Computer Science studies things that can be computed by beings of finite resources – be they humans made of meat and bone or be automatons constructed of metal and electricity.

It is the study of what is possible in a finite universe. The nature of truths privy to us – beings of finite resources. What can be efficiently computed and what cannot. These are the fundamental questions of computer science. How hard is really hard? Are there easy ways to get around the hardness of problems? These questions are what a people who work on the frontiers of the body of theory that make up computer science ponder about. And unlike the esoterica of mathematics or the alienated theories of physics - The questions that computer science endeavors to answer have bearing on the real world.

From improving the efficiencies of every day corporations to fundamental questions about the market - questions that have plagued economists for decades, with the tools of computer science are within our sights. Our approximations to what cannot be answered precisely can be given limits of error. It gives us the tools to tell, if we are not at the truth, at least how far are we from it. From the fundamental building blocks of all life - DNA to questions about the most refined form of human intellect, Language. All are now under the sights of computation. What nature does and what can nature do? The ultimate limits of reality and our perception. All answers to these questions have their answers inside of computer science.

This article would require an entire book to be written, but for now, I shall contend my self with writing small expository examples via posts here, of the tall claims that I’ve made in the previous paragraph.

Till Then,
Signing Off,
Vishnu Vyas

Written by admin

February 10th, 2008 at 8:16 pm

Posted in Geeky Stuff

The Emacs Tourette’s Syndrome

without comments

It’s been a long time since I’ve posted anything here. So, just to get back my “writing” spirit and please the gods of the blog world, here I am with something that many might find mildly funny.

Anyone who has used emacs enough would have automatically got into the habbit of typing C-x C-s, to save whatever it is that is in their buffer. But if you have used it as much as I’ve, then you would have gotten into the habbit of doing this so often, that you do it unconciously, whenever you are near any sort of keyboard. Infact I was totally oblivious to it untill a friend pointed it out.

The response is automatic, reflexive and almost uncontrollable, just like Tourette’s syndrome just for those who have used emacs - an Emacs Tourette’s Syndrome.

 Signing Off,
Vishnu Vyas.

Written by admin

February 9th, 2008 at 4:04 am

Posted in Geeky Stuff, General

Muahahaha……

with 2 comments

gazaam 19% cat /proc/cpuinfo | grep processor
processor       : 0
processor       : 1
processor       : 2
processor       : 3
processor       : 4
processor       : 5
processor       : 6
processor       : 7

Feast your eyes on that.. and feel belittled ….. muahahaha…. muahaha….

Signing Off (Feeling really lordy),
Vishnu Vyas

Written by admin

December 19th, 2007 at 2:55 am

Posted in Geeky Stuff

Nice little regular expression tester.

without comments

Regular expressions, if you are not a perl expert are often a pain in the ass to write, test and debug. Espescially if you are in python where there are a bunch of methods of doing extremely similar things, yet not quite the same. I found this really handly little regular expression testing tool, which runs off a web-browser and can run on your local computer called retest.

It uses ajax to make things simpler and more interactive and really useful if you are trying to parse really weird stuff.

Signing off,
Vishnu Vyas

Written by admin

November 25th, 2007 at 5:57 am

Posted in Geeky Stuff, python

Is Type-Safety an Illusion?

without comments

Today, I had an interesting conversation with a friend of mine, a self-professed Java geek and some one who is a hard sell for dynamic languages like python. And our conversation came back to the same topic, again and again - type safety. From what I know of Java, it seems more or less highly type safe unless there is some sort of ugly reinterpret_cast like construct. But, coming back to my home ground of C++, thinking about it, C++ is not really type-safe, In more cases than others, type-safety is nothing more than an illusion. C++, being a multi-paradigm language has a whole host of powerful and extremely useful features, which also makes shooting oneself in their foot extremely easy.

Here is my top three really useful features, which also are the big type-safety pitfalls.

  1. Variadics : Variadics is a really handy feature in C++, but its current syntax is a dark abyss for getting into type-safety hell. The way currently one handles variadics in C++ is this unholy mess of macros all starting with “va_”. These macros not only manipulate the stack directly, but return a memory image of the object. So, unless you are very sure of what type you are getting your hands dirty with, you are going to come up with serious bugs. The case here is even worse than python, where when you do the wrong operation on the wrong type, you get a run time exception. Which in my opinion is more type safe than the current scenario in C++.
  2. reinterpret_cast : reinterpret_cast is another potential pitfall that I’ve come across, especially when I am prototyping in C++. Sometimes, its just easy to do a reinterpret_cast and forget it. Its really handy when you are trying to develop with some one else’s code. That damn singleton class which needs one tiny extra bit of functionality that you absolutely definitely require, but you can’t extend it. So, what does one do? An ugly reinterpret_cast. And you’ve given yourself a golden pass to type-safety hell.
  3. void * pointers : These are the worst offenders. I am sure, everyone who has programmed in C++ have had enough pains with knowing how bad these little bastards can make your life. I won’t add to the woes, but just let me mourn along in silence here.

Signing Off,
Vishnu Vyas.

Written by admin

November 12th, 2007 at 10:41 am

Flexing my fingers.

with 2 comments

It’s been quite a while since I wrote anything of any significance these days. My blog seems to have moved into a more or less vegitative state. Also, since I am in line for quite some writing in the coming days ahead I think Its about time I did some emergency CPR here and get this blog back to life. Anyway, as a start, maybe I should start with a story. No, its not one about damsels in distress and charming princes. Its a more mundane story about programming.

This happened not so long ago, I’ve always been a pretty good C++ programmer, and of late I’ve been doing a lot of my programming in python. Python, if I hadn’t mentioned before, is this amazing dynamic language which is amazingly easy to use and more importantly maintain. Its one great language, except for its speed. For most practical purposes I never had any problems with the speed of python. But, sometimes when you have to wait for an hour to get some output on some data you are processing, it gets irritating. The task here was simple decipherment. I was basically using the EM algorithm (or to be more precise, the forward backward algorithm) for deciphering a piece of text. I managed to write a pretty good implementation of it in python, but it was slow - real slow.

So, I sat down and rewrote the forward backward algorithm in C++ (in the time that my python program was running) and the speed difference was unbelievable. My C++ code went 40 times faster than my hand optimized, psyco-compiled python code. If you have programmed in both C++ and python, you already knew that. C++ is faster than python, atleast 10-fold on the average. But thats not the lesson here.

The most amazing thing was, I actually managed to write, debug and get a working version of the C++ program in less time than I would have expected it to take. That’s the most surprising part. So, I’ve decided to share my experience with you guys. One of the main things that really helped me during my C++ development was not only did I have a very clear goal of what I am doing (which most software projects rarely have), but I also had a very clear goal of how I was going to do it. This was because, I had already implemented my original version in python.

Python, as someone has already said, is executable psuedo-code. Not only did I have a very clear idea of what data structure to use where, How to model the various elements (in this case, the plain text, the cipher text, etc..) and how my models interact with each other. This was all ready done, the only thing remaining was more or less manual translation from python to C++. The whole lesson here is that python is not only a great language for exploratory programming, but its a great language to prototype as well.

I am sure, that if I had started all this in C++ from the beginning, I would have been just too lazy to do all the refactoring that my code would have required. Changing from one type of object-method interface to another is pretty much a pain in C++. On the other hand, by the time I had my python code running, not only was it a correct working version, but a well designed version as well. Any screw-ups in the initial design were promptly corrected without too much effort. Any useless “just in case virtual functions” that would have cropped up in my C++ were not there because, refactoring is so easy in python that you can add them as you go. And most of all, you can test for all the bigger logical errors that occur when you have multiple objects interacting with each other in a complicated program in a python program easier than in a C++ program.

As, an unexpected side effect, I picked up a couple of good habits from python that I would have never bothered to do in C++ for my hobby programming. For example, unit-testing. I do write unit-tests, only if my projects get big enough that I think Its worth the trouble, but with python, you always have this simple if __name__ == '__main__' which serves as a poor man’s unit test. Not too much trouble, yet worth the every second you invest in writing simple tests there. These days, I do it as a matter of habit for all my python modules, and thats one good habit that spontaneously extended to my C++. With a bit of preprocessor magic, you can do pretty much the same type of poor-man’s unit-testing in C++ as well, and this did save me some pain later.

Now, that I’ve rather incoherently rambled on, I would like to summarize my experience. With, python you can not only prototype with great speed and get a clean implementation, you also end up picking up a lot of good habits on the way, that not only makes you a better python programmer, but a better C++ programmer as well!.

Signing off,
Vishnu Vyas

Written by admin

November 11th, 2007 at 9:32 am