random

Class: Numerical - PHP Classes

Need to generate random numbers, but not uniformly distributed? Check out this class! It will help you.

jQuery :random filter - Waldek Mastykarz

While working on a new JavaScript mockup I needed a way to obtain a random jQuery item. While I could use jQuery(“selector”).get(int) to get a random item, I wanted to have a cleaner way of doing that to keep my code clean. jQuery ships with great support for extensibility. You can not only extend jQuery with custom functions but filters as well. That is when I thought of the custom “:random” filter, just as you have the standard “:first”, “:last” and “:nth” filters.

Subscribe to random