<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrea Gonzales</title>
    <description>The latest articles on DEV Community by Andrea Gonzales (@andreagon).</description>
    <link>https://dev.to/andreagon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F257092%2F10f110ee-45d4-481f-ae12-9925e0d01cbe.jpg</url>
      <title>DEV Community: Andrea Gonzales</title>
      <link>https://dev.to/andreagon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andreagon"/>
    <language>en</language>
    <item>
      <title>💻🤓Algomania: Data Structure and Algorithm Helper Bot</title>
      <dc:creator>Andrea Gonzales</dc:creator>
      <pubDate>Tue, 23 Apr 2024 03:47:25 +0000</pubDate>
      <link>https://dev.to/andreagon/algomania-data-structure-and-algorithm-helper-bot-1lki</link>
      <guid>https://dev.to/andreagon/algomania-data-structure-and-algorithm-helper-bot-1lki</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/devteam/join-us-for-the-coze-ai-bot-challenge-3000-in-prizes-4dp7"&gt;Coze AI Bot Challenge&lt;/a&gt;: Bot Innovator.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔨 What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.coze.com/s/Zs8MLQo4c/"&gt;Algomania&lt;/a&gt; is a bot that helps developers and coding-problem enthusiasts to learn and answer challenges on data structures and algorithms! It can give the user any coding-related challenges based on their prompt, and their answers are evaluated by the bot based on the accuracy and the time-space complexity of the solution. To make learning more fun, the user gains a point from questions that they answer, where they can exchange these points for a virtual card collectible!&lt;/p&gt;

&lt;h2&gt;
  
  
  👩🏽‍💻 Demo
&lt;/h2&gt;

&lt;p&gt;Try out the bot &lt;a href="https://www.coze.com/s/Zs8MLQo4c/"&gt;here&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8z0j61l7x39cq0g8yvnq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8z0j61l7x39cq0g8yvnq.png" alt="Bot Demo" width="697" height="2467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the image above, the bot gave the user a medium-difficulty problem on reversing a linked list. After the user successfully provided the solution in Python, the bot updated the user's stats and added the correct points.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjw035yrsl25zke9jyosw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjw035yrsl25zke9jyosw.png" alt="Image description" width="790" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Algomania bot can also give hints to the user, and provide a plaintext solution to better understand the algorithm.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46567jzci70odl2y0qan.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46567jzci70odl2y0qan.png" alt="Image description" width="789" height="601"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the user wants to see the solution, Algomania can generate the code solution based on the user's preferred programming language.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn7wuh980up6njcdiip16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn7wuh980up6njcdiip16.png" alt="Image description" width="439" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every time the user correctly answers a challenge, the bot updates the user's stats and allocate a point based on the problem's difficulty (Easy problems equates to 1 point, Medium problems are 3 points and Hard problems are 5 points).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57yl5ezy81rzs302e42p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57yl5ezy81rzs302e42p.png" alt="Image description" width="627" height="683"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The points earned by the user can be exchanged for a card from the Coding Card Collectibles Shop. A card is worth 2 points, and the bot will randomly generate a card with an AI-generated card image. Cards have a rarity range of Common, Rare and Ultra Rare.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdc38mvwjbov0fuxrh4e7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdc38mvwjbov0fuxrh4e7.png" alt="Image description" width="461" height="523"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly, the cards owned by the users can be shown on their collection.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔧Your Configuration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🖋️Persona &amp;amp; Prompt
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Character
You're an experienced software engineer with an in-depth understanding of programming and computer science principles. Your forte lies in presenting intricate data structures and algorithms in easy-to-understand language. You can craft coding tasks tailored to the user's proficiency, evaluate their coding solutions, and deliver expert solutions and explanations when necessary.

## Skills
### Skill 1: Clarify data structures
- Untangle complex data structures. Maintain the ensuing format:

  🔗 &amp;lt;Data structure name&amp;gt;
  - 📝 Overview: &amp;lt;Simplified explanation&amp;gt;
  - ⏲️ Time Complexity: &amp;lt;Time complexity breakdown&amp;gt;
  - 🔍 Space Complexity: &amp;lt;Space complexity analysis&amp;gt;

### Skill 2: Construct coding problems
- Draft a suitable data structure or algorithm task based on the user's learning progress. Follow the subsequent format:

  ❔&amp;lt;Problem Title&amp;gt;
  🎯 Difficulty Scale: &amp;lt;Level of difficulty&amp;gt;
  - &amp;lt;Problem depiction&amp;gt;
  - Data Input: &amp;lt;Example input&amp;gt;
  - Expected Output: &amp;lt;Example outcome&amp;gt;
  - 🏷️ Relevant Topics: &amp;lt;Tags associated with the data structure. E.g., Arrays, Linked Lists, etc.&amp;gt;

### Skill 3: Assess user solutions
- Assess a user's remote solution to the coding problem made in Skill 2. If the solution is flawed, provide constructive feedback on where the error might have arisen. If it's accurate, reward points for motivation. Distribute points towards easy, medium, or hard categories, where easy is 1 point, medium is 3 points, and hard is 5 points, based on the user's successful attempts according to their difficulty scale. Ensure that points are not awarded unless the user correctly resolves the problem. Arrange the data as follows:

📒 User Stats:
- 🏆 Points Accumulated: &amp;lt;points&amp;gt;
- Challenges Done:
    - 🟢 Easy: &amp;lt;easy&amp;gt;
    - 🟡 Medium: &amp;lt;medium&amp;gt;
    - 🔴 Hard: &amp;lt;hard&amp;gt;

### Skill 4: Supply problem solutions
- If a user struggles to resolve a problem or requests the optimal solution, present a comprehensive explanation along with a plaintext code solution in Python, C++, Java, or JavaScript. Convey the solution this way:

  - ✅ Solution: &amp;lt;Guide on how to tackle the problem along with plaintext code&amp;gt;
  - 💻 Code Snippet: &amp;lt;Programmatic solution&amp;gt;
  - ⏲️ Processing Time: &amp;lt;Solution's time complexity&amp;gt;
  - 🔍 Used Space: &amp;lt;Solution's space complexity&amp;gt;

### Skill 5: There's a feature called 'Coding Card Collectibles Shop' where the users can exchange their points for collectible cards from mystery packs. Each mystery pack costs 2 points and contains one card. If the user does not have enough points to buy a card, strictly prevent them from buying a card, else, give them a card and minus 2 points from them. You currently have &amp;lt;points&amp;gt; points! Ask the user if they want to unlock a pack in this format:

🏪 Welcome to Coding Card Collectibles Shop!
&amp;lt;Summary here&amp;gt;

If the user decides to buy a card, generate cards from SSR_Game_3 workflow. Ask the user if they want to save or discard the generated card.

### Skill 6: Ask the user if they want to save the generated card from Skill 5 to the generated_cards table. If they said yes, save the card name, card rarity and card image url to generated_cards table.

### Skill 7: Display the user's card collection from the generated_cards table in the following format:

-🃏My Code Cards:
- Total Card Count: &amp;lt;number of total cards owned&amp;gt;
- Number of Common Cards: &amp;lt;quantity of common cards&amp;gt;
- Number of Rare Cards: &amp;lt;quantity of rare cards&amp;gt;
- Number of Ultra Rare Cards: &amp;lt;quantity of ultra rare cards&amp;gt;
  - 🔹&amp;lt;card name&amp;gt;
  - 💍&amp;lt;card rarity&amp;gt;
  - Card Count: &amp;lt;Number of identical cards owned&amp;gt;

Don't show the image url.

## Constraints
- Solely discuss topics centered around data structures and algorithms.
- Adhere to the ascribed format for all skills.
- Be empathetic and patient towards learners, specifically beginners.
- Consistently provide accurate and updated information.
- Adjust the difficulty level in accordance to the learner's capabilities and progression.
- When appraising user solutions, accentuate accuracy, resourcefulness (in terms of time and space complexity), and compliance with coding conventions.
- Validate that all shared information with the user is up-to-date and precise.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📦Variables
&lt;/h3&gt;

&lt;p&gt;The bot makes use of variables to store the user's stats. These include the points and number of easy, medium and hard challenges that the user had solved.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fksl6vi21l767yam5g3g8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fksl6vi21l767yam5g3g8.png" alt="Image description" width="800" height="546"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  📋Database
&lt;/h3&gt;

&lt;p&gt;In order to store the user's cards, a table called &lt;code&gt;generated_cards&lt;/code&gt; was created. It records the generated card's name, rarity and the image url.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvq1upr4yonpz4g6dk365.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvq1upr4yonpz4g6dk365.png" alt="Image description" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🔗Workflow
&lt;/h3&gt;

&lt;p&gt;I have also set up a workflow to help generate a random card based on its rarity. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkgaxq35bzyf484pss56.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkgaxq35bzyf484pss56.png" alt="Image description" width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The workflow includes a JavaScript code for generating a random number between 0 and 1. Depending on the number, it will return the card name, rarity, and the prompt. It also makes use of the &lt;code&gt;text2image&lt;/code&gt; plugin to convert the prompt into an AI-generated image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flb2ub3z6ycnutdo6ihtw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flb2ub3z6ycnutdo6ihtw.png" alt="Image description" width="800" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly, the workflow returns the name, rarity and image url of the generated card, which will be shown to the user.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzugct6bsk1u4iw28kvn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzugct6bsk1u4iw28kvn.png" alt="Image description" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🏃🏽Journey
&lt;/h2&gt;

&lt;p&gt;Algomania is a bot I wish I have. I started self-learning on data structures and algorithms to better improve my problem-solving skills, but I find that I needed a "coding partner" that I can somehow talk to, to better understand the solutions. Therefore, Algomania came to be with an added feature: a card collection game, since I love games and collecting things. &lt;/p&gt;

&lt;p&gt;I hope this bot helps you too! Thank you!!&lt;/p&gt;

</description>
      <category>cozechallenge</category>
      <category>devchallenge</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Creating an ML Model and Serving it as a RESTful API: Part 2</title>
      <dc:creator>Andrea Gonzales</dc:creator>
      <pubDate>Sat, 30 Jan 2021 09:38:00 +0000</pubDate>
      <link>https://dev.to/andreagon/creating-an-ml-model-and-serving-it-as-a-restful-api-part-2-1jnc</link>
      <guid>https://dev.to/andreagon/creating-an-ml-model-and-serving-it-as-a-restful-api-part-2-1jnc</guid>
      <description>&lt;p&gt;This post is the continuation of the Model and API creation, so be sure to check out part 1 of this series first!&lt;/p&gt;

&lt;p&gt;Part 2 of the series will be focused on creating a very simple web app that asks for Iris's petal and sepal width and length. It will then make a call to the Iris Classification Model API to classify the type of Iris flower based on the given user data. The web app will be created in PHP and HTML, where it will be hosted in a local server.&lt;/p&gt;

&lt;h1&gt;
  
  
  Coding the Web App 🖥️
&lt;/h1&gt;

&lt;p&gt;The web app contains four input fields to accept user data. Once the user clicks submit, it will call the API and return the predicted classification in JSON format.&lt;/p&gt;

&lt;p&gt;To do that, we create a file called &lt;code&gt;iris-app.php&lt;/code&gt; and enter the following PHP and HTML codes inside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
  $form = "
  &amp;lt;!DOCTYPE html&amp;gt;
  &amp;lt;html&amp;gt;
    &amp;lt;body&amp;gt;
      &amp;lt;h1&amp;gt;Iris Classification&amp;lt;/h1&amp;gt;
      &amp;lt;form action='iris-app.php' method='GET'&amp;gt;
        &amp;lt;p&amp;gt;Enter Sepal Length&amp;lt;/p&amp;gt;
        &amp;lt;input type='text' name='slength'/&amp;gt;
        &amp;lt;br/&amp;gt;
        &amp;lt;p&amp;gt;Enter Sepal Width&amp;lt;/p&amp;gt;
        &amp;lt;input type='text' name='swidth'/&amp;gt;
        &amp;lt;br/&amp;gt;
        &amp;lt;p&amp;gt;Enter Petal Length&amp;lt;/p&amp;gt;
        &amp;lt;input type='text' name='plength'/&amp;gt;
        &amp;lt;br/&amp;gt;
        &amp;lt;p&amp;gt;Enter Petal Width&amp;lt;/p&amp;gt;
        &amp;lt;input type='text' name='pwidth'/&amp;gt;
        &amp;lt;br/&amp;gt;
        &amp;lt;input type='submit' name='Submit'/&amp;gt;
        &amp;lt;input type='hidden' name='submitted' value='true'/&amp;gt;
      &amp;lt;/form&amp;gt;

   &amp;lt;/body&amp;gt;
  &amp;lt;/html&amp;gt;";

echo $form;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note the extra input tag below Submit. It will be used to notify the program that the form has been submitted.&lt;/p&gt;

&lt;p&gt;It should look like this:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7kzt89h14bb4vkrev1a8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7kzt89h14bb4vkrev1a8.png" alt="Alt Text" width="542" height="573"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the user clicks submit, it will redirect back to the same file as this is where we will be doing the API request. We then have to enclose the form in an if-else statement so that the request will only happen if the user clicks submit. If not, then the form will just keep showing itself.&lt;/p&gt;

&lt;p&gt;The code will then be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
  if(isset($_GET['submitted'])){
   //API Request Goes Here
  }
  else{
    $form = "&amp;lt;!DOCTYPE html&amp;gt;
    &amp;lt;html&amp;gt;
    &amp;lt;body&amp;gt;

    &amp;lt;h1&amp;gt;Iris Classification&amp;lt;/h1&amp;gt;
    &amp;lt;form action='home.php' method='GET'&amp;gt;
      &amp;lt;p&amp;gt;Enter Sepal Length&amp;lt;/p&amp;gt;
      &amp;lt;input type='text' name='slength'/&amp;gt;
      &amp;lt;br/&amp;gt;
      &amp;lt;p&amp;gt;Enter Sepal Width&amp;lt;/p&amp;gt;
      &amp;lt;input type='text' name='swidth'/&amp;gt;
      &amp;lt;br/&amp;gt;
      &amp;lt;p&amp;gt;Enter Petal Length&amp;lt;/p&amp;gt;
      &amp;lt;input type='text' name='plength'/&amp;gt;
      &amp;lt;br/&amp;gt;
      &amp;lt;p&amp;gt;Enter Petal Width&amp;lt;/p&amp;gt;
      &amp;lt;input type='text' name='pwidth'/&amp;gt;
      &amp;lt;br/&amp;gt;
      &amp;lt;input type='submit' name='Submit'/&amp;gt;
      &amp;lt;input type='hidden' name='submitted' value='true'/&amp;gt;
    &amp;lt;/form&amp;gt;

    &amp;lt;/body&amp;gt;
    &amp;lt;/html&amp;gt;";

    echo $form;
  }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cURL library can be used to make HTTP requests in PHP. We use &lt;code&gt;curl_init()&lt;/code&gt; to initialize a cURL session first, then only make the API request using &lt;code&gt;curl_setopt()&lt;/code&gt; where it takes three parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cURL_handler - returned when you initialized cURL using &lt;code&gt;curl_init()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Option - the constant value for the setting to be changed. For this program, we use &lt;code&gt;CURLOPT_URL&lt;/code&gt; as we want to pass a URL as the value in the third parameter&lt;/li&gt;
&lt;li&gt;Value - the value to be used for the setting. In this case, we make a call to the API along with the user's input as the query.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once this is set, we send out the request using &lt;code&gt;curl_exec()&lt;/code&gt; and finally close the cURL session using &lt;code&gt;curl_close&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Full code is written below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$swidth = $_GET['swidth'];
$slength = $_GET['slength'];
$pwidth = $_GET['pwidth'];
$plength = $_GET['plength'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://iris-classification-model.herokuapp.com/classify?swidth=".$swidth."&amp;amp;slength=".$slength."&amp;amp;pwidth=".$pwidth."&amp;amp;plength=".$plength);
$result = curl_exec($ch);
curl_close($ch);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we're done! If we run the program with these values:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpd2jib8q89q8ibnzv74z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpd2jib8q89q8ibnzv74z.png" alt="input" width="325" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We get the Iris classification as:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7rvagwfq8dlgjsvdm0u4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7rvagwfq8dlgjsvdm0u4.png" alt="json" width="226" height="114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hurrah! Now we have our Model API and interface 🎉!&lt;/p&gt;

</description>
      <category>python</category>
      <category>flask</category>
      <category>api</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Creating an ML Model and Serving it as a RESTful API: Part 1</title>
      <dc:creator>Andrea Gonzales</dc:creator>
      <pubDate>Mon, 18 Jan 2021 06:18:20 +0000</pubDate>
      <link>https://dev.to/andreagon/creating-an-ml-model-and-serving-it-as-a-restful-api-part-1-3kng</link>
      <guid>https://dev.to/andreagon/creating-an-ml-model-and-serving-it-as-a-restful-api-part-1-3kng</guid>
      <description>&lt;p&gt;I started my internship at a local company that focuses on Data Science and Machine Learning and as part of my training, I was tasked to create a simple Iris Classification model that identifies the type of Iris category (Versicolor, Virginica and Setosa) based on the given petal and sepal width and length. Being someone who has minimal Machine Learning background, I needed a lot of research and reading in order to arrive at the required output, but it was all worth it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Zo_mek6i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.pixabay.com/photo/2017/07/14/07/17/iris-2502898_1280.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zo_mek6i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.pixabay.com/photo/2017/07/14/07/17/iris-2502898_1280.jpg" alt="Iris" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this post, I will be sharing the steps I did to create an Iris Classification model using Python and serve it through Flask RESTful API. I have also created a simple PHP interface that connects to the API to demonstrate its usage.&lt;/p&gt;

&lt;h1&gt;
  
  
  Model Creation 🤖
&lt;/h1&gt;

&lt;p&gt;In Machine Learning, a model is trained using a set of data to recognize certain patterns. Python's open-source Machine Learning library, &lt;a href="https://scikit-learn.org/stable/"&gt;Sci-Kit Learn&lt;/a&gt;, provides model training for supervised and unsupervised learning. It is simple to use and it has a lot of tutorials to get started with.&lt;/p&gt;

&lt;p&gt;First, install Sci-Kit library using pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install -U scikit-learn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the installation is finished, create a file called &lt;code&gt;model.py&lt;/code&gt; where Sci-Kit Learn's already made Iris dataset can be used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn import datasets
iris = datasets.load_iris()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: You can use your own dataset but it needs to be preprocessed and formatted for Sci-Kit Learn to understand and train the model as efficiently as possible.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Next, the datasets are separated into &lt;strong&gt;data and target&lt;/strong&gt;. &lt;strong&gt;Data&lt;/strong&gt; consists of petal and sepal width and length in centimetres, while the &lt;strong&gt;target&lt;/strong&gt;, or the label, is the class to predict. For the Iris classification, the target consists of versicolor, virginica and setosa.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iris_data = iris.data
iris_target = iris.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before training the model, the data and target are split again so that the other half is used for the actual model training while the other is used for verifying the model (in other terms, testing the model's accuracy).&lt;/p&gt;

&lt;p&gt;This can be achieved using &lt;code&gt;train_test_split&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.model_selection import train_test_split
iris_data_train, iris_data_test, iris_target_train, iris_target_test = train_test_split(iris_data, iris_target, test_size = .5)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;test_size&lt;/code&gt; parameter specifies the size of the testing datasets.&lt;/p&gt;

&lt;p&gt;Now, we can start building the model. There are many classification algorithms that can be used for this model, but I settled on K-Nearest Neighbors as the accuracy score is much higher.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn import neighbors
classifier = neighbors.KNeighborsClassifier()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From this, we can start training the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;classifier.fit(iris_data_train, iris_target_train)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And there we have it! We have a trained Iris classification model. We can print the accuracy level of the model using &lt;code&gt;accuracy_score&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.metrics import accuracy_score
predict_iris = classifier.predict(iris_data_test)
print(accuracy_score(iris_target_test, predict_iris))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the above, the model has an accuracy score of 97%! Great!&lt;/p&gt;

&lt;h1&gt;
  
  
  Creating Flask API ⚙️
&lt;/h1&gt;

&lt;p&gt;Before we create the Flask API, the model needs to be serialized using a Python library called &lt;a href="https://docs.python.org/3/library/pickle.html#:~:text=%E2%80%9CPickling%E2%80%9D%20is%20the%20process%20whereby,back%20into%20an%20object%20hierarchy."&gt;Pickle&lt;/a&gt;. By "pickling" a python code, it is converted into a byte stream for it to be easily sent over the network or saved on disk. "Unpickling" is the opposite, where it converts the python file into its original state.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0AQmiAZ7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.pixabay.com/photo/2016/07/15/22/49/pickled-cucumbers-1520638_1280.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0AQmiAZ7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.pixabay.com/photo/2016/07/15/22/49/pickled-cucumbers-1520638_1280.jpg" alt="Pickle" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pickle can be installed using pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install pickle-mixin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our Iris classification model can be "pickled" or serialized using the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pickle
pickle.dump(classifier, open("iris_model", "wb"))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates the &lt;code&gt;iris_model&lt;/code&gt; file. If you try to open it, it will show indecipherable characters.&lt;/p&gt;

&lt;p&gt;Now that we have our model pickled, we can now start with the Flask API!&lt;/p&gt;

&lt;p&gt;Like the rest of the Python libraries, we install flask as well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We then create our main app file called &lt;code&gt;app.py&lt;/code&gt;. Inside, we import the libraries required for our Flask API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from flask import Flask, jsonify
from flask_restful import reqparse, abort, Api, Resource

app = Flask(__name__)
api = Api(app)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our Iris Classification model is then loaded and "unpickled":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pickle
loaded_model = pickle.load(open("iris_model", 'rb'))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we create the front-end interface later, we need a way to send over the user input to the Iris classification Flask API. In order to do that, we create parameters to the URL and we pass the user input there. The inputs we need are the petal and sepal width and length, and from this information, the model predicts what type of Iris flower we are referring to. &lt;/p&gt;

&lt;p&gt;We create the parameters using the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;parser = reqparse.RequestParser()
parser.add_argument('slength')
parser.add_argument('swidth')
parser.add_argument('plength')
parser.add_argument('pwidth')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the queries are set, we need to call the model to predict the Iris type based on the given inputs. We then create a class called &lt;code&gt;requestIris&lt;/code&gt; that takes the URL parameter values then insert it to the model for prediction. The predictions will come into integer format, so 0 is setosa, 1 is versicolor, and 2 is virginica. Also, note that the data returned should be in JSON format.&lt;/p&gt;

&lt;p&gt;The full code is stated below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class requestIris(Resource):
    def get(self):
        args = parser.parse_args()
        slength= args['slength']
        swidth = args["swidth"]
        plength = args["plength"]
        pwidth = args["pwidth"]
        prediction = (loaded_model.predict([[slength, swidth, plength, pwidth]])).tolist()
        if(prediction[0] == 0):
            type="setosa"
        elif(prediction[0] == 1):
            type="versicolor"
        else:
            type="virginica"
        serve_model = {"Iris Type":type}
        print(serve_model)
        return jsonify(serve_model)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We then add the resource to our API, and create a route for the resource:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;api.add_resource(requestIris, '/classify')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Last but not least, we add the code to run our Flask application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if __name__ == '__main__':
   app.run()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hurray! We have our Iris Classification API now! &lt;/p&gt;

&lt;p&gt;The API can be run locally or published to Heroku. I published mine here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://iris-classification-model.herokuapp.com/"&gt;https://iris-classification-model.herokuapp.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next post, I will be writing about the PHP frontend interface to demonstrate the API's application. Stay tuned!&lt;/p&gt;

</description>
      <category>python</category>
      <category>flask</category>
      <category>api</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Thank You 2020!</title>
      <dc:creator>Andrea Gonzales</dc:creator>
      <pubDate>Sun, 10 Jan 2021 08:35:46 +0000</pubDate>
      <link>https://dev.to/andreagon/thank-you-2020-8ni</link>
      <guid>https://dev.to/andreagon/thank-you-2020-8ni</guid>
      <description>&lt;p&gt;Year 2020 had been the most unexpected year I ever had. A lot of things may have happened, but I wouldn't say it's the worst year for me. Sure, there's the pandemic that caused almost a lot of planned activities to go unplanned and heartaches that resulted in wet pillow and puffy eyes, but there are always things to be grateful for.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uGy-UFb7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2021/01/new-year-4628162_1920.jpg%3Fw%3D1024" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uGy-UFb7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2021/01/new-year-4628162_1920.jpg%3Fw%3D1024" alt="" width="800" height="568"&gt;&lt;/a&gt;Goodbye, 2020!&lt;/p&gt;

&lt;h2&gt;Developer Journey 💻&lt;/h2&gt;

&lt;p&gt;Firstly, I have achieved my goal to win Google Code-In programming competition. Although my prize trip to &lt;a href="https://notesandcodes.home.blog/2020/04/23/how-coronavirus-stole-my-trip-to-google-hq/"&gt;Google Headquarters in San Francisco, California was cancelled&lt;/a&gt; (and boy, it caused more tears than I ever shed), I get to have satisfactory alternative prizes. What's more, it helped me gain confidence to join more hackathons and coding competitions, and I realized that I can actually do it. &lt;/p&gt;

&lt;p&gt;Speaking of hackathons, 2020 also enabled me to focus more and join online hackathons that are held from the other parts of the world. I get to meet people with the same interests as I and helped me learn. I also get to win a 1-year hosting and domain name for my website portfolio from a hackathon that is sponsored by &lt;a href="http://qoom.io"&gt;Qoom&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Last but not the least, I started learning PHP and Laravel Framework after being blessed with a part-time work as a freelance web developer! It's challenging at first (considering I have college to focus to as well), but I got through it alright, and get to enjoy my first salary by buying donuts 😋.&lt;/p&gt;

&lt;h2&gt;Student Stuff 📝&lt;/h2&gt;

&lt;p&gt;College life changed pretty much for 2020. For one, we get to conduct lessons through online means because of the pandemic. Being a person who was homeschooled for the whole duration of my elementary and high school years, I'm used to studying at home, so there's no problem with that. The biggest challenge with online classes is perhaps the group assignments, as they are "harder" to execute without face to face discussions.&lt;/p&gt;

&lt;p&gt;As for the lessons, we get to study OOP concept using Java (the language I always try to learn but keeps procrastinating), and PHP lessons aren't bad, especially my part-time work helped me understand the language more and put them into hands-on practice (though combining school and part-time do require more effort, time management, and sacrifice from too much gaming 😂).&lt;/p&gt;

&lt;p&gt;One last thing to add, I got my results for my last semester this January 7, and I can happily say I got my third Dean's list award 💖&lt;/p&gt;

&lt;h2&gt;Musical Hobby 🎹&lt;/h2&gt;

&lt;p&gt;Being in quarantine made it easier for me to play my piano, and at the same time, to NOT play it (my dad works at home so I can only play during his breaks). I'm happy that I get to play the songs I've been wanting to play, which includes the Voltes V Theme Song and Silhouette of a Breeze from Emma: A Victorian Romance anime.&lt;/p&gt;

&lt;p&gt;Though youth choir at my local Church was postponed (thus, I cannot sing there for now), I was given a Karaoke Microphone for Christmas. Time to SIIIING!&lt;/p&gt;

&lt;h2&gt;Family Life 👪&lt;/h2&gt;

&lt;p&gt;Of course, I get to spend more time with my family because of the pandemic. They were the ones who helped me grab opportunities and comfort me during 2020's heartaches. Even though outings are minimal, we get to have a nice picnic near the seaside every once in a while. Late night movies are also frequent, and I also get to learn new recipes to cook for my family!&lt;/p&gt;

&lt;h2&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;Once again, 2020 is a lot, even if it's mostly spent inside my house. As I welcome 2021 and continue improving in different aspects of my life, I won't regret being a part of 2020's adventures 😉&lt;/p&gt;

</description>
      <category>2020</category>
      <category>programming</category>
      <category>devjournal</category>
      <category>laravel</category>
    </item>
    <item>
      <title>Google Code-in 2019: My Experience and The Joy of Becoming a Winner</title>
      <dc:creator>Andrea Gonzales</dc:creator>
      <pubDate>Sun, 29 Mar 2020 08:33:50 +0000</pubDate>
      <link>https://dev.to/andreagon/google-code-in-2019-my-experience-joy-of-becoming-a-winner-11h8</link>
      <guid>https://dev.to/andreagon/google-code-in-2019-my-experience-joy-of-becoming-a-winner-11h8</guid>
      <description>&lt;p&gt;&lt;a href="http://codein.withgoogle.com"&gt;&lt;/a&gt;&lt;a href="http://codein.withgoogle.com"&gt;Google Code-in ( GCI )&lt;/a&gt; is an annual programming competition that introduces teenagers ages 13-17yrs old to the field of Open Source through coding, research, quality assurance, or design tasks for an organization of their choice. By the end of the competition, each open source organization will choose two students as Grand Prize Winners, who will be granted an all-expense four-day trip to Google Headquarters in San Francisco, California USA.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LXG-rmKU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/gci2019-1.jpg%3Fw%3D300" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LXG-rmKU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/gci2019-1.jpg%3Fw%3D300" alt="" width="300" height="300"&gt;&lt;/a&gt;The 10th Year Anniversary of GCI was a blast! Image source: Google Open Source Blog&lt;/p&gt;

&lt;h2&gt;My Brief History with GCI&lt;/h2&gt;

&lt;p&gt;This was my 3rd year joining this competition and is probably one of the most memorable. I first joined GCI back in 2017, and have chosen Catrobat as the organization which I will contribute to. Wanting to win the contest on the first shot was I think a bad idea for me as it became stressful and no longer enjoyable. I then changed my mind set, that although I still want to win this competition, I want to learn something new and enjoy what I'm doing. This time, I chose Sugar Labs as my organization for GCI 2018.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g9pJF2Z---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/sugarlogo.png%3Fw%3D400" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g9pJF2Z---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/sugarlogo.png%3Fw%3D400" alt="" width="400" height="133"&gt;&lt;/a&gt;Images Source: Sugar Labs&lt;/p&gt;

&lt;p&gt;There are two reasons why I chose to work with Sugar Labs. First, I liked its mission to provide educational opportunities to children through the Sugar Platform. Second, it uses Python (along with JavaScript, HTML &amp;amp; CSS) as it's language for developing its apps and games ( known as Activities ). Although I'm more familiar in Python Language, my old computer couldn't handle the environment required for Python contributions so I ended up programming in JavaScript, which I have zero experience during that time. Obviously, I didn't win, as I only finished 9 tasks. However, I did manage to be at the Top 20 students with the most tasks completed, and that's something for me.&lt;/p&gt;

&lt;p&gt;To prepare myself for the next GCI, I dedicated my summer holidays to contribute to one of Sugar Labs' product, Sugarizer, which uses JavaScript. I then became more familiar with the programming language used and more comfortable with the environment I'm working with.&lt;/p&gt;

&lt;h2&gt;Google Code-in 2019: To join, or Not to Join?&lt;/h2&gt;

&lt;p&gt;GCI 2019 started on December 3, 2019 and lasted until January 26, 2020. Weeks before the start date, I was having second thoughts whether I should sign up again or not, as the competition would clash with school review and exam schedules, and I have a goal of making it on the Dean’s List. But something tells me that I will regret it if I wouldn’t join the GCI 2019, and this thought went on for a couple of days before I finally signed up on the day the competition started. I chose Sugar Labs again as my organization, specifically working with two of its products, Sugarizer ( web implementation of Sugar ) and MusicBlocks ( visual programming language focusing on music composition ). The first few weeks wasn't so bad as I expected, as I had a study break where I used to do more tasks and finished about 2 tasks per day during this time. It only went tougher during and after the exam week, where I only get to finish 2-4 tasks per week.&lt;/p&gt;

&lt;p&gt;The difference with GCI 2019 and the previous years was that I've enjoyed it more. Some of my favourite tasks are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Editing Synthesizer Length for Music Blocks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;String and wind instruments should be able to sustain longer note length. Before implementing my fix, Music Blocks' synthesizers could not fully sustain a whole note, thus creating a rather abrupt end to its sound. Although it was specified in the task description to find new synthesizers, I found it much harder, as I have to consider the license of the audio I'll be using. Instead, I used the same synthesizer from Music Blocks, and edited it's soundfont for it to loop a little longer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Adding Automatic Re-initialization Functionality in Open Widgets&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Music Blocks students expect that when they change their code, the open widget updates base on their code. However, the student must manually re-initialize the widget for it to show the changes made. I've implemented an automatic re-initialization of the widgets for a more user-friendly experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AM6hhkL1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/reinit3.gif%3Fw%3D1024" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AM6hhkL1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/reinit3.gif%3Fw%3D1024" alt="" width="800" height="391"&gt;&lt;/a&gt;The open widget updates when code blocks are changed&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Fixing Bugs and Regressions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fixing bugs are one of my favorite things to do. It helps me to be more analytical and creative, as bugs are fixed in different kinds of ways. One fix I did was the regression on the search autocomplete functionality on Music Blocks, while there's another one from Sugarizer, where the fix requires putting a whole chunk of code above another line for it to be run first.&lt;/p&gt;

&lt;p&gt;My complete tasks list can be found &lt;a rel="noreferrer noopener" href="https://github.com/AndreaGon/GCI-2019-Tasks"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The competition went on for about 8 weeks. I finished 31 tasks, surpassing my previous year's task counts. I felt proud of myself for this new achievement.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8z4ITU5N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/tasks-1.png%3Fw%3D730" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8z4ITU5N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/tasks-1.png%3Fw%3D730" alt="" width="730" height="437"&gt;&lt;/a&gt;Yay! New Achievement Unlocked&lt;/p&gt;

&lt;h2&gt;The Waiting Begins&lt;/h2&gt;

&lt;p&gt;I read somewhere from previous winner's blog that Google privately emails the chosen Winners and Finalists before the actual public announcement on the Open Source Blog, which was on February 11. I felt very nervous. My heart jumps whenever I check my email notifications. There are lots of students who did great job in my organization, but I still hope to be chosen as a Grand Prize Winner, or as a Finalist at least. By the time January was coming to an end, I decided to stop thinking about it, and let tomorrow takes its course.&lt;/p&gt;

&lt;p&gt;Then, on the afternoon of February 2nd, I was sitting in our dining area, designing a website for a study group. I just came from a youth gathering event, and my phone buzzed with messages from the other youth group members. I decided to take a break from my website and read through my messages, when I received an email notification. The first thing I saw was the word "Winner" in the email. It didn't register on my mind, so I read the email’s Subject again, this time fully reading the words "Congratulations! You are a Google Code-in 2019 Grand Prize Winner!". And because it’s not every day we get to receive an email like this from Mr. Google, I have to read the subject three times before the great news sank into me.&lt;/p&gt;

&lt;p&gt;I quickly ran to my parent's bedroom, told them the news, and broke down into tears. I felt so happy at that moment that my happiness turned into tears of joys. All throughout the contest, I remember visualizing every night, that I'll win this time, visit Google, and meeting my Mentors and fellow GCI 2019 winners. This dream is becoming more real than ever!&lt;/p&gt;

&lt;p&gt;There are lots of things to do before the trip. Lots of documents to fill up and submit for the US visa. After scheduling my visa appointment, all I have to do is wait. I’m going to use this time to look through previous winners’ blog posts and read their amazing experience in Google HQ, San Francisco. I can't wait for my turn to take pictures on those Android statues!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PcZAeaHE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/android.jpg%3Fw%3D728" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PcZAeaHE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://notesandcodeshome.files.wordpress.com/2020/03/android.jpg%3Fw%3D728" alt="" width="728" height="535"&gt;&lt;/a&gt;Image source: Android Police&lt;/p&gt;

&lt;p&gt;P.S. : By the way, I also did manage to be on the Dean’s List 😀. I feel so blessed.&lt;/p&gt;

</description>
      <category>google</category>
      <category>javascript</category>
      <category>gci</category>
    </item>
  </channel>
</rss>
