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 characters
| defmodule Thinker.Controllers.Projects do | |
| use Phoenix.Controller | |
| use Jazz | |
| alias Thinker.Models.Project, as: Project | |
| alias Thinker.Repo, as: Repo | |
| import Ecto.Query | |
| def index(conn, _params) do | |
| query = from p in Project, select: p | |
| projects = Repo.all(query) |
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 characters
| (FunctionClauseError) no function clause matching in Jazz.Encoder.Any.to_json/2 | |
| Stacktrace | |
| lib/jazz/encoder.ex:115: Jazz.Encoder.Any.to_json({Ecto.Associations.HasMany.Proxy, #Ecto.Associations.HasMany<[name: :issues, target: Thinker.Models.Project, associated: Thinker.Models.Issue, references: :id, foreign_key: :project_id]>}, []) | |
| lib/jazz/encoder.ex:12: Jazz.Encode.it/2 | |
| lib/jazz.ex:18: Jazz.encode!/2 | |
| lib/jazz/encoder.ex:107: anonymous fn/2 in Jazz.Encoder.Map.encode/3 | |
| (elixir) lib/enum.ex:966: anonymous fn/3 in Enum.map/2 | |
| (elixir) lib/enum.ex:2235: Enumerable.Map.do_reduce/3 |
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 characters
| [%Thinker.Models.Project{created_at: %Ecto.DateTime{day: 19, hour: 10, | |
| min: 23, month: 10, sec: 54, year: 2004}, id: 1, | |
| issues: {Ecto.Associations.HasMany.Proxy, | |
| #Ecto.Associations.HasMany<[name: :issues, | |
| target: Thinker.Models.Project, associated: Thinker.Models.Issue, | |
| references: :id, foreign_key: :project_id]>}, name: "projects 1"}, | |
| %Thinker.Models.Project{created_at: %Ecto.DateTime{day: 19, hour: 10, | |
| min: 23, month: 10, sec: 52, year: 2004}, id: 2, | |
| issues: {Ecto.Associations.HasMany.Proxy, | |
| #Ecto.Associations.HasMany<[name: :issues, |
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 characters
| def anagrams(file \\ "/usr/share/dict/words") do | |
| File.stream!(file) | |
| |> Enum.map(&String.strip/1) | |
| |> Enum.reduce(%{}, fn word, words -> | |
| Map.update(words, Enum.sort(String.graphemes(word)), | |
| [word], &[word | &1]) | |
| end) | |
| |> Enum.map(&elem(&1, 1)) | |
| |> Enum.slice 1..20 | |
| end |
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 characters
| <?php | |
| // Error Reporting | |
| //ini_set('display_errors', 'On'); | |
| //error_reporting(E_ALL) . "<br />"; | |
| $os = strtolower(PHP_OS); | |
| if(strpos($os, "win") === false) ini_set('include_path',ini_get('include_path').':include:../include'); | |
| else ini_set('include_path',ini_get('include_path').';include;..\include'); | |
| require_once('AastraCommon.php'); |
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 characters
| defmodule Bond.DataTest do | |
| use ExUnit.Case, async: true | |
| @quotes_fixture_path "test/fixtures/quotes.json" | |
| setup_all do | |
| {:ok, pid} = :cberl.start_link( | |
| :bond_test, | |
| 5, | |
| "localhost:8091" |> String.to_char_list, |
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 characters
| === Entering application ose | |
| /Applications/Xcode.app/Contents/Developer/usr/bin/make RELEASE_PATH="/Users/johnny/.erlenv/releases/17.0/lib/erlang" release_spec | |
| /usr/bin/install -c -d "/Users/johnny/.erlenv/releases/17.0/lib/erlang/lib/ose-1.0/src" | |
| /usr/bin/install -c -m 644 -p ose.erl "/Users/johnny/.erlenv/releases/17.0/lib/erlang/lib/ose-1.0/src" | |
| /usr/bin/install -c -d "/Users/johnny/.erlenv/releases/17.0/lib/erlang/lib/ose-1.0/include" | |
| /usr/bin/install -c -d "/Users/johnny/.erlenv/releases/17.0/lib/erlang/lib/ose-1.0/ebin" | |
| /usr/bin/install -c -m 644 -p ../ebin/ose.beam ../ebin/ose.app ../ebin/ose.appup "/Users/johnny/.erlenv/releases/17.0/lib/erlang/lib/ose-1.0/ebin" | |
| /Applications/Xcode.app/Contents/Developer/usr/bin/make RELEASE_PATH="/Users/johnny/.erlenv/releases/17.0/lib/erlang" release_spec | |
| make[4]: Nothing to be done for `release_spec'. | |
| test -d "/Users/johnny/.erlenv/releases/17.0/lib/erlang/releases/17" || mkdir -p "/Users/johnny/.erlenv/releases/17.0/lib/erlang/releases/17" ; \ |
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 characters
| 22:18:21.890 [info] Protocol: 'inet_tcp': register/listen error: :econnrefused | |
| 1) test start/3 and stop/0 (NodeTest) | |
| test/elixir/node_test.exs:6 | |
| match (=) failed | |
| code: {:ok, _} = Node.start(:hello, :shortnames, 15000) | |
| rhs: {:error, | |
| {{:shutdown, {:failed_to_start_child, :net_kernel, {:EXIT, :nodistribution}}}, |
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 characters
| defmodule Helper do | |
| def expand_csv(path) do | |
| path | |
| |> File.stream! | |
| |> Stream.drop(1) | |
| |> Stream.map(&parse_line/1) | |
| |> Stream.flat_map(&expand_csv_row/1) | |
| |> Enum.to_list | |
| end |
OlderNewer