博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2010年8月27日

摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--importsys,osdefmain():"""Ademodaemonmainroutine,writeadatestampto/tmp/daemon-logevery10seconds."""im... 阅读全文

posted @ 2010-08-27 22:07 月光林地 阅读(2812) 评论(0) 推荐(0) 编辑

摘要: 有时候因为一些情况,需要把 linux 下符合某一项条件的所有进程 kill 掉,又不能用 killall 直接杀掉某一进程名称包含的所有运行中进程(我们可能只需要杀掉其中的某一类或运行指定参数命令的进程),这个时候我们需要运用 ps, grep, cut 和 kill 一起操作。ok,下面给出具体的参考:ps -ef|grep LOCAL=NO|grep -v grep|cut -c 9-15|... 阅读全文

posted @ 2010-08-27 22:01 月光林地 阅读(28534) 评论(1) 推荐(6) 编辑

2010年3月21日

摘要: list<int> l;for(int i = 0; i<10; i++){l.push_back(i);}for(list<int>::reverse_iterator it = l.rbegin(); it != l.rend();){cout<<*it<<endl;it = list<int>::reverse_iterato... 阅读全文

posted @ 2010-03-21 18:22 月光林地 阅读(821) 评论(0) 推荐(0) 编辑

2010年1月8日

摘要: QueryPerformanceCounter()这个函数返回高精确度性能计数器的值,它可以以微妙为单位计时.但是QueryPerformanceCounter()确切的精确计时的最小单位是与系统有关的,所以,必须要查询系统以得到QueryPerformanceCounter() 返回的嘀哒声的频率.QueryPerformanceFrequency()提供了这个频率值,返回每秒嘀哒声的个数.计算... 阅读全文

posted @ 2010-01-08 10:59 月光林地 阅读(793) 评论(0) 推荐(0) 编辑

2009年11月10日

摘要: 假如有bmp1和bmp2两个bitmapdata对象,现在要把bmp2中(sourceX,sourceY,sourceX+width,sourceY+height)区域缩放scale倍后画到bmp1的(targetX,targetY)位置,则参数设置为:bmp1.draw(bmp2, new Matrix(scale, 0, 0, scale, targetX-sourceX*scale, tar... 阅读全文

posted @ 2009-11-10 11:44 月光林地 阅读(1180) 评论(0) 推荐(0) 编辑

2009年10月18日

摘要: Solution 1 (2D)The following is a simple solution to the problem often encountered in computer graphics, determining whether or not a point (x,y) lies inside or outside a 2D polygonally bounded plane.... 阅读全文

posted @ 2009-10-18 23:56 月光林地 阅读(1767) 评论(0) 推荐(0) 编辑

2009年10月17日

摘要: 正多边形画法:[代码]正六边形网格画法:[代码] 阅读全文

posted @ 2009-10-17 23:47 月光林地 阅读(1612) 评论(0) 推荐(0) 编辑

2009年8月4日

摘要: <effective c++> 第二十条:<宁以pass-by-reference-to-const 替换 pass-by-value> 里说到当参数是内置类型、STL、函数对象时,pass by value 往往比 pass by reference 的效率高。第一次看到函数对象的概念,于是去查了一下google,原来以前接触过的#_#!!!,如callback函数。相关... 阅读全文

posted @ 2009-08-04 00:47 月光林地 阅读(606) 评论(0) 推荐(0) 编辑

2009年7月23日

摘要: CloseHandle()函数的使用:很多程序在创建线程都这样写的:............ThreadHandle = CreateThread(NULL,0,.....);CloseHandel(ThreadHandle );。。。。。这不是刚好创建又关闭了吗?线程怎么运行呢?================================================Closing a t... 阅读全文

posted @ 2009-07-23 15:04 月光林地 阅读(455) 评论(0) 推荐(0) 编辑

2009年7月22日

摘要: 写出一个struct,然后sizeof,你会不会经常对结果感到奇怪?sizeof的结果往往都比你声明的变量总长度要大,这是怎么回事呢?讲讲字节对齐吧./******************************分割线如果体系结构是不对齐的,A中的成员将会一个挨一个存储,从而sizeof(a)为11。显然对齐更浪费了空间。那么为什么要使用对齐呢?体系结构的对齐和不对齐,是在时间和空间上的一个权衡。... 阅读全文

posted @ 2009-07-22 11:18 月光林地 阅读(341) 评论(0) 推荐(0) 编辑