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
//コンパイル時に動く | |
int hash(T)(){ | |
//下の表を参照して、Tの型が登録されていたら対応する値を | |
//登録されていない場合、登録して対応させた値を返す | |
} | |
//コンパイル時でも実行時でもどちらでもよい | |
int getHashMax(){ | |
//下の表の要素数を返す |
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
//コンパイル時に動く | |
int hash(T)(){ | |
//下の表を参照して、Tの型が登録されていたら対応する値を | |
//登録されていない場合、登録して対応させた値を返す | |
} | |
//コンパイル時でも実行時でもどちらでもよい | |
int getHashMax(){ | |
//下の表の要素数を返す |
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
//コンパイル時に動く | |
int hash(T)(){ | |
//下の表を参照して、Tの型が登録されていたら対応する値を | |
//登録されていない場合、登録して対応させた値を返す | |
} | |
//コンパイル時でも実行時でもどちらでもよい | |
int getHashMax(){ | |
//下の表の要素数を返す |
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
def C(n,m): | |
return P(n,m) / P(m,1) | |
def P(n,m): | |
if (n == m): | |
return m | |
return n * P(n - 1, m) |
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
module event; | |
import derelict.sdl2.sdl; | |
import std.algorithm.iteration; | |
import std.stdio; | |
/*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | |
関数定義 | |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/ | |
void event_update() | |
{ |
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
/++ | |
各種基本型のaliasやベクトル型などを定義したモジュール | |
+/ | |
module primitive; | |
private import std.math : sqrt; | |
/++ | |
2つの同じ型の算術型を持つ構造体の定義。座標、ベクトル。 | |
+/ |
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
import dlangui.platforms.common.platform; | |
import dlangui.widgets.controls : Button; | |
mixin APP_ENTRY_POINT; | |
extern(C) int UIAppMain(string[] args) | |
{ | |
auto window = Platform.instance.createWindow("Hello World!",null); | |
window.mainWidget = (new Button).text("Hello World"); | |
window.show(); |
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
#!/usr/bin/sh | |
#スクリーンショットを保存するディレクトリ | |
SCRENNSHOT_DIR=~/Dropbox/スクリーンショット | |
i=1 | |
while true | |
do | |
if [ ! -f $SCRENNSHOT_DIR/$i.png ];then | |
output=${SCRENNSHOT_DIR}/$i.png | |
break |
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
import std.stdio, | |
core.thread; | |
void main() | |
{ | |
while(true) | |
{ | |
stderr.write(" -\r"); | |
Thread.sleep(dur!("msecs")(100)); | |
stderr.write(" \\\r"); |
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
for f in *.c | |
mv $f (basename $f .c).cpp | |
end |
OlderNewer