The Evolution of Command Pattern (II)

How Command Pattern has evolved overtime

3 minute read

In Part I, we discussed the original Command Pattern from the GoF Design Patterns book. In Part II, let’s talk about the improved version from another less known book: Pattern-Oriented Software Architecture Vol.1 (POSA in short).

In this book, there is a Command Processor pattern, which is based on the Command Pattern in GoF book. The most important difference is the newly introduced CommandProcessor. In the original Command Pattern, it defines how to create Commands, and each Command has an execute and undo methods.

The Evolution of Command Pattern (I)

How Command Pattern has evolved overtime

3 minute read

The Command Pattern is one of my favourite design patterns. It is also a good example that design patterns do change over time. In part I, we talk about the original version from the Design Patterns book. This pattern first appears in the famous GoF book, described as follows: Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.

Customize Android Seekbar Color

How to customize the colors for android seekbar

1 minute read

I was tasked to create a simple media player app for a shop demo, and I’m using the built-in SeekBar for the volume control. All goes well, until I want to change the color of it. The design has it like the thumb of the SeekBar is white, and first half is green and rest half is grey. It took me almost a whole day to find a satisfying anwser, come on Android!

My Keyboard Collection

My Mech Keyboard Collection

2 minute read

I have been collecting various keyboard over the years. Now I’m quite proud of my small collection, so I think I will share it here. The One And Only True Keyboard Yes, this is the famous IBM Model M. Typing on it is like playing piano, the sound and feel is so crisp. The IBM Model M2 I got this from a Finnish second hand website, it is much like a modern keyboard, except that the switches are still the same as original Model M.

The Most Beautiful Program Ever Written

A Lisp interpreter written in Lisp

6 minute read

It’s my 5th time trying to follow this video and things finally start to click in my head. So I think if I write down what is talked in the video, then I can just read my blog post for another 15 times instead of going through the video, that would be convenient. OK, here is a gist of it. This guy is writing an Scheme interpreter in Scheme. Let’s start from setting up the environment first so we can type along afterwards.