HNHacker News
TopNewBestAskShowJobs

stanmancan

2,441 karma · joined November 21, 2010

submissionscomments
stanmancan··on Ask HN: We just had an actual UUID v4 collision...
Plenty of systems end up generating multiple UUID's in a single millisecond.

The issue with UUIDv7 is that you also have significantly less entropy since you only have a 62 bits (sometimes less, depending on implementation) of "random" data. So while the time aspect of format lowers the chances of collisions, generating two UUIDv7's in the same millisecond (depending on implementation) have a significantly higher chance of collision than two UUIDv4's.

It's still incredibly unlikely, but it's also incredibly unlikely you generate two matching UUIDv4's, but it does happen.

TLDR; It's possible to generate matching UUIDv7's, don't assume otherwise.

stanmancan··on Ask HN: We just had an actual UUID v4 collision...
The scenario being the collision itself, the time period isn’t particularly relevant aside from it occurring much quicker than expected.
stanmancan··on Ask HN: We just had an actual UUID v4 collision...
I left a more detailed comment on the parent, but it's definitely not impossible!
stanmancan··on Ask HN: We just had an actual UUID v4 collision...
It's still possible in most implementations of UUIDv7.

UUIDv7 assigns the first 48 bits for the timestamp in milliseconds. You can generate a lot of UUID's in a millisecond though!

Then you have another 12 bits that you can use as you wish; "rand_a". The spec has a few methods they suggest on how to use these bits including 12 bits of random data, using it for sub-millisecond timestamps, or creating a monotonic counter, but each have their downsides:

- Purely random data means you can still run into collisions and anything within the same millisecond is unordered

- Sub millisecond you can run into collisions; there's nothing stopping you from generating two UUID's with the same 62 bits of rand_b data in the same sub-millisecond timestamp.

- Monotonic counters can overflow before the next tick, then what? Rollover? Once you roll over it's no longer monotonic and you can generate the same random data within the same monotonic cycle. Also; it's only monotonic to the system that's generating the UUID. If you have a distributed system and they each have their own monotonic cycles then you'll be generating UUID's with the same timestamp + monotonic counter, and again, are relying on not generating the same random data.

You can steal some of the 62 bits in rand_b if you want as well; you can use rand_a for sub-millisecond accuracy, and then use a few bits of rand_b for a monotonic counter. There's still a chance of collision here, but it's exceedingly low at the expense of less truly random data at the end.

If you want truly collision free, you'd also need to assign a couple of bits to identify the subsystem generating the UUID so that the monotonic counter is unique to that subsystem. You lose the ordering part of the monotonic counter this way though, but I guess you could argue that in nearly 100% of cases the accuracy of sub-millisecond order in a distributed system is a lie anyways.

stanmancan··on AI chatbots could be making you stupider
Unfortunately people are inherently lazy. Curious and driven indivdiuals will excel with the availability of LLM's, but the majority will atrophy.
stanmancan··on Why LLM-Generated Passwords Are Dangerously Insecure
Obligatory https://xkcd.com/221/
stanmancan··on MacBook Neo
I'm going to give Apple the benefit of the doubt here until proven otherwise. I can't see them releasing something with a terrible user experience as it would cause a lot of reputational harm.
stanmancan··on MacBook Pro with M5 Pro and M5 Max
It's cheap for what you get.

If you just need "a small box to make API calls and do minimal local processing" you an also just buy a RPI for a fraction of the price of the GMKtec G10.

All 3 serve a different purpose; just because you can buy a slower machine for less doesn't mean the price:performance of the M1 Mac Mini changes.

stanmancan··on America's pensions can't beat Vanguard but they can close a hospital
> Because the taxpayers bail them out. I could define anything as not being risky if I knew taxpayers would bail it out.

I feel like I must be misunderstanding something here because it sounds like you're saying depositing funds in a bank is considered risky behaviour?

stanmancan··on Bunny Database
The vast majority of products with paying customers need better availability than “database went down on Friday and I was AFK until Monday, sorry for the 3 day downtime everyone”
stanmancan··on Mobile carriers can get your GPS location
To be honest I thought OP said they lived in an apartment; a house is a different story.
stanmancan··on Mobile carriers can get your GPS location
Occams razor
stanmancan··on Mobile carriers can get your GPS location
Did the sisters know where you lived? Curious if the police provided them with an area and the sisters were able to give a proper address?
stanmancan··on Amazon braces for another major round of layoffs, 14,000 jobs at risk
Yes that’s how jobs work; you go to work, do your job, try not to get fired, and get paid for the work you do.

Is that supposed to be a bad thing?

stanmancan··on Anthropic Explicitly Blocking OpenCode
Switching models is too easy and the models are turning into commodities. They want to own your dev environment, which they can ultimately charge more when compared to access to their model.
stanmancan··on Apple Creator Studio
Parent isn’t insinuating otherwise. They’re saying the subscription model is more lucrative, so eventually they’ll remove the one time payment option, but keeping it as an option for the announcement keeps the bad PR at bay.
stanmancan··on I migrated to an almost all-EU stack and saved 500€ per year
How so?
stanmancan··on I migrated to an almost all-EU stack and saved 500€ per year
“Worse” is fully dependant on what you’re looking to get out of a product. I consider anything Google/Meta to be about as bad as it gets because I disagree with their business practices and value my privacy.
stanmancan··on I migrated to an almost all-EU stack and saved 500€ per year
It’s far from impossible, you just have to prioritize your privacy at more than a few bucks a month.
stanmancan··on I tried Gleam for Advent of Code
There's certainly a lot more JS code out there to train on, but the quality of the Elixir code is likely overall much better.
stanmancan··on Personal blogs are back, should niche blogs be next?
You use AI to write your blog?
stanmancan··on Elixir 1.19
I don’t understand why people drink orange soda. If you want something orange flavoured, eat an orange! If you want something bubbly, drink soda water!

.ex compiles to beam files to be run later

.exs compiles to memory

You don’t need to know Erlang to use Elixir; I’m a few years in now and I’ve never had to write any Erlang.

stanmancan··on Ask HN: Can't get hired – what's next?
After reading your replies here it seems like your attitude might be a contributing factor in your inability to pass interviews.
stanmancan··on Expert: LSP for Elixir
Yup
stanmancan··on Toyota is recycling old EV batteries to help power Mazda's production line
Turns out they're lasting much longer than expected: https://news.stanford.edu/stories/2024/12/existing-ev-batter...
stanmancan··on Do things that don't scale, and then don't scale
1,000 is way too many. Low hundreds max.
stanmancan··on Show HN: 1 Million Rows
I know why you're doing it; I'm just not sure what I'm looking at. I'm not sure if this is supposed to be a product, but right now it's literally just a paginated HTML table?
stanmancan··on Show HN: 1 Million Rows
Not 100% sure what I'm looking at here? Am I missing something or is it just table of data with an "infinite scroll" that loads 200 records at a time?
stanmancan··on NASA finds multi-billion-year-old 'coral' on Mars
Original title is clickbait.

"NASA finds another coral-like rock on mars"

stanmancan··on GPT-5
> Yeah, the explanation is just shallow enough to seem correct and deceive someone who doesn't grasp really well the subject.

This is the problem with AI in general.

When I ask it about things I already understand, it’s clearly wrong quite often.

When I ask it about something I don’t understand, I have no way to know if its response is right or wrong.

← PreviousPage 2 of 21Next →