Live data from Hacker News

Ask HN: Did you encounter any leap year bugs today?

news.ycombinator.com

281–290 of 498 posts

Re: Ask HN: Did you encounter any leap year bugs today?

#282

Earlier quoted context omitted.

Haha, that would be quite the appropriate place to put one of those "Please wait and try again" error messages.

"look, today the math just doesn't work out, try tomorrow"

This is often the result of consulting an astrologer in Asia for a marriage date, to be fair.

Re: Ask HN: Did you encounter any leap year bugs today?

#284
post #276
post #268

Earlier quoted context omitted.

Is March more logical? Feb 29 + 1 year = Feb 28.

What’s the significance of 365? Each Earth year has just a smidge under 365.25 days.

365 days is what people commonly think of as a year. So if you're born Feb 29th and celebrate your birthday one year later (whether you call that 365 or 365.25), you land on Feb 28th. Then again, folks born between Jan 1 and Feb 28th of a leap year celebrate their birthdays 366 days later by calendar days.

Anyway, I'm not sure there's any more or less logical date to use and Feb 29th babies seem to choose both about equally:

> “I love when people ask me, ‘Do you celebrate on Feb. 28 or March 1?’” said Raenell Dawn, a co-founder of Honor Society of Leap Year Day Babies. “I get to tell them, ‘Both, because I can.’ But I’m a February baby; I was not born in March.” An informal poll of the society’s members showed about a 50-50 split between the two dates, said Ms. Dawn, who is celebrating her “Sweeter 16” by turning 64 this year.

https://www.nytimes.com/2024/02/28/style/leap-year-explained...

Re: Ask HN: Did you encounter any leap year bugs today?

#285

Earlier quoted context omitted.

> No, 2024 is not a leap year. Leap years are years divisible by 4, except for years that are divisible by 100 unless they are also divisible by 400. Therefore, the next leap year will be 2024.

As the proud new owner of a leap day baby, I find this to be extra hilarious

I was at the hospital and heard two babies being born. I love that music.

Re: Ask HN: Did you encounter any leap year bugs today?

#286

It's scary how much code out there is less than 4 years old, and even scarier how much of it is because someone decided to somehow rewrite it unnecessarily and thus introduce this bug. I don't even want to know how many people think the code they wrote will be in use for more than 4 years.

On the other end of the scale, the code base I worked on today has seen at least 7 separate leap days in production. Last week a manager asked if we expected any issues with the leap day, and we all just kind of laughed (and politely said no).

Re: Ask HN: Did you encounter any leap year bugs today?

#289
post #270

Earlier quoted context omitted.

ChatGPT is specifically bad at these kinds of tasks because of tokenization. If you plug your query into https://platform.openai.com/tokenizer , you can see that"egregious" is a single token, so the LLM doesn't actually see any "e" characters -- to answer your question it would have had to learn a fact about how the word was spelled from it's training data, and I imagine texts explicitly talking about how words are s…

> If you plug your query into https://platform.openai.com/tokenizer , you can see that"egregious" is a single token That says it's 3 tokens.

It doesn’t even matter how many tokens there is, because LLMs are completely ignorant about how their input is structured. They don’t see letters or syllables cause they have no “eyes”. The closest analogy with a human is that vocal-ish concepts just emerge in their mind without any visual representation. They can only “recall” how many “e”s are there, but cannot look and count.

Re: Ask HN: Did you encounter any leap year bugs today?

#290

Earlier quoted context omitted.

I'm sure it's more complicated than "we didn't think about leap years", but it certainly sounds pretty amateurish. Old programmer rant: In my day, we fixed the Y2K bug - we went to the future and back several times a day!

It does sound amateurish eh? I do most of my business logic inside Microsoft SQL Server Stored Procedure, and MS SQL just takes care of date pretty well. But then, come to think of it, you don't need to use SQL to have good date logic. C# and Java both have excellent date handing libraries. I don't know about C++, but I'd be surprised if there was not a modern date library for C++, so I am of the opinion there should…

Yes if you're writing your own date/time routines, dealing with dates as seconds since epoch, or anything like that you're going to get burned.

Use date handling functions and libraries that have been developed by people who know how to do it and have been battle tested.

Post reply on HN