Skip to content

Instantly share code, notes, and snippets.

View hyyking's full-sized avatar
⚙️

Léo Duret hyyking

⚙️
View GitHub Profile
@hyyking
hyyking / Makefile
Last active February 14, 2021 16:58
Algorithmic version of the article "Don't Bet on It: Contingent Agreement with Asymetric Information" by James K. SEBENIUS and John GEANAKOPLOS (1983)
NC = \033[0m
RED = \033[0;31m
ORANGE = \033[0;33m
GREEN = \033[0;32m
PURPLE = \033[0;35m
FILE_EXT = cc
CC = g++
EXEC = create
OUTPUT = output
@hyyking
hyyking / MatchmakerAlgo.hs
Last active February 14, 2021 12:37
Matchmaker Algo
module Main where
import Control.Applicative ( liftA2 )
import Control.Arrow
import Control.Monad ( replicateM )
import Data.List ( maximumBy
, minimumBy
, nubBy
, unfoldr
)
![feature(const_fn_floating_point_arithmetic)]
fn rand() -> f64 {
const RAND_SEED: u64 = 69;
// https://en.wikipedia.org/wiki/Permuted_congruential_generator
thread_local! {
static INIT: std::cell::Cell<u64> = std::cell::Cell::new(RAND_SEED);
}
INIT.with(|cell| {
let s = cell.get();
@hyyking
hyyking / main.go
Last active July 24, 2019 11:16
Go linear regression
package main;
import(
"fmt"
)
type LinearFunction struct {
a float64
b float64
}
@hyyking
hyyking / regression.c
Last active July 24, 2019 11:03
C linear regression
#include<stdio.h>
#include<stdlib.h>
#define N 10
typedef struct {
// Linear Function with form f(x)=a*x+b
float a;
float b;
} LinearFunction;
# Léo Duret - May 2019
# For AGFLOW
class RuleSet(object):
"""
Holds Dependencies and Conflict rules adding the abilitty
to check coherence of them.
"""