967 karma · joined Mar 25, 2011 (15y ago) · 336 submissions
34.
Show HN: HNSW index for vector embeddings in approx 500 LOC(github.com ↗)
73 points · by dicroce · 1y ago · 12 comments
comment 2y ago · link · parent
To me the more interesting question is how web server receive an incoming request. You want to be able to read the whole thing into a single buffer, but you don't know how long its going to be until you actually read some of it. I learned recently that libc has a way to "peek" at some data without removing it from the recv buffer..... I'm curious if this is ever used to optimize the receive process?
comment 2y ago · link · parent
comment 2y ago · link · parent
I now live in NY and I have a basement. It's generally about 10 degrees cooler. I would have loved that in Fresno.
comment 2y ago · link · parent
Also, a lot of the time it feels like the answer to most leetcode problem is some sort of trick.... and if you think of it you are golden and if you don't it sucks to be you. Most of the time I'm trying to write code that is NOT tricky... So in some ways I think the job itself will train you to seek simple clean solutions as opposed to tricks.
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
This all means we can implement indexes as b-trees where the keys are the values of a particular column and the value is the file offset of the row with that value. You could envision a simple db format where indexes and the main row file are stored in separate files. In such a database you could drop an index simply by deleting the indexes file (or add one by creating it). The main row file actually has all of the data and so indexes can be recreated if necessary (at expense of course).
comment 3y ago · link · parent
I think the neocortex for the most part lets other parts of the brain control themselves... and really only has high level access. I think emotions are one of these lower level semi autonomous subsystems... but so are things like autonomous body control, balance, each of the senses etc, etc... The neocortex is playing the "Human" video game and controlling things from a high level... but cannot directly control every aspect of these subsystems... and honestly, this is how complexity is dealt with (if the neocortex could control it all, the whats the point of the other subsystems)?
comment 3y ago · link · parent
"I don't know how to do X, Y and Z."
Before I begin working on the real solutions for X, Y & Z I start by making a test program that does X. It's ok if it requires a ton of scaffolding, or canned data... the important thing is to do X. Then I do the same for Y & Z.
Now that I understand the problem I do a software design. I do this on paper and I purposely do it super quick and not caring about how neat it is... and I throw away designs rapidly as I iterate and improve. Eventually the paper crumbling slows down and I approach a real design.
This is finally the point that I can write "real" code. The unknowns are gone and all the software design iteration happened on paper.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent