This post will be the two thousandth on my blog, give or take. I want it to serve as a bridge between the eleven years of ups and downs in my life behind me, and the bright and unknown future ahead. Eadaoin pointed out to me that, yes, I threw up other retrospectives in the […]

Brugge is one of the top tourist spots in Belgium, and indeed, most of Western Europe. A PDF I pulled up asserts “…29 million overnight stays and 11 million tourist arrivals” to Flanders. Tens of millions of people visited to Brugge over the last half century. Those visitors took somewhere between hundreds and thousands of […]

The Dijver is a traditional canal, street and marketplace in the heart of Brugge, although today’s markets sell tourist tat. :) I took this panorama while on a boat trip with Eadaoin.

Like with everywhere else famous, there’s a weird discontinuity between a Google Maps lookup or a Wikipedia article, and the reality of walking through the arch. It stops being some far off exotic location, and becomes a collection of expensive chocolate and bag shops, and a cafe where I had a great coffee.

Hackoberfest has made Tic-tac-toe a thing in my life. tictactoe-server opened an issue for a ES6 refactor of the solution checker. I kicked around the lengthy imperative code check and found I wanted to expand the solution, that I wanted to drop in Tic-tac-toe boards of arbitrary size, and to check them in an efficient […]

Reddit jokes aside, holy shit: I wooed Eadaoin with space facts. We would spent hours on Skype at night when we first went out, where I’d talk about the universe to help get her to sleep. https://xkcd.com/1746/

This solution uses the Sieve of Eratosthenes and the range() functions I detailed a while back. Hurray for function composition! function factors(number) { const primes = sieve(range(2, number >> 1)).filter(n => !(number % n)); return primes.length ? primes : [number]; } The code is simple: Generate a list of primes in range 2-(n / 2) […]

It doesn’t matter to me if the rest of Rogue One is awful, not when this is how Gareth Edwards’s presents the Star Wars universe. See, I’m a written science fiction fan. While I don’t keep count of what books I’ve read, I put the count somewhere in the mid hundreds. Some novels I’ve read […]

Call me stupid, but the Sieve defeated me for years-I could never quite seem to make it click. TL;DR: Return the first element of the array, joined with the rest of the array with all multiples of the first element removed. A non-zero value is truthy in JavaScript, which is coerced into true, so non-multiples […]

This solution employs the previous solution. With the XOR method explained, you invert the array: Find the unique elements in the array. Concat the new array to the original. This makes the even (even count) numbers odd, and the odd numbers even. Use the XOR method as before. Behold: function evenOccurring(array) { return [].concat(array, array.filter(unique)).reduce(xor); […]

I dug into the problem and discovered that any number XOR’d with itself an odd number of times equals zero, whilst an even number of times equals the number itself: 7 ^ 7 = 0 7 ^ 7 ^ 7 = 7 The trick here is: Numbers which appear in the array an even number […]

The solution is ugly, but fuck it: the code works. Also, code Zen. ;) TL;DR: Create a new array by plucking the last element from the array and making it the first. def rotate(array, count) return array unless (count >= 1 && array.present?) rotate(cycle(array), count - 1) end def cycle(array) [array[-1]] + array[0..-2] end And […]

I continue to return to Zen as a way to reach peace with myself. Zen encourages introspection and meditation alongside expressive acts such as calligraphy. The core of Zen calligraphy, such that I understand it, is to cultivate the beginner’s mind. The expert mind is packed with presumption; while an expert mind has a powerful […]