Friday, March 31, 2006

I'm Going Back One Day, Come What May...

The TV was showing Man on Fire this evening, a mutilated version of course, so I decided to watch the full movie again. I've already seen the movie 3 or 4 times, but man, that is one good film. First of all, I'm a fan of Tony Scott. From Top Gun, to Crimson Tide, to Spy Game, to Domino, I've liked all the films I've seen from him. I even quite enjoyed Beat the Devil, although I enjoyed all of the BMW Short Films. Anyway, I quite like the style he has adopted in his past couple of movies that I have seen. The camera work, the laconic characters with smart one-liners, the unusual sound tracks, I like them all. Man on Fire is his best, in my opinion, along with Top Gun. The performances by Denzel Washington and even Dakota Fanning are brilliant. Add to them Mickey Rourke and Christopher Walken, and the cast becomes ideal. Among all these good performances though, Denzel's stand out. He is so cool as the lone cowboy, the "maverick", who has lost the will to live. Added to all this goodness, the sound track is amazing, and I mean it. I have already heard "Blue Bayou" by Linda Ronstadt (discovered through the film's script, which I read way before I saw the movie, but after I saw it's super-electrifying trailer,) and "Una Palabra" (A Word) by Carlos Valera (I heard it on Powder Keg.) You don't get to hear the complete Blue Bayou in the movie, that's why I strongly suggest anyone interested to get their hands on it. It's fabulous. While you're at it, get Una Palabra too. Both are very sad, but totally worth it. I haven't seen the original 198x Man on Fire film so I cannot say which one is better, but if it's any better than this, it must be among the 10 best movies of all time or something.

Wednesday, March 29, 2006

... This Monster Lives!

Remember me talking about my new graphics card? Well, it half died about a week ago. That was very bad, because I hate my hardware dying even if it is something I don't store data on and is still covered by warranty (believe me, I have broken my share of hardware!) That was part of the reason I have not posted anything here for some days. That and the fact that I was really, really distracted and busy. Well, about 10 minutes ago, I swapped out my previous card (GeForce 4 Ti 4200, which I had to fall back to) for the new one (GeForece 6800) after hand deleting all the driver DLLs (which was a stupid move, if it hadn't worked) and voila! I'm typing these while listenning to the absence of the noise a GPU fan! (My monster uses some kind of pipe system with HUGE heat-sinks on both sides, and no fans.) You could almost hear my mad laughter from a Femto-Parsec away!

Tuesday, March 21, 2006

Grand Schemes, Great Adventures!

I have always been fascinated with computer graphics. From the days even before I had a computer, I was really really attracted to video games (what boy isn't?) and not only for the sake of them being games. I wondered what made them move and jump. I remeber watching and later playing "Last Ninja II" on Commodore 64. I think that's the earliest game I played extensively and can still remember. There was a game called "Tusker" too, but I never got anywhere with that. I must add that these were the early games, before I got my own C64. After that, it was an hour BASIC, and two days of games. When I got my PC, the ratio became 1 hour to 10 hours, then 2 hours to 10. Right now, I program for a few hours, I do other stuff (that I hate) for another few hours, then play for that same amount of time (simple life I hear you say. Well, not quite.) I got distracted. I was trying to say that I became interested in interactive computer graphics because I was and am interested in games, and the interest stuck with me. Almost all of the programming fields I entered was because of this interest. I became interested in programming for performance, for restricted memory, program on the bare metal, assembly programming, the hardware interfaces, systems programming, design and analysis of algorithms, 2D and later 3D rendering techniques, etc. It all was directly or indirectly influenced by my drive for interactive graphics. Throughout the years, I've never worked professionally or even really seriously on the subject, but I have acquired some experience and knowlege (nothing great, just tidbits.) Now, I have decided to write a series of tutorial-like articles in my blog, to help the beginners scale the barrier and enter the field easier. What I'm gonna do is this: I'm gonna talk about the basics, the jargon and the definitions. Then we'll enter 2D world, to go over drawing and animation techniques. Then we'll try our hands at some 3D programs. I'm going to write these series for those who already know programming. I'm going to use C/C++ as the primary language. I'll be using Windows (bite me!) and Microsoft Visual Studio myself, but I'll try to remain portable. We'll use SDL to simplify things without sacrificing power. When we enter the third dimension, we'll use OpenGL API. We may even touch upon GPU programming! Stay tuned!

Norooz

Today is the first day of the year in the Iranian (Persian?) calendar. We call this day the "Norooz" which means "new day". As you non-Iranians may or may not know, today is the first day of Spring. More accurately, somewhere between yesterday and today was the exact Vernal (spring) Equinox. Incidentally, Iranian calendar is the most accurate solar calendars that's in use. Of course, that's probably because it's based on year-to-year observation rather than a fixed and relatively simple set of rules. This year was the first year that I wasn't with my family at the moment of the turning of the year. I was en route back from Tehran, from a business trip that got too long.

Friday, March 17, 2006

Let's Start a War... Start a Nuclear War...

I just read this eye-witness account from the first A-bomb test (in Los Alamos, New Mexico, about three weeks before Hiroshima and Nagasaki)
It blasted; it pounced; it bored its way right through you. It was a vision which was seen with more than the eye. It seemed to last forever. You longed for it to stop. Altogether it lasted about two seconds. Finally it was over.
Don't know about you, but the idea of wars and weapons gives me chills. Reminds me of a childish poem "The Peace Proposal" by Shel Silverstein.
THE PEACE PROPOSAL Said General Clay to General Gore "Really must we fight this silly war? To kill and die is such a bore". "I quite agree," said General Gore Said General Gore to General Clay, "We could go to the beach today And have some ice cream on the way". "A grand idea", said General Clay Said General Clay to General Gore, "We'll build sand castles on the shore". Said General Gore, "We'll splash and play". "Let's leave right now", said General Clay Said General Gore to General Clay, "But what if the sea is closed today And what if the sand's been blown away?" "A dreadful thought", said General Clay. Said General Gore to General Clay, I've always feared the ocean's spray. And we may drown." "It's true we may. It chills my blood", said General Clay. Said General Clay to General Gore, "My bathing suit is slightly tore. We better go on with our war." "I quite agree", said General Gore Then General Clay charged General Gore As bullets flew and cannons roared. And now, alas, there is no more Of General Clay or General Gore.
I'm not a fan of Shel Silverstein's. I just saw that quote about the first nuclear bomb test and was mulling about how much I hate wars that I remembered reading this poem on a plane to somewhere. Took quite a few minutes to find it.

Monday, March 13, 2006

I Hungary!

A few weeks back, there was an online programming contest, held as a qualification round for the 2006 Challenge 24. Teams of 3 with no restrictions compete for 5 hours, solving unusual problems. The first 30 of them are invited to Budapest for the 24-hour programming contest, that is, Challenge 24 (Actually, only 27 are invited. The first 3 teams from last year are invited too.) We only had half a mind to compete anyway. By we, I mean the usual team: bme, eam and me (yzt). bme and I were in our respective homes and eam was at his university, in Tehran. We decided to stay where we were and try our hands at a "distributed" contest and communicate using the fine technology that is AKVoIP (Any Kind of Voice over IP! It includes normal VoIP technologies and the multitude of voice-enabled chats.) To make a long story short, it was a disaster execution-wise. I have never used instant messaging software before (a fact that I'm proud of,) except for limited use of Google Talk. We had to try half a dozen of them (OpenWengo, Skype, Google Talk, Gaim, Yahoo! Messenger) before settling on the latter. eam just dropped in at the beginning of the contest, said hi, and went off so we were one person short! The communication overhead was too much. On the other hand, we (the remaining we) were competing from the comfort of our homes, and to me, programming on Mike (my box) is quite a pleasure. Everything works the way I want them to (at least I want to believe so!) and I like my chair and desk a lot. The Electronic Contest ended with us (our team name was "Balefire") in the 32nd or 33rd position. Then they processed the remaining submissions and we came to be 27th! I mean, how non-auspicious is that! Now the real challenge started. We had to get passports (eam and I) and that required a plethora of letters, forms, running from here to there, from Mashhad to Tehran, etc.) and to top it off, we have new year's holidays ahead of us. It was and is very time-consuming! Although I should probably mention that bme did the bulk of the work for me, and I only signed were it said signature, but still it was hard! We were also seeking financial support, first from my university (IAUM) and then from other sources. Up until this minute, those other sources have proved far more dependable! I also wanted to write a lot about the ridiculous inefficiency in operations of our governmental (and semi-governmental) offices, organizations, etc. but since you either already know or will never find out (lucky you!) I'll skip that. Basically, this is were we are: bme has everything worked out, except for her visa. eam has done all he had to for a passport, and it's a matter of days before his passport is ready. Now me. I have already finished all the work that had to be done with IAU, and now I'm waiting for Saturday to go stand in the lines at the Conscription Service Offices (all Iranian males above the age of 18 have to do 2 years of conscription service. Without it or their consent, you cannot do many things, leaving the country among them.) After that, I'm gonna apply for a passport.

Thursday, March 09, 2006

Doom Has Come to This World!

I just re-installed and was playing Doom 3 again and man, it's gorgeous! I mean the game itself is quite ordinary (sorry John, but more on this later) but the graphics! It's eye candy. I finished Doom 3 back when it was released, on my Ti 4200, and I was impressed, even though I couldn't turn on all the features. Now with my new card it's right out mind blowing. I mean, the lighting and shadows are so realistic, the normal-mapping so works for id, and I think they have used parallax-mapping (or displacement-mapping (I can't tell which, or is it simple bump-mapping?)) and many many more effects. The shear volume of verteces and effects the engine can handle is astonishing. Besides graphics, the movement of the monsters is also great. Those scary monsters crawling around on the walls and ceilings and jumping around, well, as I said, I'm pretty impressed. Now, all I've said here, was not at all about the game. It was about the engine. The game design is good that it's scary (at least it makes you jump,) and that it's kind of loyal to the Doom legacy, i.e. just shooting out a crazy bunch of monsters, with minimal puzzle solving and "adventuring." But it's not a real game of it's class. The artwork (graphics, level design, sound, voice-over, etc.) is good enough, but it just feels like an extremely long tech-demo (albeit a breath-taking one.) There are no complex objectives, no non-linearity (except a branching point early on, but the branches merge soon enough,) almost no environment interaction compared to the likes of Half-Life 2 (except this: try shooting a hanging lamp, and watch the light dance. Cool!) As a whole, Doom 3 is a good game, but I'm waiting for a Doom 3-engine based real game. Of course, this strategy of putting their focus on the engine is totally logical for id, since they make most of their money (that's a lot of money) from engine licensing. I haven't seen Quake 4 yet, but I think (and hope) that it's a smash hit.From what I've read and heard, Quake 4 goes back to a more story-oriented gameplay (a la Quake and Quake 2.) Oh, I forgot the best feature of Doom 3. It has the BFG9000! I mean, BFG10k in Quake III Arena was OK, but BFG9000 is something else! By the way, int the first 3 or so minutes of Doom 3, you enter a bathroom that has a big mirror. Seeing myself in the mirror suddenly took me about 9 or 10 years back, to the first times I was playing Duke Nukem 3D. In that game, Duke also enters a bathroom at some point (or many points) and you can see his reflection in the mirror. I remember my awe at that technological marvel, even though you could see Duke in the mirror only at fully-facing it or at profile.

Wednesday, March 08, 2006

People Don't Care About What They Don't Get (ICPC)

I have been involved in programming contests for several years now, as contestant, problem setter, judge or executive (*shudder*.) My point is that nothing has helped my programming and engineering skills as much as this. Now, the most prestigious of all the programming contests is the ACM International Collegiate Programming Contest (ICPC.) Each year, in some 34 regions around the world, thousands of teams from all major universities compete and around 70 of them advance to the world finals. This is a really big deal. One of the ICPC regionals, is held each year for 7 years now in Sharif University of Technology. It is one of 11 sites in Asia. I myself have participated in the last 5 of them, and our team's placements have been 5th, 13th, 6th, 3rd and 4th. It is also interesting to know that in 2003 and 2005 (when we finished 6th and 4th respectively) 3 teams advanced from Tehran site but normally (including in 2004, when we were 3rd) two teams do. Anyway, I said all that to arrive at this. In my opinion, the ICPC World Finals is the single most important team-oriented event that a student in any technology-related field can participate in. It is more important than RoboCup or IEEE design competitions because it's accessible, it's entry barrier is not too high and for those reasons, people actually like to participate in the regionals or similar contests. And now this (in Farsi.) Through all the years that Sharif University has held a regional, Dr. M. Ghodsi has been the site director. I have seen that each year, while the excitement of the students and their participation levels have grown significantly, the support of the university officials (with the exception of a few, including Dr. Ghodsi) has diminished. As a result, each year the quality of the contest (execution-wise, not scientific) has gone downhill. I don't know what it takes to bring these type of events to government officials', industry sector managers' and media's attention. But I hope somebody thinks of something soon!

Tuesday, March 07, 2006

Upgraded My Kernel

Just finished building the 2.6.15.6 kernel. My previous kernel was 2.6.12, and more than a few months old. Although Linux has come a long way since 2.0 (or was the first kernel I compiled 2.2? I think it was on a RedHat 4) I still don't feel completely at ease when I build my kernels. I admit, I'm a coward, but I just don't have the self-confidence (although I do it anyway!) I just remembered that I'm downloading Fedora Core 5 Test 3, which makes the whole upgrading thing moot. I've had added the torrent to the bottom of my queue a few days back and forgotten about it.

Monday, March 06, 2006

Dancing Links

I've recently came across Knuth's Algorithm X, and the implementation he calls "Dancing Links" (in the context of a Sudoku solver, but that's a whole other story.) This is a back-tracking method for a wide range of problems (problems reducible to an instance of the Exact Cover problem.) While Knuth's DLX is still not a deterministically polynomial-time algorithm (I just invented a concept! Hurray!) (or is it?) the algorithm is beautiful and very efficient in practice.

The Machinist

I just watched The Machinist. It is a good movie, and the ending was in some ways even more surprising than the likes of Fight Club. It reminds me of Memento, and how while the images of the film are bright and sunny, the film is as dark as it gets. One more thing I liked about this movie was that although it presented a lot of questions during its run, it still managed to wrap up the main plot line. Not like the torture that was Mulholland Drive at all (Make no mistakes, though. I liked Mulholland Dr.) But the main thing that causes me to like this film is Christian Bale. He's become so thin in the Machinist, that it is actually disturbing in some shots. You cannot help but pity him in the first half of the film. But then, the events get more peculiar and you, along with him, become curious and determined. All in all, I think he is brilliant in The Machinist (but since when I've become an expert on acting!) and I've loved his acting since I saw the first trailers for American Psycho.

Sunday, March 05, 2006

Some Kind of Monster!

I did it. For no particular reason, I went out and bought a GeForce 6800! Believe me, it's a monster. I was really worried about the weight, and whether the mainboard socket or the card itself might get damaged. It's holding up nicely though, and it's got a 3-year warranty, so what the heck! (For the record, my old card was a GeForce 4 Ti 4200 (made by MSI, but their web site is not responding.) It was an awsome card, but to say the truth, it was dead, technologically. So I shed a tear, and pulled it out of my case with a swift move! I haven't had time to run any serious benchmarks on the new cards, only some of my own programs. Expectedly, those using fragment programs heavily run much faster (3 to 4 times.) And finally I get to test my PS 2.0 codes! But strangely, some of the other tests (high tri count; using fixed-function pipeline) did not show much of an improvement. May be the programs are CPU bound? The higher clock rates should have made a difference otherwise, not to mention the higher number of vertex pipes.

First Post!

Well, as a rule, I don't like blogging. I was quite against the idea of a bunch (or thousands) of juveniles pouring out what was in their tiny heads. But recently, my views of weblogs have changed. I have seen worthwhile blogs (sorry, no links. Too numerous!) by people who actually had something to say. That still doesn't explain why I had to do it too. The key revelation was that nobody forces anyone to read a blog. People read blogs either because they find it worthy or because they've nothing better to do, a fair trade in either case. Looking at a blog like that, it becomes a log of your brain activity. You don't read logs unless you want to know what is a piece of software doing, or why. Since I've always liked logs (I'm a programmer!) - well - here it is!