This question is answered. Helpful answers available: 0. Correct answers available: 1.


Permlink Replies: 20 - Pages: 2 [ Previous | 1 2 ] - Last Post: 15 Jul 25, 11:54 Last Post By: RobM
davidekholm

Posts: 3,719
Registered: 18-Oct-2002
Re: JAlbum image sort order with underscore
Posted: 11 Jul 25, 11:43   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
Just tried the update. -1.jpg comes first, _1.jpg comes second and 1.jpg comes third.
Should 1.jpg come before _1.jpg?

I'm happy with the ordering -, _, 1. There's some logic to it:
1) Punctuation first, then numbers, then text
2) Within punctuation, according to ASCII code
davidekholm

Posts: 3,719
Registered: 18-Oct-2002
Re: JAlbum image sort order with underscore
Posted: 11 Jul 25, 11:48   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
The ASCII sequence certainly has some interesting bits of perversity. Besides the "sort to the end" characters like underscore, there's also a run of special characters that appears between 0-9 and A-Z!

I think the reason for this is that the makers of ASCII wanted it to be dead-simple to quickly convert to upper case or lower case: Simply flip, set or reset bit 5 (value 32). As the UPPER CASE and lower case alphabet then became separated by 32 code points, that left room for adding some punctuation in between.
peterverm

Posts: 3
Registered: 2-Sep-2017
Re: JAlbum image sort order with underscore
Posted: 13 Jul 25, 17:55   in response to: peterverm in response to: peterverm
 
  Click to reply to this thread Reply
i'm impressed by all your efforts regarding my "strange" question. Thank you very much, i understand now the reasoning behind the different sort mechanisms. Again, thanks. Peter
RobM

Posts: 3,953
Registered: 4-Aug-2006
Re: JAlbum image sort order with underscore
Posted: 13 Jul 25, 21:04   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
RobM wrote:
Just tried the update. -1.jpg comes first, _1.jpg comes second and 1.jpg comes third.
Should 1.jpg come before _1.jpg?

I'm happy with the ordering -, _, 1. There's some logic to it:
1) Punctuation first, then numbers, then text
2) Within punctuation, according to ASCII code

More testing using the ordering on Settings>Pages and in explore view 'According to jAlbum settings. Simple name sorting looks right but to me the name sorting is very odd, 1 before 01 and 2 coming before 02.

It looks like leading zeros mess up the ordering in order by name.

Name (sort by numeric values):
0
1
01
01__01-PVE
01_01_PVE
2
02
3
10
11

Simple Name (sort as string):
0
01
01_01_PVE
01__01_PVE
02
1
10
11
2
3
davidekholm

Posts: 3,719
Registered: 18-Oct-2002
Re: JAlbum image sort order with underscore
Posted: 15 Jul 25, 11:40   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
as 1 and 01 is numerically the same value, I guess the algorithm doesn't care.
RobM

Posts: 3,953
Registered: 4-Aug-2006
Re: JAlbum image sort order with underscore
Posted: 15 Jul 25, 11:54   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
as 1 and 01 is numerically the same value, I guess the algorithm doesn't care.
OK, I’ll make a note of leading zeros coming after 1, 2 etc.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums