English

TOP

Lebensrettende Videos

Was haben die BeeGee's mit der Mafia zu tun? Und warum ist FAST bei schiefem Lächeln so wichtig? Oder im typischen Facebook-Sprech: Sie wollte nur ein paar Rockstarfotos machen, aber was dann passiert, damit hatte keiner gerechnet...

Weiterlesen
TOP

Reference found where even-sized list expected

I started working myself though a long list of unfixed warnings today and encountered something I didn't see before: Reference found where even-sized list expected at project/Something.pm:573. The message seems to be clear, but do you find the problem at line 573?

Weiterlesen
TOP

Get multiple IDs from ElasticSearch

ElasticSearch is a search engine. It's made for extremly fast searching in big data volumes. But sometimes one needs to fetch some database documents with known IDs. I found five different ways to do the job. Let's see which one is the best.

Weiterlesen
TOP

Ubuntu 14.04 Trusty: Mapping USB keyboards

I bought a Cherry G84-4700PUCDE-2 keypad about three years ago to have some "special multimedia keys" on the left side of my keyboard. It used to work after some trying until I upgraded to Ubuntu 14.04. The "trusty" release removed support for /lib/udev/findkeys and /lib/udev/keymap and replaced both by something called "hwdb". Converting turned out to be hard, because there are many wrong hints out there spread over the internet.

Weiterlesen
TOP

Passing arguments

Many functions, methods or subs (no matter how you call them) need some arguments. In Perl TIMTOWTDI, but some are faster than others. I'll compare eight ways to get arguments passed to a sub.

Weiterlesen
TOP

Benchmarking mapping tables

Software often needs to transform values from A to B. Such transformations (given they're static) might be done using a database table, if/elsif blocks or a mapping table. Such tables are easy to create, maintain and understand. A database is always the slowest solution for a limited number of items, because the overhead for the client, network and database server is very big compared to sourcecode processing. Sourcecode-based solutions are faster, but which one is the best.

Weiterlesen
TOP

Perl RegEx /s /m Magic

Perl's "Regular Expression" Engine is one of the most flexible and powerful pattern matching and manipulation tools. "Easy" and "powerful" often behave like magnetic poles of the same kind: They can't be together. But the "s" and "m" suffix modifiers supported by the Perl RegEx engine aren't that complicated to understand but still very powerful.

Weiterlesen
TOP

MongoDB "connect failed"

Error messages should be simple, clear and easy to understand. But there are differences: A developer writing some sourcecode will think of something different as "easy to understand" than a user who doesn't know the source or internals. MongoDB reports a "DBClientCursor::init call() failed" on connect errors. Do you know what this message means?

Weiterlesen
TOP

DBI error 4: statement contains no result

Some errors are really hard to find: They appear only sometimes or only on live systems or within complex source that can't run manually using a debugger. Adding debug output might help, but might also be confusing as the DBI error code 4 "statement contains no result" does.

Weiterlesen
TOP

Data::ObjectDriver and JOIN

Data::ObjectDriver is a great ORM. It's easy to configure and easy to use, but not as powerful as DBIx::Class (which isn't that easy to learn and I actually prefer using a wrapper instead of "native" DBIx::Class, but that's another story). There is one major thing I missed with Data::ObjectDriver: JOINing foreign tables.

Weiterlesen
TOP

More Perl variable & block secrets

I wrote about Perl variable declaration secrets recently, but there's much more. Perl has a very simple way for passing variables to subs which should be called later.

Weiterlesen
TOP

Perl variable declaration secrets

Perl has a very flexible variable concept. One might use different namespaces, called "packages" or use all variables global without defining them. Another way to use variables is more Cish where every single variable must be declared before it's used.

Weiterlesen
TOP

Parallel DNS lookups using AnyEvent

Perl has a great asynchronous library: AnyEvent. (There may be even more great asynchronous libraries, but it decided to use AnyEvent.) I recently had to lookup a lot of different hostnames and didn't want to do it sequentially (because every single DNS server might be down or wait until the reply is received).

Weiterlesen
TOP

Perl -M-A-C tests

Perl supports various tests for file and directory states. Most are identical to their bash test siblings, but some additional are supported, like -M, -A and -C.

Weiterlesen
TOP

Setting up DKIM email signatures with Perl

DKIM may be called as PGP successor: PGP has been used by many people for signing their emails at a time when mostly technical related people had been using the internet. Today, few people still use PGP to sign their emails, but email servers took over this part using a technology called DKIM.

Weiterlesen