Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle McDonald kylemcdonald

View GitHub Profile
@kylemcdonald
kylemcdonald / main.cpp
Created Nov 17, 2014
Hairball in openFrameworks.
View main.cpp
#include "ofMain.h"
class ofApp : public ofBaseApp {
public:
ofEasyCam cam;
vector<ofVec3f> vertices;
ofVboMesh mesh;
void setup() {
ofSetVerticalSync(false);
int n = 250;
@kylemcdonald
kylemcdonald / differences.txt
Last active Aug 29, 2015
Results for Google autocomplete of the phrase "Is there a difference between..." followed by different letters, for English in the USA.
View differences.txt
a break and a fracture
a buffalo and a bison
a college and a university
a sweet potato and a yam
a violin and a fiddle
add and adhd
almond flour and almond meal
alzheimer's and dementia
an attorney and a lawyer
autumn and fall
@kylemcdonald
kylemcdonald / yinxyz.py
Created Dec 10, 2014
Word-subsword pairs sorted by combined frequency.
View yinxyz.py
# run this as:
# python yinxyz.py > pairs.txt
# and in another shell:
# sort -rn pairs.txt | head -500 | cut -f2-
# word list is from http://norvig.com/ngrams/count_1w.txt
pairs = [line.strip().split('\t') for line in open('count_1w.txt')]
count = {}
for w, c in pairs:
count[w] = int(c)
@kylemcdonald
kylemcdonald / cycles.pde
Created Jan 27, 2015
Generating smooth wavetables for LEDs.
View cycles.pde
size(500, 256);
translate(0, 256);
scale(1, -1);
background(255);
int n = 497;
float inScale = 100;
float outScale = 255;
//float[] data = {0,100,0}; // one cycle
//float[] data = {0,55,10,70,30,90,60,100,60,90,30,70,10,55,0}; // 7 cycles
@kylemcdonald
kylemcdonald / artsec.md
Created Feb 4, 2015
artsec wiki leftovers.
View artsec.md

For a while there was a wiki at http://github.com/kylemcdonald/artsec but it was never really used, so I removed it. The leftovers are below.

Project Ideas

Physical displays in NYC - subverting what is displayed. Requires hardware access, possibly proper watermarking. What content is appropriate?

Network subterfuge - playing with assumptions on mobile networks. Spoofing GPS or access point data to fool location aware devices. Unintentional Flash Mob?

Spoofing known Access Points, using Man in the Middle to do fun things, like take over coffee shop networks, make people speak to one another.

@kylemcdonald
kylemcdonald / Theano setup.md
Created Feb 4, 2015
Some notes for myself about installing Theano.
View Theano setup.md

Virtual machine

Get Ubuntu

OS X

Make sure pip is using the right version of python (in this case I'm using homebrew):

$ echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile
$ echo export PATH='/usr/local/sbin:$PATH' >> ~/.bash_profile
@kylemcdonald
kylemcdonald / repetition.txt
Last active Aug 29, 2015
Japanese words with some repetition that stands out to my English ears.
View repetition.txt
xyzxyz pattern
ひとつひとつ
ひとりひとり
めちゃめちゃ
xyxy pattern
いちいち
いやいや
いよいよ
いろいろ
@kylemcdonald
kylemcdonald / audio_input.py
Last active Aug 29, 2015
Live audio input with pyprocessing.
View audio_input.py
# to get the latest pyprocessing:
# pip install --allow-unverified pyprocessing pyprocessing==0.1.3.22
import matplotlib.pyplot as plt
import scipy.fftpack as sfft
from scipy.io import wavfile
from scipy.signal import blackman
import numpy as np
@kylemcdonald
kylemcdonald / mnist_reload.py
Last active Aug 29, 2015
Training models on the GPU and loading onto the CPU with Lasagne.
View mnist_reload.py
#!/usr/bin/env python
from __future__ import print_function
import argparse
import gzip
import itertools
import pickle
import os
import sys
@kylemcdonald
kylemcdonald / mainp3.cpp
Created Apr 21, 2015
Some of the first C++ code I ever wrote, as a freshman in College.
View mainp3.cpp
#include <iostream>
using namespace std;
#define songsPerCd 12
#define totalCds 5
//this code creates an automatic 2d array
bool shoppingCart[totalCds][songsPerCd];