Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. The algorithm of success !

The algorithm of success !

Scheduled Pinned Locked Moved The Lounge
algorithms
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Captain Price
    wrote on last edited by
    #1

    while(noSuccess)
    {
    tryAgain();

    if(dead)
    break;
    }

    "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

    K M F 3 Replies Last reply
    0
    • C Captain Price

      while(noSuccess)
      {
      tryAgain();

      if(dead)
      break;
      }

      "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

      K Offline
      K Offline
      kmg365
      wrote on last edited by
      #2

      * polling is inefficient * code implies noSuccess is static (c), at the very least no way to know how it is set or it's scope. * try catch for exception handler is preferred. * dead has no initial condition. please tryAgain() :)

      "Sanity is not statistical." - Eric Blair, 1984, Chapter 9

      1 Reply Last reply
      0
      • C Captain Price

        while(noSuccess)
        {
        tryAgain();

        if(dead)
        break;
        }

        "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

        M Offline
        M Offline
        Member 9475889
        wrote on last edited by
        #3

        Looks similar to the algorithm for insanity:

        while(unexpectedResult)
        {
        repeat();

        if(insane) break;
        }

        S 1 Reply Last reply
        0
        • M Member 9475889

          Looks similar to the algorithm for insanity:

          while(unexpectedResult)
          {
          repeat();

          if(insane) break;
          }

          S Offline
          S Offline
          Super Lloyd
          wrote on last edited by
          #4

          while(unexpectedResult || insane)
          {
          repeat();
          }

          My programming get away... The Blog... DirectX for WinRT/C# since 2013! Taking over the world since 1371!

          1 Reply Last reply
          0
          • C Captain Price

            while(noSuccess)
            {
            tryAgain();

            if(dead)
            break;
            }

            "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

            F Offline
            F Offline
            Forogar
            wrote on last edited by
            #5

            One definition of stupidity is to keep repeating something expecting a different result, for example, attempt to take photograph with lens cover on; comes out black; try again; repeat.

            - I would love to change the world, but they won’t give me the source code.

            C 1 Reply Last reply
            0
            • F Forogar

              One definition of stupidity is to keep repeating something expecting a different result, for example, attempt to take photograph with lens cover on; comes out black; try again; repeat.

              - I would love to change the world, but they won’t give me the source code.

              C Offline
              C Offline
              Captain Price
              wrote on last edited by
              #6

              Einstein said that; Insanity: doing the same thing over and over again and expecting different results.

              "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

              F R 2 Replies Last reply
              0
              • C Captain Price

                Einstein said that; Insanity: doing the same thing over and over again and expecting different results.

                "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

                F Offline
                F Offline
                Forogar
                wrote on last edited by
                #7

                Well, there you go! If Einstein said it I will go along with it. :-D

                - I would love to change the world, but they won’t give me the source code.

                1 Reply Last reply
                0
                • C Captain Price

                  Einstein said that; Insanity: doing the same thing over and over again and expecting different results.

                  "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

                  R Offline
                  R Offline
                  Rob Grainger
                  wrote on last edited by
                  #8

                  Unless of course you're studying quantum mechanics, oh, wait...

                  "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups