Skip to content

Instantly share code, notes, and snippets.

View Jason-Young-AI's full-sized avatar
💯
Striving

Jason Young Jason-Young-AI

💯
Striving
View GitHub Profile
from math import comb
# Implementation of DAG counter
def dagcount(n):
a = {}
a[0] = 1
for h in range(1,n+1):
a[h] = 0
for k in range(1,h+1):
a[h] += (-1)**(k+1) * comb(h,k) * 2**(k*(h-k)) * a[h-k]
@gokman
gokman / multiple angular app configuration for nginx
Created December 30, 2019 11:48
multiple angular app configuration for nginx
1. build app1 project with prod flag
ng build --prod
2. copy files under dist folder to the server
scp -r dist/app1/* {username}@{ip address of server}:/var/www/app1/
3. set base href of application (app1 works on /)
<base href="/">
4. build app2 project with prod flag
@karpathy
karpathy / min-char-rnn.py
Last active June 16, 2024 04:05
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)