• z f k (unregistered)

    [quote user="anonymous hater"]

    • bit flipping [quote] [quote user="ClaudeSuck.de"] d. understand that in T-SQL it simply swaps the between True and False [/quote] [quote user="Yes Indeed"]it's just a flag toggle. [/quote] I think it might be an attempt to print a list, alternating the presentation (background color?) of each line, depending on it is odd or even.

    CYA

  • (cs) in reply to Mike
    Mike:
    乱 - らん Insert obligatory Kurosawa reference here.

    三池 崇史 - Miike Takashi Insert obligatory Mike reference here.

  • P. Floyd (unregistered)

    So you run and you run to catch up with the sun but it's sinking Racing around to come up behind you again. The sun is the same in a relative way but you're older, Shorter of breath and one day closer to death.

  • (cs)

    It's still a WTF, but I guess I can explain this. I think this is some kind of "setup procedure". The first time the application ran (meaning the runs table is either empty or has one element made through some installation procedure). it's set to 0. Then, if it is 0, some further installation processing is done (fixing tables or creating files or whatever you like). Then it's set to 1 (at a bad attempt to always make it stay at one) to avoid it from being done again.

    Of course, it's still crazy, lousy, bad and whatnot. But at least it kind of makes sense.

  • AC (unregistered) in reply to Evo

    It could be that it is used to test connections. Primrose connection pool has this kind of configuration option. Obviously since they added such feature in Primrose, it is useful to someone in some environment.

    checkSQL Indicates that before handing our a connection, the pool should run some SQL to test if the connection is still valid. Can be useful for critical applications, where a possibly stale (yet open as returned from isClosed()) connection is never desired. Remember that performance is impacted by setting this. An example would be: checkSQL=select 1 from test. Delete this setting if you do not wish to enable the feature.
  • EmperorOfCanada (unregistered) in reply to md5sum

    I like the test in that maybe the stupid database did something magical like use a byte instead of a bit and the original programmer was exploiting some undocumented feature of the database. This would then be a different WTF.

    I remember when I was first starting to program that I felt like a real rebel using all kinds of undocumented features. Updates usually came along that unfeatured my code.

  • pflock (unregistered)

    TRWTF is that the original author wrote:

    "I consider myself to be a fairly inquisitive guy," Aaron writes, "I tend to not just dive in and start changing code without understanding the system architecture and a general understanding of the business rules."

    Whereas everybody knows that big legacy applications are turing tarpits in themselves, and only understandable by geniouses who write malbolge with closed eyes.

  • (cs)

    See Bit Ran, Ran, Bit, Ran

  • mystery (unregistered)

    Not sure if it's been mentioned but, if it's truly a single bit then bit+1 is the same as flipping it.

  • (cs) in reply to mystery
    mystery:
    Not sure if it's been mentioned but, if it's truly a single bit then bit+1 is the same as flipping it.

    It's not a single bit. It's either 8 or 16 bits, depending on table structure. I read somewhere that the bit data type can be set to numbers other than 0 or 1, but the return value is always 0,1 or null. Which means that the stored value would probably never go above 2 for this code.

  • (cs) in reply to Thg
    Thg:
    TRWTF is that this makes total sense, but everyone thinks it's a WTF.

    It's more than a tsql equivalent to printf, it lets you generate reports on jobs (or whetever this application does) that did not make it to that point in the code.

    that way you can automate a re-attempt based on the results of a SQL query.

    .. or maybe I'm making a FTW out of a WTF.

    (FTW = "feck, that'll work")

    I'd agree with you, if the table wasn't called "test". I think that's the final nail in the coffin here... ;)

    (unless "test" really is short for "test_that_something_worked": although that might be WTF worthy in its own right...!)

  • inappropriate rambler (unregistered) in reply to takatori
    takatori:
    Mike:
    乱 - らん Insert obligatory Kurosawa reference here.

    三池 崇史 - Miike Takashi Insert obligatory Mike reference here.

    ☻♀♥☺♂=♫♪♫♪♫♫♪ Insert derogatory reference here.

  • second dumb (unregistered) in reply to Kiss me I'm Polish
    Kiss me I'm Polish:
    I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.
    Stopped at a gas station. Bought a replacement. Recharged it while cleaning the mess. Continued running.
  • TheAnonCoward (unregistered) in reply to lolwtf
    lolwtf:
    Super Mario World uses this method at one point. It works, as long as you don't enter a pipe 256 times in one level...

    This perfectly explains why you can only go forward in that game... "Crap, if we let the player go back, they'll find our limitation!"

  • sino (unregistered) in reply to inappropriate rambler
    inappropriate rambler:
    takatori:
    Mike:
    乱 - らん Insert obligatory Kurosawa reference here.

    三池 崇史 - Miike Takashi Insert obligatory Mike reference here.

    ☻♀♥☺♂=♫♪♫♪♫♫♪ Insert derogatory reference here.
    Insert Punchline in TDWTF™ Title Here!

  • sino (unregistered) in reply to Todd Lewis
    Todd Lewis:
    highphilosopher:
    I thought that NULL was simply a sub state of file not found.

    On embedded systems where there is no file system, the one degenerates into the other.

    Brillant! I rofled...

  • Matt (unregistered) in reply to Mike

    Damn! You beat me to it.

  • Design Pattern (unregistered) in reply to highphilosopher
    highphilosopher:
    I thought that NULL was simply a sub state of file not found.

    http://en.wikipedia.org/wiki/Null_%28SQL%29

    E. F. Codd:
    Codd indicated in his 1990 book The Relational Model for Database Management, Version 2 that the single Null mandated by the SQL standard was inadequate, and should be replaced by two separate Null-type markers to indicate the reason why data is missing. (...) Codd's recommendation would have required SQL's logic system be expanded to accommodate a four-valued logic system.

    So the creator of the relational database model himself supports a logic that contains "File not Found", as this indicates the reason why data is missing!

  • Konamiman (unregistered) in reply to anonymous hater
    anonymous hater:
    - bit flipping - nothing at all - throw an error
    - FILE_NOT_FOUND
  • (cs) in reply to Plz Send Me The Code
    Plz Send Me The Code:
    if you call it an infinite number of times is it set to 1 or 0?

    I've got it running in an endless loop now. I'll let you know.

  • IMSoP (unregistered) in reply to anonymous hater
    anonymous hater:
    All depends on the philosophy of the implementing "Architect".

    After all a: Float=double Real=float

    WTF?

    Don't you mean "Float=double (precision), Real=single (precision)"? They're both floats, or reals, which is the whole point, Shirley?

    The first WTF comes in calling your single-precision floating point type "float" or "real" - "no one could ever need more than 32-bit precision!"

  • Quirkafleeg (unregistered) in reply to PITA
    PITA:
    And I ran. I ran so far away. I just ran. I ran all night and day. I couldn't get away.
    And the bit was set, the very next day…
  • Thomas (unregistered)

    Defining a bit as integer from 0 to 1 is definetely wrong, but I'm not surprised to learn that MS-SQL does it like that.

    The difference is that if you add one to a bit that's already 1, you get zero (and overflow bit set), but that's not an error if you choose so.

    I doubt MS-SQL could handle it like that and that's the error: They don't know or care enough about bit operations to make them work correctly.

  • Volodya (unregistered) in reply to justsomedude
    justsomedude:
    No, no, no; NULL is the forth state of tri-state logic.

    So, to summarise, there are four states in tri-state logic: *Yes *No *Maybe *Null *File not found

Leave a comment on “The Incrementing Bit Column”

Log In or post as a guest

Replying to comment #:

« Return to Article