So far, all the properties we have written have tested stateless code. Stateless code is made up of pure functions and is inherently easier to test than stateful code with side effects. The chief problem with testing stateful code is that the input to output mapping depends on the current state of the program. Previous operations can cause the same function to return different output given the same input. Therefore, in order to test stateful code, our tests must maintain some state of their own. This state is known as the model state and is updated as part of the testing process.
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
%% use sync log so we can check if it caused a wrap event | |
%% and record the timestamp/num entries for the new wrapfile | |
%% (ie, collect metadata about each wrapfile.N, for faster seeking) | |
disk_log:blog(State#state.log, Line), | |
%% Fun used to write index marker, if we need to this insertion: | |
WriteIndexFun = fun(FileOffset) -> | |
Info = disk_log:info(State#state.log), | |
NoItems = proplists:get_value(no_items, Info), | |
CurrFile = proplists:get_value(current_file, Info), |
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
#!/bin/sh | |
# copied from http://zeroset.mnim.org/2013/03/14/sftp-support-for-curl-in-ubuntu-12-10-quantal-quetzal-and-later/ | |
mkdir /tmp/curl | |
cd /tmp/curl | |
sudo apt-get update | |
sudo apt-get install build-essential debhelper libssh2-1-dev | |
apt-get source curl | |
sudo apt-get build-dep curl | |
cd curl-* | |
dpkg-buildpackage |
The best:
- Sapiens: A Brief History of Humankind - one of the most interesting books I have ever read
- Superforecasting: The Art and Science of Prediction - absolutely fascinating. actionable advice that has been unreasonably well tested and proven.
- The Better Angels of Our Nature - another one for the list of most interesting books ever
- Feeling Good: The New Mood Therapy - highly recommended for anyone who struggles with depression. takes a very data-centric approach to correcting your own warped perceptions of reality. made a world of difference for me.
- A Small Matter of Programming: Perspectives on End User Computing - incredibly useful, espec
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
build: | |
@ocamlbuild \ | |
-use-ocamlfind \ | |
-tags thread \ | |
-syntax camlp4o \ | |
-pkgs bitstring.syntax,bitstring,core,async \ | |
x_plane_autopilot.byte | |
deps: | |
@opam install core async bitstring |
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
#!/bin/bash -e | |
image=mdillon/postgis:9.6-alpine | |
container_name=my-app-postgresql | |
if [ -z "$1" ]; then | |
echo "Run command with a dockerised PostgreSQL DB. | |
usage: $(basename "$0") command |