MethylBlue
  1. Filelight
  2. Codeine
  3. Wocka
  4. Blog
  5. Detritus
  6. Home
RSS

Analogies are Evil

November 14th, 2008

Everyone likes an analogy, because a good analogy transforms a new and difficult concept into something familiar and easy to understand.

I don’t understand quantum physics, but I understand how my post is delivered! Thanks Professor McGarrigan!

And analogies are good. Sometimes. The problem is the person explaining the concept is rarely completely free of prejudice. Everyone has an ulterior motive. Even if they aren’t aware of it. And when choosing an appropriate simile the perpetrator will either consciously or unconsciously align you with their way of thinking. Practically, analogies are a kind of fallacy.

Politicians and marketing people use this to their advantage frequently. Associating groupthink from a topic people are passionate about to their mandate. And sadly it works. It works very well.

Really my only conclusion for you, my humble reader, is to do the same. But probably, you already do ;)

I finish up with a bad simile that you probably already hate:

Pirating music is stealing

Respond »

Filelight on The Big Bang Theory?

May 8th, 2008

Today I got an anonymous message:

I think there was a filelight harddrive poster on the wall in “big bang theory” Season 1 Ep. 11

Can anyone confirm?

3 Comments »

Spotlighting the London Underground

April 21st, 2008
  1. Download the Tube Map pdf from TFL
  2. Save it somewhere you won’t delete it, eg ~/Documents/
  3. Spotlight search for a tube map, eg Command-space, Tufnell Park

Spotlight will open the map with the Tufnell Park highlighted! :) So now you know where it is and what line to get.

OS X is awesome.

1 Comment »

Using TortoiseSVN from the Command Line

March 26th, 2008

I like to use CygWin, I find, at least for development, it preferable to use the command line to explorer for opening and manipulating files. However TortoiseSVN is better than command line SVN in a few important areas. So I made a script so that “svn ci” open Tortoise’s check-in dialog. Ace! :)

  1. Save this script to /usr/local/bin/svn (ie. c:\cygwin\usr\local\bin\svn)
  2. Ammend the svn variable
  3. chmod u+x /usr/local/bin/svn

As long as /usr/local/bin is first in the path, you can use TortoiseSVN for the good bits, and the command line svn client for the rest.


#!/bin/sh
# Use TortoiseSVN from the cli
# Public Domain, Max Howell 2008

path=$2
test -z $path && path=.
test -e $path && path=`cygpath -wa $path`

svn='/cygdrive/c/progra~1/TortoiseSVN/bin/TortoiseProc.exe'

function svn
{
"$svn" /notempfile /command:"$1" /path:"$path" &
}

case $1 in
up | update) svn update;;
ci | commit) svn commit;;
log) svn log;;
props) svn properties;;
browse) svn repobrowser;;
*) /usr/bin/svn $@;;
esac

You can also use your ssh key from cygwin through TortoiseSVN. Some details here.

But the gist is use this, C:/cygwin/bin/run C:/cygwin/bin/ssh, in the ssh program box in TortoiseSVN network settings.

3 Comments »

Overriding Qt Classes

February 26th, 2008

We had a need to override the QSystemTrayIcon::showMessage() function on mac specifically across multiple projects. The trouble is ensuring that developers use the override function even if they don’t know about it. So:


namespace Moose
{
    class QSystemTrayIcon : public ::QSystemTrayIcon
    {
    public:
        void showMessage( const QString& title, const QString& text )
        {
            //code
        }
    };
}

#define QSystemTrayIcon Moose::QSystemTrayIcon

Name the file “QSystemTrayIcon” and save it in a directory like QtOverrides. Then add the following to your qmake project file:

CXX = $$CXX -IQtOverrides

Which forces our override directory to be earlier in the include path than the Qt includes.

This method scares me somewhat, due to the define, but I couldn’t see a neater way of doing it.

Now if a developer #includes <QSystemTrayIcon> they will be using our stealth reimplementation.

Of course this method isn’t virtual, but that shouldn’t be a problem, people don’t tend to use QWidgets in a way that requires polymorphism. Well that’s a lie, but most methods are safe, on final-type classes.

Respond »