模式一:
压缩加密摘要
AnyFile.zip
3DES Algorithm
AnyFile.zip*
SHA-1 Algorithm.
Simple Dream Easy Go~
模式一:
压缩加密摘要
AnyFile.zip
3DES Algorithm
AnyFile.zip*
SHA-1 Algorithm.
I gonna write a Sudoku generator and solver using Python.
It'll be fun~ I mean if the program is used as part of the Maths Culture Festival.
--------------------------
Before we start, see some reference.
Sudoku完整的需求文档 明天抽空给出:)『Before 12:00 AM』
Python学习的计划不变,坚持就是胜利。
Tutorial 看完后要注意回顾一遍,写一个心得;
附明天的任务:
Day Five[6:00PM TO 11:00PM]
—————————————————————–
--------------------------------------------------------------------------------
除此之外:
参考Java安全,写出Mock Bank的加密和解密的真实用例Demo.『1:00 PM To 3:00PM
Packages are a way of structuring Python's module namespace by using ``dotted module names''.
Note that when using from package import item, the item can be either a submodule (or subpackage) of the package, or some other name defined in the package, like a function, class or variable. The import statement first tests whether the item is defined in the package; if not, it assumes it is a module and attempts to load it. If it fails to find it, an ImportError exception is raised.
Some Notice:
Now what happens when the user writes from sound.effects import *? Ideally, one would hope that this somehow goes out to the filesystem, finds which submodules are present in the package, and imports them all. Unfortunately, this operation does not work very well on Windows platforms, where the filesystem does not always have accurate information about the case of a filename! On these platforms, there is no guaranteed way to know whether a file ECHO.PY should be imported as a module echo, Echo or ECHO. (For example, Windows 95 has the annoying practice of showing all file names with a capitalized first letter.) The DOS 8+3 filename restriction adds another interesting problem for long module names.
Packages support one more special attribute, __path__. This is initialized to be a list containing the name of the directory holding the package's __init__.py before the code in that file is executed. This variable can be modified; doing so affects future searches for modules and subpackages contained in the package.
While this feature is not often needed, it can be used to extend the set of modules found in a package.
有一根27厘米的细木杆,在第3厘米、7厘米、11厘米、17厘米、23厘米这五个位置上各有一只蚂蚁。 木杆很细,不能同时通过一只蚂蚁。开始 时,蚂蚁的头朝左还是朝右是任意的,它们只会朝前走或调头,但不会后退。当任意两只蚂蚁碰头时,两只蚂蚁会同时调头朝反方向走。假设蚂蚁们每秒钟可以走一厘米的距离。 编写程序,求所有蚂蚁都离开木杆的最小时间和最大时间。
----------------------------------------------------
*** 最笨的方法当然是把蚂蚁看成一个一个的去遍历左右; // 还真有人这么写
*** 然后好一点的方法是递归:
类似这种:http://blog.csdn.net/andylin02/archive/2007/07/27/1711701.aspx
就不贴代码了
*** 最简单的方法当时是“禅”啦
| Python代码: |
| def f(x):return 27-x a=[3,7,11,17,23] b=map(f,a) print 'max:',max(max(a),max(b)) print 'min:',max(min(a[x],b[x]) for x in range(0,5)) |
那你看,万生在人海穿梭,相遇又回头:如果把这个过程想象成我继续走,他继续走;
我穿着他的躯壳,他穿着我的躯壳,那岂不等同于我们没有相识
所以
要算最长的的时间 就是初始状况下 蚂蚁离距离它最远的那个边的最大值。
要算最少的时间 就是所有蚂蚁中最后一只走出来的时间,就是每个蚂蚁都朝着离自己近的一个端点爬,然后这些时间中最大的一个。
上面是一段简单的草稿代码 就么的注释了。
缘分那。。缘分。。

Zen,大抵是西洋文音译“禅”字而来,什么是禅呢?
“言语道断,心行处灭”。必须要理解的东西是禅的不可理解,剩下的东西都是可以不理解的。当你理解了禅的不可理解性,那么就姑且算是入了一个门的吧。
我取的花名是“空山”,本意源于“空山新雨后”,然而细细品味竟然全不是一幅动态的竹喧浣女、莲动渔舟之意境。更多是一种随意世界的意味。这里我们发现中国的禅宗和其本源地印度的禅完全是很不一样的两个东西。
这点从两者修行的过程和目的上就明显的表现出来:Yoga是一种对肉体极限的挑战或者是压迫来达到心灵的静谧,而中国的禅则更多的有几分老庄的特点,主要采用Zazen的方式来游离精神。这种纯粹出于内省性的悟道方式和老庄的“坐忘”“心斋”“朝彻”并无本质上的区别。
所以空山Empty mountain 也是一种放逐肉体而不是压制肉体,通过对内心的释放而参悟真谛的过程。“青青翠竹无非般若,郁郁黄花皆是妙谛。”人到禅时 则看什么都有禅味,大彻大悟的往往都是由平凡起而止于平凡的东西。奈何奈何奈若何,如此如此不过如此。禅道实际是一种幽默,一种玄机的幽默。生活总是有问题,并且总是很多问题。然后发现问题的人便叫有眼光,解决问题的人叫做有智慧。在我们学习的那么多的学科中能解决无限的问题的学科极少,CS不过是在一个充满了漏洞的空间上,用一种比较精确的方式去丑陋的模仿人的思维,Phsics则是从一种“我认为的”角度上看起来严密的推导一些基于既定的假设而得出的结论,Chemistry则从一种现象和无数遍重复的事件里去猜测结论,数学是唯一一门接近严密的,能真正处理无限的科学学科。而这种严密,这种禅味十足的精确,对于落后于精神无数年的现实科学而言都是过分奢侈的。
数学游离了科学的肉体,大彻大悟了一段禅道然后实而还是空山一段,最多取悦了参禅者的心灵。和无穷大和无穷小打交道,这种幸福的事情大抵只有禅家和数学家做的到。但这种自得其乐似的禅道怎么能解释给众生,才是大师该做的事情。
----------------------------------------
以上只不过源于在读 Zen of Python 时候的一点遐想
最后附上 Python的禅(节选):
The Zen of Python
慢!
繁琐!
无接口!
没有自由!
不能贴代码!
莫名脚本错误!
风格越发校内化!
SNS不是抄袭抄袭!
还是wordpress好用!
ycool数据写成xml不标准!
备份的都是一些string流鸡肋!...
In this day, My plan is to understand how to build the normal Data Structure by Python.
Start Form List:
| x) |
| L) |
| i, x) |
| x) |
| [i]) |
| x) |
| x) |
| ) |
| ) |
we can use list as stack or queue very conveniently.
Is that all? Nope, there are some other build-in functions which are very usefull when used with lists: that is filter( ), map( ), reduce( ).
"filter(function, sequence)" returns a sequence consisting of those items from the sequence for which function(item) is true. If sequence is a string or tuple, the result will be of the same type; otherwise, it is always a list.
Example:
>>> def f(x): return x % 2 != 0 and x % 3 != 0 ... >>> filter(f, range(2, 25)) [5, 7, 11, 13, 17, 19, 23]
"map(function, sequence)" calls function(item) for each of the sequence's items and returns a list of the return values. For example, to compute some cubes:
>>> def cube(x): return x*x*x ... >>> map(cube, range(1, 11)) [1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]
More than one sequence may be passed; the function must then have as many arguments as there are sequences and is called with the corresponding item from each sequence (or None if some sequence is shorter than another). For example:
>>> seq = range(8) >>> def add(x, y): return x+y ... >>> map(add, seq, seq) [0, 2, 4, 6, 8, 10, 12, 14]
"reduce(function, sequence)" returns a single value constructed by calling the binary function function on the first two items of the sequence, then on the result and the next item, and so on. For example, to compute the sum of the numbers 1 through 10:
>>> def add(x,y): return x+y ... >>> reduce(add, range(1, 11)) 55
If there's only one item in the sequence, its value is returned; if the sequence is empty, an exception is raised.
LIST Comprehensions provides a more derect way to generate a list.
>>> [str(round(355/113.0, i)) for i in range(1,6)] ['3.1', '3.14', '3.142', '3.1416', '3.14159']
Use del L to delete a list or del L[index] to delete some elements of a list.
About Tuble
See some illustrations from Dive Into Python
A tuple is an immutable list. A tuple can not be changed in any way once it is created.
>>> t = ("a", "b", "mpilgrim", "z", "example")>>> t ('a', 'b', 'mpilgrim', 'z', 'example') >>> t[0]
'a' >>> t[-1]
'example' >>> t[1:3]
('b', 'mpilgrim')
>>> t ('a', 'b', 'mpilgrim', 'z', 'example') >>> t.append("new")Traceback (innermost last): File "<interactive input>", line 1, in ? AttributeError: 'tuple' object has no attribute 'append' >>> t.remove("z")
Traceback (innermost last): File "<interactive input>", line 1, in ? AttributeError: 'tuple' object has no attribute 'remove' >>> t.index("example")
Traceback (innermost last): File "<interactive input>", line 1, in ? AttributeError: 'tuple' object has no attribute 'index' >>> "z" in t
True
So what are tuples good for?
| Tuples can be converted into lists, and vice-versa. The built-in tuple function takes a list and returns a tuple with the same elements, and the list function takes a tuple and returns a list. In effect, tuple freezes a list, and list thaws a tuple. | |
Set:
Python also includes a data type for sets. A set is an unordered collection with no duplicate elements. Basic uses include membership testing and eliminating duplicate entries. Set objects also support mathematical operations like union, intersection, difference, and symmetric difference.
A set gonna be faster to execute member test. and what's more two sets can + - | & ^ (letters in a or b but not both)
Dictionary:
The dictionary in Python is actruly the same as a hash table, like " associative memories'' or "associative arrays''.
The keys() method of a dictionary object returns a list of all the keys used in the dictionary, in arbitrary order (if you want it sorted, just apply the sort() method to the list of keys). To check whether a single key is in the dictionary, either use the dictionary's has_key() method or the in keyword.
The dict() constructor builds dictionaries directly from lists of key-value pairs stored as tuples. When the pairs form a pattern, list comprehensions can compactly specify the key-value list.
Loop:
When looping through dictionaries, the key and corresponding value can be retrieved at the same time using the iteritems() method.
>>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}
>>> for k, v in knights.iteritems():
... print k, v
...
gallahad the pure
robin the brave
When looping through a sequence, the position index and corresponding value can be retrieved at the same time using the enumerate() function.
>>> for i, v in enumerate(['tic', 'tac', 'toe']): ... print i, v ... 0 tic 1 tac 2 toe
To loop over two or more sequences at the same time, the entries can be paired with the zip() function.
>>> questions = ['name', 'quest', 'favorite color'] >>> answers = ['lancelot', 'the holy grail', 'blue'] >>> for q, a in zip(questions, answers): ... print 'What is your %s? It is %s.' % (q, a) ... What is your name? It is lancelot. What is your quest? It is the holy grail. What is your favorite color? It is blue.
To loop over a sequence in reverse, first specify the sequence in a forward direction and then call the reversed() function.
>>> for i in reversed(xrange(1,10,2)): ... print i ... 9 7 5 3 1
To loop over a sequence in sorted order, use the sorted() function which returns a new sorted list while leaving the source unaltered.
>>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> for f in sorted(set(basket)): ... print f ... apple banana orange pear
Tips about comparations
The Boolean operators and and or are so-called short-circuit operators: their arguments are evaluated from left to right, and evaluation stops as soon as the outcome is determined. For example, if A and C are true but B is false, A and B and C does not evaluate the expression C. When used as a general value and not as a Boolean, the return value of a short-circuit operator is the last evaluated argument.
Note that in Python, unlike C, assignment cannot occur inside expressions. C programmers may grumble about this, but it avoids a common class of problems encountered in C programs: typing = in an expression when == was intended.
too sequence can be compared with each other. like any dictionary.

新! 谷歌人肉搜索招聘志愿者
人肉搜索与刺青、美白、护肤、减肥等直接在人肉上施行的种种行为无关。顾名思义,人肉搜索就是利用现代信息科技,变传统的网络信息搜索为人找人,人问人,人碰人,人挤人、人挨人的关系型网络社区活动,变枯燥乏味的查询过程为一人提问、八方回应,一石激起千层浪,一声呼唤惊醒万颗真心的人性化搜索体验。人肉搜索不仅可以在最短时间内揭露某某门背后的真相,为某三某七找到大众认可的道德定位,还可以在网络无法触及的地方,探寻并发现最美丽的丛林少女,最感人的高山牧民,最神秘的荒漠洞窟,最浪漫的终极邂逅…… 人肉搜索追求的最高目标是:不求最好,但求最肉。

谷歌自进入中国市场以来,一直致力于根据本地需求改进用户的搜索体验。谷歌很早就意识到,自发的、分散的、有意或无意的人肉搜索行为早在中国互联网诞生之初就存在并茁壮成长着。中国互联网界发生的几乎每一起重大事件,尤其是娱乐性事件,都有可能成为人肉搜索技术的试金石。为了丰富人民群众的业余文化生活,为了使广大网民在最短时间内赶超人肉搜索的世界水平,谷歌决定投入巨资打造亚太地区最大的人肉搜索引擎。
组织和领导以志愿者为核心的超大规模人肉搜索团队,整合来自数千万搜索志愿者的小道消息,从茫茫人海中发掘信息背后的奥秘。严格管理,制止人肉搜索过程中可能出现的扯皮、造假、谣传、起哄、攻讦、谩骂等不文明行为,创造合理、有序、创新、务实的人肉搜索新秩序。
能力要求:
请将您的中英文简历以文本或HTML的格式发至renrou-jobs@google.com, 并在邮件的标题中注明“人肉搜索志愿者管理专员”。邮件正文请使用中文,所有英文信息请以附件形式提交。
在业余时间为人肉搜索引擎奉献智慧、汗水和好心情。利用谷歌研发的人肉搜索平台,与其他数千万志愿者并肩工作,使用并行人肉计算的方式,对疑难问题坚持不动摇、不软弱、不抛弃、不放弃的肉骨茶原则,为广大网民提供第一手的,带有人情味儿的,具有震撼力和可传播性的搜索结果。
能力要求:
请将您的中英文简历以文本或HTML的格式发至renrou-jobs@google.com, 并在邮件的标题中注明“人肉搜索志愿者(兼职)”。邮件正文请使用中文,所有英文信息请以附件形式提交。
用人肉搜索的方法解释人肉搜索
“一个老虎, n 个武松”,这是天涯问答上关于“人肉搜索”的解释之一。今天回过头来想这个项目的时候,最有趣的是不同“工种”的 Googler 们热情的提交他们眼中的“人肉搜索”,严丝合缝的工程师、追求完美的 UI 设计师以及爱写诗的 Googler……
天涯问答的版本
……人肉搜索就是汇聚网民的力量来寻知答案的搜索方式。……
其实,我最喜欢的天涯问答上的版本是“人肉搜索就是一个老虎, N 个武松。”我觉得这个非常符合今天愚人节的欢乐氛围。所以,特地挑了它来做博客的标题。
漫无边际的诗人 Googler 版本:
没人没乐趣,有人有真谛
组织和领导以志愿者为核心的超大规模人肉搜索团队,整合来自数千万搜索志愿者的小道消息,从茫茫人海中发掘信息背后的奥秘。严格管理,制止人肉搜索过程中可能出现的扯皮、造假、谣传、起哄、攻讦、谩骂等不文明行为,创造合理、有序、创新、务实的人肉搜索新秩序。
追求美的UI 设计师版本:
谷歌人肉搜索是谷歌中国工程师历时三年开发推出的新一代网络搜索服务。它利用谷歌先进技术,变传统的机械化网络信息搜索过程为人找人、人问人、人碰人、人挤人、人挨人的关系型网络社区活动,给您带来全新的人性化搜索体验。
我们的搜索结果排序纯由人肉决定,绝无机器干预。只要您在谷歌人肉搜索中输入您想了解的问题,我们遍布全球各地的 googol 名志愿者就会为您开展一场查找信息的人民战争,并使用并行人肉计算的方法决定搜索结果的排序。
无论是您想了解某某门的背后真相,还是想知道……,甚至是要找到您家中走失的小强——谷歌人肉搜索都能保证让您在最短时间内得到答案。
严丝合缝的工程师版本
谷歌的“人肉搜索”并不掺杂有猎奇、宣泄或道德批判的成分,从技术角度来看,其核心理念是“人机整合搜索”,就是把人的因素,包括人的智慧,人的社会关系,人对于信息的认知能力、采集能力、解析能力和组织能力,以及人的价值观和道德取向整合进谷歌现有的高度自动化的网络信息搜索流程中,从本质上提高搜索引擎对于不同形式、不同来源、不同内涵的信息的采集、挖掘和索引能力,使搜索引擎可以在 极短的时间内,完整地收集所有突发事件、热点新闻、情感故事、网络聚焦、真情流露等非传统意义上的信息内容,并以最为人性化和最深入的方式分析信息内部的深层含义,挖掘事件背后的本源,探寻思想深处的真实。从表面上看,用户在谷歌得到的仍然是快速响应的搜索服务,但根据用户查询内容的不同,搜索结果中将包含人性化的、由志愿者与社区群体贡献的、经自动化搜索引擎客观评估并引入的信息内容。
人机整合搜索可以将作为群体的人类情感与道德因素引入搜索引擎,使得原本“冷冰冰”的搜索结果变得越来越人性化,越来越符合绝大多数人的信息以及情感需要,这种整合技术只会让搜索结果更加公平,更加合情合理。从技术上说,人机整合搜索使用目前最先进的群体行为评价与分析算法,能够切实保证被 整合入搜索结果的信息内容反映的是整个人群而非若干有倾向、偏见的个别人、个别团体的观点或意见。
N 种人对肉搜的 n 种不同反应
美国同事“啊,有点恐怖”。第一次听到这个反应的时候我们真是吃了一惊,怎么会恐怖呢?想了很久,终于明白,原来翻译的时候用了“flesh search”,那怎么能不吓人呢?让美国朋友误以为真的是“人”“肉”搜索了呢?直到解释给大家听这是“Grassroots search”(草根搜索)后美国同事们在放下心来。
日本的同事:完全看太懂。哈哈,没有什么,当我看到日本的笑话的时候,我也回复了完全不懂的邮件。
韩国的同事觉得很有共鸣,说明年他们韩国的笑话就是这个啦!
我们的组员 Piapia
Piapia 是一只见多识广的小白兔,也是我们肉搜组的荣誉组员,谷歌人肉搜索首页那张图片的主角本来就是我们的小兔 piapia。后来种种原因,照片换成了它爸的头像,这里应组员的强烈要求,还是要秀秀给我们的带来很多灵感、快乐的 Piapia 照片。