Who Reigns Supreme? Parsing Our WhatsApp Chat for Wordle Glory

Back in 2022, in a bid to outwit my mother in our daily Wordle battles, I wrote some C# code to explore optimal starting guesses. You can read about that experiment here. Fast forward two years, and my Wordle addiction is alive and well. The daily challenge remains as compelling as ever, but it’s the family WhatsApp group – where scores are shared, victories boasted, and failures commiserated – that adds an extra layer of fun. ...

31 December 2024

Back To Basics: On The Use And Abuse Of The Humble Boolean

“We who cut mere stones must always be envisioning cathedrals” — Stonecutter’s creed Consider for a moment, if you will, the humble Boolean. Taking only two possible values, it is the most basic of all the data types we programmers use, and its existence is fundamental to all the code we write. At the end of the day, when all is said and done, everything we do is just a big bunch of ones and zeroes. ...

1 July 2014

A C# Postcode Struct with Parser

As discussed recently, I’ve been trying to knock together a class struct to represent a UK postcode, provide a means of parsing a string as potentially being a valid postcode (or optionally just an outer code), and split that postcode into “outer” and “inner” code. I say potentially because, as you’ll know if you’ve looked into this topic at all, it’s impossible to validate whether a string truly does represent a postcode without querying the (copyrighted and expensive-to-license) Postcode Address File. As a result, my solution is not very stringent – it is possible to persuade it to successfully parse an invalid postcode, but hopefully there should be no occasions when a valid postcode is rejected. ...

29 May 2007

Postcode Validation

Wikipedia cracks me up sometimes. I’m sat here at my desk, trying to knock together some C# code to quickly validate an entered string as being a UK postcode. Naturally I turned to this Wikipedia article for assistance, where I find this quip: “Automatic validation of postcodes on the basis of pattern feasibility is therefore almost impossible to design, and the system contains no self-validating feature such as a check digit. Completely accurate validation is only possible by attempting to deliver mail to the address, and verifying with the recipient.” ...

23 May 2007

Big Integer

As I mentioned last summer, I do enjoy whiling away a few hours attempting to solve the maths / progamming challenges set on Project Euler. My language of choice for most puzzles is C#, but this hampered me on some of the questions as there is no in-built support for really big integers. However, a little bit of Googling and I came across this excellent BigInteger class on Code Project which does everything I need and more – and it seems bloody fast, too. Thanks to this class, I’ve been able to knock off several more problems this weekend, and now have a rating of “11% Genius” – still some way to go, then… ...

17 July 2006

Tech Books

I succumbed to temptation and bought another book at the MSDN briefing yesterday, pausing only out of concern that the guy who mans the Computer Manuals stand at these events might think that I’m stalking him (or fancy him!). Having determined that I could hand over my Barclaycard whilst flashing my wedding ring, I brought my current reading list up to three: Developer to Designer: GUI Design for the Busy Developer – this was a wedding present from my mother-in-law and is proving to be an interesting, easy-going read so far. My competencies lie in the middle tier and database, and although I’m technically capable of making GUIs, I prefer to leave the design up to others. It’s inevitable though that most coders end up doing some design, and this book is, er, designed (sorry) to help with that process. The early section of the book concentrates on each UI element in turn, whilst the later part of the book looks at putting it all together, and has particular focus on the web – layout design patterns and interaction patterns. It’s a good read, making a nice contrast from the heavier books, and I’m pleased to learn that I’m not alone in hating Outlook’s labyrinthine Tools->Options dialog! ...

18 June 2005

Property Access Modifiers in Whidbey

Ooh, this is great news: http://nxopinion.robertsoninstitute.org/blogs/rcecil/archive/2004/11/11/167.aspx It’s a little thing, to be sure, but I often find myself wanting to make a setter internal or private while leaving the getter public. So, I’m happy. It doesn’t take much 🙂

15 November 2004