Thursday, September 25, 2008

Developer Friendliness

People usually said that Firefox is more developer friendly than IE or Safari. Currently, there are two embarrassing incidents that flip my perception of Firefox.

1. Text box inside DIV
For some weird reason in Firefox 2, the cursor caret in the text box disappears when the text box is inside a DIV. Web developer has to work with the CSS hack to get the caret back
overflow: hidden; position:fixed;
It is OK if web developer have the total control of the HTML. However, we have web components in .Net and Java Server Face. If such components do not aware of this, user may had a bad experience.

2. Length Required with POST
Content-length is an HTTP header letting the server know how much data it should be expecting in the request. However, Firefox does not send such header to the server with posting with XMLHTTPRequest. Developer need to write it out explicitly
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
xhr.setRequestHeader('Content-length', '0');
XMLHTTPRequest is the key doing AJAX! The HTTP request is usually uncachable when using POST. Why on earth developers need to code it themselves?

I think implementing the standard is important. It relieves the web developers headache. On the other hand, please do not introduce new problem to the developers.

Saturday, September 20, 2008

ShineDraw in JavaScript: Kaleidoscope

This is the JavaScript version of Kaleidoscope in ShineDraw. It uses <canvas> and works with Gecko (Firefox, SeaMonkey), Webkit (Google Chrome, Safari) engines.

Performance:
  • SeaMonkey - Comsumes a lot of CPU power
  • Google Chrome - Renders the Kaleidoscope smoothly.

Sunday, September 14, 2008

ShineDraw in JavaScript: Random Expand Rotator

This is the JavaScript version of Random Expand Rotator in ShineDraw.


Implementation Note:
Image scaling and clipping cannot be done at the same time in JavaScript.

Thursday, September 11, 2008

How Bad Can a Bad MPEG Decoder Be?

I have be using VirtualDub for years to encode video files. I found many criticisms VirtualDub is being old. We should use more modern encoder support new file format like MP4. Avidemux seems very popular as it has as GUI. No command line option to be remembered.

I used Avidemux to try to encode a few files and it seems that it could get the job done. Until recently, I found a very unforgivable feature (a.k.a. a big bad bug)! The frame detail got blurred! I thought it was a blurred by the codec at the beginning. However, when I look at the preview screen in Avidemux, the details has been destroyed already comparing with VirtualDub and Media Player Classic (which deinterlaced the frame and still looks good).

We want to minimize the quality loss of the video in many ways like increasing bitrate. Losing the quality while decoding the source file is not acceptable. Please trash it right the way!