Skip to content

Instantly share code, notes, and snippets.

@sehe
sehe / test.cpp
Created August 26, 2022 16:21
tweaking a simple Asio channel benchmark
//#define TWEAKS
#ifdef TWEAKS
#define BOOST_ASIO_DISABLE_THREADS 1
#endif
#include <boost/asio.hpp>
#include <boost/asio/experimental/awaitable_operators.hpp>
#include <boost/asio/experimental/channel.hpp>
# This makefile was handwritten by Seth Heeren
# Replicates 90% of http://www.multi.fi/~ghaga/mymakefile/
######################################
TARGET_NAME=mymakemaker
## Targets
##########
all: exe dynamic static objs
clean:
//////////////////////////////////////////////////////////////////////////////
// 'mymakefile' is a tool for creating makefiles to be used with make
//
// Author: Greg Haga 2018
// email: ggh@multi.fi
//
// Quick reimplementation in C++ by Seth Heeren, public domain
///////////////////////////////////////////////////////////////////////////////
#include <unistd.h> // chdir
#include <experimental/filesystem>
//#define BOOST_SPIRIT_DEBUG
#include <boost/fusion/adapted/struct.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix.hpp>
#include <iomanip>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/utility/string_ref.hpp>
#include <boost/container/flat_set.hpp>
#include <fstream>
@sehe
sehe / test.cpp
Last active March 24, 2018 13:30
executors question
#include "stdafx.h"
#include <boost/config.hpp>
#if ! defined BOOST_NO_CXX11_DECLTYPE
#define BOOST_RESULT_OF_USE_DECLTYPE
#endif
#define BOOST_THREAD_VERSION 4
#define BOOST_THREAD_PROVIDES_EXECUTORS
#define BOOST_THREAD_USES_LOG_THREAD_ID
#define BOOST_THREAD_QUEUE_DEPRECATE_OLD
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>
//#include <boost/multi_index/composite_key.hpp>
#include <iostream>
namespace bip = boost::interprocess;
namespace bmi = boost::multi_index;
all:consumer producer
CPPFLAGS+=-std=c++03 -Wall -pedantic
CPPFLAGS+=-g -O0
CPPFLAGS+=-isystem ~/custom/boost/
LDFLAGS+=-L ~/custom/boost/stage/lib/ -Wl,-rpath,/home/sehe/custom/boost/stage/lib
LDFLAGS+=-lboost_system -lrt -lpthread
%:%.cpp
@sehe
sehe / .gitignore
Last active May 26, 2017 15:34
Binary min/max function calls in X3 calc ample
.*.swp
.*.swo
test
*.o
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
-isystem /home/sehe/custom/boost \
-std=c++11 \
-g -O2 -pthread -march=native")
add_definitions("-DBOOST_SYSTEM_NO_LIB")
ADD_LIBRARY(a_a a.cpp)
ADD_LIBRARY(b_a b.cpp)
ADD_LIBRARY(c_a c.cpp)
@sehe
sehe / clean_audio.sh
Created February 1, 2017 19:31 — forked from devoncrouse/clean_audio.sh
Using Sox (http://sox.sourceforge.net) to remove background noise and/or silence from audio files (individually, or in batch).
# Create background noise profile from mp3
/usr/bin/sox noise.mp3 -n noiseprof noise.prof
# Remove noise from mp3 using profile
/usr/bin/sox input.mp3 output.mp3 noisered noise.prof 0.21
# Remove silence from mp3
/usr/bin/sox input.mp3 output.mp3 silence -l 1 0.3 5% -1 2.0 5%
# Remove noise and silence in a single command