<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Elixir on almost done</title><link>https://nietaki.com/tags/elixir/</link><description>Recent content in Elixir on almost done</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>hello@nietaki.com (nietaki)</managingEditor><webMaster>hello@nietaki.com (nietaki)</webMaster><lastBuildDate>Fri, 21 Apr 2023 13:00:00 +0000</lastBuildDate><atom:link href="https://nietaki.com/tags/elixir/index.xml" rel="self" type="application/rss+xml"/><item><title>Elixir string operations seem slow (and why it's a good thing)</title><link>https://nietaki.com/2023/04/21/elixir-string-operations-seem-slow-and-why-its-a-good-thing/</link><pubDate>Fri, 21 Apr 2023 13:00:00 +0000</pubDate><author>hello@nietaki.com (nietaki)</author><guid>https://nietaki.com/2023/04/21/elixir-string-operations-seem-slow-and-why-its-a-good-thing/</guid><description>&lt;p&gt;I personally hate it when people post clickbait titles and take their sweet time getting to the point, so let&amp;rsquo;s do this first:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: Some Elixir string operations, most notably &lt;a href="https://hexdocs.pm/elixir/String.html#at/2" target="_blank" rel="noreferrer"&gt;&lt;code&gt;String.at/2&lt;/code&gt;&lt;/a&gt; work in &lt;a href="https://en.wikipedia.org/wiki/Time_complexity#Linear_time" target="_blank" rel="noreferrer"&gt;linear time&lt;/a&gt;,
as opposed to &lt;a href="https://en.wikipedia.org/wiki/Time_complexity#Linear_time" target="_blank" rel="noreferrer"&gt;constant time&lt;/a&gt;, like the intuition might suggest. This is because the &lt;code&gt;String&lt;/code&gt; module is UTF-8 aware.
UTF-8 encodes characters outside of ASCII with more than one byte, so in order to find the n-th character in a string you need to process it from the beginning, you can&amp;rsquo;t just use an offset in memory.&lt;/p&gt;</description></item><item><title>How to use data spanning multiple data sources in Elixir</title><link>https://nietaki.com/2020/02/02/how-to-use-data-spanning-multiple-data-sources-in-elixir/</link><pubDate>Sun, 02 Feb 2020 15:00:00 +0000</pubDate><author>hello@nietaki.com (nietaki)</author><guid>https://nietaki.com/2020/02/02/how-to-use-data-spanning-multiple-data-sources-in-elixir/</guid><description>&lt;p&gt;&lt;em&gt;Below is a reprint of the &lt;a href="https://medium.com/rekkiapp/how-to-use-data-spanning-multiple-data-sources-in-elixir-50f39c87d8fc" target="_blank" rel="noreferrer"&gt;article&lt;/a&gt; I wrote for the &lt;a href="https://rekki.com/" target="_blank" rel="noreferrer"&gt;Rekki&lt;/a&gt; Medium page.&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;a href="http://www.rekki.com/" target="_blank" rel="noreferrer"&gt;REKKI&lt;/a&gt; builds tools that help people along the restaurant supply chain do their jobs better.&lt;/p&gt;
&lt;p&gt;We have a free mobile app that lets restaurants order and chat with suppliers, and a web-based tool for suppliers that helps them process orders, manage product codes and catalogues, and communicate more easily with their customers. The majority of REKKI’s backend is written in Elixir, working hand in hand with services written in Go and Node. The Elixir services handle most of what the user sees in the app like the real-time communication with the supplier and the status of the orders.&lt;/p&gt;</description></item><item><title>Trust issues: trouble in package paradise - Code BEAM STO 2019 talk</title><link>https://nietaki.com/2019/09/01/trust-issues-code-beam-sto-talk/</link><pubDate>Sun, 01 Sep 2019 15:21:00 +0000</pubDate><author>hello@nietaki.com (nietaki)</author><guid>https://nietaki.com/2019/09/01/trust-issues-code-beam-sto-talk/</guid><description>&lt;p&gt;Earlier this year I gave a talk at &lt;a href="https://codesync.global/conferences/code-beam-sto-2019/" target="_blank" rel="noreferrer"&gt;Code BEAM STO&lt;/a&gt; about a proposed solution to the ever more real risk of hidden malicious code in our library dependencies. You can watch the whole thing here:&lt;/p&gt;
&lt;iframe width="640" height="360" src="//www.youtube.com/embed/ejAY6yWXZSc" frameborder="0" allowfullscreen&gt; &lt;/iframe&gt;
&lt;p&gt;UPDATE: I have since dropped active development of the Hoplon project, but I hope something like it will become reality when the tech community is ready for it :)&lt;/p&gt;</description></item><item><title>String&amp;#x200B;.to_existing_atom&amp;#x200B;/1 is a double-edged sword</title><link>https://nietaki.com/2018/12/04/string-to-existing-atom-is-a-double-edged-sword/</link><pubDate>Tue, 04 Dec 2018 13:21:00 +0000</pubDate><author>hello@nietaki.com (nietaki)</author><guid>https://nietaki.com/2018/12/04/string-to-existing-atom-is-a-double-edged-sword/</guid><description>&lt;p&gt;I&amp;rsquo;d argue Elixir has relatively few gotchas. It&amp;rsquo;s a simple and consistent language
and when you first learn it there&amp;rsquo;s only a few things that are genuinely counter-intuitive
and catch you by surprise.&lt;/p&gt;
&lt;p&gt;One of the examples could be the difference between
&lt;a href="https://elixir-lang.org/getting-started/binaries-strings-and-char-lists.html" target="_blank" rel="noreferrer"&gt;binaries and charlists&lt;/a&gt;
and why iex sometimes seems to do weird things to your lists:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-elixir" data-lang="elixir"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;119&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;116&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;119&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;116&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;drop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;119&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;116&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;drop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;119&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;116&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;drop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s1"&gt;&amp;#39;wat&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;One of the other ones comes when you start working with atoms and get a
little too trigger-happy with them. What you could hear from your more experienced
teammates is something like this:&lt;/p&gt;</description></item><item><title>I'm stealing API keys from your site</title><link>https://nietaki.com/2018/12/02/i-am-stealing-api-keys-from-your-site/</link><pubDate>Sun, 02 Dec 2018 18:00:00 +0000</pubDate><author>hello@nietaki.com (nietaki)</author><guid>https://nietaki.com/2018/12/02/i-am-stealing-api-keys-from-your-site/</guid><description>&lt;p&gt;Earlier this year I presented my latest project - Hoplon - at the London
Elixir meetup. I&amp;rsquo;m thinking of putting some more work into it over Christmas,
so I figured I might gather the materials about it in one place:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nietaki/hoplon" target="_blank" rel="noreferrer"&gt;Hoplon&lt;/a&gt; is an Elixir developer tool that helps
you validate your dependencies contain no
hidden malicious code. Motivated by horror stories from the JavaScript community
such as &lt;a href="https://hackernoon.com/im-harvesting-credit-card-numbers-and-passwords-from-your-site-here-s-how-9a8cb347c5b5" target="_blank" rel="noreferrer"&gt;this hypothetical one&lt;/a&gt;
and &lt;a href="https://github.com/dominictarr/event-stream/issues/116" target="_blank" rel="noreferrer"&gt;this very real one&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Introducing Rexbug - tracing on the shoulders of giants</title><link>https://nietaki.com/2018/01/10/introducing-rexbug/</link><pubDate>Wed, 10 Jan 2018 02:00:00 +0000</pubDate><author>hello@nietaki.com (nietaki)</author><guid>https://nietaki.com/2018/01/10/introducing-rexbug/</guid><description>&lt;p&gt;Towards the end of November I gave a flash talk at the
&lt;a href="https://www.meetup.com/Elixir-London/" target="_blank" rel="noreferrer"&gt;London Elixir Meetup&lt;/a&gt;.
This time I was talking about the journey from &lt;code&gt;println&lt;/code&gt; debugging to
proper tracing and bringing Erlang tools to Elixir programmers.&lt;/p&gt;
&lt;p&gt;You can watch the talk here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://skillsmatter.com/skillscasts/11258-tracing-on-the-shoulders-of-giants" target="_blank" rel="noreferrer"&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="auto"
 alt="talk thumbnail"
 width="2140"
 height="1202"
 src="https://nietaki.com/img/rexbug-talk_hu_8d9043aa447ac3d6.png"
 srcset="https://nietaki.com/img/rexbug-talk_hu_8d9043aa447ac3d6.png 800w, https://nietaki.com/img/rexbug-talk_hu_3789ffd09fe5f2fd.png 1280w"
 sizes="(min-width: 768px) 50vw, 65vw"
 data-zoom-src="https://nietaki.com/img/rexbug-talk.png"&gt;&lt;/figure&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;hellip;and here are &lt;a href="http://slides.com/nietaki/tracing-on-the-shoulders-of-giants" target="_blank" rel="noreferrer"&gt;the slides&lt;/a&gt;:&lt;/p&gt;
&lt;iframe src="//slides.com/nietaki/tracing-on-the-shoulders-of-giants/embed?style=light" width="576" height="420" scrolling="no" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;
&lt;p&gt;The resulting &lt;a href="https://github.com/nietaki/rexbug" target="_blank" rel="noreferrer"&gt;Rexbug&lt;/a&gt; project is ready to
be used but there&amp;rsquo;s still some &lt;a href="https://github.com/nietaki/rexbug/issues" target="_blank" rel="noreferrer"&gt;issues&lt;/a&gt;
I could use some help on - some should even be suitable for Elixir beginners.&lt;/p&gt;</description></item><item><title>Crawlie - Elixir London Meetup presentation</title><link>https://nietaki.com/2017/07/09/crawlie-lessons-learned-about-gen-stage-and-flow/</link><pubDate>Sun, 09 Jul 2017 02:00:00 +0000</pubDate><author>hello@nietaki.com (nietaki)</author><guid>https://nietaki.com/2017/07/09/crawlie-lessons-learned-about-gen-stage-and-flow/</guid><description>&lt;p&gt;Last year, I saw José Valim give his keynote at the &lt;a href="http://www.elixirlive.com/" target="_blank" rel="noreferrer"&gt;ElixirLive conference&lt;/a&gt; in Warsaw, where he talked about
the motivation for his new Elixir libraries: &lt;a href="https://github.com/elixir-lang/gen_stage" target="_blank" rel="noreferrer"&gt;GenStage&lt;/a&gt; and &lt;a href="https://github.com/elixir-lang/flow" target="_blank" rel="noreferrer"&gt;Flow&lt;/a&gt;.
Even though I heard about those before, it was the keynote when I &amp;ldquo;got&amp;rdquo; what the libraries were good for
and why they were neat - and I decided to play around with them.&lt;/p&gt;</description></item><item><title>Atom as an elixir IDE</title><link>https://nietaki.com/2016/11/14/atom-as-an-elixir-ide/</link><pubDate>Mon, 14 Nov 2016 20:58:00 +0000</pubDate><author>hello@nietaki.com (nietaki)</author><guid>https://nietaki.com/2016/11/14/atom-as-an-elixir-ide/</guid><description>&lt;h5 class="relative group"&gt;July 2019 update:
 &lt;div id="july-2019-update" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#july-2019-update" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h5&gt;
&lt;p&gt;I have since moved to &lt;a href="https://neovim.io/" target="_blank" rel="noreferrer"&gt;neovim&lt;/a&gt; for all my Linux/OSX work, and I&amp;rsquo;m very happy with it. The information here is probably very outdated, but I&amp;rsquo;m leaving it here for posterity&lt;/p&gt;
&lt;p&gt;You can see my neovim configuration &lt;a href="https://github.com/nietaki/dotfiles/blob/master/home/.config/nvim/" target="_blank" rel="noreferrer"&gt;in my dotfiles&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Earlier this year I joined &lt;a href="https://mainframe.com/" target="_blank" rel="noreferrer"&gt;Mainframe&lt;/a&gt; as a backend engineer. I didn&amp;rsquo;t do any real
development in &lt;a href="http://elixir-lang.org/" target="_blank" rel="noreferrer"&gt;elixir&lt;/a&gt; before and I wanted to become
productive with it ASAP. When it comes to elixir there were
&lt;a href="http://amzn.to/2fr9dRw" target="_blank" rel="noreferrer"&gt;some&lt;/a&gt;
&lt;a href="http://amzn.to/2fr6lUq" target="_blank" rel="noreferrer"&gt;good&lt;/a&gt;
&lt;a href="http://amzn.to/2fr9ML1" target="_blank" rel="noreferrer"&gt;books&lt;/a&gt; to help me understand it better, but I also needed an
editor or and IDE that would give me the necessary tools without getting in my way.&lt;/p&gt;</description></item></channel></rss>