Skip to content

Instantly share code, notes, and snippets.

View dmackinnon1's full-sized avatar

Dan MacKinnon dmackinnon1

View GitHub Profile
View test.tex
\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.
View gist:8a5b25bab7a7ce4a3800b757157243f1
# 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
View example_rtweet.r
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
View forest_of_fogetfulness.ipynb
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
View url_fetch.py
# 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');
View binomial_1.rmd
---
title: "Binomial and Negative Binomial Simulation"
author: "Dan MacKinnon"
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
View playlist.rmd
---
title: "Playlist"
author: "Dan MacKinnon"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
##Introduction
@dmackinnon1
dmackinnon1 / twin_partners.rmd
Last active March 24, 2017 18:07
Simulation in R of the "twin lab partners" problem.
View twin_partners.rmd
---
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 / pancake.rmd
Last active March 24, 2017 18:17
Simulating and exploring the pancake probability problem in R
View pancake.rmd
---
title: "Pancake Problem"
author: "Dan MacKinnon"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@dmackinnon1
dmackinnon1 / false_positives.rmd
Last active March 20, 2017 02:12
Exploring a 'false positive' conditional probability problem using a simulation in R.
View false_positives.rmd
---
title: "False Positives"
author: "Dan MacKinnon"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```