Jekyll2022-06-24T21:32:47+00:00http://aaronrobson.uk/feed.xmlAaron Robson’s websiteA website to teach me web development, a place for blogging and to host my CV.Bridge builder poem as allegory for code care2018-12-14T00:00:00+00:002018-12-14T00:00:00+00:00http://aaronrobson.uk/2018/12/14/bridge-builder-poem-as-allegory-for-code-care<p>Recently, I have found myself thoroughly enjoying reading the
<a href="https://www.artofmanliness.com/">Art of Manliness blog</a>
it features articles about butch skills,
how-to about hand tools and
a touch of philosophy
about what it means to lead a life well lived.
An article that particularly stood out for me was
<a href="https://www.artofmanliness.com/articles/manvotional-the-bridge-builder/">Manvotional: The Bridge Builder</a>
which talks about
“The Bridge Builder”
written by Will Allen Dromgoole.
I urge you to give it a read, catch you after.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>An old man going a lone highway,
Came, at the evening cold and gray,
To a chasm vast and deep and wide.
Through which was flowing a sullen tide
The old man crossed in the twilight dim,
The sullen stream had no fear for him;
But he turned when safe on the other side
And built a bridge to span the tide.
"Old man," said a fellow pilgrim near,
"You are wasting your strength with building here;
Your journey will end with the ending day,
You never again will pass this way;
You’ve crossed the chasm, deep and wide,
Why build this bridge at evening tide?"
The builder lifted his old gray head;
"Good friend, in the path I have come," he said,
"There followed after me to-day
A youth whose feet must pass this way.
This chasm that has been as naught to me
To that fair-haired youth may a pitfall be;
He, too, must cross in the twilight dim;
Good friend, I am building this bridge for him!"
</code></pre></div></div>
<p>(<a href="https://www.poetryfoundation.org/poems/52702/the-bridge-builder">source</a>)</p>
<p>In summary the poem talks of an experienced though weary traveller resolutely
choosing to help other less experienced travellers cross a turbulent river.
The river is of no danger to him but could be a disaster for others.</p>
<p>Software development is not normally as dangerous as a turbulent river but it
has some similarities.
The first steps of contributing to an established project can be a
frustrating experience,
it can appear like nothing seems to work.
This can block new people from helping out with your projects unless
steps like these are taken with the project:</p>
<ul>
<li>A simple readme that describes the purpose of the project.</li>
<li>Ensure that the code builds straight out of source control without
undue faffing.</li>
<li>Include unit tests to that show how the code should be used,
proves it really does work and double checks that the development enviroment
is set up correctly.</li>
</ul>
<p>We can change this together,
focus on making it a pleasure for others to begin helping you on your
software projects.
Raise issues,
make pull requests,
write documentation or
whatever ritual is required
to sort out just one annoyance today.</p>
<p>Remember, the mind you save may be your own.
You could be in the same situation when you need to work on
one of your old projects.</p>
<p>Go on, get out there and build some bridges,
Aaron.</p>Recently, I have found myself thoroughly enjoying reading the Art of Manliness blog it features articles about butch skills, how-to about hand tools and a touch of philosophy about what it means to lead a life well lived. An article that particularly stood out for me was Manvotional: The Bridge Builder which talks about “The Bridge Builder” written by Will Allen Dromgoole. I urge you to give it a read, catch you after.Selenium Python and Pretend Firefox2018-07-27T20:12:35+00:002018-07-27T20:12:35+00:00http://aaronrobson.uk/2018/07/27/selenium-python-and-pretend-firefox<p>I wanted to play around with Selenium to learn how QA folks run tests against websites.</p>
<p>First things first I found some example code <a href="http://selenium-python.readthedocs.io/getting-started.html">here</a>:</p>
<figure class="highlight"><pre><code class="language-python" data-lang="python"><span class="kn">from</span> <span class="nn">selenium</span> <span class="kn">import</span> <span class="n">webdriver</span>
<span class="kn">from</span> <span class="nn">selenium.webdriver.common.keys</span> <span class="kn">import</span> <span class="n">Keys</span>
<span class="n">driver</span> <span class="o">=</span> <span class="n">webdriver</span><span class="p">.</span><span class="n">Firefox</span><span class="p">()</span>
<span class="n">driver</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s">"http://www.python.org"</span><span class="p">)</span>
<span class="k">assert</span> <span class="s">"Python"</span> <span class="ow">in</span> <span class="n">driver</span><span class="p">.</span><span class="n">title</span>
<span class="n">elem</span> <span class="o">=</span> <span class="n">driver</span><span class="p">.</span><span class="n">find_element_by_name</span><span class="p">(</span><span class="s">"q"</span><span class="p">)</span>
<span class="n">elem</span><span class="p">.</span><span class="n">clear</span><span class="p">()</span>
<span class="n">elem</span><span class="p">.</span><span class="n">send_keys</span><span class="p">(</span><span class="s">"pycon"</span><span class="p">)</span>
<span class="n">elem</span><span class="p">.</span><span class="n">send_keys</span><span class="p">(</span><span class="n">Keys</span><span class="p">.</span><span class="n">RETURN</span><span class="p">)</span>
<span class="k">assert</span> <span class="s">"No results found."</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">driver</span><span class="p">.</span><span class="n">page_source</span>
<span class="n">driver</span><span class="p">.</span><span class="n">close</span><span class="p">()</span></code></pre></figure>
<p>Installed Selenium on Python 3 installation on laptop.</p>
<p><code class="language-plaintext highlighter-rouge">pip install selenium</code>
Had to use <code class="language-plaintext highlighter-rouge">pip3</code> as <code class="language-plaintext highlighter-rouge">python2</code> the default.</p>
<p>Ran code it needed a browser driver for Firefox called <code class="language-plaintext highlighter-rouge">geckodriver</code> downloaded it and placed it in <code class="language-plaintext highlighter-rouge">/bin/</code> so that it would be available.
It failed due to not enough capabilities.</p>
<p>Tried successfully on Win7 PC.</p>
<p>Figured the problem on Trisquel Linux laptop was a pretend Firefox called Icecat (though Iceweasel and aBrowser may have the same issue.
<a href="https://webrtc.org/">WebRTC</a> support seemed like the missing part.
After I installed the real Firefox everything is fine.</p>
<p>Modified example code to open
<a href="http://www.aaronrobson.uk/">this website</a>
click the CV button and start looking at the elements that represent the links to the CV pdf.</p>
<p>Like this:</p>
<figure class="highlight"><pre><code class="language-python" data-lang="python"><span class="kn">from</span> <span class="nn">selenium</span> <span class="kn">import</span> <span class="n">webdriver</span>
<span class="kn">from</span> <span class="nn">selenium.webdriver.common.keys</span> <span class="kn">import</span> <span class="n">Keys</span>
<span class="n">driver</span> <span class="o">=</span> <span class="n">webdriver</span><span class="p">.</span><span class="n">Firefox</span><span class="p">()</span>
<span class="n">driver</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s">"http://aaronrobson.uk"</span><span class="p">)</span>
<span class="n">cvlink</span> <span class="o">=</span> <span class="n">driver</span><span class="p">.</span><span class="n">find_element_by_link_text</span><span class="p">(</span><span class="s">'CV'</span><span class="p">)</span>
<span class="n">cvlink</span><span class="p">.</span><span class="n">click</span><span class="p">()</span>
<span class="n">cvlinks</span> <span class="o">=</span> <span class="n">driver</span><span class="p">.</span><span class="n">find_element_by_id</span><span class="p">(</span><span class="s">"cvlinks"</span><span class="p">)</span>
<span class="n">driver</span><span class="p">.</span><span class="n">close</span><span class="p">()</span></code></pre></figure>
<p>Initial of how to call a selenium build from changing GitHub io builds and how to run headless in a way that Travis can do.</p>I wanted to play around with Selenium to learn how QA folks run tests against websites.Welcome to Jekyll!2018-07-21T12:04:36+00:002018-07-21T12:04:36+00:00http://aaronrobson.uk/2018/07/21/welcome-to-jekyll<p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run <code class="language-plaintext highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>
<p>To add new posts, simply add a file in the <code class="language-plaintext highlighter-rouge">_posts</code> directory that follows the convention <code class="language-plaintext highlighter-rouge">YYYY-MM-DD-name-of-post.ext</code> and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.</p>
<p>Jekyll also offers powerful support for code snippets:</p>
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
<span class="c1">#=> prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>
<p>Check out the <a href="https://jekyllrb.com/docs/home">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://talk.jekyllrb.com/">Jekyll Talk</a>.</p>You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.