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
#ifndef INCLUDE_GUARD_ICT_MALLOC_H | |
#define INCLUDE_GUARD_ICT_MALLOC_H | |
#define HEAP_SIZE (1000000) | |
void *ict_malloc(unsigned int size); | |
void ict_free(void *p); | |
char heap[HEAP_SIZE]; |
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
IObservable<double> MovingAvg(IObservable<double> targetStream, int windowSize) | |
{ | |
return targetStream.Zip( | |
targetStream.Skip(windowSize) | |
.StartWith(Enumerable.Repeat(0.0, windowSize)), | |
(l, r) => Tuple.Create(r, l)) | |
.Scan(0.0, (ago, next) => { return ago - next.Item1 + next.Item2; }) | |
.Skip(windowSize) | |
.Select(x => x / windowSize) | |
; |
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
function drag(callback){ | |
var downFlag; | |
mouseDown(function(x, y){ | |
downFlag = true; | |
}); | |
mouseUp(function(x, y){ | |
downFlag = false; | |
}); |
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 <iostream> | |
#include <type_traits> | |
#include <cmath> | |
#define VARIABLE Variable<float, __COUNTER__> | |
template< | |
typename T, | |
int ID | |
> |
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
from __future__ import print_function | |
import timeit | |
if __name__ == '__main__': | |
fnpy_time = timeit.timeit("map(_ + 1, xrange(1000))", setup="from fn import _", number=100) | |
pyscalambda_time = timeit.timeit("map(_ + 1, xrange(1000))", setup="from pyscalambda import _", number=100) | |
print("pyscalambda_time",pyscalambda_time) | |
print("fbpy_time", fnpy_time) |
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
from pyscalambda import _ as _1 | |
from fn import _ as _2 | |
from itertools import imap | |
import timeit | |
if __name__ == '__main__': | |
fnpy_time = timeit.timeit("map(_ + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1, xrange(1000))", setup="from fn import _", number=100) | |
pyscalambda_time = timeit.timeit("map(_ + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1, xrange(1000))", setup="from pyscalambda import _", number=100) |
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
from itertools import imap | |
import timeit | |
if __name__ == '__main__': | |
cached_time = timeit.timeit("map(_ + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1, xrange(1000))", setup="from pyscalambda import _", number=100) | |
nocached_time = timeit.timeit("map((_ + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1+ 1 + 1 + 1 + 1 + 1).nocache(), xrange(1000))", setup="from pyscalambda import _", number=100) | |
print(cached_time, nocached_time) |
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
ja: | |
admin: | |
actions: | |
import: | |
title: "%{model_label} をインポート" | |
menu: "インポート" | |
breadcrumb: "インポート" | |
link: "インポート" | |
bulk_link: "インポート" | |
done: "一括作成" |
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
ja: | |
admin: | |
actions: | |
import: | |
title: "%{model_label} をインポート" | |
menu: "インポート" | |
breadcrumb: "インポート" | |
link: "インポート" | |
bulk_link: "インポート" | |
done: "一括作成" |
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
syntax on | |
set autoindent | |
"バックアップファイルを作るディレクトリ | |
set backupdir=$HOME/.vimbackup | |
"ファイル保存ダイアログの初期ディレクトリをバッファファイル位置に設定 | |
set browsedir=buffer | |
"クリップボードをWindowsと連携 | |
"set clipboard=unnamed |
OlderNewer