随笔分类 -  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 阅读全文
posted @ 2017-06-05 00:01 听风的日子 阅读(337) 评论(0) 推荐(0)
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 ... 阅读全文
posted @ 2016-10-24 14:55 听风的日子 阅读(316) 评论(0) 推荐(0)
lua 快速排序
摘要:function partion(arr, left, right) local tmp = arr[left] while left = tmp do right = right - 1 end ... 阅读全文
posted @ 2015-06-30 21:38 听风的日子 阅读(949) 评论(0) 推荐(0)
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.... 阅读全文
posted @ 2015-05-13 23:16 听风的日子 阅读(338) 评论(0) 推荐(0)
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 ... 阅读全文
posted @ 2015-05-11 21:46 听风的日子 阅读(1203) 评论(0) 推荐(0)
lua 入门学习
摘要:-- 1.Hello world print( "--------------1--------------")print("Hello world");-- 2. function definefunction add(a,b) return a + bendprint( "-------... 阅读全文
posted @ 2015-04-09 21:20 听风的日子 阅读(139) 评论(0) 推荐(0)