Vincent Lam’s Weblog

On Open Source

Our 0.3 Release!

For more information regard our 0.3 please visit our project wiki or Rueen blogs on the L10N Auto Fork 0.3 release (formerly known as AutoLocalization tool)

As Rueen has mentioned in his blog, our main focuses for our 0.3 releases are:

  • Allow user to specify name of new Locale (that will be forked from an original like en-GB) to our program (eg; en-CA)
  • Program takes original locale (such as en-GB) and makes a copy of it to be used for translation
  • No longer creates .bak files (this means that translation changes are saved on the actual DTD and Properties files)
  • Code Documentation
  • For the first one, allows user to specify name, we did that a couple weeks ago, no problem whatsoever.  just prompt and ask for the directory name and use that as the root. 

    Rueen and I did the second one today, make copy of the orginal tree, it was tricky at the beginning, I was gona write the little script that recursivly make copy of every file and folder from the specified directory… but then I saw the copytree function which pretty much do exactly we want. lol~ we might as well just use that. lol…..  the function doesn’t work at the beginning, we forgot to import the required library.  after we import all the required library, it still fail. 

    something wrong with the “src” and “path” that we were using..(i was using somethin like this “c:\aaa\bbb\new\”), it is complaining about the “\”, therefore we changes it to “c:\\aa\\bb\\new\\” and now it works……. stupid escape character.  

    anyway, the code flies and do exactly what we wanted.  🙂

    there is one problem with copytree tho, if the “path” already exist, the copying will fail… that’s really isn’t a problem… is not something that is related to the purpose of our script.   we don’t really care but a problem is a problem, therefore rueen wrote his little script to validate (prompt to user and ask for a new output path is the specified path already exist)

    for the third task, not to use “.bak”, that’s easy. just make a little change at our file output. remove the +”bak”, done.

    documentation, we are almost done, everything will be updated by the end of December 7, 2007.


    December 7, 2007 Posted by | open source | Leave a comment

    Distcc?!?! Woo!

    Peter talked about his open source project in class today on “add support for more compilers to distcc“.

    Peter gives us steps by steps instructure on how to get his code to “complie” a C# program with mulitple computer within the internal network. Although, it failed at the end but it is cool to know about what he did. (trying to build a file with 10-20 computers is very cool! Xx)

    The quote of the day, I hear from class is that, there are a lot of “good” code and project that do great things but they needs to be package and organized for easy installation and use. (for example cygwin is hard to setup…they really should improve the installing interface) gotta remember this. 🙂

    November 27, 2007 Posted by | open source | Leave a comment

    Lab 5 Completed

    Lab #5 adding chrome/UI to the FirstXpcom component is our last lab for this semester.  It is the first lab that I completely given up on Vista and guess what? It works so well.  As mentioned from my previous post, I redo my Lab 4 for lab 5 and it took me a little less than 10 minutes to get it done on XP.  Here is my prove.  🙂

    Lab 4 on XP

    I continue worked on Lab 5 with my “Lab 4 build on XP”, followed the instruction on the wiki and I encounter a few small problem.

    First of all, Target Applications Firefox Minimum Version=2.0 Maximum Version=3.0a3pre

    should be updated to Target Applications Firefox Minimum Version=2.0 Maximum Version=3.0b2pre

    Second of all,

    $ cd Application\ Data/Mozilla/Firefox/Profiles/development_profile/extensions

    is located here “C:\Documents and Settings\$Account Name$\Application Data\Mozilla\Firefox\Profiles”

    Third of all,

    $ echo c:\temp\firstxpcomchrome\ >

    doesn’t work for me…. maybe i should say, it acted funny because i got something like this: “ctempfirstxpcomchrome” in the file.  Therefore, I recreated the “” with notepad and manually entered the “folder address”

    Other than that, everything is good 🙂

    To test your code, go “Tools”, there should be a red text, click on it and it will generates pop up input box, enter a value and you should get something like this.

    Lab 5 Success

    Man… I wish I given up Vista earlier.

    November 21, 2007 Posted by | open source | Leave a comment

    Redo Lab 1-2 & Lab 3-4 Posted

    I have to redo lab 1 and 2 because I lost my previous files due to the problem I have with Windows Vista.  I would strongly recommend everyone “NOT” to use Windows Vista for the labs because “NOT” only do you get a lot of stupid assertion error, it corrupts files  and act funny.  For the time being, I am doing all my open source work/lab with XP for now.  I got Fedora 7 last week, but I would have to wait until the end of semester to get it installed.  For one, I am too busy with project and presentation.  For two, I don’t want to risk any file in my labtop being damaged/corrupted.  Moreover, I am running low in disk space.

    I have updated the labs section of my wiki, all the link for lab 1, 2, 3 and 4 should now be working probably.  I will probably has to redo lab4 again on Xp for Lab 5, because I did lab 4 on Vista.  *sigh* so much trouble.

    If you are going to take DPS909, please do yourself a favor.  *DON’T USE WINDOWS* for your labs.  You got so much errors and it takes so long to make a build… It basically downgrade the learning experience by a few letter grades.  Get a Apple computer or something…. At least download Fedora, ubuntu, Suse or whatever but not Vista.  Good Luck.

    November 19, 2007 Posted by | open source | 1 Comment

    Lab: Creating a Binary C++ XPCOM Component

    Finally got the Creating a Binary C++ XPCOM Component lab working. here is the steps and trick i used.

    1. have a firefox debug build ready.

    2. create firstxpcom, firstxpcom/public, and firstxpcom/src folder in the mozilla/extensions folder

    3. generate a UUID with the “uuidgen” command, create with the UUID generated.

    4. create three (copy and paste the exact code from the wiki)

    5. create the “install.rdf” file

    6. run “../build/autoconf/make-makefile extensions/firstxpcom” in the object directory, to create the make object folder/file

    7. copy “FirstXpcom.cpp” from the wiki to the firstxpcom/src folder.

    8. run make at the objdir of firstxpcom, firstxpcom/public and firstxpcom/src

    *That should do the trick. Now, to test.

    9. install the javascript shell extension, if there is a security problem installing. read this “hints”

    10. Run your debug build of firefox and follow the rest of the lab.

    November 15, 2007 Posted by | open source | Leave a comment

    Problem with Fixing a bug in Thunderbird Lab

    I have been having problem creating a patch with the Fixing a bug in Thunderbird Lab

    The coding part is not difficult.  I got it figured out before I have the pre-build trees downloaded.  Basically, all you do is to make a change in a if statement inside a cpp file.

    Then my nightmare begin with cvs diff.  I have getting all kind of error messages and nothing seems to fix it.    Here is a recap of what I did and how i fix it.

    1. I downloaded the pre-built tree
    2. I unzipped it with winzip and put it in the “c:/moz/tb/” directory
    3. I made a change to the if statement, so that it check for ‘..’
    4. I did a “make” at in the object directory
    5. I tested the thunderbird and the fix work
    6. I tried to ‘cvs diff -u8p . > labpatch.txt’ and it FAIL!?

    I am sure I did everything correctly? what went wrong? Did you spot any problem/error with my steps?

    I got this error message such as
    $ cvs diff -u8p . > patch.txt
    : no such repository
    cvs diff: authorization failed: server rejected access t for user anonymous
    cvs diff: used empty password; try “cvs login” with a real password

    Then I tried this
    $ cvs login
    (Logging in to
    CVS password:
    : no such repository
    cvs login: authorization failed: server rejected access  for user anonymous

    I went out IRC #seneca and asked for help.
    I tried this:
    $ cvs -d diff -u8p . > patch.txt

    It runs for half and hour and no error message, but it didn’t patch correctly.  The patch.txt file didn’t pick up the change I made.

    After that, I did a lot for echo, path, touch, etc.  I tried all the cvs statement. cvs -, $CVSROOT, $CVS, etc.  Then I tried a bunch of stuff that doesn’t make any sense. lol~  I mean … whatever that make it works right?  I tried to reinstall mozilla-build, I tried to reinstall vb complier, I tried a difficult computer.  Nothing worked.

    After 6 hours of trying, it is time to try something new.  Since, I am sure that everything I did is correct.  The fact that I am having all these problem doesn’t make any sense.

    Suddenly, I come up with a new idea.  Maybe there is a problem with I am decompiling/unzipping the pre-build tree.  I downloaded “Winrar” and did the lab again following the exact steps I had above:

    1. I downloaded the pre-built tree
    2. I unzipped it with “winrar” and put it in the “c:/moz/tb/” directory
    3. I made a change to the if statement, so that it check for ‘..’
    4. I did a “make” at in the object directory
    5. I tested the thunderbird and the fix work
    6. I tried to ‘cvs diff -u8p . > labpatch.txt’ Now it WORK?

    6 hours of time well wasted. = =”
    Thank for Winzip

    Well, whatever that works right?

    November 12, 2007 Posted by | open source | 2 Comments

    Helping on SQLite/CVS Editor/Testing

    I am currently helping TJ on his Desktop Social Networking Integration Project.  He needs someone to create a Client with SQLite for testing purpose.  I did something similar before with sql server 2003 express, i hope they are similar.  once I got the client running I will be testing his project with him.

    On the other hand, I have been help Vijey on his extension project.  He has been having problem with setting up extension but everything is working now.  And I found him a free cvs editor, so that he can finally start working with cvs files.  I am going to contribute more on his project on Sunday.

    November 10, 2007 Posted by | open source | Leave a comment

    More for the Translator Tool 0.2

    our 0.2 is mainly directory walk, which we did by reusing some of the code we find online.

    currently we are working on the following,

    1. fix the key problem, which can be tricky and could use a helping hand
    2. make a list of translation words from EN-GB to EN-CA, take time but nothing technical
    3. support multiple words, which I already have an idea on how to do that easily
    4. file a new bug, as required based on the responsible we got from email
    5. write/improve comments, make the code easier to read
    6. update wiki  page and bug page, we are constantly doing this
    7. allow user to select a directory to run our script (make translation)

    we will try to have most of these tasks finished by this Sunday and the rest will be completed in our 0.3, as planned.

    November 10, 2007 Posted by | open source | Leave a comment

    Our 0.2

     I think I have a pretty good idea on what we want to build/code for this project: 
    our 0.1 is to makes a change to file(s) “color to colour”
    our 0.2 is a directory walk that “walk” all directory and file in a folder.
    our 0.3 will be to support multiple translations, instead of just “color to colour” and if we have time we will fix the “key changing problem” 

    It seems like the research and practice on python has pay off decently.  Yesterday, Armen and Rueen went to my house to work on our 0.2.  Armen arrived at 10:11am and Rueen arrived at 10:42am.  We want to have it done eary because we know that we are going to be extremely busy deeper into the semister.  Reading week is our chance to get “something” done again. 

    And yes, at the end of the day, we done it again.  We have “something”. our 0.1 make changes to all file in the current directory. now, our 0.2 make changes to not only the current directory but all the child and sub directory files. At first, i wanted to do it recursively just as what I did before in another course.  We had a few options:

    1. reuse the code from Axel, because the code seems to have a directory walk function called zipwalk.  that would take us a few hours to understand and modify/reuse
    2. use my recursive testing code in python that has not been tested. that would take a few hours to fix and modify..
    3. do a search a find a simple & working directory walk code online.

    Since directory walk is such a common task, I just know that they already exist somewhere.  So? why waste our time to recode the exact same thing.  Moreover, Dave encourages us to reuse existing code? Didn’t he?  ^^” It took me less than a minute to find one.  And yes, it works perfectly.  It did walk every file and folder.  But we want it to do more than just that.  We want the code to use our translation function and apply change to all DTD and Propertise file.  We made a few adjustment.  We completely rewrite some of our code, did a lot of copy and paste. 

    Fixing the indentation is not fun.  Python rely on indentation so much that if the indentation is wrong the program wouldn’t work at all.  No a problem.  I just has to do a lot of copy and paste of the indentation.  Moving things around.  I know the code will work… just that the identation is a little messy. 

    Now comes to think of it? There should probably be “an Automatic Indentation Fixing Tool/Function for Python” out there we could use.  If they don’t? Here come another open source project which will be greatly welcomed by all python developer 🙂

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

    re: my Watching@bugzilla begins

    I have watched a few days (almost a week) but I got nothing. I must have done something wrong. I log back in Bugzilla and check my “Preferences”-> “Email Preferences”

    User Watching: That looks ok….I have the name/address

    Field/recipient specific options: Oh no, I forgot the check on “CCed”, silly me. Anyway, problem solved

    I received 6 emails in an hour from regards a bug on Unix & Windows.

    I am able to see the conversation between the person who I am watching with others. Watching is a great tools to get to know a person work and his/her involvement in the bugzilla. I just wish there is some kind of tool out there that help me filter/organizes these emails.

    for example: only the messages which includes the word “locale; en-GB; en-CA; python; etc” are being forwarded to avoid information overloading.

    maybe a “search mail function” that go though all the emails in the mailbox, so that only the mail with the given word will show. Oh wait, Gmail has this already.

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