Loading ...
Sorry, an error occurred while loading the content.

Re: [peditors] The answer: alphabetical sorting in list view - a bug?

Expand Messages
  • Paul Nevai
    # Yes, Paul can sometimes be quite---unintentionally, I believe---abrasive. # My not-thick-enough skin has been punctured more than once! How do you know that
    Message 1 of 13 , Oct 4, 2002
    • 0 Attachment
      # Yes, Paul can sometimes be quite---unintentionally, I believe---abrasive.
      # My not-thick-enough skin has been punctured more than once!

      How do you know that "unintentionally"? [smiley] /Paul
    • jacob
      ... string. As I ... You can ... memos get ... It cannot be strcmp(): in the Abc memo, the fourth character is newline (0x0A), in the Abc def memo it s
      Message 2 of 13 , Oct 4, 2002
      • 0 Attachment
        --- In peditors@y..., Paul Nevai <nevai@m...> wrote:
        >
        > There is no shortened name. Really. A memo is nothing but one
        string. As I
        > recall, memos are sorted with strcmp () [the Palm version of it].
        You can
        > check it via the publicly available Memo Pad source code. First
        memos get
        > sorted, and then the truncated memo gets displayed as a "title".
        >

        It cannot be strcmp(): in the 'Abc' memo, the fourth character is
        newline (0x0A), in the 'Abc def' memo it's space (0x20). So if it
        were strcmp(), it would tell that 'Abc def' is "larger" than 'Abc'
        and the sorting routine would place the former *after* the latter.

        It must be something else.

        And if it is, could you please change the listview sorting routine to
        use strcmp(), because, as I just have demonstrated, strcmp() would
        give correct order of the strings.

        //Yaakov

        P.S.#1 I was not offended by Paul's style - I never do :). So no
        problem.
        P.S.#2 I am really curious about this stuff. Sorry Paul and all, if
        I miss something really evident here. I have not been sleeping well
        recently: our baby is just 1 month old (or should I say 1 month
        young :) and she prefers sleeping at days and keeping us awake at
        nights :(
      • Paul Nevai
        # It cannot be strcmp(): in the Abc memo, the fourth character is I ll check to code. I ll be back later. Go to sleep - laila tov. Paul
        Message 3 of 13 , Oct 4, 2002
        • 0 Attachment
          # It cannot be strcmp(): in the 'Abc' memo, the fourth character is

          I'll check to code. I'll be back later. Go to sleep - laila tov. Paul
        • Paul Nevai
          Dear Yaakov, Rick, and all other guys: # It cannot be strcmp(): in the Abc memo, the fourth character is # newline (0x0A), in the Abc def memo it s space
          Message 4 of 13 , Oct 4, 2002
          • 0 Attachment
            Dear Yaakov, Rick, and all other guys:

            # It cannot be strcmp(): in the 'Abc' memo, the fourth character is
            # newline (0x0A), in the 'Abc def' memo it's space (0x20). So if it
            # were strcmp(), it would tell that 'Abc def' is "larger" than 'Abc'
            # and the sorting routine would place the former *after* the latter.

            I checked. It is the Palm version of strcmp(). Pay attention: "Palm
            VERSION".

            BTW, I tested your examples and you are 100% right. More than that, SPACE
            comes before TAB too.

            Do: "aSPACEb" and "aTABb"

            I need to investigate this even more...I did. The guilty party is a function
            called GetCharSortValue() which decides how strcmp() compares. It decides
            that SPACE is ahead of other printable chars. It is a sorting table.

            So please go to Palm and complain loud and clear.

            BTW, effective with OS 4.0, GetCharSortValue() was replaced by another
            function which still sorts space ahead of [almost] all else.

            I wonder if this may be an int'l agreement and not a bug. Any opinions? By
            computer guys? By linguist guys?

            Best regards, Paul
          • Yaakov Shlafman
            Dear Paul & all, ... For God s sake, WHY? Definitely a bug. Or maybe they never expected the compared strings to contain non-printable characters? (tab and
            Message 5 of 13 , Oct 4, 2002
            • 0 Attachment
              Dear Paul & all,

              --- Paul Nevai <nevai@...-state.edu> wrote:
              > Dear Yaakov, Rick, and all other guys:
              >
              > # It cannot be strcmp(): in the 'Abc' memo, the fourth character is
              > # newline (0x0A), in the 'Abc def' memo it's space (0x20). So if it
              > # were strcmp(), it would tell that 'Abc def' is "larger" than 'Abc'
              > # and the sorting routine would place the former *after* the latter.
              >
              > I checked. It is the Palm version of strcmp(). Pay attention: "Palm
              > VERSION".
              >
              > BTW, I tested your examples and you are 100% right. More than that, SPACE
              > comes before TAB too.
              >
              > Do: "aSPACEb" and "aTABb"
              >
              > I need to investigate this even more...I did. The guilty party is a function
              > called GetCharSortValue() which decides how strcmp() compares. It decides
              > that SPACE is ahead of other printable chars. It is a sorting table.
              >

              For God's sake, WHY? Definitely a bug. Or maybe they never expected the
              compared strings to contain non-printable characters? (tab and newline aren't
              printable characters - they are FORMATTING, or control characters; they
              probably wanted space to go before )

              Here's per IEEE/ISO
              ...
              The isprint() function tests for any printing character, including the space
              character, that is, any character for which isalnum() or ispunct() is true or
              the space character.
              ...
              The isgraph() function tests for any printing character except the space
              character, that is, any character for which isalnum() or ispunct() is true.
              ....

              What PalmOS are using for their sorting criteria, I wonder? Is that because in
              some fonts they have icons assigned to some characters with codes less than the
              SPACE (bad technical decision by itself, by the way)?

              And, you're right, just checked the Address book app; if I create two entries
              with last names 'Abc<newline>def' and 'Abc<space>def' - the same mistake.


              > So please go to Palm and complain loud and clear.
              >

              Would it be as efficient as talking to a brick wall? Where shall I send the
              complaint? To Customer Support? (yea, sure!)

              > BTW, effective with OS 4.0, GetCharSortValue() was replaced by another
              > function which still sorts space ahead of [almost] all else.
              >

              #$%@#$^#$%#^$%! (Pardon my French :)

              > I wonder if this may be an int'l agreement and not a bug. Any opinions? By
              > computer guys? By linguist guys?
              >

              No idea. Very weird. Does PalmOS doc say anything about it? Do you have
              access to the source?

              Probably sorting for peditPro should be using another, correct version of
              GetCharSortValue()?

              > Best regards, Paul
              >

              Thanks, Paul for your time!
              It's a mystery to me as to why I didn't notice this before having been a Palm
              user since 1997!

              :)

              Yaakov.



              __________________________________________________
              Do you Yahoo!?
              Faith Hill - Exclusive Performances, Videos & More
              http://faith.yahoo.com
            Your message has been successfully submitted and would be delivered to recipients shortly.