Category Archives: Personal

Bye Facebook

Bye Facebook

Facebook has been a part of my life for the past few years, but now it is the time to say goodbye.

This is a rather sudden decision as I just felt the urge to do this as soon as possible. However, I will attempt to rationalize the decision.

  • As a source of information, Facebook has done a good job in providing me with the latest updates on current issues, such as events happening in HK and Singapore. However, there are more reliable and convenient channels to obtain factual information, such as the BBC mobile app and local newspapers, so Facebook is not the best source for that.
  • As a way to share my opinions and engage in discussion, Facebook was a good platform. However, I have realized that debates on Facebook tend revolve around groundless claims, without factual backups and substantiations, understandably due to the “fast-food” nature of Internet. I used to enjoy arguing in this style and win the debate by some sort of sophistry but later decided to stop such meaningless acts.
  • As a way to connect with my friends, I don’t see Facebook helps, I do not really need to see their photos to stay connected, and most of the photos on Facebook are from “acquaintances” whom I do not care much. The messaging function may be something that I still use frequently, for people whom I do not have in Whatsapp contact. But I guess I just need a transition period before I get all my contacts to Whatsapp and WeChat.

All in all, the usefulness and reliance on Facebook is dropping for me. And I seem to have spent too much time randomly commenting on Facebook pages just to kill time. So why not take a break (hopefully a long one) and seek to do something more meaningful?

Bye Facebook.

Sony Z3 Top Speaker Noise

[Solved]Sony Z3 Top Speaker Noise Problem

I have recently purchased a Sony Xperia Z3. There seems to be a strange problem with the Sony Z3 top speaker. Most of the time it produces a static background noise when I run any applications that has sound. The noise can still be heard even if I have muted the media volume. But there are occasions where the noise does not occur.

I searched online and found out this a common problem for Sony Z3, the solutions they suggested on the forums(tuning the equalizer settings) did not help me. I have also contacted Sony customer service and they responded that “It happens when you use applications that access Internet.” That seems logical enough first but I soon realized that sometimes the noise does not occur even when I am using the applications that access Internet.

When I tracked down the cases where the noise did not occur, I found out the root cause of it: The Alarm Volume. 

sony z3 sound setting

Alarm volume setting in Sony Z3 sound and notification setting

This is totally strange but it is indeed the cause of the noise. Whenever I lower the alarm volume to below about 60% and reopen the applications, the noise disappears. The alarm volume is not supposed to be related to the sound inside the applications but it seems that Sony Z3 has a software bug that caused them to be linked.

Also note that the global alarm volume in the sound settings will be overwritten by individual alarm volumes that you set in the alarm application.

sony z3 alarm setting

Alarm volume setting in Sony Z3 Alarm app

So in order to make sure the noise does not come back, you need to set both the global alarm volume and individual alarm volumes to below about 60%.

staying neutral on same-sex marriage

Staying neutral on Same-Sex Marriage

The news of Same-Sex Marriage a Right Nationwide in the U.S. has taken over the Internet.

While the two sides supporting and against it are arguing back and forth, what if I have no opinions on this and I just want to stay “neutral”?

Is there a true “neutral” position that one can adopt?

I begin by understanding the issue, marriage. By enumeration (which I will discuss further later), we have two options for marriage:

  1. Marriage between the same sex
  2. Marriage between the opposite sex

As we can see, with two options, there are no middle ground.

So to be neutral, we either allow both options, or allow neither of them:

  1. Allowing both options, we have the exact same stand as a same-sex marriage supporter, that is “the sexuality does not matter in marriage”.
  2. Allowing neither of them, we have no marriage and we lose the continuation of the human species, which is not what we want.

So now it looks like the same-sex marriage supporters’ stand is indeed the neutral stand, so what is the catch here?

We risk “going down the slope”. I have mentioned above that “by enumeration, we have two options for marriage”, but there was a hidden assumption there:

When we talk about marriage, we talk about humans.

What if we broaden the scope of discussion, and talk about same and different species, just like what we did to the same and opposite sex? There we have two options as well:

  1. Marriage between the same species
  2. Marriage between different species

I think at this point, it becomes pretty clear that in order to maintain neutral, we have to allow marriage between both same and different species.

So why not take this stand? The obvious answer is that this is insane. It crosses some (most) people’s limit. And that is exactly the problem here in the same-sex marriage. The idea of same-sex marriage crosses some people’s limit, just like the idea of marriage between different species. The neutral position differs from person to person due to their different limits.

For me, I can have my neutral position as “allowing marriage between both same and different species.” But this may sound crazy to many people so it might not be the best position.

So know your limit, and set the neutral position. Alternatively, you can push (or be pushed) beyond your limit and adopt a new neutral position.




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.


Moved to self-hosted blog on DigitalOcean

Today is a big day for this blog as it moves from to a self-hosted WordPress site on DigitalOcean.

The process of transfer was easier than I expected. Moving content was easy, just export and import.

DNS and domain were the main issues. I had to point my name servers to digital ocean instead of the default wordpress ones. Then I need to create DNS records in DigitalOcean. Finally I need to configure the WordPress settings (which is just Apache settings for host name).

After finishing all these, I realized that my domain still points to the old site. It turned out that NUS cached the site (via and did not refresh it after I changed the name servers and the domain mapping. So I had to use VPN to verify that my site is working properly for everyone else (indeed it is!).

Moving to self-hosted site means a lot of changes. Some are what I have expected, like the freedom to use plugins and customize anything I want. Some plugins look really cool, like Editorial Assistant by Zemanta, which suggest links, images and tags automatically when writing new posts.

However, there are some downsides that I did not expect. Stats page was gone. I was under the impression that it should be a built-in function but apparently it is not. So I went to search the plugins and found a good replacement – WP Statistics. Later on, I realized that I could get back some functionality with Jetpack.

Overall, I think it would make a good decision as this blog has become more independent. I have control over more things than I used to. Although there are price to pay, literally for renting servers.