Archive for the ‘Technology’ Category

Months ago, I started a blog about interesting advertisements powered by Movable Type. During the installation and usage process, I got some knowledge about Movable Type, but the fact is that I’m still not quite familiar with it. Besides, the chosen topic is not quite related to my daily life. So now I’m stopping and deleting the blog.

Movable Type is a great blogging platform, and the team has been inventing many techniques and concepts, but the problem is that it’s defeated by WordPress because it’s not as simple and WordPress now has much more plugins.

The only advantage of using MT is that you don’t need to worry about the server load (digg effect, for example), but this is not a problem for us “little” bloggers. After several weeks, I even didn’t remember the url of the administration area.

I may start another blog, powered by WordPress, of course :)

I followed the official instructions to install Movable Type 4 on this host, but the 500 error page appeared every time I clicked the “begin” button. Besides, the mt-check.cgi script generated an incomplete HTML output - it’s terminated at some point.

The log of the 500 error:

… Out of memory!, referer: http://example.com/cgi-bin/mt/mt-wizard.cgi
… Callback called exit at mt-wizard.cgi line 11., referer: http://example.com/cgi-bin/mt/mt-wizard.cgi
… END failed–call queue aborted at mt-wizard.cgi line 1., referer: http://example.com/cgi-bin/mt/mt-wizard.cgi
… Callback called exit at mt-wizard.cgi line 1., referer: http://example.com/cgi-bin/mt/mt-wizard.cgi
… BEGIN failed–compilation aborted at mt-wizard.cgi line 11., referer: http://example.com/cgi-bin/mt/mt-wizard.cgi
… Premature end of script headers: mt-wizard.cgi, referer: http://example.com/cgi-bin/mt/mt-wizard.cgi

I read through the troubleshooting doc of Movable Type but it seems not to be any of the problems listed there. When I searched for “Premature end of script headers: mt-wizard.cgi“, there’re no answers in English results.

I asked the support of this hosting company but at first they said it must be the problem of the script. Oh I’m using the stable release of MT4 and it’s used widely across the world. I wouldn’t believe it.

Then suddenly I received a message from root in the secure shell:

Please try to do your installation again.
We have identified a problem which has been corrected.

Yes, it worked like a charm. Soon I received a the problem description from support:

The problem appears to be related to memory limitation set in the apache configuration. This Apache limitation has been removed and memory is now controlled via PHP.

There’re quite a lot people stuck by this error when trying to start the Movable Type tour as I see. Most people don’t believe that the memory out error is true but indeed it is in my case. Hope this helps someone.

Digg Podcast

Now Digg is beta testing its “Podcasts” section. There is a module on the right of the page, with two tabs, “Find Podcast” and “Add New Podcast”.

Open the page and try clicking the tabs. You will discover the weird behaviors of this module.

Digg is using this single JavaScript function to handle the click events of the two tabs (Note that Prototype framework is used.):

function pcSwitchTabs(){
  var tab1 = $(’podcastFind’);
  var tab2 = $(’podcastAdd’);
  var addbox = $(’podcast-add-box’);
  var errordisplay = $(’podcast-error-display’);
  var ad = $(’podcast_ad_switch’);
  var psearch = $(’podcast-search’);
  var psubmit = $(’podcast-submit’);
  if (tab1.className == ‘active’) {
    tab1.className = ”;
    tab2.className = ‘active’;
    if (addbox) {
      addbox.style.display = ‘block’;
    }
  }
}

You should ignore several lines of unused code. What does this function do? As its name, it switches the tabs back and forth. And it’s called either of the tabs is clicked. So the weird thing happens - whichever tab you click on, the current tab changes. This can make users very confused.

Another thing is that when you click on a tab, the page scrolls back to the top after the tab switch. This will definitely make users lose their attention. The code for the click-able tab:

<a onclick="pcSwitchTabs()" href="#">Find Podcast</a>

After executing the onclick event handler code, the browser tries to open the link specified by the “href” attribute. A “#” makes the page scroll back to the top. There are some common solutions to this. For example, give href attribute a value of “javascript:void(0)” or append “return false” to onclick attribute to stop the event.

These two bugs are very easy to fix, but leaving them aside will definitely make users confused or unhappy. I don’t know how the beta process is going, but hope Digg will fix them one day.

The so-called “Rich Text Editors” are used extensively over the web nowadays, especially in content publishing systems. Of course rich text editor mentioned here won’t mean the desktop software. They’re invented to solve the problem that standard HTML lacks a rich text editor component. JavaScript and basic XHTML technologies are used to create more powerful text edit controls with styling and formatting functions.

I started to pay attention to rich text editor implementations since I discovered WordPress. It bundles TinyMCE with it. However many people including me were not satisfied with the default customization of WordPress, so I got a plugin called EditorMonkey. I don’t quite remember what it was like because I haven’t used it for a long time and the author’s site is down for the time being. But I do remember that it provided two editors, FCKeditor and TinyMCE, as choices for users. That was the first time I knew FCKeditor and it gave me a good impression.

Generally speaking, the two take up most of the market. But after using them for a while, I realized some issues with them I can’t tolerate. Although they did great contribution to the Internet, they’re just not for me.

They Produce Uncontrollable Codes

Firstly I say that such editors are not for Internet novices. Why? Just open an image insertion dialog box in FCKeditor to see the options (see the FCKeditor demo). Will my mother understand what is “alternative text”? Or what is HSpace/VSpace? No. Not to say options in the “Advanced” tab. She just wants to insert an image! What the hell are these new concepts?

As a developer, I always want to be clear of what HTML code is underlying the rendered output. Both of the two editors can’t produce clean code for me. There are cases when we want to edit the source code by hand, though this doesn’t happen quite often. What do you think when you see the code in a mess but not like what you expected?

So I quickly discarded them and enjoyed the quick tag editor in WordPress. I really like it. It just converts a single line break into a “<br />” and a series of line breaks into a paragraph. Other characters remain the same.

They’re Much More than too Heavy

What do you use an Rich Text Editor for? Will you use it to create a complex website? Of course not. We mostly write simply styled articles, and they can be done easily (of course not easy for my mother) with a plain text editor.

I myself lived a good life with the quick tag editor. But at last I couldn’t get by the doom when our users needed a rich editor. So I picked up FCKeditor.

The size and speed of the editors are intolerable for doing such simple works, especially when you want to make a rich text box on the fly which needs quick response to make the user experience smooth. I heard enough complaints about the speed. No one would like to open Microsoft Word frequently, right?

Compatibility Problems

Recently FCKeditor released the 2.5 version and added Safari and Opera to their compatibility list. TinyMCE is beta testing its 3.0 version and it support all the main browsers.

However there are other compatibility related problems. I saw on several machines that the modal dialogs are squeezed to a very slim window, about 30 pixels wide, without scroll bars, making it completely unusable. Sure it may be problems of browsers, but there will be no problems if they use JavaScript and XHTML to fake a dialog. TinyMCE now uses such technique a lot, but there are still traditional modal dialogs.

They’re both too heavy to catch up the pace of technology innovations. Especially FCKeditor.

NicEdit, a New Hope?

I’ve been searching for an alternative to FCKeditor for weeks, since our users complained a lot about the text editor. I discovered NicEdit all of a sudden.

It is light weight - only 30K of a single JavaScript file. And it never uses popup dialogs except alerts. The auto-fit-height feature is really cool. An ideal solution for web sites. So I’m seriously considering switching to it, and my colleagues are also looking forward to it.

I’m pretty satisfied with the current feature set of NicEdit, But the author is considering some proposed features for the next version. This makes me wonder how FCKeditor/TinyMCE were like in the beginning. Were they as simple and light weight as today’s NicEdit? Maybe it’s the never ending feature requests which created today’s bit monsters. I really hope NicEdit will keep the feature set small and make them robust. There are still problems. For example, when the editor is not active, clicking the “insert image” button will generate a JavaScript error.