Subscribe to RSS feed - electronic brain surgery since 2001


Seven Years Later

This must be some kind of record. About seven years ago I ported the JavaScript port of a C library for SemaCodes to PHP. Back then I encountered a bug in the original C lib that I wasn't able to fix and wrote to the mailing list. Unfortunately the library was pretty much unmaintained and I never got an answer.

Until today, when I got a mail from Jesse Crews:

Andreas Gohr, Fri Jun 29 15:56:47 CEST 2007:

I have a problem with the DataMatrix exncoder:

Underscores are not encoded correctly in the barcode at all times. If the underscore is the 4th or later character in the input, it will be encoded as a carret char (^).
Please, let me know if I can give any more information.

Do you remember this? I recently started using iec16022 and encountered this bug. In the remote event that you haven't lost interest nearly 7 years later, the encoding fault was caused by set 2 being incomplete. '_' is code 26, but '^' and FNC1 were both missing from the set, causing text (C40 and text) encodings to encode '_' as code 25 ('^') instead of the correct code 26.

iec16022ecc200.c, line 257 reads:
*s2 = ”!\”#$%&'()*+,-./:;⇔?@[\\]_”
but should be *s2 = ”!\”#$%&'()*+,-./:;⇔?@[\\]^_\232”

Awesome. Even though QRCode is more or less the defacto standard nowadays, my PHP semacode library finally works. Better 7 years late, than never =).

The updated code is available in the Github Repository.

semacode, php, cellphone, bugfix
Similar posts:
Last updated: 2014/04/16 20:47 · Permalink · Comments


We just returned from a few days in Venice. The weather was fantastic and the city is as beautiful as everyone says. As usual, a selection of our photos can be found below:

venice, italy, vacation, photos
Similar posts:
Last updated: 2014/03/13 20:31 · Permalink · Comments

Cat Content

Today was a wonderful sunny spring day and my friend Anne asked us to join her for a Tierpark1) visit. And that we did. So here are just a few impressions and some (big) cat content.

tierpark, zoo, spring, photos
Similar posts:
1) the other zoo in Berlin
Last updated: 2014/03/09 19:20 · Permalink · Comments

Lenovo Thinkpad X240 & Xubuntu

I just bought a new laptop. After years with netbooks (first the EeePC 4G and then the EeePC 1015PE) this is my first full powered laptop since my Fujitsu Lifebook. I wanted something powerful with good screen resolution and battery life.

I finally decided for the Thinkpad X240. More specifically model 20AMS21B00, which is a university edition and not available in this exact configuration to the general public. Luckily I have connections ;-).

This post features a short review and some hints on configuring the X240 with Xubuntu.

Last updated: 2014/03/08 15:01 · Permalink · Comments

File Icon Generator

Consistent file icons are a bit of a pet peeve for me. Icons make download links or web based file managers (like in DokuWiki) much nicer to use. But where to get them? Whatever iconset you use, there is always the one type missing you currently need. A long while ago I even started to compile my own icon set but that suffers from the same problem.

What I needed was some icon set that would cover any possible file extension, would look nice in different sizes and is free to use. So I built one. Or more specifically, I created a tool to build such an icon set.

It's creatively named File Icon Generator and is a PHP script utilizing libGD to build the icons.

Icons are created based on a basic template (I decided for the document metapher) and a colored label. The label itself is just the file extension, the color specifies what kind of file it is (based on its mimetype). Eg. image files are blue, audio files green and so on.

The templates are configurable based on mime types as well, so for the bigger sizes some graphics can be added. Eg. a musical note for audio files.

For now it creates 16×16 and 32×32 icons for 1072 known extensions. And this is what it looks like:

The source code is available at Github and pull requests are welcome.

icons, mime, filetype, php
Last updated: 2014/02/16 17:34 · Permalink · Comments

Older Posts are available in the Archive. Keep up to date with the RSS Feed.


Older Articles are available in the Archive, subscribe to the
Full Content RSS Feed to stay tuned.

← Flattr me ;-)

Currently reading

Barbara Kingsolver

Currently playing

inXile entertainment