Add Special:RandomInCategory.
authorBrian Wolff <bawolff+wn@gmail.com>
Thu, 4 Jul 2013 16:19:47 +0000 (13:19 -0300)
committerBrion Vibber <brion@pobox.com>
Thu, 1 Aug 2013 17:33:04 +0000 (10:33 -0700)
commited1c89b88454744d0ae08e7048992f80920276d8
tree1dce808d12933ba23088258aa8e4667eb2a75485
parentac4fab6518e090933a25c50267f0e62810ce3475
Add Special:RandomInCategory.

The method used is quite biased, but I believe its the best
possible without a schema change and still being efficient.
I think it is good enough for many of the use cases that
need different articles to pop up, but not "real" randomness.

The method used
is to chose a random timestamp and look at cl_timestamp. This method
will give good results if the timestamps are uniformly distributed
(which probably is not usually true). I think it may give acceptable
results in general, especially given most people are not interested
in true randomness, but more in "give me a result I haven't seen before".
(For example, to pick a random entry in a maintenance category to clean
up).

It also fudges the result a little bit using offset to stop really
biased results from happening. This is mostly meant to stop a
category with an extremely clumped distributed from returning
the exact same article every time. It is not meant to generally
increase randomness.

Bug: 25931
Change-Id: I0c48e4a236b50fb627af94f0df47fef8372ea14d
RELEASE-NOTES-1.22
includes/AutoLoader.php
includes/SpecialPageFactory.php
includes/specials/SpecialRandomInCategory.php [new file with mode: 0644]
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc