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
(require 'request) | |
(defcustom locpilot-system-prompt | |
"\ | |
You are an Emacs code generator. \ | |
Writing comments is forbidden. \ | |
Writing test code is forbidden. \ | |
Writing English explanations is forbidden. \ | |
Only write code, nothing else." | |
;Only write until the end of function or end of class." |
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
;;; pyconf PYCONF | |
(defun runpythonproc (command-s path-to-file exec-dir &optional params venv env-vars) | |
(unless venv (setq venv "")) | |
(unless params (setq params "")) | |
(unless env-vars (setq env-vars '())) | |
(if venv | |
(progn | |
(pyvenv-deactivate) | |
(pyvenv-activate venv)) |
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
;;; Settings | |
;; (scroll-bar-mode -1) | |
(tool-bar-mode -1) | |
(menu-bar-mode -1) | |
(display-time-mode 1) | |
(display-battery-mode 1) | |
;(set-default-font "Terminus 18" nil t) | |
(defun lorem () |
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 torch | |
import cv2 | |
import numpy as np | |
import json | |
from torchvision import transforms | |
from PIL import Image | |
model = torch.hub.load('pytorch/vision', 'mobilenet_v2', pretrained=True).cuda() | |
model.eval() |
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
sudo apt-get update && sudo apt-get upgrade | |
sudo echo "Well, well, well... Look who fucked the system up again, reinstalling..." | |
echo "Installing cuda and cudnn" | |
sudo apt-get install -y system76-cuda-latest system76-cudnn-10.1 cmake | |
echo "installing python stuff" | |
sudo apt-get install -y python3-pip python3-pip | |
sudo pip3 install torch torchvision | |
sudo apt-get install -y python3-pandas python3-seaborn python3-matplotlib | |
echo "Installing Emacs and more..." |
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 matplotlib import cm as cm | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import seaborn as sns | |
from nltk.tokenize import word_tokenize | |
import re | |
from scipy import sparse | |
def repetitionMatrix(_input, title = "", kind = False, cmap = "Reds"): | |
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 nltk import pos_tag, word_tokenize | |
def yodinator(text): | |
text = word_tokenize(text) | |
tagged = pos_tag(text) | |
verbs = ("MD", "VB", "VBD", "VBG", "VBN", "VBP", "VBZ", "RB", "RBR", "RBS") |
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 math import cos,sin,radians | |
import matplotlib.pyplot as plt | |
import numpy as np | |
vec = np.array([-5,-8]) #YOUR VECTOR | |
k = 1 #decide K for shear | |
# Transformations | |
def custom_transf (vector, m1,m2,m3,m4): |
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 numpy as np | |
import random | |
def table_printer(matrix): | |
print("") | |
print(" 1 2 3 4") | |
print("1 ", matrix[0][:]) | |
print("1 ", matrix[1][:]) | |
print("1 ", matrix[2][:]) | |
print("1 ", matrix[3][:]) |