This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Set the number of rx/tx queues to create | |
| NUM_QUEUES=1 | |
| ## This script creates two `veth` devices, each in their own namespace. | |
| ## Each is assigned an address (192.168.66.1/30 and 192.168.66.2/30) | |
| ## They won't be able to ping each other until a bridge is made available. | |
| ## The idea is to simulate a middle-box setup (like `lqosd`), allowing | |
| ## `iperf` and other tests between the two. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use anyhow::Result; | |
| use itertools::Itertools; | |
| use serde::Deserialize; | |
| use std::fs::File; | |
| #[derive(Debug, Deserialize)] | |
| struct Row { | |
| numbers: [u8; 9], | |
| } |
This file contains hidden or 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
| [package] | |
| name = "bevy_mesh_example" | |
| version = "0.1.0" | |
| edition = "2021" | |
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
| [dependencies] | |
| bevy = "0.5" |
This file contains hidden or 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
| [package] | |
| name = "flappy_bonus" | |
| version = "0.1.0" | |
| authors = ["Herbert Wolverson <herberticus@gmail.com>"] | |
| edition = "2018" | |
| [dependencies] | |
| bracket-lib = { git = "https://github.com/amethyst/bracket-lib" } |
This file contains hidden or 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
| [package] | |
| name = "number_grouping_challenge" | |
| version = "0.1.0" | |
| edition = "2018" | |
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
| [dependencies] | |
| bracket-random = "0.8" |
This file contains hidden or 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
| fn is_prime(n: u32) -> bool { | |
| for i in 2..=n/2 { | |
| if n % i == 0 { | |
| return false; | |
| } | |
| } | |
| true | |
| } |
This file contains hidden or 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
| const DRAGON_FRAMES : [u16; 6] = [ 64, 1, 2, 3, 2, 1 ]; |
This file contains hidden or 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
| fn render(&mut self, ctx: &mut BTerm) { | |
| ctx.set_active_console(1); | |
| ctx.cls(); | |
| ctx.set_fancy( | |
| PointF::new(0.0, self.y), | |
| 1, | |
| Degrees::new(0.0), | |
| PointF::new(2.0, 2.0), | |
| WHITE, | |
| NAVY, |
This file contains hidden or 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
| fn flap(&mut self) { | |
| self.velocity = -2.0; | |
| } |
This file contains hidden or 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
| fn gravity_and_move(&mut self) { | |
| if self.velocity < 2.0 { | |
| self.velocity += 0.1; | |
| } | |
| self.y += self.velocity; | |
| if self.y < 0.0 { | |
| self.y = 0.0; | |
| } |
NewerOlder