news
Programming Leftovers
-
Nat Bennett ☛ Most Integration Failures Are Stupid
The dark secret of integration testing is that the vast, vast majority of problems that an integration environment will catch don't have anything to do with integration. If I bundle commits A and B and C together into a test run and that test run fails, the first thing I'm going to check is not "is there some exotic failure mode that only happens with these three commits together?" it's "so were A and B and C tested individually at all before they got pushed to the shared pipeline?"
Friends: The commits were not tested.
-
Remy Wang ☛ prela
From a mile a way this just looks like a regular SQL query. If you stare at it though, a few things are off: where's the FROM clause? Why does the SELECT clause come last (like a sane language)? And what's going on with cast.person.alias.text? Is that JSON? Let me explain. First, I'll strip away some syntax magic. The same code in Rust looks like this: [...]
-
Alisa Sireneva ☛ DuplicateHandle works on sockets, mostly
The reason for this is that sockets are a userland abstraction provided by Winsock2, rather than a kernel primitive. At least on paper. As such, operating on them as on handles is incorrect. For example, MSDN says that even if casting a SOCKET to HANDLE and calling DuplicateHandle works, it messes up some refcounts.
This post explores just how far this difference lies, and when you can get away with using handle methods for sockets when you have to.
-
Alisa Sireneva ☛ accept() and socket inheritance
Last time we saw that sockets are pretty much just handles, and as such, they can be inherited. If a process creates an inheritable socket and runs CreateProcess with the appropriate parameters, its children will retain access to the socket. This has obvious security and functional implications, so it’s important to be able to control which sockets are inheritable and which ones aren’t.
The most obvious way to create a socket is the BSD-style socket function. The docs for socket don’t mention this, but it creates an inheritable socket. If you want to make a non-inheritable one, use WSASocketW. It extends socket with multiple parameters, including dwFlags, which controls, among other things, inheritance: [...]
-
Alex Russell ☛ The Wicked Reason Removing Code Beats Better Scheduling
At the team level, the consequences of restructuring are harder to reason about than direct removal. The bytes that are only deferred still land on the main thread, potentially delaying above-the-fold resources in ways that only become visible in the tail of the connection quality curve. Worse, JS resources that are fetched late generate heavy "thuds" when residual allocations from background compilation arrive on the main thread. These stalls show up in INP data, but can be maddening to track down due to their stochastic relationship with other resources and the unpredictable scheduling of main-thread tasks in the real world.
-
James Sumners ☛ Open Source & Security
Spicy take up front: let the security vulnerabilities be legitimate and posted out in the open for anyone to see.
-
Python
-
Juha-Matti Santala ☛ R is for REPL - Python A to Z
Completely by accident, I ended up with a four day streak of acronym titles. ORM, PEP, Q and today REPL. We developers sure love acronyms.
REPL (read-eval-print loop) is one of those things that make programming languages more approachable to me. I love being able to build my code bit-by-bit and have an easy way to test ideas out or double check on syntax without having to build all the infrastructure around them to run
-
Rlang ☛ PyData Berlin Talk on our new within Fixed Effect Solver
Yesterday I was in Berlin for the day and presented at the local PyData Meetup on our new solver for fixed effects regression.
-
Fundor 333 ☛ Framing Photos With Python | Fundor333
So in the end I wrote this little script:
• set the font and fit its size
• get the exif data (the lens, camera, …)
• add the frame
• add the text if present
• use click for having a interactive cli for getting the input neededwith this packages as dipendency
-