-
Mac OS X 10.10.5
-
NVIM 0.1.1 (compiled Jan 28 2016 12:13:02)
-
MacVim-KaoriYa 20160205
-
各種プラグイン更新済み
- racerの再インストール
- NeobundleUpdate
- deoplete, neocomplete, vim-racer, rust.vim
- Rustのsrcをgit pull
This file contains 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
#pragma once | |
#include <tuple> | |
#include <iterator> | |
#include "tpl_utl.hpp" | |
namespace m_utl | |
{ | |
// support only forward_iterator | |
// e.g.) input {1,2,3}, {"abc","def","ghi"} -> output {{1,"abc"},{2,"def"},{3,"ghi"}} |
This file contains 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 <utility> | |
#include <type_traits> | |
namespace m_utl | |
{ | |
template <typename T> | |
struct identity { using type = T; }; | |
template <std::size_t N, typename T = void> |
This file contains 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
open List;; | |
let fizzbuzz min max = | |
let say cur = | |
match (cur mod 3, cur mod 5) with | |
| (0, 0) -> "FizzBuzz" | |
| (0, _) -> "Fizz" | |
| (_, 0) -> "Buzz" | |
| (_, _) -> string_of_int cur | |
in |
This file contains 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
"3.10.1 | |
"set ft=vimperator: | |
" アドオンインストール時の待ち時間カット | |
set! security.dialog_enable_delay=0 | |
" j,kによる上下スクロールの移動量を5倍に設定 | |
noremap j 5<C-e> | |
noremap k 5<C-y> |
This file contains 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
open Core.Std;; | |
type car_query = | |
| And of car_query * car_query | |
| Or of car_query * car_query | |
| Term of string * string | |
let cons_exn arg = | |
let cons_term_exn item = | |
match String.split item '=' with |
This file contains 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 <type_traits> | |
namespace m_utl | |
{ | |
template <typename... Types> | |
struct type_tuple {}; | |
// 関数の型を受け取り、戻り値を推定するメタ関数 | |
// ジェネリックラムダ以外であればこの中の何れかにオーバーロードされる | |
namespace result_of_function_impl |
This file contains 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
type trie = Trie of int option * char_to_children | |
and char_to_children = (char * trie) list | |
let empty = | |
Trie (None, []) | |
let example = | |
Trie (None, | |
[('i', Trie (Some 11, | |
[('n', Trie (Some 5, [('n', Trie (Some 9, []))]))])); |
This file contains 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
// Dining Philosophers | |
use std::thread; | |
use std::time::Duration; | |
use std::sync::{Arc, Mutex}; | |
struct Table { | |
forks: Vec<Mutex<()>>, | |
} | |
struct Philosopher { |
This file contains 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
let () = | |
let sockaddr = Unix.ADDR_INET (Unix.inet_addr_of_string "0.0.0.0", 3333) in | |
let _server = | |
Lwt_io.establish_server sockaddr (fun (in_, out) -> | |
Lwt.catch (fun () -> | |
in_ | |
|> Lwt_io.read_lines | |
|> Lwt_stream.iter_s (fun line -> Lwt_io.write_line out line) | |
) (fun _exn -> Lwt.return_unit (* callback shouldn't raise *)) | |
|> Lwt.ignore_result |
OlderNewer