2014/15 Sem 2 Module Review

Below is my module review for Academic Year 14/15 Semester 2, my second semester in year 2.

CS3230 Design and Analysis of Algorithms

This module is one of the core modules for CS major. And it builds on top of CS2020 (or CS2010). Most of the algorithms covered in CS3230 are already taught in CS2020. The additional work is to “analyse” them or “design” some algorithm that fulfills certain requirements. In addition to giving algorithms, complete answers for this module require certain amount of proving, including correctness, termination, and analysis of running time. Apart from the usual graph algorithms, this module also touches on complexity classes (NP, NP-C, etc), amortized analysis on running time.

Overall the concept is not exactly new if you have some programming background, knowing what is NP and amortized analysis. Questions that involves proving can be challenging if you do not have a solid mathematics/discrete structure background.

Midterm, final, assignments and tutorial participation are counted towards the overall grade. If you can solve the assignments and tutorial questions independently, exams should not be a problem.

Expected Grade: A

Actual Grade: A

After thoughts: This is no surprise for me.


CS2103T Software Engineering

Again this is one of the core modules for CS, and lots of people are taking this (including people from ISE and CEG). The concepts are useful and can be readily applied to software projects. The module covers all phases of software development cycle, including requirement analysis, design, implementation and testing. I learnt a lot of useful knowledge on how to do software engineering properly, such as the various patterns and testing techniques.

Project makes this module really hard. As our tutor put it, the project can be done easily in a few weeks by one person, but the team-based nature makes it hard. Coordination and communication within the team can cause a lot of delays and extra work. From a web and mobile developer background, I find it troublesome to “code from scratch” without using any frameworks. Our team generally completed the software but it was not polished enough due to the delays in development.

The final and the participation marks are not hard. You need to make sure you can understand the concepts taught and apply them to simple cases.

Expected Grade: A-

Actual Grade: A

After thoughts: Well, I got a grade higher than I expected. I guess the lecturer was just scaring us when he said “we will not get the deserved grades unless we do well in finals.” after the product demo.


CS2101 Effective Communication for Computing Professionals

This module is paired with CS2103T. It serves to enhance our ability to communicate with others as an IT professional. The whole module is graded based on continual assessments. It covers basic rules and principles in communication and writing, as well as some areas that are important for the IT field, such as interviews and software project presentation.

Consistent effort is needed for this module as you are constantly graded for various components. The components themselves are not very heavy. A lot of work is in the form of writing and talking, so it is more of an English module than a CS module.

Expected Grade: A-

Actual Grade: B+

After thoughts: B+ is a bit lower than my expectations. From the way the tutor communicated with us, I thought we were doing fine and deserve at least a A-. Everyone in my group seems to have gotten B+ or lower, so maybe it is just how this module is graded.


CS3243 Introduction to Artificial Intelligence

This module is first AI module that I am taking. It covers some basic elements of searching techniques, logic and uncertainty. A lot of focus is on understanding the various algorithms, such as A*, RESOLUTION, UNIFICATION, MINI-MAX. It certainly taught me a lot of new concepts, though some of concepts (logic) seem to overlap with earlier modules like CS1231.

The project is about implementing a learning agent for Tetris. The concepts used for the implementation is not directly covered so the teams has to do research on their own. Luckily in our team we have someone who is good at researching. He did a lot of work in implementing the learning algorithm. The lecturer required the implementation to be explicitly designed for large amount of data but I don’t feel that we are good enough to show that. We were pretty satisfied with our result that can clear about 20k lines on average. So we did not really put in too much effort to optimizing the running time.

The final and the tutorial questions are similar in terms of the difficult level. Understanding the concepts, especially the mechanism of various algorithms is important in answering the questions.

Expected Grade: A-

Actual Grade: A-

After thoughts: The grade that I expected. I can say that I understood the concepts well but the midterm and the project was not well done so A- is pretty normal. It turned out we did not score very well for the performance of tetris agent, in fact, we got zero marks for some test cases. We were expecting at least a decent performance since we have a “good” average of more than 20k lines cleared. Maybe the requirement for this project was much higher than we expected.


CS3882 Breakthrough Ideas for Digital Markets

This module is one of the less known and less popular modules, only about 10 students took it this semester. It focuses on generating ideas for digital products and transforming the idea into a prototype. A lot of interesting concepts were taught, like design thinking and patenting.

Half of the work for this module come from the individual reviews of the concepts taught and group effort on proposing and refining the idea. Then after deciding on the idea, the teams are required to develop a prototype and do a final presentation with demo. The prototype is mainly used to demonstrate the feasibility and the appeal of the idea, so only minimum amount of coding is needed to develop the MVP. Overall this module does not take up a lot of time. It is quite useful for people who are intended to do a start-up. The professors for this modules are very helpful and they have good experience in the IT industry.

Expected Grade: A-

Actual Grade: A

After thoughts: A little higher than I thought, but no surprise. It was a very small class size and there had to be some people who score A. So even though our project was not fantastic, it proved to be better than our classmates.

[Solved] onDataChanged not called, Android Wearable

I was doing a school project on Android Wearable for the past few days. A strange bug happened.

I used  Wearable.DataApi.putDataItem(mGoogleApiClient, putDataReq)for triggering  onDataChanged in WearableListenerService. However, I noticed that sometimes  onDataChanged is not called even though the putDataItem method has fired.

The strange thing is this bug only happens on the first call, subsequently the calls trigger normally. More interestingly, the bug only happens sometimes, once in a while, the first call will trigger normally.

Aftering debugging and getting nowhere, I decided to get help from stackoverflow. I found an answer that was relevant:

http://stackoverflow.com/a/24697312/1472186

The answer suggests adding a time field into the DataMap  so that the data is really changed every time. I did not think that was the cause of the problem, because I followed the online tutorial and had a count value in my DataMap, which increments every time. This should have caused the data to change every time.

However, after I added the time field into the DataMap, the bug disappeared. So it was true that my old implementation was not causing any changes. The count value did not work. After thinking through the process again, I figured out why.

The count did increase after each call, from 0 to 1, 2, 3, … However, those values are stored in the DataMap within the wearable device, not on the phone. So it was possible that wearable device already has a DataMap in which there is a data with count 0, although my phone app does not have the DataMap yet. When I send a new DataMap with count 0 from phone to the wearable, that DataMap is already present on the wearable, and hence no change will be detected and onDataChanged will not be triggered.

For time, since the current time is unique and always increasing, there would not be a case where the time in DataMap on the phone already exists on the wearable, hence always triggering onDataChanged.

Quick thoughts on Amos Yee

Evaluating Amos Yee as a person

  1. He is special, perceiving things differently from his peers and the social norms.
  2. He is logical, basing arguments on his observations and facts gathered elsewhere.
  3. He is emotional, adding unnecessarily strong emotional words to his arguments.
  4. Some sources suggest that he is suffering from Narcissistic personality disorder. While this might be the case, I believe the line between having the disorder and having a very special personality is very thin. (updated on 1 Apr)

*I drew some of the observation from the other video of him:

Explaining why the video (on LKY)

  1. By mixing arguments with obviously offensive words, he is able to draw people’s criticism to the latter. In comparison to the insults, his arguments will appear more valid. Therefore, when people are criticizing him, they will be compelled to accept his arguments, at least partially.
  2. He needs to get lots of attention for his future filming career. This could be the fastest, cheapest way to do it. Although extremely risky, the video is the best way to express himself to the largest audience possible. It may attract people who appreciates his talents.

News stories on the Amos Yee incident

  1. Amos Yee, who made insensitive remarks on Christianity in video, arrested – ST  30 March, 2015
  2. YouTuber Amos Yee charged, bail set at S$20,000 – CNA 31 Mar 2015
  3. (Update) Teen blogger Amos Yee granted US asylum 25 Mar 2017

Paradigm shift from functions to aesthetics, and next?

The idea of paradigm shift was introduced to me in secondary school English lessons. We talked about how a particular sector changed dramatically in a period of time. This pattern is actually observable in the technology industry.

In the IT world, we had a paradigm shift from functions to aesthetics.

Past: From nothing to functions

In the earlier 2000s, when we first experience the power of IT on Windows 98, people were fascinated by the fact that the computers and other devices can do so many things. We replaced writing with typing, mails with emails, and we celebrated the whole range of functions that IT has brought to us. That was the paradigm shift from nothing to functions. Everyone was new to these functions and we were more than happy to have them.

Recent: From functions to aesthetics

Then we experienced time. In late 2000s and early 2010s, people got used to these functions, especially the younger generations who grew up with these functions. They did not experience the change in their lives, because emails and word processing “were already there” for them. Also, the new functions were developed but they were nothing compared to the breakthroughs during the first paradigm shift. All of these meant that there was nothing for younger generations to be excited about.

This prompted them to look for something beyond the functionalities. And surely enough, similar to any other industries, aesthetics became the focus. Therefore, we saw many software focusing on designing nice user interface and improving the user experience. These “aesthetically appealing” software quickly won over the market, despite the fact that they may be lacking in terms of functionalities.

Future: From aesthetics to …?

We come to the reality now, as of 26 March 2015, it has become the default standard to have an “aesthetically appealing” software. Otherwise, no matter how good the functions are, customers will not buy them. However, this also the period of time where customers are “expecting” aesthetics as a norm from the IT industry. If we apply the similar argument above, this could be the time where we have the chance to experience our own paradigm shift, away from aesthetics.

But what could be replacement? Are there any precedents from other industries? Real estates, pharmaceutical, automobile… all the other industries are either improving on the functions and or the aesthetics. Maybe the answer is combing the functions with aesthetics. This seems to be trend now in the watch industries where the traditional “aesthetics-focused” companies are pairing up with smart watch companies. But do we stop here? Are functions and aesthetics the ultimate goals that we want to achieve? We are nearing the time where we can get one without compromising the other, so what happens after?

Long

From int to long

The past few days, I have been working on a programming assignment to develop efficient multiplication algorithm. I have passed all graded test cases but got stuck at the non-graded challenge task, task Y. The requirement is 500k-digits numbers multiplication in 2 seconds.

My algorithm made use of both Karatsuba algorithm and a technique to combine neighbouring digits together (similar to converting from decimal to a large base).

Initially, I used int for all the variables, which allowed me to combine 8 digits at a time. This got me 2/10 points for the task. Then I thought why not use long? (I was using Java so no long long, and we were prohibited from using BigInteger) After changing my variables to long, I discovered that I could only increase the max digits from 8 to 10 before errors in the result showed up. I knew that theoretically the max digits should be around 16, but I did not bother finding out why and assumed that other parts of my code is limiting the max digits.

Two days later, after exhausting other possible optimization techniques, I still could not get better than 2/10, so I decided to investigate the issue with max digits. This time, I used the debugger and checked all the intermediate steps carefully. And I finally found out what was wrong: I constructed an array with base 10 raised to different powers, for combining the digits. However, the array was in the int range, therefore causing the error when increased the threshold for max digits. After resolving the issue (changing it to long), I was able to get 4/10 for the task. It might be that I need a much better algorithm for full marks, but at that point of time, I was filled with joy for figuring the bug out.

Long term goal

Setting a long term goal is important. I only truly appreciated it after experiencing regrets. When I started playing games, I was always able to identify an ultimate goal for me and work towards it. If I found out that the goal was too hard to achieve, I would drop the game. If I managed to achieve the goal after putting in a lot of effort, I will look for another one.

However, game is too short compared to life. What I thought was the long term goal was too short. Before I graduated from junior college, all I wanted was entering a good university with good computer science department. I assumed that this would lead me to my next goal naturally. Now it looks like I was thinking too short term. I failed to see many other factors that would affect the really long term, like the well-being of the IT industry, the general perception of technology and what I envision myself to be 20 years down the road.

It is funny that I actually did an exercise back in junior college on “what I imagine myself to be in 20 years”. It was my best chance to plan for long term. However, I wasted it by putting down vague descriptions like “working in a company of global scale”, without actually thinking through what it meant.

Now I really need a long term goal, but how long? Should it be more than 5 years? Or even 10 years? Going back to the discussion of games, it should be challenging, and it should take a lot of effort. Obviously getting an internship would not fulfill the criteria of challenging, neither would graduating from NUS with a job offer. This time, I need to think through, considering the feasibility and the challenge, the possible avenues and obstacles.

TBC…