Sean O wrote:
Nice job. I like the logic, and the fading out of unselected rows.

My solution was, admittedly, a quick one. It certainly wouldn't scale past
1,000 rows or so -- especially with the majority # selected -- but if the
10/50 number is firm, seemed to work OK.

Yours is probably more efficient on average than mine, even at higher numbers, except in extreme cases. The advantage of mine is in predictability. It's going to loop through all the rows making one call to random() for each.

Mine was actually a quick copy of something I recently had to do in my day job where this predictability was more important (to my boss) than average efficiency, and where the numbers were higher. Although I coded this approach, I argued unsuccessfully for your approach, which is usually faster.

In any case, either should work fine for the OP if the numbers are anything like the example given.

  -- Scott

Reply via email to