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 mio::Token; | |
| pub struct TokenGenerator { | |
| recovered: Vec<Token>, | |
| next: usize, | |
| } | |
| impl TokenGenerator { | |
| pub fn new() -> TokenGenerator { | |
| TokenGenerator { |
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
| diff --git a/src/parse.rs b/src/parse.rs | |
| index cc5893e..ac2d78c 100644 | |
| --- a/src/parse.rs | |
| +++ b/src/parse.rs | |
| @@ -1,6 +1,7 @@ | |
| use xmltree::Element; | |
| - | |
| +use ElementExt; | |
| use error::*; | |
| +use types::Parse; |
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
| diff --git a/parser/src/main.rs b/parser/src/main.rs | |
| index e43f3eb..5ee9a46 100644 | |
| --- a/parser/src/main.rs | |
| +++ b/parser/src/main.rs | |
| @@ -94,7 +94,7 @@ pub fn parse(file: &str, _config: &config::Config) -> Result<model::Model> { | |
| /// If any other node is found, this function will return an error. | |
| pub fn parse_children<R: Read, F>(parser: &mut Events<R>, mut callback: F) -> Result<()> | |
| where | |
| - F: FnMut(&mut Events<R>, String, &mut Vec<OwnedProperty>) -> Result<()>, | |
| + F: FnMut(&mut Events<R>, &str, &mut Vec<OwnedProperty>) -> Result<()>, |
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
| mod rect; | |
| mod simple; | |
| use gfx::format::Format; | |
| use gfx::handle::Buffer; | |
| use gfx::pso::buffer::Structure; | |
| use gfx::traits::Pod; | |
| use gfx::Slice; | |
| use render_state::ModelRenderState; | |
| use shared::cgmath::Matrix4; |
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
| { | |
| "name": "test", | |
| "description": "This is a test module", | |
| "input": [ | |
| { | |
| "name": "a", | |
| "description": "A numeric value A", | |
| "type": "numeric", | |
| "between": [1, 100] | |
| }, |
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
| //! Module with several adding methods | |
| /// Add numbers A and B together | |
| /// | |
| /// * `a`: Numeric value a | |
| /// Between 0 and 100 | |
| /// * `b`: Numeric value b | |
| /// | |
| /// return: Values A and B added together | |
| pub fn add(a: &i32, b: &i32) -> i32 { |
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
| File { | |
| shebang: None, | |
| attrs: [ | |
| Attribute { | |
| pound_token: Pound, | |
| style: Inner( | |
| Bang | |
| ), | |
| bracket_token: Bracket, | |
| path: Path { |
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
| #[derive(Identifiable, Queryable)] | |
| #[table_name = "config"] | |
| pub struct DbConfig { | |
| pub id: Uuid, | |
| pub name: String, | |
| pub path: String, | |
| } | |
| #[derive(Debug)] | |
| pub struct Config { |
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
| std::vector<uint64_t> get_divisable_numbers(uint64_t number) | |
| { | |
| std::vector<uint64_t> result; | |
| uint64_t number_sqrt = sqrt(number); | |
| for(uint64_t i = 1; i <= number_sqrt; i++){ | |
| if((number % i) == 0) { | |
| result.push_back(i); | |
| result.push_back(number / i); | |
| } | |
| } |
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
| #include "time_utils.h" | |
| #include "number_utils.h" | |
| #include <vector> | |
| bool is_abundant(uint64_t number){ | |
| std::vector<uint64_t> divisors = get_divisable_numbers(number); | |
| uint64_t sum = 0; | |
| for(uint64_t divisor : divisors) { | |
| if(divisor == number) continue; | |
| sum += divisor; |