Picture

Name Marco von Ballmoos
Member since
Email [hidden]
Home page https://earthli.com/users/marco
Description

The (only) developer at earthli.com.

Contents

3736 Articles
113 Comments

1 year Ago

Refactoring a dead-simple progress-bar function

Published on in Programming

I just saw a neat code example from a Dutch government project (function starting at line 182). The commentator who posted it at Reddit wrote,

“Some people laughed at it and suggested all kind of clever one liners to replace it, but to me, that if statement is perfect. The intent is immediately clear and bugs are easy to spot. This is the kind of code you want in critical apps.”

Here’s the code.

private static string GetPercentageRounds(double percentage)
{
    if (percentage == 0)
       ... [More]

What’s the C-Suite reading these days?

Published on in Miscellaneous

 C-suite reading stuffI had the dubious pleasure of reading through MASTERING R&D COMPETITIVENESS IN 2030+ by Lea Thomas Smith, Denis Trost, Moritz Krogmann, Janina Pohl, Felix Prem (3dSE Management Consultants), which is a document about how to chart the roiling waters of the business climate of 2025. The following are some stream-of-consciousness notes I took while reading through it.

Being a bit obvious

The presentation is fast out of the gate: The executive summary screams at you to PANIC because YOU ARE MISSING OUT.

No. Stop doing that. FOMO is be resisted and coolly evaluated. You only need to “rethink... [More]”

Jason Stanley is against some fascism, I guess

Published on in Public Policy & Politics

I really like Chris Hedges as a writer, as a journalist, and as a person. He has impeccable instincts and principles. I don’t think that there is any way that he doesn’t know who Jason Stanley actually is. He interviewed him anyway, so that we could all have a look at how someone can sound like they’re on your side when they’re really falling far short.

Erasing History: How Fascism Works (w/ Jason Stanley) by The Chris Hedges Report (YouTube)

I waited long minutes to see if Stanley would discuss which current genocide is leading to the crackdown on universities, and realized that... [More]

High road vs. low road

Published on in Quotes

 Make sure you know whether you’re acting from experience and are just holding a grudge.

It’s perfectly legitimate to avoid toxicity but be keenly aware of whether you’re the one bringing it to the party.

The brainwashing you don’t see

Published on in Miscellaneous

A while back, I spotted the follow cross-post Being George Clooney Is Harder Than It Looks by Azra Raza (3 Quarks Daily). The screenshot below shows what this article looked like. This is an article that the main editor of 3QuarksDaily felt a burning interest to share. Before him, though, Maureen Dowd of the vaunted gray lady, The New York Times, felt a burning desire to shared with the world just how hard it is to be George Clooney.

 Being George Clooney Is Harder Than It Looks

This is, of course, mind-boggling if you’re not part of this world.

  • Did this article... [More]

An LLM use case with function-calling

Published on in Programming

The article Function calling using LLMs by Kiran Prakash writes,

“It’s important to emphasize that when using function calling, the LLM itself does not execute the function. Instead, it identifies the appropriate function, gathers all required parameters, and provides the information in a structured JSON format. This JSON output can then be easily deserialized into a function call in Python (or any other programming language) and executed within the program’s runtime environment.”

This is an approach that... [More]

Credit where credit is due: John Oliver takes down the ADF

Published on in Public Policy & Politics

I am a more-than-occasional critic of John Oliver’s “criticism lite,” which takes aim only at pre-approved targets, perhaps most recently in John Oliver and SNL don’t cause enough offense. I do not expect him to say a word about Israel, for example, until the entire rest of the establishment media has indicated that the coast is clear.

Still, this video about the odious ADF is a good and funny entry in the war against stupid and disingenuous.

Alliance Defending Freedom: Last Week Tonight with John Oliver (HBO) by LastWeekTonight (YouTube)

At about 07:40,

“One of its key founders was James... [More]

Links and Notes for May 9th, 2025

Published on in Notes

Below are links to articles, highlighted passages[1], and occasional annotations[2] for the week ending on the date in the title, enriching the raw data from Instapaper Likes and Twitter. They are intentionally succinct, else they’d be articles and probably end up in the gigantic backlog of unpublished drafts. YMMV.

[1] Emphases are added, unless otherwise noted.
[2] Annotations are only lightly edited and are largely contemporaneous.

Table of Contents

Sparing the enduring and ennobling from the hungry, hasty, and selfish

Published on in Quotes

 Lyndon B. JohnsonWe have rescued a magnificent and meaningful treasure from the chainsaw. For once, we have spared what is enduring and ennobling from the hungry and the hasty and the selfish act of destruction. The redwoods will stand because the men and women of vision and courage made their stand, refusing to suffer any further exploitation of our national wealth, and greater damage to our environment or any larger debasement of that quality and beauty without which life itself is quite barren.”
37th U.S. President Lyndon B. Johnson

From Roaming... [More] by Jeffrey St. Clair (CounterPunch)

A subtle failure to pattern-match null in C#

Published on in Programming

 The article The null check that didn’t check for nulls by Oren Eini (Ayende) points out an interesting and subtle difference in code-generation, depending on whether you use the var keyword. Using var in pattern-matching might lead to a pattern that looks like it checks for null but doesn’t. You can see and play with a live example (SharpLab.IO) but I’ve replicated the examples below.

This is the problematic example:

string Test1(List<string> strs)
{
    if(strs is [var s])
    {
        return s;
    }
    return... [More]

Zed shows off how to work with AI agents

Published on in Programming

The article Zed: The Fastest AI Code Editor by Richard Feldman (Zed) includes a great description and video that shows off the behavior of their new “agent” feature.

“The entire Zed code editor is open source under GPL version 3, and scratch-built in Rust all the way down to handcrafted GPU shaders and OS graphics API calls. Zed’s new AI capabilities are also open-source, just like the rest of the editor, so you can see exactly what the new Agent Panel is doing under the hood.”

This editor is very, very smooth and more... [More]

Almost all data sources are poisoned by ideology

Published on in Technology & Engineering

The article What people get wrong about the leading Chinese open models: Adoption and censorship by Nathan Lambert (Interconnects) discusses the politics behind AI models but only from the perspective of the western empire. It makes a good point but can’t see that it applies all ways.

“People vastly underestimate the number of companies that cannot use Qwen and DeepSeek open models because they come from China. This includes on-premise solutions built by people who know the fact that model weights alone cannot reveal anything... [More]”

Slopseeding > Slopsquatting

Published on in Technology & Engineering

The article AI hallucinations lead to a new cyber threat: Slopsquatting by Shweta Sharma (CSO Online) writes,

“If a single hallucinated package becomes widely recommended by AI tools, and an attacker has registered that name, the potential for widespread compromise is real,” according to a Socket analysis of the research. “And given that many developers trust the output of AI tools without rigorous validation, the window of opportunity is wide open.
A significant number of packages, amounting to 19.7% (205,000... [More]

ESC 2025 in Basel, Switzerland

Published on in Fun

 Eurovision Song Contest 2025It is that time of year again and this time the whole shebang is happening in Switzerland, right up the road in Basel.

I wrote these notes for fun, so don’t expect me to write about each group, and don’t expect any sort of fair evaluation of each group’s talent. I started writing somewhere after a couple of groups into the first semifinals. I filled those in during the finals. My partner insists on watching this thing, so let’s get right to it. I wanted to watch it in Italian for fun and... [More]

Commencement thoughts

Published on in Quotes

From Pomp and Circumstance by Corey Robin, a short article about NYU’s craven response to NYU student denounced Israel’s genocide in Gaza during his graduation speech to roaring applause. (YouTube)

“Try to imagine at least once a day that you are not an American. Go even further: try to imagine at least once a day that you belong to the vast, the overwhelming majority of people on this planet who don’t have passports, don’t live in dwellings equipped with both refrigerators and telephones, who have never even... [More]”
Susan Sontag

Links and Notes for May 2nd, 2025

Published on in Notes

Below are links to articles, highlighted passages[1], and occasional annotations[2] for the week ending on the date in the title, enriching the raw data from Instapaper Likes and Twitter. They are intentionally succinct, else they’d be articles and probably end up in the gigantic backlog of unpublished drafts. YMMV.

[1] Emphases are added, unless otherwise noted.
[2] Annotations are only lightly edited and are largely contemporaneous.

Table of Contents

Terrifying you into buying services you can’t use

Published on in Technology & Engineering

The article OpenAI and start-ups race to generate code and transform software industry by Cristina Criddle, Melissa Heikkilä (FT) was written in April of 2025 but feels like it could have been written at any time in the last two years.

A high author/content ratio

First off, kudos to the FT for doubling down and having two authors massage an OpenAI press release into an “article” that has just under 700 words in it. No wait. I just saw that, at the very end of the article, they write that it includes “Additional reporting from George... [More]”

It’s good to be king

Published on in Technology & Engineering

 The article Judge on Meta’s AI training: “I just don’t understand how that can be fair use” by Ashley Belanger (Ars Technica) describes Meta’s defense of its having helped itself to about 82TB of copyrighted books from illegal torrents.

Meta, like most AI companies, holds that training must be deemed fair use, or else the entire AI industry could face immense setbacks, wasting precious time negotiating data contracts while falling behind global rivals. Meta urged the court to rule that AI training is a transformative... [More]”

Learning from books

Published on in Quotes

“A good novel tells us the truth about its hero, but a bad novel tells us the truth about its author.”
G.K. Chesterton in 1905 (Heretics)

Links and Notes for April 25th, 2025

Published on in Notes

Below are links to articles, highlighted passages[1], and occasional annotations[2] for the week ending on the date in the title, enriching the raw data from Instapaper Likes and Twitter. They are intentionally succinct, else they’d be articles and probably end up in the gigantic backlog of unpublished drafts. YMMV.

[1] Emphases are added, unless otherwise noted.
[2] Annotations are only lightly edited and are largely contemporaneous.

Table of Contents

4Chan was hacked to death

Published on in Miscellaneous

Amid all of the snark in this article Did you even notice 4chan’s gone? by Ryan Broderick & Adam Bumas (Garbage Day), which doesn’t even try to pretend to have an any objectivity about what the author very clearly considers an unsavory place, was at least an admission that 4Chan was,

“[…] a website that, effectively, invented the concept of the internet meme and was one of the last truly anonymous spaces left on the web.

A plea for an NC-17 Internet

I never used 4Chan. I didn’t have an account there. I would occasionally see flashes... [More]

Links and Notes for April 18th, 2025

Published on in Notes

Below are links to articles, highlighted passages[1], and occasional annotations[2] for the week ending on the date in the title, enriching the raw data from Instapaper Likes and Twitter. They are intentionally succinct, else they’d be articles and probably end up in the gigantic backlog of unpublished drafts. YMMV.

[1] Emphases are added, unless otherwise noted.
[2] Annotations are only lightly edited and are largely contemporaneous.

Table of Contents

How pattern-matching in C# is lowered

Published on in Programming

 A while back, I wrote Stop trying so hard to use pattern-matching. I stand by everything i wrote there. I was recently mentoring a very clever programmer who’s new to C# but has cut his teeth on Rust. We were discussing switch statements vs. switch expressions. Which pattern-matching features can you use where? Which features can you combine?

The article Tutorial: Use pattern matching to build type-driven and data-driven algorithms (Learn Microsoft) offers a good introduction. Pattern-matching on objects is... [More]

The best poems are ineffable

Published on in Philosophy, Sociology, & Culture

The poem in Tell me Something I don’t Know by Jim Culleny (3QuarksDaily) isn’t deeply thought-provoking or revelatory but it does what poetry does best: it seems to distill meaning from elegantly juxtaposed words.

“Tell me how to weave
tomorrow into yesterday
without tangling, without
strangling today”

You see? I love it but I don’t know what it means. Not yet.

A poetic friend wrote to tell me that,

“About the poets and their words. Can you ‘know’ what they mean? Nope! Like a good question maybe we can “die Fragen selbst... [More]”

Angular is pretty specialized

Published on in Programming

 I recently had a conversation about the pros and cons of using Angular and I found this year-old article that I’d prepared from my notes but never published. The article
Two-way binding between Signals and Query Params by Julio Castro (Software Engineering Corner by Zühlke Engineers) includes the following code snippet.

@Component({
  selector: "app-root",
  standalone: true,
  imports: [AsyncPipe],
  template: `
    <h1>Signals Demo</h1>
    <p>Your first name is: {{ firstName$ | async }}</p>
  `,
})
export class AppComponent {
  private activatedRoute =... [More]

Balancing user experience and performance in a web page

Published on in Programming

 This video is just under 30 minutes and provides a lot of useful tips about how to optimize web pages. It’s almost a year old, but a lot of the optimizations are good to know, even though they won’t apply to most pages out there. It’s good to know how the browser works and which heuristics it uses to determine what can be optimized. Knowing these things helps you avoid accidentally formulating your web pages in ways that slow things down unnecessarily. You’ll be less likely to suffer under... [More]

Swift protocol extensions for C#

Published on in Programming

 Extension syntax in C#14Since this feature is being touted for C# 14—this time it’s coming for real!—I thought it would be good to refresh what I’d already learned about it. The title is a bit hyperbolic but it’s quite an interesting feature. It’s basically protocol extension from Swift for C#. It’s .NET’s answer to extending extension methods to properties and, probably, operators. You can’t add state, as far as I can tell. But that isn’t so surprising.

The video below discuss the proposal as it looked for... [More]

A good intro to .NET Aspire from the 2024 Build Conference

Published on in Programming

This is another 46-minute, 10-month-old video from the last Build conference that I found extremely helpful in explaining what .NET Aspire is and what it’s good for.

Demystify cloud-native development with .NET Aspire | BRK181 by Microsoft Developer (YouTube)

Damian Edwards and David Fowler do a soup-to-nuts demonstration of Aspire. It basically lets you configure your multi-project, distributed projects with code rather than with YAML (e.g. dockercompose.yml). Instead, it writes the files for you and handles the deployment to Docker. This lets you much more easily create and... [More]

Toub and Hanselmann at the Build Conference 2024

Published on in Programming

This 46-minute presentation by Scott Hanselman and Stephen Toub is ten months old but is still worth watching. I note below that one of the more significant things Toub shows is not any sort of programming wizardry, but column-selection in a text editor. Half of the things that people use AI for can be solved with column-select and judicious copy/paste.

'Highly Technical Talk' with Hanselman and Toub | BRK194 by Microsoft Developer (YouTube)

Another fantastic “deep dive” with these two: this time they’re optimizing the Humanizer library on-the-fly, on-stage, during a session.... [More]

Getting Docker in the path on MacOS

Published on in Programming

I couldn’t call Docker from the command line. I had installed Docker a long time ago, but had just restored from a Time Machine backup, so my system was new but the applications had been restored. That meant that Docker had recorded that the executables had been sym-linked to the right folder (/usr/local/bin) but those links were part of the old, dead system.

Long story short, go to the settings, as shown below. If you’re in the situation that I was in, in which the app was out of sync with... [More]