This file contains hidden or 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
#!/usr/bin/env python | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.stats import linregress | |
# Set nice options for plots and use of LaTeX. | |
from matplotlib import rc | |
rc('text', usetex=True) | |
rc('font', family='serif') |
This file contains hidden or 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> | |
int main() { | |
float a = -12; | |
unsigned int b = *reinterpret_cast<unsigned int*>(&a); | |
b <<= 1; | |
b >>= 1; | |
a = *reinterpret_cast<float *>(&b); | |
std::cout << a << std::endl; |
This file contains hidden or 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
#!/usr/bin/env python | |
from itertools import repeat | |
import numpy as np | |
NUM_RUNS = 1000 | |
def logistic_map(xn, r): | |
return r * xn * (1 - xn) |
This file contains hidden or 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 <iostream> | |
#include <random> | |
#include <utility> | |
#include <vector> | |
typedef float Number; | |
typedef std::pair<Number, Number> Point; | |
typedef std::mt19937 RandomGenerator; |
This file contains hidden or 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 <chrono> | |
#include <cmath> | |
#include <functional> | |
#include <iostream> | |
#include <random> | |
#include <utility> | |
#include <vector> | |
This file contains hidden or 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 <typename T> | |
std::pair<T, T> MeanAndError(const std::vector<T> &v) { | |
using namespace std; | |
T mean = accumulate(begin(v), end(v), T(0)) / v.size(); | |
vector<T> diff(v.size()); | |
transform(begin(v), end(v), begin(diff), std::bind2nd(minus<T>(), mean)); | |
T sq_sum = inner_product(begin(diff), end(diff), begin(diff), T(0)); | |
T sem = sqrt(sq_sum / (v.size() * (v.size() - 1))); | |
return make_pair(mean, sem); | |
} |
This file contains hidden or 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
CXX=clang++ | |
CXXFLAGS=-std=c++11 -stdlib=libc++ | |
CXXFLAGS+=-O3 -DNDEBUG | |
CXXFLAGS+=$(shell pkg-config --cflags eigen3) | |
all: kalman kalman_eigen | |
clean: | |
rm -f kalman | |
rm -f kalman_eigen |
This file contains hidden or 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
PROJECT=main | |
build/${PROJECT}.pdf: build/${PROJECT}.bbl | |
lualatex --output-directory=build ${PROJECT} | |
build/${PROJECT}.bbl: build/${PROJECT}.bcf | |
biber build/${PROJECT} | |
build/${PROJECT}.bcf: ${PROJECT}.tex | |
lualatex --output-directory=build ${PROJECT} |
This file contains hidden or 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
#!/usr/bin/env python | |
import json | |
import TCKUtils.utils as ut | |
TCK = 0x6A1710 | |
streamers = [ | |
'Hlt1TrackMuonUnit', | |
'Hlt1DiMuonHighMassStreamer', |
This file contains hidden or 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 <cassert> | |
#include <functional> | |
// | |
// Classical Function Definition | |
// | |
int add(int x, int y) { | |
return x + y; | |
} |