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(ex3_05). | |
-export([double_all/1,evens/1,product/1,test/0]). | |
%% First part: using higher-order functions | |
-spec double_all(list(number())) -> list(number()). | |
double_all(L) -> lists:map(fun(X) -> X * 2 end, L). | |
-spec evens(list(integer())) -> list(integer()). | |
evens(L) -> lists:filter(fun(X) -> X rem 2 == 0 end, L). |
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(rps). | |
-export([best_strategy/1, cycle/1, echo/1, enum/1, | |
frequencies/1, least_frequent/1, more_frequent/1, | |
no_repeat/1, play/1, play_two/3, rand/1, | |
rand_strategy/1, rock/1, show_play_two/3, tournament/2, | |
val/1]). | |
-type play() :: rock | paper | scissors. |
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
Purtroppo la bizzarra gestione delle porte USB su Raspberry Pi Zero (ora sono tipo micro e una sola di fatto), che obbliga all'acquisto | |
di una scheda di espansione con le porte USB "normali", lo hanno reso di fatto poco interessante. | |
Il collegamento via Bluetooth lo sconsiglio: costo dei controller, possibili latenze, e non dimentichiamo che è sempre roba che | |
va messa in mano a dei bambini (pile, sportellini, ecc.). | |
Si deve giocoforza ripiegare sul più caro Pi 3 Model B che costa circa 20€ in più. :( | |
Su Amazon il Kit completo più economico (e che straconviene) include: | |
1. Raspberry Pi 3 Model B |
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(palin). | |
-export([nopunct/1, palin/1, palindrome/1, server/1]). | |
% palindrome problem | |
% | |
% palindrome("Madam I\'m Adam.") = true | |
palindrome(Xs) -> palin(nocaps(nopunct(Xs))). |
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([start/0,allocate/0,deallocate/1,stop/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
%% 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]). |
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([start/0,allocate/0,deallocate/1,stop/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
%% 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]). |
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([start/1,allocate/0,deallocate/1,stop/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
--- | |
swagger: "2.0" | |
info: | |
description: "This is a simple API to acceess VENSES entailment service" | |
version: "1.0.0" | |
title: "VENSES API" | |
contact: | |
email: "info@sgajo.com" | |
license: | |
name: "Apache 2.0" |
OlderNewer