21 Sep 2000 (updated 21 Sep 2000 at 20:37 UTC)
»
Richard II
Went to see Ralph Fiennes perform in a
production of Shakespeare's "Richard II". Not one of his
more
popular
plays (compared to say, Richard III), but it was amazing
nonetheless. Great performances all around, and Ralph
added an incredible depth to this study of the construction
of Royalty and its downfall. The set design was nice:
the entire stage was covered in turf. This was more than a
gimmick, given all of the references to the ground and
sacred earth of Mother England in the play. Worth seeing if
you are in New York, although I think it is sold out by
now.
The Brooklyn
Academy of
Music is a neat place. We're actually
members,
so
I
should go to more plays and movies there.
Random note: The director Steven Soderbergh
was
sitting in the audience just behind me to the left.
Extra
funny since my domain name is taken from one of his films.
Data Structures
I might potentially have the need for an unusual data
structure. The idea is something like an unlimited FIFO*.
That is, I have a queue of items to be processed. However
this queue can get quite large and potentially consume
large amounts of memory. What I would like to be able to do
is to place most of the queue on disk if it gets to a
sufficient size. Pushes can be appended as they occur,
while pops can be done in batches (eg, the top 100 elements
on the queue). I can think of how to abstract some of this
(pushing is just appending to a file),
except for how to remove the first 100 elements from a file
of entries (the batch pop). Can anybody help me? Is there
any code
that does something like this? Is there a way to avoid
rewriting the file? I'm sorry if it's a stupid
question**, but I'm feeling a bit addled here right now.
* A FIFO does seem like a good thing for this job,
except
they have a rather limited size and block writes when they
get full. I can't do that.
** As I like to say, "There are no stupid questions,
just
stupid people." ;)
Possible Solution?
I suppose one solution might be to split up the queue into
N M-entry sized files. Push entries onto the Nth file. On
pop, read the first file into memory and delete it. This
can potentially produce a lot of files, but it might be the
best I can do.