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 numpy as np | |
import scipy.interpolate | |
import scipy.signal | |
def match_sampled_brutal(ts1, haystack, ts2, needle, minlen=100): | |
dt = np.median(np.diff(ts1)) | |
ts1_base = ts1[0] | |
ts1 = ts1 - ts1_base |
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
gistup |
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
/* | |
* GStreamer | |
* Copyright (C) 2006 Stefan Kost <ensonic@users.sf.net> | |
* Copyright (C) 2017 Jami Pekkanen <jami.pekkanen@gmail.com> | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Library General Public | |
* License as published by the Free Software Foundation; either | |
* version 2 of the License, or (at your option) any later version. | |
* |
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 <opencv2/opencv.hpp> | |
#include <string> | |
using namespace cv; | |
int main(int argc, char **argv) { | |
int camno = 0; | |
if(argc > 2) { | |
camno = std::atoi(argv[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
import numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.stats | |
import pyximport; pyximport.install() | |
from pixcount import pixcount | |
import scipy.ndimage | |
data = np.load('diffs.npy') | |
ts = data[:,0] | |
frames = 1000 |
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
/** | |
Hangs after two frames with gstreamer 1.0: | |
gcc -o v4l2_hang1.0 `pkg-config gstreamer-1.0 --cflags --libs` v4l2_hang.c && ./v4l2_hang1.0 | |
Works fine with 0.10 | |
gcc -o v4l2_hang0.10 `pkg-config gstreamer-0.10 --cflags --libs` v4l2_hang.c && ./v4l2_hang0.10 | |
*/ | |
#include <gst/gst.h> | |
#include <stdio.h> |
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
Loppuiko historian loppu: | |
Historian loppuun (1992) | |
Lätkän MM-kultaan (1995) | |
Sokalin tapaus (1996) | |
Dot-com-romahdukseen (1995) | |
Dianan kuolema (1997) | |
WTO-iskuihin (1999) | |
WTC-iskuihin (2001) | |
Pentagon-iskuihin (2001) |
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 numpy as np | |
import matplotlib.pyplot as plt | |
def compensatory_radius(estimate_dispersion, R): | |
cosarg = estimate_dispersion/R**2 | |
# Cos will go negative when arg > pi/2. arg < 0 makes no sense, so no need to worry about that. | |
# Trigonometry breaks down for this at pi/2? Could probably have some sort of analytical | |
# continuation if needed, however pi/2 dispersion leading to center seems implausible for a | |
# model. | |
r_2 = R*np.cos(cosarg) |
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 pandas as pd | |
hs_poll_perc = { | |
'kok': 19.6, | |
'ps': 18.0, | |
'sdp': 17.9, | |
'kesk': 12.7, | |
'vihr': 11.1, | |
'vas': 8.2, | |
'rkp': 4.6, |
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 random | |
import selectors | |
import sys | |
total_cards = 100 | |
cards_per_player = 3 | |
deck = list(range(1, total_cards + 1)) | |
random.shuffle(deck) |