Show newer

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)

namark boosted

#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 🔗️: prng.di.unimi.it/

#free #opensource #foss #fossmendations #RNG #programming

namark boosted
namark boosted
namark boosted

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 */

alright so this is a lerp, all fine, no complaints here
x * a + y * (1 - a)

but what a lerpaderp is this?
x * a + (1 - x) * (1 - a)

namark boosted

Requiring a backdoor for encryption won't stop any cyber-related crime. Encryption is just math. You can't put a math genie back in a bottle for a whole society.

namark boosted

carpenter: builds and sells table
murderer: buys table
carpenter: sent to prison for a lifetime per table leg
justice: is served
murderer: enjoys table

remember kids, specialization is crime

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 - >:(

Show thread

unsightly happenings 

Here you go voter:

notabug.org/namark/libsimple_g

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.

Show thread
namark boosted
@georgia @Rude @alex @crunklord420 @dielan @kfist @rin
>broke: watching star wars in 2020
>woke: not watching star wars
>bespoke: reading Euclid's Elements instead of watching films

https://mathcs.clarku.edu/~djoyce/java/elements/toc.html
CC @namark

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 >~<
ix.io/2nlC/cpp
Isolate, work around.

Add an innocent constant variable -> clang segmentation faults x_x
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?

namark boosted

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.)

itch.io/c/845926/libre-game-as

(The description also lists other sources like OpenGameArt.)

Show older
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.