Skip to content

Instantly share code, notes, and snippets.

View bakercp's full-sized avatar

Christopher Baker bakercp

View GitHub Profile
###############################################################################
# CONFIGURE CORE PLATFORM MAKEFILE
# This file is where we make platform and architecture specific
# configurations. This file can be specified for a generic architecture or can
# be defined as variants. For instance, normally this file will be located in
# a platform specific subpath such as
#
# $(OF_ROOT)/libs/openFrameworksComplied/linux64
#
# This file will then be a generic platform file like:
@bakercp
bakercp / parser.cpp
Last active December 15, 2015 03:09
CSV Parsing in openFrameworks
ofHttpResponse response = ofLoadURL("http://lvaqi.org/data/data.txt");
if(response.status == 200 /* successfully http response */) {
ofBuffer buffer = response.data;
string lastLine = ""; // empty for the moment
// we are going to cycle through until we come to the last line.
// since we stop when the variable is !buffer.isLastLine(), the last line
// will fill the lastLine variable.
@bakercp
bakercp / MFA.ino
Created April 3, 2013 21:01
"LED that I'm soldering to a protoshield to start off, fade up to full brightness for a period of about 45 seconds, begin fading to dark again and as it dims, to strobe."
const byte ledPin = 11; // pwm pin
boolean bIsGoingUp = true;
long fadeUpTime = 15000; // 45 * 1000 milliseconds
long fadeDownTime = 15000; //
long nextTransition = -1;
long strobeOnTime = 200; // the time the strobe effect will be on
long strobeOffTime = 1000; // the time the normal fade out will be on
@bakercp
bakercp / gist:5602350
Created May 17, 2013 22:16
ofxOMXPlayer errors
In file included from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/OMXPlayerVideo.h:11:0,
from ../../../addons/ofxOMXPlayer/src/ofxOMXVideoPlayer.h:13,
from src/developApp.h:5,
from src/developApp.cpp:1:
../../../addons/ofxOMXPlayer/libs/omxplayer/src/OMXVideo.h:38:0: warning: "CLASSNAME" redefined [enabled by default]
../../../addons/ofxOMXPlayer/libs/omxplayer/src/OMXEGLImage.h:15:0: note: this is the location of the previous definition
In file included from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/DllAvFormat.h:4:0,
from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/OMXClock.h:3,
from ../../../addons/ofxOMXPlayer/src/ofxOMXPlayer.h:13,
from src/developApp.h:4,
@bakercp
bakercp / sgx_build_modules.sh
Created May 22, 2013 04:04
Building / Installing / Running SGX modules on the Beagle Bone Black
#!/bin/bash -e
#
# Copyright (c) 2012-2013 Robert Nelson <robertcnelson@gmail.com>
#
# 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 / out.txt
Created May 22, 2013 04:26
DMSG output for SGX
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.8.13-bone18.1 (bakercp@ubuntu64) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #1 SMP Tue May 21 21:40:08 CDT 2013
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: Generic AM33XX (Flattened Device Tree), model: TI AM335x BeagleBone
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] On node 0 totalpages: 130816
[ 0.000000] free_area_init_node: node 0, pgdat c0965940, node_mem_map c09df000
[ 0.000000] Normal zone: 1024 pages used for memmap
[ 261.526630] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 261.535342] pgd = df7f0000
[ 261.538259] [00000000] *pgd=00000000
[ 261.542101] Internal error: Oops: 5 [#2] SMP ARM
[ 261.546952] Modules linked in: bufferclass_ti(O+) omaplfb(O+) pvrsrvkm(O)
[ 261.554139] CPU: 0 Tainted: G D O (3.8.13-bone18.1 #1)
[ 261.560864] PC is at AllocateDeviceID+0x0/0x48 [pvrsrvkm]
[ 261.566631] LR is at PVRSRVRegisterBCDeviceKM+0xfc/0x17c [pvrsrvkm]
[ 261.573215] pc : [<bf0063e8>] lr : [<bf002290>] psr: 40000013
[ 261.573215] sp : de509e28 ip : 00000000 fp : 0000001c
@bakercp
bakercp / addon_config.mk
Created June 19, 2013 15:55
ofxSyphon addon_config.mk
################################################################################
# ADDON_CONFIG.MK
# This file is intended to be included in addons used with openFrameworks.
# The addon_config.mk file serves two primary purposes.
#
# 1. Addon Information and Metadata
#
# Addons are an incredibly popular way to extend the functionality of
# openFrameworks. By describing your addon using the metadata fields
# below, users will be able to find and understand your addon more easily,
@bakercp
bakercp / addons.make
Created June 19, 2013 15:56
ofxSyphon in WIP addons.make
ofxSyphon #https://github.com/astellato/ofxSyphon.git, master, 44c6e2f8913e3912c626c0d961b329c70f23890b # a comment after it ofxSyphon
ofxOsc
ofxXmlSettings
@bakercp
bakercp / gist:7146013
Created October 24, 2013 22:10
Convert a homography matrix to a gl 4x4 matrix to apply the homography to a gl texture
/* calculate a new homography matrix if the src or dst quads have changed */
if(x->changed)
{
// cvFindHomography(x,x,x); // can also use this, it is supposedly more accurate, but requires some unnessesary copies and i didn't see a difference
cvWarpPerspectiveQMatrix( x->cvsrc, x->cvdst, x->homographyMatrix ); // calculate homography
x->changed = 0;
}
// output the transformation matrix (format it as a 4x4 matrix that works with opengl)