Skip to content

Instantly share code, notes, and snippets.

View fortierq's full-sized avatar

Quentin Fortier fortierq

View GitHub Profile
@fortierq
fortierq / dfs.ml
Created September 22, 2022 07:14
qcm_graph1
let dfs g r =
let n = Array.length g in
let seen = Array.make n false in
let rec aux v =
if not seen.(v) then (
seen.(v) <- true;
Printf.printf "Sommet %d visité\n%!" v;
List.iter aux g.(v)
) in
aux r
@fortierq
fortierq / bst.hs
Created July 13, 2022 11:16
bst.hs
data Tree t = E | N (Tree t) t (Tree t) deriving (Show, Eq)
get e E = error "get E"
get e (N g (k, v) d)
| e == k = v
| e < k = get e g
| otherwise = get e d
set k v E = N E (k, v) E
set k v (N g (k', v') d)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fortierq
fortierq / Dockerfile
Created August 14, 2021 11:51
Dockerfile with docker-stacks
FROM jupyter/base-notebook:2021-08-09
USER root
RUN apt-get update && apt install -y software-properties-common && add-apt-repository ppa:avsm/ppa \
&& apt install -y --no-install-recommends zlib1g-dev libffi-dev libgmp-dev libzmq5-dev \
pkg-config build-essential ocaml opam \
&& rm -rf /var/lib/apt/lists/
USER ${NB_USER}
@fortierq
fortierq / Dockerfile
Created August 14, 2021 11:47
Dockerfile without docker-stacks
FROM ubuntu
RUN apt-get update && apt install -y software-properties-common && add-apt-repository ppa:avsm/ppa \
&& apt install -y --no-install-recommends zlib1g-dev libffi-dev libgmp-dev libzmq5-dev pkg-config \
build-essential curl sudo ocaml opam python3-pip \
&& rm -rf /var/lib/apt/lists/ \
&& curl -sSL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/miniconda.sh \
&& bash /tmp/miniconda.sh -bfp /usr/local \
&& rm -rf /tmp/miniconda.sh \
&& pip3 install notebook sos-notebook \
python poetry pipenv conda
installer un package pip install poetry add pipenv install conda install
liste des dépendances requirements.txt pyproject.toml + poetry.lock Pipfile + Pipfile.lock environment.yml
installer toutes les dépendances pip install -r requirements.txt poetry install pipenv install conda install
mettre à jour toutes les dépendances X poetry update pipenv update conda update
créer un environnem
import projet.a.b
[tool.poetry]
name = "projet"
version = "0.1.0"
description = ""
authors = ["Quentin Fortier <qpfortier@gmail.com>"]
[tool.poetry.dependencies]
python = "^3.9"
[tool.poetry.dev-dependencies]