ToDo:
http://haskell.g.hatena.ne.jp/nobsun/20060611/p3
を見て思った。
main = putStrLn ("hamaji" ++ at ++ "nii" ++ dot ++ "ac" ++ dot ++ "jp")
where at = "@"
dot = "."
(21:36)
Windows のパーティションの切り方はよくわからない。
こんな感じかなぁ。
Linux いるのかなぁ? coLinux でいい気がする。
つかデスクトップをメインにしてもいいという話もあるのだが。
とりあえず testgl_net 走らせてみて考えるとか。
(05:15)
さくらのクローン環境が欲しい。 Presario に FreeBSD つっこむか。
(06:20)
気がついたら割とたくさんある。
i@u ~> /bin/ls -1 arch/hyperestraier-* arch/hyperestraier-0.3.13.tar.gz arch/hyperestraier-0.5.0.tar.gz arch/hyperestraier-0.5.1.tar.gz arch/hyperestraier-0.5.2.tar.gz arch/hyperestraier-0.5.3.tar.gz arch/hyperestraier-0.5.7.tar.gz arch/hyperestraier-0.9.0.tar.gz arch/hyperestraier-0.9.1.tar.gz arch/hyperestraier-0.9.2.tar.gz arch/hyperestraier-1.0.0.tar.gz arch/hyperestraier-1.0.1.tar.gz arch/hyperestraier-1.0.2.tar.gz arch/hyperestraier-1.0.3.tar.gz arch/hyperestraier-1.0.6.tar.gz arch/hyperestraier-1.1.0-experimental.tar.gz arch/hyperestraier-1.1.6.tar.gz arch/hyperestraier-1.2.0-experimental.tar.gz arch/hyperestraier-1.2.1.tar.gz arch/hyperestraier-1.2.2.tar.gz arch/hyperestraier-1.2.3.tar.gz
しょっちゅう消すせいか、案外すくない。
i@u ~> /bin/ls -1 arch/gcc-* arch/gcc-1.42.tar.gz arch/gcc-core-4.0.3.tar.bz2 arch/gcc-g++-3.4.0.tar.bz2 arch/gcc-g++-4.0.0.tar.bz2 arch/gcc-g++-4.0.2.tar.bz2 arch/gcc-g++-4.0.3.tar.bz2 arch/gcc-java-3.4.0.tar.bz2 arch/gcc-java-4.0.2.tar.bz2 arch/gcc-java-4.0.3.tar.bz2 arch/gcc-objc-4.0.2.tar.bz2
(08:04)
http://www.kmonos.net/alang/etc/ecmascript.php
の例をかたっぱしから実行。
匿名関数を () で囲ってほげれない、のかな。
i@u ~/test/js> cat ki10.ds
var x = ( function(a, b) {
return (a==0 ? b : arguments.callee(b%a, a));
} )( 60, 84 );
println( x );
i@u ~/test/js> ds ki10.ds
Digital Mars DMDScript 1.10
www.digitalmars.com
Compiled by Digital Mars DMD D compiler
Copyright (c) 1999-2006 by Digital Mars
written by Walter Bright
1 source files
Error: (1) : Error: cannot assign to function (a,b)
{
return b ? arguments.callee(b % a, a);
}
i@u ~/test/js> cat ki11.ds
var f = function(a, b) {
return (a==0 ? b : arguments.callee(b%a, a));
}
var x = f( 60, 84 );
println( x );
i@u ~/test/js> ds ki11.ds
Digital Mars DMDScript 1.10
www.digitalmars.com
Compiled by Digital Mars DMD D compiler
Copyright (c) 1999-2006 by Digital Mars
written by Walter Bright
1 source files
12
closure が無いのかね。
i@u ~/test/js> cat ki12.ds
function map( arr, f )
{
var newArr = new Array(arr.length);
for( var i=0; i<arr.length; ++i )
newArr[i] = f( arr[i] );
return newArr;
}
function mem_fn( mf )
{
println('OUTSIDE: ' + mf);
return function(obj) {
println('INSIDE: ' + mf);
var args = new Array(arguments.length-1);
for( var i=1; i<arguments.length; ++i )
args[i-1] = arguments[i];
return mf.apply( obj, args );
};
}
x = map(
['hoge', 'fuga', 'hagyo'],
mem_fn( String.prototype.toUpperCase )
);
map( x, println );
i@u ~/test/js> ds ki12.ds
Digital Mars DMDScript 1.10
www.digitalmars.com
Compiled by Digital Mars DMD D compiler
Copyright (c) 1999-2006 by Digital Mars
written by Walter Bright
1 source files
OUTSIDE: function toUpperCase() { [native code] }
INSIDE: undefined
Error: Undefined undefined.apply is undefined and has no Call method
関数に name メソッドが無いかしら。
i@u ~/test/js> cat ki14.ds
function Point()
{
this.x = 0;
this.y = 0;
this.distanceFromOrigin = function()
{
return Math.sqrt( this.x*this.x + this.y*this.y );
}
}
var pt = new Point();
pt.x = 5;
pt.y = -12;
println( pt.distanceFromOrigin() );
println( pt.constructor );
println( pt.constructor.name );
i@u ~/test/js> ds ki14.ds
Digital Mars DMDScript 1.10
www.digitalmars.com
Compiled by Digital Mars DMD D compiler
Copyright (c) 1999-2006 by Digital Mars
written by Walter Bright
1 source files
13
function Point()
{
}
undefined
こっちは closure ぽく動くな。
i@u ~/test/js> cat ki16.ds
function Point()
{
var x = 0;
var y = 0;
this.getX = function() { return x; }
this.getY = function() { return y; }
this.set = function(i_x, i_y) { x=i_x; y=i_y; }
}
var pt = new Point();
pt.set(100, 200);
println( pt.getX() + ' ' + pt.getY() );
i@u ~/test/js> ds ki16.ds
Digital Mars DMDScript 1.10
www.digitalmars.com
Compiled by Digital Mars DMD D compiler
Copyright (c) 1999-2006 by Digital Mars
written by Walter Bright
1 source files
100 200
scope chain の話、の部分も当然だめ。 closure 系悲しす。
MS 拡張らしいが動く。
i@u ~/test/js> cat ki24.ds
// written for JScript.NET
function Point()
{
this.x = 0.0;
this.y = 0.0;
}
function Point.prototype.distanceFromOrigin()
{
return this.x*this.x + this.y*this.y;
}
println( (new Point()).distanceFromOrigin() );
i@u ~/test/js> ds ki24.ds
Digital Mars DMDScript 1.10
www.digitalmars.com
Compiled by Digital Mars DMD D compiler
Copyright (c) 1999-2006 by Digital Mars
written by Walter Bright
1 source files
0
arity もあるみたい。
i@u ~/test/js> cat ki25.ds
// written for Rhino
function add(x, y)
{
return x + y;
}
println( add.arity );
i@u ~/test/js> ds ki25.ds
Digital Mars DMDScript 1.10
www.digitalmars.com
Compiled by Digital Mars DMD D compiler
Copyright (c) 1999-2006 by Digital Mars
written by Walter Bright
1 source files
2
__proto__ はない。
i@u ~/test/js> cat ki26.ds
// written for Rhino
var objA = { f: function(){print("objA")} }
var objB = { f: function(){print("objB")} }
var objC = new Object();
var objD = new Object();
var objE = new Object();
objD.__proto__ = objE.__proto__ = objC;
objC.__proto__ = objA; // Cのプロトタイプ変更
objD.f();
objE.f();
objC.__proto__ = objB; // Cのプロトタイプ変更
objD.f();
objE.f();
i@u ~/test/js> ds ki26.ds
Digital Mars DMDScript 1.10
www.digitalmars.com
Compiled by Digital Mars DMD D compiler
Copyright (c) 1999-2006 by Digital Mars
written by Walter Bright
1 source files
Error: Object [object Object].f is undefined and has no Call method
a.caller も無いみたいね。
// written for MocaScript
function f1() { f2(); }
function f2() { f3(); }
function f3() { f4(); }
function f4() { f5(); }
function f5() { g(); }
function g() {
for(var a=arguments; a; a=a.caller) // 呼び出し元を順にたどる
if( a.callee == f1 ) // 呼び出され関数がf1なら…?
println("g was called inside f1");
}
f1();
i@u ~/test/js> ds ki27.ds
Digital Mars DMDScript 1.10
www.digitalmars.com
Compiled by Digital Mars DMD D compiler
Copyright (c) 1999-2006 by Digital Mars
written by Walter Bright
1 source files
(09:00)
import dmdscript.script;
void* Dglobal_hello(Dobject pthis, CallContext *cc,
Dobject othis, Value* ret, Value[] arglist)
{
writef("hello\n");
return null;
}
int main() {
static char[] TEXT_hello = "hello";
static NativeFunctionData nfd[] = [
{ &TEXT_hello, &Dglobal_hello },
];
Program p = new Program();
DnativeFunction.init(p.callcontext.global, nfd, DontEnum);
p.compile(`test1`, `println('hello1'); hello();`, null);
p.execute(null);
return 0;
}
compile するごとに別の状態になるので、 Web なんかで使ってる JS 的な、 状態持たせてちょっとずつ走らせるとかできんぽい。
うーん、使えない…
(09:42)
僕はモナドの章の引用が ディアスポラだったのでうっかり衝動買いしてしまった。
世間的にはふつけるの方が人気なのかしら。 とりあえず、ある程度はわかっていたであろう僕には わかりやすいなぁ。 1年前の僕ならちょいキツかったかもだけど。
(23:19)
(00:09)
(00:10)
http://slashdot.jp/article.pl?sid=06/06/08/0250230
子供の頃に妄想した気がする。 学校の試験がげーむだったらどうなるだろう…とか。
いつも喋ってることだけどプログラミングも 料理マンガみたく対決させて欲しいよな。
おーっとあらし君物理エンジンのODEを解凍しはじめたー! 課題はコンパイラなのにどう使うんだ!? おおーっとそして出ました水魚のポーズ!!!
みたいな。 ゲームセンターあらしはすごいマンガだったなぁ。 復刻版の後ろの方についてた作者の回想に 「こんなもんありえるわけないですよね」 みたいなこと書いてたのは少し残念だったけど。
一方車田正美は本気だった。
http://www5e.biglobe.ne.jp/~saint/goroku.htm
(13:22)
http://haskell.g.hatena.ne.jp/nobsun/20060606/p1
を見て。
昨日のをちょっとつめると
c _ 0=1 c n r=div((n-r+1)*c n(r-1))r
で 36byte か。
c n r=div(product[n-r+1..n])$product[1..r]
は 42 byte でちょっと長い。
(07:30)
Haskell の何がダメって printf デバッグのしかたが わからないことじゃないかとこないだ考えた。 do の中なら簡単だけど、 関数の中でこの時値どうなってるのー、 っていうのの調べかたがさっぱりわからない。
というか調べられるのか。無理じゃないのか。
僕は printf デバッグが好きで好きでしょうがなくて というか頭弱いからか printf を埋めないと プログラムを理解することができない。
どっかの人におこられそうだけど if の後には基本的に { 書きたくて、 それは後から if の中に入ってるかチェックするために printf を埋めたいという、それだけのためで、 そしてそれに価値があるというか。 if の中と外がとても簡単な条件ならそりゃ { 省略するけど、 基本的にはあった方がいいというか。
途中で全然違う話になっている。
(06:01)
うますぎるのでレシピメモ。 忘れるわけない気もするが。 99で買った豆腐、 99で買ったキムチ、 99で買ったごま油、 うまいたれ。
適当にかける。キムチ多め。食する。おわり。
(06:02)
http://d.hatena.ne.jp/mr_konn/20060605/1149520643
これを書いちゃう konn さんすげーと思いつつも
c _ 0 = 1 c n r = (n-r+1) * (c n (r-1)) `div` r
普通に書けよとは思った。
(06:33)
Command_AddCommand(cmd, (int)"BAKURETSU_KYUKYOKU_KEN",
U, DL, DR, UL, UR, D, -1);
Command_AddCommand(cmd, (int)"TENHA_HUJINZAN",
DR, L, DL, D, DR, R, L, D, DL, -1);
Command_AddCommand(cmd, (int)"ACCEL_RUSH", L, R, DR, D, DL, UR, -1);
Command_AddCommand(cmd, (int)"BREAK_SPIRAL", L, DL, D, DR, R, UR, D, -1);
Command_AddCommand(cmd, (int)"BLOODY_FLASH",
DR, L, DL, D, DR, R, L, R, -1);
Command_AddCommand(cmd, (int)"RAISING_STORM", DR, L, DL, D, DR, R, DL, -1);
Command_AddCommand(cmd, (int)"HO_O_KYAKU", D, DL, L, DL, R, -1);
Command_AddCommand(cmd, (int)"HAO_SYOKO_KEN", R, L, DL, D, DR, R, -1);
Command_AddCommand(cmd, (int)"SHINKU_HADO", D, DR, R, D, DR, R, -1);
Command_AddCommand(cmd, (int)"YOGA_FRAME", L, DL, D, DR, R, -1);
Command_AddCommand(cmd, (int)"SYORYU_KEN", R, D, DR, -1);
Command_AddCommand(cmd, (int)"HADO_KEN", D, DR, R, -1);
Command_AddCommand(cmd, (int)"TATSUMAKI", D, DL, L, -1);
Command_AddCommand(cmd, (int)"TETU_ZAN_KO", L, R, N, R, -1);
Command_AddCommand(cmd, (int)"YAKUHO", R, N, R, N, R, -1);
Command_AddCommand(cmd, (int)"RIMON", R, N, R, -1);
(09:34)
http://d.hatena.ne.jp/Ozy/20060604#p1
ちょっと見て短くなりそうに思ったのにならんかった。
i@u ~/test> ./a.out 1999999999 1 2000000000
なんだよなぁ。 test data の妙。
(16:29)
http://www.madin.jp/diary/?date=20060602#p01
via http://www.hyuki.com/t/200606.html#i20060604001205
なんにせよ情報を消す機構を作ること自体になんか違和感を感じるのであった。
いわゆるお前には関係ないという状態。
(16:09)
匿名の意見に価値が無い、は間違ってる。 ってのはいつも思ってる通りなんだけど。 けど、非匿名の方が価値がある場合もあるなと思った。
技術的な間違いとかをコメントしてもらう場合は、 ホントどっちでもいい。 むしろ匿名の方が律義な返事しなくていいとかで ラクなくらいだったりとかもありうる。
ただ、意見みたいなものの場合は、 相手がどういうバックグラウンドかわかると 理解やらなんやらが進みやすい、 ってのは一定正しいんだよなと今さら思った。
バックグラウンド無しの発言は無価値だ、 っていうのに反発しすぎて 非匿名の価値みたいなのを過少評価してたかなーとかいう話。
(18:18)
http://d.hatena.ne.jp/rinset/20060320/1142839025
これすげー便利だなーと思ったけどインターフェースが欲しいので追加。
template tostr(T) {
char[] tostr(T t) {
return ToString!(T)(t);
}
}
template p(T) {
void p(T t) {
writefln(tostr(t));
}
}
今なら bogoyaml もっと面白おかしく実装できるなあ。
(05:38)
(17:59)
記憶喪失な僕でも10個くらいすぐに出るだろう。
下の方はやる気ひかえめというか。
(18:18)
とかで起動できるように。
if (*p == ':' && p[1] == '/') { /* scheme found */
って感じで '/' の判定を追加。
(18:36)
というネタを考えたけど実現できそうにない。 予想を確定事項に変換する。
before
警察と仲いいからできるんですかねぇ
after
警察と癒着してますからね。 # 常識だと思ってたけど…
----------- 微妙に気が効いてそうで微妙なシグネチャ
(22:09)
| 前 | 2025年 11月 |
次 | ||||
| 日 | 月 | 火 | 水 | 木 | 金 | 土 |
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | ||||||
全てリンクフリーです。 コード片は自由に使用していただいて構いません。 その他のものはGPL扱いであればあらゆる使用に関して文句は言いません。 なにかあれば下記メールアドレスへ。
_ YT [おじゃまします。Debug.TraceあたりIOの付いてないとこでも使えるっぽいです。]
_ shinh [おおあるかなーと思ってたんですがそのくらいはあるのですね。ご紹介ありがとうございます。ちょっとぐぐってみると参照透過..]