Skip to content

Instantly share code, notes, and snippets.

View drvinceknight's full-sized avatar
😀
👍

Vince Knight drvinceknight

😀
👍
View GitHub Profile
from __future__ import division
import matplotlib.pyplot as plt
def plot(data):
row_player = [len([strategy for strategy in [row[0] for row in data[:round]] if strategy=='H'])/(round + 1) for round in range(len(data))]
column_player = [len([strategy for strategy in [row[1] for row in data[:round]] if strategy=='H'])/(round + 1) for round in range(len(data))]
plt.figure()
plt.scatter(range(len(row_player)), row_player, label='Player 1 probability of playing H')
plt.scatter(range(len(column_player)), column_player, color='red', label='Player 2 probability of playing T')
plt.plot([0, len(row_player)], [.5, .5], color='green', linestyle='-')
from __future__ import division
import matplotlib.pyplot as plt
def plot(data):
row_player = [len([strategy for strategy in [row[0] for row in data[:round]] if strategy=='H'])/(round + 1) for round in range(len(data))]
column_player = [len([strategy for strategy in [row[1] for row in data[:round]] if strategy=='H'])/(round + 1) for round in range(len(data))]
plt.figure()
plt.scatter(range(len(row_player)), row_player, label='Player 1 probability of playing H')
plt.scatter(range(len(column_player)), column_player, color='red', label='Player 2 probability of playing T')
plt.plot([0, len(row_player)], [.5, .5], color='green', linestyle='-')
This project will introduce the selected student to some neat areas of mathematics. Notably: game theory and queueing theory!
The latter of these studies the interaction of strategic decision makers and the former looks at the study of waiting in a queue. This area of mathematics has many applications including the study of the National Healthcare System.
In this project the student will learn some novel theoretical mathematics (some of which is not taught till the later years of a mathematics degree) and also write relevant computer code and/or analyse of data.
from matplotlib import pyplot as plt
plt.xkcd()
ymin = -25
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
plt.xticks([])

Risk Assessment for DjangoCon-Europ 2015

http://2015.djangocon.eu/

Location: Cardiff

Activities associated with arrival and departure at the conference venue

Description - Some foreign visitors may forget that traffic drives on the left in the UK

  • Consequence (scale: 1 to 10) => Personal Injury: 8
from selenium import webdriver
from itertools import izip
import unittest
import yaml
class VisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(3)
# Site settings
title: How to write tests
email: [email protected]
description: > # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://yourdomain.com" # the base hostname & protocol for your site
twitter_username: jekyllrb
from selenium import webdriver
browser = webdriver.Firefox() # Open the browser
browser.get('http://0.0.0.0:4000/') # Go to the address of the jekyll server
assert 'How to write tests' in browser.title # This checks that the required title is in browser title
from selenium import webdriver
browser = webdriver.Firefox() # Open the browser
browser.get('http://0.0.0.0:4000/') # Go to the address of the jekyll server
assert 'Your awesome title' in browser.title # This checks that the required title is in browser title
$ jekyll new site_for_tests