WordPress 2.2 Update

Wordpress 2.2 arrived a day ago.
Updating was no problem at all. Prominent new features are wigdet support without the need for an external plugin and a working atom 1.0 feed.

I could drop two plugins: the widget plugin and the atom10 plugin. Nice. All others work as before (some important to mention are UTW, WP-Cache and the nice extended live archive(*).

A really nice site effect of the update: the WP Team finally managed to put a “SET NAMES blah” into wp-db.php, so that setting “UTF-8” i.e. in wp-admin really means UTF-8 in the database. I always hacked my wp-db(**) for my other blog planet-punk.de, since there are a lot of old posts from another legacy system that _are_ indeed UTF-8 but which where maltransformed by wp without that hack before 2.2.

I do have a local development system on my mac but i tend to test things twice or more often. Other people maybe don’t have or want that luxury and need to udate their blogs directly on the server. Either way, it’s a good idea, to put your blog to maintenance while updating your wp core files. This is easily accomplished with .htacess and mod_rewrite. First create a file “maintenance.html” for your visitors. Than look up your external ip and add the following to your .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !87.78.68.17 [NC]
RewriteRule ! maintenance.html$ maintenance.html [R=301,L]
</IfModule>

and replace 87.78.68.17 with your external ip. Remember commenting these entries when you’re done.

(*) If you have any questions about my plugins, don’t hesitate to ask, i just don’t want a plugin list in case of bugs in any plugin.

(**) The hack was: Add the following to __construct in your wp-db.php (./wp-includes/) :

	$this->select($dbname);
	$this->query("SET NAMES 'utf8'");

| Comments (1) »

17-May-07



Sichere Passwörter

Gespräch mit einem Informatiker am Wochenende

“Wir speichern unsere Passwörter jetzt sicher in der Datenbank.
Base64 kodiert.”

Waaah… *wegrenn*

| Comments (1) »

14-May-07


Removing 3rd party apps from .mac sync services

I recently tested Yojimbo and decided i have no use for this kind of tool, so i thrashed the app and all config files in my ~/Library.

Some weeks later i reinstalled another Mac and set up the .Mac Synchronisation. No problem at all.
I needed my ftp favorites on both machines so i turned to the first to tick the checkbox and saw a broken Yojimbo entry. Not on my mac!

After a little googling i found this tip: Reset the .Mac Sync Server with Syncrospector.

Syncrospector is a little apple tool you can get for free here.

Be careful. The author on macosxhints suggests to reset all sync services which could end up in a total lost of all your contacts. He writes:

Open Syncrospector in the StickiesExample -> Applications folder. Don’t bother trying to use the Unregister button to eliminate any third party client identifiers. I tried “unregistering” Yojimbo’s entry after launching, quitting, and removing the application itself from two of my Macs.

The “Unregister” button in Syncrospector indeed works! The author made one mistake (as did i): he trashed the app before unregistering. To tidy up your sync services with Apples tool, you must not thrash the app in question before but afterwards.

I just downloaded Yojimbo, run it once, unregistered after quitting and than again, moved it to trash and the damaged sync entry was gone.

| Comments (0) »

09-May-07


Java crazyness

Someone must be hit really hard with some curly braces when he implemented the following behaviour:

public class Braindead {
	public static void main(String[] args) {
		Integer i1 = 10;
		Integer i2 = 10;
 
		Integer i3 = 128;
		Integer i4 = 128;
 
		compare(i1, i2);
		compare(20, 20);
		compare(i3, i4);
	}
 
	public static void compare(Integer i1, Integer i2) {
		System.out.println("Comparing " + i1 + " and " + i2);
 
		if(i1 == i2)
			System.out.print("same ");
		else
			System.out.print("different ");
		System.out.println("Objects");
 
		if(!i1.equals(i2))
			System.out.print("not ");
		System.out.println("meaningfully equal");
		System.out.println("---");
	}
}

I’d expect the following output:

Comparing 10 and 10
different Objects
meaningfully equal
---
Comparing 20 and 20
different Objects
meaningfully equal
---
Comparing 128 and 128
different Objects
meaningfully equal
---

What you get is:

Comparing 10 and 10
same Objects
meaningfully equal
---
Comparing 20 and 20
same Objects
meaningfully equal
---
Comparing 128 and 128
different Objects
meaningfully equal
---

In order to save memory, two instances of the following wrapper objects will always be == when their primitive values are the same:

  • Boolean
  • Byte
  • Character from \u0000 to \u007f
  • Short and Integer from -128 to 127

So in order to save a handfull of bytes we present you some really inconvenient feature 😉

| Comments (2) »

24-Apr-07