Tuesday, May 30, 2006
The Vengeance Trilogy
The title refers to three films by the South Korean director Chan-wook Park. As I have written before, Oldboy is one of my all-time favorite films, and I was not even aware that it was the second part of a trilogy.
Well, now I've seen both the first and the third parts, Sympathy for Mr. Vengeance and Sympathy for Lady Vengeance respectively. And wow! What movies! They are not as... interesting as Oldboy, but every bit as dark and unique.
My advice to everyone out there is to see these films. Watch them in order, but not in a row. Watch each one two or three times and allow at least a week before going on to the next movie. But watch them! Even if the choice was between the Trois Couleurs and these, watch these. You'll be more entertained!
Thursday, May 25, 2006
Hallelujah!
No, I'm not refering to the Lordi song! I just found out that Oldboy is the middle part of a trilogy! It's like Christmass (if I was a christian, of course!) I mean, I love that movie. It's right on top of my best films list, along side Fight Club.
I'm going to get my claws on them. By the way, the names are "Sympathy for Mr. Vengeance" and "Lady Vengeance".
Wednesday, May 24, 2006
Losers Weepers!
I missed the Google Code Jam Europe today. :-(
I don't know what's with me. I miss a lot of things, and not just boring stuff like my classes, but fun things too, like this Code Jam and many other TopCoder tournaments for that matter. And it was the qualification round. I'm quite certain I could have advanced.
The hilarious thing is that a friend of mine specifically reminded me yesterday. Damn my memory.
Monday, May 22, 2006
The Gauntlet Has Been Thrown Down!
I have a nice collection of movies. Most of them are in MPEG-4 format, but some are in MPEG-1 or MPEG-2. Quite a few of my friends ask me to burn or copy a couple or two for them, and I decided to put a list of my films here. We can all be friends and increase our mutual culture awareness.
It's almost the whole collection, save for about 50 or 60 that I have on WORM media, or I have that have poor quality.
Monday, May 15, 2006
A Typical Day
Just a typical day. I got up early, because I had some government offices and banks that I had to drop by. I went to the "Department of Conscript Service" (or whatever it's called) and asked for the money I had deposited in case I went outside of Iran and decided not to come back (Don't ask! It's a long story.)
Anyway, I asked for the money and had to show them my passport. The guy asked me (like a pop quiz, or like he's caught a thief,) what my ID number was! I guess I don't look like my photo (or vice versa.) Then two different officers (both colonels) viewed my passport and then signed the paper and I went off to the bank to get my money. We call this bask the "G" bank.
The G bank I went to, asked me to sign three forms (twice each,) checked my ID and made me put my fingerprint on two of the forms! I mean, what teh hlel!
I wanted to deposit the money in a bank, say "M" bank, in an account that wasn't mine. I asked the nice young man behind the counter (no weman in the G bank, since it somehow belongs to the Armed Forces) how could I do that, that minimized my hassle. Turns out I couldn't even get an Inter-bank check(?) (my default option (C programmers, look up the meaning of "default" in a dictionary)) and he would write me a check (a normal check, mind) to be cashed at the "S" bank and then taken to a branch of the M bank and wired to the particular target branch. Or, I could get an inter-bank check from the S bank for that particular target branch and account (which was incidentally 2/3 of the city away.)
I went to the S bank, and wonder of wonders, it was not jam-packed with homo-sapiens. I decided to take option B, since I didn't cherish the idea of walking around with 5M Tomans+ on my person, or using certified travel checks(?). Believe it or not, travel checks are really hard to cash at banks!
Then I had to go into one of the branches of the M bank anyway, because I didn't know the exact address of the target branch (it's name was the name of an expressway!) Anyways, I found the target branch, went in and deposited the check. Done at last.
But I was very worried up till the moment that I asked the teller to double check for me whether the owner of the account I was depositing the money into was infact the one I intended. The was no other way to check that. The key into their database is the acount number (or at least it's an index) and the teller had not checked the name on the check to make sure whether the money goes to the right place. (OK. This is not a big deal. I should not be able to check peoples bank account numbers anyway.)
Maybe I should mention that all these events occured in Tehran, while I live in Mashhad (~1000KM away, for those who are afraid of Google Maps.) I got out of my house at around 5:10 this morning, flew to Tehran at 6:00, did all the above (and made unrelated visits to bank "P" and my friend "E",) flew back at 1:00 PM, just finished lunch (5:00 PM) and now I'm typing these.
My question is this. Why I had to make all these trips? Why I had to fly to Tehran in the first place?
Unfortunately, the answer is obvious and painful for Iranians and unavoidable.
You see, all this happened because there is no sharing of useful information between even parts of the government and banks. There is no infrastructure, and better that there isn't, for I know what would happen if they even attempt at such a thing. Disaster, in all its incarnation would befall us. That's why I said it seems unavoidable to me.
In a perfect world, the thing that would have happened could have been something like the following scenario:
On May 11th, A computer in the Conscript Services Department would realize that my exit permit was valid till May 10th. It would check with other relevant databases to see whether I was infact in the country or not (you see, it would have authorization to do so, in my case.) Then, since I was firmly inside the borders of my beloved country, it would issue an order to the bank to release my security deposit and put it in an account designated by myself when I filled out the forms. See, that would be logical to put such a field on the exit permit application form, since I figure more than 90% of the people who leave the country in fact return, and more than 99% of them actually want their money back (shameless!) Anyway, the G bank would then deposit the money (since the money is under the will of the Dep. of Conscript Services) into the said account. I could then collect it or whatever on May 11th, first thing in the morning, from the space between my chair and my keyboard, at my home.
All the above does not mean that the phisical way went actually bad. It was even quite streamlined, considering your typical, run-of-the-mill office red tape. But that's the limit of the physically-and-personally-doing-things way.
I wasted 11 hours of my time, a lot of money (around 100'000 Tomans) and a not unconsiderable amount of this country's, and the world's resources to do a thing that barely needed my intervention. Why? Because no one in this country has the will, knowledge and power to make things better. And you need the three factors near each other, or something will go wrong.
Anyone thinks I'm crazy? What I'm asking for is insane?
One more curious thing I almost forgot. The whole account system of bank G (or a good part of it) is implemented in a single account in the S bank! Think of a filesystem inside a file on another file system. Or an entire OS inside the address space of a user-task in another. Or some (seemingly) intelligent beings inside the mind of another.
Sunday, May 07, 2006
Eureka!
Some time ago, I implemented AES along with SHA-256 as a practice and because it was needed in some other project of mine (namely KOPCS, which I still may decide to unleash on the world!)
You may wonder why I didn't use one of the many free, gratis, fast and high-quality implementations out there. Well, that's me! I like to make my own wheels, and since I'm still in the learning phase, I need the practice.
Anyway, I implemented the thing and expanded it into a useful package by adding CTR mode and one-shot file and buffer en/decryption. In short, all was well and good.
A few weeks back, just before a trip, just out of nowhere it came to me to asses the performance of the library. In the process of this evaluation, I discovered something utterly strange. The library couldn't decipher what it encrypted! And only when doing multiple blocks in one go!
Of course, I had tested the thing before, but those tests were done in CounTeR mode and as you know, in counter mode you only use one way of the algorithm, encryption or decryption, not both.
Unfortunately, I had to leave on business when I encountered this bug. It almost ate me alive, the "why".
Just now, I finally found the bug! It was a stupid pointer (mis)calculation. I had to advance some pointer 128 bits (the block size) while I did it 32 bits instead.
The point of this story is never try to get clever in your code. You'll get too clever for your own good one of these days.
And, always test your code thoroughly!
Subscribe to:
Posts (Atom)