悉野小楼

导航

上一页 1 2 3 4 5 6 ··· 25 下一页

2024年5月24日

lua打印调用的函数文件及行数

摘要: lua根据调用堆栈可以打印调谁调用了我 string.split = function(s, delim) local split = {} local pattern = "[^" .. delim .. "]+" string.gsub(s, pattern, function(v) table 阅读全文

posted @ 2024-05-24 15:10 悉野 阅读(5) 评论(0) 推荐(0) 编辑

lua 写一个类

摘要: lua的创建类, 自定义class -- lua面向对象扩展 local _class={} function class(super) local class_type={} class_type.ctor=false class_type.super=super class_type.new=f 阅读全文

posted @ 2024-05-24 14:49 悉野 阅读(20) 评论(0) 推荐(0) 编辑

lua string扩展

摘要: lua string常用附加函数 string.split = function(s, delim) local split = {} local pattern = "[^" .. delim .. "]+" string.gsub(s, pattern, function(v) table.in 阅读全文

posted @ 2024-05-24 14:13 悉野 阅读(3) 评论(0) 推荐(0) 编辑

2024年5月23日

lua table函数补充 lua table的扩展

摘要: lua table函数补充 -- lua table扩展 -- 返回table大小 table.size = function(t) local count = 0 for _ in pairs(t) do count = count + 1 end return count end --返回tab 阅读全文

posted @ 2024-05-23 17:27 悉野 阅读(11) 评论(0) 推荐(0) 编辑

2024年5月21日

shell脚本测试

摘要: 1、$#:表示执行脚本传入参数的个数 2、$*:表示执行脚本传入参数的列表(不包括$0) 3、$$:表示进程的id;Shell本身的PID(ProcessID,即脚本运行的当前 进程ID号) 4、$!:Shell最后运行的后台Process的PID(后台运行的最后一个进程的 进程ID号) 5、$@: 阅读全文

posted @ 2024-05-21 09:31 悉野 阅读(22) 评论(0) 推荐(0) 编辑

ubuntu redis导入dump.rdb

摘要: 安装redis //更新包索引sudo apt-update //安装redis服务sudo apt-get install redis-server //查看redis运行状态sudo systemctl status redis-server或sudo service redis status 阅读全文

posted @ 2024-05-21 07:24 悉野 阅读(21) 评论(0) 推荐(0) 编辑

2024年5月20日

mysql允许其它机器连接

摘要: 1.修改MySQL的配置文件(windows是my.ini, linux是 my.cn.cnf或my.cnf),如果有bind-address这一行,值改为0.0.0.0,这样可以允许任意IP地址连接到MySQL服务器。bind-address = 0.0.0.0没有bind-address, 就补 阅读全文

posted @ 2024-05-20 22:13 悉野 阅读(223) 评论(0) 推荐(0) 编辑

2024年5月13日

linux查看某进程占用率

摘要: 可以使用htop, 要安装。 也可以使用ps -aux|grep 程序名, 找到进程id top -p 进程id, 这样top命令只显示这个进程的情况 输入H, 切换到线程模式, 能显示出当前线程占用情况, 是大写的H, 小写的h表示帮助 top命令下还可以按t, m切换cpu占用与内存占用显示模式 阅读全文

posted @ 2024-05-13 15:39 悉野 阅读(9) 评论(0) 推荐(0) 编辑

2024年4月28日

mongodb修改数据

摘要: mongodb修改数据, 条件是: nickname以StressRobot开头, 对应每行字段的gold设置为5000 db.user.updateMany( { "nickname": { $regex: "^StressRobot" } }, { "$set": { "gold": 5000 阅读全文

posted @ 2024-04-28 14:11 悉野 阅读(4) 评论(0) 推荐(0) 编辑

2024年3月5日

lua模块化编程

摘要: moduleA.lua -- moduleA.lua local moduleA = {} function moduleA.hello() print("Hello from moduleA") --与调用者同一个环境, 可以调用到原环境中的sayHi函数 sayHi() end return m 阅读全文

posted @ 2024-03-05 14:31 悉野 阅读(18) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 25 下一页