Sunday, March 28, 2010

Python reference management

I ran into a crazy Python reference management behavior today. I wanted to do

x=y=[None for i in xrange(10)]

and then add elements to both x and y separately. Basically, wanted to avoid creating an empty list and then append stuff to each. No particular reason, just for the heck of it.

Turns out there is some kind of weird reference management policy in Python, which it so happens that I don't have the time to dive into right now. What this does is that it couples x to y, in such a way that changing elements of one affects the other.

So, the solution is to change the above line into

x=[None for i in xrange(10)]
y=[None for i in xrange(10)]

Monday, March 22, 2010

x86-64 unsupported.

Sorry we don't support the X86_64 build environment (we never use it internally). An AMD employee, who presumably works on open64, in Dec 2009.

I am not sure whether to laugh or cry.

Sunday, March 21, 2010

New/old style classes in Python

I just got bitten by the new/old style classes in Python. :P

Here's a reasonably good description/discussion/summary/...

Thursday, March 18, 2010

GPU acceleration in IE 9

This is definitely something exciting.

It's nice to see GPU acceleration coming to consumer apps other than games. :) In the next couple of years, we can expect pervasive support for fast texturing and drawing in web browsers. Even though it leverages just the classic "drawing lines and triangles" bit of gpu's and not their emerging compute side, with imminent merger of cpu's and gpu's, I think gpu's might have found their killer app for the non-gaming folks. With on-die gpu's and faster JS, I think web apps are going to get quite cool, especially in the hands of competent web developers.

At any rate, it seems doubtful that web developers will stress even the lamest gpu's of today. They are just too ridiculously fast for these kind of workloads. And JS is going to be dog slow compared to C++ for ages to come. Unless, of course, somebody hires Mike Pall to speed up their JS engines, at which point all bets are off. :)

More generally, better web standards support from IE is great to see.

From the hardware accelerated video decoding point of view, I think Firefox going to be a loser here. H.264 seems to have won the web video codec war and so far Mozilla's policy has been to avoid it like plague.

Overall, these are exciting times for all those who browse the web, as your vehicle is about to get a serious overhaul.

I have only one question with that article. Since when has Apple solicited any kind of consumer feedback in the design phase for any of their products?

Monday, March 8, 2010

Swiftfox

Swiftfox, an optimized build of Firefox for Linux is pretty good with speed. I am running the 64 bit build of 3.6 and it's cpu and mem usage seems pretty good to me. They have prebuilt binaries, but only for Ubuntu.

Check it out.