<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="rss.xsl"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Existential Blog</title>
        <link>https://existential.company/blog</link>
        <description>Existential Blog</description>
        <lastBuildDate>Mon, 13 Dec 2021 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[Notes on Bitcoin]]></title>
            <link>https://existential.company/blog/notes-on-bitcoin</link>
            <guid>https://existential.company/blog/notes-on-bitcoin</guid>
            <pubDate>Mon, 13 Dec 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[I have never gotten a satisfactory answer to the question "what is Bitcoin" so thought I'd give it a shot given my new understanding of Bitcoin. Perhaps I can save someone some time.]]></description>
            <content:encoded><![CDATA[<p>I have never gotten a satisfactory answer to the question "what is Bitcoin" so thought I'd give it a shot given my new understanding of Bitcoin. Perhaps I can save someone some time.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-is-bitcoin">What is Bitcoin?<a href="https://existential.company/blog/notes-on-bitcoin#what-is-bitcoin" class="hash-link" aria-label="Direct link to What is Bitcoin?" title="Direct link to What is Bitcoin?" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="computer-science-fundamentals">Computer Science Fundamentals<a href="https://existential.company/blog/notes-on-bitcoin#computer-science-fundamentals" class="hash-link" aria-label="Direct link to Computer Science Fundamentals" title="Direct link to Computer Science Fundamentals" translate="no">​</a></h3>
<p>Send money (cryptocurrency) without a central authority. The power to send the money resides in the keys of each wallet.</p>
<p>There are 3 fundamental principles to understand cryptocurrency: asymmetric encryption (public/private keys), hash algorithms, and blockchain.</p>
<p><img decoding="async" loading="lazy" alt="Bitcoin" src="https://existential.company/assets/images/12-13-21-4f62c13df831eadc112381c4be541780.jpg" width="500" height="333" class="img_ev3q"></p>
<!-- -->
<p><strong>Encryption</strong> allows you to protect data, by changing it in a predictable way, reversible only with a key. Asymmetric encryption involves 2 keys — one is used to protect the data, but cannot be used to reveal it. Only the second key can reveal the protected data. Private/public keys are essentially what make up a wallet.</p>
<p><strong>A hash algorithm</strong> is a function that returns a fixed length output, for example 256 bits, when given input, for example a list of transactions. You will always get the same hash output with the same input. A viable cryptocurrency hash algorithm unpredictably changes the output with any change to the input.</p>
<p><strong>Blockchain</strong> is a list of linked blocks of data. Each block references the previous block, and includes a hash of that block. This means blocks cannot be modified without invalidating the hashes for the remainder of the chain.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="putting-it-together">Putting it together<a href="https://existential.company/blog/notes-on-bitcoin#putting-it-together" class="hash-link" aria-label="Direct link to Putting it together" title="Direct link to Putting it together" translate="no">​</a></h3>
<p>In order to ensure money cannot be spent twice, consensus must be found among the network. Otherwise there is nothing stopping me from sending money to you, and to myself (double spend). I could dispute that the first transaction was invalid. Which one is valid and which is not? This is a simple example of a fork. With a blockchain, we can ensure only one transaction is valid by reaching consensus. In Bitcoin that consensus is simply reached by accepting the longest chain of blocks. This is why waiting for 3 blocks makes it reasonably certain that the transaction is final.</p>
<p>Blocks are made up of a group of signed transactions, each signed using the private key for the wallet, and the hash of the previous block. In order for a new block to be considered valid in the chain, the hash of the new block must be within a target range, for example a hash with 16 preceding 0s. The odds of computing a hash that starts with 16 preceding 0s is very low. Bitcoin automatically changes the target range in order to reach an average of ten minutes between blocks. Small modifications can be made to the block in order to change the hash: a nonce, the date/time, changing the group of transactions in the block.</p>
<p>Whoever submits a valid block to the network first is rewarded for "mining" with a baked-in reward which halves every so often, about a year, and collects all of the fees submitted from all of the transactions included in the new block.</p>
<p>When users want to send Bitcoin, they submit a transaction to the network, which is then gossiped about to other nodes. A part of the transaction may include a transaction fee. Higher fees mean higher priority for the miners, so with higher congestion come higher fees. It's possible to submit a transaction with no fee, but it may take a long time to ever be added to the blockchain because miners are not incentivized to include the transaction.</p>
<p>That concludes my explanation of "What is Bitcoin?"</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="extra">Extra<a href="https://existential.company/blog/notes-on-bitcoin#extra" class="hash-link" aria-label="Direct link to Extra" title="Direct link to Extra" translate="no">​</a></h3>
<p>Another interesting thing to learn about is the UTXO concept that Bitcoin uses. Rather than have an account balance that is modified over time, and requires all of history to determine the current state, Bitcoin validates new transactions simply by looking at unspent transaction output — money that has been sent to you, that you haven't sent anywhere else.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="web3">Web3<a href="https://existential.company/blog/notes-on-bitcoin#web3" class="hash-link" aria-label="Direct link to Web3" title="Direct link to Web3" translate="no">​</a></h3>
<p>I've spent the last 2 months trying to catch up to the Web3 world, but I still feel far behind. The thing I'm most excited to try next is building my own blockchain using Substrate (the open source blockchain building project, which constitutes ~80% of the Polkadot blockchain). Substrate allows you to focus on the State Transition Function in the Runtime, rather than all of the other complicated parts of building a blockchain.</p>
<p>Here's to hoping, and working towards the free web!</p>
<p><a href="https://www.reddit.com/r/ExistentialCompany/comments/rfzl4s/notes_on_bitcoin" target="_blank" rel="noopener noreferrer" class="">Discuss on Reddit</a></p>]]></content:encoded>
            <category>Bitcoin</category>
        </item>
        <item>
            <title><![CDATA[Notes on Peter Naur: Programming as Theory Building]]></title>
            <link>https://existential.company/blog/notes-on-peter-naur-programming-as-theory-building</link>
            <guid>https://existential.company/blog/notes-on-peter-naur-programming-as-theory-building</guid>
            <pubDate>Sat, 23 Oct 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[Source paper]]></description>
            <content:encoded><![CDATA[<p><em><a href="https://pages.cs.wisc.edu/~remzi/Naur.pdf" target="_blank" rel="noopener noreferrer" class="">Source paper</a></em></p>
<p><strong>Abstract:</strong> A programmer's main output is a theory. A program or program text is a manifestation of a part of that theory. Documentation and program text is insufficient to convey a theory. A program without its theory is dead, and should be replaced with a new theory.</p>
<p><img decoding="async" loading="lazy" alt="Construction" src="https://existential.company/assets/images/10-23-21-cb8605f5400395e1c66a29b485b34d3b.jpg" width="2560" height="2568" class="img_ev3q"></p>
<!-- -->
<p>The quality of work is based on the original programmer's theory of the problem and how well it matches his theory of the solution.</p>
<p>The quality of a later programmer's work is how well his theories match the previous programmer's theories.</p>
<p>Rather than pass on the design, we should pass on the theories driving the design.</p>
<hr>
<p>Instead of considering a programmer to be a producer of a program and certain other texts, programming should be considered an activity to achieve a certain kind of insight, or form a theory of the matters at hand.</p>
<p>It's important to understand the theories behind a program, or it will lead to conflicts and frustrations.</p>
<hr>
<p>Consider a program developed by group A is being extended by group B. Even with full documentation and discussions, group B will not understand the theory behind group A's work. By talking with group A, group B is able to modify their proposition to take advantage of group A's theory. Later another group without communication with group A makes the original powerful design ineffective. Documentation failed to carry some of the most important design ideas.</p>
<p>As a programmer, our job is to first understand the theories behind an existing system, before recommending our own theories of what the solution should've been.</p>
<p>I don't entirely agree with this statement (summarized): <em>Continued work on a large program requires the knowledge of a programmer closely and continuously connected to it.</em> After finishing the article, I changed my mind. I do agree with this statement. As much as I would like to believe that I am capable of documenting a project sufficiently to convey its theory to the next programmer.</p>
<hr>
<p>Intelligence vs intelligent activity. Having information about something, versus having a theory about something, and recognizing and applying the theory in related aspects. My theory: knowing something is not enough, you must know how and where to apply it. E.g.: Applying Newton's Law Force = Mass × Acceleration to planets, etc. (it's not enough to know just that F=MA — what is F, M, A?). Hierarchy of data: Data → Information → Knowledge → Wisdom. Intelligence is having data, information, even knowledge, but intelligent activity is the wisdom of when to apply that knowledge, and where else it can be applied.</p>
<p>The dependence on a theory of how things relate makes it impossible to express the theory in terms of criteria or rules.</p>
<p>A programmer with the theory of the program is able to:</p>
<ol>
<li class="">Explain how the solution relates to the affairs of the world it helps to handle</li>
<li class="">Explain why the program is the way it is — justifications for code decisions, perhaps with design rules, quantitative estimates, comparisons with alternatives, etc.</li>
<li class="">Make modifications easily, and make them where they should be made given the existing capabilities</li>
</ol>
<hr>
<p>Generally, modifying a complicated man-made construction is difficult and costly. Often buildings are demolished rather than modified. Yet, there is an expectation that it is easy to modify a program. In the Theory Building View, modifying a program is not simply changing the medium of text.</p>
<p>Building in flexibility to a program has a high cost, which may or may not even be useful in the future. Flexible solutions are fine if it is easy.</p>
<p>When modifying a program, a programmer must determine how the existing theory is similar, and what has changed in theory, in order to reflect the real world. This is where possessing the existing theory is crucial.</p>
<p>Problems arise when assuming programming consists of program text production, rather than an activity of theory building.</p>
<p>Without the underlying theory, modifications to a program will become inconsistent. Only a programmer with that theory will recognize the difference in character of various changes. The character of changes is vital to the long term viability of the program.</p>
<p>Program text production is one possibility manifested into a medium as part of the greater act of Theory Building.</p>
<hr>
<p>A program dies when there is no longer a programmer possessing its theory in active control of the program. It may continue to be used, while the state of death only becomes evident when demands for modifications of the program cannot be intelligently answered. A program may be revived by a new programming team, but requires close contact with programmers who already possess the theory in order to gain an understanding of the program in the wider context of the relevant real world situations. Becoming familiar with the program text and other documentation is insufficient.</p>
<p>It is frustrating, costly, and time consuming to revive a program, and may lead to inconsistency as the new theory will likely differ from the original. The Theory Building View suggests discarding existing program text, and giving the new programmer team the opportunity to solve the given problem afresh.</p>
<hr>
<blockquote>
<p>"On the Theory Building View the primary result of the programming activity is the theory held by the programmers."</p>
</blockquote>
<blockquote>
<p>"What should you put into the documentation? That which helps the next programmer build an adequate theory of the program."</p>
</blockquote>
<blockquote>
<p>"Experienced designers often start their documentation with just:</p>
<ul>
<li class="">The metaphors</li>
<li class="">Text describing the purpose of each major component</li>
<li class="">Drawings of the major interactions between the major components"</li>
</ul>
</blockquote>
<p><a href="https://www.reddit.com/r/ExistentialCompany/comments/qecwxc/notes_on_peter_naur_programming_as_theory_building/" target="_blank" rel="noopener noreferrer" class="">Discuss on Reddit</a></p>]]></content:encoded>
            <category>Programming</category>
        </item>
        <item>
            <title><![CDATA[Optimizing my life, now with Home Assistant]]></title>
            <link>https://existential.company/blog/optimizing-my-life-home-assistant</link>
            <guid>https://existential.company/blog/optimizing-my-life-home-assistant</guid>
            <pubDate>Fri, 10 Sep 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[It's the start of the morning, like every other morning that has started. Brush teeth, take a shower, shave, get dressed. Most would probably get dressed after a shower, and I'm guessing not really care about the rest.]]></description>
            <content:encoded><![CDATA[<p>It's the start of the morning, like every other morning that has started. Brush teeth, take a shower, shave, get dressed. Most would probably get dressed after a shower, and I'm guessing not really care about the rest.</p>
<p>There are more things to consider for an obsessive overly analytical individual however. Months after moving into a new house, I'm still thinking about how to save more time, and make life easier.</p>
<p>Consider the following: Do you want your face to be wet while shaving? No: shave before brushing teeth. How far away is the shower from the water heater? Do you want an ice cold shower? No: shower after shaving and brushing teeth to save water and time.</p>
<p><img decoding="async" loading="lazy" alt="New house" src="https://existential.company/assets/images/09-10-house-be5247b41ecb447d7b7d0f726a374374.jpg" width="4032" height="3024" class="img_ev3q"></p>
<p>Countless hours, and months later, I no longer think about my morning routine, and I'm satisfied that it is optimal.</p>
<p>Was it worth it? That's debatable. As an obsessive efficient (compulsive? disorder?) it is something I just do, not really something I decided to do necessarily, it's just a habit.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="where-do-i-start-automating-my-home">Where do I start automating my home?<a href="https://existential.company/blog/optimizing-my-life-home-assistant#where-do-i-start-automating-my-home" class="hash-link" aria-label="Direct link to Where do I start automating my home?" title="Direct link to Where do I start automating my home?" translate="no">​</a></h2>
<p>I think it's important to know what's possible, and then let your mind wander, and over time figure out what to add. Software engineers, such as myself, are notorious for creating cool solutions, without an actual problem. It turns out solving problems, is often a much better approach.</p>
<p>My first problem to solve: I work from home, thanks pandemic. And I mine cryptocurrency, thanks free money. Unfortunately my PC generates a lot of heat, in my small (but actually kind of big) office. I needed to keep my office cool enough, to avoid getting a migraine while working and mining.</p>
<p>I bought a bluetooth thermometer to figure out just how hot it was getting in my office. 85 Degrees fahrenheit, in the winter! I wanted to make small iterative changes until I was satisfied with the results, and make minimal impact on my house.</p>
<p>I cut a hole in the floor of my office (the ceiling of the basement). I cut a hole near the ceiling in the wall of my office, and put another vent there to act as an "in take" because my time building custom PCs has taught me that you need airflow in AND out or it won't work as well. And everyone knows hot air rises, so the plan was to move cold air up into the office, and hot air down into the basement. I stuck 6" inline duct fans on both and fired them up. Unfortunately the impact on the temperature in my office was minimal.</p>
<p>Time to get serious. I bought a portable AC unit and planned to put it in the basement to avoid some of the noise. I was committed with two holes in my fresh new house, but before I make it even more permanent, I needed some real data confirming this was actually going to work.</p>
<p>Throughout this process I wanted to be deliberate, and have a plan for each outcome, all while being data driven. Also iteratively improving, doing as little as possible each step of the way, and trying to avoid over-architecting. Not an accident that these are all applicable programming principles.</p>
<p><img decoding="async" loading="lazy" alt="AC in the basement" src="https://existential.company/assets/images/09-10-first-979f3984059ad8767b804e44fc1f2c55.jpg" width="4032" height="3024" class="img_ev3q"></p>
<p>With the AC unit rigged up, I shut off my mining and fired up Rocket League with the FPS cap off. I closed the door to my office and let it run for 20 minutes, baking the room with no AC. Then the moment of truth. It worked! Leaving it on by accident, the office temperature would even drop down to 65 Degrees!</p>
<p><img decoding="async" loading="lazy" alt="Temperature data" src="https://existential.company/assets/images/09-10-data-68d2d3a1e28e096265c72fe495622f6d.jpg" width="1080" height="1420" class="img_ev3q"></p>
<p>It didn't take long to make me sick of running downstairs to turn it on and off all day.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="enter-automation">Enter automation<a href="https://existential.company/blog/optimizing-my-life-home-assistant#enter-automation" class="hash-link" aria-label="Direct link to Enter automation" title="Direct link to Enter automation" translate="no">​</a></h2>
<p>I had a Raspberry Pi lying around, so I threw <a href="https://www.home-assistant.io/installation/" target="_blank" rel="noopener noreferrer" class="">Home Assistant</a> onto it. Many hours of research into different smart home ecosystems led me to this decision. I also decided that I would use Z-Wave and Zigbee in order to minimize the impact on Wifi interference at my house. I like the idea of keeping everything local, and not exposing all of my smart devices to the internet.</p>
<p>I bought a <a href="https://www.amazon.com/GoControl-CECOMINOD016164-HUSBZB-1-USB-Hub/dp/B01GJ826F8/" target="_blank" rel="noopener noreferrer" class="">2-in-1 (Z-Wave and Zigbee) adapter</a> so that I wouldn't regret a decision for one over the other later.</p>
<p>All I really needed to rig up my "thermostat" was a temperature sensor, but this <a href="https://www.amazon.com/gp/product/B0151Z8ZQY/" target="_blank" rel="noopener noreferrer" class="">6-in-1 motion, temperature+</a> was the only thing I could find that didn't require batteries. I hate batteries. I don't need any more things to worry about.</p>
<p>I settled on <a href="https://www.amazon.com/gp/product/B08FJ5LHSN/" target="_blank" rel="noopener noreferrer" class="">Zigbee smart plugs</a> and found out after the fact that they also report power usage through Home Assistant, which is pretty cool. I ordered 4 more just to use for monitoring power usage.</p>
<p>After the initial setup with Home Assistant, I got very distracted by trying to use Add-Ons for everything. I'm probably the only one with this problem, but I thought I'd share: just install Z-Wave JS. Configuration → Integrations is where you'll go to add and manage Z-Wave JS, and HubZ Smart Home Controller (Zigbee). To add devices with Z-Wave just click Configure → Add Node. For Zigbee, click Configure → Add Device (in the bottom right).</p>
<p>With your devices added, head on over to Configuration → Automations. I tried to find a blueprint to save myself time, but it ended up being a waste of time.</p>
<p>I made two different rules. One that turns the AC on when the temperature is over 73, and there has been motion in the past 30 minutes, and it's between 6am and midnight. And one that turns the AC off when the temperature is under 73, there hasn't been motion for 30 minutes, or it's midnight.</p>
<p><img decoding="async" loading="lazy" alt="Home Assistant automation rules" src="https://existential.company/assets/images/09-10-second-9141a7ca32602a75c76f36569085ac12.jpg" width="4032" height="3024" class="img_ev3q"></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="where-to-from-here">Where to from here?<a href="https://existential.company/blog/optimizing-my-life-home-assistant#where-to-from-here" class="hash-link" aria-label="Direct link to Where to from here?" title="Direct link to Where to from here?" translate="no">​</a></h2>
<p>Since I can't turn my brain off, I have started finding more ways to limit what I need to do. Like adding a smart plug in front of my Amp, DAC, and sound system in my office, so it turns on with motion. Adding <a href="https://www.amazon.com/gp/product/B015KQ29JI/" target="_blank" rel="noopener noreferrer" class="">smart lights</a> in my office, so they turn on with motion.</p>
<p>I've added <a href="https://www.amazon.com/gp/product/B013OCF2EY/" target="_blank" rel="noopener noreferrer" class="">other smart lights</a> that do remember their state to the master bathroom, so that I can turn down the brightness and set it to the warmest temperature possible, so I'm not blinded in the morning and evening.</p>
<p>I now have 8 different automations configured, and I expect to keep adding more slowly. We'll see what happens when the new standard Matter shows up, but I assume what I've done so far will still be compatible through Home Assistant.</p>
<p><a href="https://www.reddit.com/r/ExistentialCompany/comments/plwikl/optimizing_my_life_now_with_home_assistant/" target="_blank" rel="noopener noreferrer" class="">Discuss on Reddit</a></p>]]></content:encoded>
            <category>Homelab</category>
            <category>Automation</category>
        </item>
    </channel>
</rss>