摘要: 原文链接:http://blog.svenapps.com/post/python-xue-xi-bi-ji/python-xue-xi-bi-ji-wu-zi-fu-chuan-han-shu-er#content注:本资料是个人学习笔记,仅供参考 1.maketrans和translate 1)string.maketrans设置字符串转换规则表(translation table) allchars = string.maketrans('', '')#所有的字符串,即不替换字符串 aTob = string.maketrans('a',& 阅读全文
posted @ 2013-05-14 11:48 七夜小魔军 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://blog.svenapps.com/post/python-xue-xi-bi-ji/python-xue-xi-bi-ji-si-zi-fu-chuan-han-shu-yi#content注:本资料是个人学习笔记,仅供参考 1.join()/split() join(),把集合中所有的字符串按照指定的分隔符连接起来,注意:join连接的列表里面的元素必须都是字符串 split(),把字符串,按照指定分隔符拆分称集合 phoneName = ['iPhone','Android','Meego'] print ' 阅读全文
posted @ 2013-05-08 17:46 七夜小魔军 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://blog.svenapps.com/post/python-xue-xi-bi-ji/python-xue-xi-bi-ji-sanlist-fen-pian-fu-zhi-zi-dian#content注:本资料是个人学习笔记,仅供参考1.list phonelist = ['iPhone','Android'] 增加 phonelist.append('WP7') 插入 phonelist.insert(2,'Meego') 更改 phonelist.(0) = 'iOS' 删除 pho 阅读全文
posted @ 2013-05-07 13:47 七夜小魔军 阅读(2066) 评论(0) 推荐(0) 编辑
摘要: 原文链接http://blog.svenapps.com/post/python-xue-xi-bi-ji/python-xue-xi-bi-ji-er-nei-zhi-han-shu#content注:本资料是个人学习笔记,仅供参考 1.apply()函数 作用,使用序列做参数来动态调用方法 def add(a,b): return a+b print add(1,2) print apply(add,(1,2)) 结果3 3 特殊用法 def myfuc(a, b): print a, b atuple=(30,10) alist= ['Hell... 阅读全文
posted @ 2013-05-06 14:22 七夜小魔军 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 原文链接http://python.svenapps.com/post/python-xue-xi-bi-ji-yi#content注:本资料是个人学习笔记,仅供参考 1.** 幂运算 比取反优先级高 -3**2 等价 -(3**2)2.// (地板除)整除运算 5/6 0 5//6 0 5.0/6 0.83333333 5.0//6 0.0 声明from __future__ import division后 5/6 0.83333333 5//6 0 5.0/6 0.83333333 5.0//6 0.03.中文编码#_*_ coding:UTF-8 _*_... 阅读全文
posted @ 2013-05-03 16:15 七夜小魔军 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 更新2013年04月02日11:46:36:修改了用[imageViewsetImageWithURLRequest:[NSURLRequestrequestWithURL:[NSURLURLWithString:@""]]placeholderImage:[UIImageimageNamed:@"loader.jpg"]success:^(NSURLRequest*request,NSHTTPURLResponse*response,UIImage*image) { } failure:^(NSURLRequest *request, NSHTTPUR 阅读全文
posted @ 2013-01-17 14:42 七夜小魔军 阅读(4858) 评论(5) 推荐(0) 编辑
摘要: 今天接了朋友台IOS4.3.1的设备,测试时发现了如下警告:Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.Using two-stage rotation animation is not supported when rotating more than one view controller or view controllers not the wind 阅读全文
posted @ 2013-01-16 14:45 七夜小魔军 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 周末把xcode更新到了4.5,今天赶紧体验了下自己的应用在iphone5上跑是啥感觉,如传言一样,上下都有黑边,今天就把自己应用是适配了下,上传审核适配要点,很简单1、项目中加个1136*640的启动页面图片,命名Default-568h@2x.png2、ios模拟器硬件->设备->iPhone(Retina 4-inch)3、动态更改控件布局和高度[UIScreen mainScreen].bounds.size.height 阅读全文
posted @ 2012-09-24 18:07 七夜小魔军 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 公司要做ipad客户端了,所以研究了ipad下才有的UISplitViewController UISplitViewController 只能作为window的rootViewController,所以我们可以先自定义个RootViewController继承UISplitViewController#import <UIKit/UIKit.h>@interface RootViewController : UISplitViewController@end- (void)viewDidLoad{ [superviewDidLoad]; MenuTableViewControll 阅读全文
posted @ 2012-09-18 18:00 七夜小魔军 阅读(538) 评论(0) 推荐(0) 编辑
摘要: 在xcode4.2的时候,非XIB下,创建一个ViewController的时候,系统在.m里还会自动生成loadView方法代码只是给你注掉了,但4.3后就不会自动生成了。 看到很多童鞋也不复写loadView方法了,但这里有个问题,就是遇到内存警告的时候,会判断你的loadView是否打开了,如果没打开,就不会释放该视图内存,然后程序就会crash掉,如果loadView复写了,并且当前视图不是活动视图,就会从内存中释放掉,当你pop到这个视图的时候,从新加载,这样就避免了内存警告的时候,程序直接崩溃的问题。所以笔者还是推荐复写loadView。释放内存的方法是在didReceive... 阅读全文
posted @ 2012-09-13 10:01 七夜小魔军 阅读(185) 评论(0) 推荐(0) 编辑