ÈçºÎд³öרҵµÄCÍ·Îļþ
×öµ½×¨Òµ£¬Ó¦¸ÃÊÇÿ¸öÖ°Òµ³ÌÐòÔ±Ó¦¸ÃÒªÇó×Ô¼º×öµ½µÄ¡£
ÈÃÎÒÃÇ¿´¿´lua
ÊÇ
ÔõôдͷÎļþµÄ¡£
1.License Agreement
License
Agreement
Ó¦¸Ã¼ÓÔÚÿ¸öÍ·ÎļþµÄ¶¥²¿¡£
Lua Sample:
/*
** $Id: lua.h,v 1.175b 2003/03/18 12:31:39 roberto Exp $
** Lua - An Extensible Extension Language
** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
**
http://www.lua.org
mailto:info@lua.org
** See Copyright Notice at the end of this file
*/
2.guard define
Õû¸öÍ·ÎļþÓ¦¸ÃÔÚguard
define
Ö®¼ä
#ifndef lua_h
#define
lua_h
#endif
ÁíÍ⣬Èç¹ûÕâ¸öÍ·Îļþ¿ÉÄܸø
c++
ʹÓã¬Òª¼ÓÉÏ
#ifdef __cplusplus
extern
"
C
"
{
#endif
/*
The lines within extern "C"
*/
#ifdef __cplusplus
}
#endif
3.
¾¡Á¿²»ÒªÔÚÍ·ÎļþÖб©Â¶Êý¾Ý½á¹¹
ÕâÑù¿ÉÒÔÓû§¶ÔÄãµÄʵÏÖµÄÒÀÀµ£¬Ò²¼õÉÙÁËÓû§µÄ±àÒëʱ¼ä
typedef
struct
lua_State lua_State;
LUA_API lua_State
*
lua_open (
void
);
LUA_API
void
lua_close (lua_State
*
L);
¿ÉÒÔ¿´µ½ËäÈ»Óû§»áһֱʹÓÃ
lua_State,
µ«ÊDz¢²»ÖªµÀ
lua_State
µÄ
½á¹¹ÊÇʲô
´ÓÒ»¸öʹÓÃ
lua
µÄÀý×Ó³ÌÐò¿ÉÒÔ¿´³ö£º
#include
"
lua.h
"
#include
"
lauxlib.h
"
#include
"
lualib.h
"
int
main(
int
argc,
char
*
argv[])
{
lua_State
*
L
=
lua_open();
const
char
*
buf
=
"
var = 100
"
;
int
var ;
luaopen_base(L);
luaopen_io(L);
lua_dostring(L, buf);
&n
Ïà¹ØÎĵµ£º
B/S ÊÇ Brower/Server ¾ÍÊÇÓÃä¯ÀÀÆ÷(ÈçIE)ΪӦÓóÌÐò¿Í»§¶Ë²Ù×÷·þÎñÆ÷¡£ÕâÑùÓÃä¯ÀÀÆ÷À´²Ù×÷¼òµ¥Ò×Ó㬵«ÊǶÔÊäÈëûÓкܺõÄÑéÖ¤¡£Â߼ʵÏÖ²»¶à¡£±¾µØÖ»ÊÇÓÃÓÚ»ñÈ¡Êý¾ÝÈ»ºó´ó²¿·ÖÑéÖ¤ÐèÒªÌá½»·þÎñÆ÷À´Íê³É¡£
C/S ÊÇClient/Server ¿Í»§¶ËÈí¼þÔòÊÇÒ»¸öÓµÓкܶàÂß¼ÑéÖ¤µÄÈí¼þ£¬±¾µØÑéÖ¤³É¹¦ºó²ÅÌá½»·þÎñÆ÷¡£
ÎÒÕÒµ½µÄ¸üÏêϸР......
In C++, how do i go about using setenv to set the display? I need to set it like this:
export DISPLAY=0.0
1¡¢setenv("DISPLAY",":0.1",1);
If you're calling the xrandr functions from your C++ program, then I would expect setenv() should work for you. The 3rd argument of 1 tells setenv() to ov ......
ÒªÏëÓÃeclipse¿ª·¢C/C++ Ê×ÏÈÒªÅäÖÃÒ»¸öC/C++µÄ±àÒë»·¾³£¬ÒòΪeclipse×ÔÉíÊDz»´øµÄ¡£ ÐèÒªÏÂÃæÕâÁ½¸ö±Ø²»¿ÉÉٵŤ¾ß 1.±àÒ빤¾ß MinGW£ºhttp://www.mingw.org/ Ö±½ÓÏÂÔØµØÖ·£ºhttp://sourceforge.net/projects/mingw/files/ 2.eclipse²å¼þ CDT £ ......
ת
ÔØ×Ôhttp://www.builder.com.cn/
static
ÊÇc++Öкܳ£ÓõÄÐÞÊηû£¬Ëü±»ÓÃÀ´¿ØÖƱäÁ¿µÄ´æ´¢·½Ê½ºÍ¿É¼ûÐÔ£¬ÏÂÃæÎÒ½«´Ó static ÐÞÊηûµÄ²úÉúÔÒò¡¢×÷ÓÃ̸Æð£¬È«Ãæ·ÖÎöstatic
ÐÞÊηûµÄʵÖÊ¡£
¡¡¡¡static µÄÁ½´ó×÷ÓÃ:
¡¡¡¡Ò»¡¢¿ØÖÆ´æ´¢·½Ê½£º
¡¡¡¡static±»ÒýÈëÒÔ¸æÖª±àÒëÆ÷£¬½«±ä ......
¿ìËÙÃÝȡģÀíÂÛ»ù´¡£º ¼ÆËã a^b mod c ?
ÓÉ(a x b) mod c=((a mod c) x b) mod c.
ÎÒÃÇ¿ÉÒÔ½« bÏȱíʾ³É¾Í£º
b=at2^t+at-1 2^t-1+……a02^0. (ai=[0,1]).
ÕâÑùÎÒÃÇÓÉ a^b mod c=(a^(at2^t+at-12^t-1+…a02^0)mod c.
È»¶øÎÒÃÇÇó a^(2^(i+1)) ......