<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Glen Martin on Medium]]></title>
        <description><![CDATA[Stories by Glen Martin on Medium]]></description>
        <link>https://medium.com/@glenem3?source=rss-59b12f9c0d74------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6edmHgBaK4il2UvL</url>
            <title>Stories by Glen Martin on Medium</title>
            <link>https://medium.com/@glenem3?source=rss-59b12f9c0d74------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 08:53:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@glenem3/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Geothermal To Bitcoin]]></title>
            <link>https://medium.com/@glenem3/from-geothermal-to-bitcoin-47078f71dce5?source=rss-59b12f9c0d74------2</link>
            <guid isPermaLink="false">https://medium.com/p/47078f71dce5</guid>
            <category><![CDATA[el-salvador-bitcoin]]></category>
            <category><![CDATA[geothermal]]></category>
            <category><![CDATA[volcano-bond]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[el-salvador]]></category>
            <dc:creator><![CDATA[Glen Martin]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 03:40:10 GMT</pubDate>
            <atom:updated>2023-01-21T03:40:10.493Z</atom:updated>
            <content:encoded><![CDATA[<h4>El Salvador bets on bitcoin reaching $1 million</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQcyVFY0aaE1XHWhxCq7eA.png" /><figcaption>Created by <a href="https://www.craiyon.com/">https://www.craiyon.com/</a></figcaption></figure><p>El Salvador, the <a href="https://www.wsj.com/articles/bitcoin-comes-to-el-salvador-first-country-to-adopt-crypto-as-national-currency-11631005200?mod=article_inline">first country</a> to legalize bitcoin as legal tender, has passed <a href="https://www.wsj.com/articles/el-salvador-legislators-pass-law-allowing-bitcoin-bond-sales-11673483273">legislation</a> which will allow the county to regulate crypto currency backed bonds. In essence this would allow El Salvador to execute <a href="https://www.wsj.com/articles/el-salvador-to-issue-bitcoin-bond-in-2022-11637616550">it’s plan</a> to sell $1 billion in 10-year US dollar-denominated bonds with a 6.5% coupon rate.</p><h3>Why would El Salvador issue bitcoin bonds?</h3><p>El Salvador has turned to bitcoin and bitcoin bonds for one reason, to spur economic growth by building a <a href="https://www.reuters.com/markets/rates-bonds/el-salvador-plans-first-bitcoin-city-backed-by-bitcoin-bonds-2021-11-21/">“bitcoin city”</a> (a special economic zone to <a href="https://dailycoin.com/el-salvadors-volcano-bitcoin-bond-bill-receives-approval/">encourage businesses to move there with tax benefits and for being friendlier to cryptocurrencies</a>), and to <a href="https://www.coindesk.com/policy/2023/01/11/el-salvador-passes-law-paving-the-way-for-volcano-bonds/">pay down the country’s debt.</a></p><p>From the <a href="https://blog.blockstream.com/el-salvador-to-issue-1b-in-tokenized-bonds-on-the-liquid-network/">$1B raised</a> from issuing the <a href="https://blog.bitfinex.com/announcements/el-salvadors-historic-digital-asset-securities-law-passes/">volcano bond (or token)</a> 500M will be used for investing in geothermal energy and bitcoin mining infrastructure while the other $500M will be used to purchase more bitcoin that will be sold strategically after 5 years to <a href="https://www.coindesk.com/business/2021/11/21/el-salvador-to-create-bitcoin-city-use-500m-of-planned-1b-bond-offering-to-buy-more-crypto/">pay an additional dividend</a>.</p><p>Fundamentally, to accomplish these goals El Salvador is speculating that the price of bitcoin will continue to rise. Indeed they would benefit greatly if bitcoin reached the <a href="https://news.yahoo.com/bitcoin-will-eventually-hit-1-million-dollars-a-coin-coin-desk-editor-predicts-172810294.html">speculative-predicted price of $1 million per coin</a>. However, whether it will reach that price point is up for <a href="https://www.fool.com/investing/2022/11/19/can-bitcoin-reach-1-million/">debate</a>, and the volatile nature of bitcoin could <a href="https://www.cnbc.com/2022/10/13/el-salvadors-bitcoin-holdings-down-60percent-to-60-million-one-year-later.html">damage EL Salvador’s finance if there’s a massive drop.</a></p><p>However, a potential issue with El Salvador’s plan from an investor’s perspective is that the government of El Salvador is not actually going to be issuing the volcano bond. <a href="https://www.coindesk.com/layer2/2022/03/25/4-reasons-why-bitcoiners-should-pass-on-el-salvadors-bitcoin-bond/">Instead, a government owned energy firm, LaGeo, will be issuing the bond, even though it’s already racked with debt and would become overleveraged.</a></p><p>Although bitcoin reached $22,562.10 as of this writing the historical trends for bitcoin may give El Salvador both pain and fortune. As we have all learned, when bit coin falls, it falls quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*54A6gGFXz6gxt5_Vt7leSQ.png" /></figure><h3>El Fin</h3><p>If you liked this article, follow me on Medium and share this article on social media. Additionally, if you want to stay up to date on my Medium articles, please <a href="https://medium.com/@glenem3/subscribe">subscribe</a> to receive emails when I publish new articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47078f71dce5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Code 2022- Day 5 Part 2]]></title>
            <link>https://medium.com/@glenem3/advent-of-code-2022-day-5-part-2-7065df0a631b?source=rss-59b12f9c0d74------2</link>
            <guid isPermaLink="false">https://medium.com/p/7065df0a631b</guid>
            <category><![CDATA[advent-of-code]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[stack]]></category>
            <category><![CDATA[advent-of-code-2022]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Glen Martin]]></dc:creator>
            <pubDate>Tue, 17 Jan 2023 12:10:02 GMT</pubDate>
            <atom:updated>2023-01-17T12:10:02.989Z</atom:updated>
            <content:encoded><![CDATA[<h4>with Python</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*T0kk2tbzxiKjC2nk5X2AGg.png" /></figure><h3>Set Up</h3><p>In day 5 of Advent of Code 2022 we are tasked with writing a program which can model how the crane operator will be moving the cargo (crates in stacks). This will help the Elves will know which crates will end up where, and most importantly which crates will be on the top.</p><p>In task 2 the only difference is how we model how the crane will pickup the creates. In this problem the crane has the ability to pick up and move multiple crates at once. Which means that the crates moved will stay in the same order.</p><p><a href="https://medium.com/@glenem3/advent-of-code-2022-day-5-part-1-8619a16efd3a">Please check out my solution to part 1 before checking out the part 2 solution!</a></p><h3>Solution</h3><p>The solution is similar to task 1 with the main difference is that I added another “helper” stack. The helper stack is used in this case to maintain the order of the crates when they are moved. This idea popped in my head because I realize that if multiple crates are popped off one stack the top crate would be last while the last item first. Hence, to maintain the order, by popping them off the second stack the top crate returns to the top and the last is returned to it’s initial position.</p><pre>def MoveFromStack_task2(stacks, instructions):<br>    #print(stacks)<br>    for instruct in instructions:<br>        t = 0<br>        x = re.split(&quot;from&quot;, re.split(&#39;move&#39;, instruct)[1])<br>        y = re.split(&quot;to&quot;, x[1])<br>        z = [int(x[0]), int(y[0]), int(y[1])]<br>        z_re_index = [z[0], z[1]-1, z[2]-1] <br>        ts = z_re_index[0]<br>        <br>        helper_stack = deque()<br>        <br>        while t &lt; ts:<br>            helper_stack.append(stacks[z_re_index[1]].pop())<br>            t = t + 1<br>        t = 0<br>        <br>        while t &lt; ts:<br>            stacks[z_re_index[2]].append(helper_stack.pop())<br>            t = t + 1<br>        <br>    return stacks</pre><p>Just like in part 1 for my part 2 solution the MakeString function is used in conjunction with the previous one to create a string that shows which crates end up on the top of the stack at the end. The new_file function is used to make a text file with the solution to part 2.</p><pre>def MakeString(data):<br>    Example = []<br>    for Ex in data:<br>        Example.append(Ex.pop())<br>    letters = Example[0]<br>    for ex in range(1,len(Example)):<br>        letters = letters + Example[ex]<br>    return letters<br><br>def new_file(file, day, part2, year=2022):<br>    with open(file, &quot;w&quot;) as f:<br>    <br>        f.write(&quot;Advent of Code &quot;+str(year)+&quot; Day &quot;+str(day)+&quot; Solutions \n&quot;)<br>    <br>        f.write(&quot;Part 2: &quot; + str(part2) + &quot;\n&quot;)<br><br>new_file(&quot;Day 5 Solution Part2.txt&quot;, day=5, <br>         part2=MakeString(MoveFromStack_task2(arr_task2_Day5, Day5))<br>         )</pre><p>We are finished with my solution for the Advent of Code Day 5 Part 2 puzzle with Python.</p><p>Please leave a comment for how you solved this problem, including a link to your GitHub repository for the Advent of Code 2022. Please let me know if you have any tips.</p><h3>El FIN</h3><p>You can look at my solutions to the Advent of Code 2022 in my <a href="https://github.com/glenem/AdventOfCode2022">GitHub repository</a>.</p><p>If you liked this article, follow me on Medium and share this article on social media. Additionally, if you want to stay up to date on my Medium articles, please <a href="https://medium.com/@glenem3/subscribe">subscribe</a> to receive emails when I publish new articles.</p><p>If you want to follow some of my other work, please check out my substack <a href="https://rmthoughts.substack.com/">Random Thoughts</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7065df0a631b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Code 2022- Day 5 Part 1]]></title>
            <link>https://medium.com/@glenem3/advent-of-code-2022-day-5-part-1-8619a16efd3a?source=rss-59b12f9c0d74------2</link>
            <guid isPermaLink="false">https://medium.com/p/8619a16efd3a</guid>
            <category><![CDATA[advent-of-code]]></category>
            <category><![CDATA[advent-of-code-2022]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[stack]]></category>
            <dc:creator><![CDATA[Glen Martin]]></dc:creator>
            <pubDate>Tue, 17 Jan 2023 01:37:16 GMT</pubDate>
            <atom:updated>2023-01-17T04:16:22.842Z</atom:updated>
            <content:encoded><![CDATA[<h4>with Python</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AppNZ4wER6WV3OrGp3fg0g.png" /></figure><h3>Set Up</h3><p>In day 5 of Advent of Code 2022 we are tasked with writing a program which can model how the crane operator will be moving the cargo (crates in stacks). This will help the Elves will know which crates will end up where, and most importantly which crates will be on the top.</p><p>In task 1 we are essentially given two inputs and some rules.</p><p>The inputs are the position the crates start in and how they will be moved. Additionally, we know that the crate on top of the stack will be the first one moved.</p><p>Let’s go through the example to get a better feel for the problem.</p><pre>    [D]    <br>[N] [C]    <br>[Z] [M] [P]<br> 1   2   3 <br><br>move 1 from 2 to 1<br>move 3 from 1 to 3<br>move 2 from 2 to 1<br>move 1 from 1 to 2</pre><p>In this example we have 3 different stacks numbered 1, 2 and 3. Below the stacks we have some instructions of how to move the crates from each stack.</p><p>The in the 1st line it indicates move one crate from stack 2 to stack 1. Pretty straight forward, we move the top crate from stack 2 and put it onto of stack 1.</p><pre>[D]        <br>[N] [C]    <br>[Z] [M] [P]<br> 1   2   3 </pre><p>The 2nd line indicates move three crates from stack 1 to stack 3. This is more complex, how are we moving the crates? Just like in the above we have to move the top most crate before moving the others. So we get the following:</p><pre>        [Z]<br>        [N]<br>    [C] [D]<br>    [M] [P]<br> 1   2   3</pre><p>Not bad.</p><h3>Solution</h3><p>Let’s go over some preliminary packages and helper functions I used.</p><p>Getting the first thing out of the way, I may have cheated, or sort of. I hard-coded the stacks to make the problem easier for me since I just had to parse the instructions.</p><p>For constructing the stacks I used the deque datatype of Python’s <a href="https://docs.python.org/3/library/collections.html">collections package</a>. Why did I want to use the <a href="https://en.wikipedia.org/wiki/Stack_(abstract_data_type)">stack data type</a> from the deque implementation anyways? Well, I was learning about stacks recently, and the wording of the problem caused the idea to pop into my head. Plus, the deque datatype provides forced me to use the essential pop and push (or append) methods of the stack.</p><p>In the following code, it loads in the stacks from the example and from the problem as a list of stacks. An important thing to remember is that the index is different from how the problem is shown on the <a href="https://adventofcode.com/2022/day/5">Advent of Code website</a>. For us, the 1st stack has the 0th index, the 2nd stack has the 1st index, …, and if we continued it further the nth stack would have the nth-1 index.</p><p>Next, the function OpenText takes in the instructions for moving the crates from the stacks, and puts them in a list of lists.</p><pre>from collections import deque # stack datatype<br>import re # RegEx<br><br><br>stack_list_Exday5 = [deque(&quot;ZN&quot;), deque(&quot;MCD&quot;), deque(&quot;P&quot;)]<br><br>def OpenText(Data):<br>    with open(Data, &#39;r+&#39;) as F:<br>        lines = [line for line in F.readlines()]<br>    <br>    lines2 = []<br>    <br>    # Removes new lines &quot;\n&quot; they are a pain<br>    for line in lines:<br>        lines2.append(line.strip())<br>    <br>    return lines2</pre><p>Now for the fun part, our solution to the Advent of Code day 5 part 1 puzzle.</p><p>The first part of the code is for parsing the list of instructions. Where each list z in the broader list has three numerical entries. The first contains the number of crates to be move, the second contains which stack to move from, and the last contains which stack to move to.</p><p>The variable t starts at 0 and the variable ts contains the number of crates to be moved. In our <a href="https://en.wikipedia.org/wiki/While_loop">while loop</a>, we remove the top most crate from the stack to be moved from, and append it to the top of the stack to move to. At the end of our while loop we increment the variable t to factor in the number of crates that must be moved from the stack.</p><pre>def MoveFromStack(stacks, instructions):<br><br>    for instruct in instructions:<br>        t = 0<br>        x = re.split(&quot;from&quot;, re.split(&#39;move&#39;, instruct)[1])<br>        y = re.split(&quot;to&quot;, x[1])<br>        z = [int(x[0]), int(y[0]), int(y[1])]<br>        z_re_index = [z[0], z[1]-1, z[2]-1] <br>        ts = z_re_index[0]<br>        <br>        while t &lt; ts:<br>            stacks[z_re_index[2]].append(stacks[z_re_index[1]].pop())<br>            t = t + 1<br><br>    return stacks<br><br></pre><p>The following function is used in conjunction with the prvious one to create a string that shows which crates end up on the top of the stack.</p><pre>def MakeString(data):<br>    Example = []<br>    for Ex in data:<br>        Example.append(Ex.pop())<br>    letters = Example[0]<br>    for ex in range(1,len(Example)):<br>        letters = letters + Example[ex]<br>    return letters</pre><p>When we combine the two previous function in another function, we get a txt file that shows the crates which end up on the top of each stack.</p><pre>def new_file(file, day, part1, year=2022):<br>    with open(file, &quot;w&quot;) as f:<br>    <br>        f.write(&quot;Advent of Code &quot;+str(year)+&quot; Day &quot;+str(day)+&quot; Solutions \n&quot;)<br>    <br>        f.write(&quot;Part 1: &quot; + str(part1) + &quot;\n&quot;)<br><br>new_file(&quot;Day 5 Solutions.txt&quot;, day=5, <br>         part1=MakeString(MoveFromStack(stack_list_day5, Day5)),<br>         )    </pre><p>We are finished with the Advent of Code Day 5 Part 1 puzzle with Python. Later we will go over my solution for the Advent of Code Day 5 Part 2 puzzle with Python.</p><p>Please leave a comment for how you solved this problem, including a link to your GitHub repository for the Advent of Code 2022. Please let me know if you have any tips.</p><h3><strong>El FIN</strong></h3><p>You can look at my solutions to the Advent of Code 2022 in my <a href="https://github.com/glenem/AdventOfCode2022">GitHub repository</a>.</p><p>If you liked this article, follow me on Medium and share this article on social media. Additionally, if you want to stay up to date on my Medium articles, please <a href="https://medium.com/@glenem3/subscribe">subscribe</a> to receive emails when I publish new articles.</p><p>If you want to follow some of my other work, please check out my substack <a href="https://rmthoughts.substack.com/">Random Thoughts</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8619a16efd3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Helpful Script For Advent Of Code]]></title>
            <link>https://medium.com/@glenem3/helpful-script-for-advent-of-code-389482d57b55?source=rss-59b12f9c0d74------2</link>
            <guid isPermaLink="false">https://medium.com/p/389482d57b55</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[advent-of-code]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Glen Martin]]></dc:creator>
            <pubDate>Thu, 08 Dec 2022 04:00:19 GMT</pubDate>
            <atom:updated>2022-12-08T04:00:19.819Z</atom:updated>
            <content:encoded><![CDATA[<h4>Creating folders and Python files for all 25 days</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*swCOM7qbRkbKljfQa7Cp0g.png" /></figure><p>I wanted to make it easy for me to have all of the folders and Python files ready for all 25 days. Previously, I would create a new folder rename it, create a new Python file, and look through previous code to copy helpful functions. But not anymore because I decided to automate this task through a simple python script.</p><h3>Python Template</h3><p>So far my Python template file is pretty basic. I just need it to be able to generate an output file for both tasks, and to open text files into an array. However, I am sure by the end of Advent of Code 2022 I will have more functions in this template for next year.</p><pre>&quot;&quot;&quot;<br>Common functions used in all of my AOC code thus far<br>&quot;&quot;&quot;<br><br>def new_file(file, day, part1, part2, year=2022):<br>    with open(file, &quot;w&quot;) as f:<br>    <br>        f.write(&quot;Advent of Code &quot;+str(year)+&quot; Day &quot;+str(day)+&quot; Solutions \n&quot;)<br>    <br>        f.write(&quot;Part 1: &quot; + str(part1) + &quot;\n&quot;)<br>    <br>        f.write(&quot;Part 2: &quot; + str(part2) + &quot;\n&quot;)<br>        <br>        <br>def OpenText(Data):<br>    with open(Data, &#39;r+&#39;) as F:<br>        lines = [line for line in F.readlines()]<br>    <br>    lines2 = []<br>    <br>    # Removes new lines &quot;\n&quot; they are a pain<br>    for line in lines:<br>        lines2.append(line.strip())<br>    <br>    return lines2<br><br><br>&#39;&#39;&#39;<br>Part 1<br>&#39;&#39;&#39;<br><br><br>&#39;&#39;&#39;<br>Part 2<br>&#39;&#39;&#39;<br></pre><h3>Python Script To Create 25 Folders and 25 Python files</h3><p>This script creates a new folder for each day of AOC, copies template files in my Advent Of Code Day folder to the folder for each day, and then rename the template files to match the day number for each folder.</p><pre>import os<br>import shutil<br><br>directory = os.getcwd()<br><br>start = 1<br>end = 25<br><br>AOC_Template = directory + &quot;\Advent Of Code Day\AOC_Template.py&quot;<br>Day_text = directory + &quot;\Advent Of Code Day\Day.txt&quot;<br>ExDay_text = directory + &quot;\Advent Of Code Day\ExDay.txt&quot;<br><br>file_list_from = [AOC_Template, Day_text, ExDay_text]<br><br>file_list_to = [&quot;\AOC_Day.py&quot;, <br>                &quot;\Day.txt&quot;,<br>                &quot;\ExDay.txt&quot;]<br><br>for t in range(start, end+1):<br>    <br>    newpath = directory + &quot;\Advent Of Code Day &quot; + str(t)<br><br>    if not os.path.exists(newpath):<br>        os.makedirs(newpath)<br>    <br>    for i in [0, 1, 2]:<br>        shutil.copyfile(<br>            file_list_from[i], <br>            directory + &quot;\Advent Of Code Day &quot; + str(t) + file_list_to[i]<br>            )<br>    <br>    file_list_to2 = [&quot;\AOC_Day&quot;+str(t)+&quot;.py&quot;, <br>                    &quot;\Day&quot;+str(t)+&quot;.txt&quot;,<br>                    &quot;\ExDay&quot;+str(t)+&quot;.txt&quot;]<br>    <br>    for m in [0, 1, 2]:<br>        <br>        os.rename(directory + &quot;\Advent Of Code Day &quot; + str(t) + file_list_to[m],<br>                  directory + &quot;\Advent Of Code Day &quot; + str(t) + file_list_to2[m])</pre><h3>El FIN</h3><p>You can look at my solutions to the Advent of Code 2022 in my <a href="https://github.com/glenem/AdventOfCode2022">GitHub repository</a>. I try to upload solutions daily, however, I am a programming neophyte so it may take be a little while to actually solve each puzzle.</p><p>If you liked this article please follow me on Medium and share this article on social media. Additionally, if you want to follow some of my other work please check out my substack <a href="https://rmthoughts.substack.com/">Random Thoughts</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=389482d57b55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Code 2022 Day 6 with Python]]></title>
            <link>https://medium.com/@glenem3/advent-of-code-2022-day-6-with-python-8aca6fd10efe?source=rss-59b12f9c0d74------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aca6fd10efe</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[puzzle]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[advent-of-code]]></category>
            <category><![CDATA[advent-of-cyber-2022]]></category>
            <dc:creator><![CDATA[Glen Martin]]></dc:creator>
            <pubDate>Wed, 07 Dec 2022 02:34:30 GMT</pubDate>
            <atom:updated>2022-12-07T02:39:51.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*knSx309KaL7EBDdTxaKTzA.png" /><figcaption>Santa working on his advent of code solution</figcaption></figure><p>Today is December 6th and Santa <a href="http://was.tl/">Eric Wastl</a><strong> </strong>has given us a gift. A new programming puzzle in our <a href="https://adventofcode.com/">Advent of Code</a> calendar. I am not the most skilled programmer so Advent of Code (on any day) can be challenging for me. But the problems in day 6 seemed straightforward and I think I was able to write a clean one function solution to both tasks.</p><p>If you don’t know what Advent of Code is and clicked on this article, please see the below description from the <a href="https://adventofcode.com/2022/about">website</a>:</p><blockquote>Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as interview prep, company training, university coursework, practice problems, a speed contest, or to challenge each other.</blockquote><blockquote>You don’t need a computer science background to participate — just a little programming knowledge and some problem solving skills will get you pretty far. Nor do you need a fancy computer; every problem has a solution that completes in at most 15 seconds on ten-year-old hardware.</blockquote><p>Let’s dive into the set up, look at what the two tasks are asking for, and then dive into the solution.</p><h3>Set Up</h3><p>The set up for this puzzle is that the Elves have a fancy device for you to fix, its communication system broke and there is no one else to fix it.</p><p>To fix the system we need to create a program that detects markers in the data stream the device is sending.</p><h3>Task 1</h3><p>For the first task we must find where the start-of-packet marker is, this marker is indicated by the end of a sequence of 4 unique characters.</p><p>Our task is to find the number of characters in the string after the last character of the start-of-packet marker</p><h3>Task 2</h3><p>The second task is similar to the first one, except now we are looking for a start-of-message marker, which consists of 14 unique characters instead of 4.</p><p>Our task is to find the number of characters in the string after the last character of our start of message marker.</p><h3>Solution</h3><p>The crux of this solution is using the <a href="https://docs.python.org/3/library/collections.html#collections.Counter">counter function</a> from the <a href="https://docs.python.org/3/library/collections.html#module-collections">collections</a> module in Python. Essentially, we are using the fact that the counter datatype stores the counts of each character in a string in an array like datatype (sorry if this explanation isn’t entirely correct, it is how I understood it). Let’s look at the following code, that can better explain this:</p><pre>from collections import Counter<br><br>c = Counter(&quot;abc&quot;)<br>print(c)<br>print(len(c))<br>c1 = Counter(&quot;aav&quot;)<br>print(c1)<br>print(len(c1))</pre><p>In c the counter creates an object of length 3 while in c1 the counter creates an object of length 2. c1 is smaller than c, because “a” appears twice so the first entry in the array-like object of our counter is 2 while the second entry is 1. In c’s array-like object all three elements are 1.</p><p>From this we know that the length of the object the counter creates for a unique sequence of characters is equal to the length of that sequence of characters. If the sequence is not unique then the length of the object the counter creases is less than the length of the sequence of characters.</p><p>The following code takes the above fact about the counter and iterates through different sequences of characters until it finds a sequence that is unique. This yields a solution to both tasks because we can vary the end length to 4 for task 1 and to 14 for task 2.</p><pre>from collections import Counter<br><br>with open(&#39;Day6.txt&#39;, &#39;r+&#39;) as F:<br>    Ex1D6 = F.readline()<br><br>def Day6GenSol(InputData, begin, end):<br>    <br>    t = 0<br>    <br>    while t &lt; len(InputData):<br>        string = InputData[begin:end]<br>        freq = Counter(string)<br>        <br>        if len(freq) == len(string):<br>            return end<br>        <br>        else:<br>            begin = begin + 1 <br>            end = end + 1<br>            t = t + 1<br><br>print(Day6GenSol(Ex1D6, begin=0, end=4))<br><br>print(Day6GenSol(Ex1D6, begin=0, end=14))</pre><p>If you have any questions or comments on this solution please let me know.</p><h3>El FIN</h3><p>You can look at my solutions to the Advent of Code 2022 in my <a href="https://github.com/glenem/AdventOfCode2022">GitHub repository</a>. I try to upload solutions daily, however, I started late so I may not have all of the solutions for each day in my repository yet.</p><p>If you liked this article please follow me on Medium and share this article on social media. Additionally, if you want to follow some of my other work please check out my substack <a href="https://rmthoughts.substack.com/">Random Thoughts</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aca6fd10efe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Only Way To Learn Programming Is By Having An Insatiable Curiosity And Googling]]></title>
            <link>https://medium.com/@glenem3/the-only-way-to-learn-programming-is-by-having-an-insatiable-curiosity-and-googling-b15f6cd05d8e?source=rss-59b12f9c0d74------2</link>
            <guid isPermaLink="false">https://medium.com/p/b15f6cd05d8e</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[curiosity]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[growth-mindset]]></category>
            <dc:creator><![CDATA[Glen Martin]]></dc:creator>
            <pubDate>Wed, 23 Nov 2022 02:23:50 GMT</pubDate>
            <atom:updated>2022-11-23T02:23:50.049Z</atom:updated>
            <content:encoded><![CDATA[<h4>The art of programming is 1 part curiosity, 1 part perseverance, and 3 parts Google searches</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tQy1607pFS9K_l5r8gzQSg.jpeg" /></figure><p>The only way I have learned to program is by repetition and having an insatiable curiosity to learn more about programming topics. The following quote by United States Secretary of Defense Donald Rumsfeld best describes the way I have learned programming.</p><blockquote><a href="https://archive.ph/20180320091111/http://archive.defense.gov/Transcripts/Transcript.aspx#selection-1053.336-1053.343">…as we know, there are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns — the ones we don’t know we don’t know…</a></blockquote><p>My programming journey has been a non-linear path. During high school and through university, I have had a bumpy road of learning both <a href="https://www.python.org/">Python</a> and fundamental programming concepts such as data structures, algorithms, iteration by way of while loops and for loops, and recursion. It wasn’t until by time at university that my programming skills really took off. At university I was exposed to <a href="https://www.r-project.org/about.html">R </a>for statistical programming in my econometrics and statistics classes. All of these experiences I would take with my to succeed in an internship during the last semester of my senior year, and in my first job out of university.</p><p>Whilst I am not a professional programmer by any means I have levied programming extensively in my career. During my internship I used R and Python for building statistical models, and ways of estimating the demographic makeup of jobs in our local area. During my career as a pricing and data analyst for a freight forwarding company, I have used R to automate part of my workflow and VBA to decrease the time it takes to generate KPI reports.</p><p>The way I have learned programming is largely by using my current programming knowledge in combination with Google searches to find ways of solving problems. Sometimes, this leads me to new programming libraries or packages that are useful to my particular application. However, at other times it is learning the syntax and semantics of a new language.</p><p>For instance, I am familiar with for loops in Python and R, but how it translated to VBA was foreign to me. Since I knew the essence of what I was looking for, I was able to turn this known unknown into a known known. How did I do this? I used by super power, Googling! Through a carefully worded Google search I was able to find an article that would help me learn VBA’s version a for loop, the <a href="https://www.tutorialspoint.com/vba/vba_foreach_loop.htm">for each loop</a>. I was able to apply this new knowledge in one my KPI reports to open/close workbooks that held data I would feed into my report as well as unhiding/hiding intermediate sheets for calculation purposes in my KPI report workbook.</p><p>How do you turn unknown unknowns to known unknowns? While Google searches are great for turning known unknowns to known knowns quickly, I think reading whether, books or online articles, is the only way to turn unknown unknowns to known unknowns. Unfortunately, this means it is a ongoing, arguably a lifetime process to transform unknown unknowns to known unknowns. Fortunately, it seems to have a network effect where the accumulation of known unknowns helps to make you aware of the unknown unknowns to an extent at least.</p><p>When I am working a writing code for work or for fun I make sure to have an open mindset. I know there is a lot I may not know or understand about a specific programming language, but this gives me an opportunity to research it as the issue arises. Slowly this helps me to transform known unknowns to known knowns, and occasionally, this helps to inform me about what the unknown unknowns are.</p><p>What do you think is important to the programmer’s mindset?</p><p>If you liked this article please follow me on Medium and share this article on social media. Additionally, if you want to follow some of my other work please check out my substack <a href="https://rmthoughts.substack.com/">Random Thoughts</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b15f6cd05d8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EXCEL IS THE MVP LANGUAGE!]]></title>
            <link>https://medium.com/@glenem3/excel-is-the-mvp-language-c16de29ecc0c?source=rss-59b12f9c0d74------2</link>
            <guid isPermaLink="false">https://medium.com/p/c16de29ecc0c</guid>
            <category><![CDATA[vba]]></category>
            <category><![CDATA[r]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Glen Martin]]></dc:creator>
            <pubDate>Sun, 20 Nov 2022 11:01:26 GMT</pubDate>
            <atom:updated>2022-11-20T11:01:26.603Z</atom:updated>
            <content:encoded><![CDATA[<h4>HOT TAKE: Excel is the most valuable programming language!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uhK1mWiRq4zaCHCT2tez5Q.jpeg" /></figure><p>Excel is the most prominent spreadsheet software and may be the most valuable programming (MVP) language. Now you may be thinking “hold up can Excel really be considered a programming language?”</p><p>What is the definition of a programing language? From <a href="https://en.wikipedia.org/wiki/Programming_language#Definitions">Wikipedia</a><a href="#footnote-1">1</a> a programming language is a notation for writing a computer program, which is a set of instructions for a computer to execute. Arguable Excel passes this definition in that we can use it to create formulas which have their own syntax and semantics to do a variety of tasks executed by our computer.</p><p>Additionally, Excel has the ability to turn your customized and complex formulas into reusable function by using the newish <a href="https://www.microsoft.com/en-us/research/blog/lambda-the-ultimatae-excel-worksheet-function/">LAMBDA() function</a>. Other than making new functions LAMBDA() can be used for iteration via recursion. Excel’s lambda function apparently make it <a href="https://www.techrepublic.com/article/microsoft-turning-excel-into-a-turing-complete-programming-language/">Turning Complete</a>; additionally Felienne Hermans and some friends used Excel to create a <a href="https://www.felienne.com/archives/2974">Turing machine</a>.</p><p>Below are some features of programing languages which Excel also has:</p><ul><li>Has data types and arguably data structures via its cells</li><li>Can be used to make custom applications</li><li>Allow you to make custom functions</li><li>Allows for iteration</li><li>Turing Complete</li></ul><p>We’ve argued that Excel is considered to be a programing language. I think Excel is the MVP language because it can be a gateway for people to feel confident enough to learn another programing language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8rKykn91NDRLj0tGNWxTw.png" /></figure><p>Excel is the most popular spreadsheet software due to its litany of features. Indeed it seems like every business uses it and it may de facto run our financial system since it’s widely used in accounting or finance.</p><p>I think Excel is a valuable gateway drug to programming. Everyone I know that became experts at using Excel’s formula language to develop applications has also experimented with using VBA in Excel. You have to learn about different lookup techniques, if statements, etc. to develop killer applications in Excel. All these skills make it easier to understand the logic of programing with VBA. Finally, there’s a playground to learn about if statements, for/while loops, variable assignment and other programing concepts for an Excel user.</p><p>Excel can act as a waterfall for people wanting to learn programming, after experimenting with VBA for automating reporting or data analysis someone could try experimenting with R or Python to generate reports and nice visualization, and to analyze your data.</p><p>How often do you use Excel? Do you think its the most valuable programming language?</p><p>Thanks for reading if you made it this far and liked this post please follow me. Additionally, if you enjoyed the content and want others to read it please share a link to other platforms like Twitter! Please check out my substack <a href="https://rmthoughts.substack.com/">Random Thoughts</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c16de29ecc0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KEYBOARD SHORTCUTS UNCHAINED]]></title>
            <link>https://medium.com/@glenem3/keyboard-shortcuts-unchained-44ee81416236?source=rss-59b12f9c0d74------2</link>
            <guid isPermaLink="false">https://medium.com/p/44ee81416236</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[autohotkey]]></category>
            <category><![CDATA[hotkeys]]></category>
            <dc:creator><![CDATA[Glen Martin]]></dc:creator>
            <pubDate>Sat, 19 Nov 2022 18:11:44 GMT</pubDate>
            <atom:updated>2022-11-20T23:27:44.187Z</atom:updated>
            <content:encoded><![CDATA[<h4>AutoHotKey is a powerful and easy to learn scripting language that can help you get the most out of your Windows computing experience by creating customized hotkeys and hotstrings.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9UuVX-SKAY4cLMDexepxeg.jpeg" /></figure><p>Customized keyboard shortcuts are a must have to make your life easier. Even without a programing background you can still receive the benefits of using the programing language <a href="https://www.autohotkey.com/">AutoHotKey</a> (AHK) to create customized shortcuts.</p><p>The two main keyboard shortcuts that can improve your productivity are <a href="https://www.autohotkey.com/docs/Hotkeys.htm">hotkeys </a>and <a href="https://www.autohotkey.com/docs/Hotstrings.htm#continuation">hotstrings</a>. You’re probably familiar with what hotkeys are, but never heard of hotstrings before. Recall hotkeys are keyboard combinations like ctrl+c to copy and ctrl+v to paste. Similarly hotstrings are a combination of characters you type out that does something.</p><p>A popular use for hotstrings are text expansion or abbreviation expansion. Additionally, if you send out the same email every day you can use AHK to create a hotstring for the content of that email.</p><p>Let’s look at two different examples of text or abbreviation expansion and what the AHK code would look like.</p><p>One example of text expansion is typing a few characters like “. sig”<a href="#footnote-1">1</a> which automatically types your signature for you.</p><p>::.sig::</p><p>Send,</p><p>(</p><p>Thanks,</p><p>Insert Name</p><p>Insert Title</p><p>Insert Company Address, Phone Number, etc.</p><p>)</p><p>return</p><p>Another example of a hotstring would be expanding an abbreviation such as expanding tbh to “to be honest.”</p><p>::.tbh:: to be honest</p><p>Notice the code for abbreviation expansion is much shorter than for adding an email signature. Nevertheless, the code for both is super simple, which makes AHK relatively easy for anyone to use.</p><p>Another cool code bite to increase your productivity is creating a hotkey that uses your favorite search engine to do a search on things you copied to your clipboard. I got the inspiration from <a href="https://www.maketecheasier.com/favorite-autohotkey-scripts/">this article</a>, however, I switched out Google Search for Brave Search, and changed the hotkey to alt+shift+c because I use ctrl+shift+c to inspect the html of websites.</p><p>; Brave Search highlighted text</p><p>!+c::</p><p>{ Send, ^c Sleep 50 Run, https://search.brave.com/searchq=%clipboard% Return }</p><p>I hope you’ve got some ideas for how you’d use AHK from this post. Personally, I use AHK everyday for repetitive emails at my job and it’s given me more time to do other tasks.</p><p>Follow the link to <a href="https://www.autohotkey.com/">download AutoHotKey</a> for yourself and to read the <a href="https://www.autohotkey.com/docs/AutoHotkey.htm">documentation</a>. Read <a href="https://www.makeuseof.com/tag/10-cool-autohotkey-scripts-make/">this </a>for more inspiration on the applications of AHK.</p><p>Do you think you will use AHK in the future? What applications do you think you’ll try out?</p><p>Leave a comment</p><p>Thanks for reading if you made it this far and liked this post please follow me for more. Additionally, if you enjoyed the content and want others to read it please hit share!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44ee81416236" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Kick @$$ In Sales]]></title>
            <link>https://medium.com/@glenem3/how-to-kick-in-sales-38ef93b5079f?source=rss-59b12f9c0d74------2</link>
            <guid isPermaLink="false">https://medium.com/p/38ef93b5079f</guid>
            <category><![CDATA[book-review]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[sales]]></category>
            <category><![CDATA[top-5]]></category>
            <category><![CDATA[jordan-belfort]]></category>
            <dc:creator><![CDATA[Glen Martin]]></dc:creator>
            <pubDate>Sun, 26 Jun 2022 14:42:06 GMT</pubDate>
            <atom:updated>2022-11-23T02:40:52.570Z</atom:updated>
            <content:encoded><![CDATA[<p>5 lessons from the Wolf of Wall Street</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*rN2m12Ol1JPKj10fatVCOA.jpeg" /></figure><p>Jordan Belfort, known by many from the <a href="https://www.imdb.com/title/tt0993846/">2013 movie The Wolf of Wall Street</a> is regarded for his natural ability to sell anything to anyone. Afterall he reportedly made <a href="https://www.redbull.com/int-en/theredbulletin/jordan-belfort-wolf-of-wall-street-interview">$5,000/minute</a> in his heyday from that ability to persuade people to buy. In Belfort’s book “Way of the Wolf <a href="https://rmthoughts.substack.com/p/way-of-the-wolf-5-takeaways#footnote-1">1</a> “ he delineated how he created the Straight Line System and taught it to his Strattonites making them kick-ass sellers and money makers.</p><blockquote><em>I kept pounding the Strattonites with a twice-daily combination of skills training and motivation; and with each passing day the success stories grew crazier and crazier. By the end of year one, top producers were earning over $250,000 a month and their success seemed to be almost contagious.</em></blockquote><p>What is the Straight Line System? If it turned a bunch of kid Strattonites into selling-machines then what can it do for you? From his book the Straight Line System seems to be equally a way of life as it is a sales technique where those versed in it achieve a higher sense of confidence.</p><blockquote><em>No matter how many times I witnessed it, this radical transformation was never lost on me. Everything from how they walked to how they talked to how they dressed to how they shook hands to the way they made eye contact; you could literally feel the confidence oozing off them.</em></blockquote><p>Throughout his book Belfort is selling you his system giving many examples for the reader to think through and many actionable steps to become better at the art of persuasion. The following are my five takeaways from his book about the Straight Line System:</p><ol><li><strong>Persuasion is about managing the certainty of the person you want to persuade. </strong>At its core, Belfort’s persuasion method, the Straight Line System, is a way to manage your prospect’s level of certainty on a continuum of 100% uncertain to 100% certain to close a deal. However, the certainty you want to increase is threefold: their certainty in your product, you, and your company.</li><li><strong>Tonality and body language are vital tools in the persuasion process.</strong> Your words can bring a person’s logical certainty to 100%, but without using the right tones or body language you will not bring their emotional certainty to 100% which is necessary to close the deal. What are the right tones or body language? Body language is slightly easier, you must 1) look the part in your approach, 2) match your prospect in their body language, and 3) you want to be actively listening to what your prospect is saying. The implementation of body language is to improve your prospects certainty about you by improving your likeability. Tonality is harder because Belfort has 10 tonalities that you could use in persuasion. The core idea is to alter the tonalities used in the persuasion to move your prospect emotionally to make you seem reasonable and trustworthy.</li><li><strong>For successful persuasion the person has to be persuadable.</strong> If you are trying to sell a pen but they are not in the market for it you will not be successful. The only people you should try to persuade are the ones who actually want what you are selling.</li><li><strong>Persuasion must be aided by a script. </strong>A script or more preferably scripts yield an advantage of being able to 1) really listen to what your prospect is saying to develop report and gather intelligence, 2) you can embed tonality and body language into persuasion by practicing, and 3) there’s little risk of sounding like a fool because you know what you are going to say and have thought of responses to objections.</li><li><strong>People have only one objection to being persuaded.</strong> In the book Belfort lists different reasons for objections like let me think about it or I need to talk to someone else, however he makes it clear that the root cause of any objection a prospect has is being uncertain about your product, you or your company.</li></ol><p>For a greater elaboration on my 5 takeaways make sure to read Belfort’s book Way of the Wolf. I would recommend trying to find it at your local library first and if you want it as a reference, buy it.</p><p>Thank you for reading this post! If you liked it and want to read more of my work please follow me. Also feel free to share the post on social media.</p><p>Please subscribe to my substack for my latest articles: <a href="https://rmthoughts.substack.com/">https://rmthoughts.substack.com/</a></p><p><em>Originally published at </em><a href="https://rmthoughts.substack.com/p/way-of-the-wolf-5-takeaways"><em>https://rmthoughts.substack.com</em></a><em> on June 26, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38ef93b5079f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>