Mélomane by nature. A 20-something businesswoman, nerd, and ambigamist in love with friends, wine, food, traveling, birds, words, a boy, and everything in between.

Catching Elephant is a theme by Andy Taylor

All original content by me is licensed under the CC BY-NC 3.0 License

 

The code that allegedly broke the Zune

marco:

Via jstn.

while (days > 365) {
    if (IsLeapYear(year)) {
        if (days > 366) {
            days -= 366;
            year += 1;
        }
    } else {
        days -= 365;
        year += 1;
    }
}

Out of curiosity, why was this being rewritten by Freescale or Microsoft at all? This has been a solved problem for a very long time.

(Also, this is very ugly C style in many places. I expected better from Microsoft.)

  1. snippet reblogged this from jstn
  2. allincircles reblogged this from marco
  3. chancegarcia reblogged this from trotzke
  4. lanceturner reblogged this from jstn
  5. trotzke reblogged this from marco
  6. romansang-marino reblogged this from ratatat
  7. ratatat reblogged this from marco
  8. parx reblogged this from poortaste
  9. perkyblackchick reblogged this from ledenes
  10. microblog reblogged this from marco
  11. aladuh reblogged this from marco
  12. darknessfalls reblogged this from jstn
  13. ronworkman reblogged this from jstn
  14. nevyn reblogged this from marco and added:
    The code from where...originated is available here. The funny thing is that the same code...
  15. uninformat reblogged this from marco
  16. benglert reblogged this from midoriw and added:
    Also, who hard-codes magic numbers like that? So many things wrong with this picture.
  17. midoriw reblogged this from marco
  18. shabdar reblogged this from marco and added:
    “I expect” is...diffrent story! Microsoft...like a hot...
  19. marco reblogged this from jstn and added:
    Out of curiosity, why was this being rewritten by Freescale or Microsoft at all? This has been a solved problem for a...
  20. inothernews reblogged this from ledenes
  21. ledenes reblogged this from ryanjpointer
  22. ryanjpointer reblogged this from jstn
  23. poortaste reblogged this from jstn
  24. sparo reblogged this from jstn
  25. jstn posted this

Blog comments powered by Disqus