Skip to content

Instantly share code, notes, and snippets.

@i-am-unknown-81514525
i-am-unknown-81514525 / bellman-ford.py
Last active June 10, 2024 15:25
Bellman Ford method without require terminating after n-1 sweep and fix negative cycle loop
from __future__ import annotations
import decimal
from typing import Union, Optional, Mapping
class Node:
def __init__(self, name: str, connection: Optional[Mapping[Union[str, Node], Union[float, int, decimal.Decimal]]]):
self.name = name
self.connection: dict[str, Union[float, int, decimal.Decimal]] = \
@i-am-unknown-81514525
i-am-unknown-81514525 / esoter_compile.py
Last active February 28, 2024 16:18
Esoteric Code Generator (Convert python code to a one-linear with only symbol and 5 a-z character)
import math
import traceback
from typing import Callable
COMPILING = 'hi.py'
OUT = 'out-hi.py'
# Normal style
repr_1 = '-~(()<())'
num_repr = {
@i-am-unknown-81514525
i-am-unknown-81514525 / esoter.py
Last active February 25, 2024 22:30
Esoteric Number Generator
import math
import traceback
from typing import Callable
# Normal style
repr_1 = '-~(()<())'
num_repr = {
0: f'({repr_1}>>{repr_1})',
1: f'{repr_1}',
2: f'({repr_1}<<{repr_1})',
@i-am-unknown-81514525
i-am-unknown-81514525 / functions.ipynb
Last active October 23, 2023 20:56
Python tutorial on functions: Jupyter Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.