<?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[dandevri - Medium]]></title>
        <description><![CDATA[Some thoughts. - Medium]]></description>
        <link>https://medium.com/dandevri?source=rss----a155c3304e7b---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>dandevri - Medium</title>
            <link>https://medium.com/dandevri?source=rss----a155c3304e7b---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 22:19:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/dandevri" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Back to JS basics.]]></title>
            <link>https://medium.com/dandevri/back-to-js-basics-22746226cbec?source=rss----a155c3304e7b---4</link>
            <guid isPermaLink="false">https://medium.com/p/22746226cbec</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[concept]]></category>
            <category><![CDATA[variables]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Danny de Vries]]></dc:creator>
            <pubDate>Tue, 01 May 2018 10:34:01 GMT</pubDate>
            <atom:updated>2017-06-26T16:58:22.681Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>JS is </em><a href="https://en.wikipedia.org/wiki/Back_to_Basics_(Christina_Aguilera_album)">here to stay</a>, without you I got trouble<em>. To </em>understand <em>you here is a quick refresher on the </em>intro <em>of JavaScript.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Ct_7IYxpWRCZdEygYsioQ.jpeg" /><figcaption>This macbook has a JS sticker on it. I don’t normally have this sticker on. Just to make it look pretty for the picture 🌈</figcaption></figure><p>We all read <a href="https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f">this article</a> from last year. (NO!? you’ve been living under a rock or something?) It’s easy to get caught up in a JavaScript library and never get out. I’ve seen people know more about React and jQuery than pure vanilla JS.</p><p>When I started the <a href="http://www.hva.nl/opleiding/communication-and-multimedia-design/communication-and-multimedia-design.html">Minor Web Development</a> at the University of Applied Sciences Amsterdam I had (what buddhist call) a <strong>beginner’s mind.</strong></p><blockquote>It refers to having an attitude of openness, eagerness, and lack of preconceptions when studying a subject, even when studying at an advanced level, just as a beginner in that subject would.</blockquote><p>People around me would sit behind their keyboard and start writing line after line of complex JS code. I would come in, and curious as I was, would ask ‘simple’ questions like;</p><blockquote>Where does this function gets invoked?</blockquote><blockquote>What are the initial arguments of this function?</blockquote><blockquote>Where do you declare this variable?</blockquote><p>And what bothered me is that some people couldn’t give me straight up answers so I could learn from them. I had to ask twice or they didn’t really know the terminology.</p><p>Don’t get me wrong, most people are really great at handling complex JS stuff (and libraries) but to me it feels like they get caught up and lose sight of general JavaScript (programming) concepts.</p><p>So with this in mind I wanted to write a quick (yeah, you can call it a cheat sheet) refresher on basic JS concepts. Mostly for myself but also for all the other folks out there.</p><h4>Programming vs Scripting.</h4><p><a href="https://www.quora.com/Is-JavaScript-a-scripting-or-a-programming-language">People argue</a> <em>programming </em>or <em>programming language </em>isn’t really the correct term to describe JS. JavaScript doesn’t stand by itself, it needs to use a <strong>interpreter</strong>. In most cases this is the browser or a standalone JS engine. It isn’t native machine code (binary 01010) but it needs to be <strong>compiled </strong>and that’s where the browser comes into play.</p><p>To play it safe I would call JavaScript a <strong>scripting language</strong> which falls under the larger category <strong>programming language.</strong></p><h4>Variables.</h4><p>Variables store data and manipulate it. They do this by using a <strong>label </strong>to point to the data. In JavaScript data can be one of the following 7 <a href="https://developer.mozilla.org/nl/docs/Web/JavaScript/Data_structures">data types</a>:</p><ul><li>undefined</li><li>null</li><li>boolean</li><li>string</li><li>symbol</li><li>number</li><li>object</li></ul><p>They can store different values at different times.</p><ul><li>To <strong>declare</strong> a variable: var <em>keyword</em> with myVar<em>name</em> of the variable.</li><li><strong>Store </strong>value in a variable with the <strong>assignment operator: </strong><strong>=</strong></li><li><strong>Initialize </strong>the variable with a data type: 19 (in this case a number)</li></ul><pre>var myVar = 19;</pre><p>A variable that is only declared but has no initial value has the valueundefined.</p><pre>var a; // value is undefined</pre><h4>Functions.</h4><p>You can divide up your code in reusable parts by using <strong>functions.</strong></p><pre>function myFunction() {</pre><pre>// do stuff</pre><pre>}</pre><p>You can call or invoke the function by using the function name and place <strong>parentheses behind them.</strong></p><pre>myFunction()</pre><p>parameters are basically variables that act as placeholders for the values that are to be input to a function when it’s called. You pass a value as input to the function. Many people use the term parameter and argument interchangeably but there is a slight difference.</p><pre>function myFunction(param1, param2) { // These are parameters<br>   console.log(param1 + param2);<br>}</pre><pre>myFunction(1, 2); // These are arguments</pre><p>Values that are passed into a function when it is called are arguments. The placeholders are parameters.</p><h4>Arrays.</h4><p>With arrays you can store multiple data types in one variable. You declare it the same way as a variable but you put [] around the values and seperate each one with a comma. Every value in an array is called a entry.</p><p>You can access data inside array using indexes. Arrays use zero-based indexing. So the first item in the array starts with a 0.</p><h4>Objects.</h4><p>Objects are similar to arrays, except that instead of using indexes you access the data in objects through what are called properties. Every property is made up of a key and a value.</p><pre>var dog = {<br>  &quot;name&quot;: &quot;Peter&quot;,<br>  &quot;legs&quot;: &quot;4&quot;<br>}</pre><blockquote>The stuff above is a basic outline of some of the core JavaScript terminology. Some of the stuff that I need to remind myself of on the daily. Stuff that people, IMHO, need to refresh more often. Hope this helps and next time you want to sound cool; try to use the right terminology. 👌</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5YQZApDdoHpaz3iwrujyNw.gif" /><figcaption>Look 👀 it’s <a href="https://medium.com/u/fac246e784d0">Luuk Hafkamp</a> when he finally got a complex function working 🎉</figcaption></figure><blockquote>Thanks for reading! Feel free to reach out to me if you have something to say!</blockquote><ul><li><a href="http://dandevri.es/">Website</a></li><li><a href="https://twitter.com/dandevri">Twitter</a></li><li><a href="https://www.instagram.com/dandevri/">Instagram</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22746226cbec" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dandevri/back-to-js-basics-22746226cbec">Back to JS basics.</a> was originally published in <a href="https://medium.com/dandevri">dandevri</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building conversational UI demystified (using wit.ai)]]></title>
            <link>https://medium.com/dandevri/building-conversational-ui-with-wit-ai-demystified-77edfe749ca2?source=rss----a155c3304e7b---4</link>
            <guid isPermaLink="false">https://medium.com/p/77edfe749ca2</guid>
            <category><![CDATA[conversations]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[artifical]]></category>
            <category><![CDATA[natural-language]]></category>
            <dc:creator><![CDATA[Danny de Vries]]></dc:creator>
            <pubDate>Tue, 01 May 2018 10:09:51 GMT</pubDate>
            <atom:updated>2017-06-27T21:25:01.854Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>The last couple of weeks I’ve been really into conversational UI. (bots) When I started off the whole <em>‘bot world’</em> seemed full of buzzwords. As I spend time building a bot the terminology made more sense and here I am; demystifying some common jargon used in conversational UI.</blockquote><p>The examples are in <strong>dutch</strong> because the bot was born in the Netherlands. 🇳🇱 Maybe you won&#39;t get specific sentences but you will understand the general flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZX00scoZ6HMG3ZUC2k_l1Q.jpeg" /></figure><p>Let’s start off with some buzzwords and the general flow of how it’s build.</p><h4>Natural language processing</h4><p>The most important thing a bot needs to do is to understand sentences the user sends. Kinda off obvious but there is a general flow for this. In <strong>wit.ai </strong>the underlying structure that parses text is called <a href="https://github.com/facebookincubator/duckling"><strong>duckling</strong></a><strong>. </strong>It parses <strong>natural language </strong>(the way we humans talk) into <strong>structured data.</strong></p><p><em>Example from the GitHub repo:</em></p><pre>&quot;the first Tuesday of October&quot;<br>=&gt; {&quot;value&quot;:&quot;2017-10-03T00:00:00.000-07:00&quot;,&quot;grain&quot;:&quot;day&quot;}</pre><p>It’s really fancy and I don’t want to go down the rabbit hole with <strong>natural language processing</strong>. I don’t even know half of it and it would be a whole book by itself. Let’s have a look at a simple implementation within wit.ai.</p><h3>Wit.ai flow</h3><h4>Entities</h4><p>When the users sends a sentence you want to detect what are called entities.</p><blockquote>An entity is a piece of information you would want to detect from a user input.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3oKIPbBQ3EdoSID8Yg%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2F3oKIPbBQ3EdoSID8Yg&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3oKIPbBQ3EdoSID8Yg%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="175" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0d6261b2e7d9caa0a41de7e421fc9ec/href">https://medium.com/media/d0d6261b2e7d9caa0a41de7e421fc9ec/href</a></iframe><p>Above you can see how wit extracts all the important entities from a user sentence. This is the most important step, getting the entities right. If the parser gets the right entities you can hit <strong>validatie.</strong></p><p>It will query the app and adds it to the processing. It makes the parser ‘smarter’ and it can extract the entities even better. Even with more complex sentences. Another useful feature is that you can make <strong>synonyms. </strong>For example <em>romance </em>and <em>romantic</em> can both be the entity <strong>love.</strong></p><h4>Query</h4><p>Now that you have validated some entities you can query you’re app and see what the response,mstructured data, is.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl0IyjGHrkhQfDpZIs%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl0IyjGHrkhQfDpZIs%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl0IyjGHrkhQfDpZIs%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="132" frameborder="0" scrolling="no"><a href="https://medium.com/media/835c0bb1ae7a0d7aea5447149946229c/href">https://medium.com/media/835c0bb1ae7a0d7aea5447149946229c/href</a></iframe><p>Below is a structured version:</p><pre>{<br>  &quot;msg_id&quot;: &quot;0C5MyEdgPv3wBkgR3&quot;,<br>  &quot;_text&quot;: &quot;Ik zoek een Nederlands boek van Saskia Noort&quot;,<br>  &quot;entities&quot;: {<br>    &quot;language&quot;: [<br>      {<br>        &quot;confidence&quot;: 0.72945154848646,<br>        &quot;value&quot;: &quot;dut&quot;,<br>        &quot;type&quot;: &quot;value&quot;<br>      }<br>    ],<br>    &quot;type&quot;: [<br>      {<br>        &quot;confidence&quot;: 0.78767754925405,<br>        &quot;value&quot;: &quot;book&quot;,<br>        &quot;type&quot;: &quot;value&quot;<br>      }<br>    ],<br>    &quot;contact&quot;: [<br>      {<br>        &quot;suggested&quot;: true,<br>        &quot;confidence&quot;: 0.99960075112416,<br>        &quot;value&quot;: &quot;Saskia Noort&quot;,<br>        &quot;type&quot;: &quot;value&quot;<br>      }<br>    ],<br>    &quot;intent&quot;: [<br>      {<br>        &quot;confidence&quot;: 0.99998293857858,<br>        &quot;value&quot;: &quot;search&quot;<br>      }<br>    ]<br>  }<br>}</pre><p>You can see it detects the right entities. The confidence is a decimal number that wit.ai sends to show how well a word matches an entity.</p><h4>Stories</h4><p>Now that the API gets the right entities you need to make sure you’re bot sends something back or even makes calls to external API’s. Within wit.ai these are called <strong>stories. </strong>Each story is basically a conversation you have with the bot. Let’s take a simple greeting for example:</p><pre>User: Hello, I am Danny.<br>Bot: Hi Danny! My name is bot.</pre><p>The user sentence in this case has an intent: greeting. Based on the structure of the sentence and the possible entities wit.ai detects that this is a greeting. To make it respond a little bit more personal you detect the name entity (in this case <strong>Danny</strong>) and store it in a variable. The bot now responds with a basic message to the user.</p><p>But what if you want to make more complex stories? What if you need more information or the user doesn’t provide enough information in the first place?</p><pre>User: I am searching for a dutch book.<br>Bot: From what author?<br>User: Saskia Noort<br>Bot: &#39;Huidpijn&#39; is the newest boek from Saskia Noort.</pre><p><em>In the above example the user doesn’t provide the name of the author.</em></p><p>This type of conversation is called <strong>slot-based. </strong>The bot needs (more) information from the user. You use context branches for this. When entities are missing you can ask a follow up question.</p><h4>Actions</h4><p>Based on the user’s sentence you might want to make API calls. These moments in the conversation are called actions. Let’s bring back the previous example:</p><pre>User: I am searching for a dutch book.<br>Bot: From what author?<br>User: Saskia Noort <br><strong>apiCall(findBook)</strong><br>Bot: &#39;Huidpijn&#39; is the newest boek from Saskia Noort.</pre><p>Between these basics message you can send actions. These are just keyword and names of methods. If you get these responses in you’re own tech stack you can then make API call’s and even store those in variables.</p><p>The response has a property called type which can have the following values:</p><ol><li>msg: Message from the bot as a string</li><li>action: Name of the action you need to perform</li><li>stop: When the conversation is over</li></ol><p>The stop command indicates when the story (conversation) is over and the user can then start any other story.</p><h3>Personality</h3><p>Every bot still needs an interface. At its core, interfaces are always about communication.</p><blockquote>Conversational interfaces are so fascinating because it is a form of communication that everyone uses and understands.</blockquote><p>When a bot doesn’t give the right response they always blame the interface and the knowledge of the system. We type natural language so we expect the bot to respond in the same natural way. <a href="https://uxdesign.cc/skeuomorphism-in-conversational-design-6ff9aea98829">This post</a> from Adrian and this <a href="https://blog.intercom.com/principles-bot-design/">post from Intercom</a> really helped to shape the bot do this right.</p><h4><strong>Timing</strong></h4><p>A bot can respond way faster than a human. You can build in a delay to make it look like it’s thinking. For example when it’s making external API calls.</p><h4>Voice</h4><p>Voice is part of the branding. It shapes the identity of the bot. Once the user associates a voice with something, it becomes part of the identity.</p><h4>Emotion</h4><p>A golden rule is:</p><blockquote><em>Don’t pretend to be human.</em></blockquote><p>You need to have empathy for the bot if it doesn’t give the right answer but don’t use the metaphor of making it human. Always emphasise the fact that it’s a system. Take error messages for example:</p><pre>❌ No results are found.</pre><pre>✅ I couldn&#39;t find anything for you! Try searching again with different keywords.</pre><p>Research shows that people prefer computers who are friendly and similar to them. Respond human-like but not human.</p><blockquote>These are just basic concepts of building conversational UI. Some of these terms are specific to wit.ai but most of them are generally accepted and good practices. Go out and try to build your first build 🤖. It’s a struggle in the beginning but once you get the hang of it, it’s not that bad after all. It feels really magical! ✨</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JLiYlLsqzaiKHdLRBk3YIg.jpeg" /><figcaption>Or don’t care at all and have a nice beer in the sun. ☀️</figcaption></figure><blockquote>Thanks for reading! Feel free to reach out to me if you have something to say!</blockquote><ul><li><a href="http://dandevri.es/">Website</a></li><li><a href="https://twitter.com/dandevri">Twitter</a></li><li><a href="https://www.instagram.com/dandevri/">Instagram</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77edfe749ca2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dandevri/building-conversational-ui-with-wit-ai-demystified-77edfe749ca2">Building conversational UI demystified (using wit.ai)</a> was originally published in <a href="https://medium.com/dandevri">dandevri</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>