• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Test Suggestions ...

 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm looking to see if anybody can bump me past a writer's block. I have this algorithm I've used for 25 years to handle two lists in sorted order ...

Now I want to extend it to handle any number of lists. I think it's going to be

I'm not dead sure this is right, and I'm stumped on tests. Waddya think?
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mhh, what if you solved that problem a slightly different way?

For example, what if you had a CompositeList that, well, is a composite of two lists and uses your algorithm? By having composites of composites of composites etc. you might be able to handle an arbitrary amount of lists without complicating the algorithm...

Just a raw, wild idea, frankly.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where I am right now is resisting putting the handleFound and handleMissing methods in an interface so I can stub them out. I think I'll just bite the bullet and try it.

This is running a query against the same table on 8-10 databases - dev, qa, prod, etc. I think the output will be an HTML table showing which ones have the same keys and values

I made a class to represent one database. It has connection info, a description and a collection of rows. It doesn't feel very cohesive so far.

I thought about your compositing type idea before and just couldn't get my head around it. With the two-list thingie, I've always had one as "master" so I could definitively say when something was "missing" or "extra" or represented an insert or delete. With this thing I think all I can know is the values match across the line or they don't. And really I think that's all that is interesting.
[ August 28, 2006: Message edited by: Stan James ]
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, that interface broke it loose. Here's how the algorithm ended up ... real simple. Hmmm, maybe I'll go back and work on some names.

and

[ August 28, 2006: Message edited by: Stan James ]
 
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic