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
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
t = np.arange(0, 15, 0.1)
a = 0.5
b = 0.5
def tick(y, t):
def coeff(L, i):
#if i >= len(L): return 0
return L[i]
def izip(L1, L2):
n = max(len(L1), len(L2))
return [(coeff(L1,i), coeff(L2,i)) for i in range(n)]
def degree(poly):
/*******
* Read input from STDIN
* Use: console.log() to output your result.
* Use: console.error() to output debug information into STDERR
* ***/
var input = [];
readline_object.on("line", (value) => { //Read input values
input.push(value);
/*
https://www.isograd.com/FR/solutionconcours.php
Dev Champion 2019, enoncé: Touches boguées
Énoncé
Votre colocataire, futur doctorant en droit, a préféré passer les six derniers mois en vacances plutôt qu'à la bibliothèque. A son retour, il prétend avoir bien avancé sur son mémoire et vous vous demandez comment ? Il a laissé son ordinateur dans le salon. Il est sensé rendre le mémoire la semaine prochaine et vous demande de relire les 150 pages du document. Vous n'êtes pas très motivé mais vous vous lancez quand même dans la lecture. A peine avez vous commencé que vous ne comprenez rien. Pas parce que vous n'êtes pas compétent, mais tout simplement parce que ce n'est pas français. Evidemment ! Votre coloc a dû récupérer un ordinateur avec des touches boguées.
Plus le temps de lire, il faut absolument rendre compréhensible le mémoire. Après avoir identifié la correspondance des lettres, vous allez écrire un programme qui permettra au document de retrouver du sens.
from math import *
import scipy.integrate as integrate
import numpy as np
import matplotlib.pyplot as plt
## exercice 1
def getPrimes(limit):
L = []
from math import exp, sqrt, log, cos, sin, pi
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["savefig.dpi"] = 500
## Exercice 3
def suite(f, u, n, a, b, c, d):
x = [u, u]
## Exercice 1
from math import log
def chaine_num(c):
#d = int(log(n)/log(256))
d = len(c)
N = 0
for k in range(d):
N += ord(c[k])*(256**k)
# prfgen get richest countries and sort by gdp
SELECT
?pop ?gdp ?drivingSideLabel
?codeTwo ?codeThree
?country
?countryLabel
?coord
(GROUP_CONCAT(DISTINCT ?tldLabel; separator = ";") AS ?tlds)
(GROUP_CONCAT(DISTINCT ?callingCode; separator = ";") AS ?callingCodes)
(GROUP_CONCAT(DISTINCT ?timezoneOffset; separator = ";") AS ?timezones)
@lefuturiste
lefuturiste / countries.sparql
Last active December 14, 2022 20:59
wikidata sparql query
# prfgen get richest countries and sort by gdp
SELECT
?pop ?gdp ?drivingSideLabel
?alpha2 ?alpha3
?country
?countryLabel
?callingCode
(GROUP_CONCAT(DISTINCT ?tldLabel; separator = ", ") AS ?tlds)
(GROUP_CONCAT(DISTINCT ?timezoneOffset; separator = ", ") AS ?timezones)
(GROUP_CONCAT(DISTINCT ?continentLabel; separator = ", ") AS ?continents)
abc = 'abcdefghijklmnopqrstuvwxyz'
stat = [[7.62, 'a'], [1.03, 'b'], [3.04, 'c'], [3.24, 'd'], [17.07, 'e'], [0.88, 'f'], [0.83, 'g'], [0.83, 'h'], [8.29, 'i'], [1.15, 'j'], [0.0, 'k'], [5.57, 'l'], [3.08, 'm'], [6.96, 'n'], [5.38, 'o'], [3.32, 'p'], [1.1, 'q'], [6.46, 'r'], [8.2, 's'], [7.51, 't'], [6.38, 'u'], [1.41, 'v'], [0.0, 'w'], [0.38, 'x'], [0.19, 'y'], [0.1, 'z']]
def decrypt(cipher, stat):
""" Décrypter un texte grâce à une attaque par statistique
Parameters
----------
cipher : str
La chaine de caractère à décrypter