Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
14 posts · #python
Clear filters·5 min read

Desktop Grid · Story
Why a Desktop Grid zone looked right while dragging and re-inflated after the drop
Deleted icons stayed in a pinned zone's kept list forever, and the icon-hugging border kept stretching toward their old spots. A 5-tick grace period fixed it.
In short
- A pinned zone keeps a list of icon positions, and a deleted or renamed icon stayed in that list forever.
- The border draws itself around every kept position, so a ghost icon far from the zone re-inflated the border after each drop.
- Entries missing for 5 consecutive enforcement ticks, about 10 seconds, are now forgotten, and auto-fit zones re-fit when that happens.
#python#pyside6#windows#debugging
·5 min read

Desktop Grid · Story
My auto-fit zone never grew: enforcement put the icon back first
In Desktop Grid, dragging an icon out of an auto-fit zone made it snap back, so the zone never re-fit. Two correct features cancelled out; a ten-line branch fixed it.
In short
- Pinned zones keep their icons inside via a periodic enforcement loop that puts any escaped icon back at its remembered position.
- Auto-fit zones are meant to grow to wrap their icons, but enforcement returned the icon before the zone ever saw it outside, so the zone never re-fit.
- For auto-fit zones the loop now accepts the new position, updates the remembered one and re-fits the border; the enforcement interval went from 4 s to 2 s.
#python#qt#windows#state#debugging
·6 min read

Desktop Grid · Story
Ten commits for a Desktop Grid feature, then one revert
I built a dragging mode for Desktop Grid in 30 minutes, with each commit patching the last one, and then reverted all of it. The history does not say why, and I will not invent a reason.
In short
- The dragging mode took 10 feature commits between 04:59 and 05:25, and almost every one fixed a side effect of the one before.
- One revert commit, cfb8b58 at 05:29, removed 270 lines and added back 27. v1.0.0 was published two minutes later.
- The commit messages tell what the feature was doing. They do not tell why I reverted it.
#python#pyside6#git#scope
·6 min read

Desktop Grid · Story
Desktop Grid: my Qt overlay swallowed every click on the desktop
I ported Desktop Grid to PySide6 and the overlay blocked the whole desktop. The fix, three minutes later, was a 60 ms timer that flips one Windows window style.
In short
- tkinter got click-through from a colour key. Qt's per-pixel alpha window does not, and WMNCHITTEST with HTTRANSPARENT did not forward clicks to other processes.
- A timer polls the cursor every 60 ms and toggles WSEXTRANSPARENT on the overlay.
- Changing window flags in Qt recreates the native window and wipes extended styles, so they are reapplied each time.
#python#pyside6#qt#win32
·5 min read

DiskDesk · Story
My right-click menu came up empty: pywin32 has no IContextMenu3
To show Explorer's real context menu from Python, I had to call IContextMenu2 and 3, which pywin32 does not expose. Raw vtable slots and a hidden window filled the empty submenus.
In short
- pywin32 exposes IContextMenu but not IContextMenu2 or IContextMenu3, and without those the shell leaves its dynamic submenus empty.
- shellmenu.py calls the COM methods through raw vtable slots with ctypes.
- A hidden window owns the popup and forwards menu messages to IContextMenu3, falling back to IContextMenu2.
#python#com#ctypes#windows
·5 min read

domain_hunter · Story
When a 404 does not mean the domain is free
rdap.org answers 404 for both a free name and a TLD with no RDAP server. DomainHunter only trusts the 404 if the request was redirected to a registry host.
In short
- rdap.org returns a plain 404 for extensions with no RDAP server at all, such as .io and .gg.
- The code counts a 404 as "free" only when the final URL is a registry host, not rdap.org itself.
- Otherwise the result is unknown, and the check falls through to WHOIS.
#python#rdap#domains#http#debugging
·5 min read

domain_hunter · Story
Two traps in a domain checker: a blank WHOIS line and a fake TLD
A regex that crossed a newline would read the next field as a WHOIS host, and a typo extension returns NXDOMAIN, which looks free. Both fixes are a few lines in availability.py.
In short
- WHOIS host discovery uses [^\S\r\n] instead of \s, so a blank whois: line (such as .ga) cannot swallow the next line.
- A name under a non-existent extension gets NXDOMAIN, so the DNS check first looks the extension up in the IANA root zone.
- The repository has one commit, so I tell both stories from the code and its comments.
#python#whois#dns#regex#domains
·8 min read

Teaching CodeT5 to read renamed Python: a deobfuscator experiment
I fine-tuned CodeT5 to undo variable renaming in Python. The first run promised 23 hours on CPU, and my own obfuscator turned out to break the syntax it was meant to preserve.
In short
- My obfuscator replaced every word that was not on a 13-item keyword list, so in, not, as and None became variables and the "obfuscated" input was often not valid Python.
- The same training job looked like a 23 hour 41 minute job on CPU (5,625 steps at 15.19 s/it) and a roughly 30 minute job on the GPU (1,405 steps at 1.17 s/it).
- The evaluation log has 740 scored examples with mean BLEU 0.250, ROUGE-1 0.344 and ROUGE-L 0.309. Only 51 of them reach ROUGE-L 0.5.
#python#machine-learning#codet5#code-analysis