The Way Alternative Text Should Be Rendered

Vlad Alexander describes how browsers mess up horribly on alternative text. I noticed the deficiencies in Opera and Firefox before, but what Webkit does is simply ridiculous. I don’t entirely agree with him since I don’t think that the alternative content should display without any indication that it’s alternative text whatsoever. I consider Opera’s behavior best in this regard (as opposed to the obtrusive icons most other browsers throw in there), except for the part where it applies width and height meant for images to the text thus cutting them off.

Comments

Opera 10.50

For those of you who read my blog, use Opera and don’t follow the latest releases, Opera 10.50 for Windows was released yesterday. Download it now!

Comments

What Is Philosophy?

I wrote this summary for a university course, but I never finished it.

The History of Philosophy

  • The history of Western philosophy starts in Greece—Miletus, more precisely, situated in modern-day western Turkey—, around the beginning of the sixth century BCE. According to Aristotle, Thales of Miletos was the first to develop a way of thinking that deserves the name philosophy, around 585 BCE.
  • The first philosophers were possibly aware of the novelty of their enterprise; at any rate, they made up a new term for it, historia, which means as much as “research.”
  • The verb philosophein is not found until the second half of the fifth century BCE. This verb and the substantive philosophia do not become commonplace until the first half of the fourth century BCE. Literally, it means “love/desire to/strive to” (phileô) “knowledge” (sophia).
  • Philosophia did originally not only specify a specific way thinking: originally philosophizing as an intellectual activity was intrinsically connected to a certain way of life. Something of this ancient concept is still present in our modern language: someone who sees things “philosophically” might possess the spiritual calmness the philosophers of Antiquity had in mind.

This intrinsic connection no longer exists, but some particular terms have maintained this connotation to the present day. Kantian, Heideggerian, phenomenologist or structuralist, on the other hand, only refer to certain points of view. The only qualities the philosopher needs to have are the same that every other scientist should have. Consequently, practicing philosophy does not mean that someone is or tries to be a better human being. It should be noted that this isn’t a modern development. During the Middle Ages, philosophy was little but a tool to support theology, and that is where the modern meaning of philosophy as academic and purely theoretical originated.

The Four Philosophical Questions According To Kant

  1. What can I know?
  2. What should I do?
  3. What may I hope?
  4. => What is a human being?

To know what philosophy is, it does not suffice to know the history. You need to know which questions philosophy wants to answer. According to Immanuel Kant (1724—1804) philosophy tries to answer three main questions, which come together in one big question.

Comments

The Prettiness Disease

The following post on the MyOpera forum spurred me to complain about something I call the prettiness disease. By this I mean adding features that either don’t help usability or actually impair it just because it looks good (according to some). A prime example is most of the features added to Mac OS X as compared to preceding incarnations, but Microsoft and the open-source community have also bought into it.

[…] the thing that most annoys me about [combine always, hide labels] is the fact that it removes the ability to simply click the taskbar icon to minimize/maximize. […] This is the case only, when taskbar buttons are not set to the default ‘combine always, hide labels’. Then it needs CTRL-click to directly switch to the last visible window of a ‘grouped’ application. This is standard Win7 behaviour also with IE8. So, if you disklike the current behaviour disable grouping of taskbar buttons for now. Perhaps there might be an option within Opera later on…

I don’t care for the “combine always, hide labels” setting in Windows 7. I think it’s a failed copy of Apple’s crappy dock, where looking pretty is the only thing that counts while losing out on usability.

Oh wow, look how clean this looks, with all the pretty icons. No text. Whoopie. Now try to identify your windows when there’s 10 different ones. What’s that, thumbnails? Oh how useful, now I can really spot the difference between my 10 directories filled with files, my 10 web pages on the same forum, my 10 text documents in my word processing application, and so on and so forth. There’s a reason I give my directories names, you know. The same applies to just about any other application. The icon only identifies the application, the text-based title identifies what the heck it actually is. Thumbnails would only work the way Microsoft seems to think they should work in Windows 7 if all I ever opened was pictures.

It’s easy enough to combine a text-based title with thumbnails (for those who like thumbnails) and flashy effects (OK, I admit that as long as they’re shorter than a second I don’t completely dislike effects like burning or fading windows, things that light up, etc), but writing your own Compiz plugin is near-impossible without completely reverse-engineering the code (documentation? comments? what’s that?), and for Windows that situation isn’t very different, at least for me.

Comments

SimplePie-based Feed Mashup

This tool is now named Tubes and is hosted on Bitbucket.

As I wrote a few months ago, Yahoo Pipes is a nice tool. Nonetheless, it has a few shortcomings which annoyed me because I could neither fix nor work around them. Therefore, I decided to write my own mashup tool. For the impatient, you can download the file right now before reading anything else.

Since SimplePie seems to be the feed aggregation library of choice for many projects, I decided to go with it. I ran into a few minor issues, but nothing I couldn’t handle easily. The code I wrote is based on the multifeeds.php demo file and SimplePie 1.1.3, because in 1.2 it didn’t work (the multifeeds demo, that is — by extension I suppose this file won’t either). It’s a little rough around the edges, and SimplePie is clearly meant for HTML output rather than XML (although its HTML isn’t quite decent either, even if the input feed is), so I decided to fix the whole thing up with Tidy, which takes care of low quality input material as well. Hopefully that makes this whole thing more robust than it would otherwise be. The code is based around bringing various Opera feeds I read together in one big feed, but this can very easily be changed.

So now that I’ve got the basics of output into a feed taken care of, I can easily duplicate other functionality of Yahoo Pipes if I want. Much better.

Comments

How to Add Keyboard Shortcuts to Ubuntu/Gnome

Someone asked me how to find a shortcut key to call something like Task Manager to terminate a program.

In Ubuntu 9.04 and 9.10, the following applies:

  1. The easiest option in this particular instance:

    Alt + F2, gnome-system-monitor, Enter

  2. The slightly more complicated (though still easy), always applicable option:

    System > Preferences > Keyboard Shortcuts

    Click Add

    Type whatever you like in name. “System Monitor”, “Task Manager” or anything you like. It doesn’t really matter, just so you can identify it yourself.

    Type gnome-system-monitor in Command.

    Click Apply.

    Scroll down to the bottom (Custom Shortcuts)

    Click on where it says “Disabled”

    Press Ctrl + Alt + Del (by default this keybinding gives you the logout/shutdown screen, so you’ll probably get a warning about reassigning this particular combination).

For more information on keybindings in Ubuntu, I’d advise you to read the community documentation. If you’re interested, you can also check out the original context of what I wrote in this post.

Comments

Erf: Usually With Sidewalks

I do agree with Joe Clark’s recent blog entry protesting shared streets without sidewalks, but I feel that the Netherlands was mistreated by the Toronto Star and to a lesser extent Joe Clark himself. For starters, the sidewalk-free erf as apparently exists in Cologne (assuming that’s what Koln is supposed to mean — if you don’t know how to type Köln, type Koeln or just use the English name) is something that, in the Netherlands, usually only exists where there is no place for sidewalks, and all erven are culs-de-sac. Erf is a Dutch word that means something like yard or court, but in the context of roads it rather refers to an area that is supposed to be more or less as safe as a yard for those cycling, walking, or playing in it. A place where the road-function (transport) is secondary to the area-function. By the way, woonerf is a now an outdated word that means something like living yard. Erven originally only existed in residential areas.

I’d say a typical erf does have sidewalks. Its distinguishing features are that cars have to drive really slowly (no precise speed is specified, but in practice it definitely doesn’t mean anything over about 10 kmph) because everybody except cars can utilize the street however they like, and that traffic can’t pass through: it’s a cul-de-sac after all. Most important it means a place where it’s safe for kids to play on the entire street and where everybody can utilize the street however they like. By no means does it mean that there aren’t supposed to be any sidewalks, and to claim that it does is a misunderstanding at best. Sadly some misguided people have managed to introduce erven without sidewalks in some places where there is enough space for them, but I’m glad to say that this is far from the norm.

Another typical situation is the 30 km zone, though you might see lower speeds like 20 km at times. This kind of zone will typically have a number of speed bumps in place to keep people at this speed and it is usually a through-going road, though seldom the preferred one. This zone will always have sidewalks and may or may not have separate cycling lanes, the latter being almost universally present on roads where the speed limit is 50 or above.

In conclusion, the Toronto Star must have projected its own vision of “better” street conditions on what is actually going on in countries such as the Netherlands and Belgium. An erf does not mean a lack of sidewalks, its application is only in carefully selected areas, and it is always meant to be a cul-de-sac. If you want to copy erven, at least do it right. Don’t claim they’re things they’re not.

Comments

30 Days to Becoming an Opera Lover

The 30 Days to Becoming an Opera 6 Lover series may very well have been what pulled me over the edge. That which made me choose Opera instead of MyIE2 (now Maxthon). It should therefore be no surprise that I still harbor warm feelings toward it. While it may be old, and the original series is no longer hosted by TnT Luoma as far as I can tell, I think that the series could still teach current (aspiring) users of Opera a thing or two — even the Opera 6 series. Due to the large part the Opera 6 series played in my personal discovery of Opera, however, my judgment may be somewhat impaired.

I dug into the Internet Archive and I was pleasantly surprised to discover that the 30 Days series for Opera 6 is available through the archive in a nice ZIP file. The original Opera 6 lover pages do not seem to have been preserved, but the ZIP file is easier to use regardless.

The 30 Days series for Opera 8 was also preserved. The Opera 8 series is still available in the archives of TnT Luoma, but the pictures and some other things are broken. Besides, I like the old layout better; it used to be blue, however, which was even better — you probably don’t want to read the oldest text available, though. While I would not recommend a detailed read (it is quite outdated after all), I would certainly recommend skimming through most of it.

By the time Opera 8 came out — and consequently, the 30 Days to Becoming an Opera 8 Lover series — I was already a seasoned Opera user, so the series didn’t do much for me. I did discover one very important Opera feature thanks to it, however. In the default keyboard setup, Shift + F2 is bound to go to nickname. If you don’t know what nicknames are, you can give bookmarks so-called nicknames and if you type them out in the address bar and press enter it will take you to the bookmark, and it will offer it in the autocomplete suggestions while you’re typing. Useful, but not a huge time saver.

Go to nickname is better, because it starts going to the nickname as soon as it’s got a match. So if you have only one bookmark with a nickname that starts with a, you’ll only have to type a and you’ll be on your way. I had not realized this prior to reading the Opera 8 Lover series, and it wasn’t actually written in the series, but without it I might very well never have tried this feature again. After some consideration and major inspiration by Moose I rebound F2 to new page & go to nickname, which means that ever since, pressing F2 automatically opened a new page and this tremendously useful dialog. The introduction of speed dial didn’t do much for me thanks to this keyboard shortcut. It might take a few seconds more to configure, but it’s worth it. Additionally, new tabs will open even faster if you disable speed dial.

Comments

Teaching Wordpress Some Manners: Enabling Day/Month/Year Archives

Wordpress can’t cope with day/month/year (/%day%/%monthnum%/%year%/) permalinks properly by default. I had no idea because I’ve always used year/month[/day]. It’s fine for the posts, but in the archives /date/month/year fails. Luckily WP (Wordpress) supports plugins in a clever manner, and it has a great API (application programming interface).

Initially I tried the WP API:

add_rewrite_rule('date/(\d{1,2})/(\d{4})', 'index.php?m=$matches[2]$matches[1]', 'top');

This kept giving me an error which I couldn’t (be bothered to) debug since it went several functions deep into the WP core, so I gave up on the API and circumvented it with the help of something I found.

Anyhow, here’s the plugin. Save in a file named rewrite-day-month-year.php or just name it whatever you like.

<?php
/*
Plugin Name: Rewrite Rules for Day/Month/Year
Plugin URI: http://frans.lowter.us/2010/01/22/teaching-wordpress-some-manners-enabling-daymonthyear-archives
Description: Wordpress can't cope with /%day%/%monthnum%/%year%/ for some reason. That is to day, it fails when you try to go for an archive in the form of /date/month/year/ This teaches it some manners. Probably/hopefully shouldn't interfere with other structures, but why you'd activate it if you don't need it I wouldn't know.
Version: 1.0
License: GPL
Author: Frans
Author URI: http://frans.lowter.us

Based on http://dd32.id.au/files/wordpress/test-rewrite.php
*/ 

function test_add_rewrite_rules( $wp_rewrite ) {
	$new_rules = array(
		"date/(\d{2})/(\d{4})" => 'index.php?m=' . $wp_rewrite->preg_index(2) . $wp_rewrite->preg_index(1),
		"date/(\d{4})" => 'index.php?year=' . $wp_rewrite->preg_index(1)
	);
	$wp_rewrite->rules = $new_rules + $wp_rewrite->rules; //NOTE: You must add it to the start of the array, Else WP's greedy rules at the end of the array will eat the request
}

register_activation_hook( __FILE__, 'flush_rules_initiate' );
register_deactivation_hook( __FILE__, 'test_flush_rules' );
// add_action('init','test_flush_rules'); // for testing

function flush_rules_initiate() {
	// Add the permalink override stuff
	add_action('generate_rewrite_rules', 'test_add_rewrite_rules');
	test_flush_rules();
}

function test_flush_rules(){
	//Flush the rewrite rules so that the new rules from this plugin get added,
	//This should only be done when the rewrite rules are changing, Ie. When this plugin is activated(Or Deactivated), For simplicity while developing using WP Rewrite, I flush the rules on every page load
	global $wp_rewrite;
	$wp_rewrite->flush_rules();
}
?>

Comments (1)

Unobtrusive Input Value Modifier

Inputs that say things like “search here” are generally messed up. In this post I will first explain why and then I will show you how to do it properly.

The Wordpress theme I’m modifying for my wife had the following HTML in it:

<input type="text" value="Search this site" onfocus="if (this.value == 'Search this site') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this site...';}" name="s" id="searchbox" />

There are three main problems with this.

  1. It prefills the search box with “Search this site.” This is incredibly annoying and obnoxious behavior for people with Javascript disabled. If you must add such text, add it through Javascript.
  2. The values don’t even match up, so if you focus on the INPUT, deselect it and select it again the text stays there. Even for users with Javascript enabled. Errors of this type could easily be avoided if the text value were stored in a variable.
  3. Which brings me to the third problem. The script should be external so it can be cached. That would save bandwidth for both you and your visitors and if there are people with Javascript disabled, they won’t even have to load the junkscript once.

Because just about every such box I have ever encountered is complete and utter crap (this is actually one of the better ones), I decided to reproduce its functionality in an unobtrusive manner, eliminating all of the mistakes I outlined above.

The HTML is now reduced to this:

<input name="s" id="searchbox"/>

You could remove the trailing slash if you’re writing HTML, or put a space in between if that’s the way you write XHTML, but that’s of no consequence otherwise. The type="text" is not essential because it’s the default, but it shouldn’t hurt to leave it in. Also see Anne van Kesteren’s Optimizing Optimizing HTML for some tips on going somewhat over the top with minimalism.

The Javascript that changes the text to “Search this site…” is now in an external file:

(function() {
	function searchbox_text_change() {
		var s = document.getElementById('searchbox');
		var s_text = 'Search this site...'
		if (s.value == '') s.value = s_text;
		else if (s.value == s_text) s.value = '';
	}
	document.addEventListener('DOMContentLoaded',
	function(){
		var s = document.getElementById('searchbox');
		searchbox_text_change();
		s.addEventListener('focus', searchbox_text_change, false);
		s.addEventListener('blur', searchbox_text_change, false);
	},
	false);
})();

All of this took me about five minutes. There’s a tiny bit of redundancy going on, but I can’t be bothered to fix that. It’s superior to just about any stupid such script I ever encountered and likely to most of the same type that I will encounter in the future. Use this script as much as you please. You don’t even have to link back to me, since I just want those bloody things to work in a way that doesn’t make me cringe.

The same kind of principle applies to autofocus junk. Never ever do any such thing if I started typing something. I’d rather you never did it at all, but if you really feel that you must do it for some masochistic reason, at the very least check if the value is still empty with if (s.value=='').

Comments

« Previous entriesNext Page »Next Page »