How to install latest GHC 7.10.2 from source + stack 0.1.6.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu
for your convinience these instuction is available as:
gist
git repo
GHC_VERSION="7.10.2"
ARCHITECTURE="x86_64"
import numpy as np | |
def spirals(n_samples=400): | |
N = n_samples | |
theta = np.sqrt(np.random.rand(N))*2*np.pi | |
r_a = 2*theta + np.pi | |
data_a = np.array([np.cos(theta)*r_a, np.sin(theta)*r_a]).T | |
x_a = data_a + np.random.randn(N,2) |
from copy import deepcopy | |
from typing import Any, Dict, Generator, List, Optional, Union | |
from typing import NamedTuple, Tuple | |
from gymnasium import spaces | |
import numpy as np | |
import torch as th | |
from stable_baselines3.common.buffers import BaseBuffer | |
from stable_baselines3.common.vec_env import VecNormalize |
# Based on min-char-rnn.py | |
# https://gist.github.com/karpathy/d4dee566867f8291f086 | |
import torch as th | |
import torch.nn as nn | |
import numpy as np | |
class Model(nn.Module): | |
def __init__(self, hidden_size, vocab_size, num_layers): |
FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime | |
ARG USER="user" | |
ARG UID="1000" | |
ARG GID="100" | |
USER "root" | |
RUN apt-get update && apt-get install -y gnupg |
Edit wpa_supplicant.conf and save it to the root of boot partition. | |
Replace the country code, ssid, and psk. | |
Full list of country codes: https://www.thinkpenguin.com/gnu-linux/country-code-list | |
On first boot, this file will be moved to /etc/wpa_supplicant/wpa_supplicant.conf where it may be edited later. |
{- | |
Brainf**k interpreter | |
Brainf**k is a Turing-complete programming language. | |
Instructions: | |
> Increment data pointer so that it points to next location in memory. | |
< Decrement data pointer so that it points to previous location in memory. | |
+ Increment the byte pointed by data pointer by 1. If it is already at its maximum value, 255, then new value will be 0. | |
- Decrement the byte pointed by data pointer by 1. If it is at its minimum value, 0, then new value will be 255. |
version: '3.1' | |
services: | |
db: | |
image: mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: CHANGE_THIS_PASSWORD | |
MYSQL_DATABASE: test_db |
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
-- Worth reading http://www.geeksforgeeks.org/convex-hull-set-2-graham-scan/ | |
import Text.Printf | |
import Data.List | |
type Point = (Double, Double) | |
-- Euclidean distance | |
dist :: (Double, Double) -> (Double, Double) -> Double | |
dist (x1, y1) (x2, y2) = sqrt (f x1 x2 + f y1 y2) |