<?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 Alessandra Vertrees on Medium]]></title>
        <description><![CDATA[Stories by Alessandra Vertrees on Medium]]></description>
        <link>https://medium.com/@alessandravertrees?source=rss-5aeaa7e33b3b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*w611LB_addCD7Vm9.jpg</url>
            <title>Stories by Alessandra Vertrees on Medium</title>
            <link>https://medium.com/@alessandravertrees?source=rss-5aeaa7e33b3b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 15:07:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alessandravertrees/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[Validating ISBN10 Values in Ruby]]></title>
            <link>https://medium.com/@alessandravertrees/validating-isbn10-values-in-ruby-79234979cfe0?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/79234979cfe0</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Mon, 06 Jan 2020 03:11:54 GMT</pubDate>
            <atom:updated>2020-01-06T03:11:54.134Z</atom:updated>
            <content:encoded><![CDATA[<p>A valid ISBN10 number is nine digits followed by a check digit. The value of the first nine digits is evaluated by first multiplying each individual digit by its weight (10 minus its index in the ISBN string), and then by calculating the sum. The value of the check digit is either a digit (0–9) or the character X (roman numeral for 10). A valid ISBN is one where the product of the sum and the check digit is a multiple of 11.</p><p>Here’s a snippet of the code I wrote to validate ISBN10 strings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*RpvDnlPsYV8hVpkGUiQQeA.png" /><figcaption>ruby code</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79234979cfe0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Memes of the Decade]]></title>
            <link>https://medium.com/@alessandravertrees/memes-of-the-decade-bd4f41108fca?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd4f41108fca</guid>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Mon, 30 Dec 2019 01:18:00 GMT</pubDate>
            <atom:updated>2019-12-30T01:18:00.225Z</atom:updated>
            <content:encoded><![CDATA[<h4>2010</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FOYpwAtnywTk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOYpwAtnywTk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FOYpwAtnywTk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/860bc6a2e3646f144fa5c42ba8f5f638/href">https://medium.com/media/860bc6a2e3646f144fa5c42ba8f5f638/href</a></iframe><h4>2011</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQH2-TGUlwu4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQH2-TGUlwu4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQH2-TGUlwu4%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5213c17c908c5daff3266da7886f520e/href">https://medium.com/media/5213c17c908c5daff3266da7886f520e/href</a></iframe><h4>2012</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tUA4jAbVz2DiJxVW.jpg" /><figcaption>Grumpy Cat (rip)</figcaption></figure><h4>2013</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*0zgyOS1bNZrrfiBw.jpg" /><figcaption>so wow, much Shiba</figcaption></figure><h4>2014</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*PvrVGxuWeYzwLDxO.png" /><figcaption>kerm</figcaption></figure><h4>2015</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FRspfpv1Rop50k%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FRspfpv1Rop50k%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FRspfpv1Rop50k%2Fgiphy-downsized-large.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/65094e6a4915be735d88fe0876dbc520/href">https://medium.com/media/65094e6a4915be735d88fe0876dbc520/href</a></iframe><h4>2016</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/0*F2kEaZEu-Il9Sy5L" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/0*mVFVycsoLyoVNP3b" /></figure><h4>2017</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_Q62H_FXqQgLjhw-.jpg" /></figure><h4>2018</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*bi89K9Dumt-a7aTp.jpg" /><figcaption>lamp</figcaption></figure><h4>2019</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/0*WwfiXAr3XzEHUh_P" /><figcaption>woman yelling at cat meme</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd4f41108fca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cookies & Algorithms]]></title>
            <link>https://medium.com/@alessandravertrees/cookies-algorithms-19c494e3c6e?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/19c494e3c6e</guid>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Sun, 22 Dec 2019 13:51:53 GMT</pubDate>
            <atom:updated>2019-12-22T13:51:53.926Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FkI5yy4lcwnACQ%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FkI5yy4lcwnACQ%2Fsource.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FkI5yy4lcwnACQ%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="297" frameborder="0" scrolling="no"><a href="https://medium.com/media/853b3db0a7282d2f507fb8eead117e67/href">https://medium.com/media/853b3db0a7282d2f507fb8eead117e67/href</a></iframe><p>In the spirit of the holiday season, I have a sudden urge to bake a ton of cookies. Reaching a total of six batches of cookies, my mind has been taken over by thoughts of baking. My favorite thought running through my mind at the moment is actually a question — is there a connection between my passions for baking and programming/technology?</p><p>I’ve seen several examples of baking-related algorithms, but the similarities go deeper than just a recipe and instructions. If we look at cookie dough as a program — the recipe and instructions are the inputs of the program, the algorithm is the chemical reaction that happens in the oven, and the output is the baked cookie.</p><p>One of the reasons I love to bake is because of the chemistry of it. Understanding why a recipe calls for certain ingredients at specific amounts is a very important step in learning how to bake. If the cookies you made come out flat and crispy, the butter-to-flour ratio is in favor of butter. The chemical process of baking is objective, however the outcome is a reflection of the inputs.</p><p>When I’m programming, I’m basically doing the same thing — designing the algorithm (or the chemical reaction), the process of using provided inputs and using them to create the desired output. With the recent increased focus on studying the ethics of algorithms, thinking about coding as baking is especially useful in understanding how algorithms can be biased.</p><p>We, as human beings, are really bad at knowing or understanding specifically what we want — which means we are really bad at providing specific inputs to get there. As we know, computers are really, really good at following instructions-they don’t have a mind of their own. Problems arise when humans write programs without being utterly specific or without understanding how the inputs and outputs are related to each other.</p><p>With both baking and programming, the errors that arise when the inputs aren’t precise are almost undetectable at a small scale. It’s totally fine to use volume to measure ingredients unless the recipe is super sensitive. Flour, for instance, settles differently each time it is measured, so each ‘cup’ varies in mass each time. However, the range of error in the mass of one cup of flour won’t be detectable. Similarly, when we test algorithms with small data sets and use cases, the range of error is basically undetectable.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FhpfInSxkkLdpS%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FhpfInSxkkLdpS%2Fsource.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FhpfInSxkkLdpS%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c9dfe151ad7f22c4f5845975379b335/href">https://medium.com/media/5c9dfe151ad7f22c4f5845975379b335/href</a></iframe><p>The issue here is that using volume to measure dry ingredients and small datasets to train/test algorithms is not replicable or scalable. If you make a match of cookies 100 times the size of the recipe, the margin of error also multiplies by 100. The chemical reaction doesn’t know what to do other than, well, react. The algorithm needs a precise amount, not a precise volume, so if there’s too much flour or too much butter — the output changes. This is why the most precise baking is done in grams, not cups.</p><p>Similarly, if an algorithm is written for small amounts or biased data sets, the outcome will reflect the inputs it was given. The difference between baking and algorithms is that the errors in baking are more obvious than they are for code. You know when a cookie recipe went wrong — but we don’t know when a predictive policing algorithm is biased.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19c494e3c6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Var, Let, and Const]]></title>
            <link>https://medium.com/@alessandravertrees/var-let-and-const-2feed03692f8?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2feed03692f8</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Mon, 16 Dec 2019 02:51:53 GMT</pubDate>
            <atom:updated>2019-12-22T12:38:24.021Z</atom:updated>
            <content:encoded><![CDATA[<p>It wasn’t until recently that I understood how important it is to truly understand the nuances of ES6. Basically, I realized this after several interviewers asked me essentially the same question: What is the difference between let, const, and var?</p><h4>Variables</h4><p>A variable is a container for storing data. At a higher level, a variable stores data in a memory location, which can be referenced or altered in the program. In previous versions of JavaScript, variable declarations in JavaScript were made using ‘var’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*Y6H-tUjaVE8MMBVFzKpdjQ.png" /><figcaption>variable declaration &amp; assignment in JavaScript</figcaption></figure><p>The image above is an example of a variable named ‘itsWednesdayMyDudes’ being declared. The container has been created — the memory has been allocated, but the value of ‘itsWednesdayMyDudes’ is ‘undefined’. In the following lines, the value is assigned to 0.4, and then “hello”, and then 1/5 (0.5). JavaScript, like some other high-level languages, does not care about the type of data is being stored in a variable (unlike C++).</p><h4>Hoisting</h4><blockquote>Declarations are hoisted, assignments are not.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*LrIsmmOiNm0cK7Q4pX9XiQ.png" /><figcaption>Hoisting example from MDN — src: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Hoisting">https://developer.mozilla.org/en-US/docs/Glossary/Hoisting</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*UCEu-42HR1618X239dRYoA.png" /><figcaption>Hoisting example from MDN — src: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Hoisting">https://developer.mozilla.org/en-US/docs/Glossary/Hoisting</a></figcaption></figure><p>According to the MDN definition of hoisting, “conceptually…a strict definition of hoisting suggests that variable and function declarations are physically moved to the top of your code, but this is not in fact what happens. Instead, the variable and function declarations are put into memory during the <em>compile</em> phase, but stay exactly where you typed them in your code” — (<a href="https://developer.mozilla.org/en-US/docs/Glossary/Hoisting">https://developer.mozilla.org/en-US/docs/Glossary/Hoisting</a>).</p><p>The concept of hoisting is important when thinking about the scope, or the visibility and accessibility of a variable/expression, of your variables. The concept of understanding hoisting as physically moving code to the top is useful, though it is not accurate. I read left to right, top to bottom — that’s also how most code is compiled. Physically organizing your code to have the declarations at the top and the assignments at the bottom is a useful way to understand what you have access too in a program.</p><p>I like to think about how this concept relates to other programming languages. For example, while programming in C++, I remember writing having to declare all functions and global variables at the top of the file so that the computer knew where things were in memory first before altering it or using it. Again, a physical movement of code, but the compilers for C++ and Javascript work differently.</p><p>The principal of hoisting is solidified in the examples above. Remembering that declarations are moved to the top of a block, the first example basically compiles as :</p><p>var num; console.log(num)//undefined; num = 6</p><p>var num; num=6; console.log(num) //6</p><h3>Var, Let, and Const</h3><p>With the release of ES6 in 2016, variable declarations can be made with these three words: ‘var’, ‘let’ and ‘const’.</p><h4>Var</h4><blockquote>“var declarations, wherever they occur, are processed before any code is executed. This is called hoisting, and is discussed further below” (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var</a>).</blockquote><p>This means is that var can be used before it is assigned a value. It also means that the variable is accessible in a larger scope, making it a non-block-level variable.</p><h4>let</h4><blockquote>“<strong>let</strong> allows you to declare variables that are limited to a scope of a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/statements/block">block</a> statement, or expression on which it is used, unlike the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/statements/var">var</a> keyword, which defines a variable globally, or locally to an entire function regardless of block scope. The other difference between <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/statements/var">var</a> and let is that the latter is initialized to a value only when a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Temporal_dead_zone">parser evaluates it (see below)</a>”(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let</a>)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*2LpxJzDLgIPu2rX1FdgwkQ.png" /><figcaption>Var vs. Let src: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let</a></figcaption></figure><p>Let is a block scope variable, which means that the value and visibility of a variable can be accessed only from within the block it is declared. If the second declaration of x was not there, “let x = 2”, the value would be 1. This is preferable for programming.</p><p><strong>Const</strong></p><blockquote>“Constants are block-scoped, much like variables defined using the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let">let</a> statement. The value of a constant can&#39;t be changed through reassignment, and it can&#39;t be redeclared” (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const</a>)</blockquote><p>Const stands for constant, like a constant in math or science equations. They are used to represent variables that stand for one thing. Since they are not dynamic, they cannot be changed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2feed03692f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Takeaways from the WWCode Connect Conference]]></title>
            <link>https://medium.com/@alessandravertrees/takeaways-from-the-wwcode-connect-conference-556b8f3500bb?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/556b8f3500bb</guid>
            <category><![CDATA[women-in-tech]]></category>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Sun, 08 Dec 2019 23:26:49 GMT</pubDate>
            <atom:updated>2019-12-08T23:26:49.627Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3oKIPnAiaMCws8nOsE%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3oKIPnAiaMCws8nOsE%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3oKIPnAiaMCws8nOsE%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="456" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f93074b49925362899227ba1890eed1/href">https://medium.com/media/4f93074b49925362899227ba1890eed1/href</a></iframe><p>Last week was the WWCode Connect conference in New York City. WWCode is a nonprofit that provides services for women pursuing careers in technology all over the world. As a woman in tech looking to kick off her career, I was interested in attending the conference to meet more women in the industry, network, and hear the stories and experiences of other women in the industry.</p><p>The conference included various talks and workshops about ethical algorithms, machine learning, accessibility, blockchain, and a panel discussion on leadership in the industry. While I loved learning how React Native and Android can be friends and how to create cryptographic tokens for smart contracts, I was surprised by how much I enjoyed being in a space with other female developers.</p><p>A few days after the conference I realized how my confidence had improved and how much more comfortable I was with my technical abilities. As developer with an unconventional background in algorithmic media who recently completed a software engineering bootcamp, it is easy for my brain to trick me into thinking that I am not good enough. Being in a room with other female developers made me feel like I belong.</p><p>The importance of representation is the biggest takeaway from the conference. I was in the same room with women who have worked at NASA. Women who found a love for data science through politics made me realize that I am not alone. Women who didn’t feel worthy enough to apply for a position at a large tech company so their boyfriend applied for them. The stories I heard throughout the day stuck with me, and they had a significant impact.</p><p>The day after the conference I was more motivated than I had been in weeks. I submitted a dozen job applications, opened my Python IDLE for the first time in a year, and was inspired to move forward with my job search. My stomach and head felt better than it had in weeks. The response was psycho-physical, it was emotional, and it was necessary. As I move forward with my software engineering journey, I look forward to attending more of these events in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=556b8f3500bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Towers of Hanoi]]></title>
            <link>https://medium.com/@alessandravertrees/towers-of-hanoi-247d39a5d1f?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/247d39a5d1f</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Sun, 01 Dec 2019 22:32:48 GMT</pubDate>
            <atom:updated>2019-12-01T22:32:48.382Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FAdRoBFh7YZEI%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FAdRoBFh7YZEI%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FAdRoBFh7YZEI%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/399d2435298b3ada4170835bbdd89960/href">https://medium.com/media/399d2435298b3ada4170835bbdd89960/href</a></iframe><p>The Towers of Hanoi is a popular math puzzle that is used to demonstrate the applications of recursion.</p><p>The object of the game is to move a stack of discs from one rod to another. The rules of the games go as follows:</p><ol><li>one disk can be moved at a time</li><li>each move takes the top disk from one stack (or rod) and places that disk on top of another stack or an empty rod.</li><li>A disk can only be placed on a disk that is larger than it.<br>(more information can be found on the Wikipedia page- <a href="https://en.wikipedia.org/wiki/Tower_of_Hanoi">https://en.wikipedia.org/wiki/Tower_of_Hanoi</a>)</li></ol><p>Consider the array A whose value is [3,2,1] and we want to move that stack to array C.</p><p>step 1. Move the top disk from rod A to rod C</p><p>A = [3,2] B =[] C = [1]</p><p>step 2. Move the top disk from rod A to rod B</p><p>A = [3] B =[2] C = [1]</p><p>step 3. Move the top disk from rod C to rod B</p><p>A = [3] B =[2,1] C = []</p><p>step 4. Move the top disk from rod A to rod C</p><p>A = [] B =[2,1] C = [3]</p><p>step 5. Move the top disk from rod B to rod A</p><p>A = [1] B =[2] C = [3]</p><p>step 6. Move the top disk from rod B to rod C</p><p>A = [1] B =[] C = [3,2]</p><p>step 7. Move the top disk from rod A to rod C</p><p>A = [] B =[] C = [3,2,1]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*vpy-kS2ymVuHq_ZNhn-tfQ.png" /><figcaption>code for towers of hanoi</figcaption></figure><p>Now let’s replace “rod X” with “source,” “target,” or “auxiliary”.</p><p>Source — rod A</p><p>Target — rod C</p><p>Auxiliary — rod B</p><p>step 1. Move the top disk from “source” to “target”</p><p>A = [3,2] B =[] C = [1]</p><p>step 2. Move the top disk from “source” to “auxiliary”</p><p>A = [3] B =[2] C = [1]</p><p>step 3. Move the top disk from “target” to “auxiliary”</p><p>A = [3] B =[2,1] C = []</p><p>step 4. Move the top disk from “source” to “target”</p><p>A = [] B =[2,1] C = [3]</p><p>step 5. Move the top disk from “auxiliary” to “source”</p><p>A = [1] B =[2] C = [3]</p><p>step 6. Move the top disk from “auxiliary” to “target”</p><p>A = [1] B =[] C = [3,2]</p><p>step 7. Move the top disk from “source” to “target”</p><p>A = [] B =[] C = [3,2,1]</p><p>To understand how this code runs on a computer, let’s look at the console logs in repl.it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*iMfHAkdNgEvn4TorinkcoA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=247d39a5d1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Recursion Examples Pt. 1]]></title>
            <link>https://medium.com/@alessandravertrees/common-recursion-examples-in-technical-interviews-7c877f0f331d?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c877f0f331d</guid>
            <category><![CDATA[recursion]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Sun, 24 Nov 2019 16:42:45 GMT</pubDate>
            <atom:updated>2019-11-24T19:19:04.525Z</atom:updated>
            <content:encoded><![CDATA[<p>Recursion by definition is a function that calls itself and is perhaps one of the most feared concepts of programming. It is confusing, not used often in the real world, and it is not very efficient — so why bother taking the time to learn it? Well, according to Cracking the Coding Interview, recursion is one of the <strong>core</strong> concepts of programming. This means that software engineers in the middle of their job search could be asked about recursion in their technical interviews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gYVf7uqFWdja6ceO4il-Q.png" /><figcaption>Cracking the Coding Interview, 6th edition, p 61</figcaption></figure><p>Recursion was heavily focused on during one of my computer science courses at Hunter College, so I have had some experience with it in the past. I find these problems interesting because they come up a lot in fractal geometry and chaos theory — simple yet complicated generative/programmable media motifs that are fascinating to look at.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FAdRoBFh7YZEI%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FAdRoBFh7YZEI%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FAdRoBFh7YZEI%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/399d2435298b3ada4170835bbdd89960/href">https://medium.com/media/399d2435298b3ada4170835bbdd89960/href</a></iframe><p>That being said — I am no pro at recursion, but I do see a value in learning it as it from a computer science and software engineering perspective. This blog is dedicated to recursion examples that I have encountered that I believe could be useful in preparing for technical interviews.</p><p>I am starting with two examples for now — both from previous computer science assignments/labs. I plan to write more blogs on recursion over time, the next one covering Towers of Hanoi and Fibannoci.</p><h3>Problem #One — Population Growth.</h3><blockquote>Initially (at hour 0), there are 48 bacteria in a test tube, and the number doubles each hour. Additionally, ‘num’ bacteria are added each hour. Write a function that returns the number of bacteria at hour ‘h’, using the prototype “numbac(h, num)”.</blockquote><blockquote>For example: <br>numbac(0,0)=48<br>numbac(1,0)=96<br>numbac(2,0)=192</blockquote><blockquote>numbac(0,5)=48<br>numbac(1,5)=101<br>numbac(2,5)=207</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FkNhC5VxNjPbvq%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FkNhC5VxNjPbvq%2Fsource.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FkNhC5VxNjPbvq%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="509" frameborder="0" scrolling="no"><a href="https://medium.com/media/2368cedf9d29ba4e949d5c5c6c512047/href">https://medium.com/media/2368cedf9d29ba4e949d5c5c6c512047/href</a></iframe><blockquote>Tip: Recursive functions need to know when to stop calling themselves, so they need a conditional (typically an if-else or if-else if-else). Step number one is always to identify the base case (when the function stops calling itself) and recursive case(s) for every recursive problem before solving it.</blockquote><h4>What we know from the question.</h4><p>Must I emphasize — read the question first before looking at the examples!!!</p><ol><li>this function named ‘numbac(h, num)’ represents the number of bacteria</li><li>at hour (h) 0, there are 48 bacteria</li><li>the number of bacteria doubles<strong> <em>each hour</em></strong></li><li>‘num’ bacteria are added <strong><em>each hour</em></strong></li></ol><p>From the question, we know that ‘h’ is an integer, ‘h’ ≥ 0, and our <strong>base case </strong>is “when h = 0, return 48,” thus, our <strong>recursive case </strong>will subtract 1 from ‘h’ until ‘h’ = 0. <strong>Each hour where ‘h’ &gt; 0</strong> represents<strong> </strong>our <strong>recursive case</strong>, or the statement where we actually <strong>call the function within the function</strong>. In the recursive case, we need to double the number of bacteria and add the value of ‘num’ to the<em> number of bacteria</em>. So we can deduce a base case and recursive case as follows:</p><h4>ok…slow down. What did that say?</h4><p><em>“we know that ‘h’ is an integer, ‘h’ ≥ 0, and our </em><strong><em>base case </em></strong><em>is “when h = 0, return 48,” ”</em> — if h = 0, return 48, else return the value of the <strong>recursive case.</strong></p><blockquote>Recursive case at the moment: numbac(h,num)</blockquote><p>“our <strong>recursive case </strong>will subtract 1 from ‘h’ until ‘h’ = 0.” — usually, when we iterate through an array or some other data structure, we start at 0 and increase the value until we reach the value of ’n’, or in this case ‘h.’ Since our goal value is 0, we will be starting with a value greater than 0 and will need to decrease the value until we reach zero.</p><blockquote>Recursive case at the moment: numbac(h-1,num)</blockquote><p><em>“double the </em><strong><em>number of bacteria</em></strong><em>” — </em>from the question, we know that<em> </em>this function named ‘numbac(h, num)’ represents the number of bacteria.</p><blockquote>Recursive case at the moment: 2*numbac(h-1,num)</blockquote><p>“add the value of ‘num’ to the<em> number of bacteria” — </em>add num to the number of bacteria</p><blockquote>Recursive case at the moment: num + numbac(h-1,num)</blockquote><p>Finally, we have:</p><p><strong>Base case</strong>: h = 0<br><strong>Recursive case:</strong> num + 2 * numbac(h-1,num)</p><p>Here is the code run in repl.it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NtE8ULOpnA1lz-R-oBUbqA.png" /><figcaption>Recursion example #1 in repl.it</figcaption></figure><h3>Problem #Two — Remove all instances of a character from a string.</h3><blockquote>Write a function that returns a string with each instance of an argument character removed, using the prototype “rem(s, c)”.</blockquote><blockquote>For example:<br>rem(‘abcd’, ‘a’) = ‘bcd’<br>rem(‘adobe’, ‘d’) = ‘aobe’<br>rem(‘adobe’, ‘D’) = ‘adobe’<br>rem(‘abcd’, ‘a’) = ‘bcd’<br>rem(‘Bookkeeper’, ‘e’) = ‘bookkpr’</blockquote><h4>What we know from the question.</h4><p>Not a whole lot…so what can we deduce?</p><ol><li>this function ‘rem(s, c)’ represents a string with characters removed</li><li>we need to compare the individual characters in string ‘s’ to the character ‘c’</li><li>if s[i] = c, remove it</li><li>since we are comparing characters, we need another if-else condition in the recursive function</li></ol><h4>Identify the base and recursive cases.</h4><p>We want to write a recursive function that goes through each character in a string, compares that character to the argument ‘c’, and removes that character if they are the same.</p><p><em>Let’s try substrings.</em></p><blockquote>example: rem(‘abcd’, ‘a’) = ‘bcd’</blockquote><p>Here’s why: think about this example above. rem(‘abcd’, ‘a’) = ‘bcd’…we could do this by just removing the first character right? The result being a substring of the original - and the function to remove the first character would return <em>s.substring(1)</em>.</p><p>So, in the context of this recursive function, we can see that <em>if s[0]=c, return s.substring(1)</em>.</p><p>Since <em>s.substring(1)</em> removes one character from the string ‘s’, our <strong>base case </strong>would be <strong><em>s.length = 0</em></strong> and we<strong><em> </em></strong>will want to return an empty string<em>.</em></p><blockquote>Recursive case at the moment: <em>if s[0]=c, return </em>rem(s,c), else…</blockquote><p>In our recursive case, we have already determined that the substring is <em>s.substring(1).</em></p><blockquote>Recursive case at the moment:<em>if s[0]=c, return </em>rem(<em>s.substring(1)</em>,c), else…</blockquote><p>Great, now we have an empty else statement. What should happen if s[0] != c? We know ‘rem(s, c)’ represents a string with characters removed, so if s[0] != c it should be added to the recursive case!</p><blockquote>Recursive case at the moment:<em>if s[0]=c, return </em>rem(<em>s.substring(1)</em>,c), else return s[0] + rem(s.substring(1),c)</blockquote><p>Finally, we have:</p><p><strong>Base case</strong>: s.length == 0<br><strong>Recursive case</strong>: if s[0] = c return rem(s.substring(1),c) else return s[0] + rem(s.substring(1),c)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jOccmevfkIXjXv6ikcG1WQ.png" /><figcaption>Recursion example #2 in repl.it</figcaption></figure><p>Voila!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c877f0f331d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 PRINT CHR$(205.5+RND(1)); : GOTO 10]]></title>
            <link>https://medium.com/@alessandravertrees/10-print-chr-205-5-rnd-1-goto-10-bf21acd329ab?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf21acd329ab</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[generative-art]]></category>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Thu, 03 Oct 2019 13:55:32 GMT</pubDate>
            <atom:updated>2019-10-03T13:55:32.317Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>10 PRINT CHR$(205.5+RND(1)); : GOTO 10</strong></h3><p>This blog is about a book that I read when I was in undergrad. To this day, ‘10 Print’ is still the most fascinating book that I have read about code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Falessandragenevie%2Fembed%2Fpreview%2FMWWgyZL%3Fheight%3D600%26slug-hash%3DMWWgyZL%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2Falessandragenevie%2Fpen%2FMWWgyZL&amp;image=https%3A%2F%2Fscreenshot.codepen.io%2F1185666.MWWgyZL.small.8a177dfc-8ac2-4ac1-9fd2-12ce9b782423.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/58a1eb57a3ab4f01f0ab5027af20f54e/href">https://medium.com/media/58a1eb57a3ab4f01f0ab5027af20f54e/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*naaRsZHQ4wBfvHeZGzcXxA.png" /><figcaption>10 Print code. source: 10 PRINT CHR$(205.5+RND(1)); : GOTO 10, p. 2</figcaption></figure><blockquote>“This book takes a single line of code — the extremely concise BASIC program for the Commodore 64 inscribed in the title — and uses it as a lens through which to consider the phenomenon of creative computing and the way computer programs exist in culture.” <a href="http://10print.org/">http://10print.org/</a></blockquote><p>We, as beginning software developers, use code to communicate with a computer. We read code as an algorithm — a list of instructions and conditions for the computer to follow, and when we read code we do so to try to understand what a program is telling the computer to do so we can modify it.</p><p>But what if we read code to understand social and cultural nuances? What if we read code to understand how humans understand the world?</p><p>We can begin answering this question by looking at<strong> 10 PRINT CHR$(205.5+RND(1)); : GOTO 10, </strong>which was written by <em>Nick Montfort, Patsy Baudoin, John Bell, Ian Bogost, Jeremy Douglass, Mark C. Marino, Michael Mateas, Casey Reas, Mark Sample, and Noah Vawter.</em> Yeah, you aren’t seeing things. 10 authors.</p><p>The authors of this book believe that analyzing one line of code is valuable because it gives us an understanding of the cultural, social and political knowledge about code and how we use code.</p><p>If we value code as text with both a machine and human meaning, how should we study it? The book introduces three different categories of studying code: critical code studies, software studies, and platform studies.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fm9joBLOZVEo%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dm9joBLOZVEo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fm9joBLOZVEo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d8dc4e6a87759cbfdc934e4077fee1f/href">https://medium.com/media/7d8dc4e6a87759cbfdc934e4077fee1f/href</a></iframe><h4>Analyzing to “10 PRINT CHR$(205.5+RND(1)); : GOTO 10”</h4><p>This blog is not going to be a summary of the book. Instead, I just want to focus on one idiosyncrasy of BASIC and the Commadore 64 that I found interesting.</p><h4>What the $%^! does “CHR$(205.5+RND(1))” do?</h4><p>Looking at this code at first glance might give you a headache, but really all this does is pseudo-randomly generate either a “/” or a “\”.</p><p><strong>“CHR$”</strong></p><p>“CHR” is short for “character”. “CHR$” is a function that <em>“takes a numeric code and returns the corresponding character, which may be a digit, a letter, a punctuation mark, a space, or a “character graphic,” a nontypographical tile typically displayed alongside others to create an image. (p.11)”.</em> Usually, when we think of using numbers to generate characters, we think of the ASCII table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/0*vd-mJWCYo8nbbjn4.png" /><figcaption>ASCII Table —source: <a href="https://en.wikipedia.org/wiki/File:ASCII-Table.svg">https://en.wikipedia.org/wiki/File:ASCII-Table.svg</a></figcaption></figure><p>However, the Commodore 64 had its own character set called PETSCII.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*5aUVWtOjQmBNF20n.gif" /><figcaption>Table of the Commadore 64 Character Set (PETSCII) — source: <a href="https://www.c64-wiki.com/wiki/PETSCII">https://www.c64-wiki.com/wiki/PETSCII</a></figcaption></figure><p><strong>“205.5 +RND(1)”<br></strong>Arithmetic is done with floating-point numbers in Commodore BASIC. In the case of needing an integer, as in CHR$, BASIC will automatically truncate the number.</p><p>But before CHR$ even reads the number, “RND(1)” needs to be calculated. The book has a whole section on “random” and pseudo-random, but “RND(1)” returns a pseudorandom number (float) between 0 and 1.</p><p>If <em>RND(1)</em> is<em> ≥0.5 and ≤1.0</em>, 205.5+RND(1) will be <strong>truncated</strong> as 206.</p><p>If<em> RND(1)</em> is <em>≥0.0 and ≤ 0.5</em>, 205.5+RND(1) will be <strong>truncated</strong> as 205.</p><p>Let’s look at what the values of 205 and 206 are on the PETSCII table. If you noticed, the values on the PETSCII table only go up to 191, so we can’t use the table to find the values of <strong>CHR$(205)</strong> and<strong> CHR$(206). </strong>The authors of the book do a better job explaining this phenomenon.</p><blockquote>“A quirk of the Commodore 64 character set is that these two characters, and a run of several character graphics, have two numeric representations. Characters 109 and 110 duplicate 205 and 206, meaning that 109.5 could replace 205.5 in this program and the identical output would be produced.(p. 13)”</blockquote><p>BASIC knows that 205 and 206 are duplicates for 109 and 110. What are the values of <strong>CHR$(109) </strong>and<strong> CHR$(110)</strong>? “/” and “\”, respectfully.</p><p>:/</p><p>\:</p><p><a href="http://nickm.com/trope_tank/10_PRINT_121114.pdf">http://nickm.com/trope_tank/10_PRINT_121114.pdf</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf21acd329ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MapBox]]></title>
            <link>https://medium.com/@alessandravertrees/mapbox-283738182011?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/283738182011</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Thu, 12 Sep 2019 13:21:00 GMT</pubDate>
            <atom:updated>2019-09-12T15:24:05.693Z</atom:updated>
            <content:encoded><![CDATA[<h3>Adding Symbols to MapBox GL JS Map</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*umxApXVEwOP4Flwn.jpeg" /><figcaption>New York Times example using MapBox -<a href="https://blog.mapbox.com/how-the-nyt-mapped-every-dollar-24ae4873ec78">https://blog.mapbox.com/how-the-nyt-mapped-every-dollar-24ae4873ec78</a></figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Falessandragenevie%2Fembed%2Fpreview%2FxxKYPwm%3Fheight%3D600%26slug-hash%3DxxKYPwm%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2Falessandragenevie%2Fpen%2FxxKYPwm&amp;image=https%3A%2F%2Fscreenshot.codepen.io%2F1185666.xxKYPwm.small.8edf7387-c952-4022-8149-322d3dd8d154.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/918dd76a462bfa837ad5d0dcead9af0c/href">https://medium.com/media/918dd76a462bfa837ad5d0dcead9af0c/href</a></iframe><h4>What is Mapbox?</h4><blockquote>“Mapbox GL JS is a JavaScript library that uses WebGL to render interactive maps from <a href="https://www.mapbox.com/help/define-vector-tiles">vector tiles</a> and <a href="https://docs.mapbox.com/mapbox-gl-js/style-spec">Mapbox styles</a>. It is part of the Mapbox GL ecosystem, which includes <a href="https://www.mapbox.com/mobile/">Mapbox Mobile</a>, a compatible renderer written in C++ with bindings for desktop and mobile platforms.” — <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map">https://docs.mapbox.com/mapbox-gl-js/api/#map</a></blockquote><p>Essentially, Mapbox is a prettier, cheaper, and more accessible alternative to Google Maps.</p><h3>HTML</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z_Lx64_5BbGJoOLWTzUzvA.png" /><figcaption>&lt;head&gt; source tags for the Mapbox library</figcaption></figure><p>Like most libraries or public API’s, the first step is to include the script and style files in your head tags. Then, create an HTML container with the id of “map” in the body.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*pa289QIYtddPxKgYtWR3KQ.png" /><figcaption>container div for the map</figcaption></figure><h3>CSS</h3><p>This CSS makes the map fill the entire page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*mgPeA0L73heUSYsET2d2nQ.png" /><figcaption>CSS from Mapbox example — <a href="https://docs.mapbox.com/mapbox-gl-js/example/add-image/">https://docs.mapbox.com/mapbox-gl-js/example/add-image/</a></figcaption></figure><h3>Javascript</h3><p>The fun part — scripting! This is where the actual magic happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hF3yMHVH6VKYoxW2VK_w8g.png" /><figcaption>public token</figcaption></figure><p>Step 1. Copy your access token.</p><p>Step 2. Set mapboxgl.accessToken to your access token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iobl3ISXeNNqJXQyqY7vbg.png" /></figure><p>Step 3. Slap that map on the DOM</p><p>The basic code for this is: new Map(options: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RsPSK4SEX5zHEW9kiF1vBQ.png" /></figure><p>The ‘Map’ object has an array of properties that you can set upon creation, but the most important one is the “container”. According to the documentation of the “Map” object, the container property is:</p><blockquote>“The HTML element in which Mapbox GL JS will render the map, or the element’s string id . The specified element must have no children.” <br>-Mapbox GL JS API Documentation</blockquote><p>We have successfully slapped the Map object on the DOM! Now we can start manipulating it.</p><h4>Event Listeners</h4><p>The ‘Map’ object has what Mapbox refers to as “<strong>Instance Members</strong>,” which are methods and properties of the map that allow you to dynamically change the map, customize the user experience, and fire events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*tw7jk7KQd9WsROH8BZaTiQ.png" /></figure><p>map.on is the equivalent to map.addEventListener, but it can take in two or three parameters. The event type and the callback function are the mandatory arguments, but an optional argument is “layerId” and, if used, must be the second argument passed. <em>Example: (‘click’, 1, callBack(e)) or (‘click, callBack(e))</em></p><p>The event object itself is titled “o,” instead of “MouseEvent” or “KeyEvent.” This is what it looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*nvV1S-j0B1-P5R4tHi-wKg.png" /><figcaption>console.log(e)</figcaption></figure><p>o.lngLat is the longitude and latitude coordinates of the mouse on the map, o.point is the x,y coordinates of the mouse in the window, and originalEvent is where the MouseEvent object is stored.</p><p>To create a pin on the map where the user clicked, we need the longitude and latitude coordinates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*zDFKO8Wn2WAPjKAmod56Ig.png" /></figure><p>Make sure to test your Sh!t in the console to make sure you are referencing the right values :]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*G0UKRHWKmBj00Cw8L7aOxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*A-sWcZX8Y1TJhh2y-6RLhQ.png" /></figure><p>Yay!</p><h4>‘DOM’ Manipulation</h4><p>in my map.on function I call a function “createPin” that takes in the longitude and latitude coordinates as well as an id. <em>The id generated in the callback function is bad code and was only used as dummy data, please don’t use it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CQIUHSh0Odxt5e6CS6LbwA.png" /></figure><p>map.addLayer adds a style layer to the map. It requires a layer object as a parameter. These are the top-level keys for the layer object used in this example. The “id” key is the layer id, which is where we use the id parameter that we are passing into the “createPin” function. The “source” key is an object with many keys, one of them being “features” which is where we set the coordinates as an array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*-NXDDwy7MpC_ZdeeDjjWQA.png" /><figcaption>in “source” object</figcaption></figure><p>Fin!</p><ul><li><a href="https://nordicapis.com/5-powerful-alternatives-to-google-maps-api/">5 Powerful Alternatives to Google Maps API | Nordic APIs |</a></li><li><a href="https://docs.mapbox.com/">Documentation</a></li><li><a href="https://blog.mapbox.com/mapbox-gl-js-react-764da6cc074a">Mapbox GL JS + React</a></li><li><a href="https://www.wired.com/2015/09/mapbox-studio/">A Powerful New Mapmaking Tool Fit for Both Pros and Newbies</a></li><li><a href="https://blog.mapbox.com/designing-electoral-maps-exploring-mapbox-gl-js-a7b7db75bd13">Designing Electoral Maps: Exploring Mapbox GL JS</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=283738182011" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Honors Research Paper]]></title>
            <link>https://medium.com/@alessandravertrees/honors-research-paper-ee0002903569?source=rss-5aeaa7e33b3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee0002903569</guid>
            <dc:creator><![CDATA[Alessandra Vertrees]]></dc:creator>
            <pubDate>Thu, 22 Aug 2019 13:56:16 GMT</pubDate>
            <atom:updated>2019-08-22T14:01:00.280Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HYwN9tgffCHbl-tDy8kZsQ.jpeg" /></figure><p>My research was centered around the environmental factors that leads someone to fall into a trance-like state, as well as the neurological, psychological, and physiological nature of trances as well as the procedures that lead someone to enter this state of being. The information I discovered along the research process was cross-referenced with the techniques used by James Turrell, Anthony McCall, La Monte Young, Alvin Lucier, and Brian Eno.<strong> </strong>This in-depth analysis was integral in the design process of my piece.</p><p>The initial concept of designing an environment that alters a participants brainwave frequencies grew into a system comprised of two components. The first component is the environment designed to altered brainwave frequencies, which I will refer to as the meditation space. An electroencephalogram (EEG) connects the first component to the second, which is a generative audiovisual interpretation/reflection of the live EEG data being streamed from the meditation space. These two components are different experiences that work together to create a biofeedback art installation.</p><p>The word “entheogen” colloquially refers to a psychoactive chemical used to produce an altered state of consciousness. I gave my project the title “Entheogen” because I believe art and new media have psychoactive qualities which have the power to transform consciousness. This belief has manifested an interest in exploring how integrated variations of light, color, and sound influence brain activity and alter brainwave frequencies. By distorting and manipulating perception using light, space, and sound, I hypothesized that I will be able to put participants into a trance-like state by creating an interactive audiovisual project.</p><p>A brainwave is “an oscillation of electrical potential in a large swath of neural tissue. Neurons, which carry electrical charges, are constantly buzzing with activity, generating action potentials (“firing”) when their charges change, primarily as a result of chemical and electrical stimulus (chains of ions leap from one neuron to another in an electrical current)” (Helmrich, S143). I designed an installation to target specific neurological responses in order to decrease the speed of one’s brainwave frequencies. In Lehman’s terms, when large numbers of neurons communicate with one another and fire synchronously, the electrical pulses generated from this phenomenon are thought of as waves. The waves range in frequency and scientists have characterized several brainwave patterns into five distinct frequency ranges (Helmrich, S144).</p><p>For my project, I have associated low brainwave frequencies with a trance-like state. The five distinct frequency ranges: delta (0–4 Hz), theta (4–7 Hz), alpha (7–13 Hz), beta (13–30 Hz), and gamma(30–127 Hz). Typically, our brainwave frequencies range anywhere between 12–30 Hz. Any frequency below 12 Hz is associated with states of relaxation, meditation, emotional detachment, daydreams, and spiritual experiences.</p><p>Increased theta power is one of the many indicators for when someone is in this state of being (Flor-Henry, 7).<strong> </strong>Being in a trance-like state is included in many different spiritual, cultural and religious practices around the world. Meditation, dancing, chanting, exercising, and listening to music are some methods<strong> </strong>that induce this state of being. The manipulation of consciousness usually requires an individual to have control of their own thoughts and awareness. However, in cases like hypnosis, a participant’s awareness is altered by external stimuli.</p><p>Entering a different level of consciousness usually requires a certain level of practice and devotion by the participant. Without the active participation and concentration of an individual, a trance-like state may be difficult to personally achieve. However, entering this state of being regularly is healthy and therapeutic.</p><p>The process of using stimuli to purposefully alter brainwave frequencies is called “<em>brainwave entrainment.</em>” Audiovisual entrainment (AVE) can be recognized using an electroencephalogram (EEG), a tool used to measure brainwave frequencies, and occurs when the brainwave frequency matches that of an audiovisual stimulus. The company Mind Alive produces a line of audiovisual entrainment eyeglasses which allow users to effectively mediate their own brainwave frequencies.</p><p>Cognition relies completely on sight and sound. Our bodies respond to certain changes in light and sound, for example, when a person is blind or has impaired vision, the body responds by heightening their sense of hearing. Neuroscientist Eric Kandel draws attention to the neurological impacts of light and space in his book titled Reductionism in Art and Brain Science. In this book, Kandel references the work of James Turrell, an artist famous for defying the nature of using an object as art. The work of Turrell reveals that light can be engineered in ways that alter a participant’s perception to a degree where his art has been referred to as “hallucinatory”.</p><p>Turrell uses pure light and space to deprive his viewers of their senses. Notably, his most famous works are from his <em>Ganzfeld</em> series, which completely alter the viewer’s perception. As quoted in Kandel’s book:</p><p>“Ganzfeld is a German term for the entire visual field; describes the experiences of a snowbound arctic explorer or a pilot navigating in dense fog. When everything in the visual field is the same color and brightness, our visual system shuts down. White is equivalent to black is equivalent to nothing. When this occurs for a long period of time, we are likely to experience hallucinations” (160).</p><p>The <em>Ganzfeld</em> series, along with Turrell’s other bodies of work, create an illusion using the physics of light and the nature of spatial perception. Turrell’s work is designed to affect our cognition, and thus his work can be used as a reference in understanding how the physical presence of light can affect our cognitive abilities.</p><p>Turrell studied the Ganzfeld effect during his studies at Pomona College.</p><p>The Mind Alive products make use of the ganzfeld effects in their AVE products, where the “distributed illumination throughout the entire visual field allowing you to move your eyes in any direction (either up or down, left or right) without interfering with the smoothness of the light in the visual field” (“Tru-Vu OmniscreenTM Eyeset,” Mind Alive ).</p><p>There are two auditory techniques used in audiovisual brainwave entrainment, one of which being binaural beats. Binaural beats are two relatively close in frequency sine waves that played in either year on stereo headphones. In physical space, the sound waves would interfere with one another and create an audible wobble effect. When played with headphones, the sound waves do not physically interfere with one another, but the brain still makes up the interference. The result is an auditory hallucination that is used in brainwave entrainment to sync brainwave frequencies to the difference of the two frequencies being played. Mind Alive claims that binaural beats have hypnotic and dissociative qualities due to the Ganzfeld effect. In their explanation, they define the Ganzfeld effect as the “process where the mind quietens as a result of having a monotonous sensory input” (Entraining Tones and Binaural Beats).”</p><p>The “Tru-Vu OmniscreenTM Multi-Color Eyeset” allows users to experience the effects of audiovisual entrainment with the added benefit of color therapy. The manual for the product includes a recommended color for each frequency range, suggesting that blue, magenta, or green be used with low-frequency sessions. EEGs have become more affordable and easier to use over the years, which has led to an entire market dedicated to consumer-friendly EEGs. The brand I used for my research and installation was the Muse 2016 headset. The headset is widely used by researchers and artists and provides tools for users to stream and analyze live EEG data. Having a background in neuroscience or machine learning is useful in computing raw EEG data, however, the “Muse Elements” algorithm and signal processing pack have been a useful tool in the development of this installation.</p><p>Inspired by the Ganzfeld effect, audiovisual entrainment, and the color suggestions of the Mind Alive manual, I decided to create a fifteen-foot illuminated canopy-like meditation space. The heart of the canopy is a large pendant lampshade from IKEA. I lined the lampshade with iridescent vinyl and created a reflective top out of cardstock and aluminum foil. Not only did these materials have an aesthetic purpose, but they ensured that the light would reach the bottom of the canopy.</p><p>The purpose of this design was to create a brightly illuminated space that offered a nuanced approach to the incorporation of the Ganzfeld effect in art. Colored light is diffused by sheets of white power-mesh that is difficult to see through from within the space. The fabric touches the floor in every direction and fills the participant’s field of vision with colored light. Binaural beats are stored onto an MP3 player for the user to listen to with headphones. A user sits down inside the meditation space and listens to binaural beats while their brainwave frequencies are measured with the Muse headset and streamed to a computer.</p><p>The source of light for the installation was three 144 neopixels-per-meter LED strips. Two silver wreath frames are attached to the top of the lampshade frame using ornament hooks, which are then looped around the lampshade frame to secure their placement. One-inch wide metal rings are then attached around the wreath frames using jewelry wire, and the LED strips are threaded through the metal rings. The lights are connected to an Arduino, which is placed at the top of the lampshade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9sXTFt_XWFK-j3smbacUyQ.jpeg" /></figure><p>The Muse 2016 headset connects to the Muse Direct App via Bluetooth Low Energy. Once the headset is turned on and connected live EEG data from all four sensors is streamed and analyzed by the app. This data is sent in packets to Max/MSP using User Datagram Protocol and Open Sound Control. These protocols make it easy to dereference the values of the available “Muse Elements” data. The Max/MSP patch calculates the running average of the relative band power for each frequency range (delta, theta, alpha, beta, gamma) by averaging the relative band power of each of the four forehead sensors and passing the average through the “mean” object.</p><p>The running average of the relative band power of each sensor is always a decimal value between zero and one. Since midi notes range between 0 and 127 and hue values range from 0 to 359, the data needed to be scaled. The scale object in Max MSP takes a number in relation to the minimum and maximum value of the input and scales it between any two numbers. The master patch uses the low and high values of each frequency range’s relative power as the input minimum and maximum values for scaling each frequency range. This allows for a more dynamic and interesting change in the generative audiovisual component of the installation.</p><p>The running average is scaled for the generative audio and visual components of the installation in two separate sub-patches within the master patch. The audio sub-patch is titled “noise” and the visual sub-patch is titled “color.” The value of each frequency range’s relative power is then passed through the “trough” and “peak” objects. The trough object outputs the lowest value that it has received, and the peak object outputs the highest value it has received. The value of the running average, trough, and peak are stored in variables with respect to the frequency range which they belong to. These variables can then be accessed throughout the entire patch using the objects; value, send and receive objects.</p><p>“Noise” receives the delta, theta, and alpha data and scales each value between two ranges, one for the note and one for the volume. To generate the note, the data is scaled from the trough and peak to zero and the number of lines in a collection file. Two collection files titled “cMajor.txt” and “minorExt.txt” represent the individual midi notes on a C major and C minor scale, respectively. The frequency of the note increases with respect to the index number, so if the delta average is greater than or equal to the delta peak, the delta average will be scaled to the last index of the collection file, thus having the highest frequency in the scale. High-frequency notes require less volume to be audible than low-frequency notes, so the volume is inversely proportional to the relationship of the average to the trough and peak. Thus, as the frequency of the note increases, the volume of the note decreases. The midi note and volume of each frequency ranges are sent to a midi keyboard in Max/MSP, which takes the note and velocity and translates it into a midi message which can be translated by Ableton Live. The Delta, Theta, and Alpha values are sent to separate ports in Ableton. Delta and Theta are interpreted as choir sounds while Alpha interpreted by wind instruments.</p><p>The “Color” sub-patch actually scales the average for all five frequency ranges between their respected trough and peaks to generate a distance value between 20 and 600 pixels and a radian value between -160 and 100. These values are then prepended with an appropriate variable name and sent to Processing via UDP send. Communication between Max/MSP and Processing is fairly simple with OSC and UDP, given that all you need is the IP address of the machine who will receive the packets and a port number. The data is received and parsed in Processing where it is used to generate the size and shape of five circular waves using the data from Max/MSP and Perlin noise. The color for each wave represents the frequency range that it is associated with: purple for delta, blue for theta, green for alpha, yellow for beta, and red for gamma.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KScfbMP4NDa8o1T_aThw8w.jpeg" /></figure><p>The belief that art and new media have captivating qualities has allowed me to create an immerse and sensory environment. The Ganzfeld effect, a similarity between Turrell and audiovisual entrainment, distorts participant’s perception of the real world using light, sound, time, and space. This distortion alters consciousness, similar to an entheogen, and changes their brainwave frequencies.</p><p>BIBLIOGRAPHY</p><p>Audio-Visual Entrainment: History and Physiological Mechanisms- as published in the <br> Association for Applied Psychophysiology and Biofeedback (AAPB) publication, <br> “Biofeedback Magazine” Volume 31, Number 2 (Summer, 2003)</p><p>Austin, James H. “Zen-Brain Horizons: Toward a Living Zen”. MIT Press. 2014.</p><p>“Available Data — Muse Direct.” Muse Developers, <br> developer.choosemuse.com/tools/available-data-muse-direct.</p><p>Becker, Judith. “Music and Trance.” <em>Leonardo Music Journal</em>, vol. 4, 1994, pp. 41–51. <em>JSTOR</em>, <br> JSTOR, <a href="http://www.jstor.org/stable/1513180">www.jstor.org/stable/1513180</a>.</p><p>Beveridge, Patrick. “Color Perception and the Art of James Turrell.” <em>Leonardo</em>, vol. 33, no. 4, <br> 2000, pp. 305–313. <em>JSTOR</em>, JSTOR, <a href="http://www.jstor.org/stable/1576905">www.jstor.org/stable/1576905</a>.</p><p>Becker, Judith. “Music and Trance.” Leonardo Music Journal, vol. 4, 1994, pp. 41–51. <br> JSTOR, JSTOR, <a href="http://www.jstor.org/stable/1513180">www.jstor.org/stable/1513180</a>.</p><p>“Entraining Tones and Binaural Beats.” Mental Health Treatment — Mind Alive, Mind Alive, <br> mindalive.com/index.cfm/technology/entraining-tones-and-binaural-beats/.</p><p>Flor-Henry, Pierre, et al. “Brain Changes during a Shamanic Trance: Altered Modes of</p><p>Consciousness, Hemispheric Laterality, and Systemic Psychobiology.” Cogent Psychology, vol. 4, no. 1, 2017, doi:10.1080/23311908.2017.1313522.</p><p>Gordon, Alastair. “Spaced Out: Radical Environments of the Psychedelic Sixties”.<em> Random <br> House Incorporated</em>. 2008.</p><p>Helmreich, Stefan. “Potential Energy and the Body Electric: Cardiac Waves, Brain Waves, and <br> the Making of Quantities into Qualities.” Current Anthropology, vol. 54, no. S7, 2013, <br> pp. S139–S148. JSTOR, JSTOR, <a href="http://www.jstor.org/stable/10.1086/670968">www.jstor.org/stable/10.1086/670968</a>.</p><p>Herrington, Tony. “Epiphanies: Life-Changing Encounters with Music”. MIT Press. 2015.</p><p>Hui, Alexandra. “The Psychophysical Ear: Musical Experiments, Experimental Sound <br> 1840–1910”. MIT Press. 2012.</p><p>KANDEL, ERIC R. “A FOCUS ON LIGHT.” <em>Reductionism in Art and Brain Science: Bridging <br> the Two Cultures</em>, Columbia University Press, New York, 2016, pp. 155–162. <em>JSTOR</em>, <br> <a href="http://www.jstor.org/stable/10.7312/kand17962.14">www.jstor.org/stable/10.7312/kand17962.14</a>.</p><p>Kovacevic, Natasha, et al. “‘My Virtual Dream’: Collective Neurofeedback in an Immersive Art <br> Environment.” Plos One, vol. 10, no. 7, 2015, doi:10.1371/journal.pone.0130129.</p><h3>Michael Govan, Christine Y. Kim. “James Turrell: A Retrospective”. 04/11/2013.</h3><p>Pesic, Peter. “Polyphonic Minds: Music of the Hemispheres”. MIT Press. 2017.<br>Peter S Hendricks, Christopher B Thorne, C Brendan Clark, David W Coombs, Matthew W <br> Johnson. “Classic psychedelic use is associated with reduced psychological distress and <br> suicidality in the United States adult population”. <em>Journal of Psychopharmacology</em>, Vol <br> 29, Issue 3, pp. 280–288, First Published January 13, 2015, <br> <a href="https://doi.org/10.1177%2F0269881114565653">https://doi.org/10.1177/0269881114565653</a></p><p>Simon, Charles W., and William H. Emmons. “EEG, Consciousness, and Sleep.” <em>Science</em>, vol. <br> 124, no. 3231, 1956, pp. 1066–1069. <em>JSTOR</em>, JSTOR, <a href="http://www.jstor.org/stable/1753085">www.jstor.org/stable/1753085</a>.</p><p>“Tru-Vu OmniscreenTM Eyeset for the DAVID Delight Series, ALERT Series and the SMART.”<br> Mental Health Treatment — Mind Alive, mindalive.com/index.cfm/technology/tru-vu-<br> omniscreen-eyesets/.</p><p>Winkelman, Michael. “Trance States: A Theoretical Model and Cross-Cultural Analysis.” <em>Ethos</em>, <br> vol. 14, no. 2, 1986, pp. 174–203. <em>JSTOR</em>, JSTOR, <a href="http://www.jstor.org/stable/639951">www.jstor.org/stable/639951</a>.</p><p>Zinman, Gregory. “The Joshua Light Show: Concrete Practices and Ephemeral Effects.” <br> <em>American Art</em>, vol. 22, no. 2, 2008, pp. 17–21. <em>JSTOR</em>, JSTOR, <br> <a href="http://www.jstor.org/stable/10.1086/591166">www.jstor.org/stable/10.1086/591166</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee0002903569" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>