Zhu Yong

$ echo "Be Persistent, Be Patient" >> ~/.life

Last Day of 2015

In less than 2 hours, it will be brand new Year 2016. It’s annual summary time!

Here is the summary list:

  • In April, whole family moved from very west to very east. We want to give the 2 boys better environment and it seems the decision is correct. Kids enjoyed to live in east because of so many fun places to go within short travel distance.
  • In Aug, whole family fly back to China for whole month, it’s a wonderful journey for the two boys.
  • In Oct, passed my driving test and got my driving license.
  • In Nov, bought my first car. I would say, it’s really expensive to own a car in Singapore, but the life will be much easier with a car, especially when we bring the two boys out. And the time spend on road between home and office is reduced by at least half.
  • In Dec, 2nd son started his childcare school life and not get used to it yet.

For work, there is one failure attempt for job change, not worth to mention, failed at the 1st culture phone call. Too bad! Other than that, it’s really a busy year, I was “outsourced” to another team to help product development, different working style and most importantly, the always tight schedule. I spent a lot of nights at home remote to company network to work.

For 2016, I want myself to always be prepared, so when opportunity comes, I am ready!

Collected My New Car

It’s Black Friday today, and this morning I collected my 2015 biggest shopping item : my Citroen Grand C4 Picasso. Oh Yeah!

At early morning, I arrived at C&C and the whole process took around 1+ hour because my rear number plate installation was loose, called the technician to fix it.

After drove to company, I spent long time to lock the car, no mater I lock use the remote key or use physical key, I only hear the click sound but it was not locked. After tried open & close all doors few times without effect. I suddenly realized that it might because of the extra remote key in my bag, which was in the car. After I took out the other key and tried lock again, it worked! I checked with other Citroen drivers, there are quite some people had same experience.

At afternoon after drove home, my wife and I lead our two boys to the new car, they immediately love it and enjoyed the short ride around our neighbourhood.

The only big problem is that I need to improve my parking skills. :(

New Toy: Microsoft Sculpt Ergonomic Desktop

This afternoon received my new toy: the Microsoft Sculpt Ergonomic Desktop set.

"microsoft sculpt ergonomic desktop"

After using old IBM Model M keyboard for long time, it took me a while to get used to this new layout and feeling. Comparing to IBM Model M, the key travel distance is really short. This keyboard would be perfect if it’s mechanical switch keyboard. :) ( Yeah, the price might double as well ).

The bad thing for this keyboard is the very strong plastic odor, it made me sick only after one hour usage. Hope the smell will disappear when I return to office next Monday.

Got COE at S$59200

Yesterday was the 2nd round of COE bid in Nov, thanks to the good sale result in 7 – 8 Nov car show @ Singpaore Expo, dealer were willing to bid COE at higher price. At around 3pm, the price was already exceed 4th Nov final price.

I kept refreshing the web page to get the status. C & C put reserve price of S$59999 at 10:30am, then at around 3:50pm when the price going to hit S$59000, they revised the bid to S$60999, then I know I guaranteed to get one COE this time.

After COE, C & C still need few days to settle :

  1. I need to pay the remainning of down payment,
  2. Settle loan from bank
  3. Settle car insurance, I must say, the insurance premium is super high for new driver like me. Too bad I must take the appointed insurance from AIG.
  4. Install the front & rear camera, solar film and etc
  5. Register the car under my name

Then, they will call me to collect the car. :)

Can’t wait for the day to come!

Repair Honeywell 50250-S After Plug Into 220V Power Supply

Because of forest fire from neighbour Indonesia, air quality for 2015 Augest and September in Singapore reached hazardous level for many days.

In all past hazardous day, it’s my job to move Honeywell 50250-S air purifier around, then one day, while I was having my dinner, my wife volunteered to do the job. And that’s it, she plugged the plug into 220V output from the transformer, and both the transfer and purifier burnt. As the result, we suffer the haze for long time until I repair it, and by that time, haze almost gone.

To fix the transformer is simple, just replace the fuse.

To fix the purifier is little bit difficult, first I can’t find online anything regarding disassemble 50250-S, I can only try to disassemble any parts that can be taken out, and finally figured out where the PCB is.

Just when I saw the PCB, I feel that I can fix it, because only one component was burnt. After search around online, I figured out that’s a veristor, but there is no part number printed, bad luck. Next I took the PCB to Simlim Tower, visited different shops and asked around if they have the replacement for that veristor, luckily I found one from a shop at basement, the replacement component is 10D271K (standard veristor for 110V). By the way, the cost for two transformer fuse + one 10D271K is S$2.

The repair process is simple, just use solder iron take out old versiter and replace with this new one, connect back the PCB, turn on the purifier,

Image of the burn veristor (in red circle)

"Honeywell 50250-S Repair"

Image after change the veristor to 10D271K (the blue color one).

"Honeywell 50250-S Repair"

Image of the fixed Honeywell 50250-S, everything back to normal:

"Honeywell 50250-S Repair"

Ordered My First Car

This weekend, just after I received my official driving license, I ordered my first car – Citroen Grand C4 Picasso.

The reasons I chose Grand C4 Picasso are simple:

  1. I need MPV car, we have 6 family members, 5 seaters car not enough.

  2. For MPV, I shortlisted Honda Stream, Toyota Wish and this Grand C4 Picasso. In Singapore Honda and Toyota cars are people’s Number 1 choice because the high reliability and relatively low maintenance cost. If the car dealer still carry Honda Stream, I might go for that car. As for Toyota Wish, it’s a quite old model, no change since 2009. As for Grand C4 Picasso, this is a new model, fuel efficient, and the dealer provide 5 years warranty + 5 years free service. Most importantly, I like both the interior and exterior of this car.

"Citroen Grand C4 Picasso"

Now I just need to wait for the AD to bid the COE, settle car loan and insurance, then I can collect my car. Sadly, that’s at least 2-3 weeks waiting time.

Got My SG50 Driving License

I passed my driving test at ComfortDelGro Driving Center on 29 Oct 2015 with only 1 attempt. And I received my offcial driving license card delivered on 5 Nov 2015, I didn’t expect to get the card so fast, with only 1 week waiting time.

UBI driving center is the one with lowest passing rate among all 3 driving school in Singapore. I engaged a private driving instructor because of its flexibility and the relatively lower cost.

To pass the driving test, here are some tips based on my experience:

First, for each learning session on road, try to train yourself the judgement for speed and distance, especially those car coming from behind on the lane you are going to change to. Don’t be rush or panic for lane change fail, it’s learning session, safety is alway first.

Second, be familiar with the road and the circuit. You can find CDC circuit with Google search. For the road, I use Google My Tracks app to track my learning session, then use Google Street View to go through the road whenever I need. Below is screen capture from my handphone.

"Google My Track" "Google My Track"

Third, try to book your test at off-peak time to avoid heavy traffic.

Forth, on actual test day, must must be confident, be calm, treat it same as normal learn session.

Config Logitech Performance MX Zoom Button in Ubuntu

The middle button (click wheel) on Logitech Performance MX is very very difficult to press. So I changed the Zoom button to middle button on windows system. To do same setting under Ubuntu, follow the instructions below:

  • Install necessary software packages
   sudo apt-get install xbindkeys xautomation xev
  • Next, use xev to find the button number for Zoom button. Just run xev from command line, then click Zoom button when your cursor is in the small white window. You will see somthing like below:
ButtonPress event, serial 45, synthetic NO, window 0x2400001,
    root 0x24d, subw 0x0, time 3735892633, (75,111), root:(301,192),
    state 0x0, button 2, same_screen YES

ButtonRelease event, serial 45, synthetic NO, window 0x2400001,
    root 0x24d, subw 0x0, time 3735892633, (75,111), root:(301,192),
    state 0x200, button 2, same_screen YES
  • Create default xbindkeys config file with command:
   xbindkeys --defaults > ~/.xbindkeysrc
  • Open file ~/.xbindkeysrc to add the following lines at end of the file:
"xte 'mouseclick 2'"

Re-Hacked YouCompleteMe to Support Lamely Structured Projects

Nearly 1 Year ago, I attempted to hack YouCompleteMe for clang code completion for a lamely structured project, that hacking worked, but the hacking was dirty. For background information, here is my origin question on StackOverflow and here is the detail about my first dirty hack.

Recently when I looked at this hacking again, I thought there should be a better way, especially after I found this code snippet from GitHub Gist. At the moment I saw the code, I had a strong feeling that I have found the solution, I just need to verify it. To make code completion success for clang -cc1 -fsyntack-only -code-complete-at a.c:4:11 main.c, the source file to create CXTranslationUnit should be main.c and the source file to do clang_codeCompleteAt should be a.c. So I modified the code to pass one additional command line argument to be the file to create TransicationUnit, then compile and run command:

$ ./complete a.c 11 4 main.c

When I saw the output, I confirmed this was a better way to hack YouCompleteMe for my need.

Now I found the correct direction, the rest was just spend time to code, test and debug, here is a summary for what I have modified:

  • File cpp/ycm/ClangCompleter/TransicationUnit.cpp, function TranslationUnit::CandidatesForLocation, take additional parameter compfile to pass to clang_codeCompleteAt
  • File cpp/ycm/ClangCompleter/CodeCompleter.cpp, function ClangCompleter::CandidatesForLocationInFile, take additional parameter compfile and pass this newly added parameter to unit->CandidatesForLocation
  • File ycmd/completers/cpp/clang_completer.py, function ComputeCandidatesInner, follow the way _FlagsForRequest is implemented, add new function to get the parent source file to create TransicationUnit and pass that result to CandidatesForLocationInFile
  • File ycmd/completers/cpp/flags.py, add the new function to get parent source file
  • File .ycm_extra_conf.py under project source directory, add function ParentForFile, this function read input .clang_input_file, which is the mapping for code-complete-at-file to TransicationUnit-file
  • Created a python script to generate the mapping file for code-complete-at-file to TransicationUnit-file

Comparing to my first hacking, this round is very clean, only clang related part on ycmd is modified, the client side remain untouched.

I have checked in the modifications to my fork of ycmd at branch lamely.

HDB BTO Home Network DIY

Inspired by this blog, I decided to DIY the network thing for my new HDB flat when I was shopping on Taobao in Nov. Followed the suggestion in that blog, I bought all necessary items from Taobao, but the network modules I bought are Cat 6 module, not 5E.

On Jan 03, my contractor went to my new HDB flat to install the lights we bought from Taobao, while they doing the lights installation, I was doing DIY job to change all RJ11 phone jacks to network RJ45 jacks.

Below are the tools I used for this DIY job.

Start from bedrooms, change the RJ11 to RJ45 one by one.