November 14th, 2007
Although I’m blogging for quite a long time and I’m active in the German locoteam I haven’t blogged much about ubuntu so far. As a matter of fact I haven’t added myself to the ubuntu planet. However that will change now because of many reasons, one of them is that we are cleaning up some of the code that runs ubuntuusers and I find countless things that are worth mentioning.
But because the blog is quite high traffic and there are more Python or Ruby related posts than ubuntu related things I’ve only submitted posts tagged as “planetubuntu” to the planet. So it’s worth reading the blog behind that funny head too if you’re interested in one of those topics.
So: Hello Planet Ubuntu!
Tagged as: planetubuntu |
4 Comments »
One of the things I love about Macbook is that it has this nifty two finger scrolling enabled by default. But thanks to the awesome synaptics linux driver you can get that on any ubuntu system too as long as your touchpad isn’t too old. There are countless tutorials on that on the web, however there is one stupid pitfall.
If you enable two finger scrolling you will most likely hit a “feature” of Firefox. It will go forward and backward in history under some strange conditions. It may be useful if one can figure out how to trigger it, but the better way is to disable it like it’s on OS X. Set the following settings in your about:config:
mousewheel.horizscroll.withnokey.action = 0
mousewheel.horizscroll.withnokey.sysnumlines = true
Just for completeness here my xorg.conf settings:
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "MaxTapTime" "120"
Option "MaxTapMove" "150"
Option "VertTwoFingerScroll" "true"
Option "HorizTwoFingerScroll" "true"
Option "VertEdgeScroll" "false"
Option "HorizEdgeScroll" "false"
Option "TapButton1" "1"
Option "TapButton2" "3"
Option "TapButton3" "2"
Option "Emulate3Buttons" "true"
Option "SHMConfig" "true"
EndSection
November 13th, 2007 | Tagged as: planetubuntu, snippets, ubuntu |
10 Comments »
November 4th, 2007
I love Python but there are things where I look at Ruby or Java and want to switch right away. What do have Ruby and Java in common? Nearly all of their libraries follow the same function/method/class naming conventions. foo_bar_baz in Ruby and fooBarBaz in Java. In Python there we have that PEP8 thing, but not even the standard library is PEP8 compatible. Many people tell me that not having the same naming guidelines for all libraries is a problem. I would argue that different naming guidelines among different libraries is a bigger problem than different indentation etc.
The reason for that is that in Python we often subclass clases from other libraries. Just take the threading module as example. Now we are forced to use different names in your own libraries/code too. Now one has to start thinking about the names of methods. (Is is get_some_foo() or some_foo or getSomeFoo()). It becomes even worse if you use mixin classes with one styleguide in a subclass of a class with a different one. I’ve seen people using the `DictMixin` in classes with camel case method names. But even the lowercase names are not coherent. Is it iteritems or iter_items? This example might be answered easily because I never saw iter_items but I saw countless occurrences of both getcurrentuser and get_current_user.
The more different name styles in a code the more I have to use dir(), help(), external documentation or the ipython source introspection. And that’s not the fault of the library developers, it starts with the python language itself. The internal types are all lowercase although they are classes. It’s true that this is because of backwards compatibility (when dict, list and others were just functions) but a big language change like Python3 would have made changing some of those names possible.
</rant>
Tagged as: rant, antizen, python |
2 Comments »