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
dest = [] | |
locs = [] | |
def process(line): | |
global dest | |
inp_split = line.split(':') | |
dep = inp_split[0] | |
conn = inp_split[1] | |
dist = int(inp_split[2]) |
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
// ofApp.h | |
#include "Poco/DirectoryWatcher.h" | |
#include "Poco/Delegate.h" | |
Poco::DirectoryWatcher* watcher; | |
void onFileAdded(const Poco::DirectoryWatcher::DirectoryEvent& addEvent); | |
void onFileChanged(const Poco::DirectoryWatcher::DirectoryEvent& changeEvent); | |
// ofApp.cpp | |
watcher = new Poco::DirectoryWatcher(ofToDataPath("img")); |
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
// https://msdn.microsoft.com/en-us/library/dd293599.aspx & https://msdn.microsoft.com/en-us/library/dd293608.aspx | |
// sequence of tweens/animations called sequentially | |
tween.go(&width, 200, 1.0).onDone([&]() { | |
tween.go(&height, 100, 1.0).onDone([&]() { | |
tween.go(&target, ofVec3f(100,200), 1.0).onDone([&]() { | |
tween.go(&target, ofVec3f(800,400), 3.0).onDone([&]() { | |
tween.go(&rotation, 900, 1.0).onDone([&]() { | |
tween.go(&target, ofVec3f(ofGetWidth()/2, ofGetHeight()/2), 2.0); | |
}); | |
}); |
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
SETUP (FIRST TIME) | |
1. Connect laptop to WiFi network called ArduinoYun-XXXXXXXXXXXX | |
2. Goto http://arduino.local or 192.168.240.1 | |
3. Password is "arduino" or my password | |
4. Click configure | |
5. Give it unique name eg. "ArduinoYunTB" and password | |
6. Enter Wifi details we want Arduino to use eg. "LWG" | |
7. Click restart | |
SETUP (NOT FIRST TIME) |
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
// 1. go into github repo via terminal | |
cd brighthearts-beta | |
// 2. check which branch your on - eg. HPV-Vaccine | |
git branch | |
// 3. delete all your local changes, and reset to what is on github | |
git reset --hard HEAD | |
// 4. pull down the latest changes |
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
#ifdef __OBJC__ | |
ofAVFoundationVideoPlayer* p = (ofAVFoundationVideoPlayer*)videoPtr->getAVFoundationVideoPlayer(); | |
if(p != nullptr) { | |
double timeSec = CMTimeGetSeconds([p getCurrentTime]) - (1.0/[p getFrameRate]); | |
CMTime time = CMTimeMakeWithSeconds(timeSec, NSEC_PER_SEC); | |
[p seekToTime:time withTolerance:kCMTimeZero]; | |
} | |
#endif |
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
git clone http://github.com/trentbrooks/someproject | |
git bundle create someproject.bundle --all | |
- need to zip assets if not in archive | |
- if OF, might need details about which version and addons |
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
cd rockhamptongallery | |
heroku git:remote -a rockhampton-web | |
//should list two remotes, origin/github and heroku | |
git remote -v | |
middleman build | |
git add -f app/build # -f because we are ignoring git dir | |
git push heroku develop:master # heroku only works with master branch, so push our develop onto their master. |
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
- (void)updateData:(NSTimer*)timer { | |
// if already getting data do nothing | |
if(!self.isFetchDataComplete) { | |
NSLog(@"Do not get data - flag is OFF..."); | |
return; | |
} | |
// reset the flag | |
self.isFetchDataComplete = FALSE; |
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
// 1 update gcc to 4.8 | |
sudo apt-get install g++-4.8 | |
cd /usr/bin | |
sudo rm g++ | |
sudo ln -s g++-4.8 g++ | |
// 1 download OF (from github or stable linuxarm7l release with https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworksCompiled/project/linuxarmv7l/config.linuxarmv7l.rpi2.mk) | |
cd ~ | |
curl -o https://github.com/openframeworks/openFrameworks/archive/master.zip | |
curl -o http://www.openframeworks.cc/versions/v0.8.4/of_v0.8.4_linuxarmv7l_release.tar.gz |
NewerOlder