What the heck? Contents of objects NOT alphabetical!??
|
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
03-16-2006 09:24
Has it always been this way?
Let's say you have 6 objects in the contents of an object rezzed in world. The objects are named:
1,11,2,object1,object11,object2
The poll asks how it should be sorted.
Here's how it really sorts in your Object's contents:
1 2 11 object1 object2 object11
I saw this, gasped, swore.
It's not alphabetical order.
Linden Lab would have to intentionally be adding an extra level of complexity to their sorting algorithms to put them this way.
This is really ridiculous! Any Computer Science 101 teaches sorting lists of strings in alphabetical numbers, and coders are tought explicitly to make sure they realize this. Phone books and almost any string-based directory sorts this way, so does practically everything in the internet.
And SL is working the opposite way.
This is silly. I want to know if this is a recent thing so I can bug report it, or if it's an old standard that I need to lobby to change.
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
|
Dianne Mechanique
Back from the Dead
Join date: 28 Mar 2005
Posts: 2,648
|
03-16-2006 09:34
Just to be picky (I'm English) the word is "alphanumerical" not alphabetical.  sorry (pet peeve assuaged) *sigh*
|
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
03-16-2006 09:36
Because SL is a game, and not a platform, and to LL all that matters are the little people who sit in clubs and watch themselves being automatically animated, with their arms crossed, occasionally extending a finger to trigger a "w00t" or "^^HoWlZ^^" gesture.
|
|
FlipperPA Peregrine
Magically Delicious!
Join date: 14 Nov 2003
Posts: 3,703
|
03-16-2006 10:08
That's standard string ordering procedure, as it doesn't view them as numbers, it sees the entire object name as a string. Therefore, as a string, "11" comes before "2". In strings, you compare one character in the sequence to the other strings to order, versus looking at the numeric value of the whole.
In my RL job's database, we have a varchar(10) field (a string) that is mostly numbers, but sometimes two numbers, written as "1/2" or "001", "002"... a trick we do is this:
select equipment_number, etc from table_name order by abs(equipment_number);
In MySQL and Oracle, the absolute value function can be used as a cheat to convert the three numbers listed above to "1", "1", and "2". Using it on the order clause still returns the equipment_number field as it appears in the database, however, sorts it numerically.
Regards,
-Flip
_____________________
Peregrine Salon: www.PeregrineSalon.com - my consulting company Second Blogger: www.SecondBlogger.com - free, fully integrated Second Life blogging for all avatars!
|
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
03-16-2006 10:09
Flip,
How then do you explain:
Object1, Object2, Object11
?
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
|
FlipperPA Peregrine
Magically Delicious!
Join date: 14 Nov 2003
Posts: 3,703
|
03-16-2006 10:18
From: Hiro Pendragon Flip,
How then do you explain:
Object1, Object2, Object11 Ah, I misread the original post, sorry about that. Are they really doing this? That's a hell of a lot of extra code to try to pull that sort of ordering off...and pretty much a waste of time, heh. Regards, -Flip
_____________________
Peregrine Salon: www.PeregrineSalon.com - my consulting company Second Blogger: www.SecondBlogger.com - free, fully integrated Second Life blogging for all avatars!
|
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
03-16-2006 10:21
From: FlipperPA Peregrine Ah, I misread the original post, sorry about that. Are they really doing this? That's a hell of a lot of extra code to try to pull that sort of ordering off...and pretty much a waste of time, heh.
Regards,
-Flip Considering benchmarks for loop-times that I've done, I wonder if this doesn't contribute to a significant part of the lag you get updating items' inventories? I mean, this changes the runtime of a single string comparison in the Object's contents from O(2N) to O(N^2), doesn't it? (Where N = string length) In the context of a loop where you are sorting inventory items, even at binary searches, we're talking O((X log X)*N^2) ... (X = number of items in contents)
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
03-16-2006 11:00
Are you sure they're even sorted at all, they could simply be in order of insertion, i mean, things are autonumbered when you drop in duplicates right?
|
|
FlipperPA Peregrine
Magically Delicious!
Join date: 14 Nov 2003
Posts: 3,703
|
03-16-2006 11:11
From: Eggy Lippmann Are you sure they're even sorted at all, they could simply be in order of insertion, i mean, things are autonumbered when you drop in duplicates right? They're definitely sorted, and if Hiro's comments above are correct, then there's extra processing going on. However, Hiro, I think they'd probably do something a little less intensive than that, like: for(x = string length (item name); x>=0; x--) { if(isnumeric(substring(item name, x, 1))) { end_num_string = concat (substring(item name, x, 1), end_num_string); } else { x = -1; } } Then by the end_num_string of each item. That way you only parse numbers at the end after doing an initial sort by alphas without numerics. Either way, its very silly and inefficient, hehehe. Regards, -Flip
_____________________
Peregrine Salon: www.PeregrineSalon.com - my consulting company Second Blogger: www.SecondBlogger.com - free, fully integrated Second Life blogging for all avatars!
|
|
Caleb Moreau
Original Kewlip!
Join date: 14 Jan 2005
Posts: 278
|
03-16-2006 11:40
..Call me dumb here.. But why is it bad that 11 comes after 2? O.o
|
|
Ricky Zamboni
Private citizen
Join date: 4 Jun 2004
Posts: 1,080
|
03-16-2006 11:45
From: Caleb Moreau ..Call me dumb here.. But why is it bad that 11 comes after 2? O.o It's nonstandard when dealing with strings. I'm sure you wouldn't ask why it's bad if 'aa' were to come after 'b'. This is the same issue.
|
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
03-16-2006 11:46
From: Caleb Moreau ..Call me dumb here.. But why is it bad that 11 comes after 2? O.o it's like "apple" coming before "zone" because apple is longer. The overwhelming standard in computer applications is that any alphanumeric sort is done 1 letter / number at a time. It means that in order for Linden Lab to have achieved this sorting, they had to basically write extra code to do so, and anyone wanting to resort it has to write extra code.
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
|
Hugsy Penguin
Sky Junkie
Join date: 20 Jun 2005
Posts: 851
|
03-16-2006 11:57
From: Ricky Zamboni It's nonstandard when dealing with strings. I'm sure you wouldn't ask why it's bad if 'aa' were to come after 'b'. This is the same issue. It's not unheard of though. Windows does this with filenames displayed in Explorer. I just created six files: 1.txt, 2.txt, 11.txt, object1.txt, object2.txt, and object11.txt. They were sorted alphanumerically like that. Personally I prefer it this way because it makes more sense. This: 1.txt 11.txt 2.txt object1.txt object11.txt object2.txt sucks IMHO. Whether or not this introduces more lag is a seperate issue. HP
|
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
03-16-2006 12:16
From: Hugsy Penguin It's not unheard of though. Windows does this with filenames displayed in Explorer. I just created six files: 1.txt, 2.txt, 11.txt, object1.txt, object2.txt, and object11.txt. They were sorted ... like that. HP It's not alphanumerically if it goes out of alphanumeric order. There needs to be some new phrase for it, like, "mixed up", or "out of order" or "crazy stupid". Anyway, I tried out the same experiment, and windows does it the same way. Disappointed.
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
|
Enabran Templar
Capitalist Pig
Join date: 26 Aug 2004
Posts: 4,506
|
03-16-2006 12:31
What do you think will get the supreme court to reverse this one, there, Hiro? I bet we can find something in the First Amendment for it, yes?
_____________________
From: Hiro Pendragon Furthermore, as Second Life goes to the Metaverse, and this becomes an open platform, Linden Lab risks lawsuit in court and [attachment culling] will, I repeat WILL be reverse in court. Second Life Forums: Who needs Reason when you can use bold tags?
|
|
Hugsy Penguin
Sky Junkie
Join date: 20 Jun 2005
Posts: 851
|
03-16-2006 13:41
From: Hiro Pendragon It's not alphanumerically if it goes out of alphanumeric order. There needs to be some new phrase for it, like, "mixed up", or "out of order" or "crazy stupid".
Anyway, I tried out the same experiment, and windows does it the same way.
Disappointed. Given the following lists of script names: My Awesome Script v1 My Awesome Script v1 My Awesome Script v2 My Awesome Script v10 My Awesome Script v3 My Awesome Script v11 My Awesome Script v4 My Awesome Script v12 My Awesome Script v5 My Awesome Script v13 My Awesome Script v6 My Awesome Script v14 My Awesome Script v7 My Awesome Script v15 My Awesome Script v8 My Awesome Script v16 My Awesome Script v9 My Awesome Script v17 My Awesome Script v10 My Awesome Script v18 My Awesome Script v11 My Awesome Script v19 My Awesome Script v12 My Awesome Script v2 My Awesome Script v13 My Awesome Script v20 My Awesome Script v14 My Awesome Script v21 My Awesome Script v15 My Awesome Script v22 My Awesome Script v16 My Awesome Script v23 My Awesome Script v17 My Awesome Script v24 My Awesome Script v18 My Awesome Script v25 My Awesome Script v19 My Awesome Script v26 My Awesome Script v20 My Awesome Script v27 My Awesome Script v21 My Awesome Script v28 My Awesome Script v22 My Awesome Script v29 My Awesome Script v23 My Awesome Script v3 My Awesome Script v24 My Awesome Script v30 My Awesome Script v25 My Awesome Script v4 My Awesome Script v26 My Awesome Script v5 My Awesome Script v27 My Awesome Script v6 My Awesome Script v28 My Awesome Script v7 My Awesome Script v29 My Awesome Script v8 My Awesome Script v30 My Awesome Script v9
The one on the right is the one that's mixed-up, out of order, and crazy stupid. I demand that it be made federal law that all alphanumeric lists be sorted as shown on the left. Capital punishment for those who don't comply.  HP
|
|
Newfie Pendragon
Crusty and proud of it
Join date: 19 Dec 2003
Posts: 1,025
|
03-16-2006 13:47
Speaking from a techie standpoint (pardon me if I suddenly sound like I'm speaking a foreign languate)...
Seems to me that they may have the sorting code page in the datbase, or used a high-null cardinality rule. Shorter strings are sorting higher on the list than longer strings. If they're sorting via a letter-by-letter routine, then the extra digits in the longer string would be compared to 'null', and high-null cardinality would give the nod to the shorter string.
In other words..... 1 beats 11
because it is one digit shorter.
- Newfie
|
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
03-16-2006 13:56
I'm not sure what the problem is. For inventories of objects, something human-logical (the number 11 is larger and so comes after 1) sorting is almost nessesary - since that inventory is what your run-of-the mill user sees and sometimes has to interact with.
Now, if it's doing the same thing when we use llListSortList... well, then it's a problem.
|
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
03-16-2006 14:30
From: Newfie Pendragon Speaking from a techie standpoint (pardon me if I suddenly sound like I'm speaking a foreign languate)...
Seems to me that they may have the sorting code page in the datbase, or used a high-null cardinality rule. Shorter strings are sorting higher on the list than longer strings. If they're sorting via a letter-by-letter routine, then the extra digits in the longer string would be compared to 'null', and high-null cardinality would give the nod to the shorter string.
In other words..... 1 beats 11
because it is one digit shorter.
- Newfie just tried and got this result: a1aa a2aa a5aa a22a So it's not anything dealing with size of string alone
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
|
Kyushu Tiger
Registered User
Join date: 12 Nov 2005
Posts: 92
|
03-16-2006 16:42
From: FlipperPA Peregrine Either way, its very silly and inefficient, hehehe.
I wonder if this all has anything to do with the feeling I have that I lag a lot more when my inventory is open? Kyushu
|
|
Starax Statosky
Unregistered User
Join date: 23 Dec 2003
Posts: 1,099
|
03-16-2006 17:39
This may explain something. I'm not sure what. But it must have some relevance to my life. I will investigate further and report back my findings.
Much later...
okay, i just tried these random words:
for starax command statosky murder beelzebub demons of
and it gave me this:
beelzebub command demons for murder of starax statosky
I'm not happy with this sorting method at all. I would like a new one please.
|
|
milady Guillaume
Shhhh, I'm researching!
Join date: 28 Dec 2003
Posts: 696
|
03-16-2006 17:45
After investigating Starax's issue..i got this
Demons Of Beelzebub Command For Starax Statosky Murder
|
|
Jauani Wu
pancake rabbit
Join date: 7 Apr 2003
Posts: 3,835
|
03-16-2006 17:49
we have the obj1, 11, 111, 2, 21, 3 ...etc order because computers are stupid. presumabely, LL wrote a script to make the computer smarter so that regular humans don't have to reorient their brain for the stupid computer.
then people who already reoriented their brain for the computer started to cry because now they see the world with the eyes of a machine.
thanks LL for making it easier to look through my inventory in a logical HUMAN manner.
filed under OMGreSMODS!
_____________________
http://wu-had.blogspot.com/ read my blog
Mecha Jauani Wu hero of justice __________________________________________________ "Oh Jauani, you're terrible." - khamon fate
|
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
03-16-2006 17:54
From: Jauani Wu filed under OMGreSMODS!
filed under zOMG tekki wikki! When are you going to show me firechick's tits, jaujau?
|
|
Kim Anubis
The Magician
Join date: 3 Jun 2004
Posts: 921
|
03-16-2006 17:54
Wow, that's weird, cause I got
starax statosky command demons of murder for beelzebub
_____________________
http://www.TheMagicians.us 
|