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
import fj.P; | |
import fj.P2; | |
import fj.P3; | |
import fj.data.Validation; | |
import java.util.Optional; | |
import java.util.function.BiFunction; | |
import java.util.function.BiPredicate; | |
import java.util.function.Function; |
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(f23). | |
-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([startFrequency/0, stopFrequency/0, startClient/3, startClient/1, killFrequency/0, killClient/1, demo/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, stop/0, startClient/3]). |
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
import io.reactivex.Single | |
import io.reactivex.schedulers.Schedulers | |
import spock.lang.FailsWith | |
import spock.lang.Specification | |
import java.util.concurrent.TimeUnit | |
class ThreadInterruptedInTimeoutTest extends Specification { | |
volatile boolean threadWasInterrupted = false |
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([get_file_contents/1, show_file_contents/1, get_all_words/1, index_lines/1, index_file/1]). | |
% Takes a filename and returns a list of indexed words | |
% f.e. index:index_file("gettysburg-address.txt"). | |
index_file(Name) -> index_lines(get_file_contents(Name)). | |
% Takes a list of lines and returns a list of indexed words | |
index_lines(Lines) -> sort_by_word(consolidate(sort_by_word_and_index(bag_of_indexed_words(zip_with_ix_nr(Lines))))). |
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
import org.slf4j.Logger; | |
import org.springframework.jdbc.core.*; | |
import org.springframework.jdbc.core.namedparam.EmptySqlParameterSource; | |
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; | |
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | |
import org.springframework.jdbc.datasource.DataSourceUtils; | |
import org.springframework.jdbc.support.JdbcUtils; | |
import rx.Observable; | |
import rx.Observer; | |
import rx.observables.SyncOnSubscribe; |
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
import groovy.transform.Immutable | |
@Immutable | |
class User { | |
UUID id | |
String fullName | |
int age | |
} | |
class VeryComplexFilter { |
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
@GrabResolver('https://oss.sonatype.org/content/groups/public') | |
@Grab('org.functionaljava:functionaljava:4.2') | |
import fj.F2 | |
import groovy.transform.Canonical | |
import groovy.transform.Immutable | |
import groovy.transform.stc.ClosureParams | |
import groovy.transform.stc.SimpleType | |
@Canonical |