May 2005


The cool new Nokia stuff is using DBus 0.23. It is a price that needs to be paid I guess to foster adoption but as someone who had to port a whole slew of apps from 0.2x to 0.3x I wish they had shipped with the newer APIs. My problem isn’t with the internals using the old API as long as the developers understand that it is going to have to be ported at somepoint. It is the fact that third parties start targetting it because the platform is out there instead of working with the newer APIs that gets me down. However 1.0 couldn’t be achived in a day so I am happy that developers are using the libraries and just want them to understand that the API switch isn’t a walk in the park. Hopefully we can get close to 1.0 by the end of GUADEC. That being said, if I have time during GUADEC I want to look at the DBus code in maemo and get an idea on how much work it would take to port. Cool stuff though. Hopefully I can win one.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

Actually just wondering when am I going to find the time to do my laundry before leaving for GUADEC Thursday morning. Or I can just go in my gym clothes and buy clothes there. I love European style. Well at least their shirts anyway. The pants are always too long and too tight.

12 Hour London Romp

A big crimp in my plans is that the tube stops around midnight on weekdays. The plan is to land around 8:25pm and get out of the airport no later than 9 on Thursday the 26th. We are going to take the tube in and head up to Maida Vale to look around my old neighborhood and make a stop off at the Warrington Hotel for some pints and perhaps a game of cricket (darts for those not in the know). After that we will head to the main cluster of bars and clubs around Piccadilly and Leicester Squares. I know there are better clubs elsewhere but this offers us the abillity to walk places even when the tube stops. Hopefully we will be able to find a club that is open fairly late though it is a weekday so… All I know is we need to be back at Paddington station around 5:00am so we can make sure we don’t miss our 7:40 flight out. Any suggestions on late night hangouts are welcome.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

My Lightning Talk on Gnome Session should make Joe happy. At Red Hat we had been working with Gnome Session to see how we could improve it and work around the limitations we had been seeing (such as hardcoding service startup). The code fell by the wayside as we were working on higher priority things for FC4. FC4 is frozen today so we have time to throw together a demo in the next three days. I think it is all pretty impressive and the implications are wider reaching than just gnome and the session since the same ideas can be brought to other levels.

I’ll leave it at that to get peoples appities wet. Come to GUADEC! hear the talks! Gaze in amazment of the two headed hound born with only one head or the legendary Esquilax, a horse with the head of a rabbit, and the body of a rabbit!

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

Chris Aillon got Slashdotted.

I love it when blogs stop being polite and start getting down to it ;-). Actually much of it just gets blown out of proportion. It is great when there are comments like “Wait for vendors? Then that is another day we remain vulnerable”. Hint, the bug has been there for much longer, another 24 hours to QA the beast is not unreasonable. Another hint, most people won’t even notice the new release within 24 hours. Having vendors be notified and giving them a reasonable amount of time to deal with it actually mitigates the risk. If the bug is already public that is another story. Security is a collaborative effort.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

I just compiled version 2.0.0 of Anjuta today, not to be confused with Anjuta 2/Scaffold though it uses a lot of the libraries and plugins that were developed for Scaffold. This is what Scaffold should have been but didn’t have enough momentum to achive. Congrats go to the Anjuta team. The interface is clean and uncluttered and the GDL windows are a dream to work with (the Gimp really should look into using the GDL for its docks). There are still some little annoyances and bugs that I will be filing, like the need for syntax highlighting themes in lieu of having to pick colors that suite my needs, or the fact that docks don’t save their hights and widths when they are iconified and then expanded. Another thing I would like to see is a context based layout switching mechanism. For instance when glade documents can be embeded into the documents dock it would be nice when switching to it the layout of anjuta changed to show me the widget palette and propery browser. When I switch back to a C document those would go away and the symbol browser would reappear. As always I would love to help out on this so if I can send a patch here and there I will. Here is a screenshot of Anjuta in action as a simple code editor.

Me bandaiding a gnome-cd deadlock
Me bandaiding a gnome-cd deadlock

Man Garrett

That is a worse accident then I got into. Good to see you and your wife are ok. Isn’t it weird how calm it gets once you relize there isn’t much you can do but ride out the event? I think people experience similar emotions in such situations. Again glad to see you are ok.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

It was pointed out to me that I skipped over the Nintendo Revolution. Here is a picture:

While the small form factor is nice I think Nintendo once again missed the boat. Not because it will not be a good system. Nintendo has the unique ability to create fun games that do not follow mainstream ideas. In fact I think a number of people in the office here at Red Hat will get the system. Where I think Nintendo fails is that they do not want to expand beyond their gaming roots. Where Nintendo gives you good games, Sony will give you emersive experiences. If you have ever played God Of War you might understand what I am getting at. That game played like I was in a movie. The Revolution is going to be a secondary system for most people in my opinion. This is especially true since they are the last of the consoles to come out once again.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

Both the Sony Playstation 3 and Microsoft XBox 360 were unveiled yesterday and I have to say it looks like Sony has got the lead in this one once again.

On design the PS 3’s sleek, almost seamless design just screems home entertainment hub.

The XBox by comparison looks like one of the Dell slimline cases I used to have at my old job, just in a different color. Most consumers I assume want something a bit less computer looking sitting in their livingroom.

To top it off the PS 3 is said to have twice the power of of the XBox 360 though raw numbers don’t always speak to realworld performance. I have to belive Sony knows what they are doing. After all they still outsell the XBox with a machine that arguably is less powerful. Combine a better looking and more powerful console and you have a clear winner. The next battlefront is price though I am sure I will have to wait over a year after release before either platform is down to my price point. Games I’m not worried about. I am sure both consoles will have a plethora of great titles.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

I was out last night with friends at the usual Wednesday night haunt, the Overdraugt. Brian Clark asked me a question that got me thinking. “What are those funny looking statements in your DBus python code, you know the ones with the @ symbol?”, he asked. I had assumed that programmers could figure that out, it seemed so natural to me. But, I remembered that Brian was a designer not a developer.

It is easy to forget because Brian does do development but unlike developers he could care less about minutiae of a perticular language. He just uses them to get things done which can often times be more effective than reveling over an elegent language construct. As developers we often forget or target audience should be people like Brian. It is one of the reasons languages like Visual Basic or formats like HTML became popular. It targeted the masses.

Targetting the masses doesn’t have to mean everyone and their mother is going to use it but one should always have the mentality that they are developing for people outside of their core audience. That is how one expand usage and by shear luck of the laws of logic, expand the usefulness of what one is developing.

Good API is one way to get there in the programming sense, but VB will never be accused of having good API. Another way to get there is good documentation. I have noted in past blogs that Python has excellent documentation contributing to its success (it also has an excellent API IMHO). Formal documentation is all well and good but one can often get lost if they don’t know what they are looking for. So to further make the DBus Python bindings slightly more useful and teach others about a fairly new Python feature I present my understanding of decorators:

J5’s Understanding of Decorators from a DBus Point of View

Decorators are Python constructs used to “decorate” functions and methods. At the highest layers they can be thought of as markers that provide extra information about the function being decorated. Decorators begin with the @ symbol followed by the decorators name. In DBus we have two such decorators. These are:

  • dbus.method
  • dbus.signal

These particular decorators can only be placed infront of python methods and not function because that is the constraints I placed on them.

Placing one of these decorators infront of a python method marks that python method as being exported as a dbus method or signal. Take this code fragment for example:

import dbus

class foo(dbus.Object):
    @dbus.method('org.FooInterface')
    def hello(msg):
        return 'hello' + msg


The hello method of class foo is now marked as also being a dbus method with interface “org.FooInterface”. Decorators not only tell the program what to do but they also provide uncluttered visual clues as to how a user can use the decorated method. So, if someone looks at the above example they can instantly tell that the hello method is exported over the bus. There are other ways we could have told the program what methods we wanted to export but none as readable as a decorator.

What is a Decorator Really (those who just want to use them can stop here)?

At the lowest levels a decorator is simply a function that takes a function or method as input and returns another function as output. Some other little bits go on in the background such as replacing the decorated function with the outputted function. What goes on inside the black box of the decorator is up to the developer. Decorators can simply return the function that was passed to it without modifying it. They can add metadata to the original function object or they could return a completely different function object.

The key to decorators is that they are executed when the function or method is parsed in the Python interpreter. This allows the decorator to modify the function before it is used. Take the dbus.Method decorator code as an example:

def method(dbus_interface):
    _util._validate_interface_or_name(dbus_interface)

    def decorator(func):
        func._dbus_is_method = True
        func._dbus_interface = dbus_interface
        func._dbus_args = inspect.getargspec(func)[0]
        func._dbus_args.pop(0)
        return func

    return decorator

When the foo class is parsed the method decorator gets called and the interface is sent into the function. We validate the interface and then return the inner function which we have conviniently named “decorator”. Once the method class for “hello” has been created it is passed into the returned decorator function. The decorator function then sets a couple of attributes on the function object itself and returns the original function. Should another function be returned it would take the place of the original. Normaly if you did that you would call the original function somewhere in the returned function but it really is just a normal python function so you can do whatever you wish. The attributes we set is later used by a Metaclass to create a list of methods that need to be registered and exported over the bus and to construct the introspection data. That is all there is to it.

Other uses for decorators is validating argument types, adding generic debugging to a problem function, adding logging or forcing security checks. Since at its core decorators are just functions that replace functions one can dream up many applications for their use.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

Donnie, good to see you taking an interest in Python. Dive into Python is an excelent way to get a hands on learning experience. Personaly I learned by picking up the Python Pocket Reference for O’Reilly. It is not the best refrence in the world since it lacks an index in the back of the book but it is small and easy to flip through. It goes through all the basics without loading you down with do nothing examples. Where it is lacking the python docs site more than makes up for it. I think that is one of the reasons Python has become successful is because it does have such great documentation. Which reminds me, I should start documenting the DBus Python bindings much better.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

I finaly got bluetooth working with my phone and Rawhide. It really shouldn’t be that hard but it is. Really all bluetooth devices should show up in networking like ZeroConf devices do. I don’t know if it is possible to browse files on a bluetooth device or pull from a bluetooth device (as opposed to pushing files) but it should be. I can see why bluetooth really never took off. I’m going to look into making the desktop work much better with bluetooth devices. If every time I walk close to my computer and my address book syncs with evolution I will be happy. It really should be as easy as associating two bluetooth devices and selecting what actions you wish to happen when the devices connect.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

Next Page »