Just a post to mirror the post on my other blog – I’ve decided it’s not the best use of my resources to continue to pay for domain and WordPress hosting for that blog, so in a couple of weeks revjameshandley.com will lapse expire, and my vicar blog will only be available via revjameshandley.wordpress.com.
I’ll try and update links from this site.
In all honesty blogging has taken something of a back seat in my life at the moment in any case.
I’ve finally jumped on the Wordle bandwagon, and enjoy tinkering away every day. Best yet has been two guesses, due to a spectacularly good first guess. Worst was six, which I put down to Covid-19 brain fog.
Just in case anyone doesn’t know, Wordle is a really simple “mastermind” like game, where you have to guess a five letter word in six guesses or less. For each guess you make (which itself has to be a valid five letter word), you get an indication for each letter of whether it is the right letter in the right place, a right letter but in the wrong place, or a letter that doesn’t appear in the word at all.
Obvious questions are whether it is theoretically always solvable, and then what is the best word to start with? Before we dive into this, a quick shout out to Hannah Dee, whose linux refresher through the medium of Wordle didn’t exactly plant the seed in my mind, but did water it.
Back to the question. If the answer didn’t have to be a valid word, the answer would be “no” straight away. There are 26x26x26x26x26 (over 11 million) permutations possible, and you have six guesses. Admittedly you can rule out a lot of these permutations after every guess – if you happen to choose 5 different letters, none of which appear, then that brings it down to 21x21x21x21x21 possibilities (a mere 4 million). However some basic arthimatic soon exposes the problem. We guess 5 letters each turn, so after 5 guesses, we have tried a maximum of 25 different letters. There are 26 to choose from. So by the time we get to guess six – our final guess – we can be certain which unique letters are in the solution, but can’t be sure of their position, or which have been repeated.
However the fact it must be a valid word helps enormously. Taking Linux’s “huge” American English dictionary, I reckon there are 11,302 five letter words, from “aahed” to “zymix”. In all honestly we can probably rule out a lot of these, but let’s continue with this list, as the worst case. Like Hannah, I’ll be using Linux command line tools along the way to show how I got my stats.
Bit of housekeeping to start with – there’s a few diacritics and apostrophes in the source word list, so we’ll filter out anything which isn’t pure ASCII, and then filter it to just words with five letters from a to z in.
Intuitively we’re trying to gather as much information as possible as early as possible, in terms of presence and position. Therefore we want to start with the letters which are most likely to occur. This way if they are in the word it might not reduce the list much, but we get positional information, and if they are not in the word it reduces the list a lot.
So, let’s count how many times each letter appears in a word.
$ grep -o "." ./wordle-words.txt | sort | uniq -c | sort -b -g -r | column
5807 s 2828 l 1637 c 1194 k 228 j
5723 e 2722 t 1628 m 869 f 92 q
5242 a 2414 n 1531 y 856 w
3832 o 2013 d 1387 h 593 v
3636 r 1898 u 1334 g 340 z
2901 i 1661 p 1307 b 237 x
If we take the 5 most common letters across those 11,000 words, these are “s”, “e”, “a”, “o” , and “r”. Sounds like “AROSE” is a good first guess! If we count all the words which contain one or more of these letters, it’s an amazing 10,782. We can be almost certain of a hit, and if not we’ve only 520 candidate words left to search.
$ grep "[arose]" wordle-words.txt | wc -l
If on the other hand we used the least popular letters we could (actually quite tricky to find words using them – but “BUZZY” is pretty bad), we only cover 4,665 words. Our odds of a hit have gone down from ~95% to less than 50%. What’s worse, if we don’t match any, we are still left with 6,637 words to search. Not good.
Let’s ignore the position information for just a moment, and see what happens with the possibilities of hit. The huge advantage we have is that if we only hit “A”, we know we didn’t hit any of “ROSE”, which also tells us a lot.
Doing this for all the combinations is pretty tedious, but a dig into AS, which is our least favourable combination:
So it seems reasonable to estimate our maximum new candidate list is 750 words. Not bad for one guess.
For the next guess, we want to choose a distinct set of letters to maximise our coverage. The next 5 on the list are “i”, “l”, “t”, “n”, “u” – “UNTIL”. Our coverage with UNTIL against the original list is still pretty high at 8,690 matches vs. 2,612 non-matches. Of course if you are doing this specifically, rather the generically, you would use the actual candidate word list after the first guess. It also turns out there is only one five letter word which does not have any letters from “AROSEUNTIL” in it, and that word is … “PYGMY”.
So after two guesses, we know we have we have either hit at least one letter, or we know the answer is pygmy. We also know there are at most 894 possible words it could be (although this estimate is too high), and we’ve still got four guesses to go.
For completeness, what happens when “AROSE” doesn’t match at all? Let’s rinse and repeat with the 520 words we had left when we didn’t match any:
$ grep -v "[arose]" ./wordle-words.txt | grep -o "." | sort | uniq -c | sort -b -g -r | column
403 i 188 n 100 d 35 z 7 q
260 y 157 c 95 g 30 w
255 u 138 p 89 f 21 v
200 l 134 h 83 b 15 j
190 t 114 m 73 k 13 x
This time we can’t make a word from the top 5. Best option is something like “UNITY”, which it turns out hits every one of our remaining 520 options. So in this scenario we’ve got 4 guesses left, we know at least 1 letter, and something about its position.
Whatever happens, after two guesses we know at least 1 letter (or the answer), our candidate list is reduced to <10% of the original word list, and we’ve still got four more guesses.
So I would feel pretty confident saying “yes” – it is always solvable in 6 guesses. I know I haven’t proved it by a long stretch, but I’m happy enough.
The only trouble with this is it does kind of take the fun out of it a bit, and you lose the sense of closing in on the solution. You also know that you will never score a “2”, unless the second word just happens to be “UNTIL”.
But I’ll give it a whirl for a few days – solving wordle by making the first two guesses “AROSE” and “UNTIL”! My predication is that I will usually only need 3 guesses.
Had a very frustrating couple of days fighting WordPress, so I thought I’d share my findings in the hope that someone else may benefit. The slugs incidentally are the part that form the permalink of the page/post – so this post’s slug will be 2022/01/14/wordpress-slug-autocorrect, leading to a permalink of https://www.eutony.net/2022/01/14/wordpress-slug-autocorrect
Rather than spin the whole narrative, I’m going to just say upfront – WordPress does not allow you to have pure numeric slugs (e.g. “365” or “123”), and if you try to do this it will ‘autocorrect’ to add a “-2” on the end. Simple as that.
In trying to chase this down, it turns out that there is a whole bunch of other reasons why it also might add a “-2” on the end. These include if there is:
a media item with the slug name,
a deleted item with that slug name in the bin,
a tag or category of that name, or
an old slug hanging around in wp_postmeta (the metakey being _wp_old_slug).
My problem was this – I have a templated page which is a sort of summary of my 365 photo project, and shows the most recent 10 photos. [It does this with a bit of PHP which hits the API at photo.eutony.net and generates a page of img tags and links to that site]. Naturally enough I wanted this to be at www.eutony.net/365. Not unreasonable, I wouldn’t have thought, and it worked when I first did it.
Anyway, I fairly recently updated WordPress and PHP, and all seemed to be well. However I noticed on the front page that my 365 photo wasn’t updating. Turns out there were a bunch of missing PHP modules (such as curl) that meant the backend caching had broken. So I eventually fixed that, and then noticed that my /365 page had turned itself into /365-2.
Even worse, navigating to /365 took me to a fairly random one of my blog posts where the title started “365-“!!
Once I discovered about the WordPress numeric slug limitation, answer was to rename the slug to “/365-photos”, and then add a couple of PermanentRedirect to .htaccess to preserve the previous published permalink(s):
RedirectPermanent /365 /365-photos
RedirectPermanent /365-2 /365-photos
As often with computing and software, the solution, once you know what it is, is a two minute job to implement – it’s getting to it that takes hours.
As we approach the end of each year, I like to look back at my New Year’s intentions, and see how I’ve done.
Only it turns out I didn’t make any at the start of 2021 (or indeed review my 2020 ambitions). In fact between February 2020 and October 2021 I wrote just 3 posts.
The reason for this is obvious, but not really visible at all in anything I’ve written, except a passing reference in May 2020 about doing a church service from home. It is of course the Covid-19 pandemic, which started in December 2019, really hit the UK in March 2020, and is still going strong two years down the road.
By January 2020 our household was getting nervous about the disease, to the extent that we cancelled a trip we had planned to Cambridge in February half-term because of the risk, and instead went away to a remote cottage in County Durham.
On the 16th March came the “work from home” order, and minimise social contact, then on the 23rd March the first lockdown was announced; and from 26th March to the 10th May the UK was in complete lockdown. Everything is closed except for food shops and healthcare, and people are not allowed any contact with people outside their “bubble”, and only allowed outside once a day for an hour’s exercise. “No person may leave the place where they are living without reasonable excuse”. Churches were closed, so church has go to online! We used YouTube, others used Zoom. Our eldest son’s high school started partially closing from the 18th March, so that he had his final day in school before the closures were announced – his final day of year 11 happened without him realising. GCSEs were cancelled, and grades issues by teachers instead. Joe Wickes kept us fit with his daily exercised, and BBC Bitesize provided home schooling!
From the 10th May we had a new regionalised system, with levels of covid determining the rules for social contact. Schools partially re-opened in June (they had been open for key workers the whole time), but it wasn’t until September they fully re-opened. Over August things relaxed considerably, and we were able to go to Cornwall for a summer holiday – but my household were in no doubt that restrictions were going to return as we headed into winter.
14th September 2020 saw new restrictions, such as the “rule of 6”, with tightening on 22nd September to a tier system. 5th November was the start of the second national lockdown (although schools stayed open), which lasted until the 2nd December, although a strict three tier situation was in place.
At the start of January 2021, the Prime Minister annouces that everyone should go back to school. On the first day of term, we enter another full lockdown, with all schools etc closed, and a full “stay at home” order.
This one lasts until 8 March, when schools re-open, and we take Step 1 of a four step roadmap for lifting restrictions. 12 April was step 2, 17 May step 3, and finally step 4, with almost all legal restrictions lifted on 19 July (four weeks later than planned).
In the meantime vaccines had been developed, and immunisations were forging ahead – natural or artifical immunity being the only route of any pandemic.
Church was also interesting. On the 17th March 2020, the Archbishops said churches should not be holding worship services in the building, and from 26th March all churches were completely closed, and we streamed our services online. The first one snuck in from Church, but from the end of March until September all our services were streamed from our homes. On the 13th September 20202, we started having Holy Communion in-person with very restricted numbers in the building, followed by two livestreamed services; one from home still, and the other from the building. In October 2020, we switched to our current pattern, of a 9am Holy Communion and a 10.30 Morning Worship from the building, both in-person and livestreamed. In the January 2021 lockdown, we were able to continue to use the building, and have a handful of people running the service.
Some restrictions have now been re-introduced (10 December – working from home advised, and facemasks mandatory) in the light of the omicron variant, and this winter was always going to be a rough ride. I am certain we have more restrictions to come in the next few days, but my hope is that come March time we will truly be moving into “living with Covid” (in the same we live with the cold, and with ‘flu), and we will have no more need for restrictions by the summer.
The above is somewhat dispassionate, on purpose. Truth it is has been an incredibly tough couple of years for me and my family, and one that has come very close to breaking me at times. We have been blessed enough to avoid any serious illness so far (but I can’t believe that one or more of us haven’t caught it, although none have ever tested positive). Truth is this time last year I was in a pretty bad place, and the last thing I was able to do was look back at my hopes for 2020 (none of which I managed, incidentally), or set any sort of ambition for 2021 beyond surviving.
Of course it wasn’t awful the whole time, and we had some really good times too. We’ve had to invent new games and rituals, discovered new local walks, and really appreciated seeing friends and family when we were able. The slower pace of life (outside work!) was a gift a lot of time. But it has been tough, and I think explains why I more or less stopped blogging and posting photos.
I can’t promise 2021 will be better on either of those two fronts, but I do know that God walks with us.
As a part of my quest to reduce plastic, and maybe save some money, I switched over to shaving with a safety razor at the end of 2019. There was also the hope of getting a closer shave, so I wouldn’t be quite so stubbly at the end of the day.
Previously I was using disposable razors, either the Gillette type ones where you change the head (Mach 5, or whatever) or the bog standard supermarket 10 pack of twin blade razors, with shaving gel that comes in a squirty can. The disposable razors are 10 for £1, and same price for a can of shaving gel, which probably does a month or so?
Anyway, I went for a Hill and Drew Double Edge Butterfly Razor and Case, which at the time was only £10 from The Shaving Stack. This turns out to have been an absolute steal; it’s a great razor, and should last me for many many years.
I also bought a badger shaving brush (which is more or less essential if you’re not using a squirty can), which was £15, but again should last many years.
I did try shaving soap, but didn’t really get on with it, so switched to Talyor of Old Bond Street Shaving Cream. This does does come in a plastic pot, but one pot lasts me probably 9 months of shaving every day, which is pretty good. They’re not cheap at £10 a tub – but better to recycle than the squirty gel. You could probably make them go a bit further than I do as well – you really do only need the tiniest amount to lather up your whole face.
Than there are the razor blades. I use Astra Superior Platinum Double Edge Razor Blades, which I bought in a pack of 100(!) for £12 delivered. They even come in little cardboard boxes of 5, and wrapped in waxed paper.
In terms of usage, I gather it’s best to change the blades every couple of days, but I tend to use them for a week, with one day off shaving a week. This is about the same as the disposable ones, which I also usually made last a week – sometimes two.
So, objectives achieved?
Well, definitely less plastic. The only plastic I generate now from shaving is the empty pot of shaving cream once or twice a year. This contrasts with maybe 30 or 40 plastic disposable razors, and 5 or 6 shaving gel cans.
There is no doubt the shave is significantly closer (especially the first 2 or 3 with a new blade).
Cost? Well, there was an upfront cost of £25 to get going, and ongoing costs of 50p a month for blades, then £1 a month for shaving cream. The disposable ones are probably slightly cheaper than this, and the shaving gel comparable. Clearly if you use a Gilette disposable or semi-disposable then the Astra’s are a significant saving. So probably not much in it either way in terms of pounds of pence, but you’re not not really comparing like with like.
More qualitatively, shaving with a safety razor is a completely different experience. For literally the first 3 months I cut my face every day!! I was so used to dragging the disposable razors over my skin at any old angle – you have to be much more careful and precise with the safety razors. But on the other hand I find it a more enjoyable experience – it shaves so beautifully and easily if you do it properly, and is so much closer. The whole lathering up is quite fun to. I’ve always enjoyed wet shaving, and it’s even better, in my opinion, with a safety razor.
Actually speaking of nicking oneself, I also use an alum block to stop the occasional little cut which still happens. The alum stick also doubles up as my deodorant. That takes a bit of a getting use to, as you still sweat, but it doesn’t smell. The alum kills off the smelly bacteria without blocking up your pores (which is what normal anto-persperant deodorant does – and of course that usually comes in yet more plastic too).
I did briefly flirt with the idea of the full cut-throat razor, and the whole stropping thing, but decided (a) I wasn’t brave enough, and (b) it was probably just a step too far.
First, as is perhaps often the way, an “off-topic” comment of his struck me, and partially inspired this post. I paraphrase from memory.
I always think that we have a limited number of keypresses in our life, so I want to use them well. If someone asks me a question, I blog the answer so that the keypresses live on. E-mails are where keypresses go to die.
Anyway, aside from the stuff I learnt about WSL, there were a couple of other gems in this talk which I wanted to flag up.
This is a flat / peer to peer VPN topology built on top of WireGuard that looks really nice. You connect all your devices (PC, server, phone, docker container, EC-2 instance) to your Tailscale network, and they are all visible to one another with static 10.x IP addresses.
I haven’t had a play with Tailscale yet, but I did set up WireGuard on a raspberry pi, and put the client on my phone, so I can now access my home private network from my phone even when I’m out and about. It could barely have been easier to set up (did have some fun and games with some of the dependencies on the pi, but reddit saw me good). My use case is probably more allowing my kids to play Factorio or Minecraft together even when they’re not in the same house. Obviously there are many other ways to solve this problem, but this one is essentially free.
Tailscale looks even nicer – my reading is that is is essentially adding a management layer to WireGuard, so all your devices can automagically join the network without needing to know all the other devices certificates and IP addresses ahead of time.
Windows terminal basically brings the command prompt up to date, with multiple windows/tabs, configurable menus, and so on.
I’ve been using at work this week, and it is just a much nicer way of managing the varioius command prompts I usually have open for Docker, Git bash, Powershell, SSH, etc. Possibly my favourite thing is the ability to add the Visual Studio command prompt as a menu item. While I hardly ever use it, it alwys seems to take me ages to find it on the Windows start menu.
The Bishop of Leeds is pleased to announce the appointment of The Revd Dr James Handley, currently Assistant Curate of Harrogate St Mark, as Associate Priest of Harrogate St Mark in the Ripon Episcopal Area.
The licensing will be conducted by Bishop Helen-Ann Hartley on Sunday 25th July 2021