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. Factor this.

Factor this.

Scheduled Pinned Locked Moved The Lounge
databasecom
19 Posts 9 Posters 2 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.
  • A Andy Brummer

    Or the enterprise numbers table with a number type column and reference table for prime, not prime, the associated entities, wcf service methods and all the unit tests IsXXXXXPrime. :-D

    Curvature of the Mind

    M Offline
    M Offline
    Mark_Wallace
    wrote on last edited by
    #10

    Andy Brummer wrote:

    Or the enterprise numbers table with a number type column and reference table for prime, not prime, the associated entities, wcf service methods and all the unit tests IsXXXXXPrime.

    My Boy, you not only keep your job, but I'm giving you seniority!

    I wanna be a eunuchs developer! Pass me a bread knife!

    1 Reply Last reply
    0
    • A Andy Brummer

      The system that I work on has a sql table that encodes a hierarchy with 2 columns. The first has prime numbers and the second has the value from the first column multiplied by all the keys of the parents for that row. To get all the children for a row you get all records where the current key divides the value for the second column. :|

      Curvature of the Mind

      L Offline
      L Offline
      leckey 0
      wrote on last edited by
      #11

      After working with Oracle that has been overcustomized for 10 months, I think this may be an improvement.

      Soon...very soon...http://CraptasticNation.blogspot.com/[^]

      A 1 Reply Last reply
      0
      • A Andy Brummer

        Or the enterprise numbers table with a number type column and reference table for prime, not prime, the associated entities, wcf service methods and all the unit tests IsXXXXXPrime. :-D

        Curvature of the Mind

        D Offline
        D Offline
        Dan Neely
        wrote on last edited by
        #12

        enum Bool { True, False, FileNotFoundNeither };

        3x12=36 2x12=24 1x12=12 0x12=18

        1 Reply Last reply
        0
        • A Andy Brummer

          The system that I work on has a sql table that encodes a hierarchy with 2 columns. The first has prime numbers and the second has the value from the first column multiplied by all the keys of the parents for that row. To get all the children for a row you get all records where the current key divides the value for the second column. :|

          Curvature of the Mind

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #13

          That's so unbelievably wrong. You must need to keep the number of entries in the table fairly small, considering what a complete hash of things would happen in the event of an overflow in the second column value.

          Software Zen: delete this;
          Fold With Us![^]

          A 1 Reply Last reply
          0
          • A Andy Brummer

            The system that I work on has a sql table that encodes a hierarchy with 2 columns. The first has prime numbers and the second has the value from the first column multiplied by all the keys of the parents for that row. To get all the children for a row you get all records where the current key divides the value for the second column. :|

            Curvature of the Mind

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #14

            erm, why? At least it makes my MS Access application, that contains a table with a single dateTime column containing the dates of the last day of the month seem somehow quite technically sound!

            ___________________________________________ .\\axxx (That's an 'M')

            A 1 Reply Last reply
            0
            • G Gary R Wheeler

              That's so unbelievably wrong. You must need to keep the number of entries in the table fairly small, considering what a complete hash of things would happen in the event of an overflow in the second column value.

              Software Zen: delete this;
              Fold With Us![^]

              A Offline
              A Offline
              Andy Brummer
              wrote on last edited by
              #15

              I know, not to mention a table scan with every lookup. The primes I saw were in the 900 range at least, so there would definitely be the potential for overflow. Good thing the hierarchy is only a few levels deep. The only other anti-pattern like that was doing bit fields for security lookups on some web site I'm not going to mention.

              Curvature of the Mind

              1 Reply Last reply
              0
              • L Lost User

                erm, why? At least it makes my MS Access application, that contains a table with a single dateTime column containing the dates of the last day of the month seem somehow quite technically sound!

                ___________________________________________ .\\axxx (That's an 'M')

                A Offline
                A Offline
                Andy Brummer
                wrote on last edited by
                #16

                It is definitely inventive, and it does work, so I can't fault anyone on that. However, I think it will be "refactored" sometime soon.

                Curvature of the Mind

                1 Reply Last reply
                0
                • L leckey 0

                  After working with Oracle that has been overcustomized for 10 months, I think this may be an improvement.

                  Soon...very soon...http://CraptasticNation.blogspot.com/[^]

                  A Offline
                  A Offline
                  Andy Brummer
                  wrote on last edited by
                  #17

                  Holy crap, that must be beastly.

                  Curvature of the Mind

                  L 1 Reply Last reply
                  0
                  • A Andy Brummer

                    Holy crap, that must be beastly.

                    Curvature of the Mind

                    L Offline
                    L Offline
                    leckey 0
                    wrote on last edited by
                    #18

                    It's a nightmare. All this customization so when you change one thing, something else breaks, but heaven forbit we DOCUMENT anything so we know that ahead of time. X|

                    Soon...very soon...http://CraptasticNation.blogspot.com/[^]

                    1 Reply Last reply
                    0
                    • A Andy Brummer

                      The system that I work on has a sql table that encodes a hierarchy with 2 columns. The first has prime numbers and the second has the value from the first column multiplied by all the keys of the parents for that row. To get all the children for a row you get all records where the current key divides the value for the second column. :|

                      Curvature of the Mind

                      L Offline
                      L Offline
                      lognormal
                      wrote on last edited by
                      #19

                      A geeky remark: This prime number multiplication game is the essence of the "Godel numbering scheme" invented in the 1930's by the mathematician Kurt Godel and used by him to prove that all formal systems are either inconsistent or incomplete - very cool if you are a mathematician. The "problem" with this approach is that it quickly produces huge (vast) numbers if your tree is big and deep. But good idea! :)

                      Why make life more difficult than it is?

                      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