- 博客(27)
- 资源 (10)
- 收藏
- 关注
原创 “Unable to find vcvarsall.bat”错误解决办法
给Python安装第三方库文件时,可能会遇到“Unable to find vcvarsall.bat”错误,无论是通过easy_install还是使用setup.py install,都无法通过! 今天我在给Python安装pytidylib时也遇见了这样的问题,查阅后解决办法如下,留个笔记。 1、安装MinGW 2、将MinGW目录下bin文件夹加入到环境变量 3、在bin文件夹中,复
2012-05-08 14:14:24 508
原创 C# 处理图片
今天的工作是把服务器上所有的电影封面图片稍微裁剪,适当缩放。贴下查资料和自己用到的代码~~ 用到的一个枚举 enum AnchorPosition { Top, Center, Bottom, Left, Right } 1、按比例缩放图小 static Image ScaleByPercent(Image imgPhoto, int
2012-05-07 09:31:09 392
原创 c# 提取HTML中所有图片URL
/// /// 取得HTML中所有图片的 URL。 /// /// HTML代码 /// 图片的URL列表 public static string[] GetHtmlImageUrlList(string sHtmlText) { // 定义正则表达式用来匹配 i
2012-05-05 21:53:32 723
原创 C# 设置本机IP、网关和DNS
需要在引用中添加System.Management using System; using System.Management; namespace SetIp { class Program { static void Main(string[] args) { ManagementClass mc = new Ma
2012-05-05 08:39:09 579
原创 Project Euler – Problem 23
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means th
2012-05-05 08:37:49 448
原创 Project Euler – Problem 22
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical va
2012-05-05 08:36:02 315
原创 Project Euler – Problem 21
For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220. Evaluate the sum o
2012-05-05 08:32:27 423
原创 Project Euler – Problem 20
n! means n (n 1) … 3 2 1 For example, 10! = 10 9 … 3 2 1 = 3628800, and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27. Find the sum of the digits in the number 100! #!/u
2012-05-05 08:30:42 265
原创 Project Euler – Problem 19
You are given the following information, but you may prefer to do some research for yourself. 1 Jan 1900 was a Monday. Thirty days has September,April, June and November. All the rest have thirty-
2012-05-05 08:29:06 984
原创 Project Euler – Problem 18
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find
2012-05-05 08:27:53 310
原创 Project Euler – Problem 17
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to 1000 (one thousand) inclusive we
2012-05-05 08:26:02 418
原创 Project Euler – Problem 16
215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 21000? 用python绕开那些复杂的大数计算和溢出的考虑! #!/usr/bin/env python # coding: utf-8 def SumOfDigits(n
2012-05-05 08:23:45 268
原创 Project Euler - Problem 15
Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner. How many routes are there through a 2020 grid? 解法一: 当前点到目标点的路径数=右边点到目标点的路径数 +
2012-05-05 08:22:40 295
原创 Project Euler – Problem 14
The following iterative sequence is defined for the set of positive integers: n n/2 (n is even) n 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 1
2012-05-05 08:20:58 310
原创 Project Euler - Problem 13
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 7432498
2012-05-05 08:19:35 317
原创 Project Euler – Problem 12
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28,
2012-05-05 08:17:49 323
原创 Project Eluer - Problem 11
In the 2020 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 5
2012-05-05 08:14:13 343
原创 Project Euler – Problem 10
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. 计算2000000一下的素数和,参照problem 7判断素数的办法。 static long sumOfPrimes(int n) { long sum = 17; fo
2012-05-05 08:11:02 301
原创 Project Euler - Problem 9
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2. For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2. There exists exactly one Pythagorean triplet for which a + b
2012-05-05 08:07:48 287
原创 Project Euler - Problem 8
Find the greatest product of five consecutive digits in the 1000-digit number. 73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112
2012-05-05 08:05:50 276
原创 Project Eurler - Problem 7
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10001st prime number? 这里采用简单的办法求素数,不过还是要讲究一点效率: 1、2是唯一的偶数素数 2、所有比3大的素数可以表示为6k+1或者6k-
2012-05-05 08:03:43 220
原创 Project Euler - Problem 6
The sum of the squares of the first ten natural numbers is, 12 + 22 + … + 102 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + … + 10)2 = 552 = 3025 Hence the difference bet
2012-05-05 07:59:40 199
原创 Project Euler - Problem 5
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to
2012-05-05 07:55:40 371
原创 Project Euler - Problem 4
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 X 99. Find the largest palindrome made from the product of two 3-digit
2012-05-05 07:52:00 248
原创 Project Euler - Problem 3
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? 思路: 1、偶数的唯一素因子为2 2、任何数可以分解为有限个素数的乘积 可以参见因子分解算法,不断模不断求因子。 def LargestPrimeFactor(numbe
2012-05-05 07:48:34 337
原创 Project Euler - Problem 2
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the
2012-05-05 07:46:25 256
原创 Project Eurler - Problem 1
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. 通常解法: def Su
2012-05-05 07:42:25 289
Programming in Python 3 2nd Edition.pdf
2011-08-09
用EditPlus打造Python的IDE环境
2010-05-14
win32病毒入门-ring3篇
2010-04-23
rootkit学习与研究
2010-04-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人