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
fn factorial(n: u64) -> u64 { | |
if n == 0 || n == 1 { | |
1 | |
} else { | |
n * factorial(n - 1) | |
} | |
} | |
#[cfg(test)] | |
mod tests { |
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
fn main() { | |
fn factorial(n: u64) -> u64 { | |
if n == 0 || n == 1 { | |
1 | |
} else { | |
n * factorial(n - 1) | |
} | |
} | |
} | |
#[cfg(test)] |
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
fn main() {} | |
fn factorial(n: u64) -> u64 { | |
if n == 0 || n == 1 { | |
1 | |
} else { | |
n * factorial(n - 1) | |
} | |
} |
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
struct Feelings { | |
flag1: bool, | |
flag2: bool, | |
} | |
impl Feelings { | |
fn feel_good(&self) -> bool { | |
self.flag1 | |
} | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am masiarek on github. | |
* I am a_masiarek (https://keybase.io/a_masiarek) on keybase. | |
* I have a public key ASAptImDJxWgKF_h6FAwW5jg7pnu6lmMbV36IsXEW3X4BAo | |
To claim this, I am signing this object: |
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
import pytest | |
@pytest.fixture(autouse=True, scope="module") | |
def fix_module(): | |
print("\nFix module setup") | |
yield | |
print("\nFix module teardown") | |
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
import csv | |
from collections import defaultdict | |
dd = defaultdict(list) | |
with open("BKPF.txt") as bkpf: | |
dd = csv.DictReader(bkpf) | |
print(*dd.fieldnames, sep="|") | |
for e in dd: | |
print(*e.values()) |
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
from collections import defaultdict | |
from pprint import pp | |
left = [{1: ["10", "11"]}, {2: ["20", "21"]}] | |
right = [ | |
{"10": ["a", "b"]}, | |
{"11": ["a", "b"]}, | |
{"20": ["x", "y"]}, | |
{"21": ["x", "z"]}, # <== here is a difference! | |
] |
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
import pandas as pd | |
import io, csv | |
A = """ | |
k1,k2,a3 | |
1,44,x | |
2,55,y | |
3,66,z""" | |
B = """ |
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
import pandas as pd | |
from io import StringIO | |
import io | |
A = """ | |
k1,k2,a3 | |
1,44,x | |
2,55,y | |
3,66,z""" |