graph LR
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
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
// source: https://www.youtube.com/watch?v=Wim9WJeDTHQ | |
// Python implementation: https://gist.github.com/ilotoki0804/fcec5d437354e5094b620b1450986299 | |
// Not using threading: https://gist.github.com/ilotoki0804/2fa26d0e3ba4cb34eae76615f9070080 | |
use std::fmt::{Display, Debug}; | |
use std::thread; | |
struct DigitsGenerator(u64, Option<Vec<u8>>); | |
impl DigitsGenerator { |
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
// source: https://www.youtube.com/watch?v=Wim9WJeDTHQ | |
// Python implementation: https://gist.github.com/ilotoki0804/fcec5d437354e5094b620b1450986299 | |
// Using threading: https://gist.github.com/ilotoki0804/34f8331a23eb28a693149fb8c0314d7f | |
use std::fmt::{Display, Debug}; | |
struct DigitsGenerator(u64, Option<Vec<u8>>); | |
impl DigitsGenerator { | |
fn new(i: u64) -> Self { |
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 with_role_decorator(f): | |
def wrapper(filename: str): | |
connection = open(filename, 'rb') | |
try: | |
return f(connection) | |
finally: | |
connection.close() | |
return wrapper | |
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 add_at_tuple(n): | |
tuple_ = () | |
for i in range(n): | |
tuple_ = tuple_ + (i,) | |
return tuple_ | |
def use_list(n): | |
list_ = [] | |
for i in range(n): |
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
# source: https://www.youtube.com/watch?v=Wim9WJeDTHQ | |
# Rust implementation: https://gist.github.com/ilotoki0804/34f8331a23eb28a693149fb8c0314d7f | |
from itertools import count, combinations_with_replacement | |
from functools import reduce | |
from operator import mul | |
import sys | |
sys.set_int_max_str_digits(0) |