Skip to content

Instantly share code, notes, and snippets.

View dmackinnon1's full-sized avatar

Dan MacKinnon dmackinnon1

View GitHub Profile
\input logicdocument
\heading
Week 1 Problem Set
Your Name
Introduction to Formal Logic
\endheading
Translate the following English sentences into the language of first-order logic.
# be nice with this simple example:
# only positive integers pls.
def fact(x):
if x == 1:
return x
else:
return x*fact(x-1)
a = 4
@dmackinnon1
dmackinnon1 / example_rtweet.r
Created November 9, 2019 03:04
simple rtweet example
install.packages("libcurl")
install.packages("curl")
install.packages("httr")
install.packages("rtweet")
install.packages("ggplot2")
install.packages("maps")
install.packages("dyplr")
install.packages("igraph")
install.packages("network")
install.packages("sna")
@dmackinnon1
dmackinnon1 / forest_of_fogetfulness.ipynb
Last active September 14, 2018 19:31
A Jupyter notebook for the "Lion and Unicorn" puzzle (puzzle 47) in "What is the Name of This Book?" By Raymond Smullyan
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dmackinnon1
dmackinnon1 / url_fetch.py
Last active May 24, 2018 19:43
Python - read csv, get json, write file
# A sample python file, kept for reference.
# -----------------------------------------
# reads a set of values from a csv,
# uses these in url construction, performs a get,
# extracts from json, writes to a new file.
import urllib.request
import json
import csv
csvfile = open('entitlements.csv', newline='')
targetfile = open('target.csv', 'wb');
@dmackinnon1
dmackinnon1 / r_monty.rmd
Last active August 15, 2017 00:32
Exploring the Monty Hall Problem in R
---
title: "R Monty"
author: "Dan MacKinnon"
date: "March 14, 2017"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
---
title: "Binomial and Negative Binomial Simulation"
author: "Dan MacKinnon"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@dmackinnon1
dmackinnon1 / pancake.rmd
Last active March 24, 2017 18:17
Simulating and exploring the pancake probability problem in R
---
title: "Pancake Problem"
author: "Dan MacKinnon"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@dmackinnon1
dmackinnon1 / twin_partners.rmd
Last active March 24, 2017 18:07
Simulation in R of the "twin lab partners" problem.
---
title: "Twin Lab Partners"
author: "Dan MacKinnon"
date: "March 21, 2017"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@dmackinnon1
dmackinnon1 / playlist.rmd
Created March 22, 2017 20:14
Simulation of 'how many tracks before a repetition in my playlist' problem
---
title: "Playlist"
author: "Dan MacKinnon"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
##Introduction