Source: https://doc.rust-lang.org/cargo/commands/general-commands.html
bold = very useful
cargo --version (actual version)
cargon --list (list installed commands)
cargo --help (provide helps)
cargo --explain code (explain specific functions)
""" | |
I'm starting to like the Variance-Gamma model quite a bit. | |
Here is a quick and dirty Octave (Matlab) code for generating the IV skew given VG parameters | |
I took the parameters from the Madan, Carr and Chang paper. | |
Instead of evaluating a double integral I use the mixing formula, which results in a single integral. | |
From Linkedin profile of Frido Rolloos | |
"" | |
import numpy as np |
-- create our table | |
CREATE TABLE Videogiochi ( | |
ID INT PRIMARY KEY AUTO_INCREMENT, | |
Nome VARCHAR(100) NOT NULL, | |
AnnoUscita INT NOT NULL, | |
Rating INT CHECK (Rating >= 1 AND Rating <= 5) | |
); | |
-- insert the data | |
INSERT INTO Videogiochi (Nome, AnnoUscita, Rating) VALUES |
Source: https://doc.rust-lang.org/cargo/commands/general-commands.html
bold = very useful
cargo --version (actual version)
cargon --list (list installed commands)
cargo --help (provide helps)
cargo --explain code (explain specific functions)
app.location.recordings.each(function (recording) { | |
recording.tracks.each(function (track) { | |
track.downloadFromLocal(window.location.href); | |
}) | |
}) |
# copy and paste the script on a Jupyter Notebook to have the | |
# table printed on screen | |
import numpy as np | |
import pandas as pd | |
from scipy.integrate import quad | |
def normal_probability_density(x): | |
constant = 1.0 / np.sqrt(2 * np.pi) | |
return(constant * np.exp((-x**2) / 2)) |
# TSP with heuristic dynamic programming | |
# Solution is based on "always picking the shortest route available" on the matrix | |
from itertools import permutations | |
def travel_salesman_problem(graph: list, path_sum: int = 0) -> int: | |
vertex = [] | |
min_path = [] | |
[MASTER] | |
# A comma-separated list of package or module names from where C extensions may | |
# be loaded. Extensions are loading into the active Python interpreter and may | |
# run arbitrary code. | |
extension-pkg-allow-list= | |
# A comma-separated list of package or module names from where C extensions may | |
# be loaded. Extensions are loading into the active Python interpreter and may | |
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list |
from fastapi import FastAPI, HTTPException | |
from pydantic import BaseModel | |
from typing import Optional | |
import uvicorn | |
# instantiate our FastApi application | |
app = FastAPI() | |
# initiate our test dataset | |
videogames = [ |
# Play it live on https://replit.com/@carlo_/wordletest#main.py | |
import random | |
from collections import Counter | |
from english_words import english_words_lower_alpha_set as words | |
words = list(words) | |
SECRET = words[random.choice(range(len(words)))] |
# Django Cheatsheet | |
# start a new Python env (with Anaconda) | |
`conda create -n my_env pip python=3.8.8` # insert your fav python version here | |
# activate Python Env | |
`conda activate my_env` | |
# install Django | |
`pip install django` |