会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
就当笔记吧
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
43
44
45
46
47
2021年11月12日
数组列表 list
摘要: # 在table的基础山增加了更直观的列表操作函数,同时使用了_count来跟踪元素数量 local list = {} list.__cname = "util.list" local null = {} list.null = null list.__newindex = function(se
阅读全文
posted @ 2021-11-12 00:26 yanghui01
阅读(60)
评论(0)
推荐(0)
2021年11月9日
lua __call
摘要: 把table当做函数一样调用时触发 local obj = {} local mt = { __call = function(tb, target) print("__call") end } setmetatable(obj, mt) obj(1) # 可以实现ClassName()直接触发对象
阅读全文
posted @ 2021-11-09 10:45 yanghui01
阅读(202)
评论(0)
推荐(0)
2021年11月6日
lua for in理解
摘要: # for in遍历, 跟在in后面是3个参数:iteratorFunc, iteratorObj, initArg 第1次时,会用iteratorObj和initArg调用iteratorFunc, iteratorFunc(iteratorObj, initArg) 第2次时,会用iterato
阅读全文
posted @ 2021-11-06 17:36 yanghui01
阅读(1212)
评论(0)
推荐(0)
2021年3月3日
错误处理 pcall, xpcall
摘要: pcall pcall(func, arg1, ...) 相当于捕获了不做任何处理 类似其他语言下的try, catch: try { //do something } catch (Exception ex) { // do nothing } local function Div(a, b) r
阅读全文
posted @ 2021-03-03 15:40 yanghui01
阅读(292)
评论(0)
推荐(0)
2018年10月7日
ubuntu Unable to locate package sysv-rc-conf
摘要: ubuntu下一个用来管理开机自启动服务的程序,今天在ss vps上安装时老是提示这个错误,百度后,下面的这个方法可行: vi /etc/apt/source.list 输入i,进入Insert模式 在最后加入 deb http://archive.ubuntu.com/ubuntu/ trusty
阅读全文
posted @ 2018-10-07 06:55 yanghui01
阅读(1745)
评论(0)
推荐(0)
2018年9月30日
sublime插件设置
摘要: 【插件的默认安装位置】 # 查看方式:菜单 -> Preferences -> Browse Packages 一般默认为:C:\Users\用户名\AppData\Roaming\Sublime Text 3\Packages # 如果想更改到安装目录: 关闭Sublime Text,找到Subl
阅读全文
posted @ 2018-09-30 14:41 yanghui01
阅读(428)
评论(0)
推荐(0)
sublime插件-json格式化插件,Pretty Json
摘要: cmd + shift + p,输入installpacket,选择第1个 再输入pretty,选择第1个,插件就安装完成了 尝试一下,cmd + shift + p打开输入窗口,选择第2个,就可以格式化这个json了
阅读全文
posted @ 2018-09-30 14:38 yanghui01
阅读(664)
评论(0)
推荐(0)
上一页
1
···
43
44
45
46
47
公告