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

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
  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.


# 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/dev/tools/TortoiseSVN/bin/TortoiseProc.exe /notempfile'

case $1 in
up | update) $svn /command:update /path:"$path";;
ci | commit) $svn /command:commit /path:"$path";;
log) $svn /command:log /path:"$path";;
props) $svn /command:properties /path:"$path";;
*) /usr/bin/svn $@;;
esac

Respond »

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 »

Dockless Helper Apps on Leopard

February 15th, 2008

The Last.fm client has a number of helper apps. These helper apps don’t link to QtGui so would normally not get a dock icon. However, since Leopard everything seems to get a dock icon by default if you put in the Contents/MacOS directory of your bundle.

There are two solutions that we found for this problem.

  1. Bundlise the binary

    This is more packaging work and feels lame. You can cheat and prevent having to copy your shared libraries into the new bundle using symlinks, ie:

    $ path=helper.app/Contents/MacOS/ mkdir -p $path && cd $path
    $ ln -s ../../../helper .
    $ vim ../info.plist
    
  2. A symlink from resources

    cd your.app/Contents/Resources/
    ln -s ../MacOS/yourapp .
    

    Launching the symlink will run the application in the background without a dock icon.

Any other solutions? Please write them below.

Respond »