1. Top Skaters


    This is what my final day at last.fm looked like.


    In the morning, this.



    Last.fm 720° team


    <p> In the evening, this.<p>

    Yes, I'm working on getting a MAME cab smuggled into Moonfruit.

    posted by cms on
    tagged as
  2. Self cleaning eggs : Guillemot eggs have a surface microstructure that makes them self-cleaning eggs, like a birds egg, EGG.

    posted by cms on
    tagged as
  3. This afternoon I went on a short guided tour of the decomissioned Royal Navy submarine, HMS Ocelot . It's in a dry-dock at the Royal Dockyards working museum at Chatham , just 20 minutes down the road from home.


    Apologies for the poor quality of the photos. I only had my iPhone, with 15% remaining charge, and submarines do not offer much in the way of natural lightning.


    HMS Ocelot


    Despite having owned a year pass for the best part of a year, and frequently admired the Ocelot from the outside, this is the first time I've been aboard. The tour is short, cramped, and completely fascinating, although perhaps not for the squeamishly claustrophobic, and definitely not for the mobility impaired.


    The Dockyards is a superb example of a modern lottery-assisted regeneration project. There's several large ships in dock you can wander around, huge warehouses full of boats and machinery to pore over, a ropery, an art gallery space, a working steam railway, several sub museums. Far more than you can do in a single visit, but your ticket, once purchased, is good for 12 months of repeat admission.

    posted by cms on
    tagged as
  4. Crumb : A thorough interview with R. Crumb dating from around the the publication of Genesis

    posted by cms on
    tagged as
  5. If you have a Mac, and you use Terminal.app to run UNIX commands, try executing this for a cool shell prompt


     export PS1="\360\237\220\232 $ "

    See what I did there?


    If you are using a UTF-8 encoding for your terminal, which you probably are, and if you're using a recent OS X, and have the right fonts installed, which you probably do, you should have a little sea-shell graphic for your prompt. Literally a cool shell prompt.


    Screen Shot 2013 04 09 at 19 11 42


    In a recent revision to Unicode , code points were assigned for many emoji. Emoji-what-now? These are little emoticon glyphs that rose to popularity in Japan . Apple have included a nice typeface with full colour icons for a subset of these in the last couple of releases of both iOS and OS X, so you can use them in most applications that use the system type rendering library, like Messages. On OS X, this includes the bundled Terminal.app terminal emulator. So you can print little icons in your shell, if you know an encoding for a particular glyph.


    Here's the ever popular 'pile of poo' (  U+1F4A9


    Screen Shot 2013 04 09 at 20 09 46


     


    Not sure what that is supposed to be used for, but it's terribly popular on the internet. "But how", I hear you ask, "do you find out the encoding sequences for these appealing novelties?"


    Well, you can search for unicode code tables on the internet. On the Mac though, the easiest thing to do is probably to enable the Character Viewer tool via the Language and Text System preference pane. 


    Screen Shot 2013 04 09 at 20 19 23


    This gets you a panel like this, where you can browse all the characters your computer knows how to render, including all the emoji sets, and find out their Unicode code points, and more importantly, a way to encode that code point in UTF-8.


    Character viewer copy  


    So, as you can see in my fecal example, the UTF-8 byte sequence for 'pile of poo' ( U+1F4A9 ) is F0 9F 92 A9, and we can print that in a bash shell, using echo  with the -e flag to enable interpreting of escape sequences, using the \x escape prefix to indicate bytes in hex. 


    Going back to the original shell trick, the shell emoji (  U+1F41A ) has the UTF-8 encoding F0 9F 90 9A. The bash shell doesn't seem to have an escape sequence for hex encoded bytes in it's prompt string, but it does interpret 3 digit codes prefixed with a plain \ as octal encoded literal bytes, so if we convert this hex string to four octal numbers, using bc or od, or emacs or just Calulator.app, we get the escape sequence from my initial shell example - "\360\237\220\232"


    So far so cute. But is there anything vaguely useful you can do with this sort of thing? Sort of. A picture's worth a thousand words. So we could perhaps encode mnemonic information in icons, and somehow dynamically update the prompt to reflect this.


    Bash will execute the contents of an environment variable PROMPT_COMMAND as a shell command immediately before the shell prompt is printed. Typically this is used to update terminal colours or title strings with escape sequences, or update PS1 to add some content that can't be printed using the built-in prompt escape functions. I decided to make my prompt respond to the result of my most recent command.


    Here's the relevant shell glue I just stuck in my .bashrc 


     
    emoji ()

     export PROMPT_COMMAND='PS1=$(emoji $?)'

    This runs a shell function called emoji in a subshell, which returns a string based on the input argument. The input argument I'm using is the exit status of the last shell command. This gets me a smiley face in my shell prompt, unless the last command I ran returned a non-zero exit state, which in UNIX, indicates a problem happened. This makes my prompt draw as a 'confused smiley', if something has gone wrong.


    Screen Shot 2013 04 09 at 20 41 56


    Still cute, and almost useful!


    I think I'll keep it for a while.


     

    posted by cms on
    tagged as
  6. I'm experimenting with desktop email clients again.


    I like Apple Mail a lot, it's one of my favourite examples of GUI desktop application, but the last couple of iterations have made it a little more clumsy to use with keyboard navigation, and it doesn't scale terribly well to managing multiple, high-volume IMAP accounts. Particularly, I find refiling groups of similar emails to be more labour intensive than this task would seem to require. By means of contrast I love  refiling mail on my iPhone using Apple Mail for iOS, in truth I love using Mail on my iPhone for any mail task way more than I'd expect, it's insanely usable for an email client on a tiny, squeezable hand-toy. 


    The real impetus for investigating a desktop alternative has come from our recent switch to using GMail for our corporate mail service at work. I hate google mail's not-quite-IMAP IMAP implementation, I hate it's sluggish IMAP performance through Mail.app, and I hate hate hate  it's god-awful webmail interface. So I've been putting some thought into rethinking the way I process email. Naturally my first line of attack is to retreat to emacs .


    I've used emacs for mail before, on and off. When I first switched to using linux for my desktop systems, way  back in the 90s, I used gnus on emacs for mail for a while, then when I made the switch to XEmacs  for a couple of years I discovered VM , which was my main INBOX on and off, following me back to GNU Emacs, with occasional experiments with Netscape Navigator , and Evolution up until I switched to a Mac full-time, around 2001. I do recall trying Thunderbird a couple of times, but I could never tolerate it for much longer than a half-hour. I also used Wanderlust for emacs for a few months when I first started working at last.fm, but I switched to using a Mac at work shortly after that, and added my work email to my Apple Mail setup. 


    This time around I'm trying to re-organise the way I approach mail fundamentally. A few years ago, I started deleting mail after I'd read it, unless I definitely felt it warranted keeping. I really liked the feeling of freedom that seemed to open up, releasing me from worrying about tidy filing of hierarchical mail archives that always needed archiving and backing up. Inspired by GMail's approach to tagging and searching, the mail I did keep I filed into a small set of IMAP buckets and indexed them in Apple Mail with labels and "smart folder" searches. So I'm trying to push that even further, and I'm trialling mu , a decidedly minimalist interface to email.


    mu works over a local mail store, ideally Maildir . So I've started syncing my work GMail account to my laptop, using the mature, Free software syncing tool offlineimap ( I installed it from macports ). offlineimap has specific GMail support, and it's super-easy to set this up to sync to a GMail account, although I had to add a 


     folderfilter = 
    lambda foldername: foldername not in ['[Gmail]/All Mail']

    to the account configuration in ~/.offlineimaprc to stop it syncing the Gmail "All Mail" filter as an IMAP folder, meaning I had 2 copies of every email going down. I set up a User launch agent via launchd to run offlineimap every 5 minutes, syncing to ~/Library/OfflineIMAP/lastfm/


    Once the mail was syncing both ways, I ran 


     MAILDIR=~/Library/OfflineIMAP/lastfm/ mu index 

    to initialise the mu indexes. I can now explore the mail archive from the shell using commands like 


     mu find from:jira date:2w..today

    which would return a summary list of emails matching the search criteria (i.e. all mail sent from JIRA in the last 2 weeks). mu is based on the xapian indexer library, and these queries run lightning-quick. The indexing process is thus entirely separate from the imap sync, and the indexes need to be updated by re-executing the 'mu index' command to keep them fresh. This takes fractions of a second after the original indexes are built.


    I'm not really interested in running searches from the shell though. mu is really an archive browser ; ideal for integrating with other mail reading and sending utilities. mu ships with a nice keyboard friendly emacs interface called mu4e . mu4e offers quick navigation short cuts to browse IMAP folders, a simple syntax to mu searches, and a list of bookmarked searches, much like virtual folders. mu4e can be set to periodically update the mu index, and even run a Maildir sync, such as offlineimap. Here's the config elisp block from my startup files. 


     (setq-default
    mu4e-maildir "~/Library/OfflineIMAP/lastfm"
    mu4e-drafts-folder "/Drafts"
    mu4e-trash-folder "/Deleted Messages"
    mu4e-sent-folder "/Sent Messages"
    mu4e-refile-folder "/Archive"
    mu4e-mu-binary "/usr/local/bin/mu"
    mu4e-sent-messages-behavior 'delete
    mu4e-get-mail-command "true"
    mu4e-update-interval 300)

     all of which is quite straightforward. The root of the various folder paths is the top level Maildir. mu4e-sent-messages-behaviour is set to the symbol delete, which is recommended for GMail accounts, as GMail auto populates one of it's magical pretend folders with all sent messages. I have set mu4e-get-mail-command to true because I prefer to have the Maildir synced via my launch agent, independently from emacs.


    There's a very nice mu4e manual which documents the package in detail, I haven't managed to work through it all yet. So far I'm managing quite well with manual searches, and the default set of keybindings and stored bookmarks. List view management follows the usual emacs semantics of building up 'marks' on list entries and then applying the actions in bulk, familiar to habituated emacs users from org-mode , wanderlust, dired etc. 


    The mail and editing and sending is borrowed from the usual emacs GNUS / smtpmail combination, which is fine, as these work perfectly well.


    I've found only one tricksy wrinkle; mu4e, like any sensible thing expects email to be in plain text. If the viewer is summoned on a rich text ( usually HTML ) mail, it tries to convert it to plain text for viewing. By default is set up to use emacs built in html2text  method, which frankly sucks, and failed to convert the majority of HTML mail in my INBOX. mu4e has a configuration variable mu4e-html2text-command option to use an external conversion command. This should be a utility that accepts HTML input on stdin, and returns converted text on stdout. The manual suggests using the python-html2text utilities, but I think on a Mac it makes more sense to use the mildly obscure, but occasionally useful, Apple provided shell tool -  textutil


    It needs to be invoked like this to work with mu4e. 


      (setq mu4e-html2text-command
    "textutil -stdin -format html -convert txt -stdout")

    And with that, everything works great. I'm going to try living with it for a few weeks before I customise it further, but I'm looking forwards to setting up Wanderlust-style dynamic refiles, and integrating crypto support, so I can return to GPG encrypting and signing my mail again, like I ought to, at my age. Never forgetting, of course, cms 1st law of software :- "All mail clients suck, intrinsically"

    posted by cms on
    tagged as
  7. Junk.fm : We're moving offices, leaving some stuff behind.

    posted by cms on
    tagged as
  8. In November 1955, Bo Diddley was booked to play live on the Ed Sullivan show, the middle America's favourite TV variety show. As legend has it, he was booked to play a single tune, but he misinterpreted his cue card, which had his name, followed by a song title, launched into his, perhaps slightly racy for the times, eponymous calling card - "Hey, Bo Diddley!", immediately following it with the song he was booked to play, the only slightly more sedate "Sixteen tons". They tore the roof off the house, and got themselves banned from the show. 


    Here's a particularly rocking performance from 1965



    That lady on the second rhythm guitar is known as The Duchess .


    Not many musicians get to name their own beat. And in this case, it's a beat that refuses to die. Not many musicians can play it well, but that hasn't stopped them trying through the years. I put a playlist of the most egregious examples I could find up on spotify . There's some direct lifts, some re-interpretations, some slightly tenuous reaches, and hopefully some surprises. It's an editable playlist, so please feel to add any that you find.



     


    I feel sure there ought to be a Spiritualized song in there, but for the life of me I can't find one from memory.


    Once you get into the habit of spotting them, it's quite an addictive hobby. I find that I often only spot them a while after I've picked out a song as an earworm.

    posted by cms on
    tagged as
  9. If you find that your Mac's 'Open With' menu is growing cluttered with identical menu entries for the same application, this indicates that your Launch Services database is confused. 


    In the normal course of action your computer scans for entries to merge into this database at boot time, and then at login for the user domains. The Finder updates it with new application information, as and when new App or Framework bundles are encountered during it's normal operation. Unfortunately this database does seem to be capable of becoming persistently corrupted, which will result in symptoms like a duplicate-riddled 'Open With' menu, or incorrect or inconsistent Filetype/Application associations. 


    On Mountain Lion, you can interact with the system database from the shell, using the lsregister utility. Run it without arguments to get basic usage instructions. It is not on any default, paths, it's buried away inside /System/Library/Frameworks/CoreServices.framework .


     /System/Library/Frameworks/CoreServices.framework

     /Versions/A/Frameworks/LaunchServices.framework

     /Versions/A/Support/lsregister -dump 

    will show you the current database in human readable form. To scrap and rebuild the database completely you might do something like this 


     /System/Library/Frameworks/CoreServices.framework

     /Versions/A/Frameworks/LaunchServices.framework

     /Versions/A/Support/lsregister -kill -all u,s,l -r -v 

    The -domain argument there is specifying that we should recursively ( -r ) scan for bundle directories in the the u ser, s ystem and l ocal domains (i.e. "~/ /" , "/System/ ", and "/ " ) and register their document type bindings and other information with the Launch Services agents, which will update their database with this information. The -v switch turns on progress logging, which is all done to stderr.


    If you're in the habit of installing apps or library bundles to some alternative roots than the builtin domain types, you can add those paths to the command, instead of the domain flags.

    posted by cms on
    tagged as
  10. Rat Avatar : A research project has seen human subjects control a rat-sized robot, and rats control a human-shaped avatar in a VR environment.

    posted by cms on
    tagged as