• (cs) in reply to RobFreundlich
    RobFreundlich:
    A guy is sitting in a bar, having a drink or two. Every once in a while, someone will call out a number, and the patrons will laugh. He gets more and more confused, until someone calls out "37", and the patrons go absolutely nuts - rolling on the floor with laughter. So he grabs one of the waiters.

    Guy: "Uh, excuse me, I'm confused. Every once in a while, someone calls out a number and the crowd laughs. What's going on?"

    Waiter: "Oh, those are the regulars. They've told the same jokes and stories so many times, they decided to give them all numbers. So now instead of telling the joke, they just call out the number."

    Guy: "Cool! But what about the last one? Someone called out 37 and everyone laughed much, much harder than usual."

    Waiter: "Oh, that's because they'd never heard that one before."

    Guy: "Reckon I could try it?"

    Waiter: "Sure, go ahead. 103 is a funny one."

    Guy: "103!" (room gets very quiet)

    Guy: "What happened? Nobody laughed."

    Waiter: "Some people just don't know how to tell a joke."

  • (cs)
    And of course, the bad news was that this was just the tip of the iceberg.

    Wait! What's the rest of the iceberg this guy hit? Sadistic minds want to know! j/k...

  • Alex (unregistered) in reply to cod3_complete
    cod3_complete:
    And of course, the bad news was that this was just the tip of the iceberg.

    Wait! What's the rest of the iceberg this guy hit? Sadistic minds want to know! j/k...

    Yes, it looks like the story is incomplete. WTF! I want to know what is the rest of the iceberg too!

  • anonymous (unregistered)

    wild guess...

    sum(k = 1 .. n, choose(n, k)) * sum(i = 1 .. n, sum(j = 0 .. i-1, choose(i,j)))

    n = maximum number of steps

    First line is number of possible non-shorthand step combinations Second line is number of ways to insert commas in each set of steps.

    yes? no?

    x anon

  • anonymous (unregistered) in reply to Pedant

    So the puzzle about how many possible mods had to be answered, I made a quick python program:

    N=45
    mem = dict();
    
    
    def rcount(p, before, skipping):
        if ( p >= N ):
            if( skipping):
                return 0
            else:
                return 1
                
        if(skipping):
            return count(p+1, 1, 1) + count(p+1, 1, 0) 
        if(before):
            return count(p+1,1,0) + count(p+1,1,1) + count(p+1,0,0)
        return count(p+1,1,0) + count(p+1,0,0)
        
    
    def count(p, before, skipping):
        key = (p, before, skipping)
    
        try:
            return mem[key]
        except:
            r = rcount(p, before, skipping)
            mem[key] =  r
            return r
        
    print count(0, 0, 0)
    

    The result is 101302819786919522

  • (cs) in reply to anonymous
    anonymous :
    So the puzzle about how many possible mods had to be answered, I made a quick python program:
    No it doesn't.

    There's requirements, there's (wretched) design, there's (brain-dead) implementation, there's (predictably unhappy) day-to-day service delivery, and finally there's Supremely Cretinous Silver Bullet.

    Similarly, there's math(s) and then there's counting.

    Counting is inelegant. Symbols suffice.

  • KT (unregistered) in reply to Hulser
    Hulser:
    Alexander:
    I don't consider this a WTF. There is probably only a very small number of sequences valid (in the sense of "You are still allowed to fly the A/C afterwards"). And the rules to determine the valid sequences are probably somewhat complicated. Thus a field validation would be a disatrous big piece of code with rules, exceptions, exceptions of the exceptions, ... So it's perfectly reasonable to outsource the real field validation to the most effective device to do this (the human brain of somebody understanding the A/C maintenance process) and to cache the results of this validation in a list.

    To those people who are suggesting that the design is intended to restrict the options to valid combinations, I think you missed something in the first sentence of the post. The guy was hired to implement an way to "automatically add mods". If the business process was that some person reviewed the new combination to make sure it was valid, they wouldn't be adding a feature to automatically add any new user-entered combination to the look-up table.

    Of course you are right. The story presented the table as the WTF, not the requirement. TRWTF is some unholy combination of the two.

    ingenium?

  • (cs) in reply to Code Dependent
    Code Dependent:
    RobFreundlich:
    A guy is sitting in a bar, having a drink or two. Every once in a while, someone will call out a number, and the patrons will laugh. He gets more and more confused, until someone calls out "37", and the patrons go absolutely nuts - rolling on the floor with laughter. So he grabs one of the waiters.

    Guy: "Uh, excuse me, I'm confused. Every once in a while, someone calls out a number and the crowd laughs. What's going on?"

    Waiter: "Oh, those are the regulars. They've told the same jokes and stories so many times, they decided to give them all numbers. So now instead of telling the joke, they just call out the number."

    Guy: "Cool! But what about the last one? Someone called out 37 and everyone laughed much, much harder than usual."

    Waiter: "Oh, that's because they'd never heard that one before."

    Guy: "Reckon I could try it?"

    Waiter: "Sure, go ahead. 103 is a funny one."

    Guy: "103!" (room gets very quiet)

    Guy: "What happened? Nobody laughed."

    Waiter: "Some people just don't know how to tell a joke."

    Nice! Here's another variant I've heard. After the original conversation, we get:

    Some Patron: "52!"

    Crowd: jeers and catcalls

    Guy: "What was that all about?"

    Waiter: "Oh, that's Smith. He really ought to give up on that one - he can never quite handle the Swedish accent."

  • anon (unregistered) in reply to pink_fairy
    pink_fairy:
    anonymous :
    So the puzzle about how many possible mods had to be answered, I made a quick python program:
    No it doesn't.

    There's requirements, there's (wretched) design, there's (brain-dead) implementation, there's (predictably unhappy) day-to-day service delivery, and finally there's Supremely Cretinous Silver Bullet.

    Similarly, there's math(s) and then there's counting.

    Counting is inelegant. Symbols suffice.

    Except of course when you consider all symbols given so far were plain wrong guesses about what the number is, no, it is not 2^45 and it is definitely not 45! It was definitely not the silly sum of combinations someone posted...

    What I shown you was math translated to a python program, it was not 'counting'.

    Want symbols? The result for N=45 is f(45, 0,0) where: { f(0, x, 0) = 1 f(0, x, 1) = 0

    f(i, 1, 1) = f(i-1, 1,1) + f(i-1, 1,0) f(i, 1, 0) = f(i-1, 0,0) + f(i-1, 1,0) f(i, 0, 0) = f(i-1, 1,0) + f(i-1, 0,0) }

    regards.

  • Cheong (unregistered) in reply to way2trivial

    Think about it... it just make sense.

    The only entries that exist in the table are that entries that actually be used... that means if somehow certain technicans skipped one of the steps that's actually be required, he would not be able to enter it here.

    Only that it there should be function that used to check the missing steps...... :P

  • (cs)

    The fact that anybody working on that system can see it as 'workable' makes me feel nauseous

  • Anonymous (unregistered)

    Actually, all calculation methods so far are wrong.

    If anybody wants the real result, in a symbolic way then take this matrix:

    [ 2 0 1 ] [ 1 1 0 ] [ 1 1 0 ]

    Raise the matrix to the 45th power (K=45) and the count will be in the top left of the result matrix.

    I.E: If K=1 Then there are two results: 1 and [empty] . Do the above procedure and you get 2.

    For K=2 the result is 5: (empty); 1 ; 2; 1,2 ; 1-2; And the thing works.

    For K=3, the result is 13:

    (empty) 1 1,2 1-2 1,2,3 1-2,3 1,2-3 1-3 1,3 2 2,3 2-3 3

    The math behind is a long story and I don't think you guys are too interested in it.

  • # (unregistered)

    3 692 890 883 188 542 000 000

  • raddad (unregistered) in reply to emurphy
    emurphy:
    ideot - that's me:
    jimlangrunner:
    Code Dependent:
    What we need on TDWTF is a similar method of selecting from a table of all possible comments. We could just enter a number and it would select the comment and insert it for us.

    Of course, we all know what the first entry in the table would be...

    What would that be? Does it have anything to do with Irish Girl?
    And a wooden table?

    Hot.

    ...and a turkey baster

  • (cs) in reply to Bappi
    Bappi:
    John Winters:
    Even more than 2^45, because there are different ways of entering the same combination. The reasoning above only considers cases where all the steps are entered separately, but if for instance we had:

    1,2,3,4,5,6

    then the same combination could be entered as:

    1-2,3,4,5,6 1-3,4,5,6 1-4,5,6 1-5,6 1-2,3-4,5,6 1-2,3-4,5-6 1-2,3,4,5-6

    etc, etc...

    And each of these needs its own row in the table. The total number would be quite a lot more than 2^45.

    No, it wouldn't. You're forgetting that this is an in-house, custom development, and that if you want records added to the table, you have to ask someone to do it for you. The reply, for each of the combinations you list, would be to "just type 1-6."

    Ah, I think I can help out there. What we need is an extra table to map the bad combinations to their correct versions.

  • Cbuttius (unregistered)

    Parsing those strings was part of the job of the first C++ class I ever wrote back in 1993

  • Ichneumon (unregistered) in reply to Jay
    Jay:
    Given that, the correct total count is 2^45. Each of the forty-five numbers may or may not appear, but the order is fixed.
    Close but not quite. I'd say 2^45-1, based on the assumption that no one's going to log the maintenance action corresponding to "I didn't do a damned thing, I skipped every one of the 45 possible steps".

Leave a comment on “The Mod Out System”

Log In or post as a guest

Replying to comment #:

« Return to Article