Run a Jupyter Data Science Notebook (or JupyterLab?) using Jupyter Docker Stacks with the current directory linked inside:
$ podman run --rm -it -p 8888:8888 -v "${PWD}":/home/jovyan/work:z docker.io/jupyter/datascience-notebook
| #!/usr/bin/env python | |
| import argparse | |
| from cryptography import exceptions | |
| from cryptography.hazmat.backends import default_backend | |
| from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305 | |
| from cryptography.hazmat.primitives.hashes import SHA256 | |
| from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC | |
| from getpass import getpass | |
| import os | |
| import sys |
| module Melsort (melsort) where | |
| -- TODO: Linked lists are not the best for this algorithm performance-wise. | |
| -- Consider a different structure, perhaps Vector. | |
| -- TODO: Some preconditions are required. | |
| push :: Ord a => a -> [[a]] -> [[a]] | |
| push x [] = [[x]] | |
| push x ([y]:ls) -- TODO: Is it possible that ls /= [] here? It's not. | |
| | x <= y = [x, y ] : ls |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| data FutureM i o a | |
| = Await (i -> FutureM i o a) | |
| | Yield o (FutureM i o a) | |
| | Done a | |
| instance Functor (FutureM i o) where | |
| fmap f (Await g) = Await (fmap f . g) |
Run a Jupyter Data Science Notebook (or JupyterLab?) using Jupyter Docker Stacks with the current directory linked inside:
$ podman run --rm -it -p 8888:8888 -v "${PWD}":/home/jovyan/work:z docker.io/jupyter/datascience-notebook
| // Source: https://blog.jcoglan.com/2020/05/12/controlling-mutation-with-types/ | |
| use std::io; | |
| use std::mem; | |
| use std::str::Chars; | |
| #[derive(Default)] | |
| struct Stack<T> { | |
| head: T, | |
| rest: Vec<T>, |
| {-# LANGUAGE AllowAmbiguousTypes #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| -- Source: https://kcsongor.github.io/symbol-parsing-haskell/ |
| library(tidyverse) | |
| # Set Monday as the first day of the week. | |
| options(lubridate.week.start = 1) | |
| theme_set( | |
| theme_minimal() + | |
| theme( | |
| panel.grid.major.x = element_blank(), | |
| panel.grid.minor.x = element_blank(), |