Archiv für Coding

Using multiple keyboards with different layouts on the same machine

My laptop has a Portuguese keyboard, which I use when I am at home, but at work I use an external keyboard with a Belgian layout. This is annoying because every time I switch keyboards, I need to go to every open program and manually change its input language with the language bar. Worse, when I start a new program, it starts with the default language which means that sometimes I have to switch input language also.

One way to work around this problem could be to buy a new keyboard, but I like that IBM model M keyboard and I have yet to find a better keyboard.

Instead of doing that, I wrote a program that switches to the correct input language when I start using a keyboard.

Download RightKeyboard

Invalid PHP_SELF Path & Cacti & Ubuntu 7.10

Wenn nach der Installation oder Update Cacti mit oben genannten Error aufwartet hilft das Anpassen der /usr/share/cacti/site/include/config.php

Man ersetzt den Teil zw. /* Sanity Check on “Corrupt” PHP_SELF */ und /* we don’t want these pages cached */ mit:

[code lang="php"]
if ((!is_file($_SERVER["PHP_SELF"])) && (!is_file($config["base_path"] . '/' . $_SERVER["PHP_SELF"]))) {
if (!is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["PHP_SELF"])) {
if (!((is_file($_SERVER["SCRIPT_FILENAME"])) && (substr_count($_SERVER["SCRIPT_FILENAME"], $_SERVER[$
if (!((is_file($_SERVER["SCRIPT_FILENAME"])))) {
echo "\nInvalid PHP_SELF Path\n";
exit;
}
}
}
}
[/code]

A Cacti Bug

MS Silverlight und der Weg zu einer besseren Zukunft?

Nachdem Microsoft Silverlight 1.0 offiziell verabschiedet hat steigen auch wieder die Anzahl der News. Das Silverlight für Mac OS X und Windows gleichermaßen entwickelt wurde hat schon etwas Aufsehen erregt doch das war noch nicht alles. In den letzten Tagen trafen noch zwei, meiner Meinung sehr interessante News ein:

Silverlight & TextMate

Cédric Bleimling directed my attention toward the video tutorial site for Microsoft Silverlight. Not only are they using TextMate for the screencast, they put its icon on the graphics for the download.
Clearly the message has been well received in Redmond :) (via macromates)

Silverlight on Linux

For those of you who have met Miguel de Icaza, you know right away what I mean when I say that he is one of the most energetic people I’ve ever met. Clearly, the whole Moonlight team (whom I haven’t met) would also qualify for this appellation – in roughly 21 days between May and June, they collectively built an alpha implementation of Silverlight on Linux, based on many pieces of the Mono codebase.
After a great deal of work between the Moonlight and .NET teams, we’re ready to formally announce that we (Microsoft and Novell) will be bringing Silverlight to Linux, fully supported and including application and media codec compatibility.
The expansion of the existing work between Microsoft and Novell to include support for Silverlight on all Linux platforms is a major step in the journey of interoperability that we are on. We’ve heard clearly from the community that a full cross-platform web development solution is not only Windows and Macintosh, but must include Linux. I think this is a big deal. While we’ve licensed media codecs before, this represents a fully heterogeneous implementation of a strategic client technology.
Here’s to a better web and support for all users. Hopefully this will help breed further productive conversations about what developers and users need, and in someone else’s famous words, we can all “just get along.”
Cheers,
Sam

(via port25)

Migration-Scripts für Wordpress

Nachdem ich beschrieben hab wie ich meine Serendipity Installation nach Wordpress migriert habe waren noch einige Dinge unsauber gelöst. GUIDs und Permalinks hatten nicht die gewünschten Werte. Aus diesem Grund liegen nun unter Projekte PHP Scripts mit denen es zum Einen möglich ist alle Permalinks auf ihre Funktionsweise zu überprüfen und zum Anderen ein Script um die GUIDs in der Datenbank zu aktualisieren. Die Scripts benötigen natürlich einiger Anpassungen an die eigene Wordpress Installation und ich übernehme keine Garantie für die Funktion – also zuvor Datenbank sichern.

Zitat zum Thema GUIDs von wp-hackers

Because it’s not the “ID” field, it’s the “Globally Unique ID” field.

That means the value stored in that field must be unique not just for one site, but for any site anywhere. The GUID is used, for one example, to differentiate posts on different sites for feed aggregators.

Presumably, if you switched sites and also changed the URL in your aggregator to the new setting, it would know not to re-load posts with the old GUIDs because they haven’t changed. Unfortunately, there is plenty of aggregator software that doesn’t obey the spec, and when they ignore this, it causes some issues. But you can also see why the GUID should not change when you change the slug.

You can’t use the ID field of the posts table as the GUID because that value is *very* common among all blogs. Creating hashes from existing data is never going to produce a more globally unique ID for a post than the actual URL for the post.

ASP.NET-Videos für jeden Entwickler

Auf dieser Seite finden Sie Dutzende englischsprachiger Videos für jeden ASP.NET-Entwickler, vom Anfänger bis zum Profi. Als Neuling bei ASP.NET erlernen Sie die Grundlagen, wie Sie dynamische Webanwendungen mit ASP.NET 2.0 und Visual Web Developer 2005 Express Edition erstellen, wahlweise mit Visual Basic oder C#. Wenn Sie bereits einige Erfahrungen bei der Entwicklung besitzen, erfahren Sie, wie Sie einige der fantastischen neuen Funktionen in ASP.NET 2.0 optimal nutzen.

ASP.NET-Videos für jeden Entwickler

Angepasste 404 Site

Noch hab ich meine Migrationsstrategie von Serendipity auf Wordpress noch nicht niedergeschrieben. Doch bin ich der perfekten Lösung wieder einen Schritt näher gekommen. Der eine oder andere wird vielleicht mitbekommen haben das manche Posts nicht betrachtet werden können. Man erhält einen 404 Error da der Post Slug nicht stimmt. Das Problem entstand bei der Migration – da Serendipity hier anders vorgeht als Wordpress. Da ich nicht alle meine Posts per Hand durchgehen will hab ich die 404 Seite etwas intelligenter gestaltet.

Von nun an, wenn jemand auf den Titel eines Posts klickt und den 404 Error bekommt werde ich automatisch per eMail informiert und werde diesen Fehler auch sofort ausbessern. Hoffe so auf kurz oder lang alle falschen Post Slugs beseitigen zu können.

Für die Erstellung dieser Seit waren codex.wordpress.org, binarymoon.co.uk und alistapart.com sehr hilfreich.

Der Code meiner 404 Error Page: Weiterlesen »

Ruby One-Click Installer für MacOS X

rubyosx is the most simple way to equip your Macintosh Apple OSX System with Ruby. It replaces the broken Readline library, updates to a current version of SQLite3 and prepares your OSX for Rails, which needs at least Ruby 1.8.4 to run. The current Ruby Version is 1.8.6 (1.8.5 is recommended for Rails) and Rubygems 0.9.4.

Das Paket installiert sich in /usr/local und läßt so Apples Ruby unangetastet. (via der schockwellenreiter)