Created from the plain text reference card on orgmode.org Download this file, and open it in Emacs org-mode!
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
from transformers import AutoProcessor, BlipForConditionalGeneration | |
import requests | |
# load model | |
processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base") | |
model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-base") | |
model = model.to(device) | |
# tokenize the image + caption we're interested in |
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 csv, glob | |
from collections import Counter | |
lang = {} | |
for file in glob.glob('./*.txt'): | |
if 'task' in file: continue | |
with open(file, 'r') as fin: | |
reader = csv.reader(fin) | |
for i, row in enumerate(reader): | |
if i == 0: continue |
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 csv | |
import matplotlib.pyplot as plt | |
from matplotlib import colors | |
from matplotlib.ticker import PercentFormatter | |
import matplotlib.dates as mdates | |
import datetime | |
from collections import Counter, defaultdict | |
import glob, os | |
hist = defaultdict(Counter) |
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 os | |
import numpy | |
import cv2 | |
folder = input("Path to the folder where the videos are: ") | |
files = os.listdir(folder) | |
i = 0 | |
n = len(files) |
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
/* | |
12/3 (thanks to @i'm 2185 on CF): | |
(Silver) | |
Given two arrays of length n, A and B, find the A[i]th divisor of B[i] for each i. | |
1<=n, B[i]<=2*10^6 | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
typedef long double ld; | |
typedef complex<ld> cd; | |
typedef pair<int, int> ii; | |
typedef tuple<int, int, int> iii; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
typedef long double ld; | |
typedef complex<ld> cd; | |
typedef pair<int, int> ii; | |
typedef tuple<int, int, int> iii; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
ios_base::sync_with_stdio(false); | |
cin.tie(NULL); | |
int n; | |
cin >> n; |
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
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
global start | |
section .text | |
start: | |
push dword msg.len | |
push dword msg | |
push dword 1 | |
mov eax, 4 |
NewerOlder