This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******* | |
* 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import * | |
import scipy.integrate as integrate | |
import numpy as np | |
import matplotlib.pyplot as plt | |
## exercice 1 | |
def getPrimes(limit): | |
L = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |