Tuesday, October 28, 2008

4 Player Pong Game

27 October 2008

No work today as it's a public holiday. Happy Deepavali!


28 October 2008

Back at work from a long weekend. Felt quite sluggish at first. However, I managed to set myself back to my 'working mode' and read up on the notes that Ming Hong passed to us last Friday as soon as I reached the 'working space'.

When Kevin arrived, we presented and shared our ideas which is supposed to integrate with Lightdraw. Kevin also injected new ideas and we settled on doing 4 games - Pong, Scrabble, Memory Game and Sudoku.

However, there is a change of plans after lunch. Instead of doing 4 games, we would be doing just 2 - Pong and a Puzzle game. Ryan and I would be working on the Pong while Leonard and You Hock would be working on the Puzzle game. We were then given time to do some research by ourselves. I manged to find some open source for Pong, but the source is written in Java. So I guess I have to study the codes and convert it into C++.

While searching for the source codes, I've also learnt how to unzip a '.zip' file in Terminal. Ming Hong and Cheng Teng came in the mid-afternoon and taught us OpenCV and how to create a simple Makefile and the concepts behind it. Our brains were then being overloaded after so much information. By the end of the day, we have managed to use OpenCV to create a window and draw a rectangle in it. Here's a picture of my rectangle done in OpenCV.



29 October 2008

As soon as we reached the office, Ryan and I started to work on the UI and tasks for today. Here's a screenshot of our '4 Player Pong' game.

As soon as we had finished the design, Kevin stepped in and we showed him our progress before he went for his meeting. I worked on generating the starting positions and size for the paddles and ball while Ryan worked on moving the paddle. We were so engross in our work that we had a late lunch. Before lunch, Ryan was able to make the paddle move up and down by using the 'w' and 's' key on the keyboard.

After lunch, Ryan and I integrated our work. Ming Hong then taught me about the OpenCV Time class and how it can be used in my '4 Player Pong' game and in Lightdraw. By the end of the day, I was able to move the ball in just 1 direction.


30 October 2008

Continued working on the ball as soon as I reached. Researched about the Random class in C++ before adding it to make the ball move in random directions. Around 10am, Kevin came in and checked our progress. Both teams are progressing well.

Soon after we walked over to NUH for lunch. To our surprise, the food there is even cheaper than our school's food! The bottled drinks there only costs $1! Leonard and I had Japanese food while Ryan and You Hock had chicken rice. We then went to the bookshop to stock up on some snacks before walking back to Fusionopolis.

We continued our work till about 3.45pm when Ryan had to leave for school to give a presentation about 'Imagine Cup' to our juniors. I then integrated our parts together before continuing to work on the '4 Player Pong'.

By the end of the day, I managed to check for the collision between the ball and the yellow paddle.


31 October 2008

Did the scoring function and checking of which paddle last collided with the ball before Kevin came in to check on our progress. Learnt about the Sleep function when I asked Ming Hong how do I like paused the application when the ball goes out of bounds. The sleep(int i) would pause the application in seconds while waitkey(int i) would pause the application in malliseconds. Ming Hong also shared that some programmers would use like loops in order to pause an application. However, this is not really safe as the looping depends on each computer. If the computer is very powerful and has high performance speed, the loop would be done in milliseconds while a very slow computer with low performance speed would take like minutes - which is not very ideal.

Around 10am, Kevin came in to check and also recap on what we have learnt so far in IHPC. We continued on our work after the recap session. I continued to check the collisions between teh ball and other paddles and managed to finish it before lunch.

After lunch, Ryan and I intergrated our work. After the integration, I discovered some bugs for the collision and spent the rest of the day trying to fix the bug while Ryan tried to get the paddle to move according to the mouse movements.


Reflection for the week:

This week at IHPC has been a short, but interesting week. I have learnt a lot about C++ and OpenCV and its functions. The working environment at IHPC is pretty similar to school. Perhaps it is just the second week; Kevin and Ming Hong are still 'spoon-feeding' us.

Learning to work with others is another experience I had here at IHPC. In school, I am usually the one who does most of the work and help others. However, here in IHPC, I am the one who is being helped. I am thankful for the help received.

I had also learnt how to trust my team-mates and the people working around me. No matter how different the way how Ryan and I 'coded' our work, at the end of the day, we are still able to understand each other's work through peer teaching(which is taught in school).

Here at IHPC, we interns are on the same page. Regardless of our cGPA in school, we are all learning something new each day.

To end things on a happier note, Happy Halloween!

Thursday, October 23, 2008

The 'Official' First Week!

The eSIP system for TP is alittle weird. We started on the 15 Oct, but we could only enter in our entries from the 20 Oct. Plus the 200 words limit is like quite little for us to describe what we had done during our attachment. I am sure that I am not the only one who complains about the 200 words limit per day.

20 October 2008

I reached the building early, as usual. So I waited for the rest at the pantry as I read up on C programming. Headed to our 'working space' and met up the rest. Speaking about our 'working space', here's how it looks like:



After alittle while, Kevin came in and we discused about what we had researched on Friday and in our spare time during the weekends. During the disscusion these are the things we shared with each other:

  • What are Compilers?("a must-know for Computer Science/IT student", as quoted from Kevin)
  • What is Open source?
We were then told of what we were supposed to do today - to continue on what we have been doing last week. So after the discusion, we continued with our tasks. We burned a DVD with the Linux ISO file on the MacBook Pro. However, due to our lack of understanding with the MacBook Pro, we actually mounted the ISO file onto the DVD instead of buring the ISO image onto the DVD. Wasted like 3 DVDs. After receiving guidance from Kevin and Ming Hong, we managed to burn the Linux ISO file successfully before going out for lunch.

We then installed Linux onto the PCs after lunch while watching the movie, "Pirates of Silicon Valley".

http://www.gearcritech.com/images/review101205_posv_t.jpg

I managed to learn more about who is Steve Jobs and Bill Gates from this movie. I've also managed to find out how Personal Computers came about and lots of other interesting stuff - such as the relationship between Steve Jobs and Bill Gates.

After the movie, we then proceed on our tasks. By the end of the day I managed to:
  • Install the Linux OS onto the PC
  • Install MSN messenger onto iMac
  • Install MSN messenger(aMSN) onto Linux

21 October 2008

The day started with me opening my 'working space'. I then proceed to turn on the Linux PC which I used the day before to write my first C++, "Hello World", Application and run it on the PC using Terminal. Kevin then soon arrived and we went through the steps we took to install Linux onto the PCs and the problems we faced. The important step that Kevin focus on was the partition step and explained it to us why it was important. We were also given a brief history and the differences between Linux KDE Desktop environment and Linux Gnome environment. We were then assigned to research on the Linux Directory Structure, the Terminal Commands and to install OpenCV onto our PCs.

After Kevin left to do his stuff, we then research and studied on Linux Directory Structure. Here's the overview of Linux Directory Structure:


http://www.debianadmin.com/linux-directory-structure-overview.html

We then went on to search and download the OpenCV installer on the Linux PCs and installed it using Terminal. Here are the steps we did to install OpenCV onto Linux:
  1. Go to the folder which contains the tar.gz file by using the 'cd (directoryName)' command
  2. Extract the tar.gz file using the 'tar -zxvf (filename)' command
  3. Go into the extracted folder
  4. Configure the file by using './Configure' in Terminal
  5. Compile the file by using 'Make' command
  6. Enter SuperUser(SU) mode by entering 'su' command and entering the password
  7. Install the file by using 'Make Install' command

By installing OpenCV this way, I've actually managed to learn what is actually going on in the back-end whenever I install a program/application. By then end of the day, I'm kind of hooked onto using the Terminal to extract and install file rather than just using the extractor with the GUI provided in Linux.


22 October 2008

I woke up alittle late today, but I still managed to reach the 'working space' on time. The morning was practically spent on going through the steps to install OpenCV and what does each process do. We also discussed about Linux Directory Structure, the commands in Terminal and was also given a brief introduction on what a Virtual Machine(VM) is and how it works.

After Kevin left to do his work, we then installed VMWare Fusion on our Apple computers. VMWare Fusion is a desktop software which provides similar functionality for users of the MacIntel platform, along with full compatibility with virtual machines created by other VMware products(extracted from wikipedia).

Once VMWare Fusion had been installed, we then installed Linux and some applications such as aMSN(a Linux version of MSN messenger) and OpenCV on the Virtual Machine. I had also managed to modify the sudoer list via the terminal. These are the steps I took to modify the sudoer list:
  1. Go to the sudoer list directory using 'cd /etc' command in the Terminal
  2. Log into a superuser(SU) account
  3. Open sudoer list via a text editor using 'nano sudoers' command
  4. Add my user into the sudoer list by editing the file
  5. Save changes made and exit the text editor
After modifying the sudoer list, Kevin then brought us to attend a talk in the auditorum. However, we only managed to attend the panel discussion about "Is the Pace of Science & Technology Moving Fast Enough to Meet the Needs of Growing Cities" as we had something on after our attachment.


23 October 2008

I reached the 'working space' a little late due to a traffic jam. Ryan was already there before I was. Not long after, the rest arrived and Ming Hong, our colleague who is also working on Lightdraw, taught us about the Text Editor function in terminal. We were then assigned to get our webcams to work with the Linux in VM.

After lunch, I decided to reformat Linux in VM as I felt that I had installed to many unnessersary files and driver. Ryan and I then tried to configure iSight to work on Linux till then end of the day. However, we managed to get the Logitech webcams to work in Linux. These are the steps we took to install the Logitech webcams:
  1. Installed livna repository for Fedora 9
  2. Installed Gspca package using 'Add/Remove Software' application
  3. Installed unicap, an application which uses the webcam, using 'Add/Remove Software' application
On top of that, we also managed to get the Logitech webcams to work in Lightdraw with the help of Ming Hong. However, Ryan and I still wasn't able to allow iSight to work in Linux. I hope we would be able to do it by tomorrow.


24 October 2008

As soon as I reached, I tried to get the iSight to work in Linux as it was supposed to be done by yesterday. However, something was wrong as I could not use the 'Add/Remove Software' application in Linux. I was prompted with 'database disk image is malformed' error. I tried searching online on ways to solve it but it was unfruitful. So I reformatted the Linux on the VM for the 2nd time in 2 days.(I am very familiar with installation process of Linux by now)

While I reformatted the VM, Kevin gave us a detailed explanation on how Lightdraw works with the OSC and X11. After the explanation, I managed to get iSight to work on Linux.(Yay!)

We then tried to run Lightdraw using the iSight but Lightdraw doesn't run as well when using the Logitech webcam because we can't set the Auto-Exposure properties of iSight. Ming Hong said that he would try to solve this problem and Kevin seemed happy with our progress.

During lunch time, we bought some stuff at MarketPlace as there is a mini-celebration for Deepavali later in the day. While heading down to MarketPlace, we caught a glimspe of some robots. Here's an interesting robot that caught our attention:


After lunch, we were assigned to brainstorm with simple applications to run with Lightdraw. We were told to choose between GTK+ and Qt to develop our application in. So we brainstorm till 3 plus in the afternoon as the office had a little 'Deepavali party' in the pantry where we were treated to snacks like pineapple tarts and some 'kuehs'. We ate some snacks before heading back to our 'working space' to continue brainstorming for our applications till we knocked off. I guess we have some work to do at home for this long weekend.


Reflection for the week:

These 5 days in IHPC had surely taught me a lot. From setting up Virtual Machines and knowing how the IDEs work behind the scenes, which are not taught in school. Thankfully, we were taught how to learn independently through subjects like CSAD(full PBL module), which is a very useful life skill that would help me through my attachment.

On side note, I think I'm beginning to be slightly 'anti-Microsoft' after using too much of Apple computers and the Linux. =P

Sunday, October 19, 2008

My First 3 Days

15 October 2008

It's my first day at Institute of High Performance Computing(IHPC). My dad drove me down to Fusionopolis to make sure that I was on time. Met up with Ryan, Leonard and You Hock at the lobby before making our way up to the office.

We met up with Janice from the Human Resource department to settle our documents before meeting up with our supervisor, Kevin. We were told that there were many departments in IHPC and we are in Advanced Computing(Visual) department. We were then brought to our "working space" and got our assigned computer. Ryan and I got an iMac each while Leonard and You Hock took the MacBooks. We were then given time to familiarize with our computers as none of us had actually used an Apple computer before.

After we familiarized with our "working area" and computers, we were then brought to somewhere in Holland Village for lunch via a shuttle bus service.

A formal introduction was done after lunch as we met up with other people from the department. We then were given a tour around the office before being assigned some tasks to do while Kevin and the rest are preparing for some interviews with the media.

These are the stuff which we are suppose to research about:
  • Linux and its distributions
  • Linux OS
  • Linux community
  • OS Licenses GPL/BSD
  • Mac OS
  • Linus Trovalds
  • Richard Stallman
  • Bill Gates
  • Steve Jobs
  • Compilers
  • Open Source
Managed to read about Linux OS, its community and its distributions before knocking off. On a side note, the people at IHPC are nice and fun. I'm sure we will learn and have a lot of fun along the way.



16 October 2008

Second day at IHPC. I arrived quite early, so I waited for the rest in the pantry while studying for my SAP exam which is on the following day. After the rest arrived, we continued our research as Kevin said that we would have a discussion on what we have read on so far. So I managed to read about Linus Trovalds and Richard Stallman.

At 10am, Kevin came over and discussed with us on what we had managed to read about so far before giving us a lesson on Linux. We then had a clearer view on what and how Linux came about thanks to Linus Trovalds. After the quick "lesson", Kevin then showed us how a Linux OS looked like and our next assignment is to install a Linux OS onto the computer. We were also told that we are supposed to split ourselves up into 2 groups and each group would be working an different platforms for Lightdraw - one group on Linux, one group on Mac. However, all four of us wanted to try working on Linux as we were interested. So we drew lots to see who would work on which platform. Ryan and I would be working more on Mac while Leonard and You Hock would be working more on Linux. We had lunch after drawing lots.

After lunch, we were then told to download the Linux OS(Fedora 9) and burn it onto the DVDs given. While downloading, we are suppose to watch a movie, "Pirates of Silicon Valley", to give us a better insight on who Bill Gates and Steve Jobs are. However, due to an unexpected media interview, we were unable to watch it and plans were pushed back. So we continued with our research for the rest of the day before knocking off.



17 October 2008

Third day of my attachment and it is the grand opening of our attachment building, Fusionopolis. Nothing much happened as Kevin and the rest are busy with the grand opening. So as a compensation, a picture of the building.

http://farm3.static.flickr.com/2134/2442357893_fc0f51f8c8_o.jpg

Since Kevin was busy, he gave us a day off (lucky us). Ryan, You Hock and I headed to Clifford Centre in Raffles Place to take our SAP exam. All 3 of us passed! The day off we got was well worth it.


Reflection for the week:

These 2-3 days at IHPC feels like an orientation for me. It's for me to get used to the environment and people at IHPC. Luckily for me, the people around me are friendly and are willing to help whenever I have any questions or doubts. Having the SAP examination this week is also quite stressful as I have to pick up new things on the job as well as study for the SAP examination.

However, thanks to the 'intensive' training received in the block mode, I've managed to pass the examination and also aquire new knowledge. I would say this is only the beginning of a new phase in my life. =)