摘要: Sum square differenceProblem 6The sum of the squares of the first ten natural numbers is,12+ 22+ ... + 102= 385The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)2= 552= 3025Hence the difference between the sum of the squares of the first ten natural numbers and the square o 阅读全文
posted @ 2013-12-12 18:29 tianxiaozz 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Smallest multipleProblem 52520 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 isevenly divisibleby all of the numbers from 1 to 20?From problem 3, we get a list of prime factors of a number . Base on this 阅读全文
posted @ 2013-12-12 17:15 tianxiaozz 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Largest palindrome productProblem 4A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 9199.Find the largest palindrome made from the product of two 3-digit numbers.The python code is as follows:def isPalindromic(data): list... 阅读全文
posted @ 2013-12-12 16:00 tianxiaozz 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Largest prime factorProblem 3The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ?The answer:import mathdef getLargestPrime(data): list = [] i = 2 while i <= math.sqrt(data): #while i <= data/2: if data%i == 0 : lis... 阅读全文
posted @ 2013-12-10 17:55 tianxiaozz 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1 对象及其引用python中,引用是用命名空间来实现的,命名空间维护了变量和对象之间的引用关系。1 myInt = 272 yourInt = myInt3 4 #change the value of yourInt5 yourInt = yourInt + 5改变值的过程中,命名空间快照如下: 、如上图所示,每个不可变对象的操作都将创建指向新对象的引用。对于可变对象,情况会不一样。1 list1 = [1, 2, 3]2 list2 = list13 4 #list1 append a new element5 list1.append(4)6 7 print(list1)8 print 阅读全文
posted @ 2013-10-29 17:35 tianxiaozz 阅读(386) 评论(0) 推荐(0) 编辑
摘要: python 3.3版本中的print默认有个换行的操作 如:for i in range(5): print(i) 结果为:01234 如果不想换行,需要用到print函数的end参数,print( , ... , end="分隔符")for i in range(5): print(i, end="##") 结果为:0##1##2##3##4## ps 分隔符可以为空。 阅读全文
posted @ 2013-10-14 15:46 tianxiaozz 阅读(1672) 评论(0) 推荐(0) 编辑
摘要: 欢迎转载,同时请附上原文链接:http://www.cnblogs.com/tianxiaozz/archive/2013/03/28/access_mobile_website_on_pc.html一、基础篇 如果用电脑的浏览器来访问网站的手机站点,结果会怎么样,那取决于网站对于浏览器用户的限制,如百度、淘宝、凡客、新浪微博、Google等网站是允许用户通过普通的电脑端浏览器访问手机站点的(在我写这篇博客时是可以的,以后改不改规则就不知道了)。 但如果,网站不允许用户通过电脑端浏览器访问手机站点,这就得从UserAgent说起了: 网站一般用UserAgent来判断来访用户使用的浏览... 阅读全文
posted @ 2013-03-28 21:15 tianxiaozz 阅读(2210) 评论(4) 推荐(0) 编辑
摘要: 欢迎转载,同时请附上原文链接:http://www.cnblogs.com/tianxiaozz/archive/2012/12/26/change_apk_package_name.html 今天,想在android手机上安装两个相同的应用,本以为可以安装不同版本的,试了几次,均相互覆盖了,于是,只能设法修改apk所对应的包名(package name)。 目的声明:本文只是为了满足DIY的需要,并不是为了成为打包党,窃取别人的劳动成果,本文所涉及的工具也均为开源的,仅供学习交流之用。 DIY前提:在国内的论坛里,搜索了一下,找到了各种解包,打包的技术内容,以及各种汉化、去广告的帖... 阅读全文
posted @ 2012-12-26 01:39 tianxiaozz 阅读(25701) 评论(29) 推荐(5) 编辑