A site devoted to discussing techniques that promote quality and ethical practices in software development.

Saturday, May 15, 2010

How is NBN pricing compared with other country?

I am presently holidaying in HK and has just visited a friend who has just installed Fibre-To-Home service. It is interesting to compare what people in HK pays and that will be charged by iiNet and Exetel using NBN service.

HK is charging HK$99 (which is about AUD14) per month. Australia is one of those few rare countries that still imposes download limit. The HK service does not have download limit.

With is low cost, I am surprised to find in a building with 28 apartments, only 2 have taken up this kind of service. The installation fee is only HK$300 or AUD43 with a contract period of 2 years.

Friday, May 14, 2010

Firefox kills Windows Journal Writer in Fujitsu T4310 Windows 7 Tablet

I am rather shocked and annoyed to discover that Firefox 3.6.3 causes the Windows Journal Note Writer to crash in a Fujitsu T4310 Tablet PC running Windows 7. Initially I suspected it was caused by the Adobe Flash plug-in in Firefox but after many hours of painful cycles of recovery to factory settings that I have managed to nail it down to Firefox.

The machine is brand new and hence I can afford to reset it back to factory settings when things goes wrong.

For those new to Tablet technology, Journal is a key component that allows user to scribble electronic ink onto a document. It can be a blank page to start with or you can print an existing document to the Journal so that you can scribble notes on it or to highlight parts. Without it operating a Tablet is pretty ordinary.

The machine is installed from distributed image and then connects to the Internet by WiFi to retrieve all the Windows updates current to May 13, 2010. At each stage, the Windows Journal is fired up to ensure that it can render the blank page and that I can print from say Adobe Reader/IE8 to a Journal file. The Windows Journal still works even when IE8's Adobe Flash plug-in is installed. During my experiment, Microsoft Security Essentials or AntiVirus are not installed.

The installation of Firefox 3.6.3 proceeds without any trouble. I cannot launch Windows Journal or print from any program that once works to Journal Note Writer the moment Firefox is installed. Printing from Firefox causes the Journal to crash.

All the crashes cause Event ID 1000 and pin-pointed to mostly "C:\Windows\System32\msvcrt.dll" or occasionally to "C:\Program Files\Windows Journal\NBDoc.dll". In all events, the exception code is 0xC0000005, which means Access Violation and the fault offset for MSVCRT is the same. Here is a typical Event message:
Log Name:      Application
Source:        Application Error
Date:          5/13/2010 11:55:08 AM
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      ABCD-PC7
Faulting application name: journal.exe, version: 6.1.7600.16385, time stamp: 0x4a5bc80a
Faulting module name: msvcrt.dll, version: 7.0.7600.16385, time stamp: 0x4a5bda6f
Exception code: 0xc0000005
Fault offset: 0x00009c7f
Faulting process id: 0x14d4
Faulting application start time: 0x01caf25012163ca9
Faulting application path: C:\Program Files\windows journal\journal.exe
Faulting module path: C:\windows\system32\msvcrt.dll

Finally, after I've uninstalled Firefox, I launched a command prompt that "Run as administrator" and to apply the following steps to recover the Windows Journal:
In the "C:\Program Files\Windows Journal" directory
1) Run
Regsvr32 /u NBDoc.dll
Regsvr32 NBDoc.dll

2) Run
Journal /repairnotewriter

If you happen to run the last command in a CMD running as the log in user, a message box will inform you that it cannot find the specific file.

3) Then reboot.

When the machine is restarted, you can try to bring up Journal. It may still crash or it may bring up the Windows Journal Recovery dialog box as the last one you tried to print from Firefox did not go to completion. Do not choose to recover and this should bring up the blank page. You can then close the Journal Writer to complete the recover process.

You may also choose to launch the Journal Writer with an existing JNT file when launching by itself fails.

After the Windows Journal is restored (with Firefox uninstalled of course) you can print from IE or any programs.

I have been a long time Tablet user and is still using my P1510 running XP with Firefox and I have never seen this bizarre interference.

If anyone has any idea what is exactly happening in the background causing them to be hostile to each other or similar bizarre interference, I would like to hear from you. If you have a way to fix this, it is even more welcoming.

Tuesday, May 11, 2010

A review of two Windows 7 Tablet PCs with touch support

I was looking to buy a Windows 7 tablet PC that was more than a touch sensitive notebook. I am not a novice to Tablet as I am still using a T1510 when it was first release several years ago. Any candidate must be able to write like a tablet PC as the primary requirement, which means you can input without the use of the keyboard by means of the TIP (Tablet Input Panel) and touch support was a secondary requirement.

I narrow down to two: Acer Multi-Touch and Fijitsu T4310L both running Windows 7 Home Edition. The processor specification was of secondary concern to me. The functioning as a tablet was more important to me.

Because of the price difference and the weight, the Acer was the first that attracted my attention. In all respect this machine had every tablet tools and support - TIP, Journal Writer, Snipping tool and sticky note, except one thing.

This machine does not come with a pen and rely solely on touch operation which was currently in vogue. This decision by Acer defied the natural human instincts. No human I know of writes with a finger otherwise Quill was never discovered.  But Acer, in search of being vogue failed to deal with this probably. Most likely buyers' ignorance and misconception of a touch computer and a tablet. I placed the blame on the level of competence on the sales people.

A quick test of writing my name was a real struggle with the TIP and I challenged anyone to write more complicated text such as any Chinese characters on it. Even the sales person had a real struggle. Sure you could flick through image files with ease with a finger but you could not flick out a sentence or even some basic words.

Seeing several people struggling with it, I declared that Acer was not only an unsuitable Tablet PC but also bordering on not being a Tablet PC either. It is basically a touch sensitive notebook with all the Tablet tools, that no one can basically use. Its bias towards touch robbed its market share. It was more than a touch (pardon the punt) of disappointment.

I would definitely not recommend this to anyone as a Tablet PC. If your sole purpose was to get that flicking and touching actions, then you could do a lot better with a purely touch sensitive notebook, rather paying for an imitation Tablet PC.

With this shocking disappointment, I moved over to a Fijitsu T4310L with Windows 7 Home edition. This machine came with a special pen and also reacted to touch, like flicking. Writing on the TIP with that pen instantly showed the difference between this and the Acer. It was like comparing a Harley Davidson with a bicycle.

It was pure joy to write with the pen on this machine, even to a novice by-stander. Coupled with the smart recognizer, which was also available to Acer but incapable to exploit it properly, the degree of accuracy was several order of magnitude of improvement over my T1510. The special pen had programmable buttons on it as well as an eraser at the top of it.

The only disappointment was that it used a special pen that was expensive to replace. Without it, one had to resort to using the finger and this brought it back to the level of incompetency of the Acer.

With respect to some of messages from Microsoft on the combination of hand writing recognizers one could have in a Home Edition, I was pleasantly surprised to see the presence of Traditional and Simplified Chinese recognizers in an English Windows 7 Home Edition.

I was so disappointed with the Acer that I did not bother to try to discover this support. The other reason was that I could not use the finger to touch that tiny down arrow to drop down the language options in the TIP. Not such frustration on the T4310.

Hence I could not be certain if the policy reported had been repealed quietly for the sake of good common sense and now an English Home Edition could have any other language recognizers one needed, just like previous editions of Windows. But I could be certain that it was available in my T4310 running Windows 7 Home Edition.

T4310 was a clear winner, even though it was dearer. What's the use buying a cheaper Tablet PC imitation.

Monday, May 10, 2010

Supporting Chinese hand writing in English Windows 7 without Ultimate or Enterprise Edition

Microsoft has a funny definition of the word 'upgrade'. If you are currently using English XP or Vista you can have whatever Chinese hand writing recognizers with you without paying Microsoft extra. But 'upgrading' to Windows 7, you get a downgrading of functionality in this respect unless you pay dearly.

I am not going to sit idle allowing Microsoft to charging me ransom for a functionality that is available previously and in an operating system that supports multi-lango from the ground up. This Microsoft's decision certainly deters me from upgrading my XP Tablet to one running Windows 7. I certainly will recommend any other XP or Vista Tablet users to do likewise.

So if you are one of those victims, here are relieves from being held hostage. There are two ways to do:
1) Use Pen Power (小蒙恬)
This comes with a writing pad and a suite of software to deal with Chinese characters recognition.

2) Use NJStar Pen.
This is a software only solution using your mouse as the writing instrument while the screen is the stroke painter or writing pad. Once a character is recognized, it sends the character to the application currently with the focus.

The first one is naturally more powerful and gives a more natural writing experience but if you have a tablet, NJStar Pen provides an writing experience as natural as that of Pen Power, without the need to have the writing pad tethered to your machine.

NJStar Pen is supposedly free and even if one has to purchase that, it is a lot cheaper than paying for an Ultimate edition just to write Chinese characters on irregular basis.

Saturday, May 8, 2010

Microsoft is not encouraging Multi-Lango Tablet PC in Windows 7

I am a user of XP Tablet PC and is looking for a replacement. Over the last several years, I have monitored the feature set they built into each OS to support Tablet operation. One of the main demands, and I believe plenty others, are that it must have recognizers for other languages. For example, if the OS locale is English, it must have Asia hand writing recognizers.

People using XP Tablet PC and Vista, takes this for granted even as it is available for base model of Vista on a tablet PC.

So when the Windows 7 comes along with the much touted expanded International Support when I tested a Tablet PC running English Windows 7 Home Premium naturally I expect that I could just add the Chinese recognizer and be able to interpose English writings with Chinese characters. Sadly, Microsoft take 2 steps forward and 4 steps back encouraged by pure greed to deny their customers this supports from the past.

While all the languages are available via keyboard inputs for all versions of Windows 7, hand writing recognizers for different languages are only available at the really top end of the spectrum:
Vista Home Premium customers could do handwriting recognition in up to 12 languages. In Windows 7 they will only get recognition for whatever Language Packs are installed (normally one language) and have no options for additional languages other than upgrading to Enterprise or Ultimate.

Home Premium customers will get the handwriting recognizer that corresponds to the language of their OS; i.e., a Swedish customer running Swedish Windows 7 will be able to use the Swedish handwriting recognizer.  Enterprise and Ultimate customers can deploy additional recognizers by downloading the desired Language Packs and enabling the respective keyboards.  The English recognizer is available to all Tablet PC customers on all SKUs.

New handwriting recognizers enable more people around the world to take advantage of handwriting recognition.  If you have some type of pen input device, you have access to handwriting input. In fact, you can use your mouse as a rudimentary input device.
With this kind of pricing policy Microsoft sends a clear message that she is more interested in money grabbing than to provide a truly affordable multi-lango tablet market. No wonder the tablet market is dwindling aided by Microsoft's greedy policy. Its downfall is not so much caused by technical issues but rather scuttled by its creator through greed.

"New handwriting recognizers enable more people around the world to take advantage of handwriting recognition." Not likely with that kind of greedy and backward policy.

Wednesday, May 5, 2010

Caveats in deriving from System.Configuration.ApplicationSettingsBase

A friend of mine was using System.Configuration.ApplicationSettingsBase to provide a customized settings containing complex type for his application. Complex type is defined as a type whose Type.IsPrimitive is false. In his application he ran into some difficulties in saving the changes. Investigation into his issues leads me to uncover several gotchas in using customising ApplicationSettingsBase, in particular, handling complex type.

To illustrate some of the caveats discussed here I am using the following classes
class Person {
   public String Name { get; set; }
   public DateTime Dob { get; set; }

The customised application settings is defined as such:
class MySettings : ApplicationSettingsBase {
  [ UserScopedSetting() ]
  [ DefaultSettingValue( "123" ) ]
  public Int32 SomeNumber {
    get{ return (Int32)this[ "SomeNumber" ]; }
    set{ this[ "SomeNumber" ] = value; }

  [ UserScopedSetting() ]
  public Person Person {
    get{ if( this["Person"] == null )
           this["Person"] = new Person();
         return this["Person"] as Person; }
    set{ this["Person"] = value; }

Cavaet 1 - ApplicationSettingsBase special treatment of complex property type

Each settings property is associated with an object of type SettingsPropertyValue, which can be retrieved by ApplicationSettingsBase.PropertyValues[].

The SettingsPropertyValue class has a member called IsDirty and it is this that will decide when if there is anything to save when one calls ApplicationSettingsBase.Save().

You can toggle this flag since it is public and is read-writable. But not wise and it is better to let the framework does the job.

What is interesting is that, when you access a complex property by means of the getter method of the property wrapper, behind the scene (actually in SettingsPropertyValue.PropertyValue of the required complex property) ApplicationSettingsBase.Item[] not only retrieves the property value but because it is a non-primitive type, not a string, not a DateTime, and not null, the call causes the complex property's IsDirty flag to toggle to true, even when just getting the property value.

The following line of code proves this:
  MySettings settings = new MySettings();
  String name = settings.Person.Name; // causing the settings data to be loaded.
  SettingsPropertyValue sv = settings.PropertyValues["Person"];
  Debug.Assert( sv != null );
  Debug.Assert( sv.IsDirty==true, "Set by SettingsPropertyValue.PropertyValue");

However, if you retrieve a primitive type you get a different result as illustrated by this:
  MySettings settings = new MySettings();
  Int32 number = settings.SomeNumber; // causing the settings data to be loaded.
  SettingsPropertyValue sv = settings.PropertyValues["SomeNumber"];
  Debug.Assert( sv != null );
  // SettingsPropertyValue.PropertyValue does not consider primitive type.
  Debug.Assert( sv.IsDirty==false );

I suspect Microsoft has not choice but to take this approach because one cannot foresee what one will do to that complex property object after it is retrieved from the settings. If one simply extracts values from it, then flipping it to a dirty property seems a bit harsh and incorrect. But if one uses that object to modify its state, then preemptively setting the property to a dirty property appears to pay off.

Caveat 2 - Do not cache complex setting object

When using settings containing complex property type, do not cache the property object and using that to modify the settings. This can cause persistence problem as illustrated by the following code fragment:
  MySettings settings = new MySettings();
  Person p = settings.Person;  // this is my cached object.
  SettingsPropertyValue sv = settings.PropertyValue["Person"];
  Debug.Assert( sv!=null );
  Debug.Assert( sv.IsDirty, "Set by SettingsPropertyValue.PropertyValue" );

  // this simulates one modifies the state of the
  // object at some later stage and then saving the settings.
  for(int n=0; n<5;n++) {
    p.Name = "Jack-"+n.ToString();  // L01
    Console.WriteLine("IsDirty before saving is {0}", sv.IsDirty );

The output from the above run will produce
IsDirty before saving is True
IsDirty before saving is False
IsDirty before saving is False
IsDirty before saving is False
IsDirty before saving is False

and if you examine the generated user.config, it only contains the first change ("Jack0") and not "Jack4" as one would expect. This is so because the dirty flag stays false after the first save and, assuming all other settings properties have not been modified but the property Person, there is nothing to save in subsequent modification performed via a cached reference object to that property.

In order to be able to save the subsequent changes, one needs to modify line L01 above as follows:
  settings.Person.Name = "Jack-"+n.ToString(); // L02

In line L02, the access to the property is sufficient to toggle the IsDirty flag to true, in accordance to Caveat 1, and will then inform the ApplicationSettingsBase.Save() that something modified needs saving.


The recommendation is always access your property via the property wrapper in the ApplicationSettingsBase-derived class, which internally accesses the settings property by means of ApplicationSettingsBase.Item[]. Doing so keeps the house keeping data in check and everything should work smooth as designed.

Joke of the century - Steve Job calling Apple iPad/iPhone open system

Steve Jobs must be using a different dictionary than mine and may be high on illicit substance when he said:
Apple has many proprietary products too. Though the operating system for the iPhone, iPod and iPad is proprietary, we strongly believe that all standards pertaining to the web should be open. Rather than use Flash, Apple has adopted HTML5, CSS and JavaScript – all open standards.

While the web part may be so only in a very limited sense. It still does not work with 80% of the web that other browsers can competently handle. It is like saying my car's ride is so good only one perfectly laid road surface but any pot-holes or expansion joints will throw the car off course.

What he did not say is that it is not open to industry adopted defacto "standards" (Steve you quoted the word open and I quoted the word standard, fair swap!), of which Adobe Flash is one, even though it API and standards belonging to Adobe.

If Apple, in particular, is so open as Steve Jobs, why is there a dictatorial control over what development languages one can use?

The whole issue is not whether Adobe Flash is proprietary or not. It is just the culture of Apple's insatiable thirst to retain control over its products - Google Voice Native removal - and it will not allow others invention to outshine his.

The so called "open" system supports Object-C, which does not have any formal written standard unlike ANSI-C or ANSI-C++. Even C# is an ISO & ECMA standard language and hence if Steve is genuine about pursuing only standard or open specification, he should endorse .Net but it is in the banned list.

I can't understand why Microsoft has been charged for anti-competitive when it only have Internet Explorer pre-installed while allowing all other browsers under the sun, including that from Apple, can installed without need for approval and yet Apple is free to impose all the kind of undocumented approval rules that in its tight-fist control of its product.

If it is good for the gander, it is good for goose! So just can't wait to see the US Department of Justice, FTC and EU coming down hard of this villain. It is long overdue.

Sunday, May 2, 2010

Free Photo Editor Review

Ever since I have uninstalled Picasa, I was looking for free Photo Editor to replace it. I came across this article and decide to give most of the recommendation a try. I did not try every one of them because I also have an additional requirement, which really should not be such a big deal in 2010, and that is the program must run in Limited User Account (LUA) and not in administrator's account.

The one that is really good is PhotoScape but obviously their developers must have 25" plus monitor in order to come up with dialog box like this:

How many more settings are available below that red box?

Program has to be useful across a range of operating environments and not just those available to your developers. Often it is not such a bad idea to limit your developers' environment to a much lower specifications one as this will have effect of making them to use their ingenuity. The above dialog box clearly can be reduced significantly without any lost of functionality by reducing the amount of white spaces between controls. Perhaps tab control can be put to a good use here.

Nevertheless PhotoScape is very capable editor. Sadly it lacks a file open menu instead opting for scanning, just the directory, for image files. Don't forget one can customize Windows File Open dialog box to contain a preview window showing the selected file.

The next one I tried was Paint.Net. Sadly this program has some problem with its installation program that must be executed when log in as an administrator. Most other programs install fine when using the "Run As" feature. Instead of telling the operator of the failure, the installation process just silently dies. Not nice. Once installed, it runs fine in LUA except it has a bug. When I select a region of an image (jpg) and wanting to transfer to another file, the File | Copy operation produces an error message saying there is an error copying to the clipboard. But I can use File | Cut to transfer the region to the clipboard. The user interface is nice, clean, unclutter and easy to operate.

The next one I tried is Photo Pos Lite, which is the baby of Photo Pos Pro. This is a shocker and there is no good reason why developers can be so ignorant in 2010 with respect to the Windows File Security that was first introduced in Windows 2000, some 10 years ago.

The installation of this program is fine but showing worrying sign of placing far too many DLL and OCX into the System32 directory. I sincerely hope its installation program practise module counting so that when I go to uninstall it, it will not tear away system DLLs that it placed there. The only annoyance of its installation program is that it does not publish the start menu for all users; it is only available for Administrator.

The following dialog box during uninstallation is a course for concern:

The bombshell comes when one launches this program in LUA. It fails so badly that it does not even bother to inform user of the failure. Only through tool to probe it to discover that it was trying to write to "C:\Program Files\Photo Pos Lite" directory and AppData sub-directory. Microsoft's recommendation is to write to user profile rather than doing what was once permitted in Windows 95's days. Judging from its installation method and malpractices, it is definitely a legacy application.

While I am there I may as well test drive the Photo Pos Pro ver 1.80. The installation process is very long as it tries to initialize some folders. Sadly, it fails to install the start menu for every user, which is usually a clear sign of its failure to run in LUA.

Sure enough, when I launch the program in LUA, after showing the lovely lion splash screen it throws this dialog box box:

and it then exits. The probe shows the Pro is doing more illegal operations than the Lite, such as setting values in HKLM as well as writing history log directly into the "C:\Program Files\Photo Pos Pro\History". Obviously the developers have kept up with Win XP to include a manifest file for its program but obviously are developing in Administrator account.

As a result, I can't even appreciate its extremely user-friendly interface enabling you to work intuitively in both the lite and pro version.

Why software sucks - Picasa is another example

I have been a user of Picasa grudgingly since it was first released. While it has many good features and is free, its user interface leaves a lot to be desire imposing a strict rule of operation on their users to the point of being annoying.

The feature that has antagonized many users is the feature that it must scan, in a very intrusive manner, your hard drives for image files to add to the library without user's consent or desire.

There is no shortage of people seeking assistance on how to turn off this annoying feature on the Internet. Perhaps it is a reflection of Google's culture of insatiable thirst to stick their nose into others private information without consent, in this case image files. This undesirable feature still exists despite many protests on the Net in its latest version, version 3.6. It is getting worse now including face recognition.

I have since uninstalled Picasa opting for PhotoScape, another free photo editing software that definitely does not intrude into my hard drive without my instruction.

Many recommendations to fix this undesirable features are superficial and ineffective. Let me show you why. All of them focus in the File Manager and recommend users to mark all drives/folders 'Remove from Picasa' like this:

Notice the folder circle in red as I am about to pick up a JPG file from that folder from Windows Explorer and drop it onto Picasa causing it to flip into edit mode of the file, a very nature and common operation. While the file is being opened in the editor, Picasa nosily scans that folder and its sub-folders recursively looking for images without my consent. A visit to the File Manager confirms such action has taken place as shown below:

Returning to library shows the presence of the images that are picked up in the background despite my instruction that that folder is removed from Picasa. This shows that the recommended remedy does not work. It further shows that Picasa' logic is faulty. The first picture indicates the user wants Picasa to have nothing to do with that folder and yet it can't help itself to nose around that folder and its sub-folders.

Picasa please mind your own business. To Picasa's developers: while you might think that feature is cool and you love that feature. Remember this saying "Your User is Not you".

Turning this ultra intrusive feature off is very simple - just add a check box in your options dialog box to say "Turn on auto scanning of images". If the user selects it (opt-in) Picasa can scan to your heart's content but if the user opt-out of that action, you should honor it.

To show Picasa is not interested in offering you such option, have a look at the dialog box when Picasa is first started up:

Picasa should take a leaf out of the book of Firefox, which politely asks the user if they want Firefox to import favorites from Internet Explorer; no such option is offered to the user. Automatic actions like these belong to the users and not the developers; Firefox and just about all the anti-virus software know that except Picasa.

With Tera Bytes hard drive not uncommon these days, your feature has been demonstrated time and time again to be a total time wastage and not a scalable feature.

Furthermore my experiment above shows the stupidity of such a logic - it is like someone calling a Square Root of 3.5 in a maths library and the program scan through the maths library calling sine, cos, tan, log, etc. every maths functions it can find. Or like opening a document in your editor and it scans and opens all others documents!

This feature really makes Picasa sucks and is definitely a prime candidate for this book.

Blog Archive