<?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 María Inés Parnisari on Medium]]></title>
        <description><![CDATA[Stories by María Inés Parnisari on Medium]]></description>
        <link>https://medium.com/@mparnisari?source=rss-df391aa55bc7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9pUICwAjJyOY8ENL.</url>
            <title>Stories by María Inés Parnisari on Medium</title>
            <link>https://medium.com/@mparnisari?source=rss-df391aa55bc7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:50:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mparnisari/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[From zero to hero: contributing to open source]]></title>
            <link>https://medium.com/@mparnisari/from-zero-to-hero-contributing-to-open-source-4bfb6d29a9ea?source=rss-df391aa55bc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bfb6d29a9ea</guid>
            <category><![CDATA[contributor]]></category>
            <category><![CDATA[pull-request]]></category>
            <category><![CDATA[cognitive-computing]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[María Inés Parnisari]]></dc:creator>
            <pubDate>Tue, 31 Oct 2017 15:00:27 GMT</pubDate>
            <atom:updated>2017-11-13T20:14:34.407Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you ever get the feeling that you are always a consumer and never a contributor to a library? Would you like to get more involved in open source projects and don’t know how? This is the story on how I personally became involved and went from fixing a simple bug to becoming the main contributor of a Node.js library.</p><p>It all began a couple of months ago. Microsoft offers a set of APIs called “cognitive services” for doing cool things like <a href="https://azure.microsoft.com/en-us/services/cognitive-services/face/">detecting faces in an image</a>, <a href="https://azure.microsoft.com/en-us/services/cognitive-services/speech/">converting spoken audio to text</a>, <a href="https://azure.microsoft.com/en-us/services/cognitive-services/recommendations/">recommending items to users based on past purchases</a>, and many more. I was updating the part of the Azure website that has demos on each of these services. I had no idea these services existed before then, but they seemed to be on the road to become increasingly popular.</p><p>And I was not wrong. StackOverflow soon had tags for the topic: first <a href="https://stackoverflow.com/questions/tagged/project-oxford"><strong>project-oxford</strong></a> (the original name of the project), then <a href="https://stackoverflow.com/questions/tagged/microsoft-cognitive"><strong>microsoft-cognitive</strong></a>, then <a href="https://stackoverflow.com/questions/tagged/azure-cognitive-services">azure-cognitive-services</a>…</p><p>One day I was casually browsing the site when I came across <a href="https://stackoverflow.com/questions/44027325/microsoft-cognitive-services-example-in-javascript">this</a> question: someone was using an <a href="https://github.com/joshbalfour/node-cognitive-services">NPM module</a> called <strong>cognitive-services</strong> which was a wrapper over Microsoft’s APIs, and was getting a 404 error when attempting to call a service.</p><p>I skimmed over the library and while it seemed to look useful, it definitely could use some work. I saw duplicate code and, what’s most important, <strong>no tests</strong>.</p><p>But back to the original StackOverflow question: since I knew a bit about the topic, <strong>I decided to help out</strong>. I cloned the library to my machine, tweaked a bit the user’s question and <strong>created a Mocha test</strong>.</p><pre>const cognitiveServices = require(&#39;../index&#39;); <br>const assert = require(&#39;assert&#39;);</pre><pre>describe(&#39;OCR&#39;, () =&gt; { <br>   it(&#39;should work&#39;, done =&gt; {<br>      const computerVision = cognitiveServices.computerVision({<br>         API_KEY: &quot;YAY MY OWN KEY!&quot; <br>      }); <br>     const parameters = { &quot;language&quot;: &quot;unk&quot;, &quot;detectOrientation&quot;: &quot;true&quot;, &quot;content-type&quot;: &quot;application/json&quot; }; <br>     const body = { <br>         url: &quot;https://upload.wikimedia.org/wikipedia/commons/2/23/Space_Needle_2011-07-04.jpg&quot; <br>     }; </pre><pre>     computerVision.ocr({ parameters, body }) <br>     .then(response =&gt; { <br>         assert(response !== undefined); <br>         done(); }) <br>     .catch(err =&gt; { <br>         done(err); <br>     }); <br>   }) <br>})</pre><p>And then I just ran the test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*DsZxZ_Y3s6ZpKRvR." /></figure><p>Yep, the bug was there. I looked over the <a href="https://github.com/joshbalfour/node-cognitive-services/issues">Issues</a> page of the library, and it turns out that someone had already figured out the problem (or most of it): Microsoft had deprecated some endpoints, but <strong>the code hadn’t been updated</strong>. So whenever the code said “ai.projectoxford.com”, it had to be replaced with “westus.api.cognitive.microsoft.com”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*LIw6L1VYowvc1Zfp." /></figure><p>“Well”, I thought, “this is an easy change. Just update the production endpoint”.</p><p>And that’s what I did. Except that the code still did not work. I added a <strong>console.log</strong> of the URI the module was talking to… But wait, why is part of the URI “<strong>undefined</strong>“?</p><p>Let’s get into debug mode. The library is using this little <strong>makeRequest</strong> function to actually do the HTTP call. So why is this <strong>uriTemplate</strong> variable used but not set anywhere?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*t2wD3icTn4WTGoiB." /></figure><p>Let’s dive in now. Every function this Node module exposes defines an “operation” object with useful data like the query parameters it accepts, the headers it accepts, and so on. But they don’t have a “uriTemplate” parameter, they have a “path” parameter. Let’s change that!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*j8_QyYxdyiu_9cuj." /></figure><p>This should work now, right?</p><p>Nope. We have to dig deeper, but I sense that we are close. Let’s look at the code that verifies the parameters and does the request.</p><p>Is there something wrong here? Yes! <strong>makeRequest</strong> returns a <strong>Promise</strong> object, but are we doing anything with it? No, there is a <strong>return</strong> statement missing. Let’s fix that.</p><p>Hooray! The test now passes!</p><p>At that point, I was happy. With these code changes I would be able to submit a pull request, get it merged, and then be able to reply to the person “Your question allowed me to contribute to open source and get something fixed!”</p><p>But then I glanced again at the “Open issues” page and realized… this project is <em>filled</em> with errors! 404 errors, syntax errors (!)…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*FAsZZH9tGTtnGgXa." /></figure><p>Well, that’s when I got excited. The problems seemed easily solvable and would require some moderate amount of work. This was the exact combination I was looking for, so I went ahead and created <a href="https://github.com/joshbalfour/node-cognitive-services/pull/13">an enormous pull request</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*3p0Mp8AQ9TVsEqv8." /></figure><p>When that got merged, suprise! I was made a <strong>project contributor.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*MsXCzBTJ5Eyhx8Gg." /></figure><p>Now I felt even more excited. I could push fixes and refactors without having to wait for someone to code review them. I of course wouldn’t write any code without supporting tests, so I went ahead and created API keys of my own for all the services, and wrote integration tests using those keys. The end result was a bunch of commits which brought the <strong>code coverage to 80%</strong>.</p><p>And I was even more happy when I looked at <a href="https://codetabs.com/github-stars/github-star-history.html">the star history</a> of the repository! There was a steady growth ever since I pushed my first commit: the project’s stargazers went from 45 to 66 in less than two months.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*WduXeeQEwn3lX-b3." /></figure><p>Why was I happy? Simple: people were actually using the library! And also, I was actually able to detect a few bugs in the API itself and <a href="https://cognitive.uservoice.com/users/391424773-mar%C3%ADa-in%C3%A9s-parnisari">report them to the core team</a>.</p><p>Isn’t this what coding is all about? Quick iterations of development and lots of feedback in between? That’s what makes coding exciting.</p><p>So, now that you have read my story, I invite you to contribute to open source! There surely is a library you use every day that you can contribute to. Remember that no contribution is too small: even updates to documentation can make a big impact.</p><p>If you are feeling adventurous, you can always go the extra mile. Go ahead and <a href="https://stackexchange.com/filters">subscribe to the StackOverflow tags you feel know best</a>, and answer the questions for those tags. Maybe one day you’ll become such an expert on the subject that you’ll be ranked as a top answerer for the tag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*vI0mvoEpQx9FXwbb." /></figure><p>And if you still don’t know where to start… <a href="https://github.com/joshbalfour/node-cognitive-services/issues"><strong>PRs are welcome at cognitive-services</strong></a> 🙂</p><p><em>Originally published at </em><a href="https://miparnisariblog.wordpress.com/2017/10/31/contributing-to-open-source/"><em>miparnisariblog.wordpress.com</em></a><em> on October 31, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bfb6d29a9ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up an Ubuntu VM under Vagrant with MySQL, Node and Redis]]></title>
            <link>https://medium.com/@mparnisari/setting-up-an-ubuntu-vm-under-vagrant-with-mysql-node-and-redis-4b556b330eaa?source=rss-df391aa55bc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b556b330eaa</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[vagrant]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[María Inés Parnisari]]></dc:creator>
            <pubDate>Mon, 05 Sep 2016 04:24:00 GMT</pubDate>
            <atom:updated>2016-09-05T20:19:38.452Z</atom:updated>
            <content:encoded><![CDATA[<p>For my daily development work I use a virtual machine running <strong>Ubuntu 14.04</strong>, <strong>MySQL 5.7</strong>, <strong>Node 4.5.0</strong> and <strong>Redis 3.2</strong>. On it, I start all the backend processes of our app, and everything client-side and all the debugging happens on my Windows 10 host. Since my host machine will soon require a reformat, I decided to automate the process of setting everything up.</p><p>First of all you need to download <a href="https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5.msi">Vagrant 1.8.5</a> and <a href="http://download.virtualbox.org/virtualbox/5.0.10/VirtualBox-5.0.10-104061-Win.exe">VirtualBox 5.0.10</a> (you could also choose another provider, but I go with VirtualBox). Then create a folder and a file inside of it called <strong>Vagrantfile, </strong>which specifies how your VM will be set up. In my case I used the Vagrantfile shown below. This sets up some initial configs (like the machine’s name, whether it will check for updates on startup, the amount of RAM, etc.). It will also forward ports so that I can debug everything in my host machine. Finally, it synchronises the source code’s folder in my host with my VM, so that whenever I change a file on my IDE the VM will pick it up immediately. The base box is <a href="https://atlas.hashicorp.com/ubuntu/boxes/trusty64"><strong>ubuntu/trusty64</strong></a>, which is the official Ubuntu box and it comes with nothing on it.</p><pre>Vagrant.configure(2) do |config| <br>config.vm.box = &quot;ubuntu/trusty64&quot; <br>config.vm.box_check_update = false <br>config.vm.hostname = &quot;dev&quot; <br>config.vm.boot_timeout = 600 <br># internet <br>config.vm.network :forwarded_port, guest: 8080, host: 8080 <br># node debugging with VS Code <br>config.vm.network :forwarded_port, host: 5858, guest: 5858 <br># mysql config.vm.network :forwarded_port, guest: 3306, host: 3306 <br>config.vm.synced_folder &quot;C:/Users/miparnisari/Documents/dev&quot;, &quot;/home/dev&quot; <br>config.vm.provider &quot;virtualbox&quot; do |vb| <br>   vb.gui = false <br>   vb.memory = &quot;3072&quot; <br>end <br>config.vm.provision &quot;shell&quot;, path: &quot;bootstrap.sh&quot; <br>end</pre><p>Notice the line that says config.vm.provision “shell”, path: “bootstrap.sh”. This is the script that runs the first time the VM is created.</p><p>The following is only the beginning of the output of running <strong>vagrant up</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*5cNYoDbiQzs5qora." /></figure><p>What comes next is long, so I will only outline what it does:</p><ul><li>Configure the VM’s timezone to UTC-3</li><li>Install MySQL 5.5 and then update it to 5.7. It’s user is ‘root’ and its password is also ‘root’.</li><li>Install Node from source (I tried installing it through sudo apt-get install nodejs but it installed an old version).</li><li>Install Redis from source.</li><li>Configure Redis to run <strong>redis-server</strong> on startup in port 6379.</li><li>Do a global installation of some node modules (like <strong>mocha</strong>, <strong>gulp</strong> and <strong>pm2</strong>).</li></ul><pre># configure timezone<br>echo &quot;America/Argentina/Buenos_Aires&quot; &gt; /etc/timezone<br>dpkg-reconfigure -f noninteractive tzdata</pre><pre># install tools<br>echo &quot;Installing wget, build-essential and g++...&quot;<br>sudo apt-get install -y -qq wget build-essential g++</pre><pre>echo &quot;Updating packages...&quot;<br>sudo apt-get -y -qq update</pre><pre># set &#39;root&#39; as password for mysql<br>sudo debconf-set-selections &lt;&lt;&lt; &#39;mysql-server mysql-server/root_password password root&#39;<br>sudo debconf-set-selections &lt;&lt;&lt; &#39;mysql-server mysql-server/root_password_again password root&#39;</pre><pre># install mysql 5.5<br>echo &quot;Installing mysql 5.5...&quot;<br>sudo apt-get install -y -qq mysql-server mysql-client</pre><pre># update mysql to 5.7<br>echo &quot;Purging mysql...&quot;<br>sudo /etc/init.d/mysql stop<br>sudo apt-get -y -qq purge mysql* &gt;/dev/null<br>sudo apt-get -y -qq autoremove &gt;/dev/null<br>sudo apt-get -y -qq autoclean &gt;/dev/null<br>echo &quot;Updating mysql to 5.7...&quot;<br>sudo debconf-set-selections &lt;&lt;&lt; &#39;mysql-apt-config mysql-apt-config/repo-codename select trusty&#39;<br>sudo debconf-set-selections &lt;&lt;&lt; &#39;mysql-apt-config mysql-apt-config/repo-distro select ubuntu&#39;<br>sudo debconf-set-selections &lt;&lt;&lt; &#39;mysql-apt-config mysql-apt-config/repo-url string <a href="http://repo.mysql.com/apt/&#39;">http://repo.mysql.com/apt/&#39;</a><br>sudo debconf-set-selections &lt;&lt;&lt; &#39;mysql-apt-config mysql-apt-config/select-server select mysql-5.7&#39;<br>sudo debconf-set-selections &lt;&lt;&lt; &#39;mysql-apt-config mysql-apt-config/select-preview select Disabled&#39;<br>sudo debconf-set-selections &lt;&lt;&lt; &#39;mysql-apt-config mysql-apt-config/select-tools select Disabled&#39;<br>sudo debconf-set-selections &lt;&lt;&lt; &#39;mysql-apt-config mysql-apt-config/select-product select Ok&#39;<br>wget -q <a href="http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb">http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb</a><br>sudo DEBIAN_FRONTEND=noninteractive dpkg -i mysql-apt-config_0.7.3-1_all.deb<br>sudo apt-get -qq update<br>sudo debconf-set-selections &lt;&lt;&lt; &quot;mysql-community-server mysql-community-server/data-dir select &#39;&#39;&quot;<br>sudo debconf-set-selections &lt;&lt;&lt; &quot;mysql-community-server mysql-community-server/root-pass password root&quot;<br>sudo debconf-set-selections &lt;&lt;&lt; &quot;mysql-community-server mysql-community-server/re-root-pass password root&quot;<br>sudo apt-get install -y -qq mysql-server mysql-client</pre><pre># install node from source<br>echo &quot;Downloading and installing node 4.5.0 ...&quot;<br>cd /usr/local/src<br>wget -q <a href="https://nodejs.org/dist/v4.5.0/node-v4.5.0.tar.gz">https://nodejs.org/dist/v4.5.0/node-v4.5.0.tar.gz</a><br>tar -xzf node-v4.5.0.tar.gz<br>cd node-v4.5.0<br>./configure<br>make -j8 &gt;/dev/null # parallel build<br>sudo make install &gt;/dev/null<br>sudo npm install -g --silent npm</pre><pre># install redis from source<br>echo &quot;Downloading and installing redis ...&quot;<br>wget -q <a href="http://download.redis.io/redis-stable.tar.gz">http://download.redis.io/redis-stable.tar.gz</a><br>tar -xzf redis-stable.tar.gz<br>cd redis-stable<br>make -j8 &gt;/dev/null # parallel build<br>sudo make install &gt;/dev/null<br>echo -n | sudo utils/install_server.sh # non-interactive, use defaults</pre><pre># install important node packages<br>echo &quot;Installing node packages nodemon, pm2, mocha, apidoc, bunyan, gulp ...&quot;<br>sudo npm install -g --silent nodemon pm2 mocha apidoc bunyan gulp</pre><pre># mysql configuration <br>echo &quot;Restarting MySQL ...&quot;<br>sudo mysql_upgrade -uroot -proot<br>sudo service mysql restart<br>echo &quot;Creating chip database ...&quot;<br>echo &quot;DROP DATABASE IF EXISTS chip&quot; | mysql -uroot -proot<br>echo &quot;CREATE USER &#39;chipuser&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;chipchip&#39;&quot; | mysql -uroot -proot<br>echo &quot;CREATE DATABASE chip&quot; | mysql -uroot -proot<br>echo &quot;GRANT ALL ON chip.* TO &#39;chipuser&#39;@&#39;localhost&#39;&quot; | mysql -uroot -proot<br>echo &quot;FLUSH PRIVILEGES&quot; | mysql -uroot -proot</pre><pre>echo &quot;Done!&quot;<br>echo &quot;MySQL version: &quot; `mysql --version`<br>echo &quot;Node version: &quot; `node -v`<br>echo &quot;Redis version: &quot; `redis-server --version`</pre><p>I have to admit that I spent many hours writing this script. There were many errors with the MySQL installation, mostly related to the fact that when you run sudo apt-get install mysql-server it will install MySQL 5.5, and we have to update it manually. Also, when you do so, there are a few prompts we have to get rid of if we want to automate the process. That’s what <strong>debconf-set-selections </strong>is for.</p><p>Now when you run this script, the most important lines for you to look after are the last three. If everything went well you should see something like this:</p><pre>==&gt; default: Done! <br>==&gt; default: MySQL version: mysql Ver 14.14 Distrib 5.7.14, for Linux (x86_64) using EditLine wrapper <br>==&gt; default: Node version: v4.5.0 <br>==&gt; default: Redis version: Redis server v=3.2.3 sha=00000000:0 malloc=jemalloc-4.0.3 bits=64 build=99280e39f402326f</pre><p>If you want to be even more sure that everything’s set up correctly, you can run vagrant ssh to ssh into the VM, and then run the following:</p><pre>vagrant@dev:~$ redis-cli <br>127.0.0.1:6379&gt; <br>vagrant@dev:~$ mysql -uroot -proot mysql: <br>[Warning] Using a password on the command line interface can be insecure. <br>Welcome to the MySQL monitor. Commands end with ; or \g. <br>Your MySQL connection id is 7 <br>Server version: 5.7.14 MySQL Community Server (GPL) </pre><pre>(blah blah blah...) </pre><pre>mysql&gt;</pre><p>Since we got the prompts both for Redis and MySQL, we’re good to continue. All that’s left to do is to make sure that we can access this MySQL instance from outside the VM. The SQL client I use on Windows is <a href="https://dev.mysql.com/downloads/workbench/">MySQL Workbench 6.3</a>. So I created a new connection with the following settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*GYdzlU0YnSSENl3R." /></figure><p>It’s very important that the boxes outlined with red say exactly what they show on the picture. The SSH key file configured must be the same one used by VirtualBox. So if your Vagrantfile resides in a folder called VM, the path to the SSH key will be</p><pre>VM\.vagrant\machines\default\virtualbox\private_key</pre><p>Also, know that the default username and password for Vagrant boxes are both ‘vagrant’.</p><p>When I clicked on <strong>Test connection</strong> I got the following warning:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/0*qIE77zTn4eglAqVj." /></figure><p>This just means that Workbench sees this as a new connection. I go ahead and click <strong>Continue</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/0*a7zss9aEit3XKmEC." /></figure><p>Success! The beauty of all of this is that its a fully automated, repeatable process. I only wish I had the time to improve the bash script to make it even more quiet, and to make the passwords and Node versions configurable.</p><h3>Like this:</h3><p>Like Loading…</p><p><em>Originally published at </em><a href="https://miparnisariblog.wordpress.com/2016/09/05/setting-up-an-ubuntu-vm-under-vagrant-with-mysql-node-and-redis/"><em>miparnisariblog.wordpress.com</em></a><em> on September 5, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b556b330eaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>