This file contains 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 binser = require "binser" | |
local unpack = table.unpack or unpack | |
local error_patterns = { | |
"Expected more bytes of input", | |
"Could not deserialize type byte", | |
"Expected more bytes of input", | |
"Got nil resource name", | |
"Expected table metatable", | |
"No resources found for name", |
This file contains 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
<1>{ | |
[1] = {}, | |
[2] = { | |
autoReconnect = true, | |
bitrate = 64000, | |
cacheAllMembers = false, | |
compress = true, | |
dateTime = "%F %T", | |
firstShard = 0, | |
largeThreshold = 100, |
This file contains 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
#!/usr/bin/env bash | |
# TODO: write a program called `rock2bin` that does this all in | |
# one call (`rock2bin luacheck -l 5.3 -t windows`). | |
mkdir build | |
curl https://www.lua.org/ftp/lua-5.3.4.tar.gz | tar xz | |
luarocks unpack luafilesystem 1.6.3-2 | |
luarocks unpack lanes 3.10.1-1 |
This file contains 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
Missing dependency for cgilua 5.1.4-2: luafilesystem >= 1.5.0 | |
Missing dependency for busted 2.0.rc12-1: luafilesystem >= 1.5.0 | |
Missing dependency for busted 2.0.rc12-1: luafilesystem | |
Missing dependency for penlight 1.4.1-1: luafilesystem | |
Missing dependency for xavante 2.4.0-1: luafilesystem >= 1.6.0 | |
Missing dependency for wsapi 1.6.1-1: luafilesystem >= 1.6.2 | |
Missing dependency for sailor 0.5-4: luafilesystem >= 1.5.0 | |
Missing dependency for sailor 0.5-4: luafilesystem | |
Missing dependency for sailor 0.5-4: luafilesystem >= 1.6.2 | |
Missing dependency for sailor 0.5-4: luafilesystem >= 1.6.0 |
This file contains 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 lua = "lua" | |
local i = 0 | |
while arg[i] do | |
lua = arg[i] | |
i = i - 1 | |
end | |
local is_windows = package.config:sub(1, 1) == "\\" |
This file contains 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
-- Usage: lua test-normpath.lua [count | path] | |
local path = require "pl.path" | |
local socket = require "socket" | |
math.randomseed(math.floor(socket.gettime() * 1000)) | |
local chars = "./A" | |
local function gen_random_path() | |
local length = math.random(0, 5) + math.random(0, 5) |
This file contains 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
Installing https://luarocks.org/sailor-0.5-4.src.rock | |
Missing dependencies for sailor 0.5-4: | |
datafile >= 0.1 (not installed) | |
luafilesystem >= 1.6.2 (not installed) | |
valua >= 0.2.2 (not installed) | |
lbase64 >= 20120807 (not installed) | |
cgilua >= 5.1.4 (not installed) | |
xavante >= 2.3 (not installed) | |
wsapi-xavante >= 1.6.1 (not installed) | |
busted >= 2.0.rc9 (not installed) |
This file contains 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
-- Problem: there is a directed graph and a subset of some A | |
-- associated with each node. Some nodes are marked as reset nodes. | |
-- An element of A traverses the graph | |
-- along the edges from start node S to finish node F, only | |
-- passing through nodes with sets containing the element. | |
-- At reset nodes it can change to any element of A. | |
-- Calculate set of possible visiting elements for each node. | |
-- Solution: resulting set for a node N is intersection of two sets: | |
-- set of elements that can visit N from S and set of starting elements that |
This file contains 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
-- Problem: there is a directed graph and a subset of some A | |
-- associated with each node. An element of A traverses the graph | |
-- along the edges from start node S to finish node F, only | |
-- passing through nodes with sets containing the element. | |
-- Calculate set of possible visiting elements for each node. | |
-- Solution: resulting set for a node N is intersection of two sets: | |
-- set of elements that can reach N from S and set of elements that | |
-- can reach F from N. They can be calculated for each node separately | |
-- using forward and backward flow analysis correspondingly, where |
This file contains 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
#!/usr/bin/env lua | |
local function visit(node, visited_set, exited_nodes) | |
visited_set[node] = true | |
for _, successor in ipairs(node.next) do | |
if not visited_set[successor] then | |
visit(successor, visited_set, exited_nodes) | |
end | |
end |
NewerOlder