Tuesday, February 21, 2012

Hacking all night @ NUSHacker's Hackathon

*Images of my happy teammates =D

Ha ha we won 2nd prizes of NUSHacker's Hack & Roll event last weekend. It was fun (but not that fun, ahem) to stay up a full day to code = )

We built something we ever wanted:  a visualization of SOC modules dependencies. Every semester I when I select modules to take, I wanted to know which modules I could take if I take a certain modules. Sometimes I'm interested in a high level modules, I want to plan modules in advance so that I can take it later as well. But what IVLE / CORS offer right now is only the prerequisites of each modules.

Every semester, I wanted to build it. Last vacation I told Hoang (the guy wearing a black jacket on the photo) about  when we bid for modules, and incidentally, he said he wanted the same thing for long! It must be a common problem for a lot of students. When the hackathon came along, we decided that it was the time to sit down and make it happens.

We built a web app that solved exactly that problem. It shows you which modules a certain module depends on, and the dependencies of these modules as well. It also show which are the follow up, higher level modules of a certain module. You can see how a level 5 modules depend on a level 1 module! You can select and deselect a few modules to see if you can still take the desired modules. Pretty simple and straightforward. It's like a skill tree, if you play games.

Well, it's not that simple to build ha ha. We intended to build something simple so that we could complete in 24 hours. One of the reason we picked the idea was because we thought it was simple enough. But we ended up with having to write our own crawler (to crawl modules information), simple parser (to figure out the logic of modules dependency), and 5 iterations of UI to make it simple enough to view (SOC turns out to have 200 modules! And this semester NUS offer around 2000 modules! Ugr.) Coding took a lot of effort, but the hardest part was in visualization: how to present the graph in a nice way that actually usable. And even coding the graph was no easy feat, since Hoang wasn't familiar with Javascript & Html5 Canvas API and had to figure out how to visualize the things on the fly. It was hard to describe it now, but after 10 hours into the Hackathon, I certainly felt like giving up already. LoL. (I remembered some guys coming and asked us about what we worked on when we were at the lowest morale and I just politely told him to let us concentrate).

But we managed to made it in 24 hours, with a lot of sweat (and profanity, swearing and cursing). Darn, it was a sweat feeling. I didn't think that people would be impressed, but they were more than excited about it. They told us how they would love to use such service, and how they liked our UI, and such. That was happiness. But my friend put it better: it was the happiness of complete a thing.

We learned a lot in 24 hours hacking the stuff. Oh, and we happened to win the second prize of the event along the way.

I'll update the link to our service later when I have access to it. I don't have it now sorry :-(

P/S: I'm having a Playbook 16GB for sale ha ha. Do contact me if you're interested =P

Saturday, January 7, 2012

Promise

Last December I visited a relative of my friend. He was around 40 and was, in some sense, an accomplished doctor. I had talked to him and acknowledged his experience as well as knowledge. He was far from a normal, average person.

However, his house looked like a derelict place. Everything was covered by dirt. On some part of the wall, the paint had fell off to the floor or partially fell off. There wasn't any furniture in the building, except for a refrigerator with little food inside. The dim neon light instead of brighten the place, made it looked even worse. The kitchen and the toilet looked messed up and terrible as well. 
I couldn't imagine staying in a place like that for long. My friend said it wasn't always like that, but after he divorced few years ago, he (kind of) stopped caring, and lived a temporary life. It was natural that his house degraded to this state. Although I respected him, and believed that it was not his desire to live in that state (no one would want so), I was disappointed by what was presented in front of me.

That moment, I thought: would something similar happened to me in the future? Then I made a promise to myself that whatever happened, I wouldn't give up on life. Well, that sounds general, but in the smallest ways, I will clean my house and reorganize my stuff every weekend. I will attend to even small little things in my home, because I believe they affects the owner's outlook greatly. I'll look after myself and take responsible for my own well being.

Monday, December 26, 2011

Time

Time is a precious and scare resource. I believe time is a stick to measure how important one thing or one person to you. The more time you spend on something, the more important it is to you (maybe unconsciously). But the things that are measured as important to you are not necessary the things that you (consciously) think to be important to you. For most of us, there are something fall into that category; otherwise you would not be complaining about procrastination or time wasting. So? Start spending more time (as in amount) on the things that you consciously, that you want to care about! Initially, just put sheer number of hours on them. Reduce time wasting on unimportant things by spending more time on more important things.

Then there comes the concept of 'deliberate practice'. It is not only pure quantity of time that matters, but quality of the time you spend too. For the things you want to improve, you must do it at a more difficult level, with more concentration (no multitasking) and thought (think about how you can do it better). You are not practice for the sake of spending time, you are practice to learn something new. And, doing is more effective than reading. It does not mean that reading is not important; reading is important as a tools to extend your box of knowledge. But at the end you must be able to turn the knowledge you acquire into action. It only counts when you can produce something of your own. So try to produce something everyday. For a programmer, write some line of code. For an artist, sketch a new piece of drawing.

*On a side note, I should spend more time with my family, especially my sister.

Wednesday, December 14, 2011

Australia Adventure (1): Google Sydney Internship



The first thing I would like to talk about my Australia adventure is the internship at Google Sydney.

Google Sydney is a relatively small office, compared to the size of Google. There are about 500 employees in the office, occupying 3 top floors of the Accenture building near the Darling habour and the casino Star City. There are a lot of engineering teams in the Sydney office: Docs, Maps, Chrome, etc. I was in the Google App Engine team.

My project was a very difficult project; it was one of the toughest projects I have ever done. The difficulty did not only come from the project itself, but came mainly from acquiring necessary knowledge in order to do it. Google love to build their own technology. Actually, they invented a lot of new technologies to foster their development process. They are fascinating. But imagine you was in my shoes, you had to understand the current implementation of the system, which was complicated and not always well documented, while learn 5-6 new advanced things at the same time. You had to design and implement the project using something you did not know, which was different from the thing used currently, which you also did not know. To add to the complication, it required a few new and/or uncommon knowledge that even your host did not know well. The only thing I was familiar with before taking the project was the language, Java.

Although I was always confident of my skill, I was still doubtful if I could complete the project with the remaining time of my internship. In fact, when I started, I only expected that I could finish the back end implementation. At the end I managed to finish not only the back end, but also API and front end presentation of the project. I was totally happy about that.

The project was tough, but it was also a fascinating learning experience. It challenged me not only in technical ability, but also work habit. Given limited timing, I needed to learn to work more efficiently. I learned to keep myself on track by constantly writing down what I need to do. (There were many times what I wrote was "what should I do now?" But even so, it was still helpful to keep me on the topic). I also learned that taking appropriate break was crucial. I would occasionally retreat from the computer, go to a tea drop and lie down there alone, musing about what I was doing. Many times I came back with a clearer understanding of the stuff I just consumed, some few ideas. Sometimes I was still as clueless, but I acknowledged that resting was not enough, that I had to come back and stick to the problem longer. I found that if you were stuck at a problem, it was usually better to take a break, then change the approach to the problem. By the way, strange as it may sound, I am growing detached from my laptop.

When it came to actual code implementation, I realized that code design (code organization) was not trivial. My first trunk of code actually required a lot of changes in design (thanks for my host who suggested me better and better design). It took me several times to get it (kind of) right. The final code was much cleaner in design than the initial code. One lesson I learned was avoiding over design or over generalization. Sometimes it is better to have a very good, clean (and explicit) design for the very specific problem at hand, than a general solutions with multiple levels of abstraction. A more explicit lesson was using class constants to capture things that class need to use. That way, when someone use that class, they do not need to know about the dependencies required to use it in most cases.

Another thing I would like to talk about is testing. Google requires testing extensively. Every functions must be tested. I learned a lot about automated testing throughout the internship. However, I cannot help to think that aggressive testing significantly slow down development time. In fact, I believe I spent around half of the implementation time writing testing code. However, automated testing is still crucial. The question is how much is right? In the context of a start-up, I think product development should be the focus. Automated testing code should be added to the core, frequently used functionality only, or when something is broken several times. Facebook is pretty big already and yet extensive testing is not yet enforced.

There are few other lessons I have learned (or reaffirmed that it was right) as well, such as better estimation of the time needed to complete a task (that is, including sufficient buffering time in the estimation). I have got a better understanding of my skills. Or breaking tasks down to smaller, easier to complete and review changes. Each change should implement one and just one small improvement. If you need to implement a big feature, you may (and should) have a draft CL (diff) to have the view of the big picture, but when write check-in code, break that CL down to multiple small CLs. In Facebook, Google or a big company, it makes it easier to get your changes checked in the code trunk. In a small start-ups, it helps reviewing code easier. By the way, unlike testing, code reviewing should be done even in small company. At least have a glance of what others write..

Lastly, to praise Google, their internal technologies are very awesome and advanced stuff. Despite of their complexity, they are relatively easy to use (well, in most cases).

Now let us talk about social stuff. It was unfortunate that my project did not involve cooperation with lots of other people in the App Engine team. We do chat and joke around a lot during lunch and dinner time though. My colleagues are, generally, nice and geeky. However, it took me longer to get along with the team compared to at Facebook. I guess it is because of the nature of Facebook. We are friends on Facebook and know a lot about others more personally. It gives a higher sense of closeness. People at both companies are smart and friendly though. It led me to believe that I can expect awesome people at any office in both companies (come on, these geeky people are always nice anywhere you go). The more important thing is whether you like (/love) what you are doing or not. Another intern who worked at Intel before confirmed to me that people there are also very nice and fun, but he did not enjoy it totally due to the kind of work there. (Talking about that, I feel that the team could do better at selling me the idea of Google App Engine. For example, why I should work for App Engine instead of Amazon Cloud Computing service? They kinda took it for granted that I would be passionate about GAE. For my main project, however, I immediately realized its importance and/or benefits to developers, so it was not hard to convince myself doing it, despite of its complexity.)

I have also got some taste of working with people in different timezone. But it was not fun (no wonder Facebook resist opening engineering office in different timezone). Your progress could easily be put on hold if you depended on response of people in another half a day away. They only started working when you were out of office! Sometimes I made changes to my work, and had to wait until the next day to receive reply before I could continue doing anything. It was not too bad for me, because I usually had something else to do during the waiting time. However, I did get blocked a few times. It was much worse for another intern friend of mine. He complained to me a lot about how he would do nothing in the afternoon because he had made all his changes in the morning, and had to wait for comments from people in Mountain View office to get back to him first.

There are tons of other benefits working at Google, such as free food, flexible working time, game room, break anytime you want, massage, etc. etc. and etc. They are all awesome but do not need much  discussion.

Overall, the internship was totally worth it. I feel that I have grown tremendously throughout the term. Now, after the two internships at Facebook and Google, I have much better understanding of software development process in real life. My confidence was just leveled up one more time. However, it is also a good reminder of my current ability. I still have yet a lot of things to learn. But I will continue growing =)

Thursday, September 1, 2011

My Facebook Experience!

The internship was an awesome experience. But if I have to say only one thing about it, I would talk about my colleagues there. It was the first time I have seen such genuine and passionate engineers. It sounds weird and prolly corny but I always feel they were very true to themselves. Their actions were always original and suggested a free, happy will. They were kinda transparent and easy to get along. They were helpful to me and treated me really nice. And they never seems to be bothered no matter how much I annoy them haha.

I'd sum it up about them in a sentence from the film "Juno":
"You're, like, the coolest people I've ever met — and you don't even have to try!"
P/S: Just to update since some people still don't know. I'm going to Sydney soon for my Google internship. There won't be NOC afterward and yeah, it's Google Sydney not Google Mountain View.

Friday, May 27, 2011

Just dance [Lady Gaga]

Don't want to be corny but suddenly I feel so grateful to end up at NUS 2 years ago. Since then I've met lots of wonderfully people. Just feel awesome now.

I guess what I tried to say was that no matter what direction our life might lead us to, we will still end up alright. That is, if we adapt a positive view of life. I took 2 gap years to apply for US universities but eventually failed to land on any of them and ended up at NUS. But now I'm happy for that. And I never feel ashamed of failing so hard back then.

Monday, March 7, 2011

Because you're young (?)

Recess week was over for a week already, but I haven't really escaped from the hibernation mode gained after it. Well, the reason for hibernation was not that I slacked too much in the recess week and carried it over, but it was the exact opposite! I was too tired. It was really stressful. The first time I really wanted to slack off and sleep the whole day. Except for 1 day I went for part time job, I spent most of the time in PL1! 2 nights slept there! (And some sleepless night also). We (I have a handful of companions, more on them later) would stick with the computer all the time, occasionally slept for a couple of hours.

Let me tell you, marathon programming is not fun at all. It really kills your nerves. And after long hours of programming, your mind doesn't really think straight. You will occasionally find a silly bug (I always say all bugs are silly) that cost you hours of debugging. Someone would ask why didn't we choose a healthier life style, like taking proper rest. But there's something called deadline!

There is some merit in this comic. The word you hear the most in a programming lab is probably "WTF." In different languages!

Actually, I cannot really blame our (evil) prof (=P) for all the suffering. He's quite evil, indeed. But a huge part of the time I spent there were for extra features! It's written there, clearly, that they are not required. Not required for an A+, not required for a free trip to WWDC. But I wasn't really want to die for an A+, or strongly interested in the free trip (I will be near there anw!). So I really really wondered why I suffered so much for it. Actually I wondered more about my friends. LOL. They were like having lots of extra features by Thursday already, yet on Sunday you still found them camping in the lab! I was actually quite slack compared to them; I only really camped at the lab since Thursday. For them? Some of them stayed in the lab all the way from Monday to Friday! One of my friend (Long) said something like: "I know that I'm not (as) good, so I'm gonna spend more time on it!" Very deliberate! I respect. Another one (Hoang) got a midterm on Monday, so he decided that he would go back on Saturday (he had a lot of extra features already, like different wolf's breathes -- real different breathes, not just different in appearance like most people) and study for his mid term. But Sunday I still found him come back to the lab, continue working on his game! There were something that bugged him and he couldn't stop working on it (yet!).

I did not really ask others for their ultimate reasons, but if they were like me, which is very likely, it would mainly because you wanted to make something decent. Without the extra features, the game wouldn't be really cool. It would not be really a game, even. So you went and implemented some extra features, which brought a long hours of debugging and testing. Besides, you have to fix here and there to fit the new thing in also. Ultimately you literally killed yourself for some cool features you wanted. There's no point to regret, though.

Besides, there is one thing I realized when looking at my friends and myself: once you're stuck at a point, you're not gonna give up easily. It's not really wise sometimes, but it's what happened. There's a certain force that attach you to the code until you eventually solve the problem. I think a bug can be considered a mystery that we have to discover (and solve!), otherwise it's gonna bug us the whole time. It's really funny when it comes to meal time. We would wait for each other to finish the piece we're working on, because no one was willing to stop. But you thought you could cook something up while waiting for others, so started coding something. You couldn't make it, though. By the time others wanted to go, you'd want to work just a little more on your code. And they started to wonder if they could have something done meanwhile... Well, you know the story. It always took 30minutes - 1 hour until we eventually went for meal.

One thing I think it was good for was building relationship (friendship). After so much hours suffering together, I think we really became closer. Everyone would willing to help other to debug their program. I must admit that others' insights are always very helpful! Even critical! Thank to my friends (experience) I saved a lot of time debugging. I hope I helped them a little also. Never forget to ask for others' piece of advice when you're stuck at something; they might know something you don't. (Especially true in this case, because we are all very new to objective-C and iOS).

In the other hand, I think spending too much time on the problem sets wasn't a really good idea. You're gonna go through hell to become stronger, but when you're busy with some assignments, you will not have time to discover other stuff. Besides, you need to have time to ponder and reflect about stuff happened. In this case we didn't have much time to explore ideas for final project. (I can't really blame anyone though). But what really bugged me was that Patrick didn't do anything special / really extra features / outside requirement for his game. He always did, wayy extra actually. And another friend complained that he didn't feel the passion to implement the extra features. He said that it wasn't his idea, and it wasn't very significant to do it anyway, so it didn't really fueled him to die die for it.

P/S: I really think I overdid it this semester when taking 6 modules, one of which is cs3217, and doing part time job, which takes around 10 hours a week. Sometimes I felt like killing myself literally. I need to learn to cope with stress better :-(

P/S2: the title was a little random. It was the first thought come to my mind before writing this, so I will just keep it there.