Random snippets of all sorts of code, mixed with a selection of help and advice.
MySQL dump from Ionos server not compatible with dockered MySQL db
8 November 2025 @ 11:40 am
I am trying to set up a development and testing environment for the software of my new employer.
The data is quite complex and due to some shortcuts/bad architecture decisions of the company that built the software, fake data won't do. So our plan is to download an SQL dump, anonymize some sensitive information with a faker script and then load it into a locally running docker container.
But when I try that, I get different errors such as:
'You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near...'
So basically the dump which is from our hosting provider IONOS, is not compatible with my docker MySQL db. But both dbs, my dockered db and the one running on IONOS shared hosting, are version 8.0.36.
I have done the SQL dump via the web UI. We do not dare to download it via terminal...
Does anyone know of that problem and might suggest a fix?
Clangd: Expected ';' at end of declaration list
8 November 2025 @ 11:32 am
I’m having trouble with my C++ class Player. Clangd in CLion keeps showing errors for my move constructor and move assignment operator, even though they seem correctly declared and defined.
Here’s the relevant part of my header (Player.h):
namespace Football {
class Player {
public:
Player(Player&& other) noexcept; // line 41
Player& operator=(Player&& other) noexcept; // line 41
// ... other members
};
}
And here’s the implementation (Player.cpp):
Player::Player(Player&& other) noexcept
: id(GenerateId()),
name(std::move(other.name)),
age(other.age),
nationality(std::move(other.nationality)),
origin(std::move(other.origin)),
position(std::move(other.position)),
height(other.height),
weight(other.weight),
totalGames(other.totalGames),
totalGoals(o
How to call JS code from C++ thread in embedded Node.js/v8 environment
8 November 2025 @ 11:12 am
I have Node.js (v22 - I am bound to this version) embedded into my application and exposing a C++ object to its environment.
My JS environment setup (based on the docs) runs in a separate thread, like my logic also runs in a separate thread.
I can run a Node.js application just fine and even call C++ methods from JS. So far so good.
But my code crashes as soon as I try to call a JS callback function from C++ side.
I already figured out that I cannot access V8 structures from another thread. Therefore I implemented a queue which ensures my code is executed in the JS thread.
Call uv_async_init to register a uv_aync_t handle. When I add a queue item i call uv_async_send and my callback function is called.
(Adding and retrieval of the queue is protected with a mutex of course.)
In the callback function (
JWT claims in Blazor web app do not get taken over
8 November 2025 @ 11:05 am
The purpose of this app is to have a template app I can use for multiple applications in the future, so I don't have redo all the authentication (and some database stuff) to focussing on building web apps in the future more easily and faster. I have a problem that I can't really wrap my head around. It has to do with creating JWT for authentication.
I have two claims (also others, but that's not in the scope of the problem) for the web app I'm building: (User)Name and Role.
The name is being used to identify the user with @context.User.Identity?.Name to display his user name.
The role is to distinguish between users and page administrators. Mainly to use with making a page only usable by admins with the @attribute [Authorize(Roles=nameof(UserRoles.admin))] but also an <Authorize View (Roles=...)> tag.
There are two (main) NuGet packages wich can assist in creating the JWTs:
Microsoft.Identity
Role and permission management for RBAC Express.js +TypeScript project
8 November 2025 @ 11:00 am
I need to implement role-based access control on the backend with postgresql, Prisma, and Express.js+TypeScript and the roles I have in mind so far are admin, manager, customer, delivery crew. I want to build to scale and execute scripts (added to package.json) via CLI to seed initial roles and permissions from constants/objects (e.g. enum Roles, enum Permissions and role_permissions = { [role]: [permissions]}) and not keep any audit logs. Access to the admin pages requires admin role and there will be 3-5 admins and the concept of organizations is not applicable here. Below is the initial structure of my models:
model User {
id String @id @default(uuid())
email String @unique
password String
firstName String?
lastName String?
isActive Boolean @default(true)
emailVerified Boolean @default(false)
createdAt DateTime @default(now())
updatedAt D
How to convert std::filesystem::path to QString
8 November 2025 @ 10:15 am
I am currently working with QPixmap to set an image to a label, but improvising a way around since my qrc file isn't working. I am trying to access the image folder in the project directory and trying to use that path to set the image. However, I am getting an error suggesting path cannot be converted to QString:
C:\QtProjects\MwendwaLB\customcard.cpp:40: error: no matching function for call to 'QImageReader::QImageReader(std::filesystem::__cxx11::path&)'
C:/QtProjects/MwendwaLB/customcard.cpp: In member function 'void CustomCard::setImage(std::filesystem::__cxx11::path&)':
C:/QtProjects/MwendwaLB/customcard.cpp:40:38: error: no matching function for call to 'QImageReader::QImageReader(std::filesystem::__cxx11::path&)'
40 | QImageReader imageReader(img_path);
| ^
void CustomCard::s
How to grep multiple words from a remote file in a ssh command to a target server
8 November 2025 @ 9:42 am
I wanted to execute below command. I have a file with server names.
for i in \`cat /tmp/srv_list\`; do ssh $i "uname -a; uptime; grep -E "warn|error|failed|issues" /var/log/messages ; echo "======================= "" \>\> /var/tmp/hst.out; done
I couldn't get the above working. The one liner breaks after the first word in the grep sequence and waits indefinitely.
Output
========
# for i in `cat /tmp/srv_list`; do ssh $i "uname -a; uptime; grep
-E "warn|error|completed|issues|rollback" /var/adm/messages/*unix " >> /var/tmp/new.out; done
-bash: error: command not found
-bash: issues: command not found
Access to this computer is prohibited unless authorised
Accessing programs or data unrelated to your job is prohibited
col function error type mismatch: found string required Int
7 November 2025 @ 11:06 pm
I am attempting to programmatically remove specific columns/fields from a dataframe (anything that starts with _), whether the field is in the root or in a struct, using the dropFields method.
For example, if I had "foo._baz", the syntax would be:
df.withColumn("foo",col("foo").dropFields("_baz"))
Hard coded this works fine. When I try to do this in a loop, generating the strings "foo" and "_baz", I get a type mismatch.
I've got a function that parses the columns to find any starting with _, that's working fine. Here's the (hopefully) relevant bit of my code:
var (baseCol, dropCol) = getColumnNodes(col)
df2 = df2.withColumn(baseCol,col(baseCol).dropFields(dropCol)
That results in:
error: type mismatch;
found : String
required: Int
df2 = df2.withColumn(baseCol,col(baseCol).dropFields(dropCol))
JPA implementation that works well with JavaFX/Maven/JLink [closed]
7 November 2025 @ 9:35 pm
Quick background information for context: I'm writing a relatively small tool for a small gaming community to download and manage UGC. It's a modular Java 24 + JavaFX Project done with Maven and IntelliJ.
I store data on a SQLite DB. So far I've used bare-metal JDBC and wrote queries myself. As the tool grows, I would like to simplify DB access. At work we use Hibernate ORM in a Jakarta environment with CDI etc, but I've read you can use Hibernate without relying on dependency injection.
So I've tried Hibernate for my tool and it does work well in my dev environment. Problems arise when trying to package a build via jlink, specifically using the javafx-maven-plugin to make things a lot easier for me.
The downside is that Hibernate does not seem to be modularized. Meaning I cannot easily package it with mvn javafx:jlink as the "automatic module cannot be used with jlink".
I've then tried EclipseLink as an alternative JPA
How do I integrate online appointment booking and calendar synchronization (Google Calendar) into a clinic management app? [closed]
7 November 2025 @ 9:47 am
I have developed Clinic Management Software but want to integrate this feature about Online Appointment booking and calendar synchronization like google calendar etc , i want to help from community. please help me for best!
thanks!