Taken from http://thedarnedestthing.com/vimwiki%20cheatsheet
[n] is relative wiki order as defined in .vimrc, default 1.
| keys | action |
|---|---|
| [n] <leader>ww | open wiki index file |
| [n] \wt | open wiki index file in new tab |
| import getpass | |
| import os | |
| import bs4 | |
| from langchain import hub | |
| # from langchain_community.document_loaders import WebBaseLoader | |
| from langchain_chroma import Chroma | |
| from langchain_core.output_parsers import StrOutputParser | |
| from langchain_core.runnables import RunnablePassthrough | |
| from langchain_openai import ChatOpenAI, OpenAIEmbeddings | |
| from langchain_text_splitters import RecursiveCharacterTextSplitter |
| Service used for data extraction from unstructured HTML: https://www.kadoa.com | |
| Data source: http://clhs.lisp.se/Body/f_map.htm | |
| Resulting JSON: | |
| [ | |
| { | |
| "id": "661a5232c700f85cf0e07c91", | |
| "data": { |
| import gradio as gr | |
| from PIL import Image | |
| import torch | |
| from transformers import AutoProcessor, AutoModelForCausalLM | |
| processor = AutoProcessor.from_pretrained("microsoft/git-base-textvqa") | |
| model = AutoModelForCausalLM.from_pretrained("microsoft/git-base-textvqa", cache_dir='/tmp') | |
| def doit(image1, image2, question): |
| /** | |
| * @param <T> the type of elements in the list | |
| */ | |
| public sealed interface SizedList<T, LENGTH extends Nat> { | |
| /** | |
| * The empty list. | |
| */ | |
| final class Nil<T> implements SizedList<T, Zero> { | |
| private static final Nil<?> NIL = new Nil<>(); |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>IRC Message Parser</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| } |
Taken from http://thedarnedestthing.com/vimwiki%20cheatsheet
[n] is relative wiki order as defined in .vimrc, default 1.
| keys | action |
|---|---|
| [n] <leader>ww | open wiki index file |
| [n] \wt | open wiki index file in new tab |
| # Chapter 17 of HPMOR | |
| # The experiment with prime numbers | |
| # python doesn't support tail recursion, so do this with a while loop | |
| def run(x, y): | |
| while True: | |
| # paper 2 is blank | |
| if x is None and y is None: | |
| x, y = 101, 101 |
| MAX_LENGTH = 12 | |
| def snip(request): | |
| """ | |
| request - str | |
| """ | |
| snipped_req = "" | |
| lines = list(filter(lambda l: len(l) > 0, request.split('\n'))) |
| (4) Another (and a more universal approach) to get rid of the dependence on $\theta$ in (2) is to estimate $s$ via the sample | |
| standard error and use approximation of $\bar{X}$ via Student t-distribution; see details in Ross textbook on statistics or in the lecture notes | |
| ```{r} | |
| for (n in c(100, 1000, 10000)) { | |
| cat("FOR SAMPLE SIZE = ", n, ":\n") | |
| sample_exp = rexp(n*m, lambda) # creating a single sample of exponential distribution | |
| sample_means = colMeans(matrix(sample_exp, nrow=n)) # creating a sample of sample means | |