[cplayer] Reading config file /home/zachary/.config/mpv/mpv.conf
[cplayer] Setting option 'no-border' = '' (flags = 4)
[cplayer] Setting option 'ontop' = 'no' (flags = 4)
[cplayer] Setting option 'save-position-on-quit' = 'yes' (flags = 4)
[cplayer] Setting option 'autofit-larger' = '100%' (flags = 4)
[cplayer] Setting option 'profile' = 'pseudo-gui' (flags = 4)
[cplayer] Setting option 'terminal' = 'no' (flags = 4)
libva info: VA-API version 0.38.1
libva info: va_getDriverName() returns 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local socket = require("socket") | |
local host, port = "180.101.50.242", 80 | |
local sock = socket.connect(host, port) | |
sock:settimeout(1) | |
sock:send("GET / HTTP/1.1\r\n\r\n") | |
sock:close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- memory test | |
local size = 1000000 | |
local t = {} -- create a table | |
local function report(title) | |
collectgarbage() | |
collectgarbage() | |
print(title, collectgarbage("count")) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function list_iter (t) | |
local i = 0 | |
local n = #t | |
return function () | |
i = i + 1 | |
if i <= n then return t[i] end | |
end | |
end | |
local t = { 10, 20, 30 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- deeply compare two objects like 'pl.tablex.deepcompare()' | |
local function deep_equals(t1, t2, ignore_mt) | |
-- different type | |
if t1Type ~= t2Type then return false end | |
-- compare simple values directly | |
if t1Type ~= 'table' then return t1 == t2 end | |
-- both table type; try metatable method | |
if not ignore_mt then | |
local mt1 = getmetatable(t1) |
a-a 12 34 12
a-a-a 56 56
a-ba-ao-ke-luo 78 90 90
Each line is a key values pattern. The key is a string delimited by hyphens. while values delimited by spaces.
I want to remove duplicate vlaues on each line:
I want to merge lines that share common prefix. Example:
a 1
a 2
bc-de 3
bc-de 4
bc-de 5
After merging:
I want to merge lines that share common prefix. Example:
a 1
a 2
bc-de 3 4
bc-de 5
After merging:
I want to merge lines that share common prefix. Example:
a 1
a 2
a-b 3
a-b 4
a-b 5
After merging:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I want to merge lines that share common prefix. Example: | |
``` | |
a 1 | |
a 2 | |
a-b 3 | |
a-b 4 | |
a-b 5 | |
``` | |
After merging: |