flip-flop

When would a Ruby flip-flop be useful?

I think I understand how a flip-flop works thanks to this tutorial, but the example there is contrived just for teaching. Can anyone give an example of how you have actually used or would use a flip-flop? Edit: I'm looking for a real-world application, not just another demonstration. What problems can this tool solve? ...

Is Perl's flip-flop operator bugged? It has global state, how can I reset it?

I'm dismayed. Ok, so this was probably the most fun perl bug I've ever found. Even today I'm learning new stuff about perl. Essentially, the flip-flop operator .. which returns false until the left-hand-side returns true, and then true until the right-hand-side returns false keep global state (or that is what I assume.) My question is c...

Calling 'scalar' on the results of the range operator (..) in Perl

So, I believe this has something to do with the difference between arrays and lists, but I don't understand what's going on here. Can anyone explain how and why Perl treats an expression like (1..4) differently than (1, 2, 3, 4) and @{[1..4]}? $ perl -de1 Loading DB routines from perl5db.pl version 1.31 Editor support available. Enter...

SR Flip Flop and D Flip Flop

I know this isn't really a programming question, but it is definitely computer related and someone might know this. How do you construct a SR flip-flop with a D flip-flop and other logic gates? I understand that ultimately, what you want is logic gates (with S and R as inputs) connecting in to the D input of the D flip-flop, but I am...