%%{init: {
'theme': 'base',
'themeVariables': {
'primaryColor': '#bdb9b9ff',
'primaryTextColor': '#333333',
'primaryBorderColor': '#333333',
'lineColor': '#666666'
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
| from itertools import permutations | |
| items = ["a", "b", "c"] | |
| perms = permutations(items) | |
| for p in perms: | |
| print(p) | |
| # list combinations | |
| from itertools import combinations |
Let me help explain both parameters in detail: For the verify parameter:
It can accept several formats:
True/False (boolean) for enabling/disabling verification A path to a CA bundle file (string) A path to a directory containing CA certificates (string) A ssl.SSLContext instance
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 | |
| # @meta version 1.0.0 | |
| # @option --pdf path to pdf file. | |
| # The file is processed and saved as 'raw-text.txt' | |
| # in the current directory. | |
| `eval "$(argc --argc-eval "$0" "$@")"` | |
| if [ -z "${argc_pdf}" ]; then | |
| echo "Try --help" | |
| exit 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
| import sys | |
| def addU(s): | |
| if s[-1] == 'I': | |
| return [f'{s}U'] | |
| else: | |
| return [] | |
| def dupMx(s): | |
| if s[0] == 'M': |
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
| Parity of 0123 permutations: | |
| - 4! = 24 sequences | |
| Rules: | |
| - a shift left changes parity | |
| - sequence reversal is the same parity | |
| - single swap changes parity | |
| 0123 even 3210 even | |
| 1230 odd 0321 odd |
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
| # Type declaration | |
| variable "users" { | |
| type = map(object({ | |
| role = string | |
| })) | |
| default = { | |
| "mike" = { "role" = "admin" } | |
| "steve" = { "role" = "user" } | |
| "joe" = { "role" = "admin" } | |
| } |
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::cmp::Ordering; | |
| #[derive(Debug)] | |
| struct Trade { | |
| shares: f64, | |
| price: f64 | |
| } | |
| impl Trade { |
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::{self, Write}, str::FromStr}; | |
| fn main() { | |
| let name = input("What's your name? "); | |
| let number: f64 = input_num("What's your favorite number? "); | |
| println!("{name}'s favorite number is {number:.2}."); | |
| } | |
| fn input(prompt: &str) -> String { | |
| let mut line = String::new(); |
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 int HOMEPLANET = 9; | |
| const int MINTRIP = 5; | |
| void Main() | |
| { | |
| var exoplanets = new List<int> { 3,4,8,4,7,8,6,2 }; | |
| var jumps = getFirstTwo(exoplanets); | |
| var tripsHome = new Dictionary<string,List<int>>(); | |
| while (jumps.Count > 0) |
NewerOlder