Jonathan Carroll's micro blog

Bringing type checking to R

Another ‘toot that became too long’ post, this time about dynamically vs strictly typed languages. Vapour is a new language that just dropped that has strict typing and transpiles to R (dynamic types) which means developers can write and refactor code with all the benefits of a …

Leap Years with GCD in various languages

I saw this deck via Haskell Weekly Recap which noted an interesting property: “x is a leap year if and only if gcd(80, x) > gcd(50, x)” (gcd = ‘greatest common divisor’) which I haven’t fully appreciated the origin of, but wanted to try some implementations. The …

R function call overhead

I’m entirely perplexed by this - I was exploring an idea I saw discussed in a blog post (that will have to wait for now - I’ll come back to it) and found some interesting behaviour I don’t understand. I managed to boil the issue down to the following: let’s say I have a …

Book review: Data Analysis with AI and R

I published Beyond Spreadsheets with R with Manning Publications partly because they approached me, but a lot because they seem to do a good job of publishing technical books and making them DRM free - if you buy a physical copy you get access to the eBooks to download (pdf, epub, …) and use …

Enums in R

I’m looping back to reading some of Tidy Design Principles since it hasn’t been touched in a while (indicating some stability, at least in the short term). I jumped ahead to a section on enums out of curiosity and pondered on them a bit more - they’re really useful in Rust, maybe …

How do you do personal knowledge management?

This post is a bit of a brain dump / working-out-loud thing. The posts here on jcarroll.xyz are less formal than what I put on my main blog jcarroll.com.au which is more for technical articles on coding. There won’t be any code in this post. This was built up from a series of notes captured …

On content creation motivation

(this was going to be a (series of) toot(s) but it got too waaay too long) I enjoyed reading a blog post this morning, linked there from some other site. As I always do, I checked their other recent posts to see if I want to add them to my RSS feed service, and found one explaining why they’re …

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 …