07 2013 档案
摘要:Python 循环while和for循环在python里面基本和java等其他语言类似,由于python的语言风格,所以在写while和for时,条件语句不需要用括号:并且for的使用比while更常见,以循环输出0-5的整数为例i=0while i<=5: print (i) i+=1;for i in range(6): print (i)值得注意的市python里面貌似是不支持++和--这样的自增自减运算的,所以这里while循环不能写i++,也不能写++i;前者python编译器不识别,后者识别为+(+i),也就是说i不会变化,不断打印0,将导致死循环的产生,此时...
阅读全文
摘要:1.The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.----Head first design patterns策略模式定义了一族算法,并将每一个都进行封装使他们变得通用。策略允许这些算法独立于使用他们的客户端自由变化。2.The Observer Patter defines a on
阅读全文
摘要:References:http://developer.android.com/training/animation/index.htmlhttp://developer.android.com/reference/android/view/ViewGroup.html#attr_android:animateLayoutChanges动画效果可以微妙地提升用户体验。特别是当屏幕状态发生改变时,比如新的内容添加进来或者新的动作产生。本文将以developer的training教程Adding Animations为基础,分析Android里面的动画使用。layout过渡动画如果layout界面
阅读全文