1. New policy: refuse to make significant changes to systems built under time pressure until they are fully understood, i.e. have been refactored, have good test coverage etc.

  2. More fun: use the apparently undocumented /QUALIFIER = '"' (that’s a double quote inside two single quotes) option in a GET DATA to make CSV lines like

    1,5,3,4,"A text value with a comma, which is still only one cell"

    work correctly.

  3. Finally solved a long-standing problem getting Icelandic characters to work properly in files being downloaded onto Windows machines for use as SPSS syntax. Turns out the solution is to explicitly set the download charset to UTF-8, and to prepend an unnecessary BOM (yuk) to the beginning of the file as so (context: Django view):

    import codecs
    
    def export_spss(request):
        response = HttpResponse(export_spss(), status=200, mimetype="application/x-spss; charset=utf-8")
        response['Content-Disposition'] = 'attachment; filename=syntax.sps'
        response.content = codecs.BOM_UTF8 + response.content
        return response

    Why is a BOM, which should be completely unnecessary in a UTF-8 file (it has no variable byte order after all) apparently required by some Windows software in order to tell it that the file is UTF-8 encoded, despite Unicode mode being on? Sigh.

  4. Today the office dog insists on playing catch with a tiny piece of paper, which goes something like this:

    HEY HEY HEY HERE IS A SMALL SCRAP OF PAPER MAYBE YOU WOULD LIKE TO THROW IT FOR ME HMM YES PAPER

    AH HA YES THANK YOU FOR THROWING THE PAPER I WILL NOW EXCITEDLY FETCH IT AS IF IT WAS THE FINEST OF TREASURE

    EXCELLENT I HAVE DISCOVERED THE PAPER AND WILL NOW BRING IT BACK FOR THE HUMAN TO THROW AGAIN

    HUMAN HERE IS THE

    OH APPARENTLY I ATE IT SORRY I WILL FIND ANOTHER

  5. Last work morning of the year at Vísar today — really enjoyed the 9 months I’ve spent with the great people here so far. Looking forward to having a break before running a whole bunch of surveys in the new year!