641 karma · joined January 13, 2018
I'll do mine: there's likely a correlation between needing to maintain a professional conduct which includes forgoing foul language (you're programming at work) and writing code under time pressure where getting a product ready for release is more important than strict adherence to clean programming practice (you're programming at work).
Everyone post your favourite conjecture!
I started a project to implement a LZ77 decoder in Game Boy assembly to see if it could compress the sprites in Pokémon Red and Blue versions better than the algorithms actually used in the game. Results are inconclusive so far, but it's been an enlightening experience.
Looking forward to 3.7 where they finally address a glaring omission where up until now deities have been weirdly indifferent about people vomiting on altars.
The original code was like this:
if (x < 0)
return 0;
int32_t i = x * 0x1ff / 0xffff;
if (i >= 0 && i < sizeof(tab)) {
(x * 0x1ff / 0xffff) can only be negative if (x < 0), which can be ruled out because the function would have returned already, or if a signed overflow has occurred, which is undefined behavior so anything can happen. The compiler can remove the (i >= 0) check because the only way it's false is if undefined behavior has already been invoked.If you add the overflow check you quoted before the assignment, the compiler can still optimize away the (i >= 0) check like before with the same reasoning. Only this time the function will return before an overflow would occur.
The point of the "sledgehammer principle" described in the article is that UB checks must occur before the UB might be invoked and branch away. You obviously can't do this either:
int i = 2 / x;
if (i != undefined) {
return i;
}
return 0;
Instead, you'll have to do something like: if (x != 0) {
int i = 2 / x;
return i;
}
return 0;Ctrl+AltGr+8 is involved enough that I might as well press Esc.
A lot of software developers are unaware of the AltGr[1] key or even assume US ANSI layout altogether so as a user I have been trained not to take keybindings involving that layer for granted.
As a real world example of similar issues, there's piece of software (I think it was telnet or mosh, but I apologize if I misremember) where Ctrl+^ is used as an escape sequence. This doesn't work for me, possibly because caret is a dead key[2] on my keyboard. For some reason, perhaps related to using scancodes instead of key codes, Ctrl+6 happens to work in that application.
[1] https://en.wikipedia.org/wiki/AltGr_key [2] https://en.wikipedia.org/wiki/Dead_key
#include <stdio.h>
int main(int c,char** v){char*s="#include <stdio.h>%cint main(int c,char** v){char*s=%c%s%c;printf(s,10,34,s,34,10);}%c";printf(s,10,34,s,34,10);}
Surely this should count as a non-cheated quine? Still, parts of the code (namely, the contents of string s) are embedded directly in the binary: % clang -std=c99 -pedantic quine.c -o quine; strings quine | grep include
#include <stdio.h>%cint main(int c,char** v){char*s=%c%s%c;printf(s,10,34,s,34,10);}%c
Even though parts of the original source survive in the binary and are passed as pointers to a print function, the source code itself doesn't get read at compile or runtime (aside from being read once into the compiler).If it's OK to read parts of the loaded binary to use as strings, I don't see why it wouldn't be OK to read the whole loaded binary, as long as you touch the source code file. I'd simply accept that the platform allows for some fairly trivial quines.
1. Find physical disks that may be a part of a managed volume group/pool 2. Find logical volumes and file systems on the volume pools 3. Mount a filesystem by some configurable logic 4. Load and execute a kernel from the filesystem
Having to allocate the first "blocks" on the imaginary "sectors" of my SSD (or even worse, a virtual disk drive) for some arbitrary amount of space formatted in possibly the most barebones filesystem still in mainstream use feels quaint and irritating and limits my ability to use that disk in a larger storage pool.
UEFI is an overcomplicated specification with lots of wintel baggage, but most of it doesn't personally offend me. What does is that UEFI had the chance to abolish disk partitioning, but instead enshrined it. And added mandatory FAT32 to add insult to injury.
My main laptop and desktop each have a separate disk for the EFI system partition. The former uses systemd-boot and the latter ZFSBootMenu. This way I have a maximum of one partition per disk. It's not ideal, but I like it better than the usual solution.
The disks in my zpool show up as having partitions 1 and 9, but I consider that an implementation detail since I never need to treat the disks as anything other than entire disks in a pool
I don't think the mouse chording is that essential to Plan 9. It's how rio and acme work, but those programs can be replaced without throwing away most of the OS concepts. I think you could absolutely create a Plan 9 UI that, for example, uses vi-like key bindings to jump around windows and text. Nobody's just done it yet and hardcore users are happy enough with what they have for now.
The deal with patents is that you make the way your invention works public knowledge. You document the principle and in exchange you get a limited-time monopoly on its implementation. An alternative for this is a trade secret. As long as you guard the secret, you can remain the only one profiting off it. Of course, some things are impractical to keep secret. It's easier to keep a method of making a fizzy drink under wraps than how the gears are laid out in the gadget you sell.
You also can't really make the contents of a book a secret. Anyone can just look at their copy, arrange words in the same order as you did and sell your book. It also makes no sense to patent the words. The contents are already inherently public knowledge to a certain extent and now people could just buy the book from a patent office. And the clerks don't like filing novel-length applications. Music is not quite as easy to make a 1-to-1 copy of, especially before wide adoption of sound recording technology, but a lot of people can carry a tune well enough to plagiarize one. And sometimes you get a child prodigy Mozart illegally transcribing Miserere.
Since it has been deemed desirable [if not unanimously] that writers and artists also have a period of monopoly rights over their work, copyright needs to work differently from patents.
Software has interesting properties. Unlike a book, you can distribute a program but keep its "recipe" a secret. We'll disregard people who are capable of working with compiled binaries; consider them modern-day transcribers of Miserere. Proprietary code is typically guarded just as any trade secret would be. Perhaps software should have been covered by patents instead of copyright from the beginning. After the patent expires, the algorithm would be unencumbered and public knowledge.
But that's not the world we live in. Software is considered to be like a book, not like a pocket watch. You could mail me a printout of the entire Windows 11 source and there's hardly anything I could ever legally do with it. I could change it for my own amusement I guess, like I can take a red pen and change all the names in my copy of Postmodernism for beginners.
Most permissive licenses — and most popular permissive licenses — include a copyright statement and conditions which would not be enforceable without copyright. They usually require redistribution of the original copyright notice and license text to be distributed along with copies or derivatives of the work.
Most software licenses are not full carte-blanche do-whatever copyright waivers. Sure, it would be hypocritical to get up in arms about copilot emitting CC0/WTFPL/Unlicense code, but comparatively little software is released under such licenses.
The GPL (in all its versions) is almost as notable for the specific conditions placed on the freedoms it offers as it is for those freedoms themselves. One possible reason to release your code under GPL is that it you don't want your work used in proprietary developer tools. It doesn't really matter then if the code is used in a proprietary developer tool's training data set instead of its own program code.
Even permissive licenses typically come with some conditions attached. If I release a program under MIT license and someone then uses portions of that code in their own project, I expect to see my name and the MIT license included in some way. Perhaps a line in the README, an ACKNOWLEDGEMENTS.txt or a comment like
// This function taken from quuxifier (https://example.org/software/quux)
// ⓒ bitofhope 2022, used under the MIT license. See doc/licenses/MIT or
// https://spdx.org/licenses/MIT.html for details.
The same, in my opinion, applies if recognizable (for some definition and threshold of recognizable, which can and does get deep into lawyer territory) portions of that code are emitted by a convolution network. If Copilot can write my function, why can't it write my name and choice of license too?Even if you are a full copyright abolitionist, you can still point out the hypocrisy from the opposite side. Github's parent company Microsoft is notoriously protective of its proprietary code and its copyright. The company has historically been explicitly hostile to the free software community and despite its later unilateral declaration of love for open source continues to profit from their proprietary code, including Copilot. If you spend a decade or a few calling open source a cancer and campaigning against it, you can expect that to come bite you in the ass when you later try to sell a neural network trained on a vast corpus of free and open source software.
printf "WARNING: %s" "$warn_msg" >&3
But of course, nonstandard.I can't really see the difference. Adding a deprecation warning to stderr in a non-POSIX command 15 years after deprecation notice is among the smallest possible changes to [GNU's Not] Unix I can think of. Even then, the change is trivially silenced by deleting a single line in a shell script or two[1] and seems that some distros already do that for you[2].
Yes, this will break something for someone[3] and I might well be that someone. You truly have my sympathies. But if you want to run a system for a decade and a half without ever needing changes, stick to POSIX. You can't have your fossils and eat them too.
[1] https://git.savannah.gnu.org/cgit/grep.git/commit/src/egrep.... [2] https://github.com/void-linux/void-packages/pull/39340 [3] https://xkcd.com/1172/
┼─┼─┼─┼─┼─┼─┼─┼─┼─┼
... 0 1 2 3 4 5 6 7 8 9 ...
Any point on the line can be described by a single coordinate, so the line is one-dimensional.We could also describe all of them in terms of a two-dimensional plane [(0,0), (0,1), (0,2) etc.] but that would just be redundant. Just like representing the number line with a taller figure doesn't really make the abstract line any different:
│ │ │ │ │ │ │ │ │ │
┼─┼─┼─┼─┼─┼─┼─┼─┼─┼
│ │ │ │ │ │ │ │ │ │
... 0 1 2 3 4 5 6 7 8 9 ...
So for a single-pixel wide view of SMB from first person perspective, we could consider it a degenerate case of a 2D view if we indexed them (0,1), (0,2), (0,3)... but that would be redundant as they're sensibly just 0, 1, 2...Consider that any 2D image you see on your screen is just a single-pixel deep 3D image and a single-pixel 4D-protruding 4D image and so on.
A lot of tech involves interacting with data about people, so the software industry is affected by GDPR particularly hard. That's why you'll have a lot of people on a tech industry news website who may gave to consult a lawyer about the regulation.
Similarly, new traffic safety laws might have logistics companies seeking legal advice, health and safety regulations might have food companies doing the same or financial regulations might have any type of company ask a lawyer about the implications.
Besides, you might not be a layperson. There's a good chance if you frequent this website that you are a professional expert in different ways to store and use data for various purposes. In that case it might be a wise idea to take the time to learn your legal responsibilities with personal data to a slightly deeper standard than most people do.
In contrast, the GDPR does not place requirements for cookies if they're not used for storing or processing personal data (the ePrivacy directive which I'm less familiar with might require a notification about them). It does not even require a popup or user's confirmation if personal data is processed on a legal basis other than consent (though these uses may need to be listed in some kind of available privacy policy document). Finally, as GDPR is mostly technology agnostic, its requirements remain the same regardless of whether the data collection is done using cookies or any other means.
>If they asked anyone with atleast a minimal technical knowledge, they'd get a lot better solutions.
This sentence implies that: (1) Nobody with even minimal technical knowledge was consulted when writing GDPR. (2) The problem of websites tracking their users can be solved through technical means. (3) One or more of the solutions are so trivial anyone with minimal technical knowledge could come up with them.
I disagree with all of the above assertions.
No we can't. We can think of scummy adtech companies who feel entitled to their business model.
The GDPR very specifically says that the option to decline tracking must be at least as easily accessible as the option to accept.
The only way the EU is to blame for the pop-ups is that the regulation hasn't been enforced strictly enough.
It's also educational. Creating overpowered joke Civ4 mods and reading disassemblies of NES games to adjust numbers in an emulator's debugger make for fun semi-practical programming puzzles. Honestly, I think I enjoy the process of cheating more than the result.
Try it out sometime! Load up some old game in gdb and start messing with the numbers. It can be fun.
There is a chance (in my estimate, negligible) that my anecdote is an extreme outlier, but I still dare state with confidence that most forks today are designed in a way that less than 99% of users end up sticking them in their eyeballs.
People using forks for the unconventional and usually unintended purpose of impaling their eyes* are a tiny minority of fork users and thus changing fork designs to encourage the intended method of use is not considered a high priority. Most people are naturally disinclined to pierce themselves, particularly in such a delicate part of their face, and as such the design of a typical fork with its pointy tines directs users to avoid this particular usage mistake.
The thesis stated above in the thread was, that cryptocurrencies are very commonly used in a way that defeats their intended purpose of decentralization. It seems reasonable to assume there is a flaw in contemporary cryptocurrency implementations that encourages this kind of use, or at the very least, doesn't discourage it very strongly.
* Excluding specialized forks for non-mainstream audiences such as very young children
It seems a little unfair to call the board crappy. A lot of keyboards had a little bit of flex to them. Most modern keyboards (even premium ones) still flex a little bit. There were better -- or at least more solid-feeling -- keyboards around at the time, some of them more common and cheaper, but calling a Honeywell board "crappy" is just downright hyperbole.
I was under the impression that BI was a few years older than it is, so thanks for making me check. Actually, the fact it was made so recently and by people so familiar with the diversity of the genre makes me less forgiving of its weird specifics and priorities.
I do not and never did think Diablo single-handedly upended the definition, but I do believe it (and its sequel):
1) Took so many of its design elements from roguelikes that in the context of its time, it was not unreasonable to consider it a new take on that genre's formula
2) Was a major, if not definitive influence on many of the roguelites that would follow afterwards
Actually, if Hades and Angband were both called "diablolikes" instead, there would probably be much less fighting over it. ("Less" not implying none. Genres can always be fought over and naming genres after specific works rarely works well anyway)
As for Wizardry, EotB, Megami Tensei, I genuinely think they look closer to a quintessential roguelike than a lot of roguelites do. If those are the smart-ass edge cases, I'm pretty happy with my wording. I didn't even intend the description to be synonymous with roguelike, but "turn based dungeon crawler" seems to include almost all games I consider to be true roguelikes and less games I don't consider roguelikes than the most actual attempted definitions of roguelike I've seen around.
If it turns out that first-person dungeon RPGs with combat-specific interface are actually an especially prevalent subset of the turn-based dungeon crawler category, I might have to start differentiating the ones with top down perspective or non-modal gameplay. So far I haven't found that to be an issue.
Besides, many of those $10 games that are $30 on the Switch are made by smaller teams or even solo creators. Just because some video game properties have grown into giant franchises with multimedia companies pouring tens and hundreds of millions dollars and armies of people into them, that doesn't mean the majority of video game titles around are like that.
Come to think of it, in the light of the countless recent stories of overwork and abuse in the games industry and the scandalous quality issues plaguing high-profile releases in recent years, I'm not even sure if we should be incentivizing games having a lot of work go into them.
How come is it entitlement to not buy things that cost more than you think they are worth, anyway? Expensive things don't become cheap just because they're cheaper than four decades ago nor because they happen to be created and marketed by large corporations with lots of employees.