Random snippets of all sorts of code, mixed with a selection of help and advice.
What does the return value of a `thrd_start_t` do?
14 March 2026 @ 7:34 am
In C, a thrd_start_t is a function with a signature of int (*)(void *). main returns an int as an error code to the instantiator, but in the case of a thread, we're the instantiator. I don't see any documentation about getting this return value, so what is it for?
FreeType - SDF font rendering
14 March 2026 @ 7:29 am
I am using FreeType and render glyphs to a font atlas with SDF enabled. I later create quad for each font and build strings using these quads and texture coordinates of fonts within altas.
To render aliased fonts, I have this shaders.
//----------------------------------------
in vec2 POSITION;
in vec2 TEXCOORD0;
out vec2 texCoord;
void main() {
gl_Position = vec4(POSITION.x, POSITION.y, 0.0, 1.0);
texCoord = TEXCOORD0;
}
//----------------------------------------
in vec2 texCoord;
out vec4 fragColor;
uniform sampler2D fontTex;
uniform float uSoftness; // 0.0 = sharpest, larger values = softer.
uniform float uEdge; //default: 0.5
uniform vec4 fontColor;
void main() {
float val = texture(fontTex, texCoord.xy).x;
float w = fwidth(val) + uSo
To render aliased fonts, I have this shaders.
//----------------------------------------
in vec2 POSITION;
in vec2 TEXCOORD0;
out vec2 texCoord;
void main() {
gl_Position = vec4(POSITION.x, POSITION.y, 0.0, 1.0);
texCoord = TEXCOORD0;
}
//----------------------------------------
in vec2 texCoord;
out vec4 fragColor;
uniform sampler2D fontTex;
uniform float uSoftness; // 0.0 = sharpest, larger values = softer.
uniform float uEdge; //default: 0.5
uniform vec4 fontColor;
void main() {
float val = texture(fontTex, texCoord.xy).x;
float w = fwidth(val) + uSoDifference between ArrayList and LinkedList in Java
14 March 2026 @ 7:15 am
I am a beginner learning Java and data structures. I understand that both ArrayList and LinkedList are implementations of the List interface, but I am confused about when each one should be used.
Can someone explain the main differences between them in terms of:
Performance
Memory usage
Typical use cases
An example scenario of when to prefer one over the other would also help.
Why does one random one of my integration tests in session is failing?
14 March 2026 @ 7:04 am
I'm trying to write a simple FastAPI application with tests. But for some reason, one random one of my integration tests in session is failing. Could you tell me why? This is my project: https://gitflic.ru/project/intolighter/fastapi-jwt-auth.
Getting rid of warning messages when using ggplot2 and ggfortify R packages
14 March 2026 @ 6:57 am
I am plotting residual plots to check assumptions for a general linear model using both ggplot2 and ggfortify R packages but I keeping getting warning messages which I am not sure how to get rid off. The plots are fine but I am bothered by the warning messages.
The R code I am running is as follows:
diag.rs2292334_auc_w <- autoplot(rs2292334_auc_w,which=1:6,ncol=3) + theme(plot.margin = unit(c(1, 1, 1, 1), "cm"), panel.background = element_blank(), axis.line = element_line(color = "black"),axis.title = element_text(size = 16, color = "black"),axis.text.x = element_text(size = 16, color = "black"),axis.title.x = element_text(margin= margin(t=10)),axis.text.y = element_text(size = 16),axis.title.y = element_text(margin = margin(r = 10)),axis.ticks.x = element_blank())
What tweaks should I make to the above code to avoid the warning messages below? :
How to capture the response and override the appropriate headers in callback scriptWrapper?
14 March 2026 @ 6:15 am
Luckily, I managed to download meta data from remote source using java script functions:
function scriptWrapper(responseObject) {
// parse jsonp and override DOM object inner html value
}
const doGetMetaDataEvent = async () => {
setInterval(async () => {
const script = document.createElement('script');
script.src = METADATA_SOURCE + '?callback=scriptWrapper';
document.getElementsByTagName('head')[0].appendChild(script);
}, REFRESH_TIMEOUT);
}
but I have a problem with disabling refresh in the browser: The script from “https://radiohost.example.endpoint&informationjson=true?callback=scriptWrapper” was loaded even though its MIME type (“application/jsonp”) is not a valid JavaScript MIME.
So the question to be solved is where to capture the response and override the appropriate headers in it response.setHeader('X-Content-Type-Options', 'nosniff')
Last backup, last copy, last restore are null in log shipping throgh view report log shipping [migrated]
14 March 2026 @ 6:11 am
I have made problem during configure log shipping on SQL Server 2019 standard version by missing last backup, last copies, last restore select not found on msdb.
I have been using user AD all machine Domain/sqladmin two nodes primary and secondary for login database engine and for agent job.
Folder permission for UNC I have create on primary and enable and NTFS on primary permission full and also I have created local folder at the secondary to store copy backup log from share.
I have configure log shipping also correct step.
But why it is still not found last backup, last copy, last restore for primary and secondary on view report and on folder share, local folder it is working normally, also all job running fine.
Thanks.
Browser not Responsive when using Profile
14 March 2026 @ 6:03 am
I'm using NoDriver Python with a chrome profile and I'm running into an issue where the browser some times enters into a corrupted state and NoDriver can't control it.
For example if I run the script and the browser launches successfully with the profile and everything is working, then I do Control+C to kill the program, then after this if I run the script again the browser launches with the profile, but the browser gets into this bad state. I can manually interact with the browser, but if I click on the top search bar then the browser crashes.
To fix this, I have to manually open chrome and launch the profile and then close it. After doing this if I run the script again then everything works.
I'm guessing theres some sort of Lock/Singleton in the Profile directory thats not being de-initialized properly when force closing the browser, and then this is messing up subsequent runs. I've spent 3 hours (with Claude 4.6) trying a bunch of different approaches to sani
Some devices cannot download my app from Google Play due to compatibility issues
14 March 2026 @ 5:52 am
I have published my Flutter app to Google Play Console for testing.
Recently I noticed that **some users cannot download the app** from the Play Store.
When they try to install it, the Play Store shows a **compatibility message**, such as:
"This app is available only for your other devices."
However, the strange part is that **other phones can download the app normally**, and only some devices show this compatibility issue.
My app details:
* Built with Flutter
* Uploaded as an Android App Bundle (.aab)
* minSdkVersion: 21
* targetSdkVersion: 35
* Currently in the testing track on Google Play
I am not sure why certain devices are considered incompatible.
Has anyone encountered this issue before?
Could someone help explain what might cause this compatibility problem?
Thank you very much for your help!
Vue doesn't load styles in root
14 March 2026 @ 3:58 am
My /index.html simply tries to load fontawesome located in /public/fonts/<url>
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<style>
@font-face {
font-family: "FontAwesome";
src: url("/fonts/fa-regular-400.woff2") format("woff2"),
url("/fonts/fa-solid-900.woof2") format("woff2"),
url("/fonts/fa-brands-400.woff2") format("woff2");
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
But firefox never makes an