Making the Trust 1200 Wireless tablet work on Linux

I have gotten access to an old wireless tablet ("wireless" as in the pen is battery powered, tablet is wired USB), and have gotten it work. Since it was not trivial to figure out how to do that, I though I would describe the steps. First the context: in the old days, X11 communicated directly with the hardware. So for a tablet to work, there needed to exist an X11 driver. There seem to be 2 kinds of tablets: Wacom tablets and non-Wacom tablets, with Wacom tablets generally having much better Linux support. So the first thing I found was some X11 Wizardpen drivers which had not been updated since 2011, which supposedly supported various non-Wacom tablets. This was very much a blind alley. After some further investigation, I found that in the newer Wayland architecture, tablet drivers had been moved into the kernel, and the Wayland project libinput had been created as a middle layer. And in fact the DIGImend project had already created a driver for my tablet (which turned o…

Status for Universal Power Adapter for Mobile Devices

I was curious abotu whether IEEE's Universal Power Adapter for Mobile Devices standard had been abandoned. Jonathan Goldberg of IEEE was kind enough to answer my email: Thue, Good afternoon. In fact, P1823 recently completed a recirculation ballot and has been submitted to the IEEE Standards Review Committee (RevCom) for December 2014 review and possible approval by the IEEE Standards Association Standards Board. Please let me know if you have any further questions on this project. Regards, Jonathan Goldberg Client Services Manager IEEE Standards Association p: +1 732 562 6088 c: +1 732 570 0116 f: +1 732 562 1571 e: IEEE - Fostering technological innovation and excellence for the benefit of humanity. On Wed, Sep 24, 2014 at 12:04 PM, IEEE Standards webmail wrote: (Message sent via IEEE Standards webmail) ----------------------------------------- referer = first_name = Thue last_name = Kristensen e…

Dashed line error in Apple PDF viewer

I had the Apple PDF viewer choke on a PDF document which worked wine in other PDF viewers. I tracked it down to a funny dashed line. As can be seen on page 155 of the PDF specification for the third edition, dashed lines are specified as fx "[1 2] 0", which means 1 unit on, 2 units off. To stop dashing, you should write a dash specification of "[] 0". I had a pdf which tried to stop dashing by writing "[ 1 0 ] 0" ("[ 1 0 ] 0 d" actually, I haven't looked into what the "d" means). This worked fine in most PDF viewers, but in Apple's viewer the document stopped rendering at that point. I assume that it is the 0-gap (the first "0") which confuses it. Fixing the PDF generator to use the "[] 0 d" from the specification made it work in Apple's PDF viewer. So now you know, if you come across the same problem :). I would report it to Apple, but they don't seem to let you report bugs if you do not have an …

The Sharing Knife

I liked the fantasy novels The Sharing Knife, so I asked Lois McMaster Bujold (the author) by email if more books in that series we planned. Her answer:

Hi Thue --

No, only the 4 so far. Nothing else is planned at this time.

There is, of course, a new Vorkosigan SF book coming out in November, _CryoBurn_.

bests, Lois.

Too bad :(

Kom uden om DR's flash-afspiller

Jeg ser nogen gange Bonderøven på DR1. Men selv om programmerne er tilgængelige via flash-afspilleren, så er DR er langsomme til at lægge programmerne ud til download. Flash-afspilleren er ret irriterende, da man for eksempel ikke kan putte den i fuldscreen, og så samtidigt klikke rundt på sin sekundære skærm.

Så siden flash-afspilleren må hente videoen et sted fra, så må jeg da også kunne hente den derfra, og så afspille den fra den downloadede fil.

Første trin er at bruge Chromium's developer tools til at "inspecte" flashplayeren på . Den har kildekoden

<object id="nettvPlayer" height="349px" width="620px" type="application/x-shockwave-flash" data="/nu/assets/swf/NetTVPlayer_10.swf">
<param name="quality" value="high">
<param name="allowScriptAccess" value="always">
<param name="wMode" value="transparent">
PHP's implementation of fgetcsv() and fputcsv() does not follow RFC 4180 or Wikipedia's description, and does not work in all cases with Excel or OO Calc, as described in bug .

Here is an RFC 4180-complient implementation in PHP. This can parse more than 1MiB of CSV text per second, so should be fast enough for most uses. It is fairly strict, in that it does not allow whitespace before the start of a quoted item, such as 1, "2" ,3 , in according to the standard, but it would be simple to make it laxer. It supports both \r\n and \n linebreaks, where the standard only supports \r\n. whitespace is just another data character, so '1, 2,3 ' becomes Array(1, " 2", "3 "). backslashes are also just another character, as backslashes have no special meaning in RFC 4180.

The code below may be used and redistributed without restrictions. You may consider buying me a beer if you find it useful.

class csv {

private s…

Sid Meier's Alpha Centauri on Linux

I own Sid Meier's Alpha Centauri Planetary Pack in the Linux edition from Loki. However, it unfortunately does not seem to run on a modern Linux distribution.

So I decided to make a virtual machine image of an old Linux distribution to make it work. That way I will never have to reinstall it, as long as I save the virtualized image.

So the procedure is:
1) Download Red Hat 8 (in 2 disks): and

2) Create a virtual disk image:
emu-img create -f qcow2 smac_redhat8.img 5G

3) Optionally install kqemu kernel module to accelerate qemu (Red Hat 8 didn't work with kvm,presumably because my CPU is not known by Red Hat 8).

3) Install Red Hat 8 in virtual image:
qemu -cpu pentium2 -hda smac_redhat8.img -m 1024 -soundhw ac97 -cdrom psyche-i386-disc1.iso
(You change cdrom in qemu by CTRL-ALT-2 and then "ch…