I have to try this out some time: There is an Emacs mode for code completion using CLang. It is mentioned in a blog entry by some guy. The nice thing here would be, that it enables ObjC code completion, which is a good thing™. Especially if your are coding for OS X or iOS.
MapReduce on CUDA using Python (and a Discontinuous Galerkin solver!)
As volcore pointed out, there is a library called pycuda, which allows for CUDA programming in Python. It also comes with a nice ReductionKernel class, which allows one to rapidly develop custom MapReduce kernels.
Update: Even better, the same author has published a Discontinuous Galerkin solver, based on the same stuff. This can be used to solve partial differential equations, e.g. for fluid simulations, but also for EM simulations, using Maxwell’s equations.
Cleaning up MacPorts
I like to use MacPorts for installing certain libraries and programs. When running an update old versions are still kept on your disk. I never did care for those old versions, so you can simply let MacPorts remove them while updating:
$ sudo port -u upgrade outdated
This is taken from another blog post.
Setting the sender of git post-receive hooks
#!/bin/sh
# Use the name and email address of the author of the last commit.
USER_EMAIL=$(git log -1 --format=format:%ae HEAD)
USER_NAME=$(git log -1 --format=format:%an HEAD)
. $(dirname $0)/post-receive-email
I then also changed the default post-receive-email script, to look like this in the send_mail() function:
send_mail()
{
if [ -n "$envelopesender" ]; then
/usr/sbin/sendmail -t -f "$envelopesender"
else
/usr/sbin/sendmail -t -F "$USER_NAME" -f "$USER_EMAIL"
fi
}
Pimping MobileMe #1: Expiration dates on folders
Well, MobileMe does not yet support the expiration of mails in folders. Especially for mailing lists, I want this feature. After let’s say 90 days the mails should be automatically deleted. I do not need to store mailing list contents for longer. So I took the nice tool imapfilter and wrote a config file that expires old mails from a selection of folders. I installed a cronjob on my web server that now automatically calls imapfilter every night. The config file (~/.imapfilter/config.lua) looks like this:
Myaccount = IMAP {
server = ‘mail.me.com’,
username = ‘your.name@me.com’,
password = ‘yourpassword’,
ssl = ‘tls1’
}
folders = {‘folder1’, ‘folder2’, ‘folder3’}
for k,folder in pairs(folders) do
foldername = ‘Mailinglists/’ .. folder
results = myaccount[foldername]:is_older(90)
myaccount[foldername]:delete_messages(results)
end
Migrating from GMX IMAP to MobileMe IMAP
I am currently migrating my >4GiB of mail data from GMX to MobileMe. I have been using offlineimap regularly to backup my mail data. So first step was to update the backup. Now the next step is to run imapsync, which can migrate whole IMAP accounts. The full command I am using for this is:
imapsync –sep1 ‘/’ –prefix1 ” –ssl1 –ssl2 –authmech1 PLAIN –authmech2 PLAIN –host1 imap.gmx.net –user1 “yourname@gmx.de” –host2 mail.me.com –user2 “yourname@me.com”
I will report back once the sync has finished, this might take a while.
Update: Yup, it worked. My mail is now hosted on MobileMe. More disk space. What is missing at MobileMe is that it does not support automatically expiring mail folders. I.e. for mailing lists, I sort the mails into subfolders for each list. The lists are often high volume traffic, and not very important. So I’d like the mails to expire after, say, 30 days. With GMX this was not a problem, but MobileMe does not yet have such a feature. However, I found a nice tool called imapfilter. It allows you to do all kinds of stuff, besides other things it allows you to filter mails according to date and to delete them. This is what I will do. I’ll write another post, when I found out how to do that exactly.
ImageMagick: Convert RGBA to RGB in a sane way
When using ImageMagick to convert an RGBA picture (e.g. an OS X window with shadows) to an RGB JPEG file, you should use the following command:
$ convert input.png -flatten +matte output.jpg
If you don’t do that, you will end up with a picture like this:
The right conversion leads to this result instead:
Humble Bundle Games: Braid
I just tried out my second game from the Humble Bundle 2. This one is called Braid. It is a 2D puzzle platform jump and run with a little twist. In the first world that I just started, you can let time run backwards, by hitting the shift key. Other than that, you only have the arrow keys for moving around your character and the space bar for jumping. The graphics are wonderful, in style akin to a aquarel or water colour painting. The music is some violins playing a melancholic soundtrack. The worlds seem to be designed with a lot of love, and it’s nice to see a jump and run game with more puzzles than fast action scenes. It’s somewhat of a change. Here’s a nice screenshot of one of the first levels:
Very small Analytics post
Doxygen UI for OS X
MacPorts comes with a nice package for Doxygen, the source documentation tool. However, it is missing the doxywizard, to quickly create and edit the sometimes very long Doxygen configuration files. However, there is a page (even from the original Doxygen guy) hosting special OS X builds with a nice small bundle, that you can drop into your Applications folder and which looks like this:




