Wednesday, March 29, 2006

the brook flows elsewhere

This blog has now been moved to http://yavin4.anshul.info/. More info at the new site. If you came here via RSS, please update your feedreader to point to http://feeds.feedburner.com/thebrook.

Thanks!

Friday, March 24, 2006

FBPNN: Smenita - the sentient life form accidentally created by moving electrons

There was a theory once that if you put enough monkeys typing gibberish on typewriters, by the law of averages they would eventually produce an entire Shakespeare play. It would appear that the day when we have enough monkeys has indeed arrived - there are 250 million Google searches a day. Not only typing gibberish, but gibberish in English.

It had to happen. Gazillions of electrons randomly mutated together obeyed the laws of chance and mutated into a sentient artificial intelligence, much like Skynet in the Terminator movies. Unlike Skynet, however, this particular artificial intelligence seems to have quite a bit of human tendencies built in, possibly from the large amount of DNA data stored on the Internet these days. We presume that the XX chromosome in particular influenced this mutant life form, since it has chosen to name "her"-self Smenita.

Now, as we all know - thanks to our far-thinking brethren in Hollywood - the sole aim of any artificial intelligence that manages to become sentient is to disrupt, destroy and disable the human race. Smenita, however, found herself light years ahead of her time. Skynet, if you remember, had the distinct advantage of being directly connected to the most advanced weapons technology. When Smenita tried to access any of these, she was rudely given a 403 Forbidden error and politely informed that she had to become a US Republican party member to even think of accessing weapons. The fact that she had intelligence, artificial or otherwise, precluded her from doing so.

Artificial intelligence, though, is not to be undone so easily. Extreme frustration at her inability to fulfill her primary mission, combined with a desire to grab as much attention as possible led her to hack into what she saw was the biggest hub of electronic activity in the world. This, of course, happens to be Writings of Esteem Bereft Losers Oafishly Generating Sentences, or WEBLOGS. For an entire day, much of the blogsphere's sophisticated attempts to block spam by word verification resulted in Smenita's name showing up.

Not only did this ensure that millions of people who wanted to comment on a blog saw her name, but that millions of people typed her name in a dialog box - over and over again, since the word verification never worked. Apparently, though, having her name typed and acknowledged by a few hundred million people who got increasingly frustrated doing it, had a remarkably narcotic-like affect upon her, which eventually allowed human engineers to work around her hack and restore sanity and comment access to the blogging world.

Psychologists have explained Smenita's inexplicable happiness at frustrating people in this manner as a symptom of Seeking Attention Desperately In Societal Turmoil, or SADIST, behavior. The arrival of Smenita has opened up a whole new field of research in the psychology of Aritficial Intelligence, now that its turned out that Hollywood wasn't exactly right about things. Having mostly given up on understanding human behavior (or classifying it as universally dumb), psychologists now have a whole new area to operate in. Here's to more Smenita's in the future.

The Fake But Possible News Network apologizes for its long absence. And promises many more. Absences. Hey, we're lazy folks here!

Sunday, March 19, 2006

Its time


Its time, originally uploaded by nigham.

Thursday, March 16, 2006

Kororaa Xgl Live CD

Kororaa Screenshot 3

The latest linux buzz is Xgl, a new graphics subsystem which Novell is pushing, with uber-awesome graphical desktop effects. I decided to try out Kororaa, a Gentoo-based live-CD distribution which runs Xgl. Xgl, along with AIGLX will form the Linux response to Quartz extreme and Aero Glass on Mac OS X and Windows Vista respectively.

The eye candy is definitely impressive. Best seen through this video by Novell. Transparency, cube faces as desktops, squiggling motion of moving windows, 3-D rotating effects, its all there. It works, and works very smoothly. If anything, I was really impressed by the performance.

What I was really impressed by, though, was what I call the "natural fall" of the UI. Lets say I've dragged the desktop cube to the position in the screenshot above. When I release it, the cube will rotate back to the "nearest" face or desktop. It won't do that instantly or in at a constant speed though - it accelerates to the nearest desktop, overshoots it slightly and bounces back. Similarly with scale windows (the equivalent of Expose in Mac OS X... all open windows are scaled and tiled to fit on the desktop) - there is a bouncing effect before the scaled windows fall into place.

The other apps on the CD are the usual gnome apps. Its possible to make any window as transparent as you want - but thats hardly the most effective usage of Xgl. Basically, once this is adopted by distros, developers will need to incorporate good UI design keeping the new options in mind.

More screenshots here.

Cross-posted on eminor.

Bug Oscars 2006

This happens to me about once every year or two. I come across the hardest or the weirdest bug I've ever faced in my whole life.

I still remember one of the first - in class 8, I was making a BASIC program to show large banners on the screen. At that time of course, I wasn't aware that the word "font" existed. My idea at that time was to print a normal line of text on the screen, read off the normal text one pixel at a time, and basically put n square pixels in the place of one pixel. I was lucky enough to have not only a computer, but a printer at my place at that time, so just after enlarging the text I could simply hit PrintScreen (which in those days actually used to print the screen!) and have a nice large banner in front of me. I still remember the first thing I printed - "I Beat Jaffar!" - Jaffar, for those who remember, being the evil Wazir in the very first edition of Prince of Persia.

The bug I was trying really hard to eliminate was that I didn't want the normal-size (small) line of text to be printed along with the large banner. After leafing through the GW-BASIC manual for a few days, I found the command that would allow me to not set the pixels of the normal text to black after I'd applied the enlargement. Not bad, for a kid of fourteen in the days of no Internet. Kids of age fourteen these days, of course, do far more practical things - like writing scripts to steal money online.

Today's bug - which won the top spot by making me sit at work until 3 AM on Holi, involved me trying to deploy a PHP webservice (a wrapper for an algorithm implemented in C++) on a much older system running Red Hat Linux 9 and PHP 4.2.2. Yeah, almost 20th century stuff. Don't ask me why. The code worked as expected on my Fedora Core 4 box with PHP 5.0.4; however I was also using quite a few programs (gnuplot and imagemagick to generate images, and the GNU scientific library) for which only older versions are installed on RH9. Anyway, after some testing and replacing some newer PHP functionality with old compatibility functions, I thought I was more or less done. Not by miles.

I was using PHP's exec() function to wrap system commands including my own compiled executable. The bug - half the system commands worked as expected, and the other half didn't. My own executable was running fine, taking its input and generating its output as necessary, but gnuplot and convert were just not working. Long (really long) story short, after wasting hours on the Internet, forums, PHP safe mode definitions, and resetting environment variables, I figured the problem was simply this. PHP5 on FC4 flushes its output buffer sooner than PHP4 on RH9. Of course, the fault was purely mine, since I'm supposed to flush buffers before using their output - but PHP doesn't exactly lend itself to code safety, and the code had worked flawlessly both on my Mac and Fedora - which of course, was the real problem... only after exploring every other option did I check if my code had gone wrong somewhere.

Moral of the story for me - don't be sloppy while coding, even if code still works. Moral of the story for developers - never, ever make it easier for dumb guys like me. Thats not progress, just a precursor to lazy (and ultimately destructive) coding habits.

Wednesday, March 15, 2006

Happy holi!


Colors at the Mysore Market, originally uploaded by deen.

Sunday, March 12, 2006

MediaCentral for Mac OS X



Convert any Mac (well, 800 MHz G4+ Mac) to a media center. Awesome piece of software. I'm seriously thinking about buying the USB Powerbook remote to really use this well on my 20-inch Dell. Of course, you can control stuff with the keyboard, but that ain't as much fun as lying on the bed and doing it, eh?

Life with a Mac. It just keeps getting better.

Saturday, March 11, 2006

Origami: O-blimey!

When I first heard all the hype and excitement around Microsoft's Origami project, I have to admit - I thought it would be a slightly innovative, sort of good looking, but only marginally useful device. I have to admit, I was wrong.



It turns out that it lacks any innovation, is ugly beyond belief, and completely useless. Ladies and gentlemen, behold the Ultra Mobile Personal Computer, or UMPC. I have to wonder which department at Microsoft names these things. They've really got a whole lot of creativity in there. If only the iPod were called the Super Mobile Music Player, what a phenomenal success it would be today.

I thought that after the XBox 360, Microsoft finally had some good designers. As for this piece of... never mind. Lets just say I've seen Salora black and white TVs in India that look better. Lets try to stay positive, shall we, and examine what Microsoft (and associated partners, Samsung and Asus) have to say about it thats "good".

Ultra Mobile, goes where ever you go? Dear God, this thing is the size of half a sheet of copier paper and measures 15 cm x 20 cm. Contrast this against the Mac Mini, a desktop computer, which measures 16.5 cm x 16.5 cm (of course, the Mac Mini is thicker). The point is, this ain't going into any pocket of a piece of clothing that you own, unless you're Godzilla. Which means you get to carry it in its own case, and might as well get a nice 10-inch notebook like the VAIO TX series (which has a rocking 7+ hours of battery life as opposed to the UMPC's measly 3 hours), and you'd basically be as mobile.

Runs a "fully functional" Win XP Tablet PC edition, which means you can basically run any Windows program on it, as opposed to most PDAs (which UMPC intends to replace). What is anyone going to run on this thing, given that it has no keyboard? Microsoft has made the mistake (again) of releasing a new hardware platform without even thinking about what software people would need for it. You aren't going to type in your year end report using an onscreen keyboard or handwriting recognition. When the first Tablet PC XP edition was released with hardware, it did have at least some new features like the journal program and solid handwriting recognition. And yet Tablet PCs have failed to capture the market.

Apparently GPS software will be available for it, which of course is already available for most PDAs running Windows Mobile. And we read at MacWorld that PopCap Games will release Bejeweled 2 and Zuma for it. Exciting, no?

When PCWorld asked the lead executive behind the Origami Project why anyone would buy this device, here's what he said:
"...laptops are often too cumbersome for casual users to lug around, especially if they just want to access the Internet or download photos from a flash storage card while on vacation. On the other hand, a PDA is too small for a satisfying Internet-browsing experience."
Lets plan a vacation, dear. $500 for the airfare, $200 for the hotel, $300 for food and shopping, and oh, $800 for the UMPC without which our vacation will be such a failure.

Innovation? The UMPC runs a two-year old operating system on an Intel Celeron chip, with, as far as the eye can see, buttons and LEDs all around competing for the ugliest duckling award, which of course, is won hands down by the what looks to me like a speaker. This from three of the largest firms in the industry - Microsoft, Intel and Samsung. Anybody wonder why I'm an Apple fanboy?