「BLOCKS」を含む日記 RSS

はてなキーワード: BLOCKSとは

2024-03-08

[]平成生まれ作品を聴こう 2024.3.8

中国笙とオーケストラのための《Pink Elephant in Prentisw/ score

https://www.youtube.com/watch?v=8iRGrZTa6Jo

作曲清水チャートリー

委嘱上海交響楽団

"Pink Elephant in Prentis" for alto sheng and orchestra

Commissioned and premiered by Shanghai Philharmonic Orchestra (cond. Zhang Liang)


Prentis Hall is a building in New York City, where I spent a year (2015-2016) living in a sleeping bag and taking showers in the toilet. Prentis was built in 1909 and was initially designed as a pasteurization facility and milk bottling plant, then later used as a Heat Transfer Research Facility, conducting nuclear research and experiments, during the Manhattan Project. Columbia University acquired the building in 1949, and the building has housed Columbia’s Computer Music Center (then Columbia-Princeton Electronic Music Center) from the 1950s onwards. During my time there at the Computer Music Center, I have spent my days and nights exploring stimulating sounds using both analog and digital synthesizers, tape recorders, CTR monitors, and other equipments unfamiliar to me back then. Aside from the Computer Music Center, the building also housed studios for visual artists, and so I was able to meet many eccentric artists, where we ended up having long conversations every night on both significant and insignificant issues surrounding us.

Located on 125th Street in Manhattan, the “residents” of Prentis Hall were constantly harassed by the rumblings of the New York City Subway (which runs aboveground for 125th Street Station), the traffic from the highway nearby, the bustling of the streets of New York, and the construction noises from the nearby building sites. At nights, the screeching noises from the metal shop and the wood shop constantly rang throughout the building. At one point in time, the noise inspired me to imagine a gigantic pink elephant running through the narrow corridors of Prentis. The head and front half of the body was seemingly a normal elephant found in the wild. However, as I scanned my eyes further back, the body of the animal seemed to become more and more pixelated, and small 3D blocks were clearly visible on its back and hind legs, as if molded by an amateur creator in a Minecraft game. As the elephant advanced, some blocks fell onto the floor like water droplets falling from an animal soaked in water. I rubbed my eyes and shook my head, certain that I have entered a dream at some point during the night. The pink elephant walked past me and wandered into one of the many rooms the building offered. I timidly peeked into the room where the pink elephant disappeared into. The pink elephant seemed to have collapsed on the floor, its body, both the organic front and the pixelated back, expanding and shrinking as it sluggishly inhaled and exhaled oxygen.

After hours of staring at the pink elephant, I jumped back at a sudden startling noise from behind, which woke the pink elephant from its deep slumber. Furious, the pink elephant stood on its two pixelated hind legs, and stomped out into the corridors again, this time shaking off more 3D blocks from its back than when it first arrived. The organic front seemed to start to bloat up like a balloon for reasons unknown to me, and the pixelated back grew smaller and smaller due to its parts crumbling down on the floor. In a blink of an eye, the inflated front side split from its pixelated rear, then with a deafening pop, exploded into thin air like a burst balloon. What was left were the pink 3D blocks of all sizes, scattered around on the corridors of Prentis Hall.


Chatori Shimizu: https://www.chatorishimizu.com/


Shanghai Philharmonic Orchestra: http://www.shphilharmonic.com/


December 7th, 2018. Shanghai, China.

2023-09-01

幼児向けYouTubeおすすめを教えて下さい

YouTubeは基本見せないようにしてたけど、「Number blocks」というBBCが作っている算数アニメの出来がとてもいいので見せはじめた。ピクサー系の短編アニメで、大人が見ても割りと面白い

子どもは4歳と2歳で、4歳の子は前から数字には割りと興味を持っていたが、2歳の子も見始めてあっという間に物の数を数えられるようになった。

他に育児活用しているYouTubeチャンネルがあれば教えてください。(Number blocks英語だけど、特に英語にこだわってるわけではない)

2021-05-03

VR面白かったやつ

環境

Oculus questをPCに繋いだり繋がなかったりで遊んでる

 

___

quest単体でできるやつ

 

halfhalf

https://www.moguravr.com/half-half/

身体サイズを伸縮させたかくれんぼ、めっちゃ楽しい

友達じゃないユーザー言葉ララララに変換されるのも好き

 

Sports Scramble

https://www.oculus.com/experiences/quest/705576999566582/?locale=ja_JP

テニスとか野球とかボーリングが出来るんだけど、バット釣り竿になったり球がビーチボールになったりして楽しい

観客がかわいい

 

●virtual virtual reality

https://www.moguravr.com/virtual-virtual-reality/

VR内でVRするのが奇妙な感覚で好き

指示に従わない遊びが出来るのが楽しい

___

steamに繋いでやるやつ

 

Blocks

https://shinrinmusic.com/google-blocks-tools/

Googleの出してるモデリングアプリ

ローポリ特化型で扱いやすいけど確かそろそろサービス終わる…?

 

medium

https://www.moguravr.com/medium-adobe-edition/

粘土みたいな感じでモデリングできる

クソ重いけど触り心地は楽しい

Blocksの方が実用性は高いか

Adobeが買収した

 

sky world

https://www.moguravr.com/skyworld/

ストラテジー

おもちゃ感満載ですごく好き

いわゆるウィンドウ切り替えみたいなやつはレバーガッチャン!だし、戦闘になると盤面がグルンと回るのが最高

カード実体化できる

擬似遊戯王

 

2021/05/05追記

こんなに沢山トラバブクマ貰えたの初めてだ

おすすめしてもらったやつ、ちょこちょこチェックしてます

ありがとう

 

2020-10-08

ブロックチェーンとは何か。

ブロックチェーン暗号通貨、Web3.0、Dweb というのはここ数年、そしてこれからバズワードであるようだ。

ここ一週間ぐらいだろうか。マイナンバーブロックチェーンを導入しようとしている事業に関して色々な議論が発生しているようである。例によって議論に向かない Twitter 上で発生している。というか何が議論の中心になっているのかイマイチよく分からない。ただ雑然と荒れているという感覚がある。

私は技術歴史文化といった面からブロックチェーン暗号通貨に対して知識がなく、学び始めたのはここ一ヶ月と言ってもいいだろう。学ぶ、といっても転がっている日本語一般的メディア記事を気が向いたときに読み散らかすぐらいである。真に技術的なことは何一つ分からない。暗号通貨Bitcoin とEthereum しか知らないし所持しているのはたまたま貰った僅かな ETH しかない。金銭的に貧しい多摩川に転がっている石くらいどこにでもいる17歳JKである。と逃げの文言を置いておく。

発端

議論の発端はここらへんからだろうか。

加納裕三 (Yuzo Kano)(@YuzoKano

囲み取材で数十秒話したこと記事になっているので、正確に伝わって無さそうです。

マイナンバーカードをいずれカード不要にしてスマホインストールできるようにしたい

・(ただ法改正必要)

・その前にそもそも、普及のためマイナンバーカードの発行総数を増やす必要がある

という趣旨かと。

https://twitter.com/YuzoKano/status/1312245723048550401

加納氏のこの時期のタイムラインから現在に向けて遡れば様々な第三者感想や疑問を得ることができるだろう。これらに纏めて答えているのが以下の記事である

ブロックチェーンの優位性①疎結合加納裕三/Yuzo Kano

https://blog.blockchain.bitflyer.com/n/n4b45329e308c

ブロックチェーンの優位性②改ざん耐性|加納裕三/Yuzo Kano

ttps://blog.blockchain.bitflyer.com/n/naa0126a024d5

加納氏とは一体何者なのかは以下を参照。

東京大学大学院工学研究科修了。ゴールドマン・サックス証券会社入社し、エンジニアとして決済システムの開発、その後デリバティブ転換社債トレーディング業務従事

2014年1月株式会社bitFlyerを共同創業し、2019年5月株式会社bitFlyer BlockchainCEO就任

bitFlyer創業以降、法改正に関する提言自主規制ルール策定等に尽力し、仮想通貨交換業業界の発展に貢献。

日本ブロックチェーン協会代表理事ISO / TC307国内審議委員会委員、官民データ活用推進基本計画実行委員会委員

2018年G7雇用イノベーション大臣会合2019年V20 VASPサミットに出席。

ttps://finsum.jp/ja/2019/speakers/recQMoKK5nD9yb8Ht/profile/

ブロックチェーン定義

ブロックチェーンを語るうえで何が重要かというと、その言葉定義である議論に参加している人が同じ言葉を使っているのに、各人の言葉に対する定義が異なっていると、言葉理解できるが内容が理解できないといった状況に陥ってしまう。このことは実生活でも頻繁に起こっているように思えるが、Twitter という短文が好まれプラットフォームでは著しくないがしろにされ不毛な議論を生む原因になっている。

加納氏が代表JBA日本ブロックチェーン協会)に依ると、ブロックチェーン定義は以下の内容である

ブロックチェーン定義

1)「ビザンチン障害を含む不特定多数ノードを用い、時間の経過とともにその時点の合意が覆る確率が0へ収束するプロトコル、またはその実装ブロックチェーンと呼ぶ。」

2)「電子署名ハッシュポインタ使用改竄検出が容易なデータ構造を持ち、且つ、当該データネットワーク上に分散する多数のノードに保持させることで、高可用性及びデータ同一性等を実現する技術を広義のブロックチェーンと呼ぶ。」

定義策定アプローチ

まず、Satoshi Nakamoto論文およびその実装であるビットコインブロックチェーンオリジナルブロックチェーン(以下「オリジナル」)として強く意識しています

狭義のブロックチェーン(定義1)は、オリジナル意識し、それが備える本質的で不可分な特徴を捉え、言語化しました。

広義のブロックチェーン(定義2)は、昨今〜今後の技術の展開を鑑み、オリジナルが備える特徴であっても、別の実装方式や別の目的への展開などにおいて、置換や変化が行われていく広がりを許容しながらも、特徴を捉えられるよう、言語化しました。

http://jba-web.jp/archives/2011003blockchain_definition

総務省のページも見つけたが JBA定義するものを基礎としている。

ttps://www.soumu.go.jp/johotsusintokei/whitepaper/ja/h30/html/nd133310.html

私が疑問と漠然としたモヤモヤ感を抱くのは、最近一般層で使われているブロックチェーン定義には「信頼できる第三者不要である」という点が抜け落ちているように思われることだ。非中央集権SNS暮らし脱中央集権を推進したい私にはこの点が"ブロックチェーン"の一番重要な点であると思うが、JBA第一定義にはこの点が記載されている。不特定多数へのインセンティブによって不特定多数による合意形成している。これによって「信頼できる第三者不要である」は満たされている。

では ISO定義を見てみる。

blockchain (3.6)

distributed ledger with confirmed blocks organized in an append-only, sequential chain using cryptographic links

Note: Blockchains are designed to be tamper resistant and to create final, definitive and immutable ledger records.

distributed ledger (3.22)

ledger that is shared across a set of DLT nodes and synchronized between the DLT nodes using a consensus mechanism

Note: A distributed ledger is designed to be tamper resistant, append-only and immutable containing confirmed and validated transactions.

https://www.iso.org/obp/ui/#iso:std:iso:22739

ISO定義によれば、ブロックチェーンは、暗号化リンク使用した一連の鎖で、追記のみで構成された確認済みブロックからなる分散台帳を指す。改ざんに強く、最終的で確定的で不変の台帳記録を作成するように設計されている。分散台帳は、一連の DTL(分散台帳技術ノードで共有され、合意メカニズム使用して DTL ノード間で同期される台帳である確認された有効トランザクションを含む全てが、改ざん耐性、追記のみの不変性を持つように設計されている。

比較

さて、加納氏の投稿やその他の加納氏に批判的/賛同的な人たちの反応を見ても、彼らの言っている内容がブロックチェーン定義を満たすものなのかいまいち分からなかった。

加納裕三 (Yuzo Kano)(@YuzoKano

ビザンチン耐性(BFT)

改ざん耐性

・高可用性(単一障害店の排除

アドレス(~=公開鍵)による疎結合の容易さ

エンタープライズ間でのデータ共有の容易さ

私はブロックチェーンの主な利点はこの5つ(ただし5つにだけではない)だと考えています。これをここでは5大利点と呼びます

なおかつ、この5大利点を概ね満たしているものブロックチェーンと呼んでいます(ただしブロックチェーンと呼んでいるものは、すべてこの定義だとは言ってない。かつ、ブロックチェーンの厳密な定義はこれではない。)

https://twitter.com/YuzoKano/status/1313247738503426048

ttps://twitter.com/YuzoKano/status/1313248174430019584

なぜ前提として厳密な定義加納氏の言葉説明せずに、勝手加納氏が定義した内容を”ブロックチェーンである”と語っているのか理解に苦しむが、加納氏の説明したい"プライベートブロックチェーン"を ISO定義を基に判断すると、


"パブリックブロックチェーン"で考えると


加納氏の上記の2つの投稿からは、"プライベートブロックチェーン"と"パブリックブロックチェーン"のどちらを指しているのか不鮮明ではあるが、note記事では"プライベートブロックチェーン"を想定している、と明記されており、議論の発端となったマイナンバーブロックチェーンに関しても"プライベートブロックチェーン"を指していると思われる。5大利点を満たす"プライベートブロックチェーン"は存在しないのでは…。

面白い記事

3つ面白い記事をみつけた。

"一方で、誤解と批判を恐れずに書けば、ブロックチェーンBitcoin論文に端を発するものであるとするならば、いわゆるプラベートブロックチェーンやコンソーシアムブロックチェーンと呼ばれているものは、ブロックチェーンと呼ぶのをやめて、「タイムスタンプ2.0」のような別の言葉を使うことも考えてはどうだろうか。それは、これらの技術が、リンクトークンタイムスタンプデータ構造の上に、決められたノードによる合意アルゴリズムを加え、記録した情報に対するビジネスロジックに応じた情報処理を加えたものであるからだ。根っこの技術は、同じHaberらによるタイムスタンプを元にしているものの、ブロックチェーンの発端となったBitcoin論文が目指した「信頼できる第三者機関を不要にする」という方向とは別の方向の進化をしているもので、その別の2つの方向のものを同一の枠で扱うことには無理があり、理解や発展を考える上で両方にとって弊害がある。"

タイムスタンプの再発見と「いわゆるブロックチェーン

https://link.medium.com/TgeOXv8Dlab

DLTブロックチェーン、DAGの違い

https://link.medium.com/4pz5oNlHpab

ビットコインじゃなくて、ブロックチェーンに興味がある」という人に教えたい「ブロックチェーン」の語源の話

https://www.coindeskjapan.com/10953/

これらの記事を読むと、そもそもブロックチェーンと呼ばれるものにおいてパブリックではないものは、なんびとも信用しない状況において根本的に非改ざん性を保障することができないのではないかと感じる。"パブリックブロックチェーン"こそがブロックチェーンであり、他のものブロックチェーンから発展してきた技術を使ったブロックチェーン定義を満たさな分散台帳なのではないか

終わりに

加納氏に関して覚えておきたいことは、彼は bitFlyerCEO であり bitFlyermiyabi という"コンソーシアム・プライベートブロックチェーン"を開発しているという点だ。当然行政に対して彼がブロックチェーン推しているのはこれを売り込むためなのであろう。これが厳密にブロックチェーンなのかは置いておいて、このプロダクト自体は素晴らしい取り組みだと私は感じる。デジタル化によって今までの煩雑手続き簡単になる可能性は大いにあるし、公的文書の保存にも役にたつ。黒塗り秘匿文書を撲滅しろ

ただ、ブロックチェーンをただの空虚バズワードとして扱うのではなく、厳密な定義の上で使うのは大事なことだ。今回の件は、果たして全てにおいて加納氏が良くない、と言えるのだろうか。言葉というのは多数が使うことによって定義が決まる。時代が変われば定義が変わってしまうこともある。ブロックチェーンという言葉を便利な魔法言葉にしてしまったのは誰だろう。本質を見極めない我々だ。AI 搭載!!といたるところで見る言葉だが、何をもって AI と呼んでいるのか不思議になる。実際のところ今まで"システム"と呼んでいたものなのに。日々の中で言葉をしっかりと見つめ直すのは大事だ。

編集後記

この記事は、そもそもブロックチェーンとは何か、という個人的な疑問をまとめたものであり、加納氏を批判する意図は無かったわけで、最後の締めはやんわりとしたかった。だが、加納氏は立場的には日本ブロックチェーン協会会長で、言葉定義する立場である言葉定義した側がこの有様というのは遺憾である日本行政デジタル化の推進は頑張って欲しい。

URL を貼りすぎたせいなのか投稿できなかったので一部表記を削った。

2020-01-06

今年流行りそうなおすすめYouTubeチャンネル

出版の裏側

現役の編集者出版業界の裏側を暴露するというチャンネル

テンポよく歯に衣着せぬ物言いで内情を詳らかにしていく

チャンネル性質ピー音や伏せ字も沢山あるがそれでも十分面白い

編集者志望や作家志望からアドバイスにも定期的に応じている

漫画家ライトノベル作家志望の人間からも多くの質問が寄せられるが

「まずはネットで腕試ししてから送ってこい」というのが最近定番の返しになっている

ゲストはいつも匿名形式での参加となっているためコメント欄では推理大会が開かれる

・脱マッチョ宣言

ボディビルダー男性女装に挑戦するチャンネル

女装に関してズブの素人だった人間が徐々にレベルアップしていく様子を楽しめる

最初はただ単にユニクロなどで買ってきたものを着るだけだったが

コメント欄女性女装家のアドバイスを参考にしながら

わず一年の間にガチ女性しか見えないレベルにまで到達してしま

元が中性的な顔立ちということを差し引いても凄かった

YouTubeでの収益をすべて寄付しているらしい

BLOCKS HOUSE BUILDER

デンマーク建築家をやっているLEGOガチ勢のチャンネル

建築家スキルを生かしてLEGOで家を組み立てるというチャレンジをしている

ただ単にガワだけを再現するのではなく機能性の高い本格的な住宅建築

LEGOブロックの意外な断熱性能の高さを見るにつけ

自分の家の断熱対策LEGOでやってみようかと思ってしま

”Primitive Technology”を連想するという人がコメント欄にもちらほらいる

・巷のデバッガ

ゲーム会社デバッガーをやっている大学生チャンネル

街なかを歩いているときに見かけた様々なものを紹介するという動画を上げているが

見たものをあたかも”現実バグであるかのように紹介するというユニーク手法をとっている

加えて豊富ゲーム知識と絡めて説明することでよりいっそうのおかしみを漂わせている

コメント欄では「これがゲーム脳か……」というような文言定番化している

海外ファンから映画マトリックスになぞらえてモーフィアスとあだ名されている

ミニヨンズ

改造ミニ四駆に心血を注ぐレッツ&ゴー世代チャンネル

金と暇を持て余したアラサー兄弟がひたすらミニ四駆の限界に挑み続けている

個人的には動力源改造シリーズ結構気に入っている

回を増すごとにヤバさがインフレしているところも懐かしの少年漫画っぽくていい

初心者には「ミニ四駆にウルトラダッシュモーター○個搭載してみた」をオススメする

不定期にやっている「ミニ四駆とビーダマンをかけ合わせようシリーズ」も見て欲しい

2019-01-03

anond:20190103193157

結構面倒

過去ブロックを覚えておく領域

int blocks[100][100];

過去ブロックを再描画

	BOOL WriteBoxOLDBox()
	{
		int width = 24;

		HDC hdc = GetDC(hWnd);
		HBRUSH hBrush = CreateSolidBrush(RGB(48, 48, 48));
		for (int y = 0; y < 30; y++)
		{
			for (int x = 0; x < 8; x++)
			{
				if (blocks[y][x] == 0)
				{
					continue;
				}

				RECT Rect = { 0,0,48,48 };
				BOOL ret;

				Rect.left = width * x + 1;
				Rect.right = width * (x + 1) - 1;
				Rect.top = width * y + 1;
				Rect.bottom = width * (y + 1) - 1;

				ret = FillRect(hdc, &Rect, hBrush);


			}
		}

		DeleteObject(hBrush);

		return FALSE;
	}

この辺は めんどくさくはあるけど みてわかってほしい

描画したWriteBoxとおなじ BOXが落ちた場所BOXの有無)を保存しておく

ここがわかりにくいといえば わかりにくい

	BOOL SaveBoxI()
	{
		blocks[y  ][x] = 1;
		blocks[y+1][x] = 1;
		blocks[y+2][x] = 1;
		blocks[y+3][x] = 1;
		return TRUE;
	}

anond:20190103184241

// WindowsProject7.cpp: アプリケーションエントリ ポイント定義します。
//

#include "stdafx.h"
#include "WindowsProject7.h"

#define MAX_LOADSTRING 100

// グローバル変数:
HINSTANCE hInst;                                // 現在インターフェイス
WCHAR szTitle[MAX_LOADSTRING];                  // タイトル バーテキスト
WCHAR szWindowClass[MAX_LOADSTRING];            // メイン ウィンドウ クラス名

// このコード モジュールに含まれ関数宣言転送します:
//ATOM                MyRegisterClass(HINSTANCE hInstance);
BOOL                InitInstance(HINSTANCE, int);
LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);

#include <list>

class MyWindow;
	
std::list< MyWindow *> windows;

class MyWindow
{
public:

	HWND hWnd;



	MyWindow()
		:hWnd(NULL)
	{
		windows.push_back(this);
	}

	virtual ~MyWindow()
	{
		std::list< MyWindow *>::iterator it;
		for (it = windows.begin(); it != windows.end(); it++)
		{
			if (*it == this)
			{
				windows.erase(it);
				break;
			}
		}
	}

	static MyWindow * find(HWND key)
	{
		std::list< MyWindow *>::iterator it;
		for (it = windows.begin(); it != windows.end(); it++)
		{
			MyWindow *target = *it;

			if (target->hWnd == key)
			{
				return target;
			}

		}

		return NULL;
	}



	//
	//  関数: MyRegisterClass()
	//
	//  目的: ウィンドウ クラス登録します。
	//
	ATOM MyRegisterClass(HINSTANCE hInstance)
	{
		WNDCLASSEXW wcex;

		wcex.cbSize = sizeof(WNDCLASSEX);

		wcex.style = CS_HREDRAW | CS_VREDRAW;
		wcex.lpfnWndProc = WndProc;
		wcex.cbClsExtra = 0;
		wcex.cbWndExtra = 0;
		wcex.hInstance = hInstance;
		wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WINDOWSPROJECT7));
		wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
		wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
		wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_WINDOWSPROJECT7);
		wcex.lpszClassName = szWindowClass;
		wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

		return RegisterClassExW(&wcex);
	}

	//
	//   関数: InitInstance(HINSTANCE, int)
	//
	//   目的: インスタンス ハンドルを保存して、メイン ウィンドウ作成します。
	//
	//   コメント:
	//
	//        この関数で、グローバル変数インスタンス ハンドルを保存し、
	//        メイン プログラム ウィンドウ作成および表示します。
	//

	int blocks[100][100];

	BOOL InitInstance()
	{
		hInst = hInstance; // グローバル変数インスタンス処理を格納します。

		ATOM c = MyRegisterClass(hInstance);
		x = 0;
		y = 0;
		boxType = 0;

		hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
			CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);

		for(int x = 0 ; x < 100 ; x++)
		{
			for (int y = 0; y < 100; y++)
			{
				blocks[y][x] = 0;
			}
		}

		if (!hWnd)
		{
			return FALSE;
		}

		return TRUE;
	}

	BOOL ShowWindow()
	{
		BOOL ret;
		ret = ::ShowWindow(hWnd, SW_SHOW);
		::UpdateWindow(hWnd);

		return ret;
	}


	HINSTANCE hInstance;
	MSG msg;
	BOOL run;
	int x;
	int y;
	BOOL Main()
	{

		HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WINDOWSPROJECT7));
		run = true;
		int rc;
		// メイン メッセージ ループ:
		while (run)
		{
			DWORD obj = MsgWaitForMultipleObjectsEx(0, NULL,  100 , QS_PAINT| QS_ALLEVENTS,0);
			if (obj <= WAIT_OBJECT_0)
			{
				while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
				{
					if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
					{
						TranslateMessage(&msg);
						DispatchMessage(&msg);
					}
					if (msg.message == WM_QUIT) {
						run = FALSE;
					}
					if (msg.message == WM_CLOSE) {
						run = FALSE;
					}

				}
			}
			else if (obj == WAIT_TIMEOUT)
			{
				y++;
				PAINTSTRUCT ps;
				HDC hdc = BeginPaint(hWnd, &ps);
				this->OnPaint(ps);
				EndPaint(hWnd, &ps);
				::UpdateWindow(hWnd);
				RECT Rect2 = { 0,0,48*9,48 * 100 };
				InvalidateRect(hWnd, &Rect2, TRUE);
			}
			else if (obj == WAIT_FAILED)
			{
				rc = GetLastError();
			}
			else {

			}
		}


		return TRUE;

	}

	int boxType;

	BOOL WriteBoxOLDBox()
	{
		int width = 24;

		HDC hdc = GetDC(hWnd);
		HBRUSH hBrush = CreateSolidBrush(RGB(48, 48, 48));
		for (int y = 0; y < 30; y++)
		{
			for (int x = 0; x < 8; x++)
			{
				if (blocks[y][x] == 0)
				{
					continue;
				}

				RECT Rect = { 0,0,48,48 };
				BOOL ret;

				Rect.left = width * x + 1;
				Rect.right = width * (x + 1) - 1;
				Rect.top = width * y + 1;
				Rect.bottom = width * (y + 1) - 1;

				ret = FillRect(hdc, &Rect, hBrush);


			}
		}

		DeleteObject(hBrush);

		return FALSE;
	}


	BOOL WriteBox()
	{
		WriteBoxOLDBox();

		switch (boxType)
		{
		case 0:
			return WriteBoxI();
		case 1:
			return WriteBoxL();
		case 2:
			return WriteBoxZ();

		}

		return TRUE;
	}

	BOOL WriteBoxZ()
	{
		HDC hdc = GetDC(hWnd);
		HBRUSH hBrush = CreateSolidBrush(RGB(48, 48, 246));

		int width = 24;

		RECT Rect = { 0,0,48,48 };
		BOOL ret;

		Rect.left = width * x + 1;
		Rect.right = width * (x + 1) - 1;
		Rect.top = width * y + 1;
		Rect.bottom = width * (y + 1) - 1;

		ret = FillRect(hdc, &Rect, hBrush);


		Rect.top += width;
		Rect.bottom += width;
		ret = FillRect(hdc, &Rect, hBrush);

		Rect.left += width;
		Rect.right += width;
		ret = FillRect(hdc, &Rect, hBrush);

		Rect.top += width;
		Rect.bottom += width;
		ret = FillRect(hdc, &Rect, hBrush);


		DeleteObject(hBrush);

		return TRUE;
	}


	BOOL WriteBoxL()
	{
		HDC hdc = GetDC(hWnd);
		HBRUSH hBrush = CreateSolidBrush(RGB(48, 246 , 48));

		int width = 24;

		RECT Rect = { 0,0,48,48 };
		BOOL ret;

		Rect.left = width * x + 1;
		Rect.right = width * (x + 1) -1 ;
		Rect.top = width * y + 1;
		Rect.bottom = width * (y + 1) -1;

		ret = FillRect(hdc, &Rect, hBrush);


		Rect.top    += width; 
		Rect.bottom += width;
		ret = FillRect(hdc, &Rect, hBrush);

		Rect.top += width;
		Rect.bottom += width;
		ret = FillRect(hdc, &Rect, hBrush);

		Rect.left   += width;
		Rect.right  += width;
		ret = FillRect(hdc, &Rect, hBrush);

		DeleteObject(hBrush);

		return TRUE;
	}

	BOOL WriteBoxI()
	{
		HDC hdc = GetDC(hWnd);
		HBRUSH hBrush = CreateSolidBrush(RGB( 246 , 48 , 48));

		int width = 24;

		RECT Rect = { 0,0,48,48 };
		BOOL ret;

		Rect.left = width * x + 1;
		Rect.right = width * (x + 1) - 1;
		Rect.top = width * y + 1;
		Rect.bottom = width * (y + 1) - 1;

		ret = FillRect(hdc, &Rect, hBrush);


		//Rect.left   += width;
		//Rect.right  += width;
		Rect.top += width;
		Rect.bottom += width;
		ret = FillRect(hdc, &Rect, hBrush);

		Rect.top += width;
		Rect.bottom += width;
		ret = FillRect(hdc, &Rect, hBrush);

		Rect.top += width;
		Rect.bottom += width;
		ret = FillRect(hdc, &Rect, hBrush);

		DeleteObject(hBrush);

		return TRUE;
	}

	BOOL SaveBoxI()
	{
		blocks[y  ][x] = 1;
		blocks[y+1][x] = 1;
		blocks[y+2][x] = 1;
		blocks[y+3][x] = 1;
		return TRUE;
	}


	BOOL OnPaint(PAINTSTRUCT &ps)
	{
		if (x > 8) {
			x = 0;
		}
		if (x <0) {
			x = 8;
		}
		if (y > 20) {
			switch (boxType)
			{
			case 0:
				SaveBoxI();
				break;
			case 1:
				break;
			case 2:
				break;
			}

			y = 0;
			boxType++;
			if (boxType > 2)
			{
				boxType = 0;
			}
		}

		this->WriteBox();

		return TRUE;
	}



	BOOL OnKey(WPARAM wParam)
	{
		if (wParam == VK_LEFT)
		{
			x++;
		}
		if (wParam == VK_RIGHT)
		{
			x--;
		}
		return TRUE;
	}


};


int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPWSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

    // TODO: ここにコードを挿入してください。

    // グローバル文字列初期化しています。
    LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
    LoadStringW(hInstance, IDC_WINDOWSPROJECT7, szWindowClass, MAX_LOADSTRING);
    //MyRegisterClass(hInstance);



	MyWindow win;



	win.hInstance = hInstance;

	// アプリケーション初期化を実行します:
	if (!win.InitInstance())
	{
		return FALSE;
	}

	BOOL ret;

	win.ShowWindow();

	ret = win.Main();

	if (ret)
	{
		return 0;
	}else {
		return (int)win.msg.wParam;
	}



}






//
//  関数: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  目的:    メイン ウィンドウメッセージを処理します。
//
//  WM_COMMAND  - アプリケーション メニューの処理
//  WM_PAINT    - メイン ウィンドウの描画
//  WM_DESTROY  - 中止メッセージを表示して戻る
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
    case WM_COMMAND:
        {
            int wmId = LOWORD(wParam);
            // 選択されたメニューの解析:
            switch (wmId)
            {
            case IDM_ABOUT:
                DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
                break;
            case IDM_EXIT:
                DestroyWindow(hWnd);
                break;
            default:
                return DefWindowProc(hWnd, message, wParam, lParam);
            }
        }
		break;
	case WM_KEYDOWN:
		{
			MyWindow *target = MyWindow::find(hWnd);
			target->OnKey(wParam);
		}
	break;
    case WM_PAINT:
        {
            PAINTSTRUCT ps;
            HDC hdc = BeginPaint(hWnd, &ps);

			MyWindow *target = MyWindow::find(hWnd);
			target->OnPaint(ps);


            // TODO: HDC を使用する描画コードをここに追加してください...
            EndPaint(hWnd, &ps);
        }
        break;
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}

// バージョン情報ボックスメッセージ ハンドラーです。
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);
    switch (message)
    {
    case WM_INITDIALOG:
        return (INT_PTR)TRUE;

    case WM_COMMAND:
        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
        {
            EndDialog(hDlg, LOWORD(wParam));
            return (INT_PTR)TRUE;
        }
        break;
    }
    return (INT_PTR)FALSE;
}

2015-01-22

http://anond.hatelabo.jp/20150122174420

俺はクルマが好きなんだあああああああ!!!!!!!!!!!!!111111111111

とにかく!!!クルマ!!!!好きなんだ!!!!!!!!!!!!!!!!!!!!!!!!!!111111111

と言えばいいだけの話(実際それ以上の情報は何も無い記事)なのに、なんで論理っぽいもので固めようとするのかが理解できない。

筋の通った論理になってるならまだしも、bulding blocksになりそうな要素を無理やりかき集めて積み上げただけの自己矛盾した支離滅裂な内容になっちゃってるし。

2011-03-03

ブログの問題を解いてみた

http://okajima.air-nifty.com/b/2011/01/2011-ffac.html

ぷよぷよを解く問題をやってみた

かかった時間はおおよそ1時間

途中でわからないところがあったのでくぐってしまった

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder[] blocks = {
                new StringBuilder("**GYRR"),
                new StringBuilder("RYYGYG"),
                new StringBuilder("GYGYRR"),
                new StringBuilder("RYGYRG"),
                new StringBuilder("YGYRYG"),
                new StringBuilder("GYRYRG"),
                new StringBuilder("YGYRYR"),
                new StringBuilder("YGYRYR"),
                new StringBuilder("YRRGRG"),
                new StringBuilder("RYGYGG"),
                new StringBuilder("GRYGYR"),
                new StringBuilder("GRYGYR"),
                new StringBuilder("GRYGYR")
            };

            bool updated = true;
            while (updated)
            {
            breaked:
                DumpBlock(blocks);
                for (int i = 0; i < blocks.Length; i++)
                {
                    for (int j = 0; j < blocks[i].Length; j++)
                    {
                        char c = blocks[i][j];
                        if (c == '*')
                            continue;
                        updated = false;
                        if (KillBlocks(blocks, i, j))
                        {
                            updated = true;
                            goto breaked;
                        }
                    }
                }
            }
            DumpBlock(blocks);
            Console.Read();
        }
        struct Point
        {
            public int x, y;
            public Point(int x, int y)
            {
                this.x = x;
                this.y = y;
            }
        }
        static bool KillBlocks(StringBuilder[] blocks, int x, int y)
        {
            bool[,] visted = new bool[blocks.Length,blocks[0].Length];

            MarkBlock(visted, blocks, x, y);

            Queue<Point> queque = new Queue<Point>();
            for (int i = x; i < blocks.Length; i++)
                for (int j = y; j < blocks[i].Length; j++)
                    if(visted[i,j] == true)
                        queque.Enqueue(new Point(j,i));

            if (queque.Count < 4)
                return false;

            while (queque.Count > 0)
            {
                Point p = queque.Dequeue();
                RemoveBlock(blocks, p.x, p.y);
            }
            return true;
        }
        static void MarkBlock(bool[,] visted, StringBuilder[] blocks, int x, int y)
        {
            if (x < 0 || y < 0 || x >= blocks.Length || y >= blocks[0].Length || visted[x, y] == true)
                return;
            char c = blocks[x][y];
            visted[x, y] = true;
            if (x + 1 < blocks.Length && blocks[x + 1][y] == c) MarkBlock(visted, blocks, x + 1, y);
            if (y + 1 < blocks[0].Length && blocks[x][y + 1] == c) MarkBlock(visted, blocks, x, y + 1);
            if (x > 0 && blocks[x - 1][y] == c) MarkBlock(visted, blocks, x - 1, y);
            if (y > 0 && blocks[x][y - 1] == c) MarkBlock(visted, blocks, x, y - 1);
        }
        static void DumpBlock(StringBuilder[] blocks)
        {
            foreach (StringBuilder s in blocks)
                Console.WriteLine(s);
            Console.WriteLine();
        }
        static void RemoveBlock(StringBuilder[] blocks,int x,int y)
        {
            int i;
            if (y == 0)
            {
                blocks[y][x] = '*';
                return;
            }
            for (i = y; i > 0; i--)
            {
                blocks[i][x] = blocks[i - 1][x];
            }
            blocks[i][x] = '*';
        }
    }
}

2007-06-04

[]??Delphihacks??Delphi??Win32API??

Delphi - Wikipedia??Windows開発の決定版 - Delphi(Skype??なでしこ)

タグ「delphi」を含む注目エントリー - はてなブックマーク

Delphiアプリケーションのメモリリーク検出法

Delphiアプリケーションのメモリリーク検出法 (山本隆の開発日誌)

作ろう!コンポーネント Delphi C++Builder

http://www.componentsource.co.jp/features/delphi/

TMS Software | Productivity software building blocks

Components > Effects and Multimedia > Video. Torry's Delphi Pages

Components > Effects and Multimedia > Audio. Torry's Delphi Pages

Components > Effects and Multimedia > Voice. Torry's Delphi Pages

Components > Effects and Multimedia > Direct X. Torry's Delphi Pages

try finally end

CとDelphiの対比表

eXeScope(Windows95/98/Me / ユーティリティ)

Delphi - テクノラティブログ検索

2ch検索: [Delphi]

Delphi-ML〓〓〓〓〓〓〓〓〓〓〓??About Delphi

Delphi Q & A掲示板

Delphi Q & A 〓f〓〓〓〓 〓〓〓〓〓〓O〓〓(HTML〓o〓[〓W〓〓〓〓)

fdelphi.com

Delphi入門

旧 Delphi 入門??Seventh Delphi

Delphiメモ

超ローテクDelphi講座

俺のためのDelphi学習

Delphi はじめの一歩

VB〓〓VC〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓H

Delphi の格言

キーボードからの入力取得

マウスボタンのクリック、マウスの位置情報の取得

ジョイスティックからの入力取得

バッカーへの階段: 入門:キーロガー

テキストファイルを読み書きする

テキストファイルのロードとセーブ

DelphiによるWin32API

Delphi WAVEサウンド音を鳴らす/Tips & Tricks

MIDI、WAVEファイルを再生する

サウンドを読み込んで鳴らす

MIDIを演奏する MCI/midiStream

5分ではじめるDelphi - 第1回 簡単なメディアプレーヤの作成(前編)

MP3プレイヤーを作る>dllによる再生

Controling sound volume from code

Torry's Delphi Pages

lsMicrophone: mxl.dwComponentType :=MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE;

MIXERLINE_COMPONENTTYPE_DST_SPEAKERS

MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT

SwissDelphiCenter.ch : ...set the volume for the microphone/ mute it (enhanced)?

Components > Sound Effects > Mixer. Torry's Delphi Pages

uses MMSystems;

//

PlaySound('C:\WINNT\Media\start.wav', 0, SND_FILENAME or SND_ASYNC);


ビットマップを表示しよう

画像ファイルを指定した位置へ表示

俺Delゲーム応用

画面をキャプチャして表示する

めもニャンだむ

Delphi6でプログラミング ビットマップの半透明コピー AlphaDraw

画像処理プログラミング講座

Graphic Effect

カラー画像をモノクロ画像に変換

procedure TForm1.Button1Click(Sender: TObject);

var

bmp1,bmp2 :TBitmap;

begin

bmp1 :=Tbitmap.Create;

bmp2 :=Tbitmap.Create;

try

bmp1.LoadFromFile('C:\Program Files\Common Files\Borland Shared\Images\Splash\256Color\FINANCE.BMP');

bmp2.LoadFromFile('C:\Program Files\Common Files\Borland Shared\Images\Splash\256Color\FACTORY.BMP');

Form1.Canvas.Draw(10,10,bmp1);

Form1.Image1.Canvas.Draw(10,10,bmp2);

finally

bmp1.Free;

bmp2.Free;

end;

end;


無料版Delphi6でSTGをつくるためのプログラミング講座 Ver.2005 Jan.

Delphiでわずか59KBのオセロを作る方法

めもニャンだむ:BIOS 情報

コンストラクタとデストラクタ

SwissDelphiCenter.ch : ...get the MAC Address?

乱数

DelphiでMD5

もっと楽にGUIとの連携がしたい:Python + Delphi = P4D(Python for Delphi) - ふにゃるん

Delphi WindowsのOSのバージョンを取得する/Tips & Tricks

SourceForge.net: Gecko SDK for Delphi

DelphiでWinSock

SQLite-もげもげ〜

BDS(Delphi/BCB)用SQLiteライブラリ (山本隆の開発日誌)

Application.ProcessMessages

FrontPage - DelphiVIP

SwissDelphiCenter.ch : programming tips

Torry's Delphi Pages

Delphi Tips

Delphi Code Tips

Magic of Delphi4〓z〓[〓〓 〓y〓[〓W

Delphi Win32API/API関数一覧

Delphi〓〓〓Z

クジラ式 Delphi 資料

Delphi〓〓y〓[〓W

サイト移転のお知らせ(Mr.XRAY)

openDelphi.org

KOL and MCKPage

Gen's Delphi Labo.

サイト移転のお知らせ(Mr.XRAY)

ナッキーの「Turbo Delphiはじめて奮戦記」- 第1回 Turbo Delphi のインストール

フリーのTurbo Delphiで始めるWindowsプログラミング:ITpro

フリーのTurbo Delphiで始めるWindowsプログラミング:ITpro

http://torrent.borland.com/turbo_hotfix_rollup.zip

http://torrent.borland.com/prereqs_jp.zip

http://torrent.borland.com/turbodelphi_jp.exe

(1) \dotNETRedist\dotnetfx.exe

(2) \dotNETRedist\langpack.exe

(3) \dotNETRedist\NDP1.1sp1-KB867460-X86.exe

\dotNETSDK\setup.exe

\IE60SP1\ie6setup.exe

\dotNETJSharp\vjredist.exe

\dotNETJSharp\vjredist-Permalink | 記事への反応(1) | 15:15

2007-03-13

cygwinとやらを落としてみた

blocksやらSudokuやらをやってみた。満足した。UNIXって凄いや!

 
ログイン ユーザー登録
ようこそ ゲスト さん