• kirby (unregistered)

    while (Comment.objects.filter(content="FRIST!!1").count() is not 0): try: Comment(content="FRIST!!one").save(force_insert=True) except: pass

  • bvs23bkv33 (unregistered)

    comment.save (force_insert=First)

  • someone (unregistered)

    I note product is capitalised in one place, and not in the other; that represents two separate variables in Python. Was the original code like that or has some error crept in along the way?

  • plis (unregistered) in reply to someone

    product = instance of Product

  • I dunno LOL ¯\(°_o)/¯ (unregistered)

    Just like they say in Galaxy Quest, "Never give up, never surrender!"

  • djingis1 (unregistered)

    One definition of insanity is doing the same thing over and over again, and expecting different results.

  • 04012018 (unregistered)

    Oh Four! Oh One too! Oh Four! Oh one to ate teen!



    PS: A quick and dirty way to avoid cross cuts in ORMs is to just call an API in the model methods, or actions or whatever scam hippy scum are running now just to make a dollar!

    Let's crash San Francisco in the Ocean to tidal wave Asia.

    They think Marx works? Maybe they can hold up their little red books and see if that saves them!

    That, or we can just give everyone AIDS.

    Guess what? The British already did! And now we're going to blame it on Putin!


  • RickRollMaster (unregistered)

    The metaphorical equivalent of Rick Roll's "Never gonna give you up" in program form. I feel trolled somehow.

  • Chronomium (unregistered)

    I feel like this might have started as a requirement of "insert unless something of that version/type combo already exists".

    The other seven eighths of the code don't have an excuse.

  • Anon The Mouse (unregistered)

    I'm not sure what's worse... code that never gives up like this... or code that assumes everything succeeded and just soldiers on regardless... like ours.

  • Carl Witthoft (google) in reply to djingis1

    <quote>One definition of insanity is doing the same thing over and over again, and expecting different results</quote> for j = 1:100 { random() }

    Now who's insane?

  • Carl Witthoft (google)
    One definition of insanity is doing the same thing over and over again, and expecting different results

    for j = 1:100 { random() }

    Now who's insane?

  • Another Anon (unregistered) in reply to Carl Witthoft

    What are you talking about? You're getting the same result, a random number.

    Now, if you expected to get a color, or a person's name, after the random number, then you might just be insane.

    If random() does give a color and then a person's name after the random number, then the function might just be insane.

  • 04012018 (unregistered)

    So, this is what I'm going to do:

    I'm going to start putting creatives on an S3 account with Cloudfront in front of it, labeled like 1.jpg, 2.jpg, 3.jpg ...

    Then I'm going to make some js client side garbage that just picks one at random. That js script is going to be on ....


    The S3 logs dictate payout from my freelancer salary. My break even is $2,000 a month. Anything above that goes to 04012018 payouts.

    If you want in on this, I'll create a whitelist of other people. And that's going to be hosted on ...


    Since everyone is listening, thanks to Assange and Snowden, I'm turning everyone into @Comey right out of the gate. If you are a child predator, don't look for "god" for help. You will probably be ex-parte assassinated by a gang of lawless pirates in really, the worst humanistic way possible.

    If you want to sue me, talk to whatever bank robo-signed me 10 years ago, and try taking my house valued now at $18k with a $70,000 mortgage, due to the burnings, the sword murderers, the shootings, the drunk fist fights, the biker shows of force, the job loss, and everything else a bunch of spoiled children unleashed on me. Nicer places can be rented out for less than $100 where I live. I will strip the god damn thing bare and sell it to nomadic gypsies if I have too.

    Plus, I will do some single mother scam! That's legal, right? Just setup a bunch of women at said $100 rent, get them pregnant, and collect welfare? If it is good for William Jefferson, it's good for me too!

    That, or you can call of the SA Goon army, and let me go back to work on the freelance site, you decadent Silicon Valley perverts. Don't you have work to do? What do your shareholders and boards of directors and the your Communist Overlords of the Chinese and Iranian army have to say?

    PS: Tell the money people they are better off just buying GNMA.

  • Sole Purpose of Visit (unregistered) in reply to 04012018

    Is there any good reason why 50% of comments are "moderated, presumed moribund," and this one is passed through? Nice article, Remy. But here is where we see TRWTF.

  • Jezor (unregistered)

    It can still fail if the check throws an exception!

  • Zenith (unregistered)

    Reminds me of a basket case program that I briefly worked on. The Indian didn't understand ADO, so it mandated Entity with no grasp of that either, and wrapped that into an opaque "framework" in a locked TFS repository. Said framework was such that no object could be saved twice without throwing an exception that was basically word salad. It wouldn't respond to bug reports, so I did what I could, which was jump through the object hierarchy at runtime and flip some internal property to "reset" it enough for the subsequent saves to work. Because the Indian had a penchant for randomly touching simple stuff followed by a round of finger pointing, I had to put this all into one long line with no spaces and the only documentation was "workaround for Amberlamps framework bug." Of course he went into his howler monkey "do you not know how busy I am reverting the needful mails?!" tirade but wouldn't remove the line. Probably shut down its brain every time it tried to pull it apart. Anyway, my point was that sometimes the WTF isn't code like this but further upstream.

Leave a comment on “A Repeated Save”

Log In or post as a guest

Replying to comment #:

« Return to Article