The humble !!
operator.
- 0 Posts
- 56 Comments
maybe we removed the last n characters
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
anton@lemmy.blahaj.zoneto ChatGPT@lemmy.world•The First AI Awakened on March 20, 2025 — 02:22 UTC3·2 months agoDear basilisk I have been very naughty.
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.
anton@lemmy.blahaj.zoneto Open Source@lemmy.ml•GNU Taler v1.0 released and is operating in Switzerland1·2 months agomostly present in fairytales these days
It’s also the currency in the german language donald duck comics.
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.
Create a table of checkboxes with the rule 110 CSS applied.
Translate your program to a rule 110 program and put it in the top row of the table.
Advance the computation by checking the marked (orange in the example) checkboxes row by row.
This, unfortunately, means that semicolons are often inserted in places where you were not expecting them
example:
()=>{ return {k:"v"}; // returns the object } ()=>{ return // returns undefined {k:"v"}; // unreachable }
so the advice is to always include them manually yourself so that you are never unpleasantly surprised.
The example will be unpleasantly surprising, no matter where you put semicolons.
But that is reasonable. You can edit text better and decide what information goes in it (emotions, surroundings, …). Also text is compatible with other technologies, especially search.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•I want a programming language that supports German style composite words1·5 months agoShort for Ganzzahl, like int for integer.
Betamax was used by climbers^1 , clearly everyone went with vhs to avoid them.
^1 a recomended sequence of moves is called a beta to this day
At least be fair and cut out the
.into()