Dates are hard embedded systems substraction



  • In A.D. 1582 Pope Gregory XIII found that the existing Julian calendar
    insufficiently represented reality, and changed the rules about
    calculating leap years to account for this. Similarly, in A.D. 2013
    Rockchip hardware engineers found that the new Gregorian calendar still
    contained flaws, and that the month of November should be counted up to
    31 days instead. Unfortunately it takes a long time for calendar changes
    to gain widespread adoption, and just like more than 300 years went by
    before the last Protestant nation implemented Greg's proposal, we will
    have to wait a while until all religions and operating system kernels
    acknowledge the inherent advantages of the Rockchip system. Until then
    we need to translate dates read from (and written to) Rockchip hardware
    back to the Gregorian format.

    This patch works by defining Jan 1st, 2016 as the arbitrary anchor date
    on which Rockchip and Gregorian calendars are in sync. From that we can
    translate arbitrary later dates back and forth by counting the number
    of November/December transitons since the anchor date to determine the
    offset between the calendars. We choose this method (rather than trying
    to regularly "correct" the date stored in hardware) since it's the only
    way to ensure perfect time-keeping even if the system may be shut down
    for an unknown number of years. The drawback is that other software
    reading the same hardware (e.g. mainboard firmware) must use the same
    translation convention (including the same anchor date) to be able to
    read and write correct timestamps from/to the RTC.



  • So, Rockchip developers regard themselves holier than the Pope himself?



  • Are they serious?

    //Mark on calendar the day after Nov 30, 2016 midnight is another Y2K, where light may go out, planes may fall and stock market may shock.



  • @cheong said:

    Are they serious?

    Judging by the commit message, not very...


  • Winner of the 2016 Presidential Election

    @cheong said:

    //Mark on calendar the day after Nov 30, 2016 midnight is another Y2K, where light may go out, planes may fall and stock market may shock.



  • Dates are :yum: (if not soiled with glucose syrup)

    The main advantage of standards seems to be, you can always add a new one. (Obligatory xkcd reference left as an exercise to the reader.)

    But honestly, I wonder why the heck they didn't go the whole way: Months with even indices (0, 2, 4, ..., that is, Jan, Mar, May, ...) get 30 days each, and months with odd indices (1, 3, 5, ..., that is Feb, Apr, Jun, ...) get 31 days each, except Dec, which gets 30 days, except in leap years, where it gets 31 days.



  • Emmm... from Reddit, if I'm reading it correctly, it's the Rockchip chips will generate 2016-11-31 as valid date?

    If that's true, it's really a :wtf: .



  • @Buddy said:

    and just like more than 300 years went by before the last Protestant nation implemented Greg's proposal

    Inb4 that there were several "Protestant" movements before Augustinian monk Martin Luther , butTIL that Soviet Russia was a Protestant nation as well. (Probably good, that the Orthodox church was reformed, too.)

    @cheong said:

    2016-11-31 as valid date?

    Not a shbit more weird than 2016-02-30 not being one.



  • The 0-based indices threw me off a bit, but that's exactly what we should do. It would make calculating number of days so much simpler.



  • Mayans had it all figured out. Today is 13.0.3.0.15.



  • @PWolff said:

    Not a shbit more weird than 2016-02-30 not being one.

    Not as weird as Nov 31 in some sense.

    Generate Feb 30 as valid date is plain laziness (not checking for Feb date rule). Generate Nov 31 without generating April 30 does sound like some sort of other problem.



  • Yes. Once the February rules are established.

    But whenever someone suggests to change a rule, I'm used to ask whether we couldn't follow that path a bit further. In this case: if we change the number of days of any month, why shouldn't we revoke those pesky exceptions for February, while we're at it?



  • The elephant in the room here is:

    As an Quite Interesting diversion (sans one box):



  • @Buddy said:

    In A.D. 1582 Pope Gregory XIII found that the existing Julian calendarinsufficiently represented reality, and changed the rules aboutcalculating leap years to account for this.

    Damn @julianlam doing it wrong again



  • @cheong said:

    Are they serious?

    I dug it a bit, and they are, it's a workaround for a bug in some chip.

    From Julius Werner Subject [PATCH] RTC: RK808: Work around hardware bug on November 31st Date Wed, 2 Dec 2015 17:53:04 -0800

    In Fuzhou, China, the month of November seems to be having 31 days.
    That's nice and all (I'm sure you can get a lot more done in a year that
    way), but back here in other parts of the world we are not so lucky.
    Therefore, if we read that date from the RTC we should correct it to
    December 1st.

    This is not a full workaround. Since the RTC actually ticks all the way
    through that imaginary day, there's no easy way to detect and correct
    this issue if the device was offline the whole time and allowed it to
    tick through to December 1st on the Rockchip calendar (which would be
    December 2nd on the Gregorian one). Those edge cases can only really be
    solved by regularly syncing to an external time source (e.g. NTP).



  • You know all those occasions when you got those incredible feelings of deja vu? Well, that was because of the Time Lords adjusting the Calendar around you.



  • I hate that Linux has to fix the stupidity of every single hardware maker out there.





  • Eww, what happened to TONT? That new look is positively ugly.



  • I dunno. MSDN moved it onto new software I guess?



  • Same thing (and also with software bugs).

    No, I don't really know of any solution to the problem, but I do know that it's one of the biggest problems in computing.

    It's like if some car companies started making and shipping cars without doors, that no one would obviously want to buy, but car dealerships just shrugged and added the doors for free when they got them. Most customers wouldn't notice, but now every other dealership would have to start adding doors for free. And then other car companies would see that and say "hey, why should we add doors when that other company gets them for free?"...

    Of course, usually the government would step in and forbid selling defective products that claim to adhere to a standard but don't, but this is software (and Chinese vendors) we're talking about.



  • Where's the problem? Real pros don't use doors at all. https://www.reddit.com/r/answers/comments/1gvkea/why_dont_race_cars_have_doors/



  • Btw, does it affect Microsoft too? Seems Microsoft also produce OS for embedded systems.



  • @anonymous234 said:

    I hate that Linux has to fix the stupidity of every single hardware maker out there.

    I love that by and large it actually manages to do so quite effectively.



  • @PWolff said:

    Not a shbit more weird than 2016-02-30 not being one.

    I know. And if they had to make a month longer, :wtf: not February? :facepalm:

    @blakeyrat said:

    Mayans had it all figured out. Today is 13.0.3.0.15.

    I thought that calendar--and the world--ended a while back? :innocent:

    [spoiler]I actually had a countdown to the end of the world on my site for a while, just for fun.[/spoiler]


  • Winner of the 2016 Presidential Election

    @CoyneTheDup said:

    I actually had a countdown to the end of the world on my site for a while, just for fun.

    Well did the world end?



  • @sloosecannon said:

    Well did the world end?

    Not yet. But you can check in real time:



  • @sloosecannon said:

    Well did the world end?

    Several times. The Adams-Replacement is due to happen every now and then.

    (http://www.goodreads.com/quotes/2397-there-is-a-theory-which-states-that-if-ever-anyone)


  • Winner of the 2016 Presidential Election

    @loose said:

    You know all those occasions when you got those incredible feelings of deja vu? Well, that was because of the Time Lords adjusting the Calendar around you.

    Are you sure it's not these guys?



  • Don't know. But then if it was, I wouldn't.

    Not seen it, or even aware of it. Checking with IMDB I get the impression it's a sort of dark Matrix[spoiler] where the baddies win. [/spoiler]So not on my wishlist, but will watch if I find it flicking through the channels.


  • Winner of the 2016 Presidential Election

    Not quite, no.

    Yes, there's a bit of a Matrix-y vibe at times, but not overall. I like the movie, despite some pretty silly moments. Overall, pretty good plot, awesome film noir atmosphere, I found it thoroughly enjoyable.

    Personally, I'd recommend it, but you know, to each their own.



  • I will consider your opinion.

    My biggest 'put off' is the whole framing for murders thing. Which I view as an necessary plot device (Mcguffin IIRC) to "motivate" the action. The "big" reveal at the end points towards a "then I woke up" scenario.

    But then if I chose the films I would like to watch by their write ups, I'd only see the films I want to watch - but that's a different story, especially when you get hooked by the trailer, and the trailer contains the only decent action in the entire film.


  • Winner of the 2016 Presidential Election

    I can't really say anything without getting into spoiler territory, but yeah, wrong impression. I assume the writeups are rather poor for the same reason.



  • @Maciejasjmj said:

    Not yet. But you can check in real time:

    Found this comment in the page source:

    if the lhc actually destroys the earth & this page isn't yet updated
    please email mike@frantic.org to receive a full refund
    
                           ___
                          / / \\\                   Has the great lazer eyed bunny
                          \ \  \\\                      destroyed the world yet?
                           \ \  \\\                                                               _______
             ______________ \ \  \\\__                                                           /        \
     ____  _/                       (O)\---------------------------------------------           /          \
    /    \/                         ( __|                                                      |            |
    |____/               |      ------- \\              status: In Progress                     \          /
         |______________/_______________//              [73%/100%]    eta: ..Soon                \________/
    
    
    check out our exciting new social media presence at http://twitter.com/htlhcdtwy
    


  • @Maciejasjmj said:

    @sloosecannon said:
    Well did the world end?

    Not yet. But you can check in real time:

    I found it particularly amusing that the page has code to indicate if the world has ended (if an uninitialized JS variable is not undefined, then the world has ended.)

    And that it has a reference to an RSS feed. With one entry from 2011. The world-ending state apparently hasn't changed since then.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.