From 03f8544691a8de9f77a803fd8cd2eeadb919ec03 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 10 Dec 2023 00:39:16 +0100 Subject: Genesis commit --- LICENSE | 14 + README | 4 + c/.gitignore | 3 + c/base.mk | 4 + c/cat/.gitignore | 1 + c/cat/Makefile | 8 + c/cat/cat.c | 102 ++ c/sigfd/.gitignore | 1 + c/sigfd/Makefile | 8 + c/sigfd/main.c | 42 + c/timer/.gitignore | 1 + c/timer/Makefile | 11 + c/timer/main.c | 48 + elixir/aoc/01/input | 2244 +++++++++++++++++++++++++++++++++++ elixir/aoc/01/main.exs | 12 + go/read-unix-sock/read-unix-sock.go | 30 + m4/ifdef/ifdef.m4 | 19 + sed/bf2c/bf2c.sed | 27 + sed/bf2c/test.bf | 709 +++++++++++ sed/dc/README | 1 + sed/dc/dc.sed | 328 +++++ 21 files changed, 3617 insertions(+) create mode 100644 LICENSE create mode 100644 README create mode 100644 c/.gitignore create mode 100644 c/base.mk create mode 100644 c/cat/.gitignore create mode 100644 c/cat/Makefile create mode 100644 c/cat/cat.c create mode 100644 c/sigfd/.gitignore create mode 100644 c/sigfd/Makefile create mode 100644 c/sigfd/main.c create mode 100644 c/timer/.gitignore create mode 100644 c/timer/Makefile create mode 100644 c/timer/main.c create mode 100644 elixir/aoc/01/input create mode 100644 elixir/aoc/01/main.exs create mode 100644 go/read-unix-sock/read-unix-sock.go create mode 100644 m4/ifdef/ifdef.m4 create mode 100755 sed/bf2c/bf2c.sed create mode 100644 sed/bf2c/test.bf create mode 100644 sed/dc/README create mode 100755 sed/dc/dc.sed diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..276994d --- /dev/null +++ b/LICENSE @@ -0,0 +1,14 @@ +BSD Zero Clause License + +Copyright © 2023 Thomas Voss + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..4bd5dc8 --- /dev/null +++ b/README @@ -0,0 +1,4 @@ +This is just a collection of random code I’ve written. Nothing here is +meaningful, I’m just putting it on the internet so that I have a backup +somewhere. This is mostly just me figuring out how some new library +works, playing with some idea, etc. diff --git a/c/.gitignore b/c/.gitignore new file mode 100644 index 0000000..b8be893 --- /dev/null +++ b/c/.gitignore @@ -0,0 +1,3 @@ +.cache/ +compile_commands.json +*.o diff --git a/c/base.mk b/c/base.mk new file mode 100644 index 0000000..7aea715 --- /dev/null +++ b/c/base.mk @@ -0,0 +1,4 @@ +CC = cc +CFLAGS = \ + -Wall -Wextra -Werror -Wpedantic -pipe \ + -O3 -flto -march=native -mtune=native diff --git a/c/cat/.gitignore b/c/cat/.gitignore new file mode 100644 index 0000000..ef07ddc --- /dev/null +++ b/c/cat/.gitignore @@ -0,0 +1 @@ +cat diff --git a/c/cat/Makefile b/c/cat/Makefile new file mode 100644 index 0000000..081ffd4 --- /dev/null +++ b/c/cat/Makefile @@ -0,0 +1,8 @@ +include ../base.mk + +all: cat +cat: cat.c + $(CC) $(CFLAGS) -o $@ $< + +clean: + rm -f cat diff --git a/c/cat/cat.c b/c/cat/cat.c new file mode 100644 index 0000000..7aaaa6b --- /dev/null +++ b/c/cat/cat.c @@ -0,0 +1,102 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define warn(...) \ + do { \ + warn(__VA_ARGS__); \ + rv = EXIT_FAILURE; \ + } while (0) + +static int rv = EXIT_SUCCESS; +static bool out_is_reg; +static char buf[BUFSIZ]; + +static void cat(const char *); +static void cat_sendfile(const char *, int, size_t); +static void cat_readwrite(const char *, int); + +int +main(int argc, char **argv) +{ + struct stat sb; + + if (fstat(STDOUT_FILENO, &sb) == -1) + warn("fstat: /dev/stdout"); + else + out_is_reg = S_ISREG(sb.st_mode); + + if (argc == 1) + cat("-"); + for (int i = 1; i < argc; i++) + cat(argv[i]); + return rv; +} + +void +cat(const char *file) +{ + int fd; + struct stat sb; + + if (strcmp(file, "-") == 0) + fd = STDIN_FILENO; + else if ((fd = open(file, O_RDONLY)) == -1) { + warn("open: %s", file); + return; + } + + if (fstat(fd, &sb) == -1) { + warn("fstat: %s", file); + goto out; + } + + if (S_ISREG(sb.st_mode) && out_is_reg) + cat_sendfile(file, fd, sb.st_size); + else + cat_readwrite(file, fd); + +out: + close(fd); +} + +void +cat_sendfile(const char *file, int fd, size_t n) +{ + off_t off = 0; + ssize_t nw; + + do { + nw = sendfile(STDOUT_FILENO, fd, &off, n); + off += nw; + } while (nw != -1 && (size_t)off < n); + + if (nw == -1) + warn("sendfile: %s", file); +} + +void +cat_readwrite(const char *file, int fd) +{ + ssize_t nr, nw; + + while ((nr = read(fd, buf, BUFSIZ)) > 0) { + for (ssize_t off = 0; nr > 0; nr -= nw, off += nw) { + if ((nw = write(STDOUT_FILENO, buf + off, nr)) == -1) { + warn("write: %s", file); + return; + } + } + } + if (nr == -1) + warn("read: %s", file); +} diff --git a/c/sigfd/.gitignore b/c/sigfd/.gitignore new file mode 100644 index 0000000..067fa65 --- /dev/null +++ b/c/sigfd/.gitignore @@ -0,0 +1 @@ +sigfd diff --git a/c/sigfd/Makefile b/c/sigfd/Makefile new file mode 100644 index 0000000..f126000 --- /dev/null +++ b/c/sigfd/Makefile @@ -0,0 +1,8 @@ +include ../base.mk + +all: sigfd +sigfd: main.c + $(CC) $(CFLAGS) -o $@ $< + +clean: + rm -f sigfd diff --git a/c/sigfd/main.c b/c/sigfd/main.c new file mode 100644 index 0000000..6721f60 --- /dev/null +++ b/c/sigfd/main.c @@ -0,0 +1,42 @@ +#include +#include + +#include +#include +#include +#include +#include +#include + +#define die(...) err(EXIT_FAILURE, __VA_ARGS__) +#define lengthof(a) (sizeof(a) / sizeof(*(a))) + +static char buf[4096]; + +int +main(void) +{ + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGINT); + sigaddset(&set, SIGQUIT); + sigprocmask(SIG_BLOCK, &set, NULL); + + int fd = signalfd(-1, &set, 0); + if (fd == -1) + die("signalfd"); + + struct pollfd fds[] = { + {.fd = fd, .events = POLL_IN}, + }; + for (;;) { + if (poll(fds, lengthof(fds), -1) == -1) + die("poll"); + if (fds[0].revents & POLL_IN) { + fputs("Caught signal!\n", stderr); + read(fds[0].fd, buf, sizeof(buf)); + } + } + + return EXIT_SUCCESS; +} diff --git a/c/timer/.gitignore b/c/timer/.gitignore new file mode 100644 index 0000000..fe84f2c --- /dev/null +++ b/c/timer/.gitignore @@ -0,0 +1 @@ +timer diff --git a/c/timer/Makefile b/c/timer/Makefile new file mode 100644 index 0000000..410dc79 --- /dev/null +++ b/c/timer/Makefile @@ -0,0 +1,11 @@ +include ../base.mk + +CFLAGS := $(CFLAGS) $(shell pkg-config --cflags libnotify) -D_ISOC99_SOURCE +LDLIBS = $(shell pkg-config --libs libnotify) + +all: timer +timer: main.c + $(CC) $(CFLAGS) $(LDLIBS) -o $@ $< + +clean: + rm -f timer diff --git a/c/timer/main.c b/c/timer/main.c new file mode 100644 index 0000000..751cbca --- /dev/null +++ b/c/timer/main.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +#include + +#define die(...) err(EXIT_FAILURE, __VA_ARGS__) +#define diex(...) errx(EXIT_FAILURE, __VA_ARGS__) + +static char buf[128]; + +int +main(int argc, char **argv) +{ + char *endptr; + long secs; + + if (argc != 3) { + fprintf(stderr, "Usage: %s secs body\n", argv[0]); + exit(EXIT_FAILURE); + } + + errno = 0; + secs = strtol(argv[1], &endptr, 10); + if (errno) + die("strtol: %s", argv[1]); + if (endptr == argv[1] || *endptr) + diex("Invalid integer: %s", argv[1]); + + snprintf(buf, sizeof(buf), "%ld Second%s Elapsed", secs, + secs == 1 ? "" : "s"); + + notify_init("TIMER"); + NotifyNotification *n = + notify_notification_new(buf, argv[2], "dialog-information"); + + notify_notification_set_timeout(n, 5000); + while ((secs = sleep(secs))) + sleep(secs); + if (!notify_notification_show(n, NULL)) + diex("Failed to send notification"); + + g_object_unref(G_OBJECT(n)); + notify_uninit(); + return EXIT_SUCCESS; +} diff --git a/elixir/aoc/01/input b/elixir/aoc/01/input new file mode 100644 index 0000000..ff8b32b --- /dev/null +++ b/elixir/aoc/01/input @@ -0,0 +1,2244 @@ +2832 +2108 +3082 +4328 +6843 +5121 +2869 +1366 +2358 +1680 +4980 +1161 + +8026 +2154 +4242 +1023 +2744 +3162 +4093 +1150 +5397 +2738 +5657 + +10954 +11208 +8034 +1636 +9430 +9421 +5025 + +3837 +5938 +3967 +2942 +2727 +3623 +4070 +1748 +1795 +1687 +4023 +6068 +2558 +2570 +4214 + +9679 +2986 +5168 +16463 + +5912 +6008 +1259 +5378 +10740 +1642 +2617 +7821 + +3840 +5265 +2104 +1510 +5477 +2636 +5920 +5939 +5430 +4482 +5603 +4915 +5416 +5897 + +3932 +9344 +7536 +4925 +10088 +5253 +5625 +6800 + +3928 +13714 +18995 +3569 + +2424 +5188 +11199 +6078 +11525 +5155 +3142 + +2595 +5893 +5590 +6270 +6095 +5279 +3726 +6015 +3985 +5455 +5190 +4897 +6632 + +5046 +1424 +3629 +6204 +6187 +1149 +4145 +6953 +2958 +6312 +1592 +4614 +2859 + +5750 +9606 +11706 +2629 +13635 +5611 + +2162 +6014 +3168 +8052 +10781 +3762 +5653 + +21918 +14739 + +2431 +5955 +4810 +7476 +2529 +7985 +6040 +5864 +3459 +3347 +4853 + +4695 +3911 +5590 +4439 +4874 +2251 +3967 +6895 +5801 +2720 +5125 +5575 +2057 + +5642 +3714 +5127 +5083 +2925 +5048 +6368 +5883 +2287 +3276 +3326 +2207 +3377 + +18373 +7075 +12254 +18539 + +13758 +19556 +23565 + +6463 +5076 +5429 +3105 +6201 +5959 +6474 +5740 +6997 +7567 +1883 + +2316 +10793 +2985 +10596 +6910 +11957 +5984 + +18521 +7234 +7943 + +8774 +7905 +4375 +1788 +9244 +2259 +4842 +6313 + +4496 +10446 +6917 +1113 +2509 +1229 +2999 + +2158 +3221 +1412 +1484 +1768 +2621 +1087 +1152 +3625 +3767 +4859 +1220 +3745 +4374 +3712 + +4072 +8998 +5778 +4361 +6138 + +11068 +15488 +17001 +16349 + +3493 +15148 +14490 +9502 +11101 + +8952 +2731 +10734 +7581 +4799 +9379 +5405 +10345 + +5008 +4456 +3824 +3025 +4493 +2369 +1050 +3368 +3266 +4641 +5932 +5774 +1287 +3001 +2934 + +16879 +20950 +11598 + +11948 +2932 +1672 +11100 + +24636 +12299 +18577 + +14198 +24466 +25429 + +3539 +5867 +2303 +1372 +3757 +3255 +4606 +4703 +4477 +3515 +5287 +7330 + +2673 +5936 +6292 +4183 +4963 +6462 +4193 +5588 +5140 +2825 +4784 +3210 +1682 +3746 + +12296 +15184 +9500 +16390 + +2816 +6984 +6514 +8120 +8000 +9203 +3716 + +24745 +15138 + +4456 +4546 +4903 +2885 +4578 +2588 +2946 +6634 +1414 +1239 +6070 +4651 +2749 + +3755 +3424 +3633 +2325 +2730 +5526 +6877 +4528 +6567 +2626 +6429 +2464 + +2159 +6338 +2919 +4039 +3091 +7916 +2833 +4192 +5486 +2220 +5616 + +1025 +10572 +6790 +3174 +5986 +2465 +9046 +1559 + +4652 +9609 +4804 +5109 +5301 +9886 +7094 + +1888 +9582 +9566 +2777 +1234 + +6231 +7939 +4757 +3026 +11324 +4069 +6366 + +5078 +6127 +1616 +5894 +3707 +1031 +5544 +4880 +6766 +6411 +2767 +2642 +1197 + +2954 +1929 +8070 +6836 +7396 +7779 +5059 +5299 +3101 +1108 +3408 + +23715 +34978 + +5986 +8393 +3943 +9746 +8118 +6464 +4882 + +66377 + +2291 +6079 +3131 +2006 +6250 +3864 +5167 +3150 +3909 +3435 +2679 +6801 +6361 + +12399 +2412 +2223 +2628 +7269 + +6446 +2771 +6190 +5186 +5672 +5414 +4361 +1204 +1306 +2448 +1425 +2860 +3235 +2123 + +6648 +5782 +2695 +6432 +5396 +5628 +5713 +5889 +5862 +1082 +4800 +6132 + +1804 +6681 +3451 +6039 +6573 +3927 +5420 +1443 +3711 +1906 +5490 +4212 +2221 + +4960 +3469 +3779 +1215 +3665 +6336 +5876 +6523 +1211 +1051 +6900 +2665 +6116 + +5650 +7059 +1520 +3284 +10604 +5219 +6087 + +1385 +3922 +6315 +3317 +2532 +1591 +2191 +6198 +1667 +2358 +4424 +3384 +1452 +1878 + +8968 +6735 +12578 +11709 +7573 +1140 + +8445 +2956 +8682 +8315 +3698 +7811 +6875 +2514 +2348 + +19576 +3115 +13589 +15609 + +43635 + +8805 +24653 +4664 + +6088 +5967 +5407 +3638 +9220 +1047 +2792 +7947 +9559 + +9635 +5762 +7826 +4419 +12047 +8603 +6995 + +6103 +7299 +7646 +4602 +5535 +7703 +6427 +6826 +1506 +5826 +8019 + +5341 +3445 +2020 +4685 +1068 +4974 +5251 +2968 +4358 +4057 +2686 +1122 +2914 +3998 +1247 + +3096 +1152 +4346 +3685 +1365 +4059 +2774 +4958 +3561 +1036 +4612 +4404 +3419 +4733 +3484 + +5167 +1180 +1172 +5057 +3974 +6226 +1309 +4009 +5230 +1105 +4158 +2016 +3786 +2513 + +2940 +1134 +6443 +7340 +5325 +3750 +3839 +7379 +4766 +4173 + +4547 +11948 +7129 +6433 +7101 +2361 +8366 + +1507 +6017 +3115 +6258 +6404 +6000 +1869 +5286 +1623 +1410 +3739 +1632 +2433 + +5846 +6515 +2172 +6728 +6626 +2611 +1583 +2759 +3192 +3197 +1057 +5425 +2712 + +7224 +2884 +2611 +1784 +3902 +7393 +5299 +2389 +1941 +4128 +5461 +1015 + +1743 +9456 +8535 +6753 +7773 +10241 +5969 +8666 + +19734 +2085 +9467 +12261 + +1778 +7318 +2654 +3489 +3276 +4511 +2533 +3292 +4718 +5173 +2267 +5451 + +5567 +5103 +1888 +2210 +4582 +1260 +1264 +4326 +5352 +3549 +5226 +1875 +3156 +3571 + +1380 +7048 +2322 +1694 +4611 +6541 +8334 +2071 +1390 +7593 + +5343 +4878 +1115 +1400 +8760 +4952 +5444 +4012 + +3021 +2193 +6671 +1502 +7320 +7557 +4150 +3959 +1818 +8798 + +19469 +23032 +11831 + +8257 +5493 +5583 +7627 +3801 +3468 +1742 + +9306 +4711 +6825 +8310 +2782 +2447 +10195 +4287 + +10790 +6505 +15999 +15093 +14116 + +1469 +2435 +4534 +8314 +7762 +2064 +5315 +1109 +4439 + +28459 +29638 + +1530 +1274 +5799 +7684 +2594 +6179 +1450 +4017 +5336 +2397 +7630 + +1467 +5771 +5730 +2600 +3958 +4481 +4994 +2718 +6763 +4521 +6496 + +3638 +7722 +6498 +3612 +7521 +1310 +6183 +1850 +6394 +4763 +2657 + +7537 +4591 +2179 +9064 +6970 +2782 +9339 +1265 +7281 + +3380 +12388 +5521 +1191 +8912 + +2776 +3427 +3206 +2075 +2589 +3545 +1806 +2603 +4079 +2700 +3430 +1185 +5708 +1322 + +1466 +4217 +3529 +1232 +5654 +2061 +5435 +5875 +4521 +4841 +6114 +5252 +1185 +5842 + +21001 +8876 + +5131 +5556 +6014 +7791 +3957 +8731 +8053 +8015 + +10379 +3070 +21154 + +3012 +5818 +1144 +6315 +4495 +1846 +7923 +1340 +2675 +4955 +3654 + +5014 +1838 +1302 +4994 +1105 +4055 +3542 +6260 +1219 +1737 +1191 +6069 +5293 +4765 + +18556 +13230 +15065 +18284 + +48135 + +9070 +7739 +6829 +7932 +8713 +4312 +8262 +4925 +2769 + +13528 +4077 +21766 + +6782 +20020 +15396 + +15610 +4166 +5153 +14554 +6008 + +5875 +4131 +2371 +1381 +1793 +5487 +5816 +6051 +5595 +5412 +4800 +3069 +2332 +4360 +2380 + +3310 +5210 +13776 +3665 +2335 +6094 + +2728 +4544 +6050 +8616 +8297 +5501 +1544 +5770 +3807 +5388 + +10758 +7573 +7170 +4945 +8868 +8074 +8055 + +6053 +6804 +6870 +9779 +9992 +7935 + +25222 +8776 +10549 + +2785 +37443 + +7055 +7876 +6587 +6322 +6447 + +2403 +3529 +1514 +2202 +2622 +4484 +3216 +7798 +1135 +2120 +1624 + +12169 +8212 +13127 +11115 +7072 +3080 + +5017 +6458 +5226 +1287 +6413 +7938 +4211 +6724 +4862 +1242 +7481 + +47712 + +8432 +3562 +5349 +2961 +1171 +5888 +10533 +6771 + +31566 +13234 + +52095 + +11601 +2394 +1084 +4909 +5592 +5718 +3912 + +10963 +12196 +15697 +3599 +8635 + +22503 +4376 + +9918 +8408 +1882 +6546 +7045 +3395 +6931 +9059 + +4664 +3815 +3110 +1676 +5396 + +9459 +2435 +9466 +8929 +2587 +8181 +5385 +1703 +7383 + +1271 +6006 +4250 +2558 +4734 +1817 +4695 +5683 +6119 +5150 +1060 +3814 +6012 +3977 + +2690 +1343 +3990 +2648 +5829 +5590 +5609 +1718 +2148 +5400 +1130 +4659 +3463 + +3287 +2098 +5050 +6246 +6901 +2001 +2289 +1892 +7836 +1358 +5224 + +7024 +3331 +2742 +6134 +4850 +6971 +4798 +6270 +3375 +3678 +2791 + +2968 +7186 +7213 +1818 +3735 +6366 +1138 +5386 +2479 +3978 +6926 + +10692 +9805 +18086 +13749 + +9566 +1552 +7121 +2410 +8839 +1581 +7143 +5682 +4454 + +2580 +5217 +5391 +3347 +3384 +5377 +2047 +2465 +4622 +5743 +3015 +1305 +1960 + +15710 +1936 + +2012 +1530 +4286 +3519 +4311 +5820 +2446 +5807 +4890 +1242 +4685 + +28724 + +1094 +1190 +2500 +3617 +1286 +2430 +8633 +6728 +7392 +6037 + +7997 +8802 +4988 +6780 +5537 +7377 +1238 +5501 + +3131 +8597 +7966 +6157 +4817 +2327 +4515 +7983 +3165 +6785 + +6203 +2841 +5423 +2632 +7410 +4532 +2012 +8719 +7507 +1449 + +37282 + +3012 +2285 +4191 +2242 +2014 +3836 +1261 +1951 +4484 +5194 +1328 +1295 +5970 +5030 +3604 + +6092 +2930 +1517 +1064 +6648 +6112 +1392 +6746 +4490 +1785 +3352 +2248 +4975 + +1774 +2925 +5667 +4315 +2228 +4088 +2936 +6062 +4679 +5220 +3173 +2961 +3431 +1907 +3213 + +11417 +6055 +10378 +11585 +11495 +3286 + +4242 +2198 +1453 +2454 +2088 +1068 +3263 +2082 +4262 +3684 +3614 +1624 +1772 +3144 +2264 + +6044 +5100 +1281 +4829 +5966 +5878 + +1648 +3848 +2167 +1269 +2907 +5569 +2338 +3106 +3710 +2819 +3167 +6767 +1247 + +11542 +5319 +7390 +10247 +5825 +3701 +5173 + +24038 +13030 +12703 + +21677 +13326 + +7060 +1796 +1544 +5340 +2291 +3485 +3469 +4839 +1484 + +5894 +1537 +11507 +6994 +8819 +9523 +1286 + +2034 +6244 +4109 +1153 +3516 +1981 +5427 +6918 +5572 +6415 +6618 + +7353 +11049 +9629 +9086 +6160 +10827 + +4833 +4240 +5281 +2985 +5001 +8689 +5876 +7358 +3057 +1477 + +64086 + +5607 + +3536 +10591 +7185 +8614 +1048 +4488 +8893 + +20808 +3764 +4172 + +11061 +3485 + +2184 +4986 +6147 +1483 +4170 +7920 +3623 +4908 +2433 +8087 +5981 + +4145 +5088 +3079 +2696 +1069 +6533 +6205 +4633 +3393 +1875 +6734 +4047 +4783 + +16756 +30731 + +27320 +12665 + +2342 +1130 +2482 +1540 +7263 +6251 +3244 +7960 +7255 +5031 +5540 + +6945 +10279 +5400 +3868 +4448 +1159 +7190 +1858 + +7499 +7600 +3816 +6417 +11374 + +53260 + +10436 +7554 +7263 +7794 +2222 +10687 +3170 + +9157 +3146 +1723 +6066 +9016 +7758 +2885 +4938 + +4079 +1302 +5794 +4695 +3859 +2063 +1108 +2669 +4541 +2125 +3846 +6019 +5780 +5048 + +11772 +3333 +8185 +3786 +7493 +10737 +2954 + +5412 +4386 +2105 +4871 +1621 +2588 +6143 +1314 +4979 +3222 +1918 +4300 + +3598 +3198 +4102 +8638 +3899 +8204 +2209 + +3851 +5188 +5494 +4102 +2427 +2568 +5264 +3951 +5236 +4779 +2152 +2163 +4852 +1866 + +4900 +4865 +1946 +1585 +2073 +6066 +3482 +1118 +1250 +2125 +6795 +4522 +3602 + +1352 +6115 +7150 +6257 +7255 +3150 +3372 +4024 +3744 +1436 +4558 +5741 + +5330 +7428 +6493 +4217 +9133 +2001 +2117 +8205 +4679 + +1039 +5446 +1385 +6914 +2516 +1703 +3439 +5279 +5214 +3995 +2455 +2006 +4653 + +11735 +6890 +18785 +11174 + +6361 +4088 +8048 +2118 +6994 +3985 +7492 +2137 +7852 +7743 +5795 + +1399 +5322 +7254 + +2887 +3842 +2467 +7211 +5307 +6887 +3368 +4678 +1254 +1202 + +4740 +5746 +1742 +2749 +6503 +2949 +1161 +5671 +6057 +5157 +1619 +5947 +6338 +4537 + +1448 +1427 +15871 +4776 +10021 + +7272 +5789 +6013 +3511 +2392 +8082 +9583 +6188 + +42302 + +1943 +3178 +7626 +7150 +2064 +1486 +7344 +1988 +6079 + +7075 +1400 +4314 +5688 +4630 +6478 +1247 +5885 +6741 +6403 +3825 + +5186 +2077 +3021 +4983 +4907 +3529 +3227 +4448 +1144 + +4816 +1427 +8101 +6482 +8208 +9606 +5595 +5328 +7792 + +6090 +2627 +1141 +2740 +4856 +5727 +2102 +2985 +5365 +1041 +1036 +1636 +2345 +2379 +4654 + +7437 +9144 +4579 +1225 +7821 +6909 +1844 +6643 +5680 + +9820 +20439 + +10177 +1834 +5160 +6476 +8352 +6981 +6495 +4232 + +19764 +2091 +13751 + +9408 +21846 +23438 + +36692 + +2312 +23451 +21444 + +8577 +16088 +6638 +3195 + +8178 +2765 +5564 +3191 +4604 +1430 +4034 +6644 +4469 +3445 + +17210 +34046 + +8370 +5176 +1309 +6288 +7944 +1098 +7113 + +1468 +3241 +4149 +7521 +5759 +4483 +2993 +6307 +7456 +2687 +1646 + +5728 +1132 +6223 +4918 +5095 +4815 +5589 +4549 +1827 +2757 +2134 +3079 +4709 + +3905 +4016 +2848 +1499 +2841 +4670 +4478 +3694 +2334 +3019 +3761 +3986 +5486 + +1096 +3760 +4569 +4388 +2661 +6027 +7493 +5582 +6502 +2966 + +7501 +1109 +8955 +3136 +6744 +6849 +1916 +3971 +3396 + +1865 +1631 +1981 +1333 +1431 +5516 +7613 +1926 +3224 +4058 + +9732 +9318 +1299 +7300 +9826 +6425 +7878 +10546 + +10269 +17150 +1771 +10243 + +17664 +19265 +1710 +18754 + +3695 +4063 +1571 +6002 +3421 +2712 +5175 +3987 +2780 +5452 +2383 +4207 +6162 +5926 + +5918 +2169 +5996 +3842 +5338 +1061 +1221 +3034 +1357 +1447 +2178 +5486 +2861 +4633 +1822 + +9053 +9367 +2796 +13702 +10292 +2461 + +20214 +25924 +5012 + +6229 +3670 +9939 +6177 +5980 +9907 +9698 + +3846 +6923 +9058 +9689 +7405 +3684 +9010 +5705 +2877 + +13046 +8583 +2706 +1403 +4918 +10851 + +1349 +11562 +14857 +2260 +8315 + +1375 +3094 +3849 +8763 +7189 +2550 +5346 +1905 +3498 +1416 + +34144 +11430 + +11590 +4032 +7238 +2641 +4778 +4260 +6007 + +1226 +1934 +6034 +3159 +2234 +3509 +4759 +5837 +1789 +4726 +1075 +5543 +2774 +3144 + +8556 +1675 +12135 +10831 +10837 + +3087 +1977 +3832 +6304 +4023 +4219 +1594 +4685 +2650 +1652 +3029 +3913 +3970 +2311 + +1088 +15228 +3891 +9920 +7675 + +4758 +2544 +3198 +7038 +4561 +5105 +7469 +6070 +4917 +1288 +2099 +2257 + +10202 +1478 +1355 +10235 +9177 +7656 +10315 +5359 + +1336 +4004 +2306 +1358 +2831 +2861 +6211 +1492 +5542 +6370 +2111 +4289 +5037 +3784 + +3083 +3535 +2551 +4519 +2305 +5878 +2102 +1477 +5529 +2048 +5068 +5816 +2887 +2567 +3309 + +11079 +4417 +19925 + +3159 +14561 +24535 + +4712 +2595 +2996 +2035 +3697 +2792 +1377 +1002 +4955 +1728 +5072 +5754 +2671 +1267 +5035 + +7438 +2343 +6421 +3441 +6451 +3448 +3853 +7268 +5461 +4265 +5232 + +4224 +1229 +2945 +2152 +2899 +1055 +4692 +2627 +5771 +5807 +4868 +2069 + +7271 +1691 +1945 +1814 +8487 +7836 +11053 + +4542 +6055 +9464 +1919 +6973 +1526 +3408 +5265 +7587 + +26489 +25984 + +13254 +34865 + +3338 +2313 +1854 +1232 +4036 +2156 +3203 +3959 +4643 +4045 +2097 +5726 +3509 +3801 + +1530 +5956 +5236 +6895 +2136 +8084 +1550 +6776 +1042 +5389 +4815 + +1479 +2337 +5443 +5880 +8131 +9774 +4225 +5564 + +9111 +3248 +5761 +8147 +3285 +11468 diff --git a/elixir/aoc/01/main.exs b/elixir/aoc/01/main.exs new file mode 100644 index 0000000..e46450d --- /dev/null +++ b/elixir/aoc/01/main.exs @@ -0,0 +1,12 @@ +{ _, data } = File.read "input" + +xs = String.split(data, "\n\n") +|> Enum.map(fn x -> + String.split(x) + |> Enum.reduce(0, &(&2 + elem(Integer.parse(&1), 0))) +end) + +IO.puts Enum.max(xs) +IO.puts Enum.sort(xs, :desc) +|> Enum.take(3) +|> Enum.sum diff --git a/go/read-unix-sock/read-unix-sock.go b/go/read-unix-sock/read-unix-sock.go new file mode 100644 index 0000000..2b09126 --- /dev/null +++ b/go/read-unix-sock/read-unix-sock.go @@ -0,0 +1,30 @@ +package main + +import ( + "errors" + "fmt" + "io" + "io/fs" + "net" + "os" +) + +func main() { + info, _ := os.Stat(os.Args[1]) + if info.Mode().Type() != fs.ModeSocket { + fmt.Fprintln(os.Stderr, "File is not a socket") + os.Exit(1) + } + + c, _ := net.Dial("unix", os.Args[1]) + defer c.Close() + + buf := make([]byte, 1024) + for { + n, err := c.Read(buf) + if errors.Is(err, io.EOF) { + return + } + fmt.Print(string(buf[:n])) + } +} diff --git a/m4/ifdef/ifdef.m4 b/m4/ifdef/ifdef.m4 new file mode 100644 index 0000000..3bc397e --- /dev/null +++ b/m4/ifdef/ifdef.m4 @@ -0,0 +1,19 @@ +m4_dnl Execute this file with ‘m4 -P ifdef.m4 -’ +m4_changequote([,])m4_dnl +m4_dnl +This file has an implementation of ‘__ifdef’ and ‘__endif’ macros. The two +macros act like the ‘#ifdef’ and ‘#endif’ macros from cpp(1). The usage looks +as follows: + +__ifdef(`foo') +This is some text +and some more text +__ifdef(`bar') +This is also some +text on two lines +__endif + +TODO: Add __elifdef()? + +m4_define([__endif], [m4_divert(0)m4_dnl])m4_dnl +m4_define([__ifdef], [m4_ifdef([$1], [__endif], [m4_divert(-1)])])m4_dnl diff --git a/sed/bf2c/bf2c.sed b/sed/bf2c/bf2c.sed new file mode 100755 index 0000000..787be25 --- /dev/null +++ b/sed/bf2c/bf2c.sed @@ -0,0 +1,27 @@ +#!/usr/bin/sed -f + +1i\ +#include \ +#include \ +#include \ +#include \ +int \ +main(void)\ +{\ + uint8_t *p = calloc(16384, 1);\ + if (!p) \ + err(EXIT_FAILURE, "calloc"); + +/./!d + +s/[^][+<>.,-]//g +s/\[[-+]\]/*p = 0;/g +s/[-+]/(*p)&&;/g +s//p++;/g +s/\./putchar(*p);/g +s/,/*p = (uint8_t)getchar();/g +s/\[/while (*p) {/g +s/\]/}/g + +$a} diff --git a/sed/bf2c/test.bf b/sed/bf2c/test.bf new file mode 100644 index 0000000..c19c44c --- /dev/null +++ b/sed/bf2c/test.bf @@ -0,0 +1,709 @@ +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[-]>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>[-]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[-]>>>>>>>>>>>>>>>> +>>>>>>>>>>>>>>>>>>>>>>>>>[-]>[-]+++++++++++++++++++++++++++.++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++.-------------------.------- +--------------------------------------.+++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++.-----------------------------------------.++++++ +++++++++++++++++++.[-]+++++++++++++++++++++++++++.++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++.------------------------------------- +----.+++++++++.---------.+++++.+++++++++++++++++.++++++++++++.++++++++++++++ ++++++++++++++.++++++++.------------------.+++++++++++++.+.------------------ +-----------------------------------------------------------------.++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.------ +---.----------------------------------------------------------------------.+ ++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++.++++++++++ ++++.+.------.--------------------------------------------------------------- +----------.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++.+++++.------------------------------------------------------------- +-----------------.++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++ ++++++++++++++++++++++++++.-----------------.++++++++.+++++.--------.-------- +----------------------------------------------------.+++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++.++++++++.[-]+++++++++++++++++++++++++++.+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.------------ +----------------------------.++++++++.----------.++++.+++++++++++++++++++.++ ++++++++++++++.+++++++++++++++++++++++++++.---------.+++++++++++..----------- +----.+++++++++.------------------------------------------------------------- +-----------------.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++.+++++++++++++++++++++++.------------------------------------------- +----------------------------------------------.+++++++++++++++++++++++++++++ +++++++.+++++++++++++++++++++++++++++++++++++++++.---.---..+++++++++.+++.---- +----------.----------------------------------------------------------------- +---.+++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++ +++++++++.---.------.-------------------------------------------------------- +--------------.++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++ +++++++++++++.++++++++++++..----.-------------------------------------------- +----------.-----------..++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++...----------------------------------------------------- +--------------------.+++++++++++++++++++++++++++++++++++++++++++++++++++++.+ +++++++++.---.---..+++++++++.+++.--------------.----------------------------- +-------------------------.++++++++++++++++++++++++++++++++++++++++++++++++++ ++.+++++++++++++++++++.------------------------------------------------------ +---------------.+++++++++++++++++++++++++++++++++++++++++++++++++++.++++.--- +.+++++++++++++.+++++.------------------------------------------------------- +---------------.+++++++++++++++.[-]>[-]+++++++++>[-]+++>>[-]>[-]<<<<<[->>>>> ++<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<[-]>>>[-]>[-]<<<[->>>+<<<]>>>[[-<< +<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<->->[-]>[-]<<<[->>>+<<<] +>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]<<[->>+<<]>>[[- +<<+>>]<<<[-]+>>>][-]<[->+<]>[[-<+>]<<<[-]+>>>]<<<[>[-]++++++++++++++++++++++ ++++++++++++++++++++++++>[-]<<<<<[->>>>>+<<<<<]>>>>>[[-<<<<<+>>>>>]<+++++++++ +++++++++++++++++++++++++++++++++++>]<<<[>>>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<< +->>>][-]++++++++++++++++>[-]++++++++++++++>>>>[-]>[-]<<<<<<<<<[->>>>>>>>>+<< +<<<<<<<]>>>>>>>>>[-<+<<<<<<<<+>>>>>>>>>][-]<<[-]+>>>[-]>[-]<<<[->>>+<<<]>>>[ +[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<->->[-]>[-]<<<[->>>+ +<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]<<[->>+<<]> +>[[-<<+>>]<<<[-]>>>][-]<[->+<]>[[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<[- +>>+<<]>>[[-<<+>>]<[-]>]<[[-]<<<<<<<+>>>>>>>]<<<][-]<[->+<]>>[-]+<[[-<+>]<+++ ++++++++++++++++++++++++++++++++++++++++++++++.<+++++++++++++++++++++++++++++ ++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++++.>>>>-< +]>[[-]>[-]<<<<[->>>>+<<<<]>>>>>[-]+<[[-<<<<+>>>>]<<<<+++++++++++++++++++++++ ++++++++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++++. +>>>>>>-<]>[[-]<<<<<<++++++++++++++++++++++++++++++++++++++++++++++++.>>>>>>] +<<]<<<<<<--------------------------------.>[-]>[-]<<<<<<[->>>>>>+<<<<<<]>>>> +>>[-<+<<<<<+>>>>>>]>>>[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]+++++ ++++++>[-]<<[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<< ++>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+ +<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<]<<<]<<<[-] +>>>>>>[-]<[->+<]>[[-<+>]>[-]<<<[->>>+<<<]>>>[-<<<+<<<<+>>>>>>>]<<[-<<<<<->>> +>>]>]<<<[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<<<<[-]> +>>>[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[ +-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>> +>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]+>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>[-]<<<[->>>+<<<]>>>[- +<<<+<<+>>>>>]<<[-<<<->>>]>]<<<[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>] +[-]++++++++++<<<<<[-]>>>>[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<< +<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]> +[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>] +<]<][-]+>[-]<<[->>+<<]>>[[-<<+>>]<[-]>]<[[-]<<<<<<<+>>>>>>>]<<<][-]<[->+<]>> +[-]+<[[-<+>]<++++++++++++++++++++++++++++++++++++++++++++++++.<+++++++++++++ ++++++++++++++++++++++++++++++++++++.<+++++++++++++++++++++++++++++++++++++++ ++++++++++.>>>>-<]>[[-]>[-]<<<<[->>>>+<<<<]>>>>>[-]+<[[-<<<<+>>>>]<<<<+++++++ ++++++++++++++++++++++++++++++++++++++++++.<+++++++++++++++++++++++++++++++++ ++++++++++++++++.>>>>>>-<]>[[-]<<<<<<++++++++++++++++++++++++++++++++++++++++ +++++++++.>>>>>>]<<]<<<<<<+++++++++++++.>[-]>[-]<<<<<<<[->>>>>>>+<<<<<<<]>>>> +>>>[-<+<<<<<<+>>>>>>>][-]+++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++<<[-]+>>>[-]>[-]<<<[->>>+<<<]>>>[[-<<<+ +>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<->->[-]>[-]<<<[->>>+<<<]>> +>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]<<[->>+<<]>>[[-<< ++>>]<<<[-]>>>][-]<[->+<]>[[-<+>]<<<[-]>>>]<<[-]+<[[-]>>[-]++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++.<-<]>[[-]<<<<<<.>>>>>>]<[-]<<<<<<<<[->>>>>>>>+<<< +<<<<<]>>>>>>[-]>>[-<<<<<<<<+>>>>>>+>>][-]<<[->>+<<]>>[[-<<+>>]<<->>]<<[<<<.. +>>>-]<<<.>>>>>[-]<<<<<<<<[->>>>>>>>+<<<<<<<<]>>>>>>[-]>>[-<<<<<<<<+>>>>>>+>> +][-]<<[->>+<<]>>[[-<<+>>]<<->>]<<[<<<..>>>-]>>>[-]>[-]<<<<<<<[->>>>>>>+<<<<< +<<]>>>>>>>[-<+<<<<<<+>>>>>>>][-]++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++<<[-]+>>>[-]>[-]<<<[->>>+<<<]>>> +[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<->->[-]>[-]<<<[->>> ++<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]<<[->>+<<] +>>[[-<<+>>]<<<[-]>>>][-]<[->+<]>[[-<+>]<<<[-]>>>]<<[-]+<[[-]>>[-]+++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++.<-<]>[[-]<<<<<<.>>>>>>]<<<<<<<<]>>>[-]<<<< +<[->>>>>+<<<<<]>>>>>[[-<<<<<+>>>>>]<<<<<<<[-]<[-]<[-]>>>>>>>>>>[-]<<<<<[->>> +>>+<<<<<]>>>>>[-<<<<<+<<<+>>>>>>>>][-]<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +<<<<<<<<<<[->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<< +<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<]>>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<]>>>[[-<<<+>>>]<<[ +-]+>>]<]<][-]<<[->>+<<]>>[[-<<+>>]<<<[-]>>>][-]<[->+<]>[[-<+>]<<<[-]>>>]<<<[ +[-]<<<<----->>>>][-]<<<<<<[->>>>>>+<<<<<<]>>>>>>[-<<<<<<+>>>->>>][-]++++++++ ++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++.>[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>]>>>[-]>[-]<<<<<[->>> +>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++>[-]<<[>>>[-]<<[->>+<<]>[-]>[-<<+> ++>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<< +[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<] +>>>[[-<<<+>>>]<<[-]+>>]<]<]<<<]<<<[-]>>>>>>[-]<[->+<]>[[-<+>]>[-]<<<[->>>+<< +<]>>>[-<<<+<<<<+>>>>>>>]<<[-<<<<<->>>>>]>]<<<[-]>[-]<<<<<[->>>>>+<<<<<]>>>>> +[-<+<<<<+>>>>>][-]++++++++++<<<<<[-]>>>>[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[ +-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]< +]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<< +<+>>>]<<[-]+>>]<]<][-]+>[-]<<[->>+<<]>>[[-<<+>>]<[-]>]<[[-]<<<<<<<+>>>>>>>]< +<<][-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++>[-]<<[>>>[-]< +<[->>+<<]>[-]>[-<<+>+>][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>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>> +>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[- +]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]+>[-]<<[->>+<<]>>[[-<<+>>]<[-]>] +<[[-]<<<<<<<+>>>>>>>]<<<][-]<[->+<]>>[-]+<[[-<+>]<++++++++++++++++++++++++++ +++++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++++.<++ +++++++++++++++++++++++++++++++++++++++++++++++.>>>>-<]>[[-]>[-]<<<<[->>>>+<< +<<]>>>>>[-]+<[[-<<<<+>>>>]<<<<++++++++++++++++++++++++++++++++++++++++++++++ +++.<++++++++++++++++++++++++++++++++++++++++++++++++.>>>>>>-<]>[[-]<<<<<<+++ ++++++++++++++++++++++++++++++++++++++++++++++.>>>>>>]<<]<<<<<<-------------- +------------------.>[-]>[-]<<<<<<[->>>>>>+<<<<<<]>>>>>>[-<+<<<<<+>>>>>>]>>>[ +-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++>[-]<<[>>>[-]<<[-> +>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<] +>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]> +[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<]<<<]<<<[-]>>>>>>[-]<[->+<]>[[-<+> +]>[-]<<<[->>>+<<<]>>>[-<<<+<<<<+>>>>>>>]<<[-<<<<<->>>>>]>]<<<[-]>[-]<<<<<[-> +>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<<<<[-]>>>>[>>>[-]<<[->>+<<]>[- +]>[-<<+>+>][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<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-] +<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]< +]<<<]<[-]>>>>[-]<[->+<]>[[-<+>]>[-]<<<[->>>+<<<]>>>[-<<<+<<+>>>>>]<<[-<<<->> +>]>]<<<[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<<<<[-]>> +>>[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[- +]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>>> +[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]+>[-]<<[->>+<<]> +>[[-<<+>>]<[-]>]<[[-]<<<<<<<+>>>>>>>]<<<][-]<[->+<]>>[-]+<[[-<+>]<++++++++++ +++++++++++++++++++++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++ +++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++++.>>>>-<]>[[-]> +[-]<<<<[->>>>+<<<<]>>>>>[-]+<[[-<<<<+>>>>]<<<<++++++++++++++++++++++++++++++ +++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++++.>>>>>>- +<]>[[-]<<<<<<++++++++++++++++++++++++++++++++++++++++++++++++.>>>>>>]<<]<<<< +<<+++++++++++++.>[-]>[-]<<<<<<<[->>>>>>>+<<<<<<<]>>>>>>>[-<+<<<<<<+>>>>>>>][ +-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++<<[-]+>>>[-]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>> +>[[-<<<+>>>]<<[-]+>>]<]<[<<->->[-]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->> +>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]<<[->>+<<]>>[[-<<+>>]<<<[-]>>>][-]<[->+< +]>[[-<+>]<<<[-]>>>]<<[-]+<[[-]>>[-]+++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++.<-<]>[[-]<<<<<<.>>>>>>]<[-]<<<<<<<<<<<[->>>>>>>>>>>+<<<<<<<<<<<]>>>>>>>> +>[-]>>[-<<<<<<<<<<<+>>>>>>>>>+>>][-]<<[->>+<<]>>[[-<<+>>]<<->>]<<[<<<..>>>-] +<<<.>>>>>[-]<<<<<<<<<<<[->>>>>>>>>>>+<<<<<<<<<<<]>>>>>>>>>[-]>>[-<<<<<<<<<<< ++>>>>>>>>>+>>][-]<<[->>+<<]>>[[-<<+>>]<<->>]<<[<<<..>>>-]>>>[-]>[-]<<<<<<<[- +>>>>>>>+<<<<<<<]>>>>>>>[-<+<<<<<<+>>>>>>>][-]+++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<[-]+>>>[-]>[-]<<< +[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<->->[- +]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<] +[-]<<[->>+<<]>>[[-<<+>>]<<<[-]>>>][-]<[->+<]>[[-<+>]<<<[-]>>>]<<[-]+<[[-]>>[ +-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++.<-<]>[[-]<<<<<<.>>>>>>]<<<<<< +<<<]>[-]++++++++++.[-]+>[-]+>[-]+++++++++++++++++++++++++++.++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++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>>>>>>]<<<][-]<[->+<]>>[-]+<[[-<+> +]<++++++++++++++++++++++++++++++++++++++++++++++++.<++++++++++++++++++++++++ +++++++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++++.> +>>>-<]>[[-]>[-]<<<<[->>>>+<<<<]>>>>>[-]+<[[-<<<<+>>>>]<<<<++++++++++++++++++ +++++++++++++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++ +++++.>>>>>>-<]>[[-]<<<<<<++++++++++++++++++++++++++++++++++++++++++++++++.>> +>>>>]<<]<<<<<<--------------------------------.>[-]>[-]<<<<[->>>>+<<<<]>>>>[ +-<+<<<+>>>>]>>>[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++>[ +-]<<[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]> +[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>> +>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<]<<<]<<<[-]>>>>>>[ +-]<[->+<]>[[-<+>]>[-]<<<[->>>+<<<]>>>[-<<<+<<<<+>>>>>>>]<<[-<<<<<->>>>>]>]<< +<[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<<<<[-]>>>>[>>> +[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[- +>>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<< +<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]+>[-]<<[->>+<<]>>[[-<< ++>>]<[-]>]<[[-]<<<<<<<+>>>>>>>]<<<][-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<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++ +++++++<<<<<[-]>>>>[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>> +[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<< +[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-] ++>[-]<<[->>+<<]>>[[-<<+>>]<[-]>]<[[-]<<<<<<<+>>>>>>>]<<<][-]<[->+<]>>[-]+<[[ +-<+>]<++++++++++++++++++++++++++++++++++++++++++++++++.<++++++++++++++++++++ +++++++++++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++ +++.>>>>-<]>[[-]>[-]<<<<[->>>>+<<<<]>>>>>[-]+<[[-<<<<+>>>>]<<<<++++++++++++++ +++++++++++++++++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++ +++++++++.>>>>>>-<]>[[-]<<<<<<+++++++++++++++++++++++++++++++++++++++++++++++ ++.>>>>>>]<<]<<<<<<+++++++++++++.<<[-]+++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++[>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[>[-]+++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++[-]<-]<-]<<<<<]<<<<+>>>>[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<< +<<+>>>>>][-]++++<<[-]>>>[-]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]> +>>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<<<--->+>>>>>>>>[-]++>[-]>[-]<<<<<<<<<<<[->>>>>>>>>>> ++<<<<<<<<<<<]>>>>>>>>>>>[-<+<<<<<<<<<<+>>>>>>>>>>>]<<<[-]>>>[-]>[-]<<<[->>>+ +<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<->->[-]>[-]< +<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]<[- +>+<]>[[-<+>]<<<[-]+>>>]<<<]<<<<+>>>]<<]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> diff --git a/sed/dc/README b/sed/dc/README new file mode 100644 index 0000000..80653ab --- /dev/null +++ b/sed/dc/README @@ -0,0 +1 @@ +This is not my code. I just think it’s really cool. diff --git a/sed/dc/dc.sed b/sed/dc/dc.sed new file mode 100755 index 0000000..0835ec0 --- /dev/null +++ b/sed/dc/dc.sed @@ -0,0 +1,328 @@ +#!/bin/sed -nf +# dc.sed - an arbitrary precision RPN calculator +# Created by Greg Ubben early 1995, late 1996 +# +# Dedicated to MAC's memory of the IBM 1620 ("CADET") computer. +# @(#)GSU dc.sed 1.1 06-Mar-1999 [non-explanatory] +# +# Examples: +# sqrt(2) to 10 digits: echo "10k 2vp" | dc.sed +# 20 factorial: echo "[d1-d1 != fractional-bases +# SunOS limits: 199/199 commands (though could pack in 10-20 more) +# Limitations: scale <= 999; |obase| >= 1; input digits in [0..F] +# Completed: 1am Feb 4, 1997 + +s/^/|P|K0|I10|O10|?~/ + +:next +s/|?./|?/ +s/|?#[ -}]*/|?/ +/|?!*[lLsS;:<>=]\{0,1\}$/ N +/|?!*[-+*/%^<>=]/ b binop +/^|.*|?[dpPfQXZvxkiosStT;:]/ b binop +/|?[_0-9A-F.]/ b number +/|?\[/ b string +/|?l/ b load +/|?L/ b Load +/|?[sS]/ b save +/|?c/ s/[^|]*// +/|?d/ s/[^~]*~/&&/ +/|?f/ s//&[pSbz0}s\1L\1l{xS\1]dS{xL}/ +/|?:/ s/|?:\([^{}]\)/|?~[s}L{s}L{s}L}s\1q]S}S}S{[L}1-d0>}S}l\1s\1L\1l{xS\1]dS{x/ +/|?[ ~ cdfxKIOT]/ b next +/|?\n/ b next +/|?[pP]/ b print +/|?k/ s/^\([0-9]\{1,3\}\)\([.~].*|K\)[^|]*/\2\1/ +/|?i/ s/^\(-\{0,1\}[0-9]*\.\{0,1\}[0-9]\{1,\}\)\(~.*|I\)[^|]*/\2\1/ +/|?o/ s/^\(-\{0,1\}[1-9][0-9]*\.\{0,1\}[0-9]*\)\(~.*|O\)[^|]*/\2\1/ +/|?[kio]/ b pop +/|?t/ b trunc +/|??/ b input +/|?Q/ b break +/|?q/ b quit +h +/|?[XZz]/ b count +/|?v/ b sqrt +s/.*|?\([^Y]\).*/\1 is unimplemented/ +s/\n/\\n/g +l +g +b next + +:print +/^-\{0,1\}[0-9]*\.\{0,1\}[0-9]\{1,\}~.*|?p/ !b Print +/|O10|/ b Print + +# Print a number in a non-decimal output base. Uses registers a,b,c,d. +# Handles fractional output bases (O<-1 or O>=1), unlike other dc's. +# Converts the fraction correctly on negative output bases, unlike +# UNIX dc. Also scales the fraction more accurately than UNIX dc. +# +s,|?p,&KSa0kd[[-]Psa0la-]Sad0>a[0P]sad0=a[A*2+]saOtd0>a1-ZSd[[[[ ]P]sclb1\ +!=cSbLdlbtZ[[[-]P0lb-sb]sclb0>c1+]sclb0!c]scdld>cscSdLbP]q]Sb\ +[t[1P1-d0bO1!c[A]sbdA=c[B]sbd\ +B=c[C]sbdC=c[D]sbdD=c[E]sbdE=c[F]sb]xscLbP]~Sd[dtdZOZ+k1O/Tdsb[.5]*[.1]O\ +X^*dZkdXK-1+ktsc0kdSb-[Lbdlb*lc+tdSbO*-lb0!=aldx]dsaxLbsb]sad1!>a[[.]POX\ ++sb1[SbO*dtdldx-LbO*dZlb!]\)/0\1/ +/^[^~]*~-\{0,1\}[0-9]*\.\{0,1\}[0-9]\{1,\}~/ !s/~[^~]*\(.*|?!*[^!=<>]\)/~0\1/ +h +/|?\*/ b mul +/|?\// b div +/|?%/ b rem +/|?^/ b exp + +/|?[+-]/ s/^\(-*\)\([^~]*~\)\(-*\)\([^~]*~\).*|?\(-\{0,1\}\).*/\2\4s\3o\1\3\5/ +s/\([^.~]*\)\([^~]*~[^.~]*\)\(.*\)/<\1,\2,\3|=-~.0,123456789<>/ +/|?/ { + s/^\([<>]\)\(-[^~]*~-.*\1\)\(.\)/\3\2/ + s/^\(.\)\(.*|?!*\)\1/\2!\1/ + s/|?![^!]\(.\)/&l\1x/ + s/[^~]*~[^~]*~\(.*|?\)!*.\(.*\)|=.*/\1\2/ + b next +} +s/\(-*\)\1|=.*/;9876543210;9876543210/ +/o-/ s/;9876543210/;0123456789/ +s/^>\([^~]*~\)\([^~]*~\)s\(-*\)\(-*o\3\(-*\)\)/>\2\1s\5\4/ + +s/,\([0-9]*\)\.*\([^,]*\),\([0-9]*\)\.*\([0-9]*\)/\1,\2\3.,\4;0/ +:right1 +s/,\([0-9]\)\([^,]*\),;*\([0-9]\)\([0-9]*\);*0*/\1,\2\3,\4;0/ +t right1 +s/.\([^,]*\),~\(.*\);0~s\(-*\)o-*/\1~\30\2~/ + +:addsub1 +s/\(.\{0,1\}\)\(~[^,]*\)\([0-9]\)\(\.*\),\([^;]*\)\(;\([^;]*\(\3[^;]*\)\).*X*\1\(.*\)\)/\2,\4\5\9\8\7\6/ +s/,\([^~]*~\).\{10\}\(.\)[^;]\{0,9\}\([^;]\{0,1\}\)[^;]*/,\2\1\3/ +# could be done in one s/// if we could have >9 back-refs... +/^~.*~;/ !b addsub1 + +:endbin +s/.\([^,]*\),\([0-9.]*\).*/\1\2/ +G +s/\n[^~]*~[^~]*// + +:normal +s/^\(-*\)0*\([0-9.]*[0-9]\)[^~]*/\1\2/ +s/^[^1-9~]*~/0~/ +b next + +:mul +s/\(-*\)\([0-9]*\)\.*\([0-9]*\)~\(-*\)\([0-9]*\)\.*\([0-9]*\).*|K\([^|]*\).*/\1\4\2\5.!\3\6,|\2<\3~\5>\6:\7;9876543210009909/ + +:mul1 +s/![0-9]\([^<]*\)<\([0-9]\{0,1\}\)\([^>]*\)>\([0-9]\{0,1\}\)/0!\1\2<\3\4>/ +/![0-9]/ s/\(:[^;]*\)\([1-9]\)\(0*\)\([^0]*\2\(.\).*X*\3\(9*\)\)/\1\5\6\4/ +/<~[^>]*>:0*;/ !t mul1 + +s/\(-*\)\1\([^>]*\).*/;\2^>:9876543210aaaaaaaaa/ + +:mul2 +s/\([0-9]~*\)^/^\1/ +s/<\([0-9]*\)\(.*[~^]\)\([0-9]*\)>/\1<\2>\3/ + +:mul3 +s/>\([0-9]\)\(.*\1.\{9\}\(a*\)\)/\1>\2;9\38\37\36\35\34\33\32\31\30/ +s/\(;[^<]*\)\([0-9]\)<\([^;]*\).*\2[0-9]*\(.*\)/\4\1<\2\3/ +s/a[0-9]/a/g +s/a\{10\}/b/g +s/b\{10\}/c/g +/|0*[1-9][^>]*>0*[1-9]/ b mul3 + +s/;/a9876543210;/ +s/a.\{9\}\(.\)[^;]*\([^,]*\)[0-9]\([.!]*\),/\2,\1\3/ +y/cb/ba/ +/|<^/ !b mul2 +b endbin + +:div +# CDDET +/^[-.0]*[1-9]/ !i\ +divide by 0 +// !b pop +s/\(-*\)\([0-9]*\)\.*\([^~]*~-*\)\([0-9]*\)\.*\([^~]*\)/\2.\3\1;0\4.\5;0/ +:div1 +s/^\.0\([^.]*\)\.;*\([0-9]\)\([0-9]*\);*0*/.\1\2.\3;0/ +s/^\([^.]*\)\([0-9]\)\.\([^;]*;\)0*\([0-9]*\)\([0-9]\)\./\1.\2\30\4.\5/ +t div1 +s/~\(-*\)\1\(-*\);0*\([^;]*[0-9]\)[^~]*/~123456789743222111~\2\3/ +s/\(.\(.\)[^~]*\)[^9]*\2.\{8\}\(.\)[^~]*/\3~\1/ +s,|?.,&SaSadSaKdlaZ+LaX-1+[sb1]Sbd1>bkLatsbLa[dSa2lbla*-*dLa!=a]dSaxsakLasbLb*t, +b next + +:rem +s,|?%,&Sadla/LaKSa[999]k*Lak-, +b next + +:exp +# This decimal method is just a little faster than the binary method done +# totally in dc: 1LaKLb [kdSb*LbK]Sb [[.5]*d0ktdSaa[dk]sadKa]dsaxsasaLbsaLatLbk K1-kt, +b next + +# END OF GSU dc.sed + +### colorized by sedsed, a debugger and code formatter for sed scripts +### original script: http://sed.sf.net/grabbag/scripts/dc.sed -- cgit v1.2.3