Skip to content

Instantly share code, notes, and snippets.

%% Based on code from
%% Erlang Programming
%% Francecso Cesarini and Simon Thompson
%% O'Reilly, 2008
%% http://oreilly.com/catalog/9780596518189/
%% http://www.erlangprogramming.org/
%% (c) Francesco Cesarini and Simon Thompson
-module(frequency).
-export([start/0,allocate/0,deallocate/1,stop/0]).
-module(concurrent18).
-export([receiver/0, receiver_slow/0, receiver_in_order/0]).
receiver() ->
receive
stop -> io:format("stop", []);
X -> io:format("~p~n", [X]),
receiver()
end.
-module(palindrome).
-export([palindrome_check/1, server/1, serve/1]).
-export([server_of_clients/0, serve_client/0]).
-export([servers_of_clients/0,servers_balancer/3,many_serve_client/1]).
rem_punct(String) -> lists:filter(fun (Ch) ->
not(lists:member(Ch,"\"\'\t\n "))
end,
String).
-module(index).
-export([get_file_contents/1,
show_file_contents/1,
index_file/1,
index_sample_files/0]).
-include_lib("eunit/include/eunit.hrl").
index_sample_files() ->
io:format("~p~n", [index_file("gettysburg-address.txt")]),
io:format("~p~n", [index_file("dickens-christmas.txt")]).
@antoine
antoine / README.md
Created November 14, 2012 16:34
editable voronoi

you need to add the first vertices blindly since nothing is showed before that

<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: yellow;
stroke: #000;
}
circle {
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: yellow;
stroke: #000;
}
circle {
@antoine
antoine / README.md
Created November 14, 2012 16:29 — forked from mbostock/.block
Interactive Voronoi + add point

now start with no vertices, add vertices when clicking. Some print bug I think due to the fact that the pointer is "on" a vertice after clicking.