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
[alias] | |
cln = !git fetch --prune && git branch --verbose | grep gone | awk '{ print $1 }' | xargs -r git branch -D | |
fall = !for b in $(git branch -l --format "%(refname:lstrip=2)"); do git fetch origin $b:$b; done | |
st = status -s | |
cl = clone | |
ci = commit | |
co = checkout | |
br = branch | |
r = reset | |
cp = cherry-pick |
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 itertools as it | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from scipy.integrate import odeint | |
mu = 0.3 | |
L = 10 | |
g = 9.8 | |
DELTA = 0.01 | |
T = 1000 |
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 asyncio | |
import os | |
import pathlib | |
import aiohttp | |
import bs4 | |
__author__ = 'Davide Canton' |
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
module Change where | |
import Control.Arrow ((&&&)) | |
import Data.Function (on) | |
import Data.List (group) | |
-- Coin datatype | |
data Coin = OneCent | TwoCents | FiveCents | | |
TenCents | TwentyCents | FiftyCents | |
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
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} | |
module CF.CF where | |
import Control.Arrow | |
import Control.Monad | |
import Control.Monad.Error | |
import Data.Char | |
import Data.List |
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
module ProveGL.Clock where | |
import Data.IORef | |
import Data.Time.LocalTime | |
import Graphics.UI.GLUT | |
applyTo :: (a, a) -> (a -> b) -> (b, b) | |
applyTo (x, y) f = (f x, f y) | |
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
module ProvaGL where | |
import Control.Monad | |
import Data.IORef (IORef, newIORef) | |
import Graphics.UI.GLUT | |
points :: Int -> [(GLfloat,GLfloat,GLfloat)] | |
points n = [ (sin (2*pi*k/n'), cos (2*pi*k/n'), 0) | k <- [1..n'] ] | |
where n' = fromIntegral 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
__author__ = 'davide' | |
import matplotlib.pyplot as plt | |
from collections import defaultdict | |
import numpy as np | |
from datetime import datetime, timedelta | |
import pandas as pd | |
from statsmodels.tsa.vector_ar.var_model import VAR | |
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
cell_index(0..8). | |
cell_value(1..9). | |
% fill with initial values | |
initial_pos(0, 3, 4). | |
initial_pos(0, 6, 1). | |
initial_pos(0, 7, 5). | |
initial_pos(1, 1, 8). | |
initial_pos(1, 2, 1). | |
initial_pos(1, 3, 9). |
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
module TM.TM where | |
import Control.Monad.State (State, evalState, get, put) | |
import Control.Monad.Trans (lift) | |
import Control.Monad.Trans.Writer (WriterT, runWriterT, tell) | |
import Data.List (intercalate, nub, (\\)) | |
import qualified Data.Map as Map (Map, fromList, keys, lookup, | |
notMember, null, union) | |
newtype Tape = Tape { tapeList :: [CellContent] } |
NewerOlder