logo
Header graphic 2 of 8

Categories

Archives

Other stuff

Other sites

I wish this site were powered by Django

May 23rd, 2008

JavaScript IDEs

Filed under: Python,Technology,Web — jm @ 22:52

I just watched a presentation about the impressive JavaScript support in Netbeans 6.1.

I have to say that I'm really impressed with it. There's a project (the Ajax Toolkit Framework) in Eclipse incubation that promises to provide pretty much the same capabilities for Eclipse, but it's not there yet. ActiveState's Komodo has some good support, but it's not really free (there's a free version without debugging support).

The only problem left now is that Netbeans' is missing a widely advertised Python plug-in, so I don't know if good Python support is available, but if it is, then it would be enough reason to leave Eclipse+Pydev behind. I'll try JPyDbg and see if I get anywhere.

February 12th, 2008

Content optimization

Filed under: PHP,Technology,Web — jm @ 19:07

Experimenting with YSlow, a FireBug plug-in for Firefox, has proven very productive. I've said it before: FireBug in combination with the Web Developer Toolbar and Jesse's Bookmarklets makes Firefox the best web development environment around.

So I spent an hour today improving maurus.net's YSlow rating. In detail, I added general output compression support by enabling zlib.output_compression in my php.ini and adding a deflate filter for JavaScript and CSS files. I also added "Expires"-headers to images, CSS files and JavaScript files. These optimizations alone, together with disabling ETags, as recommended by the YSlow FAQ, made a huge difference in this site's loading speed. Last but not least, YSlow pointed out some redundant <script> tags on the front-page.

Here's the Apache configuration I used:

FileETag none
ExpiresActive On
# images and css expire after two weeks
ExpiresByType image/gif A1296000
ExpiresByType image/jpeg A1296000
ExpiresByType text/css A1296000
AddType text/javascript .js
ExpiresByType text/javascript A1296000

AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/css

While I did all this, I also had to solve the problem that updating files for my weblog wouldn't be as simple anymore, because users would visit my site with old stylesheets and JavaScripts for two weeks when I updated my site. I decided to do the following:

  • JavaScript libraries like YUI now live in versioned directories like /yui-2.4.1/.

  • All CSS files and JavaScript files that belong to my site get a query-parameter appended to their URL that is equal to their last modification date. Thus, as soon as the file changes, its URL changes, too. Here's an example of how I load a CSS file in my header.php:

    @import url(realstyle.css.php<?php 
    echo '?ts=' . 
    date('YmdHis', 
      filectime(TEMPLATEPATH . '/realstyle.css.php')); 
    ?>);

    The resulting URL looks like this:

    @import url(realstyle.css.php?ts=20080212171452);

In summary, with a primed cache, this site will now load a lot faster than before, but if I change anything the changes will still be reflected the moment I make them. The only caveat is that I can't change images on the fly without changing their filenames, but that doesn't bother me much because I never did that anyway.

February 03rd, 2008

YUI 2.4.0 has been out since December, finally adds CSS selectors

Filed under: Technology,Web — jm @ 15:49

I missed a lot of news since November. In the meantime, Yahoo! UI 2.4.0 was released, which finally adds CSS selectors. Over the last few months I pretty much tightened my belief that I'd currently only consider 3 JavaScript libraries for web development:

  • Yahoo! UI, because it was the first library with a real commitment to non-obtrusive JavaScript (which also includes the ability to work with other libraries).

  • JQuery, because its idea of "chaining" commands and selectors, as well as that it was the first library to allow you to select subsets of XHTML pages loaded via XMLHTTPRequest. The new YUI release goes a long way to close that gap.

  • moo.fx and mootools if I need a very light-weight framework that keeps download size to a minimum, or if I just need some JavaScript helpers.

I don't recommend prototype.js/Scriptaculous or dojo anymore, primarily because prototype.js had bugs in the past that I tripped over and it tends to conflict with other libraries and dojo's documentation sucks, I never seem to find what I'm after.

This page runs with YUI btw. Now... back to reading 23000 other news items that I missed since I moved back to Munich :-).

December 20th, 2006

Rant: How to disable Flash’s auto update? and what §$@}! were managers at Macromedia?

Filed under: Attitude,Cutting the crap,Technology,Web — jm @ 19:41

Today I suddenly got an “update available for your Flash-player” dialog, which means that Adobe had that crappy piece of spyware checking in with their servers every 30 days. I immediately wanted to turn it off. If you’re not interested in how Adobe fucked up Flash’s configuration, but only want to turn off Flash’s auto-update functionality, click here

But how do I turn it off?

I remembered that Flash has no control panel (where its settings would actually belong). It also has no entry in the program menu. Adobe deliberately makes it incredibly hard to configure Flash’s privacy settings, cache settings or auto-update settings. Instead, as I remembered because I searched for it once before, there’s a special page on Adobe’s servers that allows you (after you requested the page and thus provided them with all kinds of data) to access Flash’s settings dialog. If I hadn’t known that this thing existed, my search would have taken hours longer. Here’s what I had to do to find it:

  1. Go to Adobe.com

  2. Click on support.

  3. Click on Flash-player support, of course there’s no mention of the configuration site there, in fact there’s also no hint about it in the “support center” or the “FAQ”. 95% of all users are either lost or bored by now.

  4. Click on Search and search for “Flash configuration”. This provides no meaningful search result, but a category link to “Flash configuration”

  5. At this point the site becomes unbearably slow, which is not an issue with my DSL connection, as I can access every other part of Adobe.com just fine.

  6. Found a Technote titled: “IT Administration: Configuring Flash Player auto-update notification”.

  7. It says to go into the “Settings manager” located on the Macromedia website.

  8. However, the link doesn’t go to the settings manager, it goes to a page about the settings manager.

  9. From there, you can actually access the settings dialog, which has a helpful message below it that says

    “Note: The Settings Manager that you see above is not an image; it is the actual Settings Manager.”

    Obviously, even if a user stumbled upon the settings manager, they still don’t get it!

The solution

The breadcrumbs at the settings manager’s page show its path as: “Home / Support / Documentation / Flash Player Documentation”. It’s important that you note that it’s “Flash Player documentation”. So here’s how you access Flash’s settings (I’m not making this shit up):

  1. Go to Adobe.com

  2. Go to “Support > Documentation”

  3. Choose “Flash Player” (not “Flash”!) from the dropdown (yes, the size of the dropdown requires you to scroll down to get there)

  4. Click “Go”

  5. Behold the list of only one option

  6. Click the link titled “Flash Player 9 Help” with a link-text that reads “HTML”

  7. Click one of the links on the left to open the settings manager which then provides redundant navigation!

Or click this link to access Adobe Flash Player’s settings dialog!

This whole experience is sheer brilliance. I hope that everyone who ever worked on this feature was fired. There’s a beautiful passage in the book “The Hitchhiker’s guide to the Galaxy” by Douglas Adams that describes this perfectly. A piece of dialog between the main character Arthur Dent and someone from the local council’s planning department, after Arthur found out that his house was going to get knocked down:

“You hadn’t exactly gone out of your way to call attention to the building plans had you? I mean like actually telling anyone or anything.”
“But the plans were on display.”
“On display? I eventually had to go down to the cellar to find them.”
“That’s the display department.”
“With a torch.”
“Ah, well the lights had probably gone.”
“So had the stairs.”
“But look you found the notice didn’t you?”
“Yes,” said Arthur, “yes I did. It was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying ‘Beware of The Leopard'”

August 31st, 2006

Django 0.95 has unicode problems, too

Filed under: Django,Python,Technology,Web — jm @ 04:48

I had to revise my post titled “UTF8-encoded Unicode support“, because I found out that django’s unicode support has it’s own problems. Some are, of course, connected to the character-set handling of their database code, but generally they currently handle all strings as binary, assuming that everything works within the DEFAULT_ENCODING setting.

That way, foreign character sets can break functions (#1355) in django and even worse, you can’t hook up a legacy database that uses a different character-set without patching the database driver. At least, current work on SQLAlchemy integration might make that less of a concern. I’m just hoping that django 1.0 will include full unicode support. For more information read the update on the old post.

Update (02/15/2008)

Django has come a long way since this post. An update can be found here.

August 11th, 2006

I hate IE6! (or “why my posts jumped all over the place”)

Filed under: Technology,Web — jm @ 20:10

I just fixed a bug in my maurus.net design that recently occurred in IE6/Win. Two days ago I decided to revalidate the site and I had some invalid markup that had crept in and I fixed it. Turns out that I ran into a bug that only occurs in IE6’s standards compliant mode. So congratulations to me, I introduced a bug by fixing my XHTML templates.

I fixed it by applying a width: 100%; CSS rule to the p elements under div.storycontent, the wrapper for all weblog posts’ content.

Yes, I have lots of non-semantic markup in my templates and I feel bad about it, but it’s the best I can do right now. Now that I’ve admitted it, Information scientists all over the world may now burn me at the stake.

July 20th, 2006

prototype.js Insertion.After bug in IE 6.0

Filed under: Technology,Web — jm @ 13:20

This bug bit me and fixing it was a pain. I finally found a fix in Andy’s comment at Rob Sanheim’s Panasonic Youth Weblog. The fix? Modify line 1032 in prototype-1.4.0.js to:

if (this.element.tagName.toLowerCase() == ‘tbody’ || this.element.tagName.toLowerCase() == ‘tr’) { this.insertContent(this.contentFromAnonymousTable()); }

Internet Explorer is a big piece of crap!