This file contains 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
{ok,frequency} | |
10> frequency:start(). | |
server_already_running | |
11> frequency:clear(). | |
Client: done clearing messages. | |
ok | |
12> frequency:deallocate(10). | |
Client: server took too long to deallocate my frequency. | |
ok | |
13> frequency:deallocate(10). |
This file contains 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
%% 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 | |
%% Step 1.15 ASSIGNMENT: Enhancing the frequency server |
This file contains 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
%% 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([init/0,start/0,stop/0,test_functions/0]). |
This file contains 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
%%% assignment 1.50 palindrome checker process | |
-module(b180). | |
-export([start/0,receiver/0,seqreceiver/0]). | |
%-include_lib("eunit/include/eunit.hrl"). | |
-created_by("Marcelo Ruiz Camauër"). | |
start()-> | |
Pid = spawn(?MODULE,receiver,[]), |
This file contains 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
%%% assignment 1.50 palindrome checker process | |
-module(b150). | |
-export([start/0,server/0,palindrome/1]). | |
-include_lib("eunit/include/eunit.hrl"). | |
-created_by("Marcelo Ruiz Camauër"). | |
% Define a function server/1 that accepts messages of the form | |
% | |
% {check,"Madam I\'m Adam"} |
This file contains 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
%%% assignment 3.12 Functional Programming in Erlang, 2017 | |
-module(rps). | |
-export([play/1,echo/1,play_two/3,rock/1,no_repeat/1,const/1,enum/1,cycle/1,rand/1,val/1,tournament/2]). | |
-export([type_count/1, least_freq_played/1,most_freq_played/1,rand_strategy/1]). | |
-created_by("Marcelo Ruiz Camauër"). | |
-include_lib("eunit/include/eunit.hrl"). |
This file contains 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
-module(a35). | |
-export([doubleAll/1, evens/1, product/1,zip/2,zip_with/3,zip_with_map/3,zip_with_zip_with/2]). | |
-include_lib("eunit/include/eunit.hrl"). | |
-created_by("Marcelo Ruiz Camauër"). | |
%%% invoke with: | |
%%% a35:test(). | |
%%% higher order functions |
This file contains 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
-module(index). | |
-export([index_file/1]). | |
readlines(Name) -> | |
{ok,File} = file:open(Name,[read]), | |
extract_content(File,[]). | |
extract_content(File,Partial) -> | |
case io:get_line(File,"") of | |
eof -> file:close(File), Partial; |
This file contains 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
%%% assignment 2.20 | |
% Indexing a file | |
% The aim of this exercise is to index a text file, by line number. | |
% We can think of the input being a list of text strings, and below we’ve provided an outline Erlang | |
% module that reads text files into this format, as well as a couple of example files to process. | |
% The output of the main function should be a list of entries consisting of a word | |
% and a list of the ranges of lines on which it occurs. | |
% | |
% For example, the entry |
This file contains 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
%%% assignment 2.15 palindromes | |
-module(a215). | |
-include_lib("eunit/include/eunit.hrl"). | |
-created_by("Marcelo Ruiz Camauër"). | |
-export([palindrome/1]). | |
-export([remove_punctuation/2]). | |
-spec palindrome(list()) -> boolean(). |
NewerOlder