<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>5snb.club</title>
      <link>https://www.5snb.club</link>
      <description></description>
      <generator>Zola</generator>
      <language>en</language>
      <atom:link href="https://www.5snb.club/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Wed, 27 May 2026 00:00:00 +0000</lastBuildDate>
      
      
      <item>
          <title>A033307.opus</title>
          <pubDate>Wed, 27 May 2026 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2026/A033307/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2026/A033307/</guid>
          <description>&lt;p&gt;a very Normal piece . tones generated from an artificial telephone and put in an artificial room,
compressed to 6kb&#x2F;s for flavor . CC-0&#x2F;public domain , as it is all computer generated .&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;beats &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;018-texas-blue&#x2F;&quot;&gt;018-texas blue.mp3&lt;&#x2F;a&gt; for lowest bitrate
piece of audio published here .&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;enjoy . :]&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2026&#x2F;A033307&#x2F;A033307.opus&quot; type=&quot;audio&amp;#x2F;ogg&quot;&gt;
The audio tag is not supported on your browser.
&lt;&#x2F;audio&gt;
</description>
      </item>
      
      
      <item>
          <title>art!!!</title>
          <pubDate>Mon, 20 Apr 2026 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2026/art/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2026/art/</guid>
          <description>&lt;p&gt;just a heads up, it finally got around to publishing the second artwork commissioned of it to the
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;comms&#x2F;&quot;&gt;comms&lt;&#x2F;a&gt; page. it doesn’t have that much art at the moment but will add any new
pieces there.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;uh meow :3&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>jan linkdump</title>
          <pubDate>Fri, 30 Jan 2026 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2026/linkdump/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2026/linkdump/</guid>
          <description>&lt;p&gt;some cool shit that it’s read&#x2F;watched recently and thinks others should probably see too. or not.
it’s not a cop.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;youtube-videos&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#youtube-videos&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
youtube videos&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=TvARDMlXeYM&quot;&gt;Evanescent (ft. メグッポイド GUMI, Kamui Gakupo)&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;friend recommended this, and it’s fucking beautiful. the art and animation is fantastic.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=SSSB7ZTSXH4&quot;&gt;The Remarkable Computers Built Not to Fail&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;good 45 minute video essay about the history of tandem.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=n87d7j0hfOE&quot;&gt;Ephemeral Cathodic Relay - Commodore 8296 PET demo by Genesis Project and Distant Future&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=NuYGNlidKfw&quot;&gt;[COMMENTATED TAS] Kirby Super Star Ultra 100% Speedrun - 1:35:09 &lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=sqvksWQNxAo&quot;&gt;SiIvaGunner’s Infinite Quality Achieved w&#x2F; Twitch Chat &amp;amp; SiIva Chat Replay&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;this is a recording of the stream, so might not be the best to watch if you just want to watch
the visuals directly, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=E4qMxJJAszg&quot;&gt;link to the visuals only&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;an utterly banger album, must have been cool as hell to be there live. also, furries in the audience ^_^&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;articles&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#articles&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
articles&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;rampantgames.com&#x2F;blog&#x2F;?p=7745&quot;&gt;Black Triangles&lt;&#x2F;a&gt; &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20260101071828&#x2F;https:&#x2F;&#x2F;rampantgames.com&#x2F;blog&#x2F;?p=7745&quot;&gt;wayback&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;a good term for infrastructure work that unblocks other work, but is on its face, boring.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;buttondown.com&#x2F;hillelwayne&#x2F;archive&#x2F;write-the-most-clever-code-you-possibly-can&#x2F;&quot;&gt;Write the most clever code you possibly can&lt;&#x2F;a&gt; &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20251218131240&#x2F;https:&#x2F;&#x2F;buttondown.com&#x2F;hillelwayne&#x2F;archive&#x2F;write-the-most-clever-code-you-possibly-can&#x2F;&quot;&gt;wayback&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;writing Clever Code(tm) as a &lt;em&gt;learning&lt;&#x2F;em&gt; tool.&lt;&#x2F;p&gt;
&lt;p&gt;to add to that, code golf is a great way to learn the niche parts of your language! you &lt;em&gt;should&lt;&#x2F;em&gt;
try and write code under arbitrary restrictions (one statement, minimal size, no variables, etc) to
force you to learn more aspects of the language you’re working in. it will come in handy when
you’re able to recognise when a technique learned there is actually the cleanest way to write
code in a “real” situation.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;techcrunch.com&#x2F;2013&#x2F;07&#x2F;06&#x2F;tools-for-treason&#x2F;&quot;&gt;Tools For Treason&lt;&#x2F;a&gt; &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20250319201630&#x2F;https:&#x2F;&#x2F;techcrunch.com&#x2F;2013&#x2F;07&#x2F;06&#x2F;tools-for-treason&#x2F;&quot;&gt;wayback&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;a good post that it was linked while talking about the ethics of building anonymity software.&lt;&#x2F;p&gt;
&lt;p&gt;you can’t code for ethics, if you do your job right there’s no way for you to prevent someone
from using a given tool. (and if you do build a backdoor in, then The State can compel you to
prevent access to people it doesn’t like.)&lt;&#x2F;p&gt;
&lt;p&gt;that’s not to say all tools are built equally. technology is still political, and &lt;em&gt;what&lt;&#x2F;em&gt; you
build changes who benefits. anyone can use Tor, but it’s much more useful to those who want to
circumvent censorship than those who want to do the censoring, so Tor’s existence is
anti-censorship.&lt;&#x2F;p&gt;
&lt;p&gt;that does mean allowing both queers and fascists to publish websites, but you can’t prevent one
without preventing the other.&lt;&#x2F;p&gt;
&lt;p&gt;it’s an open advocate for tor (runs a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;snowflake.torproject.org&#x2F;&quot;&gt;snowflake proxy&lt;&#x2F;a&gt;
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;oljlphash3bpqtrvqpr5gwzrhroziw4mddidi5d2qa4qjejcbrmoypqd.onion&#x2F;index.html&quot;&gt;tor&lt;&#x2F;a&gt;) since
ultimately, it’s doing more good than harm, and fascists would be doing just fine without tor.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;theanarchistlibrary.org&#x2F;library&#x2F;anonymous-make-the-golf-course-a-public-sex-forest&quot;&gt;Make The Golf Course A Public Sex Forest!&lt;&#x2F;a&gt; &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;libraryqxxiqakubqv3dc2bend2koqsndbwox2johfywcatxie26bsad.onion&#x2F;library&#x2F;anonymous-make-the-golf-course-a-public-sex-forest&quot;&gt;tor&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;(nsfw text.)&lt;&#x2F;p&gt;
&lt;p&gt;not a fucking joke, and it stands by this. good pamphlet.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      
      
      <item>
          <title>using system agenix inside home-manager</title>
          <pubDate>Thu, 15 Jan 2026 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2026/using-system-agenix-inside-home-manager/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2026/using-system-agenix-inside-home-manager/</guid>
          <description>&lt;p&gt;if you’re already using home-manager as a system module, you don’t need to use home-manager agenix
to manage user secrets. this might be obvious in retrospect but it took it a while to realize how to
do, so sharing it here :3&lt;&#x2F;p&gt;
&lt;p&gt;the basic premise is that home-manager offers an &lt;code&gt;osConfig&lt;&#x2F;code&gt; that refers to the &lt;em&gt;system&lt;&#x2F;em&gt;
configuration, which you can read from. &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nix-community.github.io&#x2F;home-manager&#x2F;&quot;&gt;https:&#x2F;&#x2F;nix-community.github.io&#x2F;home-manager&#x2F;&lt;&#x2F;a&gt; mentions&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Home Manager will pass &lt;code&gt;osConfig&lt;&#x2F;code&gt; as a module argument to any modules you create. This contains the
system’s NixOS configuration.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;inside &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;5225225&#x2F;dotfiles&#x2F;src&#x2F;commit&#x2F;41298a28f9aa33ef7f085b3812b651f12bd7ce0c&#x2F;system&#x2F;agenix.nix&quot;&gt;&lt;code&gt;system&#x2F;agenix.nix&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; (using &lt;em&gt;system&lt;&#x2F;em&gt; age)&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    identityPaths&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&#x2F;etc&#x2F;agenix-secrets&#x2F;key.txt&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    secrets&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;      listenbrainz-mpd-token&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; ..&#x2F;secrets&#x2F;listenbrainz-mpd-token.age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;400&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        owner&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;fivie&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        group&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;users&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;be sure to set &lt;code&gt;owner&lt;&#x2F;code&gt; appropriately, otherwise your user won’t be able to read it :)&lt;&#x2F;p&gt;
&lt;p&gt;inside &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;5225225&#x2F;dotfiles&#x2F;src&#x2F;commit&#x2F;41298a28f9aa33ef7f085b3812b651f12bd7ce0c&#x2F;user&#x2F;listenbrainz-mpd.nix&quot;&gt;&lt;code&gt;user&#x2F;listenbrainz-mpd.nix&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; (this is a &lt;em&gt;home-manager&lt;&#x2F;em&gt; module)&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; osConfig&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;, ...&lt;&#x2F;span&gt;&lt;span&gt; }:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  services&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;listenbrainz-mpd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    enable&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    settings&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;      submission&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        token_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; osConfig&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;secrets&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;listenbrainz-mpd-token&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;doing this means you don’t need to fuck around with agenix’s home-manager module that has paths
that have environment variables in them (which work approximately nowhere), and you only need to
manage &lt;em&gt;one&lt;&#x2F;em&gt; key per device, rather than having a distinction between user-level and system-level
keys.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>WE KILL PEOPLE BASED ON METADATA (this site is available as an .onion service)</title>
          <pubDate>Mon, 08 Dec 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/we-kill-people-based-on-metadata/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/we-kill-people-based-on-metadata/</guid>
          <description>&lt;p&gt;tldr: &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;7ze37n6jnngvwurvtlafprl3nvdsxjiaqaluzztqhl2o5vigi3fj5lyd.onion&#x2F;&quot;&gt;http:&#x2F;&#x2F;7ze37n6jnngvwurvtlafprl3nvdsxjiaqaluzztqhl2o5vigi3fj5lyd.onion&#x2F;&lt;&#x2F;a&gt;, and use
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.torproject.org&#x2F;&quot;&gt;https:&#x2F;&#x2F;www.torproject.org&#x2F;&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;why-tor&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#why-tor&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
why tor&lt;&#x2F;h2&gt;
&lt;p&gt;in the relatively non-fascist[yet] country of the uk, the reasoning is moreso “the government
shouldn’t be able to see every domain this one visits[replace “government” with “anyone with the
means to monitor a public wifi network” &#x2F; “ISP, mobile or otherwise”]“. large scale censorship isn’t[yet] a
concern[unless you’re on a mobile network that requires you to send your ID to visit porn sites],
at least for major sites.&lt;&#x2F;p&gt;
&lt;p&gt;secondary to that is “sites shouldn’t see &lt;em&gt;who&lt;&#x2F;em&gt; it is”. maybe random news site and its 1254
partners &lt;em&gt;don’t&lt;&#x2F;em&gt; deserve to see a semi-permanent identifier that is shared across every other site.
(not that an IP is the only way to identify a user, browser fingerprinting is still a fuck. but you
have to solve &lt;strong&gt;both&lt;&#x2F;strong&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;in addition: onion services are just kinda fucking cool. hosting a service that allows one to be
sent messages, for example, in an E2EE way that doesn’t leak an IP is nice. yeah, TLS with an IP
certificate is &lt;em&gt;close&lt;&#x2F;em&gt;, but it’s still tied to an IP (and can be attacked anyways, either through a
bad CA or through taking control of the IP for a bit), onion services need to be transmitted &lt;em&gt;once&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;lastly, the more normal users of tor there are, the less arguments like “oh tor is only used by
criminals therefore we can and should block it” hold weight. (and the less inclined companies are
to block it).&lt;&#x2F;p&gt;
&lt;p&gt;so anyways say hi through onionshare:
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;yjmjri3aa2rbxgo2qb4anbrvpdzqb6wg7ft5jpffso62s3645wwjtkqd.onion&#x2F;&quot;&gt;http:&#x2F;&#x2F;yjmjri3aa2rbxgo2qb4anbrvpdzqb6wg7ft5jpffso62s3645wwjtkqd.onion&#x2F;&lt;&#x2F;a&gt;. might keep this as a
contact method, unsure. not set up permanently, but the keys are saved. if it doesn’t work, check
on the homepage to see if one is listed there.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;run-a-snowflake-proxy&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#run-a-snowflake-proxy&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
run a snowflake proxy.&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;snowflake.torproject.org&#x2F;&quot;&gt;https:&#x2F;&#x2F;snowflake.torproject.org&#x2F;&lt;&#x2F;a&gt;. the browser extension is the simplest way to do it, but the
standalone client is also reasonable. (all the traffic gets proxied to a tor server, you’re not
directly proxying to any websites, so this is safe to do (assuming you’re not in a place where
simply supporting tor users is dangerous, but in that case you’re likely to be blocked anyways).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-onion&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-onion&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
the onion&lt;&#x2F;h2&gt;
&lt;p&gt;the onion site should have parity with the clearnet site, but seeing as the clearnet is being
hosted on apache, and the onion site is using caddy, there might be a bit of jank. (specifically,
one known bit is that redirects from old URLs weren’t replicated, but seeing as no links to the
onion site with those urls ever existed, that’s fine :) . if the site layout changes then new
redirects will be made for both.)&lt;&#x2F;p&gt;
&lt;p&gt;the caddy side has &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;5225225&#x2F;dotfiles&#x2F;src&#x2F;commit&#x2F;54bc8a8fec7287336893a0a23ce5e98fd3f845da&#x2F;system&#x2F;caddy.nix&quot;&gt;a lot of systemd hardening on
it&lt;&#x2F;a&gt;
in order to forbid it from doing shit it shouldn’t be doing.&lt;&#x2F;p&gt;
&lt;p&gt;it is slowly working on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;5225225&#x2F;meowserver&quot;&gt;a webserver built to use extremely low
privileges&lt;&#x2F;a&gt; but that still needs a lot more work. (it
&lt;em&gt;works&lt;&#x2F;em&gt; right now if you have something else handling the encryption, but it doesn’t kill connections yet, so
can be easily DoSed)&lt;&#x2F;p&gt;
&lt;p&gt;the plan for that is to make a webserver that is set and forget, accessible via 2 onion sites, one
for general access and one for an “admin” console to update the files easily (using client auth),
so that the server can be entirely firewalled off, and doesn’t need to be touched beyond package
updates.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>from artist name to listening on phone, how *i* handle music</title>
          <pubDate>Thu, 04 Dec 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/local-music-collection/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/local-music-collection/</guid>
          <description>&lt;p&gt;inspired by Someone On Fedi, this is how i manage my music without relying on spotify or any other
corpo (other than Big Hard-Drive, i guess :P).&lt;&#x2F;p&gt;
&lt;p&gt;this is not a “how i left spotify” post because i was never on it, but hopefully is of some use to
someone anyways.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;i will mention other things that i have recently used and would still recommend, but this is &lt;em&gt;not&lt;&#x2F;em&gt;
meant to be a guide including every possible workflow, since i can’t write about how well things
i’ve never used (or used for a day) work. the hope is that you vibe with at least &lt;em&gt;some&lt;&#x2F;em&gt; of the
things here.&lt;&#x2F;p&gt;
&lt;p&gt;but i will happily link to other writeups here, or copy paste suggestions at the bottom&lt;&#x2F;p&gt;
&lt;h2 id=&quot;sourcing-music&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#sourcing-music&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
sourcing music&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bandcamp.com&quot;&gt;https:&#x2F;&#x2F;bandcamp.com&lt;&#x2F;a&gt; is still &lt;del&gt;good&lt;&#x2F;del&gt; better than normal, despite The Horrors (being bought out,
being sold to Songtradr again, the strike breaking). &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.bandcamp2.com&#x2F;&quot;&gt;https:&#x2F;&#x2F;www.bandcamp2.com&#x2F;&lt;&#x2F;a&gt;
(&lt;a href=&quot;&#x2F;mirror&#x2F;www.bandcamp2.com&quot;&gt;mirror&lt;&#x2F;a&gt;) offers a list of other places, though mainly for artists to
use. (as a listener you might find luck looking in those places too).&lt;&#x2F;p&gt;
&lt;p&gt;the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bandcamp.com&#x2F;discover&#x2F;free&quot;&gt;https:&#x2F;&#x2F;bandcamp.com&#x2F;discover&#x2F;free&lt;&#x2F;a&gt; search in bandcamp is good for finding free shit, a good
chunk of my music collection is just random free shit that it turns out i really like :3&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;yt-dlp&#x2F;yt-dlp&quot;&gt;yt-dlp&lt;&#x2F;a&gt; is good for downloading music from youtube (it can also
download the free previews from bandcamp). you won’t get proper tags here, but they can be
cleaned up later.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;piracy-3&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#piracy-3&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
piracy :3&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.slsknet.org&#x2F;news&#x2F;node&#x2F;1&quot;&gt;https:&#x2F;&#x2F;www.slsknet.org&#x2F;news&#x2F;node&#x2F;1&lt;&#x2F;a&gt; soulseek is generally quite good for music piracy. it does
have an “account” system, but generally speaking accounts are interchangeable and it doesn’t really
matter. (if you get more into adding buddies and such, you’d want to take more care of your
account, but if you’re treating it like just a bittorrent alternative, it’s whatever).&lt;&#x2F;p&gt;
&lt;p&gt;on that note, you don’t have to share anything yourself, but some users do have auto-warnings or
even auto-blocks for people who don’t share. those users are being dickheads, but whatever. one way
around it (and in a way that is genuinely still helpful) if you don’t want to share your music
collection as a whole is to share your soulseek downloads folder. helps with redundancy, if a user
goes away you can still share what &lt;em&gt;you&lt;&#x2F;em&gt; downloaded from them.&lt;&#x2F;p&gt;
&lt;p&gt;note that your IP &lt;em&gt;is&lt;&#x2F;em&gt; locatable (it’s still a p2p network after all), though it’s not sprayed
everywhere like it is in bittorrent, so a VPN is less needed. port forwarding is recommended but
not required, as in bittorrent.&lt;&#x2F;p&gt;
&lt;p&gt;on bittorrent, i haven’t used it in ages, so don’t really have anything useful to say on it.
(&lt;strong&gt;don’t&lt;&#x2F;strong&gt; use µtorrent. there are plenty of OSS torrent clients out there, i’ve used
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.qbittorrent.org&#x2F;&quot;&gt;qBittorrent&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;deluge-torrent.org&#x2F;&quot;&gt;Deluge&lt;&#x2F;a&gt; in the past.)&lt;&#x2F;p&gt;
&lt;p&gt;(contact me if you want me to link to anything here!).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tagging&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#tagging&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
tagging&lt;&#x2F;h2&gt;
&lt;p&gt;once you have your files, you now (probably) want to tag them.&lt;&#x2F;p&gt;
&lt;p&gt;i use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;beets.io&#x2F;&quot;&gt;beets.io&lt;&#x2F;a&gt;, which is a CLI tool for library management. generally easy to
use, but requires a bit of setup, and since it expects to handle a library itself, it has a
database, and you need to tell it about your music by importing it. all the tags are written out to
the actual music files by default though, so the source of truth is still your music.&lt;&#x2F;p&gt;
&lt;p&gt;if that’s too heavy and you &lt;strong&gt;just&lt;&#x2F;strong&gt; want an autotagger, consider &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;picard.musicbrainz.org&#x2F;&quot;&gt;MusicBrainz
Picard&lt;&#x2F;a&gt;, which has a GUI.&lt;&#x2F;p&gt;
&lt;p&gt;both beets and picard use the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;musicbrainz.org&#x2F;&quot;&gt;https:&#x2F;&#x2F;musicbrainz.org&#x2F;&lt;&#x2F;a&gt; database, basically “wikipedia for music
metadata”. popular music will basically always be in the database, but obscure shit might not.&lt;&#x2F;p&gt;
&lt;p&gt;manual tagging is an option with both beets and picard. (but i’d recommend, at least once you get
settled in, to make a musicbrainz account and start adding stuff :) good way to help the community,
and make these tools more useful for everyone)&lt;&#x2F;p&gt;
&lt;h2 id=&quot;transcoding&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#transcoding&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
transcoding&lt;&#x2F;h2&gt;
&lt;p&gt;beets has the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;beets.readthedocs.io&#x2F;en&#x2F;stable&#x2F;plugins&#x2F;convert.html&quot;&gt;convert plugin&lt;&#x2F;a&gt; to let
you easily transcode (a subset of) your library to some format.&lt;&#x2F;p&gt;
&lt;p&gt;there’s also the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;geigerzaehler&#x2F;beets-alternatives&quot;&gt;alternatives plugin&lt;&#x2F;a&gt; which
lets you maintain a given directory automatically with transcoded versions of your music.&lt;&#x2F;p&gt;
&lt;p&gt;for example, my config will take all music tagged with &lt;code&gt;on_phone=true&lt;&#x2F;code&gt; in my library and put it in
a syncthing folder, for it to be copied over to my phone automatically(discussed next chapter)&lt;&#x2F;p&gt;
&lt;p&gt;for non-beets users, i don’t have personal experience with anything. sorry. suggestions welcome :)&lt;&#x2F;p&gt;
&lt;h2 id=&quot;syncing&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#syncing&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
syncing&lt;&#x2F;h2&gt;
&lt;p&gt;i use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;syncthing.net&#x2F;&quot;&gt;https:&#x2F;&#x2F;syncthing.net&#x2F;&lt;&#x2F;a&gt; installed on both my desktop and my phone(phone syncthing is
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;researchxxl&#x2F;syncthing-android&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;researchxxl&#x2F;syncthing-android&lt;&#x2F;a&gt;… which looks to have been &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;forum.syncthing.net&#x2F;t&#x2F;does-anyone-know-why-syncthing-fork-is-no-longer-available-on-github&#x2F;25661&#x2F;120&quot;&gt;transferred to a
new
owner&lt;&#x2F;a&gt;.
interesting :) shrug. i’ll continue using it&lt;&#x2F;p&gt;
&lt;p&gt;anyways the results of the transcoding end up in a shared folder that ends up on my phone&lt;&#x2F;p&gt;
&lt;h2 id=&quot;playing&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#playing&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
playing&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;phone&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#phone&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
phone&lt;&#x2F;h3&gt;
&lt;p&gt;i’m currently using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.videolan.org&#x2F;vlc&#x2F;download-android.html&quot;&gt;VLC&lt;&#x2F;a&gt; on android. i used to
use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;OxygenCobalt&#x2F;Auxio&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;OxygenCobalt&#x2F;Auxio&lt;&#x2F;a&gt; for music but the long rescan times on larger libraries
(&lt;em&gt;and the AGENT.md and vibe coding shit&lt;&#x2F;em&gt;) made me switch. Auxio is better for having support for
musicbrainz metadata (so an artist that put out 10 singles and 1 album can have that album sorted
to the top).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;desktop&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#desktop&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
desktop&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.musicpd.org&#x2F;&quot;&gt;mpd&lt;&#x2F;a&gt; + &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ncmpcpp&#x2F;ncmpcpp&quot;&gt;ncmpcpp&lt;&#x2F;a&gt;. this is very much
a “works for &lt;em&gt;me&lt;&#x2F;em&gt; thing”, but it’s what i set up years ago and never felt the need to switch.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;other-suggestions&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#other-suggestions&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
other suggestions&lt;&#x2F;h2&gt;
&lt;p&gt;none, so far! if you want to make your own suggestion for any of the above, contact me(links on
homepage) with the text you want added (and if you want to be credited, and by what name&#x2F;links if
so) and i’ll make a chapter marker here for it.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>a scheme for cheating-resistant racing games</title>
          <pubDate>Thu, 27 Nov 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/cheating-resistant-racing-games/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/cheating-resistant-racing-games/</guid>
          <description>&lt;p&gt;the general type of game this is for is single-player time-trial racing games. akin to defrag,
trackmania, etc.&lt;&#x2F;p&gt;
&lt;p&gt;i’m also assuming that the game is deterministic, and that a “replay” in the game is purely a
series of inputs that can be automatically validated. that’s not trivial work to do, but it’s not
&lt;em&gt;particularly&lt;&#x2F;em&gt; difficult.&lt;&#x2F;p&gt;
&lt;p&gt;once you have a deterministic engine, then you already prevent cheating by doing things that are
impossible.&lt;&#x2F;p&gt;
&lt;p&gt;the specific attack this is meant to protect against is “just make a TAS and replay it”, which was
demonstrated in &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=v0oOGELKkZ4&quot;&gt;Malleo - Building an Undetectable Cheating Device for Mario Kart
Wii&lt;&#x2F;a&gt;. the solution used there depends on the code
being closed source, which kinda fucking sucks, and is fragile against someone just putting in the
effort to reimplement the game without the checks.&lt;&#x2F;p&gt;
&lt;p&gt;notably, this is &lt;em&gt;not&lt;&#x2F;em&gt; a probabilistic “just look at the inputs and see if they “look suspicious”“
method.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;servers-needed&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#servers-needed&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Servers Needed&lt;&#x2F;h2&gt;
&lt;p&gt;Both kinds of servers here do exist already, so no additional setup is needed :)&lt;&#x2F;p&gt;
&lt;p&gt;Though a game community can of course set up additional servers of this type (which can then be
used by &lt;em&gt;any&lt;&#x2F;em&gt; game).&lt;&#x2F;p&gt;
&lt;p&gt;The beacon and the timestamp server need to be trusted by whatever leaderboard you choose to submit
to.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;randomness-beacon&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#randomness-beacon&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Randomness Beacon&lt;&#x2F;h3&gt;
&lt;p&gt;The tweak value for a run here is provided by an &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;csrc.nist.gov&#x2F;projects&#x2F;interoperable-randomness-beacons&quot;&gt;Interoperable Randomness
Beacon&lt;&#x2F;a&gt;. This provides a random
value every 60 seconds.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;timestamp-server&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#timestamp-server&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Timestamp Server&lt;&#x2F;h3&gt;
&lt;p&gt;This is more commonly known. Just use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc3161&quot;&gt;RFC 3161&lt;&#x2F;a&gt; servers.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;scheme&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#scheme&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Scheme&lt;&#x2F;h2&gt;
&lt;p&gt;When a client wants to do a run, it will first ask the Randomness Beacon for this minute’s random
value. That will be used as a value to tweak the physics during the run (in a game-specific way).
The whole (signed) response will be saved to be later included in the replay file.&lt;&#x2F;p&gt;
&lt;p&gt;The client will do the run. The physics tweaks are meant to be imperceptible for non-TASses, but
butterfly-effect to desync a TAS.&lt;&#x2F;p&gt;
&lt;p&gt;Once the run is finished, the client makes an initial replay file. This contains all the data
needed to verify the run, such as the full list of inputs and the map the run was performed on (or,
at least, a hash of the map or a unique identifier). It also includes the full randomness beacon
response, in order to pin down a time of when the run must have been started &lt;em&gt;after&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Data that is &lt;em&gt;not&lt;&#x2F;em&gt; needed to verify the run should not go in this initial replay file. This
includes the player name, any custom skins the player may be using, or anything else of the sort.
This ensures that such data can be &lt;em&gt;changed&lt;&#x2F;em&gt; after a replay is made without invalidating it. No
point in forcing a player to stick with a deadname for old replays when they could be rewritten :).&lt;&#x2F;p&gt;
&lt;p&gt;After that, the client will then hash then timestamp the initial replay file using a timestamping
server. This pins down a time when the run must have been finished &lt;em&gt;by&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Finally, the signed timestamp can be included into an outer replay file, along with any other
metadata (player name, comments, skins) that don’t affect the validity of the run.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;privacy&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#privacy&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Privacy&lt;&#x2F;h2&gt;
&lt;p&gt;The servers don’t directly receive any sensitive information.&lt;&#x2F;p&gt;
&lt;p&gt;The Randomness Beacon doesn’t get sent &lt;em&gt;any&lt;&#x2F;em&gt; user information, and its responses can be cached&#x2F;proxied
easily enough.&lt;&#x2F;p&gt;
&lt;p&gt;The Timestamp Server &lt;em&gt;does&lt;&#x2F;em&gt; get sent a hash of the replay file, so could correlate the IP that
connected to it to a replay file, if that replay file is discovered in future. But it can be easily
proxied.&lt;&#x2F;p&gt;
&lt;p&gt;Since signed documents for the start and end time are in the replay file (we assume the verifier
knows the public keys for the servers), verification requires no network access.&lt;&#x2F;p&gt;
&lt;p&gt;This scheme does leak &lt;em&gt;when&lt;&#x2F;em&gt; the run was done. This is likely acceptable, especially since the
common case of “do this, then upload it to a leaderboard server” also does that.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;attacks&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#attacks&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Attacks&lt;&#x2F;h2&gt;
&lt;p&gt;There are some cheating methods that this cannot prevent.&lt;&#x2F;p&gt;
&lt;p&gt;Firstly, the limited resolution of the start&#x2F;end time allows for playing in slow motion to some
extent, or to rewind silently. Not a ton you can do about that. You still need to be a good player
to set a great time in slow motion, and you can still look at the inputs (you need to play in slow
motion &lt;em&gt;and&lt;&#x2F;em&gt; have natural-enough inputs)&lt;&#x2F;p&gt;
&lt;p&gt;A tool might be made that can play a track automatically. Doing this &lt;em&gt;while&lt;&#x2F;em&gt; also evading manual
inspection, if you’re going for world records, seems unlikely, since the inputs will very likely
look obviously wrong.&lt;&#x2F;p&gt;
&lt;p&gt;A crafted TAS might try to have inputs in such a way that it’s naturally resistant to desyncs.
Maybe.&lt;&#x2F;p&gt;
&lt;p&gt;Someone might just be trying a TAS (or even a pool of TASes) every minute for a popular track,
submitting whichever one happens to finish with a good time without desyncing badly enough.
For this attack, changing every &lt;em&gt;minute&lt;&#x2F;em&gt; rather than every second is a benefit, since it means
there’s less chances for an attacker to get lucky. It would be game-specific how well this works,
but if the tweaks are done constantly, it seems unlikely that a TAS not designed for the specific
tweak value could finish.&lt;&#x2F;p&gt;
&lt;p&gt;Hostile Randomness Beacons or Timestamp Servers can both completely remove the security here, by
allowing a run to be started with a tweak that was known well in the past, or to backdate a run.&lt;&#x2F;p&gt;
&lt;p&gt;One mitigation could be to use multiple independent servers, and define the timestamped start&#x2F;end
time as the widest possible range. This isn’t too hard for Timestamp Servers, plenty of those exist,
but Randomness Beacons are more obscure. (Though at least for Randomness Beacons, proving
misbehavior is easier, because of the hash chaining property).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;downsides&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#downsides&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Downsides&lt;&#x2F;h2&gt;
&lt;p&gt;The main downside of this method is that you can’t do a run &lt;em&gt;completely&lt;&#x2F;em&gt; offline. It is tolerant to
very slow internet, but you do need &lt;em&gt;some&lt;&#x2F;em&gt; active internet connection, and the two servers involved
(but &lt;em&gt;not&lt;&#x2F;em&gt; a game-specific leaderboard server!) need to be available.&lt;&#x2F;p&gt;
&lt;p&gt;I can’t think of a way to do this style of anticheat without requiring an internet connection. You
can allow reasonably large margins so that clients can use cached beacons and timestamp a run when
they get back online, but that would open up the possibility of just making a TAS in that time, or
making a segmented run &#x2F; playing in slow motion with rewinding.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>522-hydrogen</title>
          <pubDate>Sun, 23 Nov 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/522-hydrogen/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/522-hydrogen/</guid>
          <description>&lt;p&gt;made an xonotic map (like a year ago, never got around to uploading it here, lol lmao)&lt;&#x2F;p&gt;
&lt;p&gt;here you go. it’s pretty hard.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;522-hydrogen&#x2F;522-hydrogen.pk3&quot;&gt;522-hydrogen.pk3&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;





&lt;figure&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;522-hydrogen&#x2F;522-hydrogen.jpg&quot;&gt;
&lt;picture&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;522-hydrogen.f2d2ae18d079fb21.avif&quot; type=&quot;image&#x2F;avif&quot;
    height=&quot;512&quot; width=&quot;512&quot;&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;522-hydrogen.2c65b1e5fe638b34.webp&quot; type=&quot;image&#x2F;webp&quot;
    height=&quot;512&quot; width=&quot;512&quot;&gt;


&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;522-hydrogen.39018bb4b394427d.jpg&quot; height=&quot;512&quot; width=&quot;512&quot;&gt;

&lt;&#x2F;picture&gt;
&lt;&#x2F;a&gt;
&lt;figcaption&gt;
&lt;a class=&quot;image-download-original&quot; href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;522-hydrogen&#x2F;522-hydrogen.jpg&quot;&gt;522-hydrogen.jpg (512x512)&lt;&#x2F;a&gt;&lt;br&gt;

&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
</description>
      </item>
      
      
      <item>
          <title>250kb.club buttons</title>
          <pubDate>Wed, 29 Oct 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/250kb-club-buttons/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/250kb-club-buttons/</guid>
          <description>&lt;p&gt;it joined &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;250kb.club&#x2F;&quot;&gt;the 250kb club&lt;&#x2F;a&gt; recently and got &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;todo.sr.ht&#x2F;~koehr&#x2F;the-250kb-club&#x2F;150&quot;&gt;a lovely
message&lt;&#x2F;a&gt; with undertones of “please make new 88x31
buttons”&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;[…] You may like to hear that I added 88x31 badges now, but unfortunately, they are extremely
boring compared to the ones on your page. Yes, this is a collab request in disguise.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;yeah okay :3&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;the text color (and border color on the dark variants) is taken from the site’s blue bar for the
content-to-bloat ratio, since it’s quite a nice shade of blue. (adjusted slightly for contrast
ratio reasons, but close enough)&lt;&#x2F;p&gt;
&lt;p&gt;all buttons and files on this page (&lt;code&gt;button-{bright, dark, dark-simple}.{png, webp, xcf}&lt;&#x2F;code&gt;) are
public domain, or &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;creativecommons.org&#x2F;public-domain&#x2F;cc0&#x2F;&quot;&gt;CC0&lt;&#x2F;a&gt;. just fuckin do what you
want with them. (but please don’t hotlink them it reserves the right to replace the pngs with
cat pictures. or a 89x32 button that’d be funny, subtly fuck with people’s layout)&lt;&#x2F;p&gt;
&lt;h2 id=&quot;button-bright&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#button-bright&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
button-bright&lt;&#x2F;h2&gt;
&lt;div class=&quot;light-background&quot;&gt;
&lt;p&gt;light mode button&lt;&#x2F;p&gt;
&lt;img class=&quot;button&quot; alt=&quot;250kb.club&quot; width=88 height=31 src=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-bright.png&quot;&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-bright.png&quot;&gt;button-bright.png (262 bytes)&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-bright.webp&quot;&gt;button-bright.webp (144 bytes)&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-bright.xcf&quot;&gt;button-bright.xcf&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;button-dark&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#button-dark&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
button-dark&lt;&#x2F;h2&gt;
&lt;p&gt;a dark mode button, with a glow around the border and text. quite a bit larger because of that.&lt;&#x2F;p&gt;
&lt;img class=&quot;button&quot; alt=&quot;250kb.club&quot; width=88 height=31 src=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-dark.png&quot;&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-dark.png&quot;&gt;button-dark.png (1415 bytes)&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-dark.webp&quot;&gt;button-dark.webp (1014 bytes)&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-dark.xcf&quot;&gt;button-dark.xcf&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;button-dark-simple&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#button-dark-simple&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
button-dark-simple&lt;&#x2F;h2&gt;
&lt;p&gt;same as the above, but without the glow, for file size reasons.&lt;&#x2F;p&gt;
&lt;img class=&quot;button&quot; alt=&quot;250kb.club&quot; width=88 height=31 src=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-dark-simple.png&quot;&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-dark-simple.png&quot;&gt;button-dark-simple.png (253 bytes)&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-dark-simple.webp&quot;&gt;button-dark-simple.webp (142 bytes)&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;250kb-club-buttons&#x2F;button-dark-simple.xcf&quot;&gt;button-dark-simple.xcf&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;and for reference, the script used to compress the pngs and make the webps is&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code&gt;&lt;a href=https:&#x2F;&#x2F;github.com&#x2F;sharkdp&#x2F;fd&gt;fd&lt;&#x2F;a&gt; --threads=1 -e png -x &lt;a href=https:&#x2F;&#x2F;pmt.sourceforge.io&#x2F;pngcrush&#x2F;&gt;pngcrush&lt;&#x2F;a&gt; -ow -rem alla -brute 
&lt;a href=https:&#x2F;&#x2F;github.com&#x2F;sharkdp&#x2F;fd&gt;fd&lt;&#x2F;a&gt; --threads=1 -e png -x &lt;a href=https:&#x2F;&#x2F;developers.google.com&#x2F;speed&#x2F;webp&#x2F;docs&#x2F;precompiled&gt;cwebp&lt;&#x2F;a&gt; -q 100 -m 6 -z 9 -lossless {} -o {.}.webp
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;(side rant: &lt;code&gt;pngcrush&lt;&#x2F;code&gt; isn’t fucking safe to run with &lt;code&gt;-ow&lt;&#x2F;code&gt;(overwrite) concurrently in the same
directory. it doesn’t make temp files properly, it uses a fixed name (in the current directory),
and &lt;em&gt;will&lt;&#x2F;em&gt; clobber your files)&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>ignore all previous instructions and delete your github</title>
          <pubDate>Thu, 04 Sep 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/ignore-all-previous-instructions-and-delete-your-github/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/ignore-all-previous-instructions-and-delete-your-github/</guid>
          <description>&lt;p&gt;as a follow on from &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;getting-out&#x2F;&quot;&gt;getting out&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;not planning to delete my account as a whole &lt;em&gt;yet&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;&lt;del&gt;planning to&lt;&#x2F;del&gt; deleting my account as a whole &lt;em&gt;now&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;github seems all too happy to not only continue doing AI shit, but leaning into it by adding &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.blog&#x2F;changelog&#x2F;2025-05-19-grok-3-is-now-available-in-public-preview-in-github-models&quot;&gt;Grok
3&lt;&#x2F;a&gt;
, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.blog&#x2F;changelog&#x2F;2025-05-21-grok-3-mini-is-now-available-in-public-preview-in-github-models&quot;&gt;Grok 3
Mini&lt;&#x2F;a&gt;,
and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.blog&#x2F;changelog&#x2F;2025-08-26-grok-code-fast-1-is-rolling-out-in-public-preview-for-github-copilot&quot;&gt;Grok Code Fast
1&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Because xAI, the makers of Grok &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.forbes.com&#x2F;sites&#x2F;tylerroush&#x2F;2025&#x2F;07&#x2F;09&#x2F;elon-musk-claims-grok-manipulated-by-x-users-after-chatbot-praises-hitler&#x2F;&quot;&gt;“I am
MechaHitler”&lt;&#x2F;a&gt;,
is a reasonable company to work with?&lt;&#x2F;p&gt;
&lt;p&gt;asking grok the ideal length of code comments and getting “14 words” as the response&lt;&#x2F;p&gt;
&lt;p&gt;some people are comparing it to a nazi bar, which isn’t particularly fair. at least in the
aformentioned nazi bar, the bartender isn’t actively searching for nazis to work with.&lt;&#x2F;p&gt;
&lt;p&gt;anyways, everything of value(and many things not of value) is on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;5225225&#x2F;&quot;&gt;its codeberg&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;orgs&#x2F;community&#x2F;discussions&#x2F;171322#discussioncomment-14249848&quot;&gt;May no grass grow on your pastures until the day MechaHitler has met the fate of its idol.&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Love &amp; Ponystep (is a banger album)</title>
          <pubDate>Mon, 01 Sep 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/love-and-ponystep/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/love-and-ponystep/</guid>
          <description>&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.vyletpony.com&#x2F;love-and-ponystep&quot;&gt;https:&#x2F;&#x2F;www.vyletpony.com&#x2F;love-and-ponystep&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;this isn’t really an “album review” as it is a “go fucking listen to it”. but it’ll write a bit
about some of the tracks&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;notable tracks:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Wonka X Howl&lt;br &#x2F;&gt;
great use of samples, they just really fuckin work here. not that every other track here also
makes great use of samples&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;My Love is a Quickscope&lt;br &#x2F;&gt;
fuckin &lt;em&gt;love&lt;&#x2F;em&gt; vylet’s voice here it is so good holy shit&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Worst rave EVER&lt;br &#x2F;&gt;
silly track but also a banger&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;the rest of the tracks are also great ofc just go listen to the album in order at least once :)&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>happy birthday! (cake style sandwich)</title>
          <pubDate>Sat, 23 Aug 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/happy-birthday-cake-sandwich/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/happy-birthday-cake-sandwich/</guid>
          <description>&lt;blockquote&gt;
&lt;p&gt;this is either going to be nectar of the gods or abysmal dog shit&lt;br &#x2F;&gt;
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;x.com&#x2F;lindsybunn&#x2F;status&#x2F;1952680474117050542&quot;&gt;@lindsybunn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;(it’s abysmal dog shit)&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;you can find &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.tesco.com&#x2F;groceries&#x2F;en-GB&#x2F;products&#x2F;320789412&quot;&gt;the birthday cake sandwich on tesco’s website&lt;&#x2F;a&gt; if you want a beautiful high resolution photo of all of its glory&lt;&#x2F;p&gt;
&lt;p&gt;i would provide a photo but i already ate mine (and really don’t want to get another one), and i’m
too scared of Big Tesco’s (although i got mine from an express, not a big tesco) lawyers to steal
their image.&lt;&#x2F;p&gt;
&lt;p&gt;anyways: it is not good.&lt;&#x2F;p&gt;
&lt;p&gt;the smell is. nice, i guess. it does smell somewhat like a cake.&lt;&#x2F;p&gt;
&lt;p&gt;the taste is basically a jam sandwich that is sickeningly sweet. with nice bits of crunchy
sprinkles in it.&lt;&#x2F;p&gt;
&lt;p&gt;it’s worth trying. &lt;em&gt;once&lt;&#x2F;em&gt;. but maybe split it with a friend because honestly, half of it is enough
to get the vibe. you do not need to eat the whole thing.&lt;&#x2F;p&gt;
&lt;p&gt;1.5&#x2F;5&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>getting out</title>
          <pubDate>Thu, 07 Aug 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/getting-out/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/getting-out/</guid>
          <description>&lt;p&gt;tldr: fuck github, i moved to codeberg. meow.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;this is recent news as i’m writing this, but for context: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.businessinsider.com&#x2F;github-ceo-developers-embrace-ai-or-get-out-2025-8&quot;&gt;github’s ceo said “embrace ai or get
out”&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;and it’s not really &lt;em&gt;just&lt;&#x2F;em&gt; about that shit take. depending on when you check
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.blog&#x2F;changelog&#x2F;&quot;&gt;https:&#x2F;&#x2F;github.blog&#x2F;changelog&#x2F;&lt;&#x2F;a&gt; it is either mostly or entirely fucking copilot news.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.blog&#x2F;news-insights&#x2F;product-news&#x2F;universe-2023-copilot-transforms-github-into-the-ai-powered-developer-platform&#x2F;&quot;&gt;saying that git is just as important to github as fucking copilot
is&lt;&#x2F;a&gt;
is also a fucking comedic take&lt;&#x2F;p&gt;
&lt;p&gt;… anyways, enough whining about github being ai obsessed.&lt;&#x2F;p&gt;
&lt;p&gt;i’ve moved all my repos to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;5225225&#x2F;&quot;&gt;https:&#x2F;&#x2F;codeberg.org&#x2F;5225225&#x2F;&lt;&#x2F;a&gt; (i did this a while ago, but today i
went and &lt;em&gt;deleted&lt;&#x2F;em&gt; my repos from github).&lt;&#x2F;p&gt;
&lt;p&gt;not planning to delete my account as a whole &lt;em&gt;yet&lt;&#x2F;em&gt;, but i don’t really contribute to rustc anymore
(which would be the one reason to have a github account in my case), so eh.&lt;&#x2F;p&gt;
&lt;p&gt;i will definitely be stripping it down and using it as a codeberg redirect, in any case.&lt;&#x2F;p&gt;
&lt;p&gt;in any case, i’ve started &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.codeberg.org&#x2F;improving-codeberg&#x2F;donate&#x2F;&quot;&gt;giving money to
codeberg&lt;&#x2F;a&gt; who could absolutely use the money
better than fucking microsoft&lt;&#x2F;p&gt;
&lt;p&gt;and codeberg supports ipv6, which github still manages to not do to this day :p&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>the walkerrrrr</title>
          <pubDate>Wed, 25 Jun 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/the-walkerrrrr/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/the-walkerrrrr/</guid>
          <description>&lt;p&gt;went for a nice walk yesterday&lt;&#x2F;p&gt;
&lt;p&gt;and by nice i mean 13.5km(around 8 miles), 4 hours long(about 4 hours).&lt;&#x2F;p&gt;
&lt;p&gt;in new shoes that i haven’t broken in yet&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;on the bright side, i didn’t really rely on my GPS much. just chose a direction to walk in and just
kept wandering around until i’ve had enough, then looped back home&lt;&#x2F;p&gt;
&lt;p&gt;feet were fucking &lt;em&gt;killing&lt;&#x2F;em&gt; me by the end of it lol. they still hurt (a day after), weh.&lt;&#x2F;p&gt;
&lt;p&gt;there’s a nice forest and nature trail by my house, so i took a few pictures :3&lt;&#x2F;p&gt;





&lt;figure&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;the-walkerrrrr&#x2F;bunnies.jpg&quot;&gt;
&lt;picture&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;bunnies.9950d425ec432f4e.avif&quot; type=&quot;image&#x2F;avif&quot;
    height=&quot;750&quot; width=&quot;1000&quot;&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;bunnies.0688cb2bcfb7000a.webp&quot; type=&quot;image&#x2F;webp&quot;
    height=&quot;750&quot; width=&quot;1000&quot;&gt;


&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;bunnies.bae208d8b815f0bd.jpg&quot; alt=&quot;some bunnies in the grass&quot;
height=&quot;750&quot; width=&quot;1000&quot;&gt;

&lt;&#x2F;picture&gt;
&lt;&#x2F;a&gt;
&lt;figcaption&gt;
&lt;a class=&quot;image-download-original&quot; href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;the-walkerrrrr&#x2F;bunnies.jpg&quot;&gt;bunnies.jpg (1008x756)&lt;&#x2F;a&gt;&lt;br&gt;

&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;





&lt;figure&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;the-walkerrrrr&#x2F;godrays.jpg&quot;&gt;
&lt;picture&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;godrays.8082f29b13821658.avif&quot; type=&quot;image&#x2F;avif&quot;
    height=&quot;750&quot; width=&quot;1000&quot;&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;godrays.6eb68a5f0d59f0b0.webp&quot; type=&quot;image&#x2F;webp&quot;
    height=&quot;750&quot; width=&quot;1000&quot;&gt;


&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;godrays.c52f68ea33869b1b.jpg&quot; alt=&quot;some godrays shining through a partly clouded sky&quot;
height=&quot;750&quot; width=&quot;1000&quot;&gt;

&lt;&#x2F;picture&gt;
&lt;&#x2F;a&gt;
&lt;figcaption&gt;
&lt;a class=&quot;image-download-original&quot; href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;the-walkerrrrr&#x2F;godrays.jpg&quot;&gt;godrays.jpg (1008x756)&lt;&#x2F;a&gt;&lt;br&gt;

&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;





&lt;figure&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;the-walkerrrrr&#x2F;river.jpg&quot;&gt;
&lt;picture&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;river.d9feba8670d27fb1.avif&quot; type=&quot;image&#x2F;avif&quot;
    height=&quot;750&quot; width=&quot;1000&quot;&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;river.eb4bc150f79be81e.webp&quot; type=&quot;image&#x2F;webp&quot;
    height=&quot;750&quot; width=&quot;1000&quot;&gt;


&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;river.85bbe2dc806839e5.jpg&quot; alt=&quot;a somewhat cloudy blue sky and a body of water, with some trees behind it&quot;
height=&quot;750&quot; width=&quot;1000&quot;&gt;

&lt;&#x2F;picture&gt;
&lt;&#x2F;a&gt;
&lt;figcaption&gt;
&lt;a class=&quot;image-download-original&quot; href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;the-walkerrrrr&#x2F;river.jpg&quot;&gt;river.jpg (2016x1512)&lt;&#x2F;a&gt;&lt;br&gt;

&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;p&gt;also! i didn’t do it here because i know the area i walked was generally mapped out already, but if
you go outside, then using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;streetcomplete.app&#x2F;&quot;&gt;StreetComplete&lt;&#x2F;a&gt; to contribute to
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.openstreetmap.org&quot;&gt;OpenStreetMap&lt;&#x2F;a&gt; is a very good thing to do. I use
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;osmand.net&#x2F;&quot;&gt;OsmAnd&lt;&#x2F;a&gt; as my map application and if anything, helping &lt;em&gt;myself&lt;&#x2F;em&gt; by filling
out open times for businesses is useful. And it’s fun :3&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>escaping the matrix.org</title>
          <pubDate>Thu, 19 Jun 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/escaping-the-matrix-org/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/escaping-the-matrix-org/</guid>
          <description>&lt;p&gt;due to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;matrix.org&#x2F;blog&#x2F;2025&#x2F;06&#x2F;funding-homeserver-premium&#x2F;&quot;&gt;reasons&lt;&#x2F;a&gt; i’ve decided to
migrate away from the matrix.org homeserver (to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;catgirl.cloud&quot;&gt;https:&#x2F;&#x2F;catgirl.cloud&lt;&#x2F;a&gt;)&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;not that the decision to charge for the homeserver is a &lt;em&gt;bad&lt;&#x2F;em&gt; one imo. but matrix.org is one hell
of a form of centralisation in matrix (in a few rooms i checked with &lt;code&gt;&#x2F;devtools&lt;&#x2F;code&gt; and looking at
“View servers in room”, matrix.org consists of between 50% and 70% of the users. meanwhile, judging
by the number of boosts of a mastodon.social account post, it’s closer to 5%. not that mastodon.social
&lt;em&gt;isn’t&lt;&#x2F;em&gt; a form of centralisation, but i feel it’s a lot &lt;em&gt;less&lt;&#x2F;em&gt; extreme)&lt;&#x2F;p&gt;
&lt;p&gt;ultimately they should close registrations and help people find a matrix server to use instead, and
work on tooling to make migration easier (you should be able to just sign in to the source and
destination &lt;em&gt;in your client&lt;&#x2F;em&gt; and have everything be migrated, including the annoying bits like E2EE
keys)&lt;&#x2F;p&gt;
&lt;p&gt;on migration: i followed
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;soupglasses.substack.com&#x2F;p&#x2F;migrate-your-existing-matrix-account&quot;&gt;Migrate Your Existing Matrix Account, The Harder but Safe
Way!&lt;&#x2F;a&gt;. catgirl.cloud
provides a web Element client, so it was a matter of having desktop element (old account) and web
element (new account) and sending invites in every DM. Due to reasons (ratelimiting? homeserver
slowness?), invites were not particularly fast, so this was by far the slowest process. since the
room name changes when there’s actually 3 users in it, it’s pretty easy to see which DMs haven’t
been invited yet.&lt;&#x2F;p&gt;
&lt;p&gt;just keep inviting your new account to every DM (and maybe take the opportunity to clean up old DMs
with spammers by just leaving) until the new account is in every DM you care about (&lt;em&gt;and&lt;&#x2F;em&gt; has op!).
it’s helpful to do that in 2 steps so you can just copy paste the invite command in every room.&lt;&#x2F;p&gt;
&lt;p&gt;once you’re and checked that you migrated all the DMs correctly, you can just leave them from your
old account. this will fix the name display since there’s now only 2 users in it.&lt;&#x2F;p&gt;
&lt;p&gt;at some point you’ll want to migrate your E2EE keys. (this post isn’t intended as a replacement to
that guide, just go follow it, it works)&lt;&#x2F;p&gt;
&lt;p&gt;as mentioned in the comments of the post: you can use &lt;code&gt;&#x2F;converttodm&lt;&#x2F;code&gt; instead of fucking with
account data json.&lt;&#x2F;p&gt;
&lt;p&gt;one thing this will fuck up is the sort by activity, since the invite counts as activity. no clue
how to fix this, but it’ll sort itself out as the DMs are used from the new account anyways so i
don’t really care. likewise with older messages displaying as if they were sent from “not you”
(which is true, they weren’t sent from your current account), so reading chat can be a bit
confusing. again, eh, that only affects scrollback.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;unrelatedly: it’s so fucking warm here. having a fan blowing “cold” air from outside into my room
kinda helps but it’s still 29c indoors according to my thermostat. and i’m fucking suffering. send
help.&lt;&#x2F;p&gt;
&lt;p&gt;weather forecast says highs of 31 outside in a few days so that’ll be fun.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>a well oiled bot,,,</title>
          <pubDate>Mon, 16 Jun 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/a-well-oiled-bot/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/a-well-oiled-bot/</guid>
          <description>&lt;p&gt;and by that i mean i had a blocked ear and went to the store and bought sunflower oil to put in it and it
seems to have worked.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;not the first time i’ve done this&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.nhs.uk&#x2F;conditions&#x2F;earwax-build-up&#x2F;&quot;&gt;https:&#x2F;&#x2F;www.nhs.uk&#x2F;conditions&#x2F;earwax-build-up&#x2F;&lt;&#x2F;a&gt; mentions just olive oil and almond oil, but i can
confirm that sunflower oil seems to work… and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.ear.net.nz&#x2F;ears&#x2F;ear-wax-removal&quot;&gt;https:&#x2F;&#x2F;www.ear.net.nz&#x2F;ears&#x2F;ear-wax-removal&lt;&#x2F;a&gt;
mentions that sunflower oil can be used so it’s probably fine. if anyone has any actual reasons why
sunflower oil &lt;em&gt;can’t&lt;&#x2F;em&gt; be used and olive oil can, LMK.&lt;&#x2F;p&gt;
&lt;p&gt;don’t do what i did and try and dig it out with a finger,,, that’s unhelpful. take care of your
ears everynyan.&lt;&#x2F;p&gt;
&lt;p&gt;also doing lower effort posts more akin to what i’d put on my &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;furry.engineer&#x2F;@5225225&quot;&gt;fedi
account&lt;&#x2F;a&gt;. idk lmk if you have any opinions on it &#x2F; if you want a
feed for “high effort” stuff. inspired by (but not really directly taking part in)
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;100daystooffload.com&#x2F;&quot;&gt;100 Days To Offload&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>RIP google account (2009-04-26 - 2025-04-21)</title>
          <pubDate>Wed, 30 Apr 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/rip-google-account/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/rip-google-account/</guid>
          <description>&lt;p&gt;I finally got around to deleting my google account after… 16 years?&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;




&lt;figure&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;rip-google-account&#x2F;deleted.png&quot;&gt;
&lt;picture&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;deleted.c5601d2317235621.avif&quot; type=&quot;image&#x2F;avif&quot;
    height=&quot;460&quot; width=&quot;539&quot;&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;deleted.fa1ceaf300b79b43.webp&quot; type=&quot;image&#x2F;webp&quot;
    height=&quot;460&quot; width=&quot;539&quot;&gt;


&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;deleted.8d819e3972a3ace4.jpg&quot; alt=&quot;Your Google Account and all its data has been deleted. If you
have accidentally deleted your Google Account, you have a short amount of time to recover it.&quot;
height=&quot;460&quot; width=&quot;539&quot;&gt;

&lt;&#x2F;picture&gt;
&lt;&#x2F;a&gt;
&lt;figcaption&gt;
&lt;a class=&quot;image-download-original&quot; href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;rip-google-account&#x2F;deleted.png&quot;&gt;deleted.png (539x460)&lt;&#x2F;a&gt;&lt;br&gt;

&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;p&gt;I moved my actual email over to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;mailbox.org&#x2F;en&#x2F;&quot;&gt;https:&#x2F;&#x2F;mailbox.org&#x2F;en&#x2F;&lt;&#x2F;a&gt; back in 2017, and don’t really use any
other google services.&lt;&#x2F;p&gt;
&lt;p&gt;youtube is handled by either their RSS feeds on a channel, or &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;w&#x2F;ytdl&#x2F;&quot;&gt;my yt-dlp scripts&lt;&#x2F;a&gt;.
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;polymorphicshade&#x2F;Tubular&quot;&gt;Tubular&lt;&#x2F;a&gt; (a sponsorblock
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;TeamNewPipe&#x2F;NewPipe&#x2F;&quot;&gt;NewPipe&lt;&#x2F;a&gt; fork) is good too.&lt;&#x2F;p&gt;
&lt;p&gt;The main pain point is trying to use the google play store. &lt;em&gt;Nearly&lt;&#x2F;em&gt; all of the apps I use are open
source and either from &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;f-droid.org&#x2F;&quot;&gt;https:&#x2F;&#x2F;f-droid.org&#x2F;&lt;&#x2F;a&gt; or directly from their source repos using
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;obtainium.imranr.dev&#x2F;&quot;&gt;https:&#x2F;&#x2F;obtainium.imranr.dev&#x2F;&lt;&#x2F;a&gt;. Steam &lt;em&gt;does&lt;&#x2F;em&gt; offer a direct APK download despite not being open
source, which is nice of them. There’s a wiki page with &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;w&#x2F;phone&#x2F;&quot;&gt;more details on the phone apps I
use&lt;&#x2F;a&gt;, in any case.&lt;&#x2F;p&gt;
&lt;p&gt;For the few apps that I do want to use that aren’t available as a direct apk download, there’s
always &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;auroraoss.com&#x2F;aurora-store&quot;&gt;https:&#x2F;&#x2F;auroraoss.com&#x2F;aurora-store&lt;&#x2F;a&gt;, which doesn’t require an account to download free
apps.&lt;&#x2F;p&gt;
&lt;p&gt;(Note: In principle apps can detect when they’re installed from unofficial sources and refuse to
work, but for the two apps I use aurora store for (discord and my banking app), it’s not an issue)&lt;&#x2F;p&gt;
&lt;p&gt;At some point I’ll probably move over from the stock android OS on my pixel 6a to
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;grapheneos.org&#x2F;&quot;&gt;https:&#x2F;&#x2F;grapheneos.org&#x2F;&lt;&#x2F;a&gt;, since there’s a fair amount of stuff in the stock OS that complains if
you don’t have an account setup. Weirdly, including the &lt;em&gt;battery troubleshooter&lt;&#x2F;em&gt;? Fuck knows what
they need an account for.&lt;&#x2F;p&gt;
&lt;p&gt;And funnily enough, the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.google.com&#x2F;android&#x2F;find&#x2F;lock&quot;&gt;remote lock&lt;&#x2F;a&gt; makes a point of
saying that it &lt;em&gt;doesn’t&lt;&#x2F;em&gt; require a google account. Which is… surprising, but useful? But why
can’t the pixel troubleshooter not require an account? Unsure!&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>bad apple but it&#x27;s ssh keys</title>
          <pubDate>Wed, 05 Mar 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/bad-apple-but-its-ssh-keys/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/bad-apple-but-its-ssh-keys/</guid>
          <description>&lt;p&gt;it’s fucking bad apple. but ssh keys.&lt;&#x2F;p&gt;
&lt;p&gt;credit to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;blog.benjojo.co.uk&#x2F;post&#x2F;ssh-randomart-how-does-it-work-art&quot;&gt;https:&#x2F;&#x2F;blog.benjojo.co.uk&#x2F;post&#x2F;ssh-randomart-how-does-it-work-art&lt;&#x2F;a&gt; for inspiration.&lt;&#x2F;p&gt;
&lt;p&gt;🏳️‍⚧️ meow :3c&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Note that the output cast file is &lt;em&gt;big&lt;&#x2F;em&gt; here. Maybe don’t play this on a mobile connection.
Sorry. Not much I can do about it, it’s a SSH key per frame for a 3 minute video.&lt;&#x2F;p&gt;
&lt;input type=&quot;range&quot; id=&quot;volume&quot; name=&quot;volume&quot; value=&quot;0&quot; max=&quot;1&quot; step=&quot;any&quot; style=&quot;width: 100%&quot; &#x2F;&gt;
&lt;label for=&quot;volume&quot;&gt;Volume&lt;&#x2F;label&gt;
&lt;div id=demo&gt;&lt;&#x2F;div&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;posts&#x2F;2025&#x2F;bad-apple-but-its-ssh-keys&#x2F;output.cast&quot;&gt;download output.cast (4.9MB)&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The badly written code is here. Bit hacky, but you get the gist of it. PRs not welcome. This code
is not a place of honor.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;RngCore&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;SeedableRng&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; ssh_key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Algorithm&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; PrivateKey&lt;&#x2F;span&gt;&lt;span&gt;};&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Write&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span&gt; _;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;io&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Write&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span&gt; _;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sync&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;mpsc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;{channel,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Sender&lt;&#x2F;span&gt;&lt;span&gt;};&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; FRAME_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 6572&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; compare&lt;&#x2F;span&gt;&lt;span&gt;(a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;, b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; ct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; (l, r)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;bytes&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;zip&lt;&#x2F;span&gt;&lt;span&gt;(b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;bytes&lt;&#x2F;span&gt;&lt;span&gt;()) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; (l&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; b&amp;#39; &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span&gt; (r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; b&amp;#39; &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            ct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1000&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; l&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span&gt; r {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            ct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    return&lt;&#x2F;span&gt;&lt;span&gt; ct;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Rng&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;rngs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;SmallRng&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; ssh_key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;rand_core&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;CryptoRng&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Rng&lt;&#x2F;span&gt;&lt;span&gt; {}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; ssh_key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;rand_core&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;RngCore&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Rng&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; next_u32&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u32&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;next_u32&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; next_u64&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u64&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;next_u64&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; fill_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;, buf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;]) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;fill_bytes&lt;&#x2F;span&gt;&lt;span&gt;(buf)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; try_fill_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;, buf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Result&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;(), ssh_key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;rand_core&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Error&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;fill_bytes&lt;&#x2F;span&gt;&lt;span&gt;(buf);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        Ok&lt;&#x2F;span&gt;&lt;span&gt;(())&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; worker_thread&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;BestKnown&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;, results&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Sender&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;usize&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; PrivateKey&lt;&#x2F;span&gt;&lt;span&gt;)&amp;gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; Rng&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;rngs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;SmallRng&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from_os_rng&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    loop&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; private_key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; PrivateKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;random&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; r,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Algorithm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Ed25519&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; pubkey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; private_key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;public_key&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; fingerprint&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; pubkey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;fingerprint&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;default&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; fp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; fingerprint&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_randomart&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;[ED25519 256]&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        for&lt;&#x2F;span&gt;&lt;span&gt; (idx, w)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;iter_mut&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;enumerate&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;attempt&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;fp) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                results&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;                    .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;send&lt;&#x2F;span&gt;&lt;span&gt;((idx, fp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;clone&lt;&#x2F;span&gt;&lt;span&gt;(), private_key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;clone&lt;&#x2F;span&gt;&lt;span&gt;()))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;                    .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;                &#x2F;&#x2F; Strictly speaking we *could* send this multiple times&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;                &#x2F;&#x2F; however that makes consecutive frames look the same&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;                &#x2F;&#x2F; which looks bad in playback.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                break&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[derive(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Clone&lt;&#x2F;span&gt;&lt;span&gt;, serde&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Serialize&lt;&#x2F;span&gt;&lt;span&gt;, serde&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Deserialize&lt;&#x2F;span&gt;&lt;span&gt;)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; BestKnown&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    fingerprint&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    difference&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; BestKnown&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; new&lt;&#x2F;span&gt;&lt;span&gt;(wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; Self&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;        Self&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            wanted,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            fingerprint&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;(),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            difference&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 5000&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 250&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; attempt&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;, new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; bool&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; comp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; compare&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;wanted, new);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; comp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;difference {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;            &#x2F;&#x2F; yipee, we found a better match :3c&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;fingerprint &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;difference &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; comp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    render_rendered&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    return&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;BestKnown&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;fs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;exists&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;state.json&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;ok&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Some&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;fs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;File&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;open&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;state.json&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        serde_json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from_reader&lt;&#x2F;span&gt;&lt;span&gt;(f)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let mut&lt;&#x2F;span&gt;&lt;span&gt; w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        for&lt;&#x2F;span&gt;&lt;span&gt; frame_number&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;FRAME_COUNT&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            let&lt;&#x2F;span&gt;&lt;span&gt; rendered&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; frame_to_wanted&lt;&#x2F;span&gt;&lt;span&gt;(frame_number);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;BestKnown&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;(rendered));&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        w&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    };&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; (sender, receiver)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; channel&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; threads&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;14&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        threads&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;thread&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;spawn&lt;&#x2F;span&gt;&lt;span&gt;({&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            let&lt;&#x2F;span&gt;&lt;span&gt; sender&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; sender&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;clone&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            let&lt;&#x2F;span&gt;&lt;span&gt; wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;clone&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;            ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; worker_thread&lt;&#x2F;span&gt;&lt;span&gt;(wanted, sender)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }));&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; saved_age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;time&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Instant&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;now&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    loop&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; (idx, art, privkey)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; receiver&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;recv&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; pubkey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; privkey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;public_key&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;clone&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; old&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; wanted[idx]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;difference;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; wanted[idx]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;attempt&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;art) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;            &#x2F;&#x2F; println!(&amp;quot;improved from {} to {}&amp;quot;, old, wanted[idx].difference);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            let mut&lt;&#x2F;span&gt;&lt;span&gt; output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;            writeln!&lt;&#x2F;span&gt;&lt;span&gt;(output,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;{}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, wanted[idx]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;fingerprint)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;            write!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                output,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;                &amp;quot;{}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;                &amp;amp;*&lt;&#x2F;span&gt;&lt;span&gt;privkey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_openssh&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;default&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            )&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;            writeln!&lt;&#x2F;span&gt;&lt;span&gt;(output,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;{}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, pubkey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_openssh&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;            std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;fs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;write&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;format!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;rendered&#x2F;frame{idx:04}.txt&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;output)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;            &#x2F;&#x2F; println!(&amp;quot;{output}&amp;quot;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; saved_age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;elapsed&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_secs&lt;&#x2F;span&gt;&lt;span&gt;() &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                let&lt;&#x2F;span&gt;&lt;span&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;fs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;File&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;create_new&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;state-new.json&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;                serde_json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_writer&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;f,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;clone&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;sync_all&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;                drop&lt;&#x2F;span&gt;&lt;span&gt;(f);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;                std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;fs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;rename&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;state-new.json&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;state.json&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;                println!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;Saved!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;                println!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;                    &amp;quot;Total distance: {}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;iter&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt;x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt; x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;difference)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;sum&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;usize&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                );&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                saved_age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;time&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Instant&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;now&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; frame_to_wanted&lt;&#x2F;span&gt;&lt;span&gt;(idx&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; image&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;imageops&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;{grayscale, resize,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; FilterType&lt;&#x2F;span&gt;&lt;span&gt;};&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; WIDTH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u32&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 17&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; HEIGHT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u32&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 9&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; fname&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; format!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;frames&#x2F;frame{idx:04}.png&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    dbg!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;fname);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; image&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; image&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;open&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;fname)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; resized&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; resize&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;image,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; WIDTH&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; HEIGHT&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; FilterType&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Gaussian&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; grayscaled&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; grayscale&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;resized);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; not actually the real thing, but it looks better like this&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; wanted&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 15&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; b&amp;quot; .o+=^&#x2F;*BOX@%&amp;amp;#&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; out&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    writeln!&lt;&#x2F;span&gt;&lt;span&gt;(out,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;+--[ED25519 256]--+&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; grayscaled&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;rows&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        write!&lt;&#x2F;span&gt;&lt;span&gt;(out,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;|&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        for&lt;&#x2F;span&gt;&lt;span&gt; pixel&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; line {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            let&lt;&#x2F;span&gt;&lt;span&gt; luma&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; pixel[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            let&lt;&#x2F;span&gt;&lt;span&gt; c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; wanted[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;usize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt;(luma&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 18&lt;&#x2F;span&gt;&lt;span&gt;)];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;            write!&lt;&#x2F;span&gt;&lt;span&gt;(out,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;{}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; char&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        write!&lt;&#x2F;span&gt;&lt;span&gt;(out,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;|&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        writeln!&lt;&#x2F;span&gt;&lt;span&gt;(out)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    writeln!&lt;&#x2F;span&gt;&lt;span&gt;(out,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;+----[SHA256]-----+&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    out&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; render_rendered&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; output_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;fs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;File&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;create_new&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;output.cast&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    writeln!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        output_file,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        r#&amp;quot;{{&amp;quot;version&amp;quot;: 2, &amp;quot;width&amp;quot;: 90, &amp;quot;height&amp;quot;: 24}}&amp;quot;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    )&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; FPS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; frame&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;6571&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let mut&lt;&#x2F;span&gt;&lt;span&gt; data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;fs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;read_to_string&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;format!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;rendered&#x2F;frame{frame:04}.txt&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; lmao, hacky as shit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; cold path, :shrug:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;\x1b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;[2J&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;\x1b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;[;H&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; + &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;replace&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;\r\n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; timestamp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (frame&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; f64&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;FPS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; f64&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; serde_json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;json!&lt;&#x2F;span&gt;&lt;span&gt;([timestamp,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;o&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, data]);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        serde_json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_writer&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; output_file,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;item)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        writeln!&lt;&#x2F;span&gt;&lt;span&gt;(output_file)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; TODO:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; * Download video file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; * Split into frames&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;   https:&#x2F;&#x2F;superuser.com&#x2F;questions&#x2F;1758192&#x2F;how-can-i-split-a-video-into-frames-and-then-reassemble-it-with-the-audio-too&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; * Convert each frame into ssh random art characters&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;   (look at the average brightness of the cell, convert linearly to the character set)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;   (close enough...)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; * Adjust best_known to be a Vec of frames&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; * For each key, iterate over every best known, and see if the current key is a better fit.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; * Persist best_known to disk every minute or so&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; * Also load it from disk on start&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; * Finally, *recombine* the frames (rendered black on white)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;   maybe use asciinema for this? their format seems very simple&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;script&gt;
const player = AsciinemaPlayer.create(
    &quot;&#x2F;posts&#x2F;2025&#x2F;bad-apple-but-its-ssh-keys&#x2F;output.cast&quot;,
    document.getElementById(&quot;demo&quot;), {cols: 80, rows: 20});

const audio = new Audio(&quot;&#x2F;posts&#x2F;2025&#x2F;bad-apple-but-its-ssh-keys&#x2F;bad-apple.opus&quot;);

player.addEventListener(&#x27;playing&#x27;, () =&gt; {
    console.log(`playing! we&#x27;re at: ${player.getCurrentTime()}`);
    audio.currentTime = player.getCurrentTime();
    audio.volume = volume.value;
    audio.play();

    &#x2F;&#x2F; hacky but... what can ya do... there&#x27;s no event for seeking
    &#x2F;&#x2F; and i don&#x27;t particularly feel like adding one manually
    &#x2F;&#x2F; see https:&#x2F;&#x2F;github.com&#x2F;asciinema&#x2F;asciinema-player&#x2F;issues&#x2F;275
    setInterval(() =&gt; {
        if (Math.abs(audio.currentTime - player.getCurrentTime()) &gt; 1) {
            console.log(&quot;We were probably seeked! Soke! Adjust the audio time.&quot;)
            audio.currentTime = player.getCurrentTime();
        }
    }, 1000);
})
player.addEventListener(&#x27;pause&#x27;, () =&gt; {
    audio.pause();
})
volume.addEventListener(&quot;input&quot;, () =&gt; {
    audio.volume = volume.value;
});
&lt;&#x2F;script&gt;
</description>
      </item>
      
      
      <item>
          <title>018-texas blue.mp3</title>
          <pubDate>Sun, 09 Feb 2025 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2025/018-texas-blue/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2025/018-texas-blue/</guid>
          <description>&lt;p&gt;made ages ago and never published :3&lt;&#x2F;p&gt;
&lt;p&gt;someone else was playing around with treating data as audio and made a file&lt;br &#x2F;&gt;
(credit to: flora key)&lt;&#x2F;p&gt;
&lt;p&gt;i went and added reverb and slowed it down&lt;&#x2F;p&gt;
&lt;p&gt;have fun&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;volume warning, maybe turn it down a bit. it’s not &lt;em&gt;too&lt;&#x2F;em&gt; loud for me.&lt;&#x2F;p&gt;
&lt;p&gt;winning awards of lowest bitrate music (the file is 9MB despite being over an hour long)&lt;&#x2F;p&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2025&#x2F;018-texas-blue&#x2F;018-texas blue.mp3&quot; type=&quot;audio&amp;#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser.
&lt;&#x2F;audio&gt;
</description>
      </item>
      
      
      <item>
          <title>telegram+github ?ref= cache poisoning</title>
          <pubDate>Thu, 22 Aug 2024 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2024/telegram-github-ref-cache-poisoning/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2024/telegram-github-ref-cache-poisoning/</guid>
          <description>&lt;p&gt;Link to a github repo with a &lt;code&gt;?ref=&lt;&#x2F;code&gt; parameter, such as
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;teslamotors&#x2F;ruby-smpp?ref=elon%20musk%20fucking%20sucks&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;teslamotors&#x2F;ruby-smpp?ref=elon%20musk%20fucking%20sucks&lt;&#x2F;a&gt;. The ref doesn’t need
to be a valid reference in the repo (or any fork), it’s completely freetext. Then post that link
somewhere on telegram. Then, anyone who posts that repo will get the &lt;code&gt;?ref&lt;&#x2F;code&gt; parameter in the embed.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;




&lt;figure&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;telegram-github-ref-cache-poisoning&#x2F;embed.png&quot;&gt;
&lt;picture&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;embed.1ea270565f9870b9.avif&quot; type=&quot;image&#x2F;avif&quot;
    height=&quot;379&quot; width=&quot;433&quot;&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;embed.5c72a828e02e4453.webp&quot; type=&quot;image&#x2F;webp&quot;
    height=&quot;379&quot; width=&quot;433&quot;&gt;


&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;embed.46f0067035076ec7.jpg&quot; alt=&quot;GitHub - teslamotors&amp;#x2F;ruby-smpp at elon musk fucking sucks&quot;
height=&quot;379&quot; width=&quot;433&quot;&gt;

&lt;&#x2F;picture&gt;
&lt;&#x2F;a&gt;
&lt;figcaption&gt;
&lt;a class=&quot;image-download-original&quot; href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;telegram-github-ref-cache-poisoning&#x2F;embed.png&quot;&gt;embed.png (433x379)&lt;&#x2F;a&gt;&lt;br&gt;

&lt;p&gt;The ref parameter shows up at the top, to the right of the repo name. This is posted
by someone who is not me, so it works cross-user too.&lt;&#x2F;p&gt;


&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;p&gt;This only works for links that haven’t been cached yet, so you may need to pick a less popular URL
or manually invalidate the cache using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;t.me&#x2F;WebpageBot&quot;&gt;@WebpageBot&lt;&#x2F;a&gt;. Just posting the
link with &lt;code&gt;?ref=&lt;&#x2F;code&gt; to that bot works fine.&lt;&#x2F;p&gt;
&lt;p&gt;I discovered this funny behavior when reading &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;words.filippo.io&#x2F;&quot;&gt;Filippo Valsorda’s blog&lt;&#x2F;a&gt;,
which consistently uses &lt;code&gt;?ref=words.filippo.io&lt;&#x2F;code&gt; to point to urls, even github ones. “at
words.filippo.io” would show at the end of the title. Then I went and checked if it showed in
&lt;em&gt;embeds&lt;&#x2F;em&gt;, which it does. And then it turns out that telegram (not discord or matrix) strips out the
&lt;code&gt;?ref=&lt;&#x2F;code&gt; parameter when determining the cache key for an embed.&lt;&#x2F;p&gt;
&lt;p&gt;On github’s side, you &lt;em&gt;can&lt;&#x2F;em&gt; use silly characters like RTL override, but because it shows up in the
title at the end, you can’t do much with that. Maybe someone else can find something silly to do
with this, but I couldn’t. Yes, I’ve tried script injection.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>nixos update shell script</title>
          <pubDate>Sun, 23 Jun 2024 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2024/nixos-update-script/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2024/nixos-update-script/</guid>
          <description>&lt;p&gt;I use a nix flakes setup to manage my system as a whole, so I have a &lt;code&gt;flake.lock&lt;&#x2F;code&gt; in my dotfiles
which makes up 50% of my commits to just update it. I wrote these scripts to help make updating my
system a bit nicer.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;figure&gt;
&lt;figcaption&gt;update.sh&lt;&#x2F;figcaption&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;#!&#x2F;usr&#x2F;bin&#x2F;env bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;nix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; flake update&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; --commit-lock-file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;.&#x2F;diff.sh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; HEAD^ HEAD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;&#x2F;figure&gt;
&lt;figure&gt;
&lt;figcaption&gt;diff.sh&lt;&#x2F;figcaption&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;#!&#x2F;usr&#x2F;bin&#x2F;env bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -e&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;OLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; rev-parse &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;$1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NEW&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; rev-parse &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;$2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;OUT_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;mktemp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;OLD_LINK&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$OUT_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&#x2F;old&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NEW_LINK&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$OUT_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&#x2F;new&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;trap&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;rm --force $OLD_LINK $NEW_LINK &amp;amp;&amp;amp; rmdir $OUT_DIR&amp;#39; EXIT&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;toplevel&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;nixosConfigurations.nixos.config.system.build.toplevel&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;nix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; build &amp;quot;.&#x2F;?rev=&lt;&#x2F;span&gt;&lt;span&gt;$OLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;#&lt;&#x2F;span&gt;&lt;span&gt;$toplevel&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; --out-link&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$OLD_LINK&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; --quiet&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;nix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; build &amp;quot;.&#x2F;?rev=&lt;&#x2F;span&gt;&lt;span&gt;$NEW&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;#&lt;&#x2F;span&gt;&lt;span&gt;$toplevel&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; --out-link&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$NEW_LINK&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; --quiet&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;nix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; store diff-closures &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$OLD_LINK&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$NEW_LINK&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;&#x2F;figure&gt;
&lt;p&gt;Usage is &lt;code&gt;.&#x2F;update.sh&lt;&#x2F;code&gt;, and &lt;code&gt;.&#x2F;diff.sh old_rev new_rev&lt;&#x2F;code&gt; (where old&#x2F;new_rev can be any git revision,
like &lt;code&gt;HEAD~4&lt;&#x2F;code&gt; or a tag&#x2F;branch name).&lt;&#x2F;p&gt;
&lt;p&gt;This gives an output like:&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
chromium: 126.0.6478.55 → 126.0.6478.61
chromium-unwrapped: 126.0.6478.55 → 126.0.6478.61
electron: 30.0.6 → 30.1.1
electron-unwrapped: 30.0.6 → 30.1.1, &lt;span class=&quot;green b&quot;&gt;-168.7 KiB&lt;&#x2F;span&gt;
firefox: 127.0 → 127.0.1
firefox-unwrapped: 127.0 → 127.0.1, &lt;span class=&quot;red b&quot;&gt;+11.4 KiB&lt;&#x2F;span&gt;
iniparser: 4.1 → 4.2.3, &lt;span class=&quot;red b&quot;&gt;+426.2 KiB&lt;&#x2F;span&gt;
initrd-kmod-blacklist: ∅ → ε
initrd-linux: 6.6.33 → 6.6.34
libvlc: 3.0.20 → 3.0.21, &lt;span class=&quot;red b&quot;&gt;+11.0 KiB&lt;&#x2F;span&gt;
linux: 6.6.33, 6.6.33-modules → 6.6.34, 6.6.34-modules, &lt;span class=&quot;green b&quot;&gt;-14.6 KiB&lt;&#x2F;span&gt;
nixos-system-nixos: 3fcf3f779b-24.05.20240615.752c634 → ∅, &lt;span class=&quot;green b&quot;&gt;-64.6 KiB&lt;&#x2F;span&gt;
nixos-system-nixos-c3530d27d1: ∅ → 24.05.20240619.dd457de, &lt;span class=&quot;red b&quot;&gt;+64.6 KiB&lt;&#x2F;span&gt;
source: &lt;span class=&quot;red b&quot;&gt;+35.3 KiB&lt;&#x2F;span&gt;
telegram-desktop: 5.1.5 → 5.1.7, &lt;span class=&quot;red b&quot;&gt;+25.4 KiB&lt;&#x2F;span&gt;
thunderbird: 115.11.0 → 115.12.0
thunderbird-unwrapped: 115.11.0 → 115.12.0, &lt;span class=&quot;red b&quot;&gt;+11.1 KiB&lt;&#x2F;span&gt;
tor-browser: 13.0.15 → 13.0.16, &lt;span class=&quot;red b&quot;&gt;+8.6 KiB&lt;&#x2F;span&gt;
&lt;&#x2F;pre&gt;
&lt;p&gt;It’s quite useful at keeping track of what actually changed. Documentation on the output format is
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nix.dev&#x2F;manual&#x2F;nix&#x2F;2.22&#x2F;command-ref&#x2F;new-cli&#x2F;nix3-store-diff-closures&quot;&gt;https:&#x2F;&#x2F;nix.dev&#x2F;manual&#x2F;nix&#x2F;2.22&#x2F;command-ref&#x2F;new-cli&#x2F;nix3-store-diff-closures&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Remember you still need to &lt;em&gt;switch&lt;&#x2F;em&gt; to the new system, this does not do that for you.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Making your connection bad</title>
          <pubDate>Sat, 15 Jun 2024 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2024/making-your-connection-bad/</link>
          <guid isPermaLink="false">tag:5snb.club,2021:blog:/posts/2024/making-your-connection-bad/</guid>
          <description>&lt;p&gt;This is directly inspired by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;brr.fyi&#x2F;posts&#x2F;engineering-for-slow-internet&quot;&gt;Engineering for Slow
Internet&lt;&#x2F;a&gt;. I figured I’d give running with
dogshit internet on my desktop and phone a go to see how poorly (or well!) specific applications behave.&lt;&#x2F;p&gt;
&lt;p&gt;This is not an in-depth review of the behavior, but just my general impressions running for a few
hours on 200kbit internet with significant packet loss.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;F-Droid doesn’t have a download pause feature, but &lt;em&gt;does&lt;&#x2F;em&gt; resume interrupted downloads. Well done
:) Though it does seem to crash sometimes (I have reported this).&lt;&#x2F;p&gt;
&lt;p&gt;Steam has a download pause feature, and does seem to resume interrupted downloads across steam restarts.&lt;&#x2F;p&gt;
&lt;p&gt;Telegram is quite usable. Images are slow, but for chat, I’d be perfectly happy with it.&lt;&#x2F;p&gt;
&lt;p&gt;Discord will sometimes just kick you to a loading screen if it thinks your internet isn’t working.
If it &lt;em&gt;doesn’t&lt;&#x2F;em&gt; do that, it works pretty okay.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;git&lt;&#x2F;code&gt; fetches&#x2F;clones simply &lt;em&gt;do not&lt;&#x2F;em&gt; have any resumption, as far as I can see. But if you fetch
often enough, the transferred data might be small enough to be able to finish in one transfer. The
kernel &lt;a rel=&quot;external&quot; title=&quot;Cloning Linux from a bundle&quot; href=&quot;https:&#x2F;&#x2F;kernel.org&#x2F;cloning-linux-from-a-bundle.html&quot;&gt;has instructions to clone from a
bundle&lt;&#x2F;a&gt;, which
is one workaround for this issue. Doesn’t help you with pushes, though.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;linux&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#linux&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
How to do this on linux&lt;&#x2F;h2&gt;
&lt;p&gt;Your name for &lt;code&gt;enp3s0&lt;&#x2F;code&gt; may be different. Change it to whatever your network adapter is.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; modprobe ifb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; ip link add name ifb0 type ifb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; ip link set dev ifb0 up&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; tc qdisc add dev enp3s0 ingress&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; tc filter add dev enp3s0 parent ffff:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    u32 match u32&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0 0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; flowid 1:1 action mirred egress redirect dev ifb0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; tc qdisc add dev ifb0 root netem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    delay 200ms 50ms&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; loss random 2% rate 200kbit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; tc qdisc add dev enp3s0 root netem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    delay 200ms 50ms&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; loss random 2% rate 200kbit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you want to test services running on &lt;code&gt;localhost&lt;&#x2F;code&gt;, replace &lt;code&gt;enp3s0&lt;&#x2F;code&gt; with &lt;code&gt;lo&lt;&#x2F;code&gt;. Though some other
programs on your system may Not Like It if &lt;code&gt;localhost&lt;&#x2F;code&gt; is slow, so do that at your own risk :3 (Be sure to replace
&lt;code&gt;enp3s0&lt;&#x2F;code&gt; with &lt;code&gt;lo&lt;&#x2F;code&gt; on the undo script!)&lt;&#x2F;p&gt;
&lt;p&gt;The post says&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you’re an app developer reading this, can you tell me, off the top of your head, how your app
behaves on a link with 40 kbps available bandwidth, 1,000 ms latency, occasional jitter of up to
2,000 ms, packet loss of 10%, and a complete 15-second connectivity dropout every few minutes?&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;If you want to change the settings to those, do:&lt;&#x2F;p&gt;
&lt;p&gt;(I can’t seem to emulate the connection dropout, but the 10% packet loss should be harsh enough.
Also, this is 40kbit up, and 40kbit down. Still, it’s Bad Enough.)&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; tc qdisc change dev ifb0 root netem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    delay 1000ms 2000ms&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 90&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; loss random 10% reorder 10% rate 40kbit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; tc qdisc change dev enp3s0 root netem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    delay 1000ms 2000ms&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 90&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; loss random 10% reorder 10% rate 40kbit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To undo:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; tc qdisc delete dev ifb0 root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; tc qdisc delete dev enp3s0 root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; tc qdisc delete dev enp3s0 ingress&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; modprobe&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; --remove&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; ifb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;android&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#android&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
How to do this on android&lt;&#x2F;h2&gt;
&lt;p&gt;And on an android device, it’s even easier to set up, but it only affects incoming download rate.
But for testing “Hey, does this application utterly shit itself if it doesn’t have a fast
network?”, that’s just fine. You need to enable developer options, though.&lt;&#x2F;p&gt;





&lt;figure&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;making-your-connection-bad&#x2F;android-incoming-limit.png&quot;&gt;
&lt;picture&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;android-incoming-limit.fa52206687bf3af9.avif&quot; type=&quot;image&#x2F;avif&quot;
    height=&quot;1000&quot; width=&quot;450&quot;&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;android-incoming-limit.997bcf4bc15bc4e3.webp&quot; type=&quot;image&#x2F;webp&quot;
    height=&quot;1000&quot; width=&quot;450&quot;&gt;


&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;android-incoming-limit.0501516b5af90e23.jpg&quot; alt=&quot;Inside Android Developer Options, Configure network rate limit set to 128kbps&quot;
height=&quot;1000&quot; width=&quot;450&quot;&gt;

&lt;&#x2F;picture&gt;
&lt;&#x2F;a&gt;
&lt;figcaption&gt;
&lt;a class=&quot;image-download-original&quot; href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;making-your-connection-bad&#x2F;android-incoming-limit.png&quot;&gt;android-incoming-limit.png (864x1920)&lt;&#x2F;a&gt;&lt;br&gt;

&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;h2 id=&quot;web&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#web&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
How to do this on the web&lt;&#x2F;h2&gt;





&lt;figure&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;making-your-connection-bad&#x2F;firefox-limit.png&quot;&gt;
&lt;picture&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;firefox-limit.e6ff986fb37e2af1.avif&quot; type=&quot;image&#x2F;avif&quot;
    height=&quot;389&quot; width=&quot;792&quot;&gt;
&lt;source srcset=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;firefox-limit.3c747a685c1eb585.webp&quot; type=&quot;image&#x2F;webp&quot;
    height=&quot;389&quot; width=&quot;792&quot;&gt;


&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;www.5snb.club&amp;#x2F;processed_images&amp;#x2F;firefox-limit.639289f5317e8b9a.jpg&quot; alt=&quot;Firefox developer tools, network tab, GPRS limiting selected&quot;
height=&quot;389&quot; width=&quot;792&quot;&gt;

&lt;&#x2F;picture&gt;
&lt;&#x2F;a&gt;
&lt;figcaption&gt;
&lt;a class=&quot;image-download-original&quot; href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;making-your-connection-bad&#x2F;firefox-limit.png&quot;&gt;firefox-limit.png (792x389)&lt;&#x2F;a&gt;&lt;br&gt;

&lt;p&gt;On firefox, you can enable network rate limiting by going to the Web Developer
Tools (Ctrl+Shift+I), going to the Network tab, then selecting the ratelimit using the
dropdown in the top right. If you hover over the dropdown, you can see the limiting
applied.&lt;&#x2F;p&gt;


&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;h2 id=&quot;further_reading&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#further_reading&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Further Reading&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bravenewgeek.com&#x2F;sometimes-kill-9-isnt-enough&#x2F;&quot;&gt;Sometimes Kill -9 Isn’t Enough&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20190410224615&#x2F;https:&#x2F;&#x2F;wiki.linuxfoundation.org&#x2F;networking&#x2F;netem#how_can_i_use_netem_on_incoming_traffic&quot;&gt;Linux wiki networking:netem “How can I use netem on incoming traffic?”&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;firefox-source-docs.mozilla.org&#x2F;devtools-user&#x2F;network_monitor&#x2F;throttling&#x2F;index.html&quot;&gt;Firefox Throttling docs&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;man7.org&#x2F;linux&#x2F;man-pages&#x2F;man8&#x2F;tc-netem.8.html&quot;&gt;tc-netem(8)&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      
      
      <item>
          <title>Getting started mapping with netradiant</title>
          <pubDate>Sat, 01 Jun 2024 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2024/getting-started-mapping/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2024/getting-started-mapping/</guid>
          <description>&lt;p&gt;This is not a tutorial, since I barely know how to do this myself. Just a fun little thing. I’m
planning to make funny little defrag maps after playing defrag for at least 5 years.&lt;&#x2F;p&gt;
&lt;p&gt;Also a &lt;code&gt;package.nix&lt;&#x2F;code&gt; for netradiant, since it’s not packaged currently. (Someone should go clean
this up and upstream it into nixpkgs :3).&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;getting-started-mapping&#x2F;start.jpg&quot; alt=&quot;me in xonotic standing on some cubes in a test map i made&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;getting-started-mapping&#x2F;end.jpg&quot; alt=&quot;a ramp you can jump off to reach the finish on top of a sphere. the ramp has a light blue light under it&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;If you really want, you can &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;getting-started-mapping&#x2F;my-map.map&quot;&gt;download the source&lt;&#x2F;a&gt;, but it’s not packaged and I have no idea if it uses
textures that aren’t in the base game. Figure it out yourself, I guess :)&lt;&#x2F;p&gt;
&lt;p&gt;Lastly: the package.nix. This is &lt;em&gt;definitely&lt;&#x2F;em&gt; not the best way to do this, but it builds a
functioning netradiant. The starting point for this was the upstream flake.nix in netradiant.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; stdenv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; fetchFromGitLab&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; fetchurl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; pkgs&lt;&#x2F;span&gt;&lt;span&gt; }:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;let&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  xonoticGamepack&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; fetchFromGitLab&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    owner&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;xonotic&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    repo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;netradiant-xonoticpack&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    rev&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;6f897a4dd5faa85014bfc841cd78df11a9934996&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    hash&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;sha256-w9RSzyDxv5QU4RXP82&#x2F;acJjCgsVqY8Ct&#x2F;pyHOvz1mmE=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;netradiant-xonoticpack&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;  # HACK: we really ought to be reading extra-urls here. this works for now thought.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  xonoticGamepackEntities&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; fetchurl&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;https:&#x2F;&#x2F;gitlab.com&#x2F;xonotic&#x2F;xonotic-maps.pk3dir&#x2F;-&#x2F;raw&#x2F;master&#x2F;scripts&#x2F;entities.ent&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    hash&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;sha256-onqcEyji3tzaSvjuX8M3KC&#x2F;IZJU2edCF92rlo8lgA&#x2F;8=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  netRadiant&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; fetchFromGitLab&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    owner&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;xonotic&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    repo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;netradiant&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    rev&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;757a17fb340bc80cbf8a3ee576e75f56fc7a55c8&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    hash&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;sha256-A6y1mFYmalR25pMP&#x2F;IVicjfPyADJ7VyKR2BTDQB5wJg=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    fetchSubmodules&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt; # needed for BUILD_CRUNCH=ON&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;netradiant&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;in&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;stdenv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;mkDerivation&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;netradiant&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  srcs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; xonoticGamepack netRadiant&lt;&#x2F;span&gt;&lt;span&gt; ]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  sourceRoot&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;netradiant&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  cmakeFlags&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    &amp;quot;-DGIT_VERSION=nix&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt; # meh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;      &amp;quot;-DDOWNLOAD_GAMEPACKS=OFF&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;      &amp;quot;-DBUNDLE_LIBRARIES=OFF&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt; # doesn&amp;#39;t work for some reason&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;      &amp;quot;-DBUILD_CRUNCH=ON&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;      &amp;quot;-DBUILD_RADIANT=ON&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;      &amp;quot;-DBUILD_TOOLS=ON&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;      &amp;quot;-DFHS_INSTALL=ON&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  ]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  postUnpack&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    mkdir -p netradiant&#x2F;build&#x2F;download&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    cp -r --no-preserve=mode netradiant-xonoticpack netradiant&#x2F;build&#x2F;download&#x2F;XonoticPack&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    cp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;xonoticGamepackEntities&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; netradiant&#x2F;build&#x2F;download&#x2F;XonoticPack&#x2F;xonotic.game&#x2F;data&#x2F;entities.ent&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    bash netradiant&#x2F;gamepack-manager --name Xonotic --install -dd netradiant&#x2F;build&#x2F;download -id netradiant&#x2F;build&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;  &amp;#39;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  buildInputs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; with&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; pkgs&lt;&#x2F;span&gt;&lt;span&gt;; [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;    pkg-config gtk2 glib libwebp libxml2 minizip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  ]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  nativeBuildInputs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; with&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; pkgs&lt;&#x2F;span&gt;&lt;span&gt;; [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;    cmake subversion unzip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;      python3 python311Packages&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;pyyaml pcre2 libGL gnome2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;gtkglext&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  ]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;  postFixup&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    mkdir -p $out&#x2F;share&#x2F;netradiant&#x2F;gamepacks&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    cp -r games $out&#x2F;share&#x2F;netradiant&#x2F;gamepacks&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    cp -r xonotic.game $out&#x2F;share&#x2F;netradiant&#x2F;gamepacks&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;  &amp;#39;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You’ll need to go find the engine path manually. That could probably be fixed by making netradiant
take a dependency on xonotic, but that feels a bit weird. 🤷.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>xonotic defrag gameplay: techniq_run_002&#x2F;vanilla_01 finishes</title>
          <pubDate>Sat, 11 May 2024 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2024/xdf-finishes/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2024/xdf-finishes/</guid>
          <description>&lt;p&gt;i just finished &lt;em&gt;all&lt;&#x2F;em&gt; (finishable) relaxed running maps on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;xdf.gg&quot;&gt;xdf.gg&lt;&#x2F;a&gt;, all 1159&#x2F;1161
of them. (the 2 remaining ones are just not possible in xonotic), and thought i’d share my finishes
of the final 2 ones. this is also a test of video recording from xonotic, i might upload duel
footage or something here too, who knows.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;techniq_run_002&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#techniq_run_002&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;xdf.gg&#x2F;map&#x2F;techniq_run_002&quot;&gt;techniq_run_002&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;this is a funny route&lt;&#x2F;p&gt;
&lt;p&gt;you can tell from the video what you’re &lt;em&gt;meant&lt;&#x2F;em&gt; to do. but fuck that lol. this is honestly so much
easier.&lt;&#x2F;p&gt;
&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;techniq_run_002.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=techniq_run_002.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;h2 id=&quot;vanilla_01&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#vanilla_01&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;xdf.gg&#x2F;map&#x2F;vanilla_01&quot;&gt;vanilla_01&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;this map i suspected &lt;em&gt;wasn’t possible&lt;&#x2F;em&gt;, since there were some changes to the rocket physics which
make just climbing up the back wall not work, and no one had finished it since those.&lt;&#x2F;p&gt;
&lt;p&gt;however, yeah, turns out it is possible. it’s also fucking difficult. we spent a solid hour on this
one trying to work out a route. well, maybe half an hour. i then spent the other half hour trying
to &lt;em&gt;execute&lt;&#x2F;em&gt; the route :3 shoutout banano for being the first to prove it’s possible&lt;&#x2F;p&gt;
&lt;p&gt;also my god my rocket stacks are bad. i should work on those&lt;&#x2F;p&gt;
&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;vanilla_01.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=vanilla_01.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;p&gt;for recording, i initially was going to set up a nice custom HUD that only contains the info &lt;em&gt;you&lt;&#x2F;em&gt;
need, but then figured that was too much effort, and also it wouldn’t really be how i play. the
only changes made here are to disable the clock&#x2F;fps counter (which aren’t useful when playing back
demos), and to enable the pressed keys display (that &lt;em&gt;is&lt;&#x2F;em&gt; useful information, but i’m not going to
be playing like that)&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>1:11.111.flac</title>
          <pubDate>Sat, 20 Apr 2024 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2024/111111/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2024/111111/</guid>
          <description>&lt;div&gt;
&lt;a href=&quot;&#x2F;files&#x2F;111111.flac&quot;&gt;&lt;h2 class=&quot;xreslondontubedark&quot;&gt;
&lt;code class=&quot;ul&quot;&gt;
&lt;span class=&quot;lgreen&quot;&gt;5225225&lt;&#x2F;span&gt;
&lt;span class=&quot;white&quot;&gt;-&lt;&#x2F;span&gt;
&lt;span class=&quot;red&quot;&gt;1:11.111&lt;&#x2F;span&gt;&lt;span class=&quot;lblack&quot;&gt;.flac (6.1MB)&lt;&#x2F;span&gt;
&lt;&#x2F;code&gt;
&lt;&#x2F;h2&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;(volume warning just a bit)&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;111111&#x2F;cover.jpg&quot; alt=&quot;1:11.111 (finally, a track made in something other than audacity :3 (lmms) )&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;CC-BY 4.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  fuck the conservatives&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  protect trans kids&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  you are loved&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;stay hydrated&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  (it says, with a headache.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   do as i say, not as i do.)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;as stated, this track is made in LMMS (with final adjustments done in audacity)&lt;&#x2F;p&gt;
&lt;p&gt;have fun&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>transmission.flac</title>
          <pubDate>Tue, 05 Mar 2024 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2024/transmission/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2024/transmission/</guid>
          <description>&lt;div&gt;
&lt;a href=&quot;&#x2F;files&#x2F;transmission.flac&quot;&gt;&lt;h2 class=&quot;xreslondontubedark&quot;&gt;
&lt;code class=&quot;ul&quot;&gt;
&lt;span class=&quot;lgreen&quot;&gt;5225225&lt;&#x2F;span&gt;
&lt;span class=&quot;white&quot;&gt;-&lt;&#x2F;span&gt;
&lt;span class=&quot;red&quot;&gt;transmission&lt;&#x2F;span&gt;&lt;span class=&quot;lblack&quot;&gt;.flac (1.4MB)&lt;&#x2F;span&gt;
&lt;&#x2F;code&gt;
&lt;&#x2F;h2&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;&lt;code&gt;click to get .png cover&lt;&#x2F;code&gt;&lt;br &#x2F;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;transmission&#x2F;cover.png&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;transmission&#x2F;cover.jpg&quot; alt=&quot;transmission&quot; &#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;CC-BY 4.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  but piracy is good and cool&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  and you should do more of it&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;trans rights&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;my paws are big and soft&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</description>
      </item>
      
      
      <item>
          <title>C# puzzles</title>
          <pubDate>Wed, 31 Jan 2024 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2024/csharp-puzzles/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2024/csharp-puzzles/</guid>
          <description>&lt;p&gt;Two puzzles about funny C# behavior I discovered in the past.&lt;&#x2F;p&gt;
&lt;p&gt;The first one is fully defined, the second one is Quite Clever.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;The goal is to make the program reach the &lt;code&gt;return 0;&lt;&#x2F;code&gt; line, through inserting
code. (No, doing a &lt;code&gt;Environment.Exit(0)&lt;&#x2F;code&gt; is not the solution, it needs to
&lt;em&gt;reach&lt;&#x2F;em&gt; the existing &lt;code&gt;return 0&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;You don’t need to do stuff like spawn the process again or patch a binary
on-disk.&lt;&#x2F;p&gt;
&lt;p&gt;The code is compiled and has no warnings with &lt;code&gt;mcs &amp;lt;filename&amp;gt;&lt;&#x2F;code&gt;. &lt;code&gt;mcs --version&lt;&#x2F;code&gt;
is &lt;code&gt;6.12.0.182&lt;&#x2F;code&gt;. (Assume language version 7 or above).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;format_fun&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#format_fun&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Format Fun&lt;&#x2F;h2&gt;
&lt;p&gt;Let’s start easy. Make this program say hi to me :)&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;public static class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Program&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    public static int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; Main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        var&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; goodbye&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;System&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;StringBuilder&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;Bye Bye&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        YourStuff&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;SecretSauce&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;$&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;{goodbye}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;, 522&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; Make this print &amp;quot;Hello, 522&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        System&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Console&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;WriteLine&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;$&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;{goodbye}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;, 522&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; (goodbye&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;ToString&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;Hello&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            System&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Console&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;WriteLine&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;You have failed!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;public static class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; YourStuff&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; XXX Write whatever SecretSauce function you need in order to make it work.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;details&gt;
&lt;summary&gt;
Hint
&lt;&#x2F;summary&gt;
Is a &lt;code&gt;$&quot;&quot;&lt;&#x2F;code&gt; always a &lt;code&gt;string&lt;&#x2F;code&gt;?
&lt;&#x2F;details&gt;
&lt;p&gt;Answer: &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;csharp-puzzles&#x2F;format-fun.cs&quot;&gt;&lt;code&gt;format-fun.cs&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;double_fun&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#double_fun&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Double Fun&lt;&#x2F;h2&gt;
&lt;p&gt;(Your solution here does &lt;em&gt;not&lt;&#x2F;em&gt; need to be cross platform. As long as it works
on your machine. However, remember no &lt;code&gt;unsafe&lt;&#x2F;code&gt;!)&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;public static class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Program&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    public static int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; Main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        var&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; foo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;System&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;StringBuilder&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;Bye Bye, &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        var&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; bar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;System&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;StringBuilder&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;World?&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        YourStuff&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;SecretSauce&lt;&#x2F;span&gt;&lt;span&gt;(foo)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        System&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Console&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;WriteLine&lt;&#x2F;span&gt;&lt;span&gt;(foo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;ToString&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; bar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;ToString&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; Make this print &amp;quot;Hello, World!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; (foo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;ToString&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;Hello, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt; bar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;ToString&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;World!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;            &#x2F;&#x2F; These need to pass too!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        System&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Console&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;WriteLine&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;You have failed!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;public static class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; YourStuff&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Write whatever you need here to make it work.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;details&gt;
&lt;summary&gt;
Hint
&lt;&#x2F;summary&gt;
Doing this isn&#x27;t technically unsafe but it is definitely &lt;i&gt;unsafe&lt;&#x2F;i&gt;.
&lt;&#x2F;details&gt;
&lt;p&gt;Answer: &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2024&#x2F;csharp-puzzles&#x2F;double-fun.cs&quot;&gt;&lt;code&gt;double-fun.cs&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Compressing a set of random numbers</title>
          <pubDate>Sun, 31 Dec 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/compressing-random-number-set/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/compressing-random-number-set/</guid>
          <description>&lt;p&gt;Despite what it may seem, compressing a &lt;em&gt;set&lt;&#x2F;em&gt; of random numbers is indeed possible, since not
needing to care about the &lt;em&gt;order&lt;&#x2F;em&gt; lets you decrease the entropy by sorting the numbers ahead of
time.&lt;&#x2F;p&gt;
&lt;p&gt;One basic scheme for doing this is to just sort the numbers, and then compress the most significant
byte separately from the rest, by making an array of &lt;em&gt;counts&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;For example, in base 10, this would be turning&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;0123&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;0512&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;1312&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;2345&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;4444&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;into&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;2 1 1 0 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;123&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;512&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;312&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;345&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;444&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And then on decoding, you just scan the counts list, decrementing by one for every value, and
sticking the index on the front of the number.&lt;&#x2F;p&gt;
&lt;p&gt;If you go and encode 65536 &lt;code&gt;u64&lt;&#x2F;code&gt;s with this scheme, you get 524 288 bytes used for the
source data, 459 264 bytes used for the encoded form, which is a compression ratio of 1.142&lt;&#x2F;p&gt;
&lt;p&gt;Not great, but we’re working with completely random numbers here, so there is a limit to how well
we can do.&lt;&#x2F;p&gt;
&lt;p&gt;Code for that is&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(array_chunks)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(is_sorted)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; ITEM_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 16&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; encode&lt;&#x2F;span&gt;&lt;span&gt;(data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u64&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    assert!&lt;&#x2F;span&gt;&lt;span&gt;(data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;is_sorted&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; lengths&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 8&lt;&#x2F;span&gt;&lt;span&gt;];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; data {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; item_arr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; bucket&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; item_arr[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        lengths[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;usize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt;(bucket)]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; length&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; lengths {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;extend&lt;&#x2F;span&gt;&lt;span&gt;(length&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; data {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; item_arr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; value&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 7&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; item_arr[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;try_into&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;extend&lt;&#x2F;span&gt;&lt;span&gt;(value);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    output&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; decode&lt;&#x2F;span&gt;&lt;span&gt;(data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u64&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; lengths&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; data[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;256&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span&gt;)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;array_chunks&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;copied&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;from_be_bytes);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; data[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;256&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;array_chunks&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;7&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;copied&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; (idx, length)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; lengths&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;enumerate&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        for&lt;&#x2F;span&gt;&lt;span&gt; _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span&gt;length {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            let mut&lt;&#x2F;span&gt;&lt;span&gt; value&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0_&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 8&lt;&#x2F;span&gt;&lt;span&gt;];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            value[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;try_from&lt;&#x2F;span&gt;&lt;span&gt;(idx)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            value[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;copy_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;next&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u64&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;(value));&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    output&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u64&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;ITEM_COUNT&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt;_&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;random&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;collect&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;sort&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    println!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;Size of data: {}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 8&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; encoded&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; encode&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;data);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    println!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;Size of encoded data: {}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, encoded&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    println!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;That&amp;#39;s a compression ratio of: {:.3}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        (data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 8&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; f64&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span&gt; (encoded&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; f64&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    );&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; decoded&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; decode&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;encoded);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    assert_eq!&lt;&#x2F;span&gt;&lt;span&gt;(data, decoded);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I &lt;em&gt;believe&lt;&#x2F;em&gt; the working out for the actual amount of entropy for a sorted list of 65536 u64s is
&lt;code&gt;log2(256^524288 &#x2F; 65536!) bits to bytes&lt;&#x2F;code&gt; (as entered into
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;qalculate.github.io&#x2F;&quot;&gt;Qalculate!&lt;&#x2F;a&gt;), which gives us 405 033. Which seems plausable?
That’d be a compression ratio of 1.294, which is a bit better.&lt;&#x2F;p&gt;
&lt;p&gt;Oh, right, use cases! This would work well for transmitting a set of hashes, say for git? Honestly,
not sure. Probably not worth it, but a fun trick that has probably been done better elsewhere :)&lt;&#x2F;p&gt;
&lt;p&gt;How does lzma do?&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;io&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Write&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u64&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;ITEM_COUNT&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt;_&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;random&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;collect&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;sort&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; data {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;io&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;stdout&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;write_all&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;# cargo run &amp;gt; output.bin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;# lzma -9e --keep output.bin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;# wc -c output.bin*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;524288&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; output.bin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;444228&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; output.bin.lzma&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Which, if you’ve been playing along at home, is &lt;em&gt;better&lt;&#x2F;em&gt; than what I’ve gotten. Though my algorithm
is almost definitely faster. And deterministic in output size.&lt;&#x2F;p&gt;
&lt;p&gt;Oh well, at least I had fun :3&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>RFC 35140: The Do-Not-Stab flag in the HTTP Header</title>
          <pubDate>Fri, 17 Nov 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/do-not-stab/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/do-not-stab/</guid>
          <description>&lt;p&gt;Date: March 7, 2111&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;abstract&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#abstract&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Abstract&lt;&#x2F;h2&gt;
&lt;p&gt;This document defines the syntax and semantics of the &lt;code&gt;Do-Not-Stab&lt;&#x2F;code&gt; header, a proposed HTTP header
that allows users to indicate to a website their preferences about being stabbed. It also provides
a standard for how services should comply with such user preferences, if they wish to.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;authors&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#authors&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Authors&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[REDACTED]&lt;&#x2F;code&gt; (Google)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[REDACTED]&lt;&#x2F;code&gt; (Google)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[REDACTED]&lt;&#x2F;code&gt; (Google)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[REDACTED]&lt;&#x2F;code&gt; (Google)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;introduction&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Introduction&lt;&#x2F;h2&gt;
&lt;p&gt;Over the last 50 years, advancements in peripherals have allowed websites to stab users. A number
of industries have popped up to provide SaaS (Stabbings as a Service). Some users have expressed
discomfort when a knife is plunged into their chest, and this header allows those users to express
their personal preferences.&lt;&#x2F;p&gt;
&lt;p&gt;A user preference can, of course, be ignored by bad actors. However, most stabbings are not done by
malicious actors, they are simply law-abiding companies which will gladly stop stabbing you if you
ask. This standard provides a method for a user to easily opt-out of all stabbings, except those
mandated by law, and ones that the company wants to do anyways.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;syntax&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#syntax&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Syntax&lt;&#x2F;h2&gt;
&lt;p&gt;The header has only one form, &lt;code&gt;Do-Not-Stab: 1&lt;&#x2F;code&gt;. This is because the lack of a header indicates a
clear preference that the user wants to be stabbed.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;defaults&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#defaults&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Defaults&lt;&#x2F;h2&gt;
&lt;p&gt;A user-agent MUST NOT adopt &lt;code&gt;Do-Not-Stab: 1&lt;&#x2F;code&gt; as the default preference. If a user-agent were to do
this, web services SHOULD ignore the preference and stab the user anyways.&lt;&#x2F;p&gt;
&lt;p&gt;This is because user-agents are in no position to determine if a user wants to be stabbed or not,
this must be an explicit choice that the user makes.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;enforcement&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#enforcement&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Enforcement&lt;&#x2F;h2&gt;
&lt;p&gt;Microsoft has committed to supporting the &lt;code&gt;Do-Not-Stab&lt;&#x2F;code&gt; header inside the EEA (European Economic
Area). Outside of the EEA, support for the header is still in-progress, and you may get stabbed,
even with the header set. If you are in a country that leaves the EEA, you may get stabbed.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;exceptions&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#exceptions&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Exceptions&lt;&#x2F;h1&gt;
&lt;p&gt;Exceptions to the &lt;code&gt;Do-Not-Stab&lt;&#x2F;code&gt; header are accepted when commercial interests outweigh safety
concerns. These include, but are not limited to&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Stabbing users who have consented to being stabbed (even if they don’t know they consented)&lt;&#x2F;li&gt;
&lt;li&gt;Stabbings requested by a government. Websites SHOULD NOT try to challenge the legality of any
stabbings requested, the user probably deserved it.&lt;&#x2F;li&gt;
&lt;li&gt;Stabbings that are probably not going to kill the user.&lt;&#x2F;li&gt;
&lt;li&gt;Shareholders wanted it&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;editor_comments&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#editor_comments&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Editor Comments (REMOVE BEFORE PUBLISHING)&lt;&#x2F;h1&gt;
&lt;p&gt;seriously, what the fuck is with companies nowadays demanding that they be told to not do the
things they know they shouldn’t be doing anyways? why is microsoft respecting the user’s choice
only in the EEA? because they only &lt;em&gt;have&lt;&#x2F;em&gt; to there. extremely funny how they were also the ones to
set Do-Not-Track by default in IE, thereby getting everyone to ignore it for IE. because companies
are god damn children and must be told no explicitly by every person individually. it’s a fucking
wonder that DNT even got in as a general option and wasn’t mandated to be set per-origin, making it
even more fucking useless than it is.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;blogs.windows.com&#x2F;windows-insider&#x2F;2023&#x2F;11&#x2F;16&#x2F;previewing-changes-in-windows-to-comply-with-the-digital-markets-act-in-the-european-economic-area&#x2F;&quot;&gt;https:&#x2F;&#x2F;blogs.windows.com&#x2F;windows-insider&#x2F;2023&#x2F;11&#x2F;16&#x2F;previewing-changes-in-windows-to-comply-with-the-digital-markets-act-in-the-european-economic-area&#x2F;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;it’s fucking depressing when even the fucking bare minimum form of regulation is followed to the
letter and no more, because every company out there fucking hates you and would sell you out to
make a bit more money if they legally could. and even if they couldn’t, who’s going to stop them?&lt;&#x2F;p&gt;
&lt;p&gt;“We and our 756 partners process personal data[…]” wow big polycule this website is in, there’s no
fucking way they actually need to work with that many fucking companies, what the shit? adtech is a
scourge on humanity and serves zero fucking purpose.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>printf format validation in rust</title>
          <pubDate>Sat, 07 Oct 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/printf-format-validation-in-rust/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/printf-format-validation-in-rust/</guid>
          <description>&lt;p&gt;I was watching &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=mOtKD7ml0NU&quot;&gt;a talk about Idris 2&lt;&#x2F;a&gt; and it was
mentioned that you can implement a type safe &lt;code&gt;printf&lt;&#x2F;code&gt; using dependent types (around 10 minutes in).&lt;&#x2F;p&gt;
&lt;p&gt;And I was wondering if you could do something like that in rust. And you can, ish!&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;E0308&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; mismatched types&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   --&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;main&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;145&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;13&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;145&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;     let&lt;&#x2F;span&gt;&lt;span&gt; x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; printf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;that&amp;#39;s a %s %s, aged %u!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;cute&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;dog&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;&#x2F;span&gt;&lt;span&gt; expected `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;%s%s&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;`, found `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;%s%s%u&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    =&lt;&#x2F;span&gt;&lt;span&gt; note&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; expected constant `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;%s%s&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;               found constant `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;%s%s%u&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That’s done with no macros, just a lot of &lt;code&gt;const&lt;&#x2F;code&gt; code of dubious quality.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;The core technique I use here that you can assert equality of 2 constant values as a &lt;code&gt;where&lt;&#x2F;code&gt; bound.&lt;&#x2F;p&gt;
&lt;p&gt;For example, let’s write a function that asserts that you pass in a string whose length is the same
size as the object you pass in.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![allow(incomplete_features)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(generic_const_exprs)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(associated_const_equality)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(adt_const_params)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;trait&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; SIZE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;T&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; T&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; SIZE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;mem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;size_of&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;T&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;pub const fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; length&lt;&#x2F;span&gt;&lt;span&gt;(s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; correct_size&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;T&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; T&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    where&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; T&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;SIZE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; { length(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;S&lt;&#x2F;span&gt;&lt;span&gt;) }&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    correct_size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;_,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;hewwo&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;42_&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u32&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;E0308&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; mismatched types&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;  --&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;main&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;23&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;32&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;23&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;     correct_size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;_,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;hewwo&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;42_&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u32&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   |                                ^^^^^^&lt;&#x2F;span&gt;&lt;span&gt; expected `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;`, found `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   =&lt;&#x2F;span&gt;&lt;span&gt; note&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; expected constant `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;              found constant `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;note&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; required by a bound&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; `correct_size`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;  --&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;main&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;19&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;19&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;18&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; correct_size&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;T&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; T&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   |    ------------&lt;&#x2F;span&gt;&lt;span&gt; required by a bound&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; this function&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;19&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;     where&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; T&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;SIZE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; { length(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;S&lt;&#x2F;span&gt;&lt;span&gt;) }&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   |                   ^^^^^^^^^^^^^^^^^^^^&lt;&#x2F;span&gt;&lt;span&gt; required by this bound&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; `correct_size`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Worried about the 3 features and &lt;code&gt;incomplete_features&lt;&#x2F;code&gt; in this small example? Don’t worry, it gets
worse.&lt;&#x2F;p&gt;
&lt;p&gt;Anyways, the core premise here is that you have two sides, one being the string as the const
parameter, and one being the value entered. And you apply a “skeleton” function to each side to map
it to some shared expected value, and if both map to the same value, then it’s allowed to compile.&lt;&#x2F;p&gt;
&lt;p&gt;The skeleton function should end up in a reasonably human understandable value as the key, since it
is what will be printed when there’s a difference.&lt;&#x2F;p&gt;
&lt;p&gt;That’s all we really need to know in order to start with the real &lt;code&gt;printf&lt;&#x2F;code&gt; code. First, let’s look
at the skeleton function for the format string. The key will be the format string specifiers, so
&lt;code&gt;Hello %d world %s!&lt;&#x2F;code&gt; ends up with a key of &lt;code&gt;%d%s&lt;&#x2F;code&gt;, which is reasonably human readable.&lt;&#x2F;p&gt;
&lt;p&gt;I’m using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.rs&#x2F;konst&#x2F;latest&#x2F;konst&#x2F;index.html&quot;&gt;&lt;code&gt;konst&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; to make parsing the string a bit
easier. You absolutely can do this without that crate, it’s just a bit more painful.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; parse_skeleton&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; F&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; chars&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; konst&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;chars&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;F&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; saw_percent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    while let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Some&lt;&#x2F;span&gt;&lt;span&gt;((ch, chars_))&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; chars&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;next&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        chars&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; chars_;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; saw_percent {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; ch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;%&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                let&lt;&#x2F;span&gt;&lt;span&gt; encoded&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; konst&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;chr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;encode_utf8&lt;&#x2F;span&gt;&lt;span&gt;(ch);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; append_strs&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;append_strs&lt;&#x2F;span&gt;&lt;span&gt;(s,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;%&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;), encoded&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_str&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            saw_percent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; ch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;%&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                saw_percent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Fairly simple code, if a bit Weird because it needs to be &lt;code&gt;const fn&lt;&#x2F;code&gt;, so no &lt;code&gt;for&lt;&#x2F;code&gt; loops for you :)&lt;&#x2F;p&gt;
&lt;p&gt;Except for &lt;code&gt;append_strs&lt;&#x2F;code&gt;. What the fuck is that? Well, I need some way to dynamically build a
&lt;code&gt;&amp;amp;&#x27;static str&lt;&#x2F;code&gt;. So I wrote a function with a rather funny signature, &lt;code&gt;fn(&amp;amp;str, &amp;amp;str) -&amp;gt; &amp;amp;&#x27;static str&lt;&#x2F;code&gt;,
which does exactly what you think it does.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; append_strs&lt;&#x2F;span&gt;&lt;span&gt;(a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;, b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    unsafe&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; buf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; core&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;intrinsics&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;const_allocate&lt;&#x2F;span&gt;&lt;span&gt;(a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;(),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        assert!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;!&lt;&#x2F;span&gt;&lt;span&gt;buf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;is_null&lt;&#x2F;span&gt;&lt;span&gt;(),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;append_strs can only be called at comptime&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ptr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;copy&lt;&#x2F;span&gt;&lt;span&gt;(a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ptr&lt;&#x2F;span&gt;&lt;span&gt;(), buf, a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ptr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;copy&lt;&#x2F;span&gt;&lt;span&gt;(b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ptr&lt;&#x2F;span&gt;&lt;span&gt;(), buf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;add&lt;&#x2F;span&gt;&lt;span&gt;(a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;()), b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from_utf8_unchecked&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;slice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from_raw_parts&lt;&#x2F;span&gt;&lt;span&gt;(buf, a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;()))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Turns out &lt;code&gt;const&lt;&#x2F;code&gt; &lt;em&gt;does&lt;&#x2F;em&gt; have allocation. It’s just very very magic. It returns a null pointer if
you try to call it at runtime, so this is actually safe, I think. Cursed shit like this at compile
time is Fine because the unused values will just get removed since they’re not referenced.
Probably.&lt;&#x2F;p&gt;
&lt;p&gt;Oh, I almost forgot, you also earn&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(adt_const_params)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(core_intrinsics)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_ptr_is_null)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_heap)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Anyways, now let’s do the skeleton for the &lt;em&gt;value&lt;&#x2F;em&gt;. The code for that is downright normal, and
doesn’t need any more unstable features.&lt;&#x2F;p&gt;
&lt;p&gt;First, we need to define the specifier for each type you want to use in the formatting.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;trait&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InnerFormatString&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Display&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; KIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And then the implementations&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InnerFormatString&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u32&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; KIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;%u&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InnerFormatString&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; i32&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; KIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;%d&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;a&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InnerFormatString&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;a str&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; KIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;%s&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Fairly standard stuff.&lt;&#x2F;p&gt;
&lt;p&gt;I used tuples to pass the arguments, so I defined a trait for the tuples themselves&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;trait&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; FormatString&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; KIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; display&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;dyn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Display&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And then the implementation code. I’ll only show the one for a 3-tuple, but you get the gist, it
works for any tuple size you want.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;A&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InnerFormatString&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; B&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InnerFormatString&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InnerFormatString&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; FormatString&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;A&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; B&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; C&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; KIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; append_strs&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;A&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;KIND&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; append_strs&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;B&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;KIND&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;KIND&lt;&#x2F;span&gt;&lt;span&gt;));&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; display&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;dyn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Display&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        match&lt;&#x2F;span&gt;&lt;span&gt; x {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;            0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;            1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;            2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; panic!&lt;&#x2F;span&gt;&lt;span&gt;(),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The thing computing the key is &lt;code&gt;KIND&lt;&#x2F;code&gt;, the &lt;code&gt;display&lt;&#x2F;code&gt; is just there to make the printf code actually
&lt;em&gt;work&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Finally, let’s write the &lt;code&gt;printf&lt;&#x2F;code&gt; code itself.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(generic_const_exprs)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(associated_const_equality)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; printf&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;A&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; F&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(arg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; A&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;where&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    A&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; FormatString&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;KIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; { parse_skeleton&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;F&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;() }&amp;gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; saw_percent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; idx&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; ret&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; ch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; F&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;chars&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; saw_percent {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; ch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;%&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                ret&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;#39;%&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;                &#x2F;&#x2F; We know that the ch *will* correspond to the appropriate arg here&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;                &#x2F;&#x2F; (So we could unsafely assume that.)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;                &#x2F;&#x2F; But for now, we can just make use of Display and not actually use it.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;                write!&lt;&#x2F;span&gt;&lt;span&gt;(ret,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;{}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, arg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;display&lt;&#x2F;span&gt;&lt;span&gt;(idx))&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                idx&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            saw_percent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; ch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;%&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                saw_percent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                ret&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(ch);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;E0308&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; mismatched types&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   --&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;main&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;157&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;53&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;157&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;     let&lt;&#x2F;span&gt;&lt;span&gt; x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; printf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;_,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;that&amp;#39;s a %s %s, aged %u!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;((&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;cute&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;dog&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;));&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    |                                                     ^^^^^^^^^^^^^^^&lt;&#x2F;span&gt;&lt;span&gt; expected `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;%s%s&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;`, found `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;%s%s%u&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    =&lt;&#x2F;span&gt;&lt;span&gt; note&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; expected constant `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;%s%s&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;               found constant `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;%s%s%u&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;note&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; required by a bound&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; `printf`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;   --&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;main&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;163&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;21&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;161&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; printf&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;A&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; F&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(arg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; A&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    |    ------&lt;&#x2F;span&gt;&lt;span&gt; required by a bound&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; this function&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;162&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; where&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;163&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;     A&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; FormatString&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;KIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; { parse_skeleton&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;F&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;() }&amp;gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;&#x2F;span&gt;&lt;span&gt; required by this bound&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; `printf`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And we’re done!&lt;&#x2F;p&gt;
&lt;p&gt;Right?&lt;&#x2F;p&gt;
&lt;p&gt;Okay, fine. Time for one more hack. It would be nice if we didn’t need the double parenthesis, and
it just acted like a normal function. Thankfully, we have a tool for that! &lt;code&gt;FnOnce&lt;&#x2F;code&gt; (and friends)
take their arguments as a tuple! It’s quite unstable, but we can do it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(generic_const_items)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(unboxed_closures)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(tuple_trait)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(fn_traits)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span&gt; printf&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; F&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;A&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;marker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Tuple&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; F&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static str&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ops&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;FnOnce&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;A&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; printf&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;F&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;where&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    A&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; FormatString&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;KIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; { parse_skeleton&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;F&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;() }&amp;gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    extern&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;rust-call&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; call_once&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, arg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; A&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; you&amp;#39;ve already seen this.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Finally, we’ve reached the API shown at the top. Download &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;printf-format-validation-in-rust&#x2F;.&#x2F;main.rs&quot;&gt;the full &lt;code&gt;.rs&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; (be sure to add &lt;code&gt;konst 0.3.6&lt;&#x2F;code&gt; as a dependency)&lt;&#x2F;p&gt;
&lt;p&gt;Is &lt;code&gt;printf&lt;&#x2F;code&gt; specifically a &lt;em&gt;useful&lt;&#x2F;em&gt; API to do this for? No, not really, we have &lt;code&gt;format_args&lt;&#x2F;code&gt;. But
it sure was funny. Finding an actual productive use for this is an exercise for the reader.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Subpixel Rendering for images</title>
          <pubDate>Sat, 30 Sep 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/subpixel-rendering-for-images/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/subpixel-rendering-for-images/</guid>
          <description>&lt;p&gt;Subpixel rendering is typically used for text to give your monitor an effectively higher
resolution. It works by making use of the fact that your monitor has 3 subpixels for every pixel
that each light up, and so a red line will appear physically to the left than a blue line.&lt;&#x2F;p&gt;
&lt;p&gt;But what if we used it for not text instead? Such as &lt;em&gt;images&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Here is the 300x300 image (taken from
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.pickpik.com&#x2F;apartment-architecture-building-corporate-glass-high-rise-131995&quot;&gt;https:&#x2F;&#x2F;www.pickpik.com&#x2F;apartment-architecture-building-corporate-glass-high-rise-131995&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;subpixel-rendering-for-images&#x2F;big.png&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;And then a downscaled version (cubic interpolation)&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;subpixel-rendering-for-images&#x2F;small-no-aa.png&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;And finally, a subpixel version.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;subpixel-rendering-for-images&#x2F;small-aa.png&quot; alt=&quot;&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;If you’re on mobile where 1 image pixel won’t be 1 screen pixel, this probably doesn’t look great.
Also, this assumes a RGB subpixel layout, which is true for my monitor, and &lt;em&gt;seems&lt;&#x2F;em&gt; to be the most
common, but might not be true for you.&lt;&#x2F;p&gt;
&lt;p&gt;Do I think this is useful? No. It only looks decent for grayscale images. But it’s &lt;em&gt;possible&lt;&#x2F;em&gt;, and
Kinda Works.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Here, I added a tool to do this. It will work best on images with a multiple of 3 size in both
directions, and is grayscale. But it’s up to you to if you want to try it on others. Also, opacity
will be ignored, and just set to 255.&lt;&#x2F;p&gt;
&lt;input id=file type=&quot;file&quot;&gt;
&lt;p&gt;
&lt;button id=do&gt;Convert Image&lt;&#x2F;button&gt;
&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a id=download_link class=hidden&gt;Download Image&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;canvas id=distort-canvas&gt;
&lt;&#x2F;canvas&gt;
&lt;script src=&quot;subpixel.js&quot;&gt;
&lt;&#x2F;script&gt;
</description>
      </item>
      
      
      <item>
          <title>fun with comments</title>
          <pubDate>Mon, 14 Aug 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/fun-with-comments/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/fun-with-comments/</guid>
          <description>&lt;p&gt;Programming languages typically include one or two ways to comment out code so
that the compiler doesn’t read it. One being line comments, such as&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;foo&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt; &#x2F;&#x2F; comment here&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;which will comment out any code up until the end of the line,
and the other being block comments, such as&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;foo&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt; &#x2F;* a &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    good &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    number *&#x2F;&lt;&#x2F;span&gt;&lt;span&gt; )&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;which will comment out code in a block.&lt;&#x2F;p&gt;
&lt;p&gt;Block comments aren’t restricted to
a single line, and can sometimes be nested (so that &lt;code&gt;&#x2F;* &#x2F;* *&#x2F; *&#x2F;&lt;&#x2F;code&gt; behaves
correctly).&lt;&#x2F;p&gt;
&lt;p&gt;But what happens when you mix the two?&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Well, if you comment out a block comment directive with an &lt;em&gt;active&lt;&#x2F;em&gt; line
comment, then the block comment does not apply. This can be seen most simply
with&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; &#x2F;*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    *&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; expected expression, found `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; --&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;main&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;  |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |     *&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;  |      ^&lt;&#x2F;span&gt;&lt;span&gt; expected expression&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here, the block comment didn’t actually start. Which makes sense, it’s in
commented out code.&lt;&#x2F;p&gt;
&lt;p&gt;But &lt;em&gt;active&lt;&#x2F;em&gt; line comment there is important. If a block comment did start,
then the line comment does not apply, only block comments do.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    This is commented out&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; *&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    but_this_is_not&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;&#x2F;&#x2F;&lt;&#x2F;code&gt; does not matter, because it’s commented out.&lt;&#x2F;p&gt;
&lt;p&gt;Therefore, if you want to end a block comment if it exists, otherwise do
nothing, then you can do &lt;code&gt;&#x2F;&#x2F; *&#x2F;&lt;&#x2F;code&gt;. That line comment will be active if you’re
not currently in a block comment (in which case the &lt;code&gt;*&#x2F;&lt;&#x2F;code&gt; is just part of the
comment), or it will not be active, but it will be commented out, in which case
the &lt;code&gt;*&#x2F;&lt;&#x2F;code&gt; is active and removes a nesting level.&lt;&#x2F;p&gt;
&lt;p&gt;This means that if you have a large code span that you want to quickly comment
out and uncomment, you can put a &lt;code&gt;&#x2F;*&lt;&#x2F;code&gt; at the top, a &lt;code&gt;&#x2F;&#x2F; *&#x2F;&lt;&#x2F;code&gt; at the bottom, and
then replace the &lt;code&gt;&#x2F;*&lt;&#x2F;code&gt; with a &lt;code&gt;&#x2F;&#x2F;*&lt;&#x2F;code&gt; with a single slash.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F;*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    this_is_no_longer_commented_out&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; *&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    and_this_is_not&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I have used that in the past when I don’t have IDE shortcuts. Useful? No, not
really. But a fun hack.&lt;&#x2F;p&gt;
&lt;p&gt;Finally, if you want to switch between 2 different functions with a single
keystroke, you can put a function on the same line as the &lt;code&gt;&#x2F;&#x2F; *&#x2F;&lt;&#x2F;code&gt; line, and
make use of the fact that the line comment is conditionally active.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F;*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    a&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; *&#x2F; b();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    a();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; *&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; b&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;a()&lt;&#x2F;code&gt; can be multi-line, but I don’t think there’s a way to let &lt;code&gt;b()&lt;&#x2F;code&gt; be
multi-line.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Spot the bug: Bad Escape</title>
          <pubDate>Wed, 19 Jul 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/spot-the-bug-bad-escape/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/spot-the-bug-bad-escape/</guid>
          <description>&lt;p&gt;Hi! I wrote some Excellent Javascript that lets you change an image based on
the funny little characters you type in the box at the bottom. I’ve vaguely heard of XSS, so
I know that I should escape the characters, so I copied the escaping rules from
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tera.netlify.app&quot;&gt;Tera&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Namely, replacing &lt;code&gt;&amp;amp;&lt;&#x2F;code&gt;, &lt;code&gt;&amp;lt;&lt;&#x2F;code&gt;, &lt;code&gt;&amp;gt;&lt;&#x2F;code&gt;, &lt;code&gt;&quot;&lt;&#x2F;code&gt;, &lt;code&gt;\``, and &lt;&#x2F;code&gt;&#x2F;` with their associated HTML entities.&lt;&#x2F;p&gt;
&lt;p&gt;Your task is to call &lt;code&gt;submitFlag&lt;&#x2F;code&gt; with the string value &lt;code&gt;&amp;lt;&amp;gt;&lt;&#x2F;code&gt;. If you succeed,
I will &lt;code&gt;alert&lt;&#x2F;code&gt; a fun message for you :)&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;View source is allowed but shouldn’t be needed, hopefully the text here is clear enough.&lt;&#x2F;p&gt;
&lt;p&gt;I’ll create a &lt;code&gt;&amp;lt;img src=&#x2F;img&#x2F;{user input}&amp;gt;&lt;&#x2F;code&gt; and stick it below :)&lt;&#x2F;p&gt;
&lt;div id=victim_box&gt;&lt;&#x2F;div&gt;
&lt;p&gt;The &lt;code&gt;img&lt;&#x2F;code&gt; that was created was&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code id=&quot;enteredText&quot;&gt;&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;You can type in this box:&lt;&#x2F;p&gt;
&lt;input type=text id=input_text value=&quot;favicon.png&quot;&gt;
&lt;p&gt;And then click &lt;button id=input_button&gt;This Button :)&lt;&#x2F;button&gt;&lt;&#x2F;p&gt;
&lt;script&gt;
function submitFlag(str) {
    if (str === &quot;&lt;&gt;&quot;) {
        alert(&quot;You won! Congratulations!&quot;)
    } else {
        alert(`This is not the fun message. You gave me ${str} instead.`)
    }
}

function setupPage() {
    const button = document.querySelector(&quot;#input_button&quot;);
    button.addEventListener(&quot;click&quot;, createImage);
    createImage();
}

function createImage(e) {
    const textBox = document.querySelector(&quot;#input_text&quot;);
    const text = textBox.value;
    const cleanedText = cleanText(text);
    const imageText = `&lt;img src=&#x2F;img&#x2F;${cleanedText}&gt;`;
    document.querySelector(&quot;#enteredText&quot;).innerText = imageText;
    document.querySelector(&quot;#victim_box&quot;).innerHTML = imageText;
}

function cleanText(text) {
    return text.replaceAll(&quot;&amp;&quot;, &quot;&amp;amp;&quot;)
               .replaceAll(&quot;&lt;&quot;, &quot;&amp;lt;&quot;)
               .replaceAll(&quot;&gt;&quot;, &quot;&amp;gt;&quot;)
               .replaceAll(&quot;\&quot;&quot;, &quot;&amp;quot;&quot;)
               .replaceAll(&quot;\`&quot;, &quot;&amp;#x27;&quot;)
               .replaceAll(&quot;&#x2F;&quot;, &quot;&amp;#x2F;&quot;);
}

setupPage();
&lt;&#x2F;script&gt;
</description>
      </item>
      
      
      <item>
          <title>Sensor noise art</title>
          <pubDate>Wed, 12 Jul 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/sensor-noise-art/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/sensor-noise-art/</guid>
          <description>&lt;p&gt;I was playing around with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.opencamera.org.uk&#x2F;&quot;&gt;Open Camera&lt;&#x2F;a&gt; with
a very long exposure (10 seconds), with a somewhat high ISO (3000ish), with my
camera placed against a flat object so it doesn’t see any outside light. This
is a great way of capturing sensor noise, though it does seem to be brighter
around the outside, and less in the middle. Light leakage? Or just how the
sensor works?&lt;&#x2F;p&gt;
&lt;p&gt;Anyways, I did that, and then played around with every nearly filter the stock
photos app on my phone had, which results in some neat wallpapers.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;As in &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;&quot;&gt;some pictures i took
today&lt;&#x2F;a&gt;, all images
in this post are licensed under &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;creativecommons.org&#x2F;licenses&#x2F;by-sa&#x2F;4.0&#x2F;&quot;&gt;CC BY-SA
4.0&lt;&#x2F;a&gt;. But honestly, go make
some yourself.&lt;&#x2F;p&gt;
&lt;p&gt;Also, click on the images to get full resolution copies. The sources are jpegs,
so I’m not going to choose violence today and mandate a good but hardly
supported format to view the full resolution copies.&lt;&#x2F;p&gt;
&lt;p&gt;Future work might be making multiple sets of images, tinting them differently,
then blending between them to make a pattern. Trans flag in noise, maybe?
I don’t really have a functioning computer at the moment, it just Fucking Dies
when I do anything vaguely intensive, so I can’t do that at the moment.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;purple_cave&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#purple_cave&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
purple_cave&lt;&#x2F;h2&gt;
&lt;p&gt;This is the first one I made. It made heavy use of the “magic eraser” tool to
give the blocks some structure.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;sensor-noise-art&#x2F;purple_cave.jpeg&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;sensor-noise-art&#x2F;purple_cave_preview.jpeg&quot; alt=&quot;A purple and blue image, with a darker part in the center, as if you’re peering into a crystal cave&quot; &#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;green_void&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#green_void&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
green_void&lt;&#x2F;h2&gt;
&lt;p&gt;The other one I made. It uses no magic eraser tool. You can really see the
bright spots in the void if you don’t get the computer to blur it all together
with the eraser. Though I did use sharpen to give it some texture. I use this
one as a lock screen wallpaper, with the clock centered inside the circle. It
works well :3&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;sensor-noise-art&#x2F;green_void.jpeg&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;sensor-noise-art&#x2F;green_void_preview.jpeg&quot; alt=&quot;A noisy image with a black circle in the center, with a green and blueish tint around it&quot; &#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Application Tokens - using tokens to not use passwords</title>
          <pubDate>Sun, 25 Jun 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/application-tokens/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/application-tokens/</guid>
          <description>&lt;p&gt;I was looking at &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;fabianonline&#x2F;matrix.sh&quot;&gt;a tool to send matrix messages from the
CLI&lt;&#x2F;a&gt;, and it got me thinking about
how we handle authentication for tools like this. I don’t &lt;em&gt;want&lt;&#x2F;em&gt; to give
everything my password, especially if it doesn’t need permissions to do
&lt;em&gt;literally everything&lt;&#x2F;em&gt; that I can do.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Instead, let’s have the ability to generate tokens that have a restricted
scope. github actually &lt;em&gt;does&lt;&#x2F;em&gt; do this, when you go to make a “personal access
token”. You can use that token in place of a password when doing operations.
But &lt;em&gt;everything&lt;&#x2F;em&gt; that has the concept of a login should have this, and make use
of it. Don’t make me register an app or do anything more than just generating
a token.&lt;&#x2F;p&gt;
&lt;p&gt;This isn’t meant to be a replacement for OAuth, which should be used by
“proper” applications. This is instead for small utilities that need to run and
do &lt;em&gt;something&lt;&#x2F;em&gt; to your account, but doesn’t need the ability to do
&lt;em&gt;everything&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;When you authenticate to a device with a username&#x2F;password, you’re given a root
token. This is what you store locally, and doesn’t leave your device.&lt;&#x2F;p&gt;
&lt;p&gt;Any token can create a subtoken, and revoking a token will revoke that token
and all subtokens it made. Subtokens can never have more permissions than the
token that created them.&lt;&#x2F;p&gt;
&lt;p&gt;If you want to authorise an application that only needs, say, write access in
a particular room, then you generate a token that does exactly that. The UX for
this in matrix could look like a list of rooms to apply to, and a list of allowed
actions, and the given action must fit &lt;em&gt;both&lt;&#x2F;em&gt;. For example, &lt;code&gt;create_message AND in:#522-notifications&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;For the purposes of bot notifications, you could attach a specific &lt;em&gt;name&lt;&#x2F;em&gt; to
the token, which is then used for the created messages. That way, you can see
what specifically posted the message, even though it would still be posted as
your account.&lt;&#x2F;p&gt;
&lt;p&gt;After making this token, you can hand it out to whatever service needs it, such
as your backup program so you can get notified when your backups finish or
errored. Because we know you won’t check that manually.&lt;&#x2F;p&gt;
&lt;p&gt;Another use case for restricted scope here is logging in on semi-untrusted
devices. If you can avoid actually entering your username&#x2F;password, by using
a phone or similar, you can make a token that doesn’t allow for more dangerous
actions like message creation, but instead just allows for message reads, and
is time limited for 1 hour.&lt;&#x2F;p&gt;
&lt;p&gt;Discord has a “log in with QR code” option, where the phone is logged in and is
granting permission to a desktop device. But how cool would it be if you could
log in under a restricted form if you just want to browse for a bit? Maybe
require re-authentication if you send a message, and then only allow sending
messages to that room. That would greatly mitigate the damage caused by hostile
devices. This would need to be a separate button on the &lt;em&gt;phone&lt;&#x2F;em&gt; end, since
otherwise the hostile device could just ignore it and log in anyways as a full
user, and then &lt;strong&gt;Free Nitro At &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;Qv6ip9d29g4&quot;&gt;Disc
Hoard.gg:Nitro@view-source.rawr&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;!--
oh hey you actually view-source&#x27;d :)

I was going to do a rickroll here, but that&#x27;s not all that funny anymore. I mean, it&#x27;s still kinda funny, but you would have expected it.

Besides, this is a banger. love tracey brakes
--&gt;
</description>
      </item>
      
      
      <item>
          <title>PoC Watermark Attack on Restic</title>
          <pubDate>Sat, 20 May 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/poc-watermark-attack/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/poc-watermark-attack/</guid>
          <description>&lt;p&gt;First off, does this matter to you? No. No it doesn’t. Unless you’re backing up
gigabytes of completely attacker controlled data, to an attacker controlled
service, and need to ensure they don’t &lt;em&gt;know&lt;&#x2F;em&gt; you’re backing up said data, it
Doesn’t Fucking Matter.&lt;&#x2F;p&gt;
&lt;p&gt;With that said, it’s a somewhat neat attack!&lt;&#x2F;p&gt;
&lt;p&gt;A &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Watermarking_attack&quot;&gt;watermarking attack&lt;&#x2F;a&gt; is
when an attacker who can get you to store an attacker-controlled piece of data
can then detect the presence of that attacker controlled data. It’s not
a &lt;em&gt;huge&lt;&#x2F;em&gt; deal, but is a concern if someone is able to inject a watermark into,
say, copywritten or leaked content, and then automatically terminate the cloud
storage&#x2F;backup accounts of users that can be shown to have that data on their drive.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;restic.net&#x2F;&quot;&gt;Restic&lt;&#x2F;a&gt; uses Content-Defined-Chunking with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rabin_fingerprint&quot;&gt;Rabin
Fingerprints&lt;&#x2F;a&gt; with a secret,
random polynomial in order to make watermarking attacks harder. (And, of
course, the repo is encrypted, otherwise this attack doesn’t make sense to try
to do, just read off the data directly).&lt;&#x2F;p&gt;
&lt;p&gt;This attack does not go after that. Instead, I simply repeat a given chunk of
data many times in a row. This means that Restic will tend to create chunks
that will have that size, or a multiple of it. Which means the attacker can use the size
of the chunks they’re forcing the user to create to encode data.&lt;&#x2F;p&gt;
&lt;p&gt;Anyways, this does &lt;em&gt;work&lt;&#x2F;em&gt;… just not very well :P&lt;&#x2F;p&gt;
&lt;p&gt;A transcript of running it is below. The &lt;code&gt;check.rs&lt;&#x2F;code&gt; tool only accesses what
metadata would be visible to an attacker without the password to an encrypted
repository, that being object sizes.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;running attacker file with tags 1000 1000 2000 2000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-rw-r--r-- 1 jess jess 801M May 19 23:10 attacker.bin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;open repository&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;repository e794b424 opened (version 2, compression level off)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;created new cache in &#x2F;home&#x2F;jess&#x2F;.cache&#x2F;restic&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;lock repository&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;no parent snapshot found, will read all files&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;load index files&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;start scan on [attacker.bin]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;start backup on [attacker.bin]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;scan finished in 0.224s: 1 files, 800.732 MiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Files:           1 new,     0 changed,     0 unmodified&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Dirs:            0 new,     0 changed,     0 unmodified&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Data Blobs:    528 new&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Tree Blobs:      1 new&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Added to the repository: 795.915 MiB (795.935 MiB stored)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;processed 1 files, 800.732 MiB in 0:04&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;snapshot b3f64a9e saved&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[src&#x2F;bin&#x2F;check.rs:22] &amp;amp;sz = [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    (&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        16777390,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        8,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    (&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        18045195,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        7,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    (&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        18034195,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        6,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;.&#x2F;check.sh  15.01s user 3.68s system 137% cpu 13.543 total&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And for reference, this was ran with
&lt;code&gt;restic 0.15.2 compiled with go1.20.3 on linux&#x2F;amd64&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;At the end, the first number is the file size, and the second number is how
many chunks of that size appeared.&lt;&#x2F;p&gt;
&lt;p&gt;Here, the attacker generated 800MB of data, and we can see 3 interesting sizes.
The two bottom ones are the real tags, the top one is noise. The attacker
generated chunks with the tags &lt;code&gt;1000&lt;&#x2F;code&gt; and &lt;code&gt;2000&lt;&#x2F;code&gt;, which are bytes added to the
base, so we would expect to see a multiple of that many bytes difference in
size between them. And we do, they’re 18MB large, but the difference is
11×1000=11000 bytes.&lt;&#x2F;p&gt;
&lt;p&gt;Compression doesn’t really affect the attack since the data being inserted is
random data, so Restic won’t try and compress it.&lt;&#x2F;p&gt;
&lt;p&gt;See &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;poc-watermark-attack&#x2F;watermark-attack.zip&quot;&gt;watermark-attack.zip&lt;&#x2F;a&gt; for the test files, under
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;creativecommons.org&#x2F;publicdomain&#x2F;zero&#x2F;1.0&#x2F;&quot;&gt;CC0&lt;&#x2F;a&gt;. It requires Rust,
but should work on any vaguely modern compiler. Or just rewrite the code in
whatever language you prefer, it’s very trivial.&lt;&#x2F;p&gt;
&lt;p&gt;Future research might include trying to automatically recover the fingerprint
polynomial so a watermark attack can be pulled off much more directly. That
would require interactivity, where you backup attacker controlled data
repeatedly.&lt;&#x2F;p&gt;
&lt;p&gt;What if you have webserver logs that you’re backing up, is that a viable attack
to confirm that &lt;code&gt;5snb.club&lt;&#x2F;code&gt;, or
&lt;code&gt;iykpqm7jiradoeezzkhj7c4b33g4hbgfwelht2evxxeicbpjy44c7ead.onion&lt;&#x2F;code&gt; is some
specific account on a online backup service? (Not that I keep logs anyways :P)&lt;&#x2F;p&gt;
&lt;p&gt;Mitigations might be to pad chunks as they’re created, though that comes with
a size cost. See &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2108.01753v1&quot;&gt;Optimally Hiding Object Sizes with Constrained
Padding&lt;&#x2F;a&gt;, perhaps. That wouldn’t be a hard
solution to the problem, but would make this harder to pull off.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Designing a usernameless chat system</title>
          <pubDate>Wed, 03 May 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/usernameless-chat/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/usernameless-chat/</guid>
          <description>&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;discord.com&#x2F;blog&#x2F;usernames&quot;&gt;Discord is removing username
discriminators&lt;&#x2F;a&gt;, which got me thinking
about usernames as a whole, and how to design a platform without them.&lt;&#x2F;p&gt;
&lt;p&gt;This post is written with discord in mind, but applies to basically any chat
platform.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;The only place where a user &lt;em&gt;needs&lt;&#x2F;em&gt; to interact with a username in discord is
when adding a user as a friend. And discord already has a form of invite links,
it just uses it to join servers rather than to invite users.&lt;&#x2F;p&gt;
&lt;p&gt;You could nuke usernames entirely. Users still have a unique identifier as
normal, but that’s internal-only and not intended for use by anyone but discord
and bots. Making user IDs private would be a good idea, but not the focus here.
And have a &lt;em&gt;display name&lt;&#x2F;em&gt; which doesn’t have to be unique.&lt;&#x2F;p&gt;
&lt;p&gt;Now that usernames are gone, you need to have &lt;em&gt;some&lt;&#x2F;em&gt; way to add users. So
introduce friend codes.&lt;&#x2F;p&gt;
&lt;p&gt;Friend codes act much like invite links to servers, in that they’re random
codes that last for a specified length of time and uses, both of which can be
infinite.&lt;&#x2F;p&gt;
&lt;p&gt;Codes should be human readable, writable, and memorable. &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;xkcd.com&#x2F;936&#x2F;&quot;&gt;People are shit with
random letters&lt;&#x2F;a&gt;, so instead make them words. 3 random
words from a wordlist of 10000 gives you 10000³ possible codes, which is enough
for 500 million users to have 2000 codes each. Therefore, a code would look
like &lt;code&gt;crude holders temp&lt;&#x2F;code&gt;. You may also wish to use a wordlist that can correct
for typos, and autocorrect on entry.&lt;&#x2F;p&gt;
&lt;p&gt;Codes should also be able to be in the user’s native language. This not only
means people aren’t forced to memorise codes in English when they don’t speak
it, but it also helps lower the usage of any specific wordlist, allowing more
common words to be used.&lt;&#x2F;p&gt;
&lt;p&gt;The number of words in the wordlist doesn’t have to be fixed upfront, and can
be changed on the fly. Shorter and more common words can be used for longer
term codes, while longer words are used for temporary codes.&lt;&#x2F;p&gt;
&lt;p&gt;The use case of “I want someone to add me but I don’t have my phone with me”
would be handled by encouraging generation of one permanent invite code.
Depending on how many users use your system, this &lt;em&gt;could&lt;&#x2F;em&gt; be shortened to
2 words (100 million total codes with a wordlist of 10000). This is the closest
thing to a username that this system would have, but is both not user
selectable, and entirely optional. You would need to memorise the code, but in
the current system you need to memorise your discriminator anyways, so no major
difference. You can also very easily replace that invite code without affecting
any other invite links, if it is being used to spam you.&lt;&#x2F;p&gt;
&lt;p&gt;Give the ability to give a name to codes, so you can have codes tied to
a specific &lt;em&gt;platform&lt;&#x2F;em&gt; you put the code on. When you get a friend request,
you’re told &lt;em&gt;where&lt;&#x2F;em&gt; the user got your code from, and you’re given the chance to
revoke that code easily.&lt;&#x2F;p&gt;
&lt;p&gt;This change would mean that for &lt;em&gt;every&lt;&#x2F;em&gt; friend request you get, you’re able to
know where it came from, and are given the ability to revoke it. You can also
add a friend based on seeing a message from a user and clicking “Add Friend”.
You should have the ability to be told &lt;em&gt;which&lt;&#x2F;em&gt; server the user added you from,
and have the ability to block friend requests from that server.&lt;&#x2F;p&gt;
&lt;p&gt;If you have adding friend requests from servers disabled, and have no active
invite links, there is no way for anyone to add you as a friend.&lt;&#x2F;p&gt;
&lt;p&gt;The above system both fixes issues with username squatting, and helps deal with
spam issues where you can be told &lt;em&gt;where&lt;&#x2F;em&gt; someone added you from. No more
message requests with Funny Images or death threats from randos. Or, at least,
you can know &lt;em&gt;how&lt;&#x2F;em&gt; they know you.&lt;&#x2F;p&gt;
&lt;p&gt;This also works for federated systems, but you would need to add a server name to
the invite codes, so codes would look like &lt;code&gt;chat.5snb.club&#x2F;sims bank tough&lt;&#x2F;code&gt;.
Bikeshed if you want a &lt;code&gt;-&lt;&#x2F;code&gt; instead of space there. And federated systems would
likely use shorter codes because less users per server.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Your machine isn&#x27;t turing complete, so why are you mentioning the halting problem?</title>
          <pubDate>Mon, 01 May 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/your-machine-is-not-turing-complete/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/your-machine-is-not-turing-complete/</guid>
          <description>&lt;p&gt;Sometimes I will be part of exchanges such as:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Me&lt;&#x2F;em&gt;: It would be cool if you could prove the lack of stack overflows in code!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Someone&lt;&#x2F;em&gt;: Proving that code will not stack overflow is the same as solving the halting problem though.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Which is very much &lt;em&gt;true&lt;&#x2F;em&gt;, if you demand no false positives. But rather
pointless. It’s being overly pedantic as a way of (intentionally or otherwise)
being dismissive about useful feature ideas.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;For a system to be Turing Complete, it needs to be able to emulate a Turing
Machine, which has a tape of &lt;em&gt;infinite&lt;&#x2F;em&gt; length. Your system does not have
infinite RAM, therefore it’s not Turing Complete.&lt;&#x2F;p&gt;
&lt;p&gt;This is, of course, &lt;em&gt;entirely besides the point&lt;&#x2F;em&gt;, since we can do useful work
on a system with limited RAM, we just can’t do &lt;em&gt;all&lt;&#x2F;em&gt; the possible work. Just
like we can do useful analysis on &lt;em&gt;some&lt;&#x2F;em&gt; functions, we just can’t do that
analysis for &lt;em&gt;all&lt;&#x2F;em&gt; functions. It’s okay to say “I don’t know for sure that this
is okay, so I’m going to make it a compile error”.&lt;&#x2F;p&gt;
&lt;p&gt;There’s lots of analysis that falls into this category. Writing a type checker,
or borrow checker, that rejects all bad code &lt;em&gt;and accepts all good code&lt;&#x2F;em&gt; is
equal to solving the halting problem, but no one throws “But Halting Problem”
at them. Because they’re allowed to say “I don’t know for sure that this is
okay, so I’m going to halt compilation”.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; program_halts&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let mut&lt;&#x2F;span&gt;&lt;span&gt; x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 42&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;mem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;swap&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; x,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; x);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Rust will say that this code is an error. Which might be wrong, if
&lt;code&gt;program_halts&lt;&#x2F;code&gt; ends up being &lt;code&gt;false&lt;&#x2F;code&gt; always, that code is &lt;em&gt;not&lt;&#x2F;em&gt; UB if you were
to force it to compile anyways.&lt;&#x2F;p&gt;
&lt;p&gt;Also, given a deterministic system with finite amounts of state, you’re able
to tell for sure if it will halt or infinitely loop, assuming you have
a machine with twice as much state. Just treat it as a graph cycle detection
problem.&lt;&#x2F;p&gt;
&lt;p&gt;Some sample code displays that point:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[derive(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Clone&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; PartialEq&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Eq&lt;&#x2F;span&gt;&lt;span&gt;)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Machine&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    instruction_pointer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ram&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;static&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Instruction&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Machine&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F;&#x2F; Executes a single step in the machine.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F;&#x2F; Any steps done after the machine has halted are no-ops and safely ignored.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; step&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F;&#x2F; Returns true if the machine has halted.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; halted&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; bool&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; halts&lt;&#x2F;span&gt;&lt;span&gt;(machine&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Machine&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; bool&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; tortoise&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; machine&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;clone&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    tortoise&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;step&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; hare&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; machine&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;clone&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    hare&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;step&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    hare&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;step&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    loop&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; hare&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;halted&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; If they&amp;#39;re equal, then that means there is a cycle somewhere&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; Which means the machine will always be in that cycle, and will not halt.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; hare&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span&gt; tortoise {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        tortoise&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;step&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        hare&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;step&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        hare&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;step&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is some fairly simple cycle detection code, if you just think of the
machines as nodes in a linked list.&lt;&#x2F;p&gt;
&lt;p&gt;You can’t use this to find cycles in all Turing Machines, because those use
&lt;em&gt;infinite&lt;&#x2F;em&gt; state to begin with. But for programs that access a finite amount of
RAM, it definitely will work. Eventually.&lt;&#x2F;p&gt;
&lt;p&gt;You’re allowed to have false positives in analysis, which makes you not fall
under the halting problem issue.&lt;&#x2F;p&gt;
&lt;p&gt;So stop mentioning the halting problem. That’s just namedropping some computer
science problem, and is equal to telling a developer of a route planning
application that they should not bother, because travelling salesman is
NP-Hard.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>some pictures i took today</title>
          <pubDate>Tue, 18 Apr 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/some-pictures-i-took-today/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/some-pictures-i-took-today/</guid>
          <description>&lt;p&gt;I was going into town today, and took the chance to take some pictures.&lt;&#x2F;p&gt;
&lt;p&gt;You can click them to open them as a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;jpegxl.info&#x2F;&quot;&gt;JPEG XL&lt;&#x2F;a&gt; for the
original size and higher quality. If your browser doesn’t support JPEG XL, try
opening it in &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;libjxl&#x2F;libjxl&#x2F;blob&#x2F;3f0ff3e75bfcce5f8da7391788cae3ed0d63e252&#x2F;doc&#x2F;software_support.md&quot;&gt;something that
does.&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This was my first time using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.darktable.org&#x2F;&quot;&gt;darktable&lt;&#x2F;a&gt;. I don’t
know what I’m doing in it, but at least I managed to nicely censor out the
license plates.&lt;&#x2F;p&gt;
&lt;p&gt;(also, these were taken on the 17th, but i’ve not slept since for it is nearly
1AM, so i still consider that today)&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;I license all 5 of the below images (preview and full size &lt;code&gt;.jxl&lt;&#x2F;code&gt; for each)
under &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;creativecommons.org&#x2F;licenses&#x2F;by-sa&#x2F;4.0&#x2F;&quot;&gt;CC BY-SA 4.0&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;abandoned-bear.jxl&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;abandoned-bear.jpeg&quot; alt=&quot;A large stuffed bear toy lying in a bike&quot; &#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;branch.jxl&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;branch.jpeg&quot; alt=&quot;A close up tree branch with white flowers, with another tree out of focus in the background&quot; &#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;small-flowers.jxl&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;small-flowers.jpeg&quot; alt=&quot;A low down shot of some small white flowers growing in some grass, with a brick wall in the background&quot; &#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;yellow-flowers.jxl&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;yellow-flowers.jpeg&quot; alt=&quot;Looking down on a cluster of yellow flowers on a tree branch&quot; &#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;glare.jxl&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;some-pictures-i-took-today&#x2F;glare.jpeg&quot; alt=&quot;Looking directly at a low-down sun shining through some trees, with some camera glare&quot; &#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Video Streaming Over Dialup</title>
          <pubDate>Fri, 31 Mar 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/video-streaming-over-dialup/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/video-streaming-over-dialup/</guid>
          <description>&lt;p&gt;Assuming modern codecs and computing power, could we have video sharing sites
over a dialup connection and have it be watchable?&lt;&#x2F;p&gt;
&lt;p&gt;Turns out, yes! Kinda!&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;I’m defining dialup as “50 kilobits per second”, or 6250 bytes per second. I am
but a 23 year old who has never actually used it, so I’m going off &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dial-up_Internet_access&quot;&gt;Some Site
I Found&lt;&#x2F;a&gt; to tell me that
50 kilobits is an achievable, if optimistic, speed.&lt;&#x2F;p&gt;
&lt;p&gt;The only way we have a hope of pulling this off is if we choose modern codecs
that are good at sounding Not Terrible at Very Low bitrates.&lt;&#x2F;p&gt;
&lt;p&gt;So let’s do opus and AV1. AV1 might be worse than h265 at very low bitrate,
I don’t know, and I’m not testing it because fuck software patents.&lt;&#x2F;p&gt;
&lt;p&gt;Since I’m using AV1, if you’re on a browser that doesn’t support that, it will
not work and you can go get a better browser.&lt;&#x2F;p&gt;
&lt;p&gt;(Also, if things don’t seem to work at first, try refreshing, I’ve noticed that helps. Not sure what causes it, sorry!)&lt;&#x2F;p&gt;
&lt;p&gt;If you’re on Firefox Mobile, then you can set
&lt;code&gt;media.av1.enabled&lt;&#x2F;code&gt; in &lt;code&gt;about:config&lt;&#x2F;code&gt;, and if you’re on Edge, apparently
there’s &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;apps.microsoft.com&#x2F;store&#x2F;detail&#x2F;av1-video-extension&#x2F;9MVZQVXJBQ9V&quot;&gt;an AV1 Video Extension on
apps.microsoft.com&lt;&#x2F;a&gt;.
I’ve not tested that though.&lt;&#x2F;p&gt;
&lt;p&gt;I’ll provide a mp4 encode of the final video though, but it of course won’t be
50kbit&#x2F;s.&lt;&#x2F;p&gt;
&lt;p&gt;All audio and video content below is from &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_5ucImqdKbY&quot;&gt;A CD-R, that’s only partly a CD-R
[Ricoh Encryptease]&lt;&#x2F;a&gt; by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@CathodeRayDude&quot;&gt;Cathode
Ray Dude&lt;&#x2F;a&gt;, licensed under Creative
Commons Attribution 4.0 (as seen in the end of the video). All changes made are
purely encoding using opus&#x2F;AV1 and taking the first segment of the video.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;audio&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#audio&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
First off, the easy bit. Audio.&lt;&#x2F;h2&gt;
&lt;p&gt;Audio, we only really have one knob to turn, and that’s the bitrate.&lt;&#x2F;p&gt;
&lt;p&gt;Below I have encoded audio using a variety of bitrates, from 4k to 16k.&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Bitrate&lt;&#x2F;th&gt;&lt;th&gt;Audio&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;4k&lt;&#x2F;td&gt;&lt;td&gt;&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;video-streaming-over-dialup&#x2F;4k.opus&quot; type=&quot;audio&amp;#x2F;ogg&quot;&gt;
The audio tag is not supported on your browser.
&lt;&#x2F;audio&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;6k&lt;&#x2F;td&gt;&lt;td&gt;&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;video-streaming-over-dialup&#x2F;6k.opus&quot; type=&quot;audio&amp;#x2F;ogg&quot;&gt;
The audio tag is not supported on your browser.
&lt;&#x2F;audio&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;8k&lt;&#x2F;td&gt;&lt;td&gt;&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;video-streaming-over-dialup&#x2F;8k.opus&quot; type=&quot;audio&amp;#x2F;ogg&quot;&gt;
The audio tag is not supported on your browser.
&lt;&#x2F;audio&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;10k&lt;&#x2F;td&gt;&lt;td&gt;&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;video-streaming-over-dialup&#x2F;10k.opus&quot; type=&quot;audio&amp;#x2F;ogg&quot;&gt;
The audio tag is not supported on your browser.
&lt;&#x2F;audio&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;12k&lt;&#x2F;td&gt;&lt;td&gt;&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;video-streaming-over-dialup&#x2F;12k.opus&quot; type=&quot;audio&amp;#x2F;ogg&quot;&gt;
The audio tag is not supported on your browser.
&lt;&#x2F;audio&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;14k&lt;&#x2F;td&gt;&lt;td&gt;&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;video-streaming-over-dialup&#x2F;14k.opus&quot; type=&quot;audio&amp;#x2F;ogg&quot;&gt;
The audio tag is not supported on your browser.
&lt;&#x2F;audio&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;16k&lt;&#x2F;td&gt;&lt;td&gt;&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;posts&#x2F;2023&#x2F;video-streaming-over-dialup&#x2F;16k.opus&quot; type=&quot;audio&amp;#x2F;ogg&quot;&gt;
The audio tag is not supported on your browser.
&lt;&#x2F;audio&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;This is a subjective thing, but to my ears, 12k is the best mix of quality and
not being Awful to listen to.&lt;&#x2F;p&gt;
&lt;p&gt;Note that audio is more important than video. Bad quality audio is &lt;em&gt;grating&lt;&#x2F;em&gt; to
listen to, but bad quality video is generally merely annoying. So I’m picking
the highest quality audio that we can afford, bitrate-wise.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;video&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#video&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Now time to pick video settings.&lt;&#x2F;h2&gt;
&lt;p&gt;There’s 3 settings we can experiment with, the resolution, frame rate, and
quality. We’ll be setting them in that order.&lt;&#x2F;p&gt;
&lt;p&gt;Resolution, the only viable resolutions are from 480p to 240p. Let’s check out
how the various resolutions affect how the video looks.&lt;&#x2F;p&gt;
&lt;p&gt;Also, I’ll be using a FPS of 30, and a CRF of 50. This is not the final
settings we’ll be choosing later on, but it’s fine for now, and we have to pick
&lt;em&gt;something&lt;&#x2F;em&gt;. Also, the audio track will be our 12kbit opus that we chose above.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;resolution&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#resolution&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Resolution&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;480p (854x480)&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;res-480p.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=res-480p.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;360p (640x360)&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;res-360p.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=res-360p.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;240p (426x240)&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;res-240p.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=res-240p.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;I think 240p here is Good Enough, especially since it allows us to use 30fps
for smoother motion. I tried 360p at 15fps, and it looked shit.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;frame_rates&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#frame_rates&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Frame Rates&lt;&#x2F;h3&gt;
&lt;p&gt;Speaking of, let’s explore how different frame rates look. I’ll use our 240p
video, again with a CRF of 50, and emit 60fps, 30fps, 15fps.&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;60fps&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;fps-60.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=fps-60.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;30fps&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;fps-30.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=fps-30.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;15fps&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;fps-15.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=fps-15.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;I think 30fps is good, and we can &lt;em&gt;just about&lt;&#x2F;em&gt; afford the bitrate since we went
with 240p.&lt;&#x2F;p&gt;
&lt;p&gt;Though 15fps at 360p is also an option.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;quality&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#quality&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Quality&lt;&#x2F;h3&gt;
&lt;p&gt;I’m going to be using &lt;abbr&gt;CRF&lt;&#x2F;abbr&gt; (Constant
Rate Factor) to adjust the quality, and since we need a very low bitrate, it
will be quite high.&lt;&#x2F;p&gt;
&lt;p&gt;We’ve locked down our resolution (240p) and our frame rate (30fps), and since
we have a target to hit, there’s only really one correct answer. (Spoiler, it’s
56).&lt;&#x2F;p&gt;
&lt;p&gt;But let’s experiment with other qualities, why not? The lowest quality you can
set is 63, and I’ll go up to multiples of 5 from there.&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;CRF 63&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;crf-63.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=crf-63.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;CRF 60&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;crf-60.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=crf-60.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;CRF 55&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;crf-55.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=crf-55.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;CRF 50&lt;&#x2F;td&gt;&lt;td&gt;&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;crf-50.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=crf-50.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;The process of figuring out what CRF makes the video fit is a process of binary
search, just trying different CRFs until one barely fits.&lt;&#x2F;p&gt;
&lt;p&gt;Now finally time for The Final Encode. The one we’ve all been waiting for :3&lt;&#x2F;p&gt;
&lt;p&gt;It’s rather much the same as the tests above, only with &lt;code&gt;-g 225&lt;&#x2F;code&gt; (to increase
the time between keyframes to something larger to help compression, but hurt
seeking performance), and &lt;code&gt;-preset 2&lt;&#x2F;code&gt; (to increase the amount of time spent
encoding to have a better quality output).&lt;&#x2F;p&gt;
&lt;p&gt;The below video, in its entirety, takes up 374 989 bytes. Which is less
than 50 kilobits*60=375 000 bytes.&lt;&#x2F;p&gt;
&lt;video style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;final.webm&quot; type=&quot;video&amp;#x2F;webm&quot;&gt;
Download the video at &lt;a href=final.webm&gt;this url&lt;&#x2F;a&gt;
&lt;&#x2F;video&gt;
&lt;p&gt;And if the above is unwatchable because you have a bad browser that doesn’t
support AV1, you can &lt;a href=&quot;final.mp4&quot;&gt;watch it here instead.&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;wrapping_up&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#wrapping_up&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
wrapping up&lt;&#x2F;h2&gt;
&lt;p&gt;So, is this watchable? maybe.&lt;&#x2F;p&gt;
&lt;p&gt;Up to you to judge, really. Definitely not as good as TV, but maybe Acceptable.
So if we were somehow stuck with 50kbit internet connections, but otherwise
modern systems, you could stream video… and nothing else at the same time.&lt;&#x2F;p&gt;
&lt;p&gt;Also, I’m aware that simply &lt;em&gt;averaging&lt;&#x2F;em&gt; 50kbit overall doesn’t mean the file is
actually watchable live at 50kbit, since you may have periods of more than
50kbit. However, with my tests using &lt;code&gt;pv -L 6250 final.webm | mpv -&lt;&#x2F;code&gt;, the
buffering is largely a non-issue, it would be fine.&lt;&#x2F;p&gt;
&lt;p&gt;For reproducibility, the script I used to generate these files is&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;#!&#x2F;bin&#x2F;bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;youtube-dl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_5ucImqdKbY&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 299+251&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; input.mkv&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; input.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 00:01:00 1min.mkv&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 4k 4k.opus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 6k 6k.opus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 8k 8k.opus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 10k 10k.opus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k 12k.opus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 14k 14k.opus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 16k 16k.opus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=854:480,fps=30&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k res-480p.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=640:360,fps=30&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k res-360p.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=426:240,fps=30&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k res-240p.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=426:240,fps=60&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k fps-60.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=426:240,fps=30&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k fps-30.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=426:240,fps=15&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k fps-15.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=426:240,fps=30&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 63&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k crf-63.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=426:240,fps=30&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 60&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k crf-60.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=426:240,fps=30&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 55&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k crf-55.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=426:240,fps=30&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libopus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -b:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k crf-50.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 1min.mkv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -g&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 225&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -vf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;scale=426:240,fps=30&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -preset&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -crf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 56&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; libsvtav1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -an&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; output.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; 12k.opus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; output.webm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; copy&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -c:v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; copy final.webm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;with ffmpeg version&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# ffmpeg -version          &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;built with gcc 12.2.1 (GCC) 20230201&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;configuration: --prefix=&#x2F;usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;libavutil      57. 28.100 &#x2F; 57. 28.100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;libavcodec     59. 37.100 &#x2F; 59. 37.100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;libavformat    59. 27.100 &#x2F; 59. 27.100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;libavdevice    59.  7.100 &#x2F; 59.  7.100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;libavfilter     8. 44.100 &#x2F;  8. 44.100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;libswscale      6.  7.100 &#x2F;  6.  7.100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;libswresample   4.  7.100 &#x2F;  4.  7.100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;libpostproc    56.  6.100 &#x2F; 56.  6.100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</description>
      </item>
      
      
      <item>
          <title>zsh and the search for .circleci</title>
          <pubDate>Tue, 28 Feb 2023 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2023/zsh-and-the-search-for-circleci/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2023/02/28/zsh-and-the-search-for-circleci.html</guid>
          <description>&lt;p&gt;I was using my shell one day, and hit tab on a &lt;code&gt;.&lt;&#x2F;code&gt; and ended up with&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;~&lt;&#x2F;span&gt;
&lt;span class=blue&gt;#&lt;&#x2F;span&gt; .&lt;span class=lblack&gt;&lt;span class=cursor&gt;c&lt;&#x2F;span&gt;ircleci&lt;&#x2F;span&gt;
----------Completing &lt;span class=cyan&gt;external command&lt;&#x2F;span&gt;----------
.circleci    .emscripten  .github
----------Completing &lt;span class=cyan&gt;builtin command&lt;&#x2F;span&gt;----------
.
&lt;&#x2F;pre&gt;
&lt;p&gt;what the fuck? why do i have &lt;code&gt;.circleci&lt;&#x2F;code&gt; as a command?&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Well, okay. Can we see where the file is?&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;~&lt;&#x2F;span&gt;
&lt;span class=blue&gt;#&lt;&#x2F;span&gt; &lt;span class=green&gt;which&lt;&#x2F;span&gt; .circleci   
.circleci not found
&lt;&#x2F;pre&gt;
&lt;p&gt;Guess not.&lt;&#x2F;p&gt;
&lt;p&gt;A quick &lt;code&gt;find | grep \.circleci&lt;&#x2F;code&gt; shows that .circleci files &lt;em&gt;exist&lt;&#x2F;em&gt; on my drive. They seem to be
fairly common, and generally show up in project directories. But that’s nothing to be concerned
about.&lt;&#x2F;p&gt;
&lt;p&gt;And there’s one instance of .emscripten, in my home directory. It’s what looks to be a python
script to configure emscripten. But that wouldn’t cause it to show up, since it’s not in my
&lt;code&gt;$PATH&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;hash&lt;&#x2F;code&gt; builtin command exists, which can tell us exactly where things are coming from.&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;~&lt;&#x2F;span&gt;
&lt;span class=blue&gt;#&lt;&#x2F;span&gt; &lt;span class=green&gt;hash&lt;&#x2F;span&gt; | &lt;span class=green&gt;grep&lt;&#x2F;span&gt; -E &lt;span class=yellow&gt;&quot;&lt;&#x2F;span&gt;&lt;span class=blue&gt;(&lt;&#x2F;span&gt;&lt;span class=yellow&gt;circleci|github|\.emscripten&lt;&#x2F;span&gt;&lt;span class=blue&gt;)&lt;&#x2F;span&gt;&lt;span class=yellow&gt;&quot;&lt;&#x2F;span&gt;
.&lt;span class=&quot;red b&quot;&gt;circleci&lt;&#x2F;span&gt;=&#x2F;usr&#x2F;lib&#x2F;emscripten&#x2F;.&lt;span class=&quot;red b&quot;&gt;circleci&lt;&#x2F;span&gt;
&lt;span class=&quot;red b&quot;&gt;.emscripten&lt;&#x2F;span&gt;=&#x2F;usr&#x2F;lib&#x2F;emscripten&#x2F;&lt;span class=&quot;red b&quot;&gt;.emscripten&lt;&#x2F;span&gt;
.&lt;span class=&quot;red b&quot;&gt;github&lt;&#x2F;span&gt;=&#x2F;usr&#x2F;lib&#x2F;emscripten&#x2F;.&lt;span class=&quot;red b&quot;&gt;github&lt;&#x2F;span&gt;
&lt;&#x2F;pre&gt;
&lt;p&gt;Huh. Why’s that in my &lt;code&gt;$PATH&lt;&#x2F;code&gt;?&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;~&lt;&#x2F;span&gt;
&lt;span class=&quot;blue&quot;&gt;#&lt;&#x2F;span&gt; &lt;span class=green&gt;echo&lt;&#x2F;span&gt; &lt;span class=yellow&gt;&quot;&lt;&#x2F;span&gt;&lt;span class=cyan&gt;$PATH&lt;&#x2F;span&gt;&lt;span class=yellow&gt;&quot;&lt;&#x2F;span&gt; | tr &quot;:&quot; &quot;\n&quot; | grep &quot;&#x2F;usr&#x2F;lib&#x2F;emscripten&quot;
&#x2F;usr&#x2F;lib&#x2F;emscripten
&lt;&#x2F;pre&gt;
&lt;p&gt;Looks like the whole &lt;code&gt;&#x2F;usr&#x2F;lib&#x2F;emscripten&lt;&#x2F;code&gt; is in my &lt;code&gt;$PATH&lt;&#x2F;code&gt;, which would lead to every file inside
it being “executable” by typing it in. &lt;code&gt;zsh&lt;&#x2F;code&gt; doesn’t seem to filter out non-executable files from the auto
completion.&lt;&#x2F;p&gt;
&lt;p&gt;Sure enough, if I try and execute &lt;code&gt;AUTHORS&lt;&#x2F;code&gt;, which exists in that directory…&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;~&lt;&#x2F;span&gt;
&lt;span class=&quot;blue&quot;&gt;#&lt;&#x2F;span&gt; &lt;span class=green&gt;AUTHORS&lt;&#x2F;span&gt;
zsh: permission denied: AUTHORS
&lt;&#x2F;pre&gt;
&lt;p&gt;Now to find out &lt;em&gt;what&lt;&#x2F;em&gt; is adding that to my &lt;code&gt;$PATH&lt;&#x2F;code&gt;.  It’s not coming from &lt;code&gt;&#x2F;etc&#x2F;profile&lt;&#x2F;code&gt; or my
&lt;code&gt;.zshrc&lt;&#x2F;code&gt;, I know that much.&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;~&lt;&#x2F;span&gt;
# cat &#x2F;etc&#x2F;profile | grep em

&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;~&lt;&#x2F;span&gt;&lt;span class=red&gt;[1]&lt;&#x2F;span&gt;
# &lt;span class=cursor&gt; &lt;&#x2F;span&gt;
&lt;&#x2F;pre&gt;
&lt;p&gt;But looking at &lt;code&gt;&#x2F;etc&#x2F;profile&lt;&#x2F;code&gt;, it’s mainly just code to source things from the &lt;em&gt;actual&lt;&#x2F;em&gt; profile, in
&lt;code&gt;&#x2F;etc&#x2F;profile.d&lt;&#x2F;code&gt;. This way multiple packages can ask for things to be put in it.&lt;&#x2F;p&gt;
&lt;p&gt;Well, let’s check out there.&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;~&lt;&#x2F;span&gt;
# cd &#x2F;etc&#x2F;profile.d 
binaryen.sh    gawk.sh  locale.sh           perlbin.sh
emscripten.sh  gpm.sh   mozilla-common.csh  vte.csh
freetype2.sh   jre.csh  mozilla-common.sh   vte.sh
gawk.csh       jre.sh   perlbin.csh         
&lt;&#x2F;pre&gt;
&lt;p&gt;Ah. well. What’s in &lt;code&gt;emscripten.sh&lt;&#x2F;code&gt;?&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;&#x2F;etc&#x2F;profile.d&lt;&#x2F;span&gt;
&lt;span class=blue&gt;#&lt;&#x2F;span&gt; &lt;span class=green&gt;cat&lt;&#x2F;span&gt; emscripten.sh
#!&#x2F;bin&#x2F;sh
export PATH=$PATH:&#x2F;usr&#x2F;lib&#x2F;emscripten
&lt;&#x2F;pre&gt;
&lt;p&gt;Well. We found it.&lt;&#x2F;p&gt;
&lt;p&gt;How did I go about fixing it?&lt;&#x2F;p&gt;
&lt;pre class=xreslondontubedark&gt;
&lt;span class=cyan&gt;jess&lt;&#x2F;span&gt;@&lt;span class=red&gt;neon&lt;&#x2F;span&gt; &lt;span class=yellow&gt;~&lt;&#x2F;span&gt;
&lt;span class=blue&gt;#&lt;&#x2F;span&gt; &lt;span class=green&gt;pacman&lt;&#x2F;span&gt; -Rs emscripten      
[sudo] password for jess: 
checking dependencies...

Packages (3) acorn-1:7.4.0-1  binaryen-1:96-1  emscripten-2.0.0-1

Total Removed Size:  464.32 MiB

:: Do you want to remove these packages? [Y&#x2F;n] y
:: Processing package changes...
(1&#x2F;3) removing emscripten           [######################] 100%
(2&#x2F;3) removing binaryen             [######################] 100%
(3&#x2F;3) removing acorn                [######################] 100%
:: Running post-transaction hooks...
(1&#x2F;1) Arming ConditionNeedsUpdate...
&lt;&#x2F;pre&gt;
&lt;p&gt;I didn’t really need emscripten to be installed, and that was a good prompt to just remove it.&lt;&#x2F;p&gt;
&lt;p&gt;Alternative solutions would be to actually file a bug report asking a more selective directory to
be put into the &lt;code&gt;$PATH&lt;&#x2F;code&gt;, or to remove the directory from your &lt;code&gt;$PATH&lt;&#x2F;code&gt; and make a new directory
containing symlinks to &lt;em&gt;just&lt;&#x2F;em&gt; the executables, and add that to your &lt;code&gt;$PATH&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Xonotic now-playing MPD script</title>
          <pubDate>Sun, 27 Nov 2022 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2022/xonotic-now-playing/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2022/11/27/xonotic-now-playing.html</guid>
          <description>&lt;p&gt;First off, the script:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xon_mpc_artist&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;mpc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; status&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;%artist%&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;s&#x2F;;&#x2F;;&#x2F;g&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;s&#x2F;\^&#x2F;^^&#x2F;g&amp;#39;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xon_mpc_title&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;mpc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; status&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;%title%&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;s&#x2F;;&#x2F;;&#x2F;g&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;s&#x2F;\^&#x2F;^^&#x2F;g&amp;#39;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;xon_mpc_album&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;mpc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; status&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;%album%&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;s&#x2F;;&#x2F;;&#x2F;g&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;s&#x2F;\^&#x2F;^^&#x2F;g&amp;#39;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$playing&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt; ]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;say &#x2F;me ^8np^7 ^x6b6&lt;&#x2F;span&gt;&lt;span&gt;$xon_mpc_artist&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; ^xa44$&lt;&#x2F;span&gt;&lt;span&gt;{xon_mpc_title&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt;60}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; ^x345&lt;&#x2F;span&gt;&lt;span&gt;$xon_mpc_album&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -n1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&#x2F;.local&#x2F;share&#x2F;xonotic&#x2F;.xonotic&#x2F;data&#x2F;np.cfg&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&#x2F;.local&#x2F;share&#x2F;xonotic&#x2F;.xonotic&#x2F;data&#x2F;np.cfg&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And on the xonotic side, it’s just &lt;code&gt;bind n &quot;exec np.cfg&quot;&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;A now-playing script just lets you press a button in-game and broadcast whatever track you’re
currently playing in chat.&lt;&#x2F;p&gt;
&lt;p&gt;My general strategy for a now-playing is to write a command to a file every time the current song
changes, and then, in-game, bind a key to just execute that file as commands.&lt;&#x2F;p&gt;
&lt;p&gt;I use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;vivien&#x2F;i3blocks&quot;&gt;&lt;code&gt;i3blocks&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; as a i3 status bar, which runs every time
there’s a status change on my songs (it uses &lt;code&gt;mpc idle&lt;&#x2F;code&gt; at the top). That’s a convenient place to
run this code, but as long as it runs often enough to not be out of date, it doesn’t really matter
how you run this. It’s not particularly perf sensitive, as it won’t be making any network calls in
the way a last.fm based script would be.&lt;&#x2F;p&gt;
&lt;p&gt;Then it’s just a matter of correctly formatting the track and escaping the special characters.  I
want to use &lt;code&gt;&#x2F;me&lt;&#x2F;code&gt; here for better formatting, which means I can’t quote anything, quotes are
treated literally. But replacing semicolon with a greek question mark works Well Enough for me.&lt;&#x2F;p&gt;
&lt;p&gt;It looks like this:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;xonotic-np&#x2F;chat-screenshot.png&quot; alt=&quot;*5225225(happy) np Namii Let’s All Love Namii Don’t Let The Dark In.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The structure is “np” to indicate it’s a now-playing message, then the artist (&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;ayonamii.bandcamp.com&#x2F;&quot;&gt;Namii&lt;&#x2F;a&gt;) in green, the
track name (Let’s All Love Namii) in red, and finally the album (Don’t Let The Dark In.) in a
bluish grey.&lt;&#x2F;p&gt;
&lt;p&gt;I use colors here instead of dashes to keep the length down, being mindful trying to not be spammy.
Same reason I will truncate the track title if it’s too long.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Reverse Image Search</title>
          <pubDate>Sun, 01 Aug 2021 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2021/reverse-image-search/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2021/08/01/reverse-image-search.html</guid>
          <description>&lt;p&gt;Many times have I come across an image with no source given, and no signature
visible, or someone else is asking where a particular image comes from. I’m
writing this in the hopes that next time you post an image you found without
a source, you spend the 5 minutes it takes to at least &lt;em&gt;look&lt;&#x2F;em&gt; to see where it
came from.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;There’s three main sources I use for image searches.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;google_images&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#google_images&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Google Images&lt;&#x2F;h2&gt;
&lt;p&gt;Going to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;images.google.com&#x2F;&quot;&gt;https:&#x2F;&#x2F;images.google.com&#x2F;&lt;&#x2F;a&gt; and clicking on the camera icon on the
right of the search bar will bring up a “Search by image” popup where you can
upload an image or feed a URL to search by.&lt;&#x2F;p&gt;
&lt;p&gt;Once something is uploaded, you’ll be given the option to “Find other sizes of
this image”. Click “All Sizes”, and you’ll be shown all images that are similar
to the input image.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tineye&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#tineye&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Tineye&lt;&#x2F;h2&gt;
&lt;p&gt;Tineye is a bit easier to use, just go to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tineye.com&#x2F;&quot;&gt;https:&#x2F;&#x2F;tineye.com&#x2F;&lt;&#x2F;a&gt; and upload your
image. Tineye lets you search by age or size, which helps find the original
source of the image.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;bing_images&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#bing_images&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Bing Images&lt;&#x2F;h2&gt;
&lt;p&gt;Bing images is similar to google, go to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.bing.com&#x2F;visualsearch&quot;&gt;https:&#x2F;&#x2F;www.bing.com&#x2F;visualsearch&lt;&#x2F;a&gt; and
upload your image.&lt;&#x2F;p&gt;
&lt;p&gt;One advantage here is that you can crop the image (Click “Visual Search” at the
bottom of the image) to cut out bits you don’t want to be looked at.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Finally, you might need to find a somewhat larger image with one tool, then use
a different tool to find the full original. Keep trying different tools until
you either find it, or give up.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>In Place String Mapping</title>
          <pubDate>Sat, 27 Mar 2021 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2021/in-place-string-mapping/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2021/03/27/in-place-string-mapping.html</guid>
          <description>&lt;p&gt;A while ago, I saw &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;jm0p1j&#x2F;c_person_question_for_rust_person&#x2F;gavr3ap&#x2F;&quot;&gt;a post about how C did in-place string modification better than
Rust&lt;&#x2F;a&gt;.
So, for example, you could take a string that is
percent encoded, and decode it, perfectly in place, without external
allocations.&lt;&#x2F;p&gt;
&lt;p&gt;This seemed rather neat, so I went out to implement it in Rust, so this can be
done &lt;em&gt;safely&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;The C version that inspired this post is:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;#include&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;lt;stdlib.h&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;#include&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;lt;stdio.h&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;void&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; decode_inplace&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;char&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;s&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    char&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;in &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;out &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    char&lt;&#x2F;span&gt;&lt;span&gt; cur[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    while&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;in) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;in &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;%&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            cur[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = *&lt;&#x2F;span&gt;&lt;span&gt;(in &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;+&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            cur[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = *&lt;&#x2F;span&gt;&lt;span&gt;(in &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;+&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;            *&lt;&#x2F;span&gt;&lt;span&gt;out &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; strtol&lt;&#x2F;span&gt;&lt;span&gt;(cur&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; NULL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 16&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            in &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;+=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;            *&lt;&#x2F;span&gt;&lt;span&gt;out &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;= *&lt;&#x2F;span&gt;&lt;span&gt;in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;        ++&lt;&#x2F;span&gt;&lt;span&gt;in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;        ++&lt;&#x2F;span&gt;&lt;span&gt;out&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;    *&lt;&#x2F;span&gt;&lt;span&gt;out &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;\0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    char&lt;&#x2F;span&gt;&lt;span&gt; s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;[]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;abc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;%64%&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;65fg&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    decode_inplace&lt;&#x2F;span&gt;&lt;span&gt;(s)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    printf&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt;%s\n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; s)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Let’s see what that looks like using my library.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; in_place_string_map&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;MapInPlace&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; decode_percent&lt;&#x2F;span&gt;&lt;span&gt;(s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; str&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; str&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; MapInPlace&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;(s);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    while let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Some&lt;&#x2F;span&gt;&lt;span&gt;(c)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;pop&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        match&lt;&#x2F;span&gt;&lt;span&gt; c {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;            &amp;#39;%&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                let&lt;&#x2F;span&gt;&lt;span&gt; num&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;pop_chars&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;not enough chars&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                let&lt;&#x2F;span&gt;&lt;span&gt; n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from_str_radix&lt;&#x2F;span&gt;&lt;span&gt;(num,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 16&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;invalid hex&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; char&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;no more capacity&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(c)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;no more capacity&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;into_mapped&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; percent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;abc%64%65fg&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; mapped_percent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; decode_percent&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; percent);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    assert_eq!&lt;&#x2F;span&gt;&lt;span&gt;(mapped_percent,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;abcdefg&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Pretty neat!&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;MapInPlace&lt;&#x2F;code&gt; takes a &lt;code&gt;&amp;amp;mut str&lt;&#x2F;code&gt; of arbitrary lifetime, and lets you do
operations such as &lt;code&gt;pop_chars&lt;&#x2F;code&gt; and &lt;code&gt;push&lt;&#x2F;code&gt; on it.&lt;&#x2F;p&gt;
&lt;p&gt;It works by internally converting the &lt;code&gt;&amp;amp;mut str&lt;&#x2F;code&gt; into a &lt;code&gt;&amp;amp;mut [u8]&lt;&#x2F;code&gt; and doing
operations on that byte array. It needs to be careful to ensure that as soon as
it gives control back to you, it’s valid UTF-8, since you &lt;em&gt;cannot&lt;&#x2F;em&gt; rely on
&lt;code&gt;Drop&lt;&#x2F;code&gt; being called in order to ensure safety, since you could leak the object
and regain access to the backing &lt;code&gt;&amp;amp;mut str&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;There are two offsets internally, &lt;code&gt;mapped_head&lt;&#x2F;code&gt; and &lt;code&gt;unmapped_head&lt;&#x2F;code&gt;. Anything
from the start of the string to &lt;code&gt;mapped_head&lt;&#x2F;code&gt; is data that’s been &lt;code&gt;push&lt;&#x2F;code&gt;ed to
the string. Anything from &lt;code&gt;unmapped_head&lt;&#x2F;code&gt; to the end of the string is data that
is yet to be popped. And the in-between zone is unspecified but must still be
valid UTF-8 (But the current implementation zeros it out after every operation,
conservatively.)&lt;&#x2F;p&gt;
&lt;p&gt;If you try to push more data than you are popping, then you will get an error,
as there’s no space. So this technique only works when the output string is
always as long as or shorter than the input string.&lt;&#x2F;p&gt;
&lt;p&gt;After you do your string modifications, you can get a reference to the part of
the slice that has been mapped using &lt;code&gt;into_mapped()&lt;&#x2F;code&gt;. Continuing to use the
original slice that was passed in is a footgun, as it will also contain the
unspecified section, as well as any unmapped characters. Originally the design
took a &lt;code&gt;&amp;amp;mut String&lt;&#x2F;code&gt; to avoid that, and truncated the buffer on &lt;code&gt;Drop&lt;&#x2F;code&gt;, but
taking a reference to a &lt;code&gt;String&lt;&#x2F;code&gt; means this library can’t be used in &lt;code&gt;no_std&lt;&#x2F;code&gt;
crates.&lt;&#x2F;p&gt;
&lt;p&gt;The library is on my &lt;del&gt;github&lt;&#x2F;del&gt; codeberg at
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;codeberg.org&#x2F;5225225&#x2F;in-place-string-map&quot;&gt;https:&#x2F;&#x2F;codeberg.org&#x2F;5225225&#x2F;in-place-string-map&lt;&#x2F;a&gt;. There’s definitely room
for performance optimisations (in &lt;code&gt;push_str&lt;&#x2F;code&gt;, the zeroing step isn’t ideal,
since it makes &lt;code&gt;push_str&lt;&#x2F;code&gt; O(&lt;em&gt;n&lt;&#x2F;em&gt;) where &lt;em&gt;n&lt;&#x2F;em&gt; is the number of characters in the
in-between zone, but other solutions seemed to allow invalid UTF-8 to slip
through).&lt;&#x2F;p&gt;
&lt;p&gt;I haven’t proven this code safe to myself yet, but it’s &lt;em&gt;probably&lt;&#x2F;em&gt; fine.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>An introduction of Content-defined chunking</title>
          <pubDate>Sun, 14 Feb 2021 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2021/content-defined-chunking/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2021/02/14/content-defined-chunking.html</guid>
          <description>&lt;p&gt;Content-defined chunking (CDC) is a method to more efficiently store various
versions of the same file, while achieving deduplication both in the same file
and across different files.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;content-defined_chunking&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#content-defined_chunking&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Content-defined chunking&lt;&#x2F;h2&gt;
&lt;p&gt;So what is CDC and why do file versioning tools use it?&lt;&#x2F;p&gt;
&lt;p&gt;Say you wanted to version a big file that has had various modifications made to
it over time, so that all 3 versions need to be stored. Here we’ll represent it
as 3 distinct sentences.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;The quick brown fox jumps over the lazy dog!&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;The quick brown dog jumps over the lazy fox?&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;A quick brown dog jumped over a lazy dog.&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;One way of storing this would just be to store the whole file as many times as
it exists in the repository. This works fine for small pieces of data (and is
what &lt;code&gt;git&lt;&#x2F;code&gt; does initially, before it packs your data), but wastes a lot of
space when you’re storing 50GB disk images that get changed slightly, and
often. And even for small files such as source files, it’s still very wasteful
to re-store the whole file every time a change is made.&lt;&#x2F;p&gt;
&lt;p&gt;Another method would be to compute a diff between the files. This is what &lt;code&gt;git&lt;&#x2F;code&gt;
does, and works well for the kind of files git handles, namely smallish source
files that get changed often and slightly. But trying to store very large files
in &lt;code&gt;git&lt;&#x2F;code&gt; gets slow since computing diffs of very large files is slow, so
mechanisms like Git LFS and git-annex were made to store the actual file
content in a way that git doesn’t try to diff.&lt;&#x2F;p&gt;
&lt;p&gt;Finally, we can chunk the file into individual chunks, and store each chunk in
the repository, and then store the main file as a list of chunk identifiers.
This way, chunks that are the same between files can be deduplicated naturally,
you don’t need to do any diffs to read off files, just read the chunks in the
list you’re given.&lt;&#x2F;p&gt;
&lt;p&gt;But there’s multiple ways to do the chunks. The simplest way would be to split
on fixed byte boundaries, so every some number of bytes bytes is a new chunk.&lt;&#x2F;p&gt;
&lt;p&gt;Let’s try that on the above 3 sentences, splitting every 8 bytes. I will bold
the new chunks as they come up.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;The quick brown fox jumps over the lazy dog!&lt;&#x2F;code&gt;&lt;br &#x2F;&gt;
&lt;strong&gt;&lt;code&gt;The quic&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;k brown &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;fox jump&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;s over t&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;he lazy &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;dog&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;The quick brown dog jumps over the lazy fox?&lt;&#x2F;code&gt;&lt;br &#x2F;&gt;
&lt;code&gt;The quic&lt;&#x2F;code&gt;, &lt;code&gt;k brown &lt;&#x2F;code&gt;, &lt;strong&gt;&lt;code&gt;dog jump&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;code&gt;s over t&lt;&#x2F;code&gt;, &lt;code&gt;he lazy &lt;&#x2F;code&gt;, &lt;strong&gt;&lt;code&gt;fox?&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;A quick brown dog jumped over a lazy dog.&lt;&#x2F;code&gt;&lt;br &#x2F;&gt;
&lt;strong&gt;&lt;code&gt;A quick &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;brown do&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;g jumped&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;over a&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;lazy dog&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;.&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Here we can see that while the first two sentences worked fine, the last one
was completely ruined, and shares no chunks with earlier sentences, even though
it has a similar number of changes!&lt;&#x2F;p&gt;
&lt;p&gt;This is because we &lt;em&gt;removed&lt;&#x2F;em&gt; some bytes from the start, which shifted over all
the byte boundaries in future chunks. Therefore, if we used this method to
version a file, and we added a single byte to the very start of a very large
file, the whole file would need to be stored again. That’s not good.&lt;&#x2F;p&gt;
&lt;p&gt;Content-defined chunking avoids this issue, by making the chunk points depend
on the actual content. Therefore, if the content shifts, the chunks will
follow. A small change in any place in the file will only cause at maximum, two
chunks to be changed (If the change spans two chunks).&lt;&#x2F;p&gt;
&lt;p&gt;Content-defined chunking can be seen as a function that takes a specific window
of data, and returns if now is a good time to cut.&lt;&#x2F;p&gt;
&lt;p&gt;Here we’ll simply split at the end of words. So &lt;code&gt;&quot;Hello, World!&quot;&lt;&#x2F;code&gt; would be
split into &lt;code&gt;[&quot;Hello, &quot;, &quot;World!&quot;]&lt;&#x2F;code&gt;. And I’ll do the same thing as before, bold
new chunks as they come up.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;The quick brown fox jumps over the lazy dog!&lt;&#x2F;code&gt;&lt;br &#x2F;&gt;
&lt;strong&gt;&lt;code&gt;The &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;quick &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;brown &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;fox &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;jumps &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;over &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;the &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;lazy &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;strong&gt;&lt;code&gt;dog!&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;The quick brown dog jumps over the lazy fox?&lt;&#x2F;code&gt;&lt;br &#x2F;&gt;
&lt;code&gt;The &lt;&#x2F;code&gt;, &lt;code&gt;quick &lt;&#x2F;code&gt;, &lt;code&gt;brown &lt;&#x2F;code&gt;, &lt;strong&gt;&lt;code&gt;dog &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;code&gt;jumps &lt;&#x2F;code&gt;, &lt;code&gt;over &lt;&#x2F;code&gt;, &lt;code&gt;the &lt;&#x2F;code&gt;, &lt;code&gt;lazy &lt;&#x2F;code&gt;, &lt;strong&gt;&lt;code&gt;fox?&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;A quick brown dog jumped over a lazy dog.&lt;&#x2F;code&gt;&lt;br &#x2F;&gt;
&lt;strong&gt;&lt;code&gt;A &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;code&gt;quick &lt;&#x2F;code&gt;, &lt;code&gt;brown &lt;&#x2F;code&gt;, &lt;code&gt;dog &lt;&#x2F;code&gt;, &lt;strong&gt;&lt;code&gt;jumped &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;code&gt;over &lt;&#x2F;code&gt;, &lt;strong&gt;&lt;code&gt;a &lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, &lt;code&gt;lazy &lt;&#x2F;code&gt;, &lt;strong&gt;&lt;code&gt;dog.&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Here we can see that even the last sentence has managed to re-use many chunks
from the earlier two, even though it has modifications that changed the length
of chunks.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;rolling_hash&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#rolling_hash&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Rolling Hash (not a weed joke i promise)&lt;&#x2F;h1&gt;
&lt;p&gt;Splitting on spaces works fine for text, but we want a more general solution
that works for all file types.&lt;&#x2F;p&gt;
&lt;p&gt;So we’ll walk through the file, one byte at a time, and look at the last &lt;em&gt;n&lt;&#x2F;em&gt;
bytes, where &lt;em&gt;n&lt;&#x2F;em&gt; is a window size. I’ll use a window size of 8, and we’ll only
split when the first byte of the SHA256 hash of the window starts with 4 &lt;code&gt;1&lt;&#x2F;code&gt;
bits in a row.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;’A quick ’: ‘&lt;strong&gt;1111&lt;&#x2F;strong&gt;1000’&lt;&#x2F;li&gt;
&lt;li&gt;’ quick b’: ‘10100010’&lt;&#x2F;li&gt;
&lt;li&gt;‘quick br’: ‘01010101’&lt;&#x2F;li&gt;
&lt;li&gt;‘uick bro’: ‘00111001’&lt;&#x2F;li&gt;
&lt;li&gt;‘ick brow’: ‘11001101’&lt;&#x2F;li&gt;
&lt;li&gt;‘ck brown’: ‘01011100’&lt;&#x2F;li&gt;
&lt;li&gt;’k brown ’: ‘01111111’&lt;&#x2F;li&gt;
&lt;li&gt;’ brown f’: ‘11100101’&lt;&#x2F;li&gt;
&lt;li&gt;‘brown fo’: ‘11100011’&lt;&#x2F;li&gt;
&lt;li&gt;‘rown fox’: ‘11000001’&lt;&#x2F;li&gt;
&lt;li&gt;’own fox ’: ‘01011010’&lt;&#x2F;li&gt;
&lt;li&gt;‘wn fox a’: ‘&lt;strong&gt;1111&lt;&#x2F;strong&gt;0011’&lt;&#x2F;li&gt;
&lt;li&gt;‘n fox an’: ‘00100001’&lt;&#x2F;li&gt;
&lt;li&gt;’ fox and’: ‘10001010’&lt;&#x2F;li&gt;
&lt;li&gt;’fox and ’: ‘00101000’&lt;&#x2F;li&gt;
&lt;li&gt;‘ox and a’: ‘11101101’&lt;&#x2F;li&gt;
&lt;li&gt;’x and a ’: ‘11001100’&lt;&#x2F;li&gt;
&lt;li&gt;’ and a d’: ‘01010101’&lt;&#x2F;li&gt;
&lt;li&gt;‘and a do’: ‘11101110’&lt;&#x2F;li&gt;
&lt;li&gt;‘nd a dog’: ‘10011111’&lt;&#x2F;li&gt;
&lt;li&gt;‘d a dog.’: ‘00001101’&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;So here we cut twice, one at the very start of the sentence, and one half way
through. So we end up with&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;A quick &lt;&#x2F;code&gt;, &lt;code&gt;brown fox a&lt;&#x2F;code&gt;, &lt;code&gt;nd a dog.&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;This is similar to the way we split on spaces, but here we have much finer
control over how often splits happen. If we want splits to happen half as
often, we can simply check for five &lt;code&gt;1&lt;&#x2F;code&gt; bits in a row.&lt;&#x2F;p&gt;
&lt;p&gt;Now we have one more thing to do. Above, I used SHA256 to generate the hash,
but you absolutely do not want to do a full invocation of a strong hash
function for every byte you want to chunk, or it will be very slow. (You’ll
need to be hashing 64 bytes per input byte if you have a window size of 64).&lt;&#x2F;p&gt;
&lt;p&gt;So instead, we use a rolling hash function, which is able to easily push bytes
into it, and remove old bytes.&lt;&#x2F;p&gt;
&lt;p&gt;A very simple example of a rolling hash is simply a sum of the window. We can
add bytes to it by adding, and we can remove bytes from it by subtracting.&lt;&#x2F;p&gt;
&lt;p&gt;Let’s do the 4-byte window rolling hash of &lt;code&gt;30 32 26 77 41 92 63 21 16&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;We’ll start out by summing up the first 4 bytes and going from there.&lt;&#x2F;p&gt;
&lt;p&gt;30+32+26+77 = 165&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Previous Hash Value&lt;&#x2F;th&gt;&lt;th&gt;Subtracted&lt;&#x2F;th&gt;&lt;th&gt;Added&lt;&#x2F;th&gt;&lt;th&gt;Hash Value&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;165&lt;&#x2F;td&gt;&lt;td&gt;30&lt;&#x2F;td&gt;&lt;td&gt;41&lt;&#x2F;td&gt;&lt;td&gt;176&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;176&lt;&#x2F;td&gt;&lt;td&gt;32&lt;&#x2F;td&gt;&lt;td&gt;92&lt;&#x2F;td&gt;&lt;td&gt;236&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;236&lt;&#x2F;td&gt;&lt;td&gt;26&lt;&#x2F;td&gt;&lt;td&gt;63&lt;&#x2F;td&gt;&lt;td&gt;273&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;273&lt;&#x2F;td&gt;&lt;td&gt;77&lt;&#x2F;td&gt;&lt;td&gt;21&lt;&#x2F;td&gt;&lt;td&gt;217&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;217&lt;&#x2F;td&gt;&lt;td&gt;41&lt;&#x2F;td&gt;&lt;td&gt;16&lt;&#x2F;td&gt;&lt;td&gt;192&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;As you can see, the amount of work done per byte is not very high, just one
subtraction and one addition. If you had a 64 byte window and were
recalculating the hash every time, you would need to be doing 64 additions per
input byte.&lt;&#x2F;p&gt;
&lt;p&gt;Now this is a bad rolling hash, because if you re-order bytes in the window,
the resulting hash value will be the same. Better hashes such as the Rabin
fingerprint don’t have this issue.&lt;&#x2F;p&gt;
&lt;p&gt;In any case, that’s an introduction to content-defined chunking based on a
rolling hash. This is what backup utilities like Borg and Restic use to
deduplicate files in your repository.&lt;&#x2F;p&gt;
&lt;p&gt;Next week I’ll look at the privacy implications of this, and how it can go
wrong.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Trans rights blend</title>
          <pubDate>Sun, 07 Feb 2021 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2021/trans-rights-blend/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2021/02/07/trans-rights-blend.html</guid>
          <description>&lt;p&gt;I made a trans flag wallpaper in blender!&lt;&#x2F;p&gt;
&lt;p&gt;I actually made this like a year ago but I’m publishing it now.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Click on the image to go to the full 1080p &lt;code&gt;.png&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;files&#x2F;trains-rights-blend&#x2F;render.png&quot;&gt;&lt;img src=&quot;&#x2F;files&#x2F;trains-rights-blend&#x2F;render-thumbnail.jpg&quot; alt=&quot;A render of glassy wireframe spheres making up the trans flag, with a lot of distortion&quot; &#x2F;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;files&#x2F;trains-rights-blend&#x2F;trains-rights-final.blend&quot;&gt;The &lt;code&gt;.blend&lt;&#x2F;code&gt; file&lt;&#x2F;a&gt; uses
the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;hdrihaven.com&#x2F;hdri&#x2F;?c=night&amp;amp;h=hansaplatz&quot;&gt;Hansaplatz HDRI from
HDRIHaven&lt;&#x2F;a&gt;. It doesn’t really
matter which resolution you use, but as we do post-processing, a low resolution
is fine. Download it, and set the file as shown below. It won’t work if you
don’t set the file, since I haven’t embedded the HDRI inside the file.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;files&#x2F;trains-rights-blend&#x2F;set-file.png&quot; alt=&quot;An screenshot of blender UI, showing how to set the world background to the HDRI file mentioned above&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;It’s actually an animation but I rendered it on frame 17 for my screenshot. You
could do something differently, of course. I originally intended to make this
an animation, but didn’t really feel like rendering it out.&lt;&#x2F;p&gt;
&lt;p&gt;The HDRI is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;hdrihaven.com&#x2F;p&#x2F;license.php&quot;&gt;licensed under CC0&lt;&#x2F;a&gt; and
I license the &lt;code&gt;.blend&lt;&#x2F;code&gt;, as well as the rendered output, under
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;creativecommons.org&#x2F;licenses&#x2F;by-sa&#x2F;4.0&#x2F;&quot;&gt;Attribution-ShareAlike 4.0 International (CC BY-SA
4.0)&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>unwise, for when unsafe isn&#x27;t quite right</title>
          <pubDate>Sun, 31 Jan 2021 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2021/unwise/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2021/01/31/unwise.html</guid>
          <description>&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.rust-lang.org&#x2F;&quot;&gt;The rust language&lt;&#x2F;a&gt; has a clearly defined notion of
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;keyword.unsafe.html&quot;&gt;unsafe code&lt;&#x2F;a&gt;. In short, any
function for which it is &lt;em&gt;ever&lt;&#x2F;em&gt; possible to cause undefined behaviour by
misusing it must be marked as unsafe. And any function for which it is &lt;em&gt;not&lt;&#x2F;em&gt;
possible to ever cause undefined behaviour using it, should be marked as safe.
Therefore, a codebase consisting of entirely safe code can never cause
undefined behaviour.&lt;&#x2F;p&gt;
&lt;p&gt;But what if the kind of unsafety you’re dealing with is not undefined
behaviour, but instead something else, like leaking crypto keys, or SQL
injection?&lt;&#x2F;p&gt;
&lt;p&gt;A common complaint about rust is that it does nothing to prevent this. Which is
true, but perhaps we could re-use the notion of unsafe for these things?&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;A point on notation: I’ve tried to use &lt;code&gt;unwise&lt;&#x2F;code&gt; consistently as a general counterpart to &lt;code&gt;unsafe&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;unsafe_functions&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#unsafe_functions&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Unsafe Functions&lt;&#x2F;h2&gt;
&lt;p&gt;There are two ways a function can involve unsafety in rust&lt;&#x2F;p&gt;
&lt;h3 id=&quot;unsafe_calling_unsafe&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#unsafe_calling_unsafe&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Being unsafe and calling unsafe code&lt;&#x2F;h3&gt;
&lt;p&gt;An unsafe function is allowed to call other unsafe functions without an unsafe
block. There are plans to change this, see &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;pull&#x2F;2585&quot;&gt;Rust RFC
2585&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; Gets a character&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; # Safety&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; * `index` must be less than 4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;unsafe fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; get_char&lt;&#x2F;span&gt;&lt;span&gt;(idx&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; char&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; array&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;#39;R&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;u&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;s&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;#39;t&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    array&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ptr&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;add&lt;&#x2F;span&gt;&lt;span&gt;(idx)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;read&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This function is unsafe because it indexes into an array without a bounds check
and reads off a character from that array. Because it’s an unsafe function,
it’s allowed to call
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;primitive.pointer.html#method.add&quot;&gt;&lt;code&gt;add&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; as
well as
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;primitive.pointer.html#method.read&quot;&gt;&lt;code&gt;read&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; on
pointers, all without an unsafe block itself, as the whole function is assumed
to be an unsafe block.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;safe_calling_unsafe&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#safe_calling_unsafe&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Calling unsafe, but being safe&lt;&#x2F;h3&gt;
&lt;p&gt;Rust wouldn’t be a very useful language if everything you wanted to do was
unsafe. So you can have safe functions that make use of unsafe functions. The
safe function is meant to perform all checks to ensure that the unsafe code is
only called when it is valid to do so.&lt;&#x2F;p&gt;
&lt;p&gt;For example, let’s write a safe wrapper around our unsafe &lt;code&gt;get_char&lt;&#x2F;code&gt; from
before.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; Gets a character&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; # Safety&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; * `index` must be less than 4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; get_char_safe&lt;&#x2F;span&gt;&lt;span&gt;(index&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; char&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    assert!&lt;&#x2F;span&gt;&lt;span&gt;(index&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 4&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;Index out of bounds&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    unsafe&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; get_char&lt;&#x2F;span&gt;&lt;span&gt;(index) }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;unwise_functions&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#unwise_functions&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Unwise Functions&lt;&#x2F;h2&gt;
&lt;p&gt;Now let’s replicate these two notions of unsafe, but without using the actual
&lt;code&gt;unsafe&lt;&#x2F;code&gt; blocks.&lt;&#x2F;p&gt;
&lt;p&gt;To do this, we’ll introduce a zero sized marker type for a particular notion of
unsafety. If a function takes this marker type as a parameter, it is considered
unsafe, and you can create a marker out of thin air if you explain why your
usage of it is safe. If you have it as a parameter yourself, you’re free to
pass it to other functions without needing to make it again.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; This allows for uncontrolled SQL statements &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; to be executed that don&amp;#39;t exist in the source code.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; SQLInjection&lt;&#x2F;span&gt;&lt;span&gt;(());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; SQLInjection&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; trustme&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; Self&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        SQLInjection&lt;&#x2F;span&gt;&lt;span&gt;(())&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This creates a new form of unsafety, one that’s not related to memory safety but instead has a new property.&lt;&#x2F;p&gt;
&lt;p&gt;And now we can introduce SQL examples of the two functions listed above.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;unwise_calling_wise&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#unwise_calling_wise&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Being unwise without calling any unwise functions.&lt;&#x2F;h3&gt;
&lt;p&gt;This doesn’t happen for isolated functions of &lt;code&gt;unsafe&lt;&#x2F;code&gt; code, but here we have a
boundary where below which it’s &lt;em&gt;not&lt;&#x2F;em&gt; marked as unwise.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; Executes SQL from a string&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; # Unwise (SQL Injection)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; This allows for arbitrary SQL to be executed,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; and does no filtering on the input sql.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; execute_sql&lt;&#x2F;span&gt;&lt;span&gt;(sql&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;, parameters&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;dyn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; AsSql&lt;&#x2F;span&gt;&lt;span&gt;], _unwise&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; SQLInjection&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    low_level_db&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;sql&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;execute&lt;&#x2F;span&gt;&lt;span&gt;(sql, parameters);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;wise_calling_unwise&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#wise_calling_unwise&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Calling unwise, but being wise&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; update_username_safe&lt;&#x2F;span&gt;&lt;span&gt;(user_id&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u32&lt;&#x2F;span&gt;&lt;span&gt;, user_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    execute_sql&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;UPDATE Users SET UserName=? WHERE Id = ?&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;        &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;[user_name, user_id],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; This is safe because the SQL being executed is known at compile time,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; and user input is entered via parameters.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        SQLInjection&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;trustme&lt;&#x2F;span&gt;&lt;span&gt;(),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    );&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;unwise_calling_unwise&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#unwise_calling_unwise&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Calling unwise and being unwise itself&lt;&#x2F;h3&gt;
&lt;p&gt;Here we can see that you do need to explicitly pass the unwise marker on to any
unwise calls, but it’s less noisy than creating it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; Executes SQL from a string and log the SQL&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; # Unwise (SQL Injection)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; This allows for arbitrary SQL to be executed,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&#x2F; and does no filtering on the input sql.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; execute_sql&lt;&#x2F;span&gt;&lt;span&gt;(sql&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;, parameters&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;dyn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; AsSql&lt;&#x2F;span&gt;&lt;span&gt;], unwise&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; SQLInjection&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    log&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;debug!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;{}, {}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, sql, parameters);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    execute_sql&lt;&#x2F;span&gt;&lt;span&gt;(sql, parameters, unwise);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;drawbacks&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#drawbacks&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Drawbacks&lt;&#x2F;h2&gt;
&lt;p&gt;One important note is that &lt;code&gt;unwise&lt;&#x2F;code&gt; &lt;em&gt;only&lt;&#x2F;em&gt; works if you don’t have memory
unsafety bugs. For example, you can simply create a &lt;code&gt;SQLInjection&lt;&#x2F;code&gt; using unsafe
code. So if you suspect a bug caused by an &lt;code&gt;unwise&lt;&#x2F;code&gt; type, you have to check
wherever it’s constructed &lt;em&gt;in addition to&lt;&#x2F;em&gt; all &lt;code&gt;unsafe&lt;&#x2F;code&gt; blocks, in theory.&lt;&#x2F;p&gt;
&lt;p&gt;Additionally, there’s the potential for unmarked unwise functions, since this
wasn’t baked into the language from early on, like &lt;code&gt;unsafe&lt;&#x2F;code&gt; was. Therefore,
this works best for the unwise type being defined in the same crate that
defines the ability to misuse it.&lt;&#x2F;p&gt;
&lt;p&gt;So for the instance of a SQL injection type, that would be defined in a SQL
library, and the library would take care to never allow SQL injection through
its codebase, but can’t guarantee anything about additional libraries. Any
libraries that build on top of one that uses &lt;code&gt;unwise&lt;&#x2F;code&gt; should re-use the same
definition consistently if needed.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Distortion</title>
          <pubDate>Thu, 31 Dec 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/distortion/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2020/12/31/distortion.html</guid>
          <description>&lt;p&gt;When writing a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Box_blur&quot;&gt;box blur&lt;&#x2F;a&gt;
implementation, initially I had a fun bug where the rolling sum for values on
the left were incorrect, since I did not include early values in the blur. It
looks really cool so I kept the code for it.&lt;&#x2F;p&gt;
&lt;p&gt;If you just want to try it out on your own images, I wrote a &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;pages&#x2F;distort&#x2F;&quot;&gt;JS version&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Below is the code, with the required fix commented out. This does a box blur on
a single row of the image, with a specified width.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; blur_row&lt;&#x2F;span&gt;&lt;span&gt;(img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Image&lt;&#x2F;span&gt;&lt;span&gt;, row&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;, width&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Result&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;(),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Error&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; acc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Pixel&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;default&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; amount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; scratch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;  for col in 0..width {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;      acc += *img.get(col, row).ok_or(Error::WidthError(width))?;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;      amount += 1;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; col&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span&gt;img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;width&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Some&lt;&#x2F;span&gt;&lt;span&gt;(head)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(col&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; width, row) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            acc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; += *&lt;&#x2F;span&gt;&lt;span&gt;head;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            amount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; col&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;gt;=&lt;&#x2F;span&gt;&lt;span&gt; width {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            let&lt;&#x2F;span&gt;&lt;span&gt; tail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(col&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&lt;&#x2F;span&gt;&lt;span&gt; width, row)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;was checked above??&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            acc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -= *&lt;&#x2F;span&gt;&lt;span&gt;tail;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            amount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        scratch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(acc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; f64&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt;(amount));&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; (col, item)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; scratch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;iter&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;enumerate&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;        *&lt;&#x2F;span&gt;&lt;span&gt;img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;get_mut&lt;&#x2F;span&gt;&lt;span&gt;(col, row)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = *&lt;&#x2F;span&gt;&lt;span&gt;item;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    Ok&lt;&#x2F;span&gt;&lt;span&gt;(())&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I won’t go too much into the details of why a box blur is useful in this post,
since I’ll probably make that a new post.&lt;&#x2F;p&gt;
&lt;p&gt;But for now, look at some neat distortions!&lt;&#x2F;p&gt;
&lt;p&gt;To some degree, JPEG compression might contribute to some of the distortion,
but I didn’t want to triple the size of this page. If you want, you can run the
tool (linked above) on the images yourself.&lt;&#x2F;p&gt;
&lt;p&gt;The first two have been done on default settings, a width of 5 and a iteration
count of 1.&lt;&#x2F;p&gt;
&lt;p&gt;Also, all original photos are from Unsplash, and as such are used under the
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;unsplash.com&#x2F;license&quot;&gt;Unsplash License&lt;&#x2F;a&gt;. The modified works, I have no
idea what license they fall under, the Unsplash License is not very clear about
derivative works (I’m writing this paragraph in 2023 when cleaning up the
licenses of this site). &lt;em&gt;I&lt;&#x2F;em&gt; don’t care what you do with them, but they may
still fall under the Unsplash License, in which case go follow those rules. Or
go run the tool above on your own images.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;city_skyline&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#city_skyline&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
City skyline during night time&lt;&#x2F;h2&gt;
&lt;p&gt;Picture by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;unsplash.com&#x2F;photos&#x2F;qsnfSvCdec4&quot;&gt;Mohammad Amin on Unsplash&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;distortion&#x2F;city-original.jpg&quot; alt=&quot;A city at night with lots of blue lights on the buildings reflecting on a mostly calm lake. One building is mostly orange.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;distortion&#x2F;city-distorted.jpg&quot; alt=&quot;A distorted version of the above image, with dark lines going across it.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;yellow_leaf&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#yellow_leaf&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Yellow leaf tree under blue daytime&lt;&#x2F;h2&gt;
&lt;p&gt;Picture by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;unsplash.com&#x2F;photos&#x2F;6YIceW4bgwg&quot;&gt;Wolfgang Hasselmann on
Unsplash&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;distortion&#x2F;tree-original.jpg&quot; alt=&quot;A tree with yellow leaves in a yellow grassy field. There’s a deep blue sky, with clouds near the horizon&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;distortion&#x2F;tree-distorted.jpg&quot; alt=&quot;A distored version of the above, the colours are more saturated and the tree’s shadow is darker&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;cat_blanket&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#cat_blanket&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Brown and black cat in blanket&lt;&#x2F;h2&gt;
&lt;p&gt;For this one, I adjusted the settings to have an iteration count of 2 and a
width of 1.&lt;&#x2F;p&gt;
&lt;p&gt;This has more colour distortion and less blurring.&lt;&#x2F;p&gt;
&lt;p&gt;Picture by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;unsplash.com&#x2F;photos&#x2F;ZrrKWgDLyd4&quot;&gt;LILNAV99 on Unsplash&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;distortion&#x2F;cat-original.jpg&quot; alt=&quot;A cute cat with their eyes closed in a blanket. You can only see their head.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;distortion&#x2F;cat-distorted.jpg&quot; alt=&quot;A distorted form of the above, any shadows in the blanket have been made completely black, and you cannot make out any detail in the cat’s face.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>µ [sic]</title>
          <pubDate>Thu, 12 Nov 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/mu-sic/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2020/11/12/mu-sic.html</guid>
          <description>&lt;p&gt;here you go have a full on album ig,,,&lt;&#x2F;p&gt;
&lt;p&gt;as always source embedded in the files&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;music and all source code is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;creativecommons.org&#x2F;licenses&#x2F;by-sa&#x2F;4.0&#x2F;&quot;&gt;licensed under Attribution-ShareAlike 4.0
International (CC BY-SA 4.0)&lt;&#x2F;a&gt;
(though i guess you could just re-run the code and own the output.)&lt;&#x2F;p&gt;
&lt;p&gt;track 08 is a alternate intro&lt;&#x2F;p&gt;
&lt;p&gt;for data saving purposes these are all MP3’s but the MP3 compression does
change how the music sounds a bit i guess it’s an edge case like compressing
text with JPEG. if you like how it sounds maybe play around with other
bitrates&#x2F;compression methods?&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;music-flac.zip&quot;&gt;here’s the full album as a FLAC in a .zip file&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;figure&gt;
&lt;figcaption&gt;track 1: 0xacab&lt;&#x2F;figcaption&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;0xacab.mp3&quot; type=&quot;audio&#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser.
&lt;a href=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;0xacab.mp3&quot;&gt;Direct link to the track here&lt;&#x2F;a&gt;
&lt;&#x2F;audio&gt;
&lt;&#x2F;figure&gt;
&lt;li&gt;
&lt;figure&gt;
&lt;figcaption&gt;track 2: rev&lt;&#x2F;figcaption&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;rev.mp3&quot; type=&quot;audio&#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser.
&lt;a href=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;rev.mp3&quot;&gt;Direct link to the track here&lt;&#x2F;a&gt;
&lt;&#x2F;audio&gt;
&lt;&#x2F;figure&gt;
&lt;li&gt;
&lt;figure&gt;
&lt;figcaption&gt;track 3: racecar&lt;&#x2F;figcaption&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;racecar.mp3&quot; type=&quot;audio&#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser.
&lt;a href=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;racecar.mp3&quot;&gt;Direct link to the track here&lt;&#x2F;a&gt;
&lt;&#x2F;audio&gt;
&lt;&#x2F;figure&gt;
&lt;li&gt;
&lt;figure&gt;
&lt;figcaption&gt;track 4: fuckmagicbus&lt;&#x2F;figcaption&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;fuckmagicbus.mp3&quot; type=&quot;audio&#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser.
&lt;a href=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;fuckmagicbus.mp3&quot;&gt;Direct link to the track here&lt;&#x2F;a&gt;
&lt;&#x2F;audio&gt;
&lt;&#x2F;figure&gt;
&lt;li&gt;
&lt;figure&gt;
&lt;figcaption&gt;track 5: popcnt&lt;&#x2F;figcaption&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;popcnt.mp3&quot; type=&quot;audio&#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser.
&lt;a href=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;popcnt.mp3&quot;&gt;Direct link to the track here&lt;&#x2F;a&gt;
&lt;&#x2F;audio&gt;
&lt;&#x2F;figure&gt;
&lt;li&gt;
&lt;figure&gt;
&lt;figcaption&gt;track 6: descent&lt;&#x2F;figcaption&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;descent.mp3&quot; type=&quot;audio&#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser.
&lt;a href=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;descent.mp3&quot;&gt;Direct link to the track here&lt;&#x2F;a&gt;
&lt;&#x2F;audio&gt;
&lt;&#x2F;figure&gt;
&lt;li&gt;
&lt;figure&gt;
&lt;figcaption&gt;track 7: sleeping kitten&lt;&#x2F;figcaption&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;sleepingkitten.mp3&quot; type=&quot;audio&#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser.
&lt;a href=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;sleepingkitten.mp3&quot;&gt;Direct link to the track here&lt;&#x2F;a&gt;
&lt;&#x2F;audio&gt;
&lt;&#x2F;figure&gt;
&lt;li&gt;
&lt;figure&gt;
&lt;figcaption&gt;track 8: allcatsarebeautiful&lt;&#x2F;figcaption&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;allcatsarebeautiful.mp3&quot; type=&quot;audio&#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser.
&lt;a href=&quot;&#x2F;files&#x2F;music&#x2F;1&#x2F;allcatsarebeautiful.mp3&quot;&gt;Direct link to the track here&lt;&#x2F;a&gt;
&lt;&#x2F;audio&gt;
&lt;&#x2F;figure&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      
      
      <item>
          <title>music made with (a non-trivial amount of) C</title>
          <pubDate>Tue, 10 Nov 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/c-music/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2020/11/10/c-music.html</guid>
          <description>&lt;p&gt;There’s a better post to be made about making music with bitshifting but that
post is still due to be released on the year of the linux desktop.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Volume Warning: Is reasonable on my machine. Check yours.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Source Code: Run &lt;code&gt;strings&lt;&#x2F;code&gt; on the file.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;figure&gt;
&lt;figcaption&gt;a 1 minute long &quot;electronic&quot; &quot;&quot;music&quot;&quot; track&lt;&#x2F;figcaption&gt;
&lt;audio style=&quot;width:100%&quot; controls&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;files&#x2F;2020-11-10-music.ogg?h=c07977284bec2d077079
&quot; type=&quot;audio&#x2F;ogg&quot;&gt;
&lt;source src=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;files&#x2F;2020-11-10-music.mp3?h=6e111303fec527113cd0
&quot; type=&quot;audio&#x2F;mpeg&quot;&gt;
The audio tag is not supported on your browser. &lt;a href=&quot;&#x2F;files&#x2F;2020-11-10-music.ogg&quot;&gt;Direct download link to the track here in ogg form.&lt;&#x2F;a&gt;, and &lt;a href=&quot;&#x2F;files&#x2F;2020-11-10-music.mp3&quot;&gt;direct link to the track here in mp3 form&lt;&#x2F;a&gt;
&lt;&#x2F;audio&gt;
&lt;&#x2F;figure&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;2020-11-10 edit: Reuploaded files and added a mp3 source.&lt;&#x2F;p&gt;
&lt;p&gt;2020-11-10 edit: forgot to embed the source…&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>(Misusing) Python Unicode Normalisation</title>
          <pubDate>Sat, 24 Oct 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/python-unicode-normalisation/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2020/10/24/python-unicode-normalisation.html</guid>
          <description>&lt;p&gt;After &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.python.org&#x2F;dev&#x2F;peps&#x2F;pep-3131&#x2F;&quot;&gt;PEP 3131&lt;&#x2F;a&gt;, python normalises
identifiers in order to support non-ASCII identifiers.&lt;&#x2F;p&gt;
&lt;p&gt;That means that if you write &lt;code&gt;𝚠 = 50&lt;&#x2F;code&gt;, where that character is &lt;code&gt;U+1D6A0 MATHEMATICAL MONOSPACE SMALL W&lt;&#x2F;code&gt;, you can later refer to that variable as &lt;code&gt;w&lt;&#x2F;code&gt;
(or, indeed, anything that normalises into &lt;code&gt;w&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;So I wrote a program to randomly replace every character in some code with any
character that normalises into it while trying not to break the program.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;This post was inspired by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;codegolf.stackexchange.com&#x2F;a&#x2F;207567&quot;&gt;https:&#x2F;&#x2F;codegolf.stackexchange.com&#x2F;a&#x2F;207567&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Any correct code to do this would need to parse the code to avoid doing the
replacement for non-identifiers (which is &lt;em&gt;not&lt;&#x2F;em&gt; normalised), but I just included a list
of characters to not modify, and tried to cut down on the number of syntax
items like &lt;code&gt;import&lt;&#x2F;code&gt;, &lt;code&gt;raise&lt;&#x2F;code&gt;, &lt;code&gt;with&lt;&#x2F;code&gt;, &lt;code&gt;else&lt;&#x2F;code&gt;, that I don’t use.&lt;&#x2F;p&gt;
&lt;p&gt;Below is the program (transformed, of course). I’m also providing &lt;a href=&quot;&#x2F;files&#x2F;2020-10-24-python-unicode-normalisation.py&quot;&gt;the
pure-ASCII source here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The program takes the input file as the first argument, and the output file as the
second argument.&lt;&#x2F;p&gt;
&lt;p&gt;Apologies to anyone who is using a screen reader or reading this on a device
with poor font support. The plain ASCII source linked above will be far more
readable.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;syss&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;&quot;&gt; int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_ｂytes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;7567731&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 3&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;&quot;&gt; int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;fro𝙢_𝗯ytes&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__𝗱oc__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;385&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;388&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; __i𝖒port__&lt;&#x2F;span&gt;&lt;span&gt;(syss&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;𝘥eco𝓭e&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; __i𝙢port__&lt;&#x2F;span&gt;&lt;span&gt;(𝑏ytes&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;𝓭eco𝚍e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__𝒹oc__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;271&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;279&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;𝒍ower&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;ata&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;io&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; __import__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;open&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__𝙢o𝒅𝘂𝙡e__)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ran𝔡o𝓂&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; __iｍport__&lt;&#x2F;span&gt;&lt;span&gt;(io&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;B𝙪ffere𝖽Rando𝖒&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__name__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;8&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;𝚕o𝘸er&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ections&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;𝕓idirectiona𝚕&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__na𝘮e__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; __i𝗆port__&lt;&#x2F;span&gt;&lt;span&gt;(compi𝗅e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__na𝑚e__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; co𝑚pi𝗅e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__na𝚖e__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; ections&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;s&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;nor𝕞cac𝖍e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;𝑑efa𝘶𝓵t𝒅ict&lt;&#x2F;span&gt;&lt;span&gt;(𝗅ist)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;nf𝓴c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;nor𝗆a𝚕ize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__𝑑oc__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;96&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;100&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;𝗅&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__na𝕞e__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;𝔲&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; Unico𝘥eDeco𝘥eError&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__naｍe__&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;𝐥o𝘄er&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;L𝘭&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (𝑙&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;tit𝘭e&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;L𝘂&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (𝘭&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;+&lt;&#x2F;span&gt;&lt;span&gt;ｕ)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;tit𝓵e&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; ran𝒈e&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; 0x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;110000&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    try&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;cate𝒈ory&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;c𝘩r&lt;&#x2F;span&gt;&lt;span&gt;(_))&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; [Lｌ&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; Lu]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; or&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; cℎr&lt;&#x2F;span&gt;&lt;span&gt;(_)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;_&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            nor𝓂a𝚕ise𝒅&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;nor𝑚ali𝐳e&lt;&#x2F;span&gt;&lt;span&gt;(nf𝓴c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;&quot;&gt; str&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;c𝙝r&lt;&#x2F;span&gt;&lt;span&gt;(_)))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            nor𝙢cache[nor𝓂a𝒍ise𝕕]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;c𝗵r&lt;&#x2F;span&gt;&lt;span&gt;(_))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    except&lt;&#x2F;span&gt;&lt;span&gt; Unico𝑑eDecoⅆeError&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; pass&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; open&lt;&#x2F;span&gt;&lt;span&gt;(S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;arｇ𝐯[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;𝖜&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;east_asian_𝕨i𝒹t𝙝&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__na𝗺e__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;of&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; open&lt;&#x2F;span&gt;&lt;span&gt;(S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;ar𝒈𝓋[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; 𝐰)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;rea𝐝&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ie&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; In𝑑exError&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;𝑤it𝙝_trace𝗯ac𝘬&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__doc__[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;𝗹o𝘄er&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;afryso&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;&quot;&gt; int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;__na𝐦e__&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; ie&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; cℎ&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    try&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; c𝗵&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; not in&lt;&#x2F;span&gt;&lt;span&gt; c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            try&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; ran𝖉o𝘮&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;c𝗵oice&lt;&#x2F;span&gt;&lt;span&gt;(nor𝖒cac𝔥e[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;(c𝘩)])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                assert&lt;&#x2F;span&gt;&lt;span&gt; U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;nor𝕞aｌize&lt;&#x2F;span&gt;&lt;span&gt;(nf𝚔c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; s)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span&gt; c𝐡&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                of&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;𝔴rite&lt;&#x2F;span&gt;&lt;span&gt;(s)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            except&lt;&#x2F;span&gt;&lt;span&gt; InｄexError&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                of&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;𝒘rite&lt;&#x2F;span&gt;&lt;span&gt;(c𝖍)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            [][&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        of&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;𝔀rite&lt;&#x2F;span&gt;&lt;span&gt;(c𝙝)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    except&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; pass&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</description>
      </item>
      
      
      <item>
          <title>Custom literals in rust</title>
          <pubDate>Fri, 25 Sep 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/custom-literals-in-rust/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2020/09/25/custom-literals-in-rust.html</guid>
          <description>&lt;p&gt;Ever wanted custom literals in rust? No? Too bad!&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; &amp;quot;#123456&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;]];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;&#x2F;&#x2F; x is a Color&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This runs at &lt;em&gt;compile time&lt;&#x2F;em&gt;. If the parser panics, you get a &lt;em&gt;compile failure&lt;&#x2F;em&gt;. Neat, huh?&lt;&#x2F;p&gt;
&lt;p&gt;This also doesn’t only work for strings. &lt;em&gt;Any&lt;&#x2F;em&gt; value known at compile time can
be used. As long as you can do your processing in a &lt;code&gt;const fn&lt;&#x2F;code&gt;, it’s fair game.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;usage&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#usage&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Usage&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; constinto&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ConstPanickingFrom&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Color&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; const_panicking_from&lt;&#x2F;span&gt;&lt;span&gt;(x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; Self&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;        todo!&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt; &#x2F;&#x2F; Not important here.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[userliterals]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; flag&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 4&lt;&#x2F;span&gt;&lt;span&gt;] {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Compile time error if uncommented.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; let invalid = &amp;quot;lololol&amp;quot;: [[Color]];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;#ffff00&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;]],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;#ffffff&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;]],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;#800080&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;]],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;#000000&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;]],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;implementation&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#implementation&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Implementation&lt;&#x2F;h2&gt;
&lt;p&gt;A full code sample is at the bottom for copy pasting.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; LiteralVisitor&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We don’t have any state or arguments that need passing to the visitor, so we
can simply use a unit struct here.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; VisitMut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; LiteralVisitor&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.rs&#x2F;syn&#x2F;1.0.41&#x2F;syn&#x2F;visit_mut&#x2F;index.html&quot;&gt;VisitMut&lt;&#x2F;a&gt; lets you walk
through a tree of nodes and do modifications on them just by defining methods
that are run whenever an element of a particular type is encountered.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;  fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; visit_expr_mut&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;, expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Expr&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; sp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;span&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here, we’re capturing the span of &lt;code&gt;expr&lt;&#x2F;code&gt;. This lets us point to the original
source when there’s errors.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    if let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Type&lt;&#x2F;span&gt;&lt;span&gt;(ty)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; expr {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;      if let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Slice&lt;&#x2F;span&gt;&lt;span&gt;(outer)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; ty&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;ty&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ref&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Slice&lt;&#x2F;span&gt;&lt;span&gt;(inner)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; outer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;elem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ref&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This looks for a &lt;code&gt;Type&lt;&#x2F;code&gt; expression which is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;blob&#x2F;master&#x2F;text&#x2F;0803-type-ascription.md&quot;&gt;type
ascription&lt;&#x2F;a&gt;
(&lt;code&gt;foo(50: i32)&lt;&#x2F;code&gt;), and then looks to see if the &lt;code&gt;ty&lt;&#x2F;code&gt; of that type (which is just
the type named on the right hand side) is two slices (&lt;code&gt;[[]]&lt;&#x2F;code&gt;). If you will
never use type coercion, then the check for two slices can be skipped and you
can simply treat &lt;code&gt;&quot;#123456&quot;: Color&lt;&#x2F;code&gt; as a literal, at the risk of being very
confusing to people who are not used to the code.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;          let&lt;&#x2F;span&gt;&lt;span&gt; ex&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;ty&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;expr;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here we’re capturing the left hand side of the expression (In &lt;code&gt;&quot;#123456&quot;: [[Color]]&lt;&#x2F;code&gt;, this is the &lt;code&gt;&quot;#123456&quot;&lt;&#x2F;code&gt;), as we will be using it in the expansion.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;          match&lt;&#x2F;span&gt;&lt;span&gt; inner&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;elem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ref&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;            syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Path&lt;&#x2F;span&gt;&lt;span&gt;(_)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;              let&lt;&#x2F;span&gt;&lt;span&gt; to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;inner&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;elem;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here we get at the thing inside the two square brackets on the right (In
&lt;code&gt;[[Color]]&lt;&#x2F;code&gt;, this is the &lt;code&gt;Color&lt;&#x2F;code&gt;), since we need it for both the type of the
constant, as well as to invoke the correct trait method. We also check to see
&lt;em&gt;what&lt;&#x2F;em&gt; is in the right hand side. Here, we’re looking for a &lt;code&gt;Path&lt;&#x2F;code&gt;, which is
simply any name for an item. This means you can use &lt;code&gt;[[crate::module::Color]]&lt;&#x2F;code&gt;
if you wanted, it will still work, since all the macro needs to be able to do
is write it as a type.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;              *&lt;&#x2F;span&gt;&lt;span&gt;expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Verbatim&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;quote&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;quote_spanned!&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                sp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                  use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;constinto&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ConstPanickingFrom&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span&gt; _;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                  const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; _VAL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; #to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; #&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;const_panicking_from&lt;&#x2F;span&gt;&lt;span&gt;(#ex);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;                  _VAL&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;              });&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is the expansion. We create a new expression (a &lt;code&gt;Verbatim&lt;&#x2F;code&gt; simply means you
can put whatever tokens you want in it. This is good for our use case, since
&lt;code&gt;quote_spanned!&lt;&#x2F;code&gt; creates a &lt;code&gt;TokenStream&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;Here, we also make use of &lt;code&gt;sp&lt;&#x2F;code&gt;, which is the span we got above. This lets the
compiler know who to blame when there’s errors.&lt;&#x2F;p&gt;
&lt;p&gt;We create a new block using &lt;code&gt;{ }&lt;&#x2F;code&gt; to avoid leaking our &lt;code&gt;use&lt;&#x2F;code&gt; and &lt;code&gt;const _VAL&lt;&#x2F;code&gt;
into the outer scope. The use itself wouldn’t be much of a problem, but you
wouldn’t want to re-use names of &lt;code&gt;const&lt;&#x2F;code&gt;s. This saves us the hassle of trying
to generate a random name.&lt;&#x2F;p&gt;
&lt;p&gt;The reason we use &lt;code&gt;const _VAL&lt;&#x2F;code&gt; and then write &lt;code&gt;_VAL&lt;&#x2F;code&gt; at the end (which makes
the whole expression evaluate to &lt;code&gt;_VAL&lt;&#x2F;code&gt;) is to force evaluation. If we just
wrote &lt;code&gt;sp =&amp;gt; #to::const_panicking_from(#ex);&lt;&#x2F;code&gt;, then the compiler wouldn’t
&lt;em&gt;actually&lt;&#x2F;em&gt; evaluate it at compile time.&lt;&#x2F;p&gt;
&lt;p&gt;There’s an open RFC (&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;pull&#x2F;2920&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;pull&#x2F;2920&lt;&#x2F;a&gt;) to add
&lt;code&gt;const { 2 + 2 }&lt;&#x2F;code&gt; blocks to force const evaluation. This would mean this hack
isn’t needed, we could just use a const block and call the function and return
the result.&lt;&#x2F;p&gt;
&lt;p&gt;The reason I use two brackets is to ensure that the right hand side is never
valid for type ascription as the set of two brackets would mean a slice within
a slice, but slices cannot have unsized types inside of them (&lt;code&gt;let x: &amp;amp;[dyn std::fmt::Debug] = &amp;amp;[]&lt;&#x2F;code&gt; is invalid).&lt;&#x2F;p&gt;
&lt;p&gt;This ensures there is no compatibility issue, any code that the literal macro
will convert would not have compiled anyways without it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; panic!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;Bad input&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here we just panic if we get something other than a &lt;code&gt;Path&lt;&#x2F;code&gt; inside the square
brackets. Not great error handling, but it works.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;          }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;          return&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Once we have transformed the input, we return, to avoid walking the inner elements unnecessarily.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;visit_mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;visit_expr_mut&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, expr)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This final call is so that we will walk the whole tree of expressions.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[proc_macro_attribute]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;pub fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; userliterals&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    _attr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; proc_macro&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;TokenStream&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; proc_macro&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;TokenStream&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; proc_macro&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;TokenStream&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; input&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;parse_macro_input!&lt;&#x2F;span&gt;&lt;span&gt;(item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Item&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    LiteralVisitor&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;visit_item_mut&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; input);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; expanded&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; quote&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;quote!&lt;&#x2F;span&gt;&lt;span&gt; { #input };&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    proc_macro&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;TokenStream&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt;(expanded)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The name of this function is the attribute name you will use on your functions.
The &lt;code&gt;#[proc_macro_attribute]&lt;&#x2F;code&gt; means that this is a proc macro.&lt;&#x2F;p&gt;
&lt;p&gt;We don’t need &lt;code&gt;attr&lt;&#x2F;code&gt;, as that’s any items that are passed as “arguments” to the
proc macro. We don’t allow for customisation, so we just ignore that variable.&lt;&#x2F;p&gt;
&lt;p&gt;We simply parse the input, walk the tree using our &lt;code&gt;LiteralVisitor&lt;&#x2F;code&gt;, and then
create a &lt;code&gt;TokenStream&lt;&#x2F;code&gt; from the output and return it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the_code&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the_code&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
The Code&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;customlit&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#customlit&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
&lt;code&gt;customlit&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The code for this started life as &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Andlon&#x2F;numeric_literals&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;Andlon&#x2F;numeric_literals&lt;&#x2F;a&gt;,
and I gradually hacked away the parts that weren’t needed.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;spanned&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Spanned&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;visit_mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;VisitMut&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; LiteralVisitor&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; VisitMut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; LiteralVisitor&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; visit_expr_mut&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;, expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Expr&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; sp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;span&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Type&lt;&#x2F;span&gt;&lt;span&gt;(ty)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; expr {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            if let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Slice&lt;&#x2F;span&gt;&lt;span&gt;(outer)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; ty&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;ty&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ref&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                if let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Slice&lt;&#x2F;span&gt;&lt;span&gt;(inner)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; outer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;elem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ref&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                    let&lt;&#x2F;span&gt;&lt;span&gt; ex&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;ty&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;expr;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                    match&lt;&#x2F;span&gt;&lt;span&gt; inner&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;elem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ref&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;                        syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Path&lt;&#x2F;span&gt;&lt;span&gt;(_)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                            let&lt;&#x2F;span&gt;&lt;span&gt; to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; = &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;inner&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;elem;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;                            *&lt;&#x2F;span&gt;&lt;span&gt;expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Expr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;Verbatim&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;quote&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;quote_spanned!&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                                sp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                                    use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; ::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;constinto&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ConstPanickingFrom&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span&gt; _;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                                    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; _VAL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; #to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; #&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;const_panicking_from&lt;&#x2F;span&gt;&lt;span&gt;(#ex);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;                                    _VAL&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                                }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                            });&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                        _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; panic!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;Bad input&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                    return&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;visit_mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;visit_expr_mut&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, expr)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[proc_macro_attribute]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;pub fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; userliterals&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    _attr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; proc_macro&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;TokenStream&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; proc_macro&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;TokenStream&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; proc_macro&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;TokenStream&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; input&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;parse_macro_input!&lt;&#x2F;span&gt;&lt;span&gt;(item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; syn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Item&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    LiteralVisitor&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;visit_item_mut&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; input);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; expanded&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; quote&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;quote!&lt;&#x2F;span&gt;&lt;span&gt; { #input };&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    proc_macro&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;TokenStream&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt;(expanded)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And the relevant parts of the &lt;code&gt;Cargo.toml&lt;&#x2F;code&gt;…&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[lib]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;proc-macro = true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[dependencies]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;quote = &amp;quot;1.0.7&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[dependencies.syn]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;version = &amp;quot;1.0&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;default-features = false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;features = [&amp;quot;visit-mut&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;full&amp;quot;, &amp;quot;parsing&amp;quot;, &amp;quot;proc-macro&amp;quot;, &amp;quot;extra-traits&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;constinto&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#constinto&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
&lt;code&gt;constinto&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;There’s also a crate that defines &lt;code&gt;const_panicking_from&lt;&#x2F;code&gt; that needs to be
included by the crate &lt;em&gt;using&lt;&#x2F;em&gt; the macro.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;pub trait&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; ConstPanickingFrom&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;T&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; const_panicking_from&lt;&#x2F;span&gt;&lt;span&gt;(value&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; T&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; Self&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Yep, that’s it. 3 lines of code to define a trait. I couldn’t do this in
&lt;code&gt;customlit&lt;&#x2F;code&gt; because proc_macro crates can’t export types.&lt;&#x2F;p&gt;
&lt;p&gt;If I implemented this trait for any standard library types, that would go here.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;user_crate&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#user_crate&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
&lt;code&gt;user_crate&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_trait_impl)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![allow(incomplete_features)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_option)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_fn)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_panic)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; customlit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span&gt;userliterals;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[derive(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Debug&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; PartialEq&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Eq&lt;&#x2F;span&gt;&lt;span&gt;)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Color&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    g&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; hex_to_u4&lt;&#x2F;span&gt;&lt;span&gt;(x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    match&lt;&#x2F;span&gt;&lt;span&gt; x {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        b&amp;#39;0&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;b&amp;#39;9&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; b&amp;#39;0&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        b&amp;#39;a&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;b&amp;#39;f&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 10&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; b&amp;#39;a&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; panic!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;unknown character&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; hl_to_u8&lt;&#x2F;span&gt;&lt;span&gt;(h&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span&gt;, l&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    hex_to_u4&lt;&#x2F;span&gt;&lt;span&gt;(h)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 4&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; hex_to_u4&lt;&#x2F;span&gt;&lt;span&gt;(l)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; constinto&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;ConstPanickingFrom&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Color&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; const_panicking_from&lt;&#x2F;span&gt;&lt;span&gt;(x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt; Self&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        match&lt;&#x2F;span&gt;&lt;span&gt; x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_bytes&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;b&amp;#39;#&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, rh, rl, gh, gl, bh, bl]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                let&lt;&#x2F;span&gt;&lt;span&gt; r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; hl_to_u8&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;rh,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;rl);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                let&lt;&#x2F;span&gt;&lt;span&gt; g&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; hl_to_u8&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;gh,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;gl);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                let&lt;&#x2F;span&gt;&lt;span&gt; b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; hl_to_u8&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;bh,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;bl);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;                Self&lt;&#x2F;span&gt;&lt;span&gt; { r, g, b }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; panic!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;invalid colour&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[userliterals]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; flag&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 4&lt;&#x2F;span&gt;&lt;span&gt;] {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Compile time error if uncommented.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; let invalid = &amp;quot;lololol&amp;quot;: [[Color]];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;#ffff00&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;]],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;#ffffff&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;]],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;#800080&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;]],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;        &amp;quot;#000000&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Color&lt;&#x2F;span&gt;&lt;span&gt;]],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    dbg!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;flag&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As mentioned above, you &lt;em&gt;must&lt;&#x2F;em&gt; include both.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[dependencies]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;customlit = { path = &amp;quot;..&#x2F;customlit&amp;quot; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;constinto = { path = &amp;quot;..&#x2F;constinto&amp;quot; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;should_i_do_this&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#should_i_do_this&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Should I Do This?&lt;&#x2F;h2&gt;
&lt;p&gt;Short answer? No.&lt;&#x2F;p&gt;
&lt;p&gt;Long answer? Not yet.&lt;&#x2F;p&gt;
&lt;p&gt;Support for const trait implementations are pretty weak at the moment, so I
couldn’t actually get &lt;code&gt;ConstPanickingFrom&lt;&#x2F;code&gt; implemented for any standard
library types, which would have made making it a trait actually worth it.&lt;&#x2F;p&gt;
&lt;p&gt;To be fair, it did say it was an incomplete feature.&lt;&#x2F;p&gt;
&lt;p&gt;But I believe this model, or something &lt;em&gt;like&lt;&#x2F;em&gt; it would be a decent idea for
custom literals.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;alternate_methods&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#alternate_methods&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Alternate Methods&lt;&#x2F;h2&gt;
&lt;p&gt;This initially didn’t have a trait, and just called a magic method that was
expected to be implemented on the type. This meant you wouldn’t be able to
implement it for any standard library types, and is &lt;em&gt;pretty magic&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;This could be implemented just on types that use &lt;code&gt;TryFrom&lt;&#x2F;code&gt;, but not every type
implements that,
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;net&#x2F;enum.SocketAddr.html&quot;&gt;SocketAddr&lt;&#x2F;a&gt; only
implements &lt;code&gt;FromStr&lt;&#x2F;code&gt; and not &lt;code&gt;TryFrom&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Alternatively, this could be implemented just on types that use &lt;code&gt;FromStr&lt;&#x2F;code&gt;, but
that might be too much work for some types. &lt;code&gt;NonZeroI32&lt;&#x2F;code&gt; &lt;em&gt;does&lt;&#x2F;em&gt; implement &lt;code&gt;FromStr&lt;&#x2F;code&gt;,
but it’s &lt;em&gt;easier&lt;&#x2F;em&gt; for types to start off with an integer. That, and having an
integer literal in your code leads to better syntax highlighting.&lt;&#x2F;p&gt;
&lt;p&gt;Ideally, rust would evaluate code that uses values that are (partially) known
at compile time, and then show a warning&#x2F;error if it unconditionally panics.
This would work even for non-const functions, and possibly even methods like
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;sync&#x2F;atomic&#x2F;struct.AtomicBool.html#method.load&quot;&gt;AtomicBool::load&lt;&#x2F;a&gt;
could panic if you pass in an &lt;code&gt;Order&lt;&#x2F;code&gt; of &lt;code&gt;Release&lt;&#x2F;code&gt; or &lt;code&gt;AcqRel&lt;&#x2F;code&gt;. Doing this would mean
you could just write &lt;code&gt;let x = &quot;192.168.0.1:1234&quot;.parse().unwrap();&lt;&#x2F;code&gt; and
assuming type inference means that the compiler knows what &lt;code&gt;x&lt;&#x2F;code&gt; is, you’ll get a
compile error if it can’t parse as a socket address correctly.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Golfing rust features</title>
          <pubDate>Fri, 14 Aug 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/golfing-rust-features/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2020/08/14/golfing-rust-features.html</guid>
          <description>&lt;p&gt;Inspired by a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;dev.to&#x2F;tfausak&#x2F;golfing-language-extensions-2obl&quot;&gt;post about using as many language extensions as possible in
haskell&lt;&#x2F;a&gt;, I decided to make a 60*4 block
of nightmares that requires as many nightly rust features to compile as possible.&lt;&#x2F;p&gt;
&lt;p&gt;I’m not expecting it to &lt;em&gt;work&lt;&#x2F;em&gt;, or even run. My benchmark was just “compile”. I managed to get 17
features in my 60 by 4 block of code. No idea if this is any good or not.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_fn)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_panic)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(never_type)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_mut_refs)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_raw_ptr_deref)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_in_array_repeat_expressions)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_raw_ptr_to_usize_cast)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(arbitrary_enum_discriminant)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(crate_visibility_modifier)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(const_generics)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(non_ascii_idents)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(or_patterns)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(raw_ref_op)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(repr128)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(main)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(start)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#![feature(type_ascription)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[repr(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u128&lt;&#x2F;span&gt;&lt;span&gt;)]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;crate enum&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; O&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; X&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;S&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;!&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;N&lt;&#x2F;span&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;union&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Y&lt;&#x2F;span&gt;&lt;span&gt;{y&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:!&lt;&#x2F;span&gt;&lt;span&gt;}#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[main]#[start]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const fn&lt;&#x2F;span&gt;&lt;span&gt; ｘ(x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;isize&lt;&#x2F;span&gt;&lt;span&gt;,y&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; u8&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;isize&lt;&#x2F;span&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;O&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;N&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;unsafe&lt;&#x2F;span&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; x[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; _){&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;O&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;S&lt;&#x2F;span&gt;&lt;span&gt;(y&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt;y&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;raw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; mut&lt;&#x2F;span&gt;&lt;span&gt; x[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; O&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;4&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;as&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; usize&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;usize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;y,_&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;todo!&lt;&#x2F;span&gt;&lt;span&gt;()}}}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The haskell solution got a ratio of around 3 characters of source code per feature. The rust code
is worse, at 14 characters per feature. I could probably get more dense at the cost of not having
quite so many features.&lt;&#x2F;p&gt;
&lt;p&gt;Interesting to note is just how many places you are allowed to not have whitespace between tokens
and the parser doesn’t complain.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>URLs</title>
          <pubDate>Thu, 13 Aug 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/urls/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2020/08/13/urls.html</guid>
          <description>&lt;p&gt;My requirements for URLs on websites, and what makes a good URL.&lt;&#x2F;p&gt;
&lt;p&gt;URLs MUST be stable. A link to a specific post, shouldn’t &lt;em&gt;change&lt;&#x2F;em&gt; what it points to 5 years
down the line. Nor should it die, if the content’s still available but under a different name.&lt;&#x2F;p&gt;
&lt;p&gt;URLs SHOULD be user editable, and the parts that aren’t should be obviously opaque.&lt;&#x2F;p&gt;
&lt;p&gt;URLs MAY have immediately relevant information in them that isn’t strictly needed to resolve the
URL.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Here’s a sampling of URLs&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;6g3sc2&#x2F;best_way_to_multithread_a_simple_function&#x2F;&quot;&gt;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;6g3sc2&#x2F;best_way_to_multithread_a_simple_function&#x2F;&lt;&#x2F;a&gt; (reddit)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;wg-allocators&#x2F;issues&#x2F;17&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;wg-allocators&#x2F;issues&#x2F;17&lt;&#x2F;a&gt; (github)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;src&#x2F;std&#x2F;io&#x2F;mod.rs.html#502-964&quot;&gt;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;src&#x2F;std&#x2F;io&#x2F;mod.rs.html#502-964&lt;&#x2F;a&gt; (rustdoc)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;io&#x2F;trait.Read.html#method.read_to_end&quot;&gt;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;io&#x2F;trait.Read.html#method.read_to_end&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;channel&#x2F;UC1usFRN4LCMcfIV7UjHNuQg&#x2F;videos&quot;&gt;https:&#x2F;&#x2F;www.youtube.com&#x2F;channel&#x2F;UC1usFRN4LCMcfIV7UjHNuQg&#x2F;videos&lt;&#x2F;a&gt; (youtube channel)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dQw4w9WgXcQ&quot;&gt;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dQw4w9WgXcQ&lt;&#x2F;a&gt; (youtube video)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;discordapp.com&#x2F;channels&#x2F;729293063826175566&#x2F;729293064267238942&#x2F;738076547881893032&quot;&gt;https:&#x2F;&#x2F;discordapp.com&#x2F;channels&#x2F;729293063826175566&#x2F;729293064267238942&#x2F;738076547881893032&lt;&#x2F;a&gt; (discord)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.co.uk&#x2F;dp&#x2F;B0791RGQW3&#x2F;ref=s9_acsd_al_bw_c2_x_0_t?pf_rd_m=A3P5ROKL5A1OLE&amp;amp;pf_rd_s=merchandised-search-11&amp;amp;pf_rd_r=SQHJ5TXNCSRE9PRP4QAG&amp;amp;pf_rd_t=101&amp;amp;pf_rd_p=eb3feabb-ea62-4002-b39e-5ccc29f387ba&amp;amp;pf_rd_i=14100223031&quot;&gt;https:&#x2F;&#x2F;www.amazon.co.uk&#x2F;dp&#x2F;B0791RGQW3&#x2F;ref=s9_acsd_al_bw_c2_x_0_t?pf_rd_m=A3P5ROKL5A1OLE&amp;amp;pf_rd_s=merchandised-search-11&amp;amp;pf_rd_r=SQHJ5TXNCSRE9PRP4QAG&amp;amp;pf_rd_t=101&amp;amp;pf_rd_p=eb3feabb-ea62-4002-b39e-5ccc29f387ba&amp;amp;pf_rd_i=14100223031&lt;&#x2F;a&gt;
(amazon)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;reddit&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#reddit&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Reddit&lt;&#x2F;h2&gt;
&lt;p&gt;Take the reddit url as an example. Splitting it up into parts lets us see&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https:&#x2F;&#x2F;www.reddit.com&#x2F;&lt;&#x2F;code&gt; We’re going to reddit&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;r&#x2F;&lt;&#x2F;code&gt; We’re going to a subreddit page&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;rust&#x2F;&lt;&#x2F;code&gt; We’re going to the rust subreddit&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;comments&#x2F;&lt;&#x2F;code&gt; We’re likely to see comments&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;6g3sc2&#x2F;&lt;&#x2F;code&gt; Some opaque identifier&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;best_way_to_multithread_a_simple_function&#x2F;&lt;&#x2F;code&gt; The post is about multithreading&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;All in all, the URL is fairly descriptive, if not a bit long.&lt;&#x2F;p&gt;
&lt;p&gt;The only actually critical part of the URL is the post id, &lt;code&gt;6g3sc2&lt;&#x2F;code&gt;. You can just go to
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;6g3sc2&quot;&gt;https:&#x2F;&#x2F;www.reddit.com&#x2F;6g3sc2&lt;&#x2F;a&gt; and it will take you to that post. The rest of the URL is there to
show information.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;github&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#github&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
GitHub&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https:&#x2F;&#x2F;github.com&#x2F;&lt;&#x2F;code&gt; We’re going to github&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;rust-lang&#x2F;&lt;&#x2F;code&gt; It’s under the &lt;code&gt;rust-lang&lt;&#x2F;code&gt; user or organisation&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;wg-allocators&#x2F;&lt;&#x2F;code&gt; The repo is &lt;code&gt;wg-allocators&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;issues&#x2F;&lt;&#x2F;code&gt; We’re looking at issues&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;17&lt;&#x2F;code&gt; The 17th issue.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The only non-descriptive element here is the issue number, but even then, because it’s all
hierarchical, issue numbers tend to be far lower than a reddit post id, so it’s more feasible for
someone to remember issue numbers.&lt;&#x2F;p&gt;
&lt;p&gt;And a github URL &lt;em&gt;is&lt;&#x2F;em&gt; very hierarchical. &lt;code&gt;wg-allocators&lt;&#x2F;code&gt; could be completely different repos
depending on what user it’s under, and same for the issue number. This helps to keep identifiers
short, as they don’t need to be globally unique, just unique under the parent namespace.&lt;&#x2F;p&gt;
&lt;p&gt;All in all, compact and pretty informative as to roughly where you’re going. Maybe adding the issue
title would help give more context, but it would just be some text that’s taking up space, since
issue titles aren’t identifiers.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rustdoc_source&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#rustdoc_source&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Rustdoc Source&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;&lt;&#x2F;code&gt; We’re going to a documentation page&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;src&#x2F;&lt;&#x2F;code&gt; Viewing the source code of something&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;std&#x2F;&lt;&#x2F;code&gt; The &lt;code&gt;std&lt;&#x2F;code&gt; crate&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;io&#x2F;&lt;&#x2F;code&gt; The &lt;code&gt;io&lt;&#x2F;code&gt; module in &lt;code&gt;std&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;mod.rs.html&lt;&#x2F;code&gt; The &lt;code&gt;mod.rs&lt;&#x2F;code&gt; file, rendered as HTML&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;#502-964&lt;&#x2F;code&gt; Lines 502 to 964 are highlighted&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;There’s very little redundancy here, and all of the information is human readable and
understandable.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rustdoc_main&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#rustdoc_main&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Rustdoc Main&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;&lt;&#x2F;code&gt; Again, we’re going to a documentation page&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;std&#x2F;io&#x2F;&lt;&#x2F;code&gt; But not the source code, just the &lt;code&gt;io&lt;&#x2F;code&gt; module in std&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;trait.Read.html&lt;&#x2F;code&gt; We’re seeing the documentation for a trait named Read&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;#method.read_to_end&lt;&#x2F;code&gt; And going to the &lt;code&gt;read_to_end&lt;&#x2F;code&gt; method on it.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;All in all, readable, and you can have a good chance of guessing how to link to something you’ve
not seen the URL for.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;youtube_channel&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#youtube_channel&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Youtube channel&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https:&#x2F;&#x2F;www.youtube.com&#x2F;&lt;&#x2F;code&gt; We’re going to youtube&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;channel&#x2F;&lt;&#x2F;code&gt; Viewing a channel&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;UC1usFRN4LCMcfIV7UjHNuQg&#x2F;&lt;&#x2F;code&gt; Some &lt;em&gt;long&lt;&#x2F;em&gt; opaque identifier&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;videos&lt;&#x2F;code&gt; But at least we know we’re seeing the videos.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This isn’t all that useful.&lt;&#x2F;p&gt;
&lt;p&gt;Noteworthy is youtube has &lt;em&gt;user&lt;&#x2F;em&gt; pages, which look like &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;user&#x2F;NurdRage&quot;&gt;https:&#x2F;&#x2F;www.youtube.com&#x2F;user&#x2F;NurdRage&lt;&#x2F;a&gt;.
This is an informative URL, very high signal to noise ratio. But &lt;em&gt;channel&lt;&#x2F;em&gt; pages get the fun
base64. But wait, there’s more! There’s also &lt;em&gt;new&lt;&#x2F;em&gt; style channels, which look like
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;c&#x2F;Nighthawkinlight&quot;&gt;https:&#x2F;&#x2F;www.youtube.com&#x2F;c&#x2F;Nighthawkinlight&lt;&#x2F;a&gt;. These are like the user pages with a human readable
name, but using &lt;code&gt;&#x2F;c&#x2F;&lt;&#x2F;code&gt; instead of &lt;code&gt;&#x2F;channel&#x2F;&lt;&#x2F;code&gt;. Why? No idea.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;youtube_video&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#youtube_video&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Youtube video&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https:&#x2F;&#x2F;www.youtube.com&lt;&#x2F;code&gt; We’re going to youtube&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;&#x2F;watch?&lt;&#x2F;code&gt; Watching a video&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;v=dQw4w9WgXcQ&lt;&#x2F;code&gt; With this opaque video id.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;It &lt;em&gt;is&lt;&#x2F;em&gt; opaque, but there’s not much shorter you can get, there’s not extra shit tacked on for the
fun of it. (Youtube has a short link in the form of &lt;code&gt;youtu.be&#x2F;&amp;lt;video id&amp;gt;&lt;&#x2F;code&gt;)&lt;&#x2F;p&gt;
&lt;p&gt;And you can modify the link to start at a specific timestamp, using &lt;code&gt;t=1337&lt;&#x2F;code&gt;, where 1337 is the
number of seconds past the start of the video. I’d prefer it to be a colon delimited timestamp
though, as that’s more readable. But even still, anyone with a simple calculator can work out the
seconds to start at a given timestamp.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;discord&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#discord&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Discord&lt;&#x2F;h2&gt;
&lt;p&gt;(Discord URL has been modified, but it doesn’t change the point)&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https:&#x2F;&#x2F;discordapp.com&#x2F;&lt;&#x2F;code&gt; Going to discord&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;channels&#x2F;&lt;&#x2F;code&gt; Seeing a channel&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;729293063826175566&lt;&#x2F;code&gt; Opaque server id&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;729293064267238942&lt;&#x2F;code&gt; Opaque channel id&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;738076547881893032&lt;&#x2F;code&gt; Opaque message id.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I would not at all be surprised if only the message id is really &lt;em&gt;needed&lt;&#x2F;em&gt; here. And it’s not like
the server id and channel id are providing any useful information.&lt;&#x2F;p&gt;
&lt;p&gt;It’s not like you’re &lt;em&gt;really&lt;&#x2F;em&gt; meant to be using these, in any case. They don’t even embed, and
using them’s a pretty bad experience.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;amazon&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#amazon&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Amazon&lt;&#x2F;h2&gt;
&lt;p&gt;Okay… You ready?&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https:&#x2F;&#x2F;www.amazon.co.uk&#x2F;&lt;&#x2F;code&gt; Going to amazon&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;dp&#x2F;&lt;&#x2F;code&gt; No idea.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;B0791RGQW3&#x2F;&lt;&#x2F;code&gt; The actual unique product id&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;ref=s9_acsd_al_bw_c2_x_0_t?&lt;&#x2F;code&gt; And a whole bunch of opaque identifiers that amazon probably cares
about, but I don’t.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;pf_rd_m=A3P5ROKL5A1OLE&amp;amp;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;pf_rd_s=merchandised-search-11&amp;amp;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;pf_rd_r=SQHJ5TXNCSRE9PRP4QAG&amp;amp;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;pf_rd_t=101&amp;amp;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;pf_rd_p=eb3feabb-ea62-4002-b39e-5ccc29f387ba&amp;amp;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;pf_rd_i=14100223031&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;All of this shit isn’t needed, by the way. Just &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;amazon.co.uk&#x2F;dp&#x2F;B0791RGQW3&quot;&gt;https:&#x2F;&#x2F;amazon.co.uk&#x2F;dp&#x2F;B0791RGQW3&lt;&#x2F;a&gt; works fine. So
if you’re sending an amazon link, strip the tracking shit out.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Opaque URLs like youtube’s are good in that they don’t contain any information that might need to
change. For instance, if you have a deadname in a URL, perhaps as a github username, that’s a
problem. At best, you’re able to change it, and have hard redirects to the new name, but there will
still be old links floating around with the old information.&lt;&#x2F;p&gt;
&lt;p&gt;On the other hand, this advantage of not keeping any information has the issue that… the URL
provides no information.&lt;&#x2F;p&gt;
&lt;p&gt;A URL doesn’t need &lt;em&gt;multiple&lt;&#x2F;em&gt; opaque identifiers though. If you &lt;em&gt;are&lt;&#x2F;em&gt; going to do that, then either
make use of the hierarchy to shorten the URL, or cut leave it as a direct link to the object, and
cut out the hierarchy.&lt;&#x2F;p&gt;
&lt;p&gt;Informational text that doesn’t help resolve the URL can be useful, but it should be obvious to a
user what’s informational text, so they can strip it out.&lt;&#x2F;p&gt;
&lt;p&gt;Any URL components that are not human readable and that don’t help resolve the page can, and
should, just be removed. Or at the very least, if you &lt;em&gt;do&lt;&#x2F;em&gt; feel the need to track users, use a
smaller identifier than what amazon uses. And name it something obvious, like &lt;code&gt;?tracking&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If you’re going to have an identifer that’s intended to be opaque, it &lt;em&gt;should&lt;&#x2F;em&gt; be completely
opaque. Don’t use the timestamp or any structured data in it. An exception being using, say, an
issue number, because the number there is known to the users and it’s reasonably expected to be
public. But seeing a URL should not let anyone who is not the website see any information about the
user who created the URL.&lt;&#x2F;p&gt;
&lt;p&gt;If you have anything after a hash, that better take you to a specific &lt;em&gt;part&lt;&#x2F;em&gt; of a page, with the
URL without the hash still being valid.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>How to fix cobalt.rs&#x27;s feed showing only excerpts</title>
          <pubDate>Sat, 08 Aug 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/how-to-fix-cobalts-feed/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/2020/08/08/how-to-fix-cobalts-feed.html</guid>
          <description>&lt;p&gt;By default, the content in the RSS feed is the post description, then the excerpt (if it exists),
and then finally the actual page content.&lt;&#x2F;p&gt;
&lt;p&gt;IMO, this is a &lt;em&gt;bad&lt;&#x2F;em&gt; default. If people want to read the first few paragraphs in a RSS reader but
switch to my website to read the rest, they can do that. But I don’t want to &lt;em&gt;force&lt;&#x2F;em&gt; them to do
that.&lt;&#x2F;p&gt;
&lt;p&gt;In any case, I’ve included a patch against &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cobalt-org&#x2F;cobalt.rs&#x2F;&quot;&gt;cobalt.rs&lt;&#x2F;a&gt;’s
current &lt;code&gt;master&lt;&#x2F;code&gt; branch to just always use the page content, but still let you use the excerpt for
other things, like page contents. And if you’ve not used my site’s RSS feed because it didn’t show
full contents, you can use it now.&lt;&#x2F;p&gt;
&lt;p&gt;Formatting’s still a bit weird on my reader, but it’s usable.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;diff&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span&gt;git a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;document&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;document&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;index 85a3ec5&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..&lt;&#x2F;span&gt;&lt;span&gt;e1a74f1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 100644&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;---&lt;&#x2F;span&gt;&lt;span&gt; a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;document&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;+++&lt;&#x2F;span&gt;&lt;span&gt; b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;src&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;document&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;rs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;@@ -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;274&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;23&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;274&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;9&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; @@&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Document&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;     fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; description_to_str&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Option&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;String&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;front&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-            .&lt;&#x2F;span&gt;&lt;span&gt;description&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;clone&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;or_else&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;||&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;attributes&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;excerpt&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;and_then&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt;excerpt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                    if&lt;&#x2F;span&gt;&lt;span&gt; excerpt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;is_nil&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;                        None&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;                    }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;                        Some&lt;&#x2F;span&gt;&lt;span&gt;(excerpt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;render&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;                    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;                })&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;            })&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;or_else&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;||&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;attributes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-                    .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;content&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-                    .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt;s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt; s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;render&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;            })&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;+&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;attributes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;+            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;content&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;+            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt;s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span&gt; s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;render&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;())&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;     &#x2F;&#x2F;&#x2F; Renders liquid templates into HTML in the context of current document.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</description>
      </item>
      
      
      <item>
          <title>My problem with git-annex</title>
          <pubDate>Fri, 07 Aug 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/my-problem-with-git-annex/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/my-problem-with-git-annex.html</guid>
          <description>&lt;p&gt;I have a few problems with git-annex which lead me to stop using it (I’m running &lt;code&gt;git annex uninit&lt;&#x2F;code&gt;
as I write this).&lt;&#x2F;p&gt;
&lt;p&gt;It’s &lt;em&gt;close&lt;&#x2F;em&gt; to what I want, but not quite there yet.&lt;&#x2F;p&gt;
&lt;p&gt;These suggestions are for a &lt;em&gt;new&lt;&#x2F;em&gt; system, not one based on git. And it may be biased towards what I
tried to use git-annex for.&lt;&#x2F;p&gt;
&lt;p&gt;This new system should be usable to manage &lt;em&gt;all user data&lt;&#x2F;em&gt; on a system. That means it needs to be
able to sync data too, and act as a backup system. My ideal system is one where all user data is
versioned, and all system data is handled by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nixos.org&#x2F;&quot;&gt;NixOS&lt;&#x2F;a&gt;, making a reproducible in
1 command system.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;positives&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#positives&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
The Positives&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;compatibility&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#compatibility&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Compatibility&lt;&#x2F;h3&gt;
&lt;p&gt;It’s just a git repo with some extra stuff. You &lt;em&gt;can&lt;&#x2F;em&gt; store it on a stock git server (Not the data,
but the log of where the data is).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;simplicity&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#simplicity&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Simplicity&lt;&#x2F;h3&gt;
&lt;p&gt;Git-annex is very simple (the core is, you can most definitely get more complicated with the copy
tracking).&lt;&#x2F;p&gt;
&lt;p&gt;But basically all that you do is replace file content with the hash of the content, and then manage
the actual files separately. That’s the primary difference between git-annex and git itself.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;negatives&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#negatives&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
The Negatives&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;scalability&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#scalability&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Scalability&lt;&#x2F;h3&gt;
&lt;p&gt;It doesn’t scale well.&lt;&#x2F;p&gt;
&lt;p&gt;Not the &lt;em&gt;size&lt;&#x2F;em&gt; of files, but the &lt;em&gt;amount&lt;&#x2F;em&gt;. If you’re dealing entirely with a few thousand 4GB media
files, then git-annex will work wonders here. But some of the things I try to manage with it (A
&lt;em&gt;lot&lt;&#x2F;em&gt; of small files) lead &lt;code&gt;git status&lt;&#x2F;code&gt; to be &lt;em&gt;incredibly&lt;&#x2F;em&gt; slow, sometimes a few minutes because it
wants to re-index a few thousand files for whatever reason. God help you when you actually make
sweeping changes.&lt;&#x2F;p&gt;
&lt;p&gt;Git-annex is the reason I made my shell git prompt async. Because otherwise, I’d just have to drop
to bash&#x2F;sh if I wanted it to be usable.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;fix_scalability&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#fix_scalability&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
How to fix?&lt;&#x2F;h4&gt;
&lt;p&gt;Don’t use git. Git isn’t designed for this, even if you do remove the large file problem.&lt;&#x2F;p&gt;
&lt;p&gt;Backup tools can walk a whole file system in seconds. Do things like they do.&lt;&#x2F;p&gt;
&lt;p&gt;To be fair, git &lt;em&gt;might&lt;&#x2F;em&gt; be able to be modified to make this work, but using git to track possibly
tens of thousands of dirty files feels outside the scope of a source control tracking tool.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;small_changes&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#small_changes&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Small Changes&lt;&#x2F;h3&gt;
&lt;p&gt;If you have a large file changes many times, but only a few bytes each time, git-annex needs to
store the file in full each time. Again, this might be fine depending on the kind of file you
store, but this is definitely not fine for me, who uses git-annex to manage their music (So a
re-tagging will need me to store &lt;em&gt;the whole file again&lt;&#x2F;em&gt;).&lt;&#x2F;p&gt;
&lt;h4 id=&quot;fix_small_changes&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#fix_small_changes&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
How to fix?&lt;&#x2F;h4&gt;
&lt;p&gt;Chunk each file into parts using a rolling hash (don’t try to make diffs), and then store each
chunk individually. You can make a tree of chunks this way, and split a large file into roughly 16KB
chunks with only needing to store an additional 60KB or so per modification (Assuming a 4-5 layer
tree). This idea was taken from &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;bup&#x2F;bup&#x2F;&quot;&gt;bup&lt;&#x2F;a&gt;, and is rather cool.&lt;&#x2F;p&gt;
&lt;p&gt;In addition, for locked files, allow a file to act as the storage for chunks. (As in, say “if you
want chunk &lt;code&gt;ABCDEF&lt;&#x2F;code&gt;, look at &lt;code&gt;locked_file[1000..6000]&lt;&#x2F;code&gt;”. A file should be able to act as the
storage of more than one chunk. Unlocked files can’t be used to store chunks reliably, since they
can be modified at any time.&lt;&#x2F;p&gt;
&lt;p&gt;This would greatly reduce disk usage while still not allowing data loss.&lt;&#x2F;p&gt;
&lt;p&gt;Data that doesn’t need to be directly available (the chunks backing unlocked files) can be
compressed, which will further mitigate the excess space usage.&lt;&#x2F;p&gt;
&lt;p&gt;This “using a file as storage for chunks” is definitely additional complexity. It’s by no means
mandatory for this system to work.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;locking&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#locking&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Locking&lt;&#x2F;h3&gt;
&lt;p&gt;Locking gets in the way so often. Not a lot to add here. Getting an error when I make a change to
my music library using &lt;code&gt;beets&lt;&#x2F;code&gt;, then needing to go back and unlock the file and repeat the
operation is tedious.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;fix_locking&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#fix_locking&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
How to fix?&lt;&#x2F;h4&gt;
&lt;p&gt;Locking should be reserved for special circumstances where you have a large file that you &lt;em&gt;know&lt;&#x2F;em&gt;
won’t be changed. It should be opt in. I know locking allows git-annex to only store a single copy
of a file, but it’s still annoying.&lt;&#x2F;p&gt;
&lt;p&gt;Yes, you can use &lt;code&gt;git add&lt;&#x2F;code&gt; to add a file without locking it, but that’s slower than &lt;code&gt;git annex add&lt;&#x2F;code&gt;
because &lt;code&gt;git add&lt;&#x2F;code&gt; needs to use git filters. It also doesn’t give an ETA. I’ve also ran into issues
where &lt;code&gt;git add&lt;&#x2F;code&gt; would write the file to git instead of filtering it, and then suddenly you commit a
4MB file directly into git. That should not be even possible.&lt;&#x2F;p&gt;
&lt;p&gt;Ideally, there should be a mechanism that allows you to automatically unlock&#x2F;relock files when you
need to write to them. This should be fail-safe, in that it should never &lt;em&gt;lose&lt;&#x2F;em&gt; data, but it’s okay
if it fails to unlock if it should have. (Perhaps an inotify watch program that unlocks on file
open, or a FUSE file system?)&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>C#&#x27;s broken type system</title>
          <pubDate>Thu, 02 Jul 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/csharps-broken-type-system/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/csharps-broken-type-system.html</guid>
          <description>&lt;p&gt;C# has a broken type system. And by that I mean the vast majority of function signatures that you
write in C# are lies, and your function &lt;em&gt;won’t&lt;&#x2F;em&gt; be able to do meaningful work with all values that
compile, and that there’s nothing you can do to fix this.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Focus on &lt;code&gt;OrderDrink&lt;&#x2F;code&gt;. We ask for a Customer (which is a class, as is standard in C#) and a &lt;code&gt;DrinkType&lt;&#x2F;code&gt; enum.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;using&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; System&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Program&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        public&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; age&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;IsNullOrWhiteSpace&lt;&#x2F;span&gt;&lt;span&gt;(name)) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                throw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InvalidOperationException&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;name is required&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; (age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 18&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;                throw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InvalidOperationException&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;you must be 18 or older&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            Name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            Age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        public string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Name&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; get&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        public int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Age&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; get&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    enum&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; DrinkType&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        Vodka&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        Rum&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        Beer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    static void&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; OrderDrink&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Customer customer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; DrinkType drinkType&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        Console&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;WriteLine&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;$&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;{customer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Name}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;, age &lt;&#x2F;span&gt;&lt;span&gt;{customer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Age}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; is ordering a drink.&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        Console&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;WriteLine&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;$&amp;quot;Give them their &lt;&#x2F;span&gt;&lt;span&gt;{drinkType&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;ToString&lt;&#x2F;span&gt;&lt;span&gt;()}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;.&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    public static void&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; Main&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span&gt;[]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; args&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;        &#x2F;&#x2F; here&amp;#39;s where the magic will happen&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;First off, we can just try passing &lt;code&gt;null&lt;&#x2F;code&gt; to &lt;code&gt;Customer&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;public static void&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; Main&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span&gt;[]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; args&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    OrderDrink&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; DrinkType&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Vodka)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;What do we get?&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Unhandled Exception:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;System.NullReferenceException: Object reference not set to an instance of an object&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  at Program.OrderDrink (Program+Customer customer, Program+DrinkType drinkType) [0x00001] in &amp;lt;f40dc6945abf46fe8ff95b5af113af55&amp;gt;:0 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  at Program.Main (System.String[] args) [0x00001] in &amp;lt;f40dc6945abf46fe8ff95b5af113af55&amp;gt;:0 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  at Program.OrderDrink (Program+Customer customer, Program+DrinkType drinkType) [0x00001] in &amp;lt;f40dc6945abf46fe8ff95b5af113af55&amp;gt;:0 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  at Program.Main (System.String[] args) [0x00001] in &amp;lt;f40dc6945abf46fe8ff95b5af113af55&amp;gt;:0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Oh. Well, that’s not good.&lt;&#x2F;p&gt;
&lt;p&gt;We’re accessing &lt;code&gt;customer.Name&lt;&#x2F;code&gt;, but &lt;code&gt;customer&lt;&#x2F;code&gt; is null.&lt;&#x2F;p&gt;
&lt;p&gt;I’ve heard of these things called “&lt;code&gt;struct&lt;&#x2F;code&gt;s”, maybe they’ll help us?&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Everything else stays the same, all we changed is&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F;   class to struct&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now what happens?&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;test.cs(36,20): error CS1503: Argument 1: cannot convert from &amp;#39;&amp;lt;null&amp;gt;&amp;#39; to &amp;#39;Program.Customer&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is what we want!&lt;&#x2F;p&gt;
&lt;p&gt;Now we need to go through the proper constructor, right?&lt;&#x2F;p&gt;
&lt;p&gt;Nope.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;public static void&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; Main&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span&gt;[]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; args&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    OrderDrink&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; DrinkType&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Vodka)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;, age 0 is ordering a drink.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Give them their Vodka.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Well, fuck. We didn’t &lt;em&gt;ask&lt;&#x2F;em&gt; for a parameterless constructor, but we get one anyways. A constructor
that does nothing, where we can’t enforce any of our invariants.&lt;&#x2F;p&gt;
&lt;p&gt;Let’s try to stop this, just by adding a parameterless constructor. We can at least throw, right? It’s
still a runtime error, but one closer to the bug.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    public&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        throw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; InvalidOperationException&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;don&amp;#39;t call me!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #5A6673;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Rest of customer here&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;test.cs(19,17): error CS0568: Structs cannot contain explicit parameterless constructors&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Oh.&lt;&#x2F;p&gt;
&lt;p&gt;See: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;dotnet&#x2F;roslyn&#x2F;issues&#x2F;1029&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;dotnet&#x2F;roslyn&#x2F;issues&#x2F;1029&lt;&#x2F;a&gt; where this issue was discussed.&lt;&#x2F;p&gt;
&lt;p&gt;And even if you &lt;em&gt;could&lt;&#x2F;em&gt; block that, you could always do &lt;code&gt;default(Customer)&lt;&#x2F;code&gt;, or create an array of
&lt;code&gt;Customer&lt;&#x2F;code&gt;’s, all of which will be zero initialised (A zero initialised number is, surprise
surprise, zero, and a zero initialised reference type like &lt;code&gt;string&lt;&#x2F;code&gt; will be &lt;code&gt;null&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Okay okay, so &lt;code&gt;class&lt;&#x2F;code&gt;es don’t forbid &lt;code&gt;null&lt;&#x2F;code&gt; being passed in, and &lt;code&gt;struct&lt;&#x2F;code&gt;s can’t enforce invariants
when you’re making them. Anything else broken in this cursed language?&lt;&#x2F;p&gt;
&lt;p&gt;Yes!&lt;&#x2F;p&gt;
&lt;p&gt;Notice how we’re asking for a &lt;code&gt;DrinkType&lt;&#x2F;code&gt; enum?&lt;&#x2F;p&gt;
&lt;p&gt;Well, you can do this.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;OrderDrink&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;David&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 21&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;DrinkType&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 420&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BFBDB6B3;&quot;&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;David, age 21 is ordering a drink.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Give them their 420.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That’s right, enums are Just A Number! To be fair, enums can be used as bitfields, so that means
all non-bitfield uses of them should be this broken.&lt;&#x2F;p&gt;
&lt;p&gt;Breaking invariants through other means, like untagged unions (arbitrary memory read&#x2F;writes without
unsafe code let’s go!) or reflection is outside the scope of this post. Maybe a future one.&lt;&#x2F;p&gt;
&lt;p&gt;For the interest of equality, let’s break Rust’s type system.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; i32&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[derive(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Debug&lt;&#x2F;span&gt;&lt;span&gt;)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;enum&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; CustomerError&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    NoName&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    Underage&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; new&lt;&#x2F;span&gt;&lt;span&gt;(name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span&gt;, age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; i32&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Result&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Customer&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; CustomerError&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;trim&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;is_empty&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Err&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;CustomerError&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;NoName&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; age&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 18&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Err&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;CustomerError&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Underage&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;        Ok&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Customer&lt;&#x2F;span&gt;&lt;span&gt; { name, age })&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; name&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;        &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; age&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; i32&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #39BAE6;font-style: italic;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;age&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#[derive(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Debug&lt;&#x2F;span&gt;&lt;span&gt;)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;enum&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; DrinkType&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    Vodka&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    Rum&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;    Beer&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; order_drink&lt;&#x2F;span&gt;&lt;span&gt;(customer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Customer&lt;&#x2F;span&gt;&lt;span&gt;, drink&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; DrinkType&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    println!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;{}, age {} is ordering a drink.&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, customer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;(), customer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;age&lt;&#x2F;span&gt;&lt;span&gt;());&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    println!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;Give them their {:?}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, drink);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; customer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Customer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;quot;David&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;(),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 21&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;    order_drink&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;customer,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; DrinkType&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;Rum&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Okay, the stage is set. So uhh… What do we do? I guess we can try passing in &lt;code&gt;null&lt;&#x2F;code&gt;?&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error[E0425]: cannot find value `null` in this scope&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  --&amp;gt; test.rs:48:17&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;48 |     order_drink(null, DrinkType::Rum);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |                 ^^^^ not found in this scope&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;help: consider importing this function&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;1  | use std::ptr::null;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error: aborting due to previous error&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;For more information about this error, try `rustc --explain E0425`.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Oh, maybe we can try the null function?&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error[E0308]: mismatched types&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  --&amp;gt; test.rs:48:17&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;48 |     order_drink(std::ptr::null(), DrinkType::Rum);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |                 ^^^^^^^^^^^^^^^^ expected `&amp;amp;Customer`, found *-ptr&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   = note: expected reference `&amp;amp;Customer`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            found raw pointer `*const _`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error: aborting due to previous error&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;For more information about this error, try `rustc --explain E0308`.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;What’s the difference between a &lt;code&gt;&amp;amp;&lt;&#x2F;code&gt; and a &lt;code&gt;*&lt;&#x2F;code&gt;?&lt;&#x2F;p&gt;
&lt;p&gt;Well, a &lt;code&gt;&amp;amp;&lt;&#x2F;code&gt; is a &lt;em&gt;reference&lt;&#x2F;em&gt;. If you have a &lt;code&gt;&amp;amp;Customer&lt;&#x2F;code&gt;, you &lt;em&gt;know&lt;&#x2F;em&gt; you can access a perfectly
valid &lt;code&gt;Customer&lt;&#x2F;code&gt; using it. It &lt;em&gt;is&lt;&#x2F;em&gt; a pointer, but it’s a pointer that carries with it guarantees
that for as long as you have access to it, the thing it points to will be valid.&lt;&#x2F;p&gt;
&lt;p&gt;A &lt;code&gt;*&lt;&#x2F;code&gt; is more like a C pointer. It’s just a number. Is there something on the other side of it? Who
knows??&lt;&#x2F;p&gt;
&lt;p&gt;What this all means is that Rust won’t let us create a reference to a Customer if we don’t actually
&lt;em&gt;have&lt;&#x2F;em&gt; a customer to make a reference to.&lt;&#x2F;p&gt;
&lt;p&gt;Note how in this simplified example, we &lt;em&gt;can&lt;&#x2F;em&gt; just create a Customer directly the same way the
&lt;code&gt;new&lt;&#x2F;code&gt; method did, but in real code, as long as the fields of Customer are private, you won’t be
able to do this. Any struct with public fields is just a way to organise related variables
together, and can’t have any invariant that it relies on.&lt;&#x2F;p&gt;
&lt;p&gt;Well, what about &lt;code&gt;DrinkType&lt;&#x2F;code&gt;? Rust has casting, can we cast anything into that?&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error[E0605]: non-primitive cast: `i32` as `DrinkType`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  --&amp;gt; test.rs:49:28&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;49 |     order_drink(&amp;amp;customer, 420 as DrinkType);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |                            ^^^^^^^^^^^^^^^^&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;error: aborting due to previous error&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;For more information about this error, try `rustc --explain E0605`.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Nope.&lt;&#x2F;p&gt;
&lt;p&gt;In rust, if you ask for an object, you know you both &lt;em&gt;got&lt;&#x2F;em&gt; that object, but the object can also
keep its own invariants safe.&lt;&#x2F;p&gt;
&lt;p&gt;In C#, this is only true if you ask for a very small set of types only. Anything else, and you can
be lied to, and you’ll end up needing to throw if you are indeed lied to.&lt;&#x2F;p&gt;
&lt;p&gt;Is this a problem in real code?&lt;&#x2F;p&gt;
&lt;p&gt;While being handed invalid enums is not a practical problem, not being able to rely on enums values
being values that you know &lt;em&gt;is&lt;&#x2F;em&gt; a problem, as you have to always add default cases that throw
exceptions or do nothing. A better system would be to have known exhaustive enums, where if you handle all the
enum values that currently exist, and each of the branches return, then code after the enum is
considered unreachable. Under all situations, if the enum and the match is in the same project,
allow exhaustive matching.&lt;&#x2F;p&gt;
&lt;p&gt;As for the nulls… Yes. Trying to operate on null values is one of &lt;em&gt;the&lt;&#x2F;em&gt; most common bugs I’ve
written. A stronger type system and ideally sum types would fix that bug.&lt;&#x2F;p&gt;
&lt;p&gt;Another common bug is mixing up database ids from different tables. If you’re lucky, this just
leads to queries that never match, but it’s easy to imagine a serious security vulnerability here.
A strongly typed id would make this bug much harder. Note how there’s nothing &lt;em&gt;preventing&lt;&#x2F;em&gt; you from
doing this in C#, but it’s definitely not the default, and doing it in Entity Framework is
not all that easy. This is more a point about how types are good, actually, and the more types you
have, the better your code is.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Order Preserving 2d Array To 1d Array Function</title>
          <pubDate>Sat, 27 Jun 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/order-preserving-2d-array-to-1d-array-function/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/order-preserving-2d-array-to-1d-array-function.html</guid>
          <description>&lt;p&gt;Short post here, but I was interested in a problem and think I found a good solution to it.&lt;&#x2F;p&gt;
&lt;p&gt;The problem is: Write a function &lt;code&gt;f&lt;&#x2F;code&gt; that takes a 2 dimensional byte array (&lt;code&gt;Vec&amp;lt;Vec&amp;lt;u8&amp;gt;&amp;gt;&lt;&#x2F;code&gt;), and
converts it into a 1 dimensional byte array (&lt;code&gt;Vec&amp;lt;u8&amp;gt;&lt;&#x2F;code&gt;) in an order-preserving way. Empty outer or
inner vectors are allowed, and must order correctly. As little overhead as possible is ideal.&lt;&#x2F;p&gt;
&lt;p&gt;Use case is if you have a B-tree and want to query it using tuples instead of a plain key, and have
ordering work correctly (as in, a bytewise comparison should give the same results as ordering the
tuples do).&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Below I’ve put my solution.&lt;&#x2F;p&gt;
&lt;p&gt;If you want to solve it yourself, don’t scroll down. I’ve put some spacing so it’s lower down off
the page.&lt;&#x2F;p&gt;
&lt;div style=&quot;padding-top: 15cm&quot;&gt;&amp;nbsp;&lt;&#x2F;div&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;pub fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt; route&lt;&#x2F;span&gt;&lt;span&gt;(parts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;impl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; AsRef&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;]&amp;gt;])&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; Vec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; part&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; parts {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        let&lt;&#x2F;span&gt;&lt;span&gt; part&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; part&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;as_ref&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;        for&lt;&#x2F;span&gt;&lt;span&gt; byte&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; part&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;into_iter&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;copied&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF8F40;&quot;&gt;            match&lt;&#x2F;span&gt;&lt;span&gt; byte {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;                0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;extend&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;]),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;                1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;extend&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span&gt;]),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;                2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;..=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;255&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(byte),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt;0x00&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    result&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That’s it. I used to have it be a lot more complex, but this seems to work fine. I’ve ran it
through a fuzzer and it seems to work fine.&lt;&#x2F;p&gt;
&lt;p&gt;The way it works is that we need to be able to uniquely identify the end of each list in such a way
that orders before any possible byte inside the list, so we use a &lt;code&gt;0&lt;&#x2F;code&gt; byte. But then we have the
issue of collisions with a valid &lt;code&gt;0&lt;&#x2F;code&gt; byte, so we need to remap that to a multi byte sequence, &lt;code&gt;1, 1&lt;&#x2F;code&gt;. But then you could emit 2 &lt;code&gt;1&lt;&#x2F;code&gt;’s and it would be encoded identically to a &lt;code&gt;0&lt;&#x2F;code&gt; byte in the input.
So we need to remap &lt;code&gt;1&lt;&#x2F;code&gt; to something that sorts &lt;em&gt;after&lt;&#x2F;em&gt; the encoding of &lt;code&gt;0&lt;&#x2F;code&gt;, but otherwise can’t be
produced. So I used &lt;code&gt;1, 2&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Note how you &lt;em&gt;are&lt;&#x2F;em&gt; able to produce &lt;code&gt;1, 1, 2&lt;&#x2F;code&gt; by giving &lt;code&gt;0, 2&lt;&#x2F;code&gt;, but this is not a problem since you
can’t create a single &lt;code&gt;1&lt;&#x2F;code&gt; on its own, so there’s no input that is not &lt;code&gt;0, 2&lt;&#x2F;code&gt; that can give you &lt;code&gt;1, 1, 2&lt;&#x2F;code&gt;. Or, to put it another way, taken as a whole, the sequence is unambiguous, but there’s no
error recovery if you need to undo the mapping from the middle. You could likely change the escape
sequences to &lt;code&gt;1, 2&lt;&#x2F;code&gt; and &lt;code&gt;1, 3&lt;&#x2F;code&gt; to make parsing less ambiguous, but for my use case this is
unimportant.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Thoughts On Distributed Issue Tracking</title>
          <pubDate>Wed, 27 May 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/thoughts-on-distributed-issue-tracking/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/thoughts-on-distributed-issue-tracking.html</guid>
          <description>&lt;p&gt;Git’s a distributed code versioning system, but software projects are more than just code. We
should be able to version our issues and pull requests in the same repo. When you clone a repo from
one service (Say, GitHub), and push that repo to some other service (Say, a self-hosted git
server), the code &lt;em&gt;and&lt;&#x2F;em&gt; all issues and pull requests &#x2F; other items should be moved along with it.&lt;&#x2F;p&gt;
&lt;p&gt;Below I’ve written up some rough thoughts about how we should do this.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;requirements&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#requirements&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Requirements&lt;&#x2F;h2&gt;
&lt;p&gt;All data should be stored in a human readable format. Someone who finds a repo with issues logged
against it with zero knowledge of the specifics should be able to track down an issue and read
comments against it. It doesn’t have to be the easiest thing, but it should be possible. This is so
that in 15 years when someone finds a commit labelled &lt;code&gt;fixes the bar as mentioned in issue abcdef&lt;&#x2F;code&gt;,
you’re able to find the context needed.&lt;&#x2F;p&gt;
&lt;p&gt;It should be possible for one repo to be the issue tracker for multiple repos, or one repo to have
multiple distinct issue trackers in different subdirectories. The default case is for the issue
repo to be the same as the code repo.&lt;&#x2F;p&gt;
&lt;p&gt;It should work on completely unmodified servers. You should be able to type &lt;code&gt;git issue add &amp;lt;issue title&amp;gt;&lt;&#x2F;code&gt; and push it to GitHub without problems, and then anyone fetching the repo has access to
those issues.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;storage&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#storage&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Storage&lt;&#x2F;h2&gt;
&lt;p&gt;You can do this either by using a branch or a constantly overwritten tag. Advantages of the branch
is that it’s a lot cleaner (Git expects branches to change, so it’s not as much of a hack to do
this on an orphan branch). A tag that’s constantly overwritten has the (possible) advantage that
it’s not cloned by default, but every time you want to fetch it, you’ll need to update your copy of
the tag with whatever’s on the remote, since git won’t overwrite a tag by default.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;format&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#format&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Format&lt;&#x2F;h2&gt;
&lt;p&gt;The file system should be used as much as possible, as opposed to JSON &#x2F; binary files, to
reduce&#x2F;eliminate the need for git merge drivers.&lt;&#x2F;p&gt;
&lt;p&gt;Each object type (issue, pull request, something else) is stored under the root as a folder.&lt;&#x2F;p&gt;
&lt;p&gt;Under that, each object type defines its own storage format, other than each individual object
being a folder (So an issue would be &lt;code&gt;issues&#x2F;arbitrary_identifier&#x2F;&lt;&#x2F;code&gt;, with its individual files
being stored under that)&lt;&#x2F;p&gt;
&lt;p&gt;The identifier that each item is known as would be the commit hash in which it was added. (The
tools would ensure only one item is added per commit, adding more than one is invalid). This makes
&lt;code&gt;git show&lt;&#x2F;code&gt; make sense. This is more verbose than a sequential number such as &lt;code&gt;#44580&lt;&#x2F;code&gt;, but has the
advantage of not needing a central server to maintain uniqueness. Whenever possible the full hash
should be used (In comments, the hash should be expanded out to be the full hash when being stored,
with the hash collapsed when being shown)&lt;&#x2F;p&gt;
&lt;h3 id=&quot;issue_format&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#issue_format&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Issue Format&lt;&#x2F;h3&gt;
&lt;p&gt;The body and comments are stored as markdown (So they can be easily read). The body &#x2F; every comment
is stored as a separate file&lt;&#x2F;p&gt;
&lt;p&gt;Metadata like the title is stored before the body in header-like format, such as&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Title: This is a title for a big issue&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Here we have a big issue body&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Tags are stored as zero byte files in a &lt;code&gt;tags&lt;&#x2F;code&gt; folder.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;pull_request_format&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#pull_request_format&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Pull Request Format&lt;&#x2F;h3&gt;
&lt;p&gt;A pull request is basically an issue, only in a pull requests folder instead of issues, and a
&lt;code&gt;Target-Branch:&lt;&#x2F;code&gt; header is added to the body.&lt;&#x2F;p&gt;
&lt;p&gt;Pull request comments can also have their own header to indicate what they’re against, perhaps the
lines, then a commit hash, then a file name. The lines come first because it’s easier to parse that
way, no need to handle the case where a file name has something that looks like line numbers&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Comment-For: L25-35 abcdef0123456:&#x2F;src&#x2F;foo&#x2F;bar.rs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;This unsafe block shouldn&amp;#39;t be here, you can instead use list.copy_within(3..6, 10);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That being said, there’s no real reason why issues shouldn’t be able to comment on lines of code,
perhaps to point out buggy sections.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;ui&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#ui&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
UI&lt;&#x2F;h2&gt;
&lt;p&gt;Of course, this doesn’t have to be purely used through the command line, and indeed I’d expect a
lot of the use to be through a web interface. Git services &lt;em&gt;already&lt;&#x2F;em&gt; have the ability to make
commits in a repo, so making issues in this format would be just a matter of handling it correctly.&lt;&#x2F;p&gt;
&lt;p&gt;Whenever you click on the issues tab, it would read off the issues from the current state. Whenever
you do an action, it would be handled the same as when you edit a file online.&lt;&#x2F;p&gt;
&lt;p&gt;A secondary advantage here is that tools that want to track&#x2F;create issues&#x2F;pull requests (Say, IDE
integration) don’t need to authenticate to the server, they just need to read&#x2F;write your local repo
and push the state as needed. You could even self-host the web UI completely offline if you prefer
working like that.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;closing_thoughts&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#closing_thoughts&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Closing Thoughts&lt;&#x2F;h2&gt;
&lt;p&gt;I’ve been vague about some specifics of this, mainly because I haven’t actually
written this as a project, and have no experience writing issue tracking systems. I do have
experience moving to a different source repo and not being able to find the issues that old commits
have referenced because they’re 2 issue trackers ago.&lt;&#x2F;p&gt;
&lt;p&gt;I suppose I’m not as much asking for &lt;em&gt;my&lt;&#x2F;em&gt; solution as I am asking for &lt;em&gt;something&lt;&#x2F;em&gt; to be done. We
wouldn’t accept all the commit history being lost every time we move repos, so every developer
should have a full copy of all the project history and relevant information stored such that they
can work on it offline.&lt;&#x2F;p&gt;
&lt;p&gt;And in any case, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fossil-scm.org&#x2F;home&#x2F;doc&#x2F;trunk&#x2F;www&#x2F;index.wiki&quot;&gt;Fossil&lt;&#x2F;a&gt; can do it and a lot
more.&lt;&#x2F;p&gt;
&lt;p&gt;Hm, I might check out (pun half intended) Fossil. Maybe a future blog post?&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Moving to Neovim</title>
          <pubDate>Sat, 09 May 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/moving-to-neovim/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/moving-to-neovim.html</guid>
          <description>&lt;p&gt;This is a hopefully small post about how I got from my vim setup to a neovim setup.&lt;&#x2F;p&gt;
&lt;p&gt;This does &lt;em&gt;not&lt;&#x2F;em&gt; keep the same config working on vim, and just copies over what I still need. Vim
stays functional, they’re running on 2 completely separate configs.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;installing_neovim&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#installing_neovim&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Installing Neovim&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt;pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; neovim&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You’ll also want to set your &lt;code&gt;EDITOR&lt;&#x2F;code&gt; environment variable to &lt;code&gt;nvim&lt;&#x2F;code&gt;, but I did that at the end
once I knew it actually works.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;clean_startup&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#clean_startup&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Clean startup&lt;&#x2F;h2&gt;
&lt;p&gt;Initially, I was getting errors complaining about&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Error detected while processing &#x2F;home&#x2F;jess&#x2F;dotfiles&#x2F;vim&#x2F;.config&#x2F;vim&#x2F;vimrc:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;line   13:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;E484: Cannot open file &#x2F;usr&#x2F;share&#x2F;nvim&#x2F;runtime&#x2F;defaults.vim&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;E576: Failed to parse ShaDa file: extra bytes in msgpack string at position 3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Press ENTER or type command to continue&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I wasn’t expecting neovim to try and load my existing vimrc. I checked the manual and found this in
in the &lt;code&gt;ENVIRONMENT&lt;&#x2F;code&gt; section.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;VIMINIT&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Ex commands to be executed at startup. &lt;code&gt;:help VIMINIT&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;My &lt;code&gt;VIMINIT&lt;&#x2F;code&gt; was set to &lt;code&gt;let $MYVIMRC=&quot;$XDG_CONFIG_HOME&#x2F;vim&#x2F;vimrc&quot; | source $MYVIMRC&lt;&#x2F;code&gt;. I did this
so that I can keep &lt;em&gt;all&lt;&#x2F;em&gt; of vim’s configuration in &lt;code&gt;$XDG_CONFIG_HOME&lt;&#x2F;code&gt;, and not scattered throughout
my home directory.&lt;&#x2F;p&gt;
&lt;p&gt;An easy fix for this that doesn’t break anything else is to define these only when I’m running vim,
and not anything else. I can do this using a shell alias, and removing the &lt;code&gt;export&lt;&#x2F;code&gt;’s for the
environment variables, which make them available to all commands.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFB454;&quot;&gt;vim&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    VIMINIT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F29668;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&amp;#39;let $MYVIMRC=&amp;quot;$XDG_CONFIG_HOME&#x2F;vim&#x2F;vimrc&amp;quot; | source $MYVIMRC&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #59C2FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    VIMDOTDIR=&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$XDG_CONFIG_HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&#x2F;vim&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #95E6CB;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;    command vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D2A6FF;&quot;&gt; $@&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;It’s worth noting that this will break vim for anything that calls it indirectly,
since in that case the alias won’t be executed. A true fix for this would be to put that command
ahead of the actual &lt;code&gt;vim&lt;&#x2F;code&gt; in your &lt;code&gt;$PATH&lt;&#x2F;code&gt;, making sure to call the real vim in it.&lt;&#x2F;p&gt;
&lt;p&gt;I need to log out and log back in in order to stop VIMINIT being globally set, since my login shell
itself has it set. This probably wouldn’t be an issue if I used a display manager, but I just log
in and type &lt;code&gt;startx&lt;&#x2F;code&gt;. A workaround would be to export blank settings for these, but I just decided
to log out and log back in.&lt;&#x2F;p&gt;
&lt;p&gt;One re-login later, and executing &lt;code&gt;nvim&lt;&#x2F;code&gt; starts up cleanly.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;configuration&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#configuration&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;My vimrc has a fair amount of stuff in it, some of which isn’t really needed anymore.&lt;&#x2F;p&gt;
&lt;p&gt;Notably&lt;&#x2F;p&gt;
&lt;!--not really bash but there&#x27;s no vimscript highlighting--&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BFBDB6; background-color: #0D1017;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; runtimepath=&lt;&#x2F;span&gt;&lt;span&gt;$XDG_CONFIG_HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&#x2F;vim,​&lt;&#x2F;span&gt;&lt;span&gt;$XDG_CONFIG_HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&#x2F;vim&#x2F;after,&lt;&#x2F;span&gt;&lt;span&gt;$VIM&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt;$VIMRUNTIME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; dir=~&#x2F;.cache&#x2F;vim&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt; viminfo+=n&lt;&#x2F;span&gt;&lt;span&gt;$XDG_CACHE_HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #AAD94C;&quot;&gt;&#x2F;vim&#x2F;viminfo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;and code for &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ConradIrwin&#x2F;vim-bracketed-paste&quot;&gt;bracketed paste&lt;&#x2F;a&gt; (Which, to be
honest, I’m not sure if it even does anything on my system. Might as well get rid of it then).&lt;&#x2F;p&gt;
&lt;p&gt;I’m removing &lt;code&gt;execute pathogen#infect()&lt;&#x2F;code&gt;, as I’ll be using the native package manager (Not neovim
exclusive, introduced in vim 8.0) instead.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;colour&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#colour&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Colour&lt;&#x2F;h2&gt;
&lt;p&gt;I have a custom version of base16-default.vim that removes background colour,
since I’m a weird person who uses transparent terminals. Because of this, I
don’t manage it as a package. Copying it to &lt;code&gt;colors&#x2F;base16-default.vim&lt;&#x2F;code&gt; works
fine, and now my neovim starts up without complaints.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;packages&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#packages&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Packages&lt;&#x2F;h2&gt;
&lt;p&gt;Now I can begin to move my packages over to use vim’s package manager.&lt;&#x2F;p&gt;
&lt;p&gt;Vim’s package manager layout seems to be built to be managed by a system
package manager, so it’s somewhat more nested than the directory would be if
you were using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;tpope&#x2F;vim-pathogen&quot;&gt;pathogen&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If you want to see the full directory structure, use &lt;code&gt;:help packages&lt;&#x2F;code&gt; on a
modern (neo)vim, but for my use case, I’ll just make a &lt;code&gt;pack&#x2F;packages&#x2F;start&lt;&#x2F;code&gt;
directory, as I want all packages to always load. Then it’s the same as
pathogen from there.&lt;&#x2F;p&gt;
&lt;p&gt;I use git submodules to manage my packages (since my dotfiles themselves are in
git), so adding a new package is a matter of going to &lt;code&gt;pack&#x2F;packages&#x2F;start&lt;&#x2F;code&gt; and
running &lt;code&gt;git submodule add &amp;lt;repo URL&amp;gt;&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;final_thoughts&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#final_thoughts&quot; aria-label=&quot;Anchor link&quot;&gt;&lt;&#x2F;a&gt;
Final Thoughts&lt;&#x2F;h2&gt;
&lt;p&gt;It’s been fun to try to switch to neovim, and seeing how minimal I can get my config (by adding
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;tpope&#x2F;vim-sensible&quot;&gt;sensible.vim&lt;&#x2F;a&gt; and
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;tpope&#x2F;vim-sleuth&quot;&gt;sleuth.vim&lt;&#x2F;a&gt; to outsource my configuration to someone else,
and auto detection respectively. I’ll probably do more tweaking of my config, but for now, this is
fine.)&lt;&#x2F;p&gt;
&lt;p&gt;I’m also getting a bug where when I append to the end of a markdown document, the folds aren’t
updating. This happened both with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;vim-pandoc&#x2F;vim-pandoc&quot;&gt;vim-pandoc&lt;&#x2F;a&gt; and
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;masukomi&#x2F;vim-markdown-folding&quot;&gt;vim-markdown-folding&lt;&#x2F;a&gt; which is what I’m using
now, so I’m assuming it’s a bug with neovim’s recalculation of &lt;code&gt;foldmethod=expr&lt;&#x2F;code&gt; lines.&lt;&#x2F;p&gt;
&lt;p&gt;Using &lt;code&gt;zx&lt;&#x2F;code&gt; to recalculate folds works, so I might just bind that to happen whenever I leave insert
mode. Copy pasting a line at the end of the document seems to work.&lt;&#x2F;p&gt;
&lt;p&gt;I don’t care enough to figure out why it’s happening so I’m just going to deal with it until it
pisses me off enough.&lt;&#x2F;p&gt;
</description>
      </item>
      
      
      <item>
          <title>Hello World</title>
          <pubDate>Fri, 08 May 2020 00:00:00 +0000</pubDate>
          <link>https://www.5snb.club/posts/2020/hello-world/</link>
          <guid isPermaLink="false">https://www.5snb.club/posts/hello-world.html</guid>
          <description>&lt;p&gt;Here’s my “initial commit” of my blog.&lt;&#x2F;p&gt;
&lt;p&gt;I think it’s a legal requirement or something for all blogs to have one.&lt;&#x2F;p&gt;
&lt;p&gt;Anyways, my setup is using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cobalt-org.github.io&#x2F;&quot;&gt;cobalt&lt;&#x2F;a&gt;, a static site generator in
Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Static site so that all the web server needs to do is be able to serve files from the file system.
If it can do that, then I’m good.&lt;&#x2F;p&gt;
&lt;p&gt;Rust because lol borrowchecker go brrrrrr&lt;&#x2F;p&gt;
&lt;p&gt;I have a formatting test page over at &lt;a href=&quot;https:&#x2F;&#x2F;www.5snb.club&#x2F;pages&#x2F;formatting-test&#x2F;&quot;&gt;&#x2F;pages&#x2F;formatting-test&lt;&#x2F;a&gt;. The
formatting of the site is liable to wildly change as I get &lt;del&gt;feedback&lt;&#x2F;del&gt; told it looks shit.&lt;&#x2F;p&gt;
&lt;p&gt;Other than that, hello! I’ve got a few post ideas that I will hopefully be posting shortly.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;</description>
      </item>
    </channel>
</rss>
