2,676 karma · joined Nov 28, 2019 (7y ago) · 1,131 submissions
comment 2y ago · link · parent
What I was getting at is that there's only so much energy a field can put into a particle. Either the voltage will drop because the machine can't "keep up," or the particle will reach a terminal velocity where the force applied by the field is insufficient to accelerate the particle any more. But, barring those two things, the particle will continue to accelerate.
comment 2y ago · link · parent
[1]: https://www.reddit.com/r/git/comments/wk2kqy/delete_files_un...
comment 2y ago · link · parent
Use git to manage versions of the static files.
Use [git worktree][1] to have multiple separate working trees in different directories.
Use [openat()][2] in your app whenever serving a request for a static file. On each request, open the directory, i.e. `/var/www/mysite.com`, and then use `openat()` with the directory's file descriptor when looking up any files under that directory.
`/var/www/mysite.com` is a symbolic link to some working tree.
When modifying the site, make modifications to the git repository. Then check out the modified working tree into a new directory.
Create a symbolic link to the new directory and `mv` (rename) it to `/var/www/mysite.com`.
Then some time later, `rm -r` the old working tree.
[1]: https://git-scm.com/docs/git-worktree
[2]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/o...
comment 2y ago · link · parent
I know almost nothing about particle physics.
comment 2y ago · link · parent
My thought (which is apparently wrong) is that the `const int& x` refers to memory that might be freed during `vector::push_back`. Then, when we go to construct the new element that is a copy of `x`, it might be invalid to read `x`. No?
Is this related to how a reference-to-const on the stack can extend the lifetime of a temporary to which it's bound? I didn't think that function parameters had this property (i.e. an implicit copy).
comment 2y ago · link · parent
The "Server" class, or whatever instantiates the Logger, will have to change, but that might not be such a big deal.
So yes, the author was wrong about not having to modify any code, but likely you won't have to modify most code.
comment 2y ago · link · parent
Well, except for that one major outage where everything shit the bed due to some misconfiguration of IP multicast in the datacenters, or so I was told.
So, maybe if your mission isn't life critical, you can just wrongfully assume exactly-once delivery.
[1]: https://en.wikipedia.org/wiki/Pragmatic_General_Multicast
comment 2y ago · link · parent
Yes, let's be considerate and not use these features. But then we must agree on the specifics of the subset. If we're going to do that, then let's just learn the language proper instead. Or, avoid shell scripts entirely.
Maybe there's an analogy with writing prose. I _could_ use rare words and uncommon syntax, but the modern style is a better approach. Is "abstruse" a rare word? Will a reader be frustrated to necessarily learn about split infinitives? What about I/O redirection at the beginning of a command?
comment 2y ago · link · parent
# Open foo.txt and use it as fd 0 in jq
<foo.txt jq '[1,2,3]'
# Create a pipe(). Use the write end as cat's fd 1 and the read end as jq's fd 0
cat foo.txt | jq '[1,2,3]'
Best thing would be a directed graph where each node is a process or a file. A process has at most one edge going into it (stdin) and at most two coming out (stdout and stderr). A file has exactly one edge touching it.Hard to do in text, though. Would look like lisp.
comment 2y ago · link · parent
Shell has tricky and arcane corners that are best to avoid, but you still do better to know about them, lest they bite you (shellcheck helps).
I don't think that "I/O redirection can precede the command name" is particularly tricky or arcane.
What bothers me is that it doesn't work with loops:
<input.txt while read -r line; do thing; done # error
while read -r line; do thing; done <input.txt # fine
The shell's grammar is quite a thing.comment 2y ago · link · parent
Many Github issue threads that I read are incomprehensible. The thread is not where the story is (it's in the memories of the people involved). Explaining is work. This is why they make kids write reports as assignments in school.
comment 2y ago · link · parent
Nope.
I'm only 35, but within my career I saw "developers" become "engineers" because that's what Facebook and Google were doing.
Titles never meant anything. Today, they're a class-like system for labeling pay in large organizations.
You can't address title inflation. Years ago, I interviewed at Subway for the position of "sandwich artist." I thought it was cute, but the person who interviewed me seemed to take the title quite seriously.
If you get hired as a Principal Wizard Non-Commissioned Bit Slayer, good for you. The title will be used to justify your pay to coworkers and future employers. Maybe you're a wizard bit slayer, and maybe you're not.
comment 2y ago · link · parent
If my string is "aaaa", does that mean its entropy is zero? There is at least information about its length. And by your definition, how do we know that this password isn't from a 256 character set? Does "Aaab" have 26 times the entropy of "aaab"?
Topics like this make more sense to me when the strings are infinite, or when the population of strings is known.
comment 2y ago · link · parent
You're right, it is a matter of culture and discipline. It's much harder to maintain a consistent and legible theory of a software component than it is to wing it with your 1-2 other teammates. Naming things is hard, especially when the names and their meanings eventually change.
comment 2y ago · link · parent
But then I realized that a lot of what makes a set of tests good documentation is comments, and those rot, maybe worse than dedicated documentation.
Keeping documentation up to date is a hard problem that I haven't yet seen solved in my career.
comment 2y ago · link · parent
A lot of stuff in the C++11 standard library was based on widespread use of Boost. Since then, I don't know. Also, were things like templates and lambdas implemented as compiler extensions before standardization? I don't know, but I doubt it. Maybe "we're a committee of people who will decide on a thing and we hope you like it" was always the norm in many ways.
comment 2y ago · link · parent
It's telling that every compiler toolchain that compiles C++ also compiles C (for some definition of "C"). With compiler flags, GCC extensions, and libraries that are kinda-sorta compatible with both languages, there's no being strict about it.
_My_ code might be strict about it, but what about tinyusb? Eventually you'll have to work with a library that chokes on `--pedantic`, because much (most?) code is not written to a strict C or C++ standard, but is "C/C++" and various extensions.
comment 2y ago · link · parent