Skip to content

Instantly share code, notes, and snippets.

@sehe
sehe / straight_line_graphviz.cpp
Last active October 4, 2024 16:01 — forked from Hermann-SW/straight_line_graphviz.cpp
Boost make_"connected / biconnected_planar / maximal_planar"+straight_line_drawing demos made create graphviz graph with fixed coordinates
#undef NDEBUG // turn on asserts
//=======================================================================
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/*
f=straight_line_graphviz
g++ -O3 -Wall -pedantic -Wextra $f.cpp -o $f
cpplint --filter=-legal/copyright,-build/namespaces,-runtime/references $f.cpp
cppcheck --enable=all --suppress=missingIncludeSystem $f.cpp --check-config
@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)