Tuesday, November 24, 2009

python and class methods

Yes, they are supported, but you have to use an extra magic function call:
classmethod = classmethod(classmethod)

Monday, November 23, 2009

my new book: Tarek Ziadé: Expert Python Programming

This book is a litte like like Pragmatic Project Automation for the python community. This book isn't really, what I was searching for, but actually it is much, much better. It provides me with a serious level of considering how to make a software project using python a success.

I think, it's a big marketing mistake, to print on the cover and certainly also elsewhere, that this book is targeted towards people with a "sound background in Python programming". I actually think, people with a serious background in computer science (maybe beyond the BSc/BA level) and some knowledge of the specifics of, how python implements the usual more or less "modernistic" (i.e. starting with Simula 67) progamming language features, certainly will gain good profit of enjoying this book. Do yourself a favour and get both, the paper book and the PDF! So maybe you can print one or the other page, and put it on your fellow project managers' desks.

(To be continued ...)

A note to my mates: yes, I got the PDF, and I also got the PDF of the PragProg book.

software documentation

From the book Expert Python Programming, "Documenting Your Project", "Use a Simple Style":

You are not writing fiction, so keep the style as simple as possible.
And with a few more words:

(Another author) made an analysis [...] to try to understand, why his books sold so well. He made a list of all best sellers in the marketing area and compared the average number of words per sentence in each one of them. He realized, that his books had the lowest numbers of words per sentence (thirteen words). This simple fact [...] proved that readers prefer short and simple sentences, rather than long and stylish ones.

using associative arrays in your code

How many lines of code does it take for your new piece of code, before you introduce an associative array?

How many lines of code does it take for your new piece of code, before you introduce a class?

Yes, I know, Bourne shell doesn't come with the concept of associative arrays, of course it also doesn't know classes or object orientation. Right, a simple 20 or 30 lines shell script for copying and renaming files may not have the need for associative arrays or classes. But if your script gets longer, pls rethink, whether Bourne shell is the right choice for your task, or whether you make really good use of ruby, perl, or python!

Your next steps may be writing unit testing and using continuous integration. It's not your customer, who should request it, it should be your serious professional style, your way to deliver proper services. If you are not familiar with the terms, look them up -- I provided you with proper links to interesting and informative articles.

how to abbreviate the word Character and how German programmers pronounce it

We know, that in a few "modern" programming languages the word "character" as an IT term gets abbreaviated as "char". Do you have any idea, of how many coders pronounce it? They pronounce it like the "char-" as in "Charlie". Why would actually anybody pronounce the abbrevation so much different to the unabbreviated word?

Tuesday, November 10, 2009

how to use UNIX tee to send output to more than one pipe?

I have a necessity for that usage, I googled for it, found an answer here on UNIX.com, but I thought, there might be something slicker. I got myself an account there in order to tell the initiator of that thread, what I am going to find out, but sadly enough, he got banned since. That doesn't happen too rarely.

I like UNIX man pages, and I thought, I should give "$ man 1 tee" a try. That pointed me to "$ info coreutils 'tee invocation'", and that instructed me to use "process substitution", a feature of modern shells. The notation is different, but it's still piping: ">( PROCESS_READING_FROM_A_PIPE )". And you can use it more than once on the process, that you want to read output from.

Now, that is seriously slick enough for me. Read the example there, it's really nice!

Added a note on en.wikipedia.org mentioning this insight.

It is rather tempting to think, that using process substitution you don't even need tee itself anymore at all, but just try yourself, it doesn't work!

SourceForge Inc changes its name to Geeknet

German Federal Cross of Merit for KDE founder

development of a child

I made a new and interesting experience with my 3yr old son last Sunday.
I was pretty strict and harsh and serious with him (o, how cruel can a father be?! (but self-critical as well!!!)), and he showed pretty good "taking qualities" (german: Nehmerqualitäten), but he still started to show, how much my appreciation means to him: he showed us, he is able to pronounce words with "R" properly now in German, "rot, rot, rot!" he shouted all of a sudden (that's the colour "red" in English), because until very recently he (as a Portuguese native speaker) used to pronounce it "bot", and it took me endless repetitions pronouncing it properly to him, that looked quite unsuccessful to me -- until last weekend. I am very, very touched. I am very proud of him.

P.S. Suggestions for better English always appreciated.

Friday, November 6, 2009

strangers contacting me on Live Messenger

On all of my MSN / Live Messenger accounts I disallowed, that people not on my contact list, can send me messages. Still I keep getting IMs from strangers. How come???

No, I didn't google for this phenomenon. Actually I'm not sure, how to express this with 3 to 5 words to be put in a Google search, so that I don't receive mostly irrelevant hits.

Actually I mostly don't use the Live Messenger client itself but pidgin. But of course: the client shouldn't make a difference there. (Actually it does, as I found out later during my research. See below!!)

Anybody any idea?

Update: now that I expressed this thing here, I was able to do a Google search (with the title of this story here), and found this. Didn't help me either, but maybe others will find it helpful.

Another update: looks like actually the client IM software needs to do the blocking, and I found the right settings in pidgin to do that. There is a privacy menu entry (Tools > Privacy), and you have to select "allow only the users on my buddy list" on every single account, if that's what you want -- and I certainly do.

Wednesday, November 4, 2009

traveling on public transport using an iPhone

In Hamburg (Germany) you can use mobil.hvv.de, in Berlin (Germany) you can use mobil.bvg.de.
For Berlin there also exists a very nice iPhone app by the name of fahrinfo, which I really make use of a lot.

how to log into your iPhone using the root resp. the mobile account with a well-known password

This article on h-online.com helped me to log into my iPhone via ssh for the very first time. Find the instructions especially here! I used it for changing those passwords immediately, and I also created a ~/.ssh/authorized_keys2 for user mobile. Creating one for user root did not work, even "$ man sshd_config" did not help me, I still have to log in using a password.

Sunday, November 1, 2009

sipgate's SIP client for the iPhone

sipgate.de re-announced their SIP client for the iPhone on the 2009-10-30.
Downloaded it, started it, nice.
It can of course make us of my address book on the iPhone.
I'm not sure, I would want to use SIP over UMTS (if they don't restrict that anyways as Skype does), but for telephone over WiFi, that's pretty nice.