Skip to content

Instantly share code, notes, and snippets.

Avatar
🎓
Studying

Florian Cassayre FlorianCassayre

🎓
Studying
View GitHub Profile
@FlorianCassayre
FlorianCassayre / Logic.scala
Last active May 19, 2021
Some tests on ADTs with Scala 3
View Logic.scala
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
View perseverance_parachute_pattern.txt
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).
#....#...#.......#.##....###.#.......###....###.##.......#.#......#####.....#.##
#...#################.....#.#........#.........#..#......###........###.....#..#
......#.#.......##..#...#################......##.#......#..#.......###......#..
#.......#...........#.....#..#........#.#...####################################
View ancestors_departements.md
@FlorianCassayre
FlorianCassayre / Arithmetic.scala
Last active Jan 17, 2020
Formal Verification course: "personalized" lab
View Arithmetic.scala
import fol.Expr
import lcf._
import Theorems._
import fol._
import fol.Expr._
object Arithmetic {
/* == Theorems 3.2 == */
@FlorianCassayre
FlorianCassayre / FOL.scala
Last active Nov 6, 2019
Scala prototype for LCF-style theorem proving, verified by the compiler.
View FOL.scala
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 Sep 21, 2019
Proof that 1+2+...+n == n(n+1)/2 using Scala Stainless.
View SumFirstIntegers.scala
import stainless.annotation.induct
object SumFirstIntegers {
// n(n+1)/2
def sumFirstIntegersClosedForm(n: BigInt): BigInt = {
require(n >= 0)
n * (n + 1) / 2
}
View lunar_terrain.pde
final int margin = 200;
int sampled = 0;
float[][] acc;
final PVector light = new PVector(2, 1, 1).normalize();
void setup() {
size(800, 800);
View day09.c
#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;
View keybase.md

Keybase proof

I hereby claim:

  • I am FlorianCassayre on github.
  • I am flomine (https://keybase.io/flomine) on keybase.
  • I have a public key whose fingerprint is 15F2 D0CC 0424 6F32 25EC 9AAD B280 01E0 4138 B6FE

To claim this, I am signing this object:

View stacker.ino
#include "LedControl.h"
#define SIZE 8
#define PIN_MATRIX_DATA 55
#define PIN_MATRIX_CLK 56
#define PIN_MATRIX_CS 54
#define PIN_BUTTON 57