Vincent Lam’s Weblog

On Open Source

Modifying the Browser Lab (continued! done)

I restarted my adventure on this yesterday with Rueen and Vijey, and we got this to work. I will post my patch to my wiki shortly.

i had a problem with this lab. my codes are not being pick up when I complie. I have been trying to add “printf”. so that i can pin point the line that i would like to edit, but it does not work at all. I do not understand why… ? I have a few mozilla build (c:/ff/; c:/mozilla) I am sure I was editing and building the correct one but it just doesn’t work (tried with ff and mozilla). This is strange…and I ran out of idea… that’s why this lab took me a few days…

my solution to this is to rebuild it to a new directory (yes… i have 3 build now) at c:/ffm. finally, my changes worked.

now i have to make changes to the code. from my previous blog, i found loadOneTab and mTabContainer. From these, I found the appendchild function. I tested the code by copying appendchild function and repeated that a few times… I tested it with “Ctrl + T”, and a few new tab pop up. Nice.

I started my research on appendchild. I think? I should “reverse append child” or something similar.

looked up mxr (learned that from class), looked up “” (Armen was doing that last Thursday, so I figure I should give that a try) and yes, i find a bunch of functions:

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from DOM element
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

at first, appendChild, HasChildNode, removeChild and ReplaceChild catch my attention, but insertBefore just pop my eye out (Moreover, I hear Cathy & Dave & Michael was talking about that in class on Thursday, so… it makes sense.). they has an example on how to “insert” stuff before “another” too, basically follow that and make change accordingly. 🙂

replace appendchild, figure out what to put inside insertbefore, update the counter/index/etc. relax a little then just build is done.


October 17, 2007 Posted by | open source | Leave a comment

Modifying the Browser Lab

I am working on this lab: 

I worked 5 hours on Thursday, a few hours yesterday and a few hours today (after finishing the 0.1).  I don’t want to cheat by reading the solution.  *sob* I need to some how find more time to concentrate on this lab.  This is one of the most interesting lab so far. lol~ I am not saying the other labs are boring… but you know, this lab is different.

I used MXR and I ended up in the tabbrowser file. I think I am in the right track.  I was looking at loadOneTab and I am looking at mTabContainer.  I am trying to make sense out of the container.  hmmm… maybe i should start coding/testing, instead of trying to understand it fully.  just as dave said, you are not suppose to understand it – -” just code and share ideas with your friends…….. there aren’t any one else working on this tho… people seems to be either busy with their 0.1 or their assignment/midterm *sob*

anyway @@” I will get this to work asap. please forgive me if i don’t have it done by monday *sob*  afterall, what i learn from this is more important than getting it done quickly.

btw, I hear we have to use some java script.  I am not very good at java script and I have never programed with java script before… my focuses were in c/c++, asp, c#, java, and now python. Moreover, BSD doesn’t teach java script.

So, this is my chance to understand java script better but i need time.

Is anyone working on this now? I hear a few people finished this already (2 -3 people?)

October 14, 2007 Posted by | open source | 1 Comment

my Watching@bugzilla begins

hm? I never “watch” someone on bugzilla before, but i am learning quickly. would watching someone be like spying on people?  I am watching a few people now and I will post my finding in a day or two.

October 14, 2007 Posted by | open source | Leave a comment

Our 0.1 Beta

just to recap, our project is to create an automatic build tool that uses the standard en-GB localization folder/files to generate/uses as a different type of english such as en-IN, en-CA and en-US.

Rueen, Armen and I have worked on the actual code, and we think we did made “something happened”. this “something” is working exactly as what we want it to be.

Here is how we get to the point where we are in now.

1. we study python for weeks, knowing where to get the code/function we need and learnt the basic structure.

– file IO, class, if, for, listdir, parser

2. a lot of research on which/what file/folder to use/change/work on/create

– l10n tool, testing/test/lib/ directory,, en-GB

3. we check-out the necessary code, l10n tool

3. followed with 6-7 hours coding yesterday. basically, put everything we understand into the code.

the code ended up to be exactly the same as what I have mentioned from “my idea of the 0.1

1. we have file io that read all the .dtd file

2+3. we have a function that identify the changes need to be made and do it

4. finally, we have it output in the screen/ouput as a file

for more information please visit our website or here @ bugzilla

October 13, 2007 Posted by | open source | Leave a comment

my idea of the 0.1

Rueen, Armen and I are trying to figure out what to write for our 0.1.  This is difficult because we do not have enough information.  I have been learning python, in hope of being helpful in the technical aspect of this project but so far, our team has no idea what 0.1 should be.  what would 0.1 be? would it be a file that read localization code? or would it be something else? we are not sure.

for this particular tools, i think we need the following:
1. file io that read a localization file.
2. organize the information that was read (somewhat like a parser)
3. make necessary translation
4. output/build

October 7, 2007 Posted by | open source | 3 Comments


I have been studying python for weeks.  It is not a difficult language, it just takes time to practice and testing.

here is what you need to do to learn python.

1. download python 2.5.1
2. read the tutorial
3. open “IDLE (Python GUI)”
4. Start Coding

i went thought most of the tutorial and i think i am pretty good at it now.  object, class, file io, control flow, data structure, no problem.

October 7, 2007 Posted by | open source | 2 Comments

So that’s how you apply the Patch!

Good Job Vijey! You are correct. The patch will works if you put it in the xpcom folder. Yeah!

Lesson Learned: Read about the patch (from where it comes from) before applying it.

October 1, 2007 Posted by | open source | Leave a comment

Incremental Build LAB!!

Thank you for the reply on python:

Those two links are really helpful: ,

Thanks 🙂

I worked on the Incremental Build Lab today with Rueen, Vijey and TJ!!

I think I did a good job following instruction on the page.

Downloaded the (5-10minutes)
Unzipping it (20-30minutes)
Building it (20-30minutes)
Make Changes (2 seconds)
Build it again in the in the Object directory (5-10 minutes)
Create a patch (20-30minutes)
Send and Download ppl patch (5 seconds)
Apply the Downloaded Patch (5 seconds)
Check update (5 seconds)
Restore patch (5 seconds)
Check restore (5 seconds)

Everything works up to this point, but I couldn’t get Mike’s thread patch to works.  I got the follow messages and I do not know what file is it asking for…. nsThread.cpp? any idea?

can’t find file to patch at input line 9
Perhaps you should have used the -p or –strip option?
The text leading up to this was:
|? threads/.gdb_history
|Index: threads/nsThread.cpp
|RCS file: /cvsroot/mozilla/xpcom/threads/nsThread.cpp,v
|retrieving revision 1.70
|diff -u -p -5 -r1.70 nsThread.cpp
|— threads/nsThread.cpp       11 Jul 2007 03:01:56 -0000      1.70
|+++ threads/nsThread.cpp       25 Aug 2007 15:53:36 -0000
File to patch:

September 30, 2007 Posted by | open source | 1 Comment

MXR! and

I have been having a lot of fun with the cross reference library.  From how the “Back button” work to how the “Stop button” works.  Which button trigger which function.  which function trigger other function. It is a lot of information.

In order to find information effectively on mxr, there are a list of rules and tricks which is based on the consistency of the structure of the code that you should know (or will help).  You will probably be able to figure that out yourself but I am going to make a list later today or tomorrow!

September 26, 2007 Posted by | open source | Leave a comment

Open Source Project Update

After a few weeks of discussion, we finally come up with an open source project. Originally, I was going to do the EN-CA localization project but that did not seems to work out, then it kind of got changed to ZH-HK which is the canton style of Chinese which is used mostly in Hong Kong. Finally, just last Monday, the finally decision is made. I am going to make a automated tool that translate between different type of English (CA, GB, US, etc). While I am excited about this project yet I am a little worried on how everything is going to work. First of all, I need to figure out what programming language I should uses. We might have to use Python for which I have minimum experience with. I read a few article on python… it doesn’t seem to be that difficult, but I am just wondering if anyone know a good website or a good book that I can use?

September 26, 2007 Posted by | open source | 3 Comments