メモ iOS https://developer.apple.com/ios/human-interface-guidelines/overview/design-principles/ Windows https://msdn.microsoft.com/en-us/windows/uwp/usability/index Testing https://msdn.microsoft.com/en-us/windows/uwp/accessibility/accessibility-testing Google https://material.io/guidelines/ Bidirectionality https://material.io/guidelines/usability/bidirectionality.html#bidirectionality-localizationMore
Category Archives: development
[Elixir]What’s new in Ecto2.0
Elixirの開発元であるPlatformatecからEcto2.0に関するフリーペーパーが正式に公開された。 Click to access whats-new-in-ecto-2-0-1.pdf いくつかEctoの特性(Ecto is not your ORMといったこととか)が書かれていて、解決したい問題とその対策として2.0や2.1で入ったことを書いている。 1つ、気になったところをメモとして残しておく。 Ecto2.1からdynamicを使って簡易に動的にwhere句を制御することができるようになった。コードは以下。 https://github.com/elixir-ecto/ecto/blob/v2.1.1/lib/ecto/query.ex#L381 例えば、以下の場合は dynamic で指定した箇所をその引数の状態によって動的に切り替えることができる。 (http://blog.plataformatec.com.br/wp-content/uploads/2016/12/whats-new-in-ecto-2-0-1.pdf より) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode…More
[Elixir]timestamp in Ecto2.1
Ecto2.1が着々とrcとして改修されていますね。 この中で、Calendar typeの導入が書かれています。 defaultでは、従来は timestamp() などの Ecto.Scheme に設定する値には Ecto.DateTime が格納されていたのですが、ここがデフォルトで NaiveDateTime になるよう。これにより、このSchemeを使っているところは基本的に NativeDateTime でEctoから今まで Ecto.DateTime で受け取っていた時間を扱う必要がありますね。 Ecto.DateTime とかはEcto2.2で完全に削除されるそうな。 https://github.com/elixir-ecto/ecto/blob/e3077b99c24086d5b93580228b1daa6bb0ee0b5a/CHANGELOG.md#integration-with-elixir-13-calendar-types Schemeの設定としては以下になるそうですね。(ここの @timestamps_opts より。) ちなみに、これが導入PR https://github.com/elixir-ecto/ecto/commit/12d67912ddddb39ff79cb53d3098569cb427b521 ~N[] のsigilとか使われてて、個人的には Map だけで表現されるより読みやすくなった。More
[Elixir]handle_infoとreply
GenServerなんかにある handle_info/2 の使い方をど忘れしてしまったので、メモ。 自身のブログを検索すると、 [Elixir in Action]OTP/GenServerを学んで非同期/並行処理を学ぶ にすでにメモってたのですが。 以下のような簡単なコールバックを実装し、スクリプトを実行してみます。 まずはGrnServerを持つプロセスを生成します。そのあと、 call や cast で定義されていないメッセージを send してあげると、ここでは handle_info/2 に拾われて処理を行います。 少し話がそれて、非同期通信の時に何らかの処理を終えた時に通知を受け取りたい場合、そういえば以下のように reply/2 を使って処理を非同期にプロセスに投げることできるのでしたね。上に貼ったリンク先を読み直してて思い出した… handle_infoも使うと、以下の通りにも書くことができる、と。 ここの、GenServerのドキュメントにも載っているやり方です。More
Design Document Template
A memo for me https://github.com/KazuCocoa/design-document-template This may help me when I try something stuff.More
[Elixir]Registerを覗く
key-value processとしてElixir1.4に入れる予定の Register というものが公開されました。 https://github.com/elixir-lang/registry 付属のベンチマークによると、以下のように高い性能が出ていることがわかります。 the result of https://github.com/elixir-lang/registry/blob/master/bench/ MacBook Pro (Retina, 15-inch, Late 2013) OS: Mac OS 10.11.6 processor: 2.6 GHz Intel Core i7 memory: 16 GB 1600 MHz DDR3 Erlang/OTP 18 $ TASKS=8 MIX_ENV=bench mix run bench/erlang.exs {835251, :ok} $ TASKS=8 MIX_ENV=bench mix run bench/gproc.exs {732408, :ok} $ TASKS=8 MIX_ENV=bench mix run…More
learning Rx
Reactiveを再度ざっと振り返るために、以下のlearnrxをやった。 http://reactivex.io/learnrx/ map や filter 、 reduce や take など、Elixirを学んだりしていると自然と学んだものだった。 Reactive、非同期通信とか扱いやすいけれどやっぱり使いすぎるとコールバックばかりでテストコードを書くことが大味になるし、使うのは適度が良さそう。More
[iOS]Run multi simulators with FBSimulatorControl
複数のシミュレータを1つの端末/OS上で起動可能な FBSimulatorControl はご存知の方も多いかもしれません。 それを使った時のメモ。最後の方に、XCTestを実行する時のものも。 installはリポジトリを参考に。 (以下は 0.2.0 のバージョン) listを表示 2つの端末を同時起動 help 以下のPR/議論で、結果の出力フォーマットとしてJUnitなんかを選択できるようになったようです。 formatterのサポート https://github.com/facebook/FBSimulatorControl/issues/281 https://github.com/facebook/FBSimulatorControl/pull/290 また、以下の通り .xctest を対象にすると、XCTestを実行可能なようです。 という形でテストを実行できる模様。 .xctest はAWS Device Farmとかでも使えるコレですね。 http://docs.aws.amazon.com/devicefarm/latest/developerguide/test-types-ios-xctest.htmlMore
[Elixir]ets vs Agent
on-memory vs processであるets vs Agentに関して、過去に以下の議論があったのでメモ。 https://groups.google.com/forum/#!topic/elixir-lang-talk/RyhiBcD_Zvw 以下の回答は、Elixir in Actionを書かれたErlang developerの方 There are some gotchas with ETS: No garbage collection of individual rows. Memory is released when the owner process dies (and there’s no heir process). Data is copied to / from ETS table. Usually not a problem, but might be when individual rows are huge.…More
Download precompiled package and execute library with its binary
I’d like to run http_proxy without install package management for Elixir as portable aspect. So, I prepare simple shell script to help the problem. It is that downloading precompiled package and unzip it, run http_proxy with the precompiled mix. Example https://github.com/KazuCocoa/run_http_proxyMore