<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Renata</title>
    <description>The latest articles on DEV Community by Renata (@renata_curiosum).</description>
    <link>https://dev.to/renata_curiosum</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F888463%2Fe3049417-e214-4087-9973-ff8b6ac22196.png</url>
      <title>DEV Community: Renata</title>
      <link>https://dev.to/renata_curiosum</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/renata_curiosum"/>
    <language>en</language>
    <item>
      <title>How to change column to nullable with modify in Ecto migration?</title>
      <dc:creator>Renata</dc:creator>
      <pubDate>Wed, 13 Jul 2022 05:57:12 +0000</pubDate>
      <link>https://dev.to/renata_curiosum/how-to-change-column-to-nullable-with-modify-in-ecto-migration-33b7</link>
      <guid>https://dev.to/renata_curiosum/how-to-change-column-to-nullable-with-modify-in-ecto-migration-33b7</guid>
      <description>&lt;p&gt;Sooner or later you'll have to change the null constraint in one of your DB relations. How to do it easily in Ecto?&lt;/p&gt;

&lt;p&gt;Although I came across many different examples where a raw SQL has been used to perform this type of operation in Ecto, it's actually super easy to do it with &lt;a href="https://hexdocs.pm/ecto_sql/Ecto.Migration.html#modify/3"&gt;modify/3&lt;/a&gt; function.&lt;/p&gt;

&lt;p&gt;Let's assume that your migration looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:blog_posts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null:&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
  &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="ss"&gt;:intro&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null:&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
  &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="ss"&gt;:body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;null:&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
  &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="ss"&gt;:category_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;references&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:blog_categories&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;on_delete:&lt;/span&gt; &lt;span class="ss"&gt;:delete_all&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://curiosum.com/til/change-column-to-nullable-ecto-migration"&gt;Read more...&lt;/a&gt;&lt;/p&gt;

</description>
      <category>elixir</category>
      <category>beginners</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to create and use custom shell commands?</title>
      <dc:creator>Renata</dc:creator>
      <pubDate>Mon, 11 Jul 2022 19:45:26 +0000</pubDate>
      <link>https://dev.to/renata_curiosum/how-to-create-and-use-custom-shell-commands-1pbg</link>
      <guid>https://dev.to/renata_curiosum/how-to-create-and-use-custom-shell-commands-1pbg</guid>
      <description>&lt;p&gt;Each of us had a situation, where we had to invoke a few, same commands each time. Making it once is not that problematic, but when we are supposed to repeat given operations, it may be better just to create one function that will handle it all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create own functions
&lt;/h2&gt;

&lt;p&gt;To create our own functions, firstly we need to open a new terminal. By default, we ought to be in the root directory (~), but to be sure you can execute the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and hit enter.&lt;/p&gt;

&lt;p&gt;Right now, we can create a new file, in which we will store our function with commands. To do it, execute this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch&lt;/span&gt; .custom_bash_commands.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The naming convention is up to you, in this case, the file will be named &lt;code&gt;.custom_bash_commands.sh&lt;/code&gt; , where &lt;code&gt;'.'&lt;/code&gt; at the beginning means it is a hidden file. To see all of the hidden and visible files, you can just do &lt;code&gt;ls -a&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Once we have created the file, we can open it. To do so, you can use VIM or your favorite text editor. I will be using Visual Studio Code. For that, I will execute the following command in my current directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;open &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="s1"&gt;'Visual Studio Code'&lt;/span&gt; .custom_bash_commands.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we can create our function by following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="k"&gt;function &lt;/span&gt;mix_all&lt;span class="o"&gt;(){&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"mix format"&lt;/span&gt;
  mix format
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"mix static.credo"&lt;/span&gt;
  mix static.credo
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"mix dialyzer"&lt;/span&gt;
  mix dialyzer
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"mix test"&lt;/span&gt;
  mix &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first line is just a convention, which is used while creating Scripts. Next, we have function declaration, which is called &lt;code&gt;mix_all&lt;/code&gt; .&lt;/p&gt;

&lt;p&gt;We use &lt;code&gt;echo&lt;/code&gt; command to print out the following state. Of course, this is just a sample function, you can use whatever you want to up here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://curiosum.com/til/create-and-use-custom-shell-commands"&gt;Read more...&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>news</category>
    </item>
    <item>
      <title>How to Create Neural Network in Elixir Using Nx and Axon?</title>
      <dc:creator>Renata</dc:creator>
      <pubDate>Thu, 07 Jul 2022 08:57:22 +0000</pubDate>
      <link>https://dev.to/renata_curiosum/how-to-create-neural-network-in-elixir-using-nx-and-axon-ikd</link>
      <guid>https://dev.to/renata_curiosum/how-to-create-neural-network-in-elixir-using-nx-and-axon-ikd</guid>
      <description>&lt;p&gt;Neural networks mirror the behaviour of the human brain, enabling computer programmes to recognise patterns and solve common problems in the fields of artificial intelligence, machine learning and deep learning.&lt;/p&gt;

&lt;p&gt;Nowadays neural networks are used frequently for various tasks such as text translation, face identification, recognising speech or handwritten text, control robots and autonomous vehicles, image recognition, image classification and many more.&lt;/p&gt;

&lt;p&gt;If neural networks are becoming so popular it would be good to create them in an easy way and the Axon library which is built on top of Nx allow to do that in Elixir.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://curiosum.com/blog/how-create-neural-network-elixir-nx-axon"&gt;Read more&lt;/a&gt;&lt;/p&gt;

</description>
      <category>elixir</category>
      <category>todayilearned</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
