<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Danny Arnold on Medium]]></title>
        <description><![CDATA[Stories by Danny Arnold on Medium]]></description>
        <link>https://medium.com/@despairblue?source=rss-28d914186eb2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4Qx0uyi8-KKck_q5.jpeg</url>
            <title>Stories by Danny Arnold on Medium</title>
            <link>https://medium.com/@despairblue?source=rss-28d914186eb2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 04:32:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@despairblue/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Elixir Weirdness]]></title>
            <link>https://medium.com/@despairblue/elixir-weirdness-1ec1d0e5a10?source=rss-28d914186eb2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ec1d0e5a10</guid>
            <category><![CDATA[amnesia]]></category>
            <category><![CDATA[mix]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[hex]]></category>
            <dc:creator><![CDATA[Danny Arnold]]></dc:creator>
            <pubDate>Sun, 25 Sep 2016 14:22:50 GMT</pubDate>
            <atom:updated>2016-09-25T14:22:50.563Z</atom:updated>
            <content:encoded><![CDATA[<h3>mix.exs and mix deps.get</h3><p>In the mix.exs file I say that I want <em>{ :amnesia, “~&gt; 0.1.0”, github: “meh/amnesia”}.</em> But “mix deps.get” pulls in version 0.2.5 and “mix test” complains about it:</p><pre>Unchecked dependencies for environment test:<br>* amnesia (<a href="https://github.com/meh/amnesia.git">https://github.com/meh/amnesia.git</a>)<br>  the dependency does not match the requirement &quot;~&gt; 0.1.0&quot;, got &quot;0.2.5&quot;<br>** (Mix) Can&#39;t continue due to errors on dependencies</pre><p>What am I missing?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ec1d0e5a10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Storing and Restoring the State in elm@0.17]]></title>
            <link>https://medium.com/wunder-nerds/storing-and-restoring-the-state-in-elm-0-17-94874429dc1d?source=rss-28d914186eb2------2</link>
            <guid isPermaLink="false">https://medium.com/p/94874429dc1d</guid>
            <category><![CDATA[elm]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[sports]]></category>
            <dc:creator><![CDATA[Danny Arnold]]></dc:creator>
            <pubDate>Tue, 31 May 2016 11:00:43 GMT</pubDate>
            <atom:updated>2016-05-31T11:54:02.450Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>If you’re just interested in the code: </strong><a href="https://github.com/despairblue/counter-local-storage">https://github.com/despairblue/counter-local-storage</a></p><p>It’s quite common for elm applications to save the application’s state in local storage and reinitialize themselfs with that state on reload. <a href="https://dreamwriter.co/">dreamwriter</a> (still using elm@0.15) is doing it, the <a href="https://github.com/evancz/elm-todomvc">elm-todomvc</a> example does it.</p><h4>Ports</h4><p>Ports are used to achieve this. Ports are a way for elm programs to communicate with JavaScript in a coordinated and safe fashion.</p><p><strong>With the release of elm 0.17 the way ports work changed.</strong></p><h4>Restoring the Model</h4><p>The JavaScript-side would look like this:</p><pre>// elm@0.16<br>const model = localStorage.getItem(&#39;model&#39;)<br>const startingModel = model ? JSON.parse(model) : null<br>const elmApp = elm.fullscreen(elm.Main, { getStorage: startingModel })</pre><p>Usually one would have declared an incoming port like this:</p><pre>-- elm@0.16<br>port getStorage : Maybe Model</pre><p>That port could contain our stored model. After pattern-matching it out this can be passed into a <em>Signal.foldp</em> as an initial value, but enough about elm 0.16. In elm 0.17 that changed and — looking at my old code and trying to understand it just enough to write this — for the better.</p><p>In JavaScript the way an application is initialized changed a bit, though that has nothing to do with ports:</p><pre>// elm@0.17<br>// this stayed the same<br>const model = localStorage.getItem(&#39;model&#39;)<br>const startingModel = model ? JSON.parse(model) : null<br>// this changed, `fullscreen` is defined on the module itself<br>const elmApp = elm.Main.fullscreen(startingState)</pre><p>The way the port is declared in elm also changed.</p><p><strong>It’s gone. </strong>There is no incoming port for things passed in when creating an application.</p><p>Instead you have to use a special type of <em>Program</em>, <em>Html.App.programWithFlags</em>:</p><pre>-- elm@0.17<br>main : Program (Maybe Model)<br>main =<br>    Html.programWithFlags<br>        { init = init<br>        , update = update<br>        , subscriptions = subscriptions<br>        , view = view<br>        }</pre><p>As can be seen in the type annotation it takes a <em>Maybe Model</em> as an argument.</p><p>The <em>Model</em> gets passed to <em>init</em>. So <em>init</em> becomes a function:</p><pre>-- elm@0.17<br>init : Maybe Model -&gt; ( Model, Cmd msg )<br>init model =<br>    case model of<br>        Just model -&gt;<br>            ( model, Cmd.none )</pre><pre>        Nothing -&gt;<br>            ( defaultModel, Cmd.none )</pre><p>So that’s the easy part. Now to the other easy part. The one that makes it worthwhile: saving the model on every update.</p><h4>Storing the Model</h4><p>The JavaScript interface stayed the same:</p><pre>// elm@0.16 and elm@0.17<br>elmApp.ports.setStorage.subscribe(function (state) {<br>  localStorage.setItem(&#39;model&#39;, JSON.stringify(state))<br>})</pre><p>In elm 0.16 you would declare an outgoing port like this:</p><pre>-- elm@0.16<br>port setStorage : Signal Model<br>port setStorage =<br>    model</pre><p>In elm 0.17 a couple of things are a bit different. The most noticeable difference on the elm-side being that a module that uses ports must declare this at the module declaration by using the <em>port</em> keyword:</p><pre>-- elm@0.17<br>port module Main exposing (..)</pre><p>Also the ports signature change due to the transition from Signals to Subscriptions:</p><pre>-- elm@0.17<br>port setStorage : Model -&gt; Cmd msg</pre><p><em>setStorage</em> takes a <em>Model</em> and returns a <em>Cmd</em> that can be returned from <em>update</em>. That’s basically it, there is just some wiring to do:</p><pre>-- elm@0.17<br>update : Msg -&gt; Model -&gt; ( Model, Cmd Msg )<br>update msg model =<br>    let<br>        newModel =<br>            case msg of<br>                Increment -&gt;<br>                    model + 1</pre><pre>                Decrement -&gt;<br>                    model — 1<br>            in<br>                ( newModel, setStorage newModel )</pre><p><em>setStorage model</em> returns a <em>Cmd</em> and thus replaces the <em>Cmd.none</em> part. If you want to return multiple <em>Cmd</em>`s have a look at <a href="http://package.elm-lang.org/packages/elm-lang/core/4.0.1/Platform-Cmd#batch">Cmd.batch</a> and the <a href="https://github.com/evancz/elm-todomvc/blob/master/Todo.elm#L42">withSetStorage</a> helper function in <a href="https://github.com/evancz/elm-todomvc">elm-todomvc</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94874429dc1d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wunder-nerds/storing-and-restoring-the-state-in-elm-0-17-94874429dc1d">Storing and Restoring the State in elm@0.17</a> was originally published in <a href="https://medium.com/wunder-nerds">Wundernerds Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immobilienscout 24 API]]></title>
            <link>https://medium.com/wunder-nerds/immobilienscout-24-api-7c8e1b810de0?source=rss-28d914186eb2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c8e1b810de0</guid>
            <category><![CDATA[immobilien]]></category>
            <category><![CDATA[property]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Danny Arnold]]></dc:creator>
            <pubDate>Thu, 18 Feb 2016 15:45:54 GMT</pubDate>
            <atom:updated>2016-02-18T15:49:25.280Z</atom:updated>
            <content:encoded><![CDATA[<p>We implemented an interface to <a href="https://www.immobilienscout24.de/">immobilienscout24.de</a> (is24 hereafter). When we found that there was no SDK available for Node.js, we built one ourself. It’s not released and a little coupled to our use case. Though if there is enough demand and polishing, releasing it should be possible.</p><p>Following there a a couple of caveats we found and how to avoid them.</p><h4>JSON Validation</h4><p>Updating a contact fails depending on the payload’s properties’ order. As you can see in this example below. In the example below we first create a contact and then add a phone number to it. The first try works the second does not. The only difference is where the property `title` is.</p><p>Takeaway:</p><ul><li>Use the order found in the examples (see the JSON example <a href="http://api.immobilienscout24.de/our-apis/import-export/contact/post.html">here</a>).</li><li>Pray that you don’t use a JavaScript environment in which the properties of an object are not ordered (they don’t have to be, according to the ECMA standard).</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f927e1fb7a30b00ffcb5a9f839c9be0/href">https://medium.com/media/8f927e1fb7a30b00ffcb5a9f839c9be0/href</a></iframe><p>This could happen for any other resource type as well, though this is the only case we found where this happened.</p><h4>Schemas</h4><p>These tables are really useful: <a href="http://api.immobilienscout24.de/our-apis/import-export/ftp-vs-api/">http://api.immobilienscout24.de/our-apis/import-export/ftp-vs-api/</a>.</p><p>Sadly they only exit for the <em>REALESTATE resource </em>types. If you want to know all the properties of any type the API supports check the <a href="https://github.com/ImmobilienScout24/restapi-java-sdk/tree/8a409e6d1269e0937b18b36adc5b893eef704cad/src/main/generated-sources/de/immobilienscout24/rest/schema/common/_1">restapi-java-sdk on GitHub</a>.</p><p>The examples in the documentation are good, but not exhaustive since</p><ul><li>they don’t contain all optional fields,</li><li>it’s not apparent which fields are required and which are optional,</li><li>in case of enumerations it’s not apparent what values are possible.</li></ul><p>It would be awesome to have the other resource types documented exactly as the <em>REALESTATE ones.</em></p><h4>Request Signing</h4><p>All requests to is24 have to be signed with the OAuth tokens and secrets.</p><p>This wasn’t straightforward for us, never having seen that. After some trial and error (kudos to nouncer.com for <a href="http://nouncer.com/oauth/signature.html">this helpful tool</a>) using <a href="https://github.com/bettiolo/oauth-signature-js">oauth-signature.js</a> is what worked for us:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66565f64e0510d437daaaaa6eaaa0787/href">https://medium.com/media/66565f64e0510d437daaaaa6eaaa0787/href</a></iframe><h4>When struggling</h4><p>Make sure to have look at the <a href="http://api.immobilienscout24.de/get-started/responses.html">error code page</a> and check out the <a href="https://playground.immobilienscout24.de/rest/playground">playground</a> (like an apigee console) for oauth token/secret creation and trying out stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c8e1b810de0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wunder-nerds/immobilienscout-24-api-7c8e1b810de0">Immobilienscout 24 API</a> was originally published in <a href="https://medium.com/wunder-nerds">Wundernerds Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interesting Talks about Testing and Functional Programming]]></title>
            <link>https://medium.com/@despairblue/interesting-talks-about-testing-and-functional-programming-371417b8230e?source=rss-28d914186eb2------2</link>
            <guid isPermaLink="false">https://medium.com/p/371417b8230e</guid>
            <dc:creator><![CDATA[Danny Arnold]]></dc:creator>
            <pubDate>Tue, 17 Feb 2015 22:24:32 GMT</pubDate>
            <atom:updated>2015-02-17T22:24:32.903Z</atom:updated>
            <content:encoded><![CDATA[<h4>Good talk about why unit tests and contracts are more important than integration tests</h4><p><a href="http://www.infoq.com/presentations/integration-tests-scam">Integration Tests Are a Scam</a></p><h4><em>Completely useless, though entertaining, well maybe not completely useless</em></h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F45140590&amp;url=http%3A%2F%2Fvimeo.com%2F45140590&amp;image=http%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F313898584_640.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=vimeo" width="640" height="512" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c267e6795a126c841b7973a931cec62/href">https://medium.com/media/0c267e6795a126c841b7973a931cec62/href</a></iframe><h4>Great introduction talks about using FP in practice</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fm3svKOdZijA%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dm3svKOdZijA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fm3svKOdZijA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2bb7e286960471b86b33d2ce9dea497/href">https://medium.com/media/e2bb7e286960471b86b33d2ce9dea497/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F43382919&amp;url=http%3A%2F%2Fvimeo.com%2F43382919&amp;image=http%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F450885176_1280.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=vimeo" width="1280" height="408" frameborder="0" scrolling="no"><a href="https://medium.com/media/f19d8c666b5488fed8b63784b5c1e3e1/href">https://medium.com/media/f19d8c666b5488fed8b63784b5c1e3e1/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=371417b8230e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[http://martingryner.com/no-i-wont-be-your-technical-co-founder/]]></title>
            <link>https://medium.com/@despairblue/http-martingryner-com-no-i-wont-be-your-technical-co-founder-ba98b1dc4619?source=rss-28d914186eb2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba98b1dc4619</guid>
            <dc:creator><![CDATA[Danny Arnold]]></dc:creator>
            <pubDate>Tue, 17 Feb 2015 22:23:33 GMT</pubDate>
            <atom:updated>2015-02-17T22:23:33.651Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="http://martingryner.com/no-i-wont-be-your-technical-co-founder/">http://martingryner.com/no-i-wont-be-your-technical-co-founder/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba98b1dc4619" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>