Refer to RFC 2119 to interpret MUST, SHOULD and MAY.
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
#!/bin/sh | |
p () { | |
zcat /proc/config.gz | grep "$1=" | |
} | |
p CONFIG_NET | |
p CONFIG_INET | |
p CONFIG_NET_UDP_TUNNEL | |
p CONFIG_NF_CONNTRACK |
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
--- Instance-based module template. | |
-- @module example | |
local methods = {} | |
local MT = { __index = methods } | |
local function new() | |
local self = {} | |
return setmetatable(self, MT) |
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
diff --git a/src/lmathlib.c b/src/lmathlib.c | |
index 4f2ec60..d87536d 100644 | |
--- a/src/lmathlib.c | |
+++ b/src/lmathlib.c | |
@@ -183,7 +183,7 @@ static int math_log (lua_State *L) { | |
res = l_mathop(log)(x); | |
else { | |
lua_Number base = luaL_checknumber(L, 2); | |
-#if !defined(LUA_USE_C89) | |
+#if defined(LUA_USE_LOG2) |
Lua [1] is a lightweight multi-paradigm dynamic programming language, designed with embeddability and extensibility as its primary goals. It has a diverse range of uses across industries, including notaby video games, networking and machine learning.
The Lua community holds a yearly Workshop, which will take place mid-October
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
> x = string.dump(function() end) | |
> x = x:sub(1,3) .. "b" .. x:sub(5) -- break header | |
> loadstring(x)() | |
stdin:1: attempt to call a nil value | |
stack traceback: | |
stdin:1: in main chunk | |
[C]: ? | |
> assert(loadstring(x))() | |
stdin:1: binary string: bad header in precompiled chunk | |
stack traceback: |
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
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. | |
64 bytes from 8.8.8.8: icmp_seq=1 ttl=45 time=75.0 ms | |
64 bytes from 8.8.8.8: icmp_seq=2 ttl=45 time=57.1 ms | |
64 bytes from 8.8.8.8: icmp_seq=4 ttl=45 time=41.5 ms | |
64 bytes from 8.8.8.8: icmp_seq=5 ttl=45 time=39.4 ms | |
64 bytes from 8.8.8.8: icmp_seq=6 ttl=45 time=42.9 ms | |
64 bytes from 8.8.8.8: icmp_seq=8 ttl=45 time=69.9 ms | |
64 bytes from 8.8.8.8: icmp_seq=9 ttl=45 time=49.6 ms | |
64 bytes from 8.8.8.8: icmp_seq=10 ttl=45 time=37.7 ms | |
64 bytes from 8.8.8.8: icmp_seq=12 ttl=45 time=40.0 ms |
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
c=0; n=1 | |
for i in $(fold -b1 $1); do | |
[ "$i" = "(" ] && c=$((c+1)) | |
[ "$i" = ")" ] && c=$((c-1)) | |
echo $c $n | |
n=$((n+1)) | |
done | |
# sh day1.sh input.txt | tail -n1 | cut -d' ' -f1 | |
# sh day1.sh input.txt | grep -e '-1 ' | head -n1 | cut -d' ' -f2 |
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
-- For use with https://github.com/fperrad/lua-MessagePack | |
-- Usage: | |
-- local mp = require "MessagePack" | |
-- local MP = mp_magic(mp) | |
-- mp.pack{ this_is_a_string = MP{binary = "this_is_a_binary"} } | |
local mp_magic = function(mp) | |
if mp.mpmagic then return mp.mpmagic end | |
local mp_mt = {} | |
local new = function(t) return setmetatable(t, mp_mt) end |