• (cs) in reply to xtremezone
    xtremezone:
    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 versions?
    Not to mention, if he had been in the least bit competent, he would have just asked Google, or IRC, or any number of other places online how to undo a commit in Subversion rather than going to somebody on his team and bringing attention to himself. I think it is possible, but it's not pretty, and requires direct access to the repository (which I'm guessing he wouldn't have had).

    Still, blindly adding files to source control is incompetent anyway... Probably a Windows n00b.

    [sarcasm]Yeah, thats the problem here. That he was adding every file in his workspace to subversion. I mean come on, think of all the file space he is wasting on the subversion server with this stuff that could otherwise have been used to store the pictures he had taken of Darcy with his hidden bathroom camera.[/sarcasm]

  • (cs) in reply to No Kendrick
    No Kendrick:
    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!

    What you could do is have a key file use a method like Cube and then complain that he broke the build when he deleted it. Or even better add it to a file Lauren usually maintains and let her figure out how it broke.

  • Nick (unregistered) in reply to Google is your friend
    Google is your friend:
    Dear Dave,

    A better idea would be to do a quick Google search and find out that you can in fact delete a file from a Subversion repository (if you use the URL).

    And Noah, do you even knowah anything about Subversion?

    kthxbye

    Yes, you can delete files, but that does not remove the file from the repo, only from the current revision, what Dave wants is obliterate, which completely removes all references to the file in the repo. SVN does not have this command, yet.

    You can do it the "hard" way with svndump though. I have done this many times to remove binary files that users have checked in.

  • The 2-Belo (unregistered) in reply to @Deprecated
    @Deprecated:
    tater tots:
    Fixed?

    const bool wouldIDoHer = true;

    You forgot: const bool didSheSlapMe = true;

    const bool HOWCANYOUSLAP = true;

  • (cs) in reply to Hancock
    Hancock:
    I don't get it....

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

    At a guess, Dave had to lower his standards - literally.

  • (cs)

    I have correct the Subject to put in the proper language in which this code is written, except for the fact that AddGirls needs struct Girl[3] at the top (unless C has changed).

    In C++ you use std::string not char*.

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

    Definitely not.

    What happens in the function stays in the function.

  • (cs)

    No such thing as passing by const reference in C, the language in which the code is written.

  • (cs) in reply to nwbrown
    nwbrown:
    What you could do is have a key file use a method like Cube and then complain that he broke the build when he deleted it. Or even better add it to a file Lauren usually maintains and let her figure out how it broke.

    "The build" is one of the biggest WTFs

  • scamz (unregistered) in reply to Anonymous
    Anonymous:
    DeaDPooL:
    Too far fetched to believe IMO
    From personal experience I disagree. The devs at my company are absolutely useless when it comes to code syncs (we use Serena Dimensions with the Windows Explorer plugin for synching a local work area with the back-end). They are forever checking in files that have no place being in source control, just because said file was in their work area and they forgot to delete/ignore it before syncing. This happens about once a week, give or take.

    Now, plenty of our coders write stuff on their own time, either proper code or fun little algorithms like Dave's "girl-ranking" algorithm. I really don't think it is much of a stretch for a non-work file to end up in a synchronisable work area. If that happens and you don't pay attention whilst syncing, crap like this is inevitable. I've never come across a girl-ranking algorithm but I have certainly seen plenty of examples of inappropriate files being commited to source control due to a bad sync.

    What is so difficult about creating a new project for your personal code that is not linked to source control?! If the devs here didn't have the brains to figure out how to do that then they'd deserve to be fired :/

  • (cs)

    WTF where WT stands for Who To?

  • Barbra (unregistered)

    Such a fine example of the Streisand effect (http://en.wikipedia.org/wiki/Streisand_effect). You approach someone with the intention of removing an embarrassing checkin, and that guy publishes it to The Daily WTF.

  • Me (unregistered) in reply to tater tots

    You made my day.

  • (cs) in reply to Remy Porter

    Also, from an OOD perspective, it would be better to have the score calculation as a method of a Girl object, to have DRY/SPOT code.

  • inhibeo (unregistered) in reply to NSCoder
    NSCoder:
    WTF where WT stands for Who To?
    Who To Failure?
  • Latkes, Yum! (unregistered) in reply to inhibeo
    inhibeo:
    NSCoder:
    WTF where WT stands for Who To?
    Who To Failure?

    Is that what you call it? Because I always consider it a win (at least for me).

  • Paul (unregistered) in reply to Latkes, Yum!

    Unless it's Hashini

  • Bukkake (unregistered)

    for (Gril grl: allGirls) {

    grl.getStringFromObj();

    }

  • smoogalhead (unregistered) in reply to Remy Porter

    I've had this kind of problem before, but usually it's for a reasonable excuse. It can be quite tricky to remove data from SVN, it isn't primarily designed for that, in fact the point is to provide a high level of retention. I've encountered a fair few situations where things like passwords, etc have mistakenly made their way into an SVN revision somewhere.

  • Boris (unregistered) in reply to Google is your friend

    Just doing

    svn rm http://url/to/repo/some/file
    or whatever won't "remove the file from Subversion"; it has more or less the same effect as doing an
    svn rm
    and
    svn ci
    locally, and the old revision still shows up in the version history and can be found in diffs, etc.

    You can purge a file from the historical record, but it's not pretty; see http://svnbook.red-bean.com/en/1.5/svn.reposadmin.maint.html#svn.reposadmin.maint.filtering - essentially, you have to dump, filter and re-import the repository, which mandates some downtime, which explains why people don't do it unless they absolutely have to.

  • Anonimoose (unregistered) in reply to Latkes, Yum!
    Latkes:
    inhibeo:
    NSCoder:
    WTF where WT stands for Who To?
    Who To Failure?

    Is that what you call it? Because I always consider it a win (at least for me).

    The Daily Win Than Failure?

  • (cs) in reply to smoogalhead
    smoogalhead:
    I've had this kind of problem before, but usually it's for a reasonable excuse. It can be quite tricky to remove data from SVN, it isn't primarily designed for that, in fact the point is to provide a high level of retention. I've encountered a fair few situations where things like passwords, etc have mistakenly made their way into an SVN revision somewhere.

    If that happens can't you just change the passwords?

  • tation (unregistered)

    Girl.name = "Irish" Girl.wouldIDoHer = on a wooden table

  • PITA (unregistered) in reply to drfreak
    drfreak:
    Neither would Shirley Temple. You'd have to exhume her body for starters...
    She is still alive.
  • Phyzz (unregistered) in reply to boog
    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.

    We'd have gotten a good story either way }:)

  • Jake (unregistered)

    By the way, that's not a very effective way to compare two "Girl"s. The reason is the same as the reason why we don't use absolute distance to compute the line in a linear regression and use sum of squares of the distances instead.

  • Rich (unregistered) in reply to epsalon

    My mistake, typo. Didn't try it in the compiler the first time. Chane the variable 'prod' in the if statement to 'n' and all is well.

  • (cs) in reply to boog
    boog:
    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.

    He means Darcy in Accounting, not Darcy in Engineering.

  • (cs)

    good story, but we need to know who Kendrick and Lauren are and why Dave is obsessed with them

  • Shinobu (unregistered)

    Methinks and PITA: YHBT (And maybe I've been too. But if I don't post this some pour sod might come away thinking that FTFY means ‘fucked that ** for you’.)

  • slacking off (unregistered) in reply to tater tots

    I think you mean static const bool wouldIDoHer = true;

  • Bonce (unregistered)

    TRWTF which nobody seems to have picked up on is needing software to decide which girl is more desirable.

    Whatever happened to gut instinct?

  • Tom (unregistered)

    Darcy sounds nice

  • PITA (unregistered) in reply to Shinobu
    Shinobu:
    Methinks and PITA: YHBT (And maybe I've been too. But if I don't post this some pour sod might come away thinking that FTFY means ‘fucked that ** for you’.)
    Sometimes that's the only lovin' I get.
  • (cs)

    Animal Crackers

    "Animal crackers are crackers in the shapes of animals, some brands of which are sweetened. These are usually animals one would see at the zoo or circus, including lions, tigers, bears, and elephants. There is debate about whether or not animal crackers are actually crackers or cookies. They resemble crackers due to the way they are made, with layered dough, but the use of sweetened dough gives them the cookie taste and consistency."

    Circus Animal Cookies

    I remember circus animal cookies that were similar to animal crackers but covered on one side with hard pink icing. Unfortunately, the only circus animal cookies I've seen lately are these – totally drenched in overly sweet, soft, pink frosting and brightly covered sprinkles.

  • (cs) in reply to Bonce
    Bonce:
    TRWTF which nobody seems to have picked up on is needing software to decide which girl is more desirable.

    Whatever happened to gut instinct?

    You're assuming that Dave actually has some gut instinct...

  • (cs) in reply to MarkJ
    MarkJ:
    Bonce:
    TRWTF which nobody seems to have picked up on is needing software to decide which girl is more desirable.

    Whatever happened to gut instinct?

    You're assuming that Dave actually has some gut instinct...

    ...or intinct at a lower level.

  • Mr. Bob (unregistered)

    legs should be of type long. Everyone knows that.

  • LDB (unregistered) in reply to @Deprecated
    @Deprecated:
    And what's he got against Kendrick, anyway?

    Kendrick.isDoing(Darcy) == true; Lauren.wants(Kendrick) == true;

  • LDB (unregistered) in reply to Corey
    Corey:
    I can't help but think that better unit testing might spare him some embarrassment...

    Unit testing....isn't that what he's hoping to accomplish ultimately?

  • Captha Duis (unregistered)

    If managers could code, Dave.cpp is what it would look like.

  • PeterG (unregistered) in reply to Remy Porter

    @RemyPorter:

    You are making a common mistake many programmers make. They over design their code for situations that will never arise. Clearly, this code was designed by Dave and optimized for Dave. To generalize the code for anyone else would be overkill.

    Always remember, code to the situation at hand. Generalized code is good for OS APIs and other situations where you can't foresee all the ways it will used. In all other cases, use the programmer's equivalent of Occam's razor, and write just enough code to solve the problem. This is a corollary to the old programming adage: "The easiest code to debug is the code you never write."

    These truths are what make Dave's reductionist code brilliant.

  • Mr.Hanky (unregistered) in reply to tater tots

    wouldIDoHer should be a function:

    bool wouldIDoHer(double score, double bloodAlcoholLevel, unsigned int noOfPeopleWhoWouldKnow) {

    //some complex calculations, or just return true; }

  • boog (unregistered) in reply to AlpineR
    AlpineR:
    ...the only circus animal cookies I've seen lately are these – totally drenched in overly sweet, soft, pink frosting and brightly covered sprinkles.
    I know, they're freakin' delicious, amirite?!
  • iMalc (unregistered)

    What a dork, we all know that Girls should be passed by const reference for the comparison!

  • (cs) in reply to Mr. Bob
    Mr. Bob:
    legs should be of type long. Everyone knows that.
    Definitely. I was going to say it should be long legs not short legs but you beat me to it.
  • Octavian (unregistered)

    I would use an improved structure instead :)

    struct Girl {..... long legs; short rank; long score; char * phone_number; .....};

    and here is a sorting routine:

    Girl AllGirls[n]; Girl TempGirl; int i=1;

    for(i=1;i<=n;i++;){ AllGirls[i].score = Square(AllGirls[i].face) + Square(AllGirls[i].body) + Square(AllGirls[i].legs);
    }

    i=1;j=1; for (j=1;j<n;j++) while (i<n) do{ if (AllGirls[i+1].score > AllGirls[i].score) TempGirl = AllGirls[i]; AllGirls[i] = AllGirls[i+1]; AllGirls[i+1] = TempGirl; } } //slowest sorting algorithm but it works and I am in a hurry

    Have fun !!! :)

  • noo (unregistered) in reply to Andy

    short boobs? i dunno ... maybe long boobs? (eww) float boobs? might be creepy

    double boobs -- a real winner! :)

  • Mythran (unregistered) in reply to noo
    noo:
    short boobs? i dunno ... maybe long boobs? (eww) float boobs? might be creepy

    double boobs -- a real winner! :)

    Now to finish what you started:

    string boobs (a string of them?! 20...30+? Nice!)

  • Octavian (unregistered) in reply to noo

    it was "short rank" not rack and it is meaning howgood is the girl; the rank represent how good the girl is ;)

    but I think "boobs" was a missing attribute so it should of been there with double :)

    So the reviewed Girl structure would be: struct Girl { char * name; short face; long body; double boobs; long legs; double rank; short score; char * phone_number; bool wouldIDoHer; };

    Have fun coding !!!

Leave a comment on “Dave.cpp”

Log In or post as a guest

Replying to comment #:

« Return to Article