Skip to content

Instantly share code, notes, and snippets.

# Il faut deux choses pour que ce code fonctionne :
# La librairie PuLP (pip install pulp)
# Le logiciel coin-cbc. Sur Debian: apt-get install coinor-cbc
from pulp import *
# puzzle.txt contient les chiffres lignes par lignes et espace pour les cases vides
with open('puzzle.txt', 'r') as f:
puzzle = f.readlines()
ROWS = len(puzzle)
# Prendre https://github.com/hbenbel/French-Dictionary -> le fichier avec tous les mots/verbes/etc
from itertools import product, groupby
import unicodedata
mots = ['', 'REPONSE', 'ETONNANTE', 'DE', 'LA', 'PART', 'DE', 'NOS', 'GRANDS', 'ASTRES',
'FORT', 'PEU', 'CONCLUANTE', 'BIEN', 'QUE', 'NENNI', 'LANCONS', 'NOUS', 'TOUT', 'DE', 'MEME']
phrase = [[3,1,10,20,14,5], [6,4,15,17], [12,2], [19,4,18,20], [3,13],
[6,15,11,4,10,18], [4], [15,7,18,11,10], [5,3,12,9,4,15,13,10,4,8,14],
[15,19,12,11,7,17,5,13,10,20]]
from datetime import datetime as dt
import itertools
def check_set(e):
# On reçoit une liste de liste, on la découpe par ligne
annee = e[0]
nom = e[1]
debut = e[2]
fin = e[3]
couleur = e[4]
@Epithumia
Epithumia / engrenages.py
Created October 28, 2019 15:13
Solveur de l'énigme Engrenages
moves = [12, 15, 15, 27, 36, 42, 33, 42, 15, 18, 9]
wheel = ['O', 'Y', 'F', 'S', 'R', 'T', 'K', 'M', 'I', 'B', 'N', 'V', 'E', 'Z', 'G', 'U', 'T', 'A', 'Q', 'D', 'L', 'W', 'J', 'S', 'A', 'L', 'N', 'C', 'P', 'X', 'H', 'E']
word = []
key = 0
for m in moves:
key += int(m*4/3)
word.append(wheel[key%32])
print(''.join(word))

Keybase proof

I hereby claim:

  • I am Epithumia on github.
  • I am grendel (https://keybase.io/grendel) on keybase.
  • I have a public key whose fingerprint is CFA9 A578 2D2E 7AB4 3C1A F0B4 5C44 C765 6C81 CBB5

To claim this, I am signing this object:

#!/usr/bin/env python
#
# Converts any integer into a base [BASE] number. I have chosen 62
# as it is meant to represent the integers using all the alphanumeric
# characters, [no special characters] = {0..9}, {A..Z}, {a..z}
#
# I plan on using this to shorten the representation of possibly long ids,
# a la url shortenters
#
@Epithumia
Epithumia / cameraCtrlTether2.py
Created June 30, 2014 23:31
Proof of concept : wireless tethering on the E-M1, in camera control mode, now with smarter polling
# -*- coding: utf-8 -*-
from urllib import urlretrieve
from urllib2 import urlopen
import re
import time
def getInitialData():
data = []
@Epithumia
Epithumia / cameraCtrlTether.py
Created June 29, 2014 20:24
Proof of concept : wireless tethering on the E-M1, in camera control mode
# -*- coding: utf-8 -*-
from urllib import urlretrieve
from urllib2 import urlopen
import re
import time
urlopen('http://192.168.0.10/switch_cammode.cgi?mode=play').read()
page = urlopen('http://192.168.0.10/get_imglist.cgi?DIR=/DCIM').read()
m = re.findall('(DCIM.*)',page)[0].split(',')[1]
@Epithumia
Epithumia / getEM1Imagesv2.py
Created June 14, 2014 10:52
Simple script to download images wirelessly from the Olympus E-M1 to the computer (with progress bar)
# -*- coding: utf-8 -*-
from urllib2 import urlopen
import re
page = urlopen('http://192.168.0.10/DCIM').read()
#print page
m = re.findall('(wlansd.*DCIM.*;)',page)
@Epithumia
Epithumia / getEM1Images.py
Created June 14, 2014 10:45
Simple script to download images wirelessly from the Olympus E-M1 to the computer
# -*- coding: utf-8 -*-
from urllib import urlretrieve
from urllib2 import urlopen
import re
page = urlopen('http://192.168.0.10/DCIM').read()
#print page
m = re.findall('(wlansd.*DCIM.*;)',page)