💾 Archived View for gemini.tuxmachines.org › n › 2024 › 02 › 05 › Programming_Leftovers.1.gmi captured on 2024-02-05 at 09:45:46. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Tux Machines
Posted by Roy Schestowitz on Feb 05, 2024
Devices Leftovers (Linux and More)
=> https://news.tuxmachines.org/i/2024/02/binarcode-1540384054vxM.thumbnail.jpg ↺ Binary system
=> https://lemire.me/blog/2024/02/04/how-fast-is-rolling-karp-rabin-hashing/ ↺ How fast is rolling Karp-Rabin hashing?
A hash function maps values (e.g., strings) into a fixed number of strings, typically smaller than the original. It is useful to compare quickly two long strings, for example. Instead of comparing the strings, you may compare the hash values.
=> https://www.scattered-thoughts.net/writing/notation-and-representation/ ↺ Zest: notation and representation
One of the fundamental characteristics of a nominal type is that two separate definitions are not equal, even if they have the same name and structure. This means that the entire concept of a nominal type is tied to a compilation model and to a process lifetime. If I compile a program once and run two copies of the executable, should type foo from the first copy be considered equal to type foo from the second copy? What if I compile the same code at two different optimization levels? Or for two different platforms?
=> https://ruudvanasseldonk.com/2024/a-reasonable-configuration-language ↺ A reasonable configuration language
About six months ago, I was fed up with it. The particular it was HCL — Hashicorp Configuration Language — but that was just the trigger, it was hardly the only offender. The issue I was struggling with that day was to define six cloud storage buckets in Terraform. They were similar, but not quite identical. The kind of thing you’d do with a two-line nested loop in any general-purpose language, but where all the ways of achieving that in HCL were so much hassle, that is was far simpler to just copy-paste the config six times.
=> https://www.logikalsolutions.com/wordpress/information-technology/defaults-and-deletes/ ↺ C++ – Defaults and Deletes – Pt. 1
Defaults and Deletes tend to be needlessly confusing for new C++ developers. Trying to learn this topic is why so many put on a diaper and go code Python. Hopefully this example series and discussion will allow you to man up. This is a continuation of my C++ series to assist junior/new developers so they can do something meaningful with their lives. No, you can’t use Python for a medical device.
=> https://rednafi.com/go/retry_function/ ↺ Retry function in Go
The following implementation leverages the reflect module to achieve the above goals. We’re intentionally avoiding complex retry logic for brevity: [...]
=> https://utcc.utoronto.ca/~cks/space/blog/python/DjangoSolvingProblemSideways ↺ Solving one of our Django problems in a sideways, brute force way
All of this is solving the problem in the obvious way and also a cool thing to (try to) do in Django. Who doesn't want to write Python code that handles exceptional cases by, well, raising exceptions and then having them magically caught and turn into different rendered pages? But Django doesn't particularly support this, although I might have been able to add something by writing an application specific piece of Django middleware that worked by catching our custom 'no such user' exception and rendering an appropriate template as the response. However, this would have been my first piece of middleware, so I held off trying anything here until we updated to a modern version of Django (partly in the hopes it might have a solution).
=> https://lucumr.pocoo.org/2024/2/4/rye-a-vision/ ↺ Rye: A Vision Continued
In April of last year I released Rye to the public. Rye, both then and now, represents my very personal vision of what an improved Python packaging and project management solution can look like. Essentially, it's a comprehensive user experience, designed so that the only tool a Python programmer would need to interface with is Rye itself and it gets you from zero to one in a minute. It is capable of bootstrapping Python by automatically downloading different Python versions, it creates virtualenvs, it manages dependencies, and lints and formats. Initially developed for my own use, I decided to release it to the public, and the feedback has been overwhelmingly positive.
=> https://cosmicqbit.dev/cleansing-email-addresses/ ↺ Cleansing a Dump of 1.5 Million Email Addresses
Within milliseconds the script extracted all the emails found in the raw dump and compiled them into a new file namely clean_emails.txt