elixir
いやーよくわからないエラーメッセージとスタックトレースなんだけど。なんか深そうだし。 ** (exit) an exception was raised: ** (ArgumentError) argument error :erlang.++({'content-type', 'image/png'}, []) (erlcloud) src/erlcloud_s3.erl:699: :er…
っていうエラーが出る protocol String.Chars not implemented for %{"avatar_url" => "https://avatars.githubusercontent.com/u/12345?v=3"} 文字列補完(string interpolation)に、String.Charsを持っていないデータ(MapとかStruct)を渡していることに…
こういうことを学んだので↓ otiai10.hatenablog.com これを、Ecto.Migrationでやりたい defmodule MyApp.Repo.Migrations.CreateUserToken do use Ecto.Migration def change do create table(:posts) do add :user_id, references(:users, on_delete: :dele…
stackoverflow.com Ecto.Repo.__info__(:functions) [__adapter__: 0, __pool__: 0, __query_cache__: 0, __repo__: 0, all: 1, all: 2, config: 0, delete: 1, delete: 2, delete!: 1, delete!: 2, delete_all: 1, delete_all: 2, get: 2, get: 3, get!: 2,…
Ecto.Migration – Ecto v2.0.0-beta.0 execute使お... defmodule MyApp.Repo.Migrations.CreateProviderTable do use Ecto.Migration def change do create table(:providers) do add :name, :string timestamps end create unique_index(:providers, [:name…
Elixir (iex) iex(1)> (fn msg -> IO.puts msg end).("hello!") hello! :ok Go func(msg string) { fmt.Println(msg) }("hello!")
前回まで 【Elixir】バージョン管理しつつErlangとElixirをMacにインストールする - DRYな備忘録 【Elixir】the result of the expression is ignored - DRYな備忘録 【Elixir】use of operator === has no effect と言われる - DRYな備忘録 Elixirでゼロ埋…
iex(6)> String.rjust("hoge", 8, ?0) "0000hoge" zero paddingしたい対象がintegerなら、適宜、第1Integer.to_striingなど使う。 123 |> Integer.to_string |> String.rjust(8, ?0) 参考 In Elixir, how do you format numbers with string interpolation -…
問題 Elixirのコンパイラに掲題のように叱られる。 原因 「===使ってもええんやで」という意味。 解決 1..max |> Enum.each fn(n) -> - case {rem(n, 3) == 0, rem(n, 5) == 0} do + case {rem(n, 3) === 0, rem(n, 5) === 0} do {true, true} -> 雑感 たと…
問題 ElixirでFizzBuzz書いてて、掲題のように怒られる main.exs:4: warning: the result of the expression is ignored (suppress the warning by assigning the expression to the _ variable) the result of the expression is ignored (suppress the war…
just want "Hello, World"? brew install elixirで、ErlangもElixirも入ります。 参考 qiita.com Prerequisite JDK installed on your mac brew install wget Good Bye Elixir, installed via brew brewで入れたelixirは消す % brew uninstall elixir % brew…