Random snippets of all sorts of code, mixed with a selection of help and advice.
Label not appear on 3D graph
25 January 2026 @ 10:26 am
So i want to try to plot of 3D trajectories (ground truth vs prediction) , the problem basically is that even though x,y labels appear normal, Z label its just disappeared, its like the 3D box that contains the trajectories is too big that it cut off Z label, (the values of Z axis though appear just fine) below is the code, i thought basically is there any way to make only the 3D BOX (not the whole figure smaller ) so Z label will appear on the screen just fine like x and y ? . Below is the code you can ask any more details i want to give if its needed.
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.ticker import MaxNLocator
forecast_step = 0
x_idx, y_idx, z_idx = 0, 1, 2
x_true = y_true_unscaled[:, x_idx, forecast_step]
y_true = y_true_unscaled[:, y_idx, forecast_step]
z_true = y_true_unscaled[:, z_idx, forecast_step]
x_pred = y_pred_unscaled[:, x_idx, forecast_step]
y_pred = y_pred_unscaled[:, y_idx, forecast_step]
z_pre
Docker missing context
25 January 2026 @ 10:18 am
when trying to run docker compose, docker misses context and actually copying other files
compose:
bot:
build:
context: .
target: bot
restart: unless-stopped
depends_on:
- db
- api
dockerfile:
FROM rust:1.93-bookworm as builder
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY api bot cron entity ./
RUN cargo build --release
FROM debian:bookworm-slim as base
WORKDIR /app
FROM base as bot
COPY --from=builder /app/target/release/bot /usr/local/bin/bot
CMD ["bot"]
project structure:
dockerignore:
migration/
target/
.env
so when i do docker compose up or docker compose build --no-cache i get error
ERROR [bot bot 1/1] COPY --from=builder /app/target/release/bot /usr/local/bin/bot
verifying sha of Cargo.tomls in result i see
dockerignore:
migration/
target/
.env
so when i do docker compose up or docker compose build --no-cache i get error
ERROR [bot bot 1/1] COPY --from=builder /app/target/release/bot /usr/local/bin/bot
verifying sha of Cargo.tomls in result i see Image doesn't exist, but it does
25 January 2026 @ 10:03 am
I'm working on a personal project that I'm going to use to spoof Discord emotes, and for the frontend I'm using Tkinter. I have the following lines of code that I'm using to cache emotes into a folder, however when using the async function to download the images, I get this error:
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python313\Lib\tkinter\__init__.py", line 2774, in __init__
self.tk.call(
~~~~~~~~~~~~^
(widgetName, self._w) + extra + self._options(cnf))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: image "./img_cache/895847091056807996.png" doesn't exist
I am aware that using async would lead to the button maker not finding images sometimes, and I tried to address that with a try/except clause and a while loop, however I cannot catch the error, even though I put the exact error I'm getting in the except clause. The code for that
How to disable line numbers in Markdown unformatted text blocks
25 January 2026 @ 10:01 am
I have the following in my Markdown code:
```
abc
def
```
and it is rendered as
1 | abc
2 | def
How can I get rid of the preceding line numbers?
The auto-completion for await changes the method's signature - how do I prevent that?
25 January 2026 @ 9:47 am
Reproduce by:
Create a void method.
In it type awa then press Tab.
See the signature change from void to async Task.
How can that be prevented?
CSS selectors with querySelector: Select only top level element(s) in shadow DOM
25 January 2026 @ 9:26 am
Assuming the following HTML content
<template>
<div>
an amount of unknown content
may contain: <div TAG>undesired node</div>
</div>
At the root level:
<div TAG>desired node</div>
</template>
I wish to, in JavaScript, select the root level node with TAG.
The following are statements I could come up with:
tem.content.querySelectorAll("[TAG]") // => [div, div] // includes non-root
tem.content.querySelectorAll("> [TAG]") // => Error // invalid syntax
tem.content.querySelectorAll(":root") // => [] // no :root
tem.content.querySelectorAll(":host") // => [] // no :host
tem.content.querySelectorAll(":host([TAG])") // no :host
tem.content.querySelectorAll(":scope") // => [] // no :scope
namespaces in headers(compiler-explorer)
25 January 2026 @ 9:22 am
I couldn't find a way to compile my project
The namespaces are like this.
namespace efanna2e {
...
}
project(multifile)
cmake_minimum_required(VERSION 3.5)
add_executable(multifile
index_kdtree.cpp
index_kdtree.h
index.h
index_random.h
parameters.h
exceptions.h
util.h
distance.h
)
:6:10: fatal error: efanna2e/index_kdtree.h: No such file or
directory
6 | #include
| ^~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. Compiler returned: 1
What would be the best way to manage separate processes in JavaScript
25 January 2026 @ 9:08 am
My project task is to query devices. I use JS and Bun as my API.
Example. On the site user add a device, lets's say over MQTT. He enters MQTT connection parameters and save device. I store in in DB. Then he click start. I send request to my API. It should start a process and return HTTP 200. But process continue to run and store results in DB for a history graph and in Redis for current values. Somehow handler to that process have to be saved and if user click stop I have to terminate that process.
I looked into Bun Workers but it does not looks like exactly what I need. Or is it? What would be a best technique to accomplish this?
I know that there might be better suited tools for that like Go Routines and Channels but I need to understand what are my possibilities in JS.
Is there a concept in python 3 which integrates with the while statement like an iterator does with the for statement?
25 January 2026 @ 7:03 am
I am searching for a way, to accomplish the common algorithmic pattern
prev_length = -1
while len(my_list) != prev_length:
prev_length = len(my_list)
# algorithmic code goes here
in the following form, which reads like plain english
while length_changed(my_list):
# algorithmic code goes here
I only was able to come so far:
tracker = LengthTracker(my_list)
while tracker.changed():
# algorithmic code goes here
To keep focus on the actual question, I spare You reading the implementation of class LengthTracker because this client side code already shows why I dislike this approach: There is an the extra initialization of the tracker object plus it pollutes my code as the object needlessly keeps existing after the loop has ended.
I guess, as I want automatic initialization, I might be looking for a concept that relates to while as t
"How to Remove Watermark in Gemini Code Assist on VS Code?" [closed]
25 January 2026 @ 3:42 am
I'm using Gemini Code Assist in Visual Studio Code, and I am trying to merge the split panels into one single window. No matter what I do, it keeps splitting the panels, and even when I try to use full-screen mode, the watermark still persists.
I've already tried maximizing the editor to full screen, removing the split mode, and toggling Zen mode, but the watermark remains visible.
Is there a way to remove the watermark, and is there a default panel-splitting behavior in VS Code that forces the Gemini assistant to keep splitting the editor?
Is there a setting or configuration that could help me keep everything in one single window without the watermark?
Please advise if it's just the way Gemini works in VS Code or if there's a workaround.

