whoami
Hey!
I'm Christopher. I am a software and technology enthusiast.
Besides fiddling with bits and pieces I enjoy having a social life and doing sports.
If you want to know more, there is a more elaborated About me page.
I just want to share the following video. Seriously, how awesome is this? (Click this posting’s title if you’re reading via a planet to see the video.)
That thing runs Gentoo.
| 1 comment | Jan 20, 2010 7:01:00 PM | multi-touch, nerdstuff, planet-pymt, planet-python, planet-ubuntu, technology |
For those of you who don’t know it, if something provides Multi-Touch input methods, it means that you (and potentially an almost arbitrary number of other people) can interact with the same device using as many of your fingers as you like.
This technique is relatively new to most of us and I have been blown away when I first saw a video of someone interacting with a so-called Multi-Touch table:
(If you’re reading this posting via a planet or feed reader, please click this posting’s title to see the videos on my blog directly.)
In case you like the python programming language, you might be as excited as I was to know that there’s actually a library that allows you to write multi-touch software yourself. This library is PyMT. It’s based on top of OpenGL and allows you to deal with multi-touch input events in a nicely abstracted way. PyMT is cross-platform, open-source and actively developed. It comes with many examples, a mouse simulator (in case you don’t have such a table) and (in the development branch) support for the new touchpads found in recent macbooks as well as other types of hardware (HP touchsmart, etc.). Here’s an old demo video that shows what PyMT is capable of already:
I was so impressed by what is possible that I started diving into the matter quite some time ago. I’m even building my own table at the moment. The thesis I’m currently working on also relies on PyMT. If you got an appetite, feel free to join us in #pymt on irc.freenode.net or the mailing lists.
In order to show you how easy it can be, here’s a quick demo I just wrote.
If you are interested in building your own hardware (yes, you can), let me suggest you take a look at the excellent NUI community. They have software, forums and even a book available for free for you to learn and explore.
| 12 comments | Nov 19, 2009 12:14:00 PM | multi-touch, planet-python, planet-ubuntu, pymt, python, technology |
During 2008′s Google Summer of Code I introduced a new storage abstraction layer to the MoinMoin wiki engine. This allows you to run moin on a variety of backends (filesystem, mercurial, etc.).
This year (2009) I participated again. My application contained three major areas of work:
The first two objectives were finished quite well. Two different pieces of middleware were introduced for both, the ACLs and the routing. You can now use several different backends in a simple or optionally fairly complex way. You could just use one single filesystem backend or potentially hundreds of different backends, each with different ACLs applied, and mount each one into its own namespace (you may be familiar with this concept from UNIX, where you can mount discs and such into arbitrary places of the filesystem tree).
In addition to that, ACLs have been refactored. ‘revert’ and ‘delete’ were removed (obviously you will still be able to perform the corresponding actions from the UI), ‘create’ and ‘destroy’ were added.
As for the SQLAlchemy backend, we do have a somewhat working version. Unfortunately it still suffers from severe performance problems. Originally I wanted to fix that after SoC, but real-life (bachelor’s thesis, etc.) caught me, so I will have to postpone that. If you have some SQLAlchemy experience and want to help out here (or with something else), you are very welcome to join us (#moin-dev on irc.freenode.net).
For an overview of what else has been done during GSoC 2009 on the storage side of things, take a look at the following resources:
Please keep in mind that this is still fairly alpha. Especially the UI is for developers and geeks only and will be redone properly (with Jinja2) before the release (help needed here as well).
Thanks to the whole moin crew and especially my mentor Thomas Waldmann for the nice and fun collaboration!
(Oh and – hopefully – hello planet python!)
| 0 comments | Oct 20, 2009 2:57:00 AM | coding, gsoc, MoinMoin, planet-python, planet-ubuntu, python, sqlalchemy |
We all know that one of the cool things that Python offers is it’s interactive shell that makes it possible to quickly test things. It’s included in every Python release and can be invoked by simply entering ‘python’ on the command-line. While this is great already, the official interactive shell lacks several features that would be convenient (such as code completion, syntax hilighting, pasteservice support…). IPython is an attempt to provide an interactive python shell with the same capabilities, but additional goodies. I was using it mainly because it featured code completion.
I came to the python support channel today to ask about some strange behavior I had observed. Consider the following snippet:
In [1]: class Foo(object): ...: def __getattr__(self, attr): ...: print attr ...: ...: In [2]: foo = Foo() In [3]: foo.asd asd asd In [4]: Foo().asd asd
Now this should of course print ‘asd’ once in every case. This is IPython’s fault and seems to be related to this bug report. When asking about this, somebody suggested bpython. I headed over to their page and was quite pleased by what I saw in their video. bpython features syntax hilighting, code completion, expected parameters, rewind and pastebin support. See for yourself:
| 9 comments | Jun 2, 2009 4:19:00 PM | bpython, coding, planet-ubuntu, python |
Update: The below no longer applies. A fix has been released. (So you can undo any ugly hack you used in order to make it work.)
Dear Python developers,
when upgrading to Ubuntu 9.04 (Jaunty Jackalope, which is to be released in 22 days from now) please keep in mind that python-virtualenv (the tool we all know and love) is broken. It still works with python2.5, though.
While trying to resolve this issue I had several ideas:
I am not sure whether this will wreak further havoc, so please be cautious. I hope that we can get this fixed until Jaunty is released. There is a bug report.
Just letting you know. Took me some time to realize.
| 6 comments | Apr 1, 2009 1:45:00 PM | planet-ubuntu |
This is just a short maintenance info. A few minutes ago I finished upgrading my blog (which is proudly powered by Zine) to the most recent available version (hg calls it tip). Since I was running quite an outdated version (some pre 0.1 alpha version) I had to convert a few things manually. From now on there will be proper support for upgrading all my Zine instances in one go painlessly. If you notice any remaining glitches that need to be ironed out, please add a comment to this posting.
I fixed some problem in Zine that was causing the Atom feed not to validate properly. I want to apologize in advance for any postings that might appear in your feedreader again. This won’t happen anymore but was inevitable.
(I usually don’t like maintenance postings on planets, but I want to check whether my feed still works. I will remove this posting from the planet after it has properly shown up.)
Happy new year!
| 2 comments | Jan 2, 2009 10:19:00 PM | maintenance, zine |
Just a few minutes ago the python blogging engine Zine, codename “Aldus”, was released.
Initially called TextPress, the project has come a long way already. Despite being a 0.1 release, it is quite powerful already. It is incredibly easy to write plugins for it. This is due to both, the clever design of the code and the choice of programming language (python). It is even easier to customize it’s look with a theme. You basically just need to change a CSS file.
I have been using the development versions for over a year already for several blogs and I am happy to see the first stable release. This blog is itself powered by Zine and I am looking forward to upgrading to the new version.
For further reference, see the official project page at:
zine.pocoo.org
Merry Christmas to all of you!
| 1 comment | Dec 24, 2008 5:15:00 PM | Python, zine |
One of my favorite games, Savage 2, is now available with no cost involved.
It has quite a unique gameplay and cannot be classified as belonging to a specific genre. The game is made up like this: There’s two teams fighting each other: humans and beasts. Each team has a headquarter the other team aims to destroy. (No surprises so far.) Each team has one commander and a bunch of “normal” players. The commander views the game from bird’s eye perspective like in Warcraft 3. The units he sees are partially under his control. The other units of his team are played by actual players. The players play in either first or third person mode.
It is a very strategic game and often one genius idea has a heavy influence on the outcome of the match. There’s quite a few more aspects I like about the game, but I don’t want to make this posting too long.
Just head over to the downloads section and get it for your architecture (Available for Windows, Linux 32 & 64 bit, OSX).
(I usually don’t do advertising for commercial products, but this one is an exception since it’s one of the better games for linux.)
| 9 comments | Dec 22, 2008 2:36:00 PM | games |
I have seen quite a few logos that look very similar or almost identical to the ubuntu logo. Let’s make a contest out of this and see who finds the most similar graphic.
This is the logo we all know:
The well-known logo of the Microsoft Alumni Network:
My current favorite (just discovered):
The logo of Pool Invest:
These are my candidates. Can you find others? (Logos of ubuntu derivates do not count!)
(Please note: The logos linked in this blogpost are trademarks of their respective owners. I am neither responsible for, nor affiliated with any of them. I am just linking them so you can have a good laugh. I am also not responsible for any of the content the linked websites contain. I am not implying that somebody copied or stole someone else’s property.)
| 13 comments | Dec 15, 2008 2:48:00 PM | no tags |
In this posting I want to explain a fundamental concept shared by many popular programming languages such as Python et al. Understanding this concept is key to working with objects, names and variables successfully. Those who don’t understand it often face difficulties at some point, and many questions asked on support channels reveal that not everybody knows about this. After reading this posting you will (hopefully) have understood why things behave the way they behave, so let’s dive in.
Consider the following code (if you want the code beautifully colored for easier reading, please visit my blog directly rather than reading through a planet):
>>> class Foo(object): ... def __init__(self): ... self.my_attribute = "some string literal" ... >>> foo = Foo() >>> bar = foo
This first defines a class Foo and an attribute self.my_attribute. (You can tell that this is an instance attribute because the definition takes place in the __init__ method. We will cover that in a later blog posting.) We then assign the string literal “some string literal” to the attribute. Now, every instance of class Foo is initialized with an attribute my_attribute with the value “some string literal”. After the definition of the class, we create an instance of it (By calling something Java folks would refer to as the constructor. Take note of the parentheses.) which we call foo. The next line is what is most interesting: One might say “bar equals foo”, but that is not as precise an idiom it should be. Let’s go on and see what happens.
>>> foo.my_attribute 'some string literal' >>> bar.my_attribute 'some string literal'
This is easy. We just get the value stored in my_attribute. No surprises here. The next step, however, may be confusing to some.
>>> bar.my_attribute = "it's a trap!" >>> foo.my_attribute "it's a trap!"
We assigned another string literal “it’s a trap!” to bar.my_attribute and for some reason (which I will explain shortly) foo.my_attribute changed to the very same string as well!
When you instantiate an object from a class, there is no doubt that you need memory for your object (even if you didn’t specify any attributes on that class/object) to be stored. Upon creation of an object, that object is stored somewhere. (How this happens exactly is dependant on the languages implementation and is of no interest for us.) Consider this example:
>>> Foo() <__main__.Foo object at 0xb7e791ac>
If you read the above carefully you will have noticed that this, again, creates an object of class Foo (indicated by the parentheses). The instance of Foo we just created lives somewhere (albeit, in CPython, only for a limited time as we shall soon see). Now, if we wanted to alter that objects my_attribute, how would we do it? The answer is: We can’t (I am simplifying here). “Why can’t we?” I hear you say. The explanation is, that we did not bind the object to a name. Binding an object to a name usually means selecting a unique identifier (like the very unique word “foo”), creating an instance of a class as we did above, and putting the = operator between those. Like this:
>>> foo2 = Foo()
We now have bound (a new!) instance of class Foo to the name (or reference) foo2 (Check your languages specification to see what is allowed as a valid identifier). We can now do:
>>> foo2 <__main__.Foo object at 0xb7825e0c>
As you can see, foo2′s differs from the object we created above (the one that we didn’t bind to a name), because it actually is a new, different object. (The hexadecimal value 0xb7825e0c tells us where this object is stored but does not matter much. You will see other values for your machine.)
Let me visualize this (without the objects we created when we began):
As you can see, the object we created last is bound to the name foo2. The other object is not bound to any name and thus not reachable for us.
You can now understand what happened when we initially did this:
>>> class Foo(object): ... def __init__(self): ... self.my_attribute = "some string literal" ... >>> foo = Foo() >>> bar = foo
On the very last line, we did not create an instance of class Foo, but instead just created another reference for that object. The very same object is now reachable with either name, foo and bar. Hence, if we change foo’s attributes we will alter bar’s as well and vice versa.
If you want to check whether two names are referring to the same object, you can use the is operator in Python like this:
>>> foo is bar True >>> bar is foo True
Here you are checking for identity of both objects. Don’t confuse the is operator with the == operator (in Python), which checks for equality but not identity! (This is different for other languages like Java!)
Doing
foo = 5
binds object 5 to foo, represented by the integer literal 5 (Yes, even ints are objects in Python). For performance reasons Python does not create a new object for every integer you use, but rather uses the same object for the same integer. With this, you have lost the (potentially last) reference to the object (to which the name foo was bound to just a minute ago).
If you want to delete your reference, you can just do:
del foo
This does not necessarily delete your object! It only deletes the name. If, how and when the object itself is deleted is completely dependant on the implementation of Python you use. (This is said to be an implementation detail.)
Accessing a name after it has been deleted results in the following traceback:
>>> foo Traceback (most recent call last): File "< stdin >", line 1, in < module > NameError: name 'foo' is not defined
Objects do not know what names they are bound to, if any. They actually don’t even have a name. The names we defined are just references to the objects.
You can reach objects not only by name. Consider the following example:
>>> a = [Foo(), Foo(), Foo()]
Here we create a list (an object itself, by the way), create three instances of Foo and put them into the list. Note that we did not bind any of the objects to a name, except for the list, which is bound to “a”. The three instances are reachable via that name. They are said to be contained by the list and thus still reachable.
>>> a [<__main__.Foo object at 0xb7cf9f4c>, <__main__.Foo object at 0xb7cf9e2c>, <__main__.Foo object at 0xb7cf9eec>] >>> a[0] <__main__.Foo object at 0xb7cf9f4c> >>> a[1] <__main__.Foo object at 0xb7cf9e2c> >>> a[2] <__main__.Foo object at 0xb7cf9eec>
Names have only limited visibility. The underlying concept is called the namespace. (I won’t go into more detail here. Just that you got something to search for.)
By now you should have understood the basic principle of object creation and name binding in languages like Python. If there are any questions remaining, feel free to drop a comment to this posting. If someone comes up to you and says “Take a look at my shiny Python variable!”, always keep in mind that it is actually a name, bound to an object.
Further reading:
| 2 comments | Nov 22, 2008 1:17:00 PM | Coding, Python |