• data nerd (unregistered)

    He forgot FILENOTFOUND

  • (cs) in reply to NitPiC#
    NitPiC#:
    Yeah, that is a bit curious. I assume you've already read the wiki on the subject

    7*4 == 28 is one possible link, but as Wiki points out, that is fairly week (yeah, pun intended, sorry).

    Since it is referenced right in the first chapter of the Bible, the idea must have been around and firmly entrenched for ages, long before people started committing ancient myths to written documents.

    Curious stuff indeed.

    From the article:

    The association of the days of the week with the Sun, the Moon, and the five planets visible to the naked eye dates to the Roman era (2nd century).
  • (cs)

    7 Days/Week is easy to explain, take the number of days in the year, figure on 50 weeks of useful work (which is a nice round number), then add 2 for vacation, and lo and behold you get 7 ish. Although I'm not sure what they'd do in places where they get more than 2 weeks of vacation. Maybe that's where the exchange rate comes into play.

  • (cs) in reply to Some Jerk
    Some Jerk:
    I suspect that this individual must have been looking at source code and attempting to discern its' purpose. Apparently, this individual did not understand what they were doing, or perhaps the hash table might have been replaced with an equally rediculous coding structure... you know, like a REAL ENUM!?

    Its'? That's a new variation.

  • Nagesh (unregistered)

    Is good to see WTF that not PHP. PHP gets too bad rap here, but these codesd show he can make WTF with C++ too.

  • radarbob (unregistered) in reply to Spewin Coffee
    Spewin Coffee:
    The real fail is using C#.
    Fishing with Bill Dance!
  • radarbob (unregistered) in reply to PHP Vigilante
    PHP Vigilante:
    The real WTF is Java.
    Fishing with Bill Dance!
  • radarbob (unregistered) in reply to A. Nonymous
    A. Nonymous:
    PHP Vigilante:
    The real WTF is not knowing Java.
    TFTFY
    Fishing with Bill Dance!
  • radarbob (unregistered)

    It all makes sense... Resume fodder. To wit:

    Engineered highly efficient hash table used throughout the code base, significantly reducing processing time. So concise and well written as to be self documenting. Consistent; the hash table uses strings exclusively, giving a simplified API. I also leverage String's inherent trait of immutability thereby reducing not only error potential, but conserving memory in a 1.5M LOC system where every byte counts.

    Please send the codz upon request.

    Fishing with Crystal Meth
  • foxyshadis (unregistered) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    NitPiC#:
    Yeah, that is a bit curious. I assume you've already read the wiki on the subject

    7*4 == 28 is one possible link, but as Wiki points out, that is fairly week (yeah, pun intended, sorry).

    Since it is referenced right in the first chapter of the Bible, the idea must have been around and firmly entrenched for ages, long before people started committing ancient myths to written documents.

    Curious stuff indeed.

    From the article:

    The association of the days of the week with the Sun, the Moon, and the five planets visible to the naked eye dates to the Roman era (2nd century).

    That's from at least a millennium or two after the 7-day week became common, though, so it obviously has nothing to do with the origins.

    Personally, I think it's most likely that an early prophet of some forgotten religion (what we'd call a cult leader now), maybe prior to Judaism entirely, came up with the absolute 7-day cycle and it stuck and spread. Similar arbitrary customs happen all the time, because sometimes it doesn't matter what you use as long as everyone agrees.

  • (cs) in reply to foxyshadis
    foxyshadis:
    PedanticCurmudgeon:
    From the article:
    The association of the days of the week with the Sun, the Moon, and the five planets visible to the naked eye dates to the Roman era (2nd century).

    That's from at least a millennium or two after the 7-day week became common, though, so it obviously has nothing to do with the origins.

    Unless the association goes back further than Wikipedia cares to admit, which it does.

  • (cs)

    7 day week borrowed from ancient hindu calendar systems. Jesus Christ visited India and stay with several folks over here and learn magics tricks. Between the age of 13 - 28.

    None of this visit documented in Bible, but we Hindu know better.

  • (cs) in reply to Nagesh
    Nagesh:
    7 day week borrowed from ancient hindu calendar systems. Jesus Christ visited India and stay with several folks over here and learn magics tricks. Between the age of 13 - 28.

    None of this visit documented in Bible, but we Hindu know better.

    No, but something like it is documented here: http://www.chrismoore.com/lamb.html where we learn the origins of the Jewish tradition of Chinese food on Christmas Day.

  • (cs) in reply to n9ds
    n9ds:
    Nagesh:
    7 day week borrowed from ancient hindu calendar systems. Jesus Christ visited India and stay with several folks over here and learn magics tricks. Between the age of 13 - 28.

    None of this visit documented in Bible, but we Hindu know better.

    No, but something like it is documented here: http://www.chrismoore.com/lamb.html where we learn the origins of the Jewish tradition of Chinese food on Christmas Day.

    pla·gia·rism/ˈplājəˌrizəm/ Noun: The practice of taking someone else's work or ideas and passing them off as one's own.

    It is copying, but original Hindu mystic rely on word of mouth to tell story and did not have reach of Internet.

  • Some Jerk (unregistered) in reply to DWalker59
    DWalker59:
    Some Jerk:
    I suspect that this individual must have been looking at source code and attempting to discern its' purpose. Apparently, this individual did not understand what they were doing, or perhaps the hash table might have been replaced with an equally rediculous coding structure... you know, like a REAL ENUM!?

    Its'? That's a new variation.

    Now THAT is a WTF!

  • (cs) in reply to shoofle
    shoofle:
    ♫ Day enum and me wan' go home. ♪
    +1

    "Day 0. Da-a-a-ay 0."

  • (cs) in reply to C-Derb
    C-Derb:
    Coyne:
    The best part is that the author actually did DateTime.Now.DayOfWeek; in two parts, but he had the number he wanted.

    To even make this kluge work, he had to understand that today.DayOfWeek was a number from 0 to 6...so why didn't he just use the number?

    Paid by the line?

    Agreed.

    But assuming he didn't know that he could just cast from enum to int, as the original submitter pointed out ( (int) DateTime.Now.DayOfWeek ), why would he choose to load up a hash table every time this is called instead of just using a switch statement? Egads, even a nested if statement would have made more sense.

    Bonus points for using String.Format instead of ToString() though. I really liked that.

    Maybe he's paid by the millisecond of runtime?

  • JJ (unregistered) in reply to AGray
    AGray:
    I'm going to have a go at rewriting this function in one line...wish me luck!!! (I may or may not need it)

    C#:

    public static string getDayEnum()
    {
        return DateTime.Now.DayOfWeek.ToString();
    }

    [...]

    ...I have great faith in the C# one, since I use C# on a day-to-day basis.

    Yikes, I think your faith is about to be shattered. Calling ToString() on an enum member returns the name of the member, not its value, so you'll be returning "Friday," "Tuesday," etc., whereas the WTF code returns "5," "2," etc.

  • (cs)

    Yom Rishon, 1st day Yom Sheni 2nd day Yom Shlishi 3rd day Yom R'vii 4th day Yom Chamishi 5th day Yom Shishi 6th day

    and you shouldn't be using your computer on Shabbat anyway.

  • Inflexible (unregistered)

    I would like to note that your solution doesn't allow us to add FileNotFound when we need to.

  • Ceiling Cat (unregistered)

    I have no understanding for this nonsense. Sunday is supposed to be day "7". It says so in the Bible.

Leave a comment on “Denumerating the DayOfWeekEnum”

Log In or post as a guest

Replying to comment #:

« Return to Article