commit d60a958ebb3d9472f166c6d4b5a694f5f81e2978
parent a15830d2c21c143ecfea29c51174a1d14a066d9c
Author: Juan F. Meleiro <juan@juanmeleiro.mat.br>
Date: Mon, 11 Sep 2023 11:09:34 -0300
Report
Diffstat:
3 files changed, 81 insertions(+), 13 deletions(-)
diff --git a/absurdor b/absurdor
@@ -4,6 +4,7 @@ local json = require "json"
local path = require "path"
local fs = require "path.fs"
local date = require "date"
+local pprint = require "pprint"
function die(err, msg)
msg = tostring(msg or err)
@@ -116,6 +117,8 @@ if args.command == "report" then
local plot = {}
local pushed = {}
local max = 0
+ local failed = false
+ local who = {}
if #log > 0 then
start = sec2week(log[1].when)
@@ -125,21 +128,31 @@ if args.command == "report" then
if e.what == "push" then
local w = sec2week(e.when) - start
if pushed[w-1] or pushed[w] or week2sec(sec2week(e.when)) < 1693159683 then
- -- At 1693159683 seconds from Unix epoch, the governing
- -- rule was changed so that the Boulder falls to zero
- -- if it was not pushed the previous week. However, the
- -- change is not retroactive; hence the magic number.
- height = (height + 1) % 100
+ -- At 1693159683 seconds from Unix epoch, the governing
+ -- rule was changed so that the Boulder falls to zero
+ -- if it was not pushed the previous week. However, the
+ -- change is not retroactive; hence the magic number.
+ height = (height + 1) % 100
else
- io.stderr:write(string.format("The boulder fell on %s.\n", os.date("%Y-%m-%d %H:%M:%S %z", e.when)))
- height = 0
+ height = 1
end
plot[w] = height
+ who[w] = who[w] or {}
+ table.insert(who[w], e.who)
pushed[w] = true
max = w
end
end
+ local w = sec2week(os.time()) - start
+ if (not (w == 0)) and (not pushed[w-1]) then
+ failed = true
+ if not pushed[w] then
+ height = 0
+ plot[w] = 0
+ end
+ end
+
local cur = 0
for i = 1, max do
if plot[i] then
@@ -168,12 +181,15 @@ if args.command == "report" then
f = io.open(tmpname, "a")
for i = #plot, 1, -1 do
- f:write(string.rep("#", plot[i]))
+ f:write("|", string.rep("#", plot[i] or 0))
if i == max then
- f:write(" <- the heighest we've ever reached!\n")
- else
- f:write("\n")
+ f:write(" <- the heighest we've ever reached!")
+ elseif i == #plot then
+ f:write(" <- where we are now")
end
+ f:write(" ")
+ f:write(table.concat(who[i] or {}, ", "))
+ f:write("\n")
end
f:write("----------------------------------------------------------------------\n")
diff --git a/archive/2023-09-11 b/archive/2023-09-11
@@ -0,0 +1,52 @@
+Date: Mon, 11 Sep 2023 11:09:23 -0300
+From: juan <juan@juanmeleiro.mat.br>
+To: agora-official@agoranomic.org
+Subject: [Absurdor] The State of the Absurd
+Message-ID: <20230911140915.7olsbpetpjvwo7vh@grimnir>
+Mail-Followup-To: agora-official@agoranomic.org
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Disposition: inline
+Content-Transfer-Encoding: 8bit
+X-Mutt-Resume-Draft: 1
+
+======================================================================
+absurdor: juan The State of the Absurd 2023-09-11
+======================================================================
+
+ ##### _/
+ ####### /
+ ######### /
+ |#########_/
+ / #######/
+ /_ #####/
+ / /O_/ / The Boulder
+ | /_ / is at 0
+ /_/\. /
+ // // _/
+ /‘ /‘_/
+ / __`/
+ `_/
+ /
+
+
+| <- where we are now
+|
+|##### <- the heighest we've ever reached! snail
+|####
+|####
+|####
+|#### juan, snail
+|##
+|##
+|## juan
+|#
+|# 4st
+----------------------------------------------------------------------
+Do you have any suggestions on what I should put on the report?
+Send them to me!
+======================================================================
+
+--
+juan
+Registrar, Buttonmastor, Absurdor
diff --git a/log.json b/log.json
@@ -1 +1 @@
-[{"what":"report","when":1687186898,"height":0},{"what":"push","who":"4st","when":1687483775},{"what":"report","when":1687783602,"height":1},{"what":"report","when":1688411251,"height":1},{"what":"push","who":"juan","when":1688997918},{"what":"report","when":1689001176,"height":2},{"what":"report","when":1689965374,"height":2},{"what":"report","when":1690248734,"height":2},{"what":"push","who":"juan","when":1690814390},{"what":"report","when":1690814458,"height":3},{"what":"push","who":"snail","when":1690842943},{"what":"report","when":1691422342,"height":4},{"what":"report","when":1692015498,"height":4},{"what":"report","when":1692643133,"height":4},{"what":"push","who":"snail","when":1693175927},{"what":"report","when":1693231987,"height":5},{"what":"report","when":1693918103,"height":5},{"what":"report","height":5,"when":1693918207}]
-\ No newline at end of file
+[{"height":0,"what":"report","when":1687186898},{"who":"4st","what":"push","when":1687483775},{"height":1,"what":"report","when":1687783602},{"height":1,"what":"report","when":1688411251},{"who":"juan","what":"push","when":1688997918},{"height":2,"what":"report","when":1689001176},{"height":2,"what":"report","when":1689965374},{"height":2,"what":"report","when":1690248734},{"who":"juan","what":"push","when":1690814390},{"height":3,"what":"report","when":1690814458},{"who":"snail","what":"push","when":1690842943},{"height":4,"what":"report","when":1691422342},{"height":4,"what":"report","when":1692015498},{"height":4,"what":"report","when":1692643133},{"who":"snail","what":"push","when":1693175927},{"height":5,"what":"report","when":1693231987},{"height":5,"what":"report","when":1693918103},{"height":5,"what":"report","when":1693918207},{"height":0,"what":"report","when":1694441365}]
+\ No newline at end of file