08 2012 档案

摘要:cpFile.lua 1 function copyfile(source, destination) 2 sourcefile = io.open(source,"r") 3 assert(sourcefile) 4 destinationfile = io.open(destination,"w") 5 assert(destinationfile) 6 for line in sourcefile:lines() do 7 print(line) 8 destinationfile:write(line) 9 destinationfile:wri 阅读全文
posted @ 2012-08-26 22:49 good90 阅读(3275) 评论(0) 推荐(0)
摘要:记下两篇写的不错的文章:http://www.cnblogs.com/whiteyun/archive/2009/09/02/1541043.htmlhttp://blog.csdn.net/blueboy2000/article/details/5441745 阅读全文
posted @ 2012-08-26 17:53 good90 阅读(228) 评论(0) 推荐(0)
摘要:File:singleton.hpp 1 #ifndef __SINGLETON_HPP_ 2 #define __SINGLETON_HPP_ 3 4 template <class T> 5 class Singleton 6 { 7 public: 8 static T* Instance() { 9 if(!m_pInstance) m_pInstance = new T;10 assert(m_pInstance !=NULL);11 return m_pInstance;12 }13 protected:14 Singleton()... 阅读全文
posted @ 2012-08-24 14:07 good90 阅读(284) 评论(0) 推荐(0)
摘要:先看代码: 1 function permgen (a, n) 2 if 0 == n then 3 printResult(a) 4 else 5 for i=1,n do 6 a[n], a[i] = a[i], a[n] 7 permgen(a, n -1) 8 a[n], a[i] = a[i], a[n] 9 end10 end11 end12 13 function printResult (a)14 for i,v in ipairs(a) do15 ... 阅读全文
posted @ 2012-08-19 12:04 good90 阅读(6814) 评论(0) 推荐(1)
摘要:首先配置环境,百度文库里这个讲的很详细http://wenku.baidu.com/view/7912da3667ec102de2bd8957.html环境配置好之后,我也写了个简单的调用main.cpp 1 #include <stdio.h> 2 3 extern "C"{ 4 #include "lua.h" 5 #include "lualib.h" 6 #include "lauxlib.h" 7 }; 8 9 10 lua_State *L;11 int luaAdd(int x, int 阅读全文
posted @ 2012-08-19 00:11 good90 阅读(22534) 评论(2) 推荐(0)
摘要:loadrunner linux安装自然不用多讲,网上很多。推荐两个写的比较全的:http://www.51testing.com/?uid-116228-action-viewspace-itemid-219400http://lanyan-lan.iteye.com/blog/504979记一下我安装时遇到的问题:安装rsh-server时候找不到依赖error:RPM install Error:Failed dependencies needed *.so于是找到这个方法,当然了,如果你将需要的库安装起来会更好。rpm -i --force --nodeps rsh-server-0. 阅读全文
posted @ 2012-08-09 22:16 good90 阅读(188) 评论(0) 推荐(0)
摘要:看下面一个简单例1 function fac(n)2 if n == 0 then3 return 14 else5 return fac(n-1)6 end7 end像这种在函数的末尾返回一个函数就是尾调用,这个尾调用并不像C++函数调用一样需要额外的堆栈空间,而是相对于g... 阅读全文
posted @ 2012-08-09 22:09 good90 阅读(2521) 评论(5) 推荐(0)