Skip to content

Instantly share code, notes, and snippets.

View trishume's full-sized avatar

Tristan Hume trishume

View GitHub Profile
@trishume
trishume / 0-sublime.json
Created October 5, 2016 19:05
Current Sublime Text settings
{
"auto_complete_commit_on_tab": true,
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
"characters": ".",
@trishume
trishume / calculations.md
Created August 8, 2016 00:43
Canada Basic Income Calculations

Basic Income

Calculations done by Tristan Hume for a public policy class report.

basic income = $10,000/year

number of adult citizens = 27131010 => 27,131,010 total cost = number of adult citizens * basic income => $271,310,100,000/year

Stuff in Canada that could be eliminated

@trishume
trishume / FittsTaskTwo.cfg
Created July 22, 2016 22:17
My Fitts' law applet settings
# Above goes participant \n condition \n block
# ----------------------------------------
# Configuration arguments for FittsTaskTwo
# ----------------------------------------
# -----
# PARTICIPANT CODE (part of output data file names)
# P21
@trishume
trishume / datasummary.rb
Created March 24, 2016 18:25
Summarize FittsTaskTwo task output data
# Summarizes data produced by my FittsTaskTwo fork
require "csv"
data = []
Dir["FittsStudy/FittsTaskTwo-P*-C*-B*-sd2.csv"].each do |f|
_, p, c, b = /FittsTaskTwo-P(.*)-C(.*)-B(.*)-sd2\.csv/.match(f).to_a
table = CSV.read(f, headers: true)
tps = table["TP(bps)"].map { |e| e.to_f }
avg_tp = (tps.inject(:+) / tps.size).round(3) unless tps.empty?
data << [c, p, b, avg_tp]
@trishume
trishume / DataShipper.cs
Created March 17, 2016 19:04
Tobii EyeX UDP data shipper to VMWare VM host.
// Used to send data from a VMWare VM running the EyeX software
// with a Steelseries Sentry to a Mac OSX host over UDP.
namespace MinimalGazeDataStream
{
using EyeXFramework;
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using Tobii.EyeX.Framework;
@trishume
trishume / eyetribe.h
Created January 27, 2016 23:26
TheEyeTribe protocol reverse engineering
// Reversing notes
// Tristan Hume
// trying to figure out what packets to send to get the lights to turn on for a TheEyeTribe tracker
// Steps so far:
// debug the server so I can figure out how to log all UVC control requests sent using
// the mechanism in https://github.com/HBehrens/CamHolderApp/blob/master/CamHolderApp%2FUVCCameraControl.h
// I've managed to figure out where the IOUSBDevRequestDesc is in registers at one point
// Next step is to create a debugger script that logs it whenever that method is called.
//
@trishume
trishume / ruby.rb
Created November 16, 2015 04:03
Ruby is awesome
def ruby_is_great
# times is an ordinary method that acts just like a loop
# it takes a block, which is like a lambda/anonymous function
# except it acts like you would expect a control structure to
5.times do |i|
# this will return from ruby_is_great not the block
return if rand() < 0.5
puts i
end
end
@trishume
trishume / techtank.rb
Created September 20, 2015 09:05
TechTanks Bot
# Modified Seek&Destroy example that hugs the left side
# Includes commented out experiments in strats
class SeekAndDestroy < RTanque::Bot::Brain
include RTanque::Bot::BrainHelper
def tick!
@desired_heading ||= nil
@rands ||= (1..10).map { rand() * Math::PI * 2 }
@dirn ||= RTanque::Bot::BrainHelper::MAX_BOT_SPEED
@trishume
trishume / gauss.rb
Created February 3, 2015 02:27
Ruby Gaussian Elimination Steps
# Step-By-Step Gaussian Elimination on Augmented Matrices
# By Tristan Hume
require "rational"
def reduce_down(mat)
# Use each row going down to cancel lower rows
# Each iteration of this loop is one step
rows = mat.length
(0..rows-2).each do |ri1|
@trishume
trishume / velo_stats.md
Last active August 29, 2015 14:08
Data on Chording Keyboard Layout Efficiency

Pure Velotype system without layout:

the theoretical maximum for an orthographic chording system based on start+vowels+end

3.2 characters per stroke = 1.49 strokes per word

Velotype with extra suffixes no layout (er|ed|en|e|ion|able|ing|al):

same as above, but with the ability to type common suffixes is the same stroke

3.46 characters per stroke = 1.38 strokes per word