March 23, 2016 at 6:50 am
drew.allen (3/22/2016)
I agree that there are cases where the order is important, but my point was that the number of cases is far smaller than most people think. Running aggregates (usually totals) are certainly one case (and gaps and islands fit into running aggregates under a very broad definition of running aggregates), but I can't think of any other case where they are important. I think it's much more instructive to talk about specific cases where the order is thought to be important rather than talk in vague generalizations. That is why I specifically mentioned the string splitter where the order is not important despite looking like it is on the surface.Drew
I'd have to say that there are a lot more places that people think. For example, normalizing poorly formed file input using Integer Division (quotients and remainders using modulus) of ordered line/record numbers greatly simplifies the parsing of multiple rows into normalized rows and columns. Sure, you could consider that to be a "Gaps'n'Islands" problem but very few people associate a "Gaps'n'Islands" solution with such a thing.
There are also very high performance solutions for various hierarchical data problems (conversion of Adjacency Lists to Nested Sets as one example) and some pretty neat tricks for doing direct lookups for the "Next N number of business days" type of problems. I also use it for a "poor man's Full Text" system to greatly increase the speed of name lookups in "Full Name", address, and email columns, which also allows for simple but useful and highly controllable proximity searches and for the creation of condensed names and addresses to speed up other types of semi-forgiving searches.
Then there's always the fun stuff like calculating mod 10 checksums for CC#'s and routing numbers and the ever popular Uuc/Ean checksum, where order is very important.
Then there's a ton of stuff that's character based and order is important in all cases because it usually has to rebuild a string in the correct order. I'll agree that a lot of folks don't need a splitter to return elements in order but I frequently do either to match two or more input strings at the element level or to shred a multi-level single CSV.
There's more that I can't think of on my first cup o' joe. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing post 16 (of 15 total)
You must be logged in to reply to this topic. Login to reply