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
| while true | |
| do | |
| for i in {1..4} | |
| do | |
| sleep 25m | |
| notify-send "Time to take a short break" | |
| sleep 5m | |
| notify-send "Time to get back to work" | |
| done | |
| notify-send "Time for a long break" |
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 std::io; | |
| #[derive(Debug)] | |
| struct TodoItem { | |
| id: u32, | |
| name: String, | |
| completed: bool, | |
| } | |
| fn complete_item(item: &mut TodoItem){ |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" href=""> | |
| <title>Code rain</title> | |
| <link rel="stylesheet" href="style.css"/> |
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 std::fs::File; | |
| use std::io::prelude::*; | |
| use std::path::Path; | |
| #[derive(Debug, Clone, Copy, PartialEq)] | |
| struct Vec3f { | |
| x: f64, | |
| y: f64, | |
| z: f64, |
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 std::fmt; | |
| use std::ops::AddAssign; | |
| #[derive(Debug, Clone, Copy, PartialEq)] | |
| struct Vec2 { | |
| x: i64, | |
| y: i64, | |
| } |
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 std::error::Error; | |
| use std::ops::RangeInclusive; | |
| use std::fmt; | |
| type MyResult<T> = Result<T, Box<dyn Error>>; | |
| #[derive(Debug)] | |
| enum ParseError { | |
| Expected(&'static str), | |
| } |
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 std::error::Error; | |
| type MyResult<T> = Result<T, Box<dyn Error>>; | |
| fn all_pairs(s: &[i64]) -> Vec<(i64, i64)> { | |
| let mut pairs: Vec<_> = Default::default(); | |
| for i in 0..s.len() { | |
| for j in 0..s.len() { | |
| pairs.push((s[i], s[j])) |
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(Debug, PartialEq)] | |
| enum CrudErr{ | |
| NotFound | |
| } | |
| #[derive(Debug, Clone, PartialEq)] | |
| struct User { | |
| id: u32, | |
| name: String, | |
| address: String, |
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
| """ | |
| Introduction | |
| There is a war and nobody knows - the alphabet war! | |
| The letters hide in their nuclear shelters. The nuclear strikes hit the battlefield and killed a lot of them. | |
| Task | |
| Write a function that accepts battlefield string and returns letters that survived the nuclear strike. | |
| The battlefield string consists of only small letters, #,[ and ]. |
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
| """ | |
| you need to build a function to return either true/True or false/False if a string can be seen as the repetition of | |
| a simpler/shorter subpattern or not | |
| For example: | |
| has_subpattern("a") == False #no repeated pattern | |
| has_subpattern("aaaa") == True #created repeating "a" | |
| has_subpattern("abcd") == False #no repeated pattern | |
| has_subpattern("abababab") == True #created repeating "ab" |
NewerOlder