Weekly Shaarli

All links of one week in a single page.

Week 51 (December 16, 2024)

reenigneEsrever92/polymath-rs

Build a CLI for it (or a web UI)

Deliver the Bare Minimum

Just remember that you can always add more, but you can’t take it away.

Prisma ORM Manifesto: Clarity and Collaboration

How Prisma will rewrite their Rust engine into typescript. It will make the code simpler than the current heavy solution.

A Framework for Evaluating Browser Support • Josh W. Comeau

To simulate unsupported CSS rules: delete them.

Providing fallback is as easy as providing multiple values for the same property: the first the most supported, then going to the last value.

In other situations, we might want to apply an alternative set of styles when a feature is unsupported. We can use the @supports at-rule for this.

The goal isn’t to produce exactly the same UI for all users. The goal is to provide a reasonable fallback experience.

  1. browser breakdown

The statistics come from caniuse, that uses the web analystics statcounter. For each website, the audience will be different. Joshwcomeau notes that there are 4.1% more Firefox users visiting his website.

It leads to the potential harm: Is it OK to break the user experience for 1% of users? What is the potential harm caused by a broken experience?
To answer this question in business, this is a cost question: is it worth it? On the contrary, essential services such as a booking vaccine service needs to be as widely supported as possible.

Pro tip for media queries: using min-width container queries only will display at worse the mobile view.

Web feeds - Elly Loel

JSON feeds is the best? It has more features.

By heart the RSS and Atom for HTMLishness.

Especially when things like XSLT (Extensible Stylesheet Language Transformations) come into the mix and your feed becomes a lovely looking web page!

Dani ✨🐚 : « everyone trying to convince me that AI will repla… » - types.pl

everyone trying to convince me that AI will replace all of the software jobs within the next few years has to get past the obstacle that they always seem to be the same people who were trying to convince me that I’d be going around spending crypto rather than fiat currency “within the next few years” quite a bit more than a few years ago now

Damien Petermann : « L'homme le plus riche du monde est en train de de… » - Mastodon -- Sciences.Re

Elon Musk finance les partis d'extrême-droite.

La note du Hollandais Volant à ce sujet: https://lehollandaisvolant.net/?id=20241220183727

Ainsi que l'article de Politico https://www.politico.eu/article/elon-musk-endorses-germanys-far-right/

(via https://social.sciences.re/@DamienPetermann/113678302111236791)

#34 a button is not a link - HTMHell

A great TLDR

New to the web platform in December  |  Blog  |  web.dev

::target-text for text highlighted by a URL among other things

Unlocking the GNOME stack for Rust – gtk-rs
Francois Malaussena @malopedia : « La vraie info, c'est qu'un homme politique veut c… » - Piaille

« David Lisnard veut expulser de son logement social la famille d'un homme ayant insulté la police . »

Rien ne va dans cette information.

BLAKE3-team/BLAKE3: the official Rust and C implementations of the BLAKE3 cryptographic hash function
Choosing a hash function for 2030 and beyond: SHA2 vs SHA3 vs BLAKE3

Instead of hash functions to store password, use Password-Based Key Derivation Functions (PBKDF) such as Argon2id.

bcrypt should be avoided due to its huge footgun: it truncates inputs longer than 72 characters. Okta AD/LDAP was vulnerable because of it.

Checksum functions such as CRC32 and xxh3 are optimized for pure speed and don't provide any security guarantees about their output, and it's easy to find collisions for a given checksum.

In 2024 based on I/O speed, a hash function with a throughput of 1 GB / s / core is considered fast enough for most use cases.

I skip the speed part because it is not relevant for me: 100MB/s or 1GB/s does not make much difference.

SHA3 and the BLAKE family which produced secures hash functions that are also misuse resistant.

A strength >= 128 bits is considered secure. The security agencies recommendation are a bit different. Hash length ranges from 256 (NIST) to 512 (ECRYPT-CSA).

SHA3 has many functions, SHA2 is vulnerable to length extension attacks (secret || message) but BLAKE3 has none of these issues.

Post-Quantum security from Grover's algorithm divides by 2 the preimage and 2nd-preimage resistance. The BHT algorithm predicts however that a quantum computer can find a collision in 2n3 operations instead of 2^n/2

So SHA2 for convenience or BLAKE for the rest. There is only C and Rust that have official support for BLAKE though.

aria-labelledby = self - HTMHell

Why and caveats of aria-labelledby a tag in the node content.

There are good reasons to point aria-labelledby within an element. For example, to give an accessible name to a region based off of the heading within it.

Smooth Multi-Page Experiences with Just a Few Lines of CSS - HTMHell

A progressive enhancement with view-transition

RFC 9610: JSON Meta Application Protocol (JMAP) for Contacts
Iptables interactive scheme
Schemio | Home

An open-source projet to draw diagrams.

(via https://nicolas-delsaux.hd.free.fr/Shaarli/shaare/ekEOgw)

Douze fabricants et distributeurs d’électroménager condamnés à 611 millions d’euros d’amende pour entente sur les prix entre 2007 et 2014
Makeshift hot reload - HTMHell

<meta http-equiv="refresh" content="1"> for simple web pages.

Facture d'électricité : du papier aluminium derrière vos radiateurs, l'astuce d'expert qui marche vraiment - Le Hollandais Volant
mizu.js | Lightweight HTML templating library for any-side rendering
1984, le retour — Barbablog

Cela laisse présupposer un préquel du livre d'Alain Damasio Les Furtifs: les entreprises et sociétés vont progressivement prendre le rôle d'État ou de gouvernement.

HTML Conformance: A Comparison of 6.5 npm Validator Packages (With 1.5 Recommendations) · Jens Oliver Meiert

The Nu HTML validator is recommended. There is also the html-validate for partial validation

ratatui/awesome-ratatui: A curated list of TUI apps and libraries built with Ratatui
Why Can't We Make Simple Software? - Peter van Hardenberg - YouTube

Example code is often simple because it lives in a idealized world. Use defensive programming to relates possible errors.

Scaling to power of 10s is challenging. As harmful to build for the system for the future as it is to build an inefficient system for the present.

Sources of complexity:

  1. leaky abstractions
  2. model/reality gaps: first and lastnames; unicode...
    • fix it, hack around it or ignore the problem
  3. hyperspace: multiple runtimes, various screen sizes, multiple network speed, multiple version, etc...
    • example: 3 browsers with their 4 last versions each, 3 screen sizes on 3 platforms = 108 combinations
    • try to unify the environment: electron apps. Avoid NxM complexity.
  4. Complexity (homeostatis) over time
    • some people tolerate more or less complexity
    • a valuable system is worth putting up with more pain (resources, ...)

Software architecture degrades [with] changes made to the software...
Find dependencies and eliminate them
Complexity isn't always bad! i.e. Legend of Zelda Breath of the Wild's "chemistry engine"

Living with complications

  • The Gordian Knot: solve your problems by changing the rules.
  • Just start over
  • Do less with less (reduce scope)

A head-start at the author's company?

  • Local-first software: runs on your computer, but collaborates with other people.
    • In-browser with IndexedDB
  • Automerge (with portable versioned JSON-like data structure)
RFC 9639: Free Lossless Audio Codec (FLAC)
About 40 hours :: Jon Gjengset

what’s the right number of hours to work in a week

is a question behind work/life balance.

Longer days

there is a mounting body of evidence showing correlation between number of hours worked and decline in both mental health and physical health

Longer workweeks

A friend of mine who read an earlier draft of this article also made the excellent point that 2 hours at work often aren’t equivalent to 2 hours at home

Burnout

The graphs above show that you can indeed get more stuff done by working more, but only up to a point. Beyond that point, you end up with a compounding negative return. But therein also lies a clue: crunch time is fine as long as there is a recovery period afterwards.

Exerting back-pressure

Perversely, this happens more in companies where the employees feel particularly dedicated to the company’s work; employees absorb more work and tighter deadlines by working harder because they care about what they’re working towards.

I want to stress that back-pressure does not mean “just say no”. Instead, effective back-pressure is all about negotiation. [...] when you’re near capacity and someone approaches you with more work, you should present them with what work would need to be dropped in order to take on their work instead.

Working smarter

The first is to get a given thing done faster.
The second is to better choose the order in which you do things such that your time is spent where it matters most. [...] The most needed; is blocking other people; or the closest to completion.
The third is to be more cognisant of what you work on.
the fourth is to be strategic about when you work.

As a wise mentor of mine has pointed out repeatedly to me, working smarter helps, but the real superpower is resting smarter. [...] The important thing is that you feel like that time is replenishing the same batteries you exhaust at work.

Finding the time

The important thing is that you feel like that time is replenishing the same batteries you exhaust at work.

Connexion CNIL via https://imirhil.fr/cnil

Le lien redirige vers la page de connexion de la CNIL afin de déposer facilement des plaintes.

(via https://firefish.imirhil.fr/notes/a21vfsld53ku037t)

Native HTML light and dark color scheme switching - HTMHell

There are many approaches.
One solution is to set the color-schema CSS property color-scheme: light dark; then use the light-dark function.

But did you know that you can also set the media attribute to conditionally load and apply CSS based on user preferences? Such as media="(prefers-color-scheme: light)"

This media attribute can also be set in JS too, in order to load the proper stylesheet.

Rust Is The Toughest Programming Language You Will Thank Yourself For Learning | Blind Not Dumb
Horaires des trains SNCF et Transilien en France

Un outil alternatif à SNCFConnect pour connaître les horaires des trains, et des trajets possibles.

Le site fonctionne avec plusieurs pays, dont la France.

You don’t need the isOpen class - HTMHell

Instead of an isOpen class, why not using aria-expanded="true" (except for <details)?

Pourquoi quitter Whatsapp ? - Jeey's
It Takes Two to Contract

In js, asserts can be used with console.assert(<condition as expression>, error message)

It is great for prototyping or use defensive programming inside a function.

Assertions often come in pairs.
Whenever you assert something, think about which distant part of the code base relies on the assertion you just wrote, and add an equivalent assertion there.
This is worth doing even in the trivial case, where the two parties are a function and its caller.
But be on lookout for more interesting cases, where the two halves of an assertion pair are separated by different implementations, or a process and time boundary.

Niki Tonsky: "I propose we replace semantic …" - Mastodon

Diagram with large number (following semantic versioning): 2.7.123
First “2” is commented: Proud version. Bump when you are proud of the release
Second “7” is commented: Default version. Just normal/okay releases
Third “123” is commented: Shame version. Bump when fixing things too embarrassing to admit

UTF-8 Everywhere
Enum of Arrays

Instead of

const Thing = struct {
   checksum: u128,
   number: u32,
   flag: u8,
};

use

const SoA = struct {
   checksum: []u128
   number: []u32,
   flag: []u8,
};

in certain circumstances:

  • Reduced memory usage due to amortized padding. As flag is a byte, it requires some padding to align with larger fields like checksum.
  • Better memory bandwidth utilization for batched code. If a loop needs to process all things, but the processing doesn't require all fields (at least for the majority of objects), then an array-based representation reduces the amount of data that needs to be loaded.
Publicodes, l’étrange langage de développement en français - Next

A french programming language

Pour ma part, je trouve que c'est plutôt une bonne idée, notamment pour faire le lien entre le métier et les dev.

Côté dev : il est plutôt facile de générer du code à partir de ce langage

Côté métier : il est plutôt facile à lire, et donc de voir s'il y a des erreurs.

La lecture ne nécessite pas un gros bagage technique, et ceux qui font déjà du Excel s'en sortirons très bien.

Qui plus est, je vois un avantage très rare par rapport aux autres langages plus "classiques" : le support des unités.

Le projet est hébergé sur Github, avec un le site officiel public.codes.

GitHub - apankrat/nullboard: Nullboard is a minimalist kanban board, focused on compactness and readability.

A minimal and easy to maintain Kanban board.

Why online shopping isn't so fun for those who are blind or have low vision - ABC News
My approach to running a link blog

Shaarli is a kind of link blog

On Long Term Software Development - Bert Hubert's writings

A summary of comments about maintaining projects over decades

About documentation:

This does not tell you however WHY things are like this. What is the idea behind how the system works? Is there a philosophy? Is there a specific reason why we do these non-obvious things? Why is the solution split up the way it is?

code definitely needs comments. Especially why a function is like that. Other feedback was to work on commit messages

The Disappointing Outcome of the Computer Revolution
Bitcoin is Like a Religion, because It is About Faith, Not Facts.
  • very few people seem to be concerned about the mathematical facts
  • bitcoin is no money (medium of exchange, measure of value and a store of value=
  • as I write this, bitcoin is down to only 53.9% of the value of the total cryptocurrency market. The percentage has been falling since the second cryptocurrency was created.
  • many people don't understand that the bitcoin blockchain and the rules associated with it are defined entirely by the software.
  • "as developer Gavin Andresen put it in 2015, Bitcoin’s design and evolution 'really comes down to, what code are people running, and how influential are the people who are running the code?" - article on coindesk.com
    • Given that governments are rapidly buying billions of dollars worth of bitcoins (which could be increased to trillions) and are becoming the new bitcoin whales, they now have a say in what changes can be made to the bitcoin software. They could buy enough bitcoin to take control of it and then decide to change the software.
sqlite.directory

A collection of projects using SQLite

Jean-Baptiste: "Il a fallu remettre certains systèmes d'équerre p…" - Mastodon

Il a fallu remettre certains systèmes d'équerre pour que les futures mises à jour soient plus rapides.

"Faire bien" du premier coup, c'est mission impossible avant d'avoir fait le tour du métier assez longtemps.

C'était soit ça, soit construire sur des sables mouvants.

Le besoin de simplicité pour prendre des billets de train n'a jamais été aussi grand.

gezlemon/WAI-ARIA-Usage: Bookmarklet to evaluate WAI-ARIA usage
CSS Selectors Playground

This is a playground for learning and testing CSS selectors in a visual way. Start by selecting a playground or let's start with a random selector.

(via https://mas.to/@markwyner/113683573348550997)

aeris (@aeris) | imirhil.fr

« We reviewed this with our external lawyers »

but what we are saying is wrong because it does not follow the GDPR.

Sarah Rainsberger: "Someone proudly posted in Astr…" - Mastodon

Someone proudly posted in Astro Discord how they figured out how to feed Astro docs to their LLM, then proceeded to show its instructions to "get started with Astro"... which were not just worse than our recommended, but WRONG. Like, you'd FAIL. And I saw it in a heart beat.

Never been happier to be an old woman, "just working on docs", who will never be taken seriously in this industry anyway so I can yell that your LLMs are shit, and I don't have to care what the sensitive tech bros think.

Starting off right: Where autofocus shines - HTMHell

On single-purpose pages containing forms.

Such as login, signup, password reset or 2FA pages.

There are some cases to avoid such as a login form with the use of social logins (Google, GitHub, and the like) and you don't know which one they'll use don't add an autofocus.

How to Tell If You're Behind a CGNAT - Chuck Carroll

Essentially [Carrier-Grade Network Address Translations] allow the ISP to assign a single IPv4 address to multiple customers.

[A CGNAT] creates challenges trying to remotely access resources on my home network externally

You can usually tell if you're behind a CGNAT if your IP address is in a private IPv4 address range. [] ... Another method is running traceroute with your public facing IP address. [...] If there's more than one hop, then you're likely behind a CGNAT.

If you're unfortunate enough to be behind a CGNAT, you can sometimes request a static IP from your ISP (usually at a cost). However, there are options to access resources on your home network, such as using a Cloudflare Tunnel.

1.2.Train - Billets de train SNCF

Des calendriers des prix des trains SNCF

RSA conditionné : avant sa généralisation, le non-recours progresse dans les territoires pilotes - Rapports de Force

A partir du 1er janvier, les expérimentations du RSA conditionné à 15 à 20 heures d’activités doivent se généraliser à l’ensemble du pays.

Mais la cotisation pendant le travail ouvre le droit au RSA, c'est donc un droit non? Alors pourquoi le RSA serait conditionné à 15 à 20h d'activités ? Il y aura donc moins d'agents et plus de contrôle. Quelle est alors l'utilité de Pôle Emploi? Depuis son renommage en France Travail, j'y vois un tout autre objectif.

28.6% de taux d'emploi avec ette mesure après 6 mois. Il faut ensuite voir quel emploi, si la personne travaille comme intérimaire pour quelques semaines, s’il s’agit d’un CDD de quelques mois ou d’un CDI. Un autre dispositif d’accompagnement sans conditions ni sanctions a été mis en place, un allocataire sur trois était en emploi après six mois.

Un autre effet s'applique: un « décrochage » dû à la multiplication des démarches administratives et à la peur des contrôles.

De ce que laisse entrevoir la communication gouvernementale et les quelques retours d’expériences, il s’agirait de multiplier les démarches de recherche d’emploi, de participer à des ateliers de rédaction de CV ou de « coaching », de suivre des stages, des formations ou des cours de langues… Voire de l’obtention du permis de conduire ou de rendez-vous médicaux. Les témoignages de personnes ayant expérimenté le RSA conditionné soulignent la difficulté des déplacements, leur coût non défrayé ou le temps passé à justifier de leurs activités.

Pendant ce temps là, on ne contrôle surtout pas l'évasion fiscale entre autres qui représente pourtant des milliards.

Publicodes ⋅ Langage pour expert·es et développeur·euses

Une liste de projets utilisant Publicodes comme langage de programmation. Les paquets peuvent ensuite exportés en module JS comme @incubateur-ademe/nosgestesclimat.

Fireproof cloudless database for realtime apps
Vidéosurveillance algorithmique à Lille : l’analyse d’impact comporte bien un « oubli »

Un raté de la CNIL

Anglais ou français ? – Carnet de notes

Quelle langue utiliser pour écrire des programmes?

Studie zeigt: "Test-Time Compute Scaling" ist der Weg zu besseren KI-Systemen

Die Wissenschaftler untersuchten drei zentrale suchbasierte Ansätze: Die "Best-of-N"-Methode generiert mehrere Lösungsvorschläge und wählt den besten aus. Beam Search untersucht den Lösungsraum systematisch mit Hilfe eines Process Reward Models (PRM). Die neu entwickelte "Diverse Verifier Tree Search" (DVTS) optimiert zusätzlich die Vielfalt der gefundenen Lösungen.

Die Ergebnisse der Praxistests sind beeindruckend: Ein Llama-Modell mit nur einer Milliarde Parametern erreichte die Leistung eines achtmal größeren Modells. Bei mathematischen Aufgaben erzielte es eine Genauigkeit von fast 55 Prozent - laut Hugging Face nahe an der durchschnittlichen Leistung von Informatik-Doktoranden.

Ein 3-Milliarden-Parameter-Modell übertraf sogar die Leistung des 22-mal größeren 70-Milliarden-Parameter-Modells Llama 3.1