萝卜L

导航

2021年1月10日 #

lua 序列化[de]serialize 支持 循环(cycle reference)、嵌套(nest) 引用

摘要: 早已实现,想到个好的方式。兼顾可读性、折叠。 流程: 分析出单例、多引用,编号,仅考虑后者。 代码执行顺序固定,如: local o='' local function p(i) o=o..i end assert({ p'1', a={ p'2', b={p'3'}, p'4' }, } and 阅读全文

posted @ 2021-01-10 14:04 萝卜L 阅读(197) 评论(0) 推荐(0) 编辑

lua 独立运行 standalone

摘要: 可以为lua.exe创建快捷方式。 快捷方式的文件属性中在目标(...\lua.exe)后附加参数。 路径、参数: 需要脚本文档文件的路径。 可以使用绝对路径或相对路径。 相对路径基于、相对于属性中的起始位置。 起始位置即工作目录。 工作目录默认会被作为查找包(package)的路径(pacage. 阅读全文

posted @ 2021-01-10 10:28 萝卜L 阅读(290) 评论(0) 推荐(0) 编辑

2021年1月8日 #

lua 正则 regular regex PCRE2

摘要: 参考 mah0x211/pcre2: GitHub clone of SVN repo svn://vcs.exim.org/pcre2/code/trunk 语法pcre2\doc\html\pcre2.html rrthomas/lrexlib: A Lua (5.1 and later) bi 阅读全文

posted @ 2021-01-08 20:18 萝卜L 阅读(288) 评论(0) 推荐(0) 编辑

2021年1月4日 #

Iup lua dialog size

摘要: 对话框(iup.dialog)无自然尺寸(Natural size/NATURALSIZE),可以构造位于最外层的容器,(加上对话框边框偏移)来间接获取客户区的自然大小。(进而设置Minsize) 使用 dialog.RASTERSIZE=nil 清除用户尺寸(User size),再读取 dial 阅读全文

posted @ 2021-01-04 21:28 萝卜L 阅读(179) 评论(0) 推荐(0) 编辑

2020年12月30日 #

Iup Lua wheel button scroll caret

摘要: IupLua中,当鼠标在text控件客户区中, SetGlobal('MOUSEBUTTON',..) (模拟滚轮操作(wheel))会触发一次 LEAVEWINDOW_CB - ENTERWINDOW_CB 回调(callback)。 iup.SetGlobal('INPUTCALLBACKS', 阅读全文

posted @ 2020-12-30 21:35 萝卜L 阅读(133) 评论(0) 推荐(0) 编辑

2020年12月28日 #

游览器 收藏 集锦 标签分组

摘要: Microsoft Edge 版本 87.0.664.66 (官方内部版本) (64 位) 标签栏任意标签位置右键菜单,有将所有标签页添加到收藏夹(Ctrl+Shift+D)、将所有标签页添加到新集锦中。 标签栏空白位置右键菜单,有将打开的页面添加到收藏夹(Ctrl+Shift+D)。 组织: 收藏 阅读全文

posted @ 2020-12-28 08:34 萝卜L 阅读(340) 评论(0) 推荐(0) 编辑

2020年12月26日 #

Lua/AHK socket tcp telnet

摘要: 库名为socket(而非luasocket)。 当前版本( require("socket")._VERSION )为3.0-rc1。 master+bind-listen local address=service master+connect remote address=client serv 阅读全文

posted @ 2020-12-26 21:59 萝卜L 阅读(595) 评论(0) 推荐(0) 编辑

Lua wait sleep

摘要: 使用os.execute 执行涉及等待、超时的外部命令、程序。配合 >nul 不显示标准输出流信息。执行过程是阻塞(block)等待的。 os.execute"ping 1.1.1.1 /n 1 /w <time in milliseconds> >nul" ,如os.execute"ping 1. 阅读全文

posted @ 2020-12-26 16:43 萝卜L 阅读(757) 评论(0) 推荐(0) 编辑

Lua io.open read write seek flush setvbuf append

摘要: 读写操作会设置同一个指针, 指针移动的距离为读写内容的长度。 p=f:seek() f:read(num)--假设文件内容够长 assert(f:seek()==p+num) f:write(str) assert(f:seek()==p+num+string.len(str)) f:seek()  阅读全文

posted @ 2020-12-26 11:40 萝卜L 阅读(383) 评论(0) 推荐(0) 编辑

2020年12月24日 #

stream file 文件 数据流

摘要: c - Do stdio file descriptors (stdin, stdout, stderr) get opened, simply from #include'ing <stdio.h>? - Stack Overflow standard streams of a program a 阅读全文

posted @ 2020-12-24 01:43 萝卜L 阅读(176) 评论(0) 推荐(0) 编辑