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
| #![warn(rust_2018_idioms)] | |
| #[derive(Debug)] | |
| pub struct StrSplit<'haystack, D> { | |
| remainder: Option<&'haystack str>, | |
| delimiter: D, | |
| } | |
| impl<'haystack, D> StrSplit<'haystack, D> { | |
| pub fn new(haystack: &'haystack str, delimiter: D) -> Self { |
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
| " plugins | |
| let need_to_install_plugins = 0 | |
| if empty(glob('~/.vim/autoload/plug.vim')) | |
| silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
| \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| "autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
| let need_to_install_plugins = 1 | |
| endif | |
| call plug#begin() |
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 <boost/asio.hpp> | |
| #include <string> | |
| #include <iostream> | |
| #include <cerrno> | |
| #include <cstdlib> | |
| void write_handler(const boost::system::error_code &ec, std::size_t bytes_transferred); | |
| void accept_handler(const boost::system::error_code &ec); |
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 <boost/date_time/posix_time/posix_time.hpp> | |
| #include <boost/cstdint.hpp> | |
| #include <boost/thread.hpp> | |
| #include <iostream> | |
| class Sum | |
| { | |
| public: | |
| Sum(boost::uint64_t start, boost::uint64_t end): | |
| m_result(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
| #include <algorithm> | |
| #include <iterator> | |
| #include <vector> | |
| #include <iostream> | |
| #include <cstdlib> | |
| #include <cstring> | |
| #include <boost/function.hpp> | |
| #include <boost/bind.hpp> | |
| #include <boost/lambda/lambda.hpp> |
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 <string> | |
| #include <vector> | |
| #include <iostream> | |
| #include <boost/bind.hpp> | |
| #include <boost/lambda/lambda.hpp> | |
| void fill_size(std::vector<int>& sizes, std::string const& str) | |
| { | |
| sizes.push_back(str.size()); |
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 <algorithm> | |
| #include <vector> | |
| #include <iostream> | |
| #include <boost/bind.hpp> | |
| #include <boost/lambda/lambda.hpp> | |
| int divide_by(int n, int div) | |
| { | |
| return n / div; | |
| } |