Skip to content

Instantly share code, notes, and snippets.

View FlorianCassayre's full-sized avatar

Florian Cassayre FlorianCassayre

View GitHub Profile
@FlorianCassayre
FlorianCassayre / gauss_jordan.py
Last active November 18, 2024 09:46
Élimination de Gauss-Jordan en Python
__author__ = 'Florian Cassayre'
from copy import copy, deepcopy
def inverse(toInverse):
size = len(toInverse)
matrix = [[0 for j in range(size * 2)] for i in range(size)] # Matrice n x 2n

Clé d'API OVH

Pour créer une clé d'API OVH, se rendre sur ce formulaire et remplir les champs avec les informations suivantes :

  • ID / Password : identifiant et mot de passe OVH
  • Script name / Script description : libre, utiliser de préférence un vocabulaire explicite
  • Validity : Unlimited, sauf si la clé est effectivement vouée à être temporaire
  • Rights : tels que décrit sur cette page, soit :
    • DELETE /domain/zone/*
    • GET /domain/zone/*
  • POST /domain/zone/*
@FlorianCassayre
FlorianCassayre / Logic.scala
Last active May 19, 2021 13:18
Some tests on ADTs with Scala 3
import scala.compiletime.constValue
object Logic extends App:
// Definitions
enum Formula:
case Variable[Id <: String & Singleton](val id: Id) extends Formula
case True extends Formula
case False extends Formula
Data is listed from the outer ring (first line) to the inner ring (last line).
'#' corresponds to a red stripe, while '.' is a white one.
The triangular patterns starts as valley (wrt the center).
#....#...#.......#.##....###.#.......###....###.##.......#.#......#####.....#.##
#...#################.....#.#........#.........#..#......###........###.....#..#
......#.#.......##..#...#################......##.#......#..#.......###......#..
#.......#...........#.....#..#........#.#...####################################
@FlorianCassayre
FlorianCassayre / Arithmetic.scala
Last active January 17, 2020 22:31
Formal Verification course: "personalized" lab
import fol.Expr
import lcf._
import Theorems._
import fol._
import fol.Expr._
object Arithmetic {
/* == Theorems 3.2 == */
@FlorianCassayre
FlorianCassayre / FOL.scala
Last active November 6, 2019 21:18
Scala prototype for LCF-style theorem proving, verified by the compiler.
import scala.language.implicitConversions
// Scroll down to "Sandbox" to see examples
object FOL extends App {
// Types
// Formulas
// Any combination of boolean operators (does not have to be a tautology!)
@FlorianCassayre
FlorianCassayre / SumFirstIntegers.scala
Last active September 21, 2019 12:11
Proof that 1+2+...+n == n(n+1)/2 using Scala Stainless.
import stainless.annotation.induct
object SumFirstIntegers {
// n(n+1)/2
def sumFirstIntegersClosedForm(n: BigInt): BigInt = {
require(n >= 0)
n * (n + 1) / 2
}
final int margin = 200;
int sampled = 0;
float[][] acc;
final PVector light = new PVector(2, 1, 1).normalize();
void setup() {
size(800, 800);
#include <stddef.h>
#include <malloc.h>
#include <stdio.h>
#include <time.h>
typedef struct linked_t {
struct linked_t* previous;
struct linked_t* next;
int value;
} linked_t;