Archive for the ‘Funny’ Category

n program yang paling sering kupakai

2008 April 18

Beberapa waktu yang lalu di Planet Ubuntu tersebar mim “Inilah 10 program yang paling sering kupakai”. Contohnya ini. Caranya sangat mudah, yaitu mengetikkan suatu perintah konsol kompleks tertentu.

Ikut-ikutan ah…

C:\Documents and Settings\Agro>history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
'history' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Agro>

Aduh! Lupa aku!

Bunting, HP Frenku itu…

2007 December 4

Tulisan ini telah dipindah ke singularity.agronesia.net: “Bunting, HP Frenku itu…”. Silahkan kunjungi server barunya.

This post has been moved to singularity.agronesia.net: “Bunting, HP Frenku itu…”. Please visit the new server.

I knew it! Files are living things! They have genes!!!

2007 May 26

The problematic file is freetest.htm. I have identified that it has an NS_ERROR_XPC_NOT_ENOUGH_ARGS gene. With that gene, you cannot do any AJAX from the file on certain environments…

No, I’m not on a crack… Listen to my detailed account, all you Javascript developers… That defective gene might be on YOUR file.

After learning how to use AJAX on a dummy page, I coded the real thing on freetest.htm, the real page. Like most Javascript programming, sure enough it only works on one browser. The lucky one is Opera 9 this time. The suckers are Firefox 2 and IE 6.

Browser programmers are ultra-smart guys, I assume the mistake is on my part. OK, so I copied the AJAX code to a dummy, clean, HTML page to find the bug. However it works!

Ah, so it must be some arcane interaction between the previously-existing Javascript code and the newly-added AJAX code. But my AJAX code is pretty complicated. Therefore I tried adding the simplest possible AJAX action in my real page, trying to see whether a simple AJAX works at all. The simple AJAX creates an XMLHttpRequest, sends a request, and retrieves the response. This time it works in Opera 9 and IE 5. Firefox (using Firebug debugger) gives this error:

uncaught exception: [Exception... "Not enough arguments"
nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)"
location: "JS frame :: http://localhost/aspx/freetest.htm ::
doAjax :: line 26" data: no]

It’s time to hunt which other js file conflicts with this one. I deleted the reference to other js files one by one, until there is no Javascript code other then the AJAX itself! But still AJAX doesn’t work!

Lol now that’s funny. OK, so I tried modifying my real file further (I’ve backed it up), deleting more useless things like CSS and title, until it matched another dummy file (freetest-simpleajax.htm) with the same AJAX code down to every character. Browsers are weird, so there is still the slight possibility that the TITLE tag messes things up. However it still doesn’t work while AJAX works on the other dummy file!

Obligatory md5 result:

1ab3bdf1ab23aabd6cfa4b1210bc7ee2 *freetest.htm
1ab3bdf1ab23aabd6cfa4b1210bc7ee2 *freetest-simpleajax.htm

(since the content of the files are identical, the genes must be stored somewhere else such as in the NTFS Master File Table)

Lol… I tried using the save as command to save freetest.htm into freetestxxx.htm. That’s probably the equivalent of reproduction. Amusingly, freetestxxx.htm works fine. Did the defective gene not get passed?

Ah, I forgot a very basic thing! Phenotype (visible traits, like the body height of an ape and an HTML page throwing exception) comes from the intricate interaction between genotype and the environment! Basic Biology… Let’s try opening freetest.htm on another tab of the still-running firefox.exe instance…

Result…

It works!

So, it must be the environment. The other tab must be too humid or something for freetest.htm to do AJAX. It’s not a problem of cache (the tab loading an old, nonworking version of the file). I tried modifying freetest.htm by adding visible text and reloading it on both tabs. The text appears on both, signifying that both tabs opened the most recent version of the file. However AJAX still doesn’t work on that cursed tab…

Whatever… I still haven’t achieved what I wanted, making the real AJAX code work on the real page… Back to work…

Edit: The culprit is the function named parent. Renamed it to domParent. What’s weird is that after the exception occurs, the tab will be unable to do AJAX on that page even after the problem has been corrected (hence the story above).

Edit 2: It doesn’t work in IE! The ringleader is different this time… In IE 6, there is no XMLHttpRequest required for AJAX, but we can achieve the same thing by creating an ActiveXObject as shown:

var foo = new ActiveXObject('Msxml2.XMLHTTP');

However, it turns out that the variable foo won’t behave completely like a real Javascript object! It fails when we try to dynamically add a property, such as:

foo.bar = 'This thing normally works';

My code adds an id for every XMLHttpRequest object created, so it fails miserably in IE 6… Geesh, I now have to code a different way of tracking those requests…

Which would you choose? Learning a language in 1 day or 10 years?

2007 March 3

There are many random books here in Purwokerto, and some days ago I found two books with absurd titles.

First up is a book on my cousin’s bookcase: Bahasa JEPANG Hanya 1 Hari (Japanese in only 1 day) by Yan Tirtobisono. I was like “Heh!!!” when reading the title. I’ve learned this language on my spare time for around 2 years and still can’t do nothing :)… (well, yeah, probably because I’m not working hard enough)

The book’s 256 pages contain set phrases in roomaji without any grammar explanation. More like a travel pamphlet for me. I know that the Indonesian mentality is wanting results instantly without much effort, but, 1 day?!? Give me a break…

The other one is from my brother’s room: Korea dalam 10 x 365 hari (Korean in 10 x 365 days) by HS. Maru Lis. We all know that 10 x 365 days means 3650 days which means around 10 years!!! I was like “What the?!? This is a complete opposite of the other book!”.

I knew the author must meant something else, so I peeked at the contents. It turned out to be a 365-days lesson, with each lesson teaching 10 words. More like a dictionary for me. Anyway, the title is one of the most serious abuse of mathematical notation that I’ve encountered.