This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.----.-. | |
/ ( o \ | |
'| __ ` || | |
||| ||| -' | |
¯\_(ツ)_/¯ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class simple; | |
typedef statemachines::traits<my_state_type, threads::single_threaded> my_traits; | |
class simple : public statemachines::statemachine<simple, my_traits> { | |
public: | |
class generic_event : public event_t {}; | |
class one_event : public event_t { | |
public: | |
one_event (std::string msg) : m_message (msg) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-minor-mode code-wrap-mode | |
"Visually wrap the buffer text to the previous lines indent, plus a tab." | |
:lighter "" | |
(if code-wrap-mode | |
(progn | |
(visual-line-mode 1) | |
(jit-lock-register #'indent-prefix-wrap-function)) | |
(visual-line-mode 0) | |
(jit-lock-unregister #'indent-prefix-wrap-function) | |
(with-silent-modifications |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
%%! -smp enable -sname bvi_group | |
%% escript ./bvi_group.erl | |
% Magic compiler directive to make reduce/1 be visible in main/1. | |
-mode(compile). | |
%% This is a variant of the debt reduce interview question that works |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#define BOOST_SPIRIT_DEBUG | |
#include <boost/spirit.hpp> | |
#include <boost/spirit/actor.hpp> | |
#include <string> | |
#include <map> | |
#include <stdexcept> | |
#include <algorithm> | |
using namespace std; | |
using namespace boost::spirit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sstream> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
template<typename InIt, typename Tdelim, typename Tj> | |
Tj& join (InIt first, InIt last, const Tdelim &d, Tj &j) { | |
if (first == last) | |
return j; | |
InIt next = first; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | |
// | |
// (C) Eskil Heyn Olsen 2009 | |
// | |
#include <iostream> | |
#include <vector> | |
#include <utility> | |
#include <iterator> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "statemachines.h" | |
#include <fstream> | |
//********************************************************************************************* | |
namespace simple_test { | |
/* | |
#define TRY_CLASS_PTR_STATES 0 | |
#define TRY_CLASS_STATES 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#define BOOST_SPIRIT_DEBUG | |
#include <boost/spirit.hpp> | |
#include <boost/spirit/actor.hpp> | |
#include <string> | |
#include <map> | |
#include <algorithm> | |
using namespace std; | |
using namespace boost::spirit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct dive_table_grammar : boost::spirit::grammar<dive_table_grammar> { | |
dive_table_grammar (TablesCollection &t) : tablescollection (t) { } | |
template<typename Scanner> | |
struct definition { | |
definition (const dive_table_grammar &dt) | |
: si1 (minutes (0)), tablescollection (dt.tablescollection) | |
{ | |
using namespace boost::spirit; | |
m_depth_rule |