Archive for: 𔃲月 2018’

nil の場合の値代入

2018年2月16日 Posted by PURGE

Ecto でDBから値を返す時、nilの場合がある。
この場合に、nilをreplaceしたい場合がある。その記述方法

result = %{total: nil}
total = result |> Map.get("total") || 0

この記述で、nil の場合には、0が代入される。

WindowsリモートデスクトップでCtrl+Alt+Delete

2018年2月1日 Posted by PURGE

Windowsの場合:[Ctrl] + [Alt] + [Delete]
Windowsリモートデスクトップの場合:[Ctrl] + [Alt] + [End]