Random snippets of all sorts of code, mixed with a selection of help and advice.
Fake Virtual Printer
16 November 2025 @ 2:57 pm
Can I create a virtual printer on Windows that will look like a regular physical to apps? The typical PDF printers don't work. Probably because they are clearly not a physical printer.
libstdc++.so links error when try to use pybind11/3.0.1 of conan-2 and cpp23 in wsl
16 November 2025 @ 2:51 pm
In WSL (Ubuntu 24.04), when using Conan to create a package that links pybind11/3.0.1, the resulting executable in the test_package fails to run.
Even if the executable doesn't directly call any pybind11 functions, it links anaconda3/lib/libstdc++.so.6 which seems not to support cpp23.
conanfile.py (for package)
# ...
self.requires("pybind11/[*]") # try to use pybind11, if remove this and corresponding commands in CMakeLists.txt, it links the libstdc++.so in 'usr/lib'
# ...
CMakeLists.txt (for package)
# ...
set(CMAKE_CXX_STANDARD 23) # this project uses cpp23
# ...
After removing self.requires("pybind11/[*]") in conanfile.py and corresponding commands in CMakeLists.txt it links the correct (
How to make an AI model come alive?
16 November 2025 @ 2:44 pm
For fun, I developed an AI model with short-term, medium-term, and long-term memory, inspired by neuro-sama. (I'm a regular backend developer, I don't know much about AI).
How it works:
mic -> vad -> local STT whisper -> core llm
twitch chat -> llm determining the interest of the message -> core llm
hearbeat (once per minute) -> core llm
core llm openai gpt-4.1-mini responses api generates a response and uses tools (to make a Telegram post, for example), simultaneously makes a request to another llm to extract facts for long-term memory and records them in qderm.
Once every 10 messages, a session summary is made for medium-term memory.
After that, the core llm response is sent in stream mode to TTS elevenlabs flash v2.5 in stream mode.
The elevenlabs responses are played back, events are sent synchronously to vtube studio api for animations and lip-syncing, and each word is sent to a local web server that disp
pretrained NTU60 of VPN [closed]
16 November 2025 @ 2:38 pm
I am trying to reproduce Srijan Das's VPN "VPN: Learning Video-Pose Embedding for
Activities of Daily Living". Is there a public link for pretrained NTU60 or NTU120 weights? If any user has downloaded them earlier, could you share the link?
Calling a method from a parallel mixin in Python without breaking MRO or responsibilities
16 November 2025 @ 2:35 pm
I am working on a multifunctional quite old game bot with the followng implementation:
There are tons of mixins in different files/folders (each inherits GameBase). Each mixin:
- uses attributes + HTTP base for sending personal api requests, standartizing and processing the responses
- implements some specific activity for a sublocation,
- has a clear single responsibility: handling a specific action or group of actions related to it's sublocation.
- for example really, StreetLocation has more than 20 subhandlers (handler names in examples below are changed, to hide the originals)
- the self.eat() here is preferable that self.stomach.eat() - it should be delegated internally.
- name of functions are unique and do not cause MRO issues and do not rely on inheritance order right now.
class GameBase: # contains all available bot attributes + HTTP communication base methods
class *Handl
Terminating a Promise from anywhere
16 November 2025 @ 2:32 pm
I'm looking to cancel a promise based on a signal that can be controlled by anything - effectively cancelling a promise through an event.
The only valid solution I've come across so far is to just continually check if the signal that I'm listening for is false - this can be dressed up by wrapping the check in a function call. Otherwise, it looks like NodeJS can't actually terminate function.
I was hoping to use a solution that's syntatically similar to the following:
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
new Promise(async (resolve, reject) => {
try {
console.log(1);
sleep(1000).then(() => {throw new Error("hi")}); // some arbitrary time un
How to Make Book/Check Button Trigger Popup on Page 2+ in Traveler WP Search Results
16 November 2025 @ 2:21 pm
I use Traveler WP by ShineThemes. The test site is:
https://experiences.reimagine.link/search-solo/
In order to get more bookings, I added a “Book Now” button to all tour listings. The button opens the TicketingHub popup widget. It works perfectly on all listings—including the search page—but only on page 1.
The issue:
On the search results page, pagination uses a different template file. Page 1 uses grid.php (customized in a child theme). Pages 2, 3, and onward use grid-2.php. After discovering this, I copied the exact same Book Now logic from grid.php into grid-2.php.
The button shows on page 2+, and I temporarily renamed it from Book Now to Check, but it does not fire the popup when clicked. The same popup logic works everywhere else.
Original theme reference code (grid.php)
Is DD-WRT still maintained in 2025?
16 November 2025 @ 2:05 pm
I need to replace some basic small office routers and looking for devices that are DD-WRT compatible/flashable.
The pre-flashed ones offered on the DD-WRT website are way old. That gives me pause. Also, searching for DD-WRT routes via search engines produces nothing, just OpenWRT options.
Don't know squat about OpenWRT but if anyone on this question does or can point to where I can feel more assured that it's at least equal to DD-WRT in features, customization and security (above all), that will be helpful as well.
Why are C++ and Python giving me different answers, when given (I think) the same precision?
16 November 2025 @ 1:42 pm
I have this code in C++:
#include <iostream>
#include <iomanip>
#include <limits>
#include <boost/multiprecision/mpfr.hpp>
using namespace boost::multiprecision;
template<int bity>
auto obliczenie() {
using real = number<mpfr_float_backend<bity>>;
int cyfry = std::numeric_limits<real>::digits10;
std::cout << std::setprecision(cyfry + 2);
real x = 77617;
real y = 33096;
real wynik = real(333.75)*pow(y,6) + pow(x,2)*(real(11)*pow(x,2)*pow(y,2) - pow(y,6) -
real(121)*pow(y,4) -real(2)) + real(5.5)*pow(y,8) + x/(real(2)*y);
return wynik;
}
int main() {
std::cout << "Wynik dla float: " << obliczenie<24>();
std::cout << "\nWynik dla double: "<< obliczenie<53>();
std::cout << "\nWynik dla long double: " << obliczenie<64>();
std::cout << &qu
Question regarding using : and [] together, Lua
16 November 2025 @ 12:19 pm
Take the following block of code
function pickrand()
local v = math.random(1,3)
if v==1 then return ‘px' elseif v==2 then return ‘py' elseif v==3 then return 'pb' end
end
prin = {
x = function(obj)
print(obj.x)
end,
y = function(obj)
print(obj.y)
end,
xy = function(obj)
print(obj.x+obj.y)
end
}
Object = { x = 12, y = 25}
Metatable = {__index={ px=prin.x,py=prin.y,pb=prin.xy}}
setMetatable(Object,Metatable)
Object:[pickrand()] — this is the line that’s important,
I’d like a way of calling prin.x,prin.y and prin.xy with obj = self and self = Object. the typical method for this would be Object:px/pb/py(), however in my current situation I’d like to use a variable (a string) who’s content is 'px','py' or ‘pb’ instead. thus being able to randomly decide which of the 3 happens.
Not sure how i’d do this since Object[thing] do