Skip to content

Instantly share code, notes, and snippets.

View bakercp's full-sized avatar

Christopher Baker bakercp

View GitHub Profile
@bakercp
bakercp / HelloGist.sketch
Created December 16, 2014 23:25
HelloGist
void setup() {
}
void draw() {
ofDrawBitmapStringHighlight("Hello Gist!", 105, 120, ofColor::white, ofColor::black);
}
@bakercp
bakercp / DelaunayExample
Created December 9, 2014 01:04
ofSketch ofxDelaunay Example
/// 1. Download the zip file here: https://github.com/obviousjim/ofxDelaunay
/// 2. Extract it into your data/openFrameworks/addons folder of ofSketch.
/// 3. Make sure that the folder is called ofxDelaunay, not ofxDelaunay-master or something.
/// 4. Open ofSketch and paste the following code into a new sketch.
/// 5. Using the "Addons" button (+ in a circle next to the paperclip), scroll down and make sure ofxDelaunay is checked.
/// 6. Run!
#include "ofxDelaunay.h"
ofxDelaunay triangulation;
@bakercp
bakercp / Clock.pde
Created September 12, 2014 22:23
BlendBounceClock
color[] colors = new color[4];
PVector[] vertices = new PVector[4];
int colorIndexOffset = 0;
long lastTime = 0;
void setup()
@bakercp
bakercp / Output.txt
Last active August 29, 2015 14:05
PocoRegex Experiment.
Should print out:
跟我家那隻臘腸
他說我是壓力鍋
我想到
接著我幻想起鍋子大戰
@bakercp
bakercp / Install
Created July 21, 2014 20:25
openFrameworks on the UDOO Udoobuntu 1.0
To Install:
- Download 0.8.3 or use the 0.8.3 tag on master.
- Install dependencies.
- Copy config.linuxarmv7l.udoo.mk into $OF_ROOT/libs/openFrameworksCompiled/project/linuxarmv7l
- Go to example project.
To Prep:
$ export MAKEFLAGS="-j4 -s PLATFORM_VARIANT=udoo"
// =============================================================================
//
// Copyright (c) 2009-2013 Christopher Baker <http://christopherbaker.net>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@bakercp
bakercp / dmsg.out
Last active August 29, 2015 14:02
dmsg
0.997446] Advanced Linux Sound Architecture Driver Version 1.0.24.
[ 1.004682] Bluetooth: Core ver 2.16
[ 1.008388] NET: Registered protocol family 31
[ 1.012858] Bluetooth: HCI device and connection manager initialized
[ 1.019233] Bluetooth: HCI socket layer initialized
[ 1.024132] Bluetooth: L2CAP socket layer initialized
[ 1.029259] Bluetooth: SCO socket layer initialized
[ 1.034600] cfg80211: Calling CRDA to update world regulatory domain
[ 1.042032] i2c-core: driver [max17135] using legacy suspend method
[ 1.048319] i2c-core: driver [max17135] using legacy resume method
@bakercp
bakercp / gist:9216583
Last active August 29, 2015 13:56
Divvy API Queries
// Get the most popular routes
SELECT count(*) AS CNT, from_station_id, to_station_id FROM `Divvy_Trips_2013` GROUP BY from_station_id, to_station_id ORDER BY CNT DESC
//
SELECT COUNT(*) AS CNT, from_station_id FROM `Divvy_Trips_2013` WHERE gender = 'F' AND birth_year > 1994 GROUP BY from_station_id ORDER BY CNT DESC
@bakercp
bakercp / README.md
Created February 14, 2014 16:09
Emergency Pre-K Valentine's Day Cards

Happy Valentine's Day

@bakercp
bakercp / DataPrep.md
Last active August 29, 2015 13:56
divvy php interface

GRANT ALL PRIVILEGES ON divvy_2013.* TO 'divvy@localhost';

NOTE, LOAD DATA INFILE requires that the csv file be in the same directory as the database. strange. very strange.

  • Steps to pre-process Divvy Data
  • There are some instances of #N/A in the station ids - search for all and replace with -1 (about 1900 of them)
  • In the trip duration column, there are occasionally values with commas and quotes - e.g. "1,123" representing 1123.
    • These are converted to a single number in excel.
  • Remove the text name columns for the station names. we'll use the databased to join that data on the other table.
  • All dates are converted to mysql format using the format yyyy-mm-dd hh:mm:ss