This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string ofSystem(string command){ | |
FILE * ret = NULL; | |
#ifdef TARGET_WIN32 | |
ret = _popen(command.c_str(),"r"); | |
#else | |
ret = popen(command.c_str(),"r"); | |
#endif | |
string strret; | |
char c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>AllowedTypes</key> | |
<array> | |
<string>public.c-plus-plus-source</string> | |
</array> | |
<key>DefaultCompletionName</key> | |
<string>File</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl "http://www.gratisography.com/pictures/[1-88]H.jpg" -o "#1.jpg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string data = "hello there"; | |
// standard stringstream extraction based on ' ' character | |
stringstream ss(data); | |
string extract1; | |
ss >> extract1; // hello | |
cout << extract1 << endl; | |
string extract2; | |
ss >> extract2; // there | |
cout << extract2 << endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int previousStatus = 0; // 0 = nothing, 1 = hand above head | |
int resetStatusCounter = 0; | |
int resetStatusThreshold = 100; | |
void draw() { | |
// do normal kinect updates and processing here (your code) | |
int status = ?; // you need to work out when hand is above, etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "FlyCapture2.h" | |
using namespace FlyCapture2; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class ListenerClass> | |
void addEventListener(ListenerClass * listener){ | |
ofAddListener(onChangedEvent,listener,&ListenerClass::onSomething); | |
}; | |
template <class ListenerClass> | |
void removeEventListener(ListenerClass * listener){ | |
ofRemoveListener(onChangedEvent,listener,&ListenerClass::onSomething); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ofMesh ico = createIcosahedron(120); | |
ofMesh testApp::createIcosahedron(float size) { | |
ofMesh mesh; | |
GLdouble vertexB[][3]= { | |
{0, -0.525731, 0.850651}, // vertices[0] | |
{0.850651, 0, 0.525731}, // vertices[1] | |
{0.850651, 0, -0.525731}, // vertices[2] | |
{-0.850651, 0, -0.525731}, // vertices[3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deque<ofVec3f> mousePts; | |
void testApp::drawRibbonRainbow() { | |
mousePts.push_back(ofVec3f(ofGetMouseX(), ofGetMouseY(), 0)); | |
ofPolyline polyPoints; | |
for(int i = 0; i < mousePts.size(); i++) { | |
polyPoints.addVertex(mousePts[i]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gitit { | |
git pull origin develop | |
git add -A | |
git commit -am "$1" | |
git push origin develop | |
} |