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
struct Client { | |
int channel; | |
std::vector<char> buffer; | |
uint64_t to_receive = 8; | |
uint64_t received = 0; | |
bool on_receive(); | |
}; | |
int main() { |
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 <fstream> | |
#include <unordered_map> | |
#include <algorithm> | |
using namespace std; | |
void skip_to_word(istream& stream); | |
string scan_word(istream& stream); |
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 <fstream> | |
#include <unordered_map> | |
#include <algorithm> | |
using namespace std; | |
using Code = uint16_t; | |
enum Symbol { Letter, Delimiter, Unsupported, Invalid, End }; |
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
# Adjust parameters in CAPS to your needs. | |
SEGMENT_HOURS=6 | |
RECORD_DAYS=7 | |
exec ffmpeg \ | |
-y -hide_banner -nostats -loglevel info \ | |
-i 'http://IP:PORT/videostream.cgi?user=USERNAME&pwd=PASSWORD' \ | |
-f segment -segment_time $((SEGMENT_HOURS*60*60)) -segment_wrap $((RECORD_DAYS * 24 / SEGMENT_HOURS)) -segment_atclocktime 1 \ | |
-strftime 1 \ | |
"recording_%Y-%m-%d_%H-%M.webm" |
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
#define _WIN32_WINNT _WIN32_WINNT_WIN10 | |
#include <windows.h> | |
#include <stdio.h> | |
OVERLAPPED overlapped = {}; | |
VOID | |
timer_proc(LPVOID arg, DWORD low, DWORD high) | |
{ |
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
/* | |
* gcc -O2 matrix.c -o matrix | |
* | |
* for i in {1..30}; do echo 768 | ./matrix; done > matrix.csv | |
* | |
* R | |
* data = read.csv("matrix.csv", header = FALSE) | |
* wilcox.test(data$V1, data$V2, alternative = "two.sided") | |
*/ |