上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 31 下一页
摘要: ####官方文档中的解释 针对目前的lua5.4,官方api中对coroutine的解释如下 函数名 参数 返回值 作用 coroutine.create(f) function thread 创建一个主体函数为 f 的新协程。 f 必须是一个 Lua 的函数。 返回这个新协程,它是一个类型为 "t 阅读全文
posted @ 2021-05-27 19:38 Smah 阅读(661) 评论(0) 推荐(0) 编辑
摘要: 功能码 描述 作用 数据类型 0x01 读线圈 取得一组逻辑线圈的当前状态(ON/OFF) 位 0x02 读取离散输入 取得一组开关输入的当前状态(ON/OFF) 位 0x03 读寄存器 在一个或多个保持寄存器中取得当前的二进制值 整型字符型状态字浮点型 0x04 读取输入寄存器 在一个或多个输入寄 阅读全文
posted @ 2021-05-20 15:02 Smah 阅读(2284) 评论(0) 推荐(0) 编辑
摘要: function And(num1,num2) local tmp1 = num1 local tmp2 = num2 local ret = 0 local count = 0 repeat local s1 = tmp1 % 2 local s2 = tmp2 % 2 if s1 == s2 a 阅读全文
posted @ 2021-04-21 13:44 Smah 阅读(959) 评论(0) 推荐(0) 编辑
摘要: 1.类型不同 strlen是一个函数,sizeof是一个关键字(取字节运算符) 阅读全文
posted @ 2021-03-18 11:45 Smah 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 安装 5.2版本的库:sudo apt-get install liblua5.2-dev 版本不同调用的接口就不同,本文针对lua5.2 //lutil.c#include <lua.h> #include <lauxlib.h> #include <string.h> #include <std 阅读全文
posted @ 2021-03-11 15:00 Smah 阅读(867) 评论(0) 推荐(0) 编辑
摘要: 1.写一个Json库 链接: https://github.com/miloyip/json-tutorial/blob/master/tutorial01/tutorial01.md 2.写一个红黑树 链接: https://github.com/william-zk/RB_Tree 3.写一个S 阅读全文
posted @ 2021-02-19 10:19 Smah 阅读(3201) 评论(1) 推荐(2) 编辑
摘要: -- 全局变量,记录key local limit = {} -- 2为两次可以调用的最小间隔,单位秒if limit[key] then --判断是否可被调用 local lasttime = limit[key].lasttime local curtime = os.time() if cur 阅读全文
posted @ 2021-02-03 19:35 Smah 阅读(87) 评论(0) 推荐(0) 编辑
摘要: a. 速记关键词: 动态生产对象1. 工厂方法模式(Factory Method):定义一个创建对象的接口,但由子类决定需要实例化哪一个类。 工厂方法使得子类实例化的过程推迟 a. 速记关键词: 生产成系列对象2. 抽象工厂模式(Abstract Factory):提供一个接口,可以创建一系列相关或 阅读全文
posted @ 2021-01-28 16:07 Smah 阅读(200) 评论(0) 推荐(0) 编辑
摘要: SELECT * FROM carregisterinfo a WHERE (a.plate) IN ( SELECT plate FROM carregisterinfo GROUP BY plate HAVING count(*) >= 1 ) AND id IN ( SELECT max(id 阅读全文
posted @ 2021-01-12 09:08 Smah 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1.apt-get install liblua5.1-0-dev 2.编辑hello.c #include "lua.h" #include "lauxlib.h" int main(int argc, char **argv) { lua_State *L = luaL_newstate(); 阅读全文
posted @ 2020-12-17 16:37 Smah 阅读(3074) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 31 下一页