I hereby claim:
- I am keens on github.
- I am blackenedgold (https://keybase.io/blackenedgold) on keybase.
- I have a public key ASCwR-77ZlzD3WaHeOUfctKGDEc0g6RPG1qa3VEpX9URQgo
To claim this, I am signing this object:
use std::io::{self, Write}; | |
fn main() { | |
let n = 600000; | |
let out = io::stdout(); | |
let mut out = out.lock(); | |
for i in 1..n { | |
let mut str = "".to_owned(); | |
if i % 3 == 0 { | |
str.push_str("Fizz"); |
$ rustup run nightly rustc -Copt-level=3 --test sort.rs | |
$ ./sort --bench | |
running 6 tests | |
test bench_insert_sort ... bench: 571 ns/iter (+/- 22) | |
test bench_insert_sort_asserted ... bench: 547 ns/iter (+/- 47) | |
test bench_insert_sort_clone ... bench: 440 ns/iter (+/- 28) | |
test bench_insert_sort_clone_asserted ... bench: 428 ns/iter (+/- 16) | |
test bench_insert_sort_unsafe ... bench: 239 ns/iter (+/- 15) | |
test bench_insert_sort_unsafe_improved ... bench: 255 ns/iter (+/- 23) |
I hereby claim:
To claim this, I am signing this object:
; https://twitter.com/kazuho/status/858425590738599936 | |
(defun mickeyconv (n) | |
(format nil "~:D" n)) | |
(mickeyconv 1234567890) ;=> "1,234,567,890" | |
; ネタです |
$ rustup run nightly rustc -O --test suffix_array.rs | |
$ ./suffix_array.rs --bench | |
running 8 tests | |
test tests::test_make_suffix_array_gfx ... ignored | |
test tests::test_make_suffix_array_keen ... ignored | |
test tests::test_make_suffix_array_keen2 ... ignored | |
test tests::test_make_suffix_array_keen_unsafe ... ignored | |
test tests::bench_make_suffix_array_gfx ... bench: 481,257 ns/iter (+/- 13,803) | |
test tests::bench_make_suffix_array_keen ... bench: 165,853 ns/iter (+/- 15,270) |
_require "basis.smi" | |
_require "ffi.smi" | |
functor ReadLine_(X: sig val name: string end) = struct | |
val readline: string -> string | |
end |
// a parameterized monad | |
mod idx { | |
use std::marker::PhantomData; | |
#[derive(Debug)] | |
pub struct Idx<X, Y, A> | |
{ | |
x: A, | |
pre: PhantomData<X>, |
#![feature(trace_macros)] | |
macro_rules! add { | |
($e1: expr, $e2: expr) => { | |
$e1 + $e2 | |
}; | |
} | |
fn main() { |
(defun read-file-into-string (file &key (buf-size 2048)) | |
(with-output-to-string (s) | |
(with-open-file (f file) | |
(let ((buf (make-array 2048 :element-type 'base-char))) | |
(loop | |
:for size := (read-sequence buf f) | |
:while (= size buf-size) | |
:do (write-sequence buf s) | |
:finally | |
(write-sequence buf s :end size)))))) |
theory ToyList | |
imports Main | |
begin | |
no_notation Nil ("[]") and Cons (infixr "#" 65) and append (infixr "@" 65) | |
hide_type list | |
hide_const rev | |
datatype 'a list = Nil ("[]") | |
| Cons 'a "'a list" (infixr "#" 65) |