Archive for June, 2007

Data Retention

For my non German readers: Maybe you have noticed the dog-ear at the top right corner of this weblog.

It’s from a campaign against the Directive on Mandatory Retention of Communications Traffic Data enacted in March 2006 by the European Union. Since the directive has passed the European Parliament, the fight against the directive now takes place in the member states.

I support this campaign, because I think data retention is no solution:

“Data retention is an invasive tool that interferes with the private lives of all 450 million people in the European Union. Data retention is a policy that expands powers of surveillance in an unprecedented manner. It simultaneously revokes many of the safeguards in European human rights instruments, such as the Data Protection Directives and the European Convention on Human Rights.” — www.dataretentionisnosolution.com

If you’re interested in the topic here is another link covering the topic.

Scope and foreach loops

One of these misunderstandings: I always thought foreach loops would create a temporary variable for the current element that would mask any variable with the same name in the current scope.

Obviously that is not the case, as I discovered when I tried to find a bug in Simple Tagging’s STP_RelatedPosts() function.

First I thought this was a PHP-only behavior… But see the following PHP and Python examples:
More »

Dynamic ip based authentication with Apache

I have a very cool Squeezebox WiFi MP3-Player which comes with a very cool music server software called Slimserver (written in Perl, Open Source, too!).
One thing this Slimserver can do is stream MP3 to every MP3 stream capable player. (Winamp, etc.)

The problem: How to access my music from any computer that has i.e. Winamp installed, without risking a big security breach at my home computer.
Solution: Secure the Slimserver with Apache as a proxy, using Apache’s SSL and authentication capabilities.
Catch: Winamp doesn’t do SSL and MediaPlayer isn’t to good at it, either.

The real solution: Access the management interface of Slimserver via SSL, protect it via some AuthType and allow unprotected, unencrypted access to the stream URL only from IPs that have previously accessed and successfully logged in at the SSL protected page.
I do that with mod_python and the various hooks it provides. Yes, you can do more with it than just executing Python scripts.
More »

Duck Typing, Generics and Templates…

Skunk Works has an article about how “The Future Won’t Be Statically Typed”.

There’s been many criticisms of duck typing but usually those voicing them don’t have an extensive experience of development using non statically typed languages or are Java fundamentalists.

Yeah. I agree with that. But I also think current dynamic languages are not the end of the story. Why is everybody thinking Types? Why not Interfaces? No, I don’t mean Java’s Interfaces — because they also rely on inheritance trees (or are the root of it). I think inheritance trees are the root of the problem.
More »

Python refactoring for Komodo

Brandon Corfman has written some cool extensions for Komodo that add support for the most important refactorings.
He is using Bicycle Repair Man! as the backend for the refactorings. Check out his blog for some other cool Python and Komodo stuff.

I am currently working on a larger article about extended authorization schemes with mod_python and Apache. You can expect it in a few days.

Adding metadata to built-in types in Python

In this article I will show how you add metadata to any object and optionally change only part of its behavior (in this example the string representation __str__), while maintaining all other data and behavior of the object itself.
I will show how to write a class that dynamically decides which base class to use, based on the parameters that are passed to the constructor. I call that “dynamic inheritance”.

This way you can build universal decorators. (Decorators that work on more than one type.)
More »

Welcome

Welcome to my new weblog. I will focus here mainly about everything I do with software and computers in general. Occasionally you might get something to know about me as a person ;)

Stoppt die Vorratsdatenspeicherung! Jetzt klicken & handeln!Willst du auch bei der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien: