<?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 Nick Tchayka on Medium]]></title>
        <description><![CDATA[Stories by Nick Tchayka on Medium]]></description>
        <link>https://medium.com/@nickseagull?source=rss-cdcf295a7ff0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*0OPxKb2pHlcbvXJvcD_y4w.jpeg</url>
            <title>Stories by Nick Tchayka on Medium</title>
            <link>https://medium.com/@nickseagull?source=rss-cdcf295a7ff0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 13:45:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nickseagull/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[Releasing AWS Lambda Haskell Runtime v2]]></title>
            <link>https://medium.com/the-theam-journey/releasing-aws-lambda-haskell-runtime-v2-94e7d5add938?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/94e7d5add938</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[haskell]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Mon, 01 Jul 2019 17:40:43 GMT</pubDate>
            <atom:updated>2019-07-01T18:34:42.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yKkoZiskPDvfseRhJ0pN7A.jpeg" /></figure><p>We got super excited when we released the AWS Lambda Haskell runtime, described <a href="https://medium.com/the-theam-journey/getting-started-with-the-haskell-aws-lambda-runtime-951b2322c7a3">in one of our previous posts</a>, because you could finally run Haskell in AWS Lambda natively.</p><p>There are few things better than running Haskell in AWS Lambda, but one is better for sure:</p><p><strong>Running it 12 times faster!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xx1ACxVm-R2j4yRG" /></figure><p><em>Haskell Optimized is the v2 runtime; the old version was just called Haskell. Haskell Optimized cut the cold start time in half, and made execution time twelve times faster.</em></p><h3>Whaaaattt???</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/0*h1yiNRpeRE3CBXkv" /></figure><p>We have been working hard on our benchmarks, and because Haskell, being native, is fast by itself, we wanted our runtime to be much faster, while keeping the same level of convenience.</p><p>It all began with a <strong>refactor of the codebase</strong>, where we split the two big modules into small, organized, single-responsibility modules that are much easier to navigate, and therefore easier to contribute to!</p><p>We immediately saw some flaws in our code, but probably the biggest pain point that hindered performance was the layer separation.</p><h3>Deprecating the layer</h3><p><a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html">AWS Lambda layers</a> are a great tool for packing away some dependencies, to make your project run — and bootstrap — faster.</p><p>They can be used to upload heavy dependencies, like large Java JARs, or even perhaps command line applications.</p><p>We were using them to upload the runtime. This made the execution of the user’s project a bit complex:</p><ol><li>The layer had to be downloaded to the lambda.</li><li>The layer would spawn a system process through bash, spawning the user project in a very specific way, with some protocols that went through STDOUT and STDERR, along with JSON serialization.</li><li>Even something as simple as a Hello World had quite a lot of overhead due to the layer.</li></ol><p>We looked at other compiled runtimes, and having one executable per lambda — which at first hadn’t seemed like an option to us — now started to be more appealing. We also wanted to keep the same convenience that the Node.js runtime provided by allowing us to select a handler from the AWS Lambda panel.</p><p>That’s it! We could have the runtime <strong>embedded</strong> in the user project, together with the dispatcher.</p><p>So we put on our safety glasses and started sawing and sanding the runtime using awesome Haskell metaprogramming (Template Haskell) to provide the amazing experience of a 12x decrease in execution time, and cut the cold start times <strong>by half.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*QjQL4F0GP_L0ApO9" /></figure><h3>A more convenient import and name</h3><p>We have made everything available under the Aws.Lambda module. Now you don’t have to import two modules just to configure your lambdas. Instead, now you can do the following in your Main module, and you are ready to roll:</p><pre><strong>import</strong> Aws.Lambda<br><strong>generateLambdaDispatcher</strong></pre><h3>Comprehensive documentation</h3><p>You can find a website that serves all of the <a href="https://theam.github.io/aws-lambda-haskell-runtime/">documentation for the runtime here</a> using <a href="https://theam.github.io/tintin/">Tintin</a>.</p><p>When in doubt, take a peek at it: you now have a reference for easily running Haskell on AWS Lambda.</p><h3>Thanks for reading</h3><p>We hope you like the changes we’ve made to the runtime. We want it to remain the best way to run Haskell on AWS Lambda.</p><p>Tell us if you did create, launch, or even test something with the runtime. We’d love to hear from you, and to make serverless computing <strong>easier, better, faster, and stronger</strong>.</p><p>See ya!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*_D9IDXR3KLV3mlbq" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94e7d5add938" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-theam-journey/releasing-aws-lambda-haskell-runtime-v2-94e7d5add938">Releasing AWS Lambda Haskell Runtime v2</a> was originally published in <a href="https://medium.com/the-theam-journey">The Agile Monkeys’ Journey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with the Haskell AWS Lambda Runtime]]></title>
            <link>https://medium.com/the-theam-journey/getting-started-with-the-haskell-aws-lambda-runtime-951b2322c7a3?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/951b2322c7a3</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[haskell]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Mon, 10 Dec 2018 13:47:11 GMT</pubDate>
            <atom:updated>2019-07-01T19:40:28.835Z</atom:updated>
            <content:encoded><![CDATA[<h4>By <a href="https://medium.com/u/ab2254a994a1">The Agile Monkeys</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugjxQ8jYIEEH9FRtu7K2RA.png" /></figure><h3>Disclaimer</h3><p>This post is now outdated, for the newest blog post checkout this <a href="https://medium.com/the-theam-journey/releasing-aws-lambda-haskell-runtime-v2-94e7d5add938">new one</a>. If you want to learn how to create Lambda services using Haskell, you can also check the <a href="https://theam.github.io/aws-lambda-haskell-runtime/">official docs for the runtime</a>.</p><h3>Introduction</h3><p>We were there when <a href="https://twitter.com/Werner">Werner Vogels</a> announced the new custom lambda runtimes on stage, and we couldn’t have been more excited. It was definitely one of our favorite announcements that morning. We have been trying Haskell (and other flavors of Haskell, like Eta and PureScript) on AWS lambda since we started working on Serverless more than a year ago. From the beginning we felt like Haskell fit like a glove in AWS Lambda — it produces fast and reliable binaries and it’s a pure functional language! There’s nothing like a pure functional language to write Lambda Functions, right?</p><p>Well, the reality is that Haskell didn’t work as well as the supported languages did. We had to apply ugly hacks to make it work, and we ended up switching to TypeScript or other better supported languages for production projects. But that’s all in the past!</p><p>After the announcement we couldn’t stop ourselves from running to one of those cubicles at the Venetian and writing a Haskell runtime. Today we’re proudly announcing the release of <a href="https://github.com/theam/aws-lambda-haskell-runtime">a fully working Haskell Runtime for AWS Lambda</a> and our commitment to maintain it. We hope you like it and start using it in your projects. It’s still in an early stage, so please send us any issues you may find and let’s make it rock solid together!</p><h3><strong>Setting up the environment</strong></h3><p>This guide assumes that you have the <a href="https://www.haskellstack.org/">Stack</a> build tool installed. If not, you can do so by issuing the following command on your terminal:</p><pre><strong>curl -sSL </strong><a href="https://get.haskellstack.org/"><strong>https://get.haskellstack.org/</strong></a><strong> | sh</strong></pre><p>Haskell compiles to <strong>native code</strong>, which is super efficient. But it has one main drawback: linking changes from machine to machine. To make sure that our projects always work and are reproducible, we use the Stack <a href="https://docs.haskellstack.org/en/stable/docker_integration/">feature</a> for <a href="https://www.docker.com/">Docker</a> support to build our projects. Be sure to install Docker before getting started with the runtime :).</p><h3>A nice scaffold</h3><p>We will create a simple function that validates if a person has a positive age or not.</p><p>To make things easier, we have provided a Stack template that will scaffold the project for you. To use it, enter the following command:</p><pre><strong>stack new my-haskell-lambda https://github.com/theam/aws-lambda-haskell-runtime/raw/master/stack-template.hsfiles --resolver=lts-12.13 --omit-packages</strong></pre><p>This will create a <strong>my-haskell-lambda</strong>directory with the following structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/178/0*lNYrCuRa6K0Cbh41" /></figure><p>Given that the Haskell runtime is brand new, package repositories don’t have it yet on their indices. This will be fixed in the near future, but for now you need to replace the following sections in your <strong>stack.yaml:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/20144c755ef10b66fe4d8326f0e27fbc/href">https://medium.com/media/20144c755ef10b66fe4d8326f0e27fbc/href</a></iframe><h3>What’s in the code</h3><p>Our handler is pre-defined in the <strong>src/Lib.hs</strong> file. Take a look at this file — there’s quite a lot of stuff going on:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9982bb1b0434869e05f548d76f8e336d/href">https://medium.com/media/9982bb1b0434869e05f548d76f8e336d/href</a></iframe><p>The first line is the definition of the module; after that, we do a bunch of imports:</p><ol><li>Aws.Lambda.Runtime for having access to the <strong>Context</strong> type</li><li>GHC.Generics for compatibility with JSON</li><li>Data.Aeson for generating JSON (de)serializers for our types</li></ol><p>After that, we define a <strong>Person</strong> type, which is basically the JSON that our function expects; we add the <strong>deriving (Generic)</strong> clause so Haskell can generate nice code for us at compile time.</p><p>After that, we tell the compiler to generate the JSON deserializer and serializer for our type.</p><p>Finally, we define our handler. <strong>Note that it must be called “handler</strong>,” as this is currently a restriction of the Haskell runtime.</p><p>The type of our handler is a function that:</p><ol><li>Takes a <strong>Person</strong> as the first parameter</li><li>Takes an AWS <strong>Context</strong> as the second parameter</li><li>Performs <strong>IO</strong>, and returns <strong>Either</strong> a <strong>String</strong> if something went wrong, or a <strong>Person</strong> if everything went Right.</li></ol><p>In this handler, we check if the personAge field of person is greater than zero, and if it is, we <strong>return</strong> that everything was <strong>Right</strong> containing the <strong>person.</strong></p><p>If not, something went wrong. And what is the opposite of <strong>Right</strong>? You guessed it — <strong>Left</strong>. We return a <strong>Left </strong>containing the error <strong>String</strong>.</p><h3>Making the project aware of our handler</h3><p>If we open <strong>app/Main.hs</strong> we will find something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d083e5af120aedfebf526f49f1ac000f/href">https://medium.com/media/d083e5af120aedfebf526f49f1ac000f/href</a></iframe><p>We are importing the <strong>Configuration</strong> and <strong>Runtime</strong> files, which are needed for our project to deploy properly on AWS.</p><p>Then we import <strong>qualified</strong>, the module that contains our handler.</p><p>Finally, we call <strong>configureLambda</strong>, which will dynamically generate a dispatcher for our handlers. In comparison to the official runtimes written in C++ and Rust, the Haskell runtime doesn’t make you include the whole runtime in your project.</p><p>The C++ and Rust runtimes are written as a library and require you to compile an executable per lambda function.</p><p>Our runtime is a separate layer that receives the function handler name from AWS, and our configuration module generates a dispatcher dynamically to check and execute it for you.</p><p>If you wanted to create more handlers, <strong>remember to import them here, qualified.</strong></p><h3>Deploying our function</h3><p>The project scaffold provides you a simple <strong>Makefile</strong> that runs a couple of commands to make things easier for you. First, pull the docker image by doing a stack docker pull</p><p>Now, if you run make<strong>, </strong>you will end up with a <strong>build</strong> folder containing a <strong>function.zip</strong> file in the root of your project. Basically, it builds the project using Docker, to make sure that it will work on AWS Lambda. After that, it creates a zip file containing the dispatcher executable from your Haskell Lambda project.</p><blockquote><strong>Note for NixOS users: </strong>Due to how NixOS is structured, you need to edit the Makefile and replace all stack --docker &lt;something&gt; calls to stack --docker --docker-stack-exe download &lt;something&gt;.</blockquote><p>Now, open your AWS Lambda panel in the AWS Console, and click on functions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/0*6E25ry5bluGdKmHL" /></figure><p>Click on the <strong>Create function</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/0*SGZ9VOQGoaF8jxC8" /></figure><p>Give your function a name, select <strong>Use custom runtime in function code or layer,</strong> and<strong> </strong>create a new role using the policy template <strong>AWSLambdaBasicExecutionRole</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D29L-JBnceTtl070" /></figure><p>Now click on the layers button, and <strong>Add a layer</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wNKXbMQjvUzCci8i" /></figure><p>Paste in the <strong>Layer version ARN</strong> field the following ARN to use the Haskell runtime:</p><pre><strong>arn:aws:lambda:&lt;YOUR REGION&gt;:785355572843:layer:aws-haskell-runtime:2</strong></pre><p>Substitute &lt;YOUR REGION&gt; with the region that you are using in your project, if you are unsure, you can use us-west-2.</p><p><em>(By the way, we had a small issue with the deployment of </em><em>us-east-2so if you are using that region, please change the </em><em>2 at the end with a</em><em>10)</em></p><p>Now click on your function box on top of the layers button, and upload the zip file that was generated in the <strong>build</strong> directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*55dvQs4MNuiBNBMr" /></figure><p>Remember to type in the appropriate handler name, which in this case is <strong>src/Lib.handler</strong>.</p><p>Click on <strong>Save</strong>.</p><p>Now click on <strong>Test</strong>, and use this test data:</p><p><strong>{<br> “personAge”: 43,<br> “personName”: “John Doe”<br>}</strong></p><p>If everything went correctly, you can click on more details and see that our function ran correctly, and it returned the person as is, because the age was positive:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/0*6a2Z-tSIJqnM7Ew7" /></figure><p>Let’s try to insert a negative age and see what happens:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*MmjJulafWKqjRbdA" /></figure><p>It fails successfully!</p><p>Be aware that we are not constrained to only strings to return errors. We can provide our own error types, as long as we provide the <strong>ToJSON</strong> serializer.</p><p>Now you know how to create an AWS Lambda function based on our Haskell runtime. If you encounter any issue or questions, feel free to point it out in the <a href="https://github.com/theam/aws-lambda-haskell-runtime/issues">GitHub issue board</a>.</p><p>Thanks for reading — stay tuned for more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=951b2322c7a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-theam-journey/getting-started-with-the-haskell-aws-lambda-runtime-951b2322c7a3">Getting Started with the Haskell AWS Lambda Runtime</a> was originally published in <a href="https://medium.com/the-theam-journey">The Agile Monkeys’ Journey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reusable code in TidalCycles]]></title>
            <link>https://medium.com/potac/reusable-code-in-tidalcycles-59b7a4dba30a?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/59b7a4dba30a</guid>
            <category><![CDATA[music]]></category>
            <category><![CDATA[tidal]]></category>
            <category><![CDATA[haskell]]></category>
            <category><![CDATA[livecoding]]></category>
            <category><![CDATA[art]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Thu, 01 Jun 2017 23:04:04 GMT</pubDate>
            <atom:updated>2017-06-01T23:04:04.893Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swnCPtWhhsFa455YhH19sg.jpeg" /><figcaption>Renick Bell live coding during the 2013 Linux Audio Conference in Graz (Austria) at the Forum Stadtpark on 11 May 2013.</figcaption></figure><p>A lot of the time, while <a href="https://en.wikipedia.org/wiki/Live_coding">live coding music</a>, we make awesome sounds, awesome melodies, awesome patterns or even awesome effects.</p><p>But, what happens with them after we finish our piece/performance?</p><p>Most of the time, they get lost, forgotten, or just saved for the future, but lost in our file systems. Sometimes we want to bring them back to life, but copying and pasting is not an option.</p><p>TidalCycles (or Tidal only) is an embedded domain specific language in Haskell, for the purpose of creating music, patterns or just sound. It depends on the Haskell interpreter to execute its code, so we get access to it.</p><p>Because it’s just Haskell, we can make a Haskell library to save our sounds in a library that we can just <strong>import </strong>later. Let’s begin.</p><h3>Stack</h3><p>Stack is a program for initializing, building, testing and doing many other things with Haskell project with ease. If you are in <strong>OS X or Linux</strong>, you can install it by issuing the following command in your prompt:</p><pre>curl -sSL <a href="https://get.haskellstack.org/">https://get.haskellstack.org/</a> | sh</pre><p>If you are in Windows, you can download an appropriate installer from <a href="https://docs.haskellstack.org/en/stable/install_and_upgrade/#windows">this page</a>.</p><h3>Our library</h3><p>Let’s create a new Haskell library project by executing:</p><pre>stack new &lt;name-of-our-library&gt; simple-library</pre><p>I named mine <strong>ns-sounds</strong>, you can name yours whatever you like.</p><p>This command will generate a directory like so:</p><pre>├── LICENSE<br>├── README.md<br>├── Setup.hs<br>├── &lt;name-of-our-library&gt;.cabal<br>├── src<br>│   └── Lib.hs<br>└── stack.yaml</pre><p>Let’s open the <strong>cabal</strong> file with a text editor and make a few tweaks to it. First, we will add <strong>tidal</strong> to the <strong>build-depends</strong> field, then, we will change the <strong>exposed-modules</strong> field to <strong>the name we want to import</strong> and, finally, we will add the field <strong>default-extensions: OverloadedStrings</strong> after <strong>default-language:</strong></p><pre>name:                ns-sounds<br>version:             0.1.0.0<br>--synopsis:<br>--description:<br>homepage:            https://github.com/githubuser/ns-sounds#readme<br>license:             BSD3<br>license-file:        LICENSE<br>author:              Author name here<br>maintainer:          example@example.com<br>copyright:           2017 Author name here<br>category:            Web<br>build-type:          Simple<br>extra-source-files:  README.md<br>cabal-version:       &gt;=1.10</pre><pre>library<br>  hs-source-dirs:      src<br>  exposed-modules:     <strong>Sound.Tidal.NickSeagull.Sounds</strong><br>  build-depends:       base &gt;= 4.7 &amp;&amp; &lt; 5,<br>                       <strong>tidal</strong><br>  default-language:    Haskell2010<br>  <strong>default-extensions:  OverloadedStrings</strong></pre><pre>source-repository head<br>  type:     git<br>  location: https://github.com/githubuser/ns-sounds</pre><p>After this, delete the file inside the <strong>src</strong> folder called <em>Lib.hs</em> and make a folder hierarchy according to your library name, ending with a <strong>hs</strong> file, in my case:</p><pre>src<br>└── Sound<br>    └── Tidal<br>        └── NickSeagull<br>            └── Sounds.hs</pre><p>Each dot separates a directory level.</p><h3>Saving our sounds</h3><p>Now, open your library file with a text editor, in my case <strong>src/Sound/Tidal/NickSeagull/Sounds.hs</strong>.</p><p>At the top of the file, we will put the name of the module and import <strong>tidal</strong> by doing the following:</p><pre>module Sound.Tidal.NickSeagull.Sounds where</pre><pre>import Sound.Tidal.Context<br>import Sound.Tidal.Scales<br>import Sound.Tidal.Chords</pre><p>After this, we can just add our sounds as we do in regular tidal:</p><pre>mySound = s &quot;supersaw&quot; # sustain 10</pre><p>Save the file, and issue the following command from the <strong>root of the library project</strong>, where the cabal file is located:</p><pre>cabal install</pre><p>This will compile and install your library in a system-wide level.</p><p>Now, just open a new tidal session and issue the line</p><pre>import &lt;name-of-our-library&gt;</pre><p>You’re ready for rocking the stage with your sounds, whenever you update your sound library, just run <strong>cabal install</strong> again.</p><p>Keep rocking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59b7a4dba30a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/potac/reusable-code-in-tidalcycles-59b7a4dba30a">Reusable code in TidalCycles</a> was originally published in <a href="https://medium.com/potac">POTAC</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple data processing with Haskell]]></title>
            <link>https://medium.com/the-theam-journey/simple-data-processing-with-haskell-b79cea4d0a2d?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b79cea4d0a2d</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[haskell]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[data-processing]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Thu, 18 May 2017 09:27:42 GMT</pubDate>
            <atom:updated>2017-05-27T15:24:24.071Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rpKYkvD_XsZTG6OGch27fg.jpeg" /></figure><p>When doing data science, most of the time, we’re just cleaning up our data.</p><blockquote>[…] Cleaning up data to the point where you can work with it is a huge amount of work. If you’re trying to reconcile a lot of sources of data that you don’t control like in this flight search example, it can take 80% of your time. [<a href="http://blog.revolutionanalytics.com/2014/08/data-cleaning-is-a-critical-part-of-the-data-science-process.html">Source</a>]</blockquote><p>This task can be tedious, but it is very important.</p><blockquote>“It’s an absolute myth that you can send an algorithm over raw data and have insights pop up.” Jeffrey Heer</blockquote><p>The good news is that it doesn’t have to be that bad, and Haskell can help.<br>If you don’t have enough experience with Haskell, you may have heard that it is a somewhat esoteric language. Others claim that it is the silver bullet for all problems.</p><p>Actually, it’s neither. We don’t believe in magic, but, we do think it’s an awesome language for <strong>data processing</strong>.</p><p>Let’s think that we want to help a small company solve a simple problem with their sales data:</p><blockquote>Which categories of products do we have, and how many products of them have we sold. It doesn’t have to be perfect, we just want some guidance.</blockquote><p>So we start working on their data. Let’s take a look at how the process works.</p><p>First of all, we loaded all the necessary packages and <a href="https://wiki.haskell.org/Language_extensions">language extensions</a> (which may look scary at first, but they enable some language goodies), and some packages like:</p><ul><li>Flow — Allows the use of some nice operators like |&gt;</li><li>Text — Makes text processing fast and easy</li><li>Frames — Generation of types for our data in compile time.</li></ul><pre>{-# LANGUAGE ConstraintKinds, DataKinds, FlexibleContexts, GADTs,<br> OverloadedStrings, PatternSynonyms, QuasiQuotes,<br> ScopedTypeVariables, TemplateHaskell, TypeOperators,<br> ViewPatterns #-}<br> <br> import qualified Data.Text as Text<br> import qualified Data.Text.IO as Text<br> import Control.Applicative<br> import qualified Control.Foldl as Foldl<br> import qualified Data.Foldable as Foldable<br> import Data.Char<br> import Data.Proxy (Proxy(..))<br> import Data.List<br> import Lens.Family<br> import Frames<br> import Frames.CSV (readTableOpt, rowGen, RowGen(..))<br> import Pipes hiding (Proxy)<br> import qualified Pipes.Prelude as Pipes<br> import Flow</pre><p>Our data looks like this. (Dropping some superfluous columns):</p><pre>id, create_date, name_template, create_uid, qty <br>1434, 2016–04–01 00:33:21, Notebook with pen, Paw Patrol, 1, 1<br>1437, 2016–04–01 00:33:21, Small notebook, Frozen, 1, 1</pre><p>Let’s begin by loading them in our program:</p><pre>tableTypes &quot;Sale&quot; &quot;resources/order_line_products_from_april_to_august.csv&quot;<br> <br>loadSales :: IO (Frame Sale)<br>loadSales = &quot;resources/order_line_products_from_april_to_august.csv&quot;<br> |&gt; readTableOpt saleParser<br> |&gt; inCoreAoS</pre><p>So, what happened here? Let’s see:</p><p>tableTypes is a <strong>Template Haskell</strong> function, which means that it is executed at <strong>compile time.</strong> It generates a data type for our CSV, so we have everything under control with our types.</p><p>loadSales :: IO (Frame Sale) — In Haskell, we read the double colon as -<em>has type </em>, so in this example we say that loadSales has type IO (Frame Sale) . Let’s analyze this type in a bit more depth:</p><p>- Sale is the type that tableTypes generated for us, which is each row.<br>- Frame is a wrapper type that denotes a data frame containing some rows.<br>- IO is another wrapper type that indicates that it’s contents have been loaded from somewhere outside of the program. In this case, they came from a CSV file.</p><p>loadSales reads the table of the CSV file in memory (“core”) as an <em>Array of Structures</em> (inCoreAoS ).</p><p>In Haskell, we do our business like this, explicitly telling the compiler what we are handling in each step. In most cases, the compiler will tell us when we are doing something wrong with our type, like defining a function that is declared when receives a True as a parameter, but not a False , it will sometimes even tell us what do we <a href="https://wiki.haskell.org/GHC/Typed_holes">have to write</a>.</p><p>Frame and IO are wrapper types. Most of these wrappers have a function in common, called fmap which basically applies some function that you pass as a parameter to it’s contents. Sounds familiar? List is a wrapper type, and has the map function that applies a function that you pass as a parameter to its contents. It’s exactly the same thing. You can even use fmap on a List:</p><pre>map (+1) [1, 2, 3, 4] == fmap (+1) [1, 2, 3, 4]</pre><p>So in our example, we can now begin to get all the names from our data frame:</p><pre>namesFromFrame :: Frame Sale -&gt; [Text]<br>namesFromFrame saleFrame = <br> saleFrame<br> |&gt; fmap (view nameTemplate)<br> |&gt; Foldable.toList</pre><p>Here we say that namesFromFrame takes a Frame as a parameter and returns a list of Text . We name the first parameter saleFrame .</p><p>Now we take saleFrame and extract nameTemplate from each row, resulting in a Frame Text . After that, we convert it to a [Text] .</p><p>Let’s clean up our names from stopwords and any unnecessary stuff, leaving only the interesting words:</p><pre>cleanNameIntoWords :: [Text] -&gt; [Text] -&gt; Text -&gt; [Text]<br>cleanNameIntoWords languageWords stopWords nameToClean = <br> nameToClean<br> |&gt; Text.toLower<br> |&gt; Text.filter isAlphaOrSeparator<br> |&gt; Text.words<br> |&gt; (\\ stopWords)<br> |&gt; filter (`elem` languageWords)<br> |&gt; filter notSpuriousWord<br>where<br> isAlphaOrSeparator c = isAlpha c || isSeparator<br> notSpuriousWord w = Text.length w &gt; 2</pre><p>cleanNameIntoWords accepts three arguments:</p><ul><li>A list of texts that has all the words in a language</li><li>A list of texts that includes all the stopwords of that language</li><li>The name we want to clean</li></ul><p>After that we apply the following process to the name:</p><ul><li>We make it lowercase</li><li>We leave characters that aren’t spaces or alphanumerics</li><li>We convert it into a list of words</li><li>We remove the stopwords from it. ( \\ means set difference)</li><li>We leave the words that are from that language</li><li>We remove words that have fewer than three characters</li></ul><p>Pretty straightforward, right?</p><p>Now let’s get <strong>all</strong> the vocabulary from the list of those word lists:</p><pre>vocabulary :: [[Text]] -&gt; [Text]<br>vocabulary wordList =<br> wordList<br> |&gt; concat<br> |&gt; nub</pre><p>We take the list of lists, flatten it using concat and remove all duplicate elements using nub .</p><p>Let’s count all of this now:</p><pre>occurrencesOf :: Text -&gt; [Text] -&gt; Int<br>occurrencesOf word txt =<br> txt<br> |&gt; filter (== word)<br> |&gt; length<br> <br>countedVocabulary :: [[Text]] -&gt; [(Text, Int)]<br>countedVocabulary s =<br> vocabulary s<br> |&gt; map appearanceTimes<br> |&gt; sort<br> where<br> appearanceTimes x = (x, occurrencesOf x (concat s))</pre><p>We build a vocabulary from the list of lists and we make each element of that list a tuple, that tells us how many times it appears there as the second element, e.g.: (&quot;Notebook&quot;, 14). Finally, we sort it for convenience.</p><p>In order to get the stopwords and language words we have to load them as lists:</p><pre>fileAsList :: FilePath -&gt; IO [Text]<br>fileAsList path = do<br> fileContents &lt;- Text.readFile path<br> return (Text.words fileContents)</pre><p>Finally we can write our main function so we can execute our code:</p><pre>main :: IO ()<br>main = do<br> salesFrame &lt;- loadSales<br> salesNames &lt;- namesFromFrame<br> stopWords &lt;- fileAsList &quot;resources/stopwords.txt&quot;<br> languageWords &lt;- fileAsList &quot;resources/language-words.txt&quot;<br> let cleanedData = map (cleanNameIntoWords languageWords stopWords) salesNames<br> print (countedVocabulary cleanedData)</pre><p>When executed, will print something like:</p><pre>[ (“notebook”, 15)<br> , (“pen”, 19)<br> , (“shirt”, 44)<br> , …<br> ]</pre><p>We use Haskell because it’s a powerful language, with powerful tools. We know that it is not massively adopted for data science, but we are working hard on it, so it could be a reality soon. If you wanna help on this task, <a href="/service/mailto:hello@theam.io">let’s talk about it.</a></p><p>What we saw here is just a grain of sand in the desert, and Haskell can do much more powerful things. For example, we could make all of our code run in the GPU by making just a few little changes to it (see the <a href="https://github.com/AccelerateHS/accelerate/">Accelerate library</a>). We can use markdown to write our code, like you can do in <a href="http://haskell.do/">Haskell.do</a>, and many more incredible things.</p><p>What we cannot ignore is the fact that functional programming is becoming much more important nowadays, Haskell one of the best of those languages.</p><blockquote>In JavaScript, you feel like an expert, but then, nothing works.<br>In Haskell, you feel like an amateur, but then, everything works.</blockquote><p>Thanks for reading this article — stay tuned for more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b79cea4d0a2d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-theam-journey/simple-data-processing-with-haskell-b79cea4d0a2d">Simple data processing with Haskell</a> was originally published in <a href="https://medium.com/the-theam-journey">The Agile Monkeys’ Journey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lambda World 2016 — My experience]]></title>
            <link>https://medium.com/@nickseagull/lambda-world-2016-my-experience-84550d42c575?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/84550d42c575</guid>
            <category><![CDATA[haskell]]></category>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[emotions]]></category>
            <category><![CDATA[scala]]></category>
            <category><![CDATA[functional-programming]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Thu, 06 Oct 2016 20:01:23 GMT</pubDate>
            <atom:updated>2016-10-08T16:29:39.658Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kTrKPhGFcaYnTDsU5iKPlg.jpeg" /></figure><p>First of all, I’d like to thank the awesome company that I’m working in for making this journey not just a dream, but also a reality. Thank you <strong>Theam.</strong></p><p>A week ago I embarked into one of my most exciting journeys in my life, my first conference. I always have thought: Is it really worth it to go to a conference? Why should I go if all the talks are recorded?</p><p>If you are in the place that I was, let me tell you this from my point of view:</p><p><strong>It is absolutely worth it.</strong></p><p>First of all, you now have the ability to ask questions to the speakers. Ever watched a talk on YouTube and had to Google something after it because you didn’t understand? Now you can ask the speaker directly.</p><p>Second, you get to meet the organizers, which are mostly awesome people. In my case with Lambda World, they were absolutely lovely.</p><p>Third, lastly and most importantly, <strong>you get to know people. </strong>Like a lot of them if you don’t stick to one group. That’s what I did, even though I felt bad sometimes for not sticking to some really nice people.</p><h3>Day 1</h3><p>When I landed in the plane at the Jerez airport I was so excited, but this went further, just when I was going out of the airport to go to the train station I saw Dierk Konig (@mittie ). I couldn’t be that lucky. I had talked with Dierk on Twitter about a project I was doing in Frege some time ago, but I felt so lucky. I approached him and we had this conversation (not literally):</p><ul><li>Hey, do you happen to be you? — I said</li><li>Yes, I am me — he replied</li></ul><p>After that we went to drink some coffee and talked about different topics like Category Theory, Software Craftsmanship and Agile.</p><p>Sadly, our paths split there because we had our seats situated really far one from each other.</p><p>When I was walking through the train searching for my seat, I saw two or three guys with dev-related shirts. “Yes!”, I thought. This was awesome. I even saw a guy with a <strong>Scala </strong>sticker on his laptop, coding in IntelliJ IDEA while in the train. That guy happened to be @olafurpg , also a really nice guy.</p><p>I got off the train when it arrived to Cadiz and met again Dierk and two spanish guys: Fernando Mora (whom I cannot find on Twitter) and Jordi Aranda ( @jordi_aranda ). We thought about going to have dinner together, but I was <strong>SO</strong> tired, so I decided to go to bed really early at 8pm.</p><h3>Day 2</h3><p>I woke up and walked to the congress palace of Cadiz, where the Lambda World. I was early, but still, a lot of people gathered at the entrance. Guys with “Back to the Future[T]” shirts and others with “A monoid in the category of endofunctors” ones. Things were starting to get better.</p><p>We went inside, and had some nice lounge music playing in the background, lots of Lambdas spread through the congress palace. They gave us nice gifts like a shirt, headphones and a “Pito de Carnaval”, a kazoo-like artifact, to produce a similar sound, among other gifts.</p><p>Then, the <strong>TypeLevel Unconference</strong> started. I had no idea what an unconference was, so I sat in my seat (how original, huh?) and I waited for a talk. @noelmarkham presented the unconference and told us that we could talk about whatever we wanted in that lapse of 4 hours (10:00–14:00).</p><p>Well, I had organized @DataHaskell a month ago, and I decided to give this opportunity a try. I inscribed myself into the Google Drive document and started to listen to these awesome micro-talks that were given in the unconference.</p><p>While I was listening, I prepared five or six slides to serve as an accompaniment of the <strong>dataHaskell</strong> story.</p><p>One talk ended, I was the next one.</p><p>I have this ability, that I don’t get nervous before or during an important event such an exam or a talk, but after it. So I went upstairs onto the scene, and started to talk about the birth of dataHaskell and our goals.</p><p>I finished my talk, had one or two questions. And after that I went back to my seat. The breakdown came in, everything went as expected so didn’t go too much nervous.</p><p>After that, I went outside and went for a walk inside the congress palace, just to see how it was. @ChiefScientist approached me:</p><ul><li>Hey, I saw what you were doing about data science and Haskell […] I was thinking about doing a conference about FP+Data Science […] Let’s organize something — he told me. (We are already doing it ;) )</li></ul><p>So we talked for a while, went to have lunch, had some nice time.</p><p>I met the people from @HaskellMAD which are really nice, and one of them happen to be from my homeland, Gran Canaria:</p><ul><li>Wait, I thought you were not spanish. — he told me</li><li>Well, I am</li><li>By your accent, I can infer that you are from the Canary Islands</li><li>Yes I am</li><li>And by your accent again I can also tell that you are from Telde.</li><li>Correct! — I answered</li></ul><p>We both and the HaskellMAD group had a laugh, chatted a bit and left to the workshops.</p><p>After that, went to the workshops, had a nice time, and back to bed.</p><h3>Day 3</h3><p>The third day was completely awesome, took a lot of notes, and gathered a lot of knowledge and opinions.</p><p>I skipped the “Doing data science in Clojure” talk (oh wow!), but this had it’s reasons:</p><ul><li>I have had seen it already on YouTube 5 days ago</li><li>I went to have some coffee with Dierk Konig, the HaskellMAD group and @owickstrom , the creator of Oden Lang, a really nice functional language for the Golang platform.</li></ul><p>After that, Dierk had to leave, I would’ve liked to share some more time with him, because he is an awesome person, but things were like that :)</p><p>We went inside again, and I got to the @aaronmblevin talk about eDSLs, then @cmeik ‘s and went to have some lunch.</p><p>After that, I rushed into @milessabin ‘s talk about TypeLevel, I really wanted to know how it all started, would’ve liked to go to Oskar Wickstrom’s too, but couldn’t split myself and I had to choose :(</p><p>Then, I watched @raichoo ‘s talk, where he showed us how the internals of laziness in Haskell work (he even showed us ASM code!). Had some chat with Pascal Voitot, and after that with Raichoo.</p><p>Then, I went to @bodil ‘s talk, which was a really awesome talk about dogs, I mean, PureScript. It was really exciting to see something like Elm, but in a more minimal way. I’d like to see how it compares to GHCJS!</p><p>Then, the big thing, Philip Wadler’s talk about Category Theory. And, although I have had seen it two times before going to LambdaWorld, I was anxious to see again. Of course, he finished with a LambdaMan ending ;)</p><p>Then, Mark de Jong, Borja o’Cook ( @brocooks ) and I went to have some nice pizza, and headed to the Santa Catalina’s castle, where the party started.</p><p>There was this rock group playing, some awesome groove. Although I didn’t distinguish what their name was, “Vader” or “Failure”, but it does not matter, both of those names are awesome, and they were awesome too!</p><p>I even met another guy from Gran Canaria, who happened to love Haskell too! We talked for a while and thought about organizing a Functional Programming Meetup in LPGC.</p><p>Then, before leaving, I talked with Aaron Levin. A <strong>REALLY</strong> smart and interesting guy, founder of the Weird Canada movement (I think) he gave me a lot of interesting ideas for dataHaskell and FP in general.</p><p>We both headed to our hotels and went to sleep.</p><h3>Day 4</h3><p>After only 3 hours of sleep I woke up, packed my things up and headed to the Cadiz train station.</p><p>In the train I met Olaf again! We had a chat about Scala and Haskell goodnesses and arrived at the airport, where we met Raichoo, Bodil, Aaron, Erik Osheim and two other girls, one of them was the partner of Aaron.</p><p>We talked a bit more, went to the plane (which was a kinda old one) and this moment happened:</p><p>— Is this plane typesafe?</p><p>— No.</p><p>I think that this was one of the most memorable moments, that describes everything in this conference for me:</p><ul><li>Typesafety as in functional programming</li><li>Plane (the noun) as in the journey that was ending by that time</li><li>Plane (the place) as in the place that I met a lot of awesome people, which some of them were with me at that time.</li><li>And <strong>No, </strong>as the answer to the question “Will we never meet again?” or “Is this the last time am I attending to a conference?”</li></ul><p>We arrived at Madrid, took a picture and departed each one of us in different planes.</p><h3>Conclusion</h3><p>This was a really, really, really, really, awesome experience and I hope I meet all these people again, in other FP conferences.</p><p>All the emotions that happened in the short time of two days were enough for me to experiment very strong feelings about all that I’ve learned, everyone whom I met and the Lambda World conference and it’s organizers.</p><p>I am sure that I will be back at a conference, maybe even LambdaWorld 2017. And I’ll try to meet everyone who I met, again, in another time of my life.</p><p>If you are still thinking about if you should go to a conference or not, let me tell you this again. Go ahead, choose one about what you are passionate about, like me with FP, and go, travel, learn and meet. It will be an experience that is impossible to forget.</p><p>P.S.: If I didn’t mention someone here, it is not because they are not important. But because I had a lot to tell and too many emotions in my heart, forgive me :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84550d42c575" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Emacs freezing on Windows using Cask]]></title>
            <link>https://medium.com/@nickseagull/emacs-freezing-on-windows-using-cask-aaf19605567f?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaf19605567f</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[emacs]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Mon, 26 Sep 2016 21:54:26 GMT</pubDate>
            <atom:updated>2016-09-26T21:54:26.228Z</atom:updated>
            <content:encoded><![CDATA[<p>Because of different reasons, I have switched to Windows as my work OS. That is another discussion. The thing is, that I wanted to install Emacs on it and after installing emacs with <strong>chocolatey, </strong>and <strong>git </strong>cloning my dotfiles, and linking the <strong>.emacs.d </strong>into my <strong>%HOME%</strong> directory, and downloading <strong>cask</strong>, and running it on my Emacs folder. I realized that when Cask said that it was done establishing a connection with MELPA, it was lying to me.</p><blockquote>Opening TLS connection to `melpa.org&#39;...done — The biggest lie in history.</blockquote><p>Yep, something fishy was going on. I started searching on Google about this fact and after running cask with --debug I found that the <strong>GNUTLS </strong>library was not installed, neither the <strong>Zlib </strong>one.</p><p>The fix? Download the Zlib binary from <a href="http://www.zlib.net/">http://www.zlib.net/</a> and the GNUTLS binary from <a href="https://sourceforge.net/projects/ezwinports/files/">https://sourceforge.net/projects/ezwinports/files/</a> . Make sure the GNUTLS is downloaded from the <strong>EZWinPorts </strong>repo in SourceForge, not the official GNU one.</p><p>Put them into</p><pre>%HOME%/.cask/bin/</pre><pre>and</pre><pre>/path/to/your/emacs/bin/</pre><p>Now, re-run Cask, it should be fixed!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaf19605567f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use twitter to cultivate knowledge]]></title>
            <link>https://medium.com/@nickseagull/how-to-use-twitter-to-cultivate-knowledge-f48740056b48?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f48740056b48</guid>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[knowledge]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Wed, 03 Aug 2016 13:44:27 GMT</pubDate>
            <atom:updated>2016-08-03T13:56:15.326Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xTJDxicFyHy2ssj1rktl0Q.png" /></figure><p>Sometimes, more than I’d like, I get asked by people:</p><blockquote>How do you get the time to discover all those languages, libraries, paradigms, frameworks? I feel like I’m studying the same thing over and over, but I never get to know new things.</blockquote><p>The answer may sound ridiculous, but it’s <strong>Twitter</strong>.</p><p>Yes, it may sound funny, a social network is my main source of knowledge income. A site where people share gifs, random things,<br>superfluous stories of their day (<em>“Hey, I’m in the toilet now!”</em>), <br>discussing gossip, and sometimes even adult material can bring<br>lots of horizontal (and sometimes even vertical) knowledge.<br>But how?</p><p>A lot of times through our day, we have dead time. While waiting for the bus, while waiting for the doctor, while waiting for…</p><p>Yes, <strong>we wait a lot</strong>, and our main reflex sometimes is opening Facebook and start looking at our timeline, if you are not like that you may frequent a forum. 9gag gets opened up by a lot of people too.</p><p>In these times you cannot open a book to read (well, you can, but your bus could arrive in 2 minutes and you would only have the time to read 2 pages), so <strong>you kill the moment</strong> by entertaining yourself, and not taking advantage of it.</p><p>This moment is perfect to <strong>open up Twitter, and learn new stuff</strong>! There are some tools there to help you, read up:</p><h3>Hashtags</h3><p>Yes, hashtags, that stuff that people do to write <strong>#swag</strong> or <strong>#yolo</strong> (is this still a fad?) or even have topics like <strong>#HappyWednesday</strong>.<br>Hashtags are a really useful tool in Twitter to learn more.</p><p>For instance, suppose that we want to discover things about Machine Learning. Instead of googling directly “Machine Learning news” or a query like that, we can simply go to Twitter and search for <strong>#MachineLearning</strong>.</p><p>Looks like there is a nice post that explains Bayesian Machine Learning by the time that this post is being written:</p><h3>Randy Olson on Twitter</h3><p>Bayesian #MachineLearning, explained. #DataScience http://www.kdnuggets.com/2016/07/bayesian-machine-learning-explained.html ...</p><p>Sometimes you will find more interesting stuff, sometimes less, but in the end, <strong>you will discover lots of stuff</strong>.</p><h3>Digest lists</h3><p>By digest lists, I mean accounts like <a href="http://twitter.com/js_digest">@js_digest</a> or <a href="http://twitter.com/planetclojure">@planetclojure</a>.<br>Accounts that tweet or re-tweet interesting stuff in your field of knowledge desire.</p><h3>Planet Clojure on Twitter</h3><p>Interesting Talk: &quot;Doing data science with Clojure: the ugly, the sad, the joyful,&quot; http://dlvr.it/LxTrDs</p><p>This talk gave me a lot of ideas for my <strong>Data Science learning plan</strong> :-)</p><h3>Reddit Twitter accounts</h3><p>Yes! These exist! <strong>They act like digest lists</strong>, but they connect the Reddit community with Twitter, allowing you to get the information that was being posted on Reddit but in your feed.</p><h3>reddit_haskell on Twitter</h3><p>Concurrent Haskell in the real worldhttp://bit.ly/2auYgvG</p><h3>Last, but not least, other users</h3><p>At some moment of your life, you may have watched a talk about something that you liked. Well, if that’s not the case, don’t despair, using the stuff commented before, you will find some that will be interesting for you.</p><p>But in case that you had, <strong>99% of the time</strong>, the speaker puts it’s Twitter handle on the first or the last slide.</p><p>Go to the profile and check out what it is being tweeted there. Is it interesting for you? Is it about the topics that you like to learn about?</p><p>If the answer is yes, click that <strong>“Follow”</strong> button! If not, just ignore it.</p><p>I tend to use the rule of</p><blockquote>“If the user tweets more about random stuff than ideas that made me be curious, I unfollow that user”</blockquote><h3>Kent Beck on Twitter</h3><p>one rule of software cleanup: if you can&#39;t clean up something big, clean up something small. repeat until action.</p><p>Most of the books that you’ve read have an <strong>author </strong>right? Don’t forget that this author is a person too, and it is really probable that he/she has a Twitter account too, try with them!</p><p>Twitter is a really awesome site, and it is really powerful if used correctly, I hope that this post was helpful or at least interesting read for you.</p><p><strong>Oh, my Twitter handle is </strong><a href="http://twitter.com/CodeSeagull"><strong>@CodeSeagull</strong></a><strong> ;-)</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f48740056b48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up a F# project for Unity3d]]></title>
            <link>https://medium.com/@nickseagull/setting-up-a-f-project-for-unity3d-9f048ba560c8?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f048ba560c8</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[fsharp]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[unity]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Thu, 23 Jun 2016 21:23:25 GMT</pubDate>
            <atom:updated>2016-06-23T21:23:25.521Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Post from January 6th, 2016</em></p><p>After some “depression” with development in general, I finally got my hands back to work and started to tinker with my lovely <strong>F#</strong> again.</p><p><strong>BUT YOU SAID THAT YOU WOULD STAY WITH /insert other language here/ ROAR, BLARGHHGRHAGAHR</strong></p><p>Whatever, I just realized that <strong>Unity3d</strong> is a really cool simulation/presentation tool so I can do <strong>Machine Learning</strong> stuff in there.</p><p><strong>AND NO, I WON’T USE C# BECAUSE I’M A WEIRDO THAT USES FUNCTIONAL LANGUAGES WHENEVER HE IS ALLOWED TO.</strong></p><p><em>…ahem…</em> Let’s begin…</p><h3>Setting up a F# project for using it within Unity</h3><p>Well, the approach here is different than in the “normal” Unity workflow, instead of making a script in Unity and editing in your IDE such as VS or MonoDev, we create the script in the IDE, and then we import it.</p><p>It’s the same process, but just “backwards”, doesn’t seem convenient nor inconvenient to me, but each opinion is different.</p><p>Basically, what we do here, is to compile our project as a library, and assign each class, or <strong>type</strong> in our case as a component to our Unity <strong>GameObjects</strong>.</p><h3>Step One: Create a Unity project</h3><p>We begin by creating a Unity project as we do always, no changes, no anything.</p><h3>Step Two: Create a F# Library project</h3><p>It is very important that in the project creation wizard we select to create a library project as this is the way that we have to “link” our F# project with Unity.</p><p>For the project/solution path we should select the Unity’s project path, and we untick the <strong>Create directory for solution</strong>checkbox. In my case, I named my F# project GameLogic, and my paths are<br>Projects/RollABall<br>Projects/RollABall/GameLogic</p><h3>Step Three: Setting up the project paths and references</h3><p>When we finish creating our project first thing that we should do is to add a reference to the Unity DLLs, we do this (in VS2015) by right clicking on our project -&gt; Properties -&gt; Reference Paths.</p><p>There we add a path that should be like /path/to/Unity/Editor/Data/Managed.<br>There is where all the Unity DLLs are located.</p><p><strong>All but one: UnityEngine.UI.dll</strong></p><p>This one is located at /path/to/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/.<br>I copied all the files related to UnityEngine.UI to the Editor/Data/Managed directory.</p><p>After this, we have to setup our <strong>compilation output path</strong>:<br>We go to the <strong>Build</strong> tab in our project properties, and we set our output path to<br>/path/to/project/Assets/bin.<br>This way, we get our “compiled library” into our Assets folder, ready to be used in Unity.</p><p>After this, don’t forget to add the references in your project to:<br>UnityEngine.dll<br>UnityEngine.UI.dll<br>FSharp.Core.dll</p><p>The CopyLocal property of these references should be set to false except for the FSharp.Core, which should be true so Unity can find the references to the F# functions.</p><h3>Step Four: Begin to work!</h3><p>Now we just have to write some code in a .fs file like this:</p><pre>open UnityEngine</pre><pre>type TestComponent ()=<br>    inherit MonoBehaviour ()</pre><pre>    [&lt;SerializeField&gt;]<br>    let mutable message: string = &quot;Insert message here&quot;</pre><pre>    member this.Start () =<br>        Debug.Log message</pre><p><strong>What’s this SerializeField thing?</strong><br>Well, as we are using a compiled version of our <em>library</em>, we cannot expose the field through a <strong>public</strong> field, but we do it this way.</p><p>So now basically, build your solution, go to your Unity project, and in the Assets/bin folder, you will find a unique file <strong>with an arrow</strong> called like your project, in my case GameLogic. If you click on the arrow, you will find all the types that you defined, as long as they inherit from MonoBehaviour or alike. The problem may be that all of them, even if organized in folders, for which I recommend <strong>F# Power Tools</strong> for VS2015, the type list is <strong>flattened</strong>. But hell, that’s why the <strong>search bar</strong> on the project view is, <strong>use it!!</strong>.</p><p>Now we can take our TestComponent and add it to some game object in our scene, and after running the game we should get the message in our Unity console.</p><p>Have fun!</p><p>You can check an example in <a href="https://github.com/NickSeagull/roll-a-ball">my repo</a> or in <a href="https://github.com/Thorium/Roll-a-ball-FSharp">Thorium’s</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f048ba560c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making minds changed my mind]]></title>
            <link>https://medium.com/@nickseagull/making-minds-changed-my-mind-d9b57ac37580?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9b57ac37580</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Thu, 23 Jun 2016 21:17:27 GMT</pubDate>
            <atom:updated>2016-06-23T21:17:27.695Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Post from November 5th, 2015</em></p><p>Not so long ago, I used to be very skeptic about AI. I didn’t like the fact that to make an algorithm think, you had to impose to it a set of rules.</p><p>For me, that wasn’t thinking, for me, that was something a bit better than a <strong>HashMap</strong> with the conditions and callbacks.</p><p><strong>I didn’t like Artificial Intelligence.</strong> (<em>Oh my gawd!</em>)</p><p>I was really into <strong>Audio Synthesis/Processing</strong>, I’m a musician, and working with code that makes the things that I like was a really appealing idea to me.</p><p>But one day, <strong>everything changed</strong>…</p><p>I met <strong>Cayetano Guerra</strong>, my AI teacher at <strong>ULPGC</strong>, and he made me have an epiphany.</p><p>Suddenly, every bad thought that I had about AI has disappeared, and made me love AI the most, to the point that I <strong>dropped</strong>the thought about working with Audio and made me want to dedicate myself full time to AI.</p><p>He introduced me to <strong>Deep Learning</strong>, and Machine Learning in general.</p><p>My idea of making an heuristic for an AI just <em>poofed</em>. I wanted to <strong>know</strong> and <strong>work</strong> more with these awesome technologies.<strong>Even better</strong>, while most of my classroom was doing heuristics for a <strong>Chain-Four</strong> game, I started to tinker with my first neural network for generating a text. I felt the same emotions as when I was 12 and discovered programming.</p><p>Machine Learning is one of the most amazing fields in <strong>CS</strong>.</p><p>Now I’m expanding my “toolbox”. I’m learning more techniques like <strong>Genetic Algorithms</strong>. And I’m really looking forward to do something with reinforced learning like <strong>Q-Learning</strong>.</p><p>If someday you feel like you are (insert bad qualificator here) because you don’t like anything and you are just looking how your life goes by, maybe it’s just a matter of meeting new people. :)</p><p>And you, have you made a new mind today?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9b57ac37580" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I always come back to emacs]]></title>
            <link>https://medium.com/@nickseagull/why-i-always-come-back-to-emacs-db10cfdc7d1e?source=rss-cdcf295a7ff0------2</link>
            <guid isPermaLink="false">https://medium.com/p/db10cfdc7d1e</guid>
            <category><![CDATA[text-editor]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[emacs]]></category>
            <category><![CDATA[ide]]></category>
            <category><![CDATA[zencoding]]></category>
            <dc:creator><![CDATA[Nick Tchayka]]></dc:creator>
            <pubDate>Thu, 23 Jun 2016 21:15:36 GMT</pubDate>
            <atom:updated>2016-06-23T21:15:36.424Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Post from October 1st, 2015</em></p><p>There’s this discussion I always have with my friend about text editors, IDEs and productivity.</p><p>He is a really big lover of JetBrains’ IntelliJ IDEA, and don’t get me wrong, I think it is a really great IDE, but it still doesn’t feel to me the same way that it feels to him.</p><p>I keep using IntelliJ IDEA from time to time, for bigger or smaller periods, but still, I cannot say: <strong>This is my IDE, my home</strong>.</p><p>It’s simply impossible to me to think about all the overhead it introduces to my <strong>development flow</strong>.</p><p>An IDE is a tool that helps you to be more productive within a range of other toolsets and automate your process during your development time. Isn’t then <strong>emacs</strong> an IDE?</p><p>Of course it requires some configuration, maybe more, maybe less, depending on what you want to do. But the same is appliable to a “<em>formal</em>” IDE like IntelliJ.</p><p><strong>Why do you say that Nick? I can download IntelliJ and start coding in <em>Python</em> or <em>Java</em> right away! I don’t need to configure anything</strong></p><p>Of course, because the IDE already has been configured for that matter.</p><p>But try to code in <strong>Haskell</strong> using IntelliJ, I did it some days ago, and trust me, it is not a pleasurable experience. I lost like an entire hour trying to fix the interoperation between IntelliJ and Haskell’s toolset (cabal, ghc-mod, …).</p><p>In fact, I can download an <strong>emacs ditribution</strong> and start coding <em>X</em> language right away. Yes, yes, I know, I don’t have the interoperation between the IDE and the toolsets (or yes? See: <a href="http://batsov.com/prelude/">emacs prelude</a>), but once you configure it, it’s simply done forever!.</p><p><strong>“But, Nick, if you configure it in IntelliJ it’s done forever too!”</strong></p><p>Yes, you may be right, but there’s also the time factor. I lost one hour of work simply searching for how to make IntelliJ understand my project dependencies, and I ended up doing an awful <strong>symbolic link</strong> from Haskell’s compiler to <strong>/usr</strong>. Modifying my system so my IDE can understand a thing? <em>No, thanks</em></p><p>Yes, maybe I could have the same dependency-understanding problem with <strong>emacs</strong>, but there are more chances that a lot more users had the problem and fixed it, or even better, wrote a plugin for it, or pushed some commits to the plugin that generated this problem.</p><p>Why?<br>Emacs is open source and has a really big and <strong>active</strong> community.</p><p><strong>“Ok, Nick, but I don’t program in Haskell, I use IntelliJ for Java and Ruby (i.e.)!”</strong></p><p>And you should keep using it if you are really comfortable using it.</p><p>Meanwhile I will be at my <strong>home</strong>, emacs, being as productive as you are, but if there is a feature that there is not available to me through the default settings, I’ll install a plugin, or if it is still really weird that no one did it, I’ll write it by myself in 5 minutes or less using <strong>elisp</strong> instead of saying, <strong>“Damn, I hope they implement this in the next version”</strong>. Maybe you are already used to not wishing for features. But I do.</p><p>Another important thing is, I can use a <strong>CVS</strong> like <strong>git</strong> to manage all my configuration and reuse it everywhere I want.</p><p>Long live home sweet home, <strong>emacs</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db10cfdc7d1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>