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
| pub mod matrix { | |
| use num_traits::Num; | |
| pub struct Matrix<T> { | |
| pub rows: usize, | |
| pub cols: usize, | |
| data: Vec<T>, | |
| } | |
| impl<T> Matrix<T> | |
| where |
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 regex::Regex; | |
| use std::{env, fs}; | |
| use std::collections::HashMap; | |
| fn main() { | |
| let args: Vec<String> = env::args().collect(); | |
| let filename = &args[1]; | |
| let contents = fs::read_to_string(filename) | |
| .expect("Something went wrong reading the file"); | |
| let re = Regex::new(r"\b[a-zA-z]*").unwrap(); |
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
| def print_precision_4(x: float): | |
| print(f'{x:.4f}') | |
| print_precision_4(123.12345678) |
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
| #[macro_export] | |
| macro_rules! bec { | |
| // `()` indicates that the macro takes no argument. | |
| () => { | |
| " | |
| kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk | |
| kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk | |
| kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk | |
| kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxxxkkkkkkkkkkkkkkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk | |
| kkkkkkkkkkkkkkkkkkkkkkkkkkkkkxxkkkkkooddkkkkkkkkkkxxlcdkkkkkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk |
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
| #!/usr/bin/python | |
| # Copyright 2007 by Tobia Conforto <tobia.conforto@gmail.com> | |
| # | |
| # This program is free software; you can redistribute it and/or modify it under the terms of the GNU General | |
| # Public License as published by the Free Software Foundation; either version 2 of the License, or (at your | |
| # option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | |
| # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
OlderNewer