Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
The C# Excel Library 2020.5
dbForge Studio for MySQL 9.0
LinkedIn Clone 2.2
Uber clone Apps 4.0
Cab Booking Script 1.3.2
Airbnb Clone HomestayDNN 3.0
Magento Language switcher 1.2.1
The .Net PDF Library 2020.3.2
IP2Location Geolocation Database 2020.5
ODBC Driver for MailChimp 2.0
ODBC Driver for NetSuite 2.0
ODBC Driver for SQL Azure 3.1
dbForge Schema Compare for Oracle 4.1
dbForge Data Compare for Oracle 5.1
dbForge Studio for Oracle 4.1
Top Code
dbForge Studio for MySQL 8.1
dbForge Studio for Oracle 3.10
dbForge Schema Compare for Oracle 2.7
dbForge Data Compare for Oracle 3.7
IP2Location Geolocation Database 2020.5
Availability Booking Calendar PHP 1.0
ATN Site Builder 3.0
Azizi search engine script PHP 4.1.10
ATN Resume Finder 2.0
Invoice Manager by PHPJabbers 3.0
Single Leg MLM 1.2.1
PHP Review Script 1.0
ICPennyBid Penny Auction Script 4.0
Extreme Injector 3.7
ODBC Driver for MailChimp 2.0
Top Rated
phpEnter 5.1.
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
Picking random items from an iterator 
File ID: 66117






Picking random items from an iterator 
Download Picking random items from an iterator http://code.activestate.com/recipes/499305-locating-files-throughout-a-directory-tree/?in=lang-pythonReport Error Link
License: Freeware
Downloads: 0
Submit Rating:
Picking random items from an iterator  Description
Description: Each item has an equal chance of being picked. The iterator is processed only once, and only the selected items are stored, making this function memory efficient.

This is based on idea from Richard Papworth's recipe that picks a random from a file - see http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/59865 - but is more general.

License: Freeware

Related: Algorithms

O/S:Windows

Downloads: 0



More Similar Code

Creates an iterator which returns N-tuples built from the incoming items from another iterator. Useful, for example, when you need items two at a time.



This plugin will add items from an rss feed to your blog. The items will show after the content on your single post. The will pull new content every time the page loads thus helping with Google Rank since you will have new content on your single...



RANDWORD generates a random word from an alphabet. The words are selected from the lexicographically ordered list of all words of the given length using a random index generated with 'rand'.

WORD = RANDWORD(alpha, wordSize) returns a...



Program "rand_log_concave.m" generates random numbers from an arbitrary log-concave generalized pdf (i.e., a pdf known up to its normalization constant). The log of the pdf must be concave. In particular, the program can be used to...



This implements a "unique" filter. Its input is an iterator of hashable items. It returns an iterator containing only the unique items of the input, in input order. That is, list(unique("cabbage")) produces ["c",...



Routines to generate random numbers from various handy distributions: binomial, geometric, general discrete, Pareto, etc. See:
http://www.math.uu.se/research/telecom/software



This m-file produces random numbers from the negative Binomial distribution using one of four methods and it tests which is faster.



This widget will list random posts from a chosen category. You can choose how many posts to display, and whether to show the excerpt or the full content in addition to the post title. You may also link the widget title to the category archive if...



ASP.NET: Dispaly data from an Excel Spreadsheet is an ASP.NET tutorial in which programmers can get details about the process of displaying the data from Excel spread sheet with the help of VB.NET. The author explains this topic with example...



How To Retrieve and Display Records from an Access Database by Using ASP.NET, ADO.NET, and Visual C# .NET is an article that explains step-by-step process of fetching records from the Access database and bind it to the datagrid control using...

User Review for Picking random items from an iterator
- required fields
     

Please enter text on the image