Programming Leftovers
-
Undeadly ☛ Game of Trees 0.95 released
Version 0.95 of Game of Trees has been released (and the port updated): [...]
-
Scorpil ☛ Phoenix LiveView in Action
The Elixir programming language, and arguably its strongest showcase, the Phoenix Framework, are technologies that, in my mind, are constantly on the edge of mainstream popularity. Both the language and the framework are exotic enough to present a significant learning challenge, yet many of their innovative features, such as built-in fault tolerance, cluster-awarness and real-time communication capabilities, justify the effort.
I’ve been following the developments in the Phoenix Framework for the last five years, deeply intrigued by its evolution (I even went so far as to write a blog post about its strengths a few years ago). While I haven’t yet had the chance to work with Phoenix in a production setting on a large scale, I regularly experiment with it hands-on in various pet projects.
-
Rlang ☛ Exploring TidyAML: Simplifying Regression Analysis in R
If you’re a data enthusiast diving into the world of regression analysis in R, you’ve likely encountered the challenges of managing code complexity and juggling different modeling engines. The good news is that there’s a powerful tool to streamline your regression workflow – the tidyAML R package.
-
Rlang ☛ Advent of Array Elegance (AoC2023 Day 7)
I’m solving Advent of Code this year using a relaxed criteria compared to last year in that I’m allowing myself to use packages where they’re helpful, rather than strictly base R. Last year I re-solved half of the exercises using Rust which helped me learn a lot about Rust. This year I’m enamored with APL, and I wanted to share a particularly beautiful solution.
-
Arjen Wiersma ☛ Advent of Code 2023 day 9
The weekend generally is a place to find hard puzzles again, this time not so much. A simple quest to find the next number in a sequence with a fully written out algorithm to follow. They key here is to use recursion.
-
Pair of Pared Pears ☛ Introducing mpmetrics: A brief introduction to metrics
Metrics are measurements we make on a program. For example, say we wanted to know how long a function takes to call. We can wrap that function in a metric: [...]
-
Perl / Raku
-
Perl ☛ Perl Advent Calendar 2023: Mooish Attribute Shortcuts For Everyone!
Most of us surely know Moose. It is a solid piece of Perl software powering a lot of modern Perl code. It allows for very expressive definition of object attributes. This expresiveness comes at a cost, nicely explained by Curtis "Ovid" Poe in his blog post. In short: it is not immediately obvious what is the purpose of an attribute and you have to look at the option list to get the idea. In addition to that, the attributes become very verbose if you want to nail their behavior exactly right.
To solve this, you just install MooseX::Extended and enjoy new param and field, right? Sort of... The module does a lot of things, has a lot of dependencies and only works with Moose. If you often use Moo instead of Moose, you will have to find a Moo-specific module for this, and the API will likely be different.
This is the exact issue solved by Mooish::AttributeBuilder. It is a zero-dependency, module-agnostic helper for Moose family of modules letting you build your attributes more easily and give them meaning. It's not by any means a replacement of MooseX::Extended. On the contrary - it focuses on a very narrow scope of features and strives to deliver them for every Moose-compatible module on CPAN.
-
Perl ☛ Perl Advent Calendar 2023: Introduction to App::Timer
As you all know I have handful of distributions available on MetaCPAN. Although I am not actively managing any of them but I do look after them as and when needed.
If you look at the list of my distributions, you would notice that some of them are just plain application i.e. something that can be executed at the command prompt. One of them, e.g. App::Calendr. Every time, I run an application, I always wanted to know how long it took to complete the execution.
-
Rakulang ☛ Day 9 – Networks Roasting on an Open Fire, Part 1: Whipupitude
This year I decided to whip up a little display to let me know at a glance exactly how our Internet connection was failing, without having to investigate from scratch each time. First I needed a tool to measure with, something that could produce a stream of data I could analyze to produce the glanceable display. Thankfully such a tool is quite easy to find.
-
Rakulang ☛ Day 10 – The Magic Of Q
In the Raku Programming Language, one can indicate static strings with single quotes. And one can easily interpolate scalar variables in any string with double quotes: [...]
-
-
Python
-
James Bennett ☛ Don’t mock Python’s HTTPX
Which led to the rise of HTTPX (the Python one — there’s also an HTTPX in Ruby). HTTPX provides both sync and async support, a default timeout, and a pile of other features, and with a largely requests-compatible API requiring only minimal code changes to adopt. So I’ve been gradually switching my own projects over to it for a while now.
-
James Bennett ☛ Use unittest’s subtest helper
Many people nowadays prefer the third-party pytest testing framework; personally I have a slight preference for the unittest style of testing, but that’s neither here nor there, because the thing I want to talk about today is the unittest equivalent of a popular pytest feature. And if you’re using Django, its default testing tools are all built on top of unittest, so you have to do some work (and install several more third-party packages) to get equivalent functionality on top of pytest.
-