28 February 2006

Degrees of separation

There are, supposedly, six degrees of separation between any given actor and Kevin Bacon. Of course, in our connected age, it didn't take long for a bunch of geeks to colonise the concept and to associate a numerical quantity with the concept. Hence the Bacon Number, which goes along the lines of:
  • Kevin Bacon has a Bacon Number of zero
  • An actor/actress whom has appeared in a movie with Kevin Bacon has a Bacon number of 1
  • The Bacon number of any individual actor/actress is then is defined as the minimum of the Bacon numbers of all the co-actor/actresses he/she has appeared in a movie in, plus one

(Induction, woo!)

The concept got an honourable mention at this years sci/tech Oscars ceremony; it's probably too much to hope that it'll get a mention at the main awards this weekend.

Incidentally, the concept of the Bacon Number is derived from the Erdős number, which is the minimum distance by co-authors via publications to the late mathematician Paul Erdős. Blowing my own trumpet, at the moment, I have an Erdős number of 6 (see here - requires mathscinet access). The link was provided via a paper I co-authored with Mikhail Propenko, who has an Erdos number of 5. There is such a thing as an Erdős-Bacon number; informally, the lowest number is, in fact, held by an inanimate Baseball (in rod we trust!).

Degrees of separation feature strongly in research into social networking, often going hand-in-hand with work in graph theory. The nifty thing about it is its broad area of application; an example of which is the Wikipedia degrees of separation calculator which has been sucking up a lot of my nonexistent spare time :P

15 February 2006

The queue

You'll have to pardon me if I've been a bit incomprehensible recently, I've been busy writing yet another paper. Hopefully this'll be the last one before I start my write-up in earnest. The basic gist of it is that I'm writing a paper on squashing brains, which always makes for some rather confusing after-dinner conversation.

Anyway, I've been wanting to keep up with Hiren's stream of consciousness dissertation on programming, so here's my attempt at turning your own brain to a liquefied pulp.

I've had the recent displeasure of needing to build ATLAS, LAPACK and CVMLIB, which all together provide an optimised library for linear algebra, needed for our real-time simulation work. Building on x86 presents few problems, with ATLAS only needing three hours to build (!!), giving me a bunch of static (.a) libraries which I can happily link against. For me, a good set of optimisation flags for gcc, on pentium4 processors are:

-O3 -pipe -march=pentium4 -ffast-math -mfpmath=sse -msse2

On pentium-m (e.g. laptop/centrino)

-O3 -pipe -march=pentium-m -ffast-math -mfpmath=sse -msse2

On x86_64 (notably, on AMD64, such as Athlon and Opteron), it's a whole different kettle of fish. Here, I've discovered, if you build your libraries as shared (.so), then you need to build the libraries you link against also as shared libraries, and build the objects with position independent code. This is complicated by the fact that LAPACK, ATLAS and CVMLIB's build scripts are written to mostly generate static objects :|

The solution lay in manually adding -fPIC to pretty much every compile line in building the libraries (usually by editing the top-level make include file), and then repackaging the ordinary static libraries as shared .so files. This can be achieved using a small shell script:

mkdir tmp
cd tmp
ar x ../$1.a
gcc -shared *.o -o../$1.so
rm -rf *.o
cd ..

To create foo.so from foo.a, simply run:

./conv foo

It's a little ugly, but it does work. Additionally then, I've found the set of optimisation flags on x86_64 that work for me are:

-fPIC -funroll-loops -march=k8 -ffast-math -fpeel-loops -m64

The -m64 does make a significant difference; I've found that, in practice, the linear-algebra routines I run (matrix inversion etc.) run about 10-20% faster with -m64 on AMD platforms. If I had time, I'd like to properly check that out. Oh well.

I've also been keeping up on building a variety KDE packages for Mandriva 2006; the latest selection of (mostly eye-candy) RPM's are here, including a 1.3.7 build of the comix window decoration.

And now, since the medium of blogging seems to demand it: indulge yourself with some alternative entertainment.

6 February 2006

What would Cthulhu do?

Well, I'm over whatever funk I got into about my PhD. Tis all back to normal again, and now I'm merely tearing my hair out over the paper I'm currently trying to write.

Anyway, clearing the backlog of what I've been up to.. back to LA. I had Saturday afternoon to kill, so I went and re-walked along Long Beach; I didn't go as far as last time, but I did get to that pier again (map). It wasn't all that satisfying really - I've seen both sides of the Pacific now, and it looks pretty much the same from both sides. I still had a little time, so I asked myself - what would Cthulhu do? So I headed back inland.

Not far into my sojourn back downtown, I was wolf-whistled at. This was not a bad start, so I looked around to find the source of this welcome attention, and it was..


..a god-damned parrot. Sitting on this dude's shoulder. Bloody pirate. Ego crushed, my inner geek took over and I caught the bus to the nearest bit of big engineering - the Queen Mary.


Its a big ole boat, and apparently the last big Atlantic liner in its class that's all in one piece. It serves as a floating hotel now, but the sheer size of it is still quite impressive. There was plenty going on around the place (including a cheerleading tournament), so the area around the ship had a friendly buzz which was distinctly lacking on my last visit. If you wanted to, you could go for a tour around the area on a segway scooter. These bizarre vehicles are truly weird to watch, and now that I've seen people scooting around on them, quite unappealing.

However, something that stopped me dead in my tracks, something that sucked me in by its sheer monstrous kitsch tackiness, was an outlet of the Outback Steakhouse:


Folks, this was kind of surreal. I have to confess, I've never been to an Australian theme pub (and there are quite a few of them around), so visiting an 'Aussie' theme restaurant was a little startling. The food and the service was nice enough (and yes, export Fosters is actually barely drinkable) - however, the interior of the place was a sight to behold. The place was literally infested with kangaroo and koala motifs, with surfboards and boomerangs liberally nailed to walls. It was a little unsettling, like stepping into a version of what I imagined Australia was like before I moved there.


However, the decor had nothing on the menu. "Bonzer times start with awesome Outback Tucker" - I can't make this stuff up. The signature dish was this abominable giant fried onion thing (an Australian ab-original!), coupled with such rarities as the "Too Right French Onion Soup" and "Prime Minister's Prime Rib". On the drinks menu, they even managed to insert a 'h' into 'Bondi'. It was, for the little time I was at the restaurant, like being in another world.

In an even stranger turn of events, this theme restaurant franchise is now opening restaurants in Sydney (yes, that's an American-based Australian theme restaurant operating in Australia). The local menu isn't quite so hideously kitsch ("no rules, just right - g'day mates!"), but it'll be interesting to see how it is received in the long run.

Anyway, now I should get back to writing that paper ;)