随笔分类 - language
用于编程语言的研究,包括编译原理
Private Inheritance for C++
摘要:C++ has a second means of implementing the has-a relationship: private inheritance.With private inheritance, public and protected members of the base
阅读全文
serialize data use msgpack
摘要:#ifndef _BYTEBUFFER_H #define _BYTEBUFFER_H #include typedef unsigned char uint8; /* Unsigned 8 bit quantity */ typedef signed char int8; /* Signed 8 bit quantity ...
阅读全文
lua 快速排序
摘要:function partion(arr, left, right) local tmp = arr[left] while left = tmp do right = right - 1 end ...
阅读全文
lua 自己编译源文件
摘要:1,下载源代码 http://www.lua.org/download.html 直接下载source2,vs2010新建win32项目 应用程序设置中设成静态库3,将.c(除去lua.c)和.h文件加入到工程4,lua源代码文件中的lauxlib.h、lua.h、luaconf.h、lualib....
阅读全文
lua 位运算
摘要:bit = {data32={}}for i = 1, 32 do bit.data32[i] = 2^(32-i)endfunction bit:d2b( arg ) local num = tonumber( arg ) local tr = {} if num ...
阅读全文
lua 入门学习
摘要:-- 1.Hello world print( "--------------1--------------")print("Hello world");-- 2. function definefunction add(a,b) return a + bendprint( "-------...
阅读全文
浙公网安备 33010602011771号