<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Rumble Lane]]></title><description><![CDATA[An echo of my thoughts, And the ink of my story.]]></description><link>https://rumblelane.com/</link><image><url>https://rumblelane.com/favicon.png</url><title>Rumble Lane</title><link>https://rumblelane.com/</link></image><generator>Ghost 5.71</generator><lastBuildDate>Thu, 09 Apr 2026 12:47:56 GMT</lastBuildDate><atom:link href="https://rumblelane.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Trust: in the new Millenium]]></title><description><![CDATA[A letter shows up on your door one day proclaiming to be from the Queen, but how do you know if the letter really came from her?
The answer: a DKIM record.]]></description><link>https://rumblelane.com/trust-is-easy/</link><guid isPermaLink="false">59afcd647e795879923d1fbf</guid><category><![CDATA[non-fiction]]></category><category><![CDATA[programming]]></category><category><![CDATA[sys-admin]]></category><category><![CDATA[exim]]></category><dc:creator><![CDATA[Callum Trayner]]></dc:creator><pubDate>Fri, 21 Apr 2017 20:51:01 GMT</pubDate><media:content url="https://rumblelane.com/content/images/2017/04/Screenshot-from-2017-04-21-21-47-08.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://rumblelane.com/content/images/2017/04/Screenshot-from-2017-04-21-21-47-08.png" alt="Trust: in the new Millenium"><p>HAHA, IT IS DONE. WE HAVE BATTLED FOR WEEKS, BUT YOU HAVE FINALLY SUBMITTED. SUBMITTED TO BEING MY SERVANT, TO BEING THE COURIER OF MY MAIL.</p>
<p>AND YOU WILL FUCKING SIGN IT WITH MY DKIM SIGNATURE, FOR I HAVE DECREED IT.</p>
<p>For those of you wondering what the hell that was about, I&apos;ve recently spent an inordinate amount of time trying to get exim to sign my emails with a DKIM (Domain Keys Identified Mail) signature, in order to reduce the likelihood of it being considered spam.</p>
<p>For those unaware, DKIM (Domain Keys Identified Mail) is a process in which a private key is used to sign the emails prior to their delivery to another mail server. The receiving server can then lookup the domain of the sender to get the public key, which it uses to validate that the email has originated from somewhere controlled by the domain owner.<br>
Effectively, DKIM is a system to ensure that mail is coming from the domain it&apos;s proclaiming to be from, because despite what most consumer software might have you believe, anyone can send an email pretending to be from <a href="mailto:support@apple.com">support@apple.com</a>;<br>
it&apos;s as simple as</p>
<pre><code class="language-bash">echo &quot;To: user@domain.com
Subject: Password Reset
From: support@apple.com&quot; | sendmail -f &quot;support@apple.com&quot; user@domain.com
</code></pre>
<p>Those fairly simple lines would send an email to <code>user@domain.com</code> which for all intents and purposes would appear to be from <code>support@apple.com</code>.<br>
Historically this tended to be a pretty big issue, and is the reason their was so much spam going around in the 90&apos;s/00&apos;s. More recently, a number of standards have been introduced as a way to validate that a sender is who they say they. Or at least, that their associated with the domain that they say they are (You can do individual sender validation separately, using PGP signing and the web of trust).</p>
<p>The first standard is known as SPF, which is a simple text record associated with the DNS server containing the IP&apos;s that can send mail from the specified domain, if an IP is trying to send an email with a from address of <code>apple.com</code>, but the server&apos;s IP isn&apos;t in the <code>apple.com</code> SPF record, then most modern mail servers will assume the email is spam/phishing and refuse to accept it.</p>
<p>The second standard I&apos;ll mention is DKIM, which uses public/private key pairs to verify the email and it&apos;s contents. The private key is known only to the server, and is used to sign the emails as they leave, the public key is derived from the private key, and as the name suggests, is made public in a DNS record associated with the domain. Any signature made from the private key can be validated against the public key to ensure that it has in fact originated from the origin that it&apos;s proclaiming to.</p>
<p>As an aside, this post started as a rant because I wanted to have a whinge about exims&apos; scripting language, which is the reason I&apos;ve got SPF/DKIM on my mind.<br>
(My issue with exim&apos;s scripting language has to do with the lack of an indicator for variables in strings, as opposed to being a regular part of a string. In the snippet below their&apos;s nothing to indicate that DKIM_DOMAIN is actually a variable and not just an uppercase section of the string.)</p>
<pre><code class="language-bash"># Commented below each of the assignments is an example of 
# what it resolves to.
MAIN_TLS_ENABLE = true
DKIM_CANON = relaxed
DKIM_SELECTOR = 20170405
# Get DKIM_DOMAIN /FROM/ outgoing email header
DKIM_DOMAIN = ${sg{$lc:${domain:$h_from:}}}{^www\.}{}}
#DKIM_DOMAIN = rumblelane.com

# use the file associated with the domain
DKIM_FILE = /etc/exim4/dkim/DKIM_DOMAIN-private.pem
#DKIM_FILE = /etc/exim4/dkim/rumblelane.com-private.pem

# if the file doesn&apos;t exist, don&apos;t use it.
DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}
#DKIM_PRIVATE_KEY = /etc/exim4/dkim/rumblelane.com-private.pem
</code></pre>
<p><em>In the above code you can see how the configuration looks in exim, we get the domain name (DKIM_DOMAIN) from the sender address, we look for a private key for that domain (DKIM_FILE) and then we set the private key to the file if it exists (DKIM_PRIVATE_KEY), you can also see the selector I&apos;ve specified for the DKIM record, if I need to support different selectors for different domains in future I could do that with an IF/ELSE IF.</em></p>
<p>Both standards are, in essence, a way to determine the trust-worthiness of a given communication (in this case, an email), and they do so by publicly declaring that &quot;only communications that originate from these addresses (SPF) or have my signature (DKIM) are from me.&quot;</p>
<p>For the curious, you can see my DKIM record <a href="https://mxtoolbox.com/SuperTool.aspx?action=txt%3A20170405._domainkey.rumblelane.com&amp;ref=rumblelane.com">here</a>, and my SPF record <a href="https://mxtoolbox.com/SuperTool.aspx?action=txt%3Arumblelane.com&amp;ref=rumblelane.com">here</a> (It&apos;s the second, the first is my keybase verification).</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Electing Trump]]></title><description><![CDATA[Condensing my thoughts on the election of Trump.

"It's not the end of the world, but you can see it from here."]]></description><link>https://rumblelane.com/electing-trump/</link><guid isPermaLink="false">5e8a67deefff66060ade38f8</guid><category><![CDATA[non-fiction]]></category><category><![CDATA[politics]]></category><category><![CDATA[opinion]]></category><dc:creator><![CDATA[Callum Trayner]]></dc:creator><pubDate>Wed, 09 Nov 2016 22:24:00 GMT</pubDate><media:content url="https://rumblelane.com/content/images/2020/04/DSC00188-1.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://rumblelane.com/content/images/2020/04/DSC00188-1.jpg" alt="Electing Trump"><p>To steal a quote I used after the earthquakes:</p>
<blockquote>
<p>&quot;It&apos;s not the end of the world, but you can see it from here.&quot;</p>
</blockquote>
<p>Hyperbole aside, their&apos;s a fair amount to unpack with this Trump victory.</p>
<p>Firstly, <em>I don&apos;t think it&apos;s the end of the world</em>. Jon Stewart remarked a while back that he believed America was stronger than any one man, at the time he meant to defend against the oppositions implication that Obama would ruin america, but equally the remarks apply to Trump&apos;s opposition (and so I guess we&apos;ll get to see whether he was right).</p>
<p>Secondly, I feel this victory is indicative of a trend in the western world towards nativism, a recession from globalization because we perceive it as having failed us. A perception influenced by the failure of Greece, the shrinking of blue-collar / middle class jobs, the increase in wealth at the highest levels of society, and by (social-)media zeitgeist&apos;s (e.g. the argument&apos;s against TPPA/TTIP while having some merit, make&apos;s it easy to jump from &quot;TPPA is bad&quot; to &quot;globalization is bad&quot; as globalization is the primary purpose of trade agreements).<br>
So to those of you reading this, I urge you to re-evaluate your beliefs with careful consideration for your aspirations for the world and with regards to the agenda of those informing you, be they politicians or reporters (keep in mind almost everything you read is propaganda, whether it&apos;s factual or not).</p>
<p>Thirdly, I believe the Trump victory is the first strong indicator we&apos;ve had that the fall of the American empire has begun.<br>
I don&apos;t mean the fall of the US as a nation, but as a super-power with global influence.<br>
Say what you will about Obama, but he a was fairly competent and savvy politician. He was aware of China&apos;s growing influence and power, and attempted to curb it with his economic policies and the various trade agreements (TTIP/TPPA were designed from the outset to exclude China, in order to curb China&apos;s economic influence).<br>
Trump on the other hand, has run his entire platform on the notion that he is not a politician (and therefore trustworthy). But his lack of political experience will be absolutely crippling on the world stage, keep in mind that Putin was able to out-maneuver Obama, who is a reasonably savvy politician. To think Trump can go toe-to-toe with other world leaders is laughable.</p>
<p>And Lastly, this victory shows just how wide the gap between the political class and the people of the USA has grown. Just weeks before the election most prominent republicans pulled support for Trump on the back of his &quot;grab &apos;em by the pussy&quot; remarks, and the Democrats&apos; oppose him for obvious reasons, yet despite having little political backing he still won the election. This certainly indicates that much of the political class in America no longer represent the views of the people.</p>
<p>On a more positive note, we do have a few things to look forward to:</p>
<ul>
<li>We get to watch that whole &quot;build a wall&quot; farce actually play out.</li>
<li>Trump&apos;s inevitable impeachment (because it&apos;s only a matter of time until he does something that warrants it, if he hasn&apos;t already).</li>
<li>The odd&apos;s of actual fisty-cuffs between world leaders are significantly higher than they were yesterday.</li>
</ul>
<p>(I&apos;ve attached Charlie Chaplin&apos;s speech from &quot;The Great Dictator&quot; (which is 76 years old!), because it&apos;s reflective of my aspirations for the world).</p>
<!--kg-card-end: markdown--><figure class="kg-card kg-embed-card kg-card-hascaption"><iframe width="480" height="270" src="https://www.youtube.com/embed/w8HdOHrc3OQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><figcaption>Charlie Chaplin&apos;s Speech from &quot;The Great Dictator&quot;, circa 1940.</figcaption></figure><p></p>]]></content:encoded></item><item><title><![CDATA[Algebra Lessons, Part 1.]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h3 id="notes">Notes</h3>
<p>Answers with working can be found at the bottom of this page. The first few questions are relatively straight forward. The thing to remember with algebra is that you don&apos;t always get a clean answer. when presented with an equation like \( (x+2)(x+1)=\) you&apos;</p>]]></description><link>https://rumblelane.com/chantals-homework/</link><guid isPermaLink="false">59afcd647e795879923d1fb2</guid><category><![CDATA[non-fiction]]></category><category><![CDATA[homework]]></category><category><![CDATA[highschool]]></category><dc:creator><![CDATA[Callum Trayner]]></dc:creator><pubDate>Sat, 02 Jul 2016 10:19:05 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h3 id="notes">Notes</h3>
<p>Answers with working can be found at the bottom of this page. The first few questions are relatively straight forward. The thing to remember with algebra is that you don&apos;t always get a clean answer. when presented with an equation like \( (x+2)(x+1)=\) you&apos;re unlikely to get to a simple \( x = ??\) position.<br>
So try not to get too hung up on looking for that.</p>
<p>What I found when I was learning algebra was that sometimes I would forget the basic rules. For examples sometimes I would do the following:<br>
\[ (x + y)^2 = \]<br>
\[ (x + y)(x + y) \]<br>
\[ = x^2 + xy + yx + y^2 \]<br>
But that goes against one of the primary rules, namely that we keep to alphabetical order. The correct answer is \( x^2 + xy + xy + y^2 \) which can then be simplified to \( x^2 + 2xy + y^2 \). Messing it up made me think that \(xy\) and \(yx\) were different numbers, when they&apos;re actually the same number.</p>
<h4 id="substitution">Substitution</h4>
<p>mathematicians are lazy. They like to shorten everything they can in an equation. for example \( 3 \over 4 \) is used as a shorthand for \( 3 \div 4 \), and when you see two mathematical objects next to each other without a symbol between them then multiplication is implied.<br>
For example, \( 3(x) \) is really just \( 3 \times x\) and \( 3abc \) is really \( 3 \times ( a \times b \times c ) \).<br>
So for a substitution equation like \( 3a + 2b - c = T\) then what they&apos;re actually asking is \( (3 \times a) + (2 \times b) - c = T\).<br>
The substitution stuff appears to be more or less to improve your ability to use formula&apos;s, which is a large part of advanced mathematics.</p>
<p>Algebra is really just a way to represent complex relationships in mathematics. If you&apos;re having trouble understanding a question below, try to relate it back to something in the real world (a lot of your stuff will be based on geometric shapes. Senior maths generally uses graphs for Algebra).</p>
<p><img src="https://rumblelane.com/content/images/2016/07/chantal_homework-1.jpg" alt="Question 13" loading="lazy"></p>
<p>So with regards to these questions, we&apos;re expressing values in terms of there relationships. So for question a) we can see for the sides representing the otherside of the shape there are two values, \( y \) and <code>8</code>. We can represent there relationship with the \( * \) side with the following:<br>
\[ * = y + 8 \].</p>
<p>For b), we&apos;re doing the same. writing an expression that represents the relationship of these values to one another, and in relation to the perimeter of the object (where the \(perimeter = 2(x) + 2(y)\) or put another way \(P = 2(x+y)\)).</p>
<p>\[ 2((y+2)+6) + 2(y + 8) \]<br>
would give us the full rectangle. However, there&apos;s a bit missing from the object, which we need to subtract from our rectangle in order to accurately represent the object. The bit that&apos;s missing has a perimeter that can be described with the following expression (because it&apos;s a rectangle too):<br>
\[ 2(y + 6) \]<br>
You&apos;ll note that not the whole perimeter of the missing bit is missing, only the bottom half of it. Thus we only need to deduct half of it&apos;s perimeter. Giving the following:</p>
<p>\[ 2((y+2)+6) + 2(y + 8) - (y + 6) \]<br>
\[ 2(y+8) + 2(y + 8) - (y + 6) \]<br>
\[ 2y + 16 + 2y + 16 - y - 6 \]<br>
\[ 4y + 32 - y - 6 \]<br>
\[ 3y + 26 \]</p>
<p>For c), we plug the new value into our final equation from b) so that we have \( 3y + 26 = 44 \) giving us an equation we can solve.<br>
\[ 3y + 26 = 44 \]<br>
\[ 3y = 44 - 26 \]<br>
\[ 3y = 18 \]<br>
\[ 3y \div 3 = 18 \div 3 \]<br>
\[ y = 6 \]</p>
<h4 id="factorizing">Factorizing</h4>
<p>Factorizing is the inverse of expanding in normal algebra. Where normally we&apos;re given an equation like \( 12y(3 - x) \) and asked to expand it, factorising asks the opposite of us.<br>
It gives us \( 36y - 12xy \) and asks us to re-arrange it. In this case, we can see that 36 and 12 are both divisible by a few numbers, 3, 4, 6, and 12. For the greatest simplification we choose the largest number that is a factor of both numbers (it, when multiplied by two other numbers fits into both of the numbers in our equation). so the first step is \( 12(3y - xy) \). But we can see further to this that both items in the parentheses are being multiplied by <code>y</code> so we can remove it too. Thus giving us \( 12y(3 - x) \).</p>
<p>In general, the point of factorising is to re-arrange the equation. We&apos;re not trying to solve it, so we shouldn&apos;t be disappearing numbers (just re-arranging them).</p>
<h5 id="thehardpart">The Hard Part</h5>
<p>It get&apos;s a bit more complex if you&apos;re doing quadratic polynomials. I suspect that&apos;s a bit beyond what&apos;s expected of you, so feel free to skip this section and questions 10 &amp; 11 if you&apos;re pressed for time.<br>
With a quadratic you&apos;re given an equation that will look like the following \( ax^2 + bx + c = 0\) which you&apos;ll hopefully recognize as being the end result of expanding an equation like \( (x + i)(x + j) \).</p>
<p>(often the <code>= 0</code> might be skipped, that&apos;s OK, we&apos;re just showing it&apos;s there so that we know there&apos;s nothing on the otherside of the equation).</p>
<p>Of particular importance in the above equation is the relationship between the numbers <code>b</code> and <code>c</code>.<br>
Specifically, they&apos;re made up of two smaller numbers, we&apos;ll call them <code>i</code> and <code>j</code>. The relationship between <code>b</code> and <code>c</code> and there factors <code>i</code> and <code>j</code> can be expressed as  \( b = i + j \) and \( c = i \times j\).<br>
The hard part is working out what <code>i</code> and <code>j</code> are. I&apos;m not currently aware of any easy formula for working this out. You just have to pick numbers and check that they work.<br>
For example, if we have a quadratic to factorize that looks like \( x^2 + 17x + 72 \) then we have \( b = 17\) and \( c = 72 \). If we cycle threw numbers looking for values for <code>i</code> and <code>j</code> that add up to 17 but multiply out to 72 we should eventually end up with 8 and 9 ( \( 8 \times 9 = 72 \) and \( 8 + 9 = 17 \).<br>
Thus we can factorize out the equation as follows:<br>
\[ x^2 + 17x + 72 \]<br>
\[ x^2 + 17x + 72 = x^2 + x(8 + 9) + 72 \]<br>
\[ x^2 + x(8 + 9) + 8(9) \]<br>
\[ x(x) + 8x + 9x + 8(9) \]<br>
\[ x(x + 9) + 8(x + 9) \]<br>
Note in the above line we&apos;ve ended up with \( (x + 9) \) twice. We can rewrite the equation so that it only shows once by group the two things it&apos;s multiplying against, giving us:<br>
\[ (x + 9)(x + 8) \]<br>
Q.E.D.:<br>
\[ x^2 + 17x + 72 = (x + 8)(x + 9) \]</p>
<p>So to recap:<br>
We&apos;re doing the inverse of what we normally do. Instead of expanding the equation out, we&apos;re contracting it by looking for common base numbers throughout the equation.<br>
It also helps that when you&apos;re multiplying numbers it doesn&apos;t matter which way round they go \( 4 \times 5 \) is the same as \( 5 \times 4 \). This means the order when your factoring the equations doesn&apos;t matter.<br>
What does matter though, is the sign. \( -4 \times 5 \) is not the same as \( 4 \times 5 \).<br>
Also, keep in mind the shorthand we&apos;re using. \( 8(9) \) really just means \( 8 \times 9 \) and \( x(8 + 9) \) really means \( x \times ( 8 + 9 ) \).</p>
<h3 id="formulas">Formulas</h3>
<p>Perimeter of a rectangle:<br>
\[ P = 2x + 2y \]<br>
Area of a Circle:<br>
\[ A = \pi r^2 \]<br>
\[ \pi = 3.14 \]</p>
<h3 id="questions">Questions</h3>
<ol>
<li>
<p>\[ (x + 4)(x - 8) = 0\]</p>
</li>
<li>
<p>\[ 3(x + y) = 0\]</p>
</li>
<li>
<p>\[ (5 - x)^2 = 0\]</p>
</li>
<li>
<p>\[ (x - y)^2 = 0\]</p>
</li>
<li>
<p>Tommy is measuring a $20 bill that he has in his possession. He notes that the top and bottom sides are three times as long as the left and right sides of the bill. Write an equation that expresses this relationship with regards to the perimeter of the $20 bill.<br>
To answer this question You&apos;ll need the perimeter formula, and it might be helpful to draw the object being described.</p>
</li>
<li>
<p>\[ 64 - 4x = 48 - 5x \]</p>
</li>
<li>
<p>\[ 20 - 5x = 48 - 6x \]</p>
</li>
<li>
<p>\[ x^2 - 40 = 24 \]</p>
</li>
<li>
<p>\[ x^2(x + y) = 0\]</p>
</li>
<li>
<p>(HARD) Factorize the following: \[ x^2 - 10x + 25 = 0\]</p>
</li>
<li>
<p>(HARD) Factorize the following: \[ x^2 + 32x + 48 = 0\]</p>
</li>
<li>
<p>Factorize the following: \[ 12x - 12 = 0\]</p>
</li>
<li>
<p>Factorize the following: \[ 36x^2 - 12x = 0\]</p>
</li>
<li>
<p>Factorize the following: \[ 11x^3 + 15x^2 = 0\]</p>
</li>
<li>
<p>Given a circle with a radius of 4cm&apos;s, find the area of the circle (show your working). You can find the radius formula for substitution in the Formula section above.</p>
</li>
</ol>
<h3 id="answers">Answers</h3>
<p>Example Answers: \[ (x+2)(x+1) = 0\]<br>
\[ (x+2)(x+1) = x^2 + x + 2x + 2 \]<br>
\[ ( x + 2x = 3x ) \]<br>
\[ (x+2)(x+1) = x^2 +3x + 2 \]</p>
<p>Answers to the questions begin here:</p>
<ol>
<li></li>
</ol>
<p>\[(x + 4)(x - 10) = 0 \]<br>
\[ x^2 - 8x + 4x - 32\]<br>
\[ (-8x + 4x = -4x) \]<br>
\[ x^2 -4x - 32 = 0\]<br></p>
<ol start="2">
<li></li>
</ol>
<p>\[ 3( x + y ) = 0 \]<br>
\[ 3x + 3y = 0\]<br></p>
<ol start="3">
<li></li>
</ol>
<p>\[ (5 - x)^2 = 0 \]<br>
\[ (5 - x)(5 - x) \]<br>
\[ x^2 - 5x - 5x + 25 \]<br>
\[ (-5x - 5x = -10x) \]<br>
\[ x^2 - 10x + 25 = 0 \]<br></p>
<ol start="4">
<li></li>
</ol>
<p>\[ (x - y)^2 = 0 \]<br>
\[ (x - y)(x - y) \]<br>
\[ x^2 + y^2 - xy - xy \]<br>
\[ ( -xy - xy = -2xy ) \]<br>
\[ x^2 + y^2 - 2xy = 0 \]<br></p>
<ol start="5">
<li></li>
</ol>
<p>The formula for the perimeter of a rectangle is \( perimeter = 2x + 2y \) where \(x\) is the top/bottom and \(y\) is the left/right side. As per the question, we know that \( x = 3(y) \) (because the top/bottom is 3 times as long as left/right side is high). So our equation should look something like the following:<br>
\[ perimeter = 2(y)+2(3y) \]<br>
\[ perimeter = 2y + 6y \]<br>
\[ perimeter = 8y \]<br></p>
<ol start="6">
<li></li>
</ol>
<p>\[ 64 - 4x = 48 - 5x \]<br>
\[ 5x - 4x = 48 - 64 \]<br>
\[ x = -16 \]<br></p>
<ol start="7">
<li></li>
</ol>
<p>\[ 20 - 5x = 48 - 6x \]<br>
\[ 6x - 5x = 48 - 20 \]<br>
\[ x = 28 \]<br></p>
<ol start="8">
<li></li>
</ol>
<p>\[ x^2 - 40 = 24 \]<br>
\[ x^2 = 24 + 40 \]<br>
\[ x^2 = 64 \]<br>
\[ \sqrt x = \sqrt 64 \]<br>
\[ x = 8 \]<br></p>
<ol start="9">
<li></li>
</ol>
<p>\[ x^2(x + y) = 0\]<br>
\[ x^2(x + y) = x^3 + x^2y \]<br>
<br></p>
<ol start="10">
<li></li>
</ol>
<p>\[ x^2 - 10x + 25 = 0\]<br>
\[ x^2 - x(5+5) + 5(5) \]<br>
\[ x^2 - 5x - 5x + 5(5) \]<br>
\[ x^2 - 5(x) - x(5) + 5(5) \]<br>
\[ x(x) -5(x) - x(5) + 5(5) \]<br>
N.b \( 5 \times 5 \) equals the same as \( -5 \times -5 \) (as a double negative is a positive). So we can swap the sign of \( 5(5) \) to match the rest of the equation at this point.<br>
\[ x(x) - 5(x) - x(5) - 5(-5) \]<br>
\[ x(x - 5) - 5(x - 5) \]<br>
\[ (x - 5)(x - 5) \]<br>
\[ (x - 5)^2 = 0\]<br>
<br></p>
<ol start="11">
<li></li>
</ol>
<p>\[ x^2 + 19x + 48 = 0\]<br>
\[ x^2 + x(19) + 48 \]<br>
\[ x^2 + x(3+16) + 3(16) \]<br>
\[ x(x) + 3x + 16x + 3(16) \]<br>
\[ x(x) + 3(x) + x(16) + 3(16) \]<br>
\[ x(x + 16) + 3(x + 16) \]<br>
\[ (x + 3)(x + 16) = 0\]<br>
<br></p>
<ol start="12">
<li></li>
</ol>
<p>\[ 12x - 12 = 0\]<br>
\[ 12x - 12 = 12(x - 1) \]<br>
<br></p>
<ol start="13">
<li></li>
</ol>
<p>\[ 36x^2 - 12x = 0\]<br>
\[ 36x^2 - 12x = 12x(3x - 1) \]<br>
<br></p>
<ol start="14">
<li></li>
</ol>
<p>\[ 11x^3 + 15x^2 = 0\]<br>
\[ 11x^3 + 15x^2 = x^2(11x + 15) \]<br>
Keen in mind that \(11x^3\) just means \(11 \times x \times x \times x \), which is how we can factor it out without issue.<br>
<br></p>
<ol start="15">
<li></li>
</ol>
<p>\[ A = \pi r^2 \]<br>
\[ \pi \times 4^2 \]<br>
\[ 3.14 \times 4^2 \]<br>
\[ 3.14 \times 16 \]<br>
\[ = 50.24cm \]<br>
This is a simple substitution given a formula which you can find under the formula section at the top of the page.<br>
<br></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[My First Week of Game Development]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>This is the first entry in my attempt to create a game from scratch.</p>
<p>Firstly, I feel like justifying myself. I don&apos;t have any illusions of grandeur, no great idea&apos;s for a game &quot;that will change the world!&quot;. I was just curious about the</p>]]></description><link>https://rumblelane.com/game-development-part-1/</link><guid isPermaLink="false">59afcd647e795879923d1fad</guid><category><![CDATA[non-fiction]]></category><category><![CDATA[programming]]></category><category><![CDATA[python]]></category><category><![CDATA[game-dev]]></category><dc:creator><![CDATA[Callum Trayner]]></dc:creator><pubDate>Fri, 03 Jun 2016 20:43:59 GMT</pubDate><media:content url="https://rumblelane.com/content/images/2016/06/header-1.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://rumblelane.com/content/images/2016/06/header-1.png" alt="My First Week of Game Development"><p>This is the first entry in my attempt to create a game from scratch.</p>
<p>Firstly, I feel like justifying myself. I don&apos;t have any illusions of grandeur, no great idea&apos;s for a game &quot;that will change the world!&quot;. I was just curious about the challenges and problem solving that goes into the creation of games.</p>
<p>It started out innocently enough, &quot;I wonder what a simple client/server game protocol would look like.&quot; Being that most of my programming experience has been in python I figured it was a good enough place to start. I realise that a lot of people consider python to be pretty slow for these sorts of things, and well, it probably is. But I don&apos;t need it to be fast. I just need a functional prototype, and python with it&apos;s sockets, select calls, and structs seemed comparable to the more commonly used C-family of languages.</p>
<h2 id="theserver">The Server</h2>
<p>Needing a starting point I did some googling to see what people recommended, and the following is what I&apos;ve ended up with. On the server side, I have a multi-threaded socket servers that spawns a new thread for each socket connection. I was originally using <code>system.fork()</code> instead of threading but I had trouble sharing resources between the separate processes.</p>
<p>This server is connected to using a socket on the client side which sends packed structs over TCP. The server then interprets these structs and sends back a similar packet containing the information requested (or in possible future cases, simply an acknowledgement).</p>
<h4 id="theprotocol">The Protocol</h4>
<p>The layout of the structs is currently three unsigned ints followed by the payload.The first unsigned int is the length of the packet (the number of bytes in the message), this number includes the length of the length. This was a late addition to the protocol that I found I needed in order to distinguish between separate messages (as they would sometimes all come in at the same time).</p>
<p>The second unsigned int is the protocol version number (which is currently 256).<br>
I chose 256 because in hex 256 this is represented as <code>0x100</code>. This structure allows me up to 255 minor versions. Specifically, I can use the first value as a major version, the second as a minor version, and the third as a minor-minor version number (allowing each a value between 0 and 15 inclusive). In most common programs a major version increase indicates changes that aren&apos;t backwards compatible, a minor version increase indicates new features that are backwards compatible, and a minor-minor version increase would be a bug fix or some other non-breaking change.</p>
<p>The third unsigned is just an identifier so we know what the packet is regarding and how we should interpret any commands given. In some cases, this value is enough to know what they&apos;re asking. For example, a <code>2</code> identifier indicates they&apos;re asking to know what player they are without us having to look up a command.</p>
<h2 id="theworld">The World</h2>
<p>With that issue solved, I needed to actually create a world that I could have two separate clients move around in, allowing me to test the protocol.<br>
This world has ended up being a simple 2 dimensional array, creating a kind of matrix. An example usage would be <code>matrix[x][y] = Grass()</code>. However that&apos;s not quite how things ended up. Because I wanted to have sensible access to the matrix in the form of:</p>
<pre><code class="language-python">for line in matrix:
    for tile in line:
        print(tile)
</code></pre>
<p>what I&apos;ve actually ended up with is backwards co-ordinates <code>matrix[y][x] = Grass()</code>. Which while not ideal, is still functional so long as I&apos;m consistent.</p>
<p>I quickly decided that an empty grid wasn&apos;t much fun, so had to find a way to make it more interesting. With that in mind, I turned the grid into a sort of maze with the following.</p>
<p>When we first generate the world we fill it with Walls. Afterwards, we generate a number of rooms into the matrix, and then we fill in the rest with a maze. We then clean up any dead ends in the maze. Ideally what I&apos;d like to do is connect each room together instead of building a maze, but the algorithms for doing so were a bit hard to get my head around.</p>
<h5 id="rooms">Rooms</h5>
<p>The rooms were mostly what  it sounds like, I would randomly choose a width and height from within a given set, by supplying a minimum and maximum value, and then randomly selecting a number from between the two. Then we&apos;d randomly select a point on the map and check that each tile within the square steaming from that point was a wall. If any tile was already empty it meant our new room was going to overlap with an existing room, so we&apos;d stop and try again. Otherwise we&apos;d replace each of the tiles within that square with an empty tile.</p>
<h5 id="themaze">The Maze</h5>
<p>The Maze generation was a bit more complicated. I mostly ended up stealing an algorithm for this from else where in the web. For it, we started by selecting a point on the map and then moving in a direction from there. Each time we moved, we check each of the four surrounding tiles from our selected tile, from these we using a weighted number, choose a direction to go in (somewhat favouring the previously used direction so that it doesn&apos;t devolve into a windy mess) and then we replace that grid position and the next 2 with an empty tile. I haven&apos;t done a very good job of explaining this because I&apos;m still a bit vague on how it works exactly.</p>
<p>In any case, after we&apos;ve done that we go through and remove all the paths that lead to a dead end, which makes the maze a bit neater and less random.</p>
<p>The end result is this:<br>
<img src="https://rumblelane.com/content/images/2016/06/Screenshot-from-2016-06-03-21-50-16--copy-.png" alt="My First Week of Game Development" loading="lazy"></p>
<h2 id="theclient">The Client</h2>
<p>To get all of this actually playing nicely I had to create a client that could connect to our server. I briefly discussed it earlier. The client is made up of three threads, a networking thread, a draw thread, and an input thread.<br>
The networking thread pulls commands from a network queue and sends them over a socket to the server. It also reads responses from the server and uses them to update the world, after which it tells the draw thread to redraw the world.<br>
The draw thread draws the world to the terminal using simple ASCII characters. Currently it uses a &apos;clear&apos; command to clear the screen before the redraw.<br>
The Input thread handles character input. Because I&apos;m doing all of this in the terminal I&apos;m beholden to the rules of the terminal, with the main one being that by default the input is read on a per line basis. Meaning any key press has to be followed by a new line (the enter button by default) before the game will pick it up. I can hack around this by setting the terminal to raw mode, but this breaks the formatting of my draw calls, which I&apos;m too lazy to look into and fix.<br>
So while the input situation isn&apos;t ideal, it&apos;s at least functional.</p>
<p>The resulting code can be found <a href="https://github.com/Doldge/MyFirstGame/tree/week1?ref=rumblelane.com">Here</a>.</p>
<p>Next week, I&apos;ll have a go at real OpenGL rendering and maybe port the whole thing over to c++, which will be fun as I have no experience at all with c++ (and only minor experience with C)</p>
<p>When I started this I had no idea what I was going to end up with, or how far I&apos;d even get. But after creating a world, a network protocol, and a client/server application, I think I&apos;ll keep going. Not sure what the end product will be, be at the moment I&apos;m leaning towards either something Dungeon Keeper-y, or something like the original Pokemon games.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Time Waits..]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>On December 31st, 2016 the day will be a full second longer than a normal day, instead of there being 86400 seconds in the day, there will be 86401 seconds. That&apos;s weird right? time is supposed to be this consistent thing. There are always 60 seconds in a</p>]]></description><link>https://rumblelane.com/time-waits/</link><guid isPermaLink="false">59afcd647e795879923d1fa1</guid><category><![CDATA[non-fiction]]></category><category><![CDATA[programming]]></category><dc:creator><![CDATA[Callum Trayner]]></dc:creator><pubDate>Wed, 24 Jun 2015 10:39:59 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>On December 31st, 2016 the day will be a full second longer than a normal day, instead of there being 86400 seconds in the day, there will be 86401 seconds. That&apos;s weird right? time is supposed to be this consistent thing. There are always 60 seconds in a minute, always 60 minutes in an hour, and always 24 hours a day. so their <em>should</em> always be 86,400<sup id="fnref:1"><a href="#fn:1" rel="footnote" class="mathjaxme">1</a></sup> seconds in a day.</p>
<p>So if that&apos;s the case, then why does the 31st of December, 2016 have an extra second?<br>
The answer has to do with the rotation of our favourite celestial body around the sun. But before we get to that, I&apos;ll fill you in on some of the background.</p>
<h3 id="howlongisasecond">How long is a second?</h3>
<p>It&apos;s an odd question, a bit like asking &quot;how long is a piece of string?&quot;</p>
<p>The answer lies in how we measure seconds. In 1900 a second was defined in terms of the period of the Earth&apos;s orbit around the sun, we had agreed on the number of days in a year, and knew that we wanted 24 hours in a day, 60 minutes in an hour, and 60 seconds in a minute. So in 1900 we defined the second as being \(1 \over 31,556,925.9747\) of the year<sup id="fnref:2"><a href="#fn:2" rel="footnote" class="mathjaxme">2</a></sup>. Since then we&apos;ve developed the <strong>International System of Units (SI)</strong>, which is an attempt to define various measurements using universal constants (that way they&apos;re not dependent on an object or a location, so we can record time even when we&apos;re not on the earth). The SI currently defines a second as:</p>
<blockquote>
<p>The second is the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium 133 atom.</p>
</blockquote>
<p>What this means is that the second is considered to be about 9 billion vibrations from a cesium 133 atom. The &quot;ground state&quot; part means that the atom needs to be at rest (for earth, that means sea level), and 0 degrees kelvin. It&apos;s a very large, weird number because we&apos;ve worked backwards to get it. We knew how long we wanted a second to be, we just needed to find some way to express it that didn&apos;t require anything specific to our environment.</p>
<h3 id="wheredoextrasecondscomefrom">Where do extra seconds come from?</h3>
<p>Now the reason we have an extra second is because scientists use something called an Atomic Clock, to measure time. An atomic clock uses the <strong>SI</strong> definition of a second to measure time, which gives them an extremely accurate measurement. However, the downside is that the accuracy of the atomic clock no longer matches the original definition of a second, the one based on the earth&apos;s rotation of the sun.</p>
<p>&quot;why don&apos;t they just adjust the definition of a second then? just knock off a few thousand vibrations!&quot; I hear you say. The issue isn&apos;t the length of the second, so much as it is the speed at which the earth rotates the sun. As it happens, the earth doesn&apos;t rotate the sun at a consistent speed, and lately it&apos;s been slowing down by about 1 seconds every few years. The result is that in order to keep our atomic clocks from getting out of sync with earth time, we have to occasionally add a second on to the end of the day.</p>
<p>Generally, the seconds are added either at the end of June, or at the end of December, but this isn&apos;t a hard rule. The International Earth Rotation and Reference Systems Service (IERS) group usually announce coming leap seconds giving around 6 months notice for the impending adjustment.</p>
<h3 id="coolbutwhydoicare">Cool, but why do I care?</h3>
<p>That&apos;s all a bit interesting, but the final question you&apos;re probably wondering about is &quot;Why does this matter?&quot;<br>
The answer to which is that lots of computer systems make assumptions about the behaviour of time. Assumptions that are often wrong when it comes to the inclusion of leap seconds.</p>
<p>The problems arise from how the extra second is handled, with different systems applying different solutions to how they add the extra second, all of which having potential downsides.</p>
<p>For example, some systems repeat the last second of the day so that 23:59:59 occurs twice, however this can causes issues with databases (where time is recorded to the millisecond and expected to be unique, if the same second occurs twice a timestamp collision could occur), it&apos;s also possible for this solution to create vulnerabilities in security systems that rely on random numbers (as random is often seeded from the current time, duplicating the time weakens the security).</p>
<p>Other systems like Google, make tiny adjustments throughout the day so that the time at the end of the day is correct, this avoids issues caused by collisions (which is highly likely to occur at Googles scale), but the downside of this approach is that the time is off by an increasing amount throughout the day, which can cause issues when interacting with systems that don&apos;t adjust the time in this manner.</p>
<p>The final and recommended approach to handling the extra second is to just add an extra second after 23:59:59 so that the next tick is 23:59:60, instead of 00:00:00. This avoids issues with timestamp collisions and any issues that might occur from having the time just be wrong for the entire day. The problem with this solution is that next to no software makes allowances for a 61st second (because it&apos;s so rare), and as a result much of it either crashes or encounters undefined behaviour (which just means nobody know&apos;s what it&apos;s going to do).</p>
<p>This probably all sounds like posturing, but in 2012 the addition of a leap second caused both Qantas&apos; and Reddit to crash.</p>
<h4 id="notes">Notes:</h4>
<div class="footnotes">
<hr class="footnote">
<ol class="footnote">
<li id="fn:1" class="footnote ">
<p>\(60 \times 60 \times 24 = 86,400\) <a href="#fnref:1" title="return to article" class="reversefootnote">&#xA0;</a></p>
</li>
<li id="fn:2" class="footnote ">
<p>\(year = 365.242 \times 86,400 \) <a href="#fnref:2" title="return to article" class="reversefootnote">&#xA0;</a></p>
</li>
</ol>
</div><!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>