光へ

Dream On

Read this first

Life-long journey

Long time no back to this blog.

Last article was published five years ago and most of themes I wrote were about programming. Two years ago I married with lovely cute girl and now I have my boy more than one year old already.

Time flies.

After marriage, most of my focus are turn into investment. Actually I tried to create side-project which focus on stock analysis and result is good to me for investing reference. But most important is life-long investment which leads us into better life.

Last year my wife and I read about FIRE books. My wife is freelancer who manage her life well especially in budget control long time ago before our marriage. She suggest us to live FIRE-like life which save money up-to 50% while maintain quality life.

To her, life quality is also important than long term financial independence. She also thinks there exist little to retire one or two year later if...

Continue reading →


True color support environment setup

True color support.

I tried last week to sync environment between my personal computer (OSX 10.11), remote server (Ubuntu 14.04) and work server station (RHEL 6).

The environment I used is Neovim + Tmux + Mosh/SSH + iTerm2.

First I use Neovim to get the True color support. Vim doesn’t not support it. No surprising.

To get true color support, just get the latest version of Neovim. For OSX, just use brew install neovim should be enough. But for Linux, I think it need to build neovim from scratch. So I build it from source code get from Github. For RHEL it maybe a little nasty, most of problem is the installer script need HTTPS support from CURL. Just make sure to include it when compiling.

Second, tmux. Compile tmux is relatively easy, nothing specially. The problem is that one need to remember to set the config. Ref

set -ga terminal-overrides...

Continue reading →


Software testing lesson

Last month I got one bug report and need urgent fix. I do the quick fix in one day and request patch. Patch come out next week. It’s a bug in multi-thread mode which only occur when running in 16 threads or 32 threads. My fix is kind of workaround due to it’s hard to come out quick fix and make sure it’s perfect. Real fix comes out in the same week when patch process finished.

And then I happen to saw there exist one training held in three weeks later. I applied. The tutor is QA team manager from global anti-virus software company in Taiwan. He gave quick and broad walk-through within 12 hours course. It’s helpful for me. But in fact, to me it still too general style of QA manager or process.

The most surprising things I learned is the book I read recently - How Google Tests Software.

The most difference is that author explain the environment inside Google that QA/SET resources is...

Continue reading →


Learning Pattern

Recently I am learning iOS programming through udemy. I take the course created by Rob Percival. I watch first app from this course and also the course in iTune U created by Standford University. Both of them teach from the basic knowledge and spent similar time in first app. But something different.

Basically I prefer learn by doing in hard way. Set the goal and find a way to get there. Google it whenever something wrong and everything should have answer.

But I start go think about it more deeply.

By comparing the two course about iOS programming, the biggest difference I assuming initially is the level of student. I thought teacher in Stanford should expect more knowledge about programming or more smart. But it looks not.

Both of them assume student without background and indeed students taken Stanford course are not all in engineering major. But Stanford does request student to...

Continue reading →


ReadFile vs Readln

This weekend I try to expand my book page with more novels. To do it, I need to update TF/IDF database and insert the novel table.

This time I try to make my previous mecab.go can run on my Linode 2G node. I try to use ulimit and and try to add process into OOM Killer exclusion list. The second method is workable. But after running 30mins, it frozen.

And I try to ignore it, then, I found my website is down and some of my tmux window is killed. So, there should be some kind of protection mechanism. Need try another way.


Then I found that previous I use io.ReadFile to read in the txt file and then tokenize into mecab. This is good but memory-consuming. I try to use Read line-by-line instead.

The result is fantastic!! The memory is keeping in 50mb and stable. But, I wait and wait and wait. It cannot finish the run. Then I try to write small benchmark using 2.4mb txt file. I read...

Continue reading →


Timeline of Programming Language

Just saw some interesting items in Hackers News.

Ah, I have created one-page for cleaner Hackers news view experience. Just cron job to get the items using API and Google Material pack. Like a exercise.

I believe that simple will make things better. I don’t want to create one fancy page with many functionality. Just new items from HackerNews. I like it. But I just want Top30 of it and spend less than 1 min to see anything interest to me.


I found this page is worth reading. Frequency Counting Algorithms over Data Streams.

And, last, I admit I read this article - Blog Little Things, so I write tonight.

Good night, World.

Continue reading →


Front-end JS Framework

Front-end Javascript Framework.

I am not front-end guy. When I was asked about the experience when building the commercial website, I replied that basically I focus on back-end.

The work I do in my job are focusing on C/C++, C (last job) and some script in Ruby/Tcl/Bash. I do have some experience when building webpage using Joomla/PHP, Sinatra/Ruby and Martini/Go. In my experience, the framework is not that hard to learn, the hard part is Javascript framework and UI framework.

Bootstrap is easy to learn. But how to use it beautifully, many other things need to learn. Need prototyping, layout arrangement and maybe also illustration and art design (of course, out of my ability) .

Recently three framework is released.

Angular 2 looks good. Again with Google support. But still on development stage.

Polymer is now 1.0 and its official page shows really easy usage. Add GoogleMap...

Continue reading →


Go Journey

After I published previous article, I complete the transform from Ruby to Martini. Now the website and its back-end script are now written in Go. The result is very good. Not only the memory is less and concurrent support of Go makes the script run much faster.

I also try to adapt Redis to speed-up some page. I made two change, one is better but another one is not. I also try to adapt groupcache, but after some trying, I decide to postpone. Because the target improve response time is 40ms, it looks ok according to Ilya Grigorik’s article.


After that, I create one page to give cleaner viewer of Hacker News. Just create one script to get the information and update the page. I also give a try to Material + Bootstrap and adapt it to my aozora page also.

To be honest, it’s just ok. While material flat design is not bad, but I don’t feel exciting after the change. Maybe I need to build...

Continue reading →


From Sinatra/Ruby to Martini/Go

Just spent a day to migrate from Sinatra/Ruby to Martini/Golang.

The urgent for me to do this is because the node I have is Linode 2G. I found that by using two Sinatra app with alexch/rerun, it consume almost 200mb in background.

That’s not good.

Recently I start to play with data in Aozora and create one search engine based on TF-IDF to the novels. I choose Martini because it has similar syntax with Sinatra.

And I happen to find that, it take so little memory in background.

Normally I don’t care about the memory usage. But during data preparation for tf-idf, the app is always killed by system due to short of memory.

Because I need to generate data from 280000+ words with 13000+ novels. The data structure it created cannot be fit into my little web node. I choose to generate the data in my MBPR and try to save into mongodb.

And even the data saving is time-consuming. So it...

Continue reading →


A week with Go Programming Language

Just about a week ago, I start to learn Go Programming language.
I create this repository and start to make some log of practicing. Just watch below talk about how to learn new things.

I think 20hrs is a good threshold. Yes, it will not make you a profession, but it will help you overcome the first frustration. And if you still have passion after first trying, there will still have other challenge point in future.

For me this time, I learn Go Programming Language. Due to it’s really similar to C/C++, I learn it really well. From Learn to Learn, I agree the quote:

A lan­guage that doesn’t affect the way you think about pro­gram­ming, is not worth knowing.

  • Alan Perlis

Go help me to learn the error handling and concurrent programming. I just learn how to create pool of goroutines, the performance in my script is truly amazing when considering its clean and simple code. Go really...

Continue reading →