iOS SDK
提供了两个XML框架:1、NSXML,基于Objective-C语言的SAX解析框架,他是iOS
SDK默认的XML解析框架,他不支持DOM模式。2、libxml2,基于C语言的第三方提供的sax解析框架,他被苹果整合在iOS
SDK中,它支持sax和dom模式。解析XML的其它第三...
分类:
其他好文 时间:
2014-05-08 12:15:27
阅读次数:
431
在微博认证方式里,基本的OAuth认证是必须要调整到跳转到第三方页面上进行授权的,例如下面的例子:
1、从http://open.weibo.com/wiki/index.php/SDK#Android下载SDK包。
2、在AndroidExample/src/weibo4android/Wei.....
分类:
移动开发 时间:
2014-05-08 12:12:04
阅读次数:
503
#encoding:utf-8import math#向上取整print
"math.ceil---"print "math.ceil(2.3) => ", math.ceil(2.3)print "math.ceil(2.6)
=> ", math.ceil(2.6)#向下取整print "\nm...
分类:
编程语言 时间:
2014-05-08 12:11:13
阅读次数:
467
昨天晚上更新了下Android SDK Manager,发现Extras下的Android
Support
Library已经更新到19.1了,上网一查原来是sdk\extras\android\support\v7中的android-support-v7目录又添加了新的内容。据官方介绍,and.....
分类:
移动开发 时间:
2014-05-08 11:57:12
阅读次数:
426
来源:http://www.myexception.cn/perl-python/620096.htmlpython中__get__,__getattr__,__getattribute__的区别__get__,__getattr__和__getattribute都是访问属性的方法,但不太相同。ob...
分类:
编程语言 时间:
2014-05-08 11:51:14
阅读次数:
277
本文章參考與:http://www.webtop.com.au/blog/compiling-python-with-ssl-support-fedora-10-2009020237。當我"修"好yum之後就開始修python的ssl問題。我的電腦有python的多個版本。在python2.6.6中...
分类:
编程语言 时间:
2014-05-08 11:46:52
阅读次数:
507
想使用python的logging模块记录日志,并使用RotatingFileHandler来处理日志以便于在日志文件超过指定的大小后会重新生成新的日志文件。
基本代码如下:
import logging
logger = logging.getLogger('mylogger')
logger.setLevel(logging.INFO)
fh=logging.handlers.Ro...
分类:
编程语言 时间:
2014-05-08 00:25:12
阅读次数:
457
由于python具有无限精度的int类型,所以用python实现大整数乘法是没意义的,但是思想是一样的。利用的规律是:第一个数的第i位和第二个数大第j位相乘,一定累加到结果的第i+j位上,这里是从0位置开始算的。代码如下:
import sys
def list2str(li):
while li[0]==0:
del li[0]
res=''
for i in li:
res+...
分类:
编程语言 时间:
2014-05-07 23:13:21
阅读次数:
453
TARGET_IPHONE_SIMULATOR和TARGET_OS_IPHONE 是苹果的两个宏定义,
在真机sdk中位于ios->usr/include/targetconditionals.h中,
在模拟器sdk中位于simulator->usr/include/targetconditionals.h中
(笔者此时使用的xcode版本为5.1,sdk版本是7.1)
仔细看其模...
分类:
移动开发 时间:
2014-05-07 23:02:07
阅读次数:
450
defgetResult(cmd,timeout=2):#命令超时时间
deadline=time.time()+timeout
r=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE)
whiletime.time()<deadlineandr.poll()isNone:
time.sleep(0.1)
ifr.poll()isNone:#检查子进程
r.kill()
r.wait()
return‘‘
r.wait()
..
分类:
编程语言 时间:
2014-05-07 22:30:17
阅读次数:
504