Random snippets of all sorts of code, mixed with a selection of help and advice.
How can I reverse the endianness of an integer that is not a byte-multiple size?
6 November 2025 @ 11:16 pm
All the existing threads I can find for this type of problem only refer to reversing endianness on byte-multiple bit sizes (i.e, 8, 16, 32, etc), but not non-byte-multiple (i.e, 5, 13, 20, etc), so here I am writing this.
Mainly for educational purposes, I've been trying to write my own hand-rolled FLAC decoder, and so far I'm still stuck on the very basics. See, FLAC stores all it's numbers in big-endian format rather than little-endian, as per RFC 9639:
All numbers used in a FLAC bitstream are integers; there are no floating-point representations. All numbers are big-endian coded, except the field lengths used in Vorbis comments (see Section 8.6), which are little-endian coded.
In my case, my target machines are little endian. Due to this, I don't get the exact values I expect w
Graal VM for Java obfuscation (transpilation)
6 November 2025 @ 11:07 pm
Im building a Java program, and I dont want it to be cracked. I have been looking into obfuscation techniques, and have learned about transpilation. A lot of transpilation based obfuscators (JNIC), cost a lot of money, something I dont have right now. I was wondering if I could use GraalVM in the short term. What are the strengths and weaknesses of it, is it even viable? Im just converting my auth over to a DLL and loading it into memory.
Unable to deploy Ethereum contract
6 November 2025 @ 11:05 pm
I am trying to learn Solidity and Ethereum.
I am using desktop version of Solidity remix.
I compile my contract using 0.8.17 Solidity compiler.
It's a simple "HelloWorld" contract.
Sending account has 5000 eth
To deploy the contract I select "Custom-External Http Provider" from Remix Deployment menu and enter the url of my test blockchain.
When I use Ganache, contract deploys without any problems.
When I use Geth local node, the deployment hangs with message that the creation of the contract is pending and times out after 750 seconds.
I tried everything but nothing works.
Here is the command I use to start Geth 1.10.22
geth --http --http.port 8085 --rpc.allow-unprotected-txs --http.api "admin,eth,miner,web3,net,personal,txpool" --http.corsdomain "*" --http.vhosts "*" --http.addr "127.0.0.1" --datadir chaindata --networkid 1234 --nodiscover --snapshot=false --verbosity 1
MediaWiki or php is trying to execute image files
6 November 2025 @ 11:02 pm
When I pull up my house mediawiki site, the images don't show. The Thumbnails don't work, the links give errors. I find errors like this in the httpd error log:
[Thu Nov 06 17:43:55.619628 2025] [cgi:error] [pid 15930] [client ::1:56267] AH01215: stderr from /Volumes/PalaisDuLapin/HouseWiki/mediawiki-1.43.1/images/thumb/6/65/Bosch_Dishwasher.jpg/2880px-Bosch_Dishwasher.jpg: (13)Permission denied: exec of '/Volumes/PalaisDuLapin/HouseWiki/mediawiki-1.43.1/images/thumb/6/65/Bosch_Dishwasher.jpg/2880px-Bosch_Dishwasher.jpg' failed, referer: http://wabbit.local/wiki/index.php/Appliance_Info
The apache configuration for this area is:
In file: /opt/homebrew/etc/httpd/other/HouseWiki.conf
4: <Directory "/Volumes/PalaisDuLapin/HouseWiki/mediawiki-1.43.1">
9: Options +ExecCGI
: </Directory>
17: <Directory "/Volumes/PalaisDuLapin/HouseWiki/mediawiki-1.43.1/images">
21: Options -ExecCGI
:
Docker not accessing VITE env variables
6 November 2025 @ 11:02 pm
I've tried so many things, the AI is clueless about this. After several hours, this is what we (the ai and me) ended up with (it doesnt work):
vivere_frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod
args:
VITE_API_BASE_URL: ...
VITE_GOOGLE_CLIENT_ID: ${VITE_GOOGLE_CLIENT_ID}
container_name: vivere_frontend
env_file:
- .env
- ./frontend/.env
environment:
- NODE_ENV=production
- VITE_API_BASE_URL=https:...
- VITE_GOOGLE_CLIENT_ID=${VITE_GOOGLE_CLIENT_ID}
ports:
- "3000:3000"
networks:
- vivere_network
restart: unless-stopped
depends_on:
- vivere_backend
and the Dockerfile:
# Multi-stage build for production React app with SSR
# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies (using npm install to regenerate lock file)
RU
Issue Connecting STM32F407G Discovery Board to STM32CubeProgrammer
6 November 2025 @ 11:01 pm
OS: Ubuntu 24.04.2 & Windows 10
CubeProgrammer Version: 2.20.0
Board: STM32F407G-DISC1
Firmware Version: V15J63M63
I am having intermittent connectivity issues with my discovery board and the STM32 IDE/Programmer. My system is able to detect the discovery board as it shows up when using the Linux command: lsusb and it shows up on Windows DeviceManager*.* When launching the CubeProgrammer application it is able to detect the board and populate with the relevant info (See picture).
When i try to connect to the board using the Connect button I get the following error: DEV_TARGET_CMD_ERR. I've downloaded and installed the most up to date drivers for both Linux and Windows, changed USB-mini cables, tried updating the firmware (which failed since I
The objects in my MS Access form display like an Excel instead of a form
6 November 2025 @ 10:59 pm
If I double click on the form from the "All Access Objects" pane, it displays correctly.
If I try to display using the following code:
Public Function lookupTitle(ByVal jobTitle As String) As Integer
DoCmd.OpenForm "frmSelTitle", acDialog, , , , , jobTitle
lookupTitle = Forms("frmSelTitle").lstTitles.Value
DoCmd.Close acForm, "frmSelTitle"
End Function
I get this:
I visually compared all the form settings to an existing form that is called up successfully using identical code and I could not see any differences.
Any idea on what the issue is?
If I try to display using the following code:
Public Function lookupTitle(ByVal jobTitle As String) As Integer
DoCmd.OpenForm "frmSelTitle", acDialog, , , , , jobTitle
lookupTitle = Forms("frmSelTitle").lstTitles.Value
DoCmd.Close acForm, "frmSelTitle"
End Function
I get this:
I visually compared all the form settings to an existing form that is called up successfully using identical code and I could not see any differences.
Any idea on what the issue is?How to pass arbitrary-sized array as template nontype argument?
6 November 2025 @ 10:47 pm
I would like to create a template function taking an std::array<int, N> as a nontype template argument for any N (you can do that since C++20).
Explicitly I can do it like that:
#include <array>
template<int N, std::array<int, N> Arg>
void foo() {}
int main() {
foo<2, {1, 2}>();
}
My question is: can I make N be somehow deduced? For example something like this:
#include <array>
template<std::array<int, N> Arg, int N>
void bar() {}
int main() {
bar<{1, 2}>();
}
The above fails to compile as N is used before it is declared.
-----
Bit broader context: I actually want a template taking 2 of such arrays, so that I can call it like this:
foo<{1, 2, 3}, {4, 5, 6, 7}>()
The split into 2 sets of numbers is signifi
Navigation Links Overlapping Logo and Content Shifts When Scrolling on My Website
6 November 2025 @ 10:44 pm
When I adjust the window size on my personal website, the navigation links don’t stay in place and move behind my logo. Additionally, when I scroll, the content moves up instead of staying fixed, even though there’s more content below. I’ve tried adjusting the CSS as best I can, but any changes seem to disrupt the positions of both the logo and the navigation links in the header.
<!DOCTYPE html>
<html>
<head>
<!-- The title of the webpage shown in the browser tab -->
<title>My Name</title>
<!-- Link to the external CSS file for styling the page -->
<link rel="stylesheet" href="main.css" />
<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/npm/@phosphor-icons/[email protected]/src/regular/style.css"
/>
</head>
<body>
<!-- Header section containing the navigation bar -->
<h
Module build failed: UnhandledSchemeError: Reading from "node:events"
6 November 2025 @ 10:42 pm
enter image description here
Estou tentando executar os testes seguindo uma linha de Page Objects para refatorar meus teste, porém desde então estou esbarrando nesse error e não sei mais o que tentar para resolver.
Alguém consegue me ajudar?
Assim está meu cypress.config.js:
const { defineConfig } = require("cypress");
module.exports = defineConfig({
reporter: "cypress-multi-reporters",
reporterOptions: {
reporterEnabled: "cypress-mochawesome-reporter, mocha-junit-reporter",
mochaJunitReporterReporterOptions: {
mochaFile: "cypress/reports/junit/results-[hash].xml",
},
cypressMochawesomeReporterReporterOptions: {
charts: true,
reportPageTitle: "Relatório de testes",
embeddedScreenshots: true,
inlineAssets: true,
saveAllAttempts: false,
},
},
chromeWebSecuri