2008/08/13

Put a feather in his cap...

Wikipedia: maccaroni

So that's what the lyrics are about.

2008/08/05

GPS cellphones to unleash gamers onto the streets - tech - 05 August 2008 - New Scientist Tech

GPS cellphones to unleash gamers onto the streets - tech - 05 August 2008 - New Scientist Tech:

"But being able to discover the physical location of other people has downsides. Researchers at Portsmouth University have had to abandon GPS games projects because they cannot get approval from the ethics committee.
'Already there are social networking applications for the GPS iPhone which let you see where other iPhone users are,' says Andy Bain, lecturer at Portsmouth University's School of Creative Technologies. 'If I were a thief I'd abuse that knowledge right away to get myself more iPhones.'
Commercial games developers are not subject to the same ethical scrutiny as academics, he adds. It could be left to their customers to work out how to avoid anti-social gamers."

I don't know anything about gaming or social activities — I'm an old-school geek. But... Given that phone GPS is supposed to be accurate to within a few meters only, it's easy to imagine "wave function" games which rely on GPS. Such games might show the locations of participants as spheres, to indicate the GPS error. It would fall to the players to collapse the wave functions (find the other players).

I could lose a lot of money creating dull GPS-based games. "Never mind whether it's alive or dead, where is Schrödinger's Cat?" "Bohrtherford — Find the electron." Etc.

Best to lie down until the urge goes away.
"But think about this. Supposing you were to introduce a psychic, someone with clairvoyant powers, into the experiment — someone who is able to divine what state of health the cat is in without opening the box. Someone who has, perhaps, a certain eerie sympathy with cats. What then? Might that furnish us with an additional insight into the problem of quantum physics?"
"Dirk, this is complete nonsense."

-- Dirk Gently's Holistic Detective Agency, Douglas Adams

2008/08/03

Compiling subversion 1.5.1 on OS X 10.5.4

I've just tried to compile the subversion 1.5.1 client from its two source tarballs (subversion-1.5.1-tar.bz2 and subversion-deps-1.5.1-tar.bz2). I took care to first hide the /usr/local libraries from my existing subversion installation. Even so, the compilation failed, complaining

/usr/lib/libexpat.a: No such file or directory


The workaround was to temporarily move the system's /usr/lib/libexpat* dynamic libraries, and then to rebuild.

Here's the build script which worked for me:
#!/bin/sh
set -e
VERSION=1.5.1
rm -rf subversion-${VERSION}
tar xjf subversion-${VERSION}.tar.bz2
tar xjf subversion-deps-${VERSION}.tar.bz2
cd subversion-${VERSION}
./autogen.sh
./configure --without-apxs --with-ssl
make
sudo make install
sudo make install-swig-py

2008/08/02

New TextMate bundles

These aren't really new. I just wasn't aware of them.

JavaScript Tools


The JavaScript Tools bundle helps you lint, format and compress your JavaScript code, and convert code to and from JavaScript bookmarklets.

My favorite feature: whenever you save a JavaScript file via Command-S, the bundle automatically runs it through jslint. If any errors or warnings are found, a tooltip appears which shows the number of warnings/errors.

If you run a full validation using Control-Shift-V, you'll get a popup window showing "compilation" results -- complete with syntax errors and clickable links to take you to the offending source code.

Installation


I installed under ~/Library/Application Support/. It may be better to use /Library/Application Support/.
$ cd ~/Library/Application Support/TextMate/Bundles
$ svn export http://bundles.bundleforge.com/trunk/bundles/JavaScript%20Tools.tmbundle/

BTW I'm not sure why export is preferred over checkout.

If TextMate is already running, you can load the bundle by selecting Bundles->Bundle Editor->Reload Bundles.

Sproutcore


I haven't done much with Sproutcore yet, but it does already have its own TextMate bundle which provides a few tab-completion snippets.

Installation

$ cd ~/Library/Application Support/TextMate/Bundles
$ curl --location --get http://github.com/sproutit/sproutcore-tmbundle/tarball/master -o sproutcore-tmbundle.tar
$ tar xf sproutcore-tmbundle.tar


The curl --location option is required, since github will issue a redirect.

The extracted tarfile will have a root directory name of the form sproutit-sproutcore-tmbundle-.*, so a directory rename is needed.
$ mv sproutit-sproutcore-tmbundle-blah-blah.../ Sproutcore.tmbundle



2008/07/29

Google Calendar supports CalDAV

Google Calendar has added support for CalDAV. For Mac weenies, this means you can share calendars across multiple Macs, adding and removing events via iCal. And you can do it without paying for MobileMe.

Wonderful stuff!

2008/07/24

Terminal.app hangs at startup

I just got bit by this bug, under OS X 10.5.4. The symptoms are that sudo hangs, and Terminal.app hangs when opening a new tab or when starting up. Console.app shows messages of the form

7/24/08 7:04:44 AM kernel devfs: ttys001: name slot allocation failed (Errno=17)


rprr posted a workaround in the above thread which worked for me. I don't know how to link to specific messages in the discussion thread (or whether that's even allowed under the terms of use, egad), so here's a recap:
1. Started Terminal. It hung up. Did Force Quit and Sent Crash report to Apple.

2. Since I had a working X11 application, I used it to open about 10 xterms using the Applications->Terminal Menu of X11.app

3. I started Terminal again. Now it works.

Anarchogeek: Beyond REST? Building Data Services with XMPP PubSub

Anarchogeek: Beyond REST? Building Data Services with XMPP PubSub

Addresses a few problems which I've never had to face. Still, lots of interesting ideas to chew on. Hints at techniques that could be applied even to low-volume web services which involve long-running server-side computations.

Many little parasites add up to one big biomass - earth - 24 July 2008 - New Scientist Environment

The main point of the article is that parasites are much more populous than previously believed. But this quote was the most interesting:

Many little parasites add up to one big biomass - earth - 24 July 2008 - New Scientist Environment:

"Dobson says he has work in press showing that parasites contain between 10 and 1000 times more pollutants than their hosts. He suggests parasites might play an important role in cleaning up the animals they inhabit."


So they castrate you, but they also keep you clean...

2008/04/22

Served up in a fine china Meatri Dish

Love the Steak and Save the Cow:

"PETA offers a $1 million prize to whoever can come up with tasty, edible, lab-grown meat, an advance they say would save billions of animals while still satisfying our carnivorous cravings."


Of course there's another solution, courtesy of the late, great Douglas Adams:
The animal staggered to its feet. It gave a mellow gurgle.
'A very wise choice, sir, if I may say so. Very good,' it
said, 'I'll just nip off and shoot myself.'
He turned and gave a friendly wink to Arthur.
'Don't worry, sir,' he said, 'I'll be very humane.'

2008/04/17

Why Lockheed Martin signed on w. the Spaceport

From KRQE in Albuquerque: Spaceport launch tests future spacecraft




"It looks a bit like the space shuttle and would fly to space and return the same way. But even the big version would not carry people, just satellites.

The goal is to get to orbit faster and cheaper thanks to an automated reusable spacecraft run by its own computers and just a handful of people for a launch crew."

New Scientist: Revealed: the Asian source of the annual flu epidemic

Revealed: the Asian source of the annual flu epidemic - health - 17 April 2008 - New Scientist:

"Better surveillance in east Asia should lead to better predictions of how flu is evolving, and what is likely to be needed in next year's flu vaccine, says Smith."

2008/04/08

Thank you, wsgi

Thanks to all of the developers behind wsgi.

When I first heard about it, wsgi struck me as an unnecessary complication. Then someone showed me how it could simplify testing of web applications. And now:

High-Scalability:

Google App Engine supports any framework written in pure Python that speaks CGI (and any WSGI-compliant framework using a CGI adaptor), including Django, CherryPy, Pylons, and web.py. You can bundle a framework of your choosing with your application code by copying its code into your application directory.

2008/04/04

Visual Web Developer "Failed to start monitoring changes"

I keep forgetting about this...

I'd like to do development on an ASP.NET web application which resides in a VMware Fusion shared folder. Unfortunately, as noted in the Microsoft Forums, Visual Web Developer 2005 Express Edition (at least) does not support hosting on a UNC share.

So, AFAICT, the only option is to do development in a local folder. To access that folder from the host operating system, it needs to be shared from the Windows VM.

VMware Fusion, OpenSUSE 10.3 x64, copy and paste

I recently installed a 64-bit OpenSUSE 10.3 virtual machine under VMware Fusion. Everything worked fine except cut&paste -- the vmware-user executable was not launching when X11 started.

ldd showed a dependency on libexpat.so.0, in addition to libexpat.so.1. I installed that using yast, rebooted, and -- huzzah -- cut&paste now works.

yast_install_libexpat.png

More details are available in the VMware Fusion discussions forum.

2008/03/26

Five Open Tools for 2D Structure Layout (aka Structure Diagram Generation)

Five Open Tools for 2D Structure Layout (aka Structure Diagram Generation)

Good summary of several alternatives. I've been using CDK of late, but am partial to tools written for CPython. I wonder if any of the alternatives make it as easy to extract coordinates as does CDK?

2008/03/21

TUAW Terminal Tip: Safari 3.1 brings true one-window mode

Terminal Tip: Safari 3.1 brings true one-window mode:

...true one-window mode is finally, finally, here for Safari. All you need to enter is the command below into Terminal, hit enter, and you're sorted.

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true


Yay!

Functest

Writing Functests:

"This is where functest really shines. When you run functest against any directory or file the collector actually compiles a dependency chain which includes any valid python modules in all the parent directories..."


Hm. So functest would let me dispense with this nonsense boilerplate in my test modules?
import sys
import os
thisdir = os.path.abspath(os.path.dirname(__file__))
def relpath(p):
return os.path.abspath(os.path.join(thisdir, p))
sys.path.insert(relpath("../"))



I wonder if nose does/will provide similar facilities? It's pretty nice in other respects...

Twill, CherryPy 3 and testing with internal servers

Twill can test CherryPy web servers "in process", without having to run them as servers. I've used twill this way with CherryPy 2, but when I recently tried to do the same thing with a CherryPy 3 server everything broke.

I had based my code on an old CherryPy 2 tutorial by Titus Brown, and was trying to grep through the CherryPy 3 code tree to figure out how to patch it up. Bad idea :)

Yesterday Google finally turned up a solution, from a talk Titus gave at PyCon 2007.

The upshot: don't use cherrypy._cpwsgi.CPWSGIApp. In CherryPy 3, your application itself is already a WSGIApp. What's more, I think cherrypy._cpwsgi.CPWSGIApp may be broken. For sure, it and twill have incompatible ideas about the correct type of the 2nd constructor argument.

Anyway, thanks to Titus, here's an example of how to connect twill to a CherryPy 3 application for in-process testing:

import twill
import cherrypy
...
wsgi_app = cherrypy.tree.mount(myApp, "/", myConfig)
cherrypy.engine.start(blocking=False)
twill.add_wsgi_intercept('localhost', 8080, lambda: wsgi_app)


[Update 2008/03/24] Ditched the cherrypy.server.quickstart() invocation, per fumanchu's comment. Reported as Ticket #801.

2008/03/10

waf build errors

I'm evaluating waf to see if it's easier to use than SCons (especially for Qt projects). So far the results are encouraging. In particular, waf reports many kinds of problems using straightforward (color-coded!) error messages, rather than Python tracebacks.

target 'build_info' does not exist

Sometimes waf does spew an unintelligible Python traceback reminiscent of SCons. For me, these typically end with a KeyError:

File "/path/to/.waf-1.3.2-blah/wafadmin/Task.py", line 290, in must_run
prev_sig = tree.m_sig_cache[key][0]
KeyError: -214303645


This error always translates to "you are trying to build a file which is part of your source tree."

My SConscripts work in situ, creating object files etc. in the same directories where the source code resides. waf prefers to put build products in a separate build/ subdirectory. When waf is instructed to generate an output file in its build tree, and when that file already exists in the source tree, waf fails with the KeyError traceback.

I'd bet this problem is most common in software projects which started life using build systems like Make or SCons -- tools which default to building in situ.

For example, I'm trying to use waf in a subversion workspace where I've been doing SCons builds for years. To make matters worse, one of the build products is a header file, containing revision number and date for the current build. This looks like a source file, so it's likely that I never checked whether it was properly removed by scons -u -c.

In retrospect, I should have started with a clean check-out...

2008/03/07

Rogue Amoeba: Code Signing and You

Code Signing and You:

"Code signing itself is a neutral technology, but it gives incredible power to the system vendor, and that power is just waiting to be exercised and abused."


It's possible that Apple intends to close off the OS X platform. If that happens, I'll go back to Linux.