At least be fair and cut out the .into()
- 0 Posts
- 33 Comments
The humble
!!
operator.
maybe we removed the last n characters
anton@lemmy.blahaj.zoneto Programming@programming.dev•Published for the first time: the Princeton INTERCAL Compiler's source code8·28 days ago(LT(PL * 5,DO) ERROR('079','USER IS NOT SUFFICIENTLY POLITE','1')) (GT(PL * 3,DO) ERROR('099','USER IS OVERLY POLITE','1'))
Finally, we know how polite to be.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Python needs an actual default function3·1 month agoIf you want to have a library that can also be a standalone executable, just put the main function in an extra file and don’t compile that file when using the library as a library.
You could also use the preprocessor to do it similar to python but please don’t.Just use any build tool, and have two targets, one library and one executable:
LIB_SOURCES = tools.c, stuff.c, more.c EXE_SOURCES = main.c, $LIB_SOURCES
Edit: added example
To my understanding, the original meaning of object oriented is more similar to what we call the actor model today.
In reference to the modern understanding of OO, js uses prototypal inheritance, which some consider closer to the original vision.
That boolean can indicate if it’s a fancy character, that way all ASCII characters are themselves but if the boolean is set it’s something else. We could take the other symbol from a page of codes to fit the users language.
Or we could let true mean that the character is larger, allowing us to transform all of unicode to a format consisting of 8 bits parts.
That requires some form of self describing format and will probably look like a sparse matrix in the end.
It might also introduce spurious data dependencies
Those need to be in the in smallest cache or a register anyway. If they are in registers, a modern, instruction reordering CPU will deal with that fine.
to store a bit you now need to also read the old value of the byte that it’s in.
Many architectures read the cache line on write-miss.
The only cases I can see, where byte sized bools seems better, are either using so few that all fit in one chache line anyways (in which case the performance will be great either way) or if you are repeatedly accessing a bitvector from multiple threads, in which case you should make sure that’s actually what you want to be doing.
C/C++ considers an nonzero number, as your true value but false is only zero. This would allow you to guard against going from true to false via bit flip but not false to true.
Other languages like rust define 0 to be false and 1 to be true and any other bit pattern to be invalid for bools.
Don’t worry, I have this rock that repels
tigerslions.
anton@lemmy.blahaj.zoneto furry_irl@pawb.social•Etiquette_irl (Art by ShepGoesBlep)English1·2 months agoNow you need to perform random exponential backoff.
anton@lemmy.blahaj.zoneto Programming@programming.dev•Any suggestions for a self-hosted CI that can also be run locally?1·3 months agoI think there is a misunderstanding, what running locally means.
You can run a gitlab runner on your local machine, but it needs to pulls it’s jobs from git. It also requires gitlab to register your runner, so it can’t really work for new contributors to use themselves.
anton@lemmy.blahaj.zoneto Programming@programming.dev•Any suggestions for a self-hosted CI that can also be run locally?31·3 months agoRun your CI in a sandbox.
For example gitlab allows you to run in a docker image.
Unless the attacker knows a docker CVE or is willing to waste a specter style 0-day on you, the most they can do is waste your cpu cycles.
anton@lemmy.blahaj.zoneto Programming@programming.dev•Linus Torvalds built Git in 10 days - and never imagined it would last 20 years1·3 months agoApart from the obvious lack of portability, compilers write better assembly than most humans.
anton@lemmy.blahaj.zoneto Programming@programming.dev•Malicious VSCode extensions infect Windows with cryptominers6·3 months agoMaybe to build one of those shitty websites where you can’t select text because every letter is in its own element.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Synapse is the epitome of this3·3 months agoUps, my attention got trapped by the code and I didn’t properly read the comment.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Synapse is the epitome of this2·3 months agoNow do computation in those threads and realize that they all wait on the GIL giving you single core performance on computation and multi threaded performance on io.
I like self directed research, it’s mostly rust stuff, but has some really interesting topics mixed in.