Random snippets of all sorts of code, mixed with a selection of help and advice.
How can I allowlist some commands without allowing all commands in OpenAI Codex?
21 March 2026 @ 8:52 pm
OpenAI Codex keeps asking me to allow it to run some command.
How can I allowlist some commands without allowing all commands in OpenAI Codex?
E.g., in Cursor there is an allowlist:
I'm looking for something similar in OpenAI Codex.
I use a laptop running Windows 11 25H2 Pro.
E.g., in Cursor there is an allowlist:
I'm looking for something similar in OpenAI Codex.
I use a laptop running Windows 11 25H2 Pro.Sqlite3 On Update Cascade Not Cascading In Child Table
21 March 2026 @ 8:50 pm
Learning SQL using SQLite3 and I have been struggling with this for the past two days and want help.
I have a parent_Table(PT) with following statement
Create Table "GL_Cash_Book" (
"y_trans_code" Integer Not Null,
trans_date" Integer Default current_timestamp,
"receipt_no" Text,
"amount_dr" Real,
Primary Key("y_trans_code")
)
that I have connected to a child_Table(CT) with the following statement
Create Table "GL_income_account" (
"trans_id" Integer Not Null,
trans_date" Integer Default current_timestamp,
"receipt_no" Text,
"amount_cr" Real,
Primary Key("trans_id" Autoincrement),
Foreign Ke
How to adhere to abstraction and asynchrony
21 March 2026 @ 8:33 pm
public async Task<IEnumerable<Patient>> GetWaitingPatientsAsync()
{
return await _context.Patients.AsNoTracking().Where(x => x.Status == PatientStatus.Waiting).ToListAsync();
}
I have a method like this in my repository . It returns an abstraction, but I have to override this abstraction with ToListAsync and pass a list to the service layer instead of an IEnumerable. I can't avoid using ToListAsync here because await waits for a Task<T> and Where() returns an IQueryable. I'm now faced with a dilemma: I want to preserve the asynchronicity but also not break the abstraction. What do you recommend? Should I break the abstraction?
Corrupt object variables in C++ for ESP32
21 March 2026 @ 8:15 pm
I am creating a project for an ESP32. I'm quite new to ESP and C++ coding. I use PlatformIO inside VSCode.
It's a robot that will be driving around. It has Ultrasonic sensors to detect any obstacles. The sensors. I store the pins for each sensor in an object of type ProximitySensor.
I have a problem that at runtime, the values of the stored pins change, to seemingly arbitrary values.
Here's the class representing the sensors:
class ProximitySensor : public potbot::Sensor
{
private:
const int pin_trig;
const int pin_echo;
const int16_t orientation; // degrees relative to middle axis (front = 0°)
public:
ProximitySensor(const int pin_trig, const int pin_echo, const int16_t orientation);
void setup() override;
float read() override;
int16_t getOrientation(){return orientation;}
};
and the corresponding implementa
Is it safe to initialize a publisher in onReceive?
21 March 2026 @ 6:17 pm
In this tutorial https://www.hackingwithswift.com/quick-start/swiftui/how-to-use-a-timer-with-swiftui
it shows that the timer is initialized as a property of the View. I am wondering what would happen if it’s just declared inlined where the onReceive method is called. Would that trigger the publisher to be reinitialised everytime the currentDate property is updated?
Does making it a property variable ensure stability and reduce unnecessary computations?
if so, then wouldn’t declaring it as a @State be most stable?
module environment add executable/appimage
21 March 2026 @ 12:16 pm
Hi there I have a situation where I wish to add to my module environment an executable in the form of an AppImage. Is it even possible? Below is the code I'm using and the structure I have in my /usr/local/Modules/:
\> tree -h
[4.0K] .
├── [4.0K] bin
│ ├── [5.3K] add.modules
│ ├── [4.1K] envml
│ ├── [2.8K] mkroot
│ └── [ 889] modulecmd
├── [4.0K] etc
│ ├── [ 885] initrc
│ └── [1.3K] siteconfig.tcl
├── [4.0K] init
│ ├── [1.7K] bash
│ ├── [ 14K] bash_completion
│ ├── [1.2K] cmake
│ ├── [ 232] csh
│ ├── [ 852] fish
│ ├── [ 14K] fish_completion
│ ├── [1.7K] ksh
│ ├── [4.0K] ksh-functions
│ │ ├── [1.7K] ml
│ │ └── [1.7K] module
│ ├── [3.2K] lisp
│ ├�
Blazor page access via password for unauthorized users
16 March 2026 @ 7:12 pm
I'm trying to create a "rooms" system. I want some rooms to be protected by a password for unauthorized users. I tried to save the password check state at the "AddScoped" service, but I found out that it recreates service each page refresh.
What is the best approach to protect a Blazor page with a password, with the ability to reload the page, and without forcing the user to create a whole account?
How do I serialize a floating point number?
11 March 2026 @ 11:13 pm
In the past I've written code to manually serialize a binary representation of a IEEE 754 number, however, it seems like several projects simply reinterpret a floating point number as a byte array and flip the byte order if needed. Do all CPUs represent floating point numbers consistently enough for them to read a float from another computer?
Is there a way to find out if any packages are using a specific module name in Python?
9 March 2026 @ 9:23 am
I was wondering if it’s possible to search PyPi or any other package database for Python to know if any of them are already using the module name com.
The reason I want to do this is that LibreOffice exports its API to Python in a sort of Java style where the classes are namespaced with domain names like com.sun.star.uno.XInterface so that you can do from com.sun.star.uno import XInterface. Currently this is implemented by replacing the __import__ builtin such that com isn’t a real module. I wanted to propose a patch to simplify the code to use the sys.meta_path mechanism instead. This would have the side effect of making com a real module. That means it would break if the user already has another com module in their Python path. As it’s quite a short module name I wanted to gauge
Cannot start Tauri dev server - "beforeDevCommand terminated with a non-zero status code."
21 September 2023 @ 11:26 am
I'm attempting to follow the guidance on creating a Tauri app. I've installed all the prerequisites, using Linux Mint.
I'm trying to learn Rust & React so I want to start a new project. Though I can create a tauri app, I am unable to run the dev server.
I ran 'cargo create-tauri-app' using TypeScript, pnpm and React. I then navigate to the new project folder and run 'pnpm install' with no issues. However, when I attempt to run 'tauri dev' (with cargo or pnpm) I received the following error; "SyntaxError: Unexpected reserved word" ..... "Command failed with exit code 1, beforeDevCommand terminated with a non-zero status code"
Here is the build section of tauri.conf.json
"b
Here is the build section of tauri.conf.json
"b