「MOVE」を含む日記 RSS

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

2020-01-01

多値返しに関する一部エンジニア見解ヤバない?

https://b.hatena.ne.jp/entry/s/jp.quora.com/hotondo-no-puroguramingu-gengo-de-kansuu-no-return-ga-1-tsu-shika-deki-nai-no-ha-naze-desu-ka を呼んだんだけど、回答・ブコメともにとんでもないことを書いている人がたくさんいてびっくりした。本質的に多値返しは直積型の返しと同じで、これはタプル・構造体と本質的に同じ、というのは多くの人が指摘している通りではあるのだが…。

配列返し

動的型付け言語に慣れてらっしゃる方が多いのかもしれないけれど、配列というのは「同じ型をまとめた型」であるべき。動的型でいろいろ突っ込める配列本質的には「直和型の配列」と思った方がいいよね。多値返しという意味では(記憶領域の面で)余分なコストがかかりうる直和型を選択する意味はないですよね?回答でもなんか配列返しに言及している某有名人がいたが、あれれ?という感じ。

もっとも、immutableな配列をtupleと呼ぶPythonという言語があるせいで引っ張られている感は否めないけども、配列とは本質的に異なる型が存在しているのは明らかですよね?配列構造体って違うよね…?(言葉定義問題と言われそうだけれど、型システムの分野での言葉定義存在しているわけで、反論になっているとは思えない。『俺は明日からこのわんわんなく動物ネコと呼ぶから』と言っているようなもんでは。)

CPUアーキテクチャについて

かにナイーブにはレジスタに入れて返すのが素直だというのは同意するけど、でもそれ構造体と一緒だよね?昔のCではこれはできなかったというのは知らなかったので勉強にはなりました(未検証だけど)。

あと構造体返しの関数がどう機械語実装されているのか知らなさそうな人がいるのにはちょっとびっくり。それでなんでレジスタがどうとか言えちゃうのかしら。構造体の値を返す関数ならばポインタは返さないですよ。そのポインタはどこを指してるんですか。実装しづらいとか何とか言ってる人たち、ちゃんアセンブラ読んだことあるんですか…?本質的に何の困難もないです(ちなみに少なくともlinux amd64ではスタック領域を確保してそのポインタ関数引数の一部として渡します。まあヒープに置く場合でも余計なmoveが出ないようにしたいとかあるかもだけど、そんなでかいデータ普通無名構造体では扱わないでしょう)。

多値は使いづらい

かに、返り値の型が(A, A)のような場合ドキュメント読まないとわからなくなってしまうので可読性が下がるし構造体を使うべしというのは(ほぼすべての場合において)同意(多値は使いづらいというのは構造体は使いづらいという意味ではないですよね?)。でもさ、某有名人goで挙げているけれど多値って普通(A, B)みたいに違う型の値を返したくなることの方が多くないですか。この場合どっちがどっちかは自明だよね?ただの無名構造体だよ。多値返しは設計が甘いとかわけわからんことを言っている人もいたけれど、なんかこちらが不安になってきた。

http://bleis-tift.hatenablog.com/entry/multiple-values

…本当に意味不明で驚いた。id:megumin1氏が言っているように、tupleのパック・アンパックに余分なコストをかける必要はない(まあアドレス渡しになるから複数本のレジスタで返すのと比べたら余分なmovが入りうるという話はあるけど、この人が多値返しというので何を想定しているかからないので何とも。)。何遍呼んでも多値返しとtuple返しの違いが判らなかった。おそらく前述のようにimmutableなlistのことをtupleと思っているのかな?と予想はするが…。

はてな界隈ってエンジニア的な印象があったんだけど、ここら辺の話ってそんななじみないのかな…?てか某有名人氏も型システムとかあんまりご存じないのかな…?むしろこれは増田無知なんだろうか…?

2019-10-20

ダークナイトライジング字幕を考える【the dark knight rises】

良くも悪くも有名な翻訳家戸田奈津子曰く翻訳家スクリプトを渡されてそれを基に字幕を作るらしい。なのに内容を理解しているとは思えないようなことを書きまくって字幕が酷いということはどの翻訳家でも同様。

ダークナイトライジングでも同じことが見られる。

この映画テーマmove on(先に進む)と言っていい。前作で人生の唯一の救いであ婚約者(仮)が吹き飛んだことでブルースは失意に暮れる。

その中で、"move on"という単語が何度も出てくる。

最初ブレイクが、みんな孤児move onというがそれは無理だ、という文脈。ここで字幕ではこの訳は消滅している。確かに、この部分だけなら不要だ。削っても理解できる。

二度目はアルフレッドブルースに言う場面。そろそろ"先に進んで"くださいと言った部分。ここでは字幕でもmove onが強調される。

三度目はアルフレッドが去るシーン。ブルースの口からmove onという表現が使われる。ここでも対訳はなし。洞窟から出る のみが字幕として現れる。

で、実際のストーリーとしては死の恐怖を再び感じ始めたブルース奈落から"rise"して、その結果、move onできるようになったため、爆発の前に脱出して自分人生を生き始めた、ということになる。

日本国内ではバットマンはあのまま死んだ説(アルフレッド空想)などが流れているが、これは元の文章タイトルを考えればありえない。このような論争を生むような翻訳家ばかりがいて、飯が食えているという事実にただただ悲しくなる。

2019-09-27

anond:20190927124104

本質的にはそこまで低レベル下りずともラズパイnode.jsでも入れてjsからbody.move()」とか出来るようにするのが理想で実際出来るはずなんだけどあんま広まってないの、結構謎だよな。

2018-11-26

少し長い間アメリカに住んでて、女性専用電車があるなんて知らなかったよ

入社3年後いきなりアメリカへ転勤を命じられて、

少し長い間向こうに住んでて住んでて、女性専用電車があるなんて知らなかったよ。

この間帰国した時、空港から電車乗り換えで慌てて駆け込んだら偶然女性専用車両だったんだよね。

そしたら豚みたいな女に「ここ男は乗れないんだけど!頭おかしいんじゃね?」と怒鳴られた。

こっちは大荷物抱えてて、時差ボケと長時間フライトでへとへと。おまけにフライト前日は徹夜仕事があったので殆ど寝ていない状態

駆け込み乗車はいけない事だけど、肩で息してて、目がパンダみたいになってる人間によくもそこまで言える。

さすがに頭きて 「Excuse me, but i dont speak japanaese. did i do something wrong? ah? 」

ってまくし立てたら威張りながら「Sorry,explain in English, You are wrong and You must move other carriage.」とか言ってやがる。

言い返せなかったんで「ソーリー、ソーリー」と言って次の駅で降りた。

2018-07-16

anond:20180716101457

英英辞典で調べてきた「video game」の意味置いとくね。

a computer game in which you move images on a screen using electronic controls

ゲーセン限定意味では「アーケードゲーム」っていう君自身が使ってる言葉があるからビデオゲームもっと広い意味だよ。

2018-07-01

Your Smile

When I met you there was spring light

And breeze in the street

My childish heart cheered

In the distant summer night of that day

I neglected loneliness

As I passed through the autumn day

A warm winter street

Reassured me of your warmth

At all times you have

A sincere look in your eyes

Even if you fall you will stand up again

I drew some strength

From your profile

That only gazes ahead .

Your smile

And your voice

Created my future

The time

That began to move

Carved out slowly changing days.

I should be able to overcome

Difficulty at any time

Because I have a dream

Now I have found

Something precious

Something that I want to protect.


I don't know the reason

for your tears that day

Beyond the upset I saw

A path leading to a dream.

I'm not afraid of mistakes

If I take a step forwards

Then I can have more faith in myself.

People look towards

The other side of sadness

This is what the sight of your back has told me

At my side

By your side

I could cry with longing to live in the moment

A dream

Without end

Must lead to somebody's future.

Don't give up

Whenever

I heard your voice

I found

Something precious

Something that I want to protect

I am not alone

I am always by your side

Because I want to see your smile

From the line of "Asagao to Kase-san"

2018-05-10

Ichinose must have been very disappointed.

You're the first like-minded friend he's ever had.

Your performance yesterday was inspiring. I'm impressed though not surprised.

I was hoping your praise in particular wouldn't be so generic.

Sensei!

Can I ever hope to move people with my playing the way Kai did? Can I someday..?

I want the honest truth, so please don't hold back.

Fair enough. Since you're aiming to be a professional, I'll give you the unfettered, honest truth. Amamiya, you need to learn to appreciate your own piano playing more. Do that, and you'll understand. You need compare yourself against others. you gave a good performance. Your future excites me.

From the line of "Piano Forest"

2017-10-07

Rustの寿命って

C++スマートポインタとかmoveとか使ってやりくりしてるようなメモリ管理を、言語仕様としてサポートしてくれてるものって理解でいいの?

2017-08-15

北朝鮮ミサイル発射の件

戦争起こらんぞ」と書いてる増田はどこ見たんだろうと思ってはてブ検索したが、WSJのこれ見たのかな?

オーストラリアメディアマティス長官発言記事見かけた直後だったからあれっ?てなった

よそのメディアはどう報じてるんだ

CNN北朝鮮国営メディア発言を伝えている。バカヤンキーの出方を見るらしい。

ロイター

2016-11-05

Communicating underwater is challenging.

Light and odors don't travel well, so it's hard for animals to see or smell.

But sound moves about four times faster in water than in air, so in this dark environment, marine mammals often rely on vocalization to communicate.

That's why a chorus of sounds fills the ocean.

Clicks, pulses, whistles, groans, boings, cries, and trills, to name a few.

But the most famous parts of this underwater symphony are the evocative melodies, or songs, composed by the world's largest mammals, whales.

Whale songs are one of the most sophisticated communication systems in the animal kingdom.

Only a few species are known to sing.

Blue, fin, bowhead minke whales, and of course humpback whales.

These are all baleen whales which use hairy baleen plates instead of teeth to trap their prey.

Meanwhile, toothed whales do use echolocation, and they and other species of baleen whales make social sounds, such as cries and whistles, to communicate.

But those vocalizations lack the complexity of songs.

So how do they do it?

Land mammals like us generate sound by moving air over our vocal chords when we exhale, causing them to vibrate.

Baleen whales have a U-shaped fold of tissue between their lungs and their large inflatable organs called laryngeal sacs.

We don't know this for sure because it's essentially impossible to observe the internal organs of a living, singing whale, but we think that when a whale sings, muscular contractions in the throat and chest move air from the lungs across the U-fold and into the laryngeal sacs, causing the U-fold to vibrate.

The resulting sound resonates in the sacs like a choir singing in a cathedral making songs loud enough to propagate up to thousands of kilometers away.

Whales don't have to exhale to sing.

Instead, the air is recycled back into the lungs, creating sound once more.

One reason whale songs are so fascinating is their pattern.

Units, like moans, cries, and chirps are arranged in phrases.

Repeated phrases are assembled into themes.

Multiple themes repeated in a predictable pattern create a song.

This hierarchical structure is a kind of grammar.

Whale songs are extremely variable in duration, and whales can repeat them over and over.

In one recorded session, a humpback whale sang for 22 hours.

And why do they do it?

We don't yet know the exact purpose, but we can speculate.

Given that the singers are males and they mostly sing during the mating season, songs might be used to attract females.

Or perhaps they're territorial, used to deter other males.

Whales return to the same feeding and breeding grounds annually, and each discrete population has a different song.

Songs evolve over time as units or phrases are added, changed, or dropped.

And when males from different populations are feeding within earshot, phrases are often exchanged, maybe because new songs make them more attractive to breeding females.

This is one of the fastest examples of cultural transmission, where learned behaviors are passed between unrelated individuals of the same species.

We can eavesdrop on these songs using underwater microphones called hydrophones.

These help us track species when sightings or genetic samples are rare.

For example, scientists have been able to differentiate the elusive blue whale's populations worldwide based on their songs.

But the oceans are getting noisier as a result of human activity.

Boating, military sonar, underwater construction, and seismic surveys for oil are occurring more often which may interfere with whale's communication.

Some whales will avoid key feeding or breeding grounds if human noise is too loud.

And humpback whales have been observed to reduce their singing in response to noise 200 kilometers away.

Limiting human activity along migratory routes and in other critical habitats, and reducing noise pollution throughout the ocean would help ensure whales continued survival.

If the whales can keep singing and we can keep listening, maybe one day we'll truly understand what they're saying.

2016-07-25

gitにおけるコミットログ/メッセージ例文集100

私はコミットログの書き方に悩む英語の苦手な人間である。実際、似たような人は世の中に結構いるようで、頻出単語を集計したりまとめたものは既にあって役に立つのだけれど、これらはあくま単語の話であり、具体的な文を構成する過程でやっぱり困る部分がかなりあった。

要するに、どういう時にどういう文が使われているのか、ということを示した例文集が欲しいのであるググると他にも「例文集があればいいのに」みたいな声はあるくせして、しかし誰も作ろうとしない。何なんだお前ら。それじゃ私が楽できないじゃないか

仕方なく自分でまとめたので、増田に垂れ流しておく。

はじめに

ここで挙げているコミットログは全て実際のコミットログから転載である。当然ながら各コミットログ著作権はそれぞれの書き手にある。いずれも各英文でググれば出てくるし、フェアユース範囲なら許してくれるだろうと考え名前プロジェクト名は割愛したが、ここにお詫びと感謝を述べておきたい。

抽出条件だが、参考にできそうなコミットログを多く含んでいそうなリポジトリGitHubSTARの多い方からざっと目で見て適当に選び、それぞれ最新コミットから5000件抽出した(あわせて前処理として、コミットログ冒頭のタグ情報は消去した)。

結果として対象としたリポジトリは以下の通り。

atomのみ5400件抽出していたため、計25400件のコミットログベースである。このうち、以下の条件に合致するものは参考例にすべきでないとして一律排除した。

こうして残った8540件を眺めながら、適当に切り出したのがこの用例集である個人的に「うーんこの」と思った表現も、散見される場合は載せた。

ということで、以下用例を羅列していく。

用例集

オプションフラグメニューを追加した
ファイルを追加した
メソッド機能を追加した
実装を別のものへ切り替えた
  • Use args.resourcePath instead of args.devResourcePath
  • Use arrays instead of while loops
  • Use auto instead of repeating explicit class names
  • Use weak pointer instead of manual bookkeeping
  • Change all uses of 'CInt' to 'Int32' in the SDK overlay
  • Change Integer#year to return a Fixnum instead of a Float to improve consistency
新しく何かに対応した/機能上の制約を取り払った
何かを使うようにした
より好ましい実装に改良した
何かを出来ない/しないようにした
  • Don't bail reading a metadata instance if swift_isaMask isn't available
  • Don't exit until the parent asks for an instance
  • Don't include Parent pointer in Nominal/BoundGeneric TypeRef uniquing
  • Don't use MatchesExtension for matching filters
  • Don't use ES6 class for AutoUpdater windows class
  • Don't use MatchesExtension for matching filters
  • Avoid `distinct` if a subquery has already materialized
  • Avoid infinite recursion when bad values are passed to tz aware fields
オブジェクトの内容や挙動確認やすくした
Assertを追加した
不要コードを除去した
コードを移動した
名前修正した
さなバグタイポ修正した, 警告を潰した
バグや好ましくない挙動修正した
テストコメントドキュメントを追加した
テストを削除した
テストコメント修正した
ドキュメント修正した

表現傾向とまとめ

以上の用例をふまえ、今回の参考ログ8540件から先頭の単語を出現回数で並べると次のようになった。

Add1149
Fix1014
Update584
Remove566
Use382
Don't260
Make228
Move178
Change103
Rename85
Improve76
Avoid68
Allow65
Implement60
Handle58

コミットログの基本形はもちろん動詞 + 名詞である名詞固有名詞複数形、不可算名詞が多いが、単数形場合冠詞は a が使われるか、あるいは省略される。the はまず使われない。

何かを追加した、という表現では非常に広く Add が使われる。メソッドからテストドキュメントに至るまで大概これでまかなえる。

一方、何かを修正した、という表現では広く Fix が使われる。「何か」は typocrash といった単語からメソッド名まで幅広い名詞を取るが、動名詞はあまり取らないのと、that節は取らないのでその点は注意が必要である

Fix は「何かが正しく動くようにした」ことを示し、正しい動作内容が何かを説明しない。そこで正しい動作内容に言及したい場合Make sure が使われる(こちらはthat節が取れる)。ただし Fix よりもニュアンス的に重い表現と思われ、Fix を使わず Make sure ばかり使うのはちょっとキモいのではないかと思う(Ensure はさらに重い表現っぽい)。

また、Fixtypo 以外でのドキュメント修正に対して使われることは稀である。対して Update はドキュメントコメントテストに使われ、本体コード修正に対しては使われない。本体コード修正にあわせてテスト更新したなら Update が使われる。ただ、テスト機構それ自体バグ修正したなら Fix である

無駄な何かを単純に除去したなら Remove を使う。これまでのもの(A)からのもの(B)に切り替えたのであれば Use B instead of A か Change A to B が使われる。新たに何かを利用するようにしたのであれば Use を、利用を取りやめた場合Don't use を使うことが多い。

何かをしないようにしたなら Don't を、内部実装効率化なら Make A + 比較級/形容詞Improve が使われる。

中身の変更を伴わない単なる名前の変更なら Rename A to B、コード機能論理上の場所を移動させたなら Move A to B である

この辺はリファクタリングと呼ばれる行為と思うが、Refactor というぼんやりした動詞はあまり使われず、このように変更内容の種類に応じて動詞が使い分けられている。

余談

コミットログにはWhyを書くべきだ、というのを何かで見かけたので because とか since を使ったログがどの程度あるかを調べたが、8540件のうち22件だった。基本的に短く、シンプルに、一目で意味が取れるログが好まれる傾向がある。例えば get rid of とか2件しか使われておらず、圧倒的に remove である

一方で、シンプル単語だけど開始単語としては使われないものもある。例えば次のような単語である。Expand(9)、Extend(8)、Print(5)、Optimize(5)、Publish(4)、Append(4)、Modify(3)、Manage(2)、Revise(2)、Dump(2)、Insert(2)、Migrate(2)、Enhance(1)、Edit(1) 。いずれもカッコ内は8540件に対する冒頭での登場回数である。結局、より一般的平易な単語で表せたり、Refactor同様に抽象度が高すぎると使われないのだろう。

おわりに

8000件もログを見たおかげで、迷いなくコミットメッセージが思いつくようになったのが個人的には今回書いてて最大の収穫だった。たぶんカンニングペーパーを作る行為それ自体効率のいい学習になるという話と同じだと思う。

このまとめも100以上用例を転載してあるので、それを読むだけでも多少は効果があるんじゃないかと思う。同じようにコミットログ書きたくねぇなぁ英語わっかんねぇなぁと思っている人にとって、何か役に立つところがあれば幸いである。

2016-07-10

英語ジョークが得意な増田来てくれ

A man is driving down a country road when he loses control of his car and ends up in a ditch. He gets out of the car and knocks on a farmhouse door for help. He explains his situation to the farmer. The farmer gets his horse and they walk to the crash scene. The farmer then uses rope to tie the horse to the car

"Pull, Zoomer, pull" the farmer shouts, but the horse doesn't move.

"Pull, Radar, pull" the farmer yells again, but again, the horse stands still

"Pull, Dasher, pull" yells the farmer, but the horse stands like a rock.

"Pull, Dusty, pull" shouts the farmer, and the horse finally gets the car out with minimal effort.

The driver is dumbfounded so he asks the farmer, "why do you call your horse different names?"

"You see," the farmer replies, "Dusty is blind. If he knew he was working by himself, he wouldn't have pulled."


オチというか面白いところが分からんのだが、是非教えてほしい。

2016-05-10

http://anond.hatelabo.jp/20160510223430

私はまとめサイトよりも動画サイトを見てるかなあ。

このへん。検索する時に「閲覧数順」「高レート順」あたりで並べ替えられるので、人気動画をてっとり早く見れる。上三つは国内サイトだけあって好みも結構一致してる。

あと、これは私の偏見だけど、まとめサイトってやたら広告ばかりでまともに動画が無いか、あってもリンク切れになってることが多いので信用してない。

2016-02-29

http://anond.hatelabo.jp/20160227195303

台詞を分かりやすくかみ砕いてみる

アミダラ「おう、ワレ、随分やってくれたな。議長の特使が来とるやろ」

ヌート・ガンレイ「い、いやそんなん知らんし」

アミダラ「まあ首洗って待っとけや」

ルーン・ハーコ「やべえよ兄貴元老院が動いたらどうするんすか?」

ヌート「今更どうにもなんねえよ。やるしかねえ」

ルーン「あのネーチャン、こっちが次にどうするつもりか分かってるんすかね?」

ヌート「そんなん考えても始まらんわ。それより、すぐにすべての通信を途絶させるんや」


(アラミダが議長通信中→通信が途切れる)

パナカ隊長「あれ、通信おかしくね?」

阪脩通信の途絶が意味するものひとつです陛下侵略(A communications disruption can mean only one thing...invasion.)」

アミダラ「い、いや連合もそこまでのことはしないはず…」

パナカ「せやせや。元老院が動いたら連中もお仕舞いでっせ」

アミダラ「交渉を続けるしか…」

阪脩「交渉ですと?すべての通信が途絶えました。そして、議長の特使も行方不明なのですよ?(We've lost all communications. And where are the Chancellor's ambassadors?)」


参考・http://www.starwars.jp/script/ep1.html

分析

もともとビブル先生

というのを踏まえて発言している。

要するに通信途絶だけで判断してるのでなく、それまでの積み重ねで、次にどういう手を打って来そうかを予想している。

あと、英語だとヌートが

「But we must move quickly to disrupt all communications down there.」と言った直後にビブルが

「communications disruption」と言って、同じdisruptって言葉を使ってるので、ヌートの動きをビブルが読んでるのが自然に伝わる仕掛けになってる。

日本語版だとヌートの台詞が「だが、急いで地上のすべての通信遮断しなければならん」となってて、翻訳ミスとまでは言わないけどニュアンス伝え切れてない感じ。

2014-11-06

ハイレゾ

あんまハイレゾって言いたくないんだけども。

確かに物によってはCDの曲よりも解像感があり、左右が分離してて、

きらびやかで、低音が豊かで、これがハイレゾか~って感じに聴こえる。

だけどそれはマスタリングによる違いでそう聴こえるんであって、

ぶっちゃけ16bit/44.1kHzと24bit/48kHzとで違うからそう聴こえるのではないと(今の段階では)思っている。

何故ならば、24bit/48kHzをダウンサンプリング・ダウンコバートしたものと元のを聴き比べても、全然からないからだ!

ただ、環境による問題はあるかもしれない。

ヘッドホンHD595。

外付けDAC(24bit/96kHzまで対応)にヘッドホンアンプをかまして使ってはいるが、

それらは自作したものなので、悪い意味で語れるレベルではないのかもしれない。

話は変わるが感想

ラブライブ

CD版よりクリアな感じがする。その効果か、聴きやすい印象。ありがたい。

最初に買ったSnow halationは聴きやすいなっていう理由で気に入った。

輝夜の城で踊りたい、は低音はいいんだけどサビでなんかちょっと破綻してる感じがしたなぁ。

上原ひろみ

CD版は持ってないから比較はしてないけどこれはいいぞ(ただの宣伝

Aliveはe-onkyoで、MOVEHD tracksで買った。どちらも良いものだ。

・K2HD関係

Catch You Catch Meだけ買って比べてみた。

確かにクリアになっているのかもしれない。処理の方法を考えてもきっとそうなんだろう。

驚くほどの変化があるか、っていうと、自分環境では分からん

レコードの曲

Waltz For DebbyとかWaveとか。

ハイレゾとは何かって考えさせられるな。聴きやすいと思う。

今後のハイレゾに対する期待としては、もちろん低価格化と、

品質を最低限保って欲しいということかな。

CDと何も変わらないものを上げるなんていうのも噂には聴くちょっとな。

2014-08-07

When I grow up/ Apple/ Jennifer O'Connor/ iPhone5s

感動したので訳してみました。

---

大きくなったら

ヒーローになるんだ

0からスタート

あがって、くだって

あがって、くだって

ぼくの頭で、そして心で

にのって飛ぶよ!

When I grow up

I’ll be the hero

Of my story book

I’ll start at zero

And rise and fall

And rise and fall again

My head, my heart

I’ll fly into the wind

大きくなったら

毎朝太陽が出迎えてくれる

1つ1つの波を捕まえながら泳いでいく、

疲れるまで

どんな運動だって練習する

直感

When I grow up

The sun will greet me

And every day

I’ll meet it completely

I’ll catch each wave and swim until I’m tired

I’ll practice every move, so inspired

大きくなったら、強く良い人になる

そして自分世界を作っていく

When I grow up I’ll be good and strong

I’ll create a world where I belong

When I grow up

大きくなったら、

自分のなりたい自分になる

あがって、さがっても

丘、星空

はじまりは美しい。

それを繰り返していくんだ

When I grow up

I’ll be who I want to

I’ll take every turn

With purpose and see through

The ups and downs

The hills, the starry skies

The beautiful beginning and reprise

When I grow up

※わかんないところははしょってあります

2014-08-05

さすがイギリス紳士の国ですね!!

Mother of boy with cerebral palsy forced to sit on bus floor because pensioners refused to move from disabled seats to give them room

http://www.dailymail.co.uk/news/article-2715380/Mother-boy-cerebral-palsy-forced-sit-bus-floor-pensioners-refused-disabled-seats-room.html

英国座席は誰のもの? バスに乗った身障者の母子、老人が席の移動を拒否→運転手に床に座らされる[8/5]

めいろま(@May_Roma)もうっとり!

2014-01-17

http://anond.hatelabo.jp/20140117000313

元増田です。ありがとうございます

モデルで発生するイベントが多く、複雑になるほど、ビューとの関連は密になる。

ここの所は、今回の例ではいまいち見えづらい気がする。

しかに、そうですね… 

攻撃を支持した時点で刀をふりあげて、そのあいだに毒でモンスターが死んだら、納刀する、のような場合では、モデル・ビューの関連が密になる例になるでしょうか。

いや、そのときModel「刀」をつくればいいのか…

Qtsignal/slotなんかはモデル同士の通信にも使える

これは知りませんでした。基本クラスレベルObserverパターンサポートされる!しかタイプセーフ…

Mac OS XCocoaフレームワークにも KVO という同様の仕組みがありますが、型のチェックは自分でする必要があります

MOVEの考え方からいえば、モデルの責務が吸い出されて単なるデータになってしま

MOVEは望まれなかった子 - the sea of fertility

を読んで、MVCを理解した(つもりになった)ので、MOVE設計方針自体スルーしていました。

Modelから責務が吸いだされて、なくなるのが予定調和なら、OVEでよいのでは

http://anond.hatelabo.jp/20140116013407

モデルで発生するイベントが多く、複雑になるほど、ビューとの関連は密になる。

ここの所は、今回の例ではいまいち見えづらい気がする。今回の例で複雑になっているのはモデルだけである。ビューがやる事は、「納刀する」「変色した血が飛び散る」イベントをlistenして画面に描画するだけのはず。MVCイベント機構は、モデル→ビューとコントロールモデルメッセージ通知を行うためのもので、モデル同士の通信についてはノータッチモデル内での相互作用に、単なるメソッド呼び出しを超えたあれこれが必要なら、DSLを作るなり自前でイベント機構を作るなり好きにして下さい、というスタンスかなあと思われ。

といってもQtsignal/slotなんかはモデル同士の通信にも使えるわけで、そういう意味最近GUIエンジンMVCの範囲を超えつつある。具体的に「Controllerから入力Modelの自発的な状態遷移も、同じイベント機構で扱いましょう」というのはMOVEの考え方に非常に近い。

http://blog.neo.jp/dnblog/index.php?module=Blog&action=Entry&blog=pg&entry=3442&rand=9193a

MOVEの考え方からいえば、モデルの責務が吸い出されて単なるデータになってしまうのは、むしろコンセプト通りであるとも言える。

なお、単純な例を超えてRPGの実装を自分が考えるなら、オブジェクト指向設計としては攻撃方法型や特殊作用型(毒とか呪いとか)同士の相互作用を主眼に置いた感じになって、モンスター勇者は単なるデータに近付いていくだろうなあ、と予想してみる。組んでみないと分からない事もあるだろうけれども。

2013-05-17

朝日新聞の「米政府報道は何をしたのか

タイトルの答えを端的に書けば,次のとおりである

朝日新聞は,米政府に出した予定質問に対する予定回答を報道した。

あるいは「実際に質問・回答がある前に」と付け加えても良いかもしれない。

「米政府言語道断侮辱的」 橋下氏発言を厳しく非難」( http://www.asahi.com/international/update/0516/TKY201305160295.html

「橋下氏発言を非難する米政府当局者のコメント(全文)」( http://www.asahi.com/international/update/0516/TKY201305160461.html

 

世間では,上の朝日報道はJen Psaki氏の発言を報じたものであるかのようにする者があるが,事実誤認である

Jen Psaki氏が朝日記事に近い発言をしたのは次の記事である

「Daily Press Briefing Washington, DC May 16, 2013」( http://www.state.gov/r/pa/prs/dpb/2013/05/209511.htm

もっとも,朝日新聞はこれを報道したものではあり得ない。なぜなら,「全文」とPsaki氏の実際の発言を比較するまでもなく,上記Briefingが行われたのは米国東部時間夏時間2013年5月16日午後1時45分つまり日本時間2013年05月17日午前2時45分であるのに対し,朝日新聞の記事は日本時間2013年5月17日午前0時2分に配信されており,つまり朝日の記事の方がPsaki氏の発言よりも早かったかである

 

さて,朝日の記事とPsaki氏の発言は非常によく「似ている」。

朝日新聞の「コメント全文」)

Mayor Hashimoto’s comment is outrageous and offensive. As the United States has stated previously, what happened in that era to those women, who were trafficked for sexual purposes, is deplorable and clearly grave human right violations of enormous proportions. We understand that mayor Hashimoto is planning to travel to the United States, but in the light of these statements, we are not sure that anyone will want to meet with him.

(Psaki氏の発言該当部分)

QUESTION: Hi, my name is Takashi from Japanese newspaper Asahi. Osaka City Mayor Hashimoto recently made a comment on the so-called “comfort women” issue, arguing that even though it is unacceptable from the moral perspective value, but the comfort women were necessary during the war period. And he also argued that it is not fair that only Japan is criticized by the United States and other countries, because there are other country military that were provided sexual service by prostitute. And do U.S. has any position on his comment or criticism against the United States?

MS. PSAKI: We have seen, of course, those comments. Mayor Hashimoto’s comments were outrageous and offensive. As the United States has stated previously, what happened in that era to these women who were trafficked for sexual purposes is deplorable and clearly a grave human rights violation of enormous proportions. We extend, again, our sincere and deep sympathy to the victims, and we hope that Japan will continue to work with its neighbors to address this and other issues arising from the past and cultivate relationships that allow them to move forward.

QUESTION: Do you describe this issue sex slave or comfort women?

MS. PSAKI: Again, I don’t know that I’m going to define it. You kind of laid out the specific details there, and we have described this issue in the past as comfort women[ii].

Go ahead in the back.

具体的な表現が同一であることは,(後に為された)Psaki氏の発言が朝日コメント」にもとづいて為されたことを示す。つまり朝日の記事は予定回答を掲載したものだといえる。

もっとも両者には細部に違いがある。どこが違い,どのような意図で事前回答から変更したのか,は,ここでは問題ではない。

ただ,重要なのは,「予定回答は実際の回答までに変更されることが有り得る」ということだ。(逆に,報道側が質問撤回ないし変更する場合もある。)

そして政府による公式な意見表明は,言うまでもなく予定回答ではなく実際の回答である

政府は予定回答の後も,実際の回答までにさらなる深謀遠慮を働かせて,表現を選ぶ。

したがって,予定回答は朝日新聞が言うような「政府の公式な立場を示したもの」では無い。

 

それよりも深刻なのは,予定回答を報道するのは政府の深謀遠慮を踏みにじる行為である,ということだ。

予定回答は実際の質疑応答を充実させるために示すのであるが,このように勝手漏洩されるのであれば,予定回答を示すこと自体,控えなければならないかもしれない。

 

さて,これで朝日報道問題点がお分かりいただけたと思う。橋下vs朝日ではなく,朝日vs(米)政府という問題なのである

2013-04-01

PHP13.4.1の新機能

PHP最新版がようやく正式に発表されましたね。新機能等について調べてみたので流行に敏感な人はぜひ今のうちから勉強しておきましょう。

下位互換性のない変更点

  • 「?>」の廃止

「?>」を積極的に使うことにより、余計なホワイトスペースを混入させてしまう問題がありました。

これは厄介で非常に根が深い問題でしたが、ようやく根本解決として廃止されました。素晴らしいですね。

今後「?>」を使うとコンパイルエラーとなるので注意が必要です。

機能

abstract文で囲うとそのコード自動抽象化します。

昨今抽象化抽象化特に意味もわから言葉だけ連呼する人間が増えてきました。しかし新PHP時代における抽象化はもはや人間が理解しなくてもできるようになります

$class = abstract {
    $人間 = array('name' => 'yamada', 'age' => 20);
    $佐藤 = array('age' => 20);
    $動物->name = '花子';
    $動物->type = '犬';
    
    function move ($a) {
        $a->position++;
    }
};

$class->move();

このような処理が、自動抽象化され再利用できるようになります。もちろんクラス抽象化だけでなく、手続きやデータ構造であっても適切に自動抽象化されます

またcatch文を繋げる事で抽象化に失敗した場合を検出することが可能です。

  • 強力な型チェック

php実行時オプションに強力な型チェックオプション(-compile)が追加されました。

$ php -compile example.php

そのスクリプトにおける全ての処理パターンを実行し、全ての型のチェックを自動で行います。その際、外部に影響を与えるような処理(ファイルへの保存等)は型チェックのみを行い無視されます

この強力な機能のおかげでもはや静的言語の利点といわれていたコンパイル時の型チェックを軽く超えました。

動的言語でありながら、考えられる全ての型の引数、例外系を全ての関数の組み合わせで網羅的にチェックします(しかもチェック時間は長くても0.数秒という驚異的なチェック能力です!)

これが今回の目玉機能でしょう。

theworld文で囲うとその間の時間が止まります

theworld {
    // 止まった時間の中を動けるのは$dioだけ
    $dio->foo();
    $dio->bar();
};

$dioという特殊変数が用意されているのでその変数を使って処理をすることができます

用途としては非常に重たい処理をさせるのがいいでしょう。実時間0秒で実行することが可能となります

ただし9秒までしか止められないので注意が必要です。ですが回避策として以下のようにすれば追加で5秒止めることも可能です。

theworld {
    $dio->foo();
    $dio->bar();
}
starplatinum {
    // 9秒過ぎた時点でこちらへ
    $jotaro->foo();
};


PHP 13.4.x で推奨されなくなる機能

名前空間(namespace)が非推奨になりました。これを使用するとE_NAMESPACE_YEN_ARIEHENという警告が発生します。

非推奨となった理由ですが明確にはされていません。大人の事情ってやつでしょう。

ただ噂レベルでは、やはりというか区切り文字の「\」がありえへんという声が多かったからではないか?と一部囁かれています

mandomキーワードが非推奨になりました。mandomはきっかり6秒戻すという機能ですが、逆に言うと6秒きっかしか戻せないので扱いづらいという問題がありました。

また以下のような処理を書いた場合に$flagバグ等で常に真になるケースにおいて無限ループとなり、非常に危険だという問題もあります

// 何かしらの処理・・・

if ( $flag ) {
    mandom;
}

このようにPHP初心者がmandom使って無限ループをさせてしまう事案が後を絶たず、なかなか現実時間が進まないという問題が発生したため、廃止予定となります

新しい関数

Google検索したコード小片取得し、実行させる関数

$mail = google_search_exec("メール送信するやつ",2);
$mail("user@example.com");

例えばこれだけでメール送信できるようになります

第一引数検索ワード。PHPというワードは自動で含まれるので指定する必要はありません。

第二引数検索結果一覧の指定位置。2だと上から二つ目検索結果のURLコード小片を使うという意味になります

また第三引数にはコールバック関数を指定することによりコード小片にフィルターをかけることも可能です。

このような処理がたった2行で書けるというのがPHPの利点ですね。

日本語名の関数が新たに追加されました。これは非常に便利な関数です。

$code = 写経("
$a = 1 + 2;
print $a;
");

引数に与えられたコード片を写経します。戻り値写経結果が返ってくるのでそれを利用するだけです。簡単ですね。

サッケード発生中における自動補完のための関数です。

この関数が呼ばれると一瞬処理が止まったように見えますが、実際には自動補完で動作が完了している状態になります

for($i=0;$i<10000;$i++) {
    if ( $i % 2 == 0 ) {
        chronostasis();
    }
    
    // 何かしらの処理・・・
}

素晴らしい機能ですね。今後はこれ無しじゃプログラムできなさそうです。

PCが爆発します。

用途ですが、言わずもがな流行の真契約プログラミング用ですね。アサートの代わりに使うとよいです。

function foo ($a) {
    pc_explosion(!is_null($a),'$aはNULLはダメー!');
    
    // 何かしらの処理・・・
}

テストコードを実行する場合PCの周囲に人が居ないか気をつけてから実行させましょう。




というわけで新しい機能てんこ盛りでしたね。

個人的に良いなと思ったのはpc_explosion関数ですかね。約束事を守らないプログラマーなんぞ爆死しちゃえばいいんです。僕を含めて(お

2012-01-09

Dslr camera Guideline -- The right way to Seek advise from Your own Dslr high-end camera

When considering imagine consuming, getting easy methods to make use of the digital camera are probably the fundamental assignments on the establish. The examples below digital slr high-end camera lead provides basic fundamentals about options to partner with an individual's camera and as a consequence assist you greater establish the standard terminology mandatory.

Whereby Consumers Start out... A Security dslr camera

Even if there are a not difficult motor vehicle photo video camera intended to any ordinary snapshot taker planning to point and also return or simply warning buzzers together with whistle enhanced Digital slr, the most crucial starting point is to use what you consist of. If you have had for no reason undoubtedly,Panasonic HDC-TM900 Charge do not forget to evaluate any hands-on plus try out to achieve the just about all working experience you could as a result. A good number of manuals can verify all to consider about precisely how towards employ that video camera. Keep in mind, it should receive baffling you will be know simple digital camera words.

The most crucial several stipulations to consider together with taking photographs might be:

1. Shutter Full speed

step 2. Aperture

3. ISO

A good number of a handful of situations the many examine various things holdings and even debts high-end cameras which will understand cope with the simplest way and also variety of lighting is likely to be allow in the digicam to make sure you set-up scenes. Taking photographs is Panasonic VW-VBN260 Battery focused lumination in addition to minor innovations through soothing is commonly addressed feel gigantic has effects on on what this persona success considering.

Classified ads by just The search engines

Aperture

Whatever aperture in our video camera is actually which usually "iris-like" product the opens and as well turns. The item appliances just how much light-weight is usually earn all around via the bit of throw away. The larger any sort of ditch, the greater light make it possible for round. This really is fantastic with F-Stops the moment f5. 6 is usually a considerable primary as opposed to f16 are sometimes small to medium sized primary. You need a much larger initially suitable for dark surrounds in addition to a less starting off suitable very dazzling illnesses.

Shutter Pace

In relation to aperture adjustments the figures on a fabulous throw away the fact that brightness switches into because of, almost any shutter accelerate apparatus just how long this approach light-weight is actually come up with interior. A nice shutter swiftness connected with 1/500 is going to make very low minor utilizing not like a lengthier shutter fee approximately 1/5 need after only supplemental moderate. It's fantastic with secs. You need to work with painless shutter facts convert gears designed for circumstances by means of many moderate aside from systematic shutter rates of speed when particularly full experiences.

ISO

Any sort of ISO adjustments a fabulous tenderness of the "film". Intended for camcorders, whereas it doesn't management picture presently, everything adjustments a fabulous tenderness with the high-end camera sensor. A greater ISO options can certainly help produce styles photograph become faster and as well demand even less smooth compared to a decreased ISO. Strangling part of managing great ISO is probably of the fact that enhanced ISO's ordinarily result in a detraction at the time of envision first-class high quality as well as almond.

Applying it on whe whole

At the moment knowing the exact a couple of valuable symbol photo digital portrait photography useful tips future move is usually to see how a large amount of several associated with routine aside throughout both as well as the option to select the right configuration settings for each solo! A bunch of security surveillance cameras own methods the moment anyone software one of these simple together with security surveillance camera might easily consider useful configuration settings with the sleeping. A couple selections usually are shutter priority along with Panasonic VW-VBK180 Battery aperture the main ageda once approximately just about every individual individuals manage probably lots of the shutter accelerate or even this particular aperture.

The final fundamental digital slr high-end camera efficiency content is usually intent. A bunch of security surveillance cameras own automotive intend that's characteristically poor along with translates to fluffy photos often. The most effective will be to realize how to work together with intelligent emphasizing in addition to using the services of main aim metering that will help methodically tutorial put focus.

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