Random snippets of all sorts of code, mixed with a selection of help and advice.
android build not applying theme.res without migrating to Maven
10 February 2026 @ 2:09 am
I’ve made the required changes and the app is working correctly in the simulator. However, when I build for Android, the theme.res styles are not being applied. It appears that androidTheme.res is being used instead.
When I open androidTheme.res, the styling reflected there matches what I see on the device, which suggests it is overriding theme.res.
I’ve tried multiple approaches to force the use of theme.res, prevent androidTheme.res from being generated, or stop it from being applied, but without success.
Below are the build hints I added in the codenameone_settings.properties file:
codename1.android.theme=theme
Find a media file embedded in a web page - not obvious
10 February 2026 @ 1:50 am
I want to find the video playing in this web page:
instagram.com/reel/DICVb06udC8
note: the character between 'D' and 'C' is an eye, not an ell
ordinarily, I would open Developer tools, select the 'network' tab, choose 'media' and see the file, but nothing shows up, even when the video is playing.
I'm using Chrome on Windows 10, if that is significant.
Line does not appear on R plot
10 February 2026 @ 1:45 am
I am running a linear regression and trying to overlay lowess regression line. The code is below:
plot(Data$X,Data$Y, pch = 12, col = "blue")
lines(lowess(Data$X, resids , f = 0.99))
abline(h = 0, col = "green")
The first command is to creat the plot, the second line with lowess regression requesting a line for X against the residuals (resids) with 99 bandwidth. However, the line does not appear on the plot? and abline does not show up the horizontal line at 0? Any suggestions to make it work is appreciated. Thank you.
The range for resids is (-1.560654 , 2.971360) and the range for X is ( 1 , 665).
Keycloak 26 – How to persist invalid login attempts permanently?
10 February 2026 @ 1:35 am
I’m using Keycloak 26.3.0 with Brute Force Detection enabled:
Max Login Failures = 3
Lockout permanently enabled
Using Direct Grant (token endpoint API) for login
I noticed that while permanent lockout works, the invalid login attempt counter resets automatically after some time because it’s stored in Keycloak’s internal cache.
I want the invalid attempt count to be stored permanently in the database, so I can track all failed logins and enforce policies reliably.
Is there any built-in way to do this, or do I need a custom SPI/extension to persist login failure attempts permanently?
Login/Password protection with Quartz 4 (Obsidian Digital Garden)
10 February 2026 @ 1:27 am
I'm trying to figure out the simplest way to provide authentication/password protection for a Quartz deployment.
I'd like the solution to be something that minimizes both complexity and cost, even a simple password to access the site is enough.
Right now I've only found:
Cloudflare Access, which is perfect except it charges 7 dollars per user above 50, which I think is expensive.
Supabase, which I've used before, however, using it on top of Quartz adds a level of complexity I'd rather avoid.
Netlify password protection is the best option I can see right now but it requires a $20 per month subscription.
Has anyone done this before and have any advice or tools I'm missing? Thanks for your help!
Is there a way to await a Console.ReadLineAsync and another Task in parallel with WaitAny()?
10 February 2026 @ 1:18 am
I'm working on a toy CLI debugger in C#/.NET. I have a REPL loop that looks something like this:
this.backgroundTcs = new TaskCompletionSource();
bool quit = false;
while (!quit) {
Task<string?> inputTask = Console.In.ReadLineAsync();
await Task.WhenAny(inputTask, backgroundTcs.Task);
Console.WriteLine($"Status: {inputTask.Status}, {backgroundTcs.Task.Status}");
// do something with either of the tasks, depending on their IsCompleted properties
if (inputTask.IsCompletedSuccessfully) {
quit = DispatchDebuggerCommand(inputTask.Result);
}
}
There is a background thread that simulates the execution of the debugged program. When that threads hits a break instruction, it calls the backgroundTcs completion source's SetResult method:
void OnBreakInstruction() {
backroundTcs.SetResu
What is the proper way to validate glooey EditableLabel in real time (pyglet error)?
10 February 2026 @ 1:08 am
I am using pyglet 1.5.31 (glooey doesn't work with later versions) and glooey 0.3.6. I am subclassing EditableLabel and trying to implement a validation to make sure it is a number whenever it is edited:
import pyglet
import glooey
class Label(glooey.EditableLabel):
def __init__():
super().__init__(*args, **kwargs)
self.previous_text = ""
self.push_handlers(on_edit_text=self.prohibit_entry)
def prohibit_entry(self, label):
update_text = False
if label.text == "":
update_text = True
else:
if self.isFloat(label.text): #Function to try to parse string as float and return false if fails
update_text = True
if not update_text:
self.text = self.previous_text
else:
self.previous_text = label.text
This code fails with this traceback:
Exception ignored on calling ctypes callback function: <
Fastapi CORS error when trying to fetch static files
10 February 2026 @ 1:06 am
getting CORS error when trying to fetch statically served images from Fastapi server even though i defined my frontend domain in the allowed origins. but everything works fine other than this
app.mount("/public", StaticFiles(directory="public"), name="public")
origins = [
"http://localhost:5173",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
my frontend code
//http://localhost:8000/public/e2f4e1...
const response = await fetch(`${BASE_URL}/public/${image.link}`);
the error i get
Access to fetch at 'http://localhost:8000/public/e2f4e1e4-33a4-4704-8e07-a02a3dfc2390.jpeg' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resour
When to use standalone functions in C++?
9 February 2026 @ 11:09 pm
I am a beginner C++ programer and I am trying to make a very simple random number generator for my program.
I started doing this by creating a struct in a header file but I am wondering if this is a good idea. All my methods and variables would be static since I don’t know what an object of this struct would even look like or why I would use it. So if everything is static, whats the point of having a struct.
I was told having standalone functions was a bad practice but how bad is it really. Is there a scenario where you shouldn’t use OOP and use isolated functions?
How to use Kimi via REST API calls?
9 February 2026 @ 8:46 pm
Trying to curl Kimi K2.5 using my generated API key but I keep getting an "Invalid Authentication" error:
curl https://api.moonshot.cn/v1/models \
-H "Authorization: Bearer sk-kimi-secret"
{"error":{"message":"Invalid Authentication","type":"invalid_authentication_error"}}%
I am able to access the model through opencode however. How do I use this model via REST calls?