码迷,mamicode.com
首页 >  
搜索关键字:python return    ( 192001个结果
hdu1222
思路:m和n如果有公约数,则安全洞存在,无公约数或公约数为1,则无   #include int gcd(int a,int b) { if(b==0)return a; else { int r; while(b!=0) { r=a%b; a=b; ...
分类:其他好文   时间:2014-05-07 02:54:02    阅读次数:283
python 按照gb2312做url编码
import urllib2 urllib2.quote("攻克平台")...
分类:编程语言   时间:2014-05-06 23:41:17    阅读次数:341
判断数据是否为整数
public class IsInteger { private IsInteger(){}; public static boolean isInteger(String value) { try { Integer.parseInt(value); return true; } catch (N...
分类:其他好文   时间:2014-05-06 23:27:37    阅读次数:348
六、PYTHON 学习之装饰器使用
Python是一种强大的语言,即可浅尝辄止,也可深入挖掘。很适合做科学计算、数据挖掘等等。今天我将简单介绍一下Python的装饰器(Decorators)的用法 。 假设我们想要庆祝下生日,需要邀请一些朋友过来参加。但是你有个讨厌的朋友,叫Joe,必须不能让他来啊。可能首先你想到的是建一个list,然后迭代查找并移除所有的Joe童鞋。这当然是个好方法,但是这里为了介绍装饰器,我们会用@来完成...
分类:编程语言   时间:2014-05-06 23:19:53    阅读次数:371
Python重写C语言程序100例--Part2
'''题目:输入某年某月某日,判断这一天是这一年的第几天? 1.程序分析:以3月5日为例,应该先把前两个月的加起来,然后再加上5天即本年的第几天,特殊       情况,闰年且输入月份大于3时需考虑多加一天。 2.程序源代码: ''' year = int(raw_input('year:\n')) month = int(raw_input('month:\n')) day = int(raw_...
分类:编程语言   时间:2014-05-06 21:27:14    阅读次数:465
广义mandelbrot集,使用python的matplotlib绘制,支持放大缩小
分形 逃逸时间算法 广义mandelbrot集,终于绘制出来了,圆了毕业设计的梦...
分类:编程语言   时间:2014-05-06 21:21:36    阅读次数:482
算法竞赛_入门经典_刘汝佳__(2)
1,有几位数字 #include int main_2_1_digit(){ int n; while(scanf("%d",&n)){ int count = 0; if(n==0) count = 1; while(n){ count++; n/=10; } printf("%d\n",count); } return 0; } ...
分类:其他好文   时间:2014-05-06 21:20:19    阅读次数:374
简单实现并发:python concurrent模块
可以使用python3中的concurrent模块,如果python环境是2.7的话,需要下载https://pypi.python.org/packages/source/f/futures/futures-2.1.6.tar.gz#md5=cfab9ac3cd55d6c7ddd0546a9f22f453此futures包即可食用concurrent模块。官方文档:http://pythonhosted.org//futures/对于..
分类:编程语言   时间:2014-05-06 20:22:07    阅读次数:725
Python 备份MySQL,并同步rsync server
#vim:tabstop=4shiftwidth=4softtabstop=4 #Copyright2010UnitedStatesGovernmentasrepresentedbythe #AdministratoroftheNationalAeronauticsandSpaceAdministration. #Copyright2011JustinSantaBarbara #AllRightsReserved. #Copyright(c)2010CitrixSystems,Inc. # #Licensed..
分类:数据库   时间:2014-05-06 20:19:17    阅读次数:629
(六)、获取Keystone token的三种方式
让我们简单Let’s take a look at three (very basic) ways to get a scoped token from Keystone (theOpenStack Identity Project). Keep in mind that these are just a few ways you can go about this. Before tryin...
分类:其他好文   时间:2014-05-06 19:30:32    阅读次数:359
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!