• Someone (unregistered)

    I am not 100% convinced that going through SQL to compare dates is a WTF. The input strings could, in theory, use some really obscure encoding for date/time that Java does not use or implements slightly different from the database used.

    Edge cases that might occur could, for instance, be:

    • a check whether 2:05 AM GMT is earlier than 3:04 AM western european time on a sunday back in 1985 where one of the two went through a daylight savings switch.
    • a check on times where leap seconds would make a difference
    • a check involving gregorian and julian calendar times
  • Ling Ling (unregistered) in reply to Brian

    That's not entirely accurate. With the absence of a singular non gender pronoun in English it is grammatically correct to use "they" so long as, and this is the important distinction, the subject's gender has not been previously specified or implied.

  • (cs) in reply to Peter
    Peter:
    Or you can use the widely-accepted (albeit sometimes deprecated) convention of using "their" as a neuter singular adjective or determiner (not pronoun).
    Sometimes deprecated? Only by those who know the language, eh?

    Oh, and just because it's a pronoun in an adjectival or deterministic role doesn't make it "not a pronoun". It's still a possessive plural common-gendered pronoun (note, not "neuter", because neuter means without gender, like a chair, not a person) which has been pressed into service in a singular role.

    Some (that is to say, "most") people are scared of cries of "sexism!" so they avoid the common gender pronouns "him" and "his"; but that doesn't mean they're right.

  • English Speaker (unregistered) in reply to rfsmit
    rfsmit:
    Peter:
    Or you can use the widely-accepted (albeit sometimes deprecated) convention of using "their" as a neuter singular adjective or determiner (not pronoun).
    Sometimes deprecated? Only by those who know the language, eh?
    "know the language"? I think that with 49.75 years study and practice I "know the language".

    Or perhaps it's "Sometimes" that you have a special meaning for?

  • (cs) in reply to Robert
    Robert:
    Your kidding, right??? I mean who cares!!!! People REALLY care about crap like this?!?!?!?! Get a life.......
    You're kidding, no? This site is intended for people who love this kind of stuff, regardless of whether they have a life.
  • (cs) in reply to Zer0

    Rip Blu-ray with 12 different ways. Download Blu-ray rip software for free and rip Bluray to DVD, PC, MP4, ISO, AVI, MPEG, iPod, WMV, MOV, etc.

  • Alex (unregistered)

    And why the heck not? Presuming that if SQL server was down the entire app would stop anyway, and if it took the programmer five mins to write this code, as opposed to maye fifteen mins for proper code...

    The managers are right not to care.

  • Alex (unregistered) in reply to Someone
    Someone:
    I am not 100% convinced that going through SQL to compare dates is a WTF. The input strings could, in theory, use some really obscure encoding for date/time that Java does not use or implements slightly different from the database used.

    Edge cases that might occur could, for instance, be:

    • a check whether 2:05 AM GMT is earlier than 3:04 AM western european time on a sunday back in 1985 where one of the two went through a daylight savings switch.
    • a check on times where leap seconds would make a difference
    • a check involving gregorian and julian calendar times

    Indeed... This solution is simple and robust. Nice submission, but actually a good code and not a WTF.

  • (cs) in reply to rfsmit
    rfsmit:
    Sometimes deprecated? Only by those who know the language, eh?

    Oh, and just because it's a pronoun in an adjectival or deterministic role doesn't make it "not a pronoun". It's still a possessive plural common-gendered pronoun (note, not "neuter", because neuter means without gender, like a chair, not a person) which has been pressed into service in a singular role.

    Oh dear, oh dear, the whole 'singular they' issue again. Next you'll be saying that we can't use 'you' for the singular case either.

    May I just point you at http://www.nytimes.com/2009/07/26/magazine/26FOB-onlanguage-t.html

    (It appears that 'they' as a generic third person singular was banned by Anne Fisher in 1745 who, though perfectly capable of coping with 'you' being either singular or plural, couldn't get her head around the same concept for 'they'. Her dictat prescribed 'he' instead, thereby starting the whole 'we need a gender neutral third person singular' problem almost immediately.)

  • Bim Job (unregistered) in reply to Alex
    Alex:
    Someone:
    I am not 100% convinced that going through SQL to compare dates is a WTF. The input strings could, in theory, use some really obscure encoding for date/time that Java does not use or implements slightly different from the database used.

    Edge cases that might occur could, for instance, be:

    • a check whether 2:05 AM GMT is earlier than 3:04 AM western european time on a sunday back in 1985 where one of the two went through a daylight savings switch.
    • a check on times where leap seconds would make a difference
    • a check involving gregorian and julian calendar times

    Indeed... This solution is simple and robust. Nice submission, but actually a good code and not a WTF.

    I'm normally very verbose. In this case, not.

    Bollocks.

  • RedAdder (unregistered) in reply to Federico
    Federico:
    adiener:
    bool FirstIsLowerOrEqual (int i1, int i2) { std::string test = "if [ $i1 -le $i2 ]; then echo first; else echo second; fi"; std::ostringstream cmd; cmd << "i1=" << i1 << "; i2=" << i2 << ";" + test; return ! system ("test `ssh some.where /bin/sh -c '" + cmd.str() + "` == first"); }
    Nice, but you have an unterminated single quote in there.
    Thanks for pointing it out! I could not test it before posting because here at work we don't use a Unix operating system ... unfortunately :-(

    On windows, use mingw or cygwin .. or just install git

  • SuperCoder (unregistered)

    This is kind of like people that writes java versions of stuff that could have been done (better) in a 3 line bash script.

    And there are many of those....

  • amyo (unregistered) in reply to Jack

    should you be correcting his "grammer"?

  • Barf4Eva (unregistered)

    'Everything In SQL' my ass...

    You should come to work for my company. We'll show you what 'Everything in SQL' looks like.

  • Hugh Mingus (unregistered) in reply to CesarMaia

    I think you mean "flavour"

  • Derekwaisy (unregistered)
    Comment held for moderation.
  • Jimmyanten (unregistered)

    prednisone 2 mg daily: https://prednisone1st.store/# prednisone 15 mg daily

Leave a comment on “Slightly OverSQL'd”

Log In or post as a guest

Replying to comment #:

« Return to Article