• BentFranklin (unregistered)

    wouldIDoHer should be an enum not a bool. Everyone knows there are three possible values:

    Would Wouldn't Why not?

  • (cs) in reply to BentFranklin
    BentFranklin:
    wouldIDoHer should be an enum not a bool. Everyone knows there are three possible values:

    Would Wouldn't Why not?

    You forgot FILE_NOT_FOUND.
  • modo (unregistered) in reply to BentFranklin
    BentFranklin:
    wouldIDoHer should be an enum not a bool. Everyone knows there are three possible values:

    Would Wouldn't FILE_NOT_FOUND

    FTFY
  • Mike (unregistered) in reply to frits
    frits:
    Maurits:
    Vladimir Poutines:
    He probably meant to do root-sum-squared but forgot the root.

    Skipping the root is a common optimization if you're just using the result as a sort key.

    I wasn't aware of that. It makes sense for integers. I wouldn't try it for floating point numbers where values -1.0 to 1.0 were expected.

    Why not? Try to come up with floating point numbers that break the sort order when the square root is skipped. I'll check back for your solution.

  • boog (unregistered) in reply to xtremezone
    xtremezone:
    boog:
    Actually, it's very easy to remove files from a Subversion repository's history.

    Coincidentally, it's even easier to completely demolish your repository while doing so.

    http://subversion.apache.org/faq.html#removal

    Unless you know of a better way. It seems #subversion doesn't. Do tell.

    Nope, that's the only way I know how, although I did find a page outlining the steps: http://stackoverflow.com/questions/560684/svn-obliterate

    As I was saying, the shell commands are very easy, but one wrong move could trash your repository.

  • Sutherlands (unregistered) in reply to xtremezone
    CodeNinja:
    I don't think you understand what a const reference does...

    Of course, if you get something as a const reference, you can't modify it without being a tool and casting it back to a normal reference (IE: 'girl1.face = 1' would fail at compile time if girl1 was a const reference). Besides, he's not attempting to modify any values in the Girl, just access them. Perfect example of a proper location to use a const reference.

    xtremezone:
    Sutherlands:
    No, that makes sense. That way whatever you do to it in your function doesn't make it back to the original.
    Ahem, const...
    "Ahem", please read the reply again, both of you.

    "TRWTF is passing by value" "No, that makes sense because [...]"

    If you DON'T pass by const ref, you get a duplicate of the object, so you can "do what you need to."

    Geez, it's like talking to 3rd graders.

  • boog (unregistered) in reply to boog
    boog:
    Nope, that's the only way I know how, although I did find a page outlining the steps: http://stackoverflow.com/questions/560684/svn-obliterate
    Looking at this link again, it's a perfect example of how ridiculously easy it is to completely trash your SVN repository.

    Read the comments on it to see why.

  • uuang (unregistered)

    This is a pretty elaborate advertisement for "Quiet War [by?] GollanczF Paul McAuley."

  • (cs) in reply to Mike
    Mike:
    frits:
    Maurits:
    Vladimir Poutines:
    He probably meant to do root-sum-squared but forgot the root.

    Skipping the root is a common optimization if you're just using the result as a sort key.

    I wasn't aware of that. It makes sense for integers. I wouldn't try it for floating point numbers where values -1.0 to 1.0 were expected.

    Why not? Try to come up with floating point numbers that break the sort order when the square root is skipped. I'll check back for your solution.

    Your right, I'm wrong. Sorry. Didn't think that one through. I was thinking about how numbers less that |1.0| squared are smaller than the original number.

  • (cs) in reply to Enterprise Architect
    Enterprise Architect:
    TRWTF is passing Girl by value instead of by const reference…

    GOOD ONE!

  • Eileen (unregistered)

    Sadly, this just ruined my faith in daily WTF. I though you guys were posting real code and not making stuff up. It's funny but no way did that actually happen.

  • Rich (unregistered)

    O(log(n)) vs O(n)

    double NthPower(double m, unsigned n) { double prod = 1.0; while(n) { if(prod & 0x1) prod *= m; m *= m; n >>= 1; } return prod; }

  • publiclurker (unregistered) in reply to Erasmus Darwin
    Erasmus Darwin:
    A few things no one's seemed to have commented on:

    NthPower is a case of reinventing the wheel, poorly. It's an inferior version of C/C++'s pow.

    The scoring algorithm should be its own function rather than being implemented twice in CompGirl. Hell, it should really be a method of Girl, but Dave seems intent on writing C in C++. He's taking advantage of a few syntactic conveniences of C++ while completely ignoring OOP.

    Even if you ignore the social implications and creep factor of ratings girls like that and wanting to blackmail Kendrick, Dave still seems to be a shitty programmer.

    Two things wrong with that:

    0: Treating a woman as an object is liable to get you into a lot of trouble in the workspace, and should be avoided.

    1: Expecting a woman to properly evaluate herself would be risky at best.

  • No Kendrick (unregistered)

    How can you resist making changes to that one and checking it back in?

    Add another woman, maybe a useful function or two at the top?

    My oh My!

  • boog (unregistered) in reply to Eileen
    Eileen:
    Sadly, this just ruined my faith in daily WTF. I though you guys were posting real code and not making stuff up. It's funny but no way did that actually happen.
    No kidding. There's no way this would happen. Darcy's body is a 3, tops.
  • (cs) in reply to toth
    toth:
    Andy:
    ...
         double g1_score = Square(g1.face) 
    -      + Square(g1.body) + Square(g1.legs);
    +      + Square(g1.body) + Square(g1.legs) + Round(g1.boobs);
         double g2_score = Square(g2.face) 
    -      + Square(g2.body) + Square(g2.legs);
    +      + Square(g2.body) + Square(g2.legs) + Round(g2.boobs);
    
    ...

    FTFY (why not use library functions that are already there?)

    FTFY, I for one prefer my boobs to be rounded, not cubes

  • (cs) in reply to DeaDPooL
    DeaDPooL:
    Too far fetched to believe IMO

    90% of programmers are socially broken. A tiny fraction of those are COMPLETELY BATSHIT OFF THE WALL PANTS ON HEAD RETARDED. Once you've met a member of that group, this kind of thing becomes "Wednesday" instead of "far fetched"

  • EmperorOfCanada (unregistered)

    I wonder if after work he turned all suave and had trouble sorting out which girls he was going to do?

  • ÃÆâ€â„ (unregistered)

    Obviously, the computer is controlling Dave, and Dave.cpp is the rough draft for the master program to enslave the human race. Obviously, since the computer chose to start with Dave, it's going along very slowly.

  • Hancock (unregistered)

    I don't get it....

    Double cum for a girl with short face, short legs and short body - this bloke clearly likes small girls.....

  • Justin (unregistered)

    Admit it, this whole post was just a really subtle advertisement for tower defense games website, wasn't it?

  • Buzz Killington (unregistered) in reply to Weng
    Weng:
    DeaDPooL:
    Too far fetched to believe IMO

    90% of programmers are socially broken. A tiny fraction of those are COMPLETELY BATSHIT OFF THE WALL PANTS ON HEAD RETARDED. Once you've met a member of that group, this kind of thing becomes "Wednesday" instead of "far fetched"

    And 57% of all statistics are made up on the spot. If 90% are socially broken, I must be the fucking MAN because I have friends AND a wife.

  • Jongles (unregistered) in reply to Martin Booth
    Martin Booth:
    Why square everything in the comparison function? Without negatives it makes no difference. With negatives someone with a -5 for their face would rate higher than a 4.. didn't dave get this code reviewed?

    It does make a difference.

    Consider 1,2,3 (sum = 6, sum of squares 14) vs 2,2,2 (sum = 6, sum of squares = 12).

    Ex: Now you try it with some other values.

  • Your Name (unregistered) in reply to Indrora
    Indrora:
    BentFranklin:
    wouldIDoHer should be an enum not a bool. Everyone knows there are three possible values:

    Would Wouldn't Why not?

    You forgot FILE_NOT_FOUND.
    PORT_NOT_FOUND?
  • Mitch (unregistered) in reply to madjo
    madjo:
    Maybe the appointment is for his daily spell checker? "Remeber"? Where's the second M?

    Remmeber?

  • Harpo (unregistered) in reply to JamesQMurphy
    JamesQMurphy:
    boog:
    So, the other day I was making the case that code was not a window into the emotions, experiences, and ultimately the soul of the developer.

    After seeing today's example, I stand corrected. Well played, TheDailyWTF. Well played.

    animal crackers or Lorna Doones
    Lorna Doones. No question. Cookie always beats cracker.

    I'm not sure if people outside the U.S. know about animal crackers here. Although they are called "crackers", they are actually sweet, like a butter cookie/biscuit. Despite Shirley Temple's song, animal crackers would not taste very good in soup.

    Oh! I thought 'Animal Crackers' was a movie. did Shirley Temple's song refer to 'Duck Soup'?

  • Brent (unregistered) in reply to Remy Porter
    Remy Porter:
    So, a non-WTF algorithm for quantifying people based on superficial physical characteristics would have the following features: 1) Attribute weighting: based on preference, attributes are weighted (some people will do anything for a pretty face, others for a massive rack, etc.) 2) Flexible attribute definitions: this algorithm offers nothing for the "ass man", nor does it offer fine grained control over "body", which- it's worth noting- contains many possible areas of interest.

    Both of these are unneeded. This is Dave.cpp, so the attributes are weighted for him, as are the choice of attributes. He obviously isn't interested in fine grained control over "body", which isn't so unreasonable, given that the areas of interest aren't independent so he might as well combine them into a single value to avoid adding complications like covariance to the calculations.

  • Anonimoose (unregistered) in reply to mfc
    mfc:
    //Remeber the f*cking appointment at 5 PM today

    I hope the f*cking appointment is for an interview somewhere else.

    It's a date. With Hashini.

  • (cs) in reply to publiclurker
    publiclurker:
    1: Expecting a woman to properly evaluate herself would be risky at best.

    Not to mention that it would lock you into whatever algorithm the woman feels like using, instead of using which ever algorithm the one actually using the application might want. Think of more than one user.

  • Matt Westwood (unregistered) in reply to Harpo
    Harpo:
    JamesQMurphy:
    boog:
    So, the other day I was making the case that code was not a window into the emotions, experiences, and ultimately the soul of the developer.

    After seeing today's example, I stand corrected. Well played, TheDailyWTF. Well played.

    animal crackers or Lorna Doones
    Lorna Doones. No question. Cookie always beats cracker.

    I'm not sure if people outside the U.S. know about animal crackers here. Although they are called "crackers", they are actually sweet, like a butter cookie/biscuit. Despite Shirley Temple's song, animal crackers would not taste very good in soup.

    Oh! I thought 'Animal Crackers' was a movie. did Shirley Temple's song refer to 'Duck Soup'?

    http://en.wikipedia.org/wiki/Animal_Crackers_in_My_Soup

  • Brent (unregistered) in reply to Franz Kafka
    Franz Kafka:

    Sure, lots of your coworkers put improper stuff in the source control system, but why would you keep your todo list in a cpp file in the first place?

    Force of habit? For the syntax highlighting?

  • Vincent (unregistered)

    Most hilarious post since a long, long time

  • Herby (unregistered) in reply to frits
    frits:
    SVN Commit 
       Message:
    
         Just what do you think you're doing, Dave?
         
         <span style="color:white;">obligatory</span>
    

    I'm sorry, Dave I can't do that for you.

  • AnOldRelic (unregistered) in reply to Weng
    Weng:
    DeaDPooL:
    Too far fetched to believe IMO

    90% of programmers are socially broken. A tiny fraction of those are COMPLETELY BATSHIT OFF THE WALL PANTS ON HEAD RETARDED. Once you've met a member of that group, this kind of thing becomes "Wednesday" instead of "far fetched"

    Dear God, how I wish you were wrong. But alas, welcome to my Tuesday... /cry

  • Mike (unregistered) in reply to Buzz Killington
    Buzz Killington:
    If 90% are socially broken, I must be the fucking MAN because I have friends AND a wife.

    That depends. Are they stored in your freezer?

  • Ouch! (unregistered) in reply to Anonimoose
    Anonimoose:
    mfc:
    //Remeber the f*cking appointment at 5 PM today

    I hope the f*cking appointment is for an interview somewhere else.

    It's a date. With Hashini.
    After all, you wouldn't want to test DaveGetsLucky.cpp in a production environment...
  • FILE_NOT_FOUND (unregistered) in reply to Your Name

    You also forgot DRUNK_ENOUGH and NOT_DRUNK_ENOUGH

  • (cs) in reply to anon
    JamesQMurphy:
    I can also guess what kind of appointment Dave has at 5pm.
    It's an appointment for MURDER
  • Mr.'; Drop Database -- (unregistered)

    The scores for face, body and legs would be better off multiplied. The face could probably be weighted more.

    double g1_score = Square(g1.face) * g1.body * g1.legs;
    or such.

  • (cs)

    How arrogant to have a WouldIDoHer bool and leave out everyone else.

    Personally I would have named the bool Doable, and allow others to set their own personal values for the supeficial weights, taking them all into account.

    Taking that even further, I'd add a DidHer int with a rating of how she was.

  • (cs)

    Don't forget the macro: #define wouldSheDoMe ( ! wouldIDoHer )

  • (cs) in reply to BentFranklin

    Or a tri-state bool!

    True = Would False = Wouldn't null or FileNotFound: Why not?

  • (cs) in reply to JamesQMurphy

    Neither would Shirley Temple. You'd have to exhume her body for starters...

  • butthead (unregistered) in reply to Richard
    Richard:
    Of course, if he hadn't told anyone, what're the odds that this would even have been noticed, since it wouldn't show up on a diff unless you nailed one of those two virgins?
    Heh-heh, heh-heh, I see what you did there! Also FTFY with the second one.
  • Adam Starks (unregistered) in reply to Vladimir Poutines
    Vladimir Poutines:
    Martin Booth:
    Why square everything in the comparison function? Without negatives it makes no difference. With negatives someone with a -5 for their face would rate higher than a 4.. didn't dave get this code reviewed?

    He probably meant to do root-sum-squared but forgot the root.

    It looks like Dave's treating it as a 3-dimensional vector, working in squared space to avoid an unnecessary square-root (all you're doing is comparing, not determining the actual value of the girl).
  • Name? (unregistered) in reply to drfreak

    Actually, she's still alive.

  • (cs) in reply to Your Name
    Your Name:
    Indrora:
    BentFranklin:
    wouldIDoHer should be an enum not a bool. Everyone knows there are three possible values:

    Would Wouldn't Why not?

    You forgot FILE_NOT_FOUND.
    PORT_NOT_FOUND?
    BackdoorAccessGranted ?
  • epsalon (unregistered) in reply to Rich
    Rich:
    O(log(n)) vs O(n)

    double NthPower(double m, unsigned n) { double prod = 1.0; while(n) { if(prod & 0x1) prod *= m; m *= m; n >>= 1; } return prod; }

    Your version doesn't compile. This one is correct:

    double NthPower(double m, unsigned n) { if (n<=0) return 1.0; double tmp=NthPower(m,n>>1); if (n&1) return mtmptmp; return tmp*tmp; }

  • anon (unregistered) in reply to tater tots
    tater tots:
    Fixed?

    const bool wouldIDoHer = true;

    win

  • (cs)

    Error: in dave.cpp:17 Error: Expected identifier before = token double *** = 1.0; ----------------^

Leave a comment on “Dave.cpp”

Log In or post as a guest

Replying to comment #:

« Return to Article