<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Marc Sleegers</title><link href="https://marcsleegers.com/" rel="alternate"/><link href="https://marcsleegers.com/atom.xml" rel="self"/><id>https://marcsleegers.com/</id><updated>2016-02-25T20:30:00+01:00</updated><entry><title>Managing Azure Machine Learning endpoints</title><link href="https://marcsleegers.com/writing/2016/02/managing-azure-machine-learning-endpoints/" rel="alternate"/><published>2016-02-25T20:30:00+01:00</published><updated>2016-02-25T20:30:00+01:00</updated><author><name/></author><id>tag:marcsleegers.com,2016-02-25:/writing/2016/02/managing-azure-machine-learning-endpoints/</id><summary type="html">&lt;p&gt;Recently, I&amp;#8217;ve been working with Azure Machine Learning a lot. It&amp;#8217;s fantastic! When the interface works. Unfortunately, It doesn&amp;#8217;t always. So, I created a &lt;a href="https://pypi.python.org/pypi/PyZureML"&gt;Python package&lt;/a&gt; so I could start managing Azure Machine Learning endpoints&amp;nbsp;programmatically.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Recently, I&amp;#8217;ve been working with Azure Machine Learning a lot. It&amp;#8217;s fantastic! When the interface works. Unfortunately, It doesn&amp;#8217;t always.
So, I created a &lt;a href="https://pypi.python.org/pypi/PyZureML"&gt;Python package&lt;/a&gt; so I could start managing Azure Machine Learning endpoints&amp;nbsp;programmatically.&lt;/p&gt;
&lt;p&gt;One of Azure&amp;#8217;s features I was - am - most excited about is the ability to easily deploy a trained machine learning model as a webservice. 
This works great, until you programmatically want to &lt;a href=""&gt;retrain a model&lt;/a&gt; with new data. You see, in order to retrain a trained model through a webservice you need to create and update a new endpoint. 
Unfortunately, managing endpoints through the &lt;a href="https://portal.azure.com/"&gt;user interface&lt;/a&gt; is totally impossible at the moment. Additionally, the &lt;span class="caps"&gt;API&lt;/span&gt; documentation is nothing to write home&amp;nbsp;about.&lt;/p&gt;
&lt;p&gt;This is where the good news starts. Azure automatically generates some &lt;span class="caps"&gt;API&lt;/span&gt; documentation specific to every webservice and every endpoint you create through the machine learning portal.
The best part about this is that Azure supplies a basic &lt;a href="https://swagger.io"&gt;Swagger&lt;/a&gt; &lt;span class="caps"&gt;JSON&lt;/span&gt; file as part of this documentation. This file basically describes most of the generated endpoint &lt;span class="caps"&gt;API&lt;/span&gt; and removes most of the guesswork.
After some scripting I figured out all the calls you need to create, delete, get and update a webservice&amp;#8217;s endpoints without ever needing the web user&amp;nbsp;interface.&lt;/p&gt;
&lt;p&gt;The reactions I got at work and on the Microsoft forums were great. Apparently, there were quite a few people waiting on Microsoft to fix the interface bugs.
I bundled my solution as a Python package, gave it a &lt;em&gt;super clever&lt;/em&gt; name and made it &lt;a href="https://pypi.python.org/pypi/PyZureML"&gt;available for download&lt;/a&gt; on PyPI. (Which was a whole new experience by itself, but that&amp;#8217;s a story for another time!)
To install it via pip, just&amp;nbsp;type:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;table class="codehilitetable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt;1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install PyZureML
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you&amp;#8217;re not into that kind of thing, you could also clone the source directly through&amp;nbsp;git:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;table class="codehilitetable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt;1&lt;/span&gt;
&lt;span class="normal"&gt;2&lt;/span&gt;
&lt;span class="normal"&gt;3&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;git clone git://github.com/marcardioid/PyZureML.git
cd ./PyZureML
python setup.py install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you decide to do it this way, it&amp;#8217;s also super easy to &lt;a href="https://github.com/marcardioid/PyZureML"&gt;contribute&lt;/a&gt; to the source code. (Hint hint!)
To use PyZureML - I admit I thought about using AzurePyML as a name - you need Python 3.x and the Requests module.
When you have both installed, using PyZureML is super easy. For example, this is how you create and delete an&amp;nbsp;endpoint.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;table class="codehilitetable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt;1&lt;/span&gt;
&lt;span class="normal"&gt;2&lt;/span&gt;
&lt;span class="normal"&gt;3&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;PyZureML&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;endpoints&lt;/span&gt;
&lt;span class="n"&gt;endpoints&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create_endpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;workspace_id&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;api_token&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;webservice_id&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;endpoint_name&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;endpoints&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;delete_endpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;workspace_id&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;api_token&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;webservice_id&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;endpoint_name&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That&amp;#8217;s all for now! I hope you have as much fun teaching computers to do stuff as I&amp;#8217;m&amp;nbsp;having.&lt;/p&gt;</content><category term="Uncategorized"/></entry><entry><title>Taking the ‘Daily’ out of ‘Daily Programmer’</title><link href="https://marcsleegers.com/writing/2016/01/taking-the-daily-out-of-daily-programmer/" rel="alternate"/><published>2016-01-30T20:00:00+01:00</published><updated>2016-01-30T20:00:00+01:00</updated><author><name/></author><id>tag:marcsleegers.com,2016-01-30:/writing/2016/01/taking-the-daily-out-of-daily-programmer/</id><summary type="html">&lt;p&gt;The past year, I&amp;#8217;ve been actively participating in reddit&amp;#8217;s &lt;a href="https://www.reddit.com/r/dailyprogrammer"&gt;r/dailyprogrammer&lt;/a&gt; subreddit. According to GitHub, I made 155 contributions. It is now time to reflect on what I&amp;#8217;ve learned, take a small step back and take the &amp;#8216;Daily&amp;#8217; out of &amp;#8216;Daily&amp;nbsp;Programmer&amp;#8217;.&lt;/p&gt;</summary><content type="html">&lt;p&gt;The past year, I’ve been actively participating in reddit’s &lt;a href="https://www.reddit.com/r/dailyprogrammer"&gt;r/dailyprogrammer&lt;/a&gt; subreddit. According to GitHub, I made 155 contributions.
It is now time to reflect on what I’ve learned, take a small step back and take the ‘Daily’ out of ‘Daily Programmer’.&lt;/p&gt;
&lt;p&gt;Being a part of the r/dailyprogrammer community has been a blast. I submitted some pretty sweet solutions, inspired others to step up their programming game and learned A &lt;span class="caps"&gt;LOT&lt;/span&gt;.
I started submitting solutions to challenges, because I though it was a great - and fun - way to keep my problem solving brain ticking. I also wanted to step up my Python game and learn some algorithms by heart.
Browsing through my commits, I can absolutely confirm what they say about training and flexing your programming muscles. If only it gave me abs, as well.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span class="dquo"&gt;“&lt;/span&gt;You know you have really made progress as a software engineer when you look back at your code from a year ago, sigh, and think: How could I have written this &lt;span class="caps"&gt;MESS&lt;/span&gt;?!” &lt;cite&gt;They&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is in part because of the community. I skipped a day here and there, but some of the active contributors really take the ‘Daily’ part of the subreddit’s name super serious. And it shows. 
They have amazed me with shiny one-liners and extremely efficient solutions. Oh, and there’s always a group of people submitting their solution in some ancient or weird language. 
Not to show off, but to showcase different coding paradigms. Okay, maybe to show off a &lt;em&gt;little&lt;/em&gt; bit.&lt;/p&gt;
&lt;p&gt;Take a look at this esoteric brainfuck solution to &lt;a href="https://www.reddit.com/r/dailyprogrammer/comments/341c03/20150427_challenge_212_easy_r%C3%B6varspr%C3%A5ket/"&gt;challenge 212 (easy)&lt;/a&gt;, for example.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;table class="codehilitetable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt;1&lt;/span&gt;
&lt;span class="normal"&gt;2&lt;/span&gt;
&lt;span class="normal"&gt;3&lt;/span&gt;
&lt;span class="normal"&gt;4&lt;/span&gt;
&lt;span class="normal"&gt;5&lt;/span&gt;
&lt;span class="normal"&gt;6&lt;/span&gt;
&lt;span class="normal"&gt;7&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;
&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+---&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;+++&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;---&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nb"&gt;+++&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;++++++++++&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+++++++++++&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;---&lt;/span&gt;
&lt;span class="nb"&gt;-------&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;++++++++++&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+++++&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;-------------&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;
&lt;span class="nv"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;[[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;++++---&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;+++&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;---&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nb"&gt;+++&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;----&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;++++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;----&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;++++---&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;
&lt;span class="nb"&gt;+++&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;---&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nb"&gt;+++&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;++++&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;++++++++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;----&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;++++&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;----&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;]]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;]]&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;+&lt;/span&gt;&lt;span class="nv"&gt;&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;
&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;---&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;+++&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;---&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nb"&gt;+++&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;.&lt;/span&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;-&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;----------&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;&lt;span class="nb"&gt;++++++++++&lt;/span&gt;&lt;span class="nt"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;If this is gibberish to you too, consider looking at my more human-readable solution in Python.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;table class="codehilitetable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt;1&lt;/span&gt;
&lt;span class="normal"&gt;2&lt;/span&gt;
&lt;span class="normal"&gt;3&lt;/span&gt;
&lt;span class="normal"&gt;4&lt;/span&gt;
&lt;span class="normal"&gt;5&lt;/span&gt;
&lt;span class="normal"&gt;6&lt;/span&gt;
&lt;span class="normal"&gt;7&lt;/span&gt;
&lt;span class="normal"&gt;8&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sentence&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;sentence_encoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sentence&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="s2"&gt;"aeiouåäö"&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isalnum&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="n"&gt;sentence_encoded&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;sentence_encoded&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;'o'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;sentence_encoded&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;The challenge was simple: encode to and decode from the &lt;span class="caps"&gt;SUPER&lt;/span&gt;-&lt;span class="caps"&gt;SECRET&lt;/span&gt; &lt;em&gt;Rövarspråket&lt;/em&gt;. This Swedish phrase roughly translates to &lt;em&gt;Robber’s Language&lt;/em&gt;.
In this spy language the sentence ‘Jag talar Rövarspråket!’ translates to ‘Jojagog totalolaror Rorövovarorsospoproråkoketot!’, for example.
Military grade encryption, as you can see.&lt;/p&gt;
&lt;p&gt;Another challenge I really loved working on was &lt;a href="https://www.reddit.com/r/dailyprogrammer/comments/23yinj/4252014_challenge_159_hard_rock_paper_scissors/"&gt;challenge 159 (hard)&lt;/a&gt;. The goal was to build an artificial intelligence for the game &lt;em&gt;Rock Paper Scissors Lizard Spock&lt;/em&gt;.
If you don’t know that game, it’s basically a spiced up version of the universally played &lt;em&gt;Rock Paper Scissors&lt;/em&gt;.
It even has similar rules: Scissors cuts Paper, Paper Covers Rock, Rock crushes Lizard, Lizard poisons Spock, Spock smashes Scissors, Scissors decapitates Lizard, Lizard eats Paper, Paper disproves Spock, Spock vaporizes Rock and - as it always has - Rock crushes Scissors.
Alternatively, a useful flowchart:&lt;/p&gt;
&lt;p&gt;&lt;img alt="The rules to Rock Paper Scissors Lizard Spock" class="img-size-medium" fetchpriority="high" loading="eager" src="https://marcsleegers.com/writing/2016/01/taking-the-daily-out-of-daily-programmer/images/RPSLS-flowchart.png"/&gt;&lt;/p&gt;
&lt;p&gt;I went all-in with my solution: I built an interactive game in JavaScript with multiple &lt;span class="caps"&gt;AI&lt;/span&gt;-difficulties to choose from.
You can &lt;a href="https://marcsleegers.com/rpsls/"&gt;play it&lt;/a&gt; on my website or check out &lt;a href="https://github.com/marcardioid/DailyProgrammer/tree/master/solutions/159_Hard"&gt;the source code&lt;/a&gt; on my GitHub.&lt;/p&gt;
&lt;p&gt;I honestly applaud the enthusiasm of the subreddit moderators. They put a lot of work in creating and posting new daily challenges.
So far, for example, I’ve &lt;a href="https://github.com/marcardioid/DailyProgrammer/tree/master/solutions/231_Hard"&gt;married off bachelors to eight sisters&lt;/a&gt;, &lt;a href="https://github.com/marcardioid/DailyProgrammer/tree/master/solutions/233_Easy"&gt;built houses in &lt;span class="caps"&gt;ASCII&lt;/span&gt;&lt;/a&gt; and &lt;a href="https://www.reddit.com/r/dailyprogrammer/comments/3x3hqa/20151216_challenge_245_intermediate_ggggggg_gggg/"&gt;communicated with aliens&lt;/a&gt;.
If you want to and have some great ideas for submissions, you are free to help the moderators out and &lt;a href="https://www.reddit.com/r/dailyprogrammer_ideas"&gt;post a challenge idea&lt;/a&gt;. 
I know I will.&lt;/p&gt;
&lt;p&gt;As is hopefully clear by now, I’m still very excited about the r/dailyprogrammer community and being a part of it. Unfortunately, I cannot be as active a member as I used to be.
My internship, my freelance work and my (larger) personal projects are taking up a lot of time at the moment. So for now, it is time to take a small step back and take the ‘Daily’ out of ‘Daily Programmer’.&lt;/p&gt;</content><category term="Uncategorized"/></entry><entry><title>Hello, world! (Again.)</title><link href="https://marcsleegers.com/writing/2016/01/hello-world-again/" rel="alternate"/><published>2016-01-23T19:30:00+01:00</published><updated>2016-01-23T19:30:00+01:00</updated><author><name/></author><id>tag:marcsleegers.com,2016-01-23:/writing/2016/01/hello-world-again/</id><summary type="html">&lt;p&gt;I&amp;#8217;m not doing the whole introductory post thingy. Not because I think you won&amp;#8217;t like me, but because life - like the software industry - is so lively. What that even means? Let me tell&amp;nbsp;you.&lt;/p&gt;</summary><content type="html">&lt;p&gt;I&amp;#8217;m not doing the whole introductory post thingy. Not because I think you won&amp;#8217;t like me, but because life - like the software industry - is so &lt;em&gt;lively&lt;/em&gt;.
What that even means? Let me tell&amp;nbsp;you.&lt;/p&gt;
&lt;p&gt;Everything around us is constantly evolving. In tech, there&amp;#8217;s always a new language or a better way to do x just around the corner. In life, I could live in an entirely different place this time next year.
I&amp;#8217;ve been reading a lot about the internet as an eternal archive lately and the outdated information you can find about certain people is &lt;em&gt;staggering&lt;/em&gt;. Because of this, I decided against the introductory blog post&amp;nbsp;trope.&lt;/p&gt;
&lt;p&gt;Instead, I&amp;#8217;d rather display my progression and my personality through my blog posts. Of course, the technologies I write about this year might not be relevant at all in a few winters. That doesn&amp;#8217;t matter as much, though, because that content might still be useful to someone.
Unless it&amp;#8217;s content about a problem I can&amp;#8217;t solve and you stumble upon it via Google hoping to find a solution. Don&amp;#8217;t you hate it when you find some post from 2004 describing the exact same problem you&amp;#8217;re having right now and there&amp;#8217;s &lt;span class="caps"&gt;NO&lt;/span&gt; comments?
It&amp;#8217;s even worse when the post has been marked as solved by the poster. &lt;em&gt;What did you see, John?! &lt;span class="caps"&gt;SHOW&lt;/span&gt; &lt;span class="caps"&gt;ME&lt;/span&gt; &lt;span class="caps"&gt;THE&lt;/span&gt; &lt;span class="caps"&gt;LIGHT&lt;/span&gt;!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I digress. You still need to know who I am. No worries, I have a great solution for that! Remember the first page you saw when you went to this website? (Unless you&amp;#8217;re a Googler. Hi!) I&amp;#8217;m going to be using that as a living document.
This is going to be great for visitors - who will always get to know about me the way I am right then and there - and for me, because I don&amp;#8217;t have to worry about outdated personal information in a blog&amp;nbsp;post.&lt;/p&gt;
&lt;p&gt;Now that we&amp;#8217;ve been properly introduced - in a way - it&amp;#8217;s time for me to tell you about this blog. Before I started studying Computer Science, I graduated as a journalist as I&amp;#8217;ve always loved language.
Unfortunately, I&amp;#8217;m not writing nearly enough to keep a proper style going. I also have some - hopefully - great ideas. So, after much consideration, I&amp;#8217;ve finally decided to start up a blog again.
Right now&lt;sup id="fnref-1"&gt;&lt;a class="footnote-ref" href="#fn-1"&gt;1&lt;/a&gt;&lt;/sup&gt;, this website is statically generated with &lt;a href="https://getpelican.com"&gt;Pelican&lt;/a&gt; and deployed with &lt;a href="https://travis-ci.org"&gt;Travis &lt;span class="caps"&gt;CI&lt;/span&gt;&lt;/a&gt;. This is a very interesting method and one of the first things I&amp;#8217;m going to be writing&amp;nbsp;about.&lt;/p&gt;
&lt;p&gt;Sounds exciting, right? &lt;a href="/atom.xml"&gt;Stay tuned&lt;/a&gt; for more of my infrequent&amp;nbsp;ramblings.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn-1"&gt;
&lt;p&gt;Oops, I did it anyway. Time related content in the introductory blog post. Let&amp;#8217;s see if this blog is still static in a year!&amp;#160;&lt;a class="footnote-backref" href="#fnref-1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Uncategorized"/></entry></feed>