<?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 Camelia D. Brumar on Medium]]></title>
        <description><![CDATA[Stories by Camelia D. Brumar on Medium]]></description>
        <link>https://medium.com/@kamibrumi?source=rss-d84067b76f0f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Eaz7LkkREDkxvnAYforgdg@2x.jpeg</url>
            <title>Stories by Camelia D. Brumar on Medium</title>
            <link>https://medium.com/@kamibrumi?source=rss-d84067b76f0f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 20:29:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kamibrumi/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[How to Keep Students Engaged When AI Can Do Their Programming Homework]]></title>
            <link>https://kamibrumi.medium.com/how-to-keep-students-engaged-when-ai-can-do-their-programming-homework-0629a5da868e?source=rss-d84067b76f0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0629a5da868e</guid>
            <category><![CDATA[hci]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[homework]]></category>
            <dc:creator><![CDATA[Camelia D. Brumar]]></dc:creator>
            <pubDate>Fri, 01 Nov 2024 21:44:35 GMT</pubDate>
            <atom:updated>2024-11-04T20:16:03.032Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mBfGU-wm5MgRRNwkgB7fJg.png" /><figcaption>Image generated by Camelia Brumar (the author of this post) with Canva.com’s Magic Media tool.</figcaption></figure><p>Programming students are increasingly using AI tools to generate code, which makes coding easier but can limit in-depth learning. In Kazemitabaar et al.’s recent study, “<em>Exploring the Design Space of Cognitive Engagement Techniques with AI-Generated Code for Enhanced Learning,</em>” researchers developed seven interactive methods to encourage students to actively engage with AI-generated code instead of passively copying it. They tested these methods, discovering that having students guide the AI step-by-step improved their ability to solve coding problems independently. This “cognitive engagement” approach aims to bridge the gap between using AI as a tool and developing essential coding skills.</p><p>In this blog post, we will go over the problems of passive code generation, a subset of the most successful methods to overcome these problems, and possible takeaways for educators. For a deeper dive into the study, please see the full-paper version here: <a href="https://arxiv.org/pdf/2410.08922">https://arxiv.org/pdf/2410.08922</a></p><h4>☄️ The Problem with Passive Code Generation</h4><p>The main challenges in learning to code — especially for novice programmers — stem from a need to build foundational skills in programming concepts, syntax, algorithmic thinking, and problem-solving. Although AI code generation offers efficiency, it introduces pitfalls that undermine these learning goals:</p><ol><li><strong>Lack of Critical Engagement</strong>: Students can bypass the active learning process of searching for, adapting, and debugging code, which traditionally fosters deeper learning.</li><li><strong>Over-Reliance on AI</strong>: When students accept AI-generated solutions without fully understanding them, it can create an “illusion of learning.” This over-reliance hampers their ability to debug, adapt, or write code independently, leading to skill degradation and weak computational thinking.</li><li><strong>Cognitive Shortcuts</strong>: AI-driven code generation can lead to “automation bias” (trusting AI suggestions uncritically) and “cognitive offloading” (relying on external tools for mental tasks), which reduce active engagement and hinder skill acquisition.</li></ol><p>The solution is to encourage cognitive engagement by introducing structured activities that require students to analyze, explain, and modify AI-generated code, thus maintaining essential in-depth learning. The study presents eight techniques to interact with generated code, as seen in the figure below. In the following section, we will discuss the two most effective methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXv_JEtYZAxPNkfEe0IVpQ.png" /><figcaption>The eight techniques to interact with generated code presented in Kazemitabaar et al.’s study “<em>Exploring the Design Space of Cognitive Engagement Techniques with AI-Generated Code for Enhanced Learning</em>”.</figcaption></figure><h4>📚 Cognitive Engagement Techniques</h4><p>In the study, seven AI-assisted programming techniques, including <em>Lead-and-Reveal</em> and <em>Trace-and-Predict</em>, were compared to a Baseline to evaluate their effectiveness. The Baseline technique offers minimal, passive engagement: the AI generates and displays code with a detailed explanation, similar to tools like ChatGPT. Users have the option, but not the necessity, to engage deeply with the code.</p><p>The comparison focused on three key metrics:</p><ol><li><strong>Performance</strong>, assessing each technique’s ability to support skill transfer in independent coding tasks.</li><li><strong>Friction</strong>, measuring cognitive load and time on task, aiming to gauge how much mental effort was required compared to the Baseline’s low-friction experience.</li><li><strong>User Perception</strong>, gathering subjective feedback on involvement to understand the engagement level each technique required.</li></ol><p>Both <em>Lead-and-Reveal</em> and <em>Trace-and-Predict</em> surpassed the Baseline in supporting learning and engagement. The <em>Lead-and-Reveal</em> method prompted users to predict each line of code through scaffolded questions, gradually revealing the code based on responses, enhancing computational thinking without high friction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*MH1C97unNlR7XpVms9DLAg.png" /></figure><p>In contrast, <em>Trace-and-Predict</em> required users to trace code execution by predicting variable states and understanding control flow, like a debugging process. This technique did introduce higher friction and took more time but promoted a thorough understanding of control flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*E0QfURcvYWH-AnsibStnOg.png" /></figure><p>Overall, both techniques were shown to foster active learning and comprehension benefits beyond the Baseline, with <em>Lead-and-Reveal</em> particularly enhancing user awareness and problem-solving.</p><h4>👩🏻‍🏫 Takeaways for Educators</h4><ol><li><strong>Active Engagement Matters</strong>: Techniques that promote active engagement, like <em>Lead-and-Reveal</em> and <em>Trace-and-Predict</em>, significantly enhance learning outcomes compared to passive approaches.</li><li><strong>Scaffolding Techniques</strong>: Scaffolded questioning and interactive prompts can help students effectively build problem-solving skills and computational thinking.</li><li><strong>Balancing Friction and Learning</strong>: It’s important to balance cognitive load with learning benefits. While higher engagement may introduce more friction, the comprehension gains justify this trade-off.</li></ol><h4>✨ Conclusion</h4><p>As programming education increasingly intersects with AI technology, it is crucial for educators to foster an environment that encourages hands-on learning rather than passive code consumption. Kazemitabaar et al.’s study highlights the effectiveness of cognitive engagement techniques such as <strong>Lead-and-Reveal</strong> and <strong>Trace-and-Predict</strong>, which actively involve students in the learning process. By shifting the focus from simply generating code to engaging with it critically, educators can enhance students’ understanding and retention of essential programming concepts. Implementing structured, interactive activities that challenge students to think critically about AI-generated solutions will help bridge the gap between leveraging AI as a tool and developing robust programming skills. As we navigate this evolving landscape, prioritizing cognitive engagement will ensure that students not only learn how to code but also gain the problem-solving abilities necessary for their future careers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0629a5da868e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Getting started with React + D3.js]]></title>
            <link>https://kamibrumi.medium.com/getting-started-with-react-d3-js-d86ccea05f08?source=rss-d84067b76f0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d86ccea05f08</guid>
            <category><![CDATA[d3js]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[how-to]]></category>
            <dc:creator><![CDATA[Camelia D. Brumar]]></dc:creator>
            <pubDate>Wed, 11 Jan 2023 06:25:47 GMT</pubDate>
            <atom:updated>2023-01-11T16:29:34.924Z</atom:updated>
            <content:encoded><![CDATA[<p>Tacos. Two fun facts that I like about tacos are that they can be filled with anything (really!) and that there is a day celebrating them (October 4th in the US)!</p><p>(A little well-deserved sidebar here. My love for tacos is also shared with the creators of the <a href="https://www.explodingkittens.com/products/exploding-kittens-original-edition">Exploding Kittens</a> card game when they created all kinds of taco cat artifacts such as the TACOCAT card, TACOCAT plushie, and TACOCAT Spelled Backwards boardgame. And no, I am not a board games geek *wink wink*.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-BeqbIHQxt3Uien_NKZwWA.jpeg" /></figure><p>Sidebar over, why am I even mentioning tacos? Well, my analogy here can feel a bit forced, but I do believe that combining React with D3.js resembles the process of putting together a taco. React is like the white corn tortilla that makes up the delicious taco shell (mmhm!) and d3 is like the filling of the taco. React holds the visuals, d3 fills the react components with <em>delicious</em> visualizations.</p><p>I chose to learn how to work with these two tools based on the workflow other colleagues in my lab have and standard practices in the industry. I didn’t find many practical examples out there online that would combine already existing react and d3 code and make it work, so I decided to create a series of short posts to share my learning journey with React and D3, with the hope that is helpful to anyone else struggling to make these two libraries work together (in harmony and with no errors).</p><h3>Prerequisites</h3><p>A beginner&#39;s understanding of React and D3 will be necessary to follow along with this tutorial. I will, in the future compile a list of valuable resources that I always find myself returning to when learning React and D3. The visualization below is what you will see in your browser at the end of this tutorial:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*2vhd8yiHhjslwegkEnDwCw.png" /></figure><p>Now then, let’s get cookin’!</p><h3>Ingredients</h3><p>This is a simple recipe that only requires three ingredients:</p><ol><li>React.js, or just the ability to use create-react-app in your terminal. For that, you’ll need to install Node.js and npm (which comes with the installation of Node.js). This can be done by following <a href="https://www.knowledgehut.com/blog/web-development/install-react-on-mac">these instructions</a> up to step 4 (included) for mac users or following the steps in the prerequisites on <a href="https://learn.microsoft.com/en-us/windows/dev-environment/javascript/react-on-windows">this other website</a> for Windows users.</li><li>D3.js: for now you need to know that this is the visualization library that we will use, but will add it to the project in the directions section below.</li><li>D3 example to embed in a react component: I chose a simple bar chart to get started: <a href="https://d3-graph-gallery.com/graph/barplot_basic.html">https://d3-graph-gallery.com/graph/barplot_basic.html</a></li></ol><h3>Directions</h3><ol><li>Create a react app following the official react documentation: <a href="https://reactjs.org/docs/create-a-new-react-app.html">https://reactjs.org/docs/create-a-new-react-app.html</a><br>That is, using the terminal, navigate to the directory where you’d like to store the the project folder. Then, run these commands:</li></ol><pre>yarn create react-app react-d3-test<br>cd react-d3-test</pre><p>You could also use npx instead, but then I suggest being consistent with the commands when installing libraries in your react app and using the same package (npm or yarn):</p><pre>npx react-app react-d3-test<br>cd react-d3-test</pre><p>This creates a single-page react app called react-d3-test and navigates inside the project folder.</p><p>2. Once inside the project folder, it’s time to install the d3 dependency to use this library in our project. Execute the following command</p><pre>yarn add d3<br># OR USING NPM:<br># npm install d3</pre><p>We’re all set to start adding the chart as a react component.</p><p>3. Index.js will look like this out of the box:</p><pre>import React from &#39;react&#39;;<br>import ReactDOM from &#39;react-dom/client&#39;;<br>import &#39;./index.css&#39;;<br>import App from &#39;./App&#39;;<br>import reportWebVitals from &#39;./reportWebVitals&#39;;<br><br>const root = ReactDOM.createRoot(document.getElementById(&#39;root&#39;));<br>root.render(<br>  &lt;React.StrictMode&gt;<br>    &lt;App /&gt;<br>  &lt;/React.StrictMode&gt;<br>);<br><br>// If you want to start measuring performance in your app, pass a function<br>// to log results (for example: reportWebVitals(console.log))<br>// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals<br>reportWebVitals();</pre><p>For our purposes, and due to the annoying double rendering problem with the StrictMode in React, I decided to remove the StrictMode tags since it will make our lives easier while developing this simple example. Thus, the code here will look like this:</p><pre>const root = ReactDOM.createRoot(document.getElementById(&#39;root&#39;));<br>root.render(<br>    &lt;App /&gt;<br>);<br><br>// If you want to start measuring performance in your app, pass a function<br>// to log results (for example: reportWebVitals(console.log))<br>// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals<br>reportWebVitals();</pre><p>4. Moving on to the App.js component, this is how it looks like initially without any modifications:</p><pre>import logo from &#39;./logo.svg&#39;;<br>import &#39;./App.css&#39;;<br><br>function App() {<br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>      &lt;header className=&quot;App-header&quot;&gt;<br>        &lt;img src={logo} className=&quot;App-logo&quot; alt=&quot;logo&quot; /&gt;<br>        &lt;p&gt;<br>          Edit &lt;code&gt;src/App.js&lt;/code&gt; and save to reload.<br>        &lt;/p&gt;<br>        &lt;a<br>          className=&quot;App-link&quot;<br>          href=&quot;https://reactjs.org&quot;<br>          target=&quot;_blank&quot;<br>          rel=&quot;noopener noreferrer&quot;<br>        &gt;<br>          Learn React<br>        &lt;/a&gt;<br>      &lt;/header&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default App;</pre><p>Which is the started code, primarily useless, thus, we’ll modify it to contain a title and the Barchart component that we want to import.</p><pre>import &#39;./App.css&#39;;<br>import Barchart from &#39;./components/Barchart&#39;;<br><br>function App() {<br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>    &lt;h1&gt;Hello React + D3 world!&lt;/h1&gt;<br>    &lt;Barchart/&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default App;</pre><p>5. Now, the most exciting part, let’s build the Barchart component. Under src, create a directory called ‘components’, and inside it, create a file named ‘Barchart.jsx’. Here we first import the needed dependencies (d3 , the useEffect hook, and the useRef hook):</p><pre>import * as d3 from &quot;d3&quot;;<br>import { useEffect, useRef } from &quot;react&quot;;</pre><p>Then, we create an empty Barchart functional component and export it:</p><pre>const Barchart = () =&gt; {};<br><br>export default Barchart;</pre><p>6. We would like our component to fetch the data only once when the component is mounted and then use it to create the visualization. Hence, the useEffect hook comes in handy. We add all the code in the <a href="https://d3-graph-gallery.com/graph/barplot_basic.html">d3 example</a> inside of the body of the useEffect hook as indicated below:</p><pre>const Barchart = () =&gt; {<br>  // set the dimensions and margins of the graph<br>  var margin = { top: 30, right: 30, bottom: 70, left: 60 },<br>    width = 460 - margin.left - margin.right,<br>    height = 400 - margin.top - margin.bottom;<br><br>  // append the svg object to the body of the page<br>  var svg = d3<br>    .select(&quot;#my_dataviz&quot;)<br>    .append(&quot;svg&quot;)<br>    .attr(&quot;width&quot;, width + margin.left + margin.right)<br>    .attr(&quot;height&quot;, height + margin.top + margin.bottom)<br>    .append(&quot;g&quot;)<br>    .attr(&quot;transform&quot;, &quot;translate(&quot; + margin.left + &quot;,&quot; + margin.top + &quot;)&quot;);<br><br>  // Parse the Data<br>  d3.csv(<br>    &quot;https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/7_OneCatOneNum_header.csv&quot;,<br>    function (data) {<br>      // X axis<br>      var x = d3<br>        .scaleBand()<br>        .range([0, width])<br>        .domain(<br>          data.map(function (d) {<br>            return d.Country;<br>          })<br>        )<br>        .padding(0.2);<br>      svg<br>        .append(&quot;g&quot;)<br>        .attr(&quot;transform&quot;, &quot;translate(0,&quot; + height + &quot;)&quot;)<br>        .call(d3.axisBottom(x))<br>        .selectAll(&quot;text&quot;)<br>        .attr(&quot;transform&quot;, &quot;translate(-10,0)rotate(-45)&quot;)<br>        .style(&quot;text-anchor&quot;, &quot;end&quot;);<br><br>      // Add Y axis<br>      var y = d3.scaleLinear().domain([0, 13000]).range([height, 0]);<br>      svg.append(&quot;g&quot;).call(d3.axisLeft(y));<br><br>      // Bars<br>      svg<br>        .selectAll(&quot;mybar&quot;)<br>        .data(data)<br>        .enter()<br>        .append(&quot;rect&quot;)<br>        .attr(&quot;x&quot;, function (d) {<br>          return x(d.Country);<br>        })<br>        .attr(&quot;y&quot;, function (d) {<br>          return y(d.Value);<br>        })<br>        .attr(&quot;width&quot;, x.bandwidth())<br>        .attr(&quot;height&quot;, function (d) {<br>          return height - y(d.Value);<br>        })<br>        .attr(&quot;fill&quot;, &quot;#69b3a2&quot;);<br>    }<br>  );<br>};<br><br>export default Barchart;</pre><p>There are few changes that we will make to this d3 example in order to make it work with React. First, when we select the svg, there is no svg in our index.html with the id “my_dataviz”. A way to solve this problem, is to use the useRef hook. This is what the <a href="https://reactjs.org/docs/hooks-reference.html#useref">React documentation</a> says about it:</p><blockquote>Essentially, useRef is like a “box” that can hold a mutable value in its .current property. You might be familiar with refs primarily as a way to <a href="https://reactjs.org/docs/refs-and-the-dom.html">access the DOM</a>. If you pass a ref object to React with &lt;div ref={myRef} /&gt;, React will set its .current property to the corresponding DOM node whenever that node changes.</blockquote><p>Thus, before the useEffect hook, create a ref and pass it to the d3.select method as follows:</p><pre>const Barchart = () =&gt; {<br>  const ref = useRef();<br><br>  useEffect(() =&gt; {<br><br>    ...<br><br>    const svg = d3<br>      .select(ref.current)<br>      .append(&quot;svg&quot;)<br>      .attr(&quot;width&quot;, width + margin.left + margin.right)<br>      .attr(&quot;height&quot;, height + margin.top + margin.bottom)<br>      .append(&quot;g&quot;)<br>      .attr(&quot;transform&quot;, `translate(${margin.left},${margin.top})`);<br><br>    ...<br><br>  }, []);<br>};</pre><p>Another place where we have to add the reference is as the ref property of the svg that our component will return:</p><pre>const Barchart = () =&gt; {<br>  const ref = useRef();<br><br>  useEffect(() =&gt; {<br><br>    ...<br><br>  }, []);<br><br>  return &lt;svg width={460} height={400} id=&quot;barchart&quot; ref={ref} /&gt;;<br>};</pre><p>The full Barchart.jsx code, with all the sauces and toppings, looks like this:</p><pre>import * as d3 from &quot;d3&quot;;<br>import { useEffect, useRef } from &quot;react&quot;;<br><br>const Barchart = () =&gt; {<br>  const ref = useRef();<br><br>  useEffect(() =&gt; {<br>    // set the dimensions and margins of the graph<br>    const margin = { top: 30, right: 30, bottom: 70, left: 60 },<br>      width = 460 - margin.left - margin.right,<br>      height = 400 - margin.top - margin.bottom;<br><br>    // append the svg object to the body of the page<br>    const svg = d3<br>      .select(ref.current)<br>      .append(&quot;svg&quot;)<br>      .attr(&quot;width&quot;, width + margin.left + margin.right)<br>      .attr(&quot;height&quot;, height + margin.top + margin.bottom)<br>      .append(&quot;g&quot;)<br>      .attr(&quot;transform&quot;, `translate(${margin.left},${margin.top})`);<br><br>    // Parse the Data<br>    d3.csv(<br>      &quot;https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/7_OneCatOneNum_header.csv&quot;<br>    ).then(function (data) {<br>      // X axis<br>      const x = d3<br>        .scaleBand()<br>        .range([0, width])<br>        .domain(data.map((d) =&gt; d.Country))<br>        .padding(0.2);<br>      svg<br>        .append(&quot;g&quot;)<br>        .attr(&quot;transform&quot;, `translate(0, ${height})`)<br>        .call(d3.axisBottom(x))<br>        .selectAll(&quot;text&quot;)<br>        .attr(&quot;transform&quot;, &quot;translate(-10,0)rotate(-45)&quot;)<br>        .style(&quot;text-anchor&quot;, &quot;end&quot;);<br><br>      // Add Y axis<br>      const y = d3.scaleLinear().domain([0, 13000]).range([height, 0]);<br>      svg.append(&quot;g&quot;).call(d3.axisLeft(y));<br><br>      // Bars<br>      svg<br>        .selectAll(&quot;mybar&quot;)<br>        .data(data)<br>        .join(&quot;rect&quot;)<br>        .attr(&quot;x&quot;, (d) =&gt; x(d.Country))<br>        .attr(&quot;y&quot;, (d) =&gt; y(d.Value))<br>        .attr(&quot;width&quot;, x.bandwidth())<br>        .attr(&quot;height&quot;, (d) =&gt; height - y(d.Value))<br>        .attr(&quot;fill&quot;, &quot;#5f0f40&quot;);<br>    });<br>  }, []);<br><br>  return &lt;svg width={460} height={400} id=&quot;barchart&quot; ref={ref} /&gt;;<br>};<br><br>export default Barchart;</pre><p>*Note that for the final result, I just changed the color of the bars to make it more aesthetically pleasing (a tiny, tiny bit).</p><p>7. Now you have to heat that tortilla! Run the following command in the terminal to run your application locally in your browser.</p><pre>yarn start<br># OR USING NPM<br># npm start</pre><p>And boom! An appetizing d3 bar chart served on an exquisite React tortilla right in front of your eyes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*DBDuWbc9ObqEz7S2f_bBRw.jpeg" /></figure><h3>Some final thoughts on the sauce…</h3><p>Tacos go well with Creamy Chipotle Ranch Dressing or some Salsa Verde (you can thank me later).</p><p>Thanks for reading this post, I’m looking forward to writing about my future findings on React + D3, and please leave comments on what you liked about it (I’m sure the tacos were delicious, but feedback on the code is welcomed, too!) and what could be improved.</p><h3>References</h3><p>TACOCAT image: <a href="https://www.stylinonline.com/exploding-kittens-tacocat-plush/?gclid=Cj0KCQiAtvSdBhD0ARIsAPf8oNl-U1IX_Rdko_2Fijq3rHq1UTpB_i8nSYLsqtFjXTsnS7hv-vd3LpUaAvpPEALw_wcB">https://www.stylinonline.com/exploding-kittens-tacocat-plush/?gclid=Cj0KCQiAtvSdBhD0ARIsAPf8oNl-U1IX_Rdko_2Fijq3rHq1UTpB_i8nSYLsqtFjXTsnS7hv-vd3LpUaAvpPEALw_wcB</a><br>React documentation on create-react-app: <a href="https://reactjs.org/docs/create-a-new-react-app.html">https://reactjs.org/docs/create-a-new-react-app.html</a><br>How to add d3 to your project: <a href="https://www.freecodecamp.org/news/how-to-get-started-with-d3-and-react-c7da74a5bd9f/">https://www.freecodecamp.org/news/how-to-get-started-with-d3-and-react-c7da74a5bd9f/</a><br>Tacos pic: <a href="https://www.feastingathome.com/grilled-steak-tacos-with-cilantro-chimichurri-sauce/">https://www.feastingathome.com/grilled-steak-tacos-with-cilantro-chimichurri-sauce/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d86ccea05f08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linear gradients automized in d3]]></title>
            <link>https://kamibrumi.medium.com/linear-gradients-automized-in-d3-7ed5285008c?source=rss-d84067b76f0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ed5285008c</guid>
            <dc:creator><![CDATA[Camelia D. Brumar]]></dc:creator>
            <pubDate>Wed, 27 Jan 2021 20:24:34 GMT</pubDate>
            <atom:updated>2021-01-27T20:24:34.029Z</atom:updated>
            <content:encoded><![CDATA[<p>I always have to spend time crafting functions that create HTML programmatically. If you are looking for how to create a linear gradient in d3 with an arbitrary number of colors and any rotation angle, here you go.</p><p>This is how it would look like in HTML:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84abfe97fe7a365907d4fa7e24606018/href">https://medium.com/media/84abfe97fe7a365907d4fa7e24606018/href</a></iframe><p>The defs tag is very useful in this case, and what it does is store graphical elements in it to be used at a later time. In our case, we store the lienarGradient tag we would like to use later to fill a rectangle. The result looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*eJuQBXy2QdrbuomcCDcT1w.png" /></figure><p>We use gradientTransform attribute is used to rotate the direction of the linear gradient, if you play a bit with the number in the rotate() function you will get the gist of it. Then, inside the lienarGradient tag, we have multiple stop tags, which specify where a certain color stops and where the next one starts, assuming that the first color goes from position 0.</p><p>Finally, I create a rectangle with the rect tag and we use the id of the linear gradient we’ve just created before as the fill of the rectangle as follows: fill=”url(https://medium.com/%E2%80%98#myGradient%E2%80%99)”.</p><p>The d3 code that creates the gradient automatically given any list of colors can be found below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ef521575c45f84b3998624f4c533859/href">https://medium.com/media/4ef521575c45f84b3998624f4c533859/href</a></iframe><p>This function takes as parameters a list of colors of arbitrary size, and the rotation angle. See the comments in the code above for the details on the implementation.</p><p>Below you can find the HTML where it is illustrated how to use this function. I hope it helps!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/194654b385c2aa96caec14e18f0c106b/href">https://medium.com/media/194654b385c2aa96caec14e18f0c106b/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ed5285008c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Activate your conda environment & opening your Jupyter notebook in a bash script]]></title>
            <link>https://kamibrumi.medium.com/activate-your-conda-environment-opening-your-jupyter-notebook-in-a-bash-script-d1113a74e858?source=rss-d84067b76f0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1113a74e858</guid>
            <dc:creator><![CDATA[Camelia D. Brumar]]></dc:creator>
            <pubDate>Tue, 22 Sep 2020 17:10:59 GMT</pubDate>
            <atom:updated>2020-09-22T21:40:29.534Z</atom:updated>
            <content:encoded><![CDATA[<h3>Activate conda environment &amp; open your Jupyter notebook from a bash script</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*tWMxl4QkNpw_Biu3zY2KYQ.png" /></figure><p>Aaaah, the school season is back, and so are the new programming courses. I am taking a Machine Learning course where we are using Jupyter notebooks most of the time. Setting up a conda virtual environment is strongly recommended over using an online notebook such as Google Colab since we might be dealing with large amounts of data, however the RAM and storage offered by those services are just not enough.</p><p>Since I like cooking, I will talk in terms of food. The ingredients you’ll need for this recipe are:</p><ol><li>A bash shell.</li><li>A text editor (I used vim for this tutorial).</li><li>A conda environment ready to use.</li><li>A pinch of patience.</li></ol><p>Just kidding. You can skip the last ingredient. Salt and pepper will do.</p><p>Once you gathered all these, we’ll create a bash script called <strong>notebook.bash </strong>in the directory of your choice. Feel free to name it however you want, just be consistent with the upcoming commands. To create a new file in bash, we use this command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0b999686bbf147fd1305dd77164e817/href">https://medium.com/media/d0b999686bbf147fd1305dd77164e817/href</a></iframe><p>Then you open this script in the editor of your choice. For vim, I used:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/da4c4277ce3940908a9315d5ba02797d/href">https://medium.com/media/da4c4277ce3940908a9315d5ba02797d/href</a></iframe><p>Next, to modify in vim, use the “i” letter key on your keyboard and insert this code, which I am going to explain after:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44b3ce379248c022597568c6966f07f3/href">https://medium.com/media/44b3ce379248c022597568c6966f07f3/href</a></iframe><p>The first line just says that we’re using bash for this script. The following line is just an alternative to <strong>conda init</strong>, which is used in bash, but it cannot be used in a bash script. If you want to find more about it, this is a handy link: <a href="https://stackoverflow.com/questions/34534513/calling-conda-source-activate-from-bash-script">https://stackoverflow.com/questions/34534513/calling-conda-source-activate-from-bash-script</a></p><p>This makes conda ready to use and so we activate our conda environment on line 4. In my case, the environment is called “conda_env”. Once this is done, we can practically use commands using whatever package we have installed in our environment, including the jupyter notebook. I have stored all my notebooks under the “labs” directory, so I navigate there by using the <strong>cd</strong> command and then I can use the command to open the jupyter notebook, i.e. <strong>jupyter notebook</strong>.</p><p>To close the vim editor, press “esc” on your keyboard, and type the command <strong>wq</strong>. <strong>w</strong> saves the changes in your document, and <strong>q</strong> closes the editor.</p><p>Now, the last thing to do before being able to execute your bash script is to change its permissions. To do so, run in your bash shell the following command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a17eaefd5c05b5dd7d032022f1a51c0/href">https://medium.com/media/0a17eaefd5c05b5dd7d032022f1a51c0/href</a></iframe><p>The “755” will give us read, write, and execute permission. Everybody else will get only read and execute permission.</p><p>Now we’re ready to use our script by just typing the following command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d173927742ed9c7140d0364b2176fe6/href">https://medium.com/media/9d173927742ed9c7140d0364b2176fe6/href</a></iframe><p>This should have displayed a list of the notebooks you have in the directory or your choice (in my case, in the labs directory):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E2bb4LCdwHmkZoDBKTCxJQ.png" /></figure><p>Ta-daaaah! You just wrote a bash script that will save you some time activating your conda environment and opening jupyter notebooks for you.</p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1113a74e858" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>