- Login to Datahub and setup ssh key (00:00):
- Data Hub
- Generate a new SSH Key:
ssh-keygen -t ed25519 -C "your_email@example.com"
- Start the SSH Agent:
eval "$(ssh-agent -s)"
- Add the private key to the agent:
ssh-add ~/.ssh/id_ed25519
- Copy the public key:
cat ~/.ssh/id_ed25519.pub
- Add the public key to GitHub (GitHub settings page)
- Check:
ssh -T git@github.com
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict, deque | |
def topo_sort(n_nodes, edges): | |
# Organize info from edges: | |
# 1. In degree of each node | |
# 2. Out nodes of each nodes | |
in_degree = dict.fromkeys(range(n_nodes), 0) | |
out_nodes = defaultdict(set) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash -e | |
rust_env() | |
{ | |
docker run --rm \ | |
-v $PWD:/app -w /app rust:latest \ | |
$1 | |
} | |
rust_env "rustc $1.rs" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
app: | |
image: rust | |
container_name: hello-rust | |
working_dir: /app | |
volumes: | |
- ./:/app | |
stdin_open: true |
This is a didactic version of Autograd based on Doug Maclaurin's Ph.D. Thesis. Only single-variable scalar functions are supported.
- Input:
x = Node(value=3.9)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from collections import namedtuple | |
from enum import Enum | |
grid = [ | |
'...#...O', | |
'.###..X.', | |
'...#....', | |
'.X......', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pdb import set_trace as st | |
import torch | |
import numpy as np | |
import pandas as pd | |
from torch import nn, optim | |
from torch.utils.data import Dataset, DataLoader | |
DEVICE = 'cuda:1' | |
torch.manual_seed(3985) |
NewerOlder