Skip to content

Instantly share code, notes, and snippets.

@foowaa
foowaa / avframe_mat.hpp
Last active August 23, 2023 01:53
ffmpeg avframe and opencv mat
/*!
* \file format_converter.h
*
* \author cltian
* \date 11 2020
*
*
*/
extern "C" {
#include "libavcodec/avcodec.h"
@six519
six519 / opencv_test2.cpp
Created December 1, 2017 09:49
Basic Motion Detection With OpenCV C++ Sample Code
/*
* To compile: g++ opencv_test2.cpp -o opencv_test2 $(pkg-config --cflags --libs opencv)
*/
#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/core/ocl.hpp>
#include <unistd.h>
using namespace cv;
using namespace std;
#include <stdio.h>
#include <string.h>
#include <pulse/pulseaudio.h>
// Field list is here: http://0pointer.de/lennart/projects/pulseaudio/doxygen/structpa__sink__info.html
typedef struct pa_devicelist {
uint8_t initialized;
char name[512];
uint32_t index;
char description[256];
@andreagrandi
andreagrandi / parse_json_post.go
Created August 19, 2014 13:28
Parse a JSON http POST in GoLang
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type test_struct struct {
Test string
# If there is no version tag in git this one will be used
VERSION = 0.1.0
# Need to discard STDERR so get path to NULL device
win32 {
NULL_DEVICE = NUL # Windows doesn't have /dev/null but has NUL
} else {
NULL_DEVICE = /dev/null
}
@callemall
callemall / C++ Install gSOAP.txt
Created July 31, 2013 15:51
Install gSOAP for using C++ programs to access a SOAP API. Install from an account that has appropriate system privileges.
wget http://sourceforge.net/projects/gsoap2/files/gSOAP/gsoap_2.8.1.zip/download
unzip gsoap_2.8.1.zip
cd gsoap-2.8/
./configure --prefix=/usr
make
make install
@austinmarton
austinmarton / sendRawEth.c
Created February 27, 2012 08:40
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>
@syzdek
syzdek / ldapsearch-async.c
Created December 13, 2011 02:41
an example of an LDAP asynchronous search using an LDAP API
/*
* Simple Programming Examples And References
* Copyright (C) 2011 David M. Syzdek <david@syzdek.net>.
*
* @SYZDEK_BSD_LICENSE_START@
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
@syzdek
syzdek / ldapsearch-sync.c
Created December 11, 2011 07:10
an example of an LDAP synchronous search using an LDAP API
/*
* Simple Programming Examples And References
* Copyright (C) 2011 David M. Syzdek <david@syzdek.net>.
*
* @SYZDEK_BSD_LICENSE_START@
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*