Mark Grealish

the life and code of a crazy cat man


I’m not sure what kids consider hip these days, except that it involves concussions


Mount Usher Gardens

Found during a cleanup of photographs from the summer. :)

Project Euler Problem #30

Problem #30 was solved on new ground: my first run through Project Euler was in rigid order of first to last ending at #25. The recent round of solutions mostly cover old ground, which works well for me by itself because it shows off how my code has improved since 2012. Also, the run of […]

Project Euler Problems #18 and #67

The new solution for Problem #18 (compared to the old one) is more elegant: I reverse and reduce the triangle in a manner that doesn’t require me to check. The solution for #67 is a bit more longform, so I turned the method I use here into an NPM package: Triangutron. const eighteen = ` […]

Project Euler Problem #36

function range(start, end) { return [...Array(end + 1).keys()].slice(start); } function palindrome(number) { return number.toString() === number.toString().split('').reverse().join(''); } function toBinary(number) { return (number >>> 0).toString(2); } function add(sum, current) { return sum + current; } const palindromes = range(1, 999999).filter(number => { return palindrome(number) && palindrome(toBinary(number)); }); console.log(palindromes.reduce(add));


I went back and owned the fuck out of Problem 24. I present to you a fully-functional functional lexicographic permutation generator generator. Hail Satan! \m/ #!/usr/bin/env node const lexicographer = require('lexicographer'); const array = [...Array(10).keys()]; const breakpoint = 1000000; let permutations = 0; for (let value of lexicographer.permute(array)) { permutations++; if (permutations === breakpoint) { […]

Project Euler Problem #16

Ruby this time, and a wee bit shorter too. (2**1000).to_s.split(//).map(&:to_i).reduce(:+)

Project Euler Problem #24

#24 defeated the fuck out of me first time through: My solution to this was basically stolen elsewhere, and it took me a whole year to come back, sit down, and work through my own solution. The poor wording (I’ve since edited it) of the Wikipedia article didn’t help me. The specific piece of information […]

Project Euler Problem #22

Again, better. :) #!/usr/bin/env node const fs = require('fs'); const add = previous, current) => previous + current; const toNumbers = string => { return string.split('').map((_, index) => string.charCodeAt(index) % 64); } fs.readFile('./p022_names.txt', 'utf8', (_, data) => { const names = JSON.parse(['[', data, ']'].join('')).sort(); const reduced =, index) => { return toNumbers(name).reduce(add) * (index […]

Project Euler Problem #12

Once again, it’s more readable than my last solution. I used a generator to get the next triangle. function divisorCount(number) { let end = Math.ceil(Math.sqrt(number)); let divisorCount = 0; for (let i = 1; i < = end; i++) { if (!(number % i)) { divisorCount += 2; } } return divisorCount; } function* triangleGenerator(number) […]

A karmic ditty for developers everywhere

Whenever you start to complain First take the time to git blame!

Project Euler Problem #8

Functional JavaScript is cleaner than my C# solution, for sure! const raw = '731..450'; // Snipped for clarity. const chunkSize = 13; const multiply = (previous, current) => previous * current; const largest = (previous, current) => current > previous ? current : previous; function chop(string, size, chunks) { chunks = chunks || []; if […]

Cookie at rest

Cookie in a windowsill

Two trees in Knocksink Woods

I sat on these photographs for a week while I agonized about colours and controls. Too much contrast? Too yellow? Too saturated? In the end I decided to present them as-is.

My programming pair partner

I have no idea how Cookie found it comfortable underneath my laptop, let alone for six hours, but six hours she stayed.

The Huntress

Cookie never stops stalking. Not once, not ever, not even for a second.

Diptych at Knocksink Woods

Eadaoin and a dog at Knocksink Woods

A dog arrived and a dog left. Our story lies somewhere in between.

Bank holiday Monday at Knocksink Forest

Eadaoin looked beautiful, I looked like a bum.

Cookie in the kitchen

She quickly decided she was through with my shit.

Dawn from Windy Arbour

The last couple of weeks make me feel like my photographic mojo is on its way back.

Eadaoin at Spanish Point, September 2016

Taken the day after Maria’s wedding. Sore heads abounded.

Belgian railway platforms

The first is a different angle on Platform #12.

Eadaoin takes photographs at La Maison d’Érasme, Anderlecht

Rue de Formanoir, Anderlecht

About the only thing remarkable about Rue de Formanoir is Erasmus House at the far end from the metro station. There’s a weekend tradition where all the residents come out and turn out their homes to sell knick-knacks and mathoms on the street. The street market is a fantastic idea made possible by the high […]

Eadaoin at Zonnekemeers, Brugge

Zonnekemeers leads the way out of the old city and into the newer suburbs. You can see the progression in architecture from the 1700s to the 2000s as you walk from one end of the street to the other.

I mean it this time

That’ll be the title of my autobiography: I Mean It This Time: A lifetime of apologies from my strange self. The diagnosis turned me into some kind of quantum special snowflake. ASD flags me as a Tumblr-grade special snowflake, but at the same the stress of my stress is boring and ordinary. I wrote the […]

Rainy Ranelagh

Autumn has arrived in full force. :(

Holy shit, two thousand posts!

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 […]