Skip to content

Instantly share code, notes, and snippets.

View chezbgone's full-sized avatar
💭
creating strange new universes out of nothing

Jason Chen chezbgone

💭
creating strange new universes out of nothing
View GitHub Profile
module Matmul where
import Data.Vector qualified as V
import Data.Vector.Mutable qualified as VM
data Matrix s r =
MkMatrix
{ matrixRows :: Int
, matrixCols :: Int
, matrixCells :: VM.MVector s (VM.MVector s r)
@chezbgone
chezbgone / wordle.hs
Created March 21, 2022 06:47
wordle implementation in haskell
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as M
import Control.Monad
import Data.Coerce
import Data.List
import Data.Maybe
@chezbgone
chezbgone / tensors.hs
Created March 1, 2022 03:05
arbitrarily nested lists with overloaded lists
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
-- for OverloadedLists
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE FlexibleInstances #-}
import GHC.Exts
import requests
import sys
import random
name_params = {
'nameOptions': random.choice(['boy_names', 'girl_names']),
'case': 'lower',
'separator': ' ',
}
password_params = {
/* Hide main tabs toolbar */
#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar {
opacity: 0;
pointer-events: none;
}
#main-window:not([tabsintitlebar="true"]) #TabsToolbar {
visibility: collapse !important;
}
/* Hide splitter, when using Tree Style Tab.
case 0 1.34244 1.13074
case 1 1.23519 1.08076
case 2 1.29861 1.09232
case 3 1.26188 1.08207
case 4 1.2716 1.09606
case 5 1.32629 1.09544
case 6 1.25706 1.08798
case 7 1.28622 1.08763
case 8 1.24646 1.0745
case 9 1.25103 1.06588
%SCRIPT
editor.write("\\]");
cursor.movePosition(2, cursorEnums.PreviousCharacter);
editor.write("[\n\n");
cursor.movePosition(1, cursorEnums.Up);
editor.write("\t");
data={1,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,7,7,7,7,8,8,9,10,4}
Labeled[Labeled[
Show[Histogram[data, 10, PlotTheme -> "Monochrome",
AspectRatio -> 1/2, Axes -> {True, False}, Frame -> False,
ImageSize -> Large],
ContourPlot[{0 == (x - 0.0331028 - 1/2) (x - 10.3169 - 1/2),
0 == (x - 1.03743 - 1/2) (x - 9.31257 - 1/2),
0 == (x - 3.27893 - 1/2) (x - 7.07107 - 1/2),
y ==
40 PDF[NormalDistribution[Mean[data], StandardDeviation[data]],
import pygame
import sys
from pygame.color import THECOLORS as colordict
from math import *
from hyperbolic_geo import *
pygame.init()
size = (500, 500)
screen = pygame.display.set_mode()