Multi-Threaded Programming with QtConcurrent

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’ »

QMake Major Mode for Emacs (qt-pro.el)

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

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posting to WordPress with Emacs (weblogger.el)

When you spend most of your day in Emacs, it can be annoying to switch to something else for a text oriented task. With weblogger.el you can post to your blog without ever leaving Emacs.

I have WordPress installed, but it should work for any other blogging software with the same XMLRPC interface.

Continue reading ‘Posting to WordPress with Emacs (weblogger.el)’ »

Covariant Return Types

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’ »

/etc/passwd Fun

Several years ago I put up a /etc/passwd script that generates a passwd file full of random usernames with hashes of random floating point numbers for the password. You can see the script in action at http://tolchz.net/etc/passwd . Hit reload a few times to get the full effect.

I’ve recently found several forums that have “users” asking how to crack the passwd file found on my site….

American Site (The user seems to think it is a Windows password file)
German Site
Czech Site
Russian Site

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Vim + netrw Problem

While modifying a remote file with netrw under Windows I ran into a problem upon trying to write the file.

scp -q "VIMD72e7.tmp" "host:/path/to/file.txt"
VIMD7E7.tmp: No such file or directory
shell returned 1
Hit any key to close this window...

I think that this is a result of the autochdir option being set. My fix is to do a

:lcd $TEMP

in the buffer with the remote file loaded prior to writing the file. This lets scp find the temporary file and the copy/write succeeds.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Falling Snow…

Quick falling snow hack with Python and Pygame. Snow eventually accumulates and fills the screen…

Falling Snow Screenshot

Falling Snow Source

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

links for 2006-12-07

links for 2006-12-06

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

SLIME Problem with SBCL

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.

SLIME Screenshot

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]