- 10 Posts
- 171 Comments
sus@programming.devto
Programmer Humor@programming.dev•Something something history is a flat circle
4·6 months agobuffer overflows are critical for memory safety since they can cause silent data corruption (bad) and remote code execution (very bad). Compared to those a “clean” unhandled runtime error is far preferable in most cases.
We can avoid expensive branches (gasp) by using some bitwise arithmetic to achieve the so-called “absolute value”, an advanced hacker technique I learnt at Blizzard. Also unlike c, c# is not enlightened enough to understand that my code is perfect so it complains about “not all code paths returning a value”.
private bool IsEven(int number) { number *= 1 - 2*(int)(((uint)number & 2147483648) >> 31); if (number > 1) return IsEven(number - 2); if (number == 0) return true; if (number == 1) return false; throw new Exception(); }
After working at blizzard for 51 years, I finally found an elegant solution by using the power of recursion
private bool IsEven(int number){ if (number > 1) return IsEven(number - 2); if (number == 0) return true; if (number == 1) return false; }
funny how well this fits for both meanings
Yeah, it’s in my edit I realized the same thing. I’m thinking it doesn’t actually really make sense and the real reason is more “the specific way C does it causes a lot of problems so we’re not poking syntax like that with a 10 foot pole” + “it makes writing the parser easier” + maybe a bit of “it makes grepping easier”
So I think it’s still probably unclear to people why “mix of keywords and identifiers” is bad: it means any new keyword could break backwards compatibility because someone could have already named a type the same thing as that new keyword.
This syntax puts type identifiers in the very prominent position of “generic fresh statement after semicolon or newline”
…though I’ve spent like 10 minutes thinking about this and now it’s again not making sense to me. Isn’t the very common plain “already_existing_variable = 5” also causing the same problem? We’d have to go back to cobol style “SET foo = 5” for everything to actually make it not an issue
You can still be snobby by instead insisting on “fold, scan, iterate”
It’s a technicality about the pointer type. You can cast the type away which typically doesn’t change the actual value (but I’m pretty sure that causes undefined behavior)
For your example,
int x = 0xDEADBEEF;signifies the integer -559038737 (at least on x86.)char *p = (char*)0xDEADBEEF;on the other hand may or may not point to the real memory address 0xDEADBEEF, depending on factors like if the processor is using virtual or real addressing, etc
sus@programming.devto
Programming@programming.dev•Everything Started with the Promise of Loosely Coupled Systems
4·8 months agoLots of em-dash usage
Service goes down after emitting an event but before persisting internal state—causing partial failures that are hard to roll back.
Subscribe to an existing event and start processing—no changes to publishers.
Helps track a request across multiple services—even through async events.
We once had a refund service consume OrderCancelled events—but due to a config typo, it ignored 15% of messages.
Takeaway: fire-and-forget works—until someone forgets to monitor.
Use it when the domain fits—fan-out use cases, audit logs, or workflows where latency isn’t critical.combined with other chatgpt-isms like the heavy reliance on lists, yeah safe to say it’s mostly AI generated
What is mutually exclusive, though, is reality and China’s “imminent collapse” which has been looming just around the corner for the past 20 years
I actually kind of looked at (jpeg) compression artifacts, and it’s indeed true to the extent that if you compress the image bad enough, it eventually makes it impossible to determine if the color was originally flat or not.
(eg. gif and dithering is a different matter, but it’s very rare these days and you can distinguish it from the “AI noise” by noticing that dithering forms “regular” patterns while “AI noise” is random)
Though from a few tests I did, compression only adds noise to comic style images near “complex geometry”, while removing noise in flat areas. This tracks with my rudimentary understanding of the discrete cosine tranform jpeg uses*, so any comic with a significantly large flat area is detectable as AI based on this method, assuming the compression quality setting is not unreasonably low
*(which should basically be a variant of the fourier transform)
I recreated most of the comic image by hand (using basic line and circle drawing tools, ha) and applied heavy compression. The flat areas remain perfectly flat (as you’d expect as a flat color is easier to compress)

But the AI image reveals a gradient that is invisible to the human eye (incidentally, the original comic does appear heavily jpeg’d, to the point I suspect it could actually be chatgpt adding artificial “fake compression artifacts” by mistake)

there’s also weird “painting” behind the texts which serves no purpose (and why would a human paint almost indistinguishable white on white for no reason?)the new ai generated comic has less compression, so the noise is much more obvious. There’s still a lot of compression artifacts, but I think those artifacts are there because of the noise, as noise is almost by definition impossible to compress

The thing missing here is that usually when you do texture, you want to make it visible. The AI ‘watercolor’ is usually extremely subtle, only affecting the 1-2 least significant bits of the color, to the point even with a massive contrast increase it’s hard to notice, and usually it varies pixel by pixel like I guess “white noise” instead of on a larger scale like you’d expect from watercolor
(it also affects the black lines, which starts being really odd)
I guess it isn’t really a 100% proof, but it’s at least 99% as I can’t find a presumed-human made comic that has it, yet every single “looks like AI” comic seems to have it
I also noticed how it suddenly went from great to crap.
But the real reason I think is ironically AI. It used to be that you could easily crawl the web, but after the AI craze, images suddenly became valuable to crawl and every website gets bombarded by scrapers, and are adding more and more countermeasures to make it more difficult, so tineye’s own image scraper probably can’t compete with them and so can’t find any new images
I agree that the “arm things” are wrong, as it’s pretty clearly just an ‘artistic choice’ that a human could very much do.
But that said these images are 100% provable to be AI. If you haven’t built up the intuition that immediately tells you it’s AI (it’s fair, most people don’t have unlimited time for looking at AI images), these still have the trademark “subtle texture in flat colors” that basically never shows up in human-made digital art. The blacks aren’t actually perfectly black, but have random noise, and the background color isn’t perfectly uniform, but has random noise.
This is not visible to the human eye but it can be detected with tools, and it’s an artifact caused by how (I believe diffusion) models work
technically I guess it’s between Cosmic latte and Desert sand
…I had to look those up but it’s definitely not a plain white
well it’s supposed to be the “passive” you (or “indeterminate” you)
but I think anyone can learn to notice the pattern of comics with this particular odd color style (assuming you would want to learn it for some reason, and if we ignore color blindness or other similar problems etc)
the trick is of course to look for the most disliked comments. Here’s a couple
All humans are basically pure evil.
You are probably cruel and violent to vulnerable individuals more than three times a day.
Older men having sex with sexually mature teen girls is fine
DUI laws are too strict. It shouldn’t be all or nothing at .08 BAC but more severe punishments for more severe inebriation. .08 is pretty low and people who drink regularly can function fine at that level.
The Lemmy users who call themselves “Leftists” are garbage human beings
And most of them aren’t really that left. Trying to talk about abolition of police and prisons is something they would never agree to
wait, is this a roundabout way of calling yourself a garbage human being?
The new one by openai, “gpt-4o image generation”





Well eh, the binary seems to be about 130MB while the ffmpeg source repository is only 80MB (and the version with separate .so files (all part of the project as far as I can see) is even larger)