The story of today is about the idiot who worked silently like if he is the only one who needs to know about the progress he made.
Once upon a time there was a guy called Ziko who had a final project in a course called advanced SE about the open source software. He chose 2 bugs to repair for the final project, they were irrelevant and one of them was so tiny, and actually the tiny one was repaired before he ever touches it.
He worked on the bug remaining and started looking on the MXR for the file concerning the bug (enhancement). He found the file, it was a JavaScript file. So he started to think whether JavaScript can write to disk. That looks like an easy think to know, but believe me it wasn't. There was lots of people writing how to write to disk using JavaScript, but none worked for him. On the other hand there were people saying that JavaScript has no disk write access. Seeing more people saying it is possible to write and saying how made him believe that it's possible. He asked some of his friends and who knew of them told him it's not possible. hmmmm that sucks. Anyway he asked a friend of his called Saher and he told him that he knows JavaScript has no disk access (as his other friends told him), and that he thinks it's a Mozilla component called from JavaScript that saved the files.
A new phase of search started looking for the Mozilla component that saves files on disk, and here useful links were found. And as his lecturer doctor told the students in the lab, there is a useful addon for mozilla firefox called XPCOM viewer that can help a lot in finding and trying out mozilla components. ouch...that was an old addon that can't be added to the new "Namoroka" formerly "firefox". But he found that he had an old installation of firefox where he can add the XPCOM addon. Anyway he didn't use it that much.
mmm Ubuntu would like to update, OK let it go ahead.
oOo oOo......Now the compile takes an hour again as if it's the first time compile. aaaah Namoroka updated,... that is really stupid, how did I not check for it in the update. Anyway it rolled back to the previous release.
Now we come to where he tries to write a code and see if it works. He used a very simple way to debug, anything he would like to see he "alerts" it using alert(string). And here comes some strange output. Something strange happened, which is that nothing happened. So now he doesn't know what happened. But the obvious thing is that when there is an error nothing happens. He later noticed that only when there is a syntax error nothing happens, i.e the function doesn't work at all.
Now is a historical moment in the history of this project. He found how to write to a file using a link he found while searching with his friend Atef for how to write to a file. Now he has something good happening.
The problem now is that he can't get the directory of the file or its name in the same function as the URL of the file, since the function that has the URL doesn't send it to the function that saves the file on disk. There were a lot of ideas like writing to the file on 2 steps, looking for the URL as an attribute for an object being passed, and passing the URL as an extra parameter in the function. Ziko chose this last option. Actually he was helped by Atef here too.
The next problem he is facing is that the directory is an object that can't read, meaning that the string representation of this object is in the only harder language than Chinese. So he asked his friend Saher about what could be its meaning, he told him this looks like an array, and when he tried to loop on it to see its elements he found it functions and variables. So it's not an array, it's another object. Actually it represents a file, a little later he found the interface of this object and found the directory as an attribute. Yaaaaay now he can complete coding in peace.
On this day he knew that the next day he has an evaluation, what good luck made him finish the project on the day just before the evaluation. So he went the next day expecting that there is no big deal since he finished the project and only a few things remaining that are needed after the project.
A Shock happens. The doctor almost blew his head by a nuke. She said he was so careless that she was shocked, and that he didn't work at all. She is right since she saw nothing from him concerning the final project. But now learnt something, when the doctor asks him to work in a certain way, he shouldn't working in his own way. Anyway he is almost done, and only hopes that the doctor may see his work now.
I've a surprise for you
I'm this guy
Ziko :D
Monday, January 18, 2010
Subscribe to:
Posts (Atom)