Sunday, July 26, 2009

[A Solution Game] A man bought a house

Can anyone write the procedure how to solve this below problem?
It seems we will have two answers according to the way of resolvers thinking can be thinking with Maths or with Business, please write down and share in the comment:

Problem:
======
"A person bought a house for $60,000. Soon thereafter they sold it for $70,000, upon moving out of town.
A few month later, they were transftered back to town and purchased the same house for $80,000, then the person grew tired of the house and resold it for $90,000."

Question: How much money did the person gain/lose (or break even) on the exchange? How you calculate this?

Monday, July 13, 2009

SQL Server with Unicode / Khmer Unicode characters

To be notice MS SQL supports only UCS-2 encoding so do not have encoding with UTF-8 as we expected as MySQL or some other database server as well. This means that you can't use UTF-8 character encoding with Microsoft SQL Server:

Here after I type Khmer Unicode and execute the query, I got question marks instead of characters:

So if you need to store national characters in Microsoft SQL Server - please consider using a national character encoding (U+1780 to U+17FF in Unicode/ISO10646 for Khmer Unicode characters, for example). Change data types:
  • varchar to nvarchar
  • text to ntext
  • char to nchar
Here is the example since I created a table and insert data:
1. Create database (mtr_db) as normally (default setting)

2. Create table (tblunicode) with two fields (id/name) but
name - data type nvarchar(MAX)


3. Insert Khmer Unicode and execute we got it as we typed!
Good luck!