date | |
---|---|
|
View reorder.rs
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
#![allow(unused)] | |
fn reorder<T: Clone>(values: Vec<T>, indices: Vec<usize>) -> Vec<Option<(usize, T)>> { | |
let mut pairs: Vec<_> = indices.iter().zip(values).collect(); | |
pairs.sort_by_key(|v| v.0); | |
let mut iter = pairs.iter().peekable(); | |
(0..*pairs.last().unwrap().0 + 1) | |
.map(|i| match iter.peek() { | |
Some((j, _)) => { |
View is_odious.rs
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
//! Checks if an integer is an odious number. | |
/// Determine if an integer is an odious number. | |
/// | |
/// 14 is an odious number because it has an odd number of 1s in its binary | |
/// expansion 1110. Conversely, 5 isn't an odious number. It has an even number | |
/// of 1s in its binary expansion 101 and so is called an evil number. | |
fn is_odious(num: i64) -> bool { | |
let mut num = num; | |
let mut sum = false; |
View Trans Voice Practice Log.md
View witchhazelhypercolor.zsh-theme
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
# Witch Hazel Hypercolor ZSH Theme | |
# | |
# by @medecau and @zoeisnowooze | |
# Witch Hazel by @theacodes | |
# | |
# https://witchhazel.thea.codes/ | |
# https://twitter.com/ZoeIsNowOoze/status/1418271734327820289 | |
# | |
# 1. Create a file ~/.oh-my-zsh/custom/themes/witchhazelhypercolor.zsh-theme | |
# |
NewerOlder