「Interface」を含む日記 RSS

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

2020-09-27

anond:20200927003907

enumをただの単一インスタンス確約されたキーオジェクトしか使ってないの見ると悲しくなるよね

そんな用途しか使わないならstaticで宣言したStringでいいじゃねぇかってなる

ストラテジーパターン的にinterface貼って使うならenumも便利だなと思うけど

2020-09-21

ReactやらTypeScriptやらが難しい

propsとstate

type aliasとinterface

hookがあるからクラスはいらない

あーもう、訳がわからん!!

こっちはヤムチャ視点だよ!!

初心者には情報の足が早すぎて古い情報なのか今必要情報なのか精査できないんじゃ!!

2020-08-25

プログラミング法令解釈の似ているところ

定義してから使うところ

学校教育法

第一

この法律で、学校とは、幼稚園小学校中学校義務教育学校高等学校中等教育学校特別支援学校大学及び高等専門学校とする。

二条

1 学校は、国(国立大学法人法平成十五年法律第百十二号)第二条第一項に規定する国立大学法人及び独立行政法人国立高等専門学校機構を含む。以下同じ。)、地方公共団体地方独立行政法人法平成十五年法律第百十八号)第六十八条第一項に規定する公立大学法人(以下「公立大学法人」という。)を含む。次項及び第百二十七条において同じ。)及び私立学校法昭和二十四年法律第二百七十号)第三条規定する学校法人(以下「学校法人」という。)のみが、これを設置することができる。

2 この法律で、国立学校とは、国の設置する学校を、公立学校とは、地方公共団体の設置する学校を、私立学校とは、学校法人の設置する学校をいう。

第一条では「学校」の定義を列挙型により定めている。

二条第1項では「国」「地方公共団体」「学校法人」という3つの用語が新たに定義されている。

同第2項では「国立学校」「公立学校」「私立学校」が定義されているが、この時点で既に前の定義が使われている。単体ではこの条文は読めず、ここまでの4つの定義を持ってこなければならない。

VBで言うところのDim a = ~。JSで言うところのvar a = ~。

法律によっては第二条あたりに、以降で使う全ての用語定義しまくるものすごく長い定義セクションがあったりする(例:所得税法)。初っ端にDimが何十行も続くコードのよう。

他の法律から引用するところ

社会福祉法

二条

2 次に掲げる事業第一社会福祉事業とする。

一 生活保護法昭和二十五年法律第百四十四号)に規定する救護施設更生施設その他生計困難者を無料又は低額な料金で入所させて生活扶助を行うことを目的とする施設経営する事業及び生計困難者に対して助葬を行う事業

二 児童福祉法昭和二十二年法律第百六十四号)に規定する乳児院母子生活支援施設児童養護施設障害児入所施設児童心理治療施設又は児童自立支援施設経営する事業

三 老人福祉法(昭和三十八年法律第百三十三号)に規定する養護老人ホーム特別養護老人ホーム又は軽費老人ホーム経営する事業

四 障害者の日常生活及び社会生活を総合的に支援するための法律平成十七年法律第百二十三号)に規定する障害者支援施設経営する事業

五 削除

六 売春防止法昭和三十一年法律第百十八号)に規定する婦人保護施設経営する事業

七 授産施設経営する事業及び生計困難者に対して無利子又は低利で資金を融通する事業

ほとんど既に制定されている法律引用しただけで、第一社会福祉事業定義構成している。

Cで言うところの#include。Pythonで言うところのimport。require派でもusing派でもなんでもどうぞ。

他の法律委任するところ

銃砲刀剣類所持等取締法銃刀法

四条

1 次の各号のいずれかに該当する者は、所持しようとする銃砲又は刀剣類ごとに、その所持について、住所地を管轄する都道府県公安委員会許可を受けなければならない。

四 国際的な規模で開催される政令で定める運動競技会のけん銃射撃競技又は空気けん銃射撃競技に参加する選手又はその候補者として適当であるとして政令で定める者から推薦された者で、当該けん銃射撃競技又は空気けん銃射撃競技用途に供するため、けん銃又は空気けん銃を所持しようとするもの

銃砲刀剣類所持等取締法施行令

第三条

1 法第四条第一項第四号の政令で定める運動競技会は、次の各号のいずれかに掲げるものとする。

一 オリンピック競技大会

二 アジア競技大会

三 近代五種競技世界選手権大会

四 世界射撃選手大会

五 アジア射撃競技選手大会

2 法第四条第一項第四号の政令で定める者は、公益財団法人日本スポーツ協会昭和二年八月八日に財団法人大日本体育協会という名称設立された法人をいう。以下「日本スポーツ協会」という。)とする。

銃刀法では、銃砲刀剣を持つ許可をする相手を「政令で定める」とぼかしておいて、許可を与える仕組みだけを制定している。

具体的に許可を与える相手は、施行令によって定めている。

まり、枠を作ってあとからそれに当てはめるコードを書いているわけだ。

これはJavaC#interfaceのものである

法律に定めるべき具体的な内容は、時代や情勢によっていくらでも変わっていくものだが、法律改正国会でいちいち可決しなければならないから手間がかかる。

それに対して政令であれば内閣が制定できるし、さらに下位の省令となれば省庁だけで完結できる。より偉い法律立場からより小回りの利く政省令委任することによってコードの柔軟性を保っている。

これは大規模開発にて分担してコーディングすることにずいぶんと似ている。

後の記述の方が強いところ

地方自治法

第八十九条

普通地方公共団体議会を置く。

第九十四条

町村は、条例で、第八十九条規定にかかわらず、議会を置かず、選挙権を有する者の総会を設けることができる。

法律基本的には後の方が強い。

先に定義された条を、後に書かれた条が覆すことができるし、なんなら後から制定された全く別の法律が、急に他の法律を覆しにくることもよくある。

これはプログラミングにおいて、変数の値や状態を後から書き換えられることに似ている。あるいは、クラスオーバーライド

法令解釈では、ある条文を読むとき、その条文に書かれている全ての定義を参照先まで確認しに行き、他の条文に委任されている事項も全て調べ、その上、他の条文で覆されていないかも調べる。

プログラマーデバッグしている時の動きに一致しているといっても過言ではないだろう。

差分管理しているところ

酒税法の一部を改正する法律平成九年)

酒税法昭和二十八法律第六号)の一部を次のように改正する。

第十条第一号中「若しくは第二号の」を「から第三号までの」に改め、同条第二号中「若しくは第二号」を「から第三号まで」に、「ついては、」を「ついては」に改める。

十四条見出し中「取消」を「取消し」に改め、同条中「左の各号の一」を「次の各号のいずれか」に改め、同条第三号を同条第四号とし、同条第二号の次に次の一号を加える。

三 未成年者飲酒禁止法大正一年法律第二十号)の規定により罰金の刑に処せられた場合

法律基本的に「~を改正する法律」を施行することで、このように改正を繰り返している。

単体の「新法」が新たに発生するのではなく、元の法律差分を組み合わせて結果的に新法になるという仕組みだ。

まり、これは差分管理でもあるし、プルリクをマージしてデプロイするGitの仕組みも連想される。

こんなにも法令解釈プログラミングは似ているのだからもっと両者は仲良くできるはずだ。

2020-07-09

[]TIP、TSF

Windows 10時代日本語入力に使っているATOKなどのソフトウェアIMEでもFEPでもなくTIPと呼ぶのが正しいらしい。でもほとんど使われていない。

テキストインプットプロセッサの略で、従来のIME(インプットメソッドエディタ)との違いはIMEがIMM32 API(インプットメソッドマネージャーAPI)を使うのに対し、TIPはTSF(テキストサービスフレームワーク)を利用する。

これはWindows XP以降標準で採用されるようになった。Windows 8以降に現れたストアアプリではTIPを使わないと日本語入力ができない。

Text Services Framework

https://docs.microsoft.com/ja-jp/windows/win32/tsf/text-services-framework

"Text Input Processor"の名称が使われているドキュメントは多くなく、これくらい

ITfInputScope2 interface

https://docs.microsoft.com/ja-jp/windows/win32/api/inputscope/nn-inputscope-itfinputscope2

2020-04-09

ねぇXちゃんさぁ。なんでこんな動的なオブジェクトをstaticにしてんの?

これさぁ、そこそこ重いけどさ、セッションごとに生成される一時的インスタンスで持ってるだけでも十分パフォーマンス的に問題ないよね?

なんでプロセス間でわざわざ共有してんの?

これってネットワーク接続管理してるオブジェクトだよね?

ネットワークリソースつったって利用者たかだか数百人でしょ?

その中でリソースを同時利用するってゆってもたかだか十数人でしょ?

プロセス内でこのオブジェクトを全共有することでリソースの削減なんてたかが知れてるよね?

それをわざわざプロセス内でこのオブジェクトを全共有ってマジ管理できるの?シンクロナイズドとか書いてっけどさぁ?削減できるリソースの量に比べて超危険すぎねぇ?

コミットログ見たけど、ぜんぜん性能問題とかと関係のない問題修正だったみたいだけど、なんでこんな危険コードになったわけ?

Xちゃんさ、そもそもコードが品雑なんだけど、これエンプラJava案件なのよ

なんでCの組み込みコードみたいにif文の鬼ネストとか、引数に空のList渡して破壊的に値を設定するような、読みづらいコード書いてるわけ?

Listくらい普通に返り値で返しなさいよ…

状態管理もif文の鬼ネストやめて専用クラスとかEnum使ってコマンドパターン対処しなさいよ

もしかして、Xちゃんオブジェクト指向にピンときていないのかな?

ちゃんはどっちかってーっとPHPパーなので、ゴリゴリオブジェクト指向はそりゃ専門じゃないよ

それでもさ、interfaceとか使って、各処理の実装を切り分けるとか、やりようはいくらでもあるじゃん

あと不要なnullチェックも多すぎです。コンストラクタ初期化保証されているfinalフィールド値がnullかどうかなんて確認しないでください

ユーザー入力DB入力環境リソースとか、外部の情報起源じゃない変数がnullとか、明らかなバグなんだから暗黙的なぬるぽクラッシュさせましょう

こんなバグが出荷に乗ることなんてありえません。わざわざ専用のエラー処理で専用の例外飛ばすとか無意味です。

いちいちなんか冗長で複雑なんですよねぇ。

ちゃんみたいな若造が、ベテランのXちゃんにこんなこといいたくないけどさ、

Xちゃんコード。どこか昭和匂いがするんだよねぇ。悪い意味で。

Xちゃん名誉のために言っておくと多分Cプログラミングうまいんじゃないかな?

そんなソース読んだこと無いから知らんけど

2019-06-21

Javaをメインで書いているわけではないけど

別にJava良くないか

なんならRubyより静的言語だという点で優れているような。

最近Go流行っているが、それならJavaだって同様に良さそうな気がする。

Java批判すべき点ってなんなんだろう。

- 記述冗長

- nullがたまにうざい

- なんか重厚な感じがする

- 重厚アーキテクチャ流行りすぎた?

- ORMとかが重厚なのが多かった

- ビルドツールが洗練されていない時代があった

- 故に環境構築が大変だった

- tomcat + jar みたいなのがだるかった?

- strutsがしんどかった

- 未だにstruts脆弱性が見つかったりするところ

- xml地獄からアノテーション化したりいろいろと模索していた

- なんかJava案件地雷が多かったとか?

- ちょっと昔には「俺たちイケてるプログラマ」はみんなRailsに移っていった流れがあった?

- Effective Javaよいが、そもそもそういうtips意識せずにそう書けるような言語仕様になってほしかった気もする

- 非同期処理やスレッド処理がやや難しかたか、あるいは言語側でのサポートが薄かったか(?)

言語仕様的な批判と、エコシステム的な批判に分けられそうなきがするな。

関数型言語の関心はScalaClojureに全フリしてもらって、Javaシンプル機能を持つGo方向性なModan Javaになっていってくれれば良さそうな気も。

httpサーブレットとかそのへんが微妙だったかもしかしてGoみたいにnet/httpライブラリが標準であればそれをベースにすることでオレオレフレームワークの乱立を避けることができるか、と思ったけどJAX-RSとかがあるな。

Goだって冗長記述必要言語だが、好かれているし、Javaも悪くない言語な気がするんだよな。

まあ何でもいいが。

ロジカルに考えているようで結局なところ雰囲気的なところに左右されているエンジニア多い気がする。

まあわいも、人気な言語に乗っておいて高単価を得られたほうがいいのでそうするが。今の所Goが肌にあっているんだよな・・。3年ぐらい使って熟練度上がってきたし、さほど悩まずにコーディングすることができる。

PHPの人が好きな、あるいはRubyのmethod_missingなど活かしたテクコードは、書いているやつは気持ちいかもしれないがわいは明示的にinterfaceがわかるコードが書かれていたほうが好きだ。型で振る舞いがわかったり制御されていないと分かりづらくない?複数プロジェクトを掛け持ちするから、読むときに前提知識が少なく読めるコードがいい。

まあJavaもリフレクションでテクいことができる気がするな。

Goがいい。誰が書いてもだいたい同じコードになるから、誰かに作業を振ったとしてもレビューやすい。

まあこれからJavaを書く気はしないが、GoAPI書いているマンから見ると、JAX-RSとかでゴリゴリAPI書いていくの全然悪くないんじゃないかと思うのであった。

最悪別にGeneric入らなくてもいいかもな。別にそんなに困ってない。はいってくれるなら、はいってくれたほうがいいが。sliceに対してmap, each, filter, existsなどのメソッドが生えることになるイメージかな。まあそれは欲しくなるけどな・・・

Scalaもいいんだが、たまにイキったコードを書くと分かりづらくなる時がある。イケてるコードを書こうと思ったとき結構パワーを使う言語だ。なんかモナドってジェネリックを更に強くしたやつだとも捉えられるような気がするな。ゴリゴリ関数型で書こうと思った場合プロジェクト全体に影響がある話なのでアーキテクチャ設計に力がいる気がする。

年をとると大事にするポイントが変わってくるな。昔はスーパープログラマになりたくて関数型言語とかやっていたが、今はいかに効率よく仕事をする=金を稼ぎ自由を得るかを重視している。職業プログラマとなったわけだ。仕様固めたりリリースしたり不具合対応したり運用したり、フリーランスなら税金計算したり、金儲けの方法考えたり忙しいんじゃ。今は結局スーパープログラマとは何か悩ましいよ。「プログラマとして」キチガイレベルにすごい人間というのはまだ見たことがないかもしれない。コーディングが早い?バグ修正が早い?パフォーマンスやばいコードを書ける?設計が優れている?

わいのレベルが低くて、高い人間凄さに気づけていないのかもしれないな。

2019-02-03

anond:20190203182834

OOPが古いってのは分かるけど

POPは単なるfinal classinterfaceなのでいつものApple信者ウリジナルかぁ~と思ったわ

2018-09-22

継承実装するくらいならinterface実装しろかいうやついるけど

マジで言ってるのかかなり怪しい。

基底クラスのメンバを隠すために継承があるのにinterfaceでやれとかアホの所業に思うんだが。

派生クラスに基底クラス変数いじらせるとどうなるかとか知らんで言ってるわけでもなかろう。

おまえモグリなんじゃねえか?

2018-04-17

Quick Tutorial for Pyramidをやってみる

PyramidPython向けWebフレームワーク

Quick Tutorial for Pyramid公式チュートリアル

https://docs.pylonsproject.org/projects/pyramid/en/latest/quick_tutorial/index.html

Prelude: Quick Project Startup with Cookiecutters

$ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout 1.9-branch

として、プロンプトの問いに答えるとサンプル的なアプリができる。

ghはgithubか。

引数指定できるテンプレートhttps://github.com/Pylons?q=pyramid-cookiecutter

sqlalchemyを使うものは分かるけど、zodbって何?

アプリは以下のようにして起動する。

$ env/bin/pserve development.ini --reload

このpserveというPythonモジュールアプリ動かしたりする。

01: Single-File Web Applications

超単純なPyramidアプリを作って、WSGIイメージをつかむ。

app.py を書き写して動かしたらHello Worldが動いた。

Analysisの項:
2. Lines 12-14. Use Pyramid's configurator in a context manager to connect view code to a particular URL route.

viewURLの紐付けはconfig.add_routeしてconfig.add_viewする。add_viewしてからadd_routeしても大丈夫だった。

3. Lines 6-8. Implement the view code that generates the response.

viewにはrequestが渡される。requestに色々入ってそう。

4. Lines 15-17. Publish a WSGI app using an HTTP server.

waitressは知らないけど、serveでHTTPサーバ作ってWSGIアプリを公開できるのかな?

Extra creditの項:
1. Why do we do this:
print('Incoming request')

...instead of:

print 'Incoming request'

Python3だから

2. What happens if you return a string of HTML? A sequence of integers?

Inernal Server Errorになった。アプリのほうではValueErrorresponseを返すようにと怒られていた。text/plainとか返すには何かしないとダメっぽい。

3. Put something invalid, such as print xyz, in the view function. Kill your python app.py with ctrl-C and restart, then reload your browser. See the exception in the console?

print(xyz)してみろ、ということかな。1と同じくInernal Server Errorになって、コンソールにはNameErrorが出た。

4. The GI in WSGI stands for "Gateway Interface". What web standard is this modelled after?

CGIかな?

2018-01-25

Go言語の素晴らしさは何よりも標準でたくさんのinterface定義されていることにあるんじゃないか最近感じている

2017-06-06

ジェネリック医薬品.java

interface 頭痛薬 {}

class バファリン implements 頭痛薬 {}

class バッサニン implements 頭痛薬 {}

class 薬瓶<T> { /* 中略 */ }

public class Test {

  public static void main(String[] args) {

    薬瓶 頭痛薬入れ = new 薬瓶<頭痛薬>();

    頭痛薬入れ.add(new バファリン());

    頭痛薬入れ.add(new バッサニン()); // バファリンとバッサニンは成分が同じなので、同じ薬瓶に入れて混ぜて服用しても問題ない

    System.out.println(頭痛薬入れ.size()); // 2

  }

}

2016-07-10

memo

書籍より

Web + DB vol.92

データ分析の基本アーキテクチャ
フレームワーク比較評価

10年戦えるデータ分析入門

SQL中心アーキテクチャの3つの
SQL中心アーキテクチャの3つの条件
tips
  • DWH層を標準ライブラリのように考えて構築するとよい.
    • 「購入の可能性があるユーザ一覧を表すビュー」をDWH層に持たせるなど.

2016-04-22

プログラミング。好きだけど、さようなら

追記(2015 5/20)

洋食屋ジョブチェンジを果たしました。

---

1年の間、プログラマとして働いていたが、続けていくことが無理だと思い、さようならする話。

プログラマになる前は、コーヒー屋で働いていた。しかし、色々とあり辞め、職業訓練校に通ってプログラミング(php)を学び、60人ほどのソフトウェア開発会社就職した。

会社に入ると、まずC#研修があった。研修と言っても、C#で内製ツールを独りで作るという研修だった。この研修中に「あれ、オレ、プログラム書けねー」と思ったりしたが、研修は終えることができたし、社内の人にも「なかなか良く出来ている」と言ってもらえ、大丈夫だろうと思っていた。

研修が終わり、C#の社内で実際に使われているツールに、機能をいくつか追加する仕事を振られた。前任者にどんな設計になっているのか大雑把に聞き、なんとなくイメージができ、コードを読み始めたのだが、これが全く意味不明で、何のために有るかがわからないクラスが大量にあった。名詞王国だと思った。前任者に、何故このクラスは、この単位で分割されているのか聞くと、「単一責任原則だよ」とか「hogeパターン使うと、後から機能追加しやすいじゃん」というような回答をもらった。納得は出来なかったが、プルリクも承認されて、このツールデプロイされていたので、社内的にも、このコードは、クソコードと言われる物では無いはずだと思ったので、自分プログラムを書き続けていれば、こんな感じの設計に慣れてくるんだろうと思った。モヤモヤは残っていたものの、仕事はしなければいけないので、前任者のコードに習うように、クラスを追加したりして、機能を追加した。プルリクを出すと、設計には何も言われずに、タイポや、テストコードを注意されただけだった。指摘された点を修正すると承認された。振られた仕事は完遂した。が、結局最後まで、モヤモヤは消えなかった。むしろモヤモヤモヤモヤになった。

次に振られた仕事は、内製ツール設計から自分で行い作成する仕事だった。言語Goだった。Goで書いてと言われた時は、以前から自分モヤモヤオブジェクト指向のせいで、モヤモヤしているんじゃないかとも思っていたので、喜んで!という感じであった。が、Goを触ってみると、結局、Go継承の無いオブジェクト指向言語やないかと思った。Goの標準ライブラリinterface名もHogerみたいな感じに接尾辞に-erを持ってくることが慣習らしく、この命名だと、interfaceを満たす構造自身が-erになるので、正にオブジェクトだなぁと思った。巷での「Goオブジェクト指向ではない」というのに期待していたのだが、自分にとっては、とてもオブジェクトしていました。

Goに対する印象は良くなくなったが、ツール設計をしないといけなかったので、Go構造体をC#クラス見立て、前回の前任者のコードのように、単一責任も持つ構造体に(無駄に)分けて、プログラムを書いて、プルリクを出した。自分でクソなコードだと思いながら。だけれどもレビューでは、「errorのチェック忘れ」「標準ライブラリにこの機能ある」「こんな風に書ける」といった感じだった。こんなコードで良いんかよと思ったが、良いらしい。ワケワカメだった。

ここらで、プログラムを書く仕事は、無理だと悟った。現実世界は、自分自然だと思う方法と違う方法で、プログラミングをすることを強要してくる。

ちなみに、仕事ではC#Goを書いていましたが、オブジェクト指向と仲良くなるためにSqueak(Smalltalk)で、オレオレ言語作ってみたりもしましたが、何が嬉しくて、オブジェクト同士のメッセージパッシングプログラムを作るのかわかりませんでした。

Lisp語族言語も触りました。

Clojureは、気持ち良くプログラムを書いていても、Javaが顔を出すところでフラストレーションが溜まってしまって、つらくなりました。

Common Lispは、自分が触った言語の中でも、秀でて良いと思いました。プログラマを辞めても、プログラム書く必要に迫られたらCommon Lispで書こうと思うくらいにです。Land of Lisp楽しいです。あと、CLOS総称関数の考え方が大好きです。

最後に、この投稿は、一種の決別の表明です。いつまでも自分に向いていなかったことに、時間を掛けてしまっている自分との決別です。

最後まで読んでいただきありがとうございました。

自分共感をもった参考リンク

2016-01-02

http://anond.hatelabo.jp/20160101212842

内藤泰弘

  掲載誌休刊になったか出版社が潰れたかなんかで、第一部・第二部みたいな感じになってる。アニメにもなった。

  ネタバレしない範囲で書くと心優しきガンマンの話(もっと書き方あるだろうに)

士郎正宗

  1.5がでたことによってシリーズとして完結といっていいかが少し疑問だけれど基本的に1巻完結ということで。

  近未来を描くSF作品の潮流を変えたと思う。漫画映画押井)→マトリックスの流れは有名か?映画という意味では押井守作品の影響が大きいのかもしれないけど。

  凍結してるので未完ではあるが、アップルシード面白い

木城ゆきと

  銃夢火星戦記が連載中のため、シリーズとしては未完ではあるものの、上記2つで完結してるのでそれはそれでよいかと。

  サイボーグ女の子?が管理社会武力で挑む話(大嘘) 脳みそプリンが美味しい(๑´ڡ`๑)

大友克洋

  さんをつけろよデコ助野郎、2020年東京オリンピック

  団地で起きた殺人事件犯人超能力者

漆原友紀

  鎖国を続けた江戸時代というか、江戸明治あいなかというかちょっと昔の日本っぽいどこかが舞台

  この世はヒト知れぬ生命に溢れている。妖怪の話みたいだけれどそうじゃない。怪異譚集的な何か。

幸村誠

  おそらく元増田の好みとは違うかもだけれど、おすすめ宇宙旅行が当たり前になりはじめた未来の話。1巻2巻以降で哲学的思想が入るので少し雰囲気変わる。

宮本 百合
  • 刻々

  時間を止められる一家が事件に巻き込まれる。伏線多数。

岩明均

  高校生少年の右腕に宇宙から生命体が寄生しました。生命体には意志も知能もあるので少年自分で発散することもできません。

鬼頭莫宏

  ホント胸糞悪くなるいい作品です。

浦沢直樹

  SFじゃないかも

ゆうきまさみ

  みんなで幸せになろうよ

2015-07-15

岩田聡任天堂社長訃報に接して(編集長) | インサイド

http://www.inside-games.jp/article/2015/07/13/89386.html

2ページ目の

Game Developers Conference 2005、岩田聡基調講演

からビジネスソフトウェア面の要点を抜粋

▼5個の変わらない点

(1)エンターテイメントとしての本質

他の娯楽と同様に、成功するためには人々を感動させるものでなくてはなりません。

笑い、恐怖、喜び、怒り、愛情、驚き、そして特に達成感

(2)挑戦と対価

コアゲーマーは困難を望み、カジュアルゲーマーは易しめの難しさを望みます

任天堂では、全てのスキルにあわせたゲームを作るのが責任だと信じています

(3)アイデア重要

(4)ソフトハードを売ります

ゲームを遊ぶ為にハードを買います

私はスティーブ・ジョブスのこの言葉同意しま

ソフトウェアユーザー体験であり、ソフトウェアコンピューター技術進歩させるだけでなく、

コンシューマーエレクトロニクス進化させる」

(5)IP(知的財産)の価値

▼変わった点

(1)ビジネスが拡大

(2)ゲーム自身も色々な面で大きくなりました

技術

より大きなチーム、より大きな予算、より困難な挑戦

大きな会社が小さな会社を飲み込むことにもなりました

(3)許容できるリスクの面で小さくなりました

ジャンルリスト最後に新しい発明掲載されたのはいつのことでしょうか?

同じジャンルの中でも一度使ったもの再利用し続けています

多様性は見つけるのが困難

(4)何を「進歩」と定義する範囲も小さくしています

ゲームの見栄えをもっとリアルにするだけがゲーム体験を改善していく手段ではありません

それだけがゲーム改善する道ではない

私達は他の手段も見つけることを望まれています。「改善」の定義は1つではありません。

(5)多くの時間お金を同じプレイヤーに追い求めて、誰かを置き去りにはしてないでしょうか?

自分では遊ばないだろうゲームについて考えていますか?

ソフト開発のスタンダード

4つの「I」で呼んでいます

(1)真に「Innovative(革新的)」であること

(2)操作ゲームプレイ方向性が「Intuitive(直感的)」であること

(3)この世界時間を費やす気になる「Inviting(誘惑的)」なものであること

(4)プレイヤーが今までにない方法でその世界に触れられる「Interface(インターフェイス)」があること

2014-12-08

「既定のインターフェイスは COM 参照可能ではありません」

warning : タイプ ライブラリ エクスポータで '%1' を処理中に警告が出されました。警告: 既定のインターフェイスは COM 参照可能ではありません。」

たぶん、Visual StudioでCOMコンポーネントを開発している諸君であろう。

interface が public になっていないので、公開できず参照可能でないということだ。public interface ... と宣言すれば警告は消える。

2014-06-09

Half-duplex loopback detected, collision threshold exceeded on xxxxxx

http://netserc.blog63.fc2.com/blog-entry-170.html

上記より。

これが起こった場合はとりあえず10Mの古いハブのせいっと・・・

覚えておこう。

日付、時間: %PM-4-ERR_DISABLE: loopback error detected on Fa0/21, putting Fa0/21 in err-disable state

日付、時間: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/21, changed state to down

日付、時間: %LINK-3-UPDOWN: Interface FastEthernet0/21, changed state to down

あと、ココも見た。

http://www.cisco.com/cisco/web/support/JP/100/1008/1008405_errdisable_recovery-j.html

2014-01-17

http://anond.hatelabo.jp/20140117111737

守備力だとか、耐性だとかは、モンスター属性なので、影響はモンスター側で面倒見てもらいたいから

攻撃でHPを減らすのは、モンスターメソッド経由になると思う。

結局、

class 勇者 :
  method attack(モンスター: monster):
      monster.attackedBy(self.attackPower)

みたいなコードになると思うんだけど。

ぐうの音もでません、その通りですね。

攻撃方法の実装もわかりました。

遅延攻撃や即死攻撃に対応したい場合、例えば次のように変更すればよいでしょうか。

interface 攻撃方法:
    /** 対称を攻撃 */
    method apply(攻撃対象: atackee);

それで、その他のクラスは下記のような感じに。

class 勇者 :
  // 中略
  method attack(モンスター: monster):
      self.currentAttackMethod.apply(monster)

class 即死攻撃 : implements 攻撃方法
  method apply(攻撃対象: atackee):
      atackee.kill

class 通常攻撃 : implements 攻撃方法
  // 中略
  method apply(攻撃対象: atackee):
      atackee.attackedBy(self.getAttackPower)

小一時間考えてみましたが、通常攻撃は

new 通常攻撃(player)

より

new 通常攻撃(player.getAttackPower)

の方が良いかもしれませんね。攻撃が放たれたら、その攻撃を誰が行ったか関係なくなる、とした方が情報の流れがすっきりすると思います

攻撃者 → 攻撃方法(突撃・斬撃・ジャンプ即死攻撃) → 攻撃対象

http://anond.hatelabo.jp/20140117045337

わかりやすさについてとやかく言わないけどさ、攻撃するってことは、モンスターHPだとかが減るんだよね?

勇者.attack(モンスター)

って書いたとしてもさ、勇者.attackメソッドの中で、モンスターHPを直接書き換えるわけじゃないでしょ?

直接書き換えてたら、モンスターに守備力だとか、耐性追加した時に、勇者側を書き換えないといけなくなる。

守備力だとか、耐性だとかは、モンスター属性なので、影響はモンスター側で面倒見てもらいたいから

攻撃でHPを減らすのは、モンスターメソッド経由になると思う。

結局、

class 勇者 :
  method attack(モンスター: monster):
      monster.attackedBy(self.attackPower)

みたいなコードになると思うんだけど。


攻撃方法型は、具体的にはどんなメソッドフィールドが並ぶのか

攻撃方法に共通のメソッドが、インターフェイスになる。

例えば、攻撃力取得メソッド

interface 攻撃方法:
    /** 攻撃力取得 */
    method getAttackPower();


フィールドは、攻撃方法によって違うかもしれないが、攻撃者を持っとけば汎用的かな。

/** 通常攻撃は力=攻撃力 */
class 通常攻撃 implements 攻撃方法:

    field _attacker

    constructor(攻撃者: attacker):
        self._attacker = attacker

    method getAttackPower():
        return self._attacker.strength
/** 突撃は力*すばやさ=攻撃力 */
class 突撃 implements 攻撃方法:
    
    field _attacker

    constructor(攻撃者: attacker):
        self._attacker = attacker

    method getAttackPower():
        return self._attacker.strength * self._attacker.agility

そうすると、攻撃方法が違っても、モンスターのattackedByメソッドの処理は共通

class モンスター:
    method attackedBy(攻撃方法: attackMethod):
        self._hp = self._hp - attackMethod.getAttackPower()
monster.attackedBy(new 通常攻撃(player));
monster.attackedBy(new 突撃(player));

利点は、攻撃方法が増えた時に、攻撃方法型を実装したクラス定義すればよくて、

勇者モンスターも書き換える必要がないことだよ。

2014-01-07

いぬいをNUINUIしたい。

つっついたり、つまんだり、つかんだり。

いぬいは、ゲーム艦これに出てくる氷雪型人格女の子のことで、

NUIとはNatual User Interfaceの略、"自然な"操作コミュニケートを指す言葉

キネクトとか、リープモーションとか、そんなの。

まぁ、つまり、ぬいぬいをNUINUIしたいとはそういうこと。男の夢。

今朝、CES2014という技術カンファレンス

インテルがRealSenseを発表したという記事を読んで

久々に目にしたNUIという説明に、

冒頭の言葉を思いついてしまった。

世界の誰もが寒いと思おうが、自己満足を満たすおっさんの思いつきは

最高の燃料だ。指先を動かすだけの傍らで、脳裏では様々な探索隊が

私の持つあらゆる知識に可能性を探しに出かけてる。

OpenCV勉強会で学んだ画像処理技術

派手だけど安価ゴム手袋一つで指先の認識精度を上げた記事。

エロゲで連動型大人の玩具を使用した痛い経験

いぬいをNUINUIしたい。

あらゆるところへ妄想は飛びし、

Tumblrキーボードを叩くより早く忘れていく。

そして、定時。何故か私の仕事は終わっており、

何ともいえない幸福感とぬいぬいをNUINUIしたいという

フレーズけが手元に残った。

2011-12-29

Portable electronic equipment battery technology

1, about the trickle charge, rapid charging and stable battery charging algorithm

According to the energy requirements of the final application, a battery may contain up to 4 lithium ion or lithium polymer battery core, its configuration will have a variety of change, at the same time with a mainstream power adapter: direct adapter, USB interface or car charger. Remove the core quantity, core configuration or power adapter type difference, the battery has the same charge characteristics. So they charge algorithm. Lithium ion and li-ion polymer battery best charging algorithm can divided into three phases: trickle charge, rapid charging and stable charge.

trickle charge. For depth discharge core to charge. When core voltage in less than about 2.8 V, use a constant 0.1 C of the current charging for it.

fast charging. Core voltage trickle charge more than the threshold, improve the charging current rapid charging. Fast charging current should be lower than 1.0 C.

stable voltage. In the fast charging process, once the core 4.2 V voltage, stable voltage phase began. This is through the minimum charge current or timer or of the two joint to interrupt charge. When the minimum current below about 0.07 C, can interrupt charge. The timer is to rely on a default to trigger the timer interrupt.

Advanced battery charger with additional security function normally. For example, if the core temperature exceeds the given window, usually 0 ℃-45 ℃, charge will be suspended.

Remove some very low-end equipment, now on the market/li-ion polymer lithium ion battery solutions are integrated with the outer components or, in accordance with the characteristics of the charging to charge, this is not just to get better effect charge, but also for safety.

lithium ion/polymer battery charge is an example of applications-double input 1.2 A lithium battery charger LTC4097

LTC4097 can be used to exchange adapter or USB power supply for single quarter/polymer lithium ion battery. Figure 1 for double input 1.2 A lithium battery charger LTC4097 schemes. It USES constant current/constant voltage algorithm charging, from exchange adapter power charge, programmable filling up to 1.2 electric current A, and with USB power can be as high as 1 A, at the same time, automatic detection in each input voltage whether there. This device also provide USB the current limit. Applications include PDA, MP3 players, digital camera, light portable medical and test equipment and big color cellular phone. The performance characteristics: no external micro controller charging termination; The input power automatic detection and choice; Through the resistance from the exchange of charging adapter input can be as high as 1.2 A programming charge current; The resistance of programmable USB charging current is up to 1 A; 100% or 20% USB charging current set; The input power output and existing bias NTC (VNTC) pin as a 120 mA drive ability; NTC thermistors input (NTC) pin for temperature qualified charged; Pre-settings battery voltage with floating plus or minus 0.6% accuracy; Thermal regulation maximize charge rate and free hot air LTC4097 can be used to exchange adapter or USB power supply for single quarter/polymer lithium ion battery. The use of constant current/constant voltage algorithm charging, from exchange adapter power charge, programmable filling up to 1.2 electric current A, and with USB power can be as high as 1 A, at the same time, automatic detection in each input voltage whether there. This device also provide USB the current limit. Applications include PDA, MP3 players, digital camera, light portable medical and test equipment and big color cellular phone.

2, lithium ion/polymer battery scheme

Lithium ion/polymer battery charge scheme for different number of core, core configuration, and power types are different. At present mainly have three main charging scheme: linear, Buck (step-down) switch and SEPIC (booster and step-down) switch.

2.1 linear scheme

When the input voltage in big with the charger with sufficient clearance of core after opening voltage, it is linear scheme, especially 1.0 C fast charging current than 1 A big too much. For example, MP3 players usually only one core, capacity from 700 to 1500 mAh differ, full charge voltage is open 4.2 V. MP3 player power is usually the AC/DC adapter or USB interface, the output is the rule of 5 V; At this time, the linear scheme is the most simple, most charger of the efficiency of the scheme. Figure 2 shows for lithium ion/polymer battery solution linear scheme, basic structure and linear voltage neat device.

linear scheme charger application examples-double input Li + charger and intelligent power source selector MAX8677A

MAX8677A is double input USB/AC adapter linear charger, built-in Smart Power Selector, used for rechargeable single quarter by Li + batteries portable devices. The charger integration of the battery and the external power source and load switch charging all the power switch, so that no external MOSFET. MAX8677A ideal used in portable devices, such as smart phones, PDA, portable media players, GPS navigation equipment, digital camera, and digital cameras.

MAX8677A can work in independent USB and the power input AC adapter or two input either one of the input. When connecting external power supply, intelligent power source selector allows the system not connect battery or can and depth discharge battery connection. Intelligent power source selector will automatically switch to the battery system load, use the system did not use the input power supply parts for battery, make full use of limited USB and adapter power supply input. All the needed electric current detection circuit, including the integration of the power switch, all integration in the piece. DC input current highest limit can be adjusted to 2 A and DC and USB input all can support 100 mA, 500 mA, and USB hung mode. Charge current can be adjusted to as high as 1.5 A, thus support wide range of battery capacitive. Other features include MAX8677A thermal regulation, over-voltage protection, charging status and fault output, power supply good surveillance, battery thermistors surveillance, and charging timer. MAX8677A using save a space, hot enhanced, 4 mm x 4 mm, 24 of the pins TQFN encapsulation, regulations, work in exceptional temperature range (40 ~ + 85 ℃).

2.2 Buck (step-down) switch scheme

When A 1.0 C of the charging current more than 1 A, or the input voltage of the core than with high voltage open many, Buck or step-down plan is A better choice. For example, based on the hard drive in the PMP, often use single core lithium ion battery, the full of open is 4.2 V voltage, capacity from 1200 to 2400 mAh range. And now PMP is usually use the car kit to charge, its output voltage in a 9 V to 16 between V. In the input voltage and battery voltage is the voltage difference between high (minimum 4.8 V) will make linear scheme lowers efficiency. This kind of low efficiency, plus more than 1.2 A 1 C fast charging electric current, have serious heat dissipation problems. To avoid this kind of situation, will the Buck scheme. Figure 3 for lithium ion/polymer battery charger scheme Buck diagram, basic structure with Buck (step-down) switching voltage regulators completely the same.

2.3 SEPIC (booster and step-down) switch scheme

In some use of three or four lithium ion/polymer core series equipments, charger of the input voltage is not always greater than the battery voltage. For example, laptop computers use 3 core lithium ion battery, full charge voltage is open 12.6 V (4.2 V x3), capacity is 1800 mAh to 3600 mAh from. Power supply input or output voltage is 1 6 V AC/DC adapter, or is car kit, the output voltage in a 9 V to 16 between V. Apparently, the linear and Buck solutions are not for this group of batteries. This is about to use SEPIC scheme, it can in the output voltage is higher than when the battery voltage, can be in the output voltage less than when the battery.

3, and power detection algorithm is proposed

Many portable products use voltage measurements to estimate the remaining battery power, but the battery voltage and surplus power relationship but will with the discharge rate, temperature and battery aging degree of change, make this kind of method can top 50% margin of error. The market for longer to use product demand unceasingly strengthens, so the system design personnel need more accurate solution. Use capacity check plan come to measure battery or consumption of electricity, will be in a wide range of application power to provide more accurate estimate of the battery power.

3.1 power detection algorithm is one of the examples of application, function complete list, double the battery portable battery application design

power detection principle. Good capacity check plan at least to have battery voltage, temperature and battery electric current, measuring method; A micro 9 a; And a set of and the verification of the punishment power detection algorithm is proposed. Bq2650x and bq27x00 is full capacity check program function, with a measuring voltage and temperature of the digital converter (ADC) and a measuring electric current and charging sensor the asp. These capacity check plan also has a microprocessor, is responsible for the implementation of the Texas instruments power detection algorithm is proposed. The algorithm can compensate the lithium ion battery life.low self-discharge, aging, the temperature and discharge rate, and other factors. Chip embedded microprocessor as host system processor save these calculation burden. Capacity check program can provide remaining power state information, bq27x00 series products also offer surplus can Run Time (Run Time to Empty) host may at any Time to capacity check plan these information query, then LED indicator light through or displays will inform the user battery. Capacity check meter is very easy to use, the system processor need only configuration 12 C or HDQ communication drive can.

The battery circuit description. Figure 4 (a) can be used for identification of IC functions with typical application circuit batteries. According to the use of IC testing program is different, the battery needs to have at least three to four outside the terminal.

VCC and BAT pins will even to the battery voltage, so that for, C power and the battery voltage measurement. The battery is connected a grounding resistance smaller detection resistors, let capacity check meter high impedance SRP and SRN input can monitor sensor resistance on both ends of the voltage. Through testing the current flows through a resistor can be used to judge the battery or release the amount of electricity. Designers choose detection resistance value must be considered when resistance on both ends of the voltage can't more than 100 mV, low resistance may be more hours in current errors. Circuit board layout must ensure that SRP and SRN to testing from as close as possible to the connection of the resistor sensor resistance end; In other words, they should be the Kelvin attachment.

HDQ pin need external and resistors, this resistance should be located the host or the main application, such capacity check plan to the battery and portable devices when sleep function enable connection broken. Advice and resistance choose 10 k Ω.

battery identification. A low cost WeiMao batteries are getting more and more serious, these cells may not contain OEM requirements of security protection circuit. So, genuine battery may contain figure 4 (a) shows the appraisal circuit. When to identify the battery, the host to contain IC (bq26150, the function is cyclic redundancy check (CRC)) issued the battery packs a ask value (challenge), the CRC will contain battery according to this inquiry value and, in the building of the IC in CRC polynomial calculation the CRC value. CRC is based on the host of command and IC secret in the query of the definition of the CRC polynomial completed, the host in CRC values calculated with the calculation result of well battery comparison to identify the appraisal success.

Once the battery through the appraisal, bq26150 will issue commands to ensure that the host and quantity test plan of material lines between normal communication. When the battery connection interruption or to connect, the whole the identification process will be repeated again.

double the battery application. Figure 4 (b) for use bq26500 support double the typical application of lithium ion battery circuit. In order to support more battery, and this circuit is adding a adjustable regulators. Capacity check millions of BAT pin and the bottom of a battery anode linked to complete the variable voltage measurement of the battery.

Host to be able to read capacity check plan of variable voltage measurement battery, to make sure the end of discharging threshold and charging terminate threshold. As for the remaining state power (RemainingStateofCapacity), do not need to read can use directly.

The above bq2650x and bq27x00 etc capacity check plan provides the battery manufacturer a simple to use options, this scheme L [just measuring battery voltage to be precise, so these capacity check plan can be applied to various battery framework, and can support the battery identification and double the battery application '

3.2 power detection algorithm is an example of applications another, can apply to all kinds of general voltmeter new IC.

Today's many manufacturers can provide a variety of voltmeter IC,, the user can choose the suitable function device, to optimize the product price. Use voltmeter measurement of storage battery parameters, the separate architecture allows users in the host custom power measurement algorithm within. Eliminating embedded processor battery cost. On this to Dallase semicconductor company called cases of DS2762 chip for typical analysis. A new separate voltmeter IC, its structure see chart 5 (a) below.

DS2762 application characteristics

DS2762 is a single quarter of lithium battery voltmeter and protection circuit, integrated into a tiny 2.46 mm x 2.74 mm inversion of packaging. Due to internal integration for power detection of high precise resistance, this device is very save a space. It is the small size and incomparable high level of integration, for mobile phone battery and other similar handheld products, such as PDA, etc, are all very ideal. Integrated protection circuit continuously monitoring the battery voltage, over voltage and flow fault (charging or discharge period). Different from the independent protection IC, DS2762 allow main processor surveillance/control protection FET conduction state, such, can DS2762 through the protection of the power system and the control circuit implementation. DS2762 can also charge a battery consumption has depth, when the battery voltage within three V, provide a limit of the charging current recovery path.

DS2762 accurate monitoring battery current, voltage and temperature, the dynamic range and resolution of common satisfy any mobile communication product testing standards. The measurement of current for internally generated when the integral, realize the power measurement. Through the real-time, continuous automatic disorders correct, the precision of power measurement can be increased. The built-in measuring resistance due to eliminate manufacturing process and temperature and cause resistance change, further improve the precision of the voltmeter. Important data stored in 32 bytes, can add the lock EEPROM; 16 bytes of SRAM are used to keep dynamic data. And DS2762 all communication all through the 1-Wire, more communication interface node, minimize the battery and the connection to the host. Its main features for; Single quarter of lithium battery protector; High precision current (power measurement), voltage and temperature measurement; Optional integrated 25 m Ω measuring resistance, each DS2762 after fine-tuning alone; 0 V battery restore charge; 32 bytes can lock EEPROM, 16 bytes SRAM, 64 a ROM;

1-Wire, node, digital communication interface; Support more battery power management, and through the protection system control FET power; Dormancy mode power supply current only 2 µ A (most); Work mode power supply current for 90 µ A (most); 2.46 mm x 2.74 mm inversion of packaging or 16 feet SSOP package led, and both are can choose with or without detection resistance; After has with e

2010-04-24

test

ルータメーカーサイトファームウェアを最新バージョンにするか、自動チューニング機能の設定を変更(無効にするなど)してみるといいかもしれません。

ルーターファームウェアアップデートする方法は、説明書なりメーカーのサイトなりに書いてあるでしょうからそちらを見てもらうとして、自動チューニング機能の設定を変更する方法ですが、

http://ascii.jp/elem/000/000/106/106192/

スタートメニューから「すべてのプログラム」→「アクセサリ」→「コマンドプロンプト」を右クリックし、「管理者として実行」を選択する。 続いて、「netsh interface tcp set global autotuninglevel=disabled」と入力すればいい。元に戻す場合は「netsh interface tcp set global autotuninglevel=normal」と入力する。

http://journal.mycom.co.jp/articles/2010/01/20/w7/index.html

受信ウィンドウ自動チューニングレベルを調整するには、「netsh interface tcp set global autotuninglevel={設定値}」と実行します。設定可能な値は下記のとおり。

「autotuninglevel」の設定値

disabled:自動最適化を無効にします

highlyrestricted:既定値より受信ウィンドウ保守的に拡大します

restricted:既定値より受信ウィンドウを制限的に拡大します

normal:既定値に戻します

experimental:実験的なシチュエーションで使用します

通常は「restricted」もしくは「highlyrestricted」を選び、先のコマンドを実行しますが、どちらがベストなのか、もしくは自動最適化を無効にした方が速くなるのかと、どの設定値を選ぶべきかは環境によって異なります(図15)。

これでも駄目な場合、もしかすると下記リンクが参考になるかもしれません。

http://questionbox.jp.msn.com/qa5697109.html

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