Random snippets of all sorts of code, mixed with a selection of help and advice.
Trouble Moving Points in Python Pygame
24 May 2026 @ 4:32 am
I'm attempting to render a rotation cube in python using Pygame and an explanation from Tsoding's video on 3d graphics. One problem I keep encountering is all my positions reaching infinity or -infinity. I am so lost and I have little experience in python programming and using Pygame.
Here is the code
# Import Modules
import pygame
import math
# Pygame Setup
pygame.init()
WINDOW_WIDTH = 500
WINDOW_HEIGHT = 500
screen = pygame.display.set_mode((WINDOW_WIDTH,WINDOW_HEIGHT))
Clock = pygame.time.Clock()
running = True
# Classes
class Point:
def __init__(self, xPos:float, yPos:float, zPos:float): #zPos:float):
self.xPos = xPos
self.yPos = yPos
self.zPos = zPos
def rotate(self, angle:float):
# This is just a rotation matrix
# do trig function
cosineAngle = math.cos(angle)
sineAngle = math.sin(angle)
# apply to positions
self.xPos = self.xPos * cosin
New system, Apache 2.4 saying it can't read my ~/public_html despite being configured the same as all my previous systems
24 May 2026 @ 4:19 am
Lightning damage fried my old home dev box this morning, so I built a brand new one, installed the same OS and same packages. I even tried to restore the package configs to what I had backed up on the old system, but nothing seems to work. Just for sanity purposes, I went back to an OS-basic install, and configured manually from there.
I've exhausted all the AI tools, and they all keep running me in circles on this.
My directory tree up to my ~/public_html is all given 711 permissions. The public_html itself though is 755, as are all directories under it. I'm currently ensuring that all files are 644 too, but that's not going to solve this since even my root of that directory is 403'ing just as anything deeper in the tree. I've also disabled all the .htaccess files, but no success.
All the AI tools are claiming that Apache "now" requires 755 from / all the way into the document root, and that while 711 would "theoretically work"
Unity URP built and run err: MissingMethodException: UnityEngine.Texture.GetScriptWidth (URP 12.1.8, Unity 2021.3.15f1, Mono Build Only)
24 May 2026 @ 4:18 am
Problem
When building for Windows using Mono backend, the game crashes with repeated MissingMethodException. The error comes from URP 12.1.8 core code calling the internal native method GetScriptWidth(). The editor runs perfectly; only builds fail.
Error Log
MissingMethodException: assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) UnityEngine.Texture.GetScriptWidth()
at UnityEngine.Texture.get_width () [0x00001] in C:\buildslave\unity\build\Runtime\Export\Graphics\Texture.bindings.cs:40
at UnityEngine.Texture2D.SetPixels (UnityEngine.Color[] colors) [0x00001] in C:\buildslave\unity\build\Runtime\Export\Graphics\Texture.cs:765
at UnityEngine.Rendering.TextureCurve.GetTexture () [0x000ae] in E:\Things\UTTT\Library\PackageCache\[email protected]\Runtime\Utilities\TextureCurve.cs:145
i dont know if this log
PolarDB MySQL 8.0: Parallel query actually slower than serial when innodb_adaptive_hash_index is ON — why?
24 May 2026 @ 3:53 am
PolarDB for MySQL 8.0.2, ePQ enabled with max_parallel_degree = 4.
I turned on Elastic Parallel Query to speed up some aggregation queries, but certain queries actually got slower with ePQ than running serially. CPU on the RO node also spikes noticeably higher during parallel execution.
After some digging I noticed innodb_adaptive_hash_index is ON (the default). I vaguely recall that AHI and parallel query can conflict, but can't find a clear explanation of the mechanism.
My guess is multiple parallel workers hitting AHI simultaneously cause latch contention on the hash index partitions — but not sure if that's what's really happening.
Has anyone run into this? Should I just turn AHI off when using ePQ?
409 Conflict with MAX_CONCURRENT_APPLICATIONS_REACHED in a Python requests burst script?
24 May 2026 @ 3:34 am
I am testing a Python automation process and encountering a server response code 409 conflict error.
The application returns an eligibility error message stating that the maximum number of concurrent applications has been reached or that the session is currently within a cooling period. This activity failure happens specifically during the application eligibility validation phase.
The environment utilizes Firebase App Check and standard authorization patterns.
My goal is to learn how to structure client-side intervals to properly handle this lock. Should I dynamically scale my request timeouts or implement a specific linear delay to queue these parallel events effectively? Any architectural suggestions would be helpful.
Do `setCustomValidity()` and `checkValidity()` supersede the need for external libraries?
24 May 2026 @ 3:34 am
I was recently drafting up a webpage and was thinking about supplying some custom error messages. I discovered setCustomValidity() which allows you to supply a custom error message. I subsequently discovered that there is a method called checkValidity() which will validate the form. When calling the checkValidity() function, I discovered that it returned false instead of true.
Is this useful for general purpose web pages or should you rely on external libraries for this support?
const text = document.querySelector('#text');
text.addEventListener('change', (e) => {
if (e.target.value.length < 5) {
e.target.setCustomValidity("Your input must be at least 5 charac
PaddleOCR vs EasyOCR: Text loss and watermark issues when processing complex PDFs in Python
24 May 2026 @ 3:20 am
I am developing a data extraction module in Python to process dense, official PDF documents. These files contain a mix of native digital text, scanned sections, signatures, and, critically, background watermarks (such as textured stamps or light gray text reading "COPY", "PROVISIONAL", etc.).
I am currently evaluating PaddleOCR and EasyOCR, but I am experiencing a severe loss of integrity in the extracted text.
The behavior I observe with each library:
With PaddleOCR: The engine truncates or completely omits entire paragraphs and text blocks. It does not throw any physical error (Crash), but the array returned by ocr.ocr() is incomplete. I have noticed that this issue worsens drastically in areas with watermarks, as the model seems to confuse the contrast of the actual text with the background, or it classifies the entire
Ninja and parallelization from link time optimization
24 May 2026 @ 3:20 am
GCC, when linking LTO objects, will run a bunch of subprocesses in parallel. It uses Make to coordinate that, in the hope that if there is a jobserver present (i.e. gcc itself has been called from Make), this will limit the total number of parallel processes.
This works fine, unless one is using Ninja as the "outside" build tool, because that does not provide a jobserver, and gcc falls back to building with as many parallel processes as there are CPUs.
That is usually better than full serialization because LTO is typically used in large projects, and at this point, there is usually just one process left in the outer build, the linker invocation itself, but if you are building a lot of targets (e.g. unit tests), the theoretical maximum becomes the square of the number of processors.
The obvious technical solution would be for Ninja to also provide a jobserver (which is difficult), but unless and until that happens, what would be a good way to set up a p
bruteforce-salted-openssl claims a file is not a salted openssl file, but GNU/linux say it is, why?
24 May 2026 @ 3:09 am
I have this file that the command file, when called upon it, says:
file test-backup
test-backup: openssl enc'd data with salted password, base64 encoded
But if I try to bruteforce-crack it (forgot the password, it was 7 years ago that I created this file), the command to do it says:
bruteforce-salted-openssl -t 4 -l 8 -m 12 test-backup
Error: test-backup is not a salted openssl file.
I am using the most recent build of bruteforce-salted-openssl, as found on Github.
Is this proof by contradiction a correct way to formally prove the behavior of this simple program with atomic ops?
24 May 2026 @ 1:51 am
Consider this example:
#include <thread>
#include <atomic>
int main(){
std::atomic<int> val = 0;
std::atomic<bool> flag = false;
std::jthread t1([&](){
if(val.load(std::memory_order::relaxed) == 1){ // #1
flag.store(true, std::memory_order::release); // #2
}
});
std::jthread t2([&](){
while(!flag.load(std::memory_order::acquire)); // #3
val.store(1,std::memory_order::relaxed); // #4
});
}
The way I try to prove the behavior of the program is by contradiction:
First, assuming the counterfactual: loop at #3 exit.
So, the first logic statement based on this assumed premise is:
The loop at #3 exit ⟾ #3 reads from #2
[stmt.while] p1: In the while statement, the substatement is executed repeatedly until the value of the condition ([stmt.pre]) beco