MozCamp Asia 2012 (Singapore) – My experience in 5 languages: English, Mandarin, Cantonese, Singlish, Korean

MozCamp Asia just finished a few hours ago. ~200 of us gathered in this small rainy and humid city-state, at the Scape (at Somerset) and the Hub just across, and raining consistently every afternoon at approximately 3-4pm was probably an interesting experience to some folks unaccustomed to it. Welcome to a tropical climate!

Anyway, I just thought to blog my experience in the 5 parts, each containing 1 part of a spoken language that I actually spoke. I apologize in advance if parts of the upcoming multilingual paragraphs are incorrectly expressed, but plowing through 5 spoken languages at MozCamp to different communities was an incredibly extraordinary experience that I wanted to share with everyone. The regions in parentheses were regions where people I personally spoke to, actually came from.

Here goes:

  1. English (for Westerners/Others): When I first arrived at MozCamp, it had a homely feeling. I studied in Singapore for over 20 years, and after moving to the States for work, coming back was a surreal experience. Was I a local? Was I a foreigner? I just had to adapt.
  2. Mandarin (for Chinese/Taipei friends): 很快的,我又遇见了好多旧朋友,也很幸运能够遇到很多新朋友。能够说普通话/国语/中文的朋友不只来自中国大陆或台北市,我也碰到法国和澳洲朋友,能够相当流利地说中文。好神奇的世界啊。
  3. Cantonese (for Hong Kongers): 有d活動都幾得意。我特別鐘意我美國寫字樓o既一位同事o既一個活動,session名叫做 “Help the UX Team Understand Security and Privacy Concerns in Asia“. 佢個名係 “Larissa Co”. 依個活動都係幾有趣,好好玩。之後我好幸福能夠認識Sammy Fung,佢係我來自香港o既第一位Mozilla朋友。幸會,幸會!
  4. Singlish (for Singaporeans/Southeast Asian friends): And then after that I was vely vely lucky to meet people from Southeast Asia, some again and again these few years. They all very very friendly, make me sometimes miss the times when I was around here. I super enjoyed my time leh, got good local food, got many friend, all vely vely happy.
  5. Korean (for Koreans): 저는 한국친구하고 저녁식사를 먹었어요. 한국친구가 싱가포르 동네식사하고 싸다하고 좋다음식을 좋아해요. 저도 좋아해요. Night Safari 에 택시로 갔어요. Night Safari 가 재밌어요.

Note: All of the phrases, including the translations, are off the top of my head, with virtually zero references from anywhere else. I make no guarantee to their grammar correctness / colloquial updated-ness at all. Once again, I apologize if I had inadvertently made any errors.

Note 2: Cantonese and Singlish are largely spoken languages, and as such may make absolutely no sense when written down. Also, Singlish is not exactly a new language of its own, but it’s unique enough to be understandable by folks from Southeast Asia and relatively not to someone from anywhere else / the Western world, so I’ve included it in.

===

English version/translation (may not be 100% accurate):

  1. ENGLISH: When I first arrived at MozCamp, it had a homely feeling. I studied in Singapore for over 20 years, and after moving to the States for work, coming back was a surreal experience. Was I a local? Was I a foreigner? I just had to adapt.
  2. MANDARIN: Very quickly, I met up with a lot of old friends again, and was very fortunate to be able to meet a lot of new ones. Our Mandarin-speaking friends not only came from mainland China or Taipei, I also met folks from France and Australia who were able to speak somewhat decent Mandarin. What a interesting/mysterious world.
  3. CANTONESE: There were interesting and unique activities. I especially enjoyed the session titled “Help the UX Team Understand Security and Privacy Concerns in Asia“, by my co-worker also from our American office. She is Larissa Co. This activity was very interesting and fun. After the activity, I was deeply honoured to be able to meet Sammy Fung, one of our community members from Hong Kong, and the first I’ve met in person. Pleased to meet you!
  4. SINGLISH: After that, I was very lucky to be able to meet people hailing from Southeast Asia. For some, it was a case of meeting up again these few years. Everyone was very friendly, indirectly causing me to miss those days when I was in Singapore. I definitely enjoyed these few days, with lots of local foods and many happy friends.
  5. KOREAN: I went to dinner with Korean friends. Korean friends like local, cheap and good Singapore food. I like it too. Went to Night Safari in a taxi. Night Safari was interesting.

Addendum: There were times when I would get confused and mix languages up. e.g. Speaking Singlish to a community not accustomed to it, or Chinese to others. Rectification usually took a few seconds/minutes.

Advertisements

What Mozilla is about..

Recently, I was in a group of friends where I was the new guy, and there were the usual questions about where you’re from, and what you do, etc. Having said that I worked in Mozilla, including Firefox, the folks perked up asking about update fatigue and comparisons with competing browsers.

However, once I mentioned that Mozilla always puts the needs and wants of the end-user first on its priority list and not to maximise profit for itself nor its shareholders, (or something along those lines because I was not speaking in English), the whole room simply went, “Whoa……” with a smile on most faces.

Couldn’t have wished for a better response.

Rust Made Easy – Part 1

Edited on 2013-04-03: This page is outdated.

Rust is a prospective language which just had its version 0.1 released, and coming from a background that does not hail from C or C++, learning it seemed quite daunting. Starting off writing Java in college and digesting Python in my free time helped, but just a little. Since I previously had some time on a plane and not really sleeping, I’ve been looking at ways to simplify learning Rust, and hopefully by guiding you, as a reader, along the way will help us share our experiences and enhance learning opportunities for all.

But seriously, what is Rust? You can find a short write-up here, along with things like not allowing null pointers (Yay! no more null crashes). Various other technical bits are way above me now. Nonetheless, follow the instructions to obtain your Rust compiler. In the following examples, save the code snippets in a test.rs file, renaming “test” to whatever you like as long as it still ends with .rs, compile it with the Rust compiler “rustc test.rs” and then execute the compiled file “./test”.

Alright, so let’s dive into Rust. To print a statement, let us understand that we first have to import a standard library or a module, known as std.

use std;

It’s like including iostream.h in C++.

Once we’ve done that, we can now print a statement:

use std;
fn main() {
    std::io::println("Hello World!");
}

to get:

Hello World!

(In Python, it is the equivalent of “print ‘Hello World!”)

In Rust, it is necessary to have a main function. The double colons “::” mean that it is calling println within module io within the std module. It’s similar to System.out.println in Java. Note that semicolons “;” at the end of the lines seem to be necessary most of the time — there are special circumstances where “;” is not needed at the end, but let’s leave that for later.

How about a number? I would like to create a local variable, which is a number, and print it. In this case, we use `let`:

use std;
fn main() {
    let x: int = 8;
    std::io::println("Our number is: " + int::str(x));
}

Two new things here. One is “let x: int = 8;”, which means create a local variable x of the type int, and set its value to 8. Again, there will be situations in the future where you leave out specifying the type, and in those cases the type will be inferred (the compiler will “guess” the type).

Second, note that we cast x to a string before printing it. In Rust, we cannot print a number without first changing its type to a string. This is done by calling str from the int module and passing in x, so we have “int::str(x)”.

You should get the output:

Our number is: 8

You may have noticed that Rust uses shortened keywords, such as “fn” for a function. It also uses “ret” for returning values. We will see more of this as we go along.

Next up, let’s construct a separate function instead of cramming everything up in main, and have it print our favourite number again:

use std;
fn fav_number(n: int) {
    std::io::println("Our number is: " + int::str(n));
}
fn main() {
    let x: int = 8;
    fav_number(x);
}

You may notice that the fav_number function accepts an integer variable n, and this is reflected by “n: int”.

What if we want to pass in our favourite number as a command-line argument? This is done by:

use std;
fn fav_number(n: str) {
    std::io::println("Our number is: " + n);
}
fn main(args: [str]) {
    fav_number(args[1]);
}

Run this with “./test 8” and you should get the same output as above:

Our number is: 8

Remember to run it with a number as an argument – if you leave out the number, you will get an error:

rust: upcall fail ‘bounds check’, test.rs:6
rust: domain main @0x22a1a50 root task failed

Examine this example more closely and you will realize that there is no casting involved. This is because we are taking in the argument (number) as a string, and merely printing it out again.

How one learns from his students in his very own class..

The third semester of teaching CS3108 (Mozilla) is coming to an end. For those of you new to the course, it is one that I guide students at my school, National University of Singapore, where I am currently finishing my third year of undergraduate studies. (Kudos to Professor Lee Wee Sun for supporting me over the many months, as well as others I haven’t mentioned)

Over the past semesters, I have welcomed student feedback on how I can make the course better and more exciting, at the same time remaining its flexibility in allowing students to fulfill their dreams at working on a large open source project.

Some of the feedback have been interesting. The first two batches came back with the opinions that each lesson have an overview of what the lesson should be about (I’m getting better at this, doesn’t seem to be a problem this semester), while there have consistently been queries asking about the CAP (GPA in other countries) required to take the course (which there isn’t).

As for the latter, my professors have been noting the trend that half the students in the first lesson of the course seem to disappear after hearing about the expectations. I am of the opinion that only the independent survive, because I am a student myself, I do not possess the opinion that the students be spoonfed material. I merely guide them along, in return for some wonderful projects that have happened over the past courses. To be honest, by the second half of the course, the students are usually much more well-versed than I am in their own area of interest.

Of course, I could always do better. This semester, there has been thought about how to obtain a student-project more easily, and this in fact has recently been mitigated with the introduction of the `student-project` keyword a while back. Interestingly, the students are also suggesting to give homework, not in the form of overly tough laboratory work, but rather short little quests. Such quests could involve writing a simple mozmill test to open a new tab, or even to use the DOM Inspector and find out the id of the Go button in Firefox, for example.

I thoroughly enjoy my classes at school. It is a great opportunity for the students to learn about the open source world, as well as a place where I can also learn from the students themselves, especially since some of their technical coding skills may be better than my very own. It brings forth the message of humility, where no one is above anyone else. I always encourage them to refer to the classes as “sharing sessions”, and to call me by name rather than “Professor”, “Lecturer”, or “Sir”, especially since I am none of the former.

I will continue to teach the course for another two semesters, till I graduate. Hopefully by then someone will take over, but till then I will continue to teach the class even though it does occasionally get tiring on top of my own university work. I thank my professors (Professor Dave Humphrey included), past and present students and members of the Mozilla community who patiently help out the students as they swim their way out of the deep end. The course has helped both the community (they get fixes) and the students (they get the experience – one past student did enough to get his name in official credits, another made use of the experience to set up his company, and a third finally may have found enough confidence to apply for a Google Summer of Code project).

CS3108 (Mozilla) will count as one of the biggest achievements that I am proud of, during my university days. I sincerely hope both the students and myself will benefit from this experience as we begin to look for jobs after graduation and step out into the real world.

NUS in Mozilla map of students around the world

Mark Surman has an interesting post over at his blog, where he maps the list of students working on Mozilla around the world. It’s amazing how Mozilla just started off in the education area not too long ago – and already encompasses ~14 schools worldwide now, from the North America to Europe, from Asia to Oceania. Kudos especially to humph for his great work linking up folks around the world.

National University of Singapore (NUS) has just finished CS3108 (Mozilla) a few weeks ago (the 4 folks being Yuen Hoe, Yaoquan, Hendrik and Tony), it will be taking a break over the next semester as I head overseas for an exchange program. I look forward to more students stepping into Mozilla development in the future.

Before I end here, I would especially like to mention that it really reaps returns and satisfaction of the highest quality, when students transform from someone totally lost to someone capable in their own right in the world of open source, within mere weeks, guided by folks around the world, with different timezones, different cultures.

Talk on Open Source development for college students, by a college student

I gave a 1 hour talk on open source development at my school, National University of Singapore, on Friday evening 6.30pm, thanks to an invitation from one of my professors, Prof Damith. There were about 15-20 students in the audience, most new to OSS, while there were a handful who already worked on OSS projects, such as Linux and Bazaar. Bits of my Mozilla open source experience went in as well.

I accepted the invitation to give a talk because I love to teach anyone who is willing to learn. It perks me up when I see fellow students learning from me, eventually becoming better than me in their own areas of OSS development. It is one of the best feelings anyone can experience. (yeah, maybe on par with, but probably not surpassing the feeling of being in love)

The slides have been uploaded. I hope the slides would prove useful to anyone looking to work on OSS, please let me know if I can help students in any way, my summer isn’t fully booked yet, and I can head anywhere around the world for discussions / talks. 🙂

(WordPress.com prevents embedding of Google Presentation slides, so I did a link instead.)

student-project keyword is live on Mozilla bugzilla – start tagging now!

Dave Humphrey has written an excellent blog post where he describes the introduction of the “student-project” keyword in Mozilla bugzilla – he also covers how to classify bugs as student-projects.

I have also gotten some queries up and running over at Mozilla Wiki where you can keep track of these projects via queries, feeds and all. These queries are Mozilla-wide, they encompass all products from Firefox to Thunderbird, SeaMonkey to Sunbird etc.

Please start tagging, then tracking “student-project” now, if you are interested!

And do join us on #education on IRC, as well as the weekly meeting phone calls. We are having great momentum here, let us continue to maintain it and push forward. 🙂