Category Archives: Personal

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.

2014/15 Sem 1 Academic Module Review

Below is my module review for AY2014/15 Sem 1:

CS2105 Computer Networks

The concepts are intuitive, just that quite a lot of details need to be memorized for the tests.

The programming assignments take time to implement and more time to debug but not very hard if you have some background in Java.

For final, my revision focused too much on computations and procedures and did not memorize all small details so the MCQs are hard for me.

Expected Grade: B+

Actual Grade: B+

CS2106 Introduction to Operating Systems

The concepts are intuitive, not a lot of details like CS2105 but a lot of procedures.

The programming assignments are the same difficulty level as CS2105, takes some time to implement and debug, but not hard in nature, you can pick your own favourite language.

The final this time is 19 questions, each testing on one procedure, with the exception of 1 question which is on the concept. Overall I think the final was manageable if you understand the concepts well enough.

Expected Grade: A-

Actual Grade: A-

ST2334 Probability and Statistics

The concepts are similar to what was taught in JC H2 Maths, just deeper. For topics on probability and hypothesis testing, there are some derivations and table lookups which are not taught before but other than those, there are not much new things.

For final, majority of questions are about computation, about 15% of questions are about concepts, which I could not recall because I did not revise them. Other than that, the questions are okay.

Expected Grade: A-

Actual Grade: B+ Mostly due to poor performance in the finals and of course bell curve god!

LSM1302 Genes and Society

As a student with O level biology background, I took this module as one of my core science module, not GEM/GEK. However I did not really study until the reading week because… Actually I have no idea why I was not studying this module, the lectures are actually quite interesting (which I found out later). After going through all the webcasts in one week, I was quite familiar with most of the concepts. The final tested on both concepts and examples. I did not study examples in depth so I lost some marks there but I did score above average.

The projects are not closely related the the concepts so basically the marks you get depends on how much effort you put in to them.

Expected Grade: B+

Actual Grade: B+

LAJ1201 Japanese 1

This should be the hardest module that I have taken in NUS so far in 1 and half years. It has three tutorials per week, a lot of homework and a lot of preparations needed to be done before the tutorials. I spent about an average of 2 hours on homework and preparation everyday. And even though I considered that as a lot of effort, I still did not do well for the continuous assessments like the quizzes. So I guess the expected workload from the students should be higher than 10 hours per week (excluding lecture and tutorials).

There are people in this module who obviously have prior experience in Japanese, so as someone who started from the scratch, the bell curve may not favour me.

Expected Grade: B

Actual Grade: B