
python
文章平均质量分 81
要个男盆友扭蛋
这个作者很懒,什么都没留下…
展开
-
Project Euler:Problem 92 Square digit chains
A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before.For example,44 → 32 → 13 → 10 → 1 → 185 → 89 → 145 → 42原创 2015-07-26 14:12:17 · 790 阅读 · 0 评论 -
UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position ... 问题解决办法之一
使用Python写文件的时候,或者将网络数据流写入到本地文件的时候,大部分情况下会遇到:UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position ... 这个问题。 网络上有很多类似的文件讲述如何解决这个问题,但是无非就是encode,decode相关的,这是导致该问题出现的真正原因吗?不是的。 很多时候,我转载 2016-01-04 11:02:37 · 11394 阅读 · 1 评论 -
Project Euler:Problem 89 Roman numerals
For a number written in Roman numerals to be considered valid there are basic rules which must be followed. Even though the rules allow some numbers to be expressed in more than one way there is alw原创 2015-07-24 16:44:36 · 856 阅读 · 0 评论 -
Project Euler:Problem 90 Cube digit pairs
Each of the six faces on a cube has a different digit (0 to 9) written on it; the same is done to a second cube. By placing the two cubes side-by-side in different positions we can form a variety of原创 2015-07-24 21:27:52 · 962 阅读 · 0 评论 -
Project Euler:Problem 88 Product-sum numbers
A natural number, N, that can be written as the sum and product of a given set of at least two natural numbers, {a1, a2, ... , ak} is called a product-sum number: N = a1 + a2 + ... + ak = a1 × a2 ×原创 2015-07-23 22:35:52 · 1488 阅读 · 1 评论 -
Project Euler:Problem 83 Path sum: four ways
In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by moving left, right, up, and down, is indicated in bold red and is equal to 2297.⎛⎝⎜⎜⎜⎜⎜⎜1312016305378原创 2015-07-21 21:51:52 · 1044 阅读 · 0 评论 -
Project Euler:Problem 73 Counting fractions in a range
Consider the fraction, n/d, where n and d are positive integers. If nd and HCF(n,d)=1, it is called a reduced proper fraction.If we list the set of reduced proper fractions for d ≤ 8 in ascending or原创 2015-07-17 16:45:40 · 626 阅读 · 0 评论 -
Project Euler:Problem 75 Singular integer right triangles
It turns out that 12 cm is the smallest length of wire that can be bent to form an integer sided right angle triangle in exactly one way, but there are many more examples.12 cm: (3,4,5)24 cm: (6原创 2015-07-18 15:53:08 · 1036 阅读 · 0 评论 -
Project Euler:Problem 81 Path sum: two ways
In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by only moving to the right and down, is indicated in bold red and is equal to 2427.⎛⎝⎜⎜⎜⎜⎜⎜1312016305原创 2015-07-20 20:39:38 · 786 阅读 · 0 评论 -
Project Euler:Problem 82 Path sum: three ways
The minimal path sum in the 5 by 5 matrix below, by starting in any cell in the left column and finishing in any cell in the right column, and only moving up, down, and right, is indicated in red an原创 2015-07-21 16:07:11 · 1272 阅读 · 0 评论 -
Project Euler:Problem 91 Right triangles with integer coordinates
The points P (x1, y1) and Q (x2, y2) are plotted at integer co-ordinates and are joined to the origin, O(0,0), to form ΔOPQ.There are exactly fourteen triangles containing a right angle that原创 2015-07-25 22:40:31 · 1150 阅读 · 0 评论 -
Project Euler:Problem 93 Arithmetic expressions
By using each of the digits from the set, {1, 2, 3, 4}, exactly once, and making use of the four arithmetic operations (+, −, *, /) and brackets/parentheses, it is possible to form different positiv原创 2015-07-26 17:25:46 · 1346 阅读 · 1 评论 -
GloVe学习之Python中简单的词向量SVD分解
GloVe原理还没搞清楚,先用Python学着跑跑小程序好了。语料:I like deep learning. I like NLP.I enjoy flying.其中words=["I","like","enjoy","deep","learning","NLP","flying","."]上下文相关矩阵:X=np.array([[0,2,1,转载 2016-10-26 20:23:47 · 3240 阅读 · 0 评论