Archive for the ‘Rant’ Category.

Learning German

Last week was spend trying to understand more about the German language. I’ve been attending the so-called intensive German course offered to all exchange students. The course is seven hours a day, starting at 9:15. As I’m not at all used to speak and hear German all day long, I’ve been really tired when I got home in the evening.

The course is a mixed experience… We start each day with an hour where we talk about grammatical problems. This usually means that our teacher gives us some exercises, and asks us to do a number of them. After 10 minutes he will interrupt us, expecting us to be finished. But I need much more than 10 minutes to go through these exercises, and so do many of the other in our class! He will then be talking about “interesting” parts of the German grammar, but that’s all theory — we don’t get to train it.

I find this a great waste of time, for I don’t learn anything when he just talks about the structure of “Nebensätze” or what not — I need exercises afterwards. And here’s the crucial point, which some might call naïve: I don’t want to do the exercises by myself when I get home. First of all I don’t have any energy for German grammar exercises when I get home, and second, when doing an intensive full-day course, then I expected us to be doing the work at the course. I don’t want to spend seven hours a day just to get pointers about what I could do when I get home.

In the other six hours each day we have mostly been fooling around. Each day brings a new theme, such as “Education”, “Emotional Intelligence”, “Ethic and the Society”, and so on. We then read a short text about the subject, and discuss it with each other at our tables. That’s all very fine if it weren’t for all the acting and presentations that we’ve made.

We have several times had to do small presentations about the subjects, and today we even had to pretend that we were guests in a TV show. I think these things draw the focus away from the subject of the course: learning German. We spend our energy thinking if sport or physics are a necessary part of a general education, we spend time thinking about our role as a wealthy manager for the TV show, etc.

I understand that we speak German while doing these things, and that we train with the language as we do so. But I really do feel that there must be a better way than this indirect way. And when we just talk with each other, then I’m afraid that we wont learn about our mistakes — I make lots of mistakes when speaking, and so do the people I’m speaking with. Do we get any better at German by exchanging errors like that?

Oh well… I’ll be there next week too. Hopefully that will be better, also because I’m attending a workshop where I’ll have a chance of learning a little bit of Swiss-German. I can already understand some of it, but it would be cool to understand more!

Kristian’s new blog

So, Kristian also decided to move his blog to WordPress: — the link in the sidebar is updated! He has his old posts there too, pretty cool.

Having gone from a simple home-made system based on HTML fragments, to a system with Wiki markup, and now to a dedicated blogging system using Markdown markup I now have posts in three formats. No two, since I’ve converted the HTML fragments.

I think we need a simple format to store posts in to avoid such stupid situations. This format could very well be an XML dialect, but that’s not the important part, the important part is to have a single format for blog posts. Posts could then be translated into whatever format your favorite blog requires, be it XHTML, Markdown or a Wiki markup format.

If this common format is an XML dialect it would be easy to parse, but tedious to edit — XML is not meant to be edited by humans. (Not that it’s impossible, using the nxml-mode for Emacs it’s not that bad.) So to make it efficient to we need to be able to map back and forth between the canonical XML format and a Wiki-like (or Markdown, call it what you want) variant.

Given such a format and solid conversion tools I hope that we can avoid parse errors like those I’ve written about before. And we would have a more versatile tool than what we have with XHTML, Markdown, Wiki, and all the other markup languages separated.

Problematic special characters

Using the Wiki-like markup system PHP Markdown is not without issues. Or rather, testing a little on the PHP Markdown Web Dingus (I wonder what a “dingus” is?) shows that it must be the way WordPress handles the data that causes the problem.

Take a look at this comment. The double-quotes are escaped with a backslash, why?! My guess is that WordPress is broken with regard to special characters. It reminds me of the problems I had when I was just starting out learning PHP. But please don’t tell me that WordPress has such embarissing mistakes! A system installed on more than 12,126 systems (as of February 17th 2005) should be better tested than this.

Parse errors…

While trying to put my PHP tutorial back online I have just spend at least half an hour fighting the markup language! The problem is the lack of tables in [Markdown][].

I wanted a table listing the operators in one column and their meaning in another column — a quite simple talk one would think, and something which I was able to do in PhpWiki with only a minor problem: I could not use || when describing the or operator, since the latter is used in the definition of the table itself.

With Markdown I had to write the table myself. No problem, I’ve written lots of tables by hand! But no, everytime I saved the page the closing table tag somehow disappeared. This messed the page up quite severely.

Next idea: make the table in plain ASCII. It wont be as nice, but it ought to work. But no, even within a code block, where the lines are interpreted literally, I got into trouble. The line with the < ate the following spaces.

These things are what I hate the most with all those PHP content-management systems: they are all so fragile! The parsing done in [Markdown][] is based on regular expressions, and so is the parsing in all other systems I’ve seen. This just doesn’t work reliably — my experience is that you either get strange results like I did, or that you get silly limitations, or you end up with both.

The limitations I’m talking about is when you in PhpWiki cannot apply formatting markup to a link. A quick test to show that it works with Markdown.

I believe that using stronger tools for the parsing would help with these problems — in particular defining a proper grammar and writing a lexer and parser would make things more robust. When people submit a comment with parse errors it would be up to the compiler to flag them as such. It wont be easy to make a compiler with good error-recovery for such a system.

But if it were done, then we would in effect have a system of writing valid [XHTML][] without all the tags — that is a worthy goal! And given such a precise understanding of the structure of the text, one could easily convert it into all sorts of interesting formats such as [LaTeX][] (for later conversion into good-looking PDFs) and ASCII (for inclusion in README files and such).

Looking at the source code for the [GNU][] Flex and Bison tools one sees that they are not exactly trivial to reimplement in PHP — far from it. But I still hope that they will some day either support PHP natively, or that we get another lexer/parser framework for PHP.

Ugly IE…

Transparent PNG I’ve just had the unpleasant experience of seing GimpsterDotCom in InternetExplorer — that browser cannot handle transparent PNG images, and therefore the little rounded corners that I use show up with a black background instead of the intented light-blue background.

”Please!” If you’re seeing those ugly black quarter-circles all over the place, then switch to a proper browser which will render the page and graphics as it is supposed to be rendered. Moreover, using FireFox will protect you against lots of nasty stuff on the web, and give you a quicker browsing experience. –Martin Geisler