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. Question in the Lounge

Question in the Lounge

Scheduled Pinned Locked Moved The Lounge
question
20 Posts 11 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.
  • W W Balboos GHB

    I have a similar hell, myself. The company is spinning off a subsidiary and employees are being transferred to the subsidiary. The management hierarchy, during the transition, is such that a manage in one 'company' may be managing employees from the other or both. There's also a third 'company' which, except for a list of employees, is still a mystery to me. Meanwhile, people get privileges based upon their department and their group. If you picture these as Venn diagrams, they don't necessarily fully overlap - and the can cross over boundaries. Spread across multiple locations. Essentially, it's mapping an every changing number of many-to-many lists. The obvious answer is, of course, a view that lets you find all of each employees relationships. A long list, each employee (by uid, for example) occurring many times, mapping them to an ever changing state. The key to this is that the view, itself, needs to be modified as the management changes the rules and shuffles people about. Partly, it's manipulating/adding to UNION's - but also, how selections are made, and creating/destroying columns as nuances erupt. It's a game of whack-a-mole, but, once in place - and one bites the bullet that the solution will break - the logic of the view (views?) does the deed without causing damage.

    Ravings en masse^

    "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

    "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

    C Offline
    C Offline
    CodeWraith
    wrote on last edited by
    #4

    I like it when they reorganize the company. The managers are so busy creating chaos and fighting each other that they find no time to harass me.

    I have lived with several Zen masters - all of them were cats.

    1 Reply Last reply
    0
    • N Nagy Vilmos

      Here. I'm mulling over an idea that requires merging multiple lists. At some point in their history, the lists diverge and I need to make sure that when they combine, lists contain all the items. The sizes of the lists are in the thousands and are persisted. I just need to work out a way to merge them efficiently. Ideas? Name for the concept?

      veni bibi saltavi

      P Offline
      P Offline
      phil o
      wrote on last edited by
      #5

      You could use a HashSet and feed it with each of your original list. Redundant items will be discarded if item is already present. You can even provide your own equality comparer. If you want to check whether you caught all original items, you can call the IsSupersetOf(IEnumerable) method for all of original lists; it should return true for all of them.

      "I'm neither for nor against, on the contrary." John Middle

      1 Reply Last reply
      0
      • W W Balboos GHB

        I have a similar hell, myself. The company is spinning off a subsidiary and employees are being transferred to the subsidiary. The management hierarchy, during the transition, is such that a manage in one 'company' may be managing employees from the other or both. There's also a third 'company' which, except for a list of employees, is still a mystery to me. Meanwhile, people get privileges based upon their department and their group. If you picture these as Venn diagrams, they don't necessarily fully overlap - and the can cross over boundaries. Spread across multiple locations. Essentially, it's mapping an every changing number of many-to-many lists. The obvious answer is, of course, a view that lets you find all of each employees relationships. A long list, each employee (by uid, for example) occurring many times, mapping them to an ever changing state. The key to this is that the view, itself, needs to be modified as the management changes the rules and shuffles people about. Partly, it's manipulating/adding to UNION's - but also, how selections are made, and creating/destroying columns as nuances erupt. It's a game of whack-a-mole, but, once in place - and one bites the bullet that the solution will break - the logic of the view (views?) does the deed without causing damage.

        Ravings en masse^

        "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

        "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

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

        OT but sounds a lot like something I did a long time ago in uni using prolog, don't laugh but that is prolog's forte, figuring out complex relationships in "data webs" (i.e. more complicated than trees, think overlapping trees joined at arbitrary points). , I remember prolog as one of those things like stereograms (those hidden 3-d images) that you can stare at for hours with no clue what/how it does anything, and then in an instant it just makes sense. (I can understand how prolog has a place in AI - but back in hte old days it was mostly just a novelty.) I said twas long ago, wouldn't even know where to start.

        Signature ready for installation. Please Reboot now.

        1 Reply Last reply
        0
        • W W Balboos GHB

          I have a similar hell, myself. The company is spinning off a subsidiary and employees are being transferred to the subsidiary. The management hierarchy, during the transition, is such that a manage in one 'company' may be managing employees from the other or both. There's also a third 'company' which, except for a list of employees, is still a mystery to me. Meanwhile, people get privileges based upon their department and their group. If you picture these as Venn diagrams, they don't necessarily fully overlap - and the can cross over boundaries. Spread across multiple locations. Essentially, it's mapping an every changing number of many-to-many lists. The obvious answer is, of course, a view that lets you find all of each employees relationships. A long list, each employee (by uid, for example) occurring many times, mapping them to an ever changing state. The key to this is that the view, itself, needs to be modified as the management changes the rules and shuffles people about. Partly, it's manipulating/adding to UNION's - but also, how selections are made, and creating/destroying columns as nuances erupt. It's a game of whack-a-mole, but, once in place - and one bites the bullet that the solution will break - the logic of the view (views?) does the deed without causing damage.

          Ravings en masse^

          "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

          "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

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

          OT but sounds a lot like something I did a long time ago in uni using prolog, don't laugh but that is prolog's forte, figuring out complex relationships in "data webs" (i.e. more complicated than trees, think overlapping trees joined at arbitrary points). , I remember prolog as one of those things like stereograms (those hidden 3-d images) that you can stare at for hours with no clue what/how it does anything - suck at 0%, and then in an instant it just makes sense (really was 0% to 100% with no in-between). I can understand how prolog has a place in AI - but back in those old days it was mostly just a novelty. I said twas long ago, wouldn't even know where to start.

          Signature ready for installation. Please Reboot now.

          1 Reply Last reply
          0
          • N Nagy Vilmos

            Here. I'm mulling over an idea that requires merging multiple lists. At some point in their history, the lists diverge and I need to make sure that when they combine, lists contain all the items. The sizes of the lists are in the thousands and are persisted. I just need to work out a way to merge them efficiently. Ideas? Name for the concept?

            veni bibi saltavi

            T Offline
            T Offline
            Tim Carmichael
            wrote on last edited by
            #8

            1. No programming questions in the lounge, and that is what is being asked for despite the wording. 2. Dump the data into a single list and select back only distinct items - the platform, tools, etc. are your choice.

            Z 1 Reply Last reply
            0
            • L Lost User

              Nagy Vilmos wrote:

              The sizes of the lists are in the thousands and are persisted. I just need to work out a way to merge them efficiently.

              Similar to a JOIN in SQL?

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              N Offline
              N Offline
              Nagy Vilmos
              wrote on last edited by
              #9

              It's a join except at the end the merged list is shared. Makes sense? ``` L0 = 0, 1, 2 L1 = 1, 3, 4 L2 = 2, 5, 6 ``` first two merge: ``` L0 = 0, 1, 2, 3, 4 L1 = 0, 1, 2, 3, 4 L2 = 2, 5, 6 ``` Then `L2` merges with `L1`: ``` L0 = 0, 1, 2, 3, 4 L1 = 0, 1, 2, 3, 4, 5, 6 L2 = 0, 1, 2, 3, 4, 5, 6 ``` Sort of. At some point `L0` will merge again and all will be happy. I think.

              veni bibi saltavi

              1 Reply Last reply
              0
              • N Nagy Vilmos

                Here. I'm mulling over an idea that requires merging multiple lists. At some point in their history, the lists diverge and I need to make sure that when they combine, lists contain all the items. The sizes of the lists are in the thousands and are persisted. I just need to work out a way to merge them efficiently. Ideas? Name for the concept?

                veni bibi saltavi

                M Offline
                M Offline
                Marc Clifton
                wrote on last edited by
                #10

                Nagy Vilmos wrote:

                Name for the concept

                Assuming no duplicates? So, what, "add distinct by"?

                public static void AddRangeDistinctBy(this List target, IEnumerable src, Func equalityComparer)
                {
                src.ForEach(item =>
                {
                // no items in the list must match the item.
                if (target.None(q => equalityComparer(q, item)))
                {
                target.Add(item);
                }
                });
                }

                Inefficient and not thread safe but gets the job done.

                Latest Article - Class-less Coding - Minimalist C# and Why F# and Function Programming Has Some Advantages Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                B 1 Reply Last reply
                0
                • N Nagy Vilmos

                  Here. I'm mulling over an idea that requires merging multiple lists. At some point in their history, the lists diverge and I need to make sure that when they combine, lists contain all the items. The sizes of the lists are in the thousands and are persisted. I just need to work out a way to merge them efficiently. Ideas? Name for the concept?

                  veni bibi saltavi

                  C Offline
                  C Offline
                  CPallini
                  wrote on last edited by
                  #11

                  Quote:

                  At some point in their history, the lists diverge

                  Make a list of divergent items. :-D

                  1 Reply Last reply
                  0
                  • T Tim Carmichael

                    1. No programming questions in the lounge, and that is what is being asked for despite the wording. 2. Dump the data into a single list and select back only distinct items - the platform, tools, etc. are your choice.

                    Z Offline
                    Z Offline
                    ZurdoDev
                    wrote on last edited by
                    #12

                    Tim Carmichael wrote:

                    No programming questions in the lounge, and that is what is being asked for despite the wording.

                    That rule does not apply to members above a certain point level. :rolleyes:

                    There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

                    B 1 Reply Last reply
                    0
                    • N Nagy Vilmos

                      Here. I'm mulling over an idea that requires merging multiple lists. At some point in their history, the lists diverge and I need to make sure that when they combine, lists contain all the items. The sizes of the lists are in the thousands and are persisted. I just need to work out a way to merge them efficiently. Ideas? Name for the concept?

                      veni bibi saltavi

                      N Offline
                      N Offline
                      Nicholas Marty
                      wrote on last edited by
                      #13

                      Wouldn't this simply be a "Union"? At least in SQL Server a union merges multiple result sets and filters out duplicate results (unless you use UNION ALL instead of just UNION). I'd assume most frameworks employ a similiar concept (at the .Net Linq Method "Union" does this as well)

                      1 Reply Last reply
                      0
                      • W W Balboos GHB

                        I have a similar hell, myself. The company is spinning off a subsidiary and employees are being transferred to the subsidiary. The management hierarchy, during the transition, is such that a manage in one 'company' may be managing employees from the other or both. There's also a third 'company' which, except for a list of employees, is still a mystery to me. Meanwhile, people get privileges based upon their department and their group. If you picture these as Venn diagrams, they don't necessarily fully overlap - and the can cross over boundaries. Spread across multiple locations. Essentially, it's mapping an every changing number of many-to-many lists. The obvious answer is, of course, a view that lets you find all of each employees relationships. A long list, each employee (by uid, for example) occurring many times, mapping them to an ever changing state. The key to this is that the view, itself, needs to be modified as the management changes the rules and shuffles people about. Partly, it's manipulating/adding to UNION's - but also, how selections are made, and creating/destroying columns as nuances erupt. It's a game of whack-a-mole, but, once in place - and one bites the bullet that the solution will break - the logic of the view (views?) does the deed without causing damage.

                        Ravings en masse^

                        "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

                        "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

                        B Offline
                        B Offline
                        BillWoodruff
                        wrote on last edited by
                        #14

                        That's a great response to a question that should have been asked in another forum !

                        «While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)

                        1 Reply Last reply
                        0
                        • Z ZurdoDev

                          Tim Carmichael wrote:

                          No programming questions in the lounge, and that is what is being asked for despite the wording.

                          That rule does not apply to members above a certain point level. :rolleyes:

                          There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

                          B Offline
                          B Offline
                          BillWoodruff
                          wrote on last edited by
                          #15

                          HappyFestivus wrote:

                          That rule does not apply to members above a certain point level.

                          Wrong !

                          «While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)

                          L 1 Reply Last reply
                          0
                          • N Nagy Vilmos

                            Here. I'm mulling over an idea that requires merging multiple lists. At some point in their history, the lists diverge and I need to make sure that when they combine, lists contain all the items. The sizes of the lists are in the thousands and are persisted. I just need to work out a way to merge them efficiently. Ideas? Name for the concept?

                            veni bibi saltavi

                            B Offline
                            B Offline
                            BillWoodruff
                            wrote on last edited by
                            #16

                            What do you think the Algorithms, Linq, and QA, forums are for ?

                            «While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)

                            1 Reply Last reply
                            0
                            • M Marc Clifton

                              Nagy Vilmos wrote:

                              Name for the concept

                              Assuming no duplicates? So, what, "add distinct by"?

                              public static void AddRangeDistinctBy(this List target, IEnumerable src, Func equalityComparer)
                              {
                              src.ForEach(item =>
                              {
                              // no items in the list must match the item.
                              if (target.None(q => equalityComparer(q, item)))
                              {
                              target.Add(item);
                              }
                              });
                              }

                              Inefficient and not thread safe but gets the job done.

                              Latest Article - Class-less Coding - Minimalist C# and Why F# and Function Programming Has Some Advantages Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                              B Offline
                              B Offline
                              BillWoodruff
                              wrote on last edited by
                              #17

                              That's a great response to a question that should have been asked in another forum !

                              «While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)

                              M 1 Reply Last reply
                              0
                              • B BillWoodruff

                                That's a great response to a question that should have been asked in another forum !

                                «While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)

                                M Offline
                                M Offline
                                Marc Clifton
                                wrote on last edited by
                                #18

                                BillWoodruff wrote:

                                That's a great response to a question that should have been asked in another forum !

                                We'll let it slide for Nagy. Heaven knows, I've gotten away with it. :laugh:

                                Latest Article - Class-less Coding - Minimalist C# and Why F# and Function Programming Has Some Advantages Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                                B 1 Reply Last reply
                                0
                                • M Marc Clifton

                                  BillWoodruff wrote:

                                  That's a great response to a question that should have been asked in another forum !

                                  We'll let it slide for Nagy. Heaven knows, I've gotten away with it. :laugh:

                                  Latest Article - Class-less Coding - Minimalist C# and Why F# and Function Programming Has Some Advantages Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                                  B Offline
                                  B Offline
                                  BillWoodruff
                                  wrote on last edited by
                                  #19

                                  Marc Clifton wrote:

                                  We'll let it slide for Nagy

                                  You walk on water, Nagy walks on air :)

                                  «While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)

                                  1 Reply Last reply
                                  0
                                  • B BillWoodruff

                                    HappyFestivus wrote:

                                    That rule does not apply to members above a certain point level.

                                    Wrong !

                                    «While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)

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

                                    BillWoodruff wrote:

                                    Wrong !

                                    He meant to say reputation, and no I don't mean the numerical thing in our profiles. I get away with lots of things that are supposedly against the rules. Nothing to do with Maunder twice leaving a drinking session before it had really even begun.

                                    Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004

                                    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