Archive for the ‘Programming’ Category.
8th January 2008, 06:30 pm
I’m really looking forward to QtConcurrent which will be in Qt 4.4; so I downloaded a Qt snapshot to try it out.
You can download all of the example code I wrote here, Qt Concurrent Examples
Continue reading ‘Multi-Threaded Programming with QtConcurrent’ »
7th January 2008, 07:38 pm
I finally got around to writing a major mode for Qt .pro and .pri files. It doesn’t provide any indenting features; only font locking.
Just load it up and add the following to your .emacs
(require ‘qt-pro)
(add-to-list ‘auto-mode-alist ‘(“\\.pr[io]$” . qt-pro-mode))
Get it here qt-pro.el
4th January 2008, 07:50 pm
I ran across something weird the other day. I had assumed that the return type of an overriding function must be identical to the function that it is overriding. The C++ Standard allows one specific exception to this rule that could possibly come in handy to save some unnecessary casting.
Continue reading ‘Covariant Return Types’ »
15th December 2006, 11:35 pm
Quick falling snow hack with Python and Pygame. Snow eventually accumulates and fills the screen…

Falling Snow Source
31st October 2006, 06:12 pm
When starting up SLIME (M-x slime) I’m getting a hangup error:
;; Swank started at port: 36773.
36773
*
Process inferior-lisp hangup
From searching, this appears to be a problem with Emacs and my version of the Linux Kernel (2.6.8). The workaround is apparently to set the inferior lisp to “nohup sbcl” which prevents SBCL from receiving the hangup signal. Unfortunately it also redirects STDOUT/STDIN which seems to cause a problem with the SLIME from CVS.
The solution that I’ve found is to start swank (the Lisp portion of SLIME) manually in SBCL.
; Load swank
(load "/path/to/swank-loader.lisp")
; Start the swank server
(swank:create-server)
Then in Emacs start SLIME with M-x slime-connect, the defaults of Host: 127.0.0.1 and Port: 4005 should be fine.

23rd March 2005, 08:26 pm
A script to put a Thunderbird Addressbook on a Palm
Run Mozilla Thunderbird, open the addressbook, click Tools->Export and export it to a CSV file, say mozilla.csv
Use it like this:
./ThunderBird2Palm.pl < mozilla.csv > palm.csv
pilot-addresses -p /dev/pilot -r palm.csv
pilot-dedupe -p /dev/pilot -r AddressDB
Requires Perl, Text::CSV, new version of pilot-link
ThunderBird2Palm.pl
21st March 2005, 10:45 am
27th September 2002, 01:46 pm
This Perl script creates a background out of images that it finds on the internet through searching for random words out of the dictionary at images.google.com . It uses PerlMagick for the image functions and currently uses xloadimg to display it on the background.
Download
Edit the first few lines
Place in crontab
Enjoy
randomimage.pl
22nd September 2002, 03:07 pm
5×5 Grid of randomly lit and unlit boxes, clicking a box flips the boxes in a cross shape
around the box clicked
Uses SDL_Image and SDL_TTF
Press ~ to get to Console
lights.tgz
22nd September 2002, 02:58 pm
A Simple SDL Demo that uses Hardware Acceleration and Double Buffering to draw
three Sphere images on the screen and bounce them around a bit.
It uses SDL_Image for loading the PNG file.
Copy and paste the source code to a file and compile it like this:
gcc -Wall -ansi -pedantic `sdl-config –cflags` -c bounce.c
gcc -Wall main.o -o main -lSDL_image -L/usr/X11R6/lib -L/usr/lib -lSDL -lpthread
Bounce.c