Skip to content

Instantly share code, notes, and snippets.

View lefuturiste's full-sized avatar
📜
A lot of things going on at the same time!

Le_Futuriste lefuturiste

📜
A lot of things going on at the same time!
View GitHub Profile
Arguments:
/usr/bin/node /usr/share/yarn/bin/yarn.js install
PATH:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Yarn version:
1.22.4
Node version:
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.6.1/css/ol.css" type="text/css">
<style>
.map {
height: 400px;
width: 100%;
}
</style>
@lefuturiste
lefuturiste / simple_json_webserver.py
Created August 2, 2021 08:07
Simple Python JSON web server
'''
Simple JSON server
'''
import io
import http.server
import json
class HTTPHandler(http.server.BaseHTTPRequestHandler):
def jsonRes(self):
enc = 'utf-8'
@lefuturiste
lefuturiste / ocaml_bintree_base.ml
Created June 9, 2021 08:30
TP du 2 juin et du 26 mai 2021 OCAML
type 'a binaryTree =
| None
| Node of ('a binaryTree)*'a*('a binaryTree)
;;
let tree1 = Node(
Node(
Node(Node(None, 7, None), 4, None),
2,
Node(None, 5, None)
@lefuturiste
lefuturiste / ocaml_bintree_search.ml
Created June 9, 2021 08:29
TP 09/06/2021 Avec clémmmmm
type 'a binaryTree =
| None
| Node of ('a binaryTree)*'a*('a binaryTree)
;;
let tree1 = Node(
Node(
Node(None, 5, None),
12,
Node(
import numpy as np
import matplotlib.pyplot as plt
import sys
## EXERCICE 1
def gris(f_in, f_out):
f = plt.imread(f_in)
l,c,d = np.shape(f)
g = np.zeros((l,c,d))
#include <stdio.h>
#include <math.h>
int main()
{
int n = 100000;
double size = 1.0 / n;
double area = 0.0;
for (int i = 0; i < n; i++)
{
var input = [];
readline_object.on("line", (value) => { //Read input values
input.push(value);
})
readline_object.on("close", ContestResponse);
function ContestResponse(){
input = input.slice(1)
let cases = []
let data = input.map(l => l.split(''))
@lefuturiste
lefuturiste / average_blur_pil.py
Created April 1, 2021 13:20
Blur with average, terrible complexity
import numpy as np
from PIL import Image
J = np.asarray(Image.open('36.jpg').convert('RGB'))
r = 20
def inShape(y, x, shape):
# TP 20, Représentation des nb réeels
"""
3. Donner une fonction binaire(x, n) qui retourne la chaîne de caractère donnant l'écriture binaire de x dont la partie fractionnaire est bornée par n.
4. Donner une fonction decimal(c) qui fait l'opération inverse.
"""
def binaire(x, n):
s = ''