Skip to content

Instantly share code, notes, and snippets.

@amedama41
amedama41 / rst.vim
Created July 28, 2019 01:18
additional syntax for reStructuredText
syn region rstExplicitMarkup keepend
\ start=+^\z(\s*\)\.\.\s+
\ skip=+^\(\(\z1\s\+\)\@>\S\|\s*$\)+
\ end=+^\ze\s*\S+
\ contains=rstExplicitMarkupDot,@rstDirectives,rstSubstitutionDefinition,rstComment
syn match rstExplicitMarkupDot '^\s*\.\.\_s' contained
\ nextgroup=@rstDirectives,rstSubstitutionDefinition,rstComment
let s:rst_directive_list = {
\ 'list-table': 'rstDirectiveListTable',
#include <cstdint>
#include <iostream>
#include <string>
#include <boost/timer/timer.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/strand.hpp>
struct handler
{
void operator()()
#include <cstddef>
#include <algorithm>
#include <atomic>
#include <iostream>
#include <mutex>
#include <random>
#include <thread>
#include <vector>
#include <boost/asio/io_service.hpp>
#include <boost/asio/strand.hpp>
#include <cstddef>
#include <algorithm>
#include <atomic>
#include <exception>
#include <iostream>
#include <random>
#include <thread>
#include <vector>
#include <boost/asio/io_service.hpp>
#include <boost/asio/strand.hpp>
@amedama41
amedama41 / aso_ssl_pending_test.cpp
Created October 25, 2015 08:21
Boost.ASIO SSL pending test
#include <iostream>
#include <boost/asio.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/asio/steady_timer.hpp>
namespace asio = boost::asio;
namespace ssl = asio::ssl;
using tcp = asio::ip::tcp;
@amedama41
amedama41 / gui.py
Created June 28, 2014 03:17
Graph algorithm visualization sample
import Tkinter
import socket
import struct
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1', 35555))
sock.setblocking(False)
root = Tkinter.Tk()
canvas = Tkinter.Canvas(root, width = 700, height = 700)
@amedama41
amedama41 / begin_impl.hpp
Created February 23, 2014 01:10
BGL property iterator for Boost.Fusion
#ifndef CANARD_PROPERTY_SEQUENCE_BEGIN_IMPL_HPP
#define CANARD_PROPERTY_SEQUENCE_BEGIN_IMPL_HPP
#include <boost/fusion/sequence/intrinsic.hpp>
#include "property_sequence.hpp"
#include "property_iterator.hpp"
namespace boost {
namespace fusion {
namespace extension {
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/utility.hpp>
namespace canard {
template <class Iterator>
class slide_view_iterator;
namespace detail {
template <class Iterator>
struct slide_iterator_base {
@amedama41
amedama41 / multiple_source_dijkstra.cpp
Last active October 14, 2016 23:44
A example of multiple source dijkstra.
#include <fstream>
#include <iterator>
#include <limits>
#include <string>
#include <random>
#include <ctime>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/graphviz.hpp>
#include <boost/graph/small_world_generator.hpp>
#include <fstream>
#include <iterator>
#include <limits>
#include <string>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/graphviz.hpp>
#include <boost/graph/properties.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/range/algorithm/for_each.hpp>