Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
../target/release/2020day1 |
24.1 ± 3.8 | 20.2 | 40.4 | 25.88 ± 7.99 |
../target/release/2020day2 |
2.5 ± 0.9 | 1.8 | 14.4 | 2.67 ± 1.18 |
../target/release/2020day3 |
1.2 ± 1.1 | 0.7 | 25.8 | 1.33 ± 1.21 |
../target/release/2020day4 |
2.2 ± 0.7 | 1.5 | 12.5 | 2.34 ± 1.00 |
../target/release/2020day5 |
1.2 ± 0.6 | 0.8 | 16.5 | 1.30 ± 0.69 |
../target/release/2020day6 |
2.2 ± 0.6 | 1.6 | 6.6 | 2.38 ± 0.87 |
../target/release/2020day7 |
14.7 ± 3.8 | 12.1 | 43.6 | 15.84 ± 5.88 |
../target/release/2020day8 |
4.8 ± 0.9 | 4.0 | 9.2 | 5.14 ± 1.67 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def queens(n, i, a, b, c): | |
if i < n: | |
for j in range(n): | |
if j not in a and i+j not in b and i-j not in c: | |
yield from queens(n, i+1, a+[j], b+[i+j], c+[i-j]) | |
else: | |
yield a | |
def sudoku_ok(solution): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Related to a comment from @nrc regarding Hash<Ty> and Borrow<Ty> interactions... | |
// I wonder if a generic hash implementation of: | |
impl<Outer: Borrow<Inner>, Inner: Hash> Hash for Outer { | |
fn hash<H: Hasher>(self: &Outer, state: &mut H) { | |
self.borrow().hash(state); | |
} | |
} | |
// Might solve the issue? Or at least mean that there's a generic way to deal with it? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trace!("Preparing an Interval to run the requests"); | |
let always_defs = futures::stream::iter_ok(raw_defs.iter().cycle()); | |
let every_100ms = Interval::new(Instant::now(), Duration::from_millis(100)); | |
let zipped = every_100ms.zip(always_defs); | |
tokio::spawn(zipped.map_err(|_| ()).for_each(move |(_, def)| { | |
let req = def.request(); | |
let dest = req.sendto(); | |
let packet = req.packet().to_vec(); | |
let targ = sender.clone(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate socketcan; | |
extern crate tokio; | |
extern crate futures; | |
extern crate mio; | |
use mio::{Ready, Poll, PollOpt, Token}; | |
use mio::event::Evented; | |
use mio::unix::EventedFd; | |
use tokio::reactor::PollEvented2; |
I hereby claim:
- I am kinnison on github.
- I am kinnison (https://keybase.io/kinnison) on keybase.
- I have a public key whose fingerprint is 1956 8523 759E 2A28 58F4 606B 3CCE BABE 206C 3B69
To claim this, I am signing this object: