1. Finally figured out how to format a memory stick for optimal compromise between compatibility and file sizes.

    The goal is to be able to stick this memory stick in anything from the last 15 years and be able to load files on and off. The implementation idea was to have two partitions, one FAT32 for compatibility with everything, and one ExFAT for wide compatibility allowing larger files.

    The mistake I made last time was using a GUID-based partition map, which rules out compatibility with older hardware which uses a BIOS. This can be rectified by using the older Master Boot Record partition map, which has some restrictions, but nothing particularly relevant in this case.

    I had no end of problems trying to achieve this with the Gnome Disks tool and GParted, and on Mac OS 10.11 it’s not possible in the Disk Utility GUI. It is, however, very easy using the command line Disk Utility tools.

    Firstly, run

    diskutil list
    

    to find out the descriptor for the device you want to format (e.g. /dev/disk2, referred to in future examples as /dev/diskX), then

    diskutil unmountDisk /dev/diskX
    

    to unmount it in preparating for formatting. I’m formatting a 64GB flash drive with 62.1GB actual capacity into two equal portions, so my command ends up looking like this:

    diskutil partitionDisk /dev/diskX MBR ExFAT NAME_OF_FIRST_PARTITION 31.1g FAT32 NAME_OF_SECOND_PARTITION 0g
    

    where the format is pretty self explanatory:

    volume partition_map partition_1_format partition_1_name partition_1_size partition_2_format partition_2_name partition_2_size
    

    The size of partition two is given as 0g, which results in the rest of the available space being taken.

    A list of available filesystems for formatting can be browsed with:

    diskutil listFilesystems
    

    I just tested the newly formatted universal memory stick with a computer with which it previously didn’t work, and it worked perfectly, so I’m confident that this approach achieves my original goal.

  2. It’s possible, however unlikely, that my new €20 printer is somehow ACTUALLY GOOD. It joined our wifi! Replacing the ink was seamless! It prints blank music stave paper! It has ink available in extra-large cartridges which still cost more than human blood but might possibly be more economical than usual! My computer discovered it automatically! It has nice UI touches, like a old-phone style keyboard for text entry which disappears when not needed! All in all, maybe this is finally a not horrible printer.

    Maybe.

  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. Email-related incident at work proves yet again that noreply@ email addresses harm your business. Always let people reply to a human, even if the email was sent by a robot.

  5. Broken your mac by removing the execute permissions on /bin/bash, or otherwise need to get shell access to fix something? (Say, for example, you were foolishly trying to patch shellshock). Don’t worry! It’s concerningly easy.

    1. Reboot your mac holding down Cmd+R
    2. Go Utilites → Terminal
    3. You’re currently in a recovery partition. cd /Volumes/Macintosh HD/bin
    4. Do whatever you need to do to fix your machine, e.g. chmod a+x bash
    5. Restart, and everything should be fine.
  6. “…the very act of building information technologies is also the act of creating specific moral systems”

    “Information technologists may therefore be in the business of creating moral systems whether they know it or not and whether or not they want that responsibility.”

    Information Technology and Moral Values, Stanford Encyclopedia of Philosophy
  7. demonstrates poor voter turnout not solved by fancy technology (to “engage the young people”) but by giving people a choice that they feel empowered by.

    Update: more electronic voting skepticism in this report (warning: PDF), also has interesting data on gender in voting.

  8. I’m getting too used to (puredata.info) — I just right-clicked a python class and expected a hypermedia “help” option with params, example usage etc.

    Jetbrains PyCharm does have an inline documentation feature, which (when invoked via a complex keyboard “shortcut”), produces this gem:

    Even when this feature does work, it shows code “documentation” in a monospace font, typically with no usage example or links to other relevant documentation, as is standard in puredata.

    Our tools are inadequate.

    Update: added puredata documentation for comparison:

    In case it’s not clear from the screenshot, that usage example is live code — it can be interacted with, changed, copied and pasted, played with, experimented with. We typically can’t do that with existing text-based code, let alone mere usage examples.

    More thoughts I want to add to this, but I will write them up as a full article.

  9. : bitcoin is simply a random number generator. In every other alternate reality, it went wrong and was de-bunked almost immediately, but we’re in the one where the random numbers always match our expectations, providing the illusion of causality.

  10. Remote filesystem autocomplete in the terminal never fails to feel a little like the sort of seamless magical consistency across physically separate systems which is so lacking in tech.

  11. Wow, I think I just got my first recruiter spam. They asked me to check out their website but gave no link. This is a tech industry rite of passage, right?