2008-01-01から1年間の記事一覧

Proactor Pattern

C

http://www.artima.com/articles/io_design_patterns.html私がやろうとしているのは、まさにこのProactor Emulationと呼ばれるものです。そして今悩んでいるのは、Proactor jobのスケジューリング。

$

C

$ cat hoge.c #include <stdio.h> int main(void) { char $str[] = "hello"; printf("%s\n", $str); return 0; } $ gcc -Wall -W hoge.c $ ./a.out hello $ gcc -pedantic hoge.c hoge.c:5:7: warning: '$' in identifier or number $</stdio.h>

hgwebでリビジョングラフを表示

1.0.2の最新のリリース版には入っていませんが、trunk(?)というかmainでは、hgwebでリビジョングラフの表示ができるようです。このサンプルでは、paperというstyleを使っています。gitwebに比べてシンプルでMercurialらしいですね。結構好みです。

The Game of Life

http://d.hatena.ne.jp/giveup/20080505もう少し練ってみた。 #include <stdio.h> #include <string.h> #include <stdbool.h> #include <unistd.h> #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) void l(_Bool mas[2][10][10],int o,int n) { for(int x=0;x<10;x++) for(in</unistd.h></stdbool.h></string.h></stdio.h>…

『ビューティフルコード』

ビューティフルコード (THEORY/IN/PRACTICE)作者: Brian Kernighan,Jon Bentley,まつもとゆきひろ,Andy Oram,Greg Wilson,久野禎子,久野靖出版社/メーカー: オライリージャパン発売日: 2008/04/23メディア: 大型本購入: 30人 クリック: 617回この商品を含む…

dformatプラグインを作って遊んでみた

http://moinmo.in/ParserMarket/UmlSequence これを改造して、 {{{#!dformat style bitwid .3 PDP-8 Instr 0-2 Op Code 3 Indirect Bit 4 Page-Zero Bit 5-11 Page Address }}}こう書くと……こんな画像に変換するMoinMoinのプラグインを作ってみた。dformatは…

Radium Softwareがhatenaに移行

Radium Softwareで有名な高橋啓治郎さんの記事がhatenaに移ったようです。またちらちら覗こうっと。http://d.hatena.ne.jp/KZR/

Variadic Templates

C++

http://d.hatena.ne.jp/faith_and_brave/20080208/1202461203 http://www.kmonos.net/alang/d/2.0/variadic-function-templates.html 応用例としてprintfがあるようだ。ネタとしてはPerlとかにあるようなpack, unpackを作り、ASN.1バイナリーエンコーディン…

Plan 9もMercurialを使っているみたい

http://hg.pdos.csail.mit.edu/hg/plan9 久々に覗いてみたら hgweb の文字が。私が個人的に好感を持っているプロジェクトが次々とMercurialを使い出すのはなにかあるんだろうか。