Sort lexicographically?

Jiaaro picture Jiaaro · May 8, 2009 · Viewed 8.5k times · Source

I am working on integrating with the Photobucket API and I came across this in their api docs:

"Sort the parameters by name lexographically [sic] (byte ordering, the standard sorting, not natural or case insensitive). If the parameters have the same name, then sort by the value."

What does that mean? How do I sort something lexicographically? byte ordering?

The rest of their docs have been ok so far, but (to me) it seems like this line bears further explanation. Unfortunately there was none to be had.

Anyway, I'm writing the application in Python (it'll eventually become a Django app) in case you want to recommend specific modules that will handle such sorting for me ^_^

Answer

dfa picture dfa · May 8, 2009

I think that here lexicographic is a "alias" for ascii sort?

Lexicographic          Natural  
z1.doc                  z1.doc    
z10.doc                 z2.doc    
z100.doc                z3.doc    
z101.doc                z4.doc    
z102.doc                z5.doc    
z11.doc                 z6.doc    
z12.doc                 z7.doc    
z13.doc                 z8.doc    
z14.doc                 z9.doc     
z15.doc                z10.doc    
z16.doc                z11.doc    
z17.doc                z12.doc    
z18.doc                z13.doc     
z19.doc                z14.doc     
z2.doc                 z15.doc    
z20.doc                z16.doc    
z3.doc                 z17.doc    
z4.doc                 z18.doc    
z5.doc                 z19.doc    
z6.doc                 z20.doc    
z7.doc                z100.doc    
z8.doc                z101.doc    
z9.doc                z102.doc