码迷,mamicode.com
首页 >  
搜索关键字:python list tuple    ( 183691个结果
Python3.2官方文档翻译-标准库概览(二)
7.5 字符串模式匹配 re模块为高级字符串成处理提供了正则表达式匹配。 对于复杂的匹配和处理,正则表达式能够提供简明优化的方法: >>> import re >>> re.findall(r’\bf[a-z]*’, ’which foot or hand fell fastest’) [’foot’, ’fell’, ’fastest’] >>> re.sub(r’(\b[a-z]+)...
分类:编程语言   时间:2014-05-14 01:04:22    阅读次数:490
leetcode第一刷_Rotate List
我提交了好多次,错误莫名其妙的,到后来才明白过来,原来我把题目给理解错了。 这个题的意思不是说让你把最后的那k个位置的元素移到前面来,这种问题的做法就是用两个指针,先让一个走,走到一定的长度之后两个一起走,很简单。它实际的意思是整个链表循环右移,假设一个链表长度是N,那么循环右移N次之后,链表又变回了原来的样子。k的取值范围只说了是非负的,也就是它可以是大于N的,因此实际的移位次数只是(k%N)...
分类:其他好文   时间:2014-05-13 23:37:23    阅读次数:299
python中的单元测试
python中的单元测试可以使用doctest,unittest完成 1.doctest的使用 (1)写入程序如下(cubetest.py): #!/usr/bin/python def cube(x): """ cube a number and return the result >>> cube(2) 8 >>> cube(3) 27 >>> cube(4) 64...
分类:编程语言   时间:2014-05-13 23:33:19    阅读次数:491
list_for_each与list_for_each_entry详解
一、list_for_each 1.list_for_each原型 #define list_for_each(pos, head)     for (pos = (head)->next, prefetch(pos->next); pos != (head);     pos = pos->next, prefetch(pos->next)) 它实际上是一个 for 循环,利用...
分类:其他好文   时间:2014-05-13 08:50:12    阅读次数:506
Python 安装 MaxMind GeoLite City
1、先安装 geoip c library  geoip c library >= 1.4.6 installed on your machine. >= 1.4.6 installed on your machine. wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.7.tar.gz tar -xvzf GeoIP...
分类:编程语言   时间:2014-05-13 06:24:28    阅读次数:940
滚动广告——viewpager
1.HomeAdView package com.tengw.jinhuaqi.view; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import j...
分类:其他好文   时间:2014-05-13 05:41:24    阅读次数:327
atitit js 开发工具 ide的代码结构显示(func list) outline总结
atitit js 开发工具 ide的代码结构显示(func list) outline总结 eclips环境::4.3.1 #-------需要一个js开发工具,可以显示outline或者代码结构显示(func list)的功能的 aptana,webstorm好十好,走十太大的,pass...子能dw,eclps,npp黑头挑选.. VJET是一个 Eclipse ...
分类:Web程序   时间:2014-05-13 00:27:13    阅读次数:390
[14.05.12]今后讨论班的走向
今后讨论班的一些走向 谨记之.........
分类:其他好文   时间:2014-05-12 23:52:13    阅读次数:432
Android 自定义Adapter 但listview 只显示第一条数据
楼主让这个问题郁闷了一晚上。。。。。在logcat里明明显示adapter的getview方法里的list大于一条数据 ,但posotion却一直是0.。。。。运行后也只显示list[0]里面的数据。。。。最后的最后原来错误出在布局文件上    我以前的是这样的; <ScrollView android:layout_width="fill_parent" ...
分类:移动开发   时间:2014-05-12 23:36:45    阅读次数:386
Python3.2官方文档翻译--标准库概览(一)
7.1 操作系统接口 Os模块提供主要许多与操作系统交互的函数。   >>> import os >>> os.getcwd() # Return the current working directory ’C:\\Python31’ >>> os.chdir(’/server/accesslogs’) # Change current working directory >>> ...
分类:编程语言   时间:2014-05-12 23:08:03    阅读次数:356
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!