Monthly Shaarli

All links of one month in a single page.

March, 2023

Rumble in the House

Logo du jeu

Il y a quelques mois, j'ai partagé ici quelques variantes pour Rumble in the Dungeon, un très sympatique jeu de société pour 3 à 6 joueurs, basé sur le bluff, la déduction et le hasard.

Il existe une autre version de ce jeu, Rumble in the House, qui ne diffère …

Introduction — pymemtrace 0.1.1 documentation

This describes tools and techniques that can identify memory leaks in Long running Python programs:

  • Is it a Leak?
  • Sources of Leaks
  • A Bit About (C)Python Memory Management
    • Reference Counts
    • Garbage Collection
    • The Big Picture
    • CPython’s Object Allocator (pymalloc)

Here is a visualisation of memory allocators from top to bottom (from the Python source Objects/obmalloc.c):

    _____   ______   ______       ________
   [ int ] [ dict ] [ list ] ... [ string ]       Python core         |
+3 | <----- Object-specific memory -----> | <-- Non-object memory --> |
    _______________________________       |                           |
   [   Python's object allocator   ]      |                           |
+2 | ####### Object memory ####### | <------ Internal buffers ------> |
    ______________________________________________________________    |
   [          Python's raw memory allocator (PyMem_ API)          ]   |
+1 | <----- Python memory (under PyMem manager's control) ------> |   |
    __________________________________________________________________
   [    Underlying general-purpose allocator (ex: C library malloc)   ]
 0 | <------ Virtual memory allocated for the python process -------> |

   =========================================================================
    _______________________________________________________________________
   [                OS-specific Virtual Memory Manager (VMM)               ]
-1 | <--- Kernel dynamic storage allocation & management (page-based) ---> |
    __________________________________   __________________________________
   [                                  ] [                                  ]
-2 | <-- Physical memory: ROM/RAM --> | | <-- Secondary storage (swap) --> |
__slots__ memory optimization in Python
Illustration from realpython.com

The other day, while working on fpdf2, I used @dataclass, a nice decorator that came in the standard library with Python 3.7, to quickly define a class that mostly stored data.

Then a question came to my mind: is the __slots__ memory optimization compatible with …

Nicolas Vivant: "Amis de la fonction publique d…" - Mastodon - Liens en vrac de sebsauvage

Amis de la fonction publique d'État, si on vous pose la question...
En France, les suites collaboratives #Microsoft #Office 365 et #Google #Workspace sont proscrites dans les services de l'État.
Les bases réglementaires :
→ Note de la CNIL (27/05/2021) : https://www.cnil.fr/fr/la-cnil-appelle-evolutions-dans-utilisation-outils-collaboratifs-etatsuniens-enseignement-superieur-recherche
→ Circulaire 6282-SG (05/07/2021) et note (15/09/2021) : https://acteurspublics.fr/upload/media/default/0001/36/acf32455f9b92bab52878ee1c8d83882684df1cc.pdf
→ Ministre de l'Éducation Nationale, en réponse à une question écrite (2022) : https://questions.assemblee-nationale.fr/q16/16-971QE.htm

DLL hijacking with exported functions. Example: Microsoft Teams - cocomelonc

You can use this program but I wrote a simple python script which enumerates the exported functions from the provided DLL (dll-def.py)

A simple way to prevent DLL hijacking from happening would be for applications to always use absolute paths instead of relative ones. Although some applications (notably portable ones) will not always be able to do so, applications located in \system32\ and relying on DLLs in the same folder have no excuse for doing otherwise. The better option, which only very few Windows executables seem to do, is to verify all DLLs before loading them (e.g. by checking their signatures) - this would largely eliminate the problem.

Caisse de solidarité ✊

Pour soutenir les grévistes organisons la solidarité financière.
Faites un don à la première caisse de grève en France ✊️

Absurd Trolley Problems

A game that gives you increasingly absurd trolley problems.
Help humanity solve philosophy by solving all the trolley problems.

Véronique Durand "La cigogne aux œufs d’or – Marchandisation de la petite enfance" @ YouTube

La cigogne depuis des millénaires ayant fort à faire,
commence avec les années à un peu s'épuiser.
Il faut dire qu'en France depuis la Libération,
des bébés à foison elle a dû augmenter la production.
Alors pour la seconder et l'aider à faire pousser en bonne santé de jolis bambins,
elle a organisé de beaux et grands jardins.
Derrière ce joli parchemin c'est aussi les mères qu'il fallait envoyer au turbin.
C'est ainsi qu'au fil des découvertes en éducation,
fleurirent de jolis appellations : asile, pouponnière, bambina, garderie, jardin d'enfants, crèche multi-accueil, etc.
Des lieux pensés pour accompagner les avancées de la société en parentalité.
Pendant fort longtemps ces jardins idylliques, tels des ruches animées par moult abeilles laborieuses, par les deniers publics furent-ils financés.
Vivent les citoyens en barboteuse !
Or par les temps nouveaux qui sévissaient alors,
point d'argent public gaspillé il ne fallait puiser encore.
C'est ainsi qu'un beau jour de 2004,
aux mains philanthropes de quelques marchands psychopathes,
le grand argentier des cigognes, les clés des portes des jardins leur a filé.
De bébés et de blé ce sont de bien étranges moissons qui dorénavant rythment nos saisons.

C'est ça que j'ai envie de vous raconter aujourd'hui :
comment cette fable elle a été rendue possible.

Une passionnante conférence gesticulée, actuellement en tournée !