Commits

OJ Reeves committed 9ff4625

Initial commit.

Comments (0)

Files changed (6)

+syntax: glob
+*.beam
Add a comment to this file

BFPG/2010-06/BFPG-2010-June-Erlang.pptx

Binary file added.

Add a comment to this file

BFPG/2011-03/BFPG-2011-March-Erlang.pptx

Binary file added.

BFPG/2011-03/echo.erl

+-module(echo).
+-compile(export_all).
+
+echo() ->
+  receive
+    done ->
+      io:format("Closing~n", []),
+      ok;
+    {Pid, Message} ->
+      io:format("Message received: ~s~n", [Message]),
+      Pid ! Message,
+      echo();
+    _ ->
+      io:format("skipping message~n", []),
+      echo()
+  end.
+

BFPG/2011-03/fizzbuzz.erl

+-module(fizzbuzz).
+-compile(export_all).
+
+run() ->
+  Fun = fun(X) ->
+      case {X rem 3, X rem 5} of
+        {0, 0} -> "FizzBuzz";
+        {0, _} -> "Fizz";
+        {_, 0} -> "Buzz";
+        _ -> X
+      end
+  end,
+  lists:map(Fun, lists:seq(1, 100)).

BFPG/2011-03/par.erl

+-module(par).
+-compile(export_all).
+
+map(F, L) ->
+  S = self(),
+  Pids = lists:map(fun(X) -> spawn(fun() -> S ! {self(), (catch F(X))} end) end, L),
+  gather(Pids).
+
+gather([P|L]) ->
+  receive
+    {P, Result} -> [Result|gather(L)]
+  end;
+gather([]) ->
+  [].
+
+data() ->
+  lists:map(fun(X) -> lists:duplicate(X, X) end, lists:seq(1, 255)).
+
+munge(X) ->
+  io_lib:format("~p", [lists:foldl(fun(E, A) -> E / A end, 1, [lists:sum(X)|X])]).
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.