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
# -*- coding: utf-8 -*- | |
import base64 | |
from Crypto.Cipher import AES | |
from Crypto import Random | |
class AESCipher: | |
block_size = 32 |
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
# -*- coding: utf-8 -*- | |
import base64 | |
from Crypto.Cipher import AES | |
from Crypto import Random | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s : s[:-ord(s[len(s) - 1:])] |
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
{ | |
"Masters":[ | |
{ | |
"Shapes":[ | |
], | |
"Layouts":[ | |
{ | |
"Shapes":[ | |
{ |
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 os | |
from fabric.api import run, local, put, cd, env | |
from time import strftime, localtime | |
env.hosts = ['[email protected]'] | |
site_name = "forpm.net" | |
local_path = "/home/silegon/sites/online/django_silegon" | |
remote_path = "/home/silegon/sites/online/django_silegon" | |
server_config_path = os.path.join(remote_path, "extra/server") |
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
#coding:utf8 | |
#找出一个随机数列中所有两个数和为100的因子。 | |
import random | |
def get_random_list(list_len): | |
list_range = list_len * 4 | |
return random.sample(xrange(-list_range, list_range), list_len) | |
def get_gene0(randome_list, sum_of_gene): |
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 random | |
def get_random_list(list_len): | |
list_range = list_len * 4 | |
return random.sample(xrange(-list_range, list_range), list_len) | |
def test_set(random_list): | |
t_set = set() | |
for i in random_list: | |
t_set.add(i) |
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
#coding:utf8 | |
#找出一个随机数列中所有两个数和为100的因子。 | |
from __future__ import division | |
import random | |
def get_random_list(list_len): | |
list_range = list_len * 4 | |
return random.sample(xrange(-list_range, list_range), list_len) |