Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

What the heck? Contents of objects NOT alphabetical!??

Starax Statosky
Unregistered User
Join date: 23 Dec 2003
Posts: 1,099
03-16-2006 18:00
From: Kim Anubis
Wow, that's weird, cause I got

starax
statosky
command
demons
of
murder
for
beelzebub



Okay. I think I like your sorting algorithm. I'll take two please.
Siggy Romulus
DILLIGAF
Join date: 22 Sep 2003
Posts: 5,711
03-16-2006 18:02
I thought it was pretty cool... but thats just me
_____________________
The Second Life forums are living proof as to why it's illegal for people to have sex with farm animals.

From: Jesse Linden
I, for one, am highly un-helped by this thread
Liberty Tesla
Perpetual Newbie
Join date: 1 Sep 2003
Posts: 173
03-16-2006 21:08
Yes, it's slower, I'm sure. It might add a whole millisecond every time you sort a folder in inventory. Major lag source. :)

As someone observed, Windows does the same thing with filenames. In fact, I'll bet the same piece of code is responsible for both: SL probably uses the locale-specific collating function provided by Windows (or MacOS). And they do it because this sort order makes sense to non-programmers: 10 is supposed to come after 9, not before 2; just like uppercase 'B' comes after lowercase 'a', regardless of what the ASCII chart says.

Anyway, once you're dealing in larger-than-ASCII character sets, and especially Unicode, naive ASCII-betical sorting is no longer an option. (Should 'c-with-cedilla' sort after 'z'? Wouldn't German users expect 'a-with-umlaut' to sort to the beginning of the list, rather than the end?) It's complicated, hard to get right, and harder still to make efficient; and if Microsoft has already done the work, why re-invent it when you have better things to do?

If it means sacrificing a millisecond here or there to come up with something that makes more sense to non-technical users, I'm all for it. And if it means LL re-using existing code provided by the OS, rather than spending the time and effort to roll their own, I'm all for that, too.

Optimization effort is better spent on any number of other areas: physics, rendering, the database architecture, the LSL VM, LoD filtering, etc. The string collating algorithm is a very small drop in a very big bucket.
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
03-17-2006 02:05
From: Liberty Tesla


If it means sacrificing a millisecond here or there

no, it means much more, not only according to my benchmarks and working out what the actual algorithm does, but because of the pain in the ass it becomes for developers who have to deal with this if sorting items is any sort of priority.
_____________________
Hiro Pendragon
------------------
http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio

Visit my SL blog: http://secondtense.blogspot.com
Bosozoku Kato
insurrectionist midget
Join date: 16 Jun 2003
Posts: 452
03-17-2006 04:01
I don't think it's slower, it's faster, imho. It's the most basic binary sorting routine without any additional code to refine it.
[0-9]<A < B < E < Z < a < b < e < z.

Apple
apple
..because A<a, it lists first. No other checks required!

Say we have 2 words to sort, "boo39ger" and "boo7ger". Doesn't matter which we work with first, so let's just say we've pulled "boo39er" out of memory and tossed it into our list. Then we snag "boo7ger" -- we need to check the list and see where the new word goes: (italics means the char we're checking from "boo39ger", normal means char from boo7ger)
b==b, they're equal, check next...
o==o, equal, next...
o==o, equal, next...
7>3, boo7ger goes after "boo39ger". Sorting DONE = fast (isn't really alphanumeric, it's a close dirty but FAST comparions/sorting routine).
Toss in "boo2939239ger", you start at the top (probably anyway, maybe the bottom, a cheap sort could break it in half or quarters to speed things up). Anyway we'll go from the bottom cuz I'm a geek.
b,o,o==b,o,o all equal, keep checking
2<7 this goes before 7, but now we have to compare to the next item, "boo39ger"
b,o,o==b,o,o equal...
2<3, So boo2939239ger goes before boo39ger. Again, cheap but fast sorting. No screwing around with other functions/comparisons.

This is about as basic (fast, albeit sorta crappy) as sorting gets. Creating a more accurate sorting routine would entail more code and more work. Even a basic bubble sort is much slower than what the Lindens are using (apparently to me anyway).

I do support it though, because the sorting occurs on the Servers, not by the client. Running better sorting routines is a waste of resources, imho, given the amount of junk in inventories and the amount of inventory fetching that goes on constantly.

Bos
_____________________
float llGetAFreakingRealTimeStampSince00:00:00Jan11970();
Zoe Llewelyn
Asylum Inmate
Join date: 15 Jun 2004
Posts: 502
03-17-2006 05:10
Personally I find this arguement a fascinating oddity and an example of peoples preference for out-dated "traditions" that are perhaps illogical but acceted over a more logical approach.

In point of fact...the number '11' is indeed a higher numerical value than the number '2', and as such...from a logical sorting perspective...should always come AFTER '2'. That we currently follow an illogical method of sorting that does not recognize the number '11' as eleven at all, but rather treats the numbers as letters in a word wherin all 'words' starting with '1' would come before all 'words' starting with '2' does not mean this practice is correct or logical...or even preferred.

Personally, both as a user, and as a programmer, the accepted illlogical practice of dealing with numbers as letters in a string has always bugged me for its counter-intuitiveness. Interesting to see how vigorously people will defend a 'tradition'.

The issues of performance that may or may not be caused by the requirement of additional processing is not addressed as it is not relevant to the particular phenomenon I was wishing to discuss. Indeed it is an important issue, merely not applicaple to the sociological persepective.

Just my own opinion and observation. Take it as such, please.
_____________________
Starax Statosky
Unregistered User
Join date: 23 Dec 2003
Posts: 1,099
03-17-2006 05:37
From: Zoe Llewelyn
Personally I find this arguement a fascinating oddity and an example of peoples preference for out-dated "traditions" that are perhaps illogical but acceted over a more logical approach.

Just my own opinion and observation. Take it as such, please.



BURN HER!!!





I agree with you. :)
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
03-17-2006 05:47
I find myself in the unusual position of having to disagree with just about everything you said, Bos.
From: Bosozoku Kato
I don't think it's slower, it's faster, imho. It's the most basic binary sorting routine without any additional code to refine it.
[0-9]<A < B < E < Z < a < b < e < z.
Neither of the two techniques being discussed do pure ASCII sorts. For the purposes of this discussion A==a, B==b, A<b and a<B. What is being discussed is whether:
"11" < "2" because "aa" < "b"
OR
"2" < "11" because 2 < 11

From: Bosozoku Kato
Say we have 2 words to sort...Toss in "boo2939239ger", you start at the top (probably anyway...Even a basic bubble sort is much slower than what the Lindens are using (apparently to me anyway).
Remember not to confuse the complexity of the sorting algorithm (insertion sort as you first describes, or the bubble sort you mention) with the complexity of the comparison function, which is where alphabetic vs. alphanumeric ordering differ.

Also any bubble sort is much slower than just about any other algorithm out their, regardless of the comparison function.

From: Bosozoku Kato
I do support it though, because the sorting occurs on the Servers, not by the client.
Change the sort order of your inventory from by-name to by-date. Notice that it is virtually instant. There is no way that's being done server-side. All the sorting load (for inventory at least) is ditributed to the clients.

From: Bosozoku Kato
float llGetAFreakingRealTimeStampSince00:00:00Jan11970();

llGetUNIXTime (sorry, couldn't resist that one :))
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
03-17-2006 05:48
From: Starax Statosky
BURN HER!!!
Does she float?
You know, like a duck?
Bosozoku Kato
insurrectionist midget
Join date: 16 Jun 2003
Posts: 452
03-17-2006 06:12
disclaimer:
My rebuttal is in fun, and because I'm bored. Plus I think it's worth a little rebuttal anyway cuz this thread is a sorta silly topic anyway. I know some feed on drama, I don't mean to be the cook.

From: Zoe Llewelyn
Personally I find this arguement a fascinating oddity and an example of peoples preference for out-dated "traditions" that are perhaps illogical but acceted over a more logical approach.

What argument?
I wouldn't call it illogical "out-dated 'traditions'". Lindens appear to be using the most simple and very common (and most limited, other than no sorting at all) solution to sorting inventories.

From: someone
In point of fact...the number '11' is indeed a higher numerical value than the number '2', and as such...from a logical sorting perspective...should always come AFTER '2'. That we currently follow an illogical method of sorting that does not recognize the number '11' as eleven at all, but rather treats the numbers as letters in a word wherin all 'words' starting with '1' would come before all 'words' starting with '2' does not mean this practice is correct or logical...or even preferred.

First, it's dealing with strings, not numerals. Regardless if it's "12" or "Kitty", or "kitty12" it is a string, aka the item's name.
Second, is "Joe34blow" a word, or 2 strings and a numeral. (or maybe a VB variant!). I call it a string because, well it is a string. Numerals don't consist of w,o,l,B,e,o, nor J.
I do concur that it's illogical that 1,11,2 is the given sort order, for "numerals", but I understand why it's sorting like this -- that's perfectly logical to me. Annoying, yes, but logical.

From: someone
Personally, both as a user, and as a programmer, the accepted illlogical practice of dealing with numbers as letters in a string has always bugged me for its counter-intuitiveness. Interesting to see how vigorously people will defend a 'tradition'.

How else can you define numbers in strings -- when looking at the entire string. Sure you can pick it apart and call the alphabetical characters "strings" and the numerical characters "numbers" but all stuffed together as an item's name? I'd call that a string, or at worst a "variant".

From: someone
The issues of performance that may or may not be caused by the requirement of additional processing is not addressed as it is not relevant to the particular phenomenon I was wishing to discuss. Indeed it is an important issue, merely not applicaple to the sociological persepective.

I personally think performance is probably a valid reason we have crappy sorting. Maybe they plan to improve it, but even if so I bet it's WAY down on the ToDo list. 1. Works. 2. Ain't Broke. 3. Can't optimize it any further, except to remove all sorting == no fix/change coming for this for a long ass time (maybe after Havok2008...).
Not sure what you were wishing to discuss, I scrolled back and didn't see you discussing anything before. This confused me. Dunno how sociology came about either. I'm confused (which is probably obvious by any of my drivel).
_____________________
float llGetAFreakingRealTimeStampSince00:00:00Jan11970();
Bosozoku Kato
insurrectionist midget
Join date: 16 Jun 2003
Posts: 452
03-17-2006 06:20
Good stuff previous to this quote. :)

From: Ben Bacon
Change the sort order of your inventory from by-name to by-date. Notice that it is virtually instant. There is no way that's being done server-side. All the sorting load (for inventory at least) is ditributed to the clients.

Topic is Object contents though, that's server side far as I'm aware. That's why updating anything in an objects contents is about as painful as pulling teeth.


From: someone
llGetUNIXTime (sorry, couldn't resist that one :))

haha yeah, about freaking time. Been waiting for this since '03 :p Think I'll keep my sig around for 3 more years just to match the time-frame of actually getting this function. :)
_____________________
float llGetAFreakingRealTimeStampSince00:00:00Jan11970();
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
03-17-2006 06:34
Wont this make it impossible to do a binary search through object inventory? (Or make it *really* hard and slow?)

Right now we can use llGetInventoryKey for an exact match on an object's name, but if we want to indroduce any variation in the results we get (searching for all items starting with "foo" for example)....
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
03-17-2006 09:23
From: Zoe Llewelyn
out-dated "traditions" that are perhaps illogical but acceted over a more logical approach.

Ah, yes, out-dated "traditions" like the ASCII table sorting, which is a global standard of computing?
_____________________
Hiro Pendragon
------------------
http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio

Visit my SL blog: http://secondtense.blogspot.com
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
03-17-2006 11:34
From: Hiro Pendragon
Ah, yes, out-dated "traditions" like the ASCII table sorting, which is a global standard of computing?
This is a display for regular old every day humans who are more likely to want "human logic" sorts rather than straight up binary sorts. I really fail to see how this is any sort of problem.

As I said, unless it effects how we're sorting in our scripts (i.e., doing something other than the binary sort we expect it to do) why is this any brand of problem?
_____________________
Siggy Romulus
DILLIGAF
Join date: 22 Sep 2003
Posts: 5,711
03-17-2006 12:07
I think its going to destroy SL - kick my dog in the nuts - and make the baby jesus cry.

Is this the 'culling' of 1.9?
_____________________
The Second Life forums are living proof as to why it's illegal for people to have sex with farm animals.

From: Jesse Linden
I, for one, am highly un-helped by this thread
Kaboom Pow
Registered User
Join date: 28 Nov 2005
Posts: 81
03-18-2006 07:51
From: Hiro Pendragon

Here's how it really sorts in your Object's contents:

1
2
11
object1
object2
object11



I've never understood why windows orders numbers as they do, i.e. 1, 10, 11, 2, 3, 30, 31, 4 and so on. For this reason I always name my files using zeros, i.e. 01, 02, 03, 04...10, 11...20, 21, 22 and so on.

As far as I've always known, the number 9 has always been followed by the numbers 10 and 11. The number 1 has always been followed by the numbers 2 and 3. I've never know the number 1 to be directly followed by numbers 10 or 11, so it doesn't make sense to me that any list would list numbers in this order.
Forseti Svarog
ESC
Join date: 2 Nov 2004
Posts: 1,730
03-18-2006 09:18
From: Starax Statosky

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.



starax, i don't know who fed you the happy juice for the forums, but i like it :D :D
_____________________
Cristiano Midnight
Evil Snapshot Baron
Join date: 17 May 2003
Posts: 8,616
03-18-2006 09:26
From: Forseti Svarog
starax, i don't know who fed you the happy juice for the forums, but i like it :D :D


I've noticed that too :) Starax's star turn in the forums has been quite amusing, and a refreshing change.

* can I get a rebate on my wand now please? *
_____________________
Cristiano


ANOmations - huge selection of high quality, low priced animations all $100L or less.

~SLUniverse.com~ SL's oldest and largest community site, featuring Snapzilla image sharing, forums, and much more.

1 2