Random snippets of all sorts of code, mixed with a selection of help and advice.
How to properly detach from a remote debug session?
3 January 2026 @ 6:54 pm
With VSCode, I want to debug my application running on a remote target.
For this, on the target I'm running gdbserver :1234 --attach $(pidof myapp).
I have created a launch.json script for code:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "Debug: Start gdbserver",
"program": "/home/developer/src/build/Debug/myapp_unstripped",
"cwd": "/home/developer/src",
"MIMode": "gdb",
"miDebuggerPath": "aarch64-linux-gnu-gdb",
"miDebuggerServerAddress": "IP:1234",
"stopAtEntry": false,
"logging": {"engineLo
Azure DevOps Change Billing with no AD at original Subscription
3 January 2026 @ 6:46 pm
This is similar to an article found here: Azure Dev-Ops - Change billing subscription.
Many years ago, a consultant came in and created our Azure Devops subscription based off of my Visual Studio Professional subscription. My MSA (Microsoft) account is [email protected]. I "renew" my VS subscription every year. I am the owner, etc.
We have a Microsoft 365 E5 subscription. My Entra ID account there is the same as the MSA account ([email protected]). Our goal is to move the Devops Subscription to be billable and owned under the Microsoft 365 world.
I have tried to add [email protected] using the MSA account at my Entra ID directory, but it doesn't allow me to do that. We are a very small company (< 10 employees)
To summarize:
Azure Devops:
No Active Directory Configured
Tied to m
Is there any way to listen binance futures WebSocket stream related to order status updates?
3 January 2026 @ 6:34 pm
I used GPT and google ai, but examples there did not work. I could not find any explanation in official binance documentation. There are related to Spot, but not Futures.
Photon Fusion latency from Vietnam to Singapore server is higher than expected (60-100ms vs 30-50ms) [closed]
3 January 2026 @ 6:29 pm
I'm developing a Unity game using Photon Fusion with PlayFab as the backend. My client is located in Vietnam, and the server region is Asia (Singapore).
When testing, I notice that the measured latency is around 60-100ms, whereas I would normally expect it to be closer to 30-50ms given the proximity.
Does anyone know why the latency is higher than expected, and are there ways to reduce it?
Launch suprocesses in Python by chunks and wait until end for start the next chunk
3 January 2026 @ 6:13 pm
I need to launch a Python script lots of times from a Python script. Suppose I have a machine with 10 cores and I need to run my script 100 times, so I could divide the total in 10 chunks of 10 executions. I have this code:
import subprocess
chunks = 10
it = 10
for i in range(0,chunks):
procs = []
for j in range(0,it):
proc = subprocess.Popen([program,option1,option2])
procs.append(proc)
[p.wait() for p in procs]
The idea is that the internal loop launches the calls in a chunk and then the external loop waits for all processes end in order to launch the next chunk. But testing on a machine with more than 10 cores and using a number of executions equal to 10 I can see all cores are working, so my code is not working as expected. But I can't find the bug. Can anyone help, please?
Visual Studio Code : jar import error - package does not exist
3 January 2026 @ 5:49 pm
When referencing an external library (.jar) with an import, i get the error "package ... does not exist".
I precised that compilation is OK (when i print in the console, changes are considered). I think so that it's just a problem of VS Code configuration/state.
I am really stuck by this error since some days (screenshot provided)
My steps :
Created a java project (no build tools)
Added a referenced library (official org.apache.commons.io JAR file) in 2 ways :
Add package with the "plus" button of the "referenced libraries" section
Configure settings to discover referenced libraries in the lib folder: when adding a new package in the lib folder, it is automatically discovered and added to the referenced libraries
Added the import "org.apache.commons.io in the app.java file
Some help would be appreciated.
"rails test" doesn't run any tests
3 January 2026 @ 5:18 pm
I downloaded Ruby and Rails onto my machine, and it looks like this:
jgodse@MacBookPro phonebook % which ruby
/Users/jgodse/.rbenv/shims/ruby
jgodse@MacBookPro phonebook % ruby --version
ruby 3.4.8 (2025-12-17 revision 995b59f666) +PRISM [arm64-darwin25]
jgodse@MacBookPro phonebook % which rails
/Users/jgodse/.rbenv/shims/rails
jgodse@MacBookPro phonebook % rails --version
Rails 8.1.1
I then created a new Rails application with some simple CRUD objects:
rails new phonebook
cd phonebook
rails db:create
rails generate scaffold communicator name:string email:string phone_number:string
rails db:migrate
rails db:test:prepare
I then ran rails console, and it worked fine. I was able to create new communicator objects and it was all good:
phonebook(test):007>
phonebook(test):008> c=Communicator.new
=> #<Communicator:0x00000001230a3ee8 id: nil, created_at: nil, email: nil, name:
HTML AutoPlay next episode similar to Netflix etc
3 January 2026 @ 4:23 pm
I am looking for a way to display next episode will play in 5 secs countdown before the end of an episode, the same as Netflix, Amazon etc...
Towards the end of each episode are the usual credits and wondered if there was a way JavaScript or similar could determine the length of each episode and display 'next episode will play in 5 seconds' countdown button, then load the next episode automatically within a HTML webpage.
I Googled this but cannot seem to find exactly what I'm after. Any suggestions please would be greatly appreciated.
I have the following usual HTML / VBScript code to play a video:
<video class="player" id="player" preload="auto" crossorigin playsinline controls poster="<%=dImagePath%>2.jpg">
<source src="<%=dPath%>" type="video/mp4" size="4K">
I Googled this but cannot seem to find exactly what I'm after. Any suggestions please would be greatly appreciated.
I have the following usual HTML / VBScript code to play a video:
<video class="player" id="player" preload="auto" crossorigin playsinline controls poster="<%=dImagePath%>2.jpg">
<source src="<%=dPath%>" type="video/mp4" size="4K">
How to show cemra feed without cropping in a program that is Qt designed and writen in python?
3 January 2026 @ 2:02 pm
I have designed a GUI using QtDesigner which is a MainWindow with central widget that only has a graphics view.
In the following Python code, I used openCV to get a camera connection and tried to show camera feed inside the graphics view:
# Source - https://stackoverflow.com/q/79859672
# Posted by Marwa Shams
# Retrieved 2026-01-03, License - CC BY-SA 4.0
from Ui.uiLoader import load_ui
from PySide6.QtWidgets import QWidget, QGraphicsScene, QGraphicsPixmapItem
from PySide6.QtCore import QTimer, Qt
from PySide6.QtGui import QImage, QPixmap, QPen
import cv2
class MainWindowTest:
def __init__(self):
# Load main window
self.ui = load_ui("graphicsviewTest.ui")
self.graphicsview = self.ui.graphicsView
self.scene = QGraphicsScene()
self.pixmap_item = QGraphicsPixmapItem()
self.scene.addItem
In the following Python code, I used openCV to get a camera connection and tried to show camera feed inside the graphics view:
# Source - https://stackoverflow.com/q/79859672
# Posted by Marwa Shams
# Retrieved 2026-01-03, License - CC BY-SA 4.0
from Ui.uiLoader import load_ui
from PySide6.QtWidgets import QWidget, QGraphicsScene, QGraphicsPixmapItem
from PySide6.QtCore import QTimer, Qt
from PySide6.QtGui import QImage, QPixmap, QPen
import cv2
class MainWindowTest:
def __init__(self):
# Load main window
self.ui = load_ui("graphicsviewTest.ui")
self.graphicsview = self.ui.graphicsView
self.scene = QGraphicsScene()
self.pixmap_item = QGraphicsPixmapItem()
self.scene.addItemHibernate ManyToMany on the same entity results in recursion
3 January 2026 @ 12:47 pm
I'm trying to model a ManyToMany relation on the same entity and can't get rid of recursion :(
I've got a person that can have multiple friends and can be a friend of multiple persons, like this:
@Entity
@Table(name = "demo_entities")
public class DemoEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
private int age;
private String name;
@ManyToMany
@JoinTable(name = "friends", joinColumns = @JoinColumn(name = "id1"), inverseJoinColumns = @JoinColumn(name = "id2"))
private List<DemoEntity> friends;
@ManyToMany
@JoinTable(name = "friends", joinColumns = @JoinColumn(name = "id2"), inverseJoinColumns = @JoinColumn(name = "id1"))
private List<DemoEntity> friendOf;
Then my friends entity looks like this:
@Entity
@Table(name = "friends")
public class DemoEntityFrie