This file contains hidden or 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 random | |
def randomdig(number): | |
max = "9"*number | |
max = int(max) | |
rand = random.randint(0,max) | |
rand = str(rand) | |
rand = "0"*(number-len(rand))+rand |
This file contains hidden or 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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf8 -*- | |
# Copyright (c) 2012, Valentin Lorentz | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to |
This file contains hidden or 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 threading | |
class Graph: | |
def __init__(self,name): | |
self.name = name | |
self.list_neighbor = {} | |
self.list_node = {} | |
def add_node(self,node): | |
self.list_node[node] = True |
This file contains hidden or 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 datetime import datetime | |
from couchdbkit.ext.django.schema import * | |
# Create your models here. | |
class Avis(Document): | |
Texte= StringProperty() | |
Membre_membre_Membre= ListProperty() | |
Publiable= BooleanProperty() | |
Lien_lien_Lien= ListProperty() |
This file contains hidden or 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
Le Telecomix Crypto Munitions Buro (aka TCMB) vous invite à un Chaos | |
Crypto Workshop sur les darknets. | |
Nous ne parlerons pas de Tor, d'OTR et de GPG parce que je commence à en | |
avoir un peu marre et que j'ai envie de faire quelque chose (et que rien | |
ne vous empêche do'rganiser des ateliers sur ces thématiques, c'est un | |
excellent moyen d'apprendre). | |
Et, pour une fois, j'ai envie qu'on fasse quelque chose plus haut | |
niveau. Donc, on va se construire un darknet et y mettre les premières |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
def ensurefirstuser(firstname,lastname,email,password): | |
users = db(db.auth_user.email==email).select() | |
if users: | |
user_id = users[0].id | |
created = False | |
if settings.debug_ensure_first_user == True: | |
print ('found user_id so created equals %s') % created | |
return (user_id,created) |
This file contains hidden or 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
password="toto" | |
my_crypt = CRYPT(key=auth.settings.hmac_key) | |
crypt_pass = my_crypt(password)[0] | |
user = db.auth_user.insert( | |
Surnom="Surnom", | |
email="email", | |
password=crypt_pass, | |
) | |
db.commit() | |
session.auth = Storage(user=user,expiration=auth.settings.expiration,hmac_key=str(uuid4())) |
This file contains hidden or 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
db.define_table( | |
auth.settings.table_user_name, | |
Field('Surnom', length=128, default=''), | |
Field('email', length=128, default='', unique=True), # required | |
Field('password', 'password', length=512,# required | |
readable=False, label='Password'), | |
Field('Skills','list:reference SkillUser',default=None), | |
Field('Items','list:reference Item',default=None), | |
Field('registration_key', length=512,# required | |
writable=False, readable=False, default=''), |
This file contains hidden or 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
password="toto" | |
my_crypt = CRYPT(key=auth.settings.hmac_key) | |
crypt_pass = my_crypt(password)[0] | |
user = db.auth_user.insert( | |
Surnom="Surnom", | |
email="email5@toto", | |
username="titi", | |
password=crypt_pass, | |
) | |
db.commit() |