Programming Leftovers
-
Yoshua Wuyts ☛ The gen auto-trait problem
One of the open questions surrounding the unstable gen {} feature is whether it should return Iterator or IntoIterator. People have had a feeling there might be good reasons for it to return IntoIterator, but couldn't necessarily articulate why. Which is why it was included in the "unresolved questions" section on the gen blocks RFC.
Because I'd like to see gen {} blocks stabilize sooner, I figured it would be worth spending some time looking into this question and see whether there are any reasons to pick one over the other. And I have found what I believe to be a fairly annoying issue with gen returning Iterator that I've started calling the gen auto-trait problem. In this post I'll walk through what this problem is, as well as how gen returning IntoIterator would prevent it. So without further ado, let's dive in!
-
Dmitrii Kovanikov ☛ The Most Elegant Configuration Language
I adore simplicity. Especially composable simplicity.
If I know two things A and B, I want to automatically know the result of their composition.
What I don’t want is reading a 1000-page book explaining all the edge cases and undefined behaviours happening in the process.
-
Nicholas Tietz-Sokolsky ☛ Beginning of a MIDI GUI in Rust
A project I'm working on (which is definitely not my SIGBOVIK submission for this year, and definitely not about computer ergonomics) requires me to use MIDI. And to do custom handling of it. So I need something that receives those MIDI events and handles them.
But... I'm going to make mistakes along the way, and a terminal program isn't very interesting for a presentation. So of course, this program also needs a UI.
-
Chris Coyier ☛ Tech + Pace Layering
I gathered together examples of people who have been infected with the pace-layer mindworm who were applying the same layered thinking to other areas: [...]
-
Rlang ☛ Identifying data gaps with R
I first came across the idea of ‘data gap mapping’ when a client engaged our team to develop a composite index to improve how they monitored national economic, political and social risks.
In most cases a ‘data gap mapping’ tries to compare what data is needed with what’s available. This can to reveal not only where additional data is needed, but also the shortcomings of the data available to us – whether in quality, quantity, frequency, or granularity. Aside from this helping to highlight potential blind spots that might emerge in our analysis, it can also be helpful for highlighting where extra effort might be needed to fill any data gaps that are identified.
-
MaskRay ☛ Understanding and improving Clang -ftime-report
Clang provides a few options to generate timing report. Among them, -ftime-report and -ftime-trace can be used to analyze the performance of Clang's internal passes.
-
Perl / Raku
-
Arne Sommer ☛ Delete and Even with Raku - Arne Sommer
You are given a list (3 or more) of positive integers, @ints.
Write a script to return all even 3-digits integers that can be formed using the integers in the given list.
-
Perl ☛ 2025-01-11 [Older] This week in PSC (175) | 2025-01-09
-
-
Python
-
Justin Duke ☛ Truncating timedeltas in Django
Let's say we want to aggregate the number of likes on a post relative to the post's creation time (for instance, to visualize the growth of a post's popularity over time), yielding a list of tuples of the form [(minutes_since_post_creation, number_of_likes)].
-
University of Toronto ☛ A mystery with Django under Apache's mod_wsgi on Ubuntu 24.04
We have a long standing Django web application that these days runs under Python 3 and a more modern version of Django. For as long as it has existed, it's had some forms that were rendered to HTML through templates, and it has rendered errors in those forms in what I think of as the standard way: [...]
-
-
Shell/Bash/Zsh/Ksh
-
Murtuzaali Surti ☛ Issue With NVM Node Version Across Terminals: Command Node Not Found
If you use a unix based operating system like macOS or Linux, you might have encountered this issue with switching node versions with nvm - where if you do nvm use , the version is switched correctly in the current terminal shell, but if you try to use node on a new terminal shell or in a different terminal, you get a command node not found error.
I recently experienced this issue myself, and will try to consolidate the fixes here in this post as a reference to my future self as well as for all of you folks.
-
Chris Done ☛ Hell (Haskell shell): Year in Review
Hell is my little shell scripting language which is a thin layer over Haskell, using its syntax, its standard library and runtime, with a simpler static type system. You can find examples here.
Over the year of 2024, I’ve written a few non-trivial shell scripts in Hell at work, and now a few colleagues have used it, too. Now I can use that to evaluate strengths and weaknesses of it as a tool. I can’t really share those shell scripts because it’s not open source, but I’ll drop in some contrived example code at the start of each heading as an amuse-bouche. The short version of work scripts is: [...]
-