Skip to content

Instantly share code, notes, and snippets.

View drvinceknight's full-sized avatar
😀
👍

Vince Knight drvinceknight

😀
👍
View GitHub Profile
\documentclass{article}
\begin{document}
\begin{center}
\begin{tabular}{cccccccccc}
\input{CC_table.tex}
\end{tabular}
\end{center}
\end{document}
import csv # The csv module
with open('tmp.csv', 'w') as f: # Opening a file in write mode
csvwriter = csv.writer(f)
csvwriter.writerow(['Header'])
with open('tmp.csv', 'a') as f: # Opening a file in append mode
csvwriter = csv.writer(f)
for k in range(100): # Looping over first 99 integers
csvwriter.writerow([k])
nbs = $(wildcard *.ipynb)
pdfs = $(nbs:%.ipynb=%.pdf)
all: $(pdfs)
%.pdf: %.ipynb
jupyter-nbconvert --to pdf $<;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Paper accepted: "An Open Framework for the Reproducible Study of the Iterated Prisoner’s Dilemma "

Vince Knight

On the 31st of August, myself and 21 co-authors had an article accepted for publication in the journal of open research software. This list of authors includes mathematicians and software developers from various parts of the world as well as some of our own students.

Having 22 authors is not common in Mathematics but with the other core developers of the software in question, we decided that anyone who made a

import doctest
import os
import unittest
def load_tests(loader, tests, ignore):
for root, dirs, files in os.walk("./docs"):
for f in files:
if f.endswith(".rst"):
tests.addTests(
import axelrod as axl
import random
from sys import argv
random.seed(1)
if len(argv) == 1:
processes = None
else:
processes = 2
import json
import time
from multiprocess import Process, Queue
import axelrod as axl
def match_generator(players, turns=100, repetitions=1000):
for rep in range(repetitions):
for player1 in players:
from collections import Counter
responses = ['E', 'B', 'C', 'E', 'E', 'B', 'A']
counts = Counter(responses)
# Print all of the counter object:
print counts
# Iterate through everything in counts and print them (a Counter acts like a
# dictionary).
import axelrod as axl
players = [axl.Cooperator(), axl.Defector(), axl.TitForTat(),
axl.PSOGambler(), axl.BackStabber(), axl.ThueMorse()]
tournament = axl.Tournament(players, processes=2)
results = tournament.play()
print(results.ranked_names)