#Google Analytic Tracker

Pages

Jan 28, 2008

R4 DS Hardware Compatibility Issues

Yesterday my sister got her so call "R4" card for her Nintendo  DS. It is basically an adaptor for micro SD card to the Nintendo DS game slot. (hmm... I am thinking about interface and adaptor design pattern).

Anyhow, thing should look very simple, my sister's friend uploaded some nds files (games) to the micro SD and she tries to run it. First we saw “硬件版本不兼容”.

This basically translated as "Hardware version not compatibles". So, what's going on???

Why does it display a Chinese Error message?

First, the NDS is brought in North America from a legitimate store. It's default NDS rom is in English. 2nd, the loaded R4 kernel is in English.

After trying a different version of English Kernel, and reload the firmware file by formatting the SD, same error message pop ups. So I decided to try the simplified Chinese kernel, which can be download here. Just look for the v1.15 link for those who can't read Chinese.

Finally, that fixes the problem.

It turns out that the NDS hardware has regional specification (i.e. not all NDS sold in the world has the same hardware). If it has different version, I can see why, but regional difference, I don't really get it. Especially when your NDS runs with an English UI.

Here is the explanation that I got from a Chinese site:

Q:启动的时候显示“硬件版本不兼容” w!RK\Q�  
A:R4 的硬件是分区域的:中文版(含简中版和繁中版)、英文版、日文版等,相应的内核也分中文版(含简中版和繁中版)、英文版、日文版等,内核版本必须和硬件版本一致(中文版硬件可以使用“简体中文版”和“繁体中文版”内核),否则会显示“硬件版本不兼容”。 (C{#O&j[V  

Basically it tells you that you need the proper R4 regional version kernel to run on your NDS.

In conclusion, the first thing R4 kernel should fix up is have its kernel support multiple regional hardware. 2nd, it should allow the user to pick its own regional UI (like English, or Chinese interface). Also it should come with a better error description than just a simple "hardware incompatibility issue" message, not sure if this is a Nintendo's message or R4 message. It looks like it is NDS internal error message since I uploaded English R4 Kernel and it display a Chinese error message. I guess that the manufacturing ("intentional or intentional") uses different region hardware to build the NDS, either to save money, or time. The result is that when you buy NDS, you may end up with hardware that have different regional specification than the market region.

Jan 22, 2008

Holy... 8 CPUs for Windows Server 2008

Recently I was given a task to write some small program for Windows 2008. We got the release candidate, and our company recently bought a new server. That's right, the machine has 8 CPU in it, each runs at 1.86 GHz.

I heard machine with 16 CPUs before for real time simulation, but today it is my first time to log on to a machine that has more than 2 CPUs (Core Duo 2).  I am so excited that I have to take a screen shoot of it, just like anyone who take picture of their pizza on their blogs.

image

Now this is what I call "multi-tasking"!

Jan 20, 2008

Bad Error Message : System.IO.Filenotfoundexception in Visual Studio 2005 Designer

 

Have you ever use Visual Studio Form or User Control designer?

Have you ever run into construction error where the designer can't display your form?

Well, if you use Visual Studio, you would most likely have encounter error displaying your form if you:
A. manually manipulate the designer file (i.e. myForm.designer.cs)
B. you add runtime code to the form/user control's constructor causing your designer not to load.

Today, as I was working on my project, I don't know what I did to the code, but when I open my main form on the designer, Visual Studio crashed, and I got the following error:

image

At first, I thought it is something to do with the ActiveX control that I was referencing. I unregistered it and re-register it. No help at all. After I start playing around with my code by recreating my project, I found out what I did wrong.

It turns out that I add a System.Threading.Timer object to one of my user control's constructor. For example:

public partial MyUserControl : UserControl
{
//....
System.Threading.Timer myTimer = new Timer(DoSomeWork, null, 0, 180000);
//....
}

Since the user control is in any project, VS didn't crash until I rebuild the project and I reopen my main form that contains this user control. The confusing part is that instead of seeing error like the following, VS crashed and ask me to restart.

image

Hopefully the designer in Visual Studio 2008 will improve error handling and not crashing Visual Studio.

Jan 18, 2008

Select Statement for DataSet with Complex Data Type

I have been very busy with a lot of stuff, I almost forgot that I have a blog. This post will be my first post in 2008.

In the project that I was working with, we never use complex data type for our column in a DataSet (System.Data.DataSet). If you uses Visual Studio DataSet Designer, you will notice that the default DataType for your column are either .NET value type, string, TimSpan, Guid, DateTime.

What if you want to use your won DataType?

Surprising, the dataset designer works with custom data type. For example:

image

The Column DSTestTable1Key is using a custom data type calls "DataType.Key"

The Key data type is basically similar to a GUID, except it is not a restrictive as a GUID. If you try to create a GUID using random string value, it won't work.

I wrote a number of test to see if I can insert, update and data data row from the table. It works as expected, except how do I do select using this Complex Data Type?

It turns out that there is a function call Covert that you can use: For example:

   1: string l_sColumnName = UIModel.UIDataModel.DSTestTable1.DSTestTable1KeyColumn.ColumnName;
   2: string l_sExpression = "CONVERT([" + l_sColumnName + "], 'System.String')" + " = " +
   3:                        "'" + l_oNewRow.DSTestTable1Key + "'";
   4:  
   5: DataRow[] oResult = UIModel.UIDataModel.DSTestTable1.Select(l_sExpression);

What happen in the above example is that it convert the data type of my column data to System.String and than compare with my Key.ToString() value.

So in conclusion, as long as your complex data type support an override ToString() that is unique, you can use the above example to retrieve value based on your complex data type. To learn how more about the select express, see reference:

Reference: http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.expression(VS.71).aspx