From f5dbf18c9dd168aad73be0d58e6ba21063179db4 Mon Sep 17 00:00:00 2001 From: DDjohnson21 Date: Sat, 27 Sep 2025 13:11:28 -0400 Subject: [PATCH 1/3] Made the red waymarker blue --- src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index f6e68f0..4430d4f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -29,7 +29,7 @@ const MapWrapper = styled.div` const customIcon = new Icon({ iconUrl: - "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png", + "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png", shadowUrl: "https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png", iconSize: [25, 41], From f05eed940d0f34203f54429f49e758a5d28b64c2 Mon Sep 17 00:00:00 2001 From: DDjohnson21 Date: Sat, 27 Sep 2025 14:12:09 -0400 Subject: [PATCH 2/3] Made the red waymarker green --- src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 4430d4f..7511b72 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -29,7 +29,7 @@ const MapWrapper = styled.div` const customIcon = new Icon({ iconUrl: - "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png", + "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png", shadowUrl: "https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png", iconSize: [25, 41], From c04ed4e3ac3e39a7c6b896c2d9f784aa217e2bfc Mon Sep 17 00:00:00 2001 From: DDjohnson21 Date: Sat, 27 Sep 2025 14:15:07 -0400 Subject: [PATCH 3/3] sorting random things for random reasons --- random_sort.py | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 random_sort.py diff --git a/random_sort.py b/random_sort.py new file mode 100644 index 0000000..c2f4f39 --- /dev/null +++ b/random_sort.py @@ -0,0 +1,60 @@ +"""Tiny demo of an intentionally random sorting algorithm. + +This exposes `random_sort`, which performs a bogosort-style shuffle until the +sequence happens to be ordered. It is useful purely for experimentation and +should not be used for production sorting needs. +""" + +from __future__ import annotations + +import random +from typing import List, Sequence, TypeVar + + +T = TypeVar("T") + + +def is_sorted(values: Sequence[T]) -> bool: + """Return True when the provided sequence is monotonically non-decreasing.""" + + return all(values[idx] <= values[idx + 1] for idx in range(len(values) - 1)) + + +def random_sort(values: Sequence[T], max_attempts: int = 10000) -> List[T]: + """Sort `values` by repeatedly shuffling until the list is ordered. + + Args: + values: Any finite sequence of comparable items. + max_attempts: Upper bound on the number of shuffles; the function raises + `RuntimeError` once this threshold is exceeded. + + Returns: + A new list containing the items from `values` arranged in ascending + order. + + Raises: + RuntimeError: If the data could not be sorted within `max_attempts` + shuffles. + """ + + attempt = 0 + candidate = list(values) + while attempt < max_attempts: + if is_sorted(candidate): + return candidate + random.shuffle(candidate) + attempt += 1 + + raise RuntimeError( + "Failed to randomly sort values within the allotted shuffle budget." + ) + + +if __name__ == "__main__": + SAMPLE = [3, 1, 2] + try: + result = random_sort(SAMPLE) + except RuntimeError as exc: # pragma: no cover - demonstration only + print(f"Sorting failed: {exc}") + else: + print(f"Sorted output: {result}")