lua

VLC Scripting with Lua: Jump to a specific time in a file?

北战南征 提交于 2020-12-28 06:50:57
问题 This seems like it should be simple, but I'm coming up empty handed here. I'm trying to make a simple VLC script that checks if the "random" button is on, and if so when it jumps to a random file, instead of starting at time=0, it starts at a random time. So far, it's looking to me like it should be a playlist script and I can get the duration from the playlist object, but in this documentation page or on Google, I can't seem to find any way to jump to a specific time from within the Lua

How can I get the lua stack trace from a core file using gdb

谁说我不能喝 提交于 2020-12-27 08:51:32
问题 I have a C++ application (for OS X) that calls lua as a scripting language. I'm running a large number of these applications (100s) and they can run for a very long time (days or weeks). Sometimes one crashes. And when it crashes it leaves me a lovely core file. I can open this core file in gdb and find where the application crashes. I can walk the call stack and find an instance of a lua_State variable. My problem is that I'd like to see what the lua call stack looks like at this time...

How can I get the lua stack trace from a core file using gdb

三世轮回 提交于 2020-12-27 08:51:01
问题 I have a C++ application (for OS X) that calls lua as a scripting language. I'm running a large number of these applications (100s) and they can run for a very long time (days or weeks). Sometimes one crashes. And when it crashes it leaves me a lovely core file. I can open this core file in gdb and find where the application crashes. I can walk the call stack and find an instance of a lua_State variable. My problem is that I'd like to see what the lua call stack looks like at this time...

Convert a string date to a timestamp

人盡茶涼 提交于 2020-12-27 08:24:06
问题 Is there any simple way to convert a RFC HTTP date into a timestamp in Lua? "Sat, 29 Oct 1994 19:43:31 GMT" into 783467011 回答1: Correcting lhf's example code to account for timezone since os.time() does not have a way to specify the timezone. Also assume all input ends in GMT since this only works with GMT. s="Sat, 29 Oct 1994 19:43:31 GMT" p="%a+, (%d+) (%a+) (%d+) (%d+):(%d+):(%d+) GMT" day,month,year,hour,min,sec=s:match(p) MON={Jan=1,Feb=2,Mar=3,Apr=4,May=5,Jun=6,Jul=7,Aug=8,Sep=9,Oct=10

I downloaded the mp4 file using Lua script, but TikTok(Other apps) cannot find the video

旧城冷巷雨未停 提交于 2020-12-26 22:47:06
问题 After successfully downloading the mp4 file using the Lua script on the Android phone, the system Videos cannot detect the 1.mp4 file, and the video cannot be found in TikTok to publish. I downloaded 1.mp4 using a script. I manually copied 1.mp4 to become copy.mp4. 1.mp4 cannot be detected by tiktok copy.mp4 can be detected by tiktok Neither file is hidden I checked the permissions of two files : -rw-rw---- root sdcard_ rw 6939904 2020-11-12 22:07 1. mp4 -rw-rw---- root sdcard_ rw 6939904

Web 开发人员喜欢 Brackets 文本编辑器的原因 | Linux 中国

余生长醉 提交于 2020-12-26 15:07:15
这个基础的编辑器是面向 Web 开发人员的,它支持多种编程语言,并提供了大量的扩展,使其成为你自己的编辑器。 来源: https:// linux.cn/article-12952- 1.html 作者:Seth Kenlon 译者:geekpi (本文字数:1570,阅读时长大约:2 分钟) Brackets 文本编辑器是主要面向 Web 开发人员的编辑器。恰如其分的是,它的“编辑”菜单中充满了对 Web 编程语言用户特别有用的功能,主要是 HTML、CSS 和 Javascript 的经典组合。 但是,它还支持许多与互联网相关的语言和格式,包括 XML、Markdown、YAML 和 JSON、PHP、Lua、Java 和 Python,以及一些常见的通用语言,例如 C、C++,甚至是 diff 命令的输出。 安装 Brackets Brackets 可以从 Brackets 网站 安装到 Linux、Windows 和 macOS 上。 另外,在 Linux 上,你可以从 flathub.org 以 Flatpak 安装。 Brackets editor 使用 Brackets 在大多数时候,Brackets 是一个“普通”的文本编辑器,其功能类似于 jEdit 或 Medit 。有语法高亮、可配置的制表符间距、字符编码设置等等。这些都可以在窗口底部的状态栏中找到。 在“视图

Web 开发人员喜欢 Brackets 文本编辑器的原因

巧了我就是萌 提交于 2020-12-26 15:01:45
这个基础的编辑器是面向 Web 开发人员的,它支持多种编程语言,并提供了大量的扩展,使其成为你自己的编辑器。 Brackets 文本编辑器是主要面向 Web 开发人员的编辑器。恰如其分的是,它的“编辑”菜单中充满了对 Web 编程语言用户特别有用的功能,主要是 HTML、CSS 和 Javascript 的经典组合。 但是,它还支持许多与互联网相关的语言和格式,包括 XML、Markdown、YAML 和 JSON、PHP、Lua、Java 和 Python,以及一些常见的通用语言,例如 C、C++,甚至是 diff 命令的输出。 安装 Brackets Brackets 可以从 Brackets 网站 安装到 Linux、Windows 和 macOS 上。 另外,在 Linux 上,你可以从 flathub.org 以 Flatpak 安装。 使用 Brackets 在大多数时候,Brackets 是一个“普通”的文本编辑器,其功能类似于 jEdit 或 Medit 。有语法高亮、可配置的制表符间距、字符编码设置等等。这些都可以在窗口底部的状态栏中找到。 在“视图”菜单中,有主题设置、行号、自动换行,甚至还有分割窗口的选项,这样你可以在一个窗口中看到两个文件。 然而,在“编辑”菜单中,有一些的特别用于编程的功能。以下是我最喜欢的一些功能: 使用 Ctrl+[ 或 Ctrl+]

How to set proxy_http_version in LUA code before upstreaming the request in nginx

北城余情 提交于 2020-12-26 12:14:40
问题 I want to change the proxy http version in Lua code programmatically. Is there any way? Yes, I know that we can set it via the nginx config file in the location/server block. Is there any way that I can do it using Lua dynamically per request? 回答1: Updated 14.10.2020 location / { content_by_lua_block { -- some logic here if flag then return ngx.exec("@http1_0") end return ngx.exec("@http1_1") } } location @http1_0 { proxy_pass ...; proxy_http_version 1.0; ... } location @http1_1 { proxy_pass

Redis Lua脚本完全入门

天涯浪子 提交于 2020-12-26 09:44:34
1. 前言 Redis是高性能的KV内存数据库,除了做缓存中间件的基本作用外还有很多用途,比如胖哥以前分享的 Redis GEO地理位置信息计算 。Redis提供了丰富的命令来供我们使用以实现一些计算。Redis的单个命令都是原子性的,有时候我们希望能够组合多个Redis命令,并让这个组合也能够原子性的执行,甚至可以重复使用,在软件热更新中也有一席之地。Redis开发者意识到这种场景还是很普遍的,就在2.6版本中引入了一个特性来解决这个问题,这就是Redis执行Lua脚本。 2. Lua Lua也算一门古老的语言了,玩魔兽世界的玩家应该对它不陌生,WOW的插件就是用Lua脚本编写的。在高并发的网络游戏中Lua大放异彩被广泛使用。 Lua广泛作为其它语言的嵌入脚本,尤其是C/C++,语法简单,小巧,源码一共才200多K,这可能也是Redis官方选择它的原因。 另一款明星软件Nginx也支持Lua,利用Lua也可以实现很多有用的功能。 3. Lua并不难 Redis 官方指南也指出不要在Lua脚本中编写过于复杂的逻辑。 为了实现一个功能就要学习一门语言,这看起来就让人有打退堂鼓的感觉。其实Lua并不难学,而且作为本文的场景来说我们不需要去学习Lua的完全特性, 要在Redis中轻量级使用Lua语言 。这对掌握了Java这种重量级语言的你来说根本不算难事

GOT Online for Unreal 功能更新

╄→尐↘猪︶ㄣ 提交于 2020-12-26 08:38:05
GOT Online在去年就已经支持了Unreal引擎,它不仅灵活便捷,还提供了数据的深度分析, 例如引擎各模块的耗时分布、资源的具体信息等高级分析功能 。为进一步满足广大Unreal开发者的需求,近期我们 增加了对Unreal 4.25版本的支持,同时支持“Lua性能分析”模式。目前该服务免费提供给Unreal开发者使用。 使用方法非常简单: 1)在UWA官网下载工具套件,参照文档说明集成SDK 2)在本地真机上进行测试 3)将测试所得数据一键上传到UWA官网 4)登录UWA官网在项目页面中查看对应的报告 目前GOT Online for Unreal提供三种模式:Overview(总体性能分析)、Assets(运行时资源检测)、Lua性能分析。 关于之前已支持的Overview与Assets模式,详情可戳本链接 。下文将对本次新增的 Lua性能分析模式 做介绍。当前仅4.25版本支持Lua模式,且仅支持SLua。后续我们会陆续支持其它Lua框架,同时也会陆续对4.20-4.24进行Lua模式的支持。 Lua性能检测目前分为三个部分:总体堆内存、CPU时间占用和堆内存具体分配。 1、总体堆内存 该页面记录了Lua的总内存走势以及Lua中几种重要对象的数量:Table、Function和Userdata。 2、CPU时间占用 在CPU时间占用页面