Entries from March 2008
March 23rd, 2008 — Enabling Technology, Ideas, Links
Ian Bicking’s interesting and provocative blog post on HTML Accessibility is a good read. Empirical accessibility is a good idea. I think by this he means making it work for real users. Fred Brooks’ ideas about the computer scientist as toolsmith seem very relevant.
I’ve been thinking about grass-roots accessibility for a while, though I can’t say I’ve made much progress. It seems to me we have to somehow empower people to enhance accessibility in a bottom up way without much help from developers.
March 17th, 2008 — Ubuntu, Windows
For some if my Windows testing VMware, sadly, won’t do the job. For example, I can’t get my USB webcam’s to work on an XP guest running on VMware on my Ubuntu machine. For testing these things I have to use my laptop. Unfortunately that requires copying files over. So I wanted to share my Ubuntu files with my laptop.
It took a while and I tried many things but I think this is the combination that did the trick.
In Synaptic, install samba.
At the command prompt, run
sudo smbpasswd -a yourid
give it your password and the password you want to use from the windows machine.
Now on the windows machine you should be able to connect. You may need to use the numeric IP address of the host.
March 15th, 2008 — Programming
Emacs python mode supports running scripts in an inferior python process that is running in an emacs buffer. I really like this idea but have never been able to reliably use it because so much of my work depends on external libraries that may not do a complete job of cleaning up their state. Attempting to reuse them in the same process is, in my experience, a recipe for confusion. Also, emacs seems to be hung waiting on the python subprocess while my GUI app is running. As a result, I always edit in emacs and then switch to a command prompt to run.
It occurred to me that if I my program doesn’t need input (almost all mine have a GUI) I can run them using the emacs compile command. The compile command in emacs is intended for running make and other command-line build tools. The command runs in a separate process and its output is directed to an emacs buffer. I tried it out and it works great!
In my .emacs file I defined this function
(defun my-compile ()
"Use compile to run python programs"
(interactive)
(compile (concat "python " (buffer-name))))
(setq compilation-scroll-output t)
This function invokes compile with python foo.py when I’m editing a buffer named foo.py. The setq makes the compilation buffer scroll to follow the output.
And then in my python-mode hook function I added:
(local-set-key "\C-c\C-c" 'my-compile)
This binds Ctrl-C Ctrl-C to compile instead of the usual eval-buffer which I never use anyway.
Now I can edit and type Ctrl-C Ctrl-C to run. If my program raises an exception, I get a traceback in the emacs buffer. emacs parses the buffer looking for error messages. It notices the File lines in the trace back and sets them up so I can click on a filename to visit the file and line associated with the traceback.
I’m loving this! No more directing my program output into a file when I’m printing tons of debug messages. No more constant Alt-Tab to switch between emacs and the command prompt.
I’m using it on Ubuntu, but a quick test indicates this works on Windows also.
March 4th, 2008 — Links, Random
An article in the WSJ reports on a study of energy consumption in Indiana before and after their recent switch to DST. The switch cost them $8.6 million extra for electricity.