Archive for April 30th, 2007

Root of War

Monday, April 30th, 2007 -- By ET

Why are wars fought?

Freedom might come to mind immediately. However, it feels strange that often times both parties claim to fight for freedom.

Greed? Might be, those great conquerors in history wanted gold, goats, girls, etc. (3G!) Ever wondered why most of the modern wars are in the gulf area?

Fear? Possibly. In fear of MDW (mass destruction weapons), you don’t need a reason to invade another country and kill its president.

BBC has a new documentary on wars. With the advent of the coming presidential election in the US, wars (and the end of it for that matter) will be a hot topic. And everyone should watch this:

Part I:

[youtube]http://www.youtube.com/watch?v=-xYeuzG24mo[/youtube]

Part II:

[youtube]http://www.youtube.com/watch?v=FV6cSUyeNQA[/youtube]

Part III:

[youtube]http://www.youtube.com/watch?v=xi6mMFifMQY[/youtube]

Part IV:

[youtube]http://www.youtube.com/watch?v=afBMu6gGdK8[/youtube]

MediaWiki Database Schema

Monday, April 30th, 2007 -- By ET

mediawiki-database-schema.png

[[Click Image to Enlarge ]]

The Bill-Spliting Database Problem

Monday, April 30th, 2007 -- By ET

A few of us assistant professors have small gathering parties every once in a while.  We normally go out into the town to find some good food and go to a bar afterwards.  Usually one of us will be the host and be in charge of finding these places, and pay the bill up front.

Now there is an interesting problem related to paying back these bills.  It is inconvenient to pay cash after each gathering, and we don’t normally see each other quite often unless in the gatherings.  It is therefore most convenient to setup a database to automatically clear out our bills among us.  In terms of participants, sometimes, one or two of us will be missing, so the DB can not just deduct some amount from all participants.  Sometimes, someone of us may only go to the restaurant or only go to the bar, therefore, the bill should be separate for the restaurant and the bar.

The database should work like this.  After each gathering, the host should select participants to the restaurant and the bar respectively and input the total bill  amount, the DB should calculate how much each of the participants owe the host, and automatically clear out the mutural payment.

The question is how to represent the whole process in the database and use the most efficient way to implement it.  Ideally this DB should be web-based so everyone can check the status at any time, and track the whole payment/billing history.


BlogTimer
You are visitor number several since September 1, 2001

Copyright Xiaoquan (Michael) Zhang, 2004-2010. All rights reserved.
All trademarks property of their owners.