2009年10月29日

酢イカ

僕は酢イカが好きなのである。

よっちゃんの酢漬けいかが一番すきなのだが、「よっちゃんいか」も好きだし、河内屋で売っている酢漬けいか(メーカー不明)も大好きだ。
まあとにかく昔から酢漬けいかが大好きなのである。

しかし、私が生まれた関西ではあまり酢漬けいかは一般的ではなかったような気がする。小学生時代は駄菓子屋がまだ存在していたが、酢漬けいかはあまり買った記憶がないのである。
とするといつから好きになったのかであるが、おそらく大人になってから、関東に来てからだと思うので30前くらいから好きになったのではないかだろうか。そうすると昔から好きだともいえなくなる。

しかし、おっさんになってから酢漬けいかが好きになった人はあまりいないのではないかと思う今日この頃である。



posted by S.F. at 21:58| 千葉 晴れ| Comment(0) | TrackBack(0) | 日記 | このブログの読者になる | 更新情報をチェックする

twitter

Twitterを始めた。
http://twitter.com/SFPGMR
いつまで続くことやら。。。
posted by S.F. at 20:08| 千葉 晴れ| Comment(0) | TrackBack(0) | 日記 | このブログの読者になる | 更新情報をチェックする

2009年10月28日

アフターダーク

ついでに村上春樹の「アフターダーク」も読了。カメラから覗いてるような「視点」を感じさせる作品だった。

アフターダーク

アフターダーク

  • 作者: 村上 春樹
  • 出版社/メーカー: 講談社
  • 発売日: 2004/09/07
  • メディア: 単行本




posted by S.F. at 17:48| 千葉 晴れ| Comment(0) | TrackBack(0) | 日記 | このブログの読者になる | 更新情報をチェックする

約束された場所で―underground 2

村上春樹の「約束された場所で」を読了。感じたのは、あまりに論理的に思考しすぎると、社会は矛盾だらけなので自己が崩壊しかねないということ。論理的思考もほどほどにというところであろうか。

約束された場所で―underground 2 (文春文庫)

約束された場所で―underground 2 (文春文庫)

  • 作者: 村上 春樹
  • 出版社/メーカー: 文芸春秋
  • 発売日: 2001/07
  • メディア: 文庫




posted by S.F. at 17:19| 千葉 晴れ| Comment(0) | TrackBack(0) | 日記 | このブログの読者になる | 更新情報をチェックする

KB971644 - プラットフォーム更新プログラム

予定通りリリースされたようだ。
20091028.png
http://support.microsoft.com/kb/971644
早速インストールしてみることにする。
インストール後、Direct2DHelloWorldサンプルをビルド、実行してみたところ動いた!
20091028direct2d.png
SimplePathAnimationSampleも当たり前だが動く。
20091028direct2d01.png


タグ:Direct2D
posted by S.F. at 09:53| 千葉 晴れ| Comment(0) | Library | このブログの読者になる | 更新情報をチェックする

2009年10月27日

Direct2D - Vista

どうも明日プラットフォームアップデートの中の1つという形でVista用のDirect 2Dがリリースされるらしい。
http://freesoft.tvbok.com/cat97/soon_vista_sp3.html
posted by S.F. at 21:05| 千葉 晴れ| Comment(0) | Library | このブログの読者になる | 更新情報をチェックする

Microsoft SDK - Windows Core Audio Sample

Microsoft SDK 7.0には、Windows Core Audioのサンプルがある。
http://msdn.microsoft.com/en-us/library/dd316764(VS.85).aspx
前バージョンのものよりも内容が豊富になっているが、WinAudioサンプルがなくなってしまった。。。

posted by S.F. at 20:02| 千葉 晴れ| Comment(0) | WASAPI | このブログの読者になる | 更新情報をチェックする

In the Pocket (Light Paint Moog and Rhodes)

Radium Softwareに載っていたもの。
確かにすごい。
posted by S.F. at 19:52| 千葉 晴れ| etc | このブログの読者になる | 更新情報をチェックする

jspongy

512Byteのjavascriptのデモ。
http://www.p01.org/releases/512b_jspongy/jspongy.htm
512Byteではないが、これもすごい。
http://www.p01.org/releases/20_lines_twinkle/
posted by S.F. at 19:10| 千葉 晴れ| Comment(0) | HTML | このブログの読者になる | 更新情報をチェックする

prototype.js & JQuery

JavasScriptには、有名なライブラリがあるのだということがわかった。

Prototype is a JavaScript Framework that aims to ease development of dynamic web applications.

http://www.prototypejs.org/

JavaScriptとHTMLの相互作用を強化する軽量なJavaScriptライブラリ

http://jquery.com/
posted by S.F. at 11:35| 千葉 雨| Comment(0) | language | このブログの読者になる | 更新情報をチェックする

2009年10月26日

Future Crew - Second Reality

なつかしい。。。
タグ:megademo
posted by S.F. at 20:03| 千葉 雨| Comment(0) | etc | このブログの読者になる | 更新情報をチェックする

2009年10月25日

WASAPI(20)

ぼちぼちと実装を進めている。
もう少しで音が出せそうだ。
まあ、僕のペースはご承知のとおり、気分や状況によって変わるのでいつになるかわからないが、。

WASAPIというかWindows Core Audioは後発だけあってよくできていると思う。そういう意味でVistaはもっと評価されていいのではないかと考える。Windows7では共有モードでも低レンテンシで再生できるらしいので、OSを入手したら評価してみたい。

しかし、COMというアーキテクチャもよくよく考えてみればよくできている。Windows95あたりからだからもう14年くらいはたっているが、Windows7でも新APIはまずCOM実装で提供されていることからも伺える。
これはMS社内でもメソドロジが確立していて、早期にリリースできるためという面もあるだろうが。

よくよく考えてみると、PC界ではMACも含めバイナリレベルでほぼX86で互換性を有しているので、COMというバイナリレベルインターフェースでOSや言語実装の差異を吸収できる時代になってきているといえるかも知れない。
JavaVMやCLIはそういうOSや言語実装の差異を埋めるために生まれてきたと記憶しているが、今の状態はそういうプラットフォーム上で生まれる成果物が逆に互換性を狭くし、本来PCが持つパフォーマンスを下げてしまっているかもしれないね。
posted by S.F. at 18:32| 千葉 曇り| Comment(0) | WASAPI | このブログの読者になる | 更新情報をチェックする

circus

MAMEでフリーで遊べるゲームがある。Circusもその1つだ。
小学生のとき、僕はこのゲームをゲームセンターで見て衝撃を受けた。
20091025circus.png
posted by S.F. at 08:24| 千葉 雨| Comment(0) | etc | このブログの読者になる | 更新情報をチェックする

HTML5 - canvas(3)

いろいろなCircleアルゴリズムで描画してみた。 元ネタ:http://openfmi.net/snippet/detail.php?type=snippet&id=8 (Google Chromeブラウザでのみ動作チェックしています)

/*--------------------------------------------------------------------
  DrawingCircles.c - javascript porting version
  Comparing Circles Drawed By
  canvas, The Simplest Drawing Circle Algorithm,
  Bresenham Circle Algorithm, Michener Algorithm
  By S.F.
  元ネタ:http://openfmi.net/snippet/detail.php?type=snippet&id=8
  --------------------------------------------------------------------*/

var ctx;
var bmp;
var w,h;
var dt;

function pset(x,y,r,g,b,a)
{
	var st = (x + w * y) * 4;
	dt[st++] = r;
	dt[st++] = g;
	dt[st++] = b;
	dt[st++] = a;
}


// the simplest way to draw a circle:
function reallySimpleCircle (radius, centerx,centery,r,g,b,a)
{
	var	cx = 0, cy;
	var	xLimit = Math.sqrt ((radius * radius) / 2);

	while (cx++ <= xLimit)
	{
		cy = Math.floor (Math.sqrt (radius * radius - cx * cx));
		pset ( cx + centerx, cy + centery, r,g,b,a);		// 45-90	degrees
		pset ( cx + centerx, -cy + centery, r,g,b,a);		// 270-315	degrees
		pset ( -cx + centerx, cy + centery, r,g,b,a);		// 90-135	degrees
		pset ( -cx + centerx, -cy + centery, r,g,b,a);	// 225-270	degrees
		pset ( cy + centerx, cx + centery, r,g,b,a);		// 0-45		degrees
		pset ( cy + centerx, -cx + centery, r,g,b,a);		// 315-360	degrees
		pset ( -cy + centerx, cx + centery, r,g,b,a);		// 135-180	degrees
		pset ( -cy + centerx, -cx + centery, r,g,b,a);	// 180-225	degrees
	}
}

////////////////////////////////////////////////////////
// Bresenham Circle Algorithm: 
//
//               -Yi              Xi
// ---------------o---------------o---------------
//      Hi    <=  |  >  Di    <=  |  >  Vi
//                |               |                       
//      x++       |     x++,y--   |     y--       
////////////////////////////////////////////////////////
function bresenhamCircle (radius, centerx,centery,  r,g,b,a)
{
	var cx, cy, d;

	cx = 0;
	cy = radius;
	d = 2 - 2 * radius;

	// let's start drawing the circle:
	pset ( cx + centerx, cy + centery, r,g,b,a);	// point (0, R);
	pset ( cx + centerx, -cy + centery, r,g,b,a);	// point (0, -R);
	pset ( cy + centerx, cx + centery, r,g,b,a);	// point (R, 0);
	pset ( -cy + centerx, cx + centery, r,g,b,a);	// point (-R, 0);
	
	while (1)
	{
		if (d > -cy)
		{
			--cy;
			d += 1 - 2 * cy;
		}

		if (d <= cx)
		{
			++cx;
			d += 1 + 2 * cx;
		}

		if (!cy) return;	// cy is 0, but these points are already drawn;

		// the actual drawing:
		pset ( cx + centerx, cy + centery, r,g,b,a);		// 0-90		degrees
		pset ( -cx + centerx, cy + centery, r,g,b,a);		// 90-180	degrees
		pset ( -cx + centerx, -cy + centery, r,g,b,a);	// 180-270	degrees
		pset ( cx + centerx, -cy + centery, r,g,b,a);		// 270-360	degrees
	}
}

// Miechener circle algorithm:
function miechenerCircle (radius, centerx,centery,  r,g,b,a)
{
	var cx, cy, d;

	d = 3 - 2 * radius;
	cy = radius;

	// let's start drawing the circle:
	pset ( centerx, radius + centery, r,g,b,a);	// point (0, R);
	pset ( centerx, -radius + centery, r,g,b,a);	// point (0, -R);
	pset ( radius + centerx, centery, r,g,b,a);	// point (R, 0);
	pset ( -radius + centerx, centery, r,g,b,a);	// point (-R, 0);

	for (cx = 0; cx <= cy; cx++)
	{
		if (d >= 0)
			// in this case we choose Hi:
			d += 10 + 4 * cx - 4 * cy--;
		else
			// in this case we choose Di:
			d += 6 + 4 * cx;

		// the actual drawing:
		pset ( cy + centerx, cx + centery, r,g,b,a);		// 0-45		degrees
		pset ( cx + centerx, cy + centery, r,g,b,a);		// 45-90	degrees
		pset ( -cx + centerx, cy + centery, r,g,b,a);		// 90-135	degrees
		pset ( -cy + centerx, cx + centery, r,g,b,a);		// 135-180	degrees
		pset ( -cy + centerx, -cx + centery, r,g,b,a);	// 180-225	degrees
		pset ( -cx + centerx, -cy + centery, r,g,b,a);	// 225-270	degrees
		pset ( cx + centerx, -cy + centery, r,g,b,a);		// 270-315	degrees
		pset ( cy + centerx, -cx + centery, r,g,b,a);		// 315-360	degrees
	}
}
///////////////////////////////////////////////////////////
// double substraction method for drawing a circle:
// 
// d0	-> H -> d1  = d0H+d0 -> D -> d2  = d1D+d1
// d0H	     -> d1H = d0H+2		  -> d2H = d1H+2
// d0D	     -> d1D = d0D+2		  -> d2D = d1D+4
// step 0	    step 1				 step 2
//
///////////////////////////////////////////////////////////
function dsCircle (radius, centerx,centery,  r,g,b,a)
{
	var cx, cy, d, dH, dD;

	d	= 1 - radius;
	dH	= 3;
	dD	= 5 - 2 * radius;
	cy	= radius;

	// drawing the circle:
	for (cx = 0; cx <= cy; cx++)
	{
		if (d < 0)
		{
			d	+= dH;
			dH	+= 2;
			dD	+= 2;
		}
		else
		{
			d	+= dD;
			dH	+= 2;
			dD	+= 4;
			--cy;
		}

		// the actual drawing:
		pset ( cy + centerx, cx + centery, r,g,b,a);		// 0-45		degrees
		pset ( cx + centerx, cy + centery, r,g,b,a);		// 45-90	degrees
		pset ( -cx + centerx, cy + centery, r,g,b,a);		// 90-135	degrees
		pset ( -cy + centerx, cx + centery, r,g,b,a);		// 135-180	degrees
		pset ( -cy + centerx, -cx + centery, r,g,b,a);	// 180-225	degrees
		pset ( -cx + centerx, -cy + centery, r,g,b,a);	// 225-270	degrees
		pset ( cx + centerx, -cy + centery, r,g,b,a);		// 270-315	degrees
		pset ( cy + centerx, -cx + centery, r,g,b,a);		// 315-360	degrees
	}
}


function draw()
{
	reallySimpleCircle(60,w/4,100,80,80,80,255);
	bresenhamCircle(60,w/4 * 3,100,80,80,80,255);
	miechenerCircle(60,w/4,240,80,80,80,255);
	dsCircle(60,w/4*3,240,80,80,80,255);
	ctx.putImageData(bmp,0,0);
	ctx.beginPath();
	ctx.arc(w/4,380, 60, 0, 2 * Math.PI, true);
	ctx.stroke();
	ctx.textAlign = "center";
	ctx.fillText("Simple",w/4,100);
	ctx.fillText("Bresenham",w/4*3,100);
	ctx.fillText("Miechener",w/4,240);
	ctx.fillText("Double Substraction",w/4*3,240);
	ctx.fillText("Canvas",w/4,380);
}

window.onload = function()
{
	ctx = document.getElementById("ctx").getContext("2d");
	w = document.getElementById("ctx").width;
	h = document.getElementById("ctx").height;
	bmp = ctx.createImageData(w,h);
	dt = bmp.data;
	draw();
}

タグ:HTML5 canvas
posted by S.F. at 05:00| 千葉 曇り| Comment(0) | HTML | このブログの読者になる | 更新情報をチェックする

2009年10月24日

HTML5 - canvas(2)

ただランダムに線を引くコード。
確かこのアルゴリズムはブレゼンハムだったかな?
(Google Chromeブラウザでのみ動作チェックしています)

<ソースコード>
var ctx;
var bmp;
var w,h;
var dt;

function pset(x,y,r,g,b,a)
{
	var st = (x + w * y) * 4;
	dt[st++] = r;
	dt[st++] = g;
	dt[st++] = b;
	dt[st++] = a;
}

function line(sx,sy,ex,ey,r,g,b,a)
{
	var dx = ex - sx;
	var dy = ey - sy;
	var adx = Math.abs(dx);
	var ady = Math.abs(dy);

	if(adx > ady)
	{
		var ddy = Math.floor(adx / 2);
		var dxtick = (dx < 0)?-1:1;
		var dytick = (dy < 0)?-1:1;
		for(;sx != ex;sx += dxtick)
		{
			pset(sx,sy,r,g,b,a);
			ddy += ady;
			if(ddy >= adx)
			{
				ddy -= adx;
				sy += dytick;
			}
		}
	} else {
		var ddx = Math.floor(ady / 2);
		var dxtick = (dx < 0)?-1:1;
		var dytick = (dy < 0)?-1:1;
		for(;sy != ey;sy += dytick)
		{
			pset(sx,sy,r,g,b,a);
			ddx += adx;
			if(ddx >= ady)
			{
				ddx -= ady;
				sx += dxtick;
			}
		}
	}
}

function draw()
{

	line(Math.floor(Math.random() * (w - 1)),Math.floor(Math.random() * (h - 1))
		,Math.floor(Math.random() * (w  - 1)),Math.floor(Math.random() * (h - 1))
		,Math.floor(Math.random() * 255),Math.floor(Math.random() * 255),Math.floor(Math.random() * 255),255); 


	ctx.putImageData(bmp,0,0);
}

window.onload = function()
{
	ctx = document.getElementById("ctx").getContext("2d");
	w = document.getElementById("ctx").width;
	h = document.getElementById("ctx").height;
	bmp = ctx.createImageData(w,h);
	dt = bmp.data;
}
タグ:HTML5 canvas
posted by S.F. at 06:20| 千葉 晴れ| Comment(1) | HTML | このブログの読者になる | 更新情報をチェックする