Skip to content

Instantly share code, notes, and snippets.

View fstiffo's full-sized avatar

Francesco Stiffoni fstiffo

  • Sgajo - Agile Development & Consulting
  • Venice - Italy
View GitHub Profile
@fstiffo
fstiffo / npm-debug.log
Created August 21, 2017 18:43
Error after installing reson-cli binaires
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'https://github.com/reasonml/reason-cli/archive/beta-v-1.13.6-bin-linux.tar.gz' ]
2 info using npm@3.10.10
3 info using node@v6.11.2
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
@fstiffo
fstiffo / swagger.yaml
Created August 13, 2017 07:29
API definition for VENSES service
---
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"
%% 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]).
%% 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]).
%% 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]).
%% 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]).
%% 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(palin).
-export([nopunct/1, palin/1, palindrome/1, server/1]).
% palindrome problem
%
% palindrome("Madam I\'m Adam.") = true
palindrome(Xs) -> palin(nocaps(nopunct(Xs))).
-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.
@fstiffo
fstiffo / ex3_05.erl
Created March 6, 2017 09:35
FUNCTIONAL PROGRAMMING IN ERLANG THE UNIVERSITY OF KENT (WEEK 3 STEP 5) - Solutions
-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).