-- Leo's gemini proxy

-- Connecting to gemini.tuxmachines.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en-GB

Tux Machines


Programming Leftovers


Posted by Roy Schestowitz on Dec 15, 2022


Free, Libre, and Open Source Software and the World Wide Web

PINE64 Announces the PineTab2 Linux Tablet with Up to 8GB RAM and RK3566 SoC



What is the memory usage of a small array in C++?


↺ What is the memory usage of a small array in C++?


> In an earlier blog post, I reported that the memory usage of a small byte array in Java (e.g., an array containing 4 bytes) was about 24 bytes. In other words: allocating small blocks of memory has substantial overhead.


> What happens in C++?



Music, Programming, and Practice


↺ Music, Programming, and Practice


> But honestly, the piano presents the same problem just on another level: practicing, i.e. learning by failing, is hard.


> What strikes me as a common thread between programming and music is the necessity to repeatedly endure failure in order to get something right. It reminds me of this line from the book Coders: [...]



How sad should I be about ChatGPT?


↺ How sad should I be about ChatGPT?


> At first I thought this was the end of the world. ChatGPT is nowhere near an Artificial General Intelligence (AGI): an AI capable of performing most tasks that a human can. But until last week I thought that even ChatGPT’s level of abstract reasoning was impossible. It can already - to an extent - code, rhyme, correct, advise, and tell stories. How fast is it going to improve? When’s it going to stop? I know that GPT is just a pile of floating point numbers predicting the next token in an output sequence, but perhaps that’s all you need in order to be human enough. I suddenly thought that AGI was inevitable, and I’d never given this possibility much credit before. I found that it made me very unhappy. This is a post about feelings, not analysis.



GPT and Search


↺ GPT and Search


> Next, I think the whole idea confuses what GPT and search are good at. Search looks up facts. It’s pulling from a database. While the “G” in GPT stands for generative. Meaning, it’s making things up. It’s often very correct when it does so, which is why we’re so impressed. But it’s also often wrong in truly comedic ways.



Building and Running an NVIDIA Container


↺ Building and Running an NVIDIA Container


> NVIDIA Container Runtime allows containerized applications to access your host’s GPU hardware. It facilitates the containerization of systems that would otherwise be off-limits, such as artificial intelligence (AI) and machine learning (ML) workloads. With NVIDIA Container Runtime installed, you can run these apps in containers on any host with an NVIDIA GPU.


> In this article, you’ll learn about the runtime’s architecture and how to set it up. You’ll also learn how to deploy your own containers with GPU access, broadening the scope of what you can successfully containerize.



Array push with autovivification in jq


↺ Array push with autovivification in jq


> I wanted to make a note to self about this. I'm using Advent of Code for an opportunity to practise and learn more about jq, and in Day 7: No Space Left On Device I think I need a way of appending values to arrays, which are themselves values of properties that I create on the fly. This may not turn out to be useful in the end, but I wanted to explore it (I was thinking I could store the list of files in a given directory like this).



Building Go programs with Nix Flakes


↺ Building Go programs with Nix Flakes


> The main problem from the NixOS standpoint is that the Go team uses a hash method that is not compatible with Nix. They also decided to invent their own configuration file parsers for some reason, these don't have any battle-tested parsers in Nix. So we need a bridge between these two worlds.



Go and the case of the half-missing import


↺ Go and the case of the half-missing import


> One of the Go programs I keep around is gops, which I find handy for seeing if I'm using outdated binaries of Go programs that I should rebuild (for example, locally built Prometheus exporters). I have a script that updates and rebuilds all of my collection of Go programs, gops included, with the latest Go tip build (and the latest version of their code). Recently, rebuilding gops has been failing with an error: [...]



Abstracting the Infrastructure


↺ Abstracting the Infrastructure


> Cloud APIs are becoming more mature. While there's no single abstraction across all cloud providers, there are enough companies putting serious work into maintaining each separate set of libraries (e.g., HashiCorp/Terraform, Pulumi, Minio, etc.).



Day 13 (Advent of Code 2022)


↺ Day 13 (Advent of Code 2022)


> No but seriously we have what are ostensibly S-expressions, except they use JSON-adjacent notation: [...]



Day 12 (Advent of Code 2022)


↺ Day 12 (Advent of Code 2022)


> Alright! The day 12 puzzle involves path finding, and it seems like a good time to lean more heavily on the WASM embeds I've set up for the previous parts.



Wednesday, December 14, 2022: An annotated example of using LPeg to parse a string to generate LPeg to parse other strings


↺ Wednesday, December 14, 2022: An annotated example of using LPeg to parse a string to generate LPeg to parse other strings


> A message on the Lua email list was asking about the best way to parse MQTT topics, specifically, how to handle the multilevel wildcard character. I answered that LPeg would be good for this, and gave annotated source code to show how it works. I thought I might also post about it for better visibility.



Improve your documentation with JavaScript


↺ Improve your documentation with JavaScript


> Open source software projects often have a very diverse user group. Some users might be very adept at using the system and need very little documentation. For these power users, documentation might only need to be reminders and hints, and can include more technical information such as commands to run at the shell. But other users may be beginners. These users need more help in setting up the system and learning how to use it.


> Writing documentation that suits both user groups can be daunting. The website's documentation needs to somehow balance "detailed technical information" with "providing more overview and guidance." This is a difficult balance to find. If your documentation can't meet both user groups, consider a third option — dynamic documentation.


> Explore how to add a little JavaScript to a web page so the user can choose to display just the information they want to see.



Rust support merged for the forthcoming GCC 13 • The Register


↺ Rust support merged for the forthcoming GCC 13 • The Register


> Preliminary support for compiling the Rust language has been merged into the codebase for GCC 13, which will be the next version of the GNU compiler collection.


> The Reg's sister site DevClass reported on the approval back in July, along with a timeline of when to expect the next steps, and now the code merge has happened. This is a good thing, and it's significant step for the Rust language – but there is a whole list of "buts" attached to this news.


> The Rust-GCC project has been underway for a couple of years, as can be seen from the earliest commits on its Github page. The last time we wrote about it, when covering Linus Torvalds' keynote at the Open Source Summit, we attracted criticism for, um, quoting the project's own description from that page, saying how preliminary it was. Some Rustaceans regarded this as unfair, which may possibly tell you more about the fervor of Rust fans than it tells you about the GCC compiler's state of completion.



pizauth: differentiating transient from permanent errors


↺ pizauth: differentiating transient from permanent errors


> The new alpha release of pizauth first differentiates (possibly) transient error from (definitely) permanent errors. If a permanent error occurs when refreshing an access token, then the token is invalidated, and the error logged. The reason that the user isn't explicitly informed is that the true error (e.g. "your account is no longer valid") is generally masked by another more generic error (e.g. "server refused to refresh token"). By invalidating the token, the user will then be asked to reauthenticate, at which point the true error is more likely to be properly reported. In the (hopefully) rare cases where there are persistent permanent refresh errors, users can look through logs to find out what happened.



How I feel about HTTPS


↺ How I feel about HTTPS


> My recent postings on using HTTPS for my sites reminded one of my readers, White_Rabbit, to send in a link to Discourse on HTTPS. The language may be salty, but it does align with my feelings towards HTTPS—namely, I don't really need it. But as I stated, Google will any day now start with the Big Scary Error Messages on non-secure sites, followed by (possibly—I don't know this for a fact, but a gut feeling) no longer allowing non-secure requests at all. And with Google's Chrome having a ridiculous market share, that's something to be concerned about.



You can have user accounts without needing to manage user accounts


↺ You can have user accounts without needing to manage user accounts


> I get the sentiment. Storing passwords securely is hard. Dealing with users changing their names is hard. Updating avatars is hard. GDPR is hard. It's just a lot of pain and suffering.


> But I still have user accounts on one of my side projects while avoiding all those issues. Here's how it works on OpenBenches.




gemini.tuxmachines.org

-- Response ended

-- Page fetched on Thu Jun 13 16:49:34 2024