摘要: textAppearance的属性设置android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceMedium"android:textAppearance="?android:attr/textAppearanceLarge"android:textAppearance="?android:attr/textAppearanceLarge”TextView属性详解 阅读全文
posted @ 2013-11-04 15:41 Sudawei 阅读(2338) 评论(0) 推荐(0) 编辑
摘要: 参考:1、http://www.cnblogs.com/anrainie/archive/2012/03/07/2383941.html总结:代码: 阅读全文
posted @ 2013-11-01 14:04 Sudawei 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 参考:1、讲解很详细:blog.csdn.net/psuaije/article/details/7447391总结:代码: 阅读全文
posted @ 2013-10-31 15:07 Sudawei 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 参考:1、http://blog.csdn.net/ameyume/article/details/65282052、http://blog.sina.com.cn/s/blog_85b3a16101011hnp.html总结:1、保存图片两种方式均可:一种是先转换为byte[],再生成bitmap;一种是直接用InputStream生成bitmap2、4.0中不允许在主线程,即UI线程中操作网络,所以必须新开一个线程,在子线程中执行网络连接;然后在主线程中显示图片。3、读取图片:Bitmap bitmap = BitmapFactory.decodeFile("/sdcard/ic 阅读全文
posted @ 2013-10-25 16:28 Sudawei 阅读(1253) 评论(0) 推荐(0) 编辑
摘要: 参考资料:http://www.open-open.com/lib/view/open1326376799874.htmlhttp://www.cnblogs.com/tt_mc/archive/2011/01/04/1925327.html总结:解析普通json:使用JSONObject,getString方法;解析数组形式json:使用JSONArray,getJSONArray方法后,遍历数组,使用普通json的解析方法;public class GetPostMain extends Activity{ Button get , post; EditText show; ... 阅读全文
posted @ 2013-10-23 11:38 Sudawei 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 7种设计坏味道1.僵化性: 很难对系统进行改动,因为每个改动都会迫使许多对系统其他部分的其它改动。2.脆弱性: 对系统的改动会导致系统中和改动的地方在概念上无关的许多地方出现问题。3.牢固性: 很难解开系统的纠结,使之成为一些可在其他系统中重用的组件。4.粘滞性: 做正确的事情比做错误的事情要困难。5.复杂性(不必要的): 设计中包含有不具任何直接好处的基础结构。6.重复性(不必要的): 设计中包含有重复的结构,而该重复的结构本可以使用单一的抽象进行统一。7.晦涩性: 很难阅读、理解。没有很好地表现出意图。11种原则 - Principle----类原则1.单一职责原则 - Single Re 阅读全文
posted @ 2013-10-11 12:39 Sudawei 阅读(350) 评论(0) 推荐(0) 编辑
摘要: os.listdir()os.path.isdir()os.path.join()os.mkdir() 1 # -*- coding:utf-8 -*- 2 import os,sys 3 4 5 def mkdir(path = os.getcwd()): 6 if 'img' in os.listdir(path) and os.path.isdir(os.path.join(path,'img')): 7 pass 8 else: 9 os.mkdir(os.path.join(path,'img'))10 subpath = ... 阅读全文
posted @ 2013-10-01 14:01 Sudawei 阅读(254) 评论(0) 推荐(0) 编辑
摘要: windows 默认换行符为 \r\n;unix默认换行符为 \n;所以当win下编辑的脚本在linux下显示末尾多了^M:换行符修改为同一的unix格式脚本如下: 1 def run(path,file): 2 for file in files: 3 file = path+'\\'+file 4 f = open(file,'r') 5 result = f.read() 6 print result 7 result = result.replace(r'\r\n',r'\n') 8 ... 阅读全文
posted @ 2013-09-29 17:53 Sudawei 阅读(3118) 评论(0) 推荐(0) 编辑
摘要: python中 __name__及__main()__的使用1 #hello.py 2 def sayHello():3 str="hello" print(str);4 5 if __name__ == "__main__": 6 print ('This is main of module "hello.py"') 7 sayHello()python作为一种脚本语言,我们用python写的各个module都可以包含以上那么一个累死c中的main函数, 只不过python中的这种__main__与c中有一些区别,主 阅读全文
posted @ 2013-09-29 17:40 Sudawei 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 参考:http://luchanghong.com/python/2012/07/11/python-urlencode-and-urldecode.html概要:python 通过 HTTP 交互处理数据的时候,url 里面的中文以及特殊字符要做处理的,来学习一下 urlencode 与 urldecode 之间相互转换的方法。当url地址含有中文,或者参数有中文的时候,这个算是很正常了,但是把这样的url作为参数传递的时候(最常见的callback),需要把一些中文甚至'/'做一下编码转换。一、urlencodeurllib库里面有个urlencode函数,可以把key-v 阅读全文
posted @ 2013-09-29 17:35 Sudawei 阅读(2958) 评论(0) 推荐(1) 编辑