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.
No. Title Sizes (in MiB) Format
1 2 Fast, 2 Furious 700 AVI
2 2001: A Space Odyssey 649 AVI
3 2046 699, 700 AVI
4 40 Year Old Virgin, The 704 AVI
5 8 Mile 334 AVI
6 Academy Awards 2006 691, 693 AVI
7 Aeon Flux 699 AVI
8 Agent Cody Banks 2 701 AVI
9 Alice in Wonderland 643 AVI
10 Alien vs Predator 700 AVI
11 Amadeus 700 AVI
12 America's Sweethearts 701 AVI
13 American Beauty 669 AVI
14 American Psycho 669 AVI
15 Analyze That 696 AVI
16 Analyze This 659 AVI
17 Animatrix 700 AVI
18 Anything Else 700 AVI
19 Apocalypse Now 613 AVI
20 Around the World in 80 Days 701 AVI
21 Assassins 700 AVI
22 Avalon 854 AVI
23 Bachelor 700 AVI
24 Bad Boys 700 AVI
25 Bad Boys 2 720 AVI
26 Basic Instinct 687 AVI
27 Batman Begins 700, 551 AVI
28 Batman Forever 689 AVI
29 Battle Royale 702 AVI
30 Beautiful Mind, A 701 AVI
31 Benny and Joon 701 AVI
32 Beyond Borders 700 AVI
33 Big Fish 700 AVI
34 Big Mama's House 700 AVI
35 Black Knight 701 AVI
36 Blade Runner - Director's Cut 701 AVI
37 Blue Streak 702 AVI
38 Bond 01 - Dr. No 695 AVI
39 Bond 02 - From Russia with Love 700 AVI
40 Bond 03 - Goldfinger 688 AVI
41 Bond 04 - Thunderball 898 AVI
42 Bond 05 - You Only Live Twice 618 AVI
43 Bond 06 - On Her Majesty's Secret Service 687 AVI
44 Bond 07 - Diamonds Are Forever 683 AVI
45 Bond 08 - Live And Let Die 686 AVI
46 Bond 09 - The Man With The Golden Gun 701 AVI
47 Bond 10 - The Spy Who Loved Me 686 AVI
48 Bond 11 - Moonraker 686 AVI
49 Bond 12 - For Your Eyes Only 664 AVI
50 Bond 13 - Octopussy 699 AVI
51 Bond 14 - A View To A Kill 701 AVI
52 Bond 15 - The Living Daylights 703 AVI
53 Bond 16 - Licence to Kill 703 AVI
54 Bond 17 - Goldeneye 701, 699 AVI
55 Bond 18 - Tomorrow Never Dies 606 AVI
56 Bond 19 - The world is not enough 628 AVI
57 Bond 20 - Die Another Day 700, 699 AVI
58 Bone Collector 695 AVI
59 Bourne Identity 700 AVI
60 Brokeback Mountain 954 AVI
61 Broken Flowers 698, 702 AVI
62 Bruce Almighty 700 AVI
63 Casablanca 697 AVI
64 Catch Me If You Can 699, 697 AVI
65 Catwoman 700 AVI
66 Charlie and the Chocolate Factory 1400 AVI
67 Charlie's Angels 2 - Full Throttle 694 AVI
68 Chicken Little 700 AVI
69 Chicken Run 349 AVI
70 Chinatown 887 AVI
71 Chocolat 680, 698 AVI
72 Chronicles Of Narnia - The Lion, the Witch and the Wardrobe 701, 699 AVI
73 Citizen Kane 683 AVI
74 City Of Angels 701 AVI
75 Clockwork Orange, A 625 AVI
76 Collateral 700 AVI
77 Con Air 670 AVI
78 Constant Gardener, The 701 AVI
79 Contact 710 AVI
80 Crash 700 AVI
81 Cube 629 AVI
82 Dancer In The Dark 721 AVI
83 Dancer Upstairs, The 674, 675 AVI
84 Dances with Wolves - Special Edition 1380, 1299 AVI
85 Dark City 689 AVI
86 Dead Man 676 AVI
87 Dead Poets Society 649 AVI
88 Decalogue (Dekalog) 546, 568, 563, 554, 572, 591, 551, 543, 583, 569 VCD
89 Derailed 700 AVI
90 Devil's Advocate, The 581 AVI
91 Dick Tracy 700, 80 AVI
92 Dirty Harry 695 AVI
93 Dirty Harry 2 - Magnum Force 697 AVI
94 Dirty Harry 3 - The Enforcer 696 AVI
95 Disclosure 697 AVI
96 Dog Day Afternoon 688 AVI
97 Dogma 561 AVI
98 Domino 701 AVI
99 Donnie Darko 699 AVI
100 Doom 700, 701 AVI
101 Dr. Strangelove 713 AVI
102 Dreamers, The 700 AVI
103 Edward Scissorhands 700 AVI
104 Elektra 701 AVI
105 Elephant 701 AVI
106 Elizabeth 699 AVI
107 Entrapment 697 AVI
108 Equilibrium 664 AVI
109 Equilibrium - Making Of 38 AVI
110 ET 699 AVI
111 Eyes Wide Shut 1239 AVI
112 Fabuleux destin d'Amélie Poulain, Le 704 AVI
113 Falling Down 700, 699 AVI
114 Family Man, The 697 AVI
115 Fantasia 696 AVI
116 Fantasia 2000 620 AVI
117 Fantastic Four 699 AVI
118 Fast and Furious 700 AVI
119 Fear And Loathing in Las Vegas 694 AVI
120 Femme Fatale 698 AVI
121 Few Good Men, A 701 AVI
122 Fight Club 693 AVI
123 Final Fantasy VII - Advent Children 699 AVI
124 Finding Nemo 700 AVI
125 First Daughter 690 AVI
126 Forest Gump 704 AVI
127 Four Weddings and a Funeral 1140 AVI
128 Freaky Friday 700 AVI
129 Freddy vs Jason 697 AVI
130 From Hell 672 AVI
131 Full Metal Jacket 635 AVI
132 Fun with Dick and Jane 700 AVI
133 Game, The 694 AVI
134 Gangs Of New York 700, 695 AVI
135 Garfield 700 AVI
136 Gladiator 762 AVI
137 Glengarry Glen Ross 1644 AVI
138 Godfather, The 692, 701 AVI
139 Godfather, The - Part II 697 AVI
140 Godfather, The - Part III 692, 675 AVI
141 Good Fellas 701 AVI
142 Good Night And Good Luck 700 AVI
143 Good, Bad, Ugly 667, 614 AVI
144 Great Dictator, The 698 AVI
145 Great Expectations 541, 576 VCD
146 Groundhog Day 1493 AVI
147 Guy Thing, A 642 AVI
148 Harry Potter and the Prisoner of Azkaban 700 AVI
149 Heat 687 AVI
150 Hercules 626 AVI
151 Hero (Ying Xiong) 701 AVI
152 History Of Violence, A 700 AVI
153 Hitch 695, 693 AVI
154 Hitchhikers Guide to the Galaxy, The 701, 693 AVI
155 Hostel 701 AVI
156 House of Flying Daggers 700, 701 AVI
157 Howl's Moving Castle (Hauru no Ugoku Shiro) 599 AVI
158 Hulk, The 699 AVI
159 Human Stain, The 689 AVI
160 I, Robot 700 AVI
161 Identity 700 AVI
162 Immortel 691 AVI
163 In Good Company 792 AVI
164 Independence Day 694 AVI
165 Interview with a Vampire 703 AVI
166 Into the Blue 700 AVI
167 Irreversible 699 AVI
168 Italian Job 697 AVI
169 Jackie Brown 1401 AVI
170 Jay and Silent Bob Strike Back 699 AVI
171 Joe Versus the Volcano 700 AVI
172 Johnny English 700 AVI
173 Jungle Book, The 625 AVI
174 Kill Bill vol. 1 700 AVI
175 Kill Bill vol. 2 697, 697 AVI
176 King Arthur 701 AVI
177 King Kong 700, 700 AVI
178 Lady Killers 700 AVI
179 Land of Dead 700 AVI
180 Last Tango in Paris 702 AVI
181 Last Tango In Paris, The 702 AVI
182 Laws of Attraction 700 AVI
183 Layer Cake 702 AVI
184 League of Extraordinary Gentlemen 700, 700 AVI
185 Lemony Snicket's A Series of Unfortunate Events 651 AVI
186 Leon 570 AVI
187 Liar Liar 690 AVI
188 Life is Beautiful 705 AVI
189 Lock, Stock and Two Smoking Barrels 700 AVI
190 Lock, Stock and Two Smoking Barrels - Director's Cut 771 VCD
191 Lord of the Rings - Fellowship of the Ring - Extended Edition 701, 701, 570 AVI
192 Lord of the Rings - Return of the King - Extended Edition 702, 696, 700 AVI
193 Lord of the Rings - The Two Towers - Extended Edition 697, 697, 697 AVI
194 Lord of War 701 AVI
195 Lost Highway 694 AVI
196 Lost in Translation 700 AVI
197 Love Actually 700 AVI
198 Machinist, The 699, 698 AVI
199 Man on Fire 700, 698 AVI
200 Marry Poppins 698, 699 AVI
201 Matadore, The 810 VCD
202 Matrix Reloaded 349 AVI
203 Matrix Revolutions 349 AVI
204 Matrix, The 578 AVI
205 Me, Myself And Irene 701 AVI
206 Meet the Fockers 411, 755 VCD
207 Meet The Parents 700 AVI
208 Memento 692 AVI
209 Memoirs of a Geisha 696, 698 AVI
210 Merchant of Venice 699 AVI
211 Modern Times 691 AVI
212 Monty Python and the Holy Grail 700 AVI
213 Mrs. Doubtfire 706, 579, 301 AVI
214 Mulan 553 AVI
215 Mummy 699 AVI
216 Mummy Returns 699 AVI
217 Munich 701, 700 AVI
218 My Fair Lady 698, 699 AVI
219 National Security 700 AVI
220 Natural Born Killers - Director's Cut 701 AVI
221 New Guy, The 701 AVI
222 Nightmare Before Christmas, The 694 AVI
223 Ocean's Eleven 690 AVI
224 Ocean's Twelve 689 AVI
225 Oldboy 696 OGM
226 One Flew Over The Cuckoo's Nest 701 AVI
227 Others 917 AVI
228 Paparazzi 700 AVI
229 Paradise Now 689 AVI
230 Passion 648 AVI
231 Patch Adams 701 AVI
232 Pay it forward 669 AVI
233 People I Know 701 AVI
234 PI 622 AVI
235 Pianist, The 700, 700 VCD
236 Platoon 655 AVI
237 Pride and Prejudice 701 AVI
238 Princess Mononoke 674 AVI
239 Pulp Fiction 659 AVI
240 Rainman 699 AVI
241 Recruit 704 AVI
242 Reservoir Dogs 507 AVI
243 Revenge 625, 625 VCD
244 Revolution OS 654 AVI
245 Revolver 624, 460 VCD
246 Robin Hood 700 AVI
247 Ronin 1484 AVI
248 Saving Private Ryan 679 AVI
249 Saw 700 AVI
250 Scanners 699 AVI
251 Scanners II - The New Order 699 AVI
252 Scarface 697, 697 AVI
253 Scent of a Woman 658, 658, 241 VCD
254 Schindler's List 699, 700, 689 AVI
255 Scorpion King 699 AVI
256 Scream 699 AVI
257 Scream 2 699 AVI
258 SE7EN 544 AVI
259 Serendipity 690 AVI
260 Serenity 702 AVI
261 Sexo Con Amor 700 AVI
262 Shakespeare in Love 699 AVI
263 Shawshank Redemption, The 707 AVI
264 Shining 700 AVI
265 Shining - Making Of 345 AVI
266 Shrek 2 427, 427 VCD
267 Silence of the Lambs 587 AVI
268 Sin City 679, 682 AVI
269 Sinbad 700 AVI
270 Skeleton Key, The 701 AVI
271 Snatch 703 AVI
272 Sound of Music, The 620, 548 AVI
273 Spartan 700, 700 AVI
274 Spiderman 2 645, 640 VCD
275 SpyGame 699 AVI
276 Stalker 703, 701 AVI
277 Star Wars Episode I - The Phantom Menace 776 AVI
278 Star Wars Episode II - Attack of the Clones 1484 AVI
279 Star Wars Episode III - Revenge of the Sith 697, 696 AVI
280 Star Wars Episode IV - A New Hope 702 AVI
281 Star Wars Episode V - The Empire Strikes Back 694 AVI
282 Star Wars Episode VI - Return of the Jedi 713 AVI
283 Starsky and Hutch 697 AVI
284 Strings 700 AVI
285 Swordfish 700 AVI
286 Syriana 696, 698 AVI
287 Talented Mr. Ripley 739, 664 VCD
288 Taxi Driver 699 AVI
289 Taxi Driver - Making Of 700 AVI
290 Terminal 697 AVI
291 Terminator 700 AVI
292 Terminator 2 - Judgement Day 699 AVI
293 Terminator 3 - Rise of the Machines 699 AVI
294 Three Extremes 701, 701 AVI
295 Tim Burton's Corpse Bride 699 AVI
296 Titanic 700, 698 AVI
297 Top Gun 700 AVI
298 Trainspotting 388 AVI
299 Transporter 700 AVI
300 Transporter 2 676 AVI
301 Treasure Planet 697 AVI
302 True Romance 701 AVI
303 Truman Show, The 667 AVI
304 Tsotsi 700 AVI
305 Twelve Monkeys 705, 705 AVI
306 Twisted 686 AVI
307 Unforgiven 700 AVI
308 Unleashed 700 AVI
309 Usual Suspects, The 634 AVI
310 Vertigo 609, 677 VCD
311 Walk the Line 701 AVI
312 Walking Tall 700 AVI
313 Wallace and Gromit in the Curse of the Were-Rabbit 699 AVI
314 War Of The Worlds 700, 701 AVI
315 Waterworld 681 AVI
316 Wedding Crashers 781 AVI
317 What Dreams May Come 696 AVI
318 What Lies Beneath 731 AVI
319 What Women Want 701 AVI
320 Who Framed Roger Rabbit? 718 AVI
321 Whole Ten Yards 969 MPEG
322 Wolf 658, 603 VCD
323 Wuthering Heights 696 AVI
324 X-MEN 701 AVI
325 X2 693 AVI
326 xXx 699 AVI

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!