When to use Serializers?

An article, posted 5 days ago filed in ruby, rails, ruby on rails, service, architecture, when to use, json & JSON-API.

Define Serializer

Serialisation (I’ll use s in writing about the concept, and z when discussing the thing itself) in programming is about converting the state of an object into something that can be stored or transferred. When you really want to serialise the state of an application to disk, you probably want full, unmodified serialisation, so the question about serialisation typically comes up when you want to share data with external parties. To these parties you don’t want to share the raw data, but pre-process it a bit, perhaps convert the internal state to objects that are more generic and don’t expose the full internals. In such case you might want to consider introducing the concept of Serializers.

Alternatives to using serializers

Before introducing new tooling, always consider the following default options Rails offers:

  • Serializers live on the view-layer. The default approach rails suggests is to have e.g. {index, show}.json.jbuilder files in your v…

Continue reading...

De nerd vote: Barbara Kathmann

An article, posted 16 days ago filed in links, politiek, pvda, groenlinks, GL/PvdA, GLPvdA, waarom links, asielcrisis, crisis, stikstof, woningbouw, CBS, rechts, BarbaraKathmann & privacy.

Voor zij die professioneel en politiek gescheiden willen houden: sommige dingen zijn soms ook politiek en het negeren ervan is vaak net zo goed politiek.

Politici worden geacht alle problemen op te lossen. Als ze dat niet bereiken hebben ze gefaald. Of hebben de andere partijen gefaald. Maar we leven in een democratie. Een, weliswaar grote, minderheid (30%) stemt extreem rechts (PVV, JA21, FvD), maar wil alle regels opzij kunnen zetten om hun gelijk te halen. Zo werkt het natuurlijk niet. Niet iedereen wil dat namelijk. En dus gaat het niet lukken. We moeten samen meerderheden vormen en samen problemen oplossen.

Tegenwoordig wint de oneliner het te vaak van de waarheid. Zelfs een fatsoenlijke partij als D66 durft niet gewoon eerlijk te zeggen dat ze voor hebben gesteld het basispakket te bevriezen. Frans Timmermans komt er altijd een beetje mêh vanaf in dat soort spelletjes. Maar als het over de inhoud gaat weet hij waarover hij het heeft. En dat is vaak genuan…

Continue reading...

Book notes: Thinking in systems

An article, posted about 2 months ago filed in ThinkingInSystems, design, society, change, book, review & summary.

These are notes I made while reading Thinking in Systems: A Primer by Donella H. Meadows. It is a book on Systems Design, or perhaps better, understanding systems. These systems can be software, drinking water systems, political systems, or the world climate “system”

On resilience

Resilience is not the same thing as being static or constant over time. Resilient systems can be very dynamic. Short-term oscillations, or periodic outbreaks, or long cycles of succession, climax, and collapse may in fact be the normal condition, which resilience acts to restore!

System traps

Sometimes systems fail to work, Meadows refers to these as ‘traps’ and identifies a list of common traps, and how to escape from these. It is good to reference the book in case you encounter such traps.

One of the trap mentioned is success to the successful, which may kill compe…

Continue reading...

Welke tweede factor authenticatie (2FA) app moet ik gebruiken?

An article, posted 2 months ago filed in Authy & authenticatie.

Inloggen is vervelend, het liefst doe je het helemaal niet. En dan wordt het tegenwoordig ook nog eens lastiger gemaakt met de 2FA eisen. Een nieuwe technologie, Passkeys, zou het einde moeten betekenen van wachtwoorden en alle inlogproblemen, alleen introduceert deze vorm van top notch veiligheid voor een ander probleem: wat als je geen toegang hebt tot de Passkey? Vandaar een ietwat pragmatische aanbeveling.

Aanbevolen voor Apple fans

Wanneer je minimaal 2 Apple devices hebt met een veiligheidsmodule (iPhone, nieuwere MacBooks), dan zou ik, wanneer de mogelijkheid er is, Passkeys aanbevelen. Wanneer je een passkey aanmaakt zijn ze ook beschikbaar op de andere apparaten die verbonden zijn met dezelfde iCloud account. Er zijn ook andere diensten die Passkeys kunnen opslaan, maar het risico met passkeys is dat je goed moet nadenken over het scenario waarin je geen toegang meer hebt tot je device.

Ondersteund de dienst geen Passkeys, maar wel ‘Google Authenticator’? I…

Continue reading...

Book notes: We Just Build Hammers - Coraline Ada Ehmke

An article, posted 3 months ago filed in CoralineAda, WeJustBuildHammers, future, science, ethics, ACM, capitalism, fascism, book, review & summary.

In “We Just Build Hammers”, Coraline Ada Ehmke explores historic parallels to moral issues in technology & software development. Referencing both fiction, historic and scientific sources, the book moves in four parts towards the current day and age.

I start of with a summary of the book, followed by a short reflection.

Summary

In the first part H.G. Wells’ writings set the scene. Wells’ has an almost scientific approach to his writing. Ehmke writes:

Wells’s future histories shined a light on what was possible and gave people permission to imagine alternate futures. But he insisted on the need for rational approaches for bringing these futures about or averting their catastrophe.”

His literature is compared to events that were developing in that same era. Leo Szilard is quoted saying:

In so far as the present discoveries in physics are concerned, the forecast of the writers may prove to be more a…

Continue reading...

A better Kamal deployment strategy?

An article, posted 4 months ago filed in deployment, docker, deploy, capistrano, server, debian, nginx, rails, ruby & proxy.

Kamal was introduced in 2023 (back then as MRSK) as an alternative way to deploy and manage containers on a server. It is marketed as Capistrano for containers, and as a big fan of the simplicity of Capistrano I was intrigued. I despise the political ideas of one of Kamal’s creators, but I think on the tech/implementation side he is promoting solutions that I honestly think are good (including HTML over the wire). Kamal is ‘simply’ some tooling around running images using Docker on a server, with zero-downtime deployments.

Some preparation

This is how I prepared for my testing:

  1. I had to set up an SMTP server as my sendmail solution (that actually worked quite well for my smallish projects, no need for sendgrid or the like); see my post on getting Chasquid up and running on Debian.
  2. I installed docker from the Debian repo’s (and not Docker’s), so it is automatical…

Continue reading...

Globale en locale optima

An article, posted 5 months ago filed in oplossingen, algorithm, programmeren, problemen, ai, politiek, optima & optimalisatie.

Vaak worden er oplossingen gepresenteerd voor problemen. Soms zijn de oplossingen voor de hand liggend, voor eenvoudige problemen. Maar in onze wereld zijn problemen steeds minder vaak eenvoudig. De oplossingen zijn daarom veelal ook niet eenvoudig. Of wellicht zijn ze wel eenvoudig, maar te moeilijk om te realiseren. En soms worden ingrepen gepresenteerd als oplossingen maar zijn ze er vooral om de status quo te behouden (of erger), maar ik wil hier uitgaan van goede intentie.

Grafiek ter illustratie met een lokaal en een hoger liggend globaal optimum. Punt 1 wijst een lokaal optimum aan, punt 2 een dal, waarbij je kunt denken terug te moeten naar punt 1, niet wetende dat er nog elders een globaal optimum voorbij punt 3 is op een andere plek.

Ontwikkelaars schrijven soms algoritmes om tot oplossingen te komen. Het ideaal daarbij is om te komen tot een globaal optimum. Een bekend voorbeeld is routeberekening. Wanneer je een route p…

Continue reading...

Getting Chasquid up and running on Debian

An article, posted 5 months ago filed in Chasquid, email, postfix, mail, tls, letsencrypt, debian, linux & server.

For quite some time I have been looking into setting up my own mail server. But having configured postfix for a little service I run, I’d been cautious making changes into that direction. Postfix offers too many configuration options, too many settings and all in a way that’s too arcane to me; every change in fear of accidentally creating an open relay by accident.

But recently I came across an article by SIDN about four modern systems for self hosting e-mail and I was intrigued. Especially about Chasquid, with its limited scope and focus on security, also through ease of configuration.

Getting started

Actually the tool comes with a nice setup guide. And first bonus, it suggest to just make use apt (although it won’t get you the latest); no special repos. So I made sure a test server I had running was updated to the latest Debian and installed Chasquid a…

Continue reading...

Aantekeningen: AI en opgroeien

An article, posted 5 months ago filed in ai, onderwijs, amsterdam, Felienne, techniek & PedagogischCollectief.

Vandaag vond AI en opgroeien: een pedagogisch gesprek plaats, een evenement dat werd georganiseerd door het Pedagogisch Collectief in samenwerking met de Gemeente Amsterdam en Kennisnet. Hier mijn aantekeningen bij de diverse sprekers.

Introductie door Marjolein Moorman (wethouder te Amsterdam, o.a. onderwijs)

Marjolein Moorman grijpt nog even terug op de vraag waarop niemand nee durfde te zeggen, of we wisten wat AI was: “Ik weet eigenlijk helemaal niet welke algoritmes er allemaal achter zitten. Dus weet ik eigenlijk wel wat AI is?”, een meer dan terechte vraag.

Als inkoppertje genereerde ze een welkomstpraatje met ChatGPT. Eerst positief, later ook wat ‘kritische’ kanttekeningen, maar zoals ze zelf ook al zegt: allemaal wel heel keurig.

We moeten in gesprek blijven over deze technologie. Ze benoemd problemen met mobieltjes. Buit…

Continue reading...

De Amsterdamse visie op AI

An article, posted 5 months ago filed in amsterdam, gemeente, ai, innovatie, llm, ux, design, klimaat, public & technologie.

Vorig jaar november publiceerde Directie Digitalisering en Innovatie van Amsterdam de Amsterdamse visie op AI. Hier een korte samenvatting, want het is een wat tekstig document (zou er AI gebruikt zijn om het te schrijven? :o), met hier en daar wat korte kanttekeningen. In cursief kantekeningen van mijn hand, rest is een ‘objectieve’ samenvatting.

Vraagstukken

De eerste pagina’s zijn vooral introductie, vanaf pagina 9 komen er wat ideeën voor toepassingen:

  • Ontsluiten van oude archieven (ik neem aan voor toevoegen context? Of is handschriftherkenning al AI?)
  • Detecteren zware objecten op kademuren (?)
  • Preventief onderhoud aan op basis van modellen

Er wordt geschreven dat logisch redeneren en kansberekening is waar AI systemen goed in zijn, maar dat is niet volledige intelligentie, het kent b.v. geen ervaringen en emoties. AI zal dus niet de mens volledig vervangen.

Des te complexer echter de…

Continue reading...

Site refresh

An article, posted 6 months ago filed in website & murb.

After more than 10 years, it was time to update the design of this website.

Most important changes:

  • Using the murb design system; a much bigger name for what it actually is, just another minimalistic cascading style sheet that is reused in several projects
  • Less distraction (previous design had a busy background with all ‘feed items’ generated by me elsewhere; they’re still in on the blog section though.

Other than that, technically not much has changed. It is still a simple Rails app (now updated to 8). If I’d start from scratch I would have made it as a static site, but this site has quite some history :)

Continue reading...

Voorkom voortijdige optimalisaties

An article, posted 6 months ago filed in javascript, programming, premature optimisation, optimisation, premature, optimalisatie, versnellen, tijd & kostbaar.

Voortijdige optimalisatie, of premature optimisation, is een bekende neiging van veel software ontwikkelaars. Het is een idee verbonden aan Donald Knuth:

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%

Veel ontwikkelaars halen eer uit het maken van “slimme” oplossingen die het draaien van de code net een beetje sneller zouden kunnen maken. De nadruk ligt op zouden omdat het veelal niet gebaseerd is op het daadwerkelijk meten aan de applicaties. Slechts door het applicatiegedrag goed te monitoren kunnen de échte performance problemen geïdentificeerd worden.

Erger is dat er kosten verbonden zijn aan zulke voortijdige optimalisaties:

  1. Het kost vaak extra tijd om een feature op te leveren (wat mij betreft niet het ergste)
  2. Het levert vaak code op die minder i…

Continue reading...

Tag descriptor

Open Source Software

An article, posted 6 months ago filed in open source, why, public & murb.

Ik ben een groot fan van open source software. Het voorkomt vendor lock-in; je zit dus niet vast aan een bepaalde partij. Indien akkoord maak ik ook graag de code die ik voor jou schrijf direct openbaar, zoals ik heb gedaan met een uitleen systeem en een collectiemanagement systeem en diverse kleinere herbruikbare componenten, zie b.v. murb op rubygems. Het voorkomt ook het eeuwige herbouwen van bijna dezelfde oplossingen.

Continue reading...

BlueSky is geen Twitter (X) alternatief.

An article, posted 7 months ago filed in mastodon, fediverse, BlueSky, twitter, X, Elon Musk, alternatief, VC, funding, enshittification & todon.

Steeds meer mensen zijn aan het verhuizen van wat Twitter heette naar een alternatief. Twee populaire bestemmingen zijn Mastodon en BlueSky, waarbij die laatste net iets populairder lijkt te zijn. Maar, waarom valt de meerderheid toch weer in diezelfde val?

BlueSky wordt weer een Twitter

BlueSky leeft nu van de ‘anti-X’ beweging, waarbij ze duidelijk de taal spreken van wat aanspreekt bij zij die migreren: we gaan niet ‘enshittifyen’ 1, geen reclame, ze hebben goede mensen aan de leiding, maar…

In tegenstelling tot Mastodon is BlueSky is het nog steeds een enkele dienst (weliswaar met een mogelijkheid tot het zelf hosten van je eigen content) die je gegevens opsluit. Neem daarbij dat de investeerders op een gegeven moment geld willen verdienen, en het is maar één kant welke het op kan gaan, de kant die alle sociale netwerken op lijken te gaan. Alle? Nee niet alle…

Het echte alternatief, een sociaal netwerk voor en door gebruikers

Iedereen ke…

Continue reading...

Programming using the Crystal language

An article, posted 8 months ago filed in crystal, programming, ruby, crystal-lang, scripting, typing, compilation, generate, speed, performance, developer happiness & activesupport.

Recently I posted ‘Doing less’. Tl;dr: I wondered why we (as tech-society) seem to be thrilled about making inefficient round trips using AI for development, or chase each other to use typed languages, while we could be using more expressive programming languages instead. Instead of guessing human input, we could write untyped short scripts that detail every edge case carefully, but without extreme uncertainty of human language input nor the extreme preciseness of typed languages. Scripting, however, is scoffed at by Real Programmers, but then why oh why do we AI?

Someone suggested I should share more about another programming language (knowing that I’m a rubyist) called Crystal, a language that shares performance characteristics of other compiled languages like C and Rust (not always in the top regions, but close). And although I heard of it a long time ago, I kinda forgot ab…

Continue reading...