第 0024 题: 使用 Python 的 Web 框架,做一个 Web 版本 TodoList 应用。
+
+
+
+
+
+
第 0025 题: 使用 Python 实现:对着电脑吼一声,自动打开浏览器中的默认网站。
+
+
例如,对着笔记本电脑吼一声“百度”,浏览器自动打开百度首页。
+
+关键字:Speech to Text
+
+
+
参考思路:
+1:获取电脑录音-->WAV文件
+ python record wav
+
+
2:录音文件-->文本
+
+
STT: Speech to Text
+
+STT API Google API
+
+
+
3:文本-->电脑命令
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Something went wrong with that request. Please try again.
+
+
+
+
+
+
+
+
+
+ You signed in with another tab or window. Reload to refresh your session.
+ You signed out in another tab or window. Reload to refresh your session.
+
第 0024 题: 使用 Python 的 Web 框架,做一个 Web 版本 TodoList 应用。
+
+
+
+
+
+
第 0025 题: 使用 Python 实现:对着电脑吼一声,自动打开浏览器中的默认网站。
+
+
例如,对着笔记本电脑吼一声“百度”,浏览器自动打开百度首页。
+
+关键字:Speech to Text
+
+
+
参考思路:
+1:获取电脑录音-->WAV文件
+ python record wav
+
+
2:录音文件-->文本
+
+
STT: Speech to Text
+
+STT API Google API
+
+
+
3:文本-->电脑命令
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Something went wrong with that request. Please try again.
+
+
+
+
+
+
+
+
+
+ You signed in with another tab or window. Reload to refresh your session.
+ You signed out in another tab or window. Reload to refresh your session.
+
+
+
+
+
\ No newline at end of file
diff --git a/Jaccorot/0010/0010.py b/Jaccorot/0010/0010.py
new file mode 100644
index 00000000..21b9a422
--- /dev/null
+++ b/Jaccorot/0010/0010.py
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+#coding=utf-8
+
+"""
+
+第 0010 题:使用 Python 生成字母验证码图片
+
+"""
+
+from PIL import Image, ImageDraw, ImageFont, ImageFilter
+import random
+
+IMAGE_MODE = 'RGB'
+IMAGE_BG_COLOR = (255,255,255)
+Image_Font = 'arial.ttf'
+text = ''.join(random.sample('abcdefghijklmnopqrstuvwxyz\
+ABCDEFGHIJKLMNOPQRSTUVWXYZ',4))
+
+def colorRandom():
+ return (random.randint(32,127),random.randint(32,127),random.randint(32,127))
+
+
+#change 噪点频率(%)
+def create_identifying_code(strs, width=400, height=200, chance=2):
+ im = Image.new(IMAGE_MODE, (width, height), IMAGE_BG_COLOR)
+ draw = ImageDraw.Draw(im)
+ #绘制背景噪点
+ for w in xrange(width):
+ for h in xrange(height):
+ if chance < random.randint(1, 100):
+ draw.point((w, h), fill=colorRandom())
+
+ font = ImageFont.truetype(Image_Font, 80)
+ font_width, font_height = font.getsize(strs)
+ strs_len = len(strs)
+ x = (width - font_width)/2
+ y = (height - font_height)/2
+ #逐个绘制文字
+ for i in strs:
+ draw.text((x,y), i, colorRandom(), font)
+ x += font_width/strs_len
+ #模糊
+ im = im.filter(ImageFilter.BLUR)
+ im.save('identifying_code_pic.jpg')
+
+
+if __name__ == '__main__':
+ create_identifying_code(text)
diff --git a/Jaccorot/0010/arial.ttf b/Jaccorot/0010/arial.ttf
new file mode 100644
index 00000000..2107596f
Binary files /dev/null and b/Jaccorot/0010/arial.ttf differ
diff --git a/Jaccorot/0010/identifying_code_pic.jpg b/Jaccorot/0010/identifying_code_pic.jpg
new file mode 100644
index 00000000..61a33564
Binary files /dev/null and b/Jaccorot/0010/identifying_code_pic.jpg differ
diff --git a/Jaccorot/0011/0011.py b/Jaccorot/0011/0011.py
new file mode 100644
index 00000000..0d9d3bca
--- /dev/null
+++ b/Jaccorot/0011/0011.py
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+第 0011 题: 敏感词文本文件 filtered_words.txt,里面的内容为以下内容,当用户输入敏感词语时,则打印出 Freedom,
+否则打印出 Human Rights。
+"""
+
+
+def trans_to_words():
+ type_in = raw_input(">")
+ judge_flag = False
+ with open('filtered_words.txt') as f:
+ text = f.read().decode('utf-8').encode('gbk')
+
+ for i in text.split("\n"):
+ if i in type_in:
+ judge_flag = True
+
+ if judge_flag:
+ print "Freedom"
+ else:
+ print "Human Rights"
+
+
+if __name__ == "__main__":
+ while True:
+ trans_to_words()
diff --git a/Jaccorot/0011/filtered_words.txt b/Jaccorot/0011/filtered_words.txt
new file mode 100644
index 00000000..69373b64
--- /dev/null
+++ b/Jaccorot/0011/filtered_words.txt
@@ -0,0 +1,11 @@
+北京
+程序员
+公务员
+领导
+牛比
+牛逼
+你娘
+你妈
+love
+sex
+jiangge
\ No newline at end of file
diff --git a/Jaccorot/0012/0012.py b/Jaccorot/0012/0012.py
new file mode 100644
index 00000000..dae4d5e9
--- /dev/null
+++ b/Jaccorot/0012/0012.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+第 0012 题: 敏感词文本文件 filtered_words.txt,里面的内容 和 0011题一样,
+当用户输入敏感词语,则用 星号 * 替换,例如当用户输入「北京是个好城市」,则变成「**是个好城市」。
+"""
+
+
+def trans_to_words():
+ type_in = raw_input(">")
+ with open('filtered_words.txt') as f:
+ text = f.read().decode('utf-8').encode('gbk')
+ print text.split("\n")
+ for i in text.split("\n"):
+ if i in type_in:
+ type_in = type_in.replace(i, '**')
+ print type_in
+
+if __name__ == "__main__":
+ while True:
+ trans_to_words()
diff --git a/Jaccorot/0012/filtered_words.txt b/Jaccorot/0012/filtered_words.txt
new file mode 100644
index 00000000..69373b64
--- /dev/null
+++ b/Jaccorot/0012/filtered_words.txt
@@ -0,0 +1,11 @@
+北京
+程序员
+公务员
+领导
+牛比
+牛逼
+你娘
+你妈
+love
+sex
+jiangge
\ No newline at end of file
diff --git a/Jaccorot/0013/0013.py b/Jaccorot/0013/0013.py
new file mode 100644
index 00000000..ad340a09
--- /dev/null
+++ b/Jaccorot/0013/0013.py
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+第 0013 题: 用 Python 写一个爬图片的程序,爬 这个链接里的日本妹子图片 :-)
+"""
+
+import os
+import urllib
+from bs4 import BeautifulSoup
+from urlparse import urlsplit
+
+
+def catch_tieba_pics(url):
+ content = urllib.urlopen(url)
+ bs = BeautifulSoup(content, 'lxml')
+ for i in bs.find_all('img', {"class": "BDE_Image"}):
+ download_pic(i['src'])
+
+
+def download_pic(url):
+ image_content = urllib.urlopen(url).read()
+ file_name = os.path.basename(urlsplit(url)[2])
+ output = open(file_name, 'wb')
+ output.write(image_content)
+ output.close()
+
+
+if __name__ == '__main__':
+ catch_tieba_pics('http://tieba.baidu.com/p/2166231880')
diff --git a/Jaccorot/0014/0014.py b/Jaccorot/0014/0014.py
new file mode 100644
index 00000000..5eaa5b05
--- /dev/null
+++ b/Jaccorot/0014/0014.py
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+第 0014 题: 纯文本文件 student.txt为学生信息, 里面的内容(包括花括号)如下所示,
+请将上述内容写到 student.xls 文件中,如下图所示:
+"""
+
+import os
+import json
+import xlwt
+
+def read_txt(path):
+ with open(path, 'r') as f:
+ text = f.read().decode('utf-8')
+ text_json = json.loads(text)
+ return text_json
+
+
+def save_into_excel(content_dict, excel_name):
+ wb = xlwt.Workbook()
+ ws = wb.add_sheet("student", cell_overwrite_ok=True)
+ row = 0
+ col = 0
+
+ for k, v in sorted(content_dict.items(),key=lambda d:d[0]):
+ ws.write(row, col, k)
+ for i in v:
+ col += 1
+ ws.write(row, col, i)
+
+ row += 1
+ col = 0
+
+ wb.save(excel_name)
+
+
+if __name__ == "__main__":
+ read_content = read_txt(os.path.join(os.path.split(__file__)[0], 'student.txt'))
+ save_into_excel(read_content, 'student.xls')
+
+
diff --git a/Jaccorot/0014/student.txt b/Jaccorot/0014/student.txt
new file mode 100644
index 00000000..ea9b1593
--- /dev/null
+++ b/Jaccorot/0014/student.txt
@@ -0,0 +1,5 @@
+{
+ "1":["张三",150,120,100],
+ "2":["李四",90,99,95],
+ "3":["王五",60,66,68]
+}
\ No newline at end of file
diff --git a/Jaccorot/0015/0015.py b/Jaccorot/0015/0015.py
new file mode 100644
index 00000000..113927c3
--- /dev/null
+++ b/Jaccorot/0015/0015.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+纯文本文件 city.txt为城市信息, 里面的内容(包括花括号)如下所示:
+请将上述内容写到 city.xls 文件中,如下图所示:
+"""
+
+import os
+import json
+import xlwt
+
+def read_txt(path):
+ with open(path, 'r') as f:
+ text = f.read().decode('utf-8')
+ text_json = json.loads(text)
+ return text_json
+
+
+def save_into_excel(content_dict, excel_name):
+ wb = xlwt.Workbook()
+ ws = wb.add_sheet("city", cell_overwrite_ok=True)
+ row = 0
+ col = 0
+
+ for k, v in sorted(content_dict.items(),key=lambda d:d[0]):
+ ws.write(row, col, k)
+ col += 1
+ ws.write(row, col, v)
+
+ row += 1
+ col = 0
+
+ wb.save(excel_name)
+
+
+if __name__ == "__main__":
+ read_content = read_txt(os.path.join(os.path.split(__file__)[0], 'city.txt'))
+ save_into_excel(read_content, 'city.xls')
diff --git a/Jimmy66/0015/city.txt b/Jaccorot/0015/city.txt
similarity index 100%
rename from Jimmy66/0015/city.txt
rename to Jaccorot/0015/city.txt
diff --git a/Jaccorot/0016/0016.py b/Jaccorot/0016/0016.py
new file mode 100644
index 00000000..c0fe6620
--- /dev/null
+++ b/Jaccorot/0016/0016.py
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+ 纯文本文件 numbers.txt, 里面的内容(包括方括号)如下所示:
+请将上述内容写到 numbers.xls 文件中,如下图所示:
+"""
+
+import os
+import json
+import xlwt
+
+def read_txt(path):
+ with open(path, 'r') as f:
+ text = f.read().decode('utf-8')
+ text_json = json.loads(text)
+ return text_json
+
+
+def save_into_excel(content_dict, excel_name):
+ wb = xlwt.Workbook()
+ ws = wb.add_sheet("numbers", cell_overwrite_ok=True)
+ row = 0
+ col = 0
+ for i in content_dict:
+ for k in i:
+ ws.write(row, col, k)
+ col += 1
+ row += 1
+ col = 0
+
+ wb.save(excel_name)
+
+
+if __name__ == "__main__":
+ read_content = read_txt(os.path.join(os.path.split(__file__)[0], 'numbers.txt'))
+ save_into_excel(read_content, 'numbers.xls')
diff --git a/Jaccorot/0016/numbers.txt b/Jaccorot/0016/numbers.txt
new file mode 100644
index 00000000..c43c0378
--- /dev/null
+++ b/Jaccorot/0016/numbers.txt
@@ -0,0 +1,5 @@
+[
+ [1, 82, 65535],
+ [20, 90, 13],
+ [26, 809, 1024]
+]
\ No newline at end of file
diff --git a/Jaccorot/0017/0017.py b/Jaccorot/0017/0017.py
new file mode 100644
index 00000000..335c94bc
--- /dev/null
+++ b/Jaccorot/0017/0017.py
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+第 0017 题: 将 第 0014 题中的 student.xls 文件中的内容写到 student.xml 文件中,如
+
+下所示:
+
+
+
+
+
+{
+ "1" : ["张三", 150, 120, 100],
+ "2" : ["李四", 90, 99, 95],
+ "3" : ["王五", 60, 66, 68]
+}
+
+
+"""
+
+import xlrd
+import json
+from lxml import etree
+
+
+def read_exl(file_name):
+ exl = xlrd.open_workbook(file_name)
+ exl_sheet = exl.sheet_by_name('student')
+ data = {}
+ for i in range(exl_sheet.nrows):
+ data[exl_sheet.row_values(i)[0]] = exl_sheet.row_values(i)[1:]
+ return json.dumps(data, encoding='utf-8')
+
+def save_to_xml(data, new_file_name):
+ root = etree.Element('root')
+ students = etree.SubElement(root, 'students')
+ students.append(etree.Comment(u"""学生信息表 "id" : [名字, 数学, 语文, 英文]"""))
+ students.text = data
+
+ student_xml = etree.ElementTree(root)
+ student_xml.write(new_file_name, pretty_print=True, xml_declaration=True, encoding='utf-8')
+
+
+if __name__ == '__main__':
+ content = read_exl('student.xls')
+ save_to_xml(content, 'student.xml')
diff --git a/Jaccorot/0017/student.xls b/Jaccorot/0017/student.xls
new file mode 100644
index 00000000..7d5717d8
Binary files /dev/null and b/Jaccorot/0017/student.xls differ
diff --git a/Jaccorot/0017/student.xml b/Jaccorot/0017/student.xml
new file mode 100644
index 00000000..afc2e49e
--- /dev/null
+++ b/Jaccorot/0017/student.xml
@@ -0,0 +1,4 @@
+
+
+ {"1": ["\u5f20\u4e09", 150.0, 120.0, 100.0], "3": ["\u738b\u4e94", 60.0, 66.0, 68.0], "2": ["\u674e\u56db", 90.0, 99.0, 95.0]}
+
diff --git a/Jaccorot/0018/0018.py b/Jaccorot/0018/0018.py
new file mode 100644
index 00000000..bbdaddd2
--- /dev/null
+++ b/Jaccorot/0018/0018.py
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+第 0018 题: 将 第 0015 题中的 city.xls 文件中的内容写到 city.xml 文件中,如下所示:
+
+
+
+
+
+{
+ "1" : "上海",
+ "2" : "北京",
+ "3" : "成都"
+}
+
+
+"""
+
+import xlrd
+import json
+from lxml import etree
+
+
+def read_exl(file_name):
+ exl = xlrd.open_workbook(file_name)
+ exl_sheet = exl.sheet_by_name('city')
+ data = {}
+ for i in range(exl_sheet.nrows):
+ data[exl_sheet.row_values(i)[0]] = exl_sheet.row_values(i)[1]
+ return json.dumps(data, encoding='utf-8')
+
+def save_to_xml(data, new_file_name):
+ root = etree.Element('root')
+ students = etree.SubElement(root, 'citys')
+ students.append(etree.Comment(u"""城市信息"""))
+ students.text = data
+
+ student_xml = etree.ElementTree(root)
+ student_xml.write(new_file_name, pretty_print=True, xml_declaration=True, encoding='utf-8')
+
+
+if __name__ == '__main__':
+ content = read_exl('city.xls')
+ save_to_xml(content, 'city.xml')
diff --git a/Jaccorot/0018/city.xls b/Jaccorot/0018/city.xls
new file mode 100644
index 00000000..ef48fed2
Binary files /dev/null and b/Jaccorot/0018/city.xls differ
diff --git a/Jaccorot/0018/city.xml b/Jaccorot/0018/city.xml
new file mode 100644
index 00000000..14186a8c
--- /dev/null
+++ b/Jaccorot/0018/city.xml
@@ -0,0 +1,4 @@
+
+
+ {"1": "\u4e0a\u6d77", "3": "\u6210\u90fd", "2": "\u5317\u4eac"}
+
diff --git a/Jaccorot/0019/0019.py b/Jaccorot/0019/0019.py
new file mode 100644
index 00000000..4112b3ad
--- /dev/null
+++ b/Jaccorot/0019/0019.py
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+第 0019 题: 将 第 0016 题中的 numbers.xls 文件中的内容写到 numbers.xml 文件中,如下
+
+所示:
+
+
+
+
+
+
+[
+ [1, 82, 65535],
+ [20, 90, 13],
+ [26, 809, 1024]
+]
+
+
+
+"""
+
+import xlrd
+import json
+from lxml import etree
+
+
+def read_exl(file_name):
+ exl = xlrd.open_workbook(file_name)
+ exl_sheet = exl.sheet_by_name('numbers')
+ data = []
+ for i in range(exl_sheet.nrows):
+ temp = [int(x) for x in exl_sheet.row_values(i) ]
+ data.append(temp)
+ return json.dumps(data, encoding='utf-8')
+
+def save_to_xml(data, new_file_name):
+ root = etree.Element('root')
+ students = etree.SubElement(root, 'numbers')
+ students.append(etree.Comment(u"""数字信息"""))
+ students.text = data
+
+ student_xml = etree.ElementTree(root)
+ student_xml.write(new_file_name, pretty_print=True, xml_declaration=True, encoding='utf-8')
+
+
+if __name__ == '__main__':
+ content = read_exl('numbers.xls')
+ save_to_xml(content, 'numbers.xml')
diff --git a/Jaccorot/0019/numbers.xls b/Jaccorot/0019/numbers.xls
new file mode 100644
index 00000000..769bb4a1
Binary files /dev/null and b/Jaccorot/0019/numbers.xls differ
diff --git a/Jaccorot/0019/numbers.xml b/Jaccorot/0019/numbers.xml
new file mode 100644
index 00000000..1ba54401
--- /dev/null
+++ b/Jaccorot/0019/numbers.xml
@@ -0,0 +1,4 @@
+
+
+ [[1, 82, 65535], [20, 90, 13], [26, 809, 1024]]
+
diff --git a/Jaccorot/0020/0020.py b/Jaccorot/0020/0020.py
new file mode 100644
index 00000000..336126eb
--- /dev/null
+++ b/Jaccorot/0020/0020.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+# coding=utf-8
+
+"""
+第 0020 题: 登陆中国联通网上营业厅 后选择「自助服务」 --> 「详单查询」,然后选择你要查询的时间段,
+点击「查询」按钮,查询结果页面的最下方,点击「导出」,就会生成类似于 2014年10月01日~2014年10月31日
+通话详单.xls 文件。写代码,对每月通话时间做个统计。
+"""
+
+import xlrd
+
+def count_the_dail_time(filename):
+ excel = xlrd.open_workbook(filename)
+ sheet = excel.sheet_by_index(0)
+ row_nums = sheet.nrows
+ col_nums = sheet.ncols
+ total_time = 0
+ for i in range(1,row_nums):
+ total_time += int(sheet.cell_value(i, 3))
+ return total_time
+
+
+if __name__ == "__main__":
+ total_len = count_the_dail_time("src.xls")
+ print "本月通话时长为" + total_len + "秒"
diff --git a/Jaccorot/0020/src.xls b/Jaccorot/0020/src.xls
new file mode 100644
index 00000000..3eb2fb39
Binary files /dev/null and b/Jaccorot/0020/src.xls differ
diff --git a/Jaccorot/0021/0021.python b/Jaccorot/0021/0021.python
new file mode 100644
index 00000000..ed78b95c
--- /dev/null
+++ b/Jaccorot/0021/0021.python
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+# coding=utf-8
+__author__ = 'Jaccorot'
+
+import os
+from hashlib import sha256
+from hmac import HMAC
+
+def encrypt_password(password, salt=None):
+ if salt is None:
+ salt = os.urandom(8)
+ assert 8 == len(salt)
+ assert isinstance(salt, str)
+
+ if isinstance(password, unicode):
+ password = password.encode('utf-8')
+ assert isinstance(password, str)
+
+ for i in range(10):
+ encrypted = HMAC(password, salt, sha256).digest()
+ return salt + encrypted
+
+
+def validate_password(hashed, password):
+ return hashed == encrypt_password(password, hashed[:8])
+
+
+if __name__ == "__main__":
+ password_new = raw_input("Set your password\n")
+ password_saved = encrypt_password(password_new)
+ password_again = raw_input("Now,type in your password\n")
+ print "Yes,you got it." if validate_password(password_saved, password_again) else "No,it's wrong."
diff --git a/Jaccorot/0022/0.jpg b/Jaccorot/0022/0.jpg
new file mode 100644
index 00000000..82d17e99
Binary files /dev/null and b/Jaccorot/0022/0.jpg differ
diff --git a/Jaccorot/0022/0022.py b/Jaccorot/0022/0022.py
new file mode 100644
index 00000000..f817057b
--- /dev/null
+++ b/Jaccorot/0022/0022.py
@@ -0,0 +1,40 @@
+#!/usr/local/bin/python
+#coding=utf-8
+
+"""
+第 0022 题: iPhone 6、iPhone 6 Plus 早已上市开卖。请查看你写得 第 0005 题的代码是否可以复用。
+"""
+import os
+from PIL import Image
+
+PHONE = {'iPhone5':(1136,640), 'iPhone6':(1134,750), 'iPhone6P':(2208,1242)}
+
+
+def resize_pic(path, new_path, phone_type):
+ im = Image.open(path)
+ w,h = im.size
+
+ width,height = PHONE[phone_type]
+
+ if w > width:
+ h = width * h // w
+ w = width
+ if h > height:
+ w = height * w // h
+ h = height
+
+ im_resized = im.resize((w,h), Image.ANTIALIAS)
+ im_resized.save(new_path)
+
+
+def walk_dir_and_resize(path, phone_type):
+ for root, dirs, files in os.walk(path):
+ for f_name in files:
+ if f_name.lower().endswith('jpg'):
+ path_dst = os.path.join(root,f_name)
+ f_new_name = phone_type + '_' + f_name
+ resize_pic(path=path_dst, new_path=f_new_name , phone_type=phone_type)
+
+
+if __name__ == '__main__':
+ walk_dir_and_resize('./', 'iPhone6')
diff --git a/Jaccorot/0023/guestbook.db b/Jaccorot/0023/guestbook.db
new file mode 100644
index 00000000..a693ad0b
Binary files /dev/null and b/Jaccorot/0023/guestbook.db differ
diff --git a/Jaccorot/0023/guestbook.py b/Jaccorot/0023/guestbook.py
new file mode 100644
index 00000000..be75c839
--- /dev/null
+++ b/Jaccorot/0023/guestbook.py
@@ -0,0 +1,75 @@
+import sqlite3
+from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash
+from contextlib import closing
+import time
+
+DATABASE = 'guestbook.db'
+DEBUG = True
+SECRET_KEY = 'development key'
+
+app = Flask(__name__)
+app.config.from_object(__name__)
+
+def connect_db():
+ return sqlite3.connect(app.config['DATABASE'])
+
+def init_db():
+ with closing(connect_db()) as db:
+ with app.open_resource('schema.sql', mode='r') as f:
+ db.cursor().executescript(f.read())
+ db.commit()
+
+@app.before_request
+def before_request():
+ g.db = connect_db()
+
+@app.teardown_request
+def teardown_request(exception):
+ db = getattr(g, 'db', None)
+ if db is not None:
+ db.close()
+ g.db.close()
+
+
+@app.route('/')
+def show_entires():
+ cur = g.db.execute('select name,text,time from entries order by id desc')
+ entries = [dict(name=row[0], text=row[1], time=row[2]) for row in cur.fetchall()]
+ for i in entries:
+ print i
+ return render_template('show_entries.html', entries=entries)
+
+@app.route('/add', methods=['POST'])
+def add_entry():
+ if not session.get('logged_in'):
+ abort(401)
+ current_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
+ g.db.execute('insert into entries (name, text, time) values (?, ?, ?)',
+ [request.form['name'], request.form['text'], current_time])
+ g.db.commit()
+ flash('New entry was successfully posted')
+ return redirect(url_for('show_entires'))
+
+@app.route('/login', methods=['GET', 'POST'])
+def login():
+ error = None
+ if request.method == 'POST':
+ if request.form['username'] is None:
+ error = "Invalid username"
+ else:
+ session['logged_in'] = True
+ session['name'] = request.form['username']
+ flash('You were logged in')
+ return redirect(url_for('show_entires'))
+ return render_template('login.html', error=error)
+
+@app.route('/logout')
+def logout():
+ session.pop('logged_in', None)
+ flash('You were logged out')
+ return redirect(url_for('show_entires'))
+
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/Jaccorot/0023/schema.sql b/Jaccorot/0023/schema.sql
new file mode 100644
index 00000000..37d58baa
--- /dev/null
+++ b/Jaccorot/0023/schema.sql
@@ -0,0 +1,7 @@
+DROP TABLE if EXISTS entries;
+CREATE TABLE entries(
+ id INTEGER PRIMARY KEY autoincrement,
+ name text NOT NULL ,
+ text text NOT NULL,
+ time datetime NOT NULL
+);
\ No newline at end of file
diff --git a/Jaccorot/0023/static/style.css b/Jaccorot/0023/static/style.css
new file mode 100644
index 00000000..dbdb6f65
--- /dev/null
+++ b/Jaccorot/0023/static/style.css
@@ -0,0 +1,19 @@
+body { font-family: sans-serif; background: #eee; }
+a, h1, h2 { color: #377ba8; }
+h1, h2 { font-family: 'Georgia', serif; margin: 0; }
+h1 { border-bottom: 2px solid #eee; }
+h2 { font-size: 1.2em; }
+
+.page { margin: 2em auto; width: 35em; border: 5px solid #ccc;
+ padding: 0.8em; background: white; }
+.entries { list-style: none; margin: 0; padding: 0; }
+.entries li { margin: 0.8em 1.2em; }
+.entries li h2 { margin-left: -1em; }
+.add-entry { font-size: 0.9em; border-bottom: 1px solid #ccc; }
+.add-entry dl { font-weight: bold; }
+.metanav { text-align: right; font-size: 0.8em; padding: 0.3em;
+ margin-bottom: 1em; background: #fafafa; }
+.flash { background: #cee5F5; padding: 0.5em;
+ border: 1px solid #aacbe2; }
+.error { background: #f0d6d6; padding: 0.5em; }
+.time { text-align:right; }
\ No newline at end of file
diff --git a/Jaccorot/0023/templates/layout.html b/Jaccorot/0023/templates/layout.html
new file mode 100644
index 00000000..94cfdc84
--- /dev/null
+++ b/Jaccorot/0023/templates/layout.html
@@ -0,0 +1,25 @@
+
+
+
+
+ Guestbook
+
+
+
+
+
Guestbook
+
+ {% if not session.logged_in %}
+ log in
+ {% else %}
+
+
+
\ No newline at end of file
diff --git a/Lyndon1994/0024/__init__.py b/Lyndon1994/0024/__init__.py
new file mode 100644
index 00000000..40a96afc
--- /dev/null
+++ b/Lyndon1994/0024/__init__.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
diff --git a/Lyndon1994/0024/todo.py b/Lyndon1994/0024/todo.py
new file mode 100644
index 00000000..40a96afc
--- /dev/null
+++ b/Lyndon1994/0024/todo.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
diff --git a/Lyndon1994/README.md b/Lyndon1994/README.md
new file mode 100644
index 00000000..7f9b1ae1
--- /dev/null
+++ b/Lyndon1994/README.md
@@ -0,0 +1,2 @@
+# Show-Me-the-Code
+Show Me the Code Python version. https://github.com/Show-Me-the-Code/python
diff --git a/Lyndon1994/source/0004-text.txt b/Lyndon1994/source/0004-text.txt
new file mode 100644
index 00000000..906dc1c9
--- /dev/null
+++ b/Lyndon1994/source/0004-text.txt
@@ -0,0 +1,7 @@
+Architects look at thousands of buildings during their training, and study critiques of those buildings written by masters. In contrast, most software developers only ever get to know a handful of large programs well—usually programs they wrote themselves—and never study the great programs of history. As a result, they repeat one another's mistakes rather than building on one another's successes.
+
+Our goal is to change that. In these two books, the authors of four dozen open source applications explain how their software is structured, and why. What are each program's major components? How do they interact? And what did their builders learn during their development? In answering these questions, the contributors to these books provide unique insights into how they think.
+
+If you are a junior developer, and want to learn how your more experienced colleagues think, these books are the place to start. If you are an intermediate or senior developer, and want to see how your peers have solved hard design problems, these books can help you too.
+
+Follow us on our blog at http://aosabook.org/blog/ or on Twitter at @aosabook and using the #aosa hashtag.
\ No newline at end of file
diff --git a/Lyndon1994/source/0005/pics/17fb7c2dc017eef4d839b311c35a09df18ff6861.jpg b/Lyndon1994/source/0005/pics/17fb7c2dc017eef4d839b311c35a09df18ff6861.jpg
new file mode 100644
index 00000000..c2239b3e
Binary files /dev/null and b/Lyndon1994/source/0005/pics/17fb7c2dc017eef4d839b311c35a09df18ff6861.jpg differ
diff --git a/Lyndon1994/source/0005/pics/1caf792fb6fe974a521128071ef41ef53881c99c.jpg b/Lyndon1994/source/0005/pics/1caf792fb6fe974a521128071ef41ef53881c99c.jpg
new file mode 100644
index 00000000..07934944
Binary files /dev/null and b/Lyndon1994/source/0005/pics/1caf792fb6fe974a521128071ef41ef53881c99c.jpg differ
diff --git a/Lyndon1994/source/0005/pics/21232fa7298b4bdfe4778c25ef24258f6cfb6327.jpg b/Lyndon1994/source/0005/pics/21232fa7298b4bdfe4778c25ef24258f6cfb6327.jpg
new file mode 100644
index 00000000..9e84c32b
Binary files /dev/null and b/Lyndon1994/source/0005/pics/21232fa7298b4bdfe4778c25ef24258f6cfb6327.jpg differ
diff --git a/Lyndon1994/source/0005/pics/348dd2ae5ff6deb6ef7b6bf9ab23e43cf8d8d2c5.jpg b/Lyndon1994/source/0005/pics/348dd2ae5ff6deb6ef7b6bf9ab23e43cf8d8d2c5.jpg
new file mode 100644
index 00000000..f69c3dec
Binary files /dev/null and b/Lyndon1994/source/0005/pics/348dd2ae5ff6deb6ef7b6bf9ab23e43cf8d8d2c5.jpg differ
diff --git a/Lyndon1994/source/0005/pics/46673332eec7befebb70e54652f68423dd15ffbb.jpg b/Lyndon1994/source/0005/pics/46673332eec7befebb70e54652f68423dd15ffbb.jpg
new file mode 100644
index 00000000..c6b9d2da
Binary files /dev/null and b/Lyndon1994/source/0005/pics/46673332eec7befebb70e54652f68423dd15ffbb.jpg differ
diff --git a/Lyndon1994/source/0005/pics/50c0ebe8f13d8c4889faaba4daec14c298fd78a7.jpg b/Lyndon1994/source/0005/pics/50c0ebe8f13d8c4889faaba4daec14c298fd78a7.jpg
new file mode 100644
index 00000000..2ae2800e
Binary files /dev/null and b/Lyndon1994/source/0005/pics/50c0ebe8f13d8c4889faaba4daec14c298fd78a7.jpg differ
diff --git a/Lyndon1994/source/0005/pics/5865440118a1550d8d27c4fdd9d28f6e9efaa99a.jpg b/Lyndon1994/source/0005/pics/5865440118a1550d8d27c4fdd9d28f6e9efaa99a.jpg
new file mode 100644
index 00000000..ffcfbda0
Binary files /dev/null and b/Lyndon1994/source/0005/pics/5865440118a1550d8d27c4fdd9d28f6e9efaa99a.jpg differ
diff --git a/Lyndon1994/source/0005/pics/7bf24be69bee676e503efc0b09caf484db5dd2b9.jpg b/Lyndon1994/source/0005/pics/7bf24be69bee676e503efc0b09caf484db5dd2b9.jpg
new file mode 100644
index 00000000..4e28f702
Binary files /dev/null and b/Lyndon1994/source/0005/pics/7bf24be69bee676e503efc0b09caf484db5dd2b9.jpg differ
diff --git a/Lyndon1994/source/0005/pics/8d1076bccf118eb0145495e3f1babbe1c3b30180.jpg b/Lyndon1994/source/0005/pics/8d1076bccf118eb0145495e3f1babbe1c3b30180.jpg
new file mode 100644
index 00000000..52b00d6f
Binary files /dev/null and b/Lyndon1994/source/0005/pics/8d1076bccf118eb0145495e3f1babbe1c3b30180.jpg differ
diff --git a/Lyndon1994/source/0005/pics/afe35fd64c190588d8bf4a657d02c52ceea875b6.jpg b/Lyndon1994/source/0005/pics/afe35fd64c190588d8bf4a657d02c52ceea875b6.jpg
new file mode 100644
index 00000000..85d18172
Binary files /dev/null and b/Lyndon1994/source/0005/pics/afe35fd64c190588d8bf4a657d02c52ceea875b6.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_17fb7c2dc017eef4d839b311c35a09df18ff6861.jpg b/Lyndon1994/source/0005/result/finish_17fb7c2dc017eef4d839b311c35a09df18ff6861.jpg
new file mode 100644
index 00000000..c2943bf5
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_17fb7c2dc017eef4d839b311c35a09df18ff6861.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_1caf792fb6fe974a521128071ef41ef53881c99c.jpg b/Lyndon1994/source/0005/result/finish_1caf792fb6fe974a521128071ef41ef53881c99c.jpg
new file mode 100644
index 00000000..482ee574
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_1caf792fb6fe974a521128071ef41ef53881c99c.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_21232fa7298b4bdfe4778c25ef24258f6cfb6327.jpg b/Lyndon1994/source/0005/result/finish_21232fa7298b4bdfe4778c25ef24258f6cfb6327.jpg
new file mode 100644
index 00000000..95ea9f45
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_21232fa7298b4bdfe4778c25ef24258f6cfb6327.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_348dd2ae5ff6deb6ef7b6bf9ab23e43cf8d8d2c5.jpg b/Lyndon1994/source/0005/result/finish_348dd2ae5ff6deb6ef7b6bf9ab23e43cf8d8d2c5.jpg
new file mode 100644
index 00000000..946153f6
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_348dd2ae5ff6deb6ef7b6bf9ab23e43cf8d8d2c5.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_46673332eec7befebb70e54652f68423dd15ffbb.jpg b/Lyndon1994/source/0005/result/finish_46673332eec7befebb70e54652f68423dd15ffbb.jpg
new file mode 100644
index 00000000..dcd407f8
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_46673332eec7befebb70e54652f68423dd15ffbb.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_50c0ebe8f13d8c4889faaba4daec14c298fd78a7.jpg b/Lyndon1994/source/0005/result/finish_50c0ebe8f13d8c4889faaba4daec14c298fd78a7.jpg
new file mode 100644
index 00000000..40347a93
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_50c0ebe8f13d8c4889faaba4daec14c298fd78a7.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_5865440118a1550d8d27c4fdd9d28f6e9efaa99a.jpg b/Lyndon1994/source/0005/result/finish_5865440118a1550d8d27c4fdd9d28f6e9efaa99a.jpg
new file mode 100644
index 00000000..78a1ff40
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_5865440118a1550d8d27c4fdd9d28f6e9efaa99a.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_7bf24be69bee676e503efc0b09caf484db5dd2b9.jpg b/Lyndon1994/source/0005/result/finish_7bf24be69bee676e503efc0b09caf484db5dd2b9.jpg
new file mode 100644
index 00000000..73f0e40f
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_7bf24be69bee676e503efc0b09caf484db5dd2b9.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_8d1076bccf118eb0145495e3f1babbe1c3b30180.jpg b/Lyndon1994/source/0005/result/finish_8d1076bccf118eb0145495e3f1babbe1c3b30180.jpg
new file mode 100644
index 00000000..8f0caec6
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_8d1076bccf118eb0145495e3f1babbe1c3b30180.jpg differ
diff --git a/Lyndon1994/source/0005/result/finish_afe35fd64c190588d8bf4a657d02c52ceea875b6.jpg b/Lyndon1994/source/0005/result/finish_afe35fd64c190588d8bf4a657d02c52ceea875b6.jpg
new file mode 100644
index 00000000..7cdf1f2a
Binary files /dev/null and b/Lyndon1994/source/0005/result/finish_afe35fd64c190588d8bf4a657d02c52ceea875b6.jpg differ
diff --git a/Lyndon1994/source/0006/1.txt b/Lyndon1994/source/0006/1.txt
new file mode 100644
index 00000000..254a2332
--- /dev/null
+++ b/Lyndon1994/source/0006/1.txt
@@ -0,0 +1,7 @@
+Dethe is a geek dad, aesthetic programmer, mentor, and creator of the Waterbear visual programming tool. He co-hosts the Vancouver Maker Education Salons and wants to fill the world with robotic origami rabbits.
+
+In block-based programming languages, you write programs by dragging and connecting blocks that represent parts of the program. Block-based languages differ from conventional programming languages, in which you type words and symbols.
+
+Learning a programming language can be difficult because they are extremely sensitive to even the slightest of typos. Most programming languages are case-sensitive, have obscure syntax, and will refuse to run if you get so much as a semicolon in the wrong place—or worse, leave one out. Further, most programming languages in use today are based on English and their syntax cannot be localized.
+
+In contrast, a well-done block language can eliminate syntax errors completely. You can still create a program which does the wrong thing, but you cannot create one with the wrong syntax: the blocks just won't fit that way. Block languages are more discoverable: you can see all the constructs and libraries of the language right in the list of blocks. Further, blocks can be localized into any human language without changing the meaning of the programming language.
\ No newline at end of file
diff --git a/Lyndon1994/source/0006/2.txt b/Lyndon1994/source/0006/2.txt
new file mode 100644
index 00000000..f1fc4500
--- /dev/null
+++ b/Lyndon1994/source/0006/2.txt
@@ -0,0 +1,7 @@
+Block-based languages have a long history, with some of the prominent ones being Lego Mindstorms, Alice3D, StarLogo, and especially Scratch. There are several tools for block-based programming on the web as well: Blockly, AppInventor, Tynker, and many more.
+
+The code in this chapter is loosely based on the open-source project Waterbear, which is not a language but a tool for wrapping existing languages with a block-based syntax. Advantages of such a wrapper include the ones noted above: eliminating syntax errors, visual display of available components, ease of localization. Additionally, visual code can sometimes be easier to read and debug, and blocks can be used by pre-typing children. (We could even go further and put icons on the blocks, either in conjunction with the text names or instead of them, to allow pre-literate children to write programs, but we don't go that far in this example.)
+
+The choice of turtle graphics for this language goes back to the Logo language, which was created specifically to teach programming to children. Several of the block-based languages above include turtle graphics, and it is a small enough domain to be able to capture in a tightly constrained project such as this.
+
+If you would like to get a feel for what a block-based-language is like, you can experiment with the program that is built in this chapter from author's GitHub repository.
\ No newline at end of file
diff --git a/Lyndon1994/source/0006/3.txt b/Lyndon1994/source/0006/3.txt
new file mode 100644
index 00000000..f477eaad
--- /dev/null
+++ b/Lyndon1994/source/0006/3.txt
@@ -0,0 +1,6 @@
+Goals and Structure
+I want to accomplish a couple of things with this code. First and foremost, I want to implement a block language for turtle graphics, with which you can write code to create images through simple dragging-and-dropping of blocks, using as simple a structure of HTML, CSS, and JavaScript as possible. Second, but still important, I want to show how the blocks themselves can serve as a framework for other languages besides our mini turtle language.
+
+To do this, we encapsulate everything that is specific to the turtle language into one file (turtle.js) that we can easily swap with another file. Nothing else should be specific to the turtle language; the rest should just be about handling the blocks (blocks.js and menu.js) or be generally useful web utilities (util.js, drag.js, file.js). That is the goal, although to maintain the small size of the project, some of those utilities are less general-purpose and more specific to their use with the blocks.
+
+One thing that struck me when writing a block language was that the language is its own IDE. You can't just code up blocks in your favourite text editor; the IDE has to be designed and developed in parallel with the block language. This has some pros and cons. On the plus side, everyone will use a consistent environment and there is no room for religious wars about what editor to use. On the downside, it can be a huge distraction from building the block language itself.
\ No newline at end of file
diff --git a/Lyndon1994/source/0011/filtered_words.txt b/Lyndon1994/source/0011/filtered_words.txt
new file mode 100644
index 00000000..69373b64
--- /dev/null
+++ b/Lyndon1994/source/0011/filtered_words.txt
@@ -0,0 +1,11 @@
+北京
+程序员
+公务员
+领导
+牛比
+牛逼
+你娘
+你妈
+love
+sex
+jiangge
\ No newline at end of file
diff --git a/Lyndon1994/source/0014/student.txt b/Lyndon1994/source/0014/student.txt
new file mode 100644
index 00000000..f06a601f
--- /dev/null
+++ b/Lyndon1994/source/0014/student.txt
@@ -0,0 +1,5 @@
+{
+ "1":["张三",150,120,100],
+ "2":["李四",90,99,95],
+ "3":["王五",60,66,68]
+}
\ No newline at end of file
diff --git a/Lyndon1994/source/0014/student.xls b/Lyndon1994/source/0014/student.xls
new file mode 100644
index 00000000..c8a41564
Binary files /dev/null and b/Lyndon1994/source/0014/student.xls differ
diff --git a/Lyndon1994/source/0014/student.xml b/Lyndon1994/source/0014/student.xml
new file mode 100644
index 00000000..9f7d7661
--- /dev/null
+++ b/Lyndon1994/source/0014/student.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ {
+ "1":["张三",150,120,100],
+ "2":["李四",90,99,95],
+ "3":["王五",60,66,68]
+}
+
+
+
\ No newline at end of file
diff --git a/Lyndon1994/source/0015/city.txt b/Lyndon1994/source/0015/city.txt
new file mode 100644
index 00000000..312f5c19
--- /dev/null
+++ b/Lyndon1994/source/0015/city.txt
@@ -0,0 +1,5 @@
+{
+ "1" : "上海",
+ "2" : "北京",
+ "3" : "成都"
+}
\ No newline at end of file
diff --git a/Lyndon1994/source/0015/city.xls b/Lyndon1994/source/0015/city.xls
new file mode 100644
index 00000000..1809fe86
Binary files /dev/null and b/Lyndon1994/source/0015/city.xls differ
diff --git "a/Lyndon1994/source/0020/2017\345\271\26403\346\234\210\350\257\255\351\237\263\351\200\232\344\277\241.xls" "b/Lyndon1994/source/0020/2017\345\271\26403\346\234\210\350\257\255\351\237\263\351\200\232\344\277\241.xls"
new file mode 100644
index 00000000..6f77a985
Binary files /dev/null and "b/Lyndon1994/source/0020/2017\345\271\26403\346\234\210\350\257\255\351\237\263\351\200\232\344\277\241.xls" differ
diff --git a/MarzinZ/0000/add_num.py b/MarzinZ/0000/add_num.py
new file mode 100644
index 00000000..3386fa23
--- /dev/null
+++ b/MarzinZ/0000/add_num.py
@@ -0,0 +1,18 @@
+from PIL import Image, ImageDraw, ImageFont
+
+def add_num_to_img(image_path, sign="42"):
+ im = Image.open(image_path)
+ width, height = im.size
+
+ draw = ImageDraw.Draw(im)
+ font = ImageFont.truetype("arial.ttf", min(width//6, height//6))
+ draw.text((width*0.75, height*0.075), sign, font=font, fill=(255,33,33, 255))
+
+ left, right = image_path.rsplit(".", 1)
+ new_image_path = left + "_" + sign + "." + right
+ im.save(new_image_path)
+
+if __name__ == '__main__':
+ # for test
+ add_num_to_img("./sample.jpg")
+ print "Finished."
diff --git a/Matafight/0001/gencodes.txt b/Matafight/0001/gencodes.txt
new file mode 100644
index 00000000..045129fd
--- /dev/null
+++ b/Matafight/0001/gencodes.txt
@@ -0,0 +1,200 @@
+19a86eae-e274-11e4-a462-b870f41f9997
+19ab06c0-e274-11e4-90b2-b870f41f9997
+19ab06c1-e274-11e4-92e6-b870f41f9997
+19ab06c2-e274-11e4-af0d-b870f41f9997
+19ab06c3-e274-11e4-9ee8-b870f41f9997
+19ab06c4-e274-11e4-bdba-b870f41f9997
+19ab06c5-e274-11e4-98bd-b870f41f9997
+19ab06c6-e274-11e4-9247-b870f41f9997
+19ab06c7-e274-11e4-b1d7-b870f41f9997
+19ab06c8-e274-11e4-9b50-b870f41f9997
+19ab06c9-e274-11e4-b95e-b870f41f9997
+19ab06ca-e274-11e4-a6bc-b870f41f9997
+19ab06cb-e274-11e4-acb2-b870f41f9997
+19ab06cc-e274-11e4-adc3-b870f41f9997
+19ab06cd-e274-11e4-82d2-b870f41f9997
+19ab06ce-e274-11e4-9c5c-b870f41f9997
+19ab06cf-e274-11e4-887b-b870f41f9997
+19ab06d0-e274-11e4-9ae6-b870f41f9997
+19ab06d1-e274-11e4-9a89-b870f41f9997
+19ab06d2-e274-11e4-adc9-b870f41f9997
+19ab06d3-e274-11e4-9717-b870f41f9997
+19ab06d4-e274-11e4-b475-b870f41f9997
+19ab06d5-e274-11e4-971e-b870f41f9997
+19ab06d6-e274-11e4-8726-b870f41f9997
+19ab06d7-e274-11e4-bc47-b870f41f9997
+19ab06d8-e274-11e4-91a3-b870f41f9997
+19ab06d9-e274-11e4-85fe-b870f41f9997
+19ab06da-e274-11e4-b7e9-b870f41f9997
+19ab06db-e274-11e4-8f0d-b870f41f9997
+19ab06dc-e274-11e4-bd0d-b870f41f9997
+19ab06dd-e274-11e4-bb78-b870f41f9997
+19ab06de-e274-11e4-a8cd-b870f41f9997
+19ab06df-e274-11e4-932c-b870f41f9997
+19ab2dcf-e274-11e4-8c44-b870f41f9997
+19ab2dd0-e274-11e4-a7fb-b870f41f9997
+19ab2dd1-e274-11e4-9805-b870f41f9997
+19ab2dd2-e274-11e4-9f0f-b870f41f9997
+19ab2dd3-e274-11e4-b0d7-b870f41f9997
+19ab2dd4-e274-11e4-9ab0-b870f41f9997
+19ab2dd5-e274-11e4-b7e0-b870f41f9997
+19ab2dd6-e274-11e4-9e9f-b870f41f9997
+19ab2dd7-e274-11e4-9b23-b870f41f9997
+19ab2dd8-e274-11e4-af20-b870f41f9997
+19ab2dd9-e274-11e4-893b-b870f41f9997
+19ab2dda-e274-11e4-ae1f-b870f41f9997
+19ab2ddb-e274-11e4-83ba-b870f41f9997
+19ab2ddc-e274-11e4-9f4d-b870f41f9997
+19ab2ddd-e274-11e4-abca-b870f41f9997
+19ab2dde-e274-11e4-8e66-b870f41f9997
+19ab2ddf-e274-11e4-9ef6-b870f41f9997
+19ab2de0-e274-11e4-bc9f-b870f41f9997
+19ab2de1-e274-11e4-aad4-b870f41f9997
+19ab2de2-e274-11e4-8b72-b870f41f9997
+19ab2de3-e274-11e4-8fb4-b870f41f9997
+19ab2de4-e274-11e4-b16e-b870f41f9997
+19ab2de5-e274-11e4-9c55-b870f41f9997
+19ab2de6-e274-11e4-8944-b870f41f9997
+19ab2de7-e274-11e4-a194-b870f41f9997
+19ab2de8-e274-11e4-939a-b870f41f9997
+19ab2de9-e274-11e4-9407-b870f41f9997
+19ab2dea-e274-11e4-89dd-b870f41f9997
+19ab2deb-e274-11e4-ab68-b870f41f9997
+19ab2dec-e274-11e4-81c4-b870f41f9997
+19ab2ded-e274-11e4-8a0a-b870f41f9997
+19ab2dee-e274-11e4-b053-b870f41f9997
+19ab2def-e274-11e4-b9eb-b870f41f9997
+19ab2df0-e274-11e4-b4c4-b870f41f9997
+19ab2df1-e274-11e4-bb71-b870f41f9997
+19ab2df2-e274-11e4-866d-b870f41f9997
+19ab2df3-e274-11e4-a075-b870f41f9997
+19ab2df4-e274-11e4-a26d-b870f41f9997
+19ab2df5-e274-11e4-97e7-b870f41f9997
+19ab2df6-e274-11e4-8daf-b870f41f9997
+19ab2df7-e274-11e4-8454-b870f41f9997
+19ab2df8-e274-11e4-846f-b870f41f9997
+19ab2df9-e274-11e4-bbcf-b870f41f9997
+19ab2dfa-e274-11e4-8c00-b870f41f9997
+19ab2dfb-e274-11e4-9dfd-b870f41f9997
+19ab2dfc-e274-11e4-bc23-b870f41f9997
+19ab2dfd-e274-11e4-bc22-b870f41f9997
+19ab2dfe-e274-11e4-aeb7-b870f41f9997
+19ab2dff-e274-11e4-a089-b870f41f9997
+19ab54de-e274-11e4-bbae-b870f41f9997
+19ab54df-e274-11e4-9bcc-b870f41f9997
+19ab54e0-e274-11e4-b29f-b870f41f9997
+19ab54e1-e274-11e4-b35e-b870f41f9997
+19ab54e2-e274-11e4-a961-b870f41f9997
+19ab54e3-e274-11e4-b4ac-b870f41f9997
+19ab54e4-e274-11e4-92f1-b870f41f9997
+19ab54e5-e274-11e4-9e32-b870f41f9997
+19ab54e6-e274-11e4-81c6-b870f41f9997
+19ab54e7-e274-11e4-8ddf-b870f41f9997
+19ab54e8-e274-11e4-80a2-b870f41f9997
+19ab54e9-e274-11e4-a464-b870f41f9997
+19ab54ea-e274-11e4-82a3-b870f41f9997
+19ab54eb-e274-11e4-8063-b870f41f9997
+19ab54ec-e274-11e4-a971-b870f41f9997
+19ab54ed-e274-11e4-ae75-b870f41f9997
+19ab54ee-e274-11e4-b3eb-b870f41f9997
+19ab54ef-e274-11e4-a18f-b870f41f9997
+19ab54f0-e274-11e4-8caa-b870f41f9997
+19ab54f1-e274-11e4-b8c5-b870f41f9997
+19ab54f2-e274-11e4-8a9e-b870f41f9997
+19ab54f3-e274-11e4-95ee-b870f41f9997
+19ab54f4-e274-11e4-88e3-b870f41f9997
+19ab54f5-e274-11e4-bf12-b870f41f9997
+19ab54f6-e274-11e4-ada4-b870f41f9997
+19ab54f7-e274-11e4-b0ef-b870f41f9997
+19ab54f8-e274-11e4-8b9a-b870f41f9997
+19ab54f9-e274-11e4-98b1-b870f41f9997
+19ab54fa-e274-11e4-916d-b870f41f9997
+19ab54fb-e274-11e4-8ec0-b870f41f9997
+19ab54fc-e274-11e4-b626-b870f41f9997
+19ab54fd-e274-11e4-a904-b870f41f9997
+19ab54fe-e274-11e4-8662-b870f41f9997
+19ab54ff-e274-11e4-83d1-b870f41f9997
+19ab5500-e274-11e4-9042-b870f41f9997
+19ab5501-e274-11e4-b901-b870f41f9997
+19ab5502-e274-11e4-bcfa-b870f41f9997
+19ab5503-e274-11e4-8736-b870f41f9997
+19ab5504-e274-11e4-86f5-b870f41f9997
+19ab5505-e274-11e4-93bc-b870f41f9997
+19ab5506-e274-11e4-830d-b870f41f9997
+19ab5507-e274-11e4-b3f1-b870f41f9997
+19ab5508-e274-11e4-93d5-b870f41f9997
+19ab5509-e274-11e4-923a-b870f41f9997
+19ab550a-e274-11e4-85a4-b870f41f9997
+19ab550b-e274-11e4-9502-b870f41f9997
+19ab550c-e274-11e4-b9f6-b870f41f9997
+19ab550d-e274-11e4-a867-b870f41f9997
+19ab550e-e274-11e4-89ae-b870f41f9997
+19ab550f-e274-11e4-8ae9-b870f41f9997
+19ab5510-e274-11e4-885e-b870f41f9997
+19ab5511-e274-11e4-90f8-b870f41f9997
+19ab7bee-e274-11e4-9370-b870f41f9997
+19ab7bef-e274-11e4-846a-b870f41f9997
+19ab7bf0-e274-11e4-839f-b870f41f9997
+19ab7bf1-e274-11e4-a17d-b870f41f9997
+19ab7bf2-e274-11e4-8619-b870f41f9997
+19ab7bf3-e274-11e4-a290-b870f41f9997
+19ab7bf4-e274-11e4-89c3-b870f41f9997
+19ab7bf5-e274-11e4-ad3b-b870f41f9997
+19ab7bf6-e274-11e4-ae67-b870f41f9997
+19ab7bf7-e274-11e4-938b-b870f41f9997
+19ab7bf8-e274-11e4-a6e5-b870f41f9997
+19ab7bf9-e274-11e4-805e-b870f41f9997
+19ab7bfa-e274-11e4-a574-b870f41f9997
+19ab7bfb-e274-11e4-a379-b870f41f9997
+19ab7bfc-e274-11e4-873c-b870f41f9997
+19ab7bfd-e274-11e4-a312-b870f41f9997
+19ab7bfe-e274-11e4-88f3-b870f41f9997
+19ab7bff-e274-11e4-98bf-b870f41f9997
+19ab7c00-e274-11e4-854c-b870f41f9997
+19ab7c01-e274-11e4-aefa-b870f41f9997
+19ab7c02-e274-11e4-96aa-b870f41f9997
+19ab7c03-e274-11e4-bea1-b870f41f9997
+19ab7c04-e274-11e4-ade7-b870f41f9997
+19ab7c05-e274-11e4-8f69-b870f41f9997
+19ab7c06-e274-11e4-9f5c-b870f41f9997
+19ab7c07-e274-11e4-b7b5-b870f41f9997
+19ab7c08-e274-11e4-b981-b870f41f9997
+19ab7c09-e274-11e4-9afa-b870f41f9997
+19ab7c0a-e274-11e4-bfb1-b870f41f9997
+19ab7c0b-e274-11e4-82d7-b870f41f9997
+19ab7c0c-e274-11e4-b270-b870f41f9997
+19ab7c0d-e274-11e4-bae6-b870f41f9997
+19ab7c0e-e274-11e4-8b31-b870f41f9997
+19ab7c0f-e274-11e4-8cde-b870f41f9997
+19ab7c10-e274-11e4-a381-b870f41f9997
+19ab7c11-e274-11e4-8716-b870f41f9997
+19ab7c12-e274-11e4-8884-b870f41f9997
+19ab7c13-e274-11e4-80ff-b870f41f9997
+19ab7c14-e274-11e4-acc5-b870f41f9997
+19ab7c15-e274-11e4-a471-b870f41f9997
+19aba300-e274-11e4-8f8f-b870f41f9997
+19aba301-e274-11e4-a482-b870f41f9997
+19aba302-e274-11e4-9d99-b870f41f9997
+19aba303-e274-11e4-912e-b870f41f9997
+19aba304-e274-11e4-8850-b870f41f9997
+19aba305-e274-11e4-8c3b-b870f41f9997
+19aba306-e274-11e4-aab1-b870f41f9997
+19aba307-e274-11e4-9eef-b870f41f9997
+19aba308-e274-11e4-bb0f-b870f41f9997
+19aba309-e274-11e4-9209-b870f41f9997
+19aba30a-e274-11e4-90fc-b870f41f9997
+19aba30b-e274-11e4-b358-b870f41f9997
+19aba30c-e274-11e4-a370-b870f41f9997
+19aba30d-e274-11e4-8500-b870f41f9997
+19aba30e-e274-11e4-9f97-b870f41f9997
+19aba30f-e274-11e4-bd2f-b870f41f9997
+19aba310-e274-11e4-aac0-b870f41f9997
+19aba311-e274-11e4-b0f9-b870f41f9997
+19aba312-e274-11e4-ac67-b870f41f9997
+19aba313-e274-11e4-957e-b870f41f9997
+19aba314-e274-11e4-9150-b870f41f9997
+19aba315-e274-11e4-8e0d-b870f41f9997
+19aba316-e274-11e4-a72e-b870f41f9997
+19aba317-e274-11e4-ae22-b870f41f9997
+19aba318-e274-11e4-8f40-b870f41f9997
+19aba319-e274-11e4-85be-b870f41f9997
diff --git a/Matafight/0001/generate_200.py b/Matafight/0001/generate_200.py
new file mode 100644
index 00000000..6cb7305e
--- /dev/null
+++ b/Matafight/0001/generate_200.py
@@ -0,0 +1,23 @@
+#_*_ encoding: utf-8 _*_
+import uuid
+
+class generate:
+ def __init__(self):
+ self.num=0;
+ self.listid=[];
+ def generate_uuid(self,num):
+ for i in range(int(num)):
+ self.listid.append(uuid.uuid1());
+
+ def get_uuid(self):
+ return self.listid;
+
+if __name__=="__main__":
+ gencode=generate();
+ gencode.generate_uuid(200);
+ keys=gencode.get_uuid();
+ filekeys=file("gencodes.txt",'w');
+ for key in keys:
+ filekeys.write(str(key)+'\n');
+ filekeys.close();
+
diff --git a/Matafight/0004/countWord.py b/Matafight/0004/countWord.py
new file mode 100644
index 00000000..3766b9eb
--- /dev/null
+++ b/Matafight/0004/countWord.py
@@ -0,0 +1,10 @@
+#_*_ encoding: utf-8 _*_
+import re
+
+inputfile=file("test.txt",'r');
+count=0;
+for line in inputfile.readlines():
+ word=re.findall(r"\w+",line);
+ count+=len(word);
+print "total wordcount is "+ str(count);
+inputfile.close();
diff --git a/Matafight/0004/test.txt b/Matafight/0004/test.txt
new file mode 100644
index 00000000..3505a728
--- /dev/null
+++ b/Matafight/0004/test.txt
@@ -0,0 +1,2 @@
+this is a test file
+this is second line:
\ No newline at end of file
diff --git a/Matafight/0006/diary1.txt b/Matafight/0006/diary1.txt
new file mode 100644
index 00000000..c6e8552e
--- /dev/null
+++ b/Matafight/0006/diary1.txt
@@ -0,0 +1 @@
+this is a diary test is
\ No newline at end of file
diff --git a/Matafight/0006/diary2.txt b/Matafight/0006/diary2.txt
new file mode 100644
index 00000000..76afcce7
--- /dev/null
+++ b/Matafight/0006/diary2.txt
@@ -0,0 +1,2 @@
+test
+test
\ No newline at end of file
diff --git a/Matafight/0006/diary3.txt b/Matafight/0006/diary3.txt
new file mode 100644
index 00000000..f27296b5
--- /dev/null
+++ b/Matafight/0006/diary3.txt
@@ -0,0 +1,2 @@
+diary3
+diary3
\ No newline at end of file
diff --git a/Matafight/0006/importantdiary.py b/Matafight/0006/importantdiary.py
new file mode 100644
index 00000000..f062a504
--- /dev/null
+++ b/Matafight/0006/importantdiary.py
@@ -0,0 +1,41 @@
+#_*_ encoding: utf-8 _*_
+import re
+
+class countWord:
+ def __init__(self):
+ self.dic={};
+ self.word="";
+
+
+ def count(self,filename):
+ self.dic={};
+ fopen=file(filename,'r');
+ for lines in fopen.readlines():
+ words=re.findall(r"\w+",lines);
+ for items in words:
+ if items in self.dic.keys():
+ self.dic[items]+=1;
+ else:
+ self.dic[items]=1;
+
+ #对字典value值排序
+ dict= sorted(self.dic.iteritems(), key=lambda d:d[1], reverse = True);
+ self.word=dict[0][0];
+
+ def getWord(self):
+ return self.word;
+
+
+if __name__=="__main__":
+ diarycount=countWord();
+ order=1;
+ importantlist=[];
+ for order in range(1,4):
+ fname="diary"+str(order)+".txt";
+ diarycount.count(fname);
+ importantlist.append(diarycount.getWord());
+ order+=1;
+ for item in importantlist:
+ print str(item)+"\t";
+
+
diff --git a/Matafight/0007/countCodeLines.py b/Matafight/0007/countCodeLines.py
new file mode 100644
index 00000000..e3ca80a0
--- /dev/null
+++ b/Matafight/0007/countCodeLines.py
@@ -0,0 +1,63 @@
+#_*_ encoding: utf-8 _*_
+import os
+import re
+#http://www.cnblogs.com/zhoujie/archive/2013/04/10/python7.html
+#http://cuiqingcai.com/977.html
+class countLines:
+ def __init__(self):
+ self.comment=0;
+ self.codes=0;
+ self.blank=0;
+ self.fileList=[];#存的是各个文件相关的list
+ def openDir(self,dirname):
+ curdir=os.getcwd();
+ curdir=curdir+str(dirname);
+ print curdir
+ dirlist=os.listdir(curdir);
+ checkpy=re.compile(r"\.py$");
+ for item in dirlist:
+ if checkpy.search(item):
+ item="\\"+item;
+ self.count(curdir+item);
+
+ def count(self,filename):
+ self.comment=0;
+ self.codes=0;
+ self.blank=0;
+ f=file(filename,'r');
+ patcomment=re.compile(r"^\s*#");#
+ patblank=re.compile(r"^\s+$");#空白字符
+ for line in f.readlines():
+ if patblank.search(line):
+ self.blank+=1;
+ elif patcomment.search(line):
+ self.comment+=1;
+ else:
+ self.codes+=1;
+ self.fileList.append([filename,self.codes,self.comment,self.blank]);
+
+ f.close();
+
+ def getResult(self):
+ return self.fileList;
+
+if __name__=="__main__":
+ countInstance=countLines();
+ countInstance.openDir(r"\testDir");
+ relist=countInstance.getResult();
+ for item in relist:
+ print item[0];
+ print "code num:"+str(item[1]);
+ print "comment num:"+str(item[2]);
+ print "blank num:"+str(item[3]);
+ print "\n"
+
+
+
+
+
+
+
+
+
+
diff --git a/Matafight/0007/testDir/countWord.py b/Matafight/0007/testDir/countWord.py
new file mode 100644
index 00000000..3766b9eb
--- /dev/null
+++ b/Matafight/0007/testDir/countWord.py
@@ -0,0 +1,10 @@
+#_*_ encoding: utf-8 _*_
+import re
+
+inputfile=file("test.txt",'r');
+count=0;
+for line in inputfile.readlines():
+ word=re.findall(r"\w+",line);
+ count+=len(word);
+print "total wordcount is "+ str(count);
+inputfile.close();
diff --git a/Matafight/0007/testDir/generate_200.py b/Matafight/0007/testDir/generate_200.py
new file mode 100644
index 00000000..6cb7305e
--- /dev/null
+++ b/Matafight/0007/testDir/generate_200.py
@@ -0,0 +1,23 @@
+#_*_ encoding: utf-8 _*_
+import uuid
+
+class generate:
+ def __init__(self):
+ self.num=0;
+ self.listid=[];
+ def generate_uuid(self,num):
+ for i in range(int(num)):
+ self.listid.append(uuid.uuid1());
+
+ def get_uuid(self):
+ return self.listid;
+
+if __name__=="__main__":
+ gencode=generate();
+ gencode.generate_uuid(200);
+ keys=gencode.get_uuid();
+ filekeys=file("gencodes.txt",'w');
+ for key in keys:
+ filekeys.write(str(key)+'\n');
+ filekeys.close();
+
diff --git a/Matafight/0007/testDir/importantdiary.py b/Matafight/0007/testDir/importantdiary.py
new file mode 100644
index 00000000..f062a504
--- /dev/null
+++ b/Matafight/0007/testDir/importantdiary.py
@@ -0,0 +1,41 @@
+#_*_ encoding: utf-8 _*_
+import re
+
+class countWord:
+ def __init__(self):
+ self.dic={};
+ self.word="";
+
+
+ def count(self,filename):
+ self.dic={};
+ fopen=file(filename,'r');
+ for lines in fopen.readlines():
+ words=re.findall(r"\w+",lines);
+ for items in words:
+ if items in self.dic.keys():
+ self.dic[items]+=1;
+ else:
+ self.dic[items]=1;
+
+ #对字典value值排序
+ dict= sorted(self.dic.iteritems(), key=lambda d:d[1], reverse = True);
+ self.word=dict[0][0];
+
+ def getWord(self):
+ return self.word;
+
+
+if __name__=="__main__":
+ diarycount=countWord();
+ order=1;
+ importantlist=[];
+ for order in range(1,4):
+ fname="diary"+str(order)+".txt";
+ diarycount.count(fname);
+ importantlist.append(diarycount.getWord());
+ order+=1;
+ for item in importantlist:
+ print str(item)+"\t";
+
+
diff --git a/Matafight/0007/testDir/test.txt b/Matafight/0007/testDir/test.txt
new file mode 100644
index 00000000..a4c321ec
--- /dev/null
+++ b/Matafight/0007/testDir/test.txt
@@ -0,0 +1,3 @@
+what
+#
+kiddingme
\ No newline at end of file
diff --git a/Matafight/0009/getLinks.py b/Matafight/0009/getLinks.py
new file mode 100644
index 00000000..df0d3d24
--- /dev/null
+++ b/Matafight/0009/getLinks.py
@@ -0,0 +1,25 @@
+# _*_ encodeing: utf-8 _*_
+from HTMLParser import HTMLParser
+import urllib2
+
+class myParser(HTMLParser):
+ def __init__(self):
+ HTMLParser.__init__(self);
+ self.flag=0;
+ self.links=[];
+
+ def handle_starttag(self, tag, attrs):
+ if tag == "a":
+ for name,value in attrs:
+ if name =="href":
+ self.links.append(value);
+
+
+if __name__=="__main__":
+ parser=myParser();
+ myurl='http://www.baidu.com';
+ html=urllib2.urlopen(myurl);
+ htmlcode=html.read();
+ parser.feed(htmlcode);
+ print parser.links;
+
diff --git a/Matafight/0011/filtered_word.txt b/Matafight/0011/filtered_word.txt
new file mode 100644
index 00000000..69373b64
--- /dev/null
+++ b/Matafight/0011/filtered_word.txt
@@ -0,0 +1,11 @@
+北京
+程序员
+公务员
+领导
+牛比
+牛逼
+你娘
+你妈
+love
+sex
+jiangge
\ No newline at end of file
diff --git a/Matafight/0011/senWord.py b/Matafight/0011/senWord.py
new file mode 100644
index 00000000..e9f331fb
--- /dev/null
+++ b/Matafight/0011/senWord.py
@@ -0,0 +1,33 @@
+# -*-coding:utf-8-*-
+import string
+
+class senseWord():
+ def __init__(self):
+ self.list=[]
+ inputfile=file('filtered_word.txt','r')
+ for lines in inputfile.readlines():
+ self.list.append(lines.decode('utf-8').encode('gbk'))#I've set the file coding type as utf-8
+ inputfile.close()
+ self.list=map(string.strip,self.list);
+ for item in self.list:
+ print item
+ def checkWord(self,word):
+ for words in self.list:
+ if words == word:
+ return True
+ return False
+
+if __name__=='__main__':
+ myCheck=senseWord()
+ ipstr=raw_input()
+ while True:
+ ipstr=raw_input()
+ if ipstr:
+ if(myCheck.checkWord(ipstr)):
+ print 'Freedom'
+ else:
+ print 'humanRight'
+ else:
+ break
+
+
diff --git a/Matafight/0012/ResenWord.py b/Matafight/0012/ResenWord.py
new file mode 100644
index 00000000..052716de
--- /dev/null
+++ b/Matafight/0012/ResenWord.py
@@ -0,0 +1,45 @@
+# -*-coding:utf-8-*-
+import string
+class senseWord():
+ def __init__(self):
+ self.list=[]
+ self.word=[]
+ inputfile=file('filtered_word.txt','r')
+ for lines in inputfile.readlines():
+ self.list.append(lines.decode('utf-8').encode('gbk'))#I've set the file coding type as utf-8
+ inputfile.close()
+ self.list=map(string.strip,self.list);
+
+ def checkWord(self,word):
+ flag=False
+ for words in self.list:
+ if words in word:
+ self.word.append(words)
+ flag= True
+ return flag
+
+ def getWord(self):
+
+ return self.word
+
+if __name__=='__main__':
+ myCheck=senseWord()
+ while True:
+ ipstr=str(raw_input())
+ if ipstr:
+ if(myCheck.checkWord(ipstr)):
+ senseList=myCheck.getWord()
+ for items in senseList:
+ length=len(items.decode('gbk'))
+ torep='*';
+ for i in range(1,length):
+ torep+='*'
+ ipstr=ipstr.replace(items,torep)
+ print ipstr
+ else:
+ print ipstr
+ else:
+ break
+
+
+
diff --git a/Matafight/0012/filtered_word.txt b/Matafight/0012/filtered_word.txt
new file mode 100644
index 00000000..69373b64
--- /dev/null
+++ b/Matafight/0012/filtered_word.txt
@@ -0,0 +1,11 @@
+北京
+程序员
+公务员
+领导
+牛比
+牛逼
+你娘
+你妈
+love
+sex
+jiangge
\ No newline at end of file
diff --git a/Mr.Lin/0000/0000.py b/Mr.Lin/0000/0000.py
new file mode 100644
index 00000000..b531eba2
--- /dev/null
+++ b/Mr.Lin/0000/0000.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Author: 30987
+# @Date: 2015-01-12 16:06:03
+# @Last Modified by: 30987
+# @Last Modified time: 2015-01-12 17:03:30
+#将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。
+
+from PIL import Image, ImageDraw, ImageFont
+class Image_unread_message:
+ def open(self,path):
+ self.im=Image.open(path)
+ return True
+ def __init__(self):
+ self.fnt=None
+ self.im=None
+
+ def setFont(self,font_path,size):
+ self.fnt=ImageFont.truetype(font_path,size)
+ return True
+ def draw_text(self,position,str,colour,fnt):
+ draw=ImageDraw.Draw(self.im)
+ draw.text(position,str,fill=colour,font=fnt)
+ self.im.show()
+ self.im.save(str+'num'+'.jpg')
+ return True
+
+
+test=Image_unread_message()
+test.open('1.png')
+test.setFont('ahronbd.ttf',80)
+test.draw_text((200,-20),'4',(255,0,0),test.fnt)
+
diff --git a/Mr.Lin/0000/1.png b/Mr.Lin/0000/1.png
new file mode 100644
index 00000000..60e8211a
Binary files /dev/null and b/Mr.Lin/0000/1.png differ
diff --git a/Mr.Lin/0001/0001.py b/Mr.Lin/0001/0001.py
new file mode 100644
index 00000000..f0185b03
--- /dev/null
+++ b/Mr.Lin/0001/0001.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Author: 30987
+# @Date: 2015-01-12 17:03:52
+# @Last Modified by: 30987
+# @Last Modified time: 2015-01-12 17:21:29
+
+#第 0001 题:做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)?
+
+
+import uuid
+
+def creat_code(number=10):
+ result =[]
+
+ while True is True:
+ uuid_id=uuid.uuid1()
+ tem = str(uuid_id).replace('-','')
+ tmmmm=str(tem[4:])
+ if not tmmmm in result:
+ result.append(tmmmm)
+ if len(result) is number:
+ break
+ print result
+
+creat_code()
\ No newline at end of file
diff --git a/Mr.Lin/0002/0002.py b/Mr.Lin/0002/0002.py
new file mode 100644
index 00000000..14fc4382
--- /dev/null
+++ b/Mr.Lin/0002/0002.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Author: 30987
+# @Date: 2015-01-12 17:22:35
+# @Last Modified by: 30987
+# @Last Modified time: 2015-01-12 22:33:53
+
+#第 0002 题:将 0001 题生成的 200 个激活码(或者优惠券)保存到 MySQL 关系型数据库中。
+
+import uuid
+import MySQLdb
+
+def creat_code(number=20):
+ result = []
+ while True is True:
+ tem=str(uuid.uuid1()).replace('-','')
+ if not tem in result:
+ result.append(tem)
+ if len(result) is number:
+ break
+ return result
+
+def coont_db(result):
+ num = len(result)
+ db= MySQLdb.connect('localhost','root','','python',charset='utf8')
+ cur = db.cursor()
+
+ try:
+ db= MySQLdb.connect('localhost','root','','python',charset='utf8')
+ cur = db.cursor()
+ print "OK"
+ for i in xrange(num):
+ cur.execute('insert into code (code_num) values("%s")' % (result[i]))
+ db.commit()
+ except:
+ print "数据库连接错误!"
+ db.rollback()
+ db.close()
+
+
+
+if __name__ == '__main__':
+ coont_db(creat_code())
diff --git a/Mr.Lin/0004/0004.py b/Mr.Lin/0004/0004.py
new file mode 100644
index 00000000..013399bb
--- /dev/null
+++ b/Mr.Lin/0004/0004.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Author: 30987
+# @Date: 2015-01-12 22:58:23
+# @Last Modified by: 30987
+# @Last Modified time: 2015-01-12 23:09:12
+
+#第 0004 题:任一个英文的纯文本文件,统计其中的单词出现的个数。
+
+def word_count(file_path):
+ file = open(file_path,'r')
+ num = 0
+ file.read()
+ for line in file:
+ line_list = line.split()
+ #print line_list
+ num += len(line_list)
+ file.close()
+ return num
+
+if __name__ == '__main__':
+ try:
+ print 'The total number of words is :',word_count('test.txt')
+ except Exception, e:
+ print "Can't open file!"
\ No newline at end of file
diff --git a/Mr.Lin/0004/test.txt b/Mr.Lin/0004/test.txt
new file mode 100644
index 00000000..72f34614
--- /dev/null
+++ b/Mr.Lin/0004/test.txt
@@ -0,0 +1,26 @@
+Why are my contributions not showing up on my profile?
+
+
+Contributions that are counted
+Your profile contributions graph is a record of contributions you've made to GitHub repositories. Contributions are only counted if they meet certain criteria. In some cases, we may need to rebuild your graph in order for contributions to appear.
+Issues and pull requests
+
+Issues and pull requests will appear on your contributions graph if they meet both of these conditions:
+
+They were opened within the past year.
+They were opened in a standalone repository, not a fork.
+Commits
+
+Commits will appear on your contributions graph if they meet all of the following conditions:
+
+The commits were made within the past year.
+The email address used for the commits is associated with your GitHub account.
+The commits were made in a standalone repository, not a fork.
+The commits were made:
+In the repository's default branch (usually master)
+In the gh-pages branch (for repositories with Project Pages sites)
+In addition, at least one of the following must be true:
+
+You are a collaborator on the repository or are a member of the organization that owns the repository.
+You have forked the repository.
+You have opened a pull request or issue in the repository.
\ No newline at end of file
diff --git a/Mr.Lin/0005/0005.py b/Mr.Lin/0005/0005.py
new file mode 100644
index 00000000..c2d95801
--- /dev/null
+++ b/Mr.Lin/0005/0005.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Author: 30987
+# @Date: 2015-01-13 10:50:36
+# @Last Modified by: 30987
+# @Last Modified time: 2015-01-13 11:11:35
+# 第 0005 题:你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率的大小
+
+from PIL import Image
+
+
+def change_img(path,size=(1136,640)):
+ im = Image.open(path)
+ size=(size[1],size[0]) if im.size[1]>im.size[0] else size
+ im.thumbnail(size,Image.ANTIALIAS) #后一个参数为滤镜
+ im.save('result-'+path)
+ #im.show()
+
+
+if __name__ == '__main__':
+ change_img('1.jpg')
\ No newline at end of file
diff --git a/Mr.Lin/0005/Thumbs.db b/Mr.Lin/0005/Thumbs.db
new file mode 100644
index 00000000..8af3a1ba
Binary files /dev/null and b/Mr.Lin/0005/Thumbs.db differ
diff --git a/Mr.Lin/0006/0006.py b/Mr.Lin/0006/0006.py
new file mode 100644
index 00000000..2863b169
--- /dev/null
+++ b/Mr.Lin/0006/0006.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Author: 30987
+# @Date: 2015-01-13 11:11:49
+# @Last Modified by: 30987
+# @Last Modified time: 2015-01-13 17:10:27
+
+import re
+
+def hot_words(file_path):
+ file = open(file_path,'r')
+ file_content = file.read()
+ p = re.compile(r'[\W\d]*')
+ word_list = p.split(file_content)
+
+ word_dict = {}
+ for word in word_list:
+ if word not in word_dict:
+ word_dict[word] = 1
+ else:
+ word_dict[word] += 1
+ sort = sorted(word_dict.items(), key=lambda e: e[1], reverse=True)
+ sort = sorted(word_dict.items(), key=lambda e: e[1], reverse=True)
+
+ print("The most word in '%s' is '%s',it appears '%s' times" % (file_path,sort[1][0], sort[1][1]))
+
+ file.close()
+
+
+if __name__ == '__main__':
+ hot_words('test.txt')
\ No newline at end of file
diff --git a/Mr.Lin/0006/test.txt b/Mr.Lin/0006/test.txt
new file mode 100644
index 00000000..72f34614
--- /dev/null
+++ b/Mr.Lin/0006/test.txt
@@ -0,0 +1,26 @@
+Why are my contributions not showing up on my profile?
+
+
+Contributions that are counted
+Your profile contributions graph is a record of contributions you've made to GitHub repositories. Contributions are only counted if they meet certain criteria. In some cases, we may need to rebuild your graph in order for contributions to appear.
+Issues and pull requests
+
+Issues and pull requests will appear on your contributions graph if they meet both of these conditions:
+
+They were opened within the past year.
+They were opened in a standalone repository, not a fork.
+Commits
+
+Commits will appear on your contributions graph if they meet all of the following conditions:
+
+The commits were made within the past year.
+The email address used for the commits is associated with your GitHub account.
+The commits were made in a standalone repository, not a fork.
+The commits were made:
+In the repository's default branch (usually master)
+In the gh-pages branch (for repositories with Project Pages sites)
+In addition, at least one of the following must be true:
+
+You are a collaborator on the repository or are a member of the organization that owns the repository.
+You have forked the repository.
+You have opened a pull request or issue in the repository.
\ No newline at end of file
diff --git a/Mr.Lin/0007/0000.py b/Mr.Lin/0007/0000.py
new file mode 100644
index 00000000..b531eba2
--- /dev/null
+++ b/Mr.Lin/0007/0000.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Author: 30987
+# @Date: 2015-01-12 16:06:03
+# @Last Modified by: 30987
+# @Last Modified time: 2015-01-12 17:03:30
+#将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。
+
+from PIL import Image, ImageDraw, ImageFont
+class Image_unread_message:
+ def open(self,path):
+ self.im=Image.open(path)
+ return True
+ def __init__(self):
+ self.fnt=None
+ self.im=None
+
+ def setFont(self,font_path,size):
+ self.fnt=ImageFont.truetype(font_path,size)
+ return True
+ def draw_text(self,position,str,colour,fnt):
+ draw=ImageDraw.Draw(self.im)
+ draw.text(position,str,fill=colour,font=fnt)
+ self.im.show()
+ self.im.save(str+'num'+'.jpg')
+ return True
+
+
+test=Image_unread_message()
+test.open('1.png')
+test.setFont('ahronbd.ttf',80)
+test.draw_text((200,-20),'4',(255,0,0),test.fnt)
+
diff --git a/Mr.Lin/0007/0007.py b/Mr.Lin/0007/0007.py
new file mode 100644
index 00000000..4e30cbee
--- /dev/null
+++ b/Mr.Lin/0007/0007.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Author: 30987
+# @Date: 2015-01-14 11:07:02
+# @Last Modified by: 30987
+# @Last Modified time: 2015-01-14 11:47:11
+#第 0007 题:有个目录,里面是你自己写过的程序,统计一下你写过多少行代码。包括空行和注释,但是要分别列出来。
+#
+#
+
+"""
+此处统计的注释行# 并不会将#!/usr/bin/env python # -*- coding: utf-8 -*- 统计在内,同时if __main__里面的注释也不会进行统计
+
+
+def code_count(code_file):
+ total_lines = 0
+ empty_lines = 0
+ comment_lines = 0
+
+ file_object = open(code_file,'r')
+ for line in file_object:
+ word_list = line.split()
+ #print word_list
+ if word_list == []:
+ empty_lines += 1
+ elif word_list[0] == '#':
+ comment_lines += 1
+ total_lines += 1
+
+ file_object.close()
+ #print("Total line: %s. Empty lines :%s.Comment lines:%s"% (total_lines,empty_lines,comment_lines))
+ return total_lines,empty_lines,comment_lines
+
+
+if __name__ == '__main__':
+ t,e,c=code_count('0007.py')
+ print("Total line: %s. Empty lines :%s.Comment lines:%s"%(t,e,c))
+
+
diff --git a/NKUCodingCat/0000/img.jpg b/NKUCodingCat/0000/img.jpg
deleted file mode 100644
index b2d0fc33..00000000
Binary files a/NKUCodingCat/0000/img.jpg and /dev/null differ
diff --git a/NKUCodingCat/0000/res.jpg b/NKUCodingCat/0000/res.jpg
deleted file mode 100644
index 748060d1..00000000
Binary files a/NKUCodingCat/0000/res.jpg and /dev/null differ
diff --git a/NKUCodingCat/0005/dst_img/1_1600x900.jpg b/NKUCodingCat/0005/dst_img/1_1600x900.jpg
deleted file mode 100644
index 1839ff0e..00000000
Binary files a/NKUCodingCat/0005/dst_img/1_1600x900.jpg and /dev/null differ
diff --git a/NKUCodingCat/0005/dst_img/2_1600x900 (1).jpg b/NKUCodingCat/0005/dst_img/2_1600x900 (1).jpg
deleted file mode 100644
index 9022a808..00000000
Binary files a/NKUCodingCat/0005/dst_img/2_1600x900 (1).jpg and /dev/null differ
diff --git a/NKUCodingCat/0005/dst_img/2_1600x900.jpg b/NKUCodingCat/0005/dst_img/2_1600x900.jpg
deleted file mode 100644
index fa6ef10b..00000000
Binary files a/NKUCodingCat/0005/dst_img/2_1600x900.jpg and /dev/null differ
diff --git a/NKUCodingCat/0005/img/1_1600x900.jpg b/NKUCodingCat/0005/img/1_1600x900.jpg
deleted file mode 100644
index 31fd478f..00000000
Binary files a/NKUCodingCat/0005/img/1_1600x900.jpg and /dev/null differ
diff --git a/NKUCodingCat/0005/img/2_1600x900 (1).jpg b/NKUCodingCat/0005/img/2_1600x900 (1).jpg
deleted file mode 100644
index 2ae772df..00000000
Binary files a/NKUCodingCat/0005/img/2_1600x900 (1).jpg and /dev/null differ
diff --git a/NKUCodingCat/0005/img/2_1600x900.jpg b/NKUCodingCat/0005/img/2_1600x900.jpg
deleted file mode 100644
index c41bb26a..00000000
Binary files a/NKUCodingCat/0005/img/2_1600x900.jpg and /dev/null differ
diff --git a/NKUCodingCat/0010/code.jpg b/NKUCodingCat/0010/code.jpg
deleted file mode 100644
index a7a63868..00000000
Binary files a/NKUCodingCat/0010/code.jpg and /dev/null differ
diff --git a/NKUCodingCat/0024/0024.sql b/NKUCodingCat/0024/0024.sql
deleted file mode 100644
index a07fa402..00000000
--- a/NKUCodingCat/0024/0024.sql
+++ /dev/null
@@ -1,67 +0,0 @@
-# SQL-Front 5.1 (Build 4.16)
-
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
-/*!40101 SET SQL_MODE='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
-/*!40103 SET SQL_NOTES='ON' */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS */;
-/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
-
-
-# Host: localhost Database: 0024
-# ------------------------------------------------------
-# Server version 5.5.38
-
-DROP DATABASE IF EXISTS `0024`;
-CREATE DATABASE `0024` /*!40100 DEFAULT CHARACTER SET utf8 */;
-USE `0024`;
-
-#
-# Source for table code
-#
-
-DROP TABLE IF EXISTS `code`;
-CREATE TABLE `code` (
- `id` int(20) NOT NULL DEFAULT '0',
- `to` text NOT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-#
-# Dumping data for table code
-#
-
-LOCK TABLES `code` WRITE;
-/*!40000 ALTER TABLE `code` DISABLE KEYS */;
-INSERT INTO `code` VALUES (13,'haiohpd');
-INSERT INTO `code` VALUES (14,'daduwwg');
-INSERT INTO `code` VALUES (9,'7');
-INSERT INTO `code` VALUES (11,'9');
-/*!40000 ALTER TABLE `code` ENABLE KEYS */;
-UNLOCK TABLES;
-
-#
-# Source for table max
-#
-
-DROP TABLE IF EXISTS `max`;
-CREATE TABLE `max` (
- `pro` varchar(255) DEFAULT NULL,
- `max` int(11) NOT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-#
-# Dumping data for table max
-#
-
-LOCK TABLES `max` WRITE;
-/*!40000 ALTER TABLE `max` DISABLE KEYS */;
-INSERT INTO `max` VALUES ('max',15);
-/*!40000 ALTER TABLE `max` ENABLE KEYS */;
-UNLOCK TABLES;
-
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
diff --git a/NKUCodingCat/0024/SQLIO.py b/NKUCodingCat/0024/SQLIO.py
deleted file mode 100644
index 910189d9..00000000
--- a/NKUCodingCat/0024/SQLIO.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#coding=utf-8
-import time, os, json, MySQLdb, HTMLParser, cgi
-def SQL_init():
- db = MySQLdb.connect("127.0.0.1","root","root","0024" )
- return db.cursor()
-def SQL_max(new=None):
- cursor = SQL_init()
- if new != None:
- sql="""UPDATE `max` SET `max`=%d WHERE `pro`='max'"""%new
- cursor.execute(sql)
- return True
- else:
- sql="""SELECT * FROM `max` WHERE `pro`='max'"""
- cursor.execute(sql)
- max = cursor.fetchall()[0][1]
- SQL_max(max+1)
- return max
-def SQL_in(task):
- max = SQL_max()
- cursor = SQL_init()
- sql = """INSERT INTO `code` SET `id`=%d,`to`='%s';"""%(max, task)
- cursor.execute(sql)
- return True
-def SQL_out():
- cursor = SQL_init()
- sql = """SELECT * FROM `code`"""
- cursor.execute(sql)
- return cursor.fetchall()
-def SQL_del(id):
- cursor = SQL_init()
- sql = """DELETE FROM `code` WHERE `id`=%d"""%id
- cursor.execute(sql)
- return json.dumps(cursor.fetchall())
-#-----------
-Temp = """
-
-
%s
-
-
-
-
-
-"""
-
-
-def PageMake():
- Data = SQL_out()
- All = ""
- Data = sorted(Data,key=lambda a:a[0] )
- for i in Data:
- #print i
- All+=Temp%(str(i[1]),int(i[0]))
- return All
\ No newline at end of file
diff --git a/NKUCodingCat/0024/main.py b/NKUCodingCat/0024/main.py
deleted file mode 100644
index ba03e834..00000000
--- a/NKUCodingCat/0024/main.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#coding=utf-8
-const = """
-
-
-
-
-
-
-
-
-
TodoList应用演示
-
-
-
-
-
-
-"""
-
-
-from bottle import static_file,route, run, post, request, redirect, error
-import os, urllib,re,json,time
-Root = os.path.split(os.path.realpath(__file__))[0]+"/static/"
-import SQLIO
-
-@route('/todo')
-def index():
- return const.format(SQLIO.PageMake(),)
-@post('/todo')
-def Accept():
- Req = request.body.read()
- L = re.split("&",Req)
- M = {}
- for i in L:
- A = re.split("=",i)
- M[A[0]] = urllib.unquote(A[1])
- for j in M.keys():
- if re.findall("id-",j):
- SQLIO.SQL_del(int(j[3:]))
- redirect('/todo', 302)
- try:
- type = M["new"]
- newtask = M["newtask"]
- except:
- redirect('/error', 404)
- if newtask != "":
- SQLIO.SQL_in(newtask)
- redirect('/todo', 302)
- else:
- return "=.=所以你想添加什么任务呀"
-
-@route('/error')
-def err():
- return "虽然不知道你在干什么但是触发了服务器错误呢"
-@route('/static/')
-def server_static(filename):
- return static_file(filename, root=Root)
-run(host='localhost',port=8080)
\ No newline at end of file
diff --git a/NKUCodingCat/0024/static/css.css b/NKUCodingCat/0024/static/css.css
deleted file mode 100644
index da2076eb..00000000
--- a/NKUCodingCat/0024/static/css.css
+++ /dev/null
@@ -1 +0,0 @@
-h1{color:green;}table,th,td{border:1px solid blue;}table{border-collapse:collapse;width:100%;}th{height:50px;}td.task{width:70%;}input#delete{font-size:15px;color:blue;background-color:#FFFFFF;border-width:0;cursor:pointer;}textarea{vertical-align:middle;width:500px;height:100px;}input#submit{width:107px;height:42px;border-width:0;font-size:17px;font-weight:500;border-radius:6px;cursor:pointer;}
\ No newline at end of file
diff --git a/NecoSama/README.md b/NecoSama/README.md
new file mode 100644
index 00000000..da4593c4
--- /dev/null
+++ b/NecoSama/README.md
@@ -0,0 +1,2 @@
+# My Repository
+My solution is shown as the url:
diff --git a/NeilLi1992/0000/main.py b/NeilLi1992/0000/main.py
new file mode 100644
index 00000000..0998925c
--- /dev/null
+++ b/NeilLi1992/0000/main.py
@@ -0,0 +1,29 @@
+from PIL import Image
+from PIL import ImageFont
+from PIL import ImageDraw
+
+file_name = raw_input("Please input the image name, including file appendix: ")
+try:
+ img = Image.open("test.jpg")
+ s = raw_input("Please input the number to display: ")
+ try:
+ num = int(s)
+ img_width = img.size[0]
+ img_height = img.size[1]
+
+ font_size = 60 * img_height / 480
+ font_height = 60
+ font_width = 40
+ text_x = img_width - font_width * len(str(num))
+ text_y = 0
+
+ font = ImageFont.truetype("Arial.ttf", font_size)
+
+ draw = ImageDraw.Draw(img)
+ draw.text((text_x, text_y), str(num), (255,0,0), font=font)
+
+ img.save("new_image.jpg")
+ except:
+ print "The input is not a number!"
+except:
+ print "Can't find specified file!"
diff --git a/PanChuan/0000/final.png b/PanChuan/0000/final.png
new file mode 100644
index 00000000..7fe24d81
Binary files /dev/null and b/PanChuan/0000/final.png differ
diff --git a/PanChuan/0000/generate_red_reminder.py b/PanChuan/0000/generate_red_reminder.py
new file mode 100644
index 00000000..b47a0366
--- /dev/null
+++ b/PanChuan/0000/generate_red_reminder.py
@@ -0,0 +1,33 @@
+from PIL import Image
+from PIL import ImageFont
+from PIL import ImageDraw
+
+"""
+make an image's white part to be transparent for merging with another image
+"""
+def white_to_transparent(img):
+ img = img.convert('RGBA')
+ datas = img.getdata()
+ newData=[]
+ for item in datas:
+ if item[0] == 255 and item[1] == 255 and item[2] == 255:
+ newData.append((255,255,255,0))
+ else:
+ newData.append(item)
+ img.putdata(newData)
+ return img
+
+if __name__ == "__main__":
+ p1_name = "github_logo.png"
+ p2_name = "red_reminder.png"
+ p1_image = Image.open(p1_name)
+ p2_image = Image.open(p2_name)
+ p2_transparent = white_to_transparent(p2_image)
+ p1_image.paste(p2_transparent,(0,0),p2_transparent)
+
+ usr_font = ImageFont.truetype("./yahei.TTF",32)
+ draw = ImageDraw.Draw(p1_image)
+ draw.text((152,8),u'12',font = usr_font)
+ p1_image.save("final.png","PNG")
+
+
diff --git a/PanChuan/0000/github_logo.png b/PanChuan/0000/github_logo.png
new file mode 100644
index 00000000..3adb86e6
Binary files /dev/null and b/PanChuan/0000/github_logo.png differ
diff --git a/PanChuan/0000/red_reminder.png b/PanChuan/0000/red_reminder.png
new file mode 100644
index 00000000..1d3125cf
Binary files /dev/null and b/PanChuan/0000/red_reminder.png differ
diff --git a/PanChuan/0000/yahei.TTF b/PanChuan/0000/yahei.TTF
new file mode 100644
index 00000000..aa23ae1f
Binary files /dev/null and b/PanChuan/0000/yahei.TTF differ
diff --git a/PanChuan/0001/generate_coupon.py b/PanChuan/0001/generate_coupon.py
new file mode 100644
index 00000000..9f9bd6fe
--- /dev/null
+++ b/PanChuan/0001/generate_coupon.py
@@ -0,0 +1,20 @@
+import string
+import random
+
+"""
+generate COUPON_NUM coupons,every coupon consists of
+COUPON_STR_LEN digit which are capital letter or 0~9
+"""
+COUPON_NUM = 200
+COUPON_STR_LENGTH = 8
+
+if __name__ == "__main__":
+ lst = list(string.letters)[26:] + list(string.digits)
+ for i in range(COUPON_NUM):
+ coupon_list = [random.choice(lst) for i in range(COUPON_STR_LENGTH)]
+ coupon_str = "".join(coupon_list)
+ print coupon_str
+
+
+
+
diff --git a/PyBeaner/0001/coupon.py b/PyBeaner/0001/coupon.py
new file mode 100644
index 00000000..460b6182
--- /dev/null
+++ b/PyBeaner/0001/coupon.py
@@ -0,0 +1,30 @@
+__author__ = 'PyBeaner'
+from random import choice
+import string
+
+chars = string.ascii_uppercase + string.digits
+
+
+def generate_coupons(count, coupon_length=5):
+ coupons = []
+ for i in range(count):
+ coupon = generate_one_coupon(coupon_length=coupon_length)
+ while coupon in coupons:
+ coupon = generate_one_coupon(coupon_length)
+
+ coupons.append(coupon)
+
+ return coupons
+
+
+def generate_one_coupon(coupon_length=5):
+ coupon = []
+ for i in range(coupon_length):
+ ch = choice(chars)
+ coupon.append(ch)
+ return "".join(coupon)
+
+
+if __name__ == '__main__':
+ coupons = generate_coupons(200, 5)
+ print(coupons)
diff --git a/PyBeaner/0002/save_to_mysql.py b/PyBeaner/0002/save_to_mysql.py
new file mode 100644
index 00000000..a9a7f9bf
--- /dev/null
+++ b/PyBeaner/0002/save_to_mysql.py
@@ -0,0 +1,26 @@
+__author__ = 'PyBeaner'
+import pymysql.cursors
+
+
+def save_to_mysql(coupons):
+ try:
+ connection = pymysql.connect(host='localhost',
+ user='user',
+ passwd='passwd',
+ db='db',
+ cursorclass=pymysql.cursors.DictCursor)
+
+ with connection.cursor() as cursor:
+ select_sql = "SELECT coupon FROM coupons where coupon='%s'"
+ insert_sql = "INSERT INTO coupons VALUES (%s);"
+ for coupon in coupons:
+ cursor.excute(select_sql, (coupon,))
+ result = cursor.fetchone()
+ if result:
+ continue
+
+ cursor.excute(insert_sql, (coupon,))
+
+ connection.commit()
+ finally:
+ connection.close()
diff --git a/PyBeaner/0004/wc.py b/PyBeaner/0004/wc.py
new file mode 100644
index 00000000..8af8b03a
--- /dev/null
+++ b/PyBeaner/0004/wc.py
@@ -0,0 +1,11 @@
+from collections import Counter
+import re
+
+__author__ = "PyBeaner"
+
+with open(r"F:\Program Files\Git\doc\git\html\RelNotes\1.5.0.1.txt") as f:
+ word_pat = re.compile("^[A-Za-z]+$")
+ file_words = [word for line in f for word in line.split()
+ if len(word) > 1 and word_pat.match(word)]
+
+print(Counter(file_words))
diff --git a/PyBeaner/0007/code_lines.py b/PyBeaner/0007/code_lines.py
new file mode 100644
index 00000000..81484695
--- /dev/null
+++ b/PyBeaner/0007/code_lines.py
@@ -0,0 +1,43 @@
+# coding=utf-8
+__author__ = 'PyBeaner'
+import os
+import fnmatch
+
+total_lines = 0
+code_lines = 0
+empty_lines = 0
+comment_lines = 0
+
+
+def count_line(line):
+ line = line.lstrip()
+ global comment_lines, empty_lines, total_lines, code_lines
+
+ total_lines += 1
+ if line.startswith("#"):
+ comment_lines += 1
+ elif not line:
+ empty_lines += 1
+ else:
+ code_lines += 1
+
+
+def scan_dir(directory, suffix="*.py"):
+ directory = os.path.abspath(directory)
+ print("Scanning files in %s ..." % directory)
+ for cur_dir, dirs, files in os.walk(directory):
+ for file in files:
+ if not fnmatch.fnmatch(file, suffix):
+ continue
+ file_path = os.path.join(cur_dir, file)
+ with open(file_path, errors="replace") as f:
+ for line in f:
+ count_line(line)
+
+
+if __name__ == '__main__':
+ scan_dir(r"../..")
+ print("Total lines:%d" % total_lines)
+ print("Code lines:%d" % code_lines)
+ print("Empty lines:%d" % empty_lines)
+ print("Comment lines:%d" % comment_lines)
diff --git a/PyBeaner/0008/text_in_html.py b/PyBeaner/0008/text_in_html.py
new file mode 100644
index 00000000..a184018d
--- /dev/null
+++ b/PyBeaner/0008/text_in_html.py
@@ -0,0 +1,21 @@
+# coding=utf-8
+__author__ = 'PyBeaner'
+from bs4 import BeautifulSoup
+
+
+def get_text(html):
+ soup = BeautifulSoup(html)
+ return soup.text
+
+
+if __name__ == '__main__':
+ import requests
+
+ r = requests.get("https://github.com/")
+ html = r.text
+ text = get_text(html)
+ with open("html.txt", "w+", errors="replace") as f:
+ print(text, file=f)
+ f.seek(0)
+ for line in f:
+ print(line)
diff --git a/PyBeaner/0009/link_in_html.py b/PyBeaner/0009/link_in_html.py
new file mode 100644
index 00000000..f78f8d07
--- /dev/null
+++ b/PyBeaner/0009/link_in_html.py
@@ -0,0 +1,22 @@
+# coding=utf-8
+__author__ = 'PyBeaner'
+from bs4 import BeautifulSoup
+
+
+def get_links(html):
+ soup = BeautifulSoup(html)
+ links = []
+ for link in soup.find_all("a"):
+ href = link["href"]
+ if href.startswith("http"):
+ links.append(href)
+ return links
+
+
+if __name__ == '__main__':
+ import requests
+
+ r = requests.get("https://github.com/")
+ html = r.text
+ links = get_links(html)
+ print(links)
diff --git a/PyBeaner/0011/filter.py b/PyBeaner/0011/filter.py
new file mode 100644
index 00000000..03633390
--- /dev/null
+++ b/PyBeaner/0011/filter.py
@@ -0,0 +1,9 @@
+__author__ = 'PyBeaner'
+
+words = open("filtered_words.txt").read().split()
+
+word = input("Please Input an word:")
+if word in words:
+ print("Freedom")
+else:
+ print("Human Rights")
diff --git a/PyBeaner/0011/filtered_words.txt b/PyBeaner/0011/filtered_words.txt
new file mode 100644
index 00000000..444eb7c6
--- /dev/null
+++ b/PyBeaner/0011/filtered_words.txt
@@ -0,0 +1,11 @@
+
+Ա
+Ա
+쵼
+ţ
+ţ
+
+
+love
+sex
+jiangge
\ No newline at end of file
diff --git a/PyBeaner/0012/filter.py b/PyBeaner/0012/filter.py
new file mode 100644
index 00000000..4e272ce6
--- /dev/null
+++ b/PyBeaner/0012/filter.py
@@ -0,0 +1,9 @@
+__author__ = 'PyBeaner'
+words = open("filtered_words.txt").read().split()
+
+user_input = input("Please Input an word:")
+
+for word in words:
+ user_input = user_input.replace(word, "*" * len(word))
+
+print(user_input)
diff --git a/PyBeaner/0012/filtered_words.txt b/PyBeaner/0012/filtered_words.txt
new file mode 100644
index 00000000..444eb7c6
--- /dev/null
+++ b/PyBeaner/0012/filtered_words.txt
@@ -0,0 +1,11 @@
+
+Ա
+Ա
+쵼
+ţ
+ţ
+
+
+love
+sex
+jiangge
\ No newline at end of file
diff --git a/PyBeaner/__init__.py b/PyBeaner/__init__.py
new file mode 100644
index 00000000..88c7a442
--- /dev/null
+++ b/PyBeaner/__init__.py
@@ -0,0 +1 @@
+__author__ = 'PyBeaner'
diff --git a/README.md b/README.md
index 35ee7952..5d75dd92 100644
--- a/README.md
+++ b/README.md
@@ -3,23 +3,25 @@ python
Show Me the Code Python version.
+2015年8月10日更新:
+【注】Pull Request 请提交你个人的仓库 URL 链接地址。
### How to Add your solutions:
- * fork this repo
- * create a folder named with your github name
- * create a folder named the problem num
- * add your solution in the folder
+ * Fork this repo.
+ * Create a folder named with your github name.
+ * Create a folder named the problem num.
+ * Add your solution in the folder.
For example, if you wanna add a solution for problem 0001, you should do like this:
- * fork Show-Me-the-Code/python
- * git clone YOUR_REPO_URL SOME_DIR
- * cd SOME_DIR
- * mkdir YOUR_GITHUB_USER_NAME
- * cd YOU_GITHUB_USER_NAME
- * mkdir 0001
- * cd 0001
- * and the write some code & test it
+ * Fork `Show-Me-the-Code/python`.
+ * git clone `YOUR_REPO_URL SOME_DIR`.
+ * cd `SOME_DIR`.
+ * mkdir `YOUR_GITHUB_USER_NAME`.
+ * cd `YOU_GITHUB_USER_NAME`.
+ * mkdir `0001`.
+ * cd `0001`.
+ * and the write some code & test it.
-if all these steps done, send us an pull request. After we accepte your request, we'll invite you to this group.
+If all these steps done, send us an pull request. After we accept your request, we'll invite you to this group.
diff --git a/Raynxxx/0000/ex00.py b/Raynxxx/0000/ex00.py
new file mode 100644
index 00000000..e67b0805
--- /dev/null
+++ b/Raynxxx/0000/ex00.py
@@ -0,0 +1,38 @@
+__author__ = 'rayn'
+
+#problem 0000
+#Add a unread number on the face icon
+
+from PIL import Image
+from PIL import ImageFont
+from PIL import ImageDraw
+
+class UnreadTagFace:
+ def __init__(self):
+ self.img = None
+ self.num = None
+ def open(self, image_path):
+ self.img = Image.open(image_path)
+ return True
+ def draw(self, tag_num = 1):
+ tag_size = max(self.img.size[0], self.img.size[1]) / 5
+ tag_str = str(tag_num) if tag_num < 100 else '99+'
+ font = ImageFont.truetype("Arial.ttf", tag_size)
+ px = self.img.size[0] - font.getsize(tag_str)[0]
+ draw_pen = ImageDraw.Draw(self.img)
+ draw_pen.text((px, 0), tag_str, (255, 0, 0), font)
+ self.img.save('face' + tag_str + '.jpg')
+ return True
+
+
+solver = UnreadTagFace()
+solver.open('face.jpg')
+solver.draw(4)
+
+
+
+
+
+
+
+
diff --git a/ShaoyuanLi/0000/a.png b/ShaoyuanLi/0000/a.png
new file mode 100644
index 00000000..5f6b0113
Binary files /dev/null and b/ShaoyuanLi/0000/a.png differ
diff --git a/ShaoyuanLi/0000/example.py b/ShaoyuanLi/0000/example.py
new file mode 100644
index 00000000..c04af4d6
--- /dev/null
+++ b/ShaoyuanLi/0000/example.py
@@ -0,0 +1,9 @@
+import Image,ImageDraw,ImageFont
+
+myfont=ImageFont.truetype("arial.ttf", 35)
+im=Image.open("touxiang.png")
+draw=ImageDraw.Draw(im)
+x,y=im.size
+draw.text((x-x/5,y/8),"8",fill=(255,0,0),font=myfont)
+im.save("result.png", "PNG")
+
diff --git a/ShaoyuanLi/0000/exmaple.py b/ShaoyuanLi/0000/exmaple.py
new file mode 100644
index 00000000..c04af4d6
--- /dev/null
+++ b/ShaoyuanLi/0000/exmaple.py
@@ -0,0 +1,9 @@
+import Image,ImageDraw,ImageFont
+
+myfont=ImageFont.truetype("arial.ttf", 35)
+im=Image.open("touxiang.png")
+draw=ImageDraw.Draw(im)
+x,y=im.size
+draw.text((x-x/5,y/8),"8",fill=(255,0,0),font=myfont)
+im.save("result.png", "PNG")
+
diff --git a/ShaoyuanLi/0000/touxiang.png b/ShaoyuanLi/0000/touxiang.png
new file mode 100644
index 00000000..c3222d12
Binary files /dev/null and b/ShaoyuanLi/0000/touxiang.png differ
diff --git a/ShaoyuanLi/0001/0001.py b/ShaoyuanLi/0001/0001.py
new file mode 100644
index 00000000..278979a6
--- /dev/null
+++ b/ShaoyuanLi/0001/0001.py
@@ -0,0 +1,24 @@
+# -*- coding: cp936 -*-
+import random
+#200鳤Ϊ8Ż룬ֵ伯ּĸ
+def generate_key(number=200,length=8):
+ char_set="abcdefghijklmnopqrstuvwxyz0123456789"
+ result=""
+ for i in range(0, number):
+ temp=""
+ while(temp==""):
+ for j in range(0,length):
+ temp=temp+char_set[random.randint(0,35)]
+#жɵŻǷ֮ǰظ
+ if(result.find(temp)==-1):
+ result=result+"%d "%(i+1)+temp
+ else:
+ temp=""
+ result=result+'\n'
+ return result
+def file_write():
+ fp=open("result.txt",'w')
+ fp.writelines(generate_key())
+ fp.close()
+if __name__ == '__main__':
+ file_write()
diff --git a/ShaoyuanLi/0001/result.txt b/ShaoyuanLi/0001/result.txt
new file mode 100644
index 00000000..8b16cadb
--- /dev/null
+++ b/ShaoyuanLi/0001/result.txt
@@ -0,0 +1,200 @@
+1 nxmmjq5u
+2 5hoe20v9
+3 elb1hrv0
+4 ls6htkmx
+5 qwzg0o39
+6 97reovrl
+7 zcwu57gj
+8 gk8cgovi
+9 prciw3q0
+10 vnf9n6b8
+11 fps1hiqw
+12 j33wf93a
+13 zwue5e71
+14 0nissnay
+15 feghkqmx
+16 io4kuhcq
+17 x6u8t76p
+18 1h61e4ng
+19 qbl5ebk8
+20 6jual6xm
+21 vjocsl6m
+22 n61d32ud
+23 p4m2iphq
+24 pyacaotz
+25 04qoagrf
+26 6crk5pqt
+27 s3ahsg3m
+28 mqzy3c6s
+29 sn7zd09i
+30 cf8zzveh
+31 xsudv4pb
+32 trnqj7fp
+33 wcm0p84l
+34 4ipcf95a
+35 s9xq6xcy
+36 phpz7h8l
+37 o91mes3g
+38 t6uknpae
+39 z6c5xi23
+40 yye3x973
+41 er1yto5z
+42 sfap7fsl
+43 bziiqf36
+44 ybg4dhmk
+45 y1mmf067
+46 33118f0r
+47 z5qmqqq7
+48 ryb0k7zw
+49 tedbcsxp
+50 yeq6xacz
+51 sgxvn5ji
+52 klymd488
+53 xfmwvjq2
+54 auy0dic5
+55 gis55ucl
+56 mcq6cr17
+57 o96zscnz
+58 hk2rlohj
+59 0ntnb0q4
+60 xw1v4xel
+61 nha9skdv
+62 k1kv2y97
+63 gbfz5l0v
+64 an80u8wr
+65 4pc3njpa
+66 6it3rlw7
+67 6mj7rtab
+68 9uahvgry
+69 680wn4my
+70 251guth4
+71 zjd0za7k
+72 n0z7wbeh
+73 j0h3jjvz
+74 f9oux370
+75 8sky09ux
+76 eax249ug
+77 477aqrpo
+78 vucjphwm
+79 ud32a2e4
+80 nhquv87l
+81 f4um10au
+82 m5jkru0w
+83 rpvzm6tm
+84 dykl1h4p
+85 zmuwu3o0
+86 j7giqlex
+87 vwa69otf
+88 6sha6mfq
+89 fpdf4wm1
+90 c04s7ymz
+91 ks87sv0b
+92 jhshq4xo
+93 96zplwyn
+94 muahr9je
+95 t218gs1g
+96 xcs602r5
+97 2d44deyq
+98 pdh1yvgf
+99 tejxc3xc
+100 ci2bx2y0
+101 ei2ic9q3
+102 1txrhspe
+103 0ut7su6t
+104 nc90orev
+105 67dn6ccd
+106 6eopvnqi
+107 a8klb1uz
+108 nwrqv1q4
+109 hz8r2ylb
+110 dnklsvf8
+111 t300hvo2
+112 lx35alfv
+113 42061qcj
+114 na4roat2
+115 3cpr59zl
+116 cwtfdnw1
+117 ig13dgp8
+118 1l00kvoe
+119 pzeijnui
+120 cquvplvg
+121 46os5qq4
+122 0gnccy9u
+123 utcbxjxy
+124 tfy5z7oj
+125 9c90fgqa
+126 z8c4glb3
+127 vhvx6jsw
+128 at0dknzh
+129 3t4n1zmw
+130 ohzbmj4m
+131 8yw8thmv
+132 eafvf0u2
+133 9k74zdd9
+134 s5wnndk8
+135 pzn80syp
+136 pwwrz5y3
+137 x4j7ea5q
+138 tyd2pf35
+139 lxz2tyso
+140 4sjkim2k
+141 hkgxx7zo
+142 xfci5bvl
+143 6m9ejxq6
+144 wfw60y3x
+145 yqvlczdy
+146 1xddbfio
+147 6emvqho0
+148 l4x17hf6
+149 fm5eibvy
+150 l8vvvosj
+151 wbhffvzm
+152 zwzcsx91
+153 q7xxd9fw
+154 x0xxczvo
+155 avp7wbsd
+156 2pqfl04c
+157 ropj6jx6
+158 andgzoxe
+159 xn11gqgu
+160 cc31xxhx
+161 22cuf67k
+162 ikuypkzs
+163 k2hawt99
+164 kb2f3z36
+165 wwdpa84t
+166 qcmqffx9
+167 1ia6qv0s
+168 5s2flplu
+169 bk1vseyl
+170 h1eq9td4
+171 b18q9a62
+172 daryg2hx
+173 2poyp7tt
+174 9xhoyk5q
+175 xcav6ut9
+176 j0wuv9hk
+177 cfyradja
+178 79kb1jmr
+179 jdo0ydys
+180 zyfy4yly
+181 dsr2j44o
+182 xfh51sce
+183 44gzcgpf
+184 x6kh99np
+185 asr1r9vu
+186 27hiy93f
+187 ggl2442w
+188 jmkf60w7
+189 qrhax89p
+190 whuhnbtc
+191 74hvzjlh
+192 05xfn6y8
+193 7gp768d5
+194 cu3o1xm1
+195 6hchvuy6
+196 ki975jre
+197 9q296wk4
+198 48l0a9nv
+199 ssx4zopx
+200 yscuw50k
diff --git a/ShaoyuanLi/0004/0004.py b/ShaoyuanLi/0004/0004.py
new file mode 100644
index 00000000..c80d04e8
--- /dev/null
+++ b/ShaoyuanLi/0004/0004.py
@@ -0,0 +1,19 @@
+# -*- coding: cp936 -*-
+import re
+fin=open("example.txt","r")
+fout=open("result.txt","w")
+str=fin.read()
+#ƥʽ
+reObj=re.compile("\b?([a-zA-Z]+)\b?")
+words=reObj.findall(str)
+#ֵ
+word_dict={}
+#ԵʵСдΪֵͳƣͬʱҪ
+for word in words:
+ if(word_dict.has_key(word)):
+ word_dict[word.lower()]=max(word_dict[word.lower()],words.count(word.lower())+words.count(word.upper())+words.count(word))
+ else:
+ word_dict[word.lower()]=max(0,words.count(word.lower())+words.count(word.upper())+words.count(word))
+for(word,number) in word_dict.items():
+ fout.write(word+":%d\n"%number)
+
diff --git a/ShaoyuanLi/0004/example.txt b/ShaoyuanLi/0004/example.txt
new file mode 100644
index 00000000..fd6c17d4
--- /dev/null
+++ b/ShaoyuanLi/0004/example.txt
@@ -0,0 +1 @@
+In the latest move to support the economy, Shanghai, Beijing, Chongqing and six other provinces and municipalities will allow banks to refinance high-quality credit assets rated by the People's Bank of China, said the central bank, as the program was first introduced in Guangdong and Shandong provinces last year.
\ No newline at end of file
diff --git a/ShaoyuanLi/0004/result.txt b/ShaoyuanLi/0004/result.txt
new file mode 100644
index 00000000..aa415b37
--- /dev/null
+++ b/ShaoyuanLi/0004/result.txt
@@ -0,0 +1,41 @@
+and:6
+beijing:1
+shandong:1
+six:2
+people:1
+move:2
+year:2
+high:2
+as:2
+program:2
+in:2
+guangdong:1
+quality:2
+provinces:4
+rated:2
+support:2
+shanghai:1
+to:4
+other:2
+was:2
+economy:2
+municipalities:2
+refinance:2
+said:2
+china:1
+last:2
+by:2
+bank:2
+chongqing:1
+introduced:2
+central:2
+assets:2
+of:2
+will:2
+credit:2
+s:2
+allow:2
+banks:2
+the:10
+first:2
+latest:2
diff --git a/Silocean/0000/DejaVuSansMono.ttf b/Silocean/0000/DejaVuSansMono.ttf
new file mode 100644
index 00000000..9bebb47e
Binary files /dev/null and b/Silocean/0000/DejaVuSansMono.ttf differ
diff --git a/Silocean/0000/Test.py b/Silocean/0000/Test.py
new file mode 100644
index 00000000..d1b6c689
--- /dev/null
+++ b/Silocean/0000/Test.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Fri Jun 5 13:40:53 2015
+
+@author: Tracy
+"""
+
+from PIL import Image
+from PIL import ImageDraw
+from PIL import ImageFont
+
+img = Image.open('icon.jpg')
+draw = ImageDraw.Draw(img)
+font = ImageFont.truetype('DejaVuSansMono.ttf',100)
+
+draw.text((img.size[0]-100,30),"3",(255,0,0), font)
+
+img.save('result.jpg')
diff --git a/Silocean/0001/Test.py b/Silocean/0001/Test.py
new file mode 100644
index 00000000..6c2d780c
--- /dev/null
+++ b/Silocean/0001/Test.py
@@ -0,0 +1,12 @@
+# -*-coding:utf-8-*-
+__author__ = 'Tracy'
+
+import uuid
+
+f = open('keys.txt', 'w')
+
+for i in range(200):
+ f.write(str(uuid.uuid1())+"\n")
+
+f.close()
+
diff --git a/Silocean/0001/keys.txt b/Silocean/0001/keys.txt
new file mode 100644
index 00000000..bc2a4a6c
--- /dev/null
+++ b/Silocean/0001/keys.txt
@@ -0,0 +1,200 @@
+2d41c530-0f55-11e5-8f5c-005056c00008
+2d42af8f-0f55-11e5-b4d8-005056c00008
+2d42af90-0f55-11e5-b7bb-005056c00008
+2d42af91-0f55-11e5-b9a1-005056c00008
+2d42af92-0f55-11e5-bf53-005056c00008
+2d42af93-0f55-11e5-bc30-005056c00008
+2d42af94-0f55-11e5-9f13-005056c00008
+2d42d69e-0f55-11e5-97ef-005056c00008
+2d42d69f-0f55-11e5-b24e-005056c00008
+2d42d6a0-0f55-11e5-9a7d-005056c00008
+2d42d6a1-0f55-11e5-8a21-005056c00008
+2d42d6a2-0f55-11e5-aa17-005056c00008
+2d42d6a3-0f55-11e5-8808-005056c00008
+2d42d6a4-0f55-11e5-b193-005056c00008
+2d42d6a5-0f55-11e5-b34f-005056c00008
+2d42d6a6-0f55-11e5-ae3a-005056c00008
+2d42d6a7-0f55-11e5-867a-005056c00008
+2d42d6a8-0f55-11e5-94f6-005056c00008
+2d42d6a9-0f55-11e5-8ccf-005056c00008
+2d42d6aa-0f55-11e5-9956-005056c00008
+2d42d6ab-0f55-11e5-b154-005056c00008
+2d42d6ac-0f55-11e5-be92-005056c00008
+2d42d6ad-0f55-11e5-ac5c-005056c00008
+2d42d6ae-0f55-11e5-a12a-005056c00008
+2d42d6af-0f55-11e5-88f8-005056c00008
+2d42d6b0-0f55-11e5-9a80-005056c00008
+2d42d6b1-0f55-11e5-ab69-005056c00008
+2d42d6b2-0f55-11e5-aa4e-005056c00008
+2d42d6b3-0f55-11e5-b419-005056c00008
+2d42d6b4-0f55-11e5-be0e-005056c00008
+2d42d6b5-0f55-11e5-8e0a-005056c00008
+2d42d6b6-0f55-11e5-8e7e-005056c00008
+2d42d6b7-0f55-11e5-9193-005056c00008
+2d42d6b8-0f55-11e5-a974-005056c00008
+2d42d6b9-0f55-11e5-84bb-005056c00008
+2d42d6ba-0f55-11e5-b16a-005056c00008
+2d42d6bb-0f55-11e5-a432-005056c00008
+2d42d6bc-0f55-11e5-b2cb-005056c00008
+2d42d6bd-0f55-11e5-b6a8-005056c00008
+2d42d6be-0f55-11e5-806a-005056c00008
+2d42d6bf-0f55-11e5-9979-005056c00008
+2d42d6c0-0f55-11e5-8f31-005056c00008
+2d42d6c1-0f55-11e5-9f4b-005056c00008
+2d42d6c2-0f55-11e5-afa9-005056c00008
+2d42d6c3-0f55-11e5-9718-005056c00008
+2d42d6c4-0f55-11e5-b206-005056c00008
+2d42d6c5-0f55-11e5-857c-005056c00008
+2d42d6c6-0f55-11e5-b451-005056c00008
+2d42d6c7-0f55-11e5-ae68-005056c00008
+2d42d6c8-0f55-11e5-8b37-005056c00008
+2d42d6c9-0f55-11e5-944b-005056c00008
+2d42d6ca-0f55-11e5-9348-005056c00008
+2d42d6cb-0f55-11e5-b068-005056c00008
+2d42d6cc-0f55-11e5-9457-005056c00008
+2d42d6cd-0f55-11e5-8d79-005056c00008
+2d42d6ce-0f55-11e5-9e25-005056c00008
+2d42d6cf-0f55-11e5-b0b3-005056c00008
+2d42d6d0-0f55-11e5-a097-005056c00008
+2d42d6d1-0f55-11e5-85d4-005056c00008
+2d42fdae-0f55-11e5-976f-005056c00008
+2d42fdaf-0f55-11e5-a37b-005056c00008
+2d42fdb0-0f55-11e5-905e-005056c00008
+2d42fdb1-0f55-11e5-83af-005056c00008
+2d42fdb2-0f55-11e5-b541-005056c00008
+2d42fdb3-0f55-11e5-b6e0-005056c00008
+2d42fdb4-0f55-11e5-b07b-005056c00008
+2d42fdb5-0f55-11e5-b458-005056c00008
+2d42fdb6-0f55-11e5-927d-005056c00008
+2d42fdb7-0f55-11e5-9bb9-005056c00008
+2d42fdb8-0f55-11e5-a37e-005056c00008
+2d42fdb9-0f55-11e5-9b60-005056c00008
+2d42fdba-0f55-11e5-8b8b-005056c00008
+2d42fdbb-0f55-11e5-bc71-005056c00008
+2d42fdbc-0f55-11e5-a6a3-005056c00008
+2d42fdbd-0f55-11e5-95eb-005056c00008
+2d42fdbe-0f55-11e5-b6c7-005056c00008
+2d42fdbf-0f55-11e5-8022-005056c00008
+2d42fdc0-0f55-11e5-91e1-005056c00008
+2d42fdc1-0f55-11e5-881e-005056c00008
+2d42fdc2-0f55-11e5-bbf8-005056c00008
+2d42fdc3-0f55-11e5-82cc-005056c00008
+2d42fdc4-0f55-11e5-b432-005056c00008
+2d42fdc5-0f55-11e5-9b5e-005056c00008
+2d42fdc6-0f55-11e5-9569-005056c00008
+2d42fdc7-0f55-11e5-93cb-005056c00008
+2d42fdc8-0f55-11e5-ac62-005056c00008
+2d42fdc9-0f55-11e5-8546-005056c00008
+2d42fdca-0f55-11e5-94a2-005056c00008
+2d42fdcb-0f55-11e5-aaa3-005056c00008
+2d42fdcc-0f55-11e5-8662-005056c00008
+2d42fdcd-0f55-11e5-8754-005056c00008
+2d42fdce-0f55-11e5-921d-005056c00008
+2d42fdcf-0f55-11e5-87f1-005056c00008
+2d42fdd0-0f55-11e5-8f64-005056c00008
+2d42fdd1-0f55-11e5-865c-005056c00008
+2d42fdd2-0f55-11e5-82fe-005056c00008
+2d42fdd3-0f55-11e5-a5c7-005056c00008
+2d42fdd4-0f55-11e5-8040-005056c00008
+2d42fdd5-0f55-11e5-b875-005056c00008
+2d42fdd6-0f55-11e5-9c3e-005056c00008
+2d42fdd7-0f55-11e5-8f2d-005056c00008
+2d42fdd8-0f55-11e5-8a4a-005056c00008
+2d42fdd9-0f55-11e5-b183-005056c00008
+2d42fdda-0f55-11e5-b57f-005056c00008
+2d42fddb-0f55-11e5-8df2-005056c00008
+2d42fddc-0f55-11e5-b25f-005056c00008
+2d42fddd-0f55-11e5-b1a7-005056c00008
+2d42fdde-0f55-11e5-8a7e-005056c00008
+2d42fddf-0f55-11e5-8e69-005056c00008
+2d42fde0-0f55-11e5-b08c-005056c00008
+2d42fde1-0f55-11e5-8b4d-005056c00008
+2d4324c0-0f55-11e5-8a3d-005056c00008
+2d4324c1-0f55-11e5-8e21-005056c00008
+2d4324c2-0f55-11e5-a739-005056c00008
+2d4324c3-0f55-11e5-be1c-005056c00008
+2d4324c4-0f55-11e5-b3cb-005056c00008
+2d4324c5-0f55-11e5-8f7f-005056c00008
+2d4324c6-0f55-11e5-8e36-005056c00008
+2d4324c7-0f55-11e5-b89a-005056c00008
+2d4324c8-0f55-11e5-ba2f-005056c00008
+2d4324c9-0f55-11e5-bde1-005056c00008
+2d4324ca-0f55-11e5-b995-005056c00008
+2d4324cb-0f55-11e5-9dff-005056c00008
+2d4324cc-0f55-11e5-ae22-005056c00008
+2d4324cd-0f55-11e5-b3a8-005056c00008
+2d4324ce-0f55-11e5-9d75-005056c00008
+2d4324cf-0f55-11e5-a491-005056c00008
+2d4324d0-0f55-11e5-a95b-005056c00008
+2d4324d1-0f55-11e5-87cc-005056c00008
+2d4324d2-0f55-11e5-9002-005056c00008
+2d4324d3-0f55-11e5-a70a-005056c00008
+2d4324d4-0f55-11e5-82d0-005056c00008
+2d4324d5-0f55-11e5-99f9-005056c00008
+2d4324d6-0f55-11e5-bb48-005056c00008
+2d4324d7-0f55-11e5-86bf-005056c00008
+2d4324d8-0f55-11e5-abe3-005056c00008
+2d4324d9-0f55-11e5-8ca4-005056c00008
+2d4324da-0f55-11e5-9ab8-005056c00008
+2d4324db-0f55-11e5-bbc0-005056c00008
+2d4324dc-0f55-11e5-829f-005056c00008
+2d4324dd-0f55-11e5-b85f-005056c00008
+2d4324de-0f55-11e5-9924-005056c00008
+2d4324df-0f55-11e5-be66-005056c00008
+2d4324e0-0f55-11e5-a782-005056c00008
+2d4324e1-0f55-11e5-a1bb-005056c00008
+2d4324e2-0f55-11e5-9a39-005056c00008
+2d4324e3-0f55-11e5-afa4-005056c00008
+2d4324e4-0f55-11e5-b056-005056c00008
+2d4324e5-0f55-11e5-b9aa-005056c00008
+2d4324e6-0f55-11e5-be9f-005056c00008
+2d4324e7-0f55-11e5-bb63-005056c00008
+2d4324e8-0f55-11e5-9953-005056c00008
+2d4324e9-0f55-11e5-b38a-005056c00008
+2d4324ea-0f55-11e5-b6c3-005056c00008
+2d4324eb-0f55-11e5-8263-005056c00008
+2d4324ec-0f55-11e5-9614-005056c00008
+2d4324ed-0f55-11e5-adac-005056c00008
+2d4324ee-0f55-11e5-b14c-005056c00008
+2d4324ef-0f55-11e5-9b03-005056c00008
+2d4324f0-0f55-11e5-b170-005056c00008
+2d4324f1-0f55-11e5-a4c5-005056c00008
+2d4324f2-0f55-11e5-8339-005056c00008
+2d4324f3-0f55-11e5-9e09-005056c00008
+2d4324f4-0f55-11e5-9f87-005056c00008
+2d4324f5-0f55-11e5-b5d5-005056c00008
+2d4324f6-0f55-11e5-bdda-005056c00008
+2d4324f7-0f55-11e5-a302-005056c00008
+2d4324f8-0f55-11e5-9cfc-005056c00008
+2d4324f9-0f55-11e5-bf30-005056c00008
+2d434bcf-0f55-11e5-b117-005056c00008
+2d434bd0-0f55-11e5-9677-005056c00008
+2d434bd1-0f55-11e5-9433-005056c00008
+2d434bd2-0f55-11e5-a0a9-005056c00008
+2d434bd3-0f55-11e5-80e1-005056c00008
+2d434bd4-0f55-11e5-a504-005056c00008
+2d434bd5-0f55-11e5-9d0e-005056c00008
+2d434bd6-0f55-11e5-afd2-005056c00008
+2d434bd7-0f55-11e5-a37b-005056c00008
+2d434bd8-0f55-11e5-8ac6-005056c00008
+2d434bd9-0f55-11e5-b15d-005056c00008
+2d434bda-0f55-11e5-9adf-005056c00008
+2d434bdb-0f55-11e5-a36b-005056c00008
+2d434bdc-0f55-11e5-adaa-005056c00008
+2d434bdd-0f55-11e5-b1f0-005056c00008
+2d434bde-0f55-11e5-b3e3-005056c00008
+2d434bdf-0f55-11e5-a63c-005056c00008
+2d434be0-0f55-11e5-a2bc-005056c00008
+2d434be1-0f55-11e5-9879-005056c00008
+2d434be2-0f55-11e5-a762-005056c00008
+2d434be3-0f55-11e5-960f-005056c00008
+2d434be4-0f55-11e5-a09d-005056c00008
+2d434be5-0f55-11e5-9ac9-005056c00008
+2d434be6-0f55-11e5-a32e-005056c00008
+2d434be7-0f55-11e5-be33-005056c00008
+2d434be8-0f55-11e5-9ce6-005056c00008
+2d434be9-0f55-11e5-89cc-005056c00008
+2d434bea-0f55-11e5-bfaf-005056c00008
+2d434beb-0f55-11e5-ba34-005056c00008
+2d434bec-0f55-11e5-9d7f-005056c00008
+2d434bed-0f55-11e5-ad4a-005056c00008
diff --git a/Silocean/0002/Test.py b/Silocean/0002/Test.py
new file mode 100644
index 00000000..d2ecb32d
--- /dev/null
+++ b/Silocean/0002/Test.py
@@ -0,0 +1,19 @@
+# -*-coding:utf-8-*-
+__author__ = 'Tracy'
+
+import MySQLdb
+
+conn = MySQLdb.connect('localhost', 'root', '123456', 'test', charset='utf8')
+cursor = conn.cursor()
+
+sql = 'create table if not exists mykeys (key_id char(36) not null)'
+cursor.execute(sql)
+
+with open('keys.txt', 'r') as f:
+ keys = f.readlines()
+ for key in keys:
+ cursor.execute("insert into mykeys values ('%s')" % str(key))
+
+cursor.close()
+conn.commit()
+conn.close()
\ No newline at end of file
diff --git a/Silocean/0002/keys.txt b/Silocean/0002/keys.txt
new file mode 100644
index 00000000..bc2a4a6c
--- /dev/null
+++ b/Silocean/0002/keys.txt
@@ -0,0 +1,200 @@
+2d41c530-0f55-11e5-8f5c-005056c00008
+2d42af8f-0f55-11e5-b4d8-005056c00008
+2d42af90-0f55-11e5-b7bb-005056c00008
+2d42af91-0f55-11e5-b9a1-005056c00008
+2d42af92-0f55-11e5-bf53-005056c00008
+2d42af93-0f55-11e5-bc30-005056c00008
+2d42af94-0f55-11e5-9f13-005056c00008
+2d42d69e-0f55-11e5-97ef-005056c00008
+2d42d69f-0f55-11e5-b24e-005056c00008
+2d42d6a0-0f55-11e5-9a7d-005056c00008
+2d42d6a1-0f55-11e5-8a21-005056c00008
+2d42d6a2-0f55-11e5-aa17-005056c00008
+2d42d6a3-0f55-11e5-8808-005056c00008
+2d42d6a4-0f55-11e5-b193-005056c00008
+2d42d6a5-0f55-11e5-b34f-005056c00008
+2d42d6a6-0f55-11e5-ae3a-005056c00008
+2d42d6a7-0f55-11e5-867a-005056c00008
+2d42d6a8-0f55-11e5-94f6-005056c00008
+2d42d6a9-0f55-11e5-8ccf-005056c00008
+2d42d6aa-0f55-11e5-9956-005056c00008
+2d42d6ab-0f55-11e5-b154-005056c00008
+2d42d6ac-0f55-11e5-be92-005056c00008
+2d42d6ad-0f55-11e5-ac5c-005056c00008
+2d42d6ae-0f55-11e5-a12a-005056c00008
+2d42d6af-0f55-11e5-88f8-005056c00008
+2d42d6b0-0f55-11e5-9a80-005056c00008
+2d42d6b1-0f55-11e5-ab69-005056c00008
+2d42d6b2-0f55-11e5-aa4e-005056c00008
+2d42d6b3-0f55-11e5-b419-005056c00008
+2d42d6b4-0f55-11e5-be0e-005056c00008
+2d42d6b5-0f55-11e5-8e0a-005056c00008
+2d42d6b6-0f55-11e5-8e7e-005056c00008
+2d42d6b7-0f55-11e5-9193-005056c00008
+2d42d6b8-0f55-11e5-a974-005056c00008
+2d42d6b9-0f55-11e5-84bb-005056c00008
+2d42d6ba-0f55-11e5-b16a-005056c00008
+2d42d6bb-0f55-11e5-a432-005056c00008
+2d42d6bc-0f55-11e5-b2cb-005056c00008
+2d42d6bd-0f55-11e5-b6a8-005056c00008
+2d42d6be-0f55-11e5-806a-005056c00008
+2d42d6bf-0f55-11e5-9979-005056c00008
+2d42d6c0-0f55-11e5-8f31-005056c00008
+2d42d6c1-0f55-11e5-9f4b-005056c00008
+2d42d6c2-0f55-11e5-afa9-005056c00008
+2d42d6c3-0f55-11e5-9718-005056c00008
+2d42d6c4-0f55-11e5-b206-005056c00008
+2d42d6c5-0f55-11e5-857c-005056c00008
+2d42d6c6-0f55-11e5-b451-005056c00008
+2d42d6c7-0f55-11e5-ae68-005056c00008
+2d42d6c8-0f55-11e5-8b37-005056c00008
+2d42d6c9-0f55-11e5-944b-005056c00008
+2d42d6ca-0f55-11e5-9348-005056c00008
+2d42d6cb-0f55-11e5-b068-005056c00008
+2d42d6cc-0f55-11e5-9457-005056c00008
+2d42d6cd-0f55-11e5-8d79-005056c00008
+2d42d6ce-0f55-11e5-9e25-005056c00008
+2d42d6cf-0f55-11e5-b0b3-005056c00008
+2d42d6d0-0f55-11e5-a097-005056c00008
+2d42d6d1-0f55-11e5-85d4-005056c00008
+2d42fdae-0f55-11e5-976f-005056c00008
+2d42fdaf-0f55-11e5-a37b-005056c00008
+2d42fdb0-0f55-11e5-905e-005056c00008
+2d42fdb1-0f55-11e5-83af-005056c00008
+2d42fdb2-0f55-11e5-b541-005056c00008
+2d42fdb3-0f55-11e5-b6e0-005056c00008
+2d42fdb4-0f55-11e5-b07b-005056c00008
+2d42fdb5-0f55-11e5-b458-005056c00008
+2d42fdb6-0f55-11e5-927d-005056c00008
+2d42fdb7-0f55-11e5-9bb9-005056c00008
+2d42fdb8-0f55-11e5-a37e-005056c00008
+2d42fdb9-0f55-11e5-9b60-005056c00008
+2d42fdba-0f55-11e5-8b8b-005056c00008
+2d42fdbb-0f55-11e5-bc71-005056c00008
+2d42fdbc-0f55-11e5-a6a3-005056c00008
+2d42fdbd-0f55-11e5-95eb-005056c00008
+2d42fdbe-0f55-11e5-b6c7-005056c00008
+2d42fdbf-0f55-11e5-8022-005056c00008
+2d42fdc0-0f55-11e5-91e1-005056c00008
+2d42fdc1-0f55-11e5-881e-005056c00008
+2d42fdc2-0f55-11e5-bbf8-005056c00008
+2d42fdc3-0f55-11e5-82cc-005056c00008
+2d42fdc4-0f55-11e5-b432-005056c00008
+2d42fdc5-0f55-11e5-9b5e-005056c00008
+2d42fdc6-0f55-11e5-9569-005056c00008
+2d42fdc7-0f55-11e5-93cb-005056c00008
+2d42fdc8-0f55-11e5-ac62-005056c00008
+2d42fdc9-0f55-11e5-8546-005056c00008
+2d42fdca-0f55-11e5-94a2-005056c00008
+2d42fdcb-0f55-11e5-aaa3-005056c00008
+2d42fdcc-0f55-11e5-8662-005056c00008
+2d42fdcd-0f55-11e5-8754-005056c00008
+2d42fdce-0f55-11e5-921d-005056c00008
+2d42fdcf-0f55-11e5-87f1-005056c00008
+2d42fdd0-0f55-11e5-8f64-005056c00008
+2d42fdd1-0f55-11e5-865c-005056c00008
+2d42fdd2-0f55-11e5-82fe-005056c00008
+2d42fdd3-0f55-11e5-a5c7-005056c00008
+2d42fdd4-0f55-11e5-8040-005056c00008
+2d42fdd5-0f55-11e5-b875-005056c00008
+2d42fdd6-0f55-11e5-9c3e-005056c00008
+2d42fdd7-0f55-11e5-8f2d-005056c00008
+2d42fdd8-0f55-11e5-8a4a-005056c00008
+2d42fdd9-0f55-11e5-b183-005056c00008
+2d42fdda-0f55-11e5-b57f-005056c00008
+2d42fddb-0f55-11e5-8df2-005056c00008
+2d42fddc-0f55-11e5-b25f-005056c00008
+2d42fddd-0f55-11e5-b1a7-005056c00008
+2d42fdde-0f55-11e5-8a7e-005056c00008
+2d42fddf-0f55-11e5-8e69-005056c00008
+2d42fde0-0f55-11e5-b08c-005056c00008
+2d42fde1-0f55-11e5-8b4d-005056c00008
+2d4324c0-0f55-11e5-8a3d-005056c00008
+2d4324c1-0f55-11e5-8e21-005056c00008
+2d4324c2-0f55-11e5-a739-005056c00008
+2d4324c3-0f55-11e5-be1c-005056c00008
+2d4324c4-0f55-11e5-b3cb-005056c00008
+2d4324c5-0f55-11e5-8f7f-005056c00008
+2d4324c6-0f55-11e5-8e36-005056c00008
+2d4324c7-0f55-11e5-b89a-005056c00008
+2d4324c8-0f55-11e5-ba2f-005056c00008
+2d4324c9-0f55-11e5-bde1-005056c00008
+2d4324ca-0f55-11e5-b995-005056c00008
+2d4324cb-0f55-11e5-9dff-005056c00008
+2d4324cc-0f55-11e5-ae22-005056c00008
+2d4324cd-0f55-11e5-b3a8-005056c00008
+2d4324ce-0f55-11e5-9d75-005056c00008
+2d4324cf-0f55-11e5-a491-005056c00008
+2d4324d0-0f55-11e5-a95b-005056c00008
+2d4324d1-0f55-11e5-87cc-005056c00008
+2d4324d2-0f55-11e5-9002-005056c00008
+2d4324d3-0f55-11e5-a70a-005056c00008
+2d4324d4-0f55-11e5-82d0-005056c00008
+2d4324d5-0f55-11e5-99f9-005056c00008
+2d4324d6-0f55-11e5-bb48-005056c00008
+2d4324d7-0f55-11e5-86bf-005056c00008
+2d4324d8-0f55-11e5-abe3-005056c00008
+2d4324d9-0f55-11e5-8ca4-005056c00008
+2d4324da-0f55-11e5-9ab8-005056c00008
+2d4324db-0f55-11e5-bbc0-005056c00008
+2d4324dc-0f55-11e5-829f-005056c00008
+2d4324dd-0f55-11e5-b85f-005056c00008
+2d4324de-0f55-11e5-9924-005056c00008
+2d4324df-0f55-11e5-be66-005056c00008
+2d4324e0-0f55-11e5-a782-005056c00008
+2d4324e1-0f55-11e5-a1bb-005056c00008
+2d4324e2-0f55-11e5-9a39-005056c00008
+2d4324e3-0f55-11e5-afa4-005056c00008
+2d4324e4-0f55-11e5-b056-005056c00008
+2d4324e5-0f55-11e5-b9aa-005056c00008
+2d4324e6-0f55-11e5-be9f-005056c00008
+2d4324e7-0f55-11e5-bb63-005056c00008
+2d4324e8-0f55-11e5-9953-005056c00008
+2d4324e9-0f55-11e5-b38a-005056c00008
+2d4324ea-0f55-11e5-b6c3-005056c00008
+2d4324eb-0f55-11e5-8263-005056c00008
+2d4324ec-0f55-11e5-9614-005056c00008
+2d4324ed-0f55-11e5-adac-005056c00008
+2d4324ee-0f55-11e5-b14c-005056c00008
+2d4324ef-0f55-11e5-9b03-005056c00008
+2d4324f0-0f55-11e5-b170-005056c00008
+2d4324f1-0f55-11e5-a4c5-005056c00008
+2d4324f2-0f55-11e5-8339-005056c00008
+2d4324f3-0f55-11e5-9e09-005056c00008
+2d4324f4-0f55-11e5-9f87-005056c00008
+2d4324f5-0f55-11e5-b5d5-005056c00008
+2d4324f6-0f55-11e5-bdda-005056c00008
+2d4324f7-0f55-11e5-a302-005056c00008
+2d4324f8-0f55-11e5-9cfc-005056c00008
+2d4324f9-0f55-11e5-bf30-005056c00008
+2d434bcf-0f55-11e5-b117-005056c00008
+2d434bd0-0f55-11e5-9677-005056c00008
+2d434bd1-0f55-11e5-9433-005056c00008
+2d434bd2-0f55-11e5-a0a9-005056c00008
+2d434bd3-0f55-11e5-80e1-005056c00008
+2d434bd4-0f55-11e5-a504-005056c00008
+2d434bd5-0f55-11e5-9d0e-005056c00008
+2d434bd6-0f55-11e5-afd2-005056c00008
+2d434bd7-0f55-11e5-a37b-005056c00008
+2d434bd8-0f55-11e5-8ac6-005056c00008
+2d434bd9-0f55-11e5-b15d-005056c00008
+2d434bda-0f55-11e5-9adf-005056c00008
+2d434bdb-0f55-11e5-a36b-005056c00008
+2d434bdc-0f55-11e5-adaa-005056c00008
+2d434bdd-0f55-11e5-b1f0-005056c00008
+2d434bde-0f55-11e5-b3e3-005056c00008
+2d434bdf-0f55-11e5-a63c-005056c00008
+2d434be0-0f55-11e5-a2bc-005056c00008
+2d434be1-0f55-11e5-9879-005056c00008
+2d434be2-0f55-11e5-a762-005056c00008
+2d434be3-0f55-11e5-960f-005056c00008
+2d434be4-0f55-11e5-a09d-005056c00008
+2d434be5-0f55-11e5-9ac9-005056c00008
+2d434be6-0f55-11e5-a32e-005056c00008
+2d434be7-0f55-11e5-be33-005056c00008
+2d434be8-0f55-11e5-9ce6-005056c00008
+2d434be9-0f55-11e5-89cc-005056c00008
+2d434bea-0f55-11e5-bfaf-005056c00008
+2d434beb-0f55-11e5-ba34-005056c00008
+2d434bec-0f55-11e5-9d7f-005056c00008
+2d434bed-0f55-11e5-ad4a-005056c00008
diff --git a/Silocean/0003/Test.py b/Silocean/0003/Test.py
new file mode 100644
index 00000000..542a2a74
--- /dev/null
+++ b/Silocean/0003/Test.py
@@ -0,0 +1,10 @@
+# -*-coding:utf-8-*-
+__author__ = 'Tracy'
+import redis, uuid
+
+r = redis.StrictRedis(host='localhost', port=6379)
+for i in range(200):
+ r.set('key_id'+str(i), uuid.uuid1())
+
+for i in range(200):
+ print(r.get("key_id"+str(i)))
\ No newline at end of file
diff --git a/Silocean/0004/Test.py b/Silocean/0004/Test.py
new file mode 100644
index 00000000..4955b1b9
--- /dev/null
+++ b/Silocean/0004/Test.py
@@ -0,0 +1,12 @@
+__author__ = 'Tracy'
+
+import io, re
+
+count = 0
+
+with io.open('text.txt', 'r') as file:
+ for line in file.readlines():
+ list = re.findall("[a-zA-Z]+'*-*[a-zA-Z]*", line)
+ count += len(list)
+print(count)
+
diff --git a/Silocean/0004/text.txt b/Silocean/0004/text.txt
new file mode 100644
index 00000000..2379c58b
--- /dev/null
+++ b/Silocean/0004/text.txt
@@ -0,0 +1 @@
+The Dursleys had everything they wanted, but they also had a secret, and their greatest fear was that somebody would discover it. They didn't think they could bear it if anyone found out about the Potters. Mrs. Potter was Mrs. Dursley's sister, but they hadn't met for several years; in fact, Mrs. Dursley pretended she didn't have a sister, because her sister and her good-for-nothing husband were as unDursleyish as it was possible to be. The Dursleys shuddered to think what the neighbors would say if the Potters arrived in the street. The Dursleys knew that the Potters had a small son, too, but they had never even seen him. This boy was another good reason for keeping the Potters away; they didn't want Dudley mixing with a child like that.
\ No newline at end of file
diff --git a/Silocean/0005/Test.py b/Silocean/0005/Test.py
new file mode 100644
index 00000000..a311f859
--- /dev/null
+++ b/Silocean/0005/Test.py
@@ -0,0 +1,19 @@
+# -*-coding:utf-8-*-
+__author__ = 'Tracy'
+import os
+import Image
+
+path = 'images'
+
+for f in os.listdir(path):
+ img = Image.open(os.path.join(path, f))
+ width = img.size[0]
+ height = img.size[1]
+ out = img
+ if width > 1136:
+ width = 1136
+ out = img.resize((width, height), Image.ANTIALIAS)
+ if height > 640:
+ height = 640
+ out = img.resize((width, height), Image.ANTIALIAS)
+ out.save('images/result/'+f)
diff --git a/Silocean/0006/Test.py b/Silocean/0006/Test.py
new file mode 100644
index 00000000..ae2b3f59
--- /dev/null
+++ b/Silocean/0006/Test.py
@@ -0,0 +1,27 @@
+# -*-coding:utf-8-*-
+__author__ = 'Tracy'
+import os,re
+
+path = 'diaries'
+files = os.listdir(path)
+
+def get_key_word(words):
+ dic = {}
+ max = 0
+ marked_key = ''
+ for word in words:
+ if dic.has_key(word) is False:
+ dic[word] = 1
+ else:
+ dic[word] = dic[word] + 1
+ for key, value in dic.items():
+ if dic[key] > max:
+ max = dic[key]
+ marked_key = key
+ print(marked_key, max)
+
+
+for f in files:
+ with open(os.path.join(path, f)) as diary:
+ words = re.findall("[a-zA-Z]+'*-*[a-zA-Z]*",diary.read())
+ get_key_word(words)
\ No newline at end of file
diff --git a/Silocean/0006/diaries/day01.txt b/Silocean/0006/diaries/day01.txt
new file mode 100644
index 00000000..be5fddd0
--- /dev/null
+++ b/Silocean/0006/diaries/day01.txt
@@ -0,0 +1,4 @@
+Python learning
+
+This is a diary about Python.
+Python is an interesting language, which is very easy to learn and we can use it to do many things.
\ No newline at end of file
diff --git a/Silocean/0006/diaries/day02.txt b/Silocean/0006/diaries/day02.txt
new file mode 100644
index 00000000..c2d743f7
--- /dev/null
+++ b/Silocean/0006/diaries/day02.txt
@@ -0,0 +1,2 @@
+Hello Java!!!
+I love Java......
\ No newline at end of file
diff --git a/Silocean/0006/diaries/day03.txt b/Silocean/0006/diaries/day03.txt
new file mode 100644
index 00000000..202d770c
--- /dev/null
+++ b/Silocean/0006/diaries/day03.txt
@@ -0,0 +1,9 @@
+The Dursleys had everything they wanted, but they also had a secret,
+and their greatest fear was that somebody would discover it.
+ They didn't think they could bear it if anyone found out about the Potters.
+ Mrs. Potter was Mrs. Dursley's sister, but they hadn't met for several years;
+ in fact, Mrs. Dursley pretended she didn't have a sister, because her sister and her good-for-nothing
+ husband were as unDursleyish as it was possible to be.
+ The Dursleys shuddered to think what the neighbors would say if the Potters arrived in the street.
+ The Dursleys knew that the Potters had a small son, too, but they had never even seen him.
+ This boy was another good reason for keeping the Potters away; they didn't want Dudley mixing with a child like that
\ No newline at end of file
diff --git a/Silocean/0007/Test.py b/Silocean/0007/Test.py
new file mode 100644
index 00000000..7c09b4db
--- /dev/null
+++ b/Silocean/0007/Test.py
@@ -0,0 +1,39 @@
+__author__ = 'Tracy'
+
+import os, io, re
+
+commentLines = 0
+whiteLines = 0
+comment = False
+
+path = 'F:\AllKindsOfWorkplace\PyCharmWorkplace\PythonLearning'
+
+count = 0
+def tree(path):
+ filelist = os.listdir(path)
+ for file in filelist:
+ if os.path.isdir(os.path.join(path, file)):
+ tree(os.path.join(path, file))
+ else:
+ filename = os.path.basename(os.path.join(path, file))
+ if filename.endswith(".py"):
+ # print(filename)
+ file = io.open(os.path.join(path, file))
+ parse(file)
+ file.close()
+
+def parse(file):
+ global commentLines
+ global whiteLines
+ global comment
+ for line in file.readlines():
+ # line = line.strip("\n")
+ if line.startswith("#"):
+ commentLines += 1
+ elif re.match("^[\\s&&[^\\n]]*$", line):
+ whiteLines += 1
+
+tree(path)
+
+print(commentLines)
+print(whiteLines)
diff --git a/Silocean/0008/Test.html b/Silocean/0008/Test.html
new file mode 100644
index 00000000..17e2b30a
--- /dev/null
+++ b/Silocean/0008/Test.html
@@ -0,0 +1,17 @@
+
+
+
+
+This is the Title
+
+
+
+
Once upon a time there were three little sisters; and their names were
+Elsie
+Lacie
+Tillie
+and they lived at the bottom of a well.
+
+
...
+
+
\ No newline at end of file
diff --git a/Silocean/0009/Test.py b/Silocean/0009/Test.py
new file mode 100644
index 00000000..4bb524a9
--- /dev/null
+++ b/Silocean/0009/Test.py
@@ -0,0 +1,21 @@
+__author__ = 'Tracy'
+
+from bs4 import BeautifulSoup
+import io
+
+with io.open('Test.html') as file:
+ html = file.read()
+ soup = BeautifulSoup(html)
+ listA = soup.find_all('a')
+ listL = soup.find_all('link')
+ listI = soup.find_all('img')
+ # print(listA)
+ # print(listL)
+ # print(listI)
+
+for x in listA:
+ print(x['href'])
+for x in listL:
+ print(x['href'])
+for x in listI:
+ print(x['src'])
\ No newline at end of file
diff --git a/Silocean/0010/DejaVuSansMono.ttf b/Silocean/0010/DejaVuSansMono.ttf
new file mode 100644
index 00000000..9bebb47e
Binary files /dev/null and b/Silocean/0010/DejaVuSansMono.ttf differ
diff --git a/Silocean/0010/Result.jpg b/Silocean/0010/Result.jpg
new file mode 100644
index 00000000..3469c9a7
Binary files /dev/null and b/Silocean/0010/Result.jpg differ
diff --git a/Silocean/0010/Test.py b/Silocean/0010/Test.py
new file mode 100644
index 00000000..a59edef2
--- /dev/null
+++ b/Silocean/0010/Test.py
@@ -0,0 +1,29 @@
+__author__ = 'Tracy'
+import Image,ImageDraw,ImageFont,ImageFilter
+import random
+
+image = Image.new('RGB', (50*4, 50), (255,255,255))
+
+font = ImageFont.truetype('DejaVuSansMono.ttf', 24)
+
+draw = ImageDraw.Draw(image)
+
+def randColor():
+ return (random.randint(64,255), random.randint(64,255), random.randint(64,255))
+
+def randColor2():
+ return (random.randint(32,127), random.randint(32,127), random.randint(32,127))
+
+def randChar():
+ return chr(random.randint(65,90))
+
+for x in range(50*4):
+ for y in range(50):
+ draw.point((x, y), randColor())
+
+for x in range(4):
+ draw.text((50*x+10, 10), randChar(), randColor2(), font)
+
+image = image.filter(ImageFilter.BLUR)
+image.save('Result.jpg')
+image.show()
\ No newline at end of file
diff --git a/Silocean/0011/Test.py b/Silocean/0011/Test.py
new file mode 100644
index 00000000..f3971a16
--- /dev/null
+++ b/Silocean/0011/Test.py
@@ -0,0 +1,22 @@
+import io
+
+file = io.open('filtered_words.txt', 'r')
+list = []
+for word in file.readlines():
+ list.append(word.strip('\n'))
+
+print(list)
+
+def isValid(word):
+ for x in list:
+ if word == x:
+ return False
+ return True
+
+myword = input("please input a word:")
+if isValid(myword):
+ print('Human Rights')
+else:
+ print('Freedom')
+
+file.close()
diff --git a/Silocean/0011/filtered_words.txt b/Silocean/0011/filtered_words.txt
new file mode 100644
index 00000000..444eb7c6
--- /dev/null
+++ b/Silocean/0011/filtered_words.txt
@@ -0,0 +1,11 @@
+
+Ա
+Ա
+쵼
+ţ
+ţ
+
+
+love
+sex
+jiangge
\ No newline at end of file
diff --git a/Silocean/0012/Test.py b/Silocean/0012/Test.py
new file mode 100644
index 00000000..c3a2cb28
--- /dev/null
+++ b/Silocean/0012/Test.py
@@ -0,0 +1,20 @@
+import io
+
+file = io.open('filtered_words.txt', 'r')
+list = []
+for word in file.readlines():
+ list.append(word.strip('\n'))
+
+print(list)
+
+def isValid(mystr):
+ result = mystr
+ for x in list:
+ if result.find(x) != -1:
+ result = result.replace(x, '**')
+ return result
+
+mystr = input("please input a string:")
+print (isValid(mystr))
+
+file.close()
diff --git a/Silocean/0012/filtered_words.txt b/Silocean/0012/filtered_words.txt
new file mode 100644
index 00000000..444eb7c6
--- /dev/null
+++ b/Silocean/0012/filtered_words.txt
@@ -0,0 +1,11 @@
+
+Ա
+Ա
+쵼
+ţ
+ţ
+
+
+love
+sex
+jiangge
\ No newline at end of file
diff --git a/Silocean/0013/Test.py b/Silocean/0013/Test.py
new file mode 100644
index 00000000..5188545e
--- /dev/null
+++ b/Silocean/0013/Test.py
@@ -0,0 +1,21 @@
+__author__ = 'Tracy'
+from urllib import urlopen
+from bs4 import BeautifulSoup
+
+f = urlopen('http://tieba.baidu.com/p/2166231880').read()
+
+s = BeautifulSoup(f)
+
+images = s.find_all('img', pic_type='0')
+count = 1
+def download(src):
+ global count
+ file_name = str(count) + '.jpg'
+ content = urlopen(src).read()
+ with open(file_name, 'wb') as f:
+ f.write(content)
+ count += 1
+
+for image in images:
+ download(image['src'])
+
diff --git a/Silocean/0014/Student.txt b/Silocean/0014/Student.txt
new file mode 100644
index 00000000..d3c6eb5b
--- /dev/null
+++ b/Silocean/0014/Student.txt
@@ -0,0 +1,5 @@
+{
+ "1":["",150,120,100],
+ "2":["",90,99,95],
+ "3":["",60,66,68]
+}
\ No newline at end of file
diff --git a/Silocean/0014/Test.py b/Silocean/0014/Test.py
new file mode 100644
index 00000000..50ab2123
--- /dev/null
+++ b/Silocean/0014/Test.py
@@ -0,0 +1,21 @@
+__author__ = 'Tracy'
+import xlwt
+
+with open('Student.txt', 'r') as f:
+ content = f.read()
+
+dic = eval(content)
+
+file = xlwt.Workbook()
+table = file.add_sheet('Test', cell_overwrite_ok=True)
+
+
+def deal(key, value):
+ table.write(int(key) - 1, 0, key)
+ for x in range(len(value)):
+ table.write(int(key) - 1, x + 1, str(value[x]).decode('gbk'))
+
+for key, value in dic.items():
+ deal(key, value)
+
+file.save('result.xls')
diff --git a/Silocean/0014/result.xls b/Silocean/0014/result.xls
new file mode 100644
index 00000000..ee6454c6
Binary files /dev/null and b/Silocean/0014/result.xls differ
diff --git a/Silocean/0015/Test.py b/Silocean/0015/Test.py
new file mode 100644
index 00000000..ecc2b1d0
--- /dev/null
+++ b/Silocean/0015/Test.py
@@ -0,0 +1,15 @@
+__author__ = 'Tracy'
+import xlwt
+
+with open('city.txt') as f:
+ content = f.read()
+ dic = eval(content)
+
+file = xlwt.Workbook()
+table = file.add_sheet("Test", cell_overwrite_ok=True)
+
+for k, v in dic.items():
+ table.write(int(k)-1, 0, k)
+ table.write(int(k)-1, 1, str(v).decode('gbk'))
+
+file.save('result.xls')
\ No newline at end of file
diff --git a/Silocean/0015/city.txt b/Silocean/0015/city.txt
new file mode 100644
index 00000000..22a2ad33
--- /dev/null
+++ b/Silocean/0015/city.txt
@@ -0,0 +1,5 @@
+{
+ "1" : "Ϻ",
+ "2" : "",
+ "3" : "ɶ"
+}
\ No newline at end of file
diff --git a/Silocean/0015/result.xls b/Silocean/0015/result.xls
new file mode 100644
index 00000000..b380dabd
Binary files /dev/null and b/Silocean/0015/result.xls differ
diff --git a/Silocean/0016/Test.py b/Silocean/0016/Test.py
new file mode 100644
index 00000000..20879865
--- /dev/null
+++ b/Silocean/0016/Test.py
@@ -0,0 +1,15 @@
+__author__ = 'Tracy'
+import xlwt
+
+with open('numbers.txt') as f:
+ content = f.read()
+ lists = eval(content)
+
+file = xlwt.Workbook()
+table = file.add_sheet('Test',cell_overwrite_ok=True)
+
+for row in range(len(lists)):
+ for col in range(len(lists[row])):
+ table.write(row, col, lists[row][col])
+
+file.save('result.xls')
\ No newline at end of file
diff --git a/Silocean/0016/numbers.txt b/Silocean/0016/numbers.txt
new file mode 100644
index 00000000..c43c0378
--- /dev/null
+++ b/Silocean/0016/numbers.txt
@@ -0,0 +1,5 @@
+[
+ [1, 82, 65535],
+ [20, 90, 13],
+ [26, 809, 1024]
+]
\ No newline at end of file
diff --git a/Silocean/0016/result.xls b/Silocean/0016/result.xls
new file mode 100644
index 00000000..6ebca345
Binary files /dev/null and b/Silocean/0016/result.xls differ
diff --git a/Silocean/0017/Test.py b/Silocean/0017/Test.py
new file mode 100644
index 00000000..3243f582
--- /dev/null
+++ b/Silocean/0017/Test.py
@@ -0,0 +1,35 @@
+
+# -*-coding:utf-8-*-
+
+__author__ = 'Tracy'
+import xlrd, re, json
+import sys
+reload(sys)
+sys.setdefaultencoding('utf-8')
+
+# xlrd.Book.encoding = 'gbk'
+with xlrd.open_workbook('student.xls') as file:
+ table = file.sheet_by_index(0)
+
+rows = table.nrows
+cols = table.ncols
+
+dic = {}
+
+content = '\n\n\n\n'
+
+for row in range(rows):
+ stu = table.row_values(row)
+ list = []
+ for x in range(len(stu)-1):
+ list.append(stu[x+1])
+ # print(isinstance(stu[x+1],unicode)) # 判断是否是unicode编码
+ dic[stu[0]] = list
+
+s = json.dumps(dic, indent=4, ensure_ascii=False)
+
+content = content + s + '\n\n'
+with open('student.xml', 'w') as f:
+ f.write(content)
+
+
diff --git a/Silocean/0017/student.xls b/Silocean/0017/student.xls
new file mode 100644
index 00000000..ee6454c6
Binary files /dev/null and b/Silocean/0017/student.xls differ
diff --git a/Silocean/0017/student.xml b/Silocean/0017/student.xml
new file mode 100644
index 00000000..5f839b46
--- /dev/null
+++ b/Silocean/0017/student.xml
@@ -0,0 +1,29 @@
+
+
+
+
+{
+ "1": [
+ "张三",
+ "150",
+ "120",
+ "100"
+ ],
+ "3": [
+ "王五",
+ "60",
+ "66",
+ "68"
+ ],
+ "2": [
+ "李四",
+ "90",
+ "99",
+ "95"
+ ]
+}
+
+
\ No newline at end of file
diff --git a/Silocean/0018/Test.py b/Silocean/0018/Test.py
new file mode 100644
index 00000000..bb374239
--- /dev/null
+++ b/Silocean/0018/Test.py
@@ -0,0 +1,24 @@
+# -*-coding:utf-8-*-
+__author__ = 'Tracy'
+
+import xlrd,json,sys
+reload(sys)
+sys.setdefaultencoding('utf8')
+
+with xlrd.open_workbook('city.xls', 'w') as f:
+ table = f.sheet_by_index(0)
+
+rows = table.nrows
+cols = table.ncols
+dic = {}
+for row in range(rows):
+ dic[str(row+1)] = table.row_values(row)[1]
+
+s = json.dumps(dic, ensure_ascii=False, indent=4)
+
+content = '\n\n\n\n'
+
+content = content + s + '\n\n'
+
+with open('city.xml', 'w') as f:
+ f.write(content)
\ No newline at end of file
diff --git a/Silocean/0018/city.xls b/Silocean/0018/city.xls
new file mode 100644
index 00000000..4ec0b777
Binary files /dev/null and b/Silocean/0018/city.xls differ
diff --git a/Silocean/0018/city.xml b/Silocean/0018/city.xml
new file mode 100644
index 00000000..30f21da1
--- /dev/null
+++ b/Silocean/0018/city.xml
@@ -0,0 +1,13 @@
+
+
+
+
+{
+ "1": "上海",
+ "3": "成都",
+ "2": "北京"
+}
+
+
\ No newline at end of file
diff --git a/Silocean/0019/Test.py b/Silocean/0019/Test.py
new file mode 100644
index 00000000..9ce2bbf4
--- /dev/null
+++ b/Silocean/0019/Test.py
@@ -0,0 +1,26 @@
+# -*-coding:utf-8-*-
+__author__ = 'Tracy'
+
+import xlrd,json,sys
+reload(sys)
+sys.setdefaultencoding('utf8')
+
+with xlrd.open_workbook('numbers.xls', 'w') as f:
+ table = f.sheet_by_index(0)
+
+rows = table.nrows
+cols = table.ncols
+
+lists = []
+
+for row in range(rows):
+ list = []
+ for x in table.row_values(row):
+ list.append(x)
+ lists.append(list)
+s = json.dumps(lists,ensure_ascii=False, indent=4)
+content = '\n\n\n\n'
+content = content + s + '\n\n'
+
+with open('numbers.xml', 'w') as f:
+ f.write(content)
diff --git a/Silocean/0019/numbers.xls b/Silocean/0019/numbers.xls
new file mode 100644
index 00000000..6ebca345
Binary files /dev/null and b/Silocean/0019/numbers.xls differ
diff --git a/Silocean/0019/numbers.xml b/Silocean/0019/numbers.xml
new file mode 100644
index 00000000..e92e06e6
--- /dev/null
+++ b/Silocean/0019/numbers.xml
@@ -0,0 +1,25 @@
+
+
+
+
+[
+ [
+ 1.0,
+ 82.0,
+ 65535.0
+ ],
+ [
+ 20.0,
+ 90.0,
+ 13.0
+ ],
+ [
+ 26.0,
+ 809.0,
+ 1024.0
+ ]
+]
+
+
\ No newline at end of file
diff --git a/Tachone/README.md b/Tachone/README.md
new file mode 100644
index 00000000..e6b2512a
--- /dev/null
+++ b/Tachone/README.md
@@ -0,0 +1,8 @@
+View my codes through the url below
+
+https://github.com/Tachone/PythonCode
+
+otherwise,welcome to visit my csdn blog!
+It's about linux,c++,shell,python,network~~
+
+http://blog.csdn.net/nk_test
diff --git a/WangZhou/0000/consolab.ttf b/WangZhou/0000/consolab.ttf
new file mode 100644
index 00000000..55f6bd2f
Binary files /dev/null and b/WangZhou/0000/consolab.ttf differ
diff --git a/WangZhou/0000/insert_num_angle.py b/WangZhou/0000/insert_num_angle.py
new file mode 100644
index 00000000..73242822
--- /dev/null
+++ b/WangZhou/0000/insert_num_angle.py
@@ -0,0 +1,20 @@
+from PIL import Image, ImageDraw, ImageFont
+
+
+def insert_angle_num(img):
+ """
+ Insert a num on the right-upper angle,then save the new image.
+ :param img:string : filename of an Image object
+ """
+ with Image.open(img) as im:
+ width, height = im.size
+ draw_image = ImageDraw.Draw(im)
+ color = '#ff0000'
+ num_font = ImageFont.truetype('consolab.ttf', 100)
+ draw_image.text((width - 80, 20), '7', font=num_font, fill=color)
+ im.save('new_message.jpg')
+
+
+if __name__ == "__main__":
+ img = 'wz0000.jpg'
+ insert_angle_num(img)
diff --git a/WangZhou/0000/new_message.jpg b/WangZhou/0000/new_message.jpg
new file mode 100644
index 00000000..6f3bb4ef
Binary files /dev/null and b/WangZhou/0000/new_message.jpg differ
diff --git a/WangZhou/0000/wz0000.jpg b/WangZhou/0000/wz0000.jpg
new file mode 100644
index 00000000..d4a4d920
Binary files /dev/null and b/WangZhou/0000/wz0000.jpg differ
diff --git a/WangZhou/0001/gen_act_key.py b/WangZhou/0001/gen_act_key.py
new file mode 100644
index 00000000..45909b32
--- /dev/null
+++ b/WangZhou/0001/gen_act_key.py
@@ -0,0 +1,21 @@
+import uuid
+
+
+def gen_act_key(n):
+ """
+ 生成 n 个激活码,保存在字典。
+ :param n: int
+ :return: dict
+ """
+ act_code_store = {}
+
+ for i in range(n):
+ code0 = str(uuid.uuid1()).split('-')[0]
+ code1 = '-'.join(str(uuid.uuid3(uuid.NAMESPACE_DNS, f'{i}')).split('-')[1:])
+ act_code = code0 + '-' + code1
+ act_code_store[f'id-{i}'] = act_code
+ return act_code_store
+
+
+if __name__ == "__main__":
+ activity_code = gen_act_key(200)
diff --git a/Yixiaohan/0000/avatar_add_number.py b/Yixiaohan/0000/avatar_add_number.py
new file mode 100644
index 00000000..804d299f
--- /dev/null
+++ b/Yixiaohan/0000/avatar_add_number.py
@@ -0,0 +1,38 @@
+#!/usr /bin/env python
+# -*- coding: utf-8 -*-
+
+"""
+将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。
+Pillow:Python Imaging Library
+PIL.ImageDraw.Draw.text(xy, text, fill=None, font=None, anchor=None)
+"""
+
+from PIL import Image, ImageDraw, ImageFont
+
+original_avatar = 'weChat_avatar.png'
+saved_avatar = 'new_avatar.png'
+windows_font = 'Arial.ttf'
+color = (255, 0, 0)
+
+def draw_text(text, fill_color, windows_font):
+ try:
+ im = Image.open(original_avatar)
+ x, y = im.size
+ print "The size of the Image is: "
+ print(im.format, im.size, im.mode)
+ im.show()
+
+ draw = ImageDraw.Draw(im)
+ font = ImageFont.truetype(windows_font, 35)
+ draw.text((x-20, 7), text, fill_color, font)
+
+ im.save(saved_avatar)
+ im.show()
+
+ except:
+ print "Unable to load image"
+
+if __name__ == "__main__":
+ #number = str(raw_input('please input number: '))
+ number = str(4)
+ draw_text(number, color, windows_font)
\ No newline at end of file
diff --git a/Yixiaohan/0000/weChat_avatar.png b/Yixiaohan/0000/weChat_avatar.png
new file mode 100644
index 00000000..f978a981
Binary files /dev/null and b/Yixiaohan/0000/weChat_avatar.png differ
diff --git a/Yixuan/0000/duck.jpg b/Yixuan/0000/duck.jpg
new file mode 100644
index 00000000..c74dbf60
Binary files /dev/null and b/Yixuan/0000/duck.jpg differ
diff --git a/Yixuan/0000/finnal.jpg b/Yixuan/0000/finnal.jpg
new file mode 100644
index 00000000..91af4c69
Binary files /dev/null and b/Yixuan/0000/finnal.jpg differ
diff --git a/Yixuan/0000/main.py b/Yixuan/0000/main.py
new file mode 100644
index 00000000..a27cf4b1
--- /dev/null
+++ b/Yixuan/0000/main.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+
+from PIL import Image, ImageDraw, ImageFont, ImageColor
+
+
+'''
+打开文件,
+声明 text 的位置, 是什么, 字体, 颜色.
+
+----
+'''
+
+original = Image.open("duck.jpg") #Open pic
+
+font = ImageFont.truetype("msyh.ttf", 60)
+
+d = ImageDraw.Draw(original)
+
+d.text((500, 0), "2", font=font, fill=(255,0,0,255))
+
+d = ImageDraw.Draw(original)
+
+original.save("finnal.jpg")
+
diff --git a/Yixuan/0000/msyh.ttf b/Yixuan/0000/msyh.ttf
new file mode 100644
index 00000000..aa23ae1f
Binary files /dev/null and b/Yixuan/0000/msyh.ttf differ
diff --git a/Yixuan/0001/code.md b/Yixuan/0001/code.md
new file mode 100644
index 00000000..161e02ca
--- /dev/null
+++ b/Yixuan/0001/code.md
@@ -0,0 +1,200 @@
+1. 3f654938-3b34-4585-b7f7-f41567b8e645
+2. b8e79c24-a7b4-4723-adae-96148557fb5f
+3. ce2de3c4-f479-47da-9bfe-84d54511597b
+4. 0d7ad4d4-a24c-46c5-b400-d5f13131c3a6
+5. ea97a605-feea-4806-8cab-9efc5009cb4f
+6. 44651cd4-3729-4fa3-8ef6-578c4aca17c5
+7. a6bdb701-6c63-4618-8183-03445f7341db
+8. 6b403e29-97ba-4d61-a1cc-b640b08b7184
+9. 656983b7-0f17-44b4-bfe1-b256bd313a4c
+10. ce587a68-a0a9-48b9-b575-69fcfd466f4f
+11. 151e5e37-3a62-48e7-a78b-7d0a580dd4d9
+12. 1ddaeba0-e342-4800-a324-dd48f837fae0
+13. 438b79e6-0944-448b-8116-5bcb1af00f87
+14. 4d59bff5-5049-4b81-b056-ea400f34d830
+15. ba70787c-c4b4-4f1f-84b8-bfd1c4cc0923
+16. d02a649a-acc9-46f8-8795-aadda041c9b0
+17. ee6127aa-c615-4bb6-8b58-6814b539a897
+18. 095477f1-920b-40bb-bf8b-5d63d4cc8562
+19. aa2fb5b6-7642-4427-963c-8866d09d5661
+20. b87c5852-c605-4753-8a68-ea3ceca4364c
+21. 2f880a72-82a2-4ed6-b139-269f1b9c613b
+22. bc40ada8-8553-4a6f-9d8c-30640f7448a1
+23. 37cbf172-73d2-4eaa-8d24-509146eca5cd
+24. 484ccf9b-a0cd-4c87-9445-b31d9bb7ddd8
+25. 3364723d-74ec-4df7-bfa5-8b19419f5ae9
+26. fdb3737b-d8f1-435b-b32d-25c11b170934
+27. e53991dd-50c5-45b9-974d-296716ddc0e0
+28. bf60b96b-2bc4-4043-b84a-78445116d6fb
+29. 2fe83f3e-16f3-4234-acfc-313887ff9620
+30. f27a9f6d-3daf-4172-9a45-975e870eef5b
+31. 7761b335-1884-45b4-a6a7-908b92122b3c
+32. 30166b2f-9e53-479f-beea-7002d67b3707
+33. 46fb8106-129b-4618-8d15-4fdd4be6f861
+34. 75b52f54-e50d-4542-9d91-dc1e80ae1a0f
+35. 26b23075-5b85-4720-a127-81dd1940e5d8
+36. ece5ed26-991c-4b3f-9309-9edbaabfe015
+37. c2eb57bd-b24d-423b-bb58-64aeb7b7c00b
+38. 53232e6c-5e39-47a9-bfc3-5b7652025d54
+39. fe8d95c7-2666-4217-b0c0-1aeaca2aecfd
+40. a1330a02-4ccf-408d-a46a-ed2170ec5e9e
+41. e27ff244-2f12-4749-b0bf-fab075bd4375
+42. ee96285b-6611-45a2-977e-743e68e9f84b
+43. 46b5294d-d6e3-401f-a6d1-67786bfac27e
+44. 64494b13-579b-45df-a3c9-55b4b0cb566c
+45. 3e10dda7-eb94-4652-9fb4-fd5202a53927
+46. 8f2fb84c-e8fb-4dbe-8428-7eb0c1f42647
+47. df66e698-0a0f-4541-a873-7fe456235d6f
+48. 18be0daf-7704-4a43-8758-ef3d5fe2e122
+49. a30daa16-3c9e-4022-9e16-392e3440b42b
+50. 703f2bfd-692b-487b-a8c2-0edfdb95f538
+51. 96e0eaa8-ad18-41f3-abb7-5f0239eeaf0d
+52. a2e00b48-5869-40b2-9712-0b1aae345f18
+53. d1c97db9-8402-44f1-b5a4-4d3183d469c4
+54. e552c679-5e3d-4000-8f1e-689ae23afe69
+55. 4db88579-5c7b-4339-a4b4-33cf870358bb
+56. da7ef6e2-d0b3-47db-9bfb-63391733b688
+57. a89536d8-9ebe-4741-a433-4c092183e598
+58. d2f9d5c0-3bd7-4b34-ab50-4794f3b7e733
+59. d42fa8f9-082c-4a79-ab3e-f8c67c88712a
+60. 0a2f6922-2860-4b5d-ac3b-390637839a38
+61. 02900b28-c774-4a4d-9497-1af77a14c5b9
+62. d520298b-d0ab-4c0e-b740-b08647a263fb
+63. 2f938524-d218-4215-a66a-bcf5d86665c2
+64. ad06ad28-6d69-4a57-81c7-2e4e28edd074
+65. 951f99f3-3c41-49c7-95d5-252e98c53c88
+66. 9b45f680-bf88-4afd-9db6-9c76c857b565
+67. 409adbc5-c62a-45e6-951c-7a43ac4c014f
+68. eda3935b-1900-46be-9158-91c2d617d16a
+69. b4830980-bae7-4151-931f-b6252d701605
+70. 63e29a47-7995-480e-aaaf-e288a7229656
+71. ec53de7b-38cd-4dab-acf6-3d3c951519ae
+72. 79fd2f79-7269-4a80-b62a-4b67e21371fe
+73. 74de0b9e-a660-42b9-aded-5e8cac9bc20b
+74. 8a6eaedc-116b-4ab3-a5b6-37ca7c970d0d
+75. bd4b77b8-dc32-411e-b0f2-2434d9dde74f
+76. 43d32480-955a-444c-9794-d6d53746ea83
+77. cd74e749-1e3d-406a-9ade-b88698cce346
+78. 1abc5745-2fc9-4244-8f2b-03c9bc2544ee
+79. dd59494e-2339-411b-8a69-6500d32e06e7
+80. 71fed090-15a4-42b2-8a24-56baa748172e
+81. 764a33d2-222a-45f6-ae20-f174b1a21548
+82. 28c2e491-4003-4b73-b570-c5d6eae7f247
+83. 64f36931-fd83-4001-af20-18c6112dc57e
+84. 4ec62f94-021f-4007-8475-70ebc880a187
+85. 1086e631-a654-4597-9c2b-47d14ddb04d2
+86. 5457bc3a-0595-4c2f-8cae-78a5cf75b0ab
+87. 026fb380-c1f2-4e71-a655-37db4a063640
+88. 0b44fa97-7019-48a8-9fb7-fa5a8baf1cd6
+89. c88c4ba8-8886-414a-875a-2fbcd87c1e15
+90. 880e5c6a-4b6b-4a0f-b7bd-0dde578ff4a0
+91. 905d527e-f54b-4b45-8d11-0e78ac8b6d1f
+92. 9477e52f-ab15-4f7a-8b3d-d06411051b8e
+93. 8ddc8db6-ecaa-4494-a4d7-1496aa9be92c
+94. 068e1a52-1002-4a66-ae90-07c7bbb80686
+95. 5ac1b226-0077-434c-81fc-ba5b59b843ed
+96. 0b13b926-dd01-4016-a5a6-115d154265eb
+97. be819d0a-8d7e-42a5-80f4-432f0ced0324
+98. f2dcd76b-8c4a-40af-a57b-77612594c207
+99. 11b7e07b-baa7-4114-b479-f7749dd1ac98
+100. ed3d4461-c291-4701-95b1-36fd6a4ece7f
+101. cc14d776-7461-48ba-818f-03510a8466f0
+102. 1dbe55f1-9877-4e18-8e76-36c7d1bbd239
+103. 25decf42-91d1-4ec4-9603-abfa9a5afa4c
+104. ea19ed4e-abfb-462b-ba90-a1294c4e53b7
+105. 4bfeadcc-95e7-439f-9f4f-046892382991
+106. 6a82b514-f7e9-4ea1-8f82-79d181a015f0
+107. e745de17-6139-4847-842c-008ba60acb0b
+108. c3ab3ff7-cd3f-4c83-8aa0-a033502b46e2
+109. a1b9ba37-5230-4956-a820-46a273c35bb8
+110. 52387327-01ee-4f4c-8a91-1833e0d19fa0
+111. d98edc3e-895e-4d01-a505-f94c1d6cf4e4
+112. ec72b2e1-93d2-43e4-b6d3-501b4a3e7654
+113. 7e2ad2bd-4421-4762-995b-d1941fe7e876
+114. dab25b3b-6cce-4ca2-91eb-2eb0e11b55b3
+115. ae16df43-402d-4765-9249-89fcbc5188a8
+116. 0a56c626-a169-4100-b932-3fdef9141079
+117. 25711d01-9228-4f9c-ae13-86f774c6e179
+118. dfb72410-9208-4e69-9252-1c8b56e2b052
+119. 571eaa38-4c6f-49cd-bb7d-cccd4b9e913e
+120. d8ba2cf4-1a32-40fd-8171-28fa53c1b269
+121. 749292ea-db2e-4db5-a952-18c0e71cdcaf
+122. b7a0a1d9-4032-40e7-8fe5-2219a04bb14b
+123. 9af40fa8-9e35-4fd4-b879-869e8da3b88d
+124. 8352d9ad-3e2e-4b67-aff2-65b8c046d82e
+125. 509e61d2-8b47-4c5d-8bd8-b3bc6d0eb8b0
+126. e415e315-b647-4e1b-bb14-aaff11923410
+127. 9ec998e4-d655-40a3-bedc-4291efa781da
+128. b3a3d295-a987-4442-9396-646909aaf2cc
+129. 0037ae45-5623-4c34-8482-4f2b0d0c1e65
+130. 4cc5ae3c-b317-43b8-bed4-8b0dd8c4bed0
+131. 5562ebf3-8df6-426a-8bcb-a7a25a57bcae
+132. feaa277c-6f8d-41c7-a3e6-00c76b9e6077
+133. 65e4a317-42c4-44a5-9c2a-b9261c2494ea
+134. 0799db74-2799-412b-9109-118933312560
+135. a91f601f-caab-4d7f-a874-f1ec883d90c2
+136. 017e1b31-e568-4f8a-8887-99b7b3743fbd
+137. 3301ab55-ae27-4713-ab25-f553e27a927d
+138. f3a9549e-6bea-4912-9d22-6e92f488544a
+139. e7d69120-5877-4212-bbd9-f4623f9fbe8d
+140. ccf2adcf-d816-41f9-8733-33d58b5f2a5a
+141. 1a579cb8-c2fd-4386-9676-de421c4837a4
+142. 43f026b9-e09c-4b4c-913b-e1e3d2e7c1cc
+143. b8737099-63a3-4771-b0c1-3ad57c195d37
+144. aae9711c-7ef2-45c5-89e8-8913518b0b36
+145. 1dbc21aa-64cd-4ce8-a150-9d1c1f986b51
+146. 449b9684-511f-4cd5-b610-51d9168ae8b1
+147. 89ca7227-4fab-483a-9682-fe0d619dd216
+148. 197b78b6-7a54-4a59-be80-2c84bb8811b3
+149. af95ddc9-3821-411d-8c6e-cd78785e7b56
+150. c600a1cc-9965-4bb1-8494-ef9d0f4abff5
+151. 694837db-f956-4772-a8ce-edfbfde6ff25
+152. ed6b74c2-2f43-42bb-ab4e-4be2957fbe1a
+153. a47381c8-3369-4830-bb9f-97643f8a1fa9
+154. 2733d133-0703-4648-9ef5-373a0beda5ac
+155. ad806245-df11-4bf2-89dc-195294083141
+156. 8492943f-de1c-4b34-b49c-2779ea5af3a7
+157. 2364d4d2-b9c0-4d0a-a9e5-c9b4e38c9e24
+158. 9889efba-a977-4d5b-9f3b-9a98f8e8e6e2
+159. 36ce676b-63a1-471f-b1ea-1e755ccc7631
+160. 977e26db-ed39-405a-b007-0c2b2bf43625
+161. 9ff654b7-3b09-43bf-97fc-2acd4d308aa1
+162. 1809a02d-3970-4951-bef3-acf7884a402c
+163. 25602879-7ad0-41f3-a8cb-635c2996ce4c
+164. adda3d47-377d-4a19-9d3e-abff09dc2c67
+165. 0c83fa5e-d271-4ebb-a438-840cb074c7a0
+166. c1f7ba6e-b22b-4850-ba21-ae231da31f6b
+167. 8568a74e-843b-45d0-9a30-582b8c8e9c59
+168. 6ffbeb12-8639-4d97-9988-a73360cddffc
+169. f3598b23-0741-499d-9bcd-ed1a1d3edae7
+170. 3b3492ff-b0a8-4341-943a-c44a6bb11f27
+171. 2701fec9-0693-4463-9599-befc09ce987a
+172. dc728f2f-c057-4f8f-b690-9646d69b6e41
+173. cb9569ab-d12e-4fc1-a905-0347868f0519
+174. 30fb9248-4cb8-4f51-add3-c7914ae34bfe
+175. 4a669209-cab6-4800-85aa-a6de510ed81c
+176. d5f81043-7cd9-4ab1-8247-40907be973bb
+177. 7b23f2a5-db14-4e25-81b9-4449f0c26b32
+178. 8768a814-e3e8-4396-a7e1-32440ec34c17
+179. 697e96ef-bcff-4097-8bbd-ee3a8beb5be7
+180. dc0ab926-196d-4d8b-8bed-0d842550c13b
+181. 53ea2b69-8c9a-4511-80ed-2142f1964d0a
+182. f38e6218-37e4-43af-85f5-a27acef5d8be
+183. cc19ab8d-a7af-446b-8d8a-1155b4b52851
+184. a6890790-ff42-402f-9352-792eea1a1f30
+185. 19124697-b4ba-4e67-b846-28c2f6cd2d09
+186. 57e9443a-7577-4e74-a32f-5ad71cccefe6
+187. 4899e4f1-a0b9-46f8-a09b-cf0420e88444
+188. 0f06b2f6-6fdf-4398-8071-d62d9520d3d3
+189. 50476641-9902-411a-b664-52d233e16040
+190. 2ea035c3-c362-44f3-9824-2dbbfcd32f41
+191. 77a582c6-046c-4a66-93fd-5315f0bca09f
+192. 3f1682d0-f6bc-4d0d-a335-d30ab3dc267b
+193. 14d6c743-69f1-4c5a-87c9-a666eb611f72
+194. fde1c6c1-905f-4785-829c-26925ad38d50
+195. fd17032e-c76a-476b-818b-0697f70cfd12
+196. 2ba10acf-ef65-4954-901d-485082c78259
+197. cf805a2d-030d-4fc0-a2a8-33c5096ac68e
+198. f7439f89-4b23-4f9d-b610-f5bfa276275c
+199. 0c1b58bc-2d78-4a3b-9cf5-f971da929379
+200. 96c4ae13-3927-4023-8c8f-9a77e9dd46a1
diff --git a/Yixuan/0001/code.py b/Yixuan/0001/code.py
new file mode 100644
index 00000000..a66f192b
--- /dev/null
+++ b/Yixuan/0001/code.py
@@ -0,0 +1,8 @@
+import uuid
+
+i = 1
+while (i < 201):
+ f = open('code.md', 'ar+')
+ s = str(i)+". "+str(uuid.uuid4())
+ f.write(s+"\n")
+ i +=1
diff --git a/Yixuan/0001/workfile b/Yixuan/0001/workfile
new file mode 100644
index 00000000..e69de29b
diff --git a/ZsnnsZ/README.md b/ZsnnsZ/README.md
new file mode 100644
index 00000000..5ab9e5dc
--- /dev/null
+++ b/ZsnnsZ/README.md
@@ -0,0 +1,2 @@
+提交项目地址,问题基本全部解决:
+https://github.com/ZsnnsZ/show-you-my-code
diff --git a/acwong00/0000/Thumbs.db b/acwong00/0000/Thumbs.db
new file mode 100644
index 00000000..ba98f0e9
Binary files /dev/null and b/acwong00/0000/Thumbs.db differ
diff --git a/acwong00/0000/msyh.ttf b/acwong00/0000/msyh.ttf
new file mode 100644
index 00000000..aa23ae1f
Binary files /dev/null and b/acwong00/0000/msyh.ttf differ
diff --git a/acwong00/0000/test.py b/acwong00/0000/test.py
new file mode 100644
index 00000000..1b9d3238
--- /dev/null
+++ b/acwong00/0000/test.py
@@ -0,0 +1,11 @@
+from PIL import Image, ImageDraw, ImageFont
+
+original = Image.open("acwong.jpg")
+
+fnt = ImageFont.truetype("msyh.ttf", 80)
+
+d = ImageDraw.Draw(original)
+
+d.text((200, 0), "6", font=fnt, fill=(255,0,0,255))
+
+original.save("finnal.jpg")
diff --git a/agmcs/0000/0000.py b/agmcs/0000/0000.py
new file mode 100644
index 00000000..490360d5
--- /dev/null
+++ b/agmcs/0000/0000.py
@@ -0,0 +1,14 @@
+from PIL import Image, ImageDraw, ImageFont
+text = "52"
+im = Image.open('1.bmp')
+w,h = im.size
+font_size = h//4
+
+draw = ImageDraw.Draw(im)
+font = ImageFont.truetype ("Arial.ttf",font_size)
+
+text_w,text_h = draw.textsize(text,font=font)
+draw.text((w-text_w,0), text, fill=(255,0,0), font=font)
+
+
+im.save('heihei.bmp')
diff --git a/agmcs/0000/1.bmp b/agmcs/0000/1.bmp
new file mode 100644
index 00000000..f1a75611
Binary files /dev/null and b/agmcs/0000/1.bmp differ
diff --git a/agmcs/0000/Thumbs.db b/agmcs/0000/Thumbs.db
new file mode 100644
index 00000000..c7d981d6
Binary files /dev/null and b/agmcs/0000/Thumbs.db differ
diff --git a/agmcs/0000/heihei.bmp b/agmcs/0000/heihei.bmp
new file mode 100644
index 00000000..6efddc96
Binary files /dev/null and b/agmcs/0000/heihei.bmp differ
diff --git a/agmcs/0001/0001.py b/agmcs/0001/0001.py
new file mode 100644
index 00000000..fed352ee
--- /dev/null
+++ b/agmcs/0001/0001.py
@@ -0,0 +1,6 @@
+import uuid
+
+uuids = []
+for i in range(200):
+ uuids.append(uuid.uuid1())
+print uuids
diff --git a/agmcs/0004/0004.py b/agmcs/0004/0004.py
new file mode 100644
index 00000000..810fb349
--- /dev/null
+++ b/agmcs/0004/0004.py
@@ -0,0 +1,5 @@
+import re
+with open('test.txt','r')as f:
+ data = f.read()
+result = re.split(r"[^a-zA-Z]",data)
+print len([x for x in result if x!= ''])
diff --git a/agmcs/0004/test.txt b/agmcs/0004/test.txt
new file mode 100644
index 00000000..a470e2f8
--- /dev/null
+++ b/agmcs/0004/test.txt
@@ -0,0 +1 @@
+Henry was a pen name used by an American writer of short stories. His real name was William Sydney Porter. He was born in North Carolina in 1862. As a young boy he lived an exciting life. He did not go to school for very long, but he managed to teach himself everything he needed to know. When he was about 20 years old, O. Henry went to Texas, where he tried different jobs. He first worked on a newspaper, and then had a job in a bank, when some money went missing from the bank O. Henry was believed to have stolen it. Because of that, he was sent to prison. During the three years in prison, he learned to write short stories. After he got out of prison, he went to New York and continued writing. He wrote mostly about New York and the life of the poor there. People liked his stories, because simple as the tales were, they would finish with a sudden change at the end, to the readers surprise.
diff --git a/agmcs/0005/0005.py b/agmcs/0005/0005.py
new file mode 100644
index 00000000..2c19c85a
--- /dev/null
+++ b/agmcs/0005/0005.py
@@ -0,0 +1,26 @@
+import os
+from PIL import Image
+
+def resize(path):
+ im = Image.open(path)
+ w,h = im.size
+ if w>640:
+ x = w/640.0
+ w=640
+ h = int(h//x)
+ if h>1136:
+ x = h/1136.0
+ h=1136
+ w = int(w//x)
+ print w,h
+ im = im.resize((w,h),Image.ANTIALIAS)
+ im.show()
+ im.save(path)
+
+path = 'img/'
+dirlist = os.listdir(path)
+
+for img in dirlist:
+ abspath = os.path.join(path,img)
+ if os.path.isfile(abspath):
+ resize(abspath)
diff --git a/agmcs/0006/0006.py b/agmcs/0006/0006.py
new file mode 100644
index 00000000..0192483c
--- /dev/null
+++ b/agmcs/0006/0006.py
@@ -0,0 +1,16 @@
+import os,re
+path = 'test/'
+dirlist = os.listdir(path)
+
+for x in dirlist:
+ abspath = os.path.join(path,x)
+ if os.path.isfile(abspath):
+ if os.path.splitext(abspath)[1] == '.txt':
+ with open(abspath,'r')as f:
+ data = f.read()
+ result = re.split(r'[^a-zA-Z]', data)
+ words = [x for x in result if x!='']
+ items = dict([(i,words.count(i)) for i in words])
+ items = sorted(items.iteritems(),key =lambda d:d[1],reverse = True)
+ print abspath,'中出现最多的是',items[0][0],'出现了',items[0][1],'次',',其次是',items[1][0],'出现了',items[1][1],'次'
+
diff --git a/agmcs/0006/test/China sends fresh water to Maldives.txt b/agmcs/0006/test/China sends fresh water to Maldives.txt
new file mode 100644
index 00000000..94c29f24
--- /dev/null
+++ b/agmcs/0006/test/China sends fresh water to Maldives.txt
@@ -0,0 +1,12 @@
+BEIJING - China will ship about 1,000 tons fresh water to water-starved Maldives via plane and vessel, according to Chinese Foreign Ministry and Defence Ministry on Saturday evening.
+
+About 150,000 residents are faced with water scarcity in Male, capital of Maldives, as a fire at the Maldives Water and Sewage Company damaged some of the company's equipments and forced suspension of water supply to Male on Thursday.
+
+In response to Maldivian government's request, China has provided emergency aid in cash and drinking water to the country, Chinese Foreign Ministry said.
+
+China has arranged delivery of bottled water in two Chinese civil aircrafts to Male. The first plane has arrived with 12 tons bottled water at 6 am Saturday morning local time, while the second one with eight tons will get there on Saturday night, Chinese foreign ministry said, adding that more water will be sent.
+
+An ocean rescue vessel of the Chinese navy suspended its escort mission and headed for Male port at 9 p.m. on Friday. With 960 tons fresh water and seawater desalting facility on board, the vessel is scheduled to arrive at the destination at 3 a.m. on Monday, Chinese Defense Ministry said.
+
+Aircrafts of Chinese air force have been ready for urgent rescue mission, and the Chinese side is applying for air route with relevant countries, the defense ministry added.
+
diff --git a/agmcs/0006/test/China's position paper on South China Sea.txt b/agmcs/0006/test/China's position paper on South China Sea.txt
new file mode 100644
index 00000000..77fec60e
--- /dev/null
+++ b/agmcs/0006/test/China's position paper on South China Sea.txt
@@ -0,0 +1,21 @@
+BEIJING - The Chinese foreign ministry was authorized to release on Sunday a position paper of the government on the matter of jurisdiction in the South China Sea arbitration initiated by the Republic of the Philippines. The following is a translated version of the full text of the position paper:
+
+Position Paper of the Government of the People' s Republic of China on the Matter of Jurisdiction in the South China Sea Arbitration Initiated by the Republic of the Philippines
+
+7 December 2014
+
+I. Introduction
+
+1. On 22 January 2013, the Department of Foreign Affairs of the Republic of the Philippines presented a note verbale to the Embassy of the People' s Republic of China in the Philippines, stating that the Philippines submitted a Notification and Statement of Claim in order to initiate compulsory arbitration proceedings under Article 287 and Annex VII of the United Nations Convention on the Law of the Sea ( "Convention" ) with respect to the dispute with China over "maritime jurisdiction" in the South China Sea. On 19 February 2013, the Chinese Government rejected and returned the Philippines' note verbale together with the attached Notification and Statement of Claim. The Chinese Government has subsequently reiterated that it will neither accept nor participate in the arbitration thus initiated by the Philippines.
+
+2. This Position Paper is intended to demonstrate that the arbitral tribunal established at the request of the Philippines for the present arbitration ( "Arbitral Tribunal" ) does not have jurisdiction over this case. It does not express any position on the substantive issues related to the subject-matter of the arbitration initiated by the Philippines. No acceptance by China is signified in this Position Paper of the views or claims advanced by the Philippines, whether or not they are referred to herein. Nor shall this Position Paper be regarded as China' s acceptance of or participation in this arbitration.
+
+3. This Position Paper will elaborate on the following positions:
+
+The essence of the subject-matter of the arbitration is the territorial sovereignty over several maritime features in the South China Sea, which is beyond the scope of the Convention and does not concern the interpretation or application of the Convention;
+
+China and the Philippines have agreed, through bilateral instruments and the Declaration on the Conduct of Parties in the South China Sea, to settle their relevant disputes through negotiations. By unilaterally initiating the present arbitration, the Philippines has breached its obligation under international law;
+
+Even assuming, arguendo, that the subject-matter of the arbitration were concerned with the interpretation or application of the Convention, that subject-matter would constitute an integral part of maritime delimitation between the two countries, thus falling within the scope of the declaration filed by China in 2006 in accordance with the Convention, which excludes, inter alia, disputes concerning maritime delimitation from compulsory arbitration and other compulsory dispute settlement procedures;
+
+Consequently, the Arbitral Tribunal manifestly has no jurisdiction over the present arbitration. Based on the foregoing positions and by virtue of the freedom of every State to choose the means of dispute settlement, China' s rejection of and non-participation in the present arbitration stand on solid ground in international law.
diff --git a/agmcs/0006/test/President Xi demands accelerated FTA strategy.txt b/agmcs/0006/test/President Xi demands accelerated FTA strategy.txt
new file mode 100644
index 00000000..d9b2bf6e
--- /dev/null
+++ b/agmcs/0006/test/President Xi demands accelerated FTA strategy.txt
@@ -0,0 +1,26 @@
+BEIJING - President Xi Jinping on Friday called for accelerated fulfillment of the free trade area (FTA) strategy and the building of a new economic system of openness.
+
+The remarks, published on Saturday, were made at a meeting of the Political Bureau of the Communist Party of China (CPC) Central Committee on Friday.
+
+The FTA strategy is an important part of China's new round of opening-up, Xi said. Multilateral trade systems and regional trade arrangements have always been the driving force behind economic globalization.
+
+Global trade is experiencing the largest change since the Uruguay round of trade talks in 1994, Xi said.
+
+As the economy is entering its "new normal", China needs even more opening-up to address problems in economic and social development, he added.
+
+China must accelerate the FTA strategy and make FTAs play a bigger role in trade and investment, he said.
+
+Accelerating the FTA strategy is an important way for China to actively participate in the rule-making of international economic and trade areas, he added.
+
+We can not just be spectators and followers, but should participate and lead, make China's voice heard and inject more Chinese elements into the international rules, he said.
+
+In recent years, China has been pushing forward opening-up, having signed numerous free trade agreements with more than 20 countries or regions.
+
+Top-level design and planning must be improved to set up a network of FTAs, "which has a foothold in neighboring regions, and radiates across the 'Belt and Road Initiatives', to face the world," the President said.
+
+The number of its FTAs needs to increase, but more attention must be paid to the quality of these FTAs with more emphasis on risk and risk assessment. Market-oriented reform will create a law-based business environment, and economic restructuring should move faster, according to the President.
+
+Xi highlighted the importance of equitable, open and transparent market rules and international competitiveness of the service sector.
+
+The President also wants to see better mechanisms and policies governing Chinese companies overseas.
+
diff --git a/agmcs/0007/0007.py b/agmcs/0007/0007.py
new file mode 100644
index 00000000..f69f5eb3
--- /dev/null
+++ b/agmcs/0007/0007.py
@@ -0,0 +1,37 @@
+import os, re
+
+path = '\..'
+blank = 0
+comment = 0
+total = 0
+
+def getline(path):
+ global blank
+ global comment
+ global total
+ with open(path,'r')as f:
+ data = f.readlines()
+ for x in data:
+ if x == '\n':
+ blank += 1
+ if x.find('#')!= -1:
+ if re.search("\'.*?#.*?\'",x) or re.search("\".*?#.*?\"",x):
+ pass
+ else:
+ comment += 1
+ total += 1
+
+def getfile(path):
+ abspath = os.path.abspath(path)
+ dirlist = os.listdir(abspath)
+ for x in dirlist:
+ curpath = os.path.join(abspath,x)
+ if os.path.isfile(curpath):
+ if os.path.splitext(curpath)[1] == '.py':
+ getline(curpath)
+ else:
+ getfile(curpath)
+
+getfile('..')
+
+print "total:%d, comment:%d, blank:%d"%(total,comment,blank)
diff --git a/agmcs/0009/0009.py b/agmcs/0009/0009.py
new file mode 100644
index 00000000..1f3b609e
--- /dev/null
+++ b/agmcs/0009/0009.py
@@ -0,0 +1,11 @@
+#coding:utf-8
+import re
+
+with open('1.html','rb')as f:
+ data = f.read()
+
+data = data.replace('\r','').replace('\b','').replace('\n','')
+find = re.compile(r'href="(.*?)"')
+result = find.findall(data)
+for x in result:
+ print x
diff --git a/agmcs/0009/1.html b/agmcs/0009/1.html
new file mode 100644
index 00000000..6a4b4121
--- /dev/null
+++ b/agmcs/0009/1.html
@@ -0,0 +1,3 @@
+
+
+
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>