Skip to content

Instantly share code, notes, and snippets.

View Gorzen's full-sized avatar

Lucien Iseli Gorzen

View GitHub Profile
[Desktop Entry]
Name=Zathura
GenericName=PDF file viewer
Exec=zathura %f
TryExec=zathura
Icon=zathura
Terminal=false
Type=Application
MimeType=application/pdf
Categories=Viewer;Graphics;
@Gorzen
Gorzen / .vimrc
Created September 12, 2019 13:53
let mapleader="," " leader is comma
set nocompatible
set background=dark " tell vim that we have a dark background
syntax enable " enable syntax
colorscheme badwolf " colorscheme
" Prevent colorscheme from changing background color (opacity)
" Background color of text
highlight Normal ctermbg=None
@Gorzen
Gorzen / .vimrc
Created September 12, 2019 13:10
let mapleader="," " leader is comma
set background=dark " tell vim that we have a dark background
syntax enable " enable syntax
colorscheme badwolf " colorscheme
" Prevent colorscheme from changing background color (opacity)
" Background color of text
highlight Normal ctermbg=None
" Background color of non-text (bottom of file)
import re, os, subprocess, io
import requests
from bs4 import BeautifulSoup
from urllib.request import urlopen
cmd1 = r'''/bin/grep -E "([A-Z]\w+[[:space:]])?([A-Z]\w+[[:space:]])?[A-Z]\w+[[:space:]]+[A-Z]\w+[[:space:]]+est[[:space:]]+né(e)?[[:space:]](\w+[[:space:]]+)*(le[[:space:]][0-9]+[[:space:]]\w+[[:space:]][0-9]+|en[[:space:]]+[0-9]+)(([[:space:]]|,|\.)+(à|au|Au|À)[[:space:]]+\w+([[:space:]]|\.|,))?" -o /home/lulu/EPFL/BA6/SHS-BA6/data/express.json'''
cmd2 = r'''/bin/grep -E "([A-Z]\w+[[:space:]])?([A-Z]\w+[[:space:]])?[A-Z]\w+[[:space:]]+[A-Z]\w+[[:space:]]+est[[:space:]]+né(e)?[[:space:]](\w+[[:space:]]+)*(le[[:space:]][0-9]+[[:space:]]\w+[[:space:]][0-9]+|en[[:space:]]+[0-9]+)(([[:space:]]|,|\.)+(à|au|Au|À)[[:space:]]+\w+([[:space:]]|\.|,))?" -o /home/lulu/EPFL/BA6/SHS-BA6/data/gazette.json'''
temp1 = subprocess.check_output(cmd1, shell=True)
temp2 = subprocess.check_output(cmd2, shell=True)
import stainless.collection._
import stainless.lang._
import stainless.proof._
object InsertionSort {
import TotalOrderLaws.TotalOrder
def bag[T](list: List[T]): Bag[T] = list match {
case Nil() => Bag.empty[T]
case Cons(x, xs) => bag(xs) + x
def lemma_leftIdentity(x: MMap[String, BigInt]): Boolean = {
(append(empty, x) == x) because {
assert(append(empty, x) == append(MMap.empty, x))
assert(append(MMap.empty, x) == MMap.empty.merge(x))
assert(MMap.empty.merge(x) == MMap{ k: String =>
M.append(MMap.empty.apply(k), x.apply(k))
})
assert(MMap{ k: String =>
M.append(MMap.empty.apply(k), x.apply(k))
} == MMap{ k: String =>
import stainless.lang._
import stainless.proof._
import stainless.annotation._
object WordCount {
import MonoidLaws._
import MonoidMap._
// How to use stainless's Map?
// It doesn't have map and it doesn't have postconditions