<?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: Claire</title>
    <description>The latest articles on DEV Community by Claire (@clairea).</description>
    <link>https://dev.to/clairea</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%2F392291%2F52320451-1597-4426-94e1-4ee779e50876.jpg</url>
      <title>DEV Community: Claire</title>
      <link>https://dev.to/clairea</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/clairea"/>
    <language>en</language>
    <item>
      <title>Serving HTML pages with GatsbyJS</title>
      <dc:creator>Claire</dc:creator>
      <pubDate>Mon, 22 Jun 2020 19:21:30 +0000</pubDate>
      <link>https://dev.to/clairea/serving-html-pages-with-gatsbyjs-2ad5</link>
      <guid>https://dev.to/clairea/serving-html-pages-with-gatsbyjs-2ad5</guid>
      <description>&lt;p&gt;Recently, I was working on a GatsbyJS website and wanted to port over a few HTML pages with Javascript in them without converting them to React to get a prototype of the site up faster. However, after some trial and tribulation, I learned that this simple idea was not so straightforward in reality. &lt;/p&gt;

&lt;h1&gt;
  
  
  The Static directory
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://www.gatsbyjs.org/docs/static-folder/"&gt;This&lt;/a&gt; doc explains that GatsbyJS provides a &lt;code&gt;static&lt;/code&gt; directory where one can put files that are not part of the module system. Sounds perfect for our HTML pages!&lt;/p&gt;

&lt;p&gt;Resulting file structure:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
/src&lt;br&gt;
/static&lt;br&gt;
----/&amp;lt;we would like our HTML pages to go here&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem
&lt;/h1&gt;

&lt;p&gt;As &lt;a href="https://github.com/gatsbyjs/gatsby/issues/13072"&gt;this&lt;/a&gt; Github issues mentions, there is a bug in GatsbyJS that makes it so accessing HTML pages gives a 404 page. &lt;/p&gt;

&lt;h1&gt;
  
  
  The Workaround
&lt;/h1&gt;

&lt;p&gt;When I was investigating this problem, I noticed that GatsbyJS wasn't serving HTML pages specifically. When I tried to access a JPG file or a PHP file located in the &lt;code&gt;static&lt;/code&gt; folder, they were all served without a hitch. &lt;/p&gt;

&lt;p&gt;After researching other ways to display HTML pages in a web browser, and after reading comments &lt;a href="https://github.com/gatsbyjs/gatsby/issues/13072"&gt;Github issue&lt;/a&gt; which reported the problem, I decided to convert my page to XHTML so GatsbyJS could serve it properly. &lt;/p&gt;

&lt;p&gt;Now, you might be wondering why I didn't just covert the pages to React since I have decided that their original format won't work anyways. Well, converting to XHTML is much easier than converting to React. In fact, sites such as (this one)[&lt;a href="http://www.it.uc3m.es/jaf/html2xhtml/simple-form.html"&gt;http://www.it.uc3m.es/jaf/html2xhtml/simple-form.html&lt;/a&gt;] will convert the pages for you! Just be sure to check that all your Javascript functionality is copied over too. A few of my &lt;code&gt;onclick&lt;/code&gt; function calls were removed, but copying and pasting them back in worked flawlessly. &lt;/p&gt;

&lt;p&gt;Final file structure:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
/src&lt;br&gt;
/static&lt;br&gt;
----/approve-event.xhtml&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Converting my HTML pages to XHTML and putting them in the &lt;code&gt;static&lt;/code&gt; folder was a quick way to port over pages to a website generated with GatsbyJS. &lt;/p&gt;

&lt;p&gt;If anyone knows why GatsbyJS won't serve HTML pages, I would love to hear about it.&lt;/p&gt;

&lt;p&gt;How are you using GatsbyJS? Leave a comment below!&lt;/p&gt;




&lt;p&gt;Cover image by &lt;a href="https://pixabay.com/users/aitoff-388338/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=2129569"&gt;Andrew Martin&lt;/a&gt; from &lt;a href="https://pixabay.com/?utm_source=link-attribution&amp;amp;utm_medium=referral&amp;amp;utm_campaign=image&amp;amp;utm_content=2129569"&gt;Pixabay&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gatsby</category>
      <category>html</category>
    </item>
    <item>
      <title>AI + Github API = Issue Sentiment Classification</title>
      <dc:creator>Claire</dc:creator>
      <pubDate>Thu, 21 May 2020 21:30:19 +0000</pubDate>
      <link>https://dev.to/clairea/ai-github-api-issue-sentiment-classification-4913</link>
      <guid>https://dev.to/clairea/ai-github-api-issue-sentiment-classification-4913</guid>
      <description>&lt;p&gt;During a class I took on Software Engineering while studying abroad, I developed a software application that used Naive Bayes to classify Github issues as resolved or simply closed. &lt;/p&gt;

&lt;p&gt;This type of analysis allows developers to understand which repositories are fixing issues and which are simply closing them due to inactivity or other such reasons. &lt;/p&gt;

&lt;h2&gt;
  
  
  View Project
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/claire-1"&gt;
        claire-1
      &lt;/a&gt; / &lt;a href="https://github.com/claire-1/github-metrics"&gt;
        github-metrics
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Github Metrics: The Classification of Github Issues as Resolved or Unresolved using Naive Bayes
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Github Metrics: The Classification of Github Issues as Resolved or Unresolved Using Naive Bayes&lt;/h1&gt;
&lt;p&gt;I wrote a blog post about this project &lt;a href="https://dev.to/claire1/ai-github-api-issue-sentiment-classification-4913" rel="nofollow"&gt;here&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;I created this project for a Software Engineering class I took.&lt;/p&gt;
&lt;h2&gt;
Project Description&lt;/h2&gt;
&lt;p&gt;For this project, I got comments from issues on Github repositories. I used Naive Bayes to do sentiment analysis on the comments to decide if they were really resolved or if they were simply closed. After I classify the issues, I display the results in a bar chat and in a bubble chart. The bar chart lets you see the number of issues resolved and closed over time. The bubble chart lets you see the individual resolved and closed issues and click on links to see more information about each issue.&lt;/p&gt;
&lt;h2&gt;
How to run&lt;/h2&gt;
&lt;p&gt;This project is fully dockerized. You must have docker and docker-compose installed.&lt;/p&gt;
&lt;p&gt;To run this project, go to the…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/claire-1/github-metrics"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Technical Details
&lt;/h2&gt;

&lt;p&gt;This project is fully dockerized. I used Java for the backend. The frontend is in Javascript. I used some SQL in this project as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Process
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;In one docker container, this application fetches the comments from issues in a specified repository using this &lt;a href="https://github.com/github-api/github-api"&gt;Github Java API&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Next, it runs a Naive Bayes classifier on the last comment on the closed issue to decide whether the issue was actually resolved or just closed. &lt;/li&gt;
&lt;li&gt;This classification is then put into a SQL database running in another docker container. &lt;/li&gt;
&lt;li&gt;Once all the issues have been processed, the program queries the database to calculate the number of closed issues. It groups them by the times they were closed. It outputs the result in a JSON file. &lt;/li&gt;
&lt;li&gt;Next, it queries the database again to get the url associated with each issue so that it can display all the closed issues with clickable links. &lt;/li&gt;
&lt;li&gt;To generate the display, the start-up script for the main docker container runs the http-server command to start a webserver that is accessible from the host machine of the docker container. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once this process completes, you can view the clustering of the issues by visiting &lt;a href="http://localhost:8080/bubble.html"&gt;http://localhost:8080/bubble.html&lt;/a&gt; or &lt;a href="http://localhost:8080/bar-chart.html"&gt;http://localhost:8080/bar-chart.html&lt;/a&gt; on your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example Display
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IRg3iIIL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/83q9b29aqhcn8iw5nr49.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IRg3iIIL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/83q9b29aqhcn8iw5nr49.png" alt="Git of Bubble Chart for Classification"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Future Work
&lt;/h2&gt;

&lt;p&gt;I used an &lt;a href="https://github.com/github-api/github-api"&gt;API&lt;/a&gt; to access Github. This API is not perfect. It does not tell you if it cannot get all the issues for a repository due to rate limiting. Thus, if there are a large number of closed issues, this application might not display all of them since it doesn't know that there are more and doesn't have a way to get the others. Also, this API also includes closed pull requests when it says it is getting all the closed issues.&lt;/p&gt;

&lt;p&gt;Additionally, the classification of issues as resolved or closed is heavily dependant on the training data. More and better training data would lead to more accurate predictions. &lt;/p&gt;

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

&lt;p&gt;I learned a lot about developing iteratively while working on this project due to the numerous moving parts involved.&lt;/p&gt;

&lt;p&gt;I also learned a lot about working with opensource code in making this project. The &lt;a href="https://github.com/github-api/github-api"&gt;existing Java Github API&lt;/a&gt; made it so I could easily access data from Github, even if the API has a few bugs. Additionally, I used some existing Javascript code to display my final data, and found several tutorials on implementing Naive Bayes in Java that were immensely helpful. I could not have completed this project without the help of a vibrant opensource community! Thank you!&lt;/p&gt;




&lt;p&gt;Header image source: &lt;a href="https://pixabay.com/illustrations/question-mark-pile-questions-symbol-2492009/"&gt;https://pixabay.com/illustrations/question-mark-pile-questions-symbol-2492009/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>octograd2020</category>
      <category>sql</category>
      <category>docker</category>
      <category>java</category>
    </item>
  </channel>
</rss>
