摘要: GL_AMBIENT 环境光,无方向,所有面都受影响GL_DIFFUSE 散射光, 定向光GL_SPECULAR 高光 阅读全文
posted @ 2013-05-13 16:27 Kalou 阅读(204) 评论(0) 推荐(0) 编辑
摘要: A renderbuffer is a data storage object containing a single image of a renderable internal format.(参考http://www.opengl.org/registry/specs/EXT/frame... 阅读全文
posted @ 2013-05-10 18:09 Kalou 阅读(2873) 评论(0) 推荐(1) 编辑
摘要: 4大核心元素:1.Domain Entity Business Object (BO)属性和行为 Data Transfer Object (DTO) 仅属性2.Business Rules3.Validation4.Business Process and workflowsUI与业务逻辑之间应该只有简单的数据传递UI层应该只包括简单的数据校验逻辑和数据显示逻辑 阅读全文
posted @ 2013-03-05 21:15 Kalou 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Note in particular that run loops retain their timers, so you can release a timer after you have added it to a run loop.scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:the target object is retained by the timer and released when the timer is invalidated.invalidateStops the receiver f 阅读全文
posted @ 2013-01-23 11:13 Kalou 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 函数原则:短小,只做一件事何为只做一件事?如果函数只是做了该函数名下同一抽象层上的步骤,则函数还是只做了一件事每个函数一个抽象层级!要确保函数只做一件事,函数中的语句都要在同一抽象层级上。1 public static String renderPageWithSetupsAndTeardowns{2 PageData pageData, boolean isSuite) throws Exception {3 if (isTestPage(pageData))4 iscludeSetupAndTeardownPages(pageData, isSuite);5... 阅读全文
posted @ 2012-12-23 18:54 Kalou 阅读(258) 评论(0) 推荐(1) 编辑
摘要: 使用CALayer属性backgroundColor,borderColor直接设置layer.contents(to an image),在多个view之间共享contents,伸展小图片到大图片 阅读全文
posted @ 2012-12-20 16:46 Kalou 阅读(151) 评论(0) 推荐(0) 编辑
摘要: strerror(errno) 阅读全文
posted @ 2012-10-11 10:26 Kalou 阅读(942) 评论(0) 推荐(0) 编辑
摘要: void Swap(int *i, int *j){ int temp = *i; *i = *j; *j = temp;}void MinHeapFixup(int a[], int i) { for (int j = (i - 1) / 2; (j >= 0 && i != 0)&& a[i] > a[j]; i = j, j = (i - 1) / 2) Swap(&a[i], &a[j]); }//在最小堆中加入新的数据nNum void MinHeapAddNumber(int a[], int n, int nNum) { 阅读全文
posted @ 2012-10-09 17:51 Kalou 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 快速排序输采用分而治之的策略,将一个串分为两个串,分别进行排序具体实现方法:在数组中找到基准pivot分区partition操作:将所有小于pivot的元素放在pivot的前面,将所有大于pivot的元素放在pivot的后面递归recursive操作:将两个子数组进行上面类似的排序效率分析:时间复杂度:最佳好情况O(nlogn),数组中的每个元素都需要被循环遍历一次,以找到其位置,需要O(n),而每次遍历时都将数组给分区成2个部分,需要O(logn);最坏情况O(n^2)空间复杂度:最好情况O(logn),最坏情况O(n)实现代码: void partition(int *arr,int l. 阅读全文
posted @ 2012-10-06 14:31 Kalou 阅读(187) 评论(0) 推荐(0) 编辑
摘要: (1)如果多个类共享数据而非行为,应该创建这些类可以包含的共用对象。(2)如果多个类共享行为而非数据,应该让它们从共同的基类继承而来,并在基类里定义共用的子程序。(3)如果多个类既共享行为又共享数据,应该让它们从共同的基类继承而来,并在基类里定义共用的数据和子程序。(4)当你想由基类控制接口时,使用继承;当你想自己控制接口时,使用包含。 阅读全文
posted @ 2012-09-27 17:14 Kalou 阅读(584) 评论(1) 推荐(0) 编辑