Tag: software development

  • Chipcard Woes

    One of my customers, a large dental practice, had a problem from time to time when reading Krankenversicherungskarten (German health insurance card, KVK). The insurance number got all garbled up, which led to problems when reading the patient’s insurance data into the health care application. After their sysadmin and I analysed the situation it seemed…

  • Programming Warts Wiki

    There is a new Programming Warts Wiki. I think this is a great idea, since it encourages discussion about the various advantages and disadvantages of different programming languages and may help to remove some kinks in those languages.

  • setuptools breaks PYTHONPATH

    setuptools and egg files are a great way to distribute Python packages and programs. But today I stumbled over a really braindead design decision: setuptools overrides Python’s standard module search path algorithm in a very inconvenient way. Normally, when Python looks for a module or package, it first looks in the current directory, then in any…

  • gnome-keyring with Python

    The documentation on gnome-keyring I discovered helped me to access it successfully with Python. I’ve written a small module that fetches and stores a username and a password for some server. Some notes: The attributes are freeform, but there a some common attributes for network hosts. These are: “user”, “domain”, “server”, “object”, “protocol”, “authtype”, and “port”. Actually there is…

  • Documentation for libgnome-keyring

    I was trying to find documentation for libgnome-keyring for little project I am writing, which accesses a password-protected web service. Unfortunately there is no real documentation for it. No API documentation (well, there are a total of two functions documented), no tutorial. Finally I found this document in GNOME’s Subversion repository. Better then nothing, but why isn’t this…

  • Selection in GtkTextBuffer

    I’ve recently played around with GtkTextBuffer. It’s a rather nice text editing widget (or rather widget part). Unfortunately it misses one functionality, which is also missing from GtkEditable derived widgets: A signal for selection changes. There are two workarounds: You can setup a notification on the “has-selection” property like this: buffer.connect(“notify”, on_buffer_notify) def on_buffer_notify(buffer, prop): if prop.name ==…

  • Java File API

    I don’t like Java’s File API. It’s main problem is that is mixes several responsibilities into one class. One responsibility is handling of “abstract” file and path names, i.e. operating system independent file names. The other responsibilities are all file system related: Querying file meta information (access rights, access times, file type), creating files, and listing…

  • Java: Iterators are not Iterable

    This is something I stumbled across multiple times now in Java: Iterators are not Iterable. Java 1.5 introduced the foreach statement, which allows easy iteration over collections like this: for (MyClass item: myCollection) { doStuffWithItem(item); } For this to work class MyClass must implement the Iterable interface. This interface defines just one method that returns an Iterator: Iterator<T> iterator(); This works fine in many cases.…

  • JavaScript Includes Revisited

    I’ve given in in the JavaScript and Modules matter. I’m doing now what all the cool kids are doing: Using XMLHttpRequest synchronously to load external JavaScript files. This has the advantage that it works synchronously, a very important thing for includes. Therefore I don’t need callback and moduleLoadedhackery anymore. Also I have sensible error checking, i.e. I can notice…

  • Porting JavaScript to Internet Explorer

    While porting a small AJAX application I wrote to Internet Explorer, I encountered a few problems: IE doesn’t like <script> tags without a matching closing tag. This is especially a problem if you use the src attribute and try to use an XHTML-like closing tag like this: <script src=”…”/> In this case IE doesn’t draw anything at all, since…