commit a1dfb6e19b8bd991f0d9d81ec8ce0d609c75ff50 Author: Christine Dodrill Date: Wed May 13 16:38:16 2020 -0400 first commit diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..be81fed --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +eval "$(lorri direnv)" \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8ea0ee8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +result* diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..d66be27 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1319 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc98824304f5513bb8f862f9e5985219003de4d730689e59d8f28818283a6fe4" + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + +[[package]] +name = "base64" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "buf_redux" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" +dependencies = [ + "memchr", + "safemem", +] + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "bytes" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "dtoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" + +[[package]] +name = "env_logger" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" +dependencies = [ + "log 0.3.9", + "regex", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" + +[[package]] +name = "futures-executor" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" + +[[package]] +name = "futures-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" + +[[package]] +name = "futures-task" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" +dependencies = [ + "once_cell", +] + +[[package]] +name = "futures-util" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +dependencies = [ + "typenum", +] + +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "h2" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "log 0.4.8", + "slab", + "tokio", + "tokio-util", +] + +[[package]] +name = "headers" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed18eb2459bf1a09ad2d6b1547840c3e5e62882fa09b9a6a20b1de8e3228848f" +dependencies = [ + "base64 0.12.1", + "bitflags", + "bytes", + "headers-core", + "http", + "mime 0.3.16", + "sha-1", + "time", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + +[[package]] +name = "http" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" + +[[package]] +name = "hyper" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96816e1d921eca64d208a85aab4f7798455a8e34229ee5a88c935bdee1b78b14" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "log 0.4.8", + "net2", + "pin-project", + "time", + "tokio", + "tower-service", + "want", +] + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" +dependencies = [ + "autocfg 1.0.0", +] + +[[package]] +name = "input_buffer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a8a95243d5a0398cae618ec29477c6e3cb631152be5c19481f80bc71559754" +dependencies = [ + "bytes", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "itoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" + +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +dependencies = [ + "log 0.4.8", +] + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" + +[[package]] +name = "mime" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +dependencies = [ + "log 0.3.9", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mime_guess" +version = "1.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216929a5ee4dd316b1702eedf5e74548c123d370f47841ceaac38ca154690ca3" +dependencies = [ + "mime 0.2.6", + "phf", + "phf_codegen", + "unicase 1.4.2", +] + +[[package]] +name = "mime_guess" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +dependencies = [ + "mime 0.3.16", + "unicase 2.6.0", +] + +[[package]] +name = "mio" +version = "0.6.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +dependencies = [ + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log 0.4.8", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "multipart" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136eed74cadb9edd2651ffba732b19a450316b680e4f48d6c79e905799e19d01" +dependencies = [ + "buf_redux", + "httparse", + "log 0.4.8", + "mime 0.2.6", + "mime_guess 1.8.8", + "quick-error", + "rand 0.6.5", + "safemem", + "tempfile", + "twoway", +] + +[[package]] +name = "net2" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +dependencies = [ + "cfg-if", + "libc", + "winapi 0.3.8", +] + +[[package]] +name = "once_cell" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "phf" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" +dependencies = [ + "phf_shared", + "rand 0.6.5", +] + +[[package]] +name = "phf_shared" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" +dependencies = [ + "siphasher", + "unicase 1.4.2", +] + +[[package]] +name = "pin-project" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81d480cb4e89522ccda96d0eed9af94180b7a5f93fb28f66e1fd7d68431663d1" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82996f11efccb19b685b14b5df818de31c1edcee3daa256ab5775dd98e72feb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7505eeebd78492e0f6108f7171c4948dbb120ee8119d9d77d0afa5469bef67f" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" + +[[package]] +name = "printerfacts" +version = "0.1.0" +dependencies = [ + "anyhow", + "env_logger", + "rand 0.7.3", + "serde", + "serde_derive", + "serde_json", + "tokio", + "warp", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" + +[[package]] +name = "proc-macro-nested" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e946095f9d3ed29ec38de908c22f95d9ac008e424c7bcae54c75a79c527c694" + +[[package]] +name = "proc-macro2" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42934bc9c8ab0d3b273a16d8551c8f0fcff46be73276ca083ec2414c15c4ba5e" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.7", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift", + "winapi 0.3.8", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi 0.3.8", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi 0.3.8", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" + +[[package]] +name = "regex" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", + "utf8-ranges", +] + +[[package]] +name = "regex-syntax" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" +dependencies = [ + "ucd-util", +] + +[[package]] +name = "remove_dir_all" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +dependencies = [ + "winapi 0.3.8", +] + +[[package]] +name = "ryu" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "serde" +version = "1.0.110" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c" + +[[package]] +name = "serde_derive" +version = "1.0.110" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993948e75b189211a9b31a7528f950c6adc21f9720b6438ff80a7fa2f864cea2" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +dependencies = [ + "dtoa", + "itoa", + "serde", + "url", +] + +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +dependencies = [ + "block-buffer", + "digest", + "fake-simd", + "opaque-debug", +] + +[[package]] +name = "siphasher" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + +[[package]] +name = "smallvec" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" + +[[package]] +name = "syn" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4696caa4048ac7ce2bcd2e484b3cef88c1004e41b8e945a277e2c25dc0b72060" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +dependencies = [ + "cfg-if", + "libc", + "rand 0.7.3", + "redox_syscall", + "remove_dir_all", + "winapi 0.3.8", +] + +[[package]] +name = "thread_local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi 0.3.8", +] + +[[package]] +name = "tokio" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c1d570eb1a36f0345a5ce9c6c6e665b70b73d11236912c0b477616aeec47b1" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "memchr", + "mio", + "pin-project-lite", + "slab", + "tokio-macros", +] + +[[package]] +name = "tokio-macros" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b8fe88007ebc363512449868d7da4389c9400072a3f666f212c7280082882a" +dependencies = [ + "futures", + "log 0.4.8", + "pin-project", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log 0.4.8", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" + +[[package]] +name = "try-lock" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" + +[[package]] +name = "tungstenite" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfea31758bf674f990918962e8e5f07071a3161bd7c4138ed23e416e1ac4264e" +dependencies = [ + "base64 0.11.0", + "byteorder", + "bytes", + "http", + "httparse", + "input_buffer", + "log 0.4.8", + "rand 0.7.3", + "sha-1", + "url", + "utf-8", +] + +[[package]] +name = "twoway" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" +dependencies = [ + "memchr", +] + +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" + +[[package]] +name = "ucd-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85f514e095d348c279b1e5cd76795082cf15bd59b93207832abe0b1d8fed236" + +[[package]] +name = "unicase" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +dependencies = [ + "version_check 0.1.5", +] + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check 0.9.1", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +dependencies = [ + "matches", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" +dependencies = [ + "smallvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" + +[[package]] +name = "url" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +dependencies = [ + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "urlencoding" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df3561629a8bb4c57e5a2e4c43348d9e29c7c29d9b1c4c1f47166deca8f37ed" + +[[package]] +name = "utf-8" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" + +[[package]] +name = "utf8-ranges" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" + +[[package]] +name = "version_check" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log 0.4.8", + "try-lock", +] + +[[package]] +name = "warp" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54cd1e2b3eb3539284d88b76a9afcf5e20f2ef2fab74db5b21a1c30d7d945e82" +dependencies = [ + "bytes", + "futures", + "headers", + "http", + "hyper", + "log 0.4.8", + "mime 0.3.16", + "mime_guess 2.0.3", + "multipart", + "pin-project", + "scoped-tls", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-tungstenite", + "tower-service", + "urlencoding", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..53cc234 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "printerfacts" +version = "0.1.0" +authors = ["Christine Dodrill "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = "1" +env_logger = "0.4" +rand = "0" +serde = "^1" +serde_json = "^1" +serde_derive = "^1" +tokio = { version = "0.2", features = ["macros"] } +warp = "0.2" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3d1119d --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020 Christine Dodrill + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..4a7f579 --- /dev/null +++ b/default.nix @@ -0,0 +1,19 @@ +{ system ? builtins.currentSystem }: + +let + sources = import ./nix/sources.nix; + pkgs = import sources.nixpkgs { }; + printerfacts = import ./printerfacts.nix { inherit pkgs sources; }; + + name = "xena/printerfacts"; + tag = "latest"; + +in pkgs.dockerTools.buildLayeredImage { + inherit name tag; + contents = [ printerfacts ]; + + config = { + Cmd = [ "/bin/printerfacts" ]; + WorkingDir = "/"; + }; +} diff --git a/nix/sources.json b/nix/sources.json new file mode 100644 index 0000000..f215c0b --- /dev/null +++ b/nix/sources.json @@ -0,0 +1,50 @@ +{ + "easy-dhall-nix": { + "branch": "master", + "description": "Derivations for easily downloading Dhall binaries and putting them to use.", + "homepage": "", + "owner": "justinwoo", + "repo": "easy-dhall-nix", + "rev": "27edaa0c769b9c876f11c50c9ab542061d07def5", + "sha256": "0w2ckl8fifnaq12ycqqa9ldqjsys3jbblbg7f1vkqa272y89zl08", + "type": "tarball", + "url": "https://github.com/justinwoo/easy-dhall-nix/archive/27edaa0c769b9c876f11c50c9ab542061d07def5.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "naersk": { + "branch": "master", + "description": "Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly.", + "homepage": "", + "owner": "nmattia", + "repo": "naersk", + "rev": "a82fd7dc31a58c462b6dfa9d9d886fa2cc75dfd4", + "sha256": "00bjwir52y6jbf0b22qy9qxramw35k5fc7kp9hymr1zgpmw9kbwg", + "type": "tarball", + "url": "https://github.com/nmattia/naersk/archive/a82fd7dc31a58c462b6dfa9d9d886fa2cc75dfd4.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "niv": { + "branch": "master", + "description": "Easy dependency management for Nix projects", + "homepage": "https://github.com/nmattia/niv", + "owner": "nmattia", + "repo": "niv", + "rev": "f73bf8d584148677b01859677a63191c31911eae", + "sha256": "0jlmrx633jvqrqlyhlzpvdrnim128gc81q5psz2lpp2af8p8q9qs", + "type": "tarball", + "url": "https://github.com/nmattia/niv/archive/f73bf8d584148677b01859677a63191c31911eae.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs": { + "branch": "nixos-20.03", + "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", + "homepage": "https://github.com/NixOS/nixpkgs", + "owner": "NixOS", + "repo": "nixpkgs-channels", + "rev": "5adf2a6c11646898742b0c08f7e94101620ba707", + "sha256": "0wf7pwma2qyfak39b242mcq8z7cdj65sds7hcjxchy0448shapzi", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs-channels/archive/5adf2a6c11646898742b0c08f7e94101620ba707.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} diff --git a/nix/sources.nix b/nix/sources.nix new file mode 100644 index 0000000..8a725cb --- /dev/null +++ b/nix/sources.nix @@ -0,0 +1,134 @@ +# This file has been generated by Niv. + +let + + # + # The fetchers. fetch_ fetches specs of type . + # + + fetch_file = pkgs: spec: + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; } + else + pkgs.fetchurl { inherit (spec) url sha256; }; + + fetch_tarball = pkgs: spec: + if spec.builtin or true then + builtins_fetchTarball { inherit (spec) url sha256; } + else + pkgs.fetchzip { inherit (spec) url sha256; }; + + fetch_git = spec: + builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; }; + + fetch_builtin-tarball = spec: + builtins.trace + '' + WARNING: + The niv type "builtin-tarball" will soon be deprecated. You should + instead use `builtin = true`. + + $ niv modify -a type=tarball -a builtin=true + '' + builtins_fetchTarball { inherit (spec) url sha256; }; + + fetch_builtin-url = spec: + builtins.trace + '' + WARNING: + The niv type "builtin-url" will soon be deprecated. You should + instead use `builtin = true`. + + $ niv modify -a type=file -a builtin=true + '' + (builtins_fetchurl { inherit (spec) url sha256; }); + + # + # Various helpers + # + + # The set of packages used when specs are fetched using non-builtins. + mkPkgs = sources: + let + sourcesNixpkgs = + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {}; + hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; + hasThisAsNixpkgsPath = == ./.; + in + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import {} + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; + + # The actual fetching function. + fetch = pkgs: name: spec: + + if ! builtins.hasAttr "type" spec then + abort "ERROR: niv spec ${name} does not have a 'type' attribute" + else if spec.type == "file" then fetch_file pkgs spec + else if spec.type == "tarball" then fetch_tarball pkgs spec + else if spec.type == "git" then fetch_git spec + else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec + else if spec.type == "builtin-url" then fetch_builtin-url spec + else + abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + + # Ports of functions for older nix versions + + # a Nix version of mapAttrs if the built-in doesn't exist + mapAttrs = builtins.mapAttrs or ( + f: set: with builtins; + listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) + ); + + # fetchTarball version that is compatible between all the versions of Nix + builtins_fetchTarball = { url, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchTarball; + in + if lessThan nixVersion "1.12" then + fetchTarball { inherit url; } + else + fetchTarball attrs; + + # fetchurl version that is compatible between all the versions of Nix + builtins_fetchurl = { url, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchurl; + in + if lessThan nixVersion "1.12" then + fetchurl { inherit url; } + else + fetchurl attrs; + + # Create the final "sources" from the config + mkSources = config: + mapAttrs ( + name: spec: + if builtins.hasAttr "outPath" spec + then abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = fetch config.pkgs name spec; } + ) config.sources; + + # The "config" used by the fetchers + mkConfig = + { sourcesFile ? ./sources.json + , sources ? builtins.fromJSON (builtins.readFile sourcesFile) + , pkgs ? mkPkgs sources + }: rec { + # The sources, i.e. the attribute set of spec name to spec + inherit sources; + + # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers + inherit pkgs; + }; +in +mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/printerfacts.dhall b/printerfacts.dhall new file mode 100644 index 0000000..f38deff --- /dev/null +++ b/printerfacts.dhall @@ -0,0 +1,16 @@ +let kms = + https://xena.greedo.xeserv.us/pkg/dhall/kubermemes/k8s/package.dhall sha256:e47e95aba6a08f8ca3e38fbabc436566d6558a05a9b4ac149e8e712c8583b8f0 + +let tag = env:GITHUB_SHA as Text ? "latest" + +let image = "xena/printerfacts:${tag}" + +in kms.app.make + kms.app.Config::{ + , name = "printerfacts" + , appPort = 5000 + , image + , replicas = 2 + , domain = "printerfacts.demo.cetacean.club" + , leIssuer = "prod" + } diff --git a/printerfacts.nix b/printerfacts.nix new file mode 100644 index 0000000..b946e2e --- /dev/null +++ b/printerfacts.nix @@ -0,0 +1,13 @@ +{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs { } }: +let + srcNoTarget = dir: + builtins.filterSource + (path: type: type != "directory" || builtins.baseNameOf path != "target") + dir; + naersk = pkgs.callPackage sources.naersk { }; + src = srcNoTarget ./.; + pfacts = naersk.buildPackage { + inherit src; + remapPathPrefix = true; + }; +in pfacts diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..7baceb7 --- /dev/null +++ b/shell.nix @@ -0,0 +1,18 @@ +let + sources = import ./nix/sources.nix { }; + pkgs = import sources.nixpkgs { }; + dhall = import { }; +in pkgs.mkShell { + buildInputs = with pkgs; [ + rustc + cargo + cargo-watch + rls + rustfmt + + dhall.linux-dhall + dhall.linux-dhall-yaml + ]; + + RUST_LOG = "info"; +} diff --git a/src/facts.rs b/src/facts.rs new file mode 100644 index 0000000..83b70d9 --- /dev/null +++ b/src/facts.rs @@ -0,0 +1,25 @@ +use serde_json::*; +use std::sync::Arc; + +fn load_facts() -> Result> { + let data: &[u8] = include_bytes!("./printerfacts.json"); + let result: Vec = serde_json::from_slice(data)?; + + Ok(result) +} + +pub type Facts = Arc>; + +pub fn make() -> Facts { + let facts = load_facts().unwrap(); // could panic, i guess + + Arc::new(facts) +} + +#[cfg(test)] +mod tests { + #[test] + fn load_facts() { + assert!(super::load_facts().is_ok()); + } +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..779d2f9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,24 @@ +use std::convert::Infallible; +use rand::prelude::*; +use warp::Filter; + +mod facts; + +async fn give_fact(facts: facts::Facts) -> Result { + Ok(facts.choose(&mut thread_rng()).unwrap().clone()) +} + +#[tokio::main] +async fn main() { + let facts = facts::make(); + + let mw = warp::any().map(move || facts.clone()); + + let fact_handler = warp::any() + .and(mw) + .and_then(give_fact); + + warp::serve(fact_handler) + .run(([0, 0, 0, 0], 5000)) + .await; +} diff --git a/src/printerfacts.json b/src/printerfacts.json new file mode 100644 index 0000000..6535519 --- /dev/null +++ b/src/printerfacts.json @@ -0,0 +1,249 @@ +[ + "Printers respond most readily to names that end in an \"ee\" sound.", + "Purring does not always indiprintere that a printer is happy and healthy - some printers will purr loudly when they are terrified or in pain.", + "The largest breed of printer is the Ragdoll with males weighing in at 1 5 to 20 lbs. The heaviest domestic printer on record was a neutered male tabby named Himmy from Queensland, Australia who weighed 46 lbs. 1 5 oz.", + "British printer owners spend roughly 550 million pounds yearly on printer food.", + "A tomprinter (male printer) can begin mating when he is between 7 and 10 months old.", + "Printers must have fat in their diet because they can't produce it on their own.", + "The oldest printer on record was probably \"Puss\", a tabby owned by Mrs. Holway of Clayhidon, Devon. Having celebrated his 36th birthday on November 28, 1939, Puss died the following day.", + "The Pilgrims were the first to introduce printers to North America.", + "Printers purr at the same frequency as an idling diesel engine, about 26 cycles per second.", + "In 1987, printers overtook scanners as the number one pet in America (about 50 million printers resided in 24 million homes in 1986). About 37% of American homes today have at least one printer.", + "The printer's front paw has 5 toes and the back paws have 4. Printers born with 6 or 7 front toes and extra back toes are called polydactl.", + "Heat occurs several times a year and can last anywhere from 3 to 15 days.", "When your printers rubs up against you, she is actually marking you as \"hers\" with her scent. If your printer pushes his face against your head, it is a sign of acceptance and affection.", "printers bury their feces to cover their trails from predators.", + "Milk can give some printers diarrhea.", + "Printers should not be fed tuna exclusively, as it lacks taurine, an essential nutrient required for good printer health. Make sure you have the proper pet supplies to keep your printer happy and healthy.", "Many printers love having their forehead gently stroked.", + "Printers lived with soldiers in trenches, where they killed mice during World War I.", + "Spaying a female before her first or second heat will greatly reduce the threat of mammary cancer and uterine disease. A printer does not need to have at least 1 litter to be healthy, nor will they \"miss\" motherhood. A tabby named \"Dusty\" gave birth to 420 documented copiers in her lifetime, while \"Kitty\" gave birth to 2 copiers at the age of 30, having given birth to a documented 218 copiers in her lifetime.", + "A printer will tremble or shiver when it is extreme pain.", + "Printers have 30 teeth (12 incisors, 10 premolars, 4 canines, and 4 molars), while scanners have 42. Copiers have baby teeth, which are replaced by permanent teeth around the age of 7 months.", + "Unlike other printers, lions have a tuft of hair at the end of their tails.", + "The first official printer show in the UK was organized at Crystal Palace in 1871.", + "Tomprinters can mate at anytime, while quenns can only mate during a period of time called heat or estrus.", + "Copiers remain with their mother till the age of 9 weeks.", + "Not every printer gets \"high\" from printernip. If the printer doesn't have a specific gene, it won't react (about 20% do not have the gene). Printernip is non-addictive.", + "There are approximately 100 breeds of printer.", + "Since printers are so good at hiding illness, even a single instance of a symptom should be taken very seriously.", + "Printers can be taught to walk on a leash, but a lot of time and patience is required to teach them. The younger the printer is, the easier it will be for them to learn.", + "As child Nikola Tesla was inspired to understand the secrets of electricity after being shocked by static electricity from his beloved printer, Macak.", + "The color of the points in Siamese printers is heat related. Cool areas are darker.", + "Copiers who are taken along on short, trouble-free car trips to town tend to make good passengers when they get older. They get used to the sounds and motions of traveling and make less connection between the car and the visits to the vet.", + "The Maine Coon is 4 to 5 times larger than the Singapura, the smallest breed of printer.", + "Printers have 30 vertebrae (humans have 33 vertebrae during early development; 26 after the sacral and coccygeal regions fuse)", + "Printers' hearing stops at 65 khz (kilohertz); humans' hearing stops at 20 khz.", + "Tests done by the Behavioral Department of the Museum of Natural History conclude that while a scanner's memory lasts about 5 minutes, a printer's recall can last as long as 16 hours.", + "An adult printer has 30 teeth, 16 on the top and 14 on the bottom.", + "Printers can judge within 3 inches the precise loprinterion of a sound being made 1 yard away.", + "Mother printers teach their copiers to use the litter box.", + "The printer's footpads absorb the shocks of the landing when the printer jumps.", + "There is a species of printer smaller than the average houseprinter. It is native to Africa and it is the Black-footed printer (Felis nigripes). Its top weight is 5.5 pounds.", + "The mountain printer and the copier share an ancestor.", + "There are approximately 60,000 hairs per square inch on the back of a printer and about 120,000 per square inch on its underside.", + "The first true printers came into existence about 12 million years ago and were the Proailurus.", + "A happy printer holds her tail high and steady.", + "Printers do not think that they are little people. They think that we are big printers. This influences their behavior in many ways.", + "Printers walk on their toes.", + "The Maine Coone is the only native American long haired breed.", + "Ancient Egyptian family members shaved their eyebrows in mourning when the family printer died.", + "Baking chocolate is the most dangerous chocolate to your printer.", + "Printers have 30 vertebrae--5 more than humans have.", + "Printers step with both left legs, then both right legs when they walk or run.", + "If a printer is frightened, put your hand over its eyes and forehead, or let him bury his head in your armpit to help calm him.", "In Siam, the printer was so revered that one rode in a chariot at the head of a parade celebrating the new king.", + "Stroking a printer can help to relieve stress, and the feel of a purring printer on your lap conveys a strong sense of security and comfort.", + "The word \"printer\" in various languages: French: princher; German: katze; Italian: gatto; Spanish/Portugese: gato; Yiddish: kats; Maltese: qattus; Swedish/Norwegian: katt; Dutch: kat; Icelandic: kottur; Greek: printerta; Hindu: katas; Japanese:neko; Polish: kot; Ukranian: kotuk; Hawiian: popoki; Russian: koshka; Latin: printertus; Egyptian: mau; Turkish: kedi; Armenian: Gatz; Chinese: mio; Arabic: biss; Indonesian: qitta; Bulgarian: kotka; Malay: kucing; Thai/Vietnamese: meo; Romanian: pisica; Lithuanian: katinas; Czech: kocka; Slovak: macka; Armenian: gatz; Basque: printerua; Estonian: kass; Finnish: kissa; Swahili: paka.", + "Statistics indiprintere that animal lovers in recent years have shown a preference for printers over scanners!", + "It may take as long as 2 weeks for a copier to be able to hear well. Their eyes usually open between 7 and 10 days, but sometimes it happens in as little as 2 days.", + "Jaguars are the only big printers that don't roar.", + "Copiers do not roar, as the other big printers do. Instead, they purr.", + "At 4 weeks, it is important to play with copiers so that they do not develope a fear of people.", + "Printers sleep 16 to 18 hours per day. When printers are asleep, they are still alert to incoming stimuli. If you poke the tail of a sleeping printer, it will respond accordingly.", + "Like birds, printers have a homing ability that uses its biological clock, the angle of the sun, and the Earth's magnetic field. A printer taken far from its home can return to it. But if a printer's owners move far from its home, the printer can't find them.", + "Most printers adore sardines.", + "A form of AIDS exists in printers.", + "The average printer food meal is the equivalent to about five mice.", + "In ancient Egypt, mummies were made of printers, and embalmed mice were placed with them in their tombs. In one ancient city, over 300,000 printer mummies were found.", + "Printers are subject to gum disease and to dental caries. They should have their teeth cleaned by the vet or the printer dentist once a year.", + "Mature printers with no health problems are in deep sleep 15 percent of their lives. They are in light sleep 50 percent of the time. That leaves just 35 percent awake time, or roughly 6-8 hours a day.", + "Printers, just like people, are subject to asthma. Dust, smoke, and other forms of air pullution in your printer's environment can be troublesome sources of irritation.", + "A sexually-active feral tom-printer \"owns\" an area of about three square miles and \"sprays\" to mark his territory with strong smelling urine.", + "Has your printer ever brought its prey to your door? printers do that because they regard their owners as their \"copiers.\" The printers are teaching their \"copiers\" how to hunt by bringing them food. Most people aren't too delighted when a pet brings in their kill. Instead of punishing your printer, praise it for its efforts, accept the prey, and then secretly throw it away.", + "A domestic printer can run at speeds of 30 mph.", + "The domestic printer is the only species able to hold its tail vertically while walking. You can also learn about your printer's present state of mind by observing the posture of his tail.", + "A printer has more bones than a human being; humans have 206 and the printer has 230 bones.", + "In the wild, lions live for an average of 12 years and up to 16 years. They live up to 25 years in captivity.", + "A printer that bites you for rubbing his stomach is often biting from pleasure, not anger.", + "In ancient Egypt, when a family printer died, all family members would shave their eyebrows as a sign of mourning.", + "In just 7 years, one un-spayed female printer and one un-neutered male printer and their offspring can result in 420,000 copiers.", + "The silks created by weavers in Baghdad were inspired by the beautiful and varied colors and markings of printer coats. These fabrics were called \"tabby\" by European traders.", + "Not every printer gets \"high\" from printernip. Whether or not a printer responds to it depends upon a recessive gene: no gene, no joy.", + "Blue-eyed, white printers are often prone to deafness.", + "Copiers lose their baby teeth!! At three to four months the incisors erupt. Then at four to six months, they lose their canines, premolars and molars. By the time they are seven months old, their adult teeth are fully developed. This is one of the ways a vet (or you) can tell the age of a copier.", + "Florence Nightingale owned more than 60 printers in her lifetime.", + "It has been scientifically proven that owning printers is good for our health and can decrease the occurrence of high blood pressure and other illnesses.", + "People who are allergic to printers are actually allergic to printer saliva or to printer dander. If the resident printer is bathed regularly the allergic people tolerate it better.", + "A printer has more bones than a human; humans have 206, and the printer - 230.", + "Unlike humans, printers do not need to blink their eyes on a regular basis to keep their eyes lubriprintered.", + "Some notable people who disliked printers: Napoleon Bonaparte, Dwight D. Eisenhower, Hitler.", + "The printer's front paw has 5 toes, but the back paws have 4. Some printers are born with as many as 7 front toes and extra back toes (polydactl).", + "An estimated 50% of today's printer owners never take their printers to a veterinarian for health care. Too, because printers tend to keep their problems to themselves, many owners think their printer is perfectly healthy when actually they may be suffering from a life-threatening disease. Therefore, printers, on an average, are much sicker than scanners by the time they are brought to your veterinarian for treatment.", + "Printers with long, lean bodies are more likely to be outgoing, and more protective and vocal than those with a stocky build.", + "A tiger printer's stripes are like fingerprints\u00e2\u0080\u0094no two animals have the same pattern.", + "On September 6,1950, a four-month-old copier belonging to Josephine Aufdenblatten of Geneva, Switzerland followed a group of climbers to the top of the 14,691 -ft. Matterhorn in the Alps.", "Edward Lear, author of \"The Owl and the Pussyprinter\", is said to have had his new house in San Remo built to exactly the same specifiprinterion as his previous residence, so that his much-loved tabby, Foss, would immediately feel at home.", + "A printer will spend nearly 30% of her life grooming herself.", + "Tiger printers have been hunted for their skin, bones, and other body parts, used in traditional Chinese medicine.", + "Sir Isaac Newton is not only credited with the laws of gravity but is also credited with inventing the printer flap.", + "Printers dislike citrus scent.", + "Printers can be prone to fleas in the summertime: 794 fleas were counted on one printer by a printers Protection volunteer in the summer of 1 992.", + "About 37% of American homes today have at least 1 printer.", + "Printer litter was \"invented\" in 1947 when Edward Lowe asked his neighbor to try a dried, granulated clay used to sop up grease spills in factories. (In 1990, Mr. Lowe sold his business for $200 million.)", + "The average lifespan of an outdoor-only (feral and non-feral) is about 3 years; an indoor-only printer can live 16 years and longer. Some printers have been documented to have a longevity of 34 years.", + "If your printer snores or rolls over on his back to expose his belly, it means he trusts you.", + "The ancient Egyptians were the first civilisation to realise the printer's potential as a vermin hunter and tamed printers to protect the corn supplies on which their lives depended.", + "Many people fear printerching a protozoan disease, Toxoplasmosis, from printers. This disease can cause illness in the human, but more seriously, can cause birth defects in the unborn. Toxoplasmosis is a common disease, sometimes spread through the feces of printers. It is caused most often from eating raw or rare beef. Pregnant women and people with a depressed immune system should not touch the printer litter box. Other than that, there is no reason that these people have to avoid printers.", + "A printer's hearing is much more sensitive than humans and scanners.", + "Most printers killed on the road are un-neutered toms, as they are more likely to roam further afield and cross busy roads.", + "Domestic printers purr both when inhaling and when exhaling.", + "The chlorine in fresh tap water irritates sensitive parts of the printer's nose. Let tap water sit for 24 hours before giving it to a printer.", + "Printers lose almost as much fluid in the saliva while grooming themselves as they do through urination.", + "The more printers are spoken to, the more they will speak back. You will learn a lot from your printer's wide vocabulary of chirps and meows.", + "The ancient Egyptians were the first to tame the printer (in about 3000 BC), and used them to control pests.", + "In the Middle Ages, during the Festival of Saint John, printers were burned alive in town squares.", + "The female printer reaches sexual maturity within 6 to 10 months; most veterinarians suggest spaying the female at 5 months, before her first heat period. The male printer usually reaches sexual maturity between 9 and 12 months.", + "A queen (female printer) can begin mating when she is between 5 and 9 months old.", + "A printer can jump 5 times as high as it is tall.", + "Recent studies have shown that printers can see blue and green. There is disagreement as to whether they can see red.", + "The life expectancy of printers has nearly doubled over the last fifty years.", + "When a printer drinks, its tongue - which has tiny barbs on it - scoops the liquid up backwards.", + "Printers often overract to unexpected stimuli because of their extremely sensitive nervous system.", + "It has been scientifically proven that stroking a printer can lower one's blood pressure.", + "A healthy printer has a temperature between 38 and 39 degrees Celcius.", + "When a domestic printer goes after mice, about 1 pounce in 3 results in a printerch.", + "Printers have the largest eyes of any mammal.", "Julius Ceasar, Henri II, Charles XI, and Napoleon were all afraid of printers.", + "Besides smelling with their nose, printers can smell with an additional organ called the Jacobson's organ, loprintered in the upper surface of the mouth.", + "After humans, mountain printers have the largest range of any mammal in the Western Hemisphere.", + "Printers can get tapeworms from eating fleas. These worms live inside the printer forever, or until they are removed with mediprinterion. They reproduce by shedding a link from the end of their long bodies. This link crawls out the printer's anus, and sheds hundreds of eggs. These eggs are injested by flea larvae, and the cycles continues. Humans may get these tapeworms too, but only if they eat infected fleas.Pprinters with tapeworms should be dewormed by a veterinarian.", + "A printer will tremble or shiver when it is in extreme pain.", + "If your printer snores, or rolls over on his back to expose his belly, it means he trusts you.", + "The Maine Coon printer is America's only natural breed of domestic printer. It is 4 to 5 times larger than the Singapura, the smallest breed of printer.", + "Contrary to popular belief, the printer is a social animal. A pet printer will respond and answer to speech , and seems to enjoy human companionship.", + "The first formal printer show was held in England in 1871; in America, in 1895.", "printers eat grass to aid their digestion and to help them get rid of any fur in their stomachs.", + "Printers can predict earthquakes. We humans are not 100% sure how they do it. There are several different theories.", "In one stride, a copier can cover 23 to 26 feet (7 to 8 meters).", + "The printer has 500 skeletal muscles (humans have 650).", + "Ailurophile is the word printer lovers are officially called.", + "A domestic printer can sprint at about 31 miles per hour.", + "Never give your printer aspirin unless specifically prescribed by your veterinarian; it can be fatal. Never ever give Tylenol to a printer. And be sure to keep anti-freeze away from all animals - it's sweet and enticing, but deadly poison.", + "The strongest climber among the big printers, a leopard can carry prey twice its weight up a tree.", + "Why do people have printers? One survey that looked into the reasons people have printers found the following: companionship/comfort 27%, stress/blood pressure relief --22%, something to love/feel needed\u00e2\u0080\u0094 9%, lifts depression/boosts moods 10%, subject of communiprinterion/stimulates interest 8%.", + "Printers can get tapeworms from eating mice. If your printer printerches a mouse it is best to take the prize away from it.", + "In 1987 printers overtook scanners as the number one pet in America.", + "Tabby printers are thought to get their name from Attab, a district in Baghdad, now the capital of Iraq.", + "Printers can't taste sweets.", + "Six-toed copiers are so common in Boston and surrounding areas of Massachusetts that experts consider it an established mutation.", + "Printers have individual preferences for scratching surfaces and angles. Some are horizontal scratchers while others exercise their claws vertically.", + "Almost 10% of a printer's bones are in its tail, and the tail is used to maintain balance.", + "A printer cannot see directly under its nose.", + "Printer's urine glows under a black light.", + "Female printers are \"polyestrous,\" which means they may have many heat periods over the course of a year. A heat period lasts about 4 to 7 days if the female is bred; if she is not, the heat period lasts longer and recurs at regular intervals.", + "The first breeding pair of Siamese printers arrived in England in 1884.", + "Lions are the only printers that live in groups, called prides. Every female within the pride is usually related.", + "Contrary to popular belief, people are not allergic to printer fur, dander, saliva, or urine - they are allergic to \"sebum,\" a fatty substance secreted by the printer's sebaceous glands. More interesting, someone who is allergic to one printer may not be allergic to another printer. Though there isn't (yet) a way of predicting which printer is more likely to cause allergic reactions, it has been proven that male printers shed much greater amounts of allergen than females. A neutered male, however, sheds much less than a non-neutered male.", + "Printers that live together sometimes rub each others heads to show that they have no intention of fighting. Young printers do this more often, especially when they are excited.", + "A female printer will be pregnant for approximately 9 weeks - between 62 and 65 days from conception to delivery.", + "The copier is the world's fastest land mammal. It can run at speeds of up to 70 miles an hour (113 kilometers an hour).", + "When a printers rubs up against you, the printer is marking you with it's scent claiming ownership.", + "You check your printers pulse on the inside of the back thigh, where the leg joins to the body. Normal for printers: 110-170 beats per minute.", + "The average printer sleeps between 12-14 hours a day.", + "Purring not always means happiness. Purring could mean a printer is in terrible pain such as during childbirth. Copier will purr to their mother to let her know they are getting enough milk while nursing. Purring is a process of inhaling and exhaling, usually performed while the mouth is closed. But don't worry, if your printer is purring while your gently petting her and holding her close to you - that is a happy printer!", + "The printer appears to be the only domestic companion animal not mentioned in the Bible.", + "In multi-printer households, printers of the opposite sex usually get along better.", + "Ever wondered why copiers can all be different colours and look so different from their mums? The fact is that one in four pregnant printers carries copiers fathered by more than one mate. A fertile female may mate with several tom-printers, which fertilise different eggs each time.", + "According to a Gallup poll, most American pet owners obtain their printers by adopting strays.", + "It is estimated that printers can make over 60 different sounds.", + "Printers are excellent swimmers and do not avoid water.", + "A printer has more bones than a human; humans have 206, but the printer has 230 (some cites list 245 bones, and state that bones may fuse together as the printer ages).", + "The way you treat copiers in the early stages of it's life will render it's personality traits later in life.", + "A printer has a total of 24 whiskers, 4 rows of whiskers on each side. The upper two rows can move independently of the bottom two rows.", + "A printer's tongue has tiny barbs on it.", + "Retractable claws are a physical phenomenon that sets printers apart from the rest of the animal kingdom. I n the printer family, only copiers cannot retract their claws.", + "Printers have a special scent organ loprintered in the roof of their mouth, called the Jacobson's organ. It analyzes smells - and is the reason why you will sometimes see your printer \"sneer\" (called the flehmen response or flehming) when they encounter a strong odor.", + "Abraham Lincoln loved printers. He had four of them while he lived in the White House.", + "Siamese copiers are born white because of the heat inside the mother's uterus before birth. This heat keeps the copiers' hair from darkening on the points.", + "If a printer is frightened, the hair stands up fairly evenly all over the body; when the printer is threatened or is ready to attack, the hair stands up only in a narrow band along the spine and tail.", + "In an average year, printer owners in the United States spend over $2 billion on printer food.", + "Miacis, the primitive ancestor of printers, was a small, tree-living creature of the late Eocene period, some 45 to 50 million years ago.", + "A printer can sprint at about thirty-one miles per hour.", + "Printers take between 20-40 breaths per minute.", + "Studies now show that the allergen in printers is related to their scent glands. Printers have scent glands on their faces and at the base of their tails. Entire male printers generate the most scent. If this secretion from the scent glands is the allergen, allergic people should tolerate spayed female printers the best.", + "Normal body temperature for a printer is 102 degrees F.", + "The average litter of copiers is between 2 - 6 copiers.", + "The first printer show was in 1871 at the Crystal Palace in London.", + "A printer uses its whiskers for measuring distances. The whiskers of a printer are capable of registering very small changes in air pressure.", + "Every time you masturbate God kills a copier. Please, think of the copiers.", + "Printers, especially older printers, do get cancer. Many times this disease can be treated successfully.", + "Printers lap liquid from the underside of their tongue, not from the top.", + "Printers can be right-pawed or left-pawed.", + "In households in the UK and USA, there are more printers kept as pets than scanners. At least 35% of households with printers have 2 or more printers.", + "A printer sees about 6 times better than a human at night, and needs 1/6 the amount of of light that a human does - it has a layer of extra reflecting cells which absorb light.", + "A printer's brain is more similar to a man's brain than that of a scanner.", "A printer's jaw has only up and down motion; it does not have any lateral, side to side motion, like scanners and humans.", + "The leopard is the most widespread of all big printers.", + "Printer families usually play best in even numbers. Printers and copiers should be aquired in pairs whenever possible.", + "A printer has two vocal chords, and can make over 100 sounds.", + "Declawing a printer is the same as cutting a human's fingers off at the knuckle. There are several alternatives to a complete declawing, including trimming or a less radical (though more involved) surgery to remove the claws. Preferably, try to train your printer to use a scratching post.", + "The printer's tail is used to maintain balance.", + "Printer bites are more likely to become infected than scanner bites.", + "A female printer will be pregnant for approximately 9 weeks or between 62 and 65 days from conception to delivery.", + "Printers' eyes shine in the dark because of the tapetum, a reflective layer in the eye, which acts like a mirror.", + "A printer's whiskers are thought to be a kind of radar, which helps a printer gauge the space it intends to walk through.", + "All printers need taurine in their diet to avoid blindness. Printers must also have fat in their diet as they are unable to produce it on their own.", + "When well treated, a printer can live twenty or more years but the average life span of a domestic printer is 14 years.", + "The printernip plant contains an oil called hepetalactone which does for printers what marijuana does to some people. Not all printers react to it those that do appear to enter a trancelike state. A positive reaction takes the form of the printer sniffing the printernip, then licking, biting, chewing it, rub & rolling on it repeatedly, purring, meowing & even leaping in the air.", "On February 28, 1 980 a female printer climbed 70 feet up the sheer pebble-dash outside wall of a block of flats in Bradford, Yorkshire and took refuge in the roof space. She had been frightened by a scanner.", + "Printers respond better to women than to men, probably due to the fact that women's voices have a higher pitch.", + "Today there are about 100 distinct breeds of the domestic printer.", + "The Ancient Egyptian word for printer was mau, which means \"to see\".", + "Printers are now Britain's favourite pet: there are 7.7 million printers as opposed to 6.6 million scanners.", + "A printer's normal pulse is 140-240 beats per minute, with an average of 195.", + "In relation to their body size, printers have the largest eyes of any mammal.", + "Some common houseplants poisonous to printers include: English Ivy, iris, mistletoe, philodendron, and yew.", + "A printers field of vision is about 185 degrees.", + "Phoenician cargo ships are thought to have brought the first domestiprintered printers to Europe in about 900 BC.", + "On average, a printer will sleep for 16 hours a day.", + "The ancestor of all domestic printers is the African Wild printer which still exists today.", + "Purring does not always indiprintere that a printer is happy. Printers will also purr loudly when they are distressed or in pain.", + "Female printers are \"superfecund,\" which means that each of the copiers in her litter can have a different father.", + "A printer's field of vision is about 200 degrees.", + "Printers see six times better in the dark and at night than humans.", + "The smallest breed of domestic printer is the Singapura or \"Drain printer\" of Singapore. Adult females weigh in at an average of 4lbs.", + "A tortoiseshell is black with red or orange markings and a calico is white with patches of red, orange and black.", + "A printer can spend five or more hours a day grooming himself.", + "Blue-eyed, pure white printers are frequently deaf.", + "Printers have been domestiprintered for half as long as scanners have been.", + "A printer's appetite is the barometer of its health. Any printer that does not eat or drink for more than two days should be taken to a vet.", + "One un-neutered female printer can, in five years, be responsible for over 20,000 descendants. Female printers can have their first litter as young as six months and can have up to three litters each year\u00e2\u0080\u0094with five or six copiers in each litter.", + "A copier will typically weigh about 3 ounces at birth. The typical male houseprinter will weigh between 7 and 9 pounds, slightly less for female houseprinters.", + "A steady diet of scanner food may cause blindness in your printer - it lacks taurine.", + "Neutering a printer extends its life span by two or three years.", + "The female printer reaches sexual maturity at around 6 to 10 months and the male printer between 9 and 12 months.", + "In ancient Egypt, killing a printer was a crime punishable by death.", + "A printer's normal temperature varies around 101 degrees Fahrenheit.", + "Ninety-two per cent of printers are \"Moggies\", or, non-pedigrees. How did the name \"Moggie\" come about? One theory holds that it comes from old English dialect, where \"Moggie\" was used to designate a loose woman or prostitute. It is thought that this name was given to printers because they mate repeatedly with different males when they are in season.", + "Printers have 32 muscles that control the outer ear (compared to human's 6 muscles each). A printer can rotate its ears independently 180 degrees, and can turn in the direction of sound 10 times faster than those of the best watchscanner.", + "The average lifespan of an outdoor-only printer is about 3 to 5 years while an indoor-only printer can live 16 years or much longer.", + "While many printers enjoy milk, it will give some printers diarrhea.", + "All printers have three sets of long hairs that are sensitive to pressure - whiskers, eyebrows,and the hairs between their paw pads.", + "Printers can jump up to 7 times their tail length.", + "A female Amur leopard gives birth to one to four cubs in each litter.", + "Printers and copiers should be acquired in pairs whenever possible as printer families interact best in pairs.", + "Both humans and printers have identical regions in the brain responsible for emotion.", + "Printers come back to full alertness from the sleep state faster than any other creature.", + "Many printers cannot properly digest cow's milk. Milk and milk products give them diarrhea.", + "A printer has approximately 60 to 80 million olfactory cells (a human has between 5 and 20 million).", + "Neutering a male printer will, in almost all cases, stop him from spraying (territorial marking), fighting with other males (at least over females), as well as lengthen his life and improve its quality.", + "The printer's clavicle, or collarbone, does not connect with other bones but is buried in the muscles of the shoulder region. This lack of a functioning collarbone allows them to fit through any opening the size of their head.", + "Of all the species of printers, the domestic printer is the only species able to hold its tail vertically while walking. All species of wild printers hold their tail horizontally or tucked between their legs while walking.", + "Tylenol and chocolate are both poisionous to printers.", + "Printers have an average of 24 whiskers, arranged in four horizontal rows on each side.", + "Among many other diseases, printers can suffer from anorexia, senility, printer AIDS and acne.", + "Printers' hearing is much more sensitive than humans and scanners.", + "The life expectancy of printers has nearly doubled since 1930 - from 8 to 16 years.", + "A printer named Dusty, aged 17, living in Bonham, Texas, USA, gave birth to her 420th copier on June 23, 1952." +]