Comparing libevent and libuv. My upfront biased: I want to like libevent. However, I want to objectively compare the two and make an informed decision.
- libevent 2.0.22 (Stable) [2014-01-05]
- libuv 1.8.0 (Stable) [2015-12-15]
#!/bin/bash | |
# install CUDA Toolkit v9.0 | |
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb) | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb" | |
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub | |
sudo apt-get update | |
sudo apt-get -y install cuda-9-0 |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright 2016 Massachusetts Institute of Technology | |
"""Publish a video as ROS messages. | |
""" | |
import argparse |
# linux send h264 rtp stream: | |
gst-launch-1.0 -v ximagesrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000 | |
# Macos send h264 rtp stream: | |
gst-launch-1.0 -v avfvideosrc capture-screen=true ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000 | |
# receive h264 rtp stream: | |
gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink |
;; Exp. (merge '(1 3 5 7 8 9 10) '(2 4 6)) ==> (1 2 3 4 5 6 7 8 9 10) | |
(define (merge L M) | |
(if (null? L) M | |
(if (null? M) L | |
(if (< (car L) (car M)) | |
(cons (car L) (merge (cdr L) M)) | |
(cons (car M) (merge (cdr M) L)))))) | |
;; split helper functions | |
(define (odd L) |
#include "HMyClass.h" | |
#include <stdio.h> | |
void my_eh( const char * error_message, void * unused) | |
{ | |
printf("my_eh: %s\n", error_message); | |
} | |
int main() | |
{ |
/* gcc gdk-gstappsrc-stream.c -Wall `pkg-config --cflags --libs gstreamer-app-0.10 gdk-pixbuf-2.0` -o gdkstream */ | |
#include <gst/gst.h> | |
#include <gst/app/gstappsrc.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <gdk-pixbuf/gdk-pixbuf.h> |