Sunday, August 21, 2011

Disable shutdown event tracker in Windows Server 2003

1. Open the local group policy editor by typing gpedit.msc in the run prompt. (applicable to non-domain computer)

2. Expand the left menu tree. Computer Configuration => Administrative Templates => System (if the System container if not there, right click on Administrative Templates and add the container)

3. Double click on the "Display Shutdown Event Tracker" item

4. Select Disabled















5. Click OK and close the dialogs.

6. To ensure the change is in effect immediately, type "gpupdate /force" in a command prompt.

Saturday, August 20, 2011

My first game on iPad 2: Tiny Tower

I've just recently bought an iPad 2. I thought about playing a game or two on this platform. And with the help from app store feature marketing, I downloaded this game called Tiny Tower. It turns out to be quite a nice and addictive game. The concept of the game is simple in that the object is to build more floors to the "tiny" tower you own. Each floor allows a different usage from residential use to retail. To be exact, there are six types in all: residential, food, recreation, service, retail and creative.

Each residential floor or apartment can house up to 5 people. You get to collect a rent $100 per person per day. These people like real life for the most part, need to get a job. They can be hired from a floor that caters food, e.g. sky burger, with each floor hiring a maximum of 3 people. Ideally, they should be placed in their dream jobs if possible, so to make them most happy and productive. The lift or elevator is the key to the game. Every now and then, a guy or gal comes to the lobby and indicates a floor to go to. By using the arrow up/down buttons, you can ship them to the desired floor and get 2*floor-level money. On the occasion, they may tip you a tower bux, which can be turned into more money or used for speeding up construction or restocking the business floor with items. VIP may also come and visit your tower occasionally. Depending on the type of VIP, they can help reduce the construction time, buy out an entire product from a floor, boost customer number to a floor, reduce restocking time, or bring in a floor of new bitizens (residents).

After playing the game for a while, you will start to get a feeling of how to best optimize the income or sales per minute so to help build the tiny tower to an ever taller tower! For me, the result is a 17-floor tower after playing the game for 3 days. Have fun and enjoy the mspaint-like graphics! :)

[9/4/2011: Just realized it's one of the best games as recommended by gamepro.]

My 17-floor tower

With the lobby view

VIP is coming to tower

Sky burger (favorite store)

More stores

Fun stores

18th floor? Maybe next time.



How to turn off the annoying beep sound in Windows Server 2003

The below commands in a prompt with administrative rights work for all windows platform 2000 or above.

To turn off the beep sound:

net stop beep

To turn off the beep sound for good even when after a system restart:

sc config beep start= disabled

(note that the space is needed before "disabled")


After typing these commands, the noisy beeps on error should be no more!

For more info, visit here.

Wednesday, August 17, 2011

Just out of some nothing-to-do-ness, I wrote a small program that will clear the IE explorer and Firefox Internet caches.

This is version 0.1. My hope is that it will grow into a bigger project in the near future! Stay tune :-)

DiskCleanup2 program




Monday, December 6, 2010

The Essence of Unit Testing

Unit testing is about making sure software works at the function or method level. The act is taken upon by developers and is seen as a protective net to catch the unit-level bugs before integration...

By definition, a unit test is an automated piece of code that invokes the method or class being tested and then checks some assumptions about the logical behavior of that method or class. Here logical code means code having an IF statement, a loop, switch, some sort of calculation, or decision making code. (referenced from the book "The Art of Unit Testing").

The book goes on to point out properties of a good unit test are:
  • It should be automated and repeatable
  • It should be easy to implement
  • Once it’s written, it should remain for future use
  • Anyone should be able to run it
  • It should run at the push of a button
  • It should run quickly
Then it differentiate integration testing from unit testing. A unit test exercises and tests only a single unit in isolation whereas integration testing exercises verification on two or more dependent software modules.

Why unit test you may ask. Some answers include:
  • Helps find problems early in the development cycle
  • Facilitates changes with regression testing being automated
  • Simplifies integration testing
  • Provides a living documentation
  • Allows for test-driven development (TDD)
There are some minor drawbacks:
  • Can only show the presence of errors not the absence (like all testing)
  • By definition cannot catch integration or performance errors
  • Time and effort needed, e.g. for more features… others?
But overall, some unit testing are still necessary since the benefits usually outweigh the drawbacks.

Recommended Unit Testing framework in the C++ world: GoogleTest + GoogleMock.



Friday, November 26, 2010

Recommended Programming Projects

Like any good C++ developers, having interests in a good open-source project and making contributions to it can come a long way to learning C++ the hands-on way. Without further ado, below is a list of quality and exemplary C++ projects, all open-source:

arora

ClamWin

Google Chrome

googlemock

googletest

NetBSD

Notepad++

Qt

Songbird

VideoLAN

Webkit

WinMerge

WTL

wxWidgets

Tuesday, August 24, 2010

CSR: Currency Statistics Reporter in C++

Ever wonder how currency exchange worked in the past? Then this simple c++ program is for you.

Briefly, this program will process the historical currency data and produce a report that contains some basic statistics such as the average, maximum and minimum values for the given currency pair. E.g. USD/TWD. At the same time, the report includes a plot of the historical currency value against time in months. A bar graph is also available for easier visualization.

You may find the program here: Currency Reporter