epoch1970;604276 Wrote:
> I was not clear.
> I don't see when the direction of the flow of bits would be of
> importance, for any of my past uses. The way I picture it in my mind is
> >>|entrance .. exit|>> but it could be the other way around for sure.
>
> What *seems* of value is the fact that bits close to the entrance
> reflect recent usage and are most significant, when bits close to the
> exit can be 20 minutes in the past (or more), hence less significant.
> I never used this information and simply tested a queue for 0/not 0.
>
> I imagine that if the empty queue sums to 0 (the way I see it),
> - a full queue would value *something big*, lets say 255,
> - a queue with only the oldest possible bit set would sum to 1
> >>|00000001|>>,
> - updating the most recent (significant) bit to 0 on a full queue
> would drop the sum from 255 to 127 >>|01111111|>>
Well, we could always add a reverse push method taking an optional
argument so that you could set the topmost bit of the cue, say:
$bQueue->rpush(1);
This would be the same as:
$discarded_bottom_bit = $bQueue->pop();
$bQueue->set($bQueue->{_nQueueLength}-1, 1);
That way, you could use a series of rpush()s to run the queue in
reverse.
epoch1970;604276 Wrote:
> Now, how 64 >>|01000000|>> hints indeed to higher activity than 63
> >>|00111111|>> eludes me (imagine that's a readout gitch vs. a player
> in pause!)... Maybe it is a bad idea to try looking for anything else
> than 0/not 0 ?
I have yet to play around seriously with Math::BigInt, so I don't know
how feasible this would be, but perhaps it could be as easy as:
# 1s indicate the area of the queue to ignore..
$biActivityMask = Math::BigInt->new("0b1111111111000");
# 1s indicate the area of interest..
$biOfInterest = Math::BigInt->new("0b0000000000111");
$biCurrentActivity = $bQueue->read();
if ( ( $biCurrentActivity & ~$biActivityMask ) & $biOfInterest ) {
do stuff
}
--
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=49028
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix