Jonathan Carroll's micro blog

Fuzzy Grouping

A former colleague got in touch recently with a question about how one might perform the following grouping operation… Given a set of medical terms that may include typos and variations (as is typically the case for real-world medical data) group “similar” items together in the …

Friends, Romans, Countrymen, lend me your debuggers

This was just going to be a short toot, but it keeps growing so I moved it over to here. I thought I was about to have the shortest “cheat” solution to an #Exercism problem - Roman Numerals - where we need to convert a number to roman. R already has as.roman() though it returns an object …

Breaking down squared digits in (Dyalog) APL

I love small challenges as a way to learn a language. I spotted this one in the #rstats hashtag on Mastodon “square each digit of an integer (return integer), eg 9113 becomes 81119” and I just had to try it in APL. First, extract each of the digits using format {⍎¨⍕⍵}9113 9 1 1 3 then …

Breaking down fizzbuzz in (Dyalog) APL

The one-liner solution: {∊(3↑(0=3 5|⍵)∪1)/'Fizz' 'Buzz' ⍵}¨⍳20 The explanation: For each value in [1, 2, ..., 20], find the boolean mask of “is this divisible by 3 or 5?” (vectorized). {0=3 5|⍵}¨⍳20 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ │0 0│0 …

Filtering Vectors

I saw a YouTube short demonstrating how to use filter() in Python along the lines of nums=range(1,30) def is_prime(num): for x in range(2,num): if (num%x) == 0: return False return True primes=list(filter(is_prime, nums)) print(primes) # [1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29] and as always, I like …

Around the web 2023W24

I think I’m happy with my RSS-to-email setup now but I feel like I’m only passively reading things and can do better. I’m going to try summarising (on this micro blog) the interesting posts I see (RSS feeds, newsletters, social feeds, general web finds) as a way to share some …

FizzBuzz without an if

Apparently using an if to solve FizzBuzz is a sign that you’re not a great programmer… Well, that’s how I would have done it :-( I wanted to see what the map alternative looked like, and I found this python example print(*map(lambda i: 'Fizz'*(not i%3)+'Buzz'*(not i%5) or i, …

Finished reading: Bullshit Jobs by David Graeber 📚

Finished reading: Bullshit Jobs by David Graeber 📚 I’ll preface this with my sympathy for my colleagues and friends currently struggling to find work after corporate layoffs. This book makes their plight even worse as it details people who do have jobs, but don’t believe they should as …

Finished reading: Soonish by Kelly and Zach Weinersmith 📚

Finished reading: Soonish by Kelly and Zach Weinersmith 📚 Another ‘prominently featured on a library shelf’ find that caught my attention partly because of the authors' name - I’ve spent many hours reading Saturday Morning Breakfast Cereal and there was definitely a time during my …

Finished reading: Version Zero by David Yoon 📚

Finished reading: Version Zero by David Yoon 📚 I thoroughly enjoyed this book. Credit to my local librarians who placed it prominently on a shelf I was casually browsing. The author does a great job of slowly building up the characters and turning up the dial in the last third of the story to the …

Finished reading: Eastern Standard Tribe by Cory Doctorow 📚

Finished reading: Eastern Standard Tribe by Cory Doctorow 📚 I found this one browsing the shelves at the library and recognised the name from my days reading boingboing.net (and the numerous mentions in XKCD, e.g. this one). I didn’t hate this book, but the writing style did remind me a lot of …

Finished reading: 500 Chess Questions Answered by Andrew Soltis 📚

Finished reading: 500 Chess Questions Answered by Andrew Soltis 📚 Not a novel and not a textbook, but it took long enough to read that it deserves mention. This is full of valuable tips and notes, but aside from reading it cover to cover, it doesn’t serve much use as a reference. There were a …

Finished reading: The Apocalypse Seven by Gene Doucette 📚

Finished reading: The Apocalypse Seven by Gene Doucette 📚 As soon as I finished The Spaceship Next Door I had a look for the author’s other books. I got mixed up between a couple and I thought this one was the sequel. It’s not, but I borrowed a copy anyway. This is a different story, but …

Finished reading: The Phoenix Project by Gene Kim 📚

Finished reading: The Phoenix Project by Gene Kim 📚 I was on the fence about this one; I’ve managed a tech team before but I’m not currently in charge of anyone so I’ve about had my fill of ‘mangement’ information books. With that said, this is a novel that tells a …

Finished reading: Jellyfish Age Backwards by Nicklas Brendborg 📚

Finished reading: Jellyfish Age Backwards by Nicklas Brendborg 📚 Another recommendation from social media, if I recall. This had a lot of really interesting information about aging across species, some things we’ve discovered that influence it, and some things that don’t. The focus …

Finished reading: The Spaceship Next Door by Gene Doucette 📚

Finished reading: The Spaceship Next Door by Gene Doucette 📚 I like to mix in some fiction between more serious topics, and someone recommended this. I couldn’t find a physical copy anywhere so I tried out my library’s ebook offering (Libby). I’d have preferred to use my new Kindle …

Finished reading: 10% Human: How Your Body’s Microbes Hold The Key To Health And Happiness by Alanna Collen 📚

Finished reading: 10% Human: How Your Body’s Microbes Hold The Key To Health And Happiness by Alanna Collen 📚 I had this one on my shelf for a while and I’m very happy I finally got around to reading it. I knew (roughly) that we have a vast microbiome within our gut, but I hadn’t really …

Finished reading: Once Upon an Algorithm by Martin Erwig 📚

Finished reading: Once Upon an Algorithm by Martin Erwig 📚 I liked the premise of this book - algorithms taught with examples from classic children’s tales. I didn’t finish it, however - it was just too wordy (I got about halfway through). In fairness, I started with a very similar …

Finished reading: The Book of Why by Judea Pearl 📚

Finished reading: The Book of Why by Judea Pearl 📚 This was the topic of a book club at work but I’m really glad I read it. My scepticism going in was probably typical of someone not all that familiar with causal analysis, believing that we can just throw all the variables at a regression …

Finished reading: The Self-Taught Computer Scientist by Cory Althoff 📚

Finished reading: The Self-Taught Computer Scientist by Cory Althoff 📚 This is the book I wish I’d read before doing Advent of Code - a full blog post on that will eventually be on my main blog; I finished both parts of all 25 exercises in (strictly) base R, and am more than halfway through …

Finished reading: Living in Data by Jer Thorp 📚

Finished reading: Living in Data by Jer Thorp 📚 (previously) As a data person, this book spoke to me deeply. As someone who has worked with collected data many times, it offered a fresh insight into understanding nuances of data, where it has come from, how it is never collected without human …

Finished reading: The Checklist Manifesto by Atul Gawande 📚

Finished reading: The Checklist Manifesto by Atul Gawande 📚 I honestly didn’t know what I was getting when I placed a library hold on this book - a recommendation from somewhere, but I assumed it was about something like how to write good checklists or manage priorities. This is not that book. …

Finished reading: Our Data, Ourselves by Jacqueline D. Lipton 📚

Finished reading: Our Data, Ourselves by Jacqueline D. Lipton 📚 I abandoned this book after a few chapters. I wasn’t sure how much I really wanted to read a book about technology and data where the author claims on page 10 that “RFID can be monitored at a distance. You do not need a …

Currently reading: Living in Data by Jer Thorp 📚 I picked this up browsing shelves in a (particularly beautiful) brick and mortar book store thanks to a voucher I received for a journal article review. So far I’m loving it. This was my first introduction to Johanna Drucker’s framing of …

Finished reading: Loonshots by Safi Bahcall 📚

Finished reading: Loonshots by Safi Bahcall 📚 This was recommended by someone at work and this time I’m very glad they did. The author carefully details the history of some of the most significant breakthroughs and, as a physicist, isn’t shy with the specifics. It was staggering to me at …