Programming Leftovers
-
Scott Willsey ☛ Astro Templates for JSON Data
Web frameworks like Astro often allow the use of Markdown for blog post “content”, that is, the actual blog post, and then the page design and programming is in a page template which takes the Markdown and renders its contents in the appropriate place for a fully rendered HTML page. This is convenient and allows excellent separation of written words (“content”) and site rendering mechanisms.
Sometimes, though, what you want to put on the page is more complicated than you can easily do in Markdown. Such is the case with my /uses page on this website.
-
Xe's Blog ☛ TIL: you need to escape the in a string in an inline script in HTML
When I was implementing this change in my site, I ran into a weird issue where my literal JavaScript text was being inserted into the page as if it was in the literal HTML. This was odd at first, but then I realized what was going on.
-
Rlang ☛ Accounts Recievables Pathways in SQL
In summary, this SQL code drops an existing table (if it exists), creates a new table with specific columns, inserts data into the new table by concatenating values from another table, and then selects data from the new table along with a calculated value for the number of distinct collector departments.
-
SICP ☛ Still no silver bullet?
In his 1986 article No Silver Bullet—Essence and Accident in Software Engineering, Fred Brooks suggests that there’ll never be a single tool, technique, or fad that realises an order-of-magnitude improvement in software engineering productivity. His reason is simple: if there were, it would be because current practices make software engineering ten times more onerous than they need to be, and there’s no evidence that this is the case. Instead, software engineering is complex because it provides complex solutions to complex problems, and that complexity can’t be removed without failing to solve the complex problem.
Unfortunately, the “hopes for the silver” that he described as not being silver bullets in the 1980s are still sold as silver bullets.
-
Ben Hoyt ☛ Discussing Forth, C, CGI, Python, Go, and AWK on Stray Pointers
This is a lightly edited, um-removed transcription of the conversation I had with Jim Lawless, host of the varied and interesting Stray Pointers podcast. It was recorded on the 15th of January (U.S. time). We discuss Forth, C, CGI, Python, Go, and AWK.
-
Bodo Tasche ☛ Email validation - easy to get wrong, simple to fix
If you mention email validation, most developers only think about the technical aspect of it. What is a valid email? Basically, there are two ways of thinking about it: Regular expressions are enough or Regular expressions don’t cover 100% of the email standard. For that I can only say: yes, a regular expression does not work for your esoteric email addresses, but who cares? The w3c spec for says this should be done with this regular expression: [...]
-
Terence Eden ☛ A (tiny, incomplete, single user, write-only) ActivityPub server in PHP
I've written an ActivityPub server which only allows you to post messages to your followers. That's all it does. It won't record favourites or reposts. There's no support for following other accounts or receiving replies. It cannot delete or update posts nor can it verify signatures. It doesn't have a database or any storage beyond flat files.
But it will happily send messages and allow itself to be followed.
This shows that it is totally possible to broadcast fully-featured ActivityPub messages to the Fediverse with minimal coding skills and modest resources.
-
Juha-Matti Santala ☛ I like to glue things together
Over the holidays, I ran into a blog post Whatever happened to programming? from 2010 by Mike Taylor. In it, Mike argues that development has lost its appeal to him because it’s so much of putting together pieces other people made and less about creating things from the scratch. He has also written a follow-up based on the comments the original post received.
-
Uwe Friedrichsen ☛ Software - It's not what you think it is - Part 4
Many misconceptions regarding software stem from comparisons with physical products like, e.g., cars or houses. We already discussed the assembly line fallacy in the first post of this series. The value preservation dilemma also has its roots in these broken comparisons.
The core of the dilemma is that most people do not realize that software needs to be changed continually to preserve its value. Meir Lehman already 1980 pointed out in his great paper “Programs, life cycles, and laws of software evolution”, that all successful systems need to be adapted continuously to respond to the ever-changing needs of their environment. 1
-
Earthly ☛ Showboaters, Maximalists and You
Programming language features can make code clearer. They can improve readability. But each feature is also a new tool for writing horrible code. Is that worse than people writing horrible code with other simpler constructs? It might be, but it’s hard to judge a solution if you don’t know the language.
If you’re going to spend your career doing this, it makes sense to keep learning. To use a language that allows experts to cleanly solve problems. But yeah, just don’t leave piles of esoteric code around for others to inherit.
-
Zach Flower ☛ Repositories Are at the Center of Development and Production
As mentioned in last week's Sunday Reboot, I've recovered a few of my old posts from the Wayback Machine—all from my time at the now shut-down Fixate.io (via their blog, Sweetcode). These are all freelance topics, so the style of writing is a bit different than normal (for me, at least), and the topics are a little wider-ranging than I would normally write about here. I can't quite remember who this piece was originally intended for. I believe it might have been Wercker in 2016 (now owned by Oracle), but I'm not 100% sure.
-
Jamie Zawinski ☛ The time_t is now
Here's a glibc roadmap of one possible solution, which sounds pretty sensible to me. It's not clear to me whether Debian is doing that, something else, or a combination.
-
Python
-
Michael's and Christian's blog ☛ ML + XAI -> Strong GLM in Python
In our latest post, we explained how to use ML + XAI to build strong generalized linear models with R. Let’s do the same with Python.
-
-
Shell/Bash/Zsh/Ksh
-
[Old] Martin Tournoij ☛ s/bash/zsh/g
There is simply no way you can do calculations with fractions in bash without relying on bc, dc, or some hacks. Compared to simply being able to use a + b it’s ugly, slow, and difficult.
-