summaryrefslogtreecommitdiff
path: root/meap/ch5
diff options
context:
space:
mode:
authorAdam Carpenter <gitlab@53hor.net>2019-07-09 15:14:04 -0400
committerAdam Carpenter <gitlab@53hor.net>2019-07-09 15:14:04 -0400
commit7e8ee5ed9cad6484e9f13f81731b102ced58402e (patch)
tree5395402ab07bbb5a659dbd68c701e22a1227202f /meap/ch5
downloadlearning-rust-7e8ee5ed9cad6484e9f13f81731b102ced58402e.tar.xz
learning-rust-7e8ee5ed9cad6484e9f13f81731b102ced58402e.zip
Init.
Diffstat (limited to 'meap/ch5')
-rwxr-xr-xmeap/ch5/Cargo.lock6
-rwxr-xr-xmeap/ch5/Cargo.toml7
-rwxr-xr-xmeap/ch5/src/main.rs191
-rwxr-xr-xmeap/ch5/target/.rustc_info.json1
-rwxr-xr-xmeap/ch5/target/debug/.cargo-lock0
-rwxr-xr-xmeap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/bin-ch5-46e10a775cf0013d1
-rwxr-xr-xmeap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/bin-ch5-46e10a775cf0013d.json1
-rwxr-xr-xmeap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/dep-bin-ch5-46e10a775cf0013dbin0 -> 12 bytes
-rwxr-xr-xmeap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/invoked.timestamp1
-rwxr-xr-xmeap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/dep-test-bin-ch5-9316120197002b39bin0 -> 12 bytes
-rwxr-xr-xmeap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/invoked.timestamp1
-rwxr-xr-xmeap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/test-bin-ch5-9316120197002b391
-rwxr-xr-xmeap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/test-bin-ch5-9316120197002b39.json1
-rwxr-xr-xmeap/ch5/target/debug/ch5bin0 -> 277848 bytes
-rwxr-xr-xmeap/ch5/target/debug/ch5-9316120197002b39bin0 -> 774152 bytes
-rwxr-xr-xmeap/ch5/target/debug/ch5-9316120197002b39.d1
-rwxr-xr-xmeap/ch5/target/debug/ch5.d1
-rwxr-xr-xmeap/ch5/target/debug/deps/ch5-46e10a775cf0013dbin0 -> 277848 bytes
-rwxr-xr-xmeap/ch5/target/debug/deps/ch5-46e10a775cf0013d.d5
-rwxr-xr-xmeap/ch5/target/debug/deps/ch5-9316120197002b39bin0 -> 774152 bytes
-rwxr-xr-xmeap/ch5/target/debug/deps/ch5-9316120197002b39.d5
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/131hx6aogxa3cb9n.obin0 -> 5288 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1cdx3b8nidwkkcjr.obin0 -> 3472 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1d7ea3e2fw6kzluy.obin0 -> 13896 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1p15q4obvvajv9mq.obin0 -> 9672 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1q2e7yv668xrks2m.obin0 -> 20120 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/22elhj5srsxnh4ez.obin0 -> 4728 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2ir0bpdybahl0hy4.obin0 -> 3208 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2p3ajrqqbkdrma7v.obin0 -> 5672 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2u4z51n7gy9gsonf.obin0 -> 9840 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/364nv5lvocy9crsn.obin0 -> 16312 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/3navidowtjyeu86r.obin0 -> 17088 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/3qx5mfronarx9xg4.obin0 -> 7392 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/4m23nyzrcp4d03ut.obin0 -> 9064 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/dep-graph.binbin0 -> 944780 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/query-cache.binbin0 -> 305615 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/work-products.binbin0 -> 716 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf.lock0
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/19ja0ulj1yz4dz1v.obin0 -> 6136 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/1f7hhoc63g3w6r91.obin0 -> 11648 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/23x6ryl2aphivrco.obin0 -> 3088 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/3owzc8gzkv73r1zs.obin0 -> 4728 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/3uqy65foquniypm8.obin0 -> 9176 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/46anzfvrp7k3pkxw.obin0 -> 12752 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/4h299gjco8eqonjk.obin0 -> 5672 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/dep-graph.binbin0 -> 797032 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/query-cache.binbin0 -> 253254 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/work-products.binbin0 -> 444 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/z4kfp7turnew5kb.obin0 -> 3472 bytes
-rwxr-xr-xmeap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp.lock0
50 files changed, 223 insertions, 0 deletions
diff --git a/meap/ch5/Cargo.lock b/meap/ch5/Cargo.lock
new file mode 100755
index 0000000..75eeb15
--- /dev/null
+++ b/meap/ch5/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ch5"
+version = "0.1.0"
+
diff --git a/meap/ch5/Cargo.toml b/meap/ch5/Cargo.toml
new file mode 100755
index 0000000..0754948
--- /dev/null
+++ b/meap/ch5/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ch5"
+version = "0.1.0"
+authors = ["Adam Carpenter <53hornet@gmail.com>"]
+edition = "2018"
+
+[dependencies]
diff --git a/meap/ch5/src/main.rs b/meap/ch5/src/main.rs
new file mode 100755
index 0000000..2fcf60c
--- /dev/null
+++ b/meap/ch5/src/main.rs
@@ -0,0 +1,191 @@
+////use std::mem;
+//const BIAS: i32 = 127;
+//const RADIX: f32 = 2.0;
+//
+//fn main() {
+ //let a: u16 = 0b1100_0011_1100_0011;
+ //dbg!(a);
+ ////let b: i16 = 0b1100_0011_1100_0011;
+ ////dbg!(b);
+
+// let a: f32 = 42.42;
+// let frankentype: u32 = unsafe {
+// std::mem::transmute(a)
+// };
+//
+// //println!("{:032b}", frankentype);
+
+// let mut i: u16 = 0;
+//
+// loop {
+// print!("{}\t", i);
+// if i % 10000 == 0 {
+// print!("\n");
+// }
+// i += 1000;
+// }
+
+ //let zero: u16 = 0b0000_0000_0000_0000;
+ //let one: u16 = 0b0000_0000_0000_0001;
+ //let two: u16 = 0b0000_0000_0000_0010;
+ //let big_533: u16 = 0b1111_1111_1111_1101;
+ //let big_534: u16 = 0b1111_1111_1111_1110;
+ //let big_535: u16 = 0b1111_1111_1111_1111;
+
+ //prinlt!("{}, {}, {}, ..., {}, {}, {}\n", zero, one, two, big_533, big_534, big_535);
+ //let big_533: u16 = 0b1111_1111_1111_1101;
+// let (a, b) = (200, 200);
+// let c: u8 = a + b;
+// println!("200 + 200 = {}", c);
+
+
+// let big_endian: [u8; 4] = [
+// 0xAA,
+// 0xBB,
+// 0xCC,
+// 0xDD,
+// ];
+//
+// let little_endian: [u8; 4] = [
+// 0xDD,
+// 0xCC,
+// 0xBB,
+// 0xAA,
+// ];
+//
+// let (a, b): (i32, i32) = unsafe {
+// (mem::transmute(big_endian), mem::transmute(little_endian))
+// };
+//
+// dbg!(a);
+// dbg!(b);
+
+
+// let n: f32 = 42.42;
+//
+// let (signbit, exponent, fraction) = deconstruct_f32(n);
+// let (sign, exponent, mantissa) = decode_f32_parts(signbit, exponent, fraction);
+// let reconstituted_n = f32_from_parts(sign, exponent, mantissa);
+// dbg!(n);
+// dbg!(signbit);
+// dbg!(exponent);
+// dbg!(mantissa);
+// dbg!(reconstituted_n);
+//}
+//
+//fn deconstruct_f32(n: f32) -> (u32, u32, u32) {
+// let n_: u32 = unsafe { std::mem::transmute(n) };
+//
+// let sign = (n_ >> 31) & 1;
+// let exponent = (n_ >> 23) & 0xff;
+// let fraction = 0b00000000_01111111_11111111_11111111 & n_;
+// (sign, exponent, fraction)
+//}
+//
+//fn decode_f32_parts(sign: u32, exponent: u32, fraction: u32) -> (f32, f32, f32) {
+// let signed_1 = (-1.0_f32).powf(sign as f32);
+//
+// let exponent = (exponent as i32) - BIAS;
+// let exponent = RADIX.powf(exponent as f32);
+//
+// let mut mantissa: f32 = 1.0;
+//
+// for i in 0..23_u32 {
+// let one_at_bit_i = 1 << i;
+//
+// if (one_at_bit_i & fraction) != 0 {
+// mantissa += 2_f32.powf((i as f32) - 23.0);
+// }
+// }
+//
+// (signed_1, exponent, mantissa)
+//}
+//
+//fn f32_from_parts(sign: f32, exponent: f32, mantissa: f32) -> f32 {
+// sign * exponent * mantissa
+//}
+
+fn mock_rand(n: u8) -> f32 {
+ let base: u32 = 0b0_01111110_00000000000000000000000;
+ let large_n = (n as u32) << 15;
+ let f32_bits = base | large_n;
+ let m = f32::from_bits(f32_bits);
+ 2.0 * (m - 0.5)
+}
+
+fn main() {
+ dbg!(mock_rand(0xff));
+ dbg!(mock_rand(0x77));
+ dbg!(mock_rand(0x00));
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct Q7(i8);
+
+impl From<f64> for Q7 {
+ fn from(n: f64) -> Self {
+ if n >= 1.0 {
+ Q7(127)
+ }
+ else if n <= -1.0 {
+ Q7(-128)
+ }
+ else {
+ Q7((n * 128.0) as i8)
+ }
+ }
+}
+
+impl From<Q7> for f64 {
+ fn from(n: Q7) -> f64 {
+ (n.0 as f64) * 2f64.powf(-7.0)
+ }
+}
+
+impl From<f32> for Q7 {
+ fn from(n: f32) -> Self {
+ Q7::from(n as f64)
+ }
+}
+
+impl From<Q7> for f32 {
+ fn from(n: Q7) -> f32 {
+ f64::from(n) as f32
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn out_of_bounds() {
+ assert_eq!(Q7::from(10.), Q7::from(1.));
+ assert_eq!(Q7::from(-10.), Q7::from(-1.));
+ }
+
+ #[test]
+ fn f32_to_q7() {
+ let n1: f32 = 0.7;
+ let q1 = Q7::from(n1);
+ let n2: f32 = -0.4;
+ let q2 = Q7::from(n2);
+ let n3: f32 = 123.0;
+ let q3 = Q7::from(n3);
+
+ assert_eq!(q1, Q7(89));
+ assert_eq!(q2, Q7(-51));
+ assert_eq!(q3, Q7(127));
+ }
+
+ #[test]
+ fn q7_to_f32() {
+ let q1 = Q7::from(0.7);
+ let n1 = f32::from(q1);
+ assert_eq!(n1, 0.6953125);
+
+ let q2 = Q7::from(n1);
+ let n2 = f32::from(q2);
+ assert_eq!(n1, n2);
+ }
+}
diff --git a/meap/ch5/target/.rustc_info.json b/meap/ch5/target/.rustc_info.json
new file mode 100755
index 0000000..fd08c40
--- /dev/null
+++ b/meap/ch5/target/.rustc_info.json
@@ -0,0 +1 @@
+{"rustc_fingerprint":5361904215157244162,"outputs":{"1164083562126845933":["rustc 1.34.0\nbinary: rustc\ncommit-hash: unknown\ncommit-date: unknown\nhost: x86_64-unknown-linux-gnu\nrelease: 1.34.0\nLLVM version: 8.0\n",""],"1617349019360157463":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/usr\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""],"15337506775154344876":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/usr\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""]},"successes":{}} \ No newline at end of file
diff --git a/meap/ch5/target/debug/.cargo-lock b/meap/ch5/target/debug/.cargo-lock
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/meap/ch5/target/debug/.cargo-lock
diff --git a/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/bin-ch5-46e10a775cf0013d b/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/bin-ch5-46e10a775cf0013d
new file mode 100755
index 0000000..42ae9c8
--- /dev/null
+++ b/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/bin-ch5-46e10a775cf0013d
@@ -0,0 +1 @@
+9321ce8cbb8a0f0f \ No newline at end of file
diff --git a/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/bin-ch5-46e10a775cf0013d.json b/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/bin-ch5-46e10a775cf0013d.json
new file mode 100755
index 0000000..eb42c8d
--- /dev/null
+++ b/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/bin-ch5-46e10a775cf0013d.json
@@ -0,0 +1 @@
+{"rustc":17307852377973297654,"features":"[]","target":8256848390295098997,"profile":14996655781355331481,"path":1036222786711178230,"deps":[],"local":[{"MtimeBased":[[1555954931,979396700],".fingerprint/ch5-46e10a775cf0013d/dep-bin-ch5-46e10a775cf0013d"]}],"rustflags":[],"edition":"Edition2018"} \ No newline at end of file
diff --git a/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/dep-bin-ch5-46e10a775cf0013d b/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/dep-bin-ch5-46e10a775cf0013d
new file mode 100755
index 0000000..e046c38
--- /dev/null
+++ b/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/dep-bin-ch5-46e10a775cf0013d
Binary files differ
diff --git a/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/invoked.timestamp b/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/invoked.timestamp
new file mode 100755
index 0000000..e00328d
--- /dev/null
+++ b/meap/ch5/target/debug/.fingerprint/ch5-46e10a775cf0013d/invoked.timestamp
@@ -0,0 +1 @@
+This file has an mtime of when this was started. \ No newline at end of file
diff --git a/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/dep-test-bin-ch5-9316120197002b39 b/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/dep-test-bin-ch5-9316120197002b39
new file mode 100755
index 0000000..e046c38
--- /dev/null
+++ b/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/dep-test-bin-ch5-9316120197002b39
Binary files differ
diff --git a/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/invoked.timestamp b/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/invoked.timestamp
new file mode 100755
index 0000000..e00328d
--- /dev/null
+++ b/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/invoked.timestamp
@@ -0,0 +1 @@
+This file has an mtime of when this was started. \ No newline at end of file
diff --git a/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/test-bin-ch5-9316120197002b39 b/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/test-bin-ch5-9316120197002b39
new file mode 100755
index 0000000..7a4b840
--- /dev/null
+++ b/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/test-bin-ch5-9316120197002b39
@@ -0,0 +1 @@
+e2c4abe1a5ced339 \ No newline at end of file
diff --git a/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/test-bin-ch5-9316120197002b39.json b/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/test-bin-ch5-9316120197002b39.json
new file mode 100755
index 0000000..f7916db
--- /dev/null
+++ b/meap/ch5/target/debug/.fingerprint/ch5-9316120197002b39/test-bin-ch5-9316120197002b39.json
@@ -0,0 +1 @@
+{"rustc":17307852377973297654,"features":"[]","target":8256848390295098997,"profile":8248545651247322450,"path":1036222786711178230,"deps":[],"local":[{"MtimeBased":[[1555954930,625381200],".fingerprint/ch5-9316120197002b39/dep-test-bin-ch5-9316120197002b39"]}],"rustflags":[],"edition":"Edition2018"} \ No newline at end of file
diff --git a/meap/ch5/target/debug/ch5 b/meap/ch5/target/debug/ch5
new file mode 100755
index 0000000..55a50fd
--- /dev/null
+++ b/meap/ch5/target/debug/ch5
Binary files differ
diff --git a/meap/ch5/target/debug/ch5-9316120197002b39 b/meap/ch5/target/debug/ch5-9316120197002b39
new file mode 100755
index 0000000..9b0d631
--- /dev/null
+++ b/meap/ch5/target/debug/ch5-9316120197002b39
Binary files differ
diff --git a/meap/ch5/target/debug/ch5-9316120197002b39.d b/meap/ch5/target/debug/ch5-9316120197002b39.d
new file mode 100755
index 0000000..ea0bc38
--- /dev/null
+++ b/meap/ch5/target/debug/ch5-9316120197002b39.d
@@ -0,0 +1 @@
+/home/carpenat/devel/learning-rust/meap/ch5/target/debug/ch5-9316120197002b39: /home/carpenat/devel/learning-rust/meap/ch5/src/main.rs
diff --git a/meap/ch5/target/debug/ch5.d b/meap/ch5/target/debug/ch5.d
new file mode 100755
index 0000000..0b93f00
--- /dev/null
+++ b/meap/ch5/target/debug/ch5.d
@@ -0,0 +1 @@
+/home/carpenat/devel/learning-rust/meap/ch5/target/debug/ch5: /home/carpenat/devel/learning-rust/meap/ch5/src/main.rs
diff --git a/meap/ch5/target/debug/deps/ch5-46e10a775cf0013d b/meap/ch5/target/debug/deps/ch5-46e10a775cf0013d
new file mode 100755
index 0000000..55a50fd
--- /dev/null
+++ b/meap/ch5/target/debug/deps/ch5-46e10a775cf0013d
Binary files differ
diff --git a/meap/ch5/target/debug/deps/ch5-46e10a775cf0013d.d b/meap/ch5/target/debug/deps/ch5-46e10a775cf0013d.d
new file mode 100755
index 0000000..1fcde82
--- /dev/null
+++ b/meap/ch5/target/debug/deps/ch5-46e10a775cf0013d.d
@@ -0,0 +1,5 @@
+/home/carpenat/devel/learning-rust/meap/ch5/target/debug/deps/ch5-46e10a775cf0013d: src/main.rs
+
+/home/carpenat/devel/learning-rust/meap/ch5/target/debug/deps/ch5-46e10a775cf0013d.d: src/main.rs
+
+src/main.rs:
diff --git a/meap/ch5/target/debug/deps/ch5-9316120197002b39 b/meap/ch5/target/debug/deps/ch5-9316120197002b39
new file mode 100755
index 0000000..9b0d631
--- /dev/null
+++ b/meap/ch5/target/debug/deps/ch5-9316120197002b39
Binary files differ
diff --git a/meap/ch5/target/debug/deps/ch5-9316120197002b39.d b/meap/ch5/target/debug/deps/ch5-9316120197002b39.d
new file mode 100755
index 0000000..db8c5a6
--- /dev/null
+++ b/meap/ch5/target/debug/deps/ch5-9316120197002b39.d
@@ -0,0 +1,5 @@
+/home/carpenat/devel/learning-rust/meap/ch5/target/debug/deps/ch5-9316120197002b39: src/main.rs
+
+/home/carpenat/devel/learning-rust/meap/ch5/target/debug/deps/ch5-9316120197002b39.d: src/main.rs
+
+src/main.rs:
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/131hx6aogxa3cb9n.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/131hx6aogxa3cb9n.o
new file mode 100755
index 0000000..d264453
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/131hx6aogxa3cb9n.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1cdx3b8nidwkkcjr.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1cdx3b8nidwkkcjr.o
new file mode 100755
index 0000000..d6f37e3
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1cdx3b8nidwkkcjr.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1d7ea3e2fw6kzluy.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1d7ea3e2fw6kzluy.o
new file mode 100755
index 0000000..2813ba1
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1d7ea3e2fw6kzluy.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1p15q4obvvajv9mq.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1p15q4obvvajv9mq.o
new file mode 100755
index 0000000..550f6ec
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1p15q4obvvajv9mq.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1q2e7yv668xrks2m.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1q2e7yv668xrks2m.o
new file mode 100755
index 0000000..fa50a3d
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/1q2e7yv668xrks2m.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/22elhj5srsxnh4ez.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/22elhj5srsxnh4ez.o
new file mode 100755
index 0000000..315f427
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/22elhj5srsxnh4ez.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2ir0bpdybahl0hy4.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2ir0bpdybahl0hy4.o
new file mode 100755
index 0000000..5aa30d1
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2ir0bpdybahl0hy4.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2p3ajrqqbkdrma7v.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2p3ajrqqbkdrma7v.o
new file mode 100755
index 0000000..f2c77e0
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2p3ajrqqbkdrma7v.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2u4z51n7gy9gsonf.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2u4z51n7gy9gsonf.o
new file mode 100755
index 0000000..1344f76
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/2u4z51n7gy9gsonf.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/364nv5lvocy9crsn.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/364nv5lvocy9crsn.o
new file mode 100755
index 0000000..5eba2e5
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/364nv5lvocy9crsn.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/3navidowtjyeu86r.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/3navidowtjyeu86r.o
new file mode 100755
index 0000000..a0fd21e
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/3navidowtjyeu86r.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/3qx5mfronarx9xg4.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/3qx5mfronarx9xg4.o
new file mode 100755
index 0000000..a712dee
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/3qx5mfronarx9xg4.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/4m23nyzrcp4d03ut.o b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/4m23nyzrcp4d03ut.o
new file mode 100755
index 0000000..95f33a1
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/4m23nyzrcp4d03ut.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/dep-graph.bin b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/dep-graph.bin
new file mode 100755
index 0000000..8ed9093
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/dep-graph.bin
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/query-cache.bin b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/query-cache.bin
new file mode 100755
index 0000000..3955087
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/query-cache.bin
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/work-products.bin b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/work-products.bin
new file mode 100755
index 0000000..bfe2e7f
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf-3o9kzrrypqiit/work-products.bin
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf.lock b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf.lock
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-17kbpbgfrls49/s-fbjfts8jbk-14hg0gf.lock
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/19ja0ulj1yz4dz1v.o b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/19ja0ulj1yz4dz1v.o
new file mode 100755
index 0000000..c3fcc9c
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/19ja0ulj1yz4dz1v.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/1f7hhoc63g3w6r91.o b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/1f7hhoc63g3w6r91.o
new file mode 100755
index 0000000..2783bf8
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/1f7hhoc63g3w6r91.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/23x6ryl2aphivrco.o b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/23x6ryl2aphivrco.o
new file mode 100755
index 0000000..518e19c
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/23x6ryl2aphivrco.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/3owzc8gzkv73r1zs.o b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/3owzc8gzkv73r1zs.o
new file mode 100755
index 0000000..74090b8
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/3owzc8gzkv73r1zs.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/3uqy65foquniypm8.o b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/3uqy65foquniypm8.o
new file mode 100755
index 0000000..ea34984
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/3uqy65foquniypm8.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/46anzfvrp7k3pkxw.o b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/46anzfvrp7k3pkxw.o
new file mode 100755
index 0000000..8b671f6
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/46anzfvrp7k3pkxw.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/4h299gjco8eqonjk.o b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/4h299gjco8eqonjk.o
new file mode 100755
index 0000000..011d32a
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/4h299gjco8eqonjk.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/dep-graph.bin b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/dep-graph.bin
new file mode 100755
index 0000000..9a93196
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/dep-graph.bin
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/query-cache.bin b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/query-cache.bin
new file mode 100755
index 0000000..96e60c7
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/query-cache.bin
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/work-products.bin b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/work-products.bin
new file mode 100755
index 0000000..0a738b9
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/work-products.bin
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/z4kfp7turnew5kb.o b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/z4kfp7turnew5kb.o
new file mode 100755
index 0000000..1b79b07
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp-3tleo0bnauax0/z4kfp7turnew5kb.o
Binary files differ
diff --git a/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp.lock b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp.lock
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/meap/ch5/target/debug/incremental/ch5-1nqr1jka2is12/s-fbjftt1asz-1fv6llp.lock