2013年10月17日

屏幕截图保存文件

摘要: CDC *pDC;//屏幕DC pDC = CDC::FromHandle(::GetDC(NULL));//获取当前整个屏幕DC int BitPerPixel = pDC->GetDeviceCaps(BITSPIXEL);//获得颜色模式 int Width = pDC->GetDeviceCaps(HORZRES); int Height = pDC->GetDeviceCaps(VERTRES); CDC memDC;//内存DC memDC.CreateCompatibleDC(pDC); CBitmap memBitmap, *o... 阅读全文

posted @ 2013-10-17 22:40 快乐的大猪 阅读(198) 评论(0) 推荐(0) 编辑

2013年8月16日

无法定位程序输入点在 XXXX上...

摘要: VS2008 用三方库的时候,发现奇怪的现象 debug版本一切正常, 但release版本会弹"无法定位程序输入点...",工程设置里有个OptimizeReferences 属性, 设置成default, 就正常.记录下 阅读全文

posted @ 2013-08-16 18:36 快乐的大猪 阅读(370) 评论(0) 推荐(0) 编辑

2013年6月4日

读Boost1

摘要: 实在无聊, 翻boost库看看顺便记录下看能坚持多久那就从算法看起下面3个是搜索算法Boyer-Moore Search时间复杂度是0(n)Boyer-Moore-Horspool Search时间复杂度是0(m*n)Knuth-Morris-Pratt Search时间复杂度是0(2*n)(喔... 今天看到这里了.. 第一个算法看了个大概, 明天继续看. 效率有点低 囧... ) 阅读全文

posted @ 2013-06-04 00:54 快乐的大猪 阅读(130) 评论(0) 推荐(0) 编辑

2013年3月14日

lua里 table的长度#table 的计算方法

摘要: int luaH_getn (Table *t) { unsigned int j = t->sizearray; if (j > 0 && ttisnil(&t->array[j - 1])) { /* there is a boundary in the array part: (binary) search for it */ unsigned int i = 0; while (j - i > 1) { unsigned int m = (i+j)/2; if (ttisnil(&t->array[m - 1])) j = 阅读全文

posted @ 2013-03-14 16:36 快乐的大猪 阅读(459) 评论(0) 推荐(0) 编辑

lua中 只有 nil 和 false 为假, 其他都为真包括0

摘要: lua中 只有 nil 和 false 为假, 其他都为真包括0 阅读全文

posted @ 2013-03-14 14:14 快乐的大猪 阅读(942) 评论(0) 推荐(0) 编辑

2013年2月22日

string.gfind string.gmatch

摘要: string.gfind 是5.0的 5.1改名成string.gmatch, 但string.gfind名依然有效, 只是5.0后文档里找不到说明 阅读全文

posted @ 2013-02-22 11:06 快乐的大猪 阅读(898) 评论(0) 推荐(0) 编辑

2013年2月6日

do while(false)

摘要: 翻代码,无意发现一行do { // ,, break; // ,,, }while(FALSE)刚开始看挺莫名其妙..心里知道肯定不是闲着无聊这么写的..傻乎乎的去问群里..其实一切都是为了break记录下. 阅读全文

posted @ 2013-02-06 23:07 快乐的大猪 阅读(136) 评论(0) 推荐(0) 编辑

2013年2月4日

[Lua]c解析lua 嵌套table

摘要: void ParseLuaTable(lua_State *L){ if (!lua_istable(L, -1)) { return; } lua_pushnil(L); while (lua_next(L, -2)) { fprintf(stdout, "%s : %s ", luaL_typename(L,-2), luaL_typename(L,-1)); int nKeyType = lua_type(L, -2); int nValueType = lua_type(L, -1); ... 阅读全文

posted @ 2013-02-04 14:37 快乐的大猪 阅读(1518) 评论(0) 推荐(1) 编辑

2013年2月3日

[mac]点关闭按钮后,重新点,恢复窗口

摘要: 绕了一下, 新手,总会再一些莫名其妙的小细节上卡住,而不是正确的调用方式上一般,方法都是对的.小失误记录下首先正确的方法应该是delegate里重写方法- (BOOL) applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag{ if (flag) { return NO; } else { if( _window ) { [_window makeKeyAndOrderFront:self]; ... 阅读全文

posted @ 2013-02-03 17:22 快乐的大猪 阅读(366) 评论(0) 推荐(0) 编辑

2013年2月2日

mac 获取当前时间

摘要: //initializtion parameterNSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];NSDate *now;NSDateComponents *comps = [[NSDateComponents alloc] init];NSInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit | ... 阅读全文

posted @ 2013-02-02 00:37 快乐的大猪 阅读(864) 评论(0) 推荐(0) 编辑

导航