Tag Archive error

Setting MySQL to Default to Unicode

When running unit tests in Django, I was getting a strange MySQL failure when attempting to insert non-ASCII Unicode characters into the database, for example:

[code light=”true”]
Warning: Incorrect string value: ‘\xE2\x89\xA5 %’ for column ‘value’ at row 1

What is happening is that Django creates a new schema from scratch for testing. This new schema picks up the MySQL defaults. All my test tables ended up with Latin-1 encoding instead of UTF-8 encoding.

I needed to change mysqld to default to unicode internally so Django will run unit tests involving correctly.

In /etc/my.cnf I added the following:

[code lang=”c” light=”true”]


collation-server = utf8_unicode_ci
init-connect=’SET NAMES utf8′
character-set-server = utf8

h/t stackoverflow

Tags, , , , , ,

Including Libraries in the Arduino IDE

There’s an annoying subtlety in the Arduino IDE when using tabs (multiple files in the sketch), that was kindly explained by PaulS on the Arduino forums.

Any Arduino libraries that are needed by the files outside of the sketch (.ino) file must also be listed in the sketch file itself.


You cannot simply do this:

[cpp light=”true”]example.h:

#include <Servo.h>[/cpp]

When you attempt to compile, you’ll get an error like,

In file included from test_junk_02.cpp:1:
test.h:7: error: 'Servo' does not name a type

You must also include the library in the sketch:

[cpp light=”true”]test.ino:

#include <Servo.h>
#incude "example.h"[/cpp]


The explanation that PaulS gave was the following:

The sketch is parsed for include files. The sketch, all included header files, and the corresponding source files, are copied to another directory for compiling. From that directory, library-based include files are NOT available unless they are included in the sketch and copied to the build directory.

Tags, , , , , ,

Zimbra Start Error: slapd daemon: bind(7) failed errno=99 (Cannot assign requested address)

If you move a Zimbra server and give it a new IP address, you may get the following error after attempting to start up:

Initializing ldap[3725] daemon: bind(7) failed errno=99 (Cannot assign requested address)

On the Zimbra forums, jholder says, “an error 99 for ldap start is almost always a hostfile issue.” Remember to change the entry for the server in /etc/hosts.

Tags, , , , , , ,

%d bloggers like this: