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 Sim::init(){ | |
SDL_Init(SDL_INIT_EVERYTHING); | |
TTF_Init(); | |
screen = SDL_SetVideoMode(1080, 720, 32, SDL_SWSURFACE); | |
running = true; | |
#ifdef TEST_SDL_LOCK_OPTS | |
EM_ASM("SDL.defaults.copyOnLock = false; SDL.defaults.discardOnLock = true; SDL.defaults.opaqueFrontBuffer = false;"); | |
#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
collinbell@Collins-MacBook-Air:~/taggartcybernetics/simulator$ make test_sim | |
g++ -c sim.cpp | |
In file included from sim.cpp:1: | |
./sim.h:41:37: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] | |
bool bool_gui_test_finished = false; | |
^ | |
./sim.h:42:30: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] | |
bool bool_gui_result = false; | |
^ | |
sim.cpp:69:5: error: no matching function for call to 'SDL_UpperBlit' |
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
#ifndef DISTANCE_SENSOR_H | |
#define DISTANCE_SENSOR_H | |
class Robot; | |
#include <vector> | |
#include "robot.h" | |
class Distance_Sensor{ | |
public: |
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
"exception thrown: TypeError: surfData is undefined,_SDL_FillRect@file:///Users/collinbell/taggartcybernetics/simulator/run.js:9213:14 | |
__ZN3Sim4drawEv@file:///Users/collinbell/taggartcybernetics/simulator/run.js:18545:3 | |
__ZN3Sim4stepEv@file:///Users/collinbell/taggartcybernetics/simulator/run.js:18756:2 | |
__Z2cbPv@file:///Users/collinbell/taggartcybernetics/simulator/run.js:81020:3 | |
dynCall_vi@file:///Users/collinbell/taggartcybernetics/simulator/run.js:171819:3 | |
Runtime.dynCall@file:///Users/collinbell/taggartcybernetics/simulator/run.js:477:14 | |
Browser_mainLoop_runner/<@file:///Users/collinbell/taggartcybernetics/simulator/run.js:6361:13 | |
Browser.mainLoop.runIter@file:///Users/collinbell/taggartcybernetics/simulator/run.js:6425:13 | |
Browser_mainLoop_runner@file:///Users/collinbell/taggartcybernetics/simulator/run.js:6359:9 | |
SDL.receiveEvent@file:///Users/collinbell/taggartcybernetics/simulator/run.js:8018:15 |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
// Walk pairs of params adding search parameters | |
if (!empty($this->_params) && count($this->_params) % 2 == 0) { | |
for ($i = 0; $i < count($this->_params); $i += 2) { | |
switch ($this->_params[$i]) { | |
case 'city': | |
$city = $this->_params[$i + 1]; | |
break; | |
case 'keywords': | |
$keywords = $this->_params[$i + 1]; | |
break; |
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
(defn enumerate-bits [n] | |
(if (= n 1) | |
;base case, n = 1 | |
[[0] [1]] | |
;normal-case, n > 1 | |
;foreach bit string in enumerate-bits (- n 1) create 2 new bitstrings conjing - and 1 | |
(reduce | |
(fn [strings assembled-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
(defn tree-to-list [tree root-id root-key] | |
(flatten (cons | |
(get tree root-id) | |
(map | |
(fn [filter-result] | |
(tree-to-list | |
tree | |
(first filter-result) | |
root-key)) | |
(filter-by-parent tree root-key root-id))))) |
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
(defn bilateral-filter | |
([src dest diameter sigma-color sigma-space] | |
(Imgproc/bilateralFilter src dest | |
(read-string diameter) | |
(read-string sigma-color) | |
(read-string sigma-space))) | |
([src dest diameter sigma-color sigma-space border-type] | |
(Imgproc/bilateralFilter src dest | |
(read-string diameter) |
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
#!/bin/bash | |
ps -A | grep pocketsphinx_continuous | grep -v grep | awk '{print $1}' |
OlderNewer