Archive for January, 2007

Vista Incompatibility

As the new Microsoft OS comes to market, there have been various reports regarding incompatibilities of the OS with existing hardware and software.

Even the compatibility tool provided by Microsoft cannot assure users that their hardware is capable of running all the features provided by the new OS [1]. Users may end up with a Vista that’s not running the features they wanted. Should there be yet another Vista-compatible logo, something like FULLY Vista-compatible, to mean being able to run all known Vista features?

On the software side there are also many anticipated problems, such as in South Korea [2]. Governments and organisations have warned that Vista may be incompatible with their existing ActiveX programs, which would result in inability to consume their daily services like banking, trading and shopping. Games and software that work with the existing XP have also stated warnings against Vista compatibility.

Adding to the issues are advisories on possible security problems with Vista despite claims it is the most secure Windows OS so far (probably just relatively more secure than their first XP?).

With nothing to work with Vista, who’s going to use it?

[1] Buying Vista? Get a guarantee
[2] Microsoft Vista to Cause Confusion for Korean Net Users


Sending PDF for download

Symptom: When sending a PDF for download to IE, the error message appears:

There was an error opening this document. The file could not be found.

Cache-Control has been set to no-cache. Firefox works fine.

Cause: Unknown, IE specific problem with cache handling.

Solution: Set expiry date to trick browser that content expired. [1]

response.setHeader("Expires", "0");
response.setHeader("Pragma", "cache");
response.setHeader("Cache-Control", "private");



Sorting Javascript Arrays (of Objects)

There’re many ready Javascripts out there, which already allow you to sort arrays. However, if you come from a OO background like me, it won’t be long before you start using Javascript arrays of custome objects. You can’t really use those simple number or string sorting algorithms available, since they don’t inspect the attributes to sort correctly. You could write a custom sort function for that purpose, then rewrite it again and again for each of the attributes of that object, and again and again for all other objects.

Or you could follow that well known Comparable model from Java. By attaching methods to the custom objects [1] like a Comparable, you can write generic sort algorithms to performing sorting. You can even extend the feature to using a Comparator to influence the object’s natural sort order.

Side note: Javascript does not support method overloading, and it doesn’t report and error that it doesn’t [2]. It simply uses the last method declared. I’ve therefore named the other method sortArray2. Bad method name, but you should name it more appropriately if you decide to use it.

Javascript Object Array Sorting Example

[1] Introduction and Features of Javascript “Function” Objects
[2] JavaScript only pretends to support function overloading


Modern Internet Business Models

As many people (and articles) have identified, online businesses are moving towards newer models to offer free stuff using advertising [1] and service support [2] to sustain.

Advertising usually means the site provides free content, and generates revenue by displaying advertisement alongside their content. The site would need to update content regularly, in order to attract returning visitors. There seems to be also a trend of user-generated content, such as video-sharing, which empowers the site visitors to contribute to the site content.

Service support usually allows users to use their product for free, charging for support when problem arises or signing support contracts with bigger companies. It is noticed that such companies have to work with lower profits, as a result more company operations are streamlined, such as reduced sales staff and marketing. Early adopters to such products also usually help shape future versions of the product.

[1] The Internet’s Biggest Google Whores
[2] Taking the plunge into open source


Sum of consecutive odd numbers = Perfect Square

Interesting story about early Apple, and also some interesting facts about floating-point calculation using Integers and sum of consecutive numbers are perfect squares.

1 + 3 = 4, 1 + 3 + 5 = 9, 1 + 3 + 5 + 7 = 16, etc…

[1] Folklore: Round Rects Are Everywhere!