i'm steve

Unbiased Shuffle - Fisher-Yates Shuffle Algorithms

Sun 08 Sep 2017
The Game In a lucky draw game, say there are 3 prizes and 5 candidates. We put each of their name on a small piece of paper and drop them into a container. The game host will draw 3 papers from the container one by one randomly, and on each successive draw, the drawn paper will be PUT BACK into the container for the next draw. Name written on the drawn paper will be given the prize.
Read more

Callback, Promise, Generator in Nodejs

Sun 06 Dec 2015
Nodejs is a javascript runtime built upon Google’s V8 engine which features event-driven & non-blocking IO model, making it a good option for writing scalable & efficient web applications. Callback If you have ever written Nodejs code, you will be so familiar with callbacks. It’s a functional parameter passed to a method call, where it will be called only when the operation is done or failed. e.g. var fs = require('fs'); // fs.
Read more

Getting Your Feet Wet With Go

Sun 30 Aug 2015
GO is an open source programming language created at Google which has been getting alot of traction recent years. It aims at becoming a language that’s easy to write, efficient, built-in concurrency support, and garbage-free, yet also able to cross-compile for different platforms. Why the HYPE I guess… It’s developed at Google, so golang is already blessed. With Google’s experience in building things at scale, the language design should have already considered the scalability & concurrency perspective.
Read more

On Choosing Django Packages

Sun 19 Apr 2015
Lately, been developing on django alot and this is to document my thought process when choosing django packages. In fact this is also how I determine what open source projects to adopt and not just limited to django. Figure Out Available Choices To determine what packages are available for a particular feature/function, Django Packages is a really great site for that purpose. Pick the category you are after, and it will show you comparison table of all the available packages.
Read more

Putting on Headphone

Sun 02 Nov 2014
I like putting on my headphone whenever I want to stay focus. It happens a lot when I m coding. For most of the time, I don’t play any music like the others do. The headphone is just there to help shielding out some outside noise especially those that can get me distracted, and it also makes people less likely to interrupt when they see me with the headphone on unless it’s something urgent or important.
Read more

Orientation Hinting in Android

Sun 06 Sep 2014
Just a quick note on implemeting “orientation hinting” with a default orientation lock at the start. What it actually means: Say, an activity is defaulted to landscape mode lock, and still allowing the user to change back to portrait only when the user intentionally doing so (rotate the devices to landscape then back to portrait). This is particularly helpful in a situation where the user would be shown and locked into a preferred mode no matter how he/she holding the device, while still offering a mechanism to change orientation if the user intends to.
Read more

My Phone Is Stuck With Outdated Apps

Sun 29 Jul 2014
Most people these days will fill their smartphone with latest apps and games, and for sure apps are part of the reason what makes smartphone so create. They enhance the phone with features, provide users with information, acting as a gaming devices… There’s no doubt apps are so crucial to smartphone and that’s why companies like Apple & Google are so keen on making their AppStore better, development tools richer so that more developer will develop for the platforms, and more users would want to buy apps from the stores.
Read more

Emacs - My Favourite Editor

Sun 16 Apr 2014
When it comes to editor, Emacs for sure is my editor of choice. It is an incredibly extensible & productive editor. It works in most platforms, and very well on terminals. Unfortunately though, it’s also an editor that have the steepest learning curve, it’s hard to explain, simply refer to the following images. *Image ref from StackExchange Scratching the surface It’s definitely not a beginner editor of choice, given the learning curve.
Read more

git-reflog - The Less Mentioned Command

Sun 10 Apr 2014
Git has been gaining popularity the past few years, together with awesome web-interfaces from Github, Bitbucket etc. people are adopting the tools quicker than ever. For most people, when dealing with git, git-add, git-rm, git-commit, git-push, git-branch and git-pull are more than sufficient. It is not until you have ruined the versioned copies – e.g. hard reset, would you wish you could have a recovery command. Oops Say, you issued the following command without much thinking:
Read more

Paxos Algorithm Explained (for myself)

Sun 22 Mar 2014
Paxos Algorithm was the work by Leslie Lamport. It is the foundation for solving many fundamental problem in distributed system. Famous systems that make use of the algorithm included but not limited to Google Chubby, ZooKeeper. Recently he was awarded the Turing Award 2013 which is a great honour to him & well deserved, this makes a good opportunity for me to go over the Paxos Algorithms again, and explain it a bit here for myself to keep my memory fresh.
Read more