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
import os | |
env = os.environ | |
tools = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\Hostx64\\x64' | |
os.environ['PATH'] = tools | |
include = [ | |
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\include', | |
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\atlmfc\\include', | |
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\VS\\include', | |
'C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17134.0\\ucrt', |
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
/* | |
Library: https://github.com/bolderflight/MPU9250 | |
Ports | |
MPU9250 Arduino Mega | |
VCC 3.3V | |
GND GND | |
SCL SCL | |
SDA SDA | |
*/ |
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 <algorithm> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <fstream> | |
#include <functional> | |
#include <random> | |
#include <stdexcept> | |
#include <vector> | |
float const eta = 0.01; |
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
// This code reads map from input.txt, finds shortest paths, and writes path | |
// information to output.txt. | |
// Map legend: | |
// 0: Road | |
// 1: Obstacle | |
// 2: Starting point | |
// 3: Destination | |
// 4: Path |
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 drawMap(map) | |
save_hold = ishold(); | |
[height, width] = size(map); | |
rectangle('Position', [0.5 -0.5-height width height]); | |
for i = 1:height | |
for j = 1:width | |
here = map(i, j); | |
if here == 'S' | |
rectangle('Position', [j-0.3 -i-0.3 0.6 0.6],... | |
'FaceColor', [1 0 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
#include <cstddef> | |
template <typename T> | |
struct ArrayDimension; | |
template <typename T, size_t N> | |
struct ArrayDimension<T[N]> | |
{ | |
static constexpr size_t Value = ArrayDimension<T>::Value + 1; | |
}; |
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 "ThreadPool.hh" | |
void ThreadPool::Run() | |
{ | |
_threads.reserve(_numThreads); | |
for (size_t i = 0; i < _numThreads; ++i) | |
_threads.push_back(std::thread(std::bind(&ThreadPool::_Thread, this))); | |
} | |
void ThreadPool::Stop(bool wait_for_remaining_tasks) |
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
module SplitBySpace (splitBySpace) where | |
splitBySpaceDone :: ([Char], [[Char]]) -> ([Char], [[Char]]) | |
splitBySpaceDone ("", y) = ("", y) | |
splitBySpaceDone (x, y) = ("", [x] ++ y) | |
splitBySpaceAppend :: Char -> ([Char], [[Char]]) -> ([Char], [[Char]]) | |
splitBySpaceAppend a (x, y) = ([a] ++ x, y) | |
splitBySpaceInternal :: [Char] -> ([Char], [[Char]]) |
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 <iostream> | |
#include <string> | |
#include <unordered_map> | |
#include <utility> | |
#include <vector> | |
using namespace std; | |
unordered_map<char, unsigned> const prec = { | |
{ '^', 1 }, |
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
const ops = "+-*/"; | |
const nums = "0123456789"; | |
function split(expr) { | |
let rtn = []; | |
let stack = ''; | |
for (let i = 0; i < expr.length; ++i) { | |
if (ops.includes(expr[i])) { | |
rtn.push(stack); | |
rtn.push(expr[i]); |
OlderNewer