Sunday, December 20, 2009

How to screw the Avatar 3D experience and alienate customers

How exactly might one go about doing that? After all, it is a James Cameron's MASTERPIECE, which will redefine CGI forever, a worthy sequel to Titanic.

Here's how Odeon, Connaught Place, a proud member of Anil Ambani's empire went about it.

You have a cinema screen with totally screwed up contrast ratio, color range that makes ugly cam prints look good and a sound system worse than a cheap pair of earphones.

And you charge people 200/300 bucks for it. Not to mention the 10x priced food to go with it.

:(

:(

Sunday, November 1, 2009

Mmap-ing temporary files

There is a cool way to allocate memory without actually doing malloc. It uses temporary files.

Here's how to do it,

1) Make a temporary file, and then use fileno() to get it's file descriptor.

2) Seek to the the end of the region which you want mmap-ed and the write a dummy data (just a "") to make the file of that size

3) Actually mmap this file with this size itself.

Why bother with all this, you ask. It can be useful to inter-operate between C land and numpy while sharing memory while avoiding memory leaks. This can be achieved by using numpy.memmap class and then passing in the numpy array to obtain the pointer.

This will in general need some amount of reworking in your library's memory allocation routine, but avoids the troubles associated with making sure that the C object is deallocated after the associated numpy object is freed.

Saturday, October 31, 2009

I wave, you wave, we all wave

I just got an invite for Google Wave, but there aren't many people around at the moment. Also I can't see any invite other folks link either. Not bad for 100th post, eh..?

Tuesday, October 27, 2009

Tweeting from python

Stumbled across this. Really cool. Now I can send myself a private tweet to keep track of my long running jobs, or just about any damn thing. I don't have to be present at the keyboard to monitor the progress for this.

The only problem, is this. No proxy support, no.... :(

Hopefully, it'll materialize soon.

Saturday, October 24, 2009

Parallel nirvana on the cheap

I just had a production run for this, it took 48 hours. Now time for some parallel goodness from python side. :) So, after much experimentation and frustration, here is a great module, and here is some great advice.

Of course, you can get it in C/C++ land too, just use this.

Saturday, October 17, 2009

Tegra2 netbooks

It seems Tegra2 based netbooks will come out next year. If it has a dual core ARM Cortex A9, running at atleast 1.5 GHz, it'll probably be faster than my present laptop in CPU power. If it has a GPU based on the 9400M chipset, it'll be faster than the gpu in my laptop too, while supporting CUDA, OpenGL 3.2, OpenCL 1.1, WebGL etc. Not to mention that it'll have dedicated hardware for video decode acceleration as well. Tegra1 devices are supposed to be capable of playing back HD video for over 10 hours on a single battery charge. Hell, if this thing can give me 6 hours of HD video playback, I am gonna love it. On a smaller process, it should get more power efficient as well, but that is probably asking for too much. Considering the amount of integration it has, a netbook based on it will likely be cheaper as well... :) :)

If this thing comes with 2GB ram, then I am definitely gonna pick one up. With Chrome OS, it could prove mighty useful as well.

4GB ram is highly unlikely since ARM doesn't have a 64 bit CPU core out as yet, AFAIK. But Tegra3, :D

So my wishlist for Tegra2 would be,

1. Dual core ARM Cortex A9 with NEON at 2GHz (it'll be fun to write an vector backend for eigen on ARM)
2. 9400M GPU
3. hardware accelerated video decode for H.264, VC1, MPEG-4, DivX
4. 2GB RAM
5. minimum 6 hour battery life while playing 1080p HD video
6. nVidia supporting Chrome OS on it. (Let's hope Chrome OS will come with some nice hacking tools with it too, or atleast there will be some community support around building distributions that allow hacking it.)

Friday, October 16, 2009

Getting colors in git output on opensuse 11.1

I just installed opensuse 11.1 on my lab machine. Git was behaving very oddly here, displaying color codes instead of color-ed output with git-diff and other commands.

A bit of googling later, I found this, exactly the same issue, but on Mac OS X. It was useful to me. Problem fixed.