From fedd4369b1efede815cc527c167ed4dc7553043d Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 27 May 2022 17:34:47 -0400 Subject: [PATCH] updates --- 20220518111652-riichi_mahjong.org | 4 + 20220518114208-mjai.org | 10 ++ aweber/20220520154427-recipient_service.org | 4 + daily/2022-05-11.org | Bin 0 -> 6964 bytes daily/2022-05-17.org | 142 ++++++++++++++++++++ daily/2022-05-18.org | 70 ++++++++++ daily/2022-05-20.org | 59 ++++++++ daily/2022-05-23.org | 37 +++++ daily/2022-05-24.org | 66 +++++++++ daily/2022-05-25.org | 37 +++++ daily/2022-05-26.org | 73 ++++++++++ daily/2022-05-27.org | 38 ++++++ introduction_️mortal_documentation.org | 8 ++ 13 files changed, 548 insertions(+) create mode 100644 20220518111652-riichi_mahjong.org create mode 100644 20220518114208-mjai.org create mode 100644 aweber/20220520154427-recipient_service.org create mode 100644 daily/2022-05-11.org create mode 100644 daily/2022-05-17.org create mode 100644 daily/2022-05-18.org create mode 100644 daily/2022-05-20.org create mode 100644 daily/2022-05-23.org create mode 100644 daily/2022-05-24.org create mode 100644 daily/2022-05-25.org create mode 100644 daily/2022-05-26.org create mode 100644 daily/2022-05-27.org create mode 100644 introduction_️mortal_documentation.org diff --git a/20220518111652-riichi_mahjong.org b/20220518111652-riichi_mahjong.org new file mode 100644 index 0000000..9b2a48a --- /dev/null +++ b/20220518111652-riichi_mahjong.org @@ -0,0 +1,4 @@ +:PROPERTIES: +:ID: 80e2ff2d-fd2f-4a14-91d7-855159de4f6e +:END: +#+title: Riichi Mahjong diff --git a/20220518114208-mjai.org b/20220518114208-mjai.org new file mode 100644 index 0000000..101dc7e --- /dev/null +++ b/20220518114208-mjai.org @@ -0,0 +1,10 @@ +:PROPERTIES: +:ID: 4af45a5a-db3b-4d49-82c7-3671f62d3283 +:ROAM_REFS: https://gimite.net/pukiwiki/index.php?Mjai%20%E9%BA%BB%E9%9B%80AI%E5%AF%BE%E6%88%A6%E3%82%B5%E3%83%BC%E3%83%90 +:END: +#+title: MJAI + +A JSON file format for describing a [[id:80e2ff2d-fd2f-4a14-91d7-855159de4f6e][Riichi Mahjong]] game event log. + +- Reference implementation :: https://github.com/gimite/mjai +- [[id:8b2cbf9b-ffcb-4282-81ab-200a2f819b07][Mortal]] implementation :: https://github.com/Equim-chan/Mortal/blob/1dcbc8193159ddfef0db3b25af30d716d9ae6e8e/libriichi/src/mjai.rs diff --git a/aweber/20220520154427-recipient_service.org b/aweber/20220520154427-recipient_service.org new file mode 100644 index 0000000..39f10cf --- /dev/null +++ b/aweber/20220520154427-recipient_service.org @@ -0,0 +1,4 @@ +:PROPERTIES: +:ID: 1ff6586e-2dba-41a2-a887-753cc5ac27c9 +:END: +#+title: Recipient Service diff --git a/daily/2022-05-11.org b/daily/2022-05-11.org new file mode 100644 index 0000000000000000000000000000000000000000..a1977dc789134276acf507a746dcde9b87252a96 GIT binary patch literal 6964 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 ROW(COALESCE(trim(substring('50', E'^[^0-9]+')), ''), COALESCE(substring('50', E'([0-9]+(\\.[0-9]+)?)')::float,0), '50') + ORDER BY orderable +#+end_src + +#+RESULTS: +| email | datum1 | orderable | +|-------------------------+--------------+-------------------------| +| correlr@aweber.com | 69 | ("",69,69) | +| correlr+0031@aweber.net | 73.50 | ("",73.5,73.50) | +| scottm@aweber.net | 101 | ("",101,101) | +| correlr+0033@aweber.net | 215 555 1234 | ("",215,"215 555 1234") | +| correlr+0040@aweber.net | 215 555 9372 | ("",215,"215 555 9372") | +| correlr+005@aweber.net | 215-555-7777 | ("",215,215-555-7777) | +| correlr+0028@aweber.net | 404 | ("",404,404) | +| correlr+0032@aweber.net | 404 Apple | ("",404,"404 Apple") | +| correlr+0029@aweber.net | 711 | ("",711,711) | +| correlr+0037@aweber.net | $ 112.65 | ($,112.65,"$ 112.65") | +| correlr+0034@aweber.net | $112.65 | ($,112.65,$112.65) | +| -----@aweber.com | A 100 | (A,100,"A 100") | +| correlr+004@aweber.net | ED-209 | (ED-,209,ED-209) | + +#+begin_src sql :eval never + CREATE OR REPLACE FUNCTION public.collate_numerically(value text) + RETURNS RECORD + LANGUAGE SQL STRICT IMMUTABLE AS $$ + SELECT ROW(COALESCE(trim(substring($1, E'^[^0-9]+')), ''), + COALESCE(substring($1, E'([0-9]+(\\.[0-9]+)?)')::float,0), + $1); + $$; +#+end_src + +#+begin_src sql + SELECT email + , datum1 + , CASE + WHEN datum1 IS NULL THEN '' + WHEN datum1 ~ E'^[0-9\.]+$' + THEN lpad(lower(datum1), 30, '0') + ELSE rpad(lower(datum1), 30, '0') + END AS orderable + FROM leads4 + WHERE unit_id = 3854 AND datum1 IS NOT NULL + ORDER BY orderable +#+end_src + +#+RESULTS: +| email | datum1 | orderable | +|------------------------------+--------------+--------------------------------| +| correlr+0037@aweber.net | $ 112.65 | $ 112.650000000000000000000000 | +| correlr+0034@aweber.net | $112.65 | $112.6500000000000000000000000 | +| correlr+notags003@aweber.net | | 000000000000000000000000000000 | +| correlr+003@aweber.net | | 000000000000000000000000000000 | +| correlr+002@aweber.net | | 000000000000000000000000000000 | +| correlr+001@aweber.net | | 000000000000000000000000000000 | +| correlr+0041@aweber.net | | 000000000000000000000000000000 | +| correlr+0027@aweber.net | | 000000000000000000000000000000 | +| correlr+0026@aweber.net | | 000000000000000000000000000000 | +| correlr+0021@aweber.net | | 000000000000000000000000000000 | +| correl+bad03@gmail.com | | 000000000000000000000000000000 | +| correlr@aweber.com | 69 | 000000000000000000000000000069 | +| scottm@aweber.net | 101 | 000000000000000000000000000101 | +| correlr+0028@aweber.net | 404 | 000000000000000000000000000404 | +| correlr+0029@aweber.net | 711 | 000000000000000000000000000711 | +| correlr+0031@aweber.net | 73.50 | 000000000000000000000000073.50 | +| correlr+0033@aweber.net | 215 555 1234 | 215 555 1234000000000000000000 | +| correlr+0040@aweber.net | 215 555 9372 | 215 555 9372000000000000000000 | +| correlr+005@aweber.net | 215-555-7777 | 215-555-7777000000000000000000 | +| correlr+0032@aweber.net | 404 Apple | 404 apple000000000000000000000 | +| -----@aweber.com | A 100 | a 1000000000000000000000000000 | +| correlr+004@aweber.net | ED-209 | ed-209000000000000000000000000 | + +#+begin_src sql :engine postgresql + SELECT email, datum1 FROM leads4 + WHERE unit_id = 3854 AND datum1 IS NOT NULL + ORDER BY datum1 +#+end_src + +#+RESULTS: +| email | datum1 | +|------------------------------+--------| +| correlr+notags003@aweber.net | | +| correlr+0028@aweber.net | | +| correlr+0027@aweber.net | | +| correlr+0026@aweber.net | | +| correlr+0021@aweber.net | | +| correl+bad03@gmail.com | | +| correlr+005@aweber.net | | +| correlr+003@aweber.net | | +| correlr+002@aweber.net | | +| correlr+001@aweber.net | | +| correlr+0041@aweber.net | | +| correlr+0040@aweber.net | | +| correlr+0034@aweber.net | | +| correlr+0033@aweber.net | | +| correlr+0032@aweber.net | | +| scottm@aweber.net | 101 | +| correlr@aweber.com | 69 | +| correlr+0029@aweber.net | 711 | +| -----@aweber.com | A 100 | +| correlr+004@aweber.net | ED-209 | + +#+begin_src sql + SELECT email + , datum1 + , ROW(COALESCE(substring(datum1, E'[^0-9]+'), ''), COALESCE(substring(datum1, E'[0-9]+')::int,0), datum1) AS orderable + FROM leads4 + WHERE unit_id = 13971 + AND ROW(COALESCE(substring('1548862518', E'[^0-9]+'), ''), COALESCE(substring('1548862518', E'[0-9]+')::int,0), '1548862518') + > + ROW(COALESCE(substring(datum1, E'[^0-9]+'), ''), COALESCE(substring(datum1, E'[0-9]+')::int,0), datum1) + ORDER BY orderable; +#+end_src + +#+RESULTS: +| email | datum1 | orderable | +|--------------------------------------+--------+-----------| +| moana.rock.diuwasly@mailosaur.io | | ("",0,"") | +| 1548862167.suf.lsb8bll2@mailosaur.io | | ("",0,) | +| 1548862018.suf.lsb8bll2@mailosaur.io | | ("",0,) | +| 1548861949.suf.lsb8bll2@mailosaur.io | | ("",0,) | +| 1548861848.suf.lsb8bll2@mailosaur.io | | ("",0,) | +| 1548862325.suf.lsb8bll2@mailosaur.io | | ("",0,) | +| bob.smith.diuwasly@mailosaur.io | | ("",0,) | +| iharh+8df668454@aweber.net | | ("",0,) | +| 1548861786.suf.lsb8bll2@mailosaur.io | | ("",0,) | +| iharh+56651@aweber.net | 3 | ("",3,3) | diff --git a/daily/2022-05-18.org b/daily/2022-05-18.org new file mode 100644 index 0000000..04d3868 --- /dev/null +++ b/daily/2022-05-18.org @@ -0,0 +1,70 @@ +:PROPERTIES: +:ID: 0695048f-6974-4a55-be6c-75de2dcdecec +:END: +#+title: 2022-05-18 +* [[id:d06d3ab4-c2d0-47c3-aae1-4395567fc3d2][Normalizing tags]] in production +:PROPERTIES: +:header-args:sql: :engine postgresql :cmdline "-U postgres postgres" :dir /docker:postgres: :exports both :cache yes :eval no-export +:END: + +#+CAPTION: Create a table to track normalized accounts +#+begin_src sql + DROP TABLE IF EXISTS accounts; + CREATE TABLE accounts AS + SELECT account_id, COUNT(tag) AS total, FALSE AS normalized + FROM invalid_tags + GROUP BY account_id; +#+end_src + +#+RESULTS[ee123c16042ab3a3381135fd50e2e474a126af94]: +| DROP TABLE | +|-------------| +| SELECT 3220 | + +#+CAPTION: Find the least affected accounts first +#+begin_src sql + SELECT COUNT(*) + FROM accounts + WHERE NOT normalized AND total < 100 +#+end_src + +#+RESULTS[b0aec0d7b3e1a161356aec4a1d23b1b1fe3d82c5]: +| count | +|-------| +| 2241 | + +#+CAPTION: Find the least affected accounts first +#+NAME: first-run-accounts +#+begin_src sql :results silent + SELECT account_id + FROM accounts + WHERE NOT normalized AND total = 1 +#+end_src + +#+begin_src emacs-lisp :var accounts=first-run-accounts :results file :eval no-export + (let ((filename "~/git/normalize_account_tags/production/01-single-tag-accounts")) + (with-temp-file filename + (insert (s-join "\n" (-map #'first accounts)))) + filename) +#+end_src + +#+RESULTS: +[[file:~/git/normalize_account_tags/production/01-single-tag-accounts]] + +#+begin_example +######################################## +### COMPLETED 473/473 (0 remaining) +### ELAPSED: 02:21:49 +### ESTIMATED REMAINING: 00:00:00 +######################################## +#+end_example + +#+begin_src sql + UPDATE accounts + SET normalized = TRUE + WHERE NOT normalized AND total = 1 +#+end_src + +#+RESULTS[f9106d0f56ea4455273bfaa63a4b4576d8a30f7f]: +| UPDATE 474 | +|------------| diff --git a/daily/2022-05-20.org b/daily/2022-05-20.org new file mode 100644 index 0000000..4881040 --- /dev/null +++ b/daily/2022-05-20.org @@ -0,0 +1,59 @@ +:PROPERTIES: +:ID: c1a4dc1f-abdd-4ee7-891d-6441af049642 +:END: +#+title: 2022-05-20 + +* [[id:d06d3ab4-c2d0-47c3-aae1-4395567fc3d2][Normalizing tags]] in production +:PROPERTIES: +:header-args:sql: :engine postgresql :cmdline "-U postgres postgres" :dir /docker:postgres: :exports both :cache yes :eval no-export +:END: + +#+CAPTION: Find the next set of least affected accounts +#+begin_src sql + SELECT COUNT(*) + FROM accounts + WHERE NOT normalized AND total <= 10 +#+end_src + +#+RESULTS[95dd01f1826657f1d72cf437dd5c045cf78c997c]: +| count | +|-------| +| 759 | + +#+CAPTION: Find the next set of least affected accounts +#+NAME: 02-less-than-equal-to-ten +#+begin_src sql :results silent + SELECT account_id + FROM accounts + WHERE NOT normalized AND total <= 10 +#+end_src + +#+begin_src emacs-lisp :var accounts=02-less-than-equal-to-ten :results file :eval no-export + (let ((filename "~/git/normalize_account_tags/production/02-less-than-equal-to-ten")) + (with-temp-file filename + (insert (s-join "\n" (-map #'car accounts)))) + filename) +#+end_src + +#+RESULTS: +[[file:~/git/normalize_account_tags/production/02-less-than-equal-to-ten]] + +#+begin_src sql + UPDATE accounts SET normalized = TRUE + WHERE NOT normalized AND total <= 10 +#+end_src + +#+RESULTS[758c043c5bfacfb10f6a17c306ca76536b92abee]: +| UPDATE 759 | +|------------| + +* Sync up on [[id:1ff6586e-2dba-41a2-a887-753cc5ac27c9][Recipient Service]] updates +- Andrew is still working on tests for the updated =GET= endpoints due to + unrelated sprockets amqp ioloop issues. +- Subscriber sync change needs to be done next to check for existence of the + recipient record rather than the subscriber record, as the latter will now + always exist. + +* Senior engineering meet up +- Create a ticket to add an api-suspenders style queuing system in the [[id:1ff6586e-2dba-41a2-a887-753cc5ac27c9][Recipient Service]]'s + subscriber creation implementation using redis for storage. diff --git a/daily/2022-05-23.org b/daily/2022-05-23.org new file mode 100644 index 0000000..fe6d4f9 --- /dev/null +++ b/daily/2022-05-23.org @@ -0,0 +1,37 @@ +:PROPERTIES: +:ID: b2a4956b-0fcb-4809-b191-e29eb086367f +:END: +#+title: 2022-05-23 +* [[id:d06d3ab4-c2d0-47c3-aae1-4395567fc3d2][Normalizing tags]] in production +:PROPERTIES: +:header-args:sql: :engine postgresql :cmdline "-U postgres postgres" :dir /docker:postgres: :exports both :cache yes :eval no-export +:END: + +#+CAPTION: Find the next set of least affected accounts +#+begin_src sql + SELECT COUNT(*) + FROM accounts + WHERE NOT normalized AND total <= 50 +#+end_src + +#+RESULTS[3b91f19494773258001c8f81134f9b930f7a5898]: +| count | +|-------| +| 708 | +#+CAPTION: Find the next set of least affected accounts +#+NAME: 03-less-than-equal-to-fifty +#+begin_src sql :results silent + SELECT account_id + FROM accounts + WHERE NOT normalized AND total <= 50 +#+end_src + +#+begin_src emacs-lisp :var accounts=03-less-than-equal-to-fifty :results file :eval no-export + (let ((filename "~/git/normalize_account_tags/production/03-less-than-equal-to-fifty")) + (with-temp-file filename + (insert (s-join "\n" (-map #'car accounts)))) + filename) +#+end_src + +#+RESULTS: +[[file:~/git/normalize_account_tags/production/03-less-than-equal-to-fifty]] diff --git a/daily/2022-05-24.org b/daily/2022-05-24.org new file mode 100644 index 0000000..fe43712 --- /dev/null +++ b/daily/2022-05-24.org @@ -0,0 +1,66 @@ +:PROPERTIES: +:ID: 3c57d654-309e-4297-a8f6-e14809e512db +:END: +#+title: 2022-05-24 + +* [[id:d06d3ab4-c2d0-47c3-aae1-4395567fc3d2][Normalizing tags]] in production +:PROPERTIES: +:header-args:sql: :engine postgresql :cmdline "-U postgres postgres" :dir /docker:postgres: :exports both :cache yes :eval no-export +:END: +** Completing yesterday's set +#+CAPTION: Find the next set of least affected accounts +#+begin_src sql + SELECT COUNT(*) + FROM accounts + WHERE NOT normalized AND total <= 50 +#+end_src + +#+RESULTS[3b91f19494773258001c8f81134f9b930f7a5898]: +| count | +|-------| +| 385 | + +#+CAPTION: Find the next set of least affected accounts +#+NAME: 04-less-than-equal-to-fifty +#+begin_src sql :results silent + SELECT account_id + FROM accounts + WHERE NOT normalized AND total <= 50 +#+end_src + +#+begin_src emacs-lisp :var accounts=04-less-than-equal-to-fifty :results file :eval no-export + (let ((filename "~/git/normalize_account_tags/production/04-less-than-equal-to-fifty")) + (with-temp-file filename + (insert (s-join "\n" (-map #'car accounts)))) + filename) +#+end_src + +#+RESULTS: +[[file:~/git/normalize_account_tags/production/04-less-than-equal-to-fifty]] +** Next set +#+CAPTION: Find the next set of least affected accounts +#+begin_src sql + SELECT COUNT(*) + FROM accounts + WHERE NOT normalized AND total <= 100 +#+end_src + +#+RESULTS[ef2cfc019cfa507c8e70a11e2c51488945751704]: +| count | +|-------| +| 306 | + +#+CAPTION: Find the next set of least affected accounts +#+NAME: 05-less-than-equal-to-one-hundred +#+begin_src sql :results silent + SELECT account_id + FROM accounts + WHERE NOT normalized AND total <= 100 +#+end_src + +#+begin_src emacs-lisp :var accounts=05-less-than-equal-to-one-hundred :results file :eval no-export + (let ((filename "~/git/normalize_account_tags/production/05-less-than-equal-to-one-hundred")) + (with-temp-file filename + (insert (s-join "\n" (-map #'car accounts)))) + filename) +#+end_src diff --git a/daily/2022-05-25.org b/daily/2022-05-25.org new file mode 100644 index 0000000..d2f4f32 --- /dev/null +++ b/daily/2022-05-25.org @@ -0,0 +1,37 @@ +:PROPERTIES: +:ID: eaa8559b-5e23-4922-98c3-4574b63c40f9 +:END: +#+title: 2022-05-25 +* [[id:d06d3ab4-c2d0-47c3-aae1-4395567fc3d2][Normalizing tags]] in production +:PROPERTIES: +:header-args:sql: :engine postgresql :cmdline "-U postgres postgres" :dir /docker:postgres: :exports both :cache yes :eval no-export +:END: +#+CAPTION: Find the next set of least affected accounts +#+begin_src sql + SELECT COUNT(*) + FROM accounts + WHERE NOT normalized AND total <= 500 +#+end_src + +#+RESULTS[4e2afc6030287036e6f8e35197d2286a91d155b1]: +| count | +|-------| +| 586 | + +#+CAPTION: Find the next set of least affected accounts +#+NAME: 06-less-than-equal-to-five-hundred +#+begin_src sql :results silent + SELECT account_id + FROM accounts + WHERE NOT normalized AND total <= 500 +#+end_src + +#+begin_src emacs-lisp :var accounts=06-less-than-equal-to-five-hundred :results file :eval no-export + (let ((filename "~/git/normalize_account_tags/production/06-less-than-equal-to-five-hundred")) + (with-temp-file filename + (insert (s-join "\n" (-map #'car accounts)))) + filename) +#+end_src + +#+RESULTS: +[[file:~/git/normalize_account_tags/production/06-less-than-equal-to-five-hundred]] diff --git a/daily/2022-05-26.org b/daily/2022-05-26.org new file mode 100644 index 0000000..9d474a4 --- /dev/null +++ b/daily/2022-05-26.org @@ -0,0 +1,73 @@ +:PROPERTIES: +:ID: f5d02f07-3585-49b1-a2e1-5867edf94680 +:END: +#+title: 2022-05-26 +* [[id:d06d3ab4-c2d0-47c3-aae1-4395567fc3d2][Normalizing tags]] in production +:PROPERTIES: +:header-args:sql: :engine postgresql :cmdline "-U postgres postgres" :dir /docker:postgres: :exports both :cache yes :eval no-export +:END: +** First pass + +#+CAPTION: Find the next set of least affected accounts +#+begin_src sql + SELECT COUNT(*) + FROM accounts + WHERE NOT normalized AND total <= 500 +#+end_src + +#+RESULTS[4e2afc6030287036e6f8e35197d2286a91d155b1]: +| count | +|-------| +| 371 | + +#+CAPTION: Find the next set of least affected accounts +#+NAME: 07-less-than-equal-to-five-hundred +#+begin_src sql :results silent + SELECT account_id + FROM accounts + WHERE NOT normalized AND total <= 500 +#+end_src + +#+begin_src emacs-lisp :var accounts=07-less-than-equal-to-five-hundred :results file :eval no-export + (let ((filename "~/git/normalize_account_tags/production/07-less-than-equal-to-five-hundred")) + (with-temp-file filename + (insert (s-join "\n" (-map #'car accounts)))) + filename) +#+end_src + +#+RESULTS: +[[file:~/git/normalize_account_tags/production/07-less-than-equal-to-five-hundred]] +** Encountered mapping errors +There were a significant number of 503 errors being raised by mapping that +affected the run. Only accounts that were normalized successfully were marked as +complete. Mapping was restarted in production, clearing up the errors. +** Resuming +#+CAPTION: Find the next set of least affected accounts +#+begin_src sql + SELECT COUNT(*) + FROM accounts + WHERE NOT normalized AND total <= 500 +#+end_src + +#+RESULTS[4e2afc6030287036e6f8e35197d2286a91d155b1]: +| count | +|-------| +| 152 | + +#+CAPTION: Find the next set of least affected accounts +#+NAME: 08-less-than-equal-to-five-hundred +#+begin_src sql :results silent + SELECT account_id + FROM accounts + WHERE NOT normalized AND total <= 500 +#+end_src + +#+begin_src emacs-lisp :var accounts=08-less-than-equal-to-five-hundred :results file :eval no-export + (let ((filename "~/git/normalize_account_tags/production/08-less-than-equal-to-five-hundred")) + (with-temp-file filename + (insert (s-join "\n" (-map #'car accounts)))) + filename) +#+end_src + +#+RESULTS: +[[file:~/git/normalize_account_tags/production/08-less-than-equal-to-five-hundred]] diff --git a/daily/2022-05-27.org b/daily/2022-05-27.org new file mode 100644 index 0000000..2847e36 --- /dev/null +++ b/daily/2022-05-27.org @@ -0,0 +1,38 @@ +:PROPERTIES: +:ID: ada428ac-6937-4790-83a8-d67852a9de33 +:END: +#+title: 2022-05-27 +* [[id:d06d3ab4-c2d0-47c3-aae1-4395567fc3d2][Normalizing tags]] in production +:PROPERTIES: +:header-args:sql: :engine postgresql :cmdline "-U postgres postgres" :dir /docker:postgres: :exports both :cache yes :eval no-export +:END: + +#+CAPTION: Find the next set of least affected accounts +#+begin_src sql + SELECT COUNT(*) + FROM accounts + WHERE NOT normalized AND total <= 1000 +#+end_src + +#+RESULTS[efaf69d6d049d7a136ec43b141a98833c0f2931e]: +| count | +|-------| +| 301 | + +#+CAPTION: Find the next set of least affected accounts +#+NAME: 09-less-than-equal-to-one-thousand +#+begin_src sql :results silent + SELECT account_id + FROM accounts + WHERE NOT normalized AND total <= 1000 +#+end_src + +#+begin_src emacs-lisp :var accounts=09-less-than-equal-to-one-thousand :results file :eval no-export + (let ((filename "~/git/normalize_account_tags/production/09-less-than-equal-to-one-thousand")) + (with-temp-file filename + (insert (s-join "\n" (-map #'car accounts)))) + filename) +#+end_src + +#+RESULTS: +[[file:~/git/normalize_account_tags/production/09-less-than-equal-to-one-thousand]] diff --git a/introduction_️mortal_documentation.org b/introduction_️mortal_documentation.org new file mode 100644 index 0000000..6b79045 --- /dev/null +++ b/introduction_️mortal_documentation.org @@ -0,0 +1,8 @@ +:PROPERTIES: +:ID: 8b2cbf9b-ffcb-4282-81ab-200a2f819b07 +:ROAM_REFS: https://mortal.ekyu.moe/index.html +:END: +#+title: Mortal + +An artificial intelligence for playing [[id:80e2ff2d-fd2f-4a14-91d7-855159de4f6e][Riichi Mahjong]]. Takes MJAI (JSON) as +input for game logs.