Comment

Comment by LarryMade2

I don't think it's complicated but I think it simplifies a complex problem I had.

A thing for storing and comparing schedules

a weekly schedule is turned into a run-length list (the week is in minutes 0 to 10079 - so 540,1020,1980,2460 would be 9am to 5pm on Sunday and Monday). Makes it easy to unpack the list into an array and do basic math comparison can determine whether schedule A is within schedule B or get the difference in minutes that schedule A falls outside of schedule B etc.

I would say the most complicated ones I've done are some SQL queries where I had to break it into stages to reduce the amount of grinding it did on a query that was combining many tables.

parent LarryMade2 8 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton