How I solved my Toshiba Linux backlight issues


I have both the Toshiba Z830 and R850 for a couple of years now. On both, I’m using the current LTS versions of KUbuntu (at the time of writing this, 14.04). Although, I’m absolutely satisfied with them, there’s a little issue regarding the backlight:

On startup, the backlight works perfectly well. I can change the settings using FN+F6/F7 without any issues. However, after putting the device into standby and waking it up again, pressing said hotkeys shows the backlight percentage dialog, but does not change the brightness.

Because Ubuntu’s SSD reboots are pretty fast Iimply didn’t care about the issue for the past few years. However, out of curiosity, I successfully fixed the issue today.

Continue reading →

Posted by Uli Köhler in Linux

Parsing the OUI database in Haskell

In this post, we will show a method and provide a Haskell module capable of parsing both the IEEE OUI list and the IEEE IAB list.

While our code only parses the databases into an object form and doesn’t insert them into a tree capable of fast MAC address -> vendor lookup, it is based on Attoparsec, providing good performance and high flexibility for changes.

Continue reading →

Posted by Uli Köhler in Haskell

How to resolve ‘Can’t perform this operation for unregistered loader type’


Recently I started to add unit tests using setuptools to one of my packages.

In order to do this, I added a test directory containing was properly setup using the



However, when running

python test

I got this error message:

running test
running egg_info
writing MyPackage.egg-info/PKG-INFO
writing top-level names to MyPackage.egg-info/top_level.txt
writing dependency_links to MyPackage.egg-info/dependency_links.txt
reading manifest file 'MyPackage.egg-info/SOURCES.txt'
reading manifest template ''
writing manifest file 'MyPackage.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "", line 29, in <module>
    'Topic :: Scientific/Engineering :: Information Analysis'
  File "/usr/lib/python3.4/distutils/", line 148, in setup
  File "/usr/lib/python3.4/distutils/", line 955, in run_commands
  File "/usr/lib/python3.4/distutils/", line 974, in run_command
  File "/usr/lib/python3/dist-packages/setuptools/command/", line 135, in run
  File "/usr/lib/python3/dist-packages/setuptools/command/", line 116, in with_project_on_sys_path
  File "/usr/lib/python3/dist-packages/setuptools/command/", line 160, in run_tests
    testLoader = cks
  File "/usr/lib/python3.4/unittest/", line 92, in __init__
  File "/usr/lib/python3.4/unittest/", line 139, in parseArgs
  File "/usr/lib/python3.4/unittest/", line 146, in createTests
  File "/usr/lib/python3.4/unittest/", line 146, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python3.4/unittest/", line 146, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python3.4/unittest/", line 117, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/usr/lib/python3/dist-packages/setuptools/command/", line 26, in loadTestsFromModule
    for file in resource_listdir(module.__name__, ''):
  File "/usr/lib/python3/dist-packages/", line 954, in resource_listdir
  File "/usr/lib/python3/dist-packages/", line 1378, in resource_listdir
    return self._listdir(self._fn(self.module_path,resource_name))
  File "/usr/lib/python3/dist-packages/", line 1415, in _listdir
    "Can't perform this operation for unregistered loader type"
NotImplementedError: Can't perform this operation for unregistered loader type

Continue reading →

Posted by Uli Köhler in Python

Haskell: Invert filter predicate

Problem: In Haskell, you intend to filter with an inverted filter operator.

For example, your code is (GHCi):

Prelude> import Data.List
Prelude Data.List> filter ( isPrefixOf "a" ) ["a","ab","cd","abcd","xyz"]

The list you need is ["cd","yz"]. In some cases, the easiest solution would be to use for example <= instead of >, but there isn’t a literal complement for all functions, like for example isPrefixOf, which is being used in the example.

Continue reading →

Posted by Uli Köhler in Haskell

Buffer-overflow safe readlink() in C++


You want to use readlink() to get the file or directory a symbolic link points to, but you don’t know the buffer size that is required to store the symlink destination. You don’t want to allocate an incredibly large amount of memory (whatever amount you choose, it could always be insufficient), but you won’t risk buffer overflows.

Continue reading →

Posted by Uli Köhler in C/C++

Accessing NCBI FTP via rsync

A little-known way of accessing data on the NCBI FTP servers is by using rsync. This method was first mentioned in this mailing list post in 2004.

Using rsync instead of ftp has a few key advantages

  • Fully incremental downloads
  • Resumable downloads
  • Faster than FTP
  • Only a single connection, no problems with FTP active/passive ports (e.g. important for dual-stack lite, e.g. see this excellent post in german )

Continue reading →

Posted by Uli Köhler in Bioinformatics

Solving ‘invalid multibyte escape: /^\xFE\xFF/’ in ruby vpim


When using Ruby 2.0/2.1 with the vpim gem (tested with version 0.695), you get an error message similar to this:

/usr/local/rvm/gems/ruby-2.1.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': /usr/local/rvm/gems/ruby-2.1.0/gems/vpim-0.695/lib/vpim/vcard.rb:678: invalid multibyte escape: /^\xFE\xFF/ (SyntaxError)

Continue reading →

Posted by Uli Köhler in Allgemein

A simple GFF3 parser in Python


You need to parse a GFF3 file containing information about sequence features. You prefer to use a minimal, depedency-free solution instead of importing the GFF3 data into a database right away. However, you need to have a standard-compatible parser

Continue reading →

Posted by Uli Köhler in Bioinformatics, Python