Older blog entries for bernhard (starting at number 22)

Dancer, I don't think it's all that surprising that there are many teens in the free software community.

I bought my first computer in 1985 when I was 15, an Amstrad CPC464 (roughly comparable to the C64 and it was actually called Schneider CPC464 here in Germany). One thing I liked about those computers was that they were simple enough so that you could understand how they worked and how the pieces fit together.

With a Windows PC this is practically impossible, given the Windows policy that the users are stupid, don't know what they do and that it's good to hide information from them. Add to that that even Microsoft doesn't seem to know how everything works in their own operating systems.

Linux and the other free software OSes are much more complex than those 8bit home computers, but with their modular nature it's still possible to understand how things work in principle and the availability of the sources means that you can delve into the details as deeply as you like. They also don't hide any information that might be interesting to a user. That's a very intriguing thing for an inquisitive newbie. If I were a teenager today, I'd probably be involved with free software in some way too.

Sketch

I've begun to implement a meta-data facility to make it possible to attach arbitrary data to an object. This is effectively a dictionary. This feature poses some interesting design problems:

  • How is the data saved and loaded?

    This is easy to solve by restricting the keys to strings and the values to a subset of builtin python types. It's possible and not even difficult to extend that to class instances if they implement a certain interface.

    I could use pickle, but that would make the file format Python specific.

  • What happens when you duplicate or copy/cut and paste an object?

    The easiest solution is not to copy the data at all. The duplicated or pasted object will have no meta data at all. This is obviously bad, since the user would rightly expect that cut and paste preserves at least some of the data.

    The next solution is to make a shallow copy of the dictionary. This can lead to subtle bugs because objects can end up sharing mutable meta-data. Always making a deep copy is not useful either because there might be cases where that sharing is desired.

    So perhaps the method that attaches a piece of meta-data to an object should have a third parameter in addition to the key and value, that describes what should happen with the data. That parameter would simply be a callable object that is called with the value and returns the value that is to be used in the copied graphics object.

    This solution would be very flexible but it also makes saving and restoring the data harder.

In other Sketch news, I've received Italian translations for 0.6.x.

Sketch is also mentioned in the current issue of c't in the SVG section of the article on internet multimedia standards.

Movies and Books

I've seen several movies lately, including Lola Rennt, Chicken Run and the Wallace and Gromit films A Grand Day Out, The Wrong Trousers and A Close Shave.

I've also read quite a bit and finished Neal Stephenson's Zodiac (recommended by the other bernhard) and Good Omens by Terry Pratchett and Neil Gaiman which I've been meaning to read for a long time now.

Today's my 31st birthday! I feel old. Most hackers here on Advogato or in the GNOME crowd are apparantly in their early twenties or even in their teens.

Sketch

As planned, I've released Sketch 0.6.8 on Saturday. The lack of outraged bugreports seems to indicate that it wasn't such as fiasco as 0.6.6. :-).

What I forgot to mention is my last diary entry: Sketch will be in SuSE Linux 7.0. It's also in Debian 2.2 which was released today (What a birthday present! :-) ), but that's not really news, because it had been in unstable since early 1999, which makes Debian the first Linux distribution to adopt Sketch.

HHLUG

On Sunday, I went to the monthly meeting of the Hamburg Linux User Group. There'll be an install party on 9th September.

Long time no diary. It seems my diary is turning into a mensary. I don't know if that's a real world, but a log that's updated about once a month could probably be called something like that.

Sketch

I've created a new Sketch mailing list at SourceForge because the old mailing list which was run by Olof Kylander at Frozenriver was down. In fact all frozenriver servers seem to be down. Nobody seems to know what happened to Olof and Karin and Frozenriver. I heard some rumours from a Gimp developer, but no real information.

Fortunately the transition went quite smoothly. As luck would have it I had a quite recent list of subscribers of he old list, so I didn't have to start from scratch again.

On the development side, the next stable version will be released tomorrow, hopefully. It would be mostly a bugfix release with only a few minor new features if it weren't for a slightly improved SVG export filter (it handles some gradients now) and especially the new PDF export filter. Thanks to ReportLab, I was able to implement it with just about 300 lines of application specific code.

I've also started hacking on a PDF import filter for Sketch. It already works to some degree on the PDF files generated by reportlab, but its overall desing is still in its early stages and it will take some more iterations before I feel I can let it loose on the public by checking it into CVS.

Reading

I've been rereading parts of Goethe's <it>Faust</it> in recent weeks. I read it for the first time after I had seen the Gründgens Film in a cinema in Göttingen in IIRC, 1990 or 1991.

I'm not sure whether it's good or bad that we didn't read <it>Faust</it> in school. I mean, I would probably have liked it much more than <it>Iphigenie</it>, but OTOH, having to read something takes away some of the fun of reading.

Anyway, <it>Faust I</it> is probably the most often quoted piece of German literature. Some cool quotes:

Mephistopheles:
Der Geist der Medizin ist leicht zu fassen;
Ihr durchstudiert die groß, und kleine Welt,
Um es am Ende gehn zu lassen,
Wie's Gott gefällt.

Mephistopheles:
Die Mädels sind doch sehr interessiert,
ob einer fromm und schlicht nach altem Brauch;
Sie denken: duckt er da, folgt er uns eben auch.

The Coin Puzzle

To make it a little more difficult, try not only to find which coin is different, but also whether its heavier or lighter than the others. All with at most three weighings.

It's possible. I've written a Python program that demonstrates the algorithm (or at least one possible algorithm, there might be more). Here's a gzipped base64 encoded version (to avoid spoilers):

H4sICNFblDkAA3dlaWdoaW5nLnB5AL2WS4/aMBDH7/kUI1YI0hqUB2/tom572V6r3hCqAjHEUtZB
jrOo/fS1YwLBcXgpLYeQ2J6fZ/6ZmfgJ9oxwjimsfsNXzGgUsBDeMPuTbOF5dRj4kqWYpf00ydga
bxK2xX2K+RyB6/Zes23Pcxynbz3Bz4iksE5CDOJ/l61isoYweQ8I7VtWiDewx2QbddcJoSmCGG84
AiZGuD2zQPz2MbyAk9+KXYAAofkqNXtcIS6fIYcsyFIZsqphDi5ZyiXiolkyzDNGJbInZpWXG0LD
X3KV8rRwzpWAcgBdRyiAwEPg2+JpgGCIYIRgbNu5BdnkRsKzkhteHUUiJgim4sk5AAqIp0FykG8A
SYbropJ5gfANCPnbMUI5dF7jWOkCUfCBgUcY0uAdqw1458wMxwo4v8D7JlgiO2QexJKAmc5I8S3G
EQ4+SNm4amgQYpILMTXp4JndviRRxTOnNqyr8uis6RWUSSWdMblT5ftjrbyFh2KdXEHdEuu0wji3
qy0vWZwyKby8QmWdPVZjvixvWWWyYqvp5cJzfXoZp/QI/QYyYlyr9KWMuMm9cQPu+TdW9lFQCGgo
35C8Fe1dDM5Pg8bcM3ZHGBU9VntzxWZevQbXikaPsb71neK9IruOvNx2FLJOfp01erAWH5Khdh+1
150yjBqUob67mRmGtBqUPt3/Pq2GzafVoEE9vf+UVsPm08prUIbBmXvW6Uga0C3uut7hRCnH93K8
2xOfE9c+wdVR7AUWzhI+geudT4izq0xDS9v6O91lfAaQu9AOpQ/ttANt6BLV/loHl1ri9hBpy17s
l7ZO+oHTLOazDjpO6EficwvrL7DtaHtHDAAA
LinuxTag 2000

Went to the LinuxTag in Stuttgart this weekend. This was the first big Linux event I attended and it was a lot of fun and I got to meet quite a few people I only new through the Internet.

One of them was Bernhard Reiter from Intevation and FFII who gave a talk about free GIS software. I knew him as a Sketch user and he thinks Sketch would be a good basis for a free viewer of geographical data. Let's see how that'll work out.

I also talked with Simon Budig about possible cooperations between Sketch and GIMP. The reorganizations planned for GIMP 2.0 may provide a good opportunity to functionality that's useful for both projects, such as the color selectors or gradient editor, into libraries that both programs can use.

After the official end of the show on Sunday I had a conversation with Michael Meeks and a few of the other GNOMErs who were still there about Sketch, libart, the GNOME canvas, Bonobo and other things. Somehow I feel that I'll have to look into bonoboizing Sketch as soon as I find the time.

RMS gave a keynote on Saturday. He didn't say very much that I hadn't already read somewhere but it was still very interesting and entertaining because I hadn't seen him before.

After RMS' talk the show was over for the day and the stairs back down to the show floor were blocked by security guys, so I couldn't get back in to get to the party that the other Bernhard had told me would be going on. Fortunately, there was a side entrance that was still open and they didn't have any controls there, so I could sneak in even though I wasn't an exhibitor (is that the right word here?). The party was fun with free beer, free Würstchen (although I was too late for those :-( ) and live music.

Sketch

I've released a new development version of Sketch on June 24th. It has one feature that I haven't seen anywhere else before. You can not only have multiple views for one document but also multiple editors. The difference is that if only create new views they share the set of selected objects, if you create new editors they manage their own selections. I have no idea yet how useful having multiple editors really is and the current implementation has some limitations when it comes to editing bezier curves, so I may take this feature out again before 0.8.

The translation of the French user documentation is underway now and I've seen the first translated sections. It looks good so far.

LinuxFund

LinuxFund.Org (the Tux credit card guys, not to be confused with linuxfund.com) started the beta-test for developer grants. I registered an account and a few hours later was informed that I was one of the first five to do that. Wow.

I want to apply for grants to help with Sketch's development, but when you want to submit a project you have to accept their "Grant Submission Agreement" which seems to state that grants are only available to U.S. residents. This is perhaps understandable in the current stage, but I sure hope that this restriction will be lifted in the future. After all, in their FAQ they state that they want to "be a multinational foundation with fund raising and development grant activity all over the world". I'll have to ask them about this.

No entry in more than two weeks, so this summarizes what's happened in that time.

Kirschblüten Feuerwerk

Friday evening was the annual (?) Kirschblüten Feuerwerk (Cherryblossom Fireworks) here in Hamburg. It's sponsored by a Japanese trade organization (or something like that) and takes place above the Außenalster (Outer Alster), a lake in the heart of the city.

The fireworks were really beautiful. The only thing that literally stood in the way of properly enjoying this were all those trees and bushes that line the Alster. The best place to watch this is probably on the water.

It was way better than the "Millennium Fireworks" but that's mainly because back then the smoke from all the private fireworks that had been going on since around 11pm had gathered into a cloud right above the Alster and blocked the view.

Hacking

Not as much as I would have liked, but I got some work done on Sketch to reactivate the localization code in the development branch and I started with the fill dialog.

When I started the 0.7.x development series, I wanted to have a new set of dialogs that would allow the user to make better use of Sketch's style capabilities, but at the moment I think it would be best to copy more or less what's available in 0.6.x and add really new interfaces later. Completing the port to GTK is more important than a completely new style interface and I'm not sure just what that new interface should look like.

Wrote a CipherSaber in Python.

Advogato

God, what are your future plans for dna.c?

Sketch

Friday night I Released yet another stable version, 0.6.7, because of the file loading bug. The bug is grave enough for this, even though it's only a one line fix.

ILOVEYOU

Many articles on this email virus/worm correctly state that in principle it would also work on Linux, if the mail clients would let the users execute attached scripts too easily. However, then they go on to say that at most it could destroy that user's files but wouldn't harm the rest of the system.

But the user's data is very likely the most precious data on that system! Well, that's the case for me at least and probably many other people. Imagine the virus would delete the TeX-files for the thesis you have to turn in tomorrow or the source tree for your latest but yet unpublished program! This kind of data is hard and maybe impossible to recreate unless you have recent backups (which everybody hopefully has) while restoring the operating system from CDs/Internet only takes a few hours.

What can protect open source system from mail and macro viruses is that open source programmers probably won't make insecure settings the default and put suitable warning messages into the program.

Microsoft defends itself saying that the customers want programmable applications. Scriptable applications are all well and good, I'm using the perhaps most flexible and scriptable mail program existing for Unix myself, but that's no excuse for making the default configuration so insecure. I'm sure gnus will never automatically execute an elisp script just because it's attached to a mail and I happen to select it, unless I explicitly configure it that way, in which case I get what I deserve.

I haven't seen the virus myself, but from what I read, the name of the VBS file ended in .txt.vbs. This is a clever trick, because apparently many mail programs on Windows don't display the file extensions so that the file name the users saw looked just like a normal txt file. These are usually opened in Notepad, so double clicking on it doesn't seem to be a security risk. Hiding information from the user can be a dangerous thing.

Anyone got a spare brown paper bag? They're not very common here in Germany...

Sketch 0.6.6 contains an awful bug. It can't load any vector graphics files because the plugins aren't initialized properly. Unfortunately this was hidden on my development account because my startup script did some things that hid this bug and even my test account had this.

I thought the pre-releases would help find this kind of bug before a release, but even though this bug was present in both 0.6.6 pre-releases nobody reported anything about this.

On a lighter note, I read the archives of the gnome-icon-list this evening. I had heard about this list from Fred yesterday, who said that in early April he had announced the clip-arts he and the co-authors of the Sketch documentation had drawn (in Sketch, of course). The clip-arts were very well-received ("Dudes, these ROCK. I love them", tigert), as was to be expected.

Since the standard format for vector graphics in GNOME will probably be SVG -- Raph is working on an SVG-renderer for Nautilus after all -- I'll have to improve the SVG filters sometime soon, unless somebody else steps forward.

Hacking

Spent a few more hours on AutoTrace. Martin had fixed most memory leaks, but there were still a few more present. Now there are only 6 left. At least this number is independent of the input image, which probably means that they're somewhere outside the actual tracing or curve fitting code and hopefully easier to find.

I also discovered that the number of mallocs I mentioned yesterday wasn't correct. Some mallocs were counted twice. The real number of mallocs for that image is 1 127 388. I've now replaced the hacked malloc/free/realloc counting code that only counted calls through the macros autotrace uses in most places with a cleaner implementation that uses the hooks provided by glibc. That way I really get all calls and it requires far fewer changes in the sources.

Still, the code is decidedly ugly. In this particular case, open source doesn't mean better code quality. These memory leaks probably weren't a problem in limn which was 'only' a command line tool that was executed over and over again. But some people want to use AutoTrace as a library someday, so they have to be eliminated.

AutoTrace is in what you might call the 'bugly duckling' phase of development. It's buggy and maybe a bit cumbersome to use and somewhat limited in what it already can do, but it has the potential to someday turn into a beautiful swan. Of course even with a swan gliding majestically through the water you normally don't see the hectic paddling underneath...

Anecdote

This evening some guy started singing a capella (does one say that in English?) in the street right in front of my window. Another guy was filming him with a video camera. His intended audience were apparantly some peope in a flat above mine.

Among others he sang Tom Jones' "Sex Bomb", Sinatra's "My Way" and Presley's "In the Ghetto", some of them slightly modified. He was quite a good singer good even.

Hacking

After a few last minute bug fixes and changes, I put the last finishing touches on Sketch 0.6.6 today and released it. I had some problems with the web-page update because SourceForge wouldn't let me log in. A few hours later it worked again, though.

A couple of days ago, Martin Weber contacted me about adding color support to the output filters for the next release of AutoTrace, so modified the svg, sk and eps/ai filters accordingly. It took just a few lines.

He also asked me to look for memory leaks and as it turns out the situation is awful. On one particular image, autotrace makes 1 452 546 mallocs, but only 290 458 frees. Most of the leaks are hard to find because of inconsistent use of malloced vs. automatic variables and strange data-structures, e.g. there's an array of structs that also seems to be a linked list.

This isn't Martin's fault, however, because these leaks are already present in limn, a part of the GNU fontutils on which autotrace is based. I gave him the advice to reimplement the algorithm from scratch. That seems to be the sanest solution.

Maschinen-Menschen Mensch-Maschinen
(Machine-Humans Human-Machines)

That's the title of an article in the current issue of c't. It contains reports from Intel's Computing Continuum Conference and Hofstadter's Spiritual Robots Symposium. I had read about Hofstadter's April 1st event on Slashdot, but the Intel one was new to me.

Especially noteworthy for me as a python-fan is that among such luminaries as Bill Joy and Hans Moravec it also mentions Guido van Rossum and his Computer Programming for Everybody.

Terry Pratchett

There seem to be a few Terry Pratchett fans on advogato. I haven't got the time to read all the diaries here, but at least mjs, stephane and dria have referred to him or his books.

For those who don't know him yet, PTerry (as he's usually called on alt.fan.pratchett or alt.books.pratchett because of Pyramids) is mostly known for his Discworld books, a series of at the moment 24 volumes of comic fantasy. The first few were just fantasy parodies, the newer have grown into their own special brand of comic fantasy.

I'm not much of a Fantasy fan in general, although I read and liked Tolkien, but the Discworld isn't really Fantasy somehow. It has lots of popular science and technology terms strewn in like "trouserlegs of time", "quantum" and the rubbersheet model of gravity. Then there's Hex, a computer built with among other things an ant-farm (complete with "Anthill inside" sticker) in the High-Energy-Magic building in Unseen University. One sentence I particularly liked in Witches Abroad is "The witches flew along a maze of twisty little canyons, all alike"...

Photogenics

Another beta of a commercial graphics program was released on Monday, this time it was Photogenics, a pixel oriented painting program. I downloaded and tried this one as well.

The archive was amazingly small (ca. 360K) but that seems to be mostly because it's a very limited demo/beta version. It only has very few import filters, only one export filter (jpg), and many of the painting modes are not available.

The UI seems to some bugs (e.g. popups pop up in the wrong position and you can't use them correctly) but the program appears to be very stable and fast.

So far, I haven't seen anything that you couldn't do with Gimp, although drawing new images seems to be easier in Photogenics, but I'm not much of an artist, so that's not all that important to me.

There are two things that I find interesting in Photogenics. One is the way drawing is handled. Drawing effectively selects pixels and applies an affect to the selection. The two stages are actually completely separate. You can change the effect thats applied even after you've finished drawing. That's pretty neat and I think GIMP should have something similar.

The other interesting thing is how undoing drawing works. Photogenics doesn't just save the pixels that were affected, it remembers the actual strokes you did with what tool and settings. This has the big advantage that it takes less memory but it also means that undoing a stroke can take very long because all previous strokes have to be repeated.

It'll be interesting to see how Photogenics can compete against GIMP and PhotoPaint which Corel wants to make available for free download.

Diaries

schoen, your diary entries are beautiful[1] and I for one like to read them. They tend to be quite long, but I don't mind. Nobody's got to read them if they don't find the time. And even on the recent diaries page, its easy to skim over it.

On licenses and requirements to comply with applicable laws: isn't that requirement always implicitly present? I mean, copyright and contracts are regulated by law and laws can state that certain clauses in contracts or license agreements are not applicable even when they are written into the contract/license.

Of course, there might be differences in this regard in different parts of the world. But that's a more general topic. It's not immediately clear that a license that was written with US law in mind also works as intended with, say European law. Anybody interested in how compatible the GNU General Public License in praticular is to German and European law should have a look at the current issue of c't or at IfROSS (Institut für Rechtsfragen in der Open Source Software)

Feetnotes:

[1]Well, OK, I probably have to explain this pun[2]. The German word for beautiful is "schön" and if no "ö" (o umlaut) is available it can be replaced with "oe".

[2]That's something PTerry's German translator likes to do sometimes even when it's not necessary. In Reaper Man, for instance, there's the following exchange between Windle Poons (a recently deceased Wizard who can't pass into after life because Death has been retired...) and the Librarian (who was turned into an orang-utan by a magical accident):

'Olé'
'Oook?'
'No, Not "with milk".'

In the german translation theres a second sentence in the last line: 'You mean "au lait"' (In the German version it's in German, of course :-)). Aaaarrrgggghhh. I'm glad I read it only after the English original and that it was the only Pratchett translation I read. I was just curious how good the translation was. The other volumes don't seem to be much different.

13 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!