View SYourNeighbor.py
This file contains 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/env python | |
opponent_switch_threshold = 8 | |
dealer_pulls_threshold = 10 | |
def opponent_switches(dealer_card, opponent_card): | |
"""Given that the dealer and opponent have the given cards, returns | |
(dealer_win, opponent_win, tie) as the odds for each outcome if the opponent | |
switches with the dealer.""" | |
if dealer_card == 13: |
View BLECarDrag.bas
This file contains 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
! This app uses the accelerometer to control a car hacked to use the | |
! RedBear BLE Shield and an Arduino. | |
redBearUUID$ = "713D0000-503E-4C75-BA94-3148F18D941E" | |
txUUID$ = "713D0003-503E-4C75-BA94-3148F18D941E" | |
! The reason I am putting a button over the drag area is because I want to fill | |
! it with a gradient representing the speed and direction, and the button is the | |
! only GUI element I know of that can draw a gradient. Unfortunately, to get | |
! the drag events, I have to disable the button, which messes up the colors. |
View birthdays.csv
This file contains 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
# People | 2 analytic | 2 same | 3 same | 4 same | 5 same | 6 same | |
---|---|---|---|---|---|---|---|
1 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | |
2 | 0.002740 | 0.002720 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | |
3 | 0.008204 | 0.007900 | 0.000010 | 0.000000 | 0.000000 | 0.000000 | |
4 | 0.016356 | 0.015900 | 0.000050 | 0.000000 | 0.000000 | 0.000000 | |
5 | 0.027136 | 0.026810 | 0.000090 | 0.000000 | 0.000000 | 0.000000 | |
6 | 0.040462 | 0.039790 | 0.000150 | 0.000000 | 0.000000 | 0.000000 | |
7 | 0.056236 | 0.055430 | 0.000240 | 0.000000 | 0.000000 | 0.000000 | |
8 | 0.074335 | 0.072730 | 0.000380 | 0.000000 | 0.000000 | 0.000000 | |
9 | 0.094624 | 0.092950 | 0.000590 | 0.000000 | 0.000000 | 0.000000 |
View birthdays.py
This file contains 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
import random | |
maxBirthdays = 6 | |
numDays = 365 | |
numTrials = 100000 | |
maxGroupSize = 1000 | |
def BirthdayExperiment(): | |
birthdays = [0] * numDays | |
numToDuplicates = {} |