diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-31 14:38:02 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-31 14:38:02 +0300 |
| commit | c4a21a5ce5bec05798f725151c6bf09cb6507027 (patch) | |
| tree | 10cc650ba5a966f4ef57ebd372839a914f8215c8 | |
| parent | d9b6bc30fbf90661c5614ebe296b2f5281edb7b8 (diff) | |
Update content for html
| -rw-r--r-- | gemfeed/2026-06-01-gt-calculator.html | 114 | ||||
| -rw-r--r-- | gemfeed/atom.xml | 116 | ||||
| -rw-r--r-- | index.html | 2 | ||||
| -rw-r--r-- | uptime-stats.html | 20 |
4 files changed, 224 insertions, 28 deletions
diff --git a/gemfeed/2026-06-01-gt-calculator.html b/gemfeed/2026-06-01-gt-calculator.html index b8ba90c7..3fdf6951 100644 --- a/gemfeed/2026-06-01-gt-calculator.html +++ b/gemfeed/2026-06-01-gt-calculator.html @@ -42,6 +42,7 @@ <li>⇢ <a href='#what-it-does'>What it does</a></li> <li>⇢ <a href='#percentage-calculations'>Percentage calculations</a></li> <li>⇢ <a href='#rpn-arithmetic'>RPN arithmetic</a></li> +<li>⇢ ⇢ <a href='#modulo'>Modulo</a></li> <li>⇢ ⇢ <a href='#logarithms'>Logarithms</a></li> <li>⇢ ⇢ <a href='#hyper-operators-n-ary'>Hyper operators (n-ary)</a></li> <li>⇢ ⇢ <a href='#comparisons-and-booleans'>Comparisons and booleans</a></li> @@ -53,6 +54,7 @@ <li>⇢ ⇢ <a href='#metric-aware-arithmetic'>Metric-aware arithmetic</a></li> <li>⇢ ⇢ <a href='#custom-metrics'>Custom metrics</a></li> <li>⇢ ⇢ <a href='#si-vs-iec-modes'>SI vs IEC modes</a></li> +<li>⇢ ⇢ <a href='#discovering-metrics'>Discovering metrics</a></li> <li>⇢ <a href='#stack-manipulation'>Stack manipulation</a></li> <li>⇢ <a href='#rational-number-mode'>Rational number mode</a></li> <li>⇢ <a href='#the-repl'>The REPL</a></li> @@ -121,6 +123,18 @@ gt <font color="#808080">'3 4 + 5 6 + *'</font> <i><font color="silv <br /> <span>The fast integer power operator <span class='inlinecode'>**</span> uses binary exponentiation (O(log n) instead of O(n)). So <span class='inlinecode'>2 100 **</span> does about 7 multiplications instead of 99. It only accepts integer exponents — use <span class='inlinecode'>^</span> for fractional powers.</span><br /> <br /> +<h3 style='display: inline' id='modulo'>Modulo</h3><br /> +<br /> +<span><span class='inlinecode'>%</span> gives the remainder after division:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>gt <font color="#808080">'17 5 %'</font> <i><font color="silver"># → 2</font></i> +gt <font color="#808080">'100 7 %'</font> <i><font color="silver"># → 2</font></i> +</pre> +<br /> <h3 style='display: inline' id='logarithms'>Logarithms</h3><br /> <br /> <span>Three unary operators for when you need them:</span><br /> @@ -152,7 +166,16 @@ gt <font color="#808080">'2 5 10 [*]'</font> <i><font color="silve gt <font color="#808080">'1000 2 2 2 2 [/]'</font> <i><font color="silver"># → 62.5</font></i> </pre> <br /> -<span>Full set: <span class='inlinecode'>[+]</span>, <span class='inlinecode'>[-]</span>, <span class='inlinecode'>[*]</span>, <span class='inlinecode'>[/]</span>, <span class='inlinecode'>[^]</span>, <span class='inlinecode'>[%]</span> for arithmetic, plus <span class='inlinecode'>[lg]</span>, <span class='inlinecode'>[log]</span>, <span class='inlinecode'>[ln]</span> for logarithms. The log hyper operators work differently from the arithmetic ones — they compute the sum of the log function applied to each value, not a left-associative reduction. The square-bracket syntax is inspired by Raku's hyper operators.</span><br /> +<span>Full set: <span class='inlinecode'>[+]</span>, <span class='inlinecode'>[-]</span>, <span class='inlinecode'>[*]</span>, <span class='inlinecode'>[/]</span>, <span class='inlinecode'>[^]</span>, <span class='inlinecode'>[%]</span> for arithmetic, plus <span class='inlinecode'>[lg]</span>, <span class='inlinecode'>[log]</span>, <span class='inlinecode'>[ln]</span> for logarithms. The log hyper operators work differently from the arithmetic ones — they compute the sum of the log function applied to each value, not a left-associative reduction. A quick entropy calculation:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>gt <font color="#808080">'0.25 0.5 0.25 [lg]'</font> <i><font color="silver"># → -5 (information theory entropy bits)</font></i> +</pre> +<br /> +<span>The square-bracket syntax is inspired by Raku's hyper operators.</span><br /> <br /> <a class='textlink' href='https://raku.org'>https://raku.org</a><br /> <br /> @@ -189,6 +212,16 @@ http://www.gnu.org/software/src-highlite --> gt <font color="#808080">'105 68 gte 100 lte +'</font> <i><font color="silver"># → 1 (out of range)</font></i> </pre> <br /> +<span>Booleans also do plain arithmetic, which is occasionally useful:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>gt <font color="#808080">'true true +'</font> <i><font color="silver"># → 2 (1 + 1)</font></i> +gt <font color="#808080">'false 5 +'</font> <i><font color="silver"># → 5 (0 + 5)</font></i> +</pre> +<br /> <h2 style='display: inline' id='variables-and-symbols'>Variables and symbols</h2><br /> <br /> <span>Store values with three assignment styles:</span><br /> @@ -204,7 +237,19 @@ gt <font color="#808080">'rate 100Mbps ='</font> <i><font color="silv <br /> <span><span class='inlinecode'>vars</span> lists them, <span class='inlinecode'>clear</span> wipes all variables and constants, <span class='inlinecode'>:name d</span> deletes one. In REPL mode, variables persist to disk between sessions.</span><br /> <br /> -<span>Symbols (the <span class='inlinecode'>:x</span> syntax) are named placeholders on the stack. They're how you do explicit variable assignment and deletion without ambiguity. Bare identifiers that don't match any variable or constant also push as symbols.</span><br /> +<span>Symbols (the <span class='inlinecode'>:x</span> syntax) are named placeholders on the stack. The <span class='inlinecode'>:</span> prefix makes intent explicit: <span class='inlinecode'>:x</span> always pushes the symbol <span class='inlinecode'>x</span>, even if a variable named <span class='inlinecode'>x</span> already exists. This is how you delete a variable without ambiguity, and how you push a name onto the stack without resolving it.</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>> x <font color="#000000">10</font> := <i><font color="silver"># define x</font></i> +> x <i><font color="silver"># pushes 10 (variable resolved)</font></i> +> :x <i><font color="silver"># pushes :x (the symbol itself)</font></i> +> :x d <i><font color="silver"># deletes the variable x</font></i> +</pre> +<br /> +<span>Bare identifiers that don't match any variable or constant also push as symbols.</span><br /> <br /> <h2 style='display: inline' id='built-in-constants'>Built-in constants</h2><br /> <br /> @@ -222,6 +267,8 @@ gt <font color="#808080">'sqrt2 sqrt3 *'</font> <i><font color="silv <br /> <span>Greek letter aliases work too: <span class='inlinecode'>π</span>, <span class='inlinecode'>τ</span>, <span class='inlinecode'>φ</span>, <span class='inlinecode'>√2</span>, <span class='inlinecode'>√3</span>, <span class='inlinecode'>√5</span>.</span><br /> <br /> +<span>There's also a <span class='inlinecode'>constants</span> command that lists all 36 in one shot. Edge cases are covered too — <span class='inlinecode'>inf</span>, <span class='inlinecode'>-inf</span>, and <span class='inlinecode'>nan</span> exist as constants if you ever need them.</span><br /> +<br /> <h2 style='display: inline' id='the-metrics-system'>The metrics system</h2><br /> <br /> <span>This is where <span class='inlinecode'>gt</span> earns its swiss army knife title. Every number carries a unit of measurement, and arithmetic understands those units.</span><br /> @@ -304,16 +351,55 @@ gt <font color="#808080">'1GB 1024MB eq'</font> <i><font color="silv by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>custom define reel <font color="#000000">304.8</font> Distance <i><font color="silver"># surveyor's reel</font></i> -custom define fortnight <font color="#000000">1209600</font> Time +<pre>custom define reel <font color="#000000">304.8</font> Distance <i><font color="silver"># surveyor's reel</font></i> +custom define fortnight <font color="#000000">1209600</font> Time <i><font color="silver"># 14 days</font></i> +custom define cup <font color="#000000">240</font> Weight <i><font color="silver"># cooking measure</font></i> </pre> <br /> -<span>Then use them like built-ins: <span class='inlinecode'>5reel @m convert</span> → 1524.</span><br /> +<span>Then use them like built-ins:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>> 5reel @m convert +<font color="#000000">1524</font> +> 2fortnight @day convert +<font color="#000000">28</font> +> 3cup @g convert +<font color="#000000">720</font> +</pre> <br /> <h3 style='display: inline' id='si-vs-iec-modes'>SI vs IEC modes</h3><br /> <br /> <span>Data size units have two modes. SI (default) uses powers of 1000. IEC uses powers of 1024. Switch with <span class='inlinecode'>metric decimal set</span> / <span class='inlinecode'>metric binary set</span>. The dedicated IEC units (KiB, MiB, GiB) are always unambiguous.</span><br /> <br /> +<h3 style='display: inline' id='discovering-metrics'>Discovering metrics</h3><br /> +<br /> +<span>You can explore what's available without leaving the REPL:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>> metric list +DataRate, DataSize, Distance, Speed, Time, Universal, Weight +> metric DataRate +Gbps, Kbps, Mbps, Tbps, bps +</pre> +<br /> +<span><span class='inlinecode'>metric compatible</span> checks whether two values can be combined before you try:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>> 1km 5mi metric compatible +km (Distance) and mi (Distance): <b><u><font color="#000000">true</font></u></b> +> 100Mbps 2hr metric compatible +Mbps (DataRate) and hr (Time): <b><u><font color="#000000">false</font></u></b> +</pre> +<br /> <h2 style='display: inline' id='stack-manipulation'>Stack manipulation</h2><br /> <br /> <span>Five operators for managing the RPN stack:</span><br /> @@ -324,7 +410,7 @@ custom define fortnight <font color="#000000">1209600</font> Time <span>- <span class='inlinecode'>show</span> / <span class='inlinecode'>showstack</span> / <span class='inlinecode'>print</span> — display the stack without modifying it</span><br /> <span>- <span class='inlinecode'>clear</span> — clear all variables and constants</span><br /> <br /> -<span><span class='inlinecode'>dup</span> and <span class='inlinecode'>swap</span> come up a lot. Square a number: <span class='inlinecode'>7 dup *</span> → 49. Reverse operand order: <span class='inlinecode'>2 10 swap /</span> → 5 (instead of 0.2).</span><br /> +<span><span class='inlinecode'>dup</span> and <span class='inlinecode'>swap</span> come up a lot. Square a number: <span class='inlinecode'>7 dup *</span> → 49. Reverse operand order: <span class='inlinecode'>2 10 swap /</span> → 5 (instead of 0.2). <span class='inlinecode'>pop</span> discards the top value if you pushed something by accident: <span class='inlinecode'>5 6 pop</span> → 5.</span><br /> <br /> <h2 style='display: inline' id='rational-number-mode'>Rational number mode</h2><br /> <br /> @@ -364,9 +450,19 @@ Rational mode enabled <br /> <span>Run <span class='inlinecode'>gt</span> with no arguments when attached to a terminal and you get the interactive session. Command history (1000 entries, persisted to <span class='inlinecode'>~/.gt_history</span>), tab completion, Emacs-style line editing, Ctrl+R reverse search.</span><br /> <br /> -<span>Variables save to disk between sessions. Session logging with <span class='inlinecode'>--log session.log</span>. Session state lives in <span class='inlinecode'>~/.local/state/gt/vars</span>.</span><br /> +<span>Variables save to disk between sessions. Session state lives in <span class='inlinecode'>~/.local/state/gt/vars</span>. For auditing or note-taking, session logging works like this:</span><br /> <br /> -<span>Built-in REPL commands: <span class='inlinecode'>help</span>, <span class='inlinecode'>clear</span>, <span class='inlinecode'>quit</span>/<span class='inlinecode'>exit</span>, <span class='inlinecode'>rpn</span>/<span class='inlinecode'>calc</span>, <span class='inlinecode'>rat</span>, <span class='inlinecode'>stack</span>. Tab-completes.</span><br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>$ gt --log calc-session.log +> 1Gbps 1hr * +> @GB convert +> quit +</pre> +<br /> +<span>Built-in REPL commands: <span class='inlinecode'>help</span>, <span class='inlinecode'>clear</span>, <span class='inlinecode'>quit</span>/<span class='inlinecode'>exit</span>, <span class='inlinecode'>rpn</span>/<span class='inlinecode'>calc</span>, <span class='inlinecode'>rat</span>, <span class='inlinecode'>stack</span>. <span class='inlinecode'>stack</span> is a shorthand hint for viewing the RPN stack. Tab-completes.</span><br /> <br /> <span>Here's what a session looks like:</span><br /> <br /> @@ -494,6 +590,8 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Or from the source directory: <span class='inlinecode'>mage install</span>.</span><br /> <br /> +<span>One quirk: there are no <span class='inlinecode'>-h</span> or <span class='inlinecode'>--help</span> flags. <span class='inlinecode'>gt version</span> gives you the version, and bare <span class='inlinecode'>gt</span> with no TTY prints usage. If you pass <span class='inlinecode'>-h</span>, <span class='inlinecode'>gt</span> tries to evaluate it as RPN and errors. It's intentional and keeps the surface area small.</span><br /> +<br /> <h2 style='display: inline' id='wrapping-up'>Wrapping up</h2><br /> <br /> <span>The local LLM experiment worked. The code is clean enough, the tests pass, the docs are thorough, and I use the tool. The logo was generated by a local model too.</span><br /> diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index cb95cf18..d3259c9c 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2026-05-31T14:32:45+03:00</updated> + <updated>2026-05-31T14:37:53+03:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="https://foo.zone/gemfeed/atom.xml" rel="self" /> @@ -49,6 +49,7 @@ <li>⇢ <a href='#what-it-does'>What it does</a></li> <li>⇢ <a href='#percentage-calculations'>Percentage calculations</a></li> <li>⇢ <a href='#rpn-arithmetic'>RPN arithmetic</a></li> +<li>⇢ ⇢ <a href='#modulo'>Modulo</a></li> <li>⇢ ⇢ <a href='#logarithms'>Logarithms</a></li> <li>⇢ ⇢ <a href='#hyper-operators-n-ary'>Hyper operators (n-ary)</a></li> <li>⇢ ⇢ <a href='#comparisons-and-booleans'>Comparisons and booleans</a></li> @@ -60,6 +61,7 @@ <li>⇢ ⇢ <a href='#metric-aware-arithmetic'>Metric-aware arithmetic</a></li> <li>⇢ ⇢ <a href='#custom-metrics'>Custom metrics</a></li> <li>⇢ ⇢ <a href='#si-vs-iec-modes'>SI vs IEC modes</a></li> +<li>⇢ ⇢ <a href='#discovering-metrics'>Discovering metrics</a></li> <li>⇢ <a href='#stack-manipulation'>Stack manipulation</a></li> <li>⇢ <a href='#rational-number-mode'>Rational number mode</a></li> <li>⇢ <a href='#the-repl'>The REPL</a></li> @@ -128,6 +130,18 @@ gt <font color="#808080">'3 4 + 5 6 + *'</font> <i><font color="silv <br /> <span>The fast integer power operator <span class='inlinecode'>**</span> uses binary exponentiation (O(log n) instead of O(n)). So <span class='inlinecode'>2 100 **</span> does about 7 multiplications instead of 99. It only accepts integer exponents — use <span class='inlinecode'>^</span> for fractional powers.</span><br /> <br /> +<h3 style='display: inline' id='modulo'>Modulo</h3><br /> +<br /> +<span><span class='inlinecode'>%</span> gives the remainder after division:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>gt <font color="#808080">'17 5 %'</font> <i><font color="silver"># → 2</font></i> +gt <font color="#808080">'100 7 %'</font> <i><font color="silver"># → 2</font></i> +</pre> +<br /> <h3 style='display: inline' id='logarithms'>Logarithms</h3><br /> <br /> <span>Three unary operators for when you need them:</span><br /> @@ -159,7 +173,16 @@ gt <font color="#808080">'2 5 10 [*]'</font> <i><font color="silve gt <font color="#808080">'1000 2 2 2 2 [/]'</font> <i><font color="silver"># → 62.5</font></i> </pre> <br /> -<span>Full set: <span class='inlinecode'>[+]</span>, <span class='inlinecode'>[-]</span>, <span class='inlinecode'>[*]</span>, <span class='inlinecode'>[/]</span>, <span class='inlinecode'>[^]</span>, <span class='inlinecode'>[%]</span> for arithmetic, plus <span class='inlinecode'>[lg]</span>, <span class='inlinecode'>[log]</span>, <span class='inlinecode'>[ln]</span> for logarithms. The log hyper operators work differently from the arithmetic ones — they compute the sum of the log function applied to each value, not a left-associative reduction. The square-bracket syntax is inspired by Raku's hyper operators.</span><br /> +<span>Full set: <span class='inlinecode'>[+]</span>, <span class='inlinecode'>[-]</span>, <span class='inlinecode'>[*]</span>, <span class='inlinecode'>[/]</span>, <span class='inlinecode'>[^]</span>, <span class='inlinecode'>[%]</span> for arithmetic, plus <span class='inlinecode'>[lg]</span>, <span class='inlinecode'>[log]</span>, <span class='inlinecode'>[ln]</span> for logarithms. The log hyper operators work differently from the arithmetic ones — they compute the sum of the log function applied to each value, not a left-associative reduction. A quick entropy calculation:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>gt <font color="#808080">'0.25 0.5 0.25 [lg]'</font> <i><font color="silver"># → -5 (information theory entropy bits)</font></i> +</pre> +<br /> +<span>The square-bracket syntax is inspired by Raku's hyper operators.</span><br /> <br /> <a class='textlink' href='https://raku.org'>https://raku.org</a><br /> <br /> @@ -196,6 +219,16 @@ http://www.gnu.org/software/src-highlite --> gt <font color="#808080">'105 68 gte 100 lte +'</font> <i><font color="silver"># → 1 (out of range)</font></i> </pre> <br /> +<span>Booleans also do plain arithmetic, which is occasionally useful:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>gt <font color="#808080">'true true +'</font> <i><font color="silver"># → 2 (1 + 1)</font></i> +gt <font color="#808080">'false 5 +'</font> <i><font color="silver"># → 5 (0 + 5)</font></i> +</pre> +<br /> <h2 style='display: inline' id='variables-and-symbols'>Variables and symbols</h2><br /> <br /> <span>Store values with three assignment styles:</span><br /> @@ -211,7 +244,19 @@ gt <font color="#808080">'rate 100Mbps ='</font> <i><font color="silv <br /> <span><span class='inlinecode'>vars</span> lists them, <span class='inlinecode'>clear</span> wipes all variables and constants, <span class='inlinecode'>:name d</span> deletes one. In REPL mode, variables persist to disk between sessions.</span><br /> <br /> -<span>Symbols (the <span class='inlinecode'>:x</span> syntax) are named placeholders on the stack. They're how you do explicit variable assignment and deletion without ambiguity. Bare identifiers that don't match any variable or constant also push as symbols.</span><br /> +<span>Symbols (the <span class='inlinecode'>:x</span> syntax) are named placeholders on the stack. The <span class='inlinecode'>:</span> prefix makes intent explicit: <span class='inlinecode'>:x</span> always pushes the symbol <span class='inlinecode'>x</span>, even if a variable named <span class='inlinecode'>x</span> already exists. This is how you delete a variable without ambiguity, and how you push a name onto the stack without resolving it.</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>> x <font color="#000000">10</font> := <i><font color="silver"># define x</font></i> +> x <i><font color="silver"># pushes 10 (variable resolved)</font></i> +> :x <i><font color="silver"># pushes :x (the symbol itself)</font></i> +> :x d <i><font color="silver"># deletes the variable x</font></i> +</pre> +<br /> +<span>Bare identifiers that don't match any variable or constant also push as symbols.</span><br /> <br /> <h2 style='display: inline' id='built-in-constants'>Built-in constants</h2><br /> <br /> @@ -229,6 +274,8 @@ gt <font color="#808080">'sqrt2 sqrt3 *'</font> <i><font color="silv <br /> <span>Greek letter aliases work too: <span class='inlinecode'>π</span>, <span class='inlinecode'>τ</span>, <span class='inlinecode'>φ</span>, <span class='inlinecode'>√2</span>, <span class='inlinecode'>√3</span>, <span class='inlinecode'>√5</span>.</span><br /> <br /> +<span>There's also a <span class='inlinecode'>constants</span> command that lists all 36 in one shot. Edge cases are covered too — <span class='inlinecode'>inf</span>, <span class='inlinecode'>-inf</span>, and <span class='inlinecode'>nan</span> exist as constants if you ever need them.</span><br /> +<br /> <h2 style='display: inline' id='the-metrics-system'>The metrics system</h2><br /> <br /> <span>This is where <span class='inlinecode'>gt</span> earns its swiss army knife title. Every number carries a unit of measurement, and arithmetic understands those units.</span><br /> @@ -311,16 +358,55 @@ gt <font color="#808080">'1GB 1024MB eq'</font> <i><font color="silv by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>custom define reel <font color="#000000">304.8</font> Distance <i><font color="silver"># surveyor's reel</font></i> -custom define fortnight <font color="#000000">1209600</font> Time +<pre>custom define reel <font color="#000000">304.8</font> Distance <i><font color="silver"># surveyor's reel</font></i> +custom define fortnight <font color="#000000">1209600</font> Time <i><font color="silver"># 14 days</font></i> +custom define cup <font color="#000000">240</font> Weight <i><font color="silver"># cooking measure</font></i> </pre> <br /> -<span>Then use them like built-ins: <span class='inlinecode'>5reel @m convert</span> → 1524.</span><br /> +<span>Then use them like built-ins:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>> 5reel @m convert +<font color="#000000">1524</font> +> 2fortnight @day convert +<font color="#000000">28</font> +> 3cup @g convert +<font color="#000000">720</font> +</pre> <br /> <h3 style='display: inline' id='si-vs-iec-modes'>SI vs IEC modes</h3><br /> <br /> <span>Data size units have two modes. SI (default) uses powers of 1000. IEC uses powers of 1024. Switch with <span class='inlinecode'>metric decimal set</span> / <span class='inlinecode'>metric binary set</span>. The dedicated IEC units (KiB, MiB, GiB) are always unambiguous.</span><br /> <br /> +<h3 style='display: inline' id='discovering-metrics'>Discovering metrics</h3><br /> +<br /> +<span>You can explore what's available without leaving the REPL:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>> metric list +DataRate, DataSize, Distance, Speed, Time, Universal, Weight +> metric DataRate +Gbps, Kbps, Mbps, Tbps, bps +</pre> +<br /> +<span><span class='inlinecode'>metric compatible</span> checks whether two values can be combined before you try:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>> 1km 5mi metric compatible +km (Distance) and mi (Distance): <b><u><font color="#000000">true</font></u></b> +> 100Mbps 2hr metric compatible +Mbps (DataRate) and hr (Time): <b><u><font color="#000000">false</font></u></b> +</pre> +<br /> <h2 style='display: inline' id='stack-manipulation'>Stack manipulation</h2><br /> <br /> <span>Five operators for managing the RPN stack:</span><br /> @@ -331,7 +417,7 @@ custom define fortnight <font color="#000000">1209600</font> Time <span>- <span class='inlinecode'>show</span> / <span class='inlinecode'>showstack</span> / <span class='inlinecode'>print</span> — display the stack without modifying it</span><br /> <span>- <span class='inlinecode'>clear</span> — clear all variables and constants</span><br /> <br /> -<span><span class='inlinecode'>dup</span> and <span class='inlinecode'>swap</span> come up a lot. Square a number: <span class='inlinecode'>7 dup *</span> → 49. Reverse operand order: <span class='inlinecode'>2 10 swap /</span> → 5 (instead of 0.2).</span><br /> +<span><span class='inlinecode'>dup</span> and <span class='inlinecode'>swap</span> come up a lot. Square a number: <span class='inlinecode'>7 dup *</span> → 49. Reverse operand order: <span class='inlinecode'>2 10 swap /</span> → 5 (instead of 0.2). <span class='inlinecode'>pop</span> discards the top value if you pushed something by accident: <span class='inlinecode'>5 6 pop</span> → 5.</span><br /> <br /> <h2 style='display: inline' id='rational-number-mode'>Rational number mode</h2><br /> <br /> @@ -371,9 +457,19 @@ Rational mode enabled <br /> <span>Run <span class='inlinecode'>gt</span> with no arguments when attached to a terminal and you get the interactive session. Command history (1000 entries, persisted to <span class='inlinecode'>~/.gt_history</span>), tab completion, Emacs-style line editing, Ctrl+R reverse search.</span><br /> <br /> -<span>Variables save to disk between sessions. Session logging with <span class='inlinecode'>--log session.log</span>. Session state lives in <span class='inlinecode'>~/.local/state/gt/vars</span>.</span><br /> +<span>Variables save to disk between sessions. Session state lives in <span class='inlinecode'>~/.local/state/gt/vars</span>. For auditing or note-taking, session logging works like this:</span><br /> <br /> -<span>Built-in REPL commands: <span class='inlinecode'>help</span>, <span class='inlinecode'>clear</span>, <span class='inlinecode'>quit</span>/<span class='inlinecode'>exit</span>, <span class='inlinecode'>rpn</span>/<span class='inlinecode'>calc</span>, <span class='inlinecode'>rat</span>, <span class='inlinecode'>stack</span>. Tab-completes.</span><br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>$ gt --log calc-session.log +> 1Gbps 1hr * +> @GB convert +> quit +</pre> +<br /> +<span>Built-in REPL commands: <span class='inlinecode'>help</span>, <span class='inlinecode'>clear</span>, <span class='inlinecode'>quit</span>/<span class='inlinecode'>exit</span>, <span class='inlinecode'>rpn</span>/<span class='inlinecode'>calc</span>, <span class='inlinecode'>rat</span>, <span class='inlinecode'>stack</span>. <span class='inlinecode'>stack</span> is a shorthand hint for viewing the RPN stack. Tab-completes.</span><br /> <br /> <span>Here's what a session looks like:</span><br /> <br /> @@ -501,6 +597,8 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Or from the source directory: <span class='inlinecode'>mage install</span>.</span><br /> <br /> +<span>One quirk: there are no <span class='inlinecode'>-h</span> or <span class='inlinecode'>--help</span> flags. <span class='inlinecode'>gt version</span> gives you the version, and bare <span class='inlinecode'>gt</span> with no TTY prints usage. If you pass <span class='inlinecode'>-h</span>, <span class='inlinecode'>gt</span> tries to evaluate it as RPN and errors. It's intentional and keeps the surface area small.</span><br /> +<br /> <h2 style='display: inline' id='wrapping-up'>Wrapping up</h2><br /> <br /> <span>The local LLM experiment worked. The code is clean enough, the tests pass, the docs are thorough, and I use the tool. The logo was generated by a local model too.</span><br /> @@ -13,7 +13,7 @@ </p> <h1 style='display: inline' id='hello'>Hello!</h1><br /> <br /> -<span class='quote'>This site was generated at 2026-05-31T14:33:01+03:00 by <span class='inlinecode'>Gemtexter</span></span><br /> +<span class='quote'>This site was generated at 2026-05-31T14:37:53+03:00 by <span class='inlinecode'>Gemtexter</span></span><br /> <br /> <span>Welcome to the foo.zone!</span><br /> <br /> diff --git a/uptime-stats.html b/uptime-stats.html index 55ca2874..a38b61b5 100644 --- a/uptime-stats.html +++ b/uptime-stats.html @@ -13,7 +13,7 @@ </p> <h1 style='display: inline' id='my-machine-uptime-stats'>My machine uptime stats</h1><br /> <br /> -<span class='quote'>This site was last updated at 2026-05-31T14:33:00+03:00</span><br /> +<span class='quote'>This site was last updated at 2026-05-31T14:37:53+03:00</span><br /> <br /> <span>The following stats were collected via <span class='inlinecode'>uptimed</span> on all of my personal computers over many years and the output was generated by <span class='inlinecode'>goprecords</span>, the global uptime records stats analyser of mine.</span><br /> <br /> @@ -26,7 +26,7 @@ <br /> <a class='textlink' href='./gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Uptime records with Raku (and also there is a version in Go now)</a><br /> <br /> -<span class='quote'>Uptime stats were last updated Sun 31 May 14:33:01 EEST 2026</span><br /> +<span class='quote'>Uptime stats were last updated Sun 31 May 14:37:53 EEST 2026</span><br /> <br /> <h2 style='display: inline' id='top-20-uptime-s-by-host'>Top 20 Uptime's by Host</h2><br /> <br /> @@ -141,13 +141,13 @@ | 10. | makemake | 81 | Linux 6.9.9-200.fc40.x86_64 | | 11. | uranus | 59 | NetBSD 10.1 | | 12. | pluto | 51 | Linux 3.2.0-4-amd64 | -| 13. | *mega-m3-pro | 50 | Darwin 25.3.0 | -| 14. | mega15289 | 50 | Darwin 23.4.0 | -| 15. | *fishfinger | 50 | OpenBSD 7.8 | +| 13. | *fishfinger | 50 | OpenBSD 7.8 | +| 14. | *mega-m3-pro | 50 | Darwin 25.3.0 | +| 15. | mega15289 | 50 | Darwin 23.4.0 | | 16. | *blowfish | 50 | OpenBSD 7.8 | | 17. | t450 | 46 | FreeBSD 14.2-RELEASE | -| 18. | phobos | 40 | Linux 3.4.0-CM-g1dd7cdf | -| 19. | mega8477 | 40 | Darwin 13.4.0 | +| 18. | mega8477 | 40 | Darwin 13.4.0 | +| 19. | phobos | 40 | Linux 3.4.0-CM-g1dd7cdf | | 20. | *pi0 | 34 | Linux 6.1.31-v8.1.el9.altarch | +-----+----------------+-------+-------------------------------+ </pre> @@ -203,14 +203,14 @@ | 10. | *OpenBSD 7... | 110 | | 11. | Darwin 13... | 40 | | 12. | Darwin 24... | 27 | -| 13. | Darwin 23... | 25 | -| 14. | FreeBSD 5... | 25 | +| 13. | FreeBSD 5... | 25 | +| 14. | Darwin 23... | 25 | | 15. | Linux 2... | 22 | | 16. | Darwin 21... | 17 | | 17. | Darwin 15... | 15 | | 18. | Darwin 22... | 12 | | 19. | Darwin 18... | 11 | -| 20. | FreeBSD 7... | 10 | +| 20. | FreeBSD 6... | 10 | +-----+----------------+-------+ </pre> <br /> |
