A Pen by LaudateCorpus1 on CodePen.
This file contains 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 fitz # PyMuPDF | |
import re | |
import torch | |
from torch.utils.data import Dataset, DataLoader | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
from transformers import AdamW | |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
def extract_text_from_pdf(pdf_path): |
This file contains 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
deb https://mirrors.mit.edu/ubuntu/dist/ jammy restricted main multiverse universe | |
deb https://mirrors.mit.edu/ubuntu/dists/ jammy-backports restricted main multiverse universe | |
deb https://mirrors.mit.edu/ubuntu/dist/ jammy-proposed restricted main multiverse universe | |
deb https://mirrors.mit.edu/ubuntu/dist/ jammy-security restricted main multiverse universe | |
deb https://mirrors.mit.edu.ubuntu/dist/ jammy-updates restricted main multiverse universe |
This file contains 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
deb https://mirrors.mit.edu/ubuntu/ jammy restricted main multiverse universe | |
# deb https://mirrors.mit.edu/ubuntu/ jammy main | |
# deb https://mirrors.mit.edu/ubuntu/ jammy multiverse | |
# deb https://mirrors.mit.edu/ubuntu/ jammy restricted | |
# deb https://mirrors.mit.edu/ubuntu/ jammy universe | |
# deb-src https://mirrors.mit.edu/ubuntu/ jammy restricted main multiverse universe | |
# deb-src https://mirrors.mit.edu/ubuntu/ jammy main | |
# deb-src https://mirrors.mit.edu/ubuntu/ jammy multiverse | |
# deb-src https://mirrors.mit.edu/ubuntu/ jammy restricted | |
# deb-src https://mirrors.mit.edu/ubuntu/ jammy universe |
This file contains 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
/*! | |
Math.uuid.js (v1.4) | |
http://www.broofa.com | |
mailto:robert@broofa.com | |
Copyright (c) 2010 Robert Kieffer | |
Dual licensed under the MIT and GPL licenses. | |
*/ | |
/* |
This file contains 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
{ | |
"EA50": { | |
"name": "Eclipse 550", | |
"galph": 76, | |
"category": "VLJ" | |
}, | |
"LJ31": { | |
"name": "Learjet 31", | |
"galph": 202, | |
"category": "Light" |
This file contains 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
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
import numpy as np | |
import cPickle as pickle | |
import gym | |
# hyperparameters | |
H = 200 # number of hidden layer neurons | |
batch_size = 10 # every how many episodes to do a param update? | |
learning_rate = 1e-4 | |
gamma = 0.99 # discount factor for reward |
This file contains 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
#!/bin/bash | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1) | |
SERVER_NAME=vpn-$NEW_UUID | |
gcloud compute instances create $SERVER_NAME \ | |
--machine-type "n1-standard-1" \ | |
--image-family ubuntu-1604-lts \ | |
--image-project "ubuntu-os-cloud" \ | |
--boot-disk-size "20" \ | |
--boot-disk-type "pd-ssd" \ | |
--boot-disk-device-name "$NEW_UUID" \ |
This file contains 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
## How to hide API keys from github ## | |
1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while | |
retaining your commits: https://help.github.com/articles/remove-sensitive-data/ | |
2. In the terminal, create a config.js file and open it up: | |
touch config.js | |
atom config.js |
This file contains 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
//============================================================================ | |
// Name : OctaneCrawler.cpp | |
// Author : Berlin Brown (berlin dot brown at gmail.com) | |
// Version : | |
// Copyright : Copyright Berlin Brown 2012-2013 | |
// License : BSD | |
// Description : This is the simplest possible web-crawler in C++ | |
// Uses boost_regex and boost_algorithm | |
// Simplest web-crawler in honor of Aaron Swartz | |
// More Info : http://code.google.com/p/octane-crawler/ |
NewerOlder