Zhu Wu's Blog

The world is a fine place and worth fighting for.

One-Time Password Generation

One-time password is deployed widely as a second factor of authentication to enhance security. As a developer, how should we implement OTP generation in the application and what should be taken care of in each implementation?

The most "naive" way...

Continue reading →

Require Files From Gem's Spec Folder

As a ruby programmer, you probably already know that the code files in gem's lib folder are automatically loaded into $LOAD_PATH when you require the gem.

Today, I encountered a scenario that I have to manually load source code files from spec...

Continue reading →

Rescue from an Invalid "sudoers" File

I was trying some feature today, and that feature required to modify /etc/sudoers. No problem, it seemed that my favorite editor vim can accomplish it. Open up a terminal, I entered sudo vim /etc/sudoers, modified and saved it. Everything was ok,...

Continue reading →

Display a Latest Content Widget

It is quite common to have a component to display latest contents of the website. Our customer, a local leading online news provider, wanted to have such a feature also. We wrote a simple SQL query to get the contents and displayed them out as...

Continue reading →

Handle Time Zone in Java

It is important to process and present date and time correctly when building an application, especially when your application is going to be used by users from more than one time zones. This article will give you more insights on how to deal time...

Continue reading →