Requirements to try out things described below:

Super large numbers as LatLng’s

Open this page from Google’s example. In firebug’s console, execute the following code:

map.setCenter(new GLatLng(1e100, 1e100));

Setting super large numbers as latitude and longitude like this always makes my Firefox 2.0.0.11 in Windows XP hang.

I don’t know why Google didn’t restrict the range of the numbers, and what computation it did to consume so much CPU time. It should ignore such numbers after a simple judgment.

Strings as zoom parameters

In the same page, execute this piece of code:

var zoom = '16';
map.setZoom(zoom);

As you see, nothing happens. Google must be ignoring the parameter when expression typeof(zoom) == ‘number’ is false. In my situation, I got the value of variable zoom from the url, and didn’t noticed it was the type mismatch which prevented the code to work, since I’m used to JavaScript’s dynamic type conversion feature:

a = 2 * '3'; // a = 6

It will be converted to number when needed. Of course, it’s good to perform strict type checking. But it’ll be better if the API threw an exception instead of being silent.

I’m a fan of Google Reader. Although FeedDemon went free recently and it offers synchronization with NewsGator which is great attraction for many people, I still couldn’t drop Google Reader.

However the panel above the subscription list takes up too much space for my humble screen resolution of 1024×768. As Google rolled out the much complained “Friends’ shared items” feature, it became an urgent task for me to hide the annoying but never used panel. It took up 1/3 of the vertical space on the left sidebar!

No, not just hiding. Sometimes I need to clear the number of unread friends’ shared items. So it should be a “toggler” like the sidebar (or nav-bar as called by Google) toggler natively built in Google Reader. Like this:

Before hiding, with mouse hovering on the toggler:

toggler

When the panel is hidden:

panel hidden

You can still open it at any time. Basically, it works in the same way as the native sidebar toggler.

This is done by writing a user script for Greasemonkey, so you must have Greasemonkey installed to use it.

Get it now.

Today I did some modifications to Starbox to let it utilize the power of Prototip. They are both cool JavaScript libraries written by Nick Stakenburg.

Starbox prototip

How does it work? When you hover your mouse on a star, a tip shows you a brief word like “lame” or “great” which helps you with your choice. If the rating box is locked, a single tip is shown wherever you hover on the box. Check out the demo. View its source to see how to get it working.

You can globally set the tips, or specify a group of tips for each specific rating box instance.

Get it

View Diff | Download the modified version

CSS for the tip (included in the zip archive):

.prototip .startip {
 color: infotext;
 background-color: infobackground;
 border: 1px solid infotext;
 padding: 1px;
}

Movable Type 4.1 was just announced. As stated in the blog post, this is a (the first?) stable release of Movable Type Open Source.

The download link given on movabletype.org is a zip file. However if you want gzip format, you can get it here. This version is under the GPL v2 license. And you can also download another version here if you agree to the personal license.

The two files are not identical, if you check them. That makes sense because they include different license agreements in their source code headers. However, they deliver the same code and functionalities as far as I know.

I just upgraded my Movable Type powered blog (not this one) to the latest version of MTOS and I really like the new layout of creating entries. Don’t forget overwriting the old mt-static directory - I missed this step as a novice and the admin page was messed up :)

Yes, I’m still a novice user of Movable Type. I’m very curious about a different approach than WordPress (OK, WP is a different approach than MT).

I saw on the web many discussions about “the best JavaScript editor”. This kind of discussions are quite like “the best PHP editor”. Neither of these two languages has a good editor as other languages like C++/Java. The difficulty in making a good PHP editor is that PHP codes are always mixed with HTML. And the difficulty in making a good JavaScript editor is that JavaScript is too flexible and even worse, different browsers have different implementations.

But there are some good JavaScript editors that’s recommended by people engaged in the discussions. The most mentioned two are JSEclipse and Aptana.

Aptana

I only tried it (the free plugin for Eclipse) for two weeks and gave up.

In Aptana’s editor, you can select a piece of code and press Ctrl+Shift+F to format it, which is like the Java editor. That’s good. But the formatting result is not as good, unfortunately. I couldn’t configure it to generate the same formatting as Java code. So actually this good feature is of no use for me. Even worse, when you press } to close a block, it will “help” you format this block. Clever, but ugly.

Aptana shows its suggestions for you almost every time in type in a character. But the suggestions are absolutely useless most of the times.

Features described on its homepage are quite promising but I didn’t try them all. These two mentioned above are already too annoying. So I switched back to JSEclipse.

JSEclipse

I use JSEclipse most of the time. It’s very simple compared to Aptana. You can see a list of features on its homepage. For me, the most useful feature is that when the cursor is on some identifier (variable, function name, etc.), all occurrences of the same identifier are highlighted. Even though sometimes it will wrongly mark some extra identifiers, it doesn’t matter much.

Sadly it’s acquired by Adobe. You see, the links given above are adobe’s. The original homepage, however, is here. The last update to JSEclipse was on April 2, 2007. So it’s almost dead. It’s really a pity. See this post in Adobe forums.

Anyway, these are only my own experiences and may be full of prejudices. Which editor are you using for editing JavaScript? please comment below.

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.