You are currently browsing the Carl's notes weblog archives for July, 2010.

Quick Debian gateway

A short tutorial by Steve Kemp, written back in 2004 but works a treat.

Line breaks in Matlab legends

In Matlab you can easily break figure titles, xlabels and ylabels over several lines by using a cell array of strings.

title({'First line and' 'second line'});

But for legends this notation is used to assign legend entries to different plots.

plot(data1);
plot(data2);
legend({'Data 1' 'Data 2'});

You can achieve multiline legend entries by wrapping each entry with sprintf.

legend(sprintf('First line and\nsecond line'));

This works even if you have multiple legend entries and can also be applied to other commands such as title, xlabel and ylabel.

plot(rand(100,3));
legend({sprintf('First line and\nsecond line') 'Single line' sprintf('Another broken\nline')});
xlabel(sprintf('And a line break\nhere'));
title(sprintf('Line breaks\nin legends'));

Using WordPress and Akismet through a proxy

By default the Akismet spam filter for WordPress won’t work behind a proxy because it needs to talk to the Akismet servers.

EDIT: The solution proposed below is now obsolete. WordPress 3.1 and greater provide configuration options for a web proxy. Unfortunately Akismet still doesn’t use these options so you still need to edit a file. Please follow the instructions from Tall Paul’s blog.

Read more…