Skip to content

Instantly share code, notes, and snippets.

View collinalexbell's full-sized avatar

collinalexbell collinalexbell

  • 00:26 (UTC -05:00)
View GitHub Profile
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
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'
#ifndef DISTANCE_SENSOR_H
#define DISTANCE_SENSOR_H
class Robot;
#include <vector>
#include "robot.h"
class Distance_Sensor{
public:
"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
@collinalexbell
collinalexbell / preprocessor_fun.h
Created January 8, 2016 14:21 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// 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,
// 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;
(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]
(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)))))
(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)
@collinalexbell
collinalexbell / get_pid.sh
Last active September 11, 2016 10:44
hideos pid kill in clojure
#!/bin/bash
ps -A | grep pocketsphinx_continuous | grep -v grep | awk '{print $1}'