Re: Queue Order Changing

From: Stefan Kaczmarek <stefan_at_thezonie.org>
Date: Tue, 3 Apr 2007 16:21:18 -0700

Well, it's just that I still have to keep track of all the changes
that a single move will cause because I have to communicate multiple
changes without refreshing the list from you.

Are you storing the pos as a column in the db? Why not have a single
"order" col in the table for each user that has like a comma-
delimited string of the different hashes, in the order that they need
to be. Then the service can just read in that string, explode it to
an array, and then manipulate it as it sees fit. When it is done, it
can then just write it back out again. It just seems like we have a
lot of different ways of referencing the same data: hash, 0-based
index (the queue itself) and the db-based position.

Well ... I dunno.

We'll keep doing it your way unless I can think of a better way to do
it.

- Z

On Apr 3, 2007, at 4:04 PM, Dylan Douglas wrote:

> Z-
>
> Yeah, once you tell me that hash X should be at position N, all the
> intermediate items between N_t0 and N_t1 will also change.
>
> E.g.: You have 10 through 17. The user moves 16 to 12. The existing
> 12 through 15 are shifted up one to become 13 through 16.
>
> That's why I'm thinking of only dealing with a hash and position to
> prevent moving the wrong hash to the right position. You just have to
> deal with the first request (move this hash there) and then the web
> service will take care of moving all the other stuff.
>
> -D
>
>
>> -----Original Message-----
>> From: Stefan Kaczmarek [mailto:stefan_at_thezonie.org]
>> Sent: Tuesday, April 03, 2007 1:14 PM
>> To: Ivan Kwok; Ben Ebert; Ty Heath; Jay Mairs; Dylan Douglas
>> Subject: Queue Order Changing
>>
>> D,
>>
>> So I'm working on the queue order stuff, and you said that you wanted
>> to reference changes by the position in the db, not the webpage.
>>
>> So okay, what I have is a collection of objects in a series, numbered
>> 0-n (the web page index) and each contain a db position that I get
>> from the server.
>>
>> Now, when a user changes an item's position, I check the web order,
>> and from there I can figure out which item moved from where, and I
>> can tell you that "db pos item N moved to replace db pos item M" ...
>> But I don't know how you're storing stuff in the db, so does that now
>> update the item position values? So, does pos item N now change its
>> position value to M? And do all of the items in between shift their
>> position values as well?
>>
>> The collection maintains the original position values (the web, 0-n
>> numbers) so I can track an item's movement during multiple orderings.
>> (Until they refresh the page, of course.) I just don't know if your
>> db position values are fixed or what.
>>
>> - Z
>>
Received on Fri Sep 14 2007 - 10:55:53 BST

This archive was generated by hypermail 2.2.0 : Sun Sep 16 2007 - 22:19:46 BST