Tux Machines
Posted by Roy Schestowitz on Dec 09, 2022
=> today's leftovers | Shows: InfinitelyGalactic, BSD Now, and Linux Action
=> ↺ Day 7 (Advent of Code 2022)
Before we tackle any tree-like structures, let's first write a nom parser for the input.
=> ↺ HiveMQ Cloud, part 4 - Sending sensor data from Raspberry Pi Pico W to HiveMQ Cloud
Exactly one year ago, in December 2021, I published three articles of MQTT messaging with Raspberry Pi, Raspberry Pi Pico and HiveMQ Cloud. On June 30th of 2022, Raspberry Pi released a new product, that is the subject of this post: the Pico W. Yes, a new version of the original Pico, but with Wi-Fi. The new board is for sale for 6$, compared to the 4$ of the original Pico.
In this post, we will rework the third project of the posts from December last year, where data was sent to HiveMQ Cloud using a Pico, separate Wi-Fi module and distance sensor. We can simplify that project now by using the new Pico W, removing the need for that separate Wi-Fi module.
=> ↺ Fast midpoint between two integers without overflow
Let us say that I ask you to find the number I am thinking about between -1000 and 1000, by repeatedly guessing a number. With each guess, I tell you whether your guess is correct, smaller or larger than my number. A binary search algorithm tries to find a value in an interval by repeating finding the midpoint, using smaller and smaller intervals. You might start with 0, then use either -500 or 500 and so forth.
=> ↺ The 10 Kinds Of Programmers That Use Calcutron-33
It is interesting how, if you observe long enough, things tend to be cyclical. Back in the old days, some computers didn’t use binary, they used decimal. This was especially true of made up educational computers like TUTAC or CARDIAC, but there was real decimal hardware out there, too. Then everyone decided that binary made much more sense and now it’s very hard to find a computer that doesn’t use it.
=> ↺ Are you ready for new smart home device triggers?
The ability to use one device’s information as a trigger event for one or more other devices to change state is what I’d consider the next step forward for the smart home. It may not sound like a huge step, but it’s an important one. And as devices from different brands begin to communicate with one another through the new Matter standard, consumers will be able to get more value from the hardware and devices they buy or already own.
=> ↺ Everything is simple, until you're an expert
As an outsider, it is probably functionally impossible to accurately criticise the way any complex system works. It's possible to criticise the outcomes. Or the impact. Or the the way it makes you feel. But I don't think non-experts can meaningfully diagnose complex, multidisciplinary, or systemic issues.
=> ↺ Building Molecule Reader in one day
Reading on screens is very difficult for me. I just cannot focus on the articles, especially when there are notifications coming in or even just other content on the screen1. I have a reMarkable tablet (RM), which I love dearly2 and much prefer to read on. But it's annoying getting articles onto it.
To put a blog post onto my RM, I copy the link from Firefox (my usual browser), open Chromium, load the page, and print it with the "Read on reMarkable" printer (which is only for Chrome-based browsers). And when I have five or ten articles I want to read, I have to repeat this for each one manually. Ouch.
I decided to solve this by writing a web app to bundle up my reading and send it to my RM!
Now I don’t know about you, but everybody I know in tech is talking about the new “GPT-3.5” (https://chat.openai.com/). Give it a prompt and it generates text that matches that prompt. And if that prompt is a request for code, the code it generates can be surprisingly accurate. So far it’s solved several days of advent of code, passed the 2022 AP CS A test, and mimicked a virtual machine. It can even take a code snippet and inject a bug, and then explain what the bug is!
=> ↺ 7 pro tips for using the GDB step command
A debugger is software that runs your code and examines any problems it finds. GNU Debugger (GBD) is one of the most popular debuggers, and in this article, I examine GDB's step command and related commands for several common use cases. Step is a widely used command but there are a few lesser known things about it which might be confusing. Also, there are ways to step into a function without actually using the step command itself such as using the less known advance command.
Troubleshoot your code with the GNU Debugger. Download the cheat sheet.
=> ↺ Our favorite markup languages for documentation
Documentation is important for so many reasons. Readable documentation is even more so. In the world of open source software, documentation is how to use or contribute to an application. It's like the rulebook for a game.
There are many different types of documentation:
We asked some of the Opensource.com contributors about their technical documentation workflow, which markup language they preferred, and why they might use one over the other. Here's what they had to say.
Markdown standards are as diverse as they are popular. This cheat sheet provides you with a solid baseline of common commands along with some of the most fun, and unique…
=> ↺ This Week In Rust: This Week in Rust 472
=> ↺ Louis-Philippe Véronneau - Debian Python Team 2022 Sprint Report
This is the report for the Debian Python Team remote sprint that took place on December 2-3-4 2022.
=> ↺ Python and hashing None [LWN.net]
The recent discussion of a proposed change to the Python language—the usual fare on the language's Ideas forum—was interesting, somewhat less for the actual feature under discussion than for the other issues raised. The change itself is a minor, convenience feature that would provide a reproducible iteration order for certain kinds of sets between separate invocations of the interpreter. That is a pretty limited use case, and one that could perhaps be fulfilled in other ways, but the discussion also highlighted some potentially worrying trends in the way that feature ideas are handled in the Python community.
=> gemini.tuxmachines.org This content has been proxied by September (3851b).Proxy Information
text/gemini;lang=en-GB