Skip to content

Instantly share code, notes, and snippets.

@sehe
sehe / test.cpp
Created Aug 26, 2022
tweaking a simple Asio channel benchmark
View test.cpp
//#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>
View Makefile
# 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:
View test.cpp
//////////////////////////////////////////////////////////////////////////////
// '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>
View test.cpp
//#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 Mar 24, 2018
executors question
View test.cpp
#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
View test.cpp
#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;
View Makefile
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
Binary min/max function calls in X3 calc ample
View .gitignore
.*.swp
.*.swo
test
*.o
View CMakeLists.txt
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 Feb 1, 2017 — 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).
View clean_audio.sh
# 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