Considering a generic function, that accepts a count of numbers (usual + - * / algebra) and returns their average (sum over count), what requirements make sense to be imposed on the number to allow division by count?
(count is 2 in example pseudo code)
1. explicit construction from a single natural number:
(n1 + n2)/number(2)
2. straight up a division operator that accepts a natural number as second argument:
(n1 + n2)/2
3. multiplication identity constructor/value that can be accumulated (using addition) to reach count:
(n1 + n2)/(number::one + number::one)
4. addition operator that accepts a natural number as second argument (assuming zero/default constructor available):
(n1 + n2)/(number() + 2)
#cpp #programming #generic_programming
@fedisearch where is the source code?
#xoshiro is a family of #publicdomain (#CC0) pseudorandom number generators.
xoshiro (xor-shift-rotate) and #xoroshiro (xor-rotate-shift-rotate) are public domain #algorithms that shift state to produce very random numbers at high speeds suitable for insecure applications. The algorithms only use a few bytes of state and are suitable for embedded applications which require good pseudorandom numbers.
Website 🔗️: http://prng.di.unimi.it/
here is the code https://codeberg.org/tuxcrafting/sndshooter
To a profession that is 90% naming, lerp is an embarrassment. What shall I call it instead?
map(zero, one, value)
progress(begin, end, amount)
way(from, to, ratio)
linin(hammer, sickle, stilin)
/* had to put these here cause of stupid character limit on poll options */
None of you understand my plight...
how do YOU split?
me - next time, can we make something at least remotely tangible?
brain - what's the fun in that?
me - how did we even get here?
brain - long story, but basically you lied and we had to fix things to make your lies true.
me - :|
brain - :|
me - >:(
unsightly happenings
Here you go voter:
https://notabug.org/namark/libsimple_geom/src/master/unit_tests/bool_algebra.cpp
From the depths of the metaprogramming abyss, where compiler bugs dwell, through relentless perversion emerges an abomination of your choosing. If this all goes horribly wrong, I will blame you, even though you were not paid for this.
c++ obstacle course
Try to write transparent wrapper using implicit conversion ->
-> templates don't pick it up, cause type deduction -> fix with metamagic ->
gcc rejects valid >~<
http://ix.io/2nlC/cpp
Isolate, work around.
Add an innocent constant variable -> clang segmentation faults x_x
http://ix.io/2nlF/cpp
power through without the quality of life constant.
Brag about bugs you found.
Feel alive.
long complicated poll, you will not be paid for this
For a vector of booleans representing a disjunction, considering these 3 binary operations:
1. Reducing conjunction. Reduces both operands and return the conjunction as a single boolean. Trivial, logical and sane.
2. Expanding conjunction. Returns a matrix representing a disjunction of conjunctions of all pairings of element from each operand (kind of a halfway symbolic computation). Somewhat complicated (essentially matrix multiplication), but still logical, if a bit insane.
3. Element-wise conjunction. Returns a vector containing the conjunction of corresponding elements of two vectors. This vector no longer represents a disjunction unless explicitly converted to original type. Kind of a masking operation. Illogical and insane.
Which operator would you prefer for each?
After encountering a public domain tileset on itch.io that appealed to me so much that I'm now considering experimenting with game development, I decided to start compiling a list of game assets on Itch.io that are under Debian-compatible licensing terms.
(i.e. Not the usual "don't redistribute or sell alone or in assets packs" terms which violate the FSF, OSI, and Debian definitions of Free and/or Open.)
https://itch.io/c/845926/libre-game-assets
(The description also lists other sources like OpenGameArt.)