who Langston warned and Dunbar amused

Those of you who have been keeping track (and to you I apologize), will be aware that I have a number of “systems” I use in order to keep track of what order I watch my DVDs in. I have quite a few DVDs, and I have a few guidelines that I like to follow while watching them — for example, I like to watch all of the special features on each DVD, but I also like to wait between re-watchings of a DVD so that I don’t get too bored of it. I also like to try my best to watch netflix DVDs as soon as possible so I can get them back (so I can get more), etc. I used to accomplish this by just have kind of a big pile of DVDs and I would sort of grab whichever one I felt like watching at the time. I know this kind of thing is entirely sufficient for most people, but I spend far too much time worrying about optimization in my own life, and it just wasn’t swinging it for me. So, over a period of time, I came up with the system that I use now — a trio of interdependent queues[1], combined with a cascading interleave to form a single queue, from which I select movies one by one.

Let me describe the interleaving part in a little more details, because it’s really the part that makes everything work. The 3 individual queues are each made up of a single type of movie; there’s the Netflix queue, the queue of movies that I haven’t watched yet, and the queue of movies of which I have watched the main feature, but I have not yet watched the special extra features. So first I interleave the two latter queue together to form a composite queue of “movies I own”. I then take the Netflix queue and interleave it with this composite queue to get the final ordering of movies to watch. Movies are removed from the “master queue” in order, and they are added to each sub-queue as I get them. Arriving netflixen are obviously added directly the the end of the netflix queue. When I buy a new DVD, it’s added to the end of the “main feature” queue, and after I watch the main feature of a movie that I own, if there are special features on the disc, I put it at the end of the “special features” queue. When I watch a disc’s special features, I generally only watch an hour or two worth of features at a time, and then put it back at the end of the same queue.

This system affords a number of nice features — I watch netflixen reasonably quickly, twice as often as movies that I own. This helps me keep the netflix flow going at a good pace. Interleaving “new” movies with special features discs makes sure that I don’t get overly bored watching documentary after commentary after documentary. Putting movies back at the end of the special features queue means that I maximize the amount of time between 2 watchings of a given DVD — this way I won’t get bored watching stuff about the same movie over and over. Some movies do go through the queue a lot of times — FotR went through 7 times (one viewing of the film, 2 special feature discs, 4 commentaries), but that’s not bad. At no point did I think “God, shut up about the ELVES already”, and I got to see everything on the disc.

The really nice thing about this system is that the implementation is quite simple — it’s just a pile of DVDs, in order. It’s trivially easy to inspect the pile and determine where a given DVD should be inserted to simulate the system described above. Since I almost always have more DVDs than I do netflixen, they just go underneath whatever DVD is under the lowest netflix. Normal DVD either go between the high pair of DVDs of the opposite type that are adjacent, or they just go at the bottom of the pile. So that’s the system.

“Queue” is a computer science term that describes a linear data structure. The idea is that it’s an ordered list of items that supports 2 operations — popping an element off the head of the list, or pushing an elements on to the tail of the list. Here’s a graphical explanation:

Given a list like this:

A B C D E

You can pop the head element off, leaving you with:

B C D E

And you can add a new element onto the end (let’s say “X”), giving you:

B C D E X

This makes more sense if you think about the British sense of the word “queue”, which they use to mean a line, like one that you stand in. So a queue data structure represents a queue in life — people go to the end of the line when they arrive, and remove themselves from the beginning of the line when the resource they’re waiting for is freed up. This is also known as a “FIFO” structure, meaning “first in, first out”.

So that’s a queue.

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>