Marching Events: What does iCalendar have to do with ray marching?

https://news.ycombinator.com/rss Hits: 13
Summary

Recently I've been cursed blessed with the opportunity of implementing a library for operating on iCalendar files. If you haven't heard of them, you probably have - it's the format used to transfer e-mail RSVPs, to name a thing: Despite iCal's age - RFC 2245 is dated 1998, same as the Clinton-Lewinsky scandal - I think it's a Pretty Good Format™. It's reasonably easy to print and parse: BEGIN:VEVENT UID:1234-1234-1234-1234 DTSTAMP:20250608T160000Z DTSTART:20250628T160000Z DTEND:20250628T190000Z SUMMARY:Found some good candles in my neighbour's trash, gonna snort 'em. CATEGORIES:BUSINESS END:VEVENT ... and supports a ton of things - today the limelight shines on recurring events. I'm a simple boy - to me recurring means a simple thing like "every day" or "every week"; world ain't no simple place, though. every day every hour every week every second Monday every year starting from 2018-02-29 every last Wednesday of every third year every fourth Sunday every other January at 12:34:56 every last Tuesday every fifth month starting from 2018-03 at noon every last work day on each other month from 2018-04 onwards, unless it's 2018-01-01 How do we tame this? iCalendar proposes we define: FREQ, saying how an event repeats (hourly, daily, weekly, ...), DTSTART, saying from when an event repeats, ... and that's basically it, at least when it comes to required properties: FREQ=HOURLY;DTSTART=20180101T120000 -> 2018-01-01 12:00:00 -> 2018-01-01 13:00:00 -> 2018-01-01 14:00:00 -> [...] (yes, this blog is a proud user of the european date format - if you don't want to see yyyy-mm-dd's, please press alt-f4 and go back to boycotting bud light or something) We can also specify INTERVAL, which produces multiplies of the frequency: FREQ=DAILY;INTERVAL=3;DTSTART=20180101T120000 -> 2018-01-01 12:00:00 -> 2018-01-04 12:00:00 -> 2018-01-07 12:00:00 -> [...] But that's boring, that's something you could've come up with on your own - here's something fun: FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=1...

First seen: 2025-04-17 19:13

Last seen: 2025-04-18 07:15