函数环境
function foo()
print(g or "No g defined!")
end
foo()
setfenv(foo, { g = 100, print = print }) --设置foo的环境为表{ g=100, ...}
foo()
print(g or "No g defined!")
--No g defined!
--100
--No g defined!...
分类:
其他好文 时间:
2014-07-22 22:59:54
阅读次数:
338
Given a binary tree, determine if it is
height-balanced.For this problem, a height-balanced binary tree is defined as a
binary tree in which the depth...
分类:
其他好文 时间:
2014-05-01 14:38:39
阅读次数:
454
Visual Studio 2005 移植 - WINVER,warning C4996,
error LINK1104一、WINVER Compile result: WINVER not defined. Defaulting to 0x0502
(Windows Server 2003) wi...
[cpp]view
plaincopy//Capture.hforclassCCapture#include#include#include#if!defined(CAPTURE_H_________)#defineCAPTURE_H_________//imagesize:160*120176*1...
分类:
其他好文 时间:
2014-05-01 10:31:47
阅读次数:
702
[1]The import com.baidu.mapapi.map.Geometry
conflicts with a type defined in the same
file解决:百度api包下的Geometry和某个类名相冲突,将类名换成另外的名字,不要和百度相关类里面的类名相同[2]jav...
分类:
移动开发 时间:
2014-05-01 08:56:27
阅读次数:
648
Pat1063代码
题目描述:
Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets,
and Nt is the to...
分类:
其他好文 时间:
2014-04-29 13:44:20
阅读次数:
325
思路1)从dll中导入 FlashWindowEx函数2)调用 1 // 声明 2 #if
defined (__cplusplus) 3 extern "C"{ 4 #endif 5 WINUSERAPI BOOL WINAPI
FlashWindowEx(PFLASHWINFO pfwi); 6...
分类:
其他好文 时间:
2014-04-29 10:17:46
阅读次数:
336
由于静态库是不需要导出的,所以在写QT的前置声明的时候需要说明
#if defined(QT_SHARED)
#ifdef COMMONLIB
#define COMMONLIB_EXPORT Q_DECL_EXPORT
#else
#define COMMONLIB_EXPORT Q_DECL_IMPORT
#endif
#else
#ifdef COMMONLIB
#defi...
分类:
其他好文 时间:
2014-04-28 10:47:42
阅读次数:
374