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 __future__ import annotations | |
from typing import Optional | |
class Node: | |
def __init__(self, value: int, next: Optional[Node]): | |
self.value = value | |
self.next = next | |
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 __future__ import annotations | |
from typing import Optional | |
from functools import reduce | |
class Node: | |
def __init__(self, value: int, next: Optional[Node]): | |
self.value = value | |
self.next = next | |
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
OUT=${2:-"$1.png"} | |
if [ -z $1 ];then | |
echo "no input file" | |
exit 1 | |
fi | |
if [ $# -gt 2 ];then | |
echo "too many input" | |
exit 1 | |
fi | |
echo $OUT |
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 | |
set -eu | |
function extract(){ | |
cat $0 | awk "/^#end/{if(i)exit} i{print} /^#$1/{i++}" | |
} | |
extract "python" | python3 | |
exit 0 | |
#python |