Toots for christophberger@c.im account

Written by Christoph Berger on 2025-02-04 at 19:43

The road to wisdom? Well, it's plain

And simple to express:

Err

and err

and err again,

but less

and less

and less.

The latest Applied Go Weekly Newsletter is here!

https://newsletter.appliedgo.net/archive/error/?utm_source=appliedgo-mastodon

[#]golang

https://newsletter.appliedgo.net/archive/error/?utm_source=appliedgo-mastodon

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-31 at 15:52

Make it simple but not too simple

Strive for simplicity.

There are good reasons for this:

…but know that complex problems cannot have simple solutions.

Avoid like the plague: Building a complex (let alone complicated) solution for a simple problem.

=> View attached media

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-31 at 15:32

DeepSeek DOES tell you about Tiananmen Square... if you ask it to act as a neutral historian.

=> View attached media

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-30 at 17:37

If you use DeepSeek, all your data is sent… TO CHINA! 🇨🇳 😱

You may or may not be concerned about this. After all, the Chinese are really nice people, and you have been buying a lot of hardware and software from Chinese companies already, didn't you? DIDN'T YOU?!

But everyone who is concerned about data privacy can use a simple solution: DeepSeek hosted on servers within your jurisdiction. The laws of your country (or conglomerate of countries) apply. If those laws are good, they protect your privacy rights well.

The DeepSeek model can run anywhere because it's open source. (Rule of thumb: Cool companies build open source products.) You can take that model and run it in a data center of your choice (or have the data center run it for you).

I gave Nebius AI Studio a try. Nebius is a company in the Netherlands that runs a long list of open source LLMs on their GPUs, including DeepSeek V3 and R1. I connected my Open WebUI instance to their DeepSeek V3 and R1 instances via an OpenAI-compatible protocol. So far, it runs like a charm.

Question to you: Which EU-based AI model hosting providers (preferably with pay-per-token billing) do you know/use/love?

(Nebius are the first I came across after a very exhau^W superficial search, but there are surely others as well. Not that I'd want to switch, though. Their service runs flawlessly.)

=> View attached media

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-29 at 16:02

"Self-documenting code or external code documentation" is a false dichotomy.

Both are indispensable, on different levels.

And in-between, there are code comments.

There is no either-or.

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-28 at 15:16

Silent observation shouldn't affect the observed. Sometimes, however, you can' avoid to affect the object you observe. For example, to track a data structure across its lifetime, you'd need to hold a pointer to it. But an active pointer to an object prevents it from getting garbage collected.

A catch-22?

Say hello to weak pointers. More on this in the Spotlight section of the latest Applied Go Weekly Newsletter issue.

https://newsletter.appliedgo.net/archive/2025-01-26-a-weak-connection-is-still-a-connection/?utm_source=appliedgo-mastodon

[#]golang

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-24 at 17:05

ORM or plain SQL?

Er, no.

The question isn't: "ORM or plain SQL".

The question is: Do you know SQL well enough to use an ORM?

If you don't know how SQL (and relational databases in general) works and you choose to start with an ORM, then you'll be at the ORM's mercy. You'll be prone to writing an infamous "n+1 query", creating data redundancies, difficult-to-query data, and whatnot. Heck, I've seen 1:n relationships implemented as JSON blob columns.

To be clear, the ORM is not the culprit. It's the lack of understanding the fundamentals of relational databases that will have brought you there.

The question, "should I learn SQL or just pick an ORM?" is wrong in itself. Learn SQL, learn relational databases, and then you'll enjoy the freedom of choice. 💐

=> View attached media

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-24 at 08:30

Hey, mich würde mal interessieren, wie viele deutschsprachige Gopher eigentlich hier unterwegs sind!

[#]golang

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-24 at 07:10

Keith Jarret's The Köln Concert album was released on Jan 24, 1975—50 years ago. (HT to Radio Bayern 2 who made me aware.)

That reminded me that I have stacked a few CDs from Keith Jarret when I was a bit younger.

Time to dig up some old memories... (Now playing: Tabarka, from the album My Song)

[#]jazz #memories

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-23 at 15:36

BART and IIFE: Two Disparate Spotlights

Two new entries in appliegdo•net/spotlights:

The latest one, fresh from the newsletter:

BART, The Little Routing Table Package That Became Indispensable

https://appliedgo.net/spotlight/bart-routing-table/

And one from the attic:

Immediately Invoked Function Expressions

https://appliedgo.net/spotlight/immediately-invoked-function-expressions/

[#]golang

https://appliedgo.net/spotlight/bart-routing-table/

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-22 at 15:13

Always be clear about the difference between "complex" and "complicated".

A complicated system has many moving parts, yet they work together in a well-defined way. A combustion engine or a compiler are examples of complex systems.

A complex system has many moving parts whose interactions are poorly defined or even unknown. Predicting the behavior of a complicated system can be impossible.(*)

Treat complex systems merely as complicated at your own peril.


Trivia

The Zen of Python includes these lines for a reason:

Simple is better than complex.

Complex is better than complicated.


(*) This being said, there is some irony in the fact that extra features on a timepiece are called "complications" and not something like "complexifications". (**)

(**) This fact has historical reasons. The term "complication" was coined by clockmakers before modern system theory created the distinction between "complex" and "complicated".

=> View attached media

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-21 at 15:28

In Ulm's computing domain

Charly builds networks to reign

His tables and lists

Help firewalls persist

While packets flow smooth down the lane

The latest Applied Go Weekly Newsletter is here!

https://newsletter.appliedgo.net/archive/2025-01-19-everyones-favorite-route/?utm_source=appliedgo-mastodon

[#]golang

https://newsletter.appliedgo.net/archive/2025-01-19-everyones-favorite-route/?utm_source=appliedgo-mastodon

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-20 at 18:13

"Debugging needs a debugger."

Nnnope.

Debugging starts way before starting a debugger.

To reduce bugs in your code:

Debugging isn't what you do with a debugger. Debugging is everything you do to eliminate undesired behavior in your code. The debugger is but one tool in a large arsenal of debugging tools and techniques.

=> View attached media

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-17 at 17:23

My little remote software stack

I am working on reducing my dependency on my laptop, or any local machine in general.

So far, this is the small stack of (open source) software I use:

One goal I pursue is data sovereignty, which is why you see no centralized service of the Big Ones listed.

Curious, what self-hosted software are you using for fun and profit?

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-16 at 15:47

Two more spotlights are online:

Big Things Will Happen

https://appliedgo.net/spotlight/big-things-will-happen-2025/

How To Verify Struct Initialization For Completeness

https://appliedgo.net/spotlight/verify-struct-initialization-complete/

[#]golang

Enjoy reading!

https://appliedgo.net/spotlight/big-things-will-happen-2025/

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-15 at 15:22

Clean up what the GC can't clean up

Gophers coming from OOP languages may occasionally miss a finalizer in Go. Fret no more: With the AddCleanup function, new in Go 1.24, you can close files, disconnect DB connections, and clean up other resources once the object containing these resources becomes unreachable.

Here is how it works:

If the object containing the resource becomes unreachable, hence due for garbage collection, the cleanup function is called.

A small but important caveat: The cleanup function must not refer to the object containing the resources. Otherwise, the object would always be referenced by reachable code and would never become subject to garbage collection; hence, the cleanup function would never run.

The example in the screenshot and in the playground is simplified as much as possible. The object is a temporary file, and the cleanup function removes the file from disk.

https://go.dev/play/p/05BWkHUHWZo?v=gotip

=> View attached media

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-14 at 15:51

A new Applied Go Weekly Newsletter issue is available:

https://newsletter.appliedgo.net/archive/2025-01-12-big-things-will-happen/

https://newsletter.appliedgo.net/archive/2025-01-12-big-things-will-happen/

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-12 at 23:00

Yesterday, I found my old Sinclair ZX Spectrum in the attic of my parents' house.

Sweet memories!

It was my second computer (after a ZX81), and I hacked Basic programs into it, hitting the rubber keys one Basic keyword a time.

And this Z80 assembly programming book! OMG. The Z80 is an eight-bit processor. I guess even an Arduino has more power than those home computers from the 1980s.

There was a large array of literature for these early consumer computers, books as well as magazines. Some peeps even disassembled and commented the whole OS ROM in a book! (Yes, back then, the whole OS was baked into read-only memory.)

Disks? No way, you had to save your code on EFFIN' CASSETTE TAPES! I remember the pilot tones the computer send to the cassette tape before sending data. The pilot tone then helped level the playback volume correctly for reading the data back in.

On the pictures, you can see a cable coming out of the case; I soldiered the ends of one side to the mainboard and connected a joystick on the other. Then I wrote my first assembly program that picked up the joystick movements and drew a line on the screen, in the direction I pushed the joystick. But the program was too damn fast; I could barely move the joystick without having the line hit the edge of the screen in an instant.

Boy, assembly language had my deep respect back then!

This reminds me of another story: ZX Basic had a command for drawing a circle; but the code used floating-point arithmetic to calculate the circle. This thing had no floating-point unit; all the floating-point operations were carried out in pure software on the Z80! Eight-bit registers! When you executed the command, you would have to wait for one or two seconds, then the circle was drawn on the screen, slow enough to see the circle building up from 0 to 360 degrees.

Then, someone published a listing with assembly code that built the circle with a super simple calculation of the pixels of an eigth of the circle; then it mirrored the result to the other seven segments. This code drew the circle within the blink of an eye. My jaws dropped to the floor.

But what I remember most from these times of curious exploration of the future was my lasting wish for better, faster, and more sophisticated hardware!

Now look where we are today...

A pretty decent advancement since then, don't you think?

=> View attached media | View attached media | View attached media | View attached media

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-07 at 15:31

When approaching an unknown codebase...

https://newsletter.appliedgo.net/archive/2025-01-05-unfamiliar/?utm_source=appliedgo-mastodon

[#]golang

https://newsletter.appliedgo.net/archive/2025-01-05-unfamiliar/?utm_source=appliedgo-mastodon

=> More informations about this toot | View the thread

Written by Christoph Berger on 2025-01-06 at 15:49

A minimalist OIDC provider for Go apps

If you plan to build an indie SaaS, you probably came across Keycloak or ORY Hydra as OpenID Connect (OIDC) solutions. Chances are they are overkill for your use case. I recently came across Pocket ID, a minimalistic OIDC provider that I'd like to share:

https://github.com/stonith404/pocket-id

Pocket ID only supports passkey authentication. That's quite minimalistic, isn't it?

(It's made with #golang, that's why it caught my attention. But Pocket ID isn't bound to Go projects. It's a dockerized server talking to your app via API.)

https://github.com/stonith404/pocket-id

=> More informations about this toot | View the thread

=> This profile with reblog | Go to christophberger@c.im account

Proxy Information
Original URL
gemini://mastogem.picasoft.net/profile/111773127469190504
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
442.638915 milliseconds
Gemini-to-HTML Time
13.489812 milliseconds

This content has been proxied by September (3851b).