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
# vim: ft=python | |
def _init(): | |
import os.path as p | |
$XONSH_ENCODING = "utf-8" | |
$XONSH_SHOW_TRACEBACK = False | |
$FORCE_POSIX_PATHS = True | |
$XONSH_COLOR_STYLE = "monokai" | |
$XONSH_HISTORY_BACKEND = 'sqlite' | |
$PROMPT = "{env_name:{} }{BOLD_CYAN}{cwd_base}{branch_color}{curr_branch: {}}{RESET} ${RESET} " |
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
{ | |
"configurations": [ | |
{ | |
"name": "Mac", | |
"includePath": [ | |
"/usr/include", | |
"/usr/local/include", | |
"${workspaceFolder}" | |
], | |
"defines": [], |
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 <iostream> | |
#include <sstream> | |
#include <tuple> | |
using namespace std; | |
template <size_t Pos, typename Tpl, typename Head> | |
void _format_tuple(ostream& os, const Tpl& tpl) { | |
os << get<Pos>(tpl); | |
} |
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
package ninja.util.camel.example | |
import org.apache.camel.CamelContext | |
import org.apache.camel.Exchange | |
import org.apache.camel.ProducerTemplate | |
import org.apache.camel.builder.ExchangeBuilder | |
import org.apache.camel.builder.RouteBuilder | |
import org.apache.camel.impl.DefaultCamelContext | |
fun CamelContext.addRoute(f : RouteBuilder.() -> Unit) { |
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
#lang racket | |
(require data/heap) | |
(struct item | |
(timestamp priority id event) | |
#:transparent) | |
; x < yなら#t, x > yなら#fを返す。 | |
; x = yなら、bodyの評価結果を返す。 |
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
fn call_f<F>(f: &F) -> i32 where F: ?Sized, F: Fn(i32) -> i32 { | |
f(100) | |
} | |
fn main() { | |
let f : Box<Fn(i32) -> i32> = Box::new(|&: x| 2 * x); | |
let v : i32 = call_f(&*f); | |
println!("{}", v); | |
} |
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
fn call_f<F: ?Sized + Fn(i32) -> i32>(f: &F) -> i32 { | |
f(100) | |
} | |
fn main() { | |
let f : Box<Fn(i32) -> i32> = Box::new(|&: x| 2 * x); | |
let v : i32 = call_f(&*f); | |
println!("{}", v); | |
} |
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
use std::num::Int; | |
use std::iter::{Iterator, iterate}; | |
struct FibIter<'a, T:Int> { | |
iterator : Box<Iterator<Item=T> + 'a> | |
} | |
impl <'a, T:Int> Iterator for FibIter<'a, T> { | |
type Item = T; |
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
use std::iter::{Iterator, iterate, Map, Unfold}; | |
use std::num::Int; | |
type FibInternalIter<T> = Map< | |
(T, T), T, | |
Unfold< | |
(T, T), (fn((T, T)) -> (T, T), Option<(T, T)>, bool), | |
fn(&mut (fn((T, T)) -> (T, T), Option<(T, T)>, bool)) -> Option<(T, T)>>, | |
fn((T, T)) -> T>; |
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
use std::iter::{Iterator, iterate}; | |
use std::num::Int; | |
struct Fib<T, I> where T: Int, I: Iterator<Item=T> { | |
it : I | |
} | |
impl <T, I> Iterator for Fib<T, I> where | |
T: Int, | |
I: Iterator<Item=T>, |
NewerOlder