HNHacker News
TopNewBestAskShowJobs

kleiba2

657 karma · joined April 10, 2026

submissionscomments
kleiba2··on Needed 1+1, built a functional programming language
There are different ways on how to implement remove, but one way to do it is to overwrite the (key, value) pair to be removed with a special "tombstone" symbol that is different from null. Another way is to shift all elements with the same hash value as the one to be removed one index to the left, and null the final position.

There are cases where contains or get would have to iterate over the whole array, basically when all the previously added elements hash-collide, i.e., are mapped to the same start-index. But every hash-implementation has pathological cases where the access methods get slow -- but if the keys are sufficiently random, you don't expect such cases to occur in practice.

kleiba2··on Needed 1+1, built a functional programming language
Right, that's the beauty of this simple approach: there's only one array and it doubles as the storage for buckets. But yes, the table will have a maximum size after which you cannot add more entries. That is, in practice you would create a new hashtable with a larger capacity and rehash all the existing entries into the new, bigger table (in practice, you would do that even sooner than that, namely when a certain load factor is passed - see my previous comment where I alluded to the role of the load factor).

The cool thing, however, is: if the size of the new hashtable is double the size of the old hashtable, your amortized insertion costs are still only O(1)!

(And you don't just have to take my word for it: take my original comment and paste it into the AI interface of your choice and have it create a concrete implementation. Ask it to add a remove operation, and an automatic doubling of the array size + rehashing when the table reaches a load factor of, say, 0.7 -- the resulting code should be very manageable, and then you can run your own tests and measure times!

This is maybe not the smartest way to do hashing, but its appeal lies in its simplicity and hence compactness of implementation. There are many cases where you don't even need a 'remove' operation, and where you never have to worry about growing the array because you know that you're only ever going to hash a certain number of elements at most.)

kleiba2··on Needed 1+1, built a functional programming language
The expected or amortized complexity of the standard hash table operations (put, get, contains, remove) are all O(1) for linear probing (under the usual assumptions for the hash function and as long as the table does not get too full). Of course that doesn't shield a single operation from being O(n) in the worst case.
kleiba2··on Vermont replacing power plants with home batteries
Why downvoted?
kleiba2··on Vermont replacing power plants with home batteries
Taking out a window and putting the battery in front of where it used to be was no option, I suppose?
kleiba2··on When oil prices spike, where does the money go?
Maybe because "economists don't know what they're doing"?
kleiba2··on Needed 1+1, built a functional programming language
I always liked that idea of just doing a linear wrap-around sweep through an array that holds (key, value) pairs, until you find the pair with the key you're looking for (for 'get' or 'contains?') or an empty spot (for 'put'). The trick to make this fast is that the hash function (key -> int) tells you at which index to start the sweep.

No secondary data structures, super simple to implement, and it works great for small use cases.

kleiba2··on When oil prices spike, where does the money go?
I suppose one thing they're trying to express here is the idea of the equilibrium price of oil, by marking the intersection of the demand line with the two supply lines. However, why they are lines in this graph in the first place, or why they are located at these specific positions is unclear to me.
kleiba2··on When oil prices spike, where does the money go?
So you're reading it as a "prerequisite chart"? That seems odd because the common way to read graphs is that what's reported on the y-axis is a function of the values of the x-axis.

I find it also hard to read it that way when I look at that "Price in February -> Price in April" annotation: if those two points on the y-axis mark points in time, then so do the correlating points on the x-axis. I can only read that as "from February to April, the demand went up while the prices went down".

kleiba2··on When oil prices spike, where does the money go?
Can anyone explain how to read that first graph? Like, there's a line for demand, say, but given the axes labels, it seems to say "for greater demand, the price goes down", so the exact opposite of what basic price theory predicts.

Same for the supply lines, just the other way around.

Also, the use of straight lines indicates a linear relationship. Is that really the case in practice?

kleiba2··on When oil prices spike, where does the money go?
Spoiler alert: "But ultimately, the bulk of the money heads in the direction of the source of the oil itself – the oil companies. [...] The money largely goes to company owners – meaning shareholders"
kleiba2··on LinkedIn Larpmaxxing
The problem is really the unpredictability: some LinkedIn pages can apparently be accessed publicly without a login, others cannot. But perhaps that fact alone would be reason enough to block it entirely in Google searches?
kleiba2··on LinkedIn Larpmaxxing
I don't have a LinkedIn account and don't really care about it. The one thing, however, that bothers me to no end is all the many, many times when a LinkedIn page comes up near the top of the results to a Google query, then I click on it, and chances are I don't get to the actual information, but to the LinkedIn log-in page.

Not that I think that this is LinkedIn's fault, but I assume Google's rationale is that "everybody has a LinkedIn account" so it's fine to include result pages that cannot be accessed without one.

kleiba2··on Goodbye Google
There are deeply committed Catholics and deeply committed Protestants, as well as relatively nominal or culturally affiliated members of both.I think your statement that they "reject the theology" cannot be sustained, but it could be true that tradition plays a bigger role in Catholoicism, but protestantism itself certainly has its own traditions.

Taking one's religion seriously does not by itself constitute fanaticism. Flying a plane into a highrise because you think that is what your religion commands certainly is. That is not to say there aren't any Christian fundamentalists out there, there certainly are. But just because you do not relate to a religion, or religions in general, does not automatically make everyone who disagrees a fanatic.

kleiba2··on Google’s Project Suncatcher to put ML infrastructure in space
So I suppose recycling is not a thing in space?
kleiba2··on Goodbye Google
Your original statement was about "religious fanatics", not about normal. There are billions of people on this planet who are Christian and believe this or similar ideas. You may beg to differ but calling all of them fanatics might be a bit extreme, don't you think?
kleiba2··on Goodbye Google
I did read the article, but I'm still unclear about which parts lead you to that conclusion.
kleiba2··on Google’s Project Suncatcher to put ML infrastructure in space
Note how their cost comparison table mentions "launch" but not a word about how to retrieve systems parts after their end-of-life. "There's so much junk already circling around the planet, what does it matter if we'll leave it there to rot?" can't possibly be the stance they're taking.
kleiba2··on Goodbye Google
Not everyone who's religious is a fanatic.

The reverse also holds, btw.

kleiba2··on What happened to the Snowden archive
Related: what happened to Snowden?
kleiba2··on Fable 5 – Median thinking declined in August
> Could there be a benefit to releasing a new model, slowly dumbing it down over a couple months, then releasing a new model that’s marginally if at all better than the original to create a perceived improvement when in reality there isn’t really one?

Not unless your competitors do the same, or else you will only be perceived as falling behind others.

kleiba2··on Why I'm still bearish on LLMs after Navier-Stokes
Geez, why do you upper-case "LLM"?
kleiba2··on The Death of Shame Is Tearing Us Apart
I assume by "shame" they mean "manners".
kleiba2··on What algorithm did Windows XP use to choose your initial user picture?
On count == 1, the winner gets set to the first element, true. But the function does not return yet! So the value might get overwritten during the remainder of the for-loop.
kleiba2··on Oscar Winner Brings Monsters to Life with His Simulation Software
Another cool self-developed tool is the Mantis Motion Controller.

https://www.bfg-motion.com/

It's been developed by a cinematographer who specialized in stop-motion animation and other special effects, Melbourne-based Gerald Thompson [0]. In true amateur spirit, the above website is probably 90% stock content that he never bothered to remove (e.g., the "team" is just the generic placeholder garbage that came with the template). That might turn you off, but the product is so niche that I suppose there is no point in making a professional website for a wider audience.

The tool allows you reliably and repeatedly run your camera through predefined motion paths. That way, you could for instance overlay a real-time tracking shot with stop motion tech recorded in the studio - the camera can be positioned in the exact same positions and angles as during the live shot.

[0] https://www.imdb.com/name/nm2756662/

kleiba2··on Hackers had a live feed of every ID verification company scanned for over a year
And again, there will be no monetary consequences for the companies that failed to secure our private data.
kleiba2··on Tesla Begins Offering Rides in a Car Without a Steering Wheel
Why would you need a driver's license to ride in a cab?
kleiba2··on Volkswagen Plans to Cut 50k Jobs Amid Dire Need to Reduce Costs
Looks like the workforce is having to pay the price for management having missed both the transition to EVs and the competition from China...
kleiba2··on The shrinking landscape of linguistic diversity in the age of LLMs
It's not just LLMs that influence the otherwise natural development of human language, there's also intentional human efforts to that effect: where I live there is a very loud minority that is pushing very hard for change the spoken and written language to be more gender-inclusive.

While no-one wants to argue against more inclusiveness, it's more than questionable whether these artificial changes actually achieve that.

More importantly, though, according to polls, the vast majority of the population is against this, and yet, the proponents are very successful to establish this new artificial way of speaking and writing at core institutions, such as e.g. universities and news outlets.

kleiba2··on Poisson Disk Sampling
Possibly interesting post from Casey Muratori, regarding random placement of grass in games: https://caseymuratori.com/blog_0013, using blue noise.
Page 1 of 7Next →