Skip to content


Interesting though

I’m at the ProFOSS virtualisation event currently. This morning there was a nice talk by Tarry Singh in which an interesting (and, imho, correct) thought was raised:

What matters is Usable Source, a mix of Open Source and Closed Source.

(Disclaimer: these aren’t his exact words, they might be rephrased a little, but you get the idea.)

I kinda like the idea :-)

Posted in Technology.

Tagged with .


Pyparsing introduction: BNF to code

After reading my previous post, you should have a pretty good understanding of what a BNF definition is all about. Let’s put this theory into practice, and write some basic parsers in Python, using Pyparsing!

Pyparsing allows a pretty one-to-one mapping of BNF to Python code: you can define sets and combinations, then parse any text fragment against it. This is something very important to notice: one basic BNF definition can (and should) be reused: if you once wrote a BNF definition for an integer value, you can easily reuse this definition in, eg, a basic integer math expression.

The most basic element using Pyparsing is a Word. In it’s most basic form this is a set of characters which will match any arbitrary length string, as long as the characters in this string are part of the Word character set.

A little introduction example: let’s write a parser which accepts words consisting of small-cap characters, or sentences which consist of words separated by spaces. First we define a formal definition using BNF:

Continued…

Posted in Development.

Tagged with , , , .


Text parsing, formal grammars and BNF introduction

Parsing input is something most developers run into one day. Parsing binary input can be pretty straight-forward, as most of the time you know the format of the input, ie you know what to expect: if you receive a message of 10 bytes, the first byte could be a message ID, the second one the payload length, third one message type ID, and others message content. Pretty easy to handle.

Parsing human-readable text can be harder though, as human beings tend to be less strict when providing input (eg whitespacing), you can’t ask humans to prepend strings with their length, etc.

There are several ways to handle text input. One well-known method is using regular expressions with matches, but writing regular expressions which are able to process not-so-strict input can be pretty though, writing expressions to parse large bodies of text is hard, using sub-expressions can become pretty complicated,… Overall regular expressions usually involve quite a lot of black magic for the average outsider.

xkcd comic: Regular expressions

Luckily, there are easier methods to parse text input too, of which I’d like to introduct one: a Python module called Pyparsing, which can do BNF-style text parsing.

First of all, let me explain “BNF”. The Backus-Naur Form, aka BNF, is a metasyntax you can use to express the grammar of a formal language. This might make no sense at all, so let’s split it up:

Continued…

Posted in Development, Various.

Tagged with , , , .


django-validation now includes inheritance support

I’m happy to announce django-validation got field type inheritance support since a couple of minutes. This means your form fields will be validated starting from the most base field type (django.newforms.Field) up to the actual field type (no multiple-inheritance supported though).

In the example I wrote yesterday, when using a TestField field, this field will be validated as a django.newforms.Field (a “required” check will be done), then as a django.newforms.CharField (“min_length” and “max_length” checks), and finally as a TestField. A normal CharField would be validated as a Field first, then as a CharField, etc.

The returned errors will be a list of all errors found, starting with the most basic one (the ones found by the most general class, Field).

Next to this, all generated Javascript code should be namespaced now (based on Python module and class names), although there might be some bad things left, I’m no Javascript guru. The generated code might be somewhat messy.

Current Python code is most certainly ugly and will need more rewrites. Next to this, other field types should be added, and some tests would be nice too.

I made a snapshot of yesterday’s sample (with some changes, the ClientValidator API slightly changed), you can try it here.

Posted in Development.

Tagged with , , , , , , , .


django-validation: an introduction

Some time ago I wrote this generic AJAX Django form validation code. Some people didn’t like this, as AJAX should not be used to perform form validation, which is sometimes true, sometimes not, as I pointed out before.

So I’ve been thinking since some time to create a Django templatetag which allows one to generate client-side Javascript form validation code without writing any code himself (unless using custom widgets). Today I got into it.

Continued…

Posted in Development.

Tagged with , , , , , , , .


KDE4 reviewed

I’ve been able to download the KDE4 LiveCD by now, so I wanted to give it a test ride and write a basic KDE 4 review. These are my findings. I first and foremost want to stress I do not ever want to attack, offend or whatever anyone in this post (as reactions of vocal users on posts like these can be fierce sometimes ;-) ). These are my findings, both positive and negative.

One reason to read this until the end (in case you wouldn’t ;-) ):

KDE 4.0 Button Overflow

At first bootup the OpenSuSE bootsplash theme attracts your attention. I really like it, very smooth.

After a successful bootup (using VirtualBox virtualization) the KDE desktop starts. This takes a while, but this can be blamed on the use of a LiveCD, and a virtual machine. The splash screen is very clean, the use of black and rounded corners reminds me of Apple OS X a little, don’t ask me why. The icon animation is nice, although I think the transparency shouldn’t go all the way to completely transparent (at least, that’s what it looks like), an maybe it should change somewhat slower. Next to this, the last icon in row (the KDE icon) is much bigger than the others, which doens’t look nice. Anyway, minor details.

Once booted, the user is presented with his desktop and a ‘Useful Tips’ dialog:

KDE 4.0 First login

Continued…

Posted in Desktop, Linux, Technology.

Tagged with , , , , , , , .


Properties of a good programmer

I was just pointed to this article thanks to the blog of Kris Buytaert. The author writes about his experiences on how to recognize a good programmer as a recruitment person.

As I still am unqualified myself (no degree yet, maybe I won’t ever get one) the article was a relief to read, as in some of the things he mentions I could recognize myself. Hopefully lots of HR people read it too ;-)

Some excerpts of particular interest, and my opinion on them (all blockquotes © inter-sections.net):

Update: article blog seems to be down, see the comments for a Google cache link.

Continued…

Posted in Technology, Various.

Tagged with , , , , .


KDE4 released: more Free Desktop progress

KDE4 was released today. Most likely not a big surprise for most readers, but hey ;-) Congratulations to the KDE team!

I’d love to give KDE 4 a test-run asap, been trying to download the LiveCD ISO to boot it in my VirtualBox virtual machine, but the torrent is extremely slow here. Maybe my ISP also implemented BitTorrent bandwidth capping as iirc some others did in Belgium, which is completely unfair as this is, obviously, 100% legal content. Some of the screenshots I saw both during development phases and today do look pretty cool, especially taking into account I’m not a big fan of the KDE3.x look. I’m still a little afraid the bottom panel is very high (just like the KDE3.x one), which removes quite a lot of my precious display size… A 14.1 widescreen laptop isn’t thát big, using GNOME I only loose 2×21 pixels.

One thing made me wonder: Plasma, Solid, Phonon, Dolphin, Okular, Akonadi, Oxygen,… Where’s the K* guys? ;-)

I remember some really long and heated threads on GNOME 3 (Project Topaz, which I still consider to be a great name) some months ago, maybe those should be revamped too, to keep the vibe alive :-)

Last couple of years have been very interesting Free Desktop-wise: we got more integration of system components, very flashy UI stuff, great new iconsets and themes, more stabilization of desktop components, several great and innovative new applications,… PDE (Perfect Desktop Environment) doesn’t exist yet (most likely it never will… does such a thing exist, after all?) but current projects are progressing very nicely, each with their proper strengths, targeted user base and features, which can only be applauded and stimulated. Keep on rocking, all of you, so the years ahead of us will be even more surprising, creative, constructive and fun!

Posted in Desktop, Linux.

Tagged with , , , , , , .


Yes, we do have a government

Right, it looks like some still think our little country is still running without a new government since last elections in June:

We then heard from Bruno Braes, a developer who worked on other political Ajax fun over in Flanders, Belgium. This is a touch ironic since Belgium has been running without a new government for how many months now? :)

I’d like to point out we dó have a government by now (since a couple of weeks), even though it’s an interim-government (we should get at least another prime minister around easter. Well, that’s the plan).

End of public service announcement.

Posted in Various.

Tagged with , , .


Nokia 6300 SyncML follow-up

Last couple of days I’ve been trying to get SyncML up and running on my new Nokia 6300 cellphone, as it wasn’t working before. I’ve been collaborating with the main libsyncml author to figure out what’s going wrong, but no success, although there is a report of someone who did get it working.

The phone firmware is broken though, that’s pretty sure. As you can read in the bug report, he had to sync the phone in Windows using the Nokia PC Suite, before it wanted to work using libsyncml. Next to this, authentication had to be enabled on the phone before it wanted to sync.

It looks like I’m not the only person who got issues though: even the official Nokia software under Windows refuses to work (“PC Sync has encountered a problem and has terminated the synchronisation“, “Data transfer not possible“) for several users. There are reports of SyncML working in iSync, although this needs an external “plugin”. Luckily I was able to make a complete phone backup using the PC suite. This, and all other suite features, except sync, seem to work fine.

Anyway, libsyncml traces, obex data dumps or logs of the data sent and received by the official client under Windows (by snooping USB data) didn’t provide any solution, yet.

The fact synchronization doesn’t work is a killer bug if you ask me: I bought this phone to be able to sync, otherwise I’d have settled with some basic model at half the price (like my old 3100).

One more issue: I configured the built-in email client to fetch mails from my IMAP server using an SSL connection. When trying to sync my mails, the client errors out though, as my (self-signed) server certificate can’t be validated. I checked the phone’s manual, but there’s nothing regarding CA keys in the phone’s trust list, nor could I find it myself…

It would be really nice if, in some new version of the firmware (next to fixing the SyncML issues) the contact list would be somewhat better integrated with other applications:

  1. Allow sending emails to contacts or browsing to the webpage of contacts from within the contacts application. Currently you can only view the addresses, if set, but there’s no way to launch the email client or browser application with the given address.
  2. Integrate calendar and contact birthday information: you can set the birthday of contacts, but these are not displayed in the calendar, whilst the latter one does allow you to add birthdays. I guess nobody wants to add all contacts manually in his calendar application too…

So, if you happen to know some people working on series40 firmware, please point them to these issues, thanks ;-)

Posted in Linux, Technology.

Tagged with , , .