Quantcast
Channel: as days pass by
Viewing all 158 articles
Browse latest View live

Print to Google Drive in a non-Gnome desktop

$
0
0

Jeremy Bicha wrote up an unknown Ubuntu feature: “printing” direct to a Google Drive PDF. I rather wanted this, but I don’t run the Gnome desktop, so I thought I might be out of luck. But no! It works fine on my Ubuntu MATE desktop too. A couple of extra tweaks are required, though. This is unfortunately a bit technical, but it should only need setting up once.

You need the Gnome Control Centre and Gnome Online Accounts installed, if you don’t have them already, as well as the Google Cloud Print extension that Jeremy mentions. From a terminal, run sudo apt install gnome-control-center gnome-online-accounts cpdb-backend-gcp.

Next, you need to launch the Control Centre, but it doesn’t like you if you’re not running the Gnome desktop. So, we lie to it. In that terminal, run XDG_CURRENT_DESKTOP=GNOME gnome-control-center online-accounts. This should correctly start the Control Centre, showing the online accounts. Sign in to your Google account using that window. (I only have Files and Printers selected; you don’t need Mail and Calendars and so on to get this printing working.)

Then… it all works. From now on, when you go to print something, the print dialogue will, after a couple of seconds, show a new entry: “Save to Google Drive”. Choose that, and your document will “print” to a PDF stored in Google Drive. Easy peasy. Nice one Jeremy for the write-up. It’d be neat if Ubuntu MATE could integrate this a little more tightly.


Why isn’t it their job

$
0
0

Bruce Lawson has written a rather nice description of the practical value of semantic HTML, and you should read it, especially if you’re a full-stack developer who feels that HTML is the super-easy part of your toolkit and the components are the most important. But there’s one extra argument I’d like to add to his list; less important than some of the others, but a different nuance.

Sometimes, when I find myself doing a bit of extra work to accommodate some users with unusual requirements, I find myself thinking: why isn’t it their job to fix this, rather than mine? This is an unworthy thought, and I don’t like that I have it, and I don’t respond to this thought; doing the right thing so all my users can use my stuff is important. But I do have the thought, nonetheless. Whether I’m adding aria labels for screenreaders, or doing extra work to build sites that layer behaviour on top as additional rather than critical, or checking text contrast ratios, or testing on unusual mobile phones I don’t and won’t have, there’s a sneaky little bit of my brain saying “why is this my problem? if someone wants to buy a weird phone, it’s their problem that websites don’t work right, isn’t it?”

Leave aside here, for now, that there is no such thing as a “normal” experience, and even saying that people differ from the “normal” experience means that you are thinking about things the wrong way because you’re assuming that there is a normality and then there’s divergence and that’s wrong. I know this. You know this too, or at least should.

Here’s the secret. Someone who has a web experience different from what the industry perceives as the norm is normally actually pretty happy to try, for themselves, to make their web experience better. Someone with poor motor control generally will be happy to learn the keyboard shortcuts for their browser, which the “norm” don’t bother to do. Someone who listens to the web rather than reads it generally will be happy to learn how to skip over your header using an option available in their tool but not yours, so you don’t have to add “skip header” links. Someone who is desperate for all bold text to appear in bright green and with sparkles generally will be happy to learn how to customise their user stylesheet to make that happen.

The secret is: if you use semantic HTML, then they do the work, not you. Their browser does the work, not you. If your pages use semantic HTML, you’re not going to get bug reports saying that your web app doesn’t work in a screenreader, or your buttons don’t work without mouse clicks, or your site doesn’t show anything on a Yoyodyne SuperPhone 3 running FailBrowser, because it will and they will and it will. And using semantic HTML elements is no more effort; it’s just as easy to use <main> as it is to use <div id="main">. Easier, even. You get to offload some of that work onto the people who need it, and they are happy to do it, as long as you aren’t actively working to stop them.

Brum tech pub crawl 2018

$
0
0

It’s time for the Birmingham tech pub crawl! Saturday 29th December 2018.

This is called a pub crawl, but it’s really an excuse to get together, hang out, have a couple of drinks — alcoholic or not, that’s entirely up to you and there’s no pressure — in various places around the Jewellery Quarter. Get away from the turkey and chill out and meet people. Bring your family and your friends along. Pop in for an hour while you’re in town and say hello, or show up at 12 noon and still be there at midnight, it’s up to you. Lots of people come at various points during the day, and it’s all very friendly, so if you don’t think you know anyone, or you’re on your own, that’s not a problem. Come, chat to people, have a drink, have a laugh. The agenda this year is, roughly, six different places and a couple of hours in each, so we move around a bit, but it’s all in the Jewellery Quarter so there’s not a lot of walking. If you’re feeling unsure do feel free to ping me — @sil on Twitter — and I can tell you where we are, and I’ll try to keep things updated during the day. Everyone is welcome, and everyone is invited.

A rough agenda:

  • The Lord Clifden, 12pm - 2pm (they do food if you fancy lunch)
  • The Church, 2pm - 4pm
  • 1000 Trades, 4pm - 6pm
  • The Rose Villa Tavern, 6pm - 8pm (probably grab a bite to eat here if we haven’t already)
  • The Queen’s Arms, 8pm - 10pm
  • The Actress and Bishop, 10pm - whenever

Chicken McNuggets

$
0
0

Back in the old days, when things made sense, you could buy Chicken McNuggets in boxes of 6, 9, and 201. So if you were really hungry, you could buy, for example, 30: two boxes of 9 and two boxes of 6. If you weren’t that hungry you’re a bit scuppered; there’s no combination of 6, 9, and 20 which adds up to, say, 14. What if you were spectacularly hungry, but also wanted to annoy the McDonalds people? What’s the largest order of Chicken McNuggets which they could not fulfil?

Well, that’s how old I am today. Happybirthdaytome.

Tomorrow I’m delivering my talk about The UX of Text at BrumPHP, and there may be a birthday drink or two afterwards. So if you’re in the area, do drop by.

Best to not talk about politics right now. It was bad two years ago and it’s worse now. We’re currently in the teeth of Brexit. I thought this below from Jon Worth was a useful summary of what the next steps are, but this is no long-term thing; this shows what might happen in the next few days, which is as far out as can be planned. I have no idea what I’ll be thinking when writing my birthday post next year. I’m pretty worried.

Right, back to work. I’d rather be planning a D&D campaign, but putting together a group to do that is harder than it looks.

  1. yes, yes, now you can get four in a Happy Meal, but that’s just daft. Who only wants four chicken nuggets?

The ray-traced pictures

$
0
0

A two-decade-long search is over.

A couple of years ago I wrote up the efforts required to recover a tiny sound demo for the Archimedes computer. In there, I made brief mention of a sample from an Arc sound editor named Armadeus, of a man saying “the mask, the ray-traced pictures, and finally the wire-frame city”. That wasn’t an idle comment. Bill and I have been looking for that sample for twenty years.

You’re thinking, I bet it’s not been twenty years. And you would be wrong. Here’s Bill posting to comp.sys.acorn in 2003, for a start.

My daughter knows about this sample. Jono knows about it. I use the phrase as a microphone test sentence, the same way other people use “testing, testing, 1, 2”. It’s lived in my head since I was in middle school, there on the Arc machines in CL0, which was Computer Lab Zero. (There was a CL1, which had the BBC Micros in it, on the first floor. I never did know whether CL0, which was on the ground floor, was a subtle joke about floor levels and computers’ zero-based numbering schemes, or if Mr Irons the teacher was just weird. He might have been weird. He thought the name for an exclamation mark was “pling”.)

Anyway, we got to talking about it again, and Bill said: to hell with this, I’ll just buy Armadeus. This act of selfless heroism earns him a gold medal. And a pint, yes it does. I’ll let him tell the story about that, and the mindblowing worthlessness of modern floppy drives, in his own time. But today it arrived, and now I have an mp3!

Interestingly, I thought it was in the other order. The sample actually says: “The ray-traced pictures. The mask. And finally, the wire-frame city.” I thought “the mask” was first, and it isn’t. Still, memory plays tricks on you after this many years. Apparently it’s from a Clares sound and music demo originally (Clares were the (defunct) company that made Armadeus. The name appears to have risen from the dead a couple of times since. No idea who they are now, if anyone.) Anyway, I don’t care; I’ve got it now. And it’s on my website, which means it will never go away. We found it once before and then lost the sample; I’m not making the same mistake again. Is this how Indy felt when he found the Ark?

Also, a shout out to arcem, which is an Archimedes emulator which runs fine on Ubuntu. It’s a pain in the bum to set up — you have to compile it, find ROMs, turn on sound support, use weird keypresses, set up hard drives in an incomprehensible text file, etc; someone ought to snap it or something so it’s easier — but it’s been rather nice revisiting a lot of the Arc software that’s still collected and around for download. Desktop sillies. Someone should bring desktop sillies back to modern desktops. And reconnecting to Arcade BBS, who need to fix all their FTP links to point to telnet.arcade-bbs.net rather than the now-dead arcade.demon.co.uk. I got to watch !DeskDuck again, which was a small mallard duck that swum up and down along the top of your icon bar. And a bunch of old demos from BIA and Arcangel and so on. I’d forgotten a bit how much I liked RISCOS, and in particular that it’s so fast to start up. Bring that back.

Nice one Bill. Time for a pint.

Three HomeSignal femtocell for bad coverage

$
0
0

My flat has terrible mobile coverage. It’s okaaaay-ish in the living room and dead in the bedrooms, and it’s infuriating. You might be thinking, but Stuart! you live right in the centre of Birmingham! surely coverage in a city centre would be amazing! at which point you will get a look like this

:|

and then I will say, yeah, it’s something to do with the buildings or concrete or something, it’s fine when you’re outside. It’s an old building. Maybe they put copper in the walls like in the Rookery or something. Anyway, whatever, it never worked, regardless of which operator you’re on. So, when I moved in, I contacted my operator, Three, and said: this sucks, do something about it. They said, sure thing, install our Wi-Fi Calling app, Three in-Touch. Which I did, and managed for two years.

I say “managed” because that app is terrible. The UI is clunky, it doesn’t handle picture messages, there’s no way to mark a message read, the phone call quality cuts out and breaks all the time, and most annoyingly when you get an SMS it shows a notification but doesn’t play a sound, so I have no idea that I got a notification1. I’ve missed loads of SMSes over the last couple of years because of that.

Anyway, the Three In-Touch2 app popped up a little dialogue box last week:

We are updating our network. From 15 May 2019, the Three inTouch app will no longer be supported. Your call history and SMS sent or received will remain visible but you will no longer be able to make calls or send or receive SMS through the app. If you delete the app, your call and SMS history will be lost. WiFi calling is already built into most handsets these days and will continue to work in any enabled handset without need of the app

Ah, thought I. WiFi calling is already built in, is it?

You see, there’s a problem with that. On iOS it’s built in. On Android, on a lot of phones, it’s built in only if you bought the phone from your carrier, which I never do. It needs some special bit of config built into the firmware for wifi calling to work.3 So I thought, well, I’m screwed then. Because Three won’t update my Z5 Compact to have whatever firmware it needs to do wifi calling, they’ve killed the (execrable, but functional) app, and I’m not buying a new phone until the phone industry stops making them the size of a football pitch.4 I got on the live chat thing with Three, who (predictably) said, yeah, we’re not sending you the firmware, pull the other one, son, it’s got bells on.5

And then, a surprise. Because they said, howsabout we send you a Three HomeSignal device? It’s a box that plugs into your wifi and then your phone sees it as a phone antenna and you get good coverage.

And my brain went, what, a femtocell? A femtocell like I asked you about when I first started having coverage problems and you swore blind didn’t exist because everyone has wifi calling now? One of those femtocells?

Having been taught to never look a gift femtocell in the mouth, though, I didn’t say anything except “yes please I’d like that, cheers very much”. And so it arrived in the post two days later. Result.

However, the user guide leaves a bit to be desired.

The Three HomeSignal user guide, which says to plug in the ethernet cable and the power, and does not at all mention that it also needs a SIM card

I do not know why the user guide completely ignores that you need to also plug a SIM card into the HomeSignal device, but it does in fact ignore that. You should not ignore it: you need to do it, otherwise it doesn’t work; you’ll get an error, which is the LED flashing red five times, which means (in the only mention of a SIM anywhere in the user guide) “SIM card problem”. At which point you think: what bloody SIM card?

More confusingly still, Three include twoSIM cards in the package. One is a Pay as you Go SIM. This is not the one you want. I don’t know why the hell they put that in; fine, if you wanna sell me on your products, go for it, but you made the HomeSignal process a billion times more confusing. The SIM card that goes into the HomeSignal device is on a special green card, and it says “HomeSignal device only” on it. Put that one in the HomeSignal box. The other one, the Pay as you Go one, you should sellotape it to a brick and then send it back to Three, postage on delivery.

Once you’ve done that, it works. So, Three, if you’re listening: one bonus point for finally deciding to update the awful Three in Touch app. Minus twenty points for not having a replacement for people who didn’t buy phones from you. Plus another twenty points for offering me the Three HomeSignal femtocell which fixes my problem. Minus a little bit for the bad instructions which don’t say that I have to put a SIM card in, and then minus quite a lot more for putting twoSIM cards in the box when I do finally work that out! So, on balance, this is probably about neutral; they have fixed a problem I shouldn’t have and which is partially caused by phone manufacturers, using a technically very clever solution which was confusingly explained. Business as usual in the mobile phone world, I suppose, unless you’re using an Apple phone at which point everything works really smoothly until it suddenly doesn’t. One day someone will get all of this right, surely?

  1. They have had, looking at the internet, this reported to them about six hundred billion times
  2. they don’t seem to be anything like consistent about the spelling and punctuation of the name of this app, so I don’t see why I should be either
  3. It seems like this might be fixed in very recent versions of Android? It’s not at all clear. This problem is of course exacerbated by not getting system updates unless your phone is less than a week old.
  4. I saw a bloke on Twitter the other day say rather sneerily, I bet all the people who are mocking folding phones like the Samsung Fold now also mocked the Samsung Note until they realised they like big screens after all. No, sneery bloke. I mock the folding phones now for being a (terribly clever technical) solution in search of a problem, I hated the huge Note when it first came out, and I hate all huge phones now. For god’s sake, phone industry, make a small flagship phone. Just one. I suppose it’ll have to be an Xperia Compact again, but it’d be good if there were competition for it.
  5. They also said that they’re rebuilding the Three inTouch app to be good and work with 5G. Apparently. At some unknown point in the future. I carefully did not point out that if you’re building a replacement for something then there needs to be overlap between the two things rather than an interregnum during which every user is screwed, because that information needs to go to their project manager rather than their support team, but to be clear: to whichever project manager thinks this is an acceptable way to do deployments, I hope someone hides snakes in your car.

Pyramid

$
0
0

I keep wanting this quotation and not being able to remember half the things in the list, so I’m putting it on my website: this is what websites are for.

It’s from The Official Slacker Handbook by Sarah Dunn, which I painstakingly tracked down and purchased a second-hand paper copy of to find this, and it reads:

Adam Weishaupt, founder of the Order of Illuminati, killed George Washington and served himself as our first president for two terms. The Illuminati are ultimately responsible for the French Revolution, the Bolshevik revolution, the American Revolution, the Pope, the Kennedy assassination, the Manson family, the Rockefeller dynasty, the numbers 5, 17, and 23, the New Age movement, the Nazis, UFO visitations, the Universal Price Code, and the pyramid with the eye on the back of the dollar bill.

No comment on whether I believe any of this, but of course that’s just what they want you to think. Fnord.

Brum tech pub crawl 2019

$
0
0

It’s time for the Birmingham tech pub crawl! Saturday 28th December 2019.

This is called a pub crawl, but it’s really an excuse to get together, hang out, have a couple of drinks — alcoholic or not, that’s entirely up to you and there’s no pressure — in various places around the Jewellery Quarter. (There was discussion of being in the city centre, or in Digbeth, but since it’s a Saturday and we want to talk rather than scream over the music, the JQ it is.) Get away from the turkey and chill out and meet people. Bring your family and your friends along. Pop in for an hour while you’re in town and say hello, or show up at 12 noon and still be there at midnight, it’s up to you. Lots of people come at various points during the day, and it’s all very friendly, so if you don’t think you know anyone, or you’re on your own, that’s not a problem. Come, chat to people, have a drink, have a laugh. The agenda this year is, roughly, six different places and a couple of hours in each, so we move around a bit, but it’s all in the Jewellery Quarter so there’s not a lot of walking. If you’re feeling unsure do feel free to ping me — @sil on Twitter — and I can tell you where we are, and I’ll try to keep things updated during the day.

Everyone is welcome, and everyone is invited. Bring friends along; drink coffees or soft drinks; pop in for an hour; whatever you fancy. Tell everyone about your pressies, talk about all the tech you thought about over the Christmas period, or don’t talk about technology at all and just enjoy hanging out with your mates. Looking forward to seeing you all.

A rough agenda:

  • The Lord Clifden, 12pm - 2pm (they do food if you fancy lunch)
  • The Church, 2pm - 4pm
  • 1000 Trades, 4pm - 6pm
  • The Rose Villa Tavern, 6pm - 8pm (probably grab a bite to eat here if we haven’t already)
  • The Queen’s Arms, 8pm - 10pm
  • The Actress and Bishop, 10pm - whenever


The tiniest of Python templating engines

$
0
0

In someone else’s project (which they’ll doubtless tell you about themselves when it’s done) I needed a tiny Python templating engine. That is: I wanted to be able to say, here is a template string, please substitute a bunch of variables into it. Now, Python already does this, in about thirty different ways, and str.format or string.Template do most of it as built-in.

str.format works like this:

"My name is {name} and I am {age} years old".format(name="Stuart",age=43)

and string.Template like this:

t=string.Template("My name is $name and I am $age years old").safe_substitute(name="Stuart",age=43)

Both of which are pretty OK.

However, what they’re missing is loops; having more than one of a thing in your template, and looping over a list, substituting it each time. Every even fractionally-more-featureful templating system has this, whether Mustache or Jinja or whatever, of course, but I didn’t want another dependency. All I needed was str.format but with loops. So, I thought, I’ll write one, in about four lines of code, so I can just drop the function in to my Python file and then I’m good.

defLoopTemplate(s,ctx):defloophandler(m):md=m.groupdict()return"".join([LoopTemplate(md["content"],val)forvalinctx[md["var"]]])returnre.sub(r"\{loop (?P<var>[^}]+)\}(?P<content>.*?)\{endloop\}",loophandler,s,flags=re.DOTALL).format(**ctx)

And lo, twas so. So I can now do

LoopTemplate("I am {name} and my imps' names are: {loop imps}{name}{endloop}",{"name":"Stuart","imps":[{"name":"Pyweazle"},{"name":"Grimthacket"},{"name":"Hardebon"}]})

and it all works. Not revolutionary, of course, but I was mildly pleased with myself.

Much internal debate about whether loophandler() should have been a lambda, but I eventually decided it was more confusing that way, on the grounds that it was confusing me and I knew what it was meant to be doing.

A brief explanation: re.sub lets you pass a function as the thing to replace with, rather than just a string. So we find all examples of {loop something}...{endloop} in the passed string, look up something in the “context”, or the dict of substitution variables you passed to LoopTemplate, and then we call LoopTemplateagain, once per item in something (which is expected to be a list), and pass it the ... as its string and the next item in something as its context. So it all works. Of course, there’s no error handling or anything — if something isn’t present in the context, or if it’s not a list, or if you stray in any other way from the path of righteousness, it’ll incomprehensibly blow up. So don’t do that.

Number word sequences

$
0
0

I was idly musing about number sequences, and the Lychrel algorithm. If you don’t know about this, there’s a good Numberphile video on it: basically, take any number, reverse it, add the two, and if you get a palindrome stop, and if you don’t, keep doing it. So start with, say, 57, reverse to get 75, add them to get 57+75=132, which isn’t a palindrome, so do it again; reverse 132 to get 231, add to get 132+231=363, and that’s a palindrome, so stop. There are a bunch of interesting questions that can be asked about this process (which James Grime goes into in the video), among which are: does this always terminate? What’s the longest chain before termination? And so on. 196 famously hasn’t terminated so far and it’s been tried for several billion iterations.

Anyway, I was thinking about another such iterative process. Take a number, express it in words, then add up the values of all the letters in the words, and do it again. So 1 becomes ONE, and ONE is 15, 14, 5 (O is the fifteenth letter of the alphabet, N the fourteenth, and so on), so we add 15+14+5 to get 34, which becomes THIRTY FOUR, and so on. (We skip spaces and dashes; just the letters.)

Take a complete example: let’s start with 4.

  • 4 -> FOUR -> 6+15+21+18 = 60
  • 60 -> SIXTY -> 19+9+24+20+25 = 97
  • 97 -> NINETY-SEVEN -> 14+9+14+5+20+25+19+5+22+5+14 = 152
  • 152 -> ONE HUNDRED AND FIFTY-TWO -> 15+14+5+8+21+14+4+18+5+4+1+14+4+6+9+6+20+25+20+23+15 = 251
  • 251 -> TWO HUNDRED AND FIFTY-ONE -> 20+23+15+8+21+14+4+18+5+4+1+14+4+6+9+6+20+25+15+14+5 = 251

and 251 is a fixed point: it becomes itself. So we stop there, because we’re now in an infinite loop.

A graph of this iterative process, starting at 4

Do all numbers eventually go into a loop? Do all numbers go into the same loop — that is, do they all end up at 251?

It’s hard to tell. (Well, it’s hard to tell for me. Some of you may see some easy way to prove this, in which case do let me know.) Me being me, I wrote a little Python programme to test this out (helped immeasurably by the Python 3 num2words library). As I discovered before, if you’re trying to pick out patterns in a big graph of numbers which all link to one another, it’s a lot easier to have graphviz draw you pretty pictures, so that’s what I did.

I’ve run numbers up to 5000 or so (after that I got a bit bored waiting for answers; it’s not recreational mathematics if I have to wait around, it’s a job for which I’m not getting paid). And it looks like numbers settle out into a tiny island which ends up at 251, a little island which ends up at 285, and a massive island which ends up at 259, all of which become themselves1. (You can see an image of the first 500 numbers and how they end up; extending that up to 5000 just makes the islands larger, it doesn’t create new islands… and the diagrams either get rather unwieldy or they get really big and they’re hard to display.2)

A graph of the first 500 numbers and their connections

I have a theory that (a) yes all numbers end up in a fixed point and (b) there probably aren’t any more fixed points. Warning: dubious mathematical assertions lie ahead.

There can’t be that many numbers that encode to themselves. This is both because I’ve run it up to 5000 and there aren’t, and because it just seems kinda unlikely and coincidental. So, we assume that the fixed points we have are most or all of the fixed points available. Now, every number has to end upsomewhere; the process can’t just keep going forever. So, if you keep generating numbers, you’re pretty likely at some point to hit a number you’ve already hit, which ends up at one of the fixed points. And finally, the numbers-to-words process doesn’t grow as fast as actual numbers do. Once you’ve got over a certain limit, you’ll pretty much always end up generating a number smaller than oneself in the next iteration. The reason I think this is that adding more to numbers doesn’t make their word lengths all that much longer. Take, for example, the longest number (in words) up to 100,000, which is (among others) 73,373, or seventy-three thousand, three hundred and seventy-three. This is 47 characters long. Even if they were all Z, which they aren’t, it’d generate 47×26=1222, which is way less than 73,373. And adding lots more doesn’t help much: if we add a million to that number, we put one million on the front of it, which is only another 10 characters, or a maximum added value of 260. There’s no actual ceiling — numbers in words still grow without limit as the number itself grows — but it doesn’t grow anywhere near as fast as the number itself does. So the numbers generally get smaller as they iterate, until they get down below four hundred or so… and all of those numbers terminate in one of the three fixed points already outlined. So I think that all numbers will terminate thus.

The obvious flaw with this argument is that it ought to apply to the reverse-and-add process above too and it doesn’t for 196 (and some others). So it’s possible that my approach will also make a Lychrel-ish number that may not terminate, but I don’t think it will; the argument above seems compelling.

You might be thinking: bloody English imperialist! What about les nombres, eh? Or die Zahlen? Did you check those? Mais oui, I checked (nice one num2words for supporting a zillion languages!) Same thing. There are different fixed points (French has one big island until 177, a very small island to 232, a 258, 436 pair, and 222 which encodes to itself and nothing else encodes to it, for example.Not quite: see the update at the end. Nothing changes about the maths, though. Images of French and German are available, and you can of course use the Python 3 script to make your own; run it as python3 numwords.py no for Norwegian, etc.) You may also be thinking “what about American English, eh? 101 is ONE HUNDRED ONE, not ONE HUNDRED AND ONE.” I have not tested this, partially because I think the above argument should still hold for it, partially because num2words doesn’t support it, and partially because that’s what you get for throwing a bunch of perfectly good tea into the ocean, but I don’t think it’d be hard to verify if someone wants to try it.

No earth-shattering revelations here, not that it matters anyway because I’m 43 and you can only win a Fields Medal if you’re under forty, but this was a fun little diversion.

Update: Minirop pointed out on Twitter that my code wasn’t correctly highlighting the “end” of a chain, which indeed it was not. I’ve poked the code, and the diagrams, to do this better; it’s apparent that both French and German have most numbers end up in a fairy large loop, rather than at one specific number. I don’t think this alters my argument for why this is likely to happen for all numbers (because a loop of numbers which all encode to one another is about as rare as a single number which encodes to itself, I’d guess), but maybe I haven’t thought about it enough!

  1. Well, 285 is part of a 285, 267, 313, 248, 284, 285 loop.
  2. This is also why the graphs use neato, which is much less pleasing a layout for this than the “tree”-style layout of dot, because the dot images end up being 32,767 pixels across and all is a disaster.

Write more

$
0
0

I’ve written a couple of things here recently and I’d forgotten how much I enjoy doing that. I should do more of it.

Most of my creative writing energy goes into D&D, or stuff for work, or talks at conferences, or #sundayroastclub, but I think quite a lot of it is bled away by Twitter; an idea happens, and then while it’s still just an idea I tweet it and then it’s used up. There’s a certain amount of instant gratification involved in this, of course, but I think it’s like a pressure valve; because a tweet is so short, so immediate, it’s easy to release the steam in a hundred tiny bursts rather than one long exhalation. I’m not good at metaphors, but in my head this seems like one of those thermometers for charities: my creative wellspring builds up to the overflow point — call it the value of 50 — and so I tweet something which drops it back down to 48. Then it builds up again to 50 and another tweet drops it back to 48, and so on. In the old days, it’d run up to fifty and then keep going while I was consumed with the desire to write but also consumed with the time required to actually write something, and then there’d be something long and detailed and interesting which would knock me back down to thirty, or ten, or nought.

I kinda miss that. I’m not sure what to do about it, though. Swearing off Twitter isn’t really an option; even ignoring the catastrophic tsunami of FOMO that would ensue, I’d be hugely worried that if I’m not part of the conversation, part of the zeitgeist, I’d just vanish from the public discourse. Not sure my ego could cope with that.

So I’m between the devil and the deep blue sea. Neither of those are nice (which, obviously, is the point) but, like so many people before me, and I suspect me included, I think I’m going to make an effort to turn more thoughts into writing rather than into snide asides or half-finished thoughts where maybe a hundred likes will finish them.

Of course I don’t have comments, so your thoughts on this should be communicated to me via Twitter. The irony hurricane proceeds apace. (Or on your own weblog which then sends me a webmention via the form below, of course, but that’s not all that likely yet.) Check in a month whether I’ve even remotely stuck to this or if I’ve just taken the easy option.

All My Endeavour

$
0
0

A discovery.

What a return for all my endeavour—
Not to mention the L. S. D!
I am an atheist now and for ever,
Because this God has afflicted me!

It’s from Rudyard Kipling’s Natural Theology, which I’d never read and which I wholly intend to mine for lines for imploring sympathy next time I’m suffering from manflu or have a hangover or something, after having read Neil Gaiman do the same back in 2004. He was actually ill, though.

Did close friends call Rudyard Kipling “Rudy”? It’s actually short for his name, although it doesn’t sound like it. Maybe I’ve been pronouncing it wrong all these years: is he “Rudy-ard” rather than “Rud-yard”?

In fifty minutes it’s my birthday, although the annual birthday post will have to wait until tomorrow.

Yes, I know he was talking about currency. Albert Hoffman didn’t synthesise LSD for another 19 years. But it’s funny.

The most powerful birthday in the world

$
0
0
Being that this is a .44 Magnum, the most powerful handgun in the world, and would blow your head clean off…
You’ve got to ask yourself one question: do I feel lucky?
— “Dirty” Harry Callaghan

Kinda, Harry.

I am pretty lucky, after all. I have work I like, friends I like, my daughter, there’s a pie shop within walking distance, I’ve been hanging out ont he web writing these birthday posts for sixteenyearsnow. And 44 is a “happy” number according to Wikipedia, and also the UK’s international dialling code. Internationalism is a lot on my mind, since Brexit happens tomorrow, and now I have to look at government guidelines on what I have to do when “travelling for business”, which speaking at conferences in Europe apparently counts as. I am sure that this will make my life more complicated; any time you have to jump through a bunch of hoops to fill out forms, someone will screw it up, and that someone is usually me. I wish being a metropolitan elite came with the benefits that it’s supposed to so I could counterbalance them.

Anyway, politics aside, let’s leave myself another note for next year. I’m spending some of today writing proposals for work, which is good stuff. Future me, this is the — how shall I describe it so that I know what it is but it remains secret? Let’s call it the Vicious Cabaret project. Looks like that may happen, which is cool. I’ve also made a bunch of progress during January on the top-secret Swordcello project, which shall remain under wraps, but wheels are moving. Things are OK, generally. I got this fantastic envelope around a card: it’s great having friends who are artists; nice one Gaby.

aliens invade, and call me out by name. And there's a Thor stamp.

Interestingly, last year I was at BrumPHP the day after my birthday; this year, I’m there tonight! So pop along; might be a pint or two.

Happy birthday to me.

Getting a new phone

$
0
0

So, I’m getting a new phone. Here’s an insight into my decision-making processes.

I have, repeatedly and irritatedly, complained that phones now are too big. My beloved Sony Xperia Z5 Compact is the right size for a phone, in my opinion. I always, always use my phone one-handed; I never ever hold in one hand and touch the screen with the other. It is a loss to me why this, which was the normal way of using a phone for years, has been reclassified as a thing that nobody wants any more, but c’est la vie, I suppose. Anyway, said beloved Z5C finally threw a seven the other day and decided that it wouldn’t do wifi any more. Or, more accurately, that it was fine doing wifi when within about two feet of the router, and not otherwise.

That’s not ideal, I thought.

I mean, it’s five years old. So I probably did OK out of it. And the battery life is shocking now. So I’ve been vaguely thinking about getting something new for a while. I’m not sure that the wifi thing is sensibly repairable, and I read a forum post about a chap who took his Z5C apart to replace the (not-user-replaceable) battery (a process which involves heating it up to break the glue behind the glass, and a bunch of other stuff that there’s no way I’d be able to do without breaking the phone and possibly burning down the building) and while doing so managed to snap a tiny bit of metal which then broke the wifi antenna and made it exhibit the problems I’m seeing. So that’s probably what happened; it got jolted or something. No chance of me fixing that; if I have to solder anything, I’ll screw it up. This is the universe telling me to get a new phone, I thought.

Consequently, it’s off to GSM Arena’s phone finder. I don’t actually have much in the way of requirements for a phone. My original list of needs was:

  • not too big (for what exactly qualifies as not too big, read on)
  • not too expensive (flagship phones are now a thousand pounds! even non-flagship ones are £500! I don’t have a monkey just lying around)
  • NFC (for Google Pay, which I use all the time)
  • a headphone jack (because wireless headphones are pointless and expensive and worse in every conceivable way other than “the cable doesn’t get tangled up”, and I don’t like them and don’t want to buy any)
  • made in the last couple of years, since if I’m spending money on a phone I want it to last a while; there’s not a lot of point replacing my 2015 Z5C with a phone of similar vintage
  • and I like pretty things. Design is important to me. Beauty, vitality, and openness are all important.

This is not much of a strenuous list of requirements, to be honest. Or so I thought. I did some searches, and quickly established that I’d have to get something bigger than the Z5C; there isn’t anything at all that size, these days. So I wandered into town with the intention of picking up some actual phones to get a sense of what was too big.

This was harder than it looks, because basically every phone shop now bolts all their phones to the table so they can’t be picked up. All you can do is jab at the screen like a bloody caveman. This is pretty goddamn annoying when the point of the test is to see what a phone feels like in the hand. The O2 shop had a bunch of plastic models of phones and even those had a massive thing glued on the back with a retracting wire cable in it, as if I’m going to steal a non-functional plastic box, O2, for god’s sake, stop treating your customers like criminals, this is almost as bad as hotels giving you those crap two-part hangers like I’m going to spend £150 on a night in the Premier Inn and then nick the hangers, what’s wrong with you… but it did at least let me establish that the absolute outside maximum size for a phone that I’m able to tolerate is the Samsung Galaxy S10e. Anything bigger than that is just too big; I can’t reach the top of the screen without using my other hand.

A search on gsmarena for phones less than 143mm in height, with NFC and 3.5mm jack, from 2018 onwards lists three phones. The S10e as mentioned, the Sony Xperia XA2, and the Sharp Aquos R2 Compact. Now, I quite like the look of the Aquos (despite all the reviews saying “it’s got two notches! not even the Nazis did that!”) but as far as I can tell it just was flat never made available in the UK at all; getting hold of one is hard. And the S10e, while it seems OK, is a Samsung (which I’m not fond of) and more importantly is £450. This left me looking at the Xperia XA2, which was a possibility — it’s sort of a grand-nephew of my Z5C. Reviews weren’t very encouraging, but I figured… this might be OK.

Andrew Hutchings pointed out on Twitter (because of course I was bitching about this whole situation on Twitter) that there are USB-to-headphone-jack adaptors. Now, I knew this — my daughter uses one to plug her headphones into her iPhone — but for some reason I hadn’t properly considered that option; I’d just assumed that no headphone jack = stupid wireless headphones. An adaptor wouldn’t be that big a deal; my headphones just get thrown in my coat pocket (I have cheapish in-ear headphones, not posh cans that go ove the ear and need a bag to carry them around in) and so I’d just leave the adaptor attached to them at all times. That wouldn’t be so bad.

Taking the headphone jack requirement away from the search added two more options (and a bunch of smartwatches, unhelpfully): the Sony Xperia XZ2 Compact and the Nokia 8 Sirocco. I liked the sound of the Nokia, but… not for very good reasons. My favourite ever phone from an industrial design perspective was the Nokia N9, which I loved with a passion that was all-encompassing. I like the Nokia brand; it says classy and well-thought-out and well-integrated and thoughtful and elegant. And “Sirocco” is a cool name; I like things with names. I hate that phones are just called a code number, now. So “Sirocco” is much cooler than “S10e”. None of these are good reasons, particularly the ones that revolve around my nostalgia for the Nokia brand considering that it’s been bought by some other company now. And the Sirocco only got fairly average reviews.

Ah, but then I read the reviews. And all the things that reviewers didn’t like, I either didn’t care about or, more worryingly yet, I completely disagreed with. “As the phone has a 16:9 screen rather than the now more popular 18:9 (or even 19:9) style, it already seems dated” says techradar, for which you can just sod off. Why, why would I want a phone a foot long? That’s the opposite of what I want! So reviews that complain that it’s not tall enough (which was a lot of them) got discounted. Complaints that it’s using an older chipset than some of its contemporaries don’t bother me; it’s quite some newer than my current phone, after all. Apparently the camera isn’t perfect, about which I don’t care; it’s got a camera, so I’m good. And they all agreed on two things: it’s Android One, meaning that it’s stock Android and will get updates (which I like, since my Z5C is stuck on Android 7 (!)), and that it’s pretty. I like pretty.

The price tag was off-putting, though. £475 on Amazon. That’s rather too much; I’d have to save up for that, and as noted I have a phone with no wifi, so this problem needs solving sooner rather than later. I don’t mind second-hand, though, so I checked eBay and it was still £250 there, which is on the very utmost outer edge of what I can just drop on a purchase and I’d have to be really convinced of it. I don’t like buying things on the knock-knock, and I am in a 12-month can’t-leave SIM-only contract with Three, so the idea of getting an “upgrade” from my carrier was a no-no even if I wanted to, which I don’t (the SIM-only thing gives me unlimited texts and calls and 6GB of data per month for nine quid. Not forty nine. Nine. I don’t want to lose that).

And then I checked CeX. And CeX had it in stock, online, class A, for £175.

What? A hundred and seventy-five quid for a phone which elsewhere is nearly five hundred?

So I bought it. And now it’s not in stock online any more, so I assume I have the only one they had. This means you can’t do the same. Sorry about that.

It’s due to arrive early next week (which is the problem with buying on a Saturday). I’ll let you know how it goes. I’m rather looking forward to it.

On the Birmingham tech scene

$
0
0

A certain amount of kerfuffle over the last couple of days in the half of the Birmingham tech scene that I tend to inhabit, over an article in Business Live about Birmingham Tech Week, a new organisation in the city which ran a pretty successful set of events at the back end of last year.1

I think what got people’s backs up was the following from BTW organiser Yiannis Maos, quoted in the article:

I saw an opportunity borne out of the frustration that Birmingham didn’t really have a tech scene, or at least not one that collaborated very much.

You see, it doesn’t appear that the Tech Week team did much in the way of actually trying to find out whether there was a tech scene before declaring that there probably wasn’t one. If they had then they’d have probably discovered the Birmingham.io calendar which contains all the stuff that’s going on, and can be subscribed to via Google. They’d probably have spoken to the existing language-specific meetups in the city before possibly doing their own instead of rather than in conjunction with. They’d have probably discovered the Brum tech Slack which has 800-odd people in it, or2CovHack or HackTheMidlands or FusionMeetup or devopsdays or CodeYourFuture_ or yougotthisconf or Tech Wednesday or Django Girls or OWASP or Open Code or any one of a ton of other things that are going on every week.

Birmingham, as anyone who’s decided to be here knows, is a bit special. A person involved in tech in Birmingham is pretty likely to be able to get a similar job in London, and yet they haven’t done so. Why is that? Because Brum’s different. Things are less frantic, here, is why. We’re all in this together. London may have kings and queens: we’re the city of a thousand different trades, all on the same level, all working hand in hand. All collaborating. It’s a grass roots thing, you see. Nobody’s in charge. The calendar mentioned above is open source exactly so that there’s not one person in charge of it and anyone else can pick it up and run with it if we disappear, so the work that’s already gone into it isn’t wasted.

Yiannis goes on to say “I guess we weren’t really banging the drum about some of the successes Birmingham had seen in regards to tech.” And this is correct. Or, more accurately, I don’t personally know whether it’s correct, but I entirely believe it. I’m personally mostly interested in the tech scene in the city being good for people in the city, not about exhibiting it to others… but that doesn’t mean that that shouldn’t be done. Silicon Canal already do some of that, but having more of it can’t be bad. We all want more stuff to happen, there just doesn’t need to be one thing which attempts to subsume any of the others. Birmingham Tech Week’s a great idea. I’d love to see it happen again, and it’s great that Yiannis has taken a lead on this; five thousand people showing up can’t be wrong.

And, to be clear, this is not an attempt to rag on them. I don’t know Yiannis myself, but I’ve been told by people whose opinions I value and who do know him that he’s not intending to be a kingmaker; that what he’s looking to do is to elevate what’s already going on, and add more to it. That’s fantastic. They’ve contacted people I know and trust to ask for opinions and thoughts. I spoke to them when they set up their own events listing and asked people to contribute to theirs specifically and I said, hey, you know there already is one of those, right? If you use that (as Silicon Canal do) and ask people to contribute to that, then we all win, because everyone uses it as the single source and we don’t have fifteen incomplete calendars. And they said, hey, we didn’t know that, soz, but we’ll certainly do that from now on, and indeed they have done so, recommending to event organisers that they add their stuff to the existing calendar, and that’s brilliant. That’s collaboration.

I think of the tech scene in my city like a night out dancing. You go out for the evening to have a dance, to have a laugh. Show up on your own or with a partner or with a group, and then all get out there on the floor together and throw some shapes; be there for one minute or the whole night, nobody minds. And nobody’s directing it. Nobody wins a dance. If someone tries to tell everyone how to dance and when to dance and where to dance… then it stops being fun.

And so there’s a certain amount of resistance, on my side of the fence, to kingmakers. To people who look at the scene, all working together happily, and then say: you people need organising for your own good, because there needs to be someone in charge here. There needs to be hierarchy, otherwise how will journalists know who to ask for opinions? It’s difficult to understand an organisation which doesn’t have any organisation. W. L. Gore and Patagonia and Valve are companies that work a similar way, without direct hierarchy, in a way that the management theorist Frédéric Laloux calls a “teal organisation” and others call “open allocation”, and they baffle people the world over too; half the managers and consultants in the world look at them and say, but that can’t work, if you don’t have bosses, nobody will do anything. But it works for them. And it seems to me to be a peculiarly Brum approach to things. If we were in this for the fame and the glory we’d have gone down to London where everyone’s terribly serious and in a rush all the time. Everyone works with everyone else; BrumPHP talks about BrumJS, Fusion talks about School of Code; one meetup directs people to others that they’ll find interesting; if the devopsdays team want a speaker about JavaScript they’ll ping BrumJS to ask about who’d be good. That’s collaboration. Everyone does their bit, and tries to elevate everyone else at the same time.

So I really hope that the newspaper article was a misquote; that the journalist involved could have looked more into what’s going on in the city and then written something about all of that, too. It’s certainly easy to just report on one thing that’s going on, but exactly what makes the Birmingham tech scene different from others is that it’s rich and deep and there isn’t one convenient person who knows all of it. I’d love to see Birmingham journalism talking more about the Birmingham scene. Let’s hope there’s more of that.

  1. That link describes the 2019 Birmingham tech week at time of writing in February 2020. I do not know whether they’ll keep the 2019 schedule around (and I hope they do and don’t just overwrite it).
  2. to quote Jim

Android home screen widgets in HTML and JS

$
0
0

I like having the news headlines on my phone’s home screen. (Well, on the screen to the right.) It helps me keep up with what’s going on in the world. But it’s hard to find a simple headline home screen widget which isn’t full of ads or extra frippery or images or tracking; I just want headlines, plain text, not unpleasantly formatted, and high-density. I don’t want to see three headlines; I’d rather see ten. I tried a whole bunch of news headline home screen widgets and they’re all terrible; not information-dense enough, or they are but they’re ugly, or they insist on putting pictures in, or they display a ton of other information I don’t want.

It occurred to me that I don’t really need a news reader per se; just an RSS reader, which I then point at Google’s “all news” feed (which they move around from time to time but at time of writing in February 2020 is at https://news.google.com/news/rss). However, RSS reader widgets are also all terrible.

Finally, I thought: fine, I’ll just do it myself. But I really don’t want to write Java and set up Android Studio. So I installed Web Widget which just renders a web page to a home screen widget, and then wrote a simple web page and stuck it at the root of my phone’s storage. I can then point Web Widget at file:///sdcard/noos.html and it all works, and I can customise it how I like. Every one’s a winner. Nice simple way to create widgets that do what I want. They can’t be animated or anything, but if you want something which displays some external data and is happy to be polled every now and again to update, it’s perfectly fine. Sadly, there’s no continuity of storage (indexedDB exists but doesn’t persist and localStorage doesn’t exist at all), but it’s good for what I needed.

On ethical design, and the Ethical Design Handbook

$
0
0

We live in a world where websites and apps mostly make people unhappy. Buying or ordering or interacting with anything at all online involves a thousand little unpleasant bumps in the road, a thousand tiny chips struck off the edges of your soul. “This website uses cookies: accept all?” Videos that appear over the thing you’re reading and start playing automatically. Grant this app access to your contacts? Grant this app access to your location? “Sign up for our newsletter”, with a second button saying “No, because I hate free things and also hate America”. Better buy quick — there’s only 2 tickets/beds/rooms/spaces left! Now now now!

This is not new news. Everyone already knows this. If you ask people — ordinary, real people, not techies — about their experiences of buying things online or reading things online and say, was this a pleasant thing to do? were you delighted by it? then you’re likely to get a series of wry headshakes. It’s not just that everyone knows this, everyone’s rather inured to it; the expectation is that it will be a bit annoying but you’ll muddle through. If you said, what’s it like for you when your internet connection goes down, or you want to change a flight, they will say, yeah, I’ll probably have to spend half an hour on hold, and the call might drop when I get to queue position 2 and I’ll have to call again, and they’ll give me the runaround; the person on the call will be helpful, but Computer will Say No. Decent customer service is no longer something that we expect to receive; it’s something unusual and weird. Even average non-hostile customer service is now so unusual that we’re a bit delighted when it happens; when the corporate body politic rouses itself to do something other than cram a live rattlesnake up your bottom in pursuit of faceless endless profit then that counts as an unexpected and pleasant surprise.

It’d be nice if the world wasn’t like that. But one thing we’re a bit short of is the vocabulary for talking about this; rather than the online experience being a largely grey miasma of unidentified minor divots, can we enumerate the specific things that make us unhappy? And for each one, look at how it could be done better and why it should be done better?

Trine Falbe, Kim Andersen, and Martin Michael Frederiksen think maybe we can, and have written The Ethical Design Handbook, published by Smashing Media. It’s written, as they say, for professionals — for the people building these experiences, to explain how and why to do better, rather than for consumers who have to endure them. And they define “ethical design” as businesses, products, and services that grow from a principle of fairness and fundamental respect towards everyone involved.

They start with some justifications for why ethical design is important, and I’ll come back to that later. But then there’s a neat segue into different types of unethical design, and this is fascinating. There’s nothing here that will come as a surprise to most people reading it, especially most tech professionals, but I’d not seen it enumerated quite this baldly before. They describe, and name, all sorts of dark patterns and unpleasant approaches which are out there right now: mass surveillance, behavioural change, promoting addiction, manipulative design, pushing the sense of urgency through scarcity and loss aversion, persuasive design patterns; all with real examples from real places you’ve heard of. Medium hiding email signup away so you’ll give them details of your social media account; Huel adding things to your basket which you need to remove; Viagogo adding countdown timers to rush you into making impulsive purchases; Amazon Prime’s “I don’t want my benefits” button, meaning “don’t subscribe”. Much of this research already existed — the authors did not necessarily invent these terms and their classifications — but having them all listed one after the other is both a useful resource and a rather terrifying indictment of our industry and the manipulative techniques it uses.

However, our industry does use these techniques, and it’s important to ask why. The book kinda-sorta addresses this, but it shies away a little from admitting the truth: companies do this stuff because it works. Is it unethical? Yeah. Does it make people unhappy? Yeah. (They quote a rather nice study suggesting that half of all people recognise these tricks and distrust sites that use them, and the majority of those go further and feel disgusted and contemptuous.) But, and this is the kicker… it doesn’t seem to hurt the bottom line. People feel disgusted or distrusting and then still buy stuff anyway. I’m sure a behavioural psychologist in the 1950s would have been baffled by this: if you do stuff that makes people not like you, they’ll go elsewhere, right? Which is, it seems, not the case. Much as it’s occasionally easy to imagine that companies do things because they’re actually evil and want to increase the amount of suffering in the world, they do not. There are no actual demons running companies. (Probably. Hail to Hastur, just in case.) Some of it is likely superstition — everyone else does this technique, so it’ll probably work for us — and some of it really should get more rigorous testing than it does get: when your company added an extra checkbox to the user journey saying “I would not dislike to not not not sign not up for the newsletter”, did purchases go up, or just newsletter signups? Did you really A/B test that? Or just assume that “more signups, even deceptive ones = more money” without checking? But they’re not all uninformed choices. Companies do test these dark patterns, and they do work. We might wish otherwise, but that’s not how the world is; you can’t elect a new population who are less susceptible to these tricks or more offended by them, even if you might wish to.

And thereby hangs, I think, my lack of satisfaction with the core message of this book. It’s not going to convince anyone who isn’t already convinced. This is where we come back to the justifications mentioned earlier. “[P]rivacy is important to [consumers], and it’s a growing concern”, says the book, and I wholeheartedly agree with this; I’ve written and delivered a whole talk on precisely this topic at a bunch of conferences. But I didn’t need to read this book to feel that manipulation of the audience is a bad thing: not because it costs money or goodwill, but just because it’s wrong, even if it earns you more money. It’s not me you’ve gotta convince: it’s the people who put ethics and goodwill on one side of the balance and an increased bottom line on the other side and the increased bottom line wins. The book says “It’s not good times to gamble all your hard work for quick wins at the costs of manipulation”, and “Surveillance capitalism is unethical by nature because at its core, it takes advantage of rich data to profile people and to understand their behaviour for the sole purpose of making money”, but the people doing this know this and don’t care. It in fact is good times to go for quick wins at the cost of manipulation; how else can you explain so many people doing it? And so the underlying message here is that the need for ethical design is asserted rather than demonstrated. Someone who already buys the argument (say, me) will nod their way through the book, agreeing at every turn, and finding useful examples to bolster arguments or flesh out approaches. Someone who doesn’t already buy the argument will see a bunch of descriptions of a bunch of things that are, by the book’s definition, unethical… and then simply write “but it makes us more money and that’s my job, so we’re doing it anyway” after every sentence and leave without changing anything.

It is, unfortunately, the same approach taken by other important but ignored technical influences, such as accessibility or open source or progressive enhancement. Or, outside the tech world, environmentalism or vegetarianism. You say: this thing you’re doing is bad, because just look at it, it is… and here’s all the people you’re letting down or excluding or disenfranchising by being bad people, so stop being bad people. It seems intuitively obvious to anyone who already believes: why would you build inaccessible sites and exclude everyone who isn’t able to read them? Why would you build unethical apps that manipulate people and leave them unhappy and disquieted? Why would you use plastic and drive petrol cars when the world is going to burn? But it doesn’t work. I wish it did. Much as the rightness and righteousness of our arguments ought to be convincing in themselves, they are not, and we’re not moving the needle by continually reiterating the reasons why someone should believe.

But then… maybe that’s why the book is named The Ethical Design Handbook and not The Ethical Design Manifesto. I went into reading this hoping that what the authors had written would be a thing to change the world, a convincer that one could hand to unethical designers or ethical designers with unethical bosses and which would make them change. It isn’t. They even explicitly disclaim that responsibility early on: “Designers from the dark side read other books, not this one, and let us leave it at that,” says the introduction. So this maybe isn’t the book that changes everyone’s minds; that’s someone else’s job. Instead, it’s a blueprint for how to build the better world once you’ve already been convinced to do so. If your customers keep coming back and saying that they find your approach distasteful, if you decide to prioritise delight over conversions at least a little bit, if you’re prepared to be a little less rich to be a lot more decent, then you’ll need a guidebook to explain what made your people unhappy and what to do about it. In that regard, The Ethical Design Handbook does a pretty good job, and if that’s what you need then it’s worth your time.

This is an important thing: there’s often the search for a silver bullet, for a thing which fixes the world. I was guilty of that here, hoping for something which would convince unethical designers to start being ethical. That’s not what this book is for. It’s for those who want to but don’t know how. And because of that, it’s full of useful advice. Take, for example, the best practices chapter: it specifically calls out some wisdom about cookie warnings. In particular, it calls out that you don’t need cookie warnings at all if you’re not being evil about what you plan to allow your third party advertisers to do with the data. This is pretty much the first place I’ve seen this written down, despite how it’s the truth. And this is useful in itself; to have something to show one’s boss or one’s business analyst. If the word has come down from on high to add cookie warnings to the site then pushback on that from design or development is likely to be ignored… but being able to present a published book backing up those words is potentially valuable. Similarly, the book goes to some effort to quantify what ethical design is, by giving scores to what you do or don’t do, and this too is a good structure on which to hang a new design and to use to feed into the next thing your team builds. So, don’t make the initial mistake I did, of thinking that this is a manifesto; this is a working book, filled with how to actually get the job done, not a philosophical thinkpiece. Grab it and point at it in design meetings and use it to bolster your team through their next project. It’s worth it.

Online shopping at the Co-op

$
0
0

On the Saturday just gone, I thought to myself: OK, better get some food in. The cupboards aren’t bare or anything, but my freezer was showing a distinct skew towards “things that go with the main bit of dinner” and away from “things that are the main bit of dinner”, which is a long way of saying: didn’t have any meat. So, off to online shopping!

I sorta alternate between Tesco and Sainsbury’s for grocery shopping; Tesco decided they wouldn’t deliver to the centre of the city for a little while, but they’re back on it now. Anyway, I was rather disillusioned to see that both of them had no delivery slots available for at least a week. It seems that not only are people panic-buying toilet roll, they’re panic-buying everything else too. I don’t want to wait a week. So, have a poke around some of the others… and they’re all the same. Asda, Morrisons, Ocado, Iceland… wait a week at least for a delivery. Amazon don’t do proper food in the UK— “Amazon Pantry” basically sells jars of sun-dried tomatoes and things, not actual food — and so I was a little stymied. Hm. What to do? And then I thought of the Co-op. Which turned out to be an enormously pleasant surprise.

Their online shopping thing is rather neat. There is considerably less selection than there is from the big supermarkets, it must be admitted. But the way you order shows quite a lot of thinking about user experience. You go to the Co-op quickshop and… put in your postcode. No signup required. And the delay is close to zero. It’s currently 2pm on Monday, and I fill in my postcode and it tells me that the next available slot is 4pm on Monday. Two hours from now. That’s flat-out impossible everywhere else; the big supermarkets will only have slots starting from tomorrow even in less trying times. You go through and add the things you want to buy and then fill in your card details to pay… and then a chap on a motorbike goes to the Co-op, picks up your order, and drives it to your place. I got a text message1 when the motorbike chap set off, before he’d even got to the Co-op, giving me a URL by which I could track his progress. I got messages as he picked up the shopping and headed for mine. He arrived and gave me the stuff. All done.

It seemed very community-focused, very grass-roots. They don’t do their own deliveries; they use a courier, but a very local one. The stuff’s put into bags by your local Co-op and then delivered directly to you with very little notice. They’re open about the process and what’s going on. It seems so much more personal than the big supermarkets do… which I suppose is the Co-op’s whole shtick in the first place, and it’s commendable that they’ve managed to keep that the case even though they’ve moved online. And while the Co-op is a nationwide organisation, it’s also rather local and community-focused. I’ll be shopping there again; shame on me that I had to be pushed into it this first time.

  1. the company that they use to be couriers are called Stuart. This was confusing!

A UK map made of squares

$
0
0

For a visualisation thing I was doing, I wanted a UK map made out of small squares: these seem a useful way to make heatmaps of the way a thing affects the UK. There are plenty of such maps but they all seem to be on stock image sites which want you to licence them and so on and that seems a bit annoying, so I figured I’d make one.

George Hodan has created a public domain (CC0) map of the UK (mirror here), so that was a good place to start. Then a small Python script and I’d made an SVG of the map:

a 20x30 map of the UK

and that’s all I wanted. Hooray. The script lets me tell it how many squares I want the UK map divided up into, so I generated it in various different sizes (10x15, 15x22, 20x30, 30x45, 40x61, 50x76) because that was convenient. If you want it in a size that isn’t one of those, grab the script and go for it.

Remote Applause

$
0
0

That’s a cool idea, I thought.

So I built Remote Applause, which does exactly that. Give your session a name, and it gives you a page to be the “stage”, and a link to send to everyone in the “audience”. The audience link has “clap” and “laugh” buttons; when anyone presses one, your stage page plays the sound of a laughter track or applause. Quite neat for an afternoon hack, so I thought I’d talk about how it works.

the Remote Applause audience page

Basically, it’s all driven by WebRTC data connections. WebRTC is notoriously difficult to get right, but fortunately PeerJS exists which does most of the heavy lifting.1 It seemed to be abandoned a few years ago, but they’ve picked it up again since, which is good news. Essentially, the way the thing works is as follows:

When you name your session, the “stage” page calculates a unique ID from that name, and registers with that name on PeerJS’s coordination server. The audience page calculates the same ID2, registers itself with a random ID, and opens a PeerJS data connection to the stage page (because it knows what its ID is). PeerJS is just using WebRTC data connections under the covers, but the PeerJS people provide the signalling server, which the main alternative simple-peer doesn’t, and I didn’t want to have to run a signalling server myself because then I’d need server-side hosting for it.

The audience page can then send a “clap” or “laugh” message down that connection whenever the respective button is pressed, and the stage page receives that message and plays the appropriate sound. Well, it’s a fraction more complex than that. The two sounds, clapping and laughing, are constantly playing on a loop but muted. When the stage receives messages, it changes the volume on the sounds. Fortunately, the stage knows how many incoming connections there are, and it knows who the messages are coming in from, so it can scale the volume change appropriately; if most of the audience send a clap, then the stage can jack the clapping volume up to 100%, and if only a few people do then it can still play the clapping but at much lower volume. This largely does away with the need for moderation; a malicious actor who hammers the clap button as often as they can can at the very worst only make the applause track play at full volume, and most of the time they’ll be one in 50 people and so can only make it play at 5% volume or something.

There are a couple of extra wrinkles. The first one is that autoplaying sounds are a no-no, because of all the awful advertising people who misused them to have autoplaying videos as soon as you opened a page; sound can only start playing if it’s driven by a user gesture of some kind. So the stage has an “enable sounds” checkbox; turning that checkbox on counts as the user gesture, so we can start actually playing the sounds but at zero volume, and we also take advantage of that to send a message to all the connected audience pages to tell them it’s enabled… and the audience pages don’t show the buttons until they get that message, which is handy. The second thing is that when the stage receives a clap or laugh from an audience member it rebroadcasts that to all other audience members; this means that each audience page can show a little clap emoji when that happens, so you can see how many other people are clapping as well as hear it over the conference audio. And the third… well, the third is a bit more annoying.

If an audience member closes their page, the stage ought to get told about that somehow. And it does… in Firefox. The PeerJS connection object fires a close event when this happens, so, hooray. In Chrome, though, we never get that event. As far as I can tell it’s a known bug in PeerJS, or possibly in Chrome’s WebRTC implementation; I didn’t manage to track it down further than the PeerJS issues list. So what we also do in the stage is poll the PeerJS connection object for every connection every few seconds with setInterval, because it exposes the underlying WebRTC connection object, and that does indeed have a property dictating its current state. So we check that and if it’s showing disconnected, we treat that the same as the close event. Easily enough solved.

There are more complexities than that, though. WebRTC is pretty goshdarn flaky, in my experience. If the stage runner is using a lot of their bandwidth, then the connections to the stage drop, like, a lot, and need to be reconnected. I suppose it would be possible to quietly gloss over this in the UI and just save stuff up for when the connection comes back, but I didn’t do that, firstly because I hate it when an app pretends it’s working but actually it isn’t, and secondly because of…

Latency. This is the other big problem, and I don’t think it’s one that Remote Applause can fix, because it’s not RA’s problem. You see, the model for this is that I’m streaming myself giving a talk as part of an online conference, right? Now, testing has demonstrated that when doing this on Twitch or YouTube Live or whatever, there’s a delay of anything from 5 to 30 seconds or so in between me saying something and the audience hearing it. Anyone who’s tried interacting with the live chat while streaming will have experienced this. Normally that’s not all that big a problem (except for interacting with the live chat) but it’s definitely a problem for this, because even if Remote Applause is instantaneous (which it pretty much is), when you press the button to applaud, the speaker is 10 seconds further into their talk. So you’ll be applauding the wrong thing. I’m not sure that’s fixable; it’s pretty much an inherent limitation of streaming video. Microsoft reputedly have a low latency streaming video service but most people aren’t using it; maybe Twitch and YouTube will adopt this technology.

Still, it was a fun little project! Nice to have a reason to use PeerJS for something. And it’s hosted on Github Pages because it’s all client side, so it doesn’t cost me anything to run, which is nice and so I can just leave it up even if nobody’s using it. And I quite like the pictures, too; the stage page shows a view of an audience from the stage (specifically, the old Met in New York), and the audience page shows a speaker on stage (specifically, Rika Jansen (page in Dutch), a Dutch singer, mostly because I liked the picture and she looks cool).

  1. but it requires javascript! Aren’t you always going on about that, Stuart? Well, yes. However, it’s flat-out not possible to do real-time two-way communication sanely without it, so I’m OK with requiring JS in this particular case. For your restaurant menu, no.
  2. using a quick JS version of Java’s hashCode function, because PeerJS has requirements on ID strings that exclude some of the characters in base64 so I couldn’t use window.btoa(), I didn’t want (or need) a whole hash library, and the Web Crypto API is complex
Viewing all 158 articles
Browse latest View live