Skip to content

Instantly share code, notes, and snippets.

import { Embedding, UMAP, Edge, Path } from "./types";
/**
* Calculates the Euclidean distance between two UMAP points.
* @param umap1 - The first UMAP point
* @param umap2 - The second UMAP point
* @returns The Euclidean distance between the two points
*/
function calculateDistance(umap1: UMAP, umap2: UMAP): number {
return Math.sqrt(
@thomasmarwitz
thomasmarwitz / tictactoe.py
Last active February 2, 2024 18:41
Simple Tic Tac Toe
from typing import Protocol, TypeAlias, Callable
from dataclasses import dataclass
from enum import Enum
import random
import re
class CellContent(Enum):
EMPTY = " "
CROSS = "X"