Details
-
AboutAAAAAAAAAAAAAAAAAAA
-
SkillsRust and other things
-
Locationhere
-
Website
Joined devRant on 12/8/2018
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
I'm not allowed to post something in Reddit because not high enough reputation. So first, i have to say something that others LIKE?
Fine, first i'll sell my soul and then i'll keep posting stuff OTHERS like because else i can't post stuff anymore.
Oh my god, reddit, you really hate unqiue opinions, don't you.16 -
If you want to know how bad the job market is in India, a colleague told me that he got offered a job from an employer, where the condition is he has to give 20% of his paycheck back to the employer in their other bank account.8
-
Hey, been gone a hot minute from devrant, so I thought I'd say hi to Demolishun, atheist, Lensflare, Root, kobenz, score, jestdotty, figoore, cafecortado, typosaurus, and the raft of other people I've met along the way and got to know somewhat.
All of you have been really good.
And while I'm here its time for maaaaaaaaath.
So I decided to horribly mutilate the concept of bloom filters.
If you don't know what that is, you take two random numbers, m, and p, both prime, where m < p, and it generate two numbers a and b, that output a function. That function is a hash.
Normally you'd have say five to ten different hashes.
A bloom filter lets you probabilistic-ally say whether you've seen something before, with no false negatives.
It lets you do this very space efficiently, with some caveats.
Each hash function should be uniformly distributed (any value input to it is likely to be mapped to any other value).
Then you interpret these output values as bit indexes.
So Hi might output [0, 1, 0, 0, 0]
while Hj outputs [0, 0, 0, 1, 0]
and Hk outputs [1, 0, 0, 0, 0]
producing [1, 1, 0, 1, 0]
And if your bloom filter has bits set in all those places, congratulations, you've seen that number before.
It's used by big companies like google to prevent re-indexing pages they've already seen, among other things.
Well I thought, what if instead of using it as a has-been-seen-before filter, we mangled its purpose until a square peg fit in a round hole?
Not long after I went and wrote a script that 1. generates data, 2. generates a hash function to encode it. 3. finds a hash function that reverses the encoding.
And it just works. Reversible hashes.
Of course you can't use it for compression strictly, not under normal circumstances, but these aren't normal circumstances.
The first thing I tried was finding a hash function h0, that predicts each subsequent value in a list given the previous value. This doesn't work because of hash collisions by default. A value like 731 might map to 64 in one place, and a later value might map to 453, so trying to invert the output to get the original sequence out would lead to branching. It occurs to me just now we might use a checkpointing system, with lookahead to see if a branch is the correct one, but I digress, I tried some other things first.
The next problem was 1. long sequences are slow to generate. I solved this by tuning the amount of iterations of the outer and inner loop. We find h0 first, and then h1 and put all the inputs through h0 to generate an intermediate list, and then put them through h1, and see if the output of h1 matches the original input. If it does, we return h0, and h1. It turns out it can take inordinate amounts of time if h0 lands on a hash function that doesn't play well with h1, so the next step was 2. adding an error margin. It turns out something fun happens, where if you allow a sequence generated by h1 (the decoder) to match *within* an error margin, under a certain error value, it'll find potential hash functions hn such that the outputs of h1 are *always* the same distance from their parent values in the original input to h0. This becomes our salt value k.
So our hash-function generate called encoder_decoder() or 'ed' (lol two letter functions), also calculates the k value and outputs that along with the hash functions for our data.
This is all well and good but what if we want to go further? With a few tweaks, along with taking output values, converting to binary, and left-padding each value with 0s, we can then calculate shannon entropy in its most essential form.
Turns out with tens of thousands of values (and tens of thousands of bits), the output of h1 with the salt, has a higher entropy than the original input. Meaning finding an h1 and h0 hash function for your data is equivalent to compression below the known shannon limit.
By how much?
Approximately 0.15%
Of course this doesn't factor in the five numbers you need, a0, and b0 to define h0, a1, and b1 to define h1, and the salt value, so it probably works out to the same. I'd like to see what the savings are with even larger sets though.
Next I said, well what if we COULD compress our data further?
What if all we needed were the numbers to define our hash functions, a starting value, a salt, and a number to represent 'depth'?
What if we could rearrange this system so we *could* use the starting value to represent n subsequent elements of our input x?
And thats what I did.
We break the input into blocks of 15-25 items, b/c thats the fastest to work with and find hashes for.
We then follow the math, to get a block which is
H0, H1, H2, H3, depth (how many items our 1st item will reproduce), & a starting value or 1stitem in this slice of our input.
x goes into h0, giving us y. y goes into h1 -> z, z into h2 -> y, y into h3, giving us back x.
The rest is in the image.
Anyway good to see you all again.26 -
Why do we even have noses?
The current hole layout in human beings isn't efficient at all.
One hole input and one hole output should be enough for food, drink, air AND sex.17 -
Apparently, caffeine is now considered harmful.
Thanks, EU
(I know it mostly for pesticides/non-food right now)18 -
Funny, the president of the European commission, the old ministry of defense of Germany, is indicted for a corruption affair, she received below-the-table payment from the weapons industry.
She's also the one saying we should go to war with Russia.
How can you be that dumb13 -
Languages doesn't matter
C is Fast (also superior)
Rust is memory safe (and not bad too)
JavaScript is special in someway
C++12 -
Someone's asking how we should do things and I want to say fuck it we ball, but apparently I'm senior or something so gotta instead say "whatever you think is sensible" then get told I should give my own professional opinion but I also just don't care.
Sad day for avoiding responsibility.3 -
I opened devRant today and saw ostream call b2plane a "Manslut".
now I can't tell what's real or not real.11 -
I have the urge to write a torrent lib in Rust but I really have other priorities to take care of…14
-
Ostream did not ban himself! Haha, not able to post anymore now :P Don't worry, ostream and I are great friends. Will remove it :P8
-
Everyone heard of MERN stack have you heard of FUCK, SHIT and PORN stack?
When I build Low level app that required backend side I use the FUCK stack.
Flask
Uniapp
C/c++
Kotlin
For some LLM project I use PORN
PostgreSQL
OpenAI
Redis
Node.js.
and for some corporate project that requires OCR I use SHIT
Spring Boot
Helm
Interceptor
Tesseract
what stack do you use?8 -
Gpt 4.5 is out and it's only benefit is 'vibes'. Probably doubled down on being woke. Also, it's expensive as F. Pure to screw over stupid people who want to use newest without thinking. Btw, the people who present it in the openai video are terrible. They're just promoting the awkward unsocial stereotyped nerd. I don't believe those people really work on it. A true nerd always knows how to tell about their shit with detail and passion. That's what makes them a nerd, not being social awkward.
Fuck you OpenAI, in any way.6 -
Angular is a pile of dog shit.
Making web dev unbearable and harder since 2010 (or 2016 if you ignore AngularJS).
Fuck you, Miško Hevery5 -
yesterday couldn't sleep for the life of me. my brain was racing to the point of every thought being like a loud scrape upon my soul. then I realized I think this is anxiety
I had ordered some drugs and I bought CBD gummies with them to make the order over a certain amount. so I got these very strong CBD gummies, which taste really good, and turns out I can't even feel CBD at all when I eat it. I always assumed the slow-down after weed smoking was CBD but I don't even get that malaise thing
well I got distracted and stopped taking the CBD gummies regularly. I think last night I was in withdrawal from them. I might not feel them when I take them but I think I feel them when I'm withdrawing from them... on top of it nothing would calm me down; not exercise, not teas, not various herbal stuffs, etc. then I remembered the gummies and ate one and that did it
upside, I think I can now conclusively say I've never had anxiety. I interpret anxiety as increased awareness, flight of ideas, increased reaction speeds, like before an interview or meeting a new exciting person all my sense would get on alert. but this was different. I felt haunted, crazy, and there was nothing I could do. then it reminded me of people who I knew who were saying they had lots of anxiety. now I has proof I don't have anxiety as a person! no more being accused inappropriately and considering such, being all confused that maybe I just didn't have a working sensor for the state. now I knooowww