上一页 1 ··· 36 37 38 39 40
摘要: local Stack = {} Stack.__cname = "util.Stack" Stack.__index = Stack function Stack.new2(src) assert("util.Stack" == src.__cname, "InvalidArgument: not 阅读全文
posted @ 2021-11-12 00:28 yanghui01 阅读(17) 评论(0) 推荐(0) 编辑
摘要: # 在table的基础山增加了更直观的列表操作函数,同时使用了_count来跟踪元素数量 local list = {} list.__cname = "util.list" local null = {} list.null = null list.__newindex = function(se 阅读全文
posted @ 2021-11-12 00:26 yanghui01 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 把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 阅读(146) 评论(0) 推荐(0) 编辑
摘要: # for in遍历, 跟在in后面是3个参数:iteratorFunc, iteratorObj, initArg 第1次时,会用iteratorObj和initArg调用iteratorFunc, iteratorFunc(iteratorObj, initArg) 第2次时,会用iterato 阅读全文
posted @ 2021-11-06 17:36 yanghui01 阅读(982) 评论(0) 推荐(0) 编辑
摘要: 类似其他语言下的try, catch: pcall(func, arg1, ...) 相当于捕获了不做任何处理 1 try { 2 //do something 3 } catch (Exception ex) { 4 // do nothing 5 } xpcall(func, exception 阅读全文
posted @ 2021-03-03 15:40 yanghui01 阅读(228) 评论(0) 推荐(0) 编辑
摘要: ubuntu下一个用来管理开机自启动服务的程序,今天在ss vps上安装时老是提示这个错误,百度后,下面的这个方法可行: vi /etc/apt/source.list 输入i,进入Insert模式 在最后加入 deb http://archive.ubuntu.com/ubuntu/ trusty 阅读全文
posted @ 2018-10-07 06:55 yanghui01 阅读(1727) 评论(0) 推荐(0) 编辑
摘要: 【插件的默认安装位置】 # 查看方式:菜单 -> Preferences -> Browse Packages 一般默认为:C:\Users\用户名\AppData\Roaming\Sublime Text 3\Packages # 如果想更改到安装目录: 关闭Sublime Text,找到Subl 阅读全文
posted @ 2018-09-30 14:41 yanghui01 阅读(362) 评论(0) 推荐(0) 编辑
摘要: cmd + shift + p,输入installpacket,选择第1个 再输入pretty,选择第1个,插件就安装完成了 尝试一下,cmd + shift + p打开输入窗口,选择第2个,就可以格式化这个json了 阅读全文
posted @ 2018-09-30 14:38 yanghui01 阅读(618) 评论(0) 推荐(0) 编辑
上一页 1 ··· 36 37 38 39 40