This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // -*- compile-command: "clang++ -ggdb -o random_selection -std=c++0x -stdlib=libc++ random_selection.cpp" -*- | |
| //Reference implementation for doing random number selection from a container. | |
| //Kept for posterity and because I made a surprising number of subtle mistakes on my first attempt. | |
| #include <random> | |
| #include <iterator> | |
| template <typename RandomGenerator = std::default_random_engine> | |
| struct random_selector | |
| { | |
| //On most platforms, you probably want to use std::random_device("/dev/urandom")() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import argparse | |
| import sys | |
| import math | |
| import operator | |
| import itertools | |
| import Image, ImageDraw | |
| # http://stackoverflow.com/questions/14423794/equivalent-of-haskell-scanl-in-python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| THE ISA AND PC/104 BUS | |
| IBM, IBM/XT, IBM PC, and IBM PC AT are registered trademarks of | |
| International Business Machines Corporation. | |
| This file is designed to give a basic overview of the bus found in | |
| most IBM clone computers, often referred to as the XT or AT bus. The | |
| AT version of the bus is upwardly compatible, which means that cards |