Random snippets of all sorts of code, mixed with a selection of help and advice.
Best alternative for ❌ (U+274C; Cross Mark)
30 May 2026 @ 10:17 pm
So I am trying to have a simple enough error icon and obviously Unicode has some crosses and stuff there but the issue is that the one that makes sense in context, is annoyingly colored and looks fairly bad for that reason when the icon is supposed to be white on a colored baackground, while on the other hand all the other ones I have seen so far make no sense syntactically (which might be important for e.g. screen reader users) a those are associated either with Multiplication, Ballots or the St. Andrews Cross (aka Saltire)
so the key question is what to best do for that.
.Net 6 .Net 10 Visual Studio
30 May 2026 @ 10:16 pm
When creating or opening an ASP.NET Core MVC web project using .NET 6 and .NET 10, I encounter a frustrating error:
In Visual Studio Community, when I click to run, the following error appears:
Failed to add the certificate to the Trusted Root Certificate Store.
Can someone please help me?
Seemingly bad design choices in C++? Why are things the way they are?
30 May 2026 @ 4:17 pm
I'm learning about C++ multithreading, and the more I learn about it the more I start to question the design choices of the standard library.
Here are some examples:
std::thread's inability to simply return a value, and the existence of std::async
When I first learned about std::async, my first thought was "why can't std::thread just have this function? Why not just give std::async's ability to return values via a std::future to std::thread?" To me, it seems the only difference between std::async and std::thread is that std::async can return a value from its function. In fact, why not take it a step further and remove std::future entirely, and just integrate the features of std::future into std::thread?
std::jthread's behavior should b
Tracking visited nodes when traversing datastructure
30 May 2026 @ 4:04 pm
I am new to Python, reading the book "Learning Python" by Mark Lutz, https://learning-python.com/about-lp6e.html.
It mentions avoiding cycles (or repeat visits) when traversing structured data, eg nested structures or graphs or similar ("Beware of Cyclic Data Structures" at end of Ch 9). It suggests using a list/dictionary/set of already visited items.
Clear enough. Set seems suitable. However if the data structure is composed of various mutable objects, these cannot be added in a Set, as python sets only take immutable (or perhaps hashable) objects, i.e. this pseudocode would not work:
if node not in visited:
visited.append(node)
process(node)
What is a good way to do this, in python style? Some ideas:
1: Use a set to track id(obj) rather than object references themselves. However my impression is that id() is kind
On macOS why does an unexpected python process keep restarting?
30 May 2026 @ 12:34 pm
On my Mac mini M1 with system 26.1.3 I have a python script, SoilTempMonitor.py, I want to run in background to monitor data from a thermometer device via MQTT. The MQTT broker is running on the mini. When the script gets a message it writes data to a mySQL database.
I created a .plist file that starts the script on startup. The script does load and runs as expected.
Looking at the mySQL database I found that duplicate entries were appearing, like so:
The data comes from an ESP32 that sends a reading and then goes into deep sleep for 10 minutes and then wakes to report again. "Bootcount" is a count of the number of times the ESP32 has woken up.
Search of running process with pgrep -fl SoilTemp in Terminal I get
728 /Library/Frameworks/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python /Users/peterwiley/D
The data comes from an ESP32 that sends a reading and then goes into deep sleep for 10 minutes and then wakes to report again. "Bootcount" is a count of the number of times the ESP32 has woken up.
Search of running process with pgrep -fl SoilTemp in Terminal I get
728 /Library/Frameworks/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python /Users/peterwiley/DCan I access variables within a user-defined function in Jupyter Lab while debugging?
30 May 2026 @ 6:20 am
In Matlab, I can easily set a breakpoint inside of a function, then Matlab's console lets me access the variables inside of the function to do whatever I want with them as can be seen in the image below
I want to know if JupyterLab allows me to do anything like this.
I did try to execute lines of code while debugging by hooking a console to the same notebook file, but the console could not execute any lines of code while the debugger was active like I could in Matlab. The image below shows that the attached console was unable to execute the print line while debugging was still in progress:
Also, I do see that JupyterLab's debugger lets me render the variables, however for much more complicated variables containing arrays of many raw values, using the console to access plotting packag
I want to know if JupyterLab allows me to do anything like this.
I did try to execute lines of code while debugging by hooking a console to the same notebook file, but the console could not execute any lines of code while the debugger was active like I could in Matlab. The image below shows that the attached console was unable to execute the print line while debugging was still in progress:
Also, I do see that JupyterLab's debugger lets me render the variables, however for much more complicated variables containing arrays of many raw values, using the console to access plotting packagHow can I avoid using LLMs as a software developer?
29 May 2026 @ 9:39 pm
Introduction
I've been developing software very successfully for many years. The reason I have chosen this profession is multifold:
I'm a creative person and I need to create things
I have an insatiable drive to think
Financial compensation one may expect for doing this
I can do my thing without constantly socializing with superficial small-talk
The drive to solve real-world problems and to be a force for the better
To work from home
It has been a great ride to do this and I achieved quite a lot of things. Yet, the industry gradually deteriorated. I do know that sometimes libraries and APIs are needed, but I witnessed too many times the drive to use some library only to solve some problem we could have otherwise easily solved, which to me meant that the specific decision was "going with the vibes" rather than a rational choice. Sure thing, there
Сomma-separated sequence of declarators in C89
29 May 2026 @ 8:30 pm
What does C89 standard say about the order of evaluation of expressions in a comma-separated sequence of declarators with initializers? I did not find the answer in the "Declarations" section, nor in "Initialization", nor in "Program execution". I just found that there are sequence points in the end of expressions in initializers (Annex C). For example:
int t = 1;
void block (void)
{
int a = (t *= 2), b = (t *= 3);
/* Is it guaranteed that a==2 and b==6 ? */
}
One more answer to a similar question.
Getting GPS points to show up on plot
29 May 2026 @ 8:12 pm
I'm trying to make an animation of animal movements using the Seabird Tracking Animation Exercise (RPubs - gganimate tutorial) to help my own data. However when I go to plot the map my points do not show up. My basemap extent is set to the correct extent but the basemap that shows up is not correct. Any suggestions as to what might be going wrong?
For context, I'm using my own data to make a visualization of an individual animal's movements that show movement to the same breeding area year over year.
I expect the points from my df to show up on the map extent but nothing shows up.
Map extent it gives me:
xmin ymin xmax ymax
-93.10445 30.96946 -93.00416 31.04072
map_bbox25 <- map_extent25
map_bbox26 <- map_extent26
map_bbox25 <- c (left=-93.2, bottom=30.9, right= -92.9, top=31.1)
map_bbox26 <- c (left=-93.2, bottom=30.
Array-based Queue vs. LinkedList-based Queue: Memory and CPU trade-offs in production
29 May 2026 @ 5:41 am
I am analyzing the performance trade-offs when implementing a Queue from scratch.
A Queue can be implemented using either a node-based LinkedList or a dynamic array (like a circular buffer).
From a memory management and CPU performance standpoint, what are the technical criteria for choosing one over the other in a production environment? Specifically, does the overhead of constant node allocation and garbage collection in a LinkedList outweigh the CPU cost of resizing and shifting elements in an array-based implementation?
Thanks for your guidance!