Skip to content

Instantly share code, notes, and snippets.

import time
import sqlite3
DB_NAME = 'comptage.db'
def create_base():
conn = sqlite3.connect(DB_NAME)
c = conn.cursor()
c.execute("""CREATE TABLE IF NOT EXISTS compte (
import Tkinter as tk
from comptage_sql import *
def format_row(t):
return "ID: {}, {}, {}-{}".format(
t[0], "HOMME" if not t[1] else "FEMME",
t[2], t[2] + 10)
def onselect(evt):
@VieVie31
VieVie31 / DFT.py
Created October 17, 2016 20:26
Discrete Fourier Transform
"""
Discrete Fourier Transform
"""
import math
import numpy as np
import matplotlib.pyplot as plt
N = 200 #sample size
x = np.cos(range(N)) #create a periodic cyclic function
r = np.random.random(N) #create some noise
@VieVie31
VieVie31 / background_extraction.py
Created December 3, 2016 16:21
Extract background (in grayscale) from video if the camera is not moving...
import cv2
import numpy as np
from skvideo.io import vreader
VIDEO_PATH = "room.mp4" #my room where i'm moving and i want to remove myself to get only the background...
cap = vreader(VIDEO_PATH)
L = list(cap)
L = map(lambda img: cv2.cvtColor(img, cv2.COLOR_BGR2GRAY), L) #to gray scale
import numpy as np
NB_STATES = input("nb autocollants a collectionner : ")
PROBA = input("probaabilite minimale 'to catch them all' : ") #0.95 par example
#transition matrix
states = np.zeros((NB_STATES, NB_STATES))
#setting tranition probability
for i in range(NB_STATES):
class State:
state_id_counter = 0
def __init__(self, initial=False, final=False):
#setting an unique id
self.id = State.state_id_counter
State.state_id_counter += 1
#setting params
self.initial = initial
self.final = final
from random import *
from psonic import *
#random major scale chord progression from the transitions allowed by:
#http://www.dummies.com/art-center/music/major-and-minor-chord-progressions-for-music-composition/
def get_major_chord(base_note):
"""Take the base note and return a list of 3 notes in
the root position of the major chord of the base note.
import math
import numpy as np
import matplotlib.pyplot as plt
from random import *
def euclidian(v1, v2):
return (sum((v1 - v2) ** 2)) ** .5

How to run Keras + Tensorflow on GPU @UPMC

Connection @UPMC network

Change XXXXXXX by your student id :

ssh XXXXXXX@ssh.ufr-info-p6.jussieu.fr

Change Y by the id of the machine :

@VieVie31
VieVie31 / download.sh
Last active July 14, 2021 11:08
download PIERRE-EMMANUEL BARRÉ podcasts on france inter
curl "https://media.radiofrance-podcast.net/podcast09/13939-12.04.2017-ITEMA_21289880-4.mp3" > "La drôle dhumeur de Pierre-Emmanuel Barré.mp3"
curl "https://media.radiofrance-podcast.net/podcast09/14212-29.03.2017-ITEMA_21274987-0.mp3" > "La campagne électorale va trop vite.mp3"
curl "https://media.radiofrance-podcast.net/podcast09/14212-22.03.2017-ITEMA_21267521-0.mp3" > "France Inter, radio bolchévique.mp3"
curl "https://media.radiofrance-podcast.net/podcast09/14212-15.03.2017-ITEMA_21260072-0.mp3" > "Dignité, tu mauras pas ?.mp3"
curl "https://media.radiofrance-podcast.net/podcast09/15275-08.03.2017-ITEMA_21253600-14.mp3" > "Qui survivra à lapocalypse ?.mp3"
curl "https://media.radiofrance-podcast.net/podcast09/15275-01.03.2017-ITEMA_21246201-14.mp3" > "Le programme de Macron.mp3"
curl "https://media.radiofrance-podcast.net/podcast09/13939-22.02.2017-ITEMA_21237840-6.mp3" > "Le débat politique à la télé, pourquoi faire ?.mp3"
curl "https://media.radiofrance-podcast.net/podcast09/13939-08.02.2017-ITEMA_2122