Python BarCamp 2011

Yesterday, I went to the Python BarCamp. In the process, I discovered the collaboration tool etherpad, which nicely complements PasteBins (eg.,, or The session protocls have their own etherpad page.

The disscussions covered a broad range of subjects, including how to interface with modules written in C, practical hosting questions, several talks on testing, the small high-performance web server Tornado, and the latest developments in Django, now in version 1.3. Regarding Django, the speaker highlighted a number of new features which were being implemented by using mixin classes. Although some quantitative analysis would be required to really assess this development, I had some strong repercussions about the Zope2 development that eventually caused the initially painful, but highly liberating, Zope3 development.

For everyone interested, the event continues to this evening, so hurry if you haven't been there yet. You should already be in or near Cologne, though, due to the limited time remaining.

Back to top

Assigning a Portlet With Python

All tutorials I found online deal with using either GenericSetup for portlets assignment, or explain only how to delete a portlet from Python. Below, I want to explain how to assign a portlet from Python, as is required when you want to have portlets that depend on dynamic structures.

Get the assignment_manager:

>>> manager = getUtility(IPortletManager, name=u"plone.leftcolumn", context=site)
>>> assignment_mapping = getMultiAdapter((context, manager), IPortletAssignmentMapping)

Get a portlet's assignment class, eg. that one from Events, and instantiate it:

>>> from import events
>>> myevents = events.Assignment()

Then assign the new portlet:

>>> assignment_mapping[u"my_events"] = myevents

If you're doing it manually, like me, then you also need to commit the change:

>>> assignment_mapping._p_changed = True
>>> transaction.commit()

Back to top

Energiewende selbstgemacht

Heute stand in unserem lokalen Käseblatt, daß viele Leute anläßlich der Ereignisse in Japan daran überlegen, Ökostrom zu beziehen, aber nicht wissen, wie man einen seriösen Anbieter findet. Diese Frage möchte ich, so gut ich kann, beantworten:

Ein seriöser Ökostromanbieter ist aus meiner Sicht ein Anbieter, der zu 100% Strom aus erneuerbaren Energien verkauft und kein "konventionelles" Angebot (Kohle, Kernkraft etc.) hat. Dazu kommt, daß die ANbieter zu bevorzugen sind, die selbst Geld in den Kraftwerks- und möglichst auch noch den Netzausbau stecken, um so die Energiewende voranzutreiben und von den großen Stromanbietern unabhängig zu werden. Soweit ich weiß, kann man mit diesen Anbietern Vereinbarungen treffen, um etwa den Strom aus der eigenen Solaranlage an diese Anbieter zu verkaufen. Damit ergibt sich aus meiner Sicht folgendes Angebotsspektrum:

Aufgrund eigenen Kraftwerksbaus oder direkter Investitionstätigkeit empfehlenswert sind:

Mit Einschränkungen, weil sie meines Wissens nur Händler sind, sind noch folgende Anbieter empfehlenswert:

Die in dem Artikel genannte Erfahrung, mit dem Wechsel zu einem Ökostromanbieter gegenüber einem lokalen konventionellen Anbieter Geld sparen zu können, hat sich für mich persönlich bestätigt.

Natürlich kann ich keinen Anspruch auf einen vollständigen Marktüberblick erheben. Falls sich also jemand benachteiligt fühlt, sollte er oder sie mir dies mitteilen.

Wer sich nur allgemein mit dem Thema befassen möchte, dem sei diese Webseite ans Herz gelegt: Energie in Bürgerhand.

Back to top

Learning WuBi as a Westerner

For quite some time, I've had the idea to learn how to type WuBi. Fortunately, I've recently run into a very nice Chinese guy who got me started on it, uncovering a configuration error on my behalf. Since I find the online documentation mostly very hard to grasp, as they have eg. glaring omissions, I'd like to just complement them with what this guy told me, and my experience, so Westerners will hopefully have an easier job mastering this method. As to why one wants to learn it, I often find it very tedious to write a character using PinYin, and to the list of oft-cited advantages of using WuBi over (smart-) PinYin, I can also add these:

  • deductive writing - improves both the understanding and memorizing of a character's structure, and eliminates guesswork,
  • yields an easy-to-transfer method of transmitting Chinese characters using only ASCII (eg. writing "你" can, with very little ambiguity (if any), be represented as "WQ",
  • allows for writing down characters that you don't know how to speak, eg. to subsequently feed them to your electronic (online?) dictionary

The downsite is that it does require quite some practice to master, so if you're only a casual writer of Chinese, you'll probably not attain the proficiency necessary to benefit from it. While I'm also far from fluent using it, I do benefit from having the keyboard layout shown in the article referenced above, at my side.

Back to top

Installing Plone4 on Debian/Lenny

At my workplace, there are two options to host applications like Plone: One is OpenBSD, and the other is Debian. In a commercial hosting setup, you may prefer to use stable and supported systems over running your business-critical machines on software in various states of 'unstable' and 'unsupported', or whatever the respective lingo for systems with state_in_flux and we_wont_really_help_you is. For this project, the decision was to host the application on a Debian system.

After unsuccessfully trying the Unified Installer packages several times and subsequently receiving unanimous advice from seasoned members of the Plone community against using them, I decided to try to install Plone4 the old-fashioned way, using a system Python and a conventional buildout. But there would be little point in this writing if Lenny would support that out of the box.

Reading the documentation for Plone4 and skimming through the appropriate versions.cfg file, the following core requirements surface:

  • Python 2.6
  • setuptools 0.6.11
  • virtualenv

Since we want to be able to upgrade our system later, having these things in the form of Debian packages should be the preferred situation. For Python2.6, I used the backport packages I created. These also require libdb4.7, which is not in Lenny as well, and so also requires a backport.

To be able to properly create backports and install them in a way that Python2.6 can see them, one needs to edit the file


to supplement the list of python versions with 'python2.6'. I didn't discover this by myself, but lost the link to the article which explained this. It is also required to change the file


to include python2.6 there, too.

The prerequisite Zope 2.12.10 requires the package 'python-profiler' to be present as well, as otherwise, an import statement fails. I didn't investigate how strong this dependency really is, but simply provided a backport for python-profiler. So, creating all the backports, also for python-imaging 1.1.6, requires that one wades through all the files under ./debian and manipulate the dependencies to claim compatibility also with Python2.6. The software itself seems to be mostly suitable for this, but many packages explicitly, and imho wrongly, state that they are not compatible with Python2.6. If you don't do this, packages will not include any Python2.6 versions of their libraries and what-not, and thus not function in a Python2.6 environment. To a very large extent, this package-rebuilding is only required to make them Python2.6-aware.

I fudged and installed the virtualenv and setuptools package under /usr/local after getting the basic Python2.6 packages installed, but I consider undoing the damage with additonal, to-be-created, backports.

After getting all the required packages installed, I created a virtualenv before doing anything else. Inside that, I then installed the remaining packages like eg. zc.buildout and ZopeSkel, using easy_install . After that, you are ready to create a new standard Plone3 project using the familiar paster invocation, but then replace the 'versions.cfg' with the one fetched from before running buildout.

[Update 2011-02-17]
If you are also going to run tests under roadrunner, you need the python-profiler package. Don't forget to update your virtualenv to point to these files, too, otherwise roadrunner will complain.

[Update 2011-04-20]
There is an update for Squeeze.

Back to top

Net Neutrality, Customized

Over the last few years, probably everyone who believes in an open Internet with non-discriminating access for all interested parties understood that abolishing Net Neutrality would amount to at least slowly, if not radically fast, driving small sites out of "the Internet", ie. present them with barriers-to-entry that they just can't meet. The result of such an effort would most likely be an Internet that consists mainly of your favourite state's authorities' offerings (aka "e-government"), plus the huge amount of corporation-generated content. Like eg. gambling, advertising, online television etc, but with a decreasing amount of actual user-generated content outside of platforms like Facebook or Google-driven stuff. Perhaps some of the more prominent non-profit projects would also remain highly visible because they are already prominent, and because some corporation deigns to sponsor their online activities as an element of their marketing efforts, but the general tendency is simply much in favour of big platforms, and against independent users trying to create their online activity from the ground up.

The efforts to codify Net Neutrality into telecommunications laws were, from my perspective, noticably supported by an initiative including Google and other big corporations, roughly arguing that abolishing Net Neutrality would result in all those small websites that still may make up the bulk of all web content, becoming roughly invisible because they will no longer be able to afford decent Internet access. I fully agree with this assessment. I'm an avid supporter of Net Neutrality myself, and strongly support the idea that the Internet should be open to everyone, for any purpose, and on basically equal terms, and not be reduced to a new technology for distributing TV.

But now I come across a statement of how "Google makes the Web faster" by - gulp - giving higher page ranks to faster websites, arguing, that websites which load faster, are beneficial to the user experience. I don't dispute that a user might like faster loading sites better than slow ones, but the question must be asked why some sites don't load as fast as others. The answer to that question is, in my opinion, quite often how much the web site owner can, or wants, to invest in having his site load fast. I see this move by Google as a change of course, now that they apparently have amassed enough content and their own broadband interests, to gradually deprecate "foreign" content, as much as all (other) carriers want to do, and to not deliver the best content, but only the best user experience. I understand that Google has to consider their growth, and their position against competitors, but none of them elided the slogan "Don't be evil!", and with the position of a market leader, there comes increased responsibility, too.

To me, this move indicates that Net Neutrality, essential for a "democratic" Internet, suddenly is not considered a value in itself by those big players, but only an instrument that may be used against the competition. I'd say that search (eg.) engines should be obliged to not discriminate against smaller websites with less-capable hosting, but exclusively rely on content-related factors instead. Their lesser visibility will impact search ranking, anyway, since these low-performing sites simply cannot be crawled as effectively and efficiently, as can be well-performing sites.

I'd like to take a moment considering the possible impact, political and otherwise, of this change in the ranking algorithm, and what it would mean if the tuning would be adjusted further, giving even more weight to speed. It would play more in favour of centralisation, restructuring the Internet some more from a level playground for all participants to a medium where ever fewer players set the rules for everyone else.

I hope that Net Neutrality can gain enough independent support to become not only the informal consent amonst old hands of the Internet, but be secured for all those who possibly don't even yet know what it is. But we, the users, need to make it happen. Please take the time to ask your delegates scrutinising questions, and vote accordingly.

External links:

Back to top



我找一位中国人把他上课我中文. 还是住在我的四旁 . 如果你有兴趣,请回答用下个表的时评.


Back to top