Tux Machines

Programming Leftovers

Posted by Roy Schestowitz on Feb 06, 2023

=> today's howtos | SparkyLinux 6.6 has been released and is available to download now

Function multi-versioning

=> ↺ Function multi-versioning

GCC supports some function attributes for function multi-versioning: a way for a function to have multiple implementations, each using a different set of ISA extensions. A function attribute specifies different requirements of ISA extensions. The generated program decodes the CPU model and features at run-time, and picks the most restrictive implementation which is satisfied by the CPU, assuming that the most restrictive implementation has the best performance.

Binary to text encoding -- state of the art and missed opportunities

=> ↺ Binary to text encoding -- state of the art and missed opportunities

Setting computing history aside, some of the dinosaurs that still require them (like SMTP), and various esotericisms (like data: URI's), not many people use such encoding schemes.
There are however still a few cases where they are the proper tool, like for example: [...]

Another take on the binary to text encoding

=> ↺ Another take on the binary to text encoding

This is my own take on "all token related swiss army knife tool", that besides generating passwords / passphrases and other tokens, has this nice exchange armor / exchange dearmor sub-command that tries to put together in a unique package some of the features I've discussed in the mentioned article.
Please note that at the moment the format is experimental, and most likely prone to backward incompatible changes!

Fast and dynamic encoding of Protocol Buffers in Go

=> ↺ Fast and dynamic encoding of Protocol Buffers in Go

I use the following code to benchmark both the decoding and encoding process. Initially, the Decode() method is a thin layer above GoFlow2 producer and stores the decoded data into the in-memory structure generated by protoc. Later, some of the data will be encoded directly during flow decoding. This is why we measure both the decoding and the encoding.2

Hacking The Python For Loop

=> ↺ Hacking The Python For Loop

In the early days of C, you’d occasionally see someone — probably a former Pascal programmer — write something like this:

Bubble Sort in Python

=> ↺ Bubble Sort in Python

Tutorial on how to perform the bubble sorting in Python using a logic that works by repeating the adjacent elements if they are not in the correct order.

NumPy Matrix Multiplication

=> ↺ NumPy Matrix Multiplication

Practical tutorial on matrix multiplication with the help of NumPy library to perform the multiplication operations on a matrix in a Python application.

Generating Random Numbers with Uniform Distribution in Python

=> ↺ Generating Random Numbers with Uniform Distribution in Python

In this article, we discovered that we can easily generate random numbers from the uniform distribution using the NumPy library's random module.

Basics of the Linux Bash Command History with Examples

=> ↺ Basics of the Linux Bash Command History with Examples

The bash command history shows the previously used commands. By default, the history is saved in memory per session and can be saved to a file for later sessions. We will explore ways to show, search and modify the history in this blog post.
I use RHEL and Debian-based Linux distributions and bash in this blog post as a reference.

How to improve Python packaging, or why fourteen tools are at least twelve too many

=> ↺ How to improve Python packaging, or why fourteen tools are at least twelve too many

There is an area of Python that many developers have problems with. This is an area that has seen many different solutions pop up over the years, with many different opinions, wars, and attempts to solve it. Many have complained about the packaging ecosystem and tools making their lives harder. Many beginners are confused about virtual environments. But does it have to be this way? Are the current solutions to packaging problems any good? And is the organization behind most of the packaging tools and standards part of the problem itself?

Surfing The Web Like It’s 1978 — Carbonyl

=> ↺ Surfing The Web Like It’s 1978 — Carbonyl

[Fathy] gets a kick out of doing odd things with Chromium, and Carbonyl is a clever byproduct of that hobby. In this case, it’s what you get when you connect chrome’s renderer to an SVG output module and then convert that SVG to colored characters on a terminal. See, html2svg is an earlier project, taking Chromium’s Skia engine and plugging it into an SVG back-end. And once you have SVG, why not render it to the terminal?

FediPoll

=> ↺ FediPoll

I’m going to be having some fun on the Fediverse over the next few days/weeks. If you’re comfortable doing so, please join in, as the more people who take part, the better.
Well, I have a fair number of followers on Mastodon, around 20,000 last time I checked. So I thought it would be fun to pose some questions to the fediverse, as polls. Then I could compile the results and see what kind of wonderful folk we have on the fedi.

=> ↺ Mastodon

=> ↺ Mastodon

=> gemini.tuxmachines.org

Proxy Information
Original URL
gemini://gemini.tuxmachines.org/n/2023/02/06/Programming_Leftovers.gmi
Status Code
Success (20)
Meta
text/gemini;lang=en-GB
Capsule Response Time
143.774387 milliseconds
Gemini-to-HTML Time
0.933268 milliseconds

This content has been proxied by September (ba2dc).