Monday, September 05, 2016

I'm back

Over 7 years later, many things changed after I posted that last article here.
Alright, that one thing has not been changed is I am still working in the last company. But the company wants to be separated, be spinned off and merging to a new company now.
Anyway, I am back to write some staff here.

Wednesday, June 10, 2009

Saturday, January 31, 2009

The Rich UI of Web browser

Flex, JavaFx, SilverLight, they are all for the the Rich Client Internet Interface Application. They are all focusing on the user control widgets. But, in other aspect, the internet application's report chart is a good point to make the diagram to use.

Sunday, October 12, 2008

C2061, a common compiler error with ntddk

This is a MS Windows application. A USB Camcorder with a USB port. Identify this device when the camcorder linked to computer and list the special directory's files.

I downloaded the Win2K3 DDK and want to use the "STORAGE_DEVICE_DESCRIPTOR" that defined in the file "ntddsdk.h".

I use the WTL library for Windows message driven framework. I try to use ::DeviceIoControl to query the device's properties, this Win32 function takes 2 struct STORAGE_DEVICE_DESCRIPTOR and STORAGE_PROPERTY_QUERY, they are defined in the ddk include file
"ntddsdk.h". When I compile this cpp file, a compile error C2061 come out and tell me that has a syntax error arround the 2 struct declaration. I can not believe, because the defination is really existed in the header file!

Then, after "googled" for a long time, actually 2-3 hours later, I found a lot of people suffered this compiler error, but no one gave any useful suggestions. I gave up the search engine and try to drill into the header files.

I found the standard Platform SDK header include many symbols that define in the , there is a part copy of
"ntddsdk.h" but exclude some DDK special symbols just like STORAGE_DEVICE_DESCRIPTOR etc. The use the macro define to avoid the symbols duplicate. The macro "_NTDDSTOR_H_" is the problem. I found the "winioctl.h" always included first. The "windows.h", line 198, #include "winscard.h", in this winscard.h line 31 is the "winioctl.h". The "winioctl.h" defines the "_NTDDSTOR_H_", so when I try to include the "ntddstor.h", the macro had been defined, the all symbols in the "ntddstor.h" will not be included in again!

Because the DDK symbols is defined in this file and not included in the "winioctl.h", I have to modify the stdafx.h to tell the compiler donot include the "winscard.h". I added #define NOCRYPT before the #include "atlbase.h". This macro will exclude the "wincrypt.h", "winefs.h" and "winscard.h". And the "ntddstor.h" also depends on some symbols from the "devioctl.h", this is another ddk header file. So the cpp file should include
"devioctl.h" first and then include "ntddstor.h". OK! It's work now.

Saturday, October 04, 2008

The JavaOnRails new validators released

The new version of validators for the JavaOnRails framework is working now. The new release of featured download is available.

I changed the package prefix name from "com.lvup" to "net.javaonrails" for the neutral open source project behaves.

I have updated an example for the Ajax support use the JavaOnRails framework. You could find the example in the http://code.google.com/p/jmap/wiki/AjaxEx. And I plan to write more examples for the framework utilization.

Friday, September 26, 2008

The validators

I will change the design of jmap.validators.
Now, the validators is using a set of if(...) to distinguish the annotation type. I should use another pattern to handle it. A set of classes may declare a common method to handle the "valid" and "formatMessage".
And the error messages may need more extra information. A field name may need to indicate this message's field.

Saturday, September 20, 2008

Java On Rails

This is a ruby on rails succedaneum for Java. You can find the code and examples here.
http://code.google.com/p/jmap/

This framework can make URI map to Class and a Method call, and automatically create a form value bean to map the form values to bean's fields, use the validating annotations to check these values and output the multi-language error messages.

For example, the URI: /jmap/main/login, will be map to the class "package.prefixname.controller.Main" and call the controller class method "public void Login()". Before the controller method call, a form value bean "package.prefixname.bean.main.Login" will be created and set all form values to its fields and checked against the fields validating annotations. So, in the controller method call, you can easily get this form bean from the request attribute with a key name "MainLogin". You can check this bean's status for the form values validating and any other business data status to determin a response with a "render" method call.