<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>‎ on jonah vairon</title>
    <link>https://58e1b19d.site-bk0.pages.dev/tags/</link>
    <description>Recent content in ‎ on jonah vairon</description>
    <generator>Hugo</generator>
    <language>en-uk</language>
    <copyright>© 2025 Jonah Vairon</copyright>
    <lastBuildDate>Thu, 26 Mar 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://58e1b19d.site-bk0.pages.dev/tags/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>cencry - encryption</title>
      <link>https://58e1b19d.site-bk0.pages.dev/python-competitive-programming/cencry/</link>
      <pubDate>Thu, 26 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/python-competitive-programming/cencry/</guid>
      <description>&lt;h2 id=&#34;problem&#34;&gt;problem&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Marko is going to write a secret letter to a friend. He thought it is better to encrypt letter so that no other person can read it. After long thought he came up with an encryption scheme which was lame but he thought it will work anyways.&lt;/p&gt;&#xA;&lt;p&gt;To encrypt a text he first wrote two infinite strings of characters first string consists only of vowels and second string consists of consonants only.&lt;/p&gt;</description>
    </item>
    <item>
      <title>employee db</title>
      <link>https://58e1b19d.site-bk0.pages.dev/rust-book/employee-db/</link>
      <pubDate>Tue, 24 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/rust-book/employee-db/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;background&lt;/h2&gt;&#xA;&lt;p&gt;The final section of the eighth chapter of the rust book ends with some&#xA;suggested exercises. The last of which is to write a program that:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Using a hash map and vectors, create a text interface to allow a user to add&#xA;employee names to a department in a company; for example, “Add Sally to&#xA;Engineering” or “Add Amir to Sales.” Then, let the user retrieve a list of all&#xA;people in a department or all people in the company by department, sorted&#xA;alphabetically.&lt;/p&gt;</description>
    </item>
    <item>
      <title>intest - enormous input test</title>
      <link>https://58e1b19d.site-bk0.pages.dev/python-competitive-programming/intest/</link>
      <pubDate>Tue, 24 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/python-competitive-programming/intest/</guid>
      <description>&lt;h2 id=&#34;problem&#34;&gt;problem&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The purpose of this problem is to verify whether the method you are using to read input data is sufficiently fast to handle problems branded with the enormous Input/Output warning. You are expected to be able to process at least 2.5MB of input data per second at runtime.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Input&lt;/strong&gt;:&#xA;The input begins with two positive integers n k (n, k&amp;lt;=107). The next n lines of input contain one positive integer ti, not greater than 109, each.&lt;/p&gt;</description>
    </item>
    <item>
      <title>pig latin</title>
      <link>https://58e1b19d.site-bk0.pages.dev/rust-book/pig-latin/</link>
      <pubDate>Fri, 20 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/rust-book/pig-latin/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;background&lt;/h2&gt;&#xA;&lt;p&gt;The final section of the eighth chapter of the rust book ends with some suggested&#xA;exercises. The second of which is to write a program that:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Convert strings to Pig Latin. The first consonant of each word is moved to the end of the word and ay is added, so first becomes irst-fay. Words that start with a vowel have hay added to the end instead (apple becomes apple-hay). Keep in mind the details about UTF-8 encoding!&lt;/p&gt;</description>
    </item>
    <item>
      <title>christmas carol</title>
      <link>https://58e1b19d.site-bk0.pages.dev/rust-book/christmas-carol/</link>
      <pubDate>Wed, 18 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/rust-book/christmas-carol/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;background&lt;/h2&gt;&#xA;&lt;p&gt;The final section of the third chapter of the rust book ends with some suggested&#xA;exercises. The last of which is to write a program to: &amp;ldquo;Print the lyrics to the&#xA;Christmas carol “The Twelve Days of Christmas,” taking advantage of the&#xA;repetition in the song.&amp;rdquo;&lt;/p&gt;&#xA;&lt;h2 id=&#34;solution&#34;&gt;solution&lt;/h2&gt;&#xA;&lt;p&gt;This was more fun that it looked. Especially trying to identify patterns in the&#xA;lyrics.&lt;/p&gt;&#xA;&lt;p&gt;Is this the most optimised version?&lt;/p&gt;&#xA;&lt;p&gt;Probably not.&lt;/p&gt;</description>
    </item>
    <item>
      <title>fibonacci</title>
      <link>https://58e1b19d.site-bk0.pages.dev/rust-book/fibonacci/</link>
      <pubDate>Wed, 18 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/rust-book/fibonacci/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;background&lt;/h2&gt;&#xA;&lt;p&gt;The final section of the third chapter of the rust book ends with some suggested&#xA;exercises. The second of which is to write a program to: &amp;ldquo;Generate the nth&#xA;Fibonacci number.&amp;rdquo;&lt;/p&gt;&#xA;&lt;h2 id=&#34;solution&#34;&gt;solution&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;m not going to implement &lt;a href=&#34;https://jonahv.com/writing/the-best-fibonacci-implementation/&#34;&gt;the best fibonacci implementation?&lt;/a&gt;. Just the bog&#xA;standard recursive approach with no memoisation. Reusing the input code from the&#xA;guessing game again:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c8d3f5;background-color:#222436;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#c099ff&#34;&gt;use&lt;/span&gt; std::io;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#c099ff&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#82aaff&#34;&gt;main&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#c099ff&#34;&gt;loop&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#82aaff&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#c3e88d&#34;&gt;&amp;#34;Which Fibonacci number would you like?&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#c099ff&#34;&gt;let&lt;/span&gt; &lt;span style=&#34;color:#c099ff&#34;&gt;mut&lt;/span&gt; n &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#c3e88d&#34;&gt;String&lt;/span&gt;::new();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        io::stdin()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            .read_line(&lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#c099ff&#34;&gt;mut&lt;/span&gt; n)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            .expect(&lt;span style=&#34;color:#c3e88d&#34;&gt;&amp;#34;Failed to read line&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#c099ff&#34;&gt;let&lt;/span&gt; n: &lt;span style=&#34;color:#4fd6be&#34;&gt;i32&lt;/span&gt; &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#c099ff&#34;&gt;match&lt;/span&gt; n.trim().parse() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#c3e88d&#34;&gt;Ok&lt;/span&gt;(num) &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&amp;gt;&lt;/span&gt; num,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#c3e88d&#34;&gt;Err&lt;/span&gt;(_) &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color:#c099ff&#34;&gt;continue&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        };&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#c099ff&#34;&gt;let&lt;/span&gt; nth_fib &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&lt;/span&gt; fib(n);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#82aaff&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#c3e88d&#34;&gt;&amp;#34;Fibonacci &lt;/span&gt;&lt;span style=&#34;color:#c3e88d&#34;&gt;{n}&lt;/span&gt;&lt;span style=&#34;color:#c3e88d&#34;&gt; is: &lt;/span&gt;&lt;span style=&#34;color:#c3e88d&#34;&gt;{nth_fib}&lt;/span&gt;&lt;span style=&#34;color:#c3e88d&#34;&gt;&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#c099ff&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#82aaff&#34;&gt;fib&lt;/span&gt;(n: &lt;span style=&#34;color:#4fd6be&#34;&gt;i32&lt;/span&gt;) -&amp;gt; &lt;span style=&#34;color:#4fd6be&#34;&gt;i64&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#c099ff&#34;&gt;if&lt;/span&gt; n &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ffc777&#34;&gt;0&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#c099ff&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ffc777&#34;&gt;1&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    } &lt;span style=&#34;color:#c099ff&#34;&gt;else&lt;/span&gt; &lt;span style=&#34;color:#c099ff&#34;&gt;if&lt;/span&gt; n &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ffc777&#34;&gt;1&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#c099ff&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ffc777&#34;&gt;1&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    } &lt;span style=&#34;color:#c099ff&#34;&gt;else&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#c099ff&#34;&gt;return&lt;/span&gt; fib(n&lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ffc777&#34;&gt;1&lt;/span&gt;) &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;+&lt;/span&gt; fib(n&lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ffc777&#34;&gt;2&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>median and mode</title>
      <link>https://58e1b19d.site-bk0.pages.dev/rust-book/median-and-mode/</link>
      <pubDate>Tue, 17 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/rust-book/median-and-mode/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;background&lt;/h2&gt;&#xA;&lt;p&gt;The final section of the eighth chapter of the rust book ends with some suggested&#xA;exercises. The first of which is to write a program that:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Given a list of integers, use a vector and return the median (when sorted, the value in the middle position) and mode (the value that occurs most often; a hash map will be helpful here) of the list.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;h2 id=&#34;solution&#34;&gt;solution&lt;/h2&gt;&#xA;&lt;p&gt;While straightforward on paper, calculating the median posed a bit of challenge&#xA;with even lists of numbers. The problem being, when there&amp;rsquo;s no clear &amp;ldquo;middle&amp;rdquo;&#xA;value the tendency is to take the mean of the 2 middle values. But, Rust being&#xA;strongly typed, this meant potentially returning a float (i.e. &lt;code&gt;f32&lt;/code&gt;) in a&#xA;function that would otherwise return an integer (i.e. &lt;code&gt;i32&lt;/code&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title>fahrenheit to celsius</title>
      <link>https://58e1b19d.site-bk0.pages.dev/rust-book/fahrenheit-to-celsius/</link>
      <pubDate>Sun, 15 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/rust-book/fahrenheit-to-celsius/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;background&lt;/h2&gt;&#xA;&lt;p&gt;The final section of the third chapter of the rust book ends with some suggested&#xA;exercises. The first of which is to write a program to: &amp;ldquo;Convert temperatures&#xA;between Fahrenheit and Celsius.&amp;rdquo;&lt;/p&gt;&#xA;&lt;h2 id=&#34;solution&#34;&gt;solution&lt;/h2&gt;&#xA;&lt;p&gt;Reusing code from the guessing game chapter, we can read input, cast it to a 32&#xA;bit float through a type hint and perform the conversion:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c8d3f5;background-color:#222436;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#c099ff&#34;&gt;use&lt;/span&gt; std::io;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#c099ff&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#82aaff&#34;&gt;main&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#c099ff&#34;&gt;loop&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#82aaff&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#c3e88d&#34;&gt;&amp;#34;Degrees in Farenheit:&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#c099ff&#34;&gt;let&lt;/span&gt; &lt;span style=&#34;color:#c099ff&#34;&gt;mut&lt;/span&gt; degrees_f &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#c3e88d&#34;&gt;String&lt;/span&gt;::new();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        io::stdin()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            .read_line(&lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#c099ff&#34;&gt;mut&lt;/span&gt; degrees_f)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            .expect(&lt;span style=&#34;color:#c3e88d&#34;&gt;&amp;#34;Failed to read line&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#c099ff&#34;&gt;let&lt;/span&gt; degrees_f: &lt;span style=&#34;color:#4fd6be&#34;&gt;f32&lt;/span&gt; &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#c099ff&#34;&gt;match&lt;/span&gt; degrees_f.trim().parse() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#c3e88d&#34;&gt;Ok&lt;/span&gt;(num) &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&amp;gt;&lt;/span&gt; num,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#c3e88d&#34;&gt;Err&lt;/span&gt;(_) &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color:#c099ff&#34;&gt;continue&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        };&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#c099ff&#34;&gt;let&lt;/span&gt; degrees_c &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&lt;/span&gt; (degrees_f &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;-&lt;/span&gt; &lt;span style=&#34;color:#ffc777&#34;&gt;32.0&lt;/span&gt;) &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ffc777&#34;&gt;5.0&lt;/span&gt;&lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ffc777&#34;&gt;9.0&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#82aaff&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#c3e88d&#34;&gt;&amp;#34;is &lt;/span&gt;&lt;span style=&#34;color:#c3e88d&#34;&gt;{degrees_c}&lt;/span&gt;&lt;span style=&#34;color:#c3e88d&#34;&gt; degrees Celsius.&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>python workout: exercise 19</title>
      <link>https://58e1b19d.site-bk0.pages.dev/python-workout/python-workout-exercise-19/</link>
      <pubDate>Fri, 30 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/python-workout/python-workout-exercise-19/</guid>
      <description>&lt;h2 id=&#34;problem&#34;&gt;problem&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Write a function, &lt;code&gt;passwd_to_dict&lt;/code&gt;, that reads from a Unix-style &amp;ldquo;password file&amp;rdquo;,&#xA;commonly stored as &lt;code&gt;/etc/passwd&lt;/code&gt;, and returns a dict. The function should return a&#xA;dict based on &lt;code&gt;/etc/passwd&lt;/code&gt; in which the dict&amp;rsquo;s keys are usernames and the values&#xA;are the users&amp;rsquo; IDs (i.e the first and third fields in the comma-separated fields&#xA;of an &lt;code&gt;/etc/passwd&lt;/code&gt; entry).&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;h3 id=&#34;attempts&#34;&gt;attempts&lt;/h3&gt;&#xA;&lt;p&gt;This should be straightforward. We can split each line on colons and extract the&#xA;first and third fields:&lt;/p&gt;</description>
    </item>
    <item>
      <title>python workout: exercise 18</title>
      <link>https://58e1b19d.site-bk0.pages.dev/python-workout/python-workout-exercise-18/</link>
      <pubDate>Wed, 28 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/python-workout/python-workout-exercise-18/</guid>
      <description>&lt;h2 id=&#34;problem&#34;&gt;problem&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Write a function (&lt;code&gt;get_final_line&lt;/code&gt;) that takes a filename as an argument. The&#xA;function should return that file&amp;rsquo;s final line on the screen.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;h3 id=&#34;attempts&#34;&gt;attempts&lt;/h3&gt;&#xA;&lt;h4 id=&#34;first&#34;&gt;first&lt;/h4&gt;&#xA;&lt;p&gt;My first thought is to just &lt;code&gt;readlines()&lt;/code&gt; and index into the last element with &lt;code&gt;-1&lt;/code&gt;.&#xA;But that seems to defeat the implied purpose of the exercise &amp;ndash; to explore hte&#xA;possibility that &amp;ldquo;I&amp;rsquo;m only interested in a single line&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;Maybe it&amp;rsquo;s worth looking at the docs.&lt;/p&gt;</description>
    </item>
    <item>
      <title>python workout: exercise 17</title>
      <link>https://58e1b19d.site-bk0.pages.dev/python-workout/exercise-17/</link>
      <pubDate>Tue, 27 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/python-workout/exercise-17/</guid>
      <description>&lt;h2 id=&#34;problem&#34;&gt;problem&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Write a function, called &lt;code&gt;how_many_different_numbers&lt;/code&gt;, that takes a single list of&#xA;integers and returns the number of different integers it contains.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;h3 id=&#34;attempts&#34;&gt;attempts&lt;/h3&gt;&#xA;&lt;p&gt;The first thing that comes to mind is to just use a &lt;code&gt;set&lt;/code&gt; and get its length/size:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c8d3f5;background-color:#222436;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#c099ff&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#82aaff&#34;&gt;how_many_different_numbers&lt;/span&gt;(numbers: &lt;span style=&#34;color:#c3e88d&#34;&gt;list&lt;/span&gt;[&lt;span style=&#34;color:#c3e88d&#34;&gt;int&lt;/span&gt;]) &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span style=&#34;color:#c3e88d&#34;&gt;int&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#c099ff&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#c3e88d&#34;&gt;len&lt;/span&gt;(&lt;span style=&#34;color:#c3e88d&#34;&gt;set&lt;/span&gt;(numbers))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;numbers &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&lt;/span&gt; [&lt;span style=&#34;color:#ffc777&#34;&gt;1&lt;/span&gt;, &lt;span style=&#34;color:#ffc777&#34;&gt;2&lt;/span&gt;, &lt;span style=&#34;color:#ffc777&#34;&gt;3&lt;/span&gt;, &lt;span style=&#34;color:#ffc777&#34;&gt;1&lt;/span&gt;, &lt;span style=&#34;color:#ffc777&#34;&gt;2&lt;/span&gt;, &lt;span style=&#34;color:#ffc777&#34;&gt;3&lt;/span&gt;, &lt;span style=&#34;color:#ffc777&#34;&gt;4&lt;/span&gt;, &lt;span style=&#34;color:#ffc777&#34;&gt;1&lt;/span&gt;]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#c3e88d&#34;&gt;print&lt;/span&gt;(how_many_different_numbers(numbers))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c8d3f5;background-color:#222436;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;4&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;solution&#34;&gt;solution&lt;/h3&gt;&#xA;&lt;p&gt;The book&amp;rsquo;s implementation:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c8d3f5;background-color:#222436;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#c099ff&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#82aaff&#34;&gt;how_many_different_numbers&lt;/span&gt;(numbers):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    unique_numbers &lt;span style=&#34;color:#c3e88d;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#c3e88d&#34;&gt;set&lt;/span&gt;(numbers)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#c099ff&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#c3e88d&#34;&gt;len&lt;/span&gt;(unique_numbers)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Pretty much the same thing.&lt;/p&gt;&#xA;&lt;h3 id=&#34;beyond-the-exercise&#34;&gt;beyond the exercise&lt;/h3&gt;&#xA;&lt;h4 id=&#34;server-log-ip-addresses&#34;&gt;server log ip addresses&lt;/h4&gt;&#xA;&lt;!--list-separator--&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;problem&lt;/p&gt;</description>
    </item>
    <item>
      <title>about</title>
      <link>https://58e1b19d.site-bk0.pages.dev/about/</link>
      <pubDate>Fri, 12 Dec 2025 00:00:00 +0000</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/about/</guid>
      <description>&lt;p&gt;Hi, I&amp;rsquo;m &lt;strong&gt;Jonah Vairon&lt;/strong&gt;. I enjoy solving complex problems with software and data.&lt;/p&gt;&#xA;&lt;p&gt;Over the years, I&amp;rsquo;ve worked as a &lt;strong&gt;backend engineer&lt;/strong&gt; in a finance startup, an &lt;strong&gt;AI&#xA;engineer&lt;/strong&gt; in business and technology consultancies, and a &lt;strong&gt;research assistant&lt;/strong&gt; at&#xA;UCL&amp;rsquo;s Institute of Education (IoE) working on applications of ML and AI to&#xA;research/evidence synthesis.&lt;/p&gt;&#xA;&lt;p&gt;When I&amp;rsquo;m not working, you can find me on a walk, weightlifting, running,&#xA;practicing yoga and karate, trying to play through my Steam library, or catching&#xA;up on film and tv.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
