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 <math.h> | |
struct Quaternion | |
{ | |
double w, x, y, z; | |
}; | |
struct EulerAngles | |
{ | |
double roll, pitch, yaw; |
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
uint64_t time_now() | |
{ | |
return (std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch())).count(); | |
} |
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
#!/bin/bash | |
# manually join security feeds | |
TIMEOUT=24h | |
IFACE=$1 | |
while read p; do | |
python udp_sub.py $p $IFACE > /dev/null & | |
done <<EOF | |
224.0.31.2 14311 | |
224.0.31.44 14311 | |
224.0.31.23 14311 |
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 socket | |
import time | |
#import fcntl | |
#import os | |
HOST = '192.168.9.10' | |
PORT = 29999 | |
PPS = 20000 | |
delay = 1.0/PPS | |
s = socket.socket(socket.AF_INET, socket.SOCK_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
function main() { | |
// declare local variables | |
var orig_ruler_units = app.preferences.rulerUnits; | |
var orig_type_units = app.preferences.typeUnits; | |
var orig_display_dialogs = app.displayDialogs; |
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
git fetch origin '+refs/heads/*:refs/remotes/origin/*' '+refs/remotes/*:refs/remotes/upstream/*' | |
#Source: https://stackoverflow.com/questions/28645819/how-to-fetch-all-branches-including-the-remotes-remote-branches |
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 <chrono> | |
#include <iostream> | |
auto start = std::chrono::steady_clock::now(); | |
// *************** | |
// CODE UNDER TEST | |
// *************** | |
auto end = std::chrono::steady_clock::now(); | |
auto diff = end - start; | |
std::cout << std::chrono::duration <double, std::nano> (diff).count() << " ns" << std::endl; |
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
cpu_set_t cpuset; | |
CPU_ZERO(&cpuset); | |
CPU_SET(###CPU ID###, &cpuset); | |
int rc = pthread_setaffinity_np(###THREAD HANDLE####, sizeof(cpu_set_t), &cpuset); |
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 ./udpmulticast2udp.cpp -o udpmulticast2udp-app to compile | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <time.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.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
#include <arpa/inet.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <unistd.h> | |
int main() { | |
const char* server_name = "localhost"; | |
const int server_port = 8877; |
NewerOlder