Announcement

Collapse
No announcement yet.

First: ARRAY SORT text strings by length...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by Gösta H. Lovgren-2 View Post
    Code:
    'now put string legth in front for sorting
    '
    This is an interesting approach, but I'll be frank with you: I don't think I could ever actually use it. I can not even think of modifying my input data, not even if it made the sorting process 10 times faster. I feel strongly about maintaining the integrity of the data, and only performing modifications that support the user's needs, not mine as programmer. That may sound altruistic, but it helps me sleep at night...



    Code:
    End Function '[B][I]Applikation kerschplunckened[/I][/B]
    '
    THIS I can use!!

    Comment


    • #22
      Originally posted by John Montenigro View Post
      This is an interesting approach, but I'll be frank with you: I don't think I could ever actually use it. I can not even think of modifying my input data, not even if it made the sorting process 10 times faster. I feel strongly about maintaining the integrity of the data, and only performing modifications that support the user's needs, not mine as programmer. That may sound altruistic, but it helps me sleep at night...
      I must be missing something. I don't see any data corruption. The original data isn't altered at all. It's the same method (except I used a Typed Array) I sort a 110,000+ word file according to length. Simple coding, easy to understand, very fast.
      THIS I can use!!
      Oh well, I'm good for something anyway, given my limited experience.{Make fist, place thumb on inside middle section of forefinger and make jabbing motions rotating same while wincing.}

      =================================
      "Silence is argument
      carried out by other means."
      Ernesto"Che"Guevara (1928-1967)
      =================================
      Last edited by Gösta H. Lovgren-2; 30 Jan 2009, 09:03 PM. Reason: A nice gesture.
      It's a pretty day. I hope you enjoy it.

      Gösta

      JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
      LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

      Comment


      • #23
        Originally posted by Gösta H. Lovgren-2 View Post
        The original data isn't altered at all.
        Yep, you're right. My apologies. I had watches on both arrays while I was stepping through the code, and I thought it was the original data being modified.

        As for "limited experience", those were someone else's words, and if they apply to anyone, I know it's not you!

        Anyway, re-visiting your code, I agree that it's straightforward. (No need for that gesture, thank you!)


        Here are the results of testing Mike Doty's "loop w/TAGARRAY", Vidar Hanto's "COLLATE with spaces", your "prefix with length", and my "custom sort", all using the same ~150,000 word list. Numbers are TIX (CPU cycles).

        Code:
        	MD loops wTAGARRAY    VH collate wWeight    GL prefix Length    jhm custom sort
        prep1                   -                     -                   -                  -
        prep2           16,353,599                    -          376,464,044                 - 
        sort           193,547,453           669,189,779         356,911,332     43,800,129,044 
        display                 -                     -                   -                  -
        				
        TOTAL:         209,901,052           669,189,779         733,375,376     43,800,129,044
        The "custom sort" method that I used took about 23 seconds, whereas (despite the prep loop of obtaining and storing lengths) TAGARRAY was virtually instantaneous.

        I love the flexibility and power of the "custom sort" capability of ARRAY SORT, and I'm probably going to experiment with it more in the future. I hope that my use of it helps others to remember that ARRAY SORT has a powerful "custom sort" capability, and that if I can use it, anyone can!


        I appreciate everyone's comments, insights, and contributions, and I appreciate being able to study the variety of ideas that can be applied. I've learned a lot!

        Thanks!!!

        Comment


        • #24
          Originally posted by John Montenigro View Post
          Anyway, re-visiting your code, I agree that it's straightforward. (No need for that gesture, thank you!)
          I apologize John. It wasn't meant for you. I just saw a chance to return a little dig towards HeWhoMustNotBeNamed. (The opportunity arises so seldom, dontcha know.)

          ====================================
          "Efforts and courage are not enough
          without
          purpose and direction."
          John F. Kennedy
          ====================================
          Last edited by Gösta H. Lovgren-2; 31 Jan 2009, 08:53 PM. Reason: Proope Name
          It's a pretty day. I hope you enjoy it.

          Gösta

          JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
          LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

          Comment


          • #25
            Thanks for clarifying that - but I must admit, that was a very precise description and was not at all ambiguous!!

            Comment


            • #26
              >TAGARRAY was virtually instantaneous.

              I have found that as a rule, what comes out of the PB box is usually the fastest and most reliable way to do anything.
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment

              Working...
              X