Release 0.4 – Proactive

The semester is coming to a close and I had two more pull requests to do. I decided I wanted to take a different approach to what kind of issues I wanted to work on. Over the past few months I have tried working on a lot of different projects. I’ve learned a lot of new things. But, I wanted to take a proactive approach this time around. Instead of looking for issues that exist I wanted to find my own issues in different repositories.

Telescope

One of the most important things I have learned over span of this course has been how to use git and GitHub. Version control has been something I have been interested in for a while. I have had some bad experiences in the past with working on a code base with multiple other people. That’s why I took such a keen interest in learning the in’s and out’s of git. And I think I have gotten pretty good at it working with git. I have been fortunate to have been able to help a few of my friends with git problems. I noticed a lot of the issues have been with how to rebase properly and squashing commits. Ideally we were aiming for each issue that is addressed to have a single commit for it in the master branch. This hasn’t really been the case in Telescope.

During one of my labs I was helping a classmate of mine with squashing his commits along with my friend Anton. As we were doing this Anton mentioned he thought we should update the documentation in Telescope to provide some information on how to squash commits. I thought this was a great idea and went for it.

### Squashing Commits

Before creating your pull request you may want to squash all your commits down to one. Ideally this should be done before you rebase on the upstream master.

Before you begin make sure you are in your own branch and any and all changes you wish to make are commited.

1. The first step is to find the base commit where your branch began. To find this you can run `git log` and look through the history for the commit before your first commit. Copy the hash from this commit.
1. Run `git rebase -i` followed by the base commit's hash.
   Example: `git rebase -i 1bab04f`
1. A `git-rebase-todo` file will then open up in your default editor. If you have no set one then you will be prompted to edit it in terminal using VIM.
   Example:

```
pick 52a4ced Build
pick b85d7a9 Final Build
```

1. On this screen you will need to decide what you want to do with each commit. Most commonly you will be choosing to squash, fixup or reword your commits. The example below will create one commit instead of 2 with the commit message being "Build".
   Example:

```
pick 52a4ced Build
fixup b85d7a9 Final Build
```

1. Once this is done you can save and close the file. (Or if using VIM press esc then : followed by wq to save and quit).

I believe it is really important for projects to have really good documentation. Especially open source project. Over the past few months the projects I really enjoy working on the most were the ones that really documentation. It makes it so much more likely that people who are not part of the project will want to come in a join it. The projects that I saw that had little to no documentation were always ones I was less inclined to participate on. In addition to helping outsiders, it is also really helpful for members to have some documentation to refer to when they need a hand.

Accessibility Insights for Web/Civic Data Lab

As for an external pull request rather than spending a lot of time looking for issues to work on as I have done so in the past I decided to take the advice of my professor and actually use the Accessibility Insights tool that I have been working on to find accessibility issues on the web. I was worried about showing up on a random project and just telling them their website wasn’t very accessible and giving them code. What I decided to do instead was to work on a project I have already worked on. Back in Release 0.1 on the very first external open source project I had ever worked on was the front end web site of a group called Civic Data Lab. I thought I would be interesting to run the Accessibility Insights tool on the front page and see what came up.

Part of the main web page normally
Same part of the website with the Accessibility Insights overlay highlights issues
Accessibility Insights list of issues

After running the tool I found a lot of the links on their main page I found that many of the social links for the members did not have aria-labels. Aria-labels are there to label links, images and other elements that would be difficult for a person with visual impairment to see. When a screen reader is used without these labels the reader would not be able to properly convey to the user what the link is for. It might for example read out the entire URL one word or letter at a time. Instead with an aria-label would read out the label which would hopefully make much more sense to the user.

<ul class="pagination justify-content-center">
   <li class="page-item px-2">
       <a target="_blank" class="fa fa-github" href="{{ member.github }}" aria-label="{{ member.full_name }}'s LinkedIn Account"></a>
   </li>
   <li class="page-item px-2">
      <a target="_blank" class="fa fa-twitter" href="{{ member.twitter }}" aria-label="{{ member.full_name }}'s Twitter Account"></a>
   </li>
   <li class="page-item px-2">
      <a target="_blank" class="fa fa-linkedin" href="{{ member.linkedin }}" aria-label="{{ member.full_name }}'s LinkedIn Account"></a>
   </li>
   <li class="page-item px-2">
      <a target="_blank" class="fa fa-inbox" href="{{ member.email }}" aria-label="{{ member.full_name }}'s Email"></a>
   </li>
</ul>

In the above code I added aria-labels based on the members full name so that each link had even more context than just “GitHub Link” for example.

After adding the aria-labels and rerunning Accessibility Insights

After running Accessibility Insights again I removed 36 issues. There was still one issue remaining regarding the amount of contrast between colours. This was something I did not feel I should change and would rather leave that for the team itself.

After this I went to their repository to create an issue and file a pull request. Only then did I realize there was already an issue regarding air-label created and a pr for it as well. I felt a upset at my self for not looking before getting started. But I then noticed the time stamps. The issue was filed in June 2018 and the PR was push in November 2018 but still wasn’t merged. When I looked into the changes I realized the fix had become out dated. Its seems a lot of the code base has changed since that time. So I create pull request just mentioning the issue I worked on and that the previous PR was outdated. Hopefully that is OK with the team and my PR will be merged eventually.

Telescope:
Original Repository: Seneca-CDOT/telescope
My Fork: varshannagarajan/telescope
The Issue: https://github.com/Seneca-CDOT/telescope/issues/312
My Pull Request: https://github.com/Seneca-CDOT/telescope/pull/480

Civic Data Lab
Original Repository: CivicDataLab/civicdatalab.github.io
My Fork: varshannagarajan/civicdatalab.github.io
The Issue: https://github.com/CivicDataLab/civicdatalab.github.io/issues/6
My Pull Request: https://github.com/CivicDataLab/civicdatalab.github.io/pull/42

Release 0.3 – Learning

With Hacktoberfest 2019 officially over its time for me to take the next step. I learned a lot and met a lot of the goals I set for myself at the beginning. For the next step in my journey in the open source community I want to take on a bigger challenge.

There are two things I intend on working on over the past few weeks. Our class is working on a large open source project. Telescope is our attempt to revamp our website. This is where we view open source blog posts by past and present students. The other issue I’m working on this week is continuing my previous issue with Microsoft. Last week when working on a issue one of the members of the project noticed another issue, and I offered to work on it and fix it.

Telescope

Telescope has a lot of different parts to it. The first challenge was to find the part of the project I wanted to work on. Fortunately this didn’t turn out to be too difficult, as I was able to find an issue I felt I could work on that would also allow me to learn something new. That is one of my goals in this class is to continue to learn new things while working on new issues. In this project we are using bull to queue up our jobs, these jobs can include parsing a feed of blogs and extracting all the information in them. My part of this project was to implement bull-board, which is a dependency that would allow us to visualize the jobs as they were being processed. While the documentation wasn’t perfect there was definitely enough provided in the repo for me to be able to set it up and try and see some jobs being queued up.

const Bull = require('bull');
const { setQueues } = require('bull-board');

require('./config');

const queue = new Bull('feed-queue', process.env.REDIS_URL);

// For visualizing queues using bull board
setQueues(queue);

module.exports = queue;

While the set up for using bull board was fairly straight forward, I am also asked to use express routing. This is something I had no previously done but do think would be useful to learn how to set up. The idea behind express routing is that if we were to put all of our routes in a single file thing can get quite chaotic very quickly. We could possibly end up with file with hundreds of different routes, and multiple people working on it which could lead to conflicts. With express routing we can break up this one large file into many smaller ones. This is exactly what I did for the route I set up to view the bull board queues.

const express = require('express');
const { UI } = require('bull-board');

const router = express.Router();

router.use('/queues', UI);

module.exports = router;

Accessibility Insights for Web

For my last PR during Hacktoberfest I worked on a small issue on an extension created by Microsoft. It was an interesting project related to accessibility and I was fairly interested continuing to work on it. While I was working on a fix for the previous issue, it was brought up there was another problem coming up. Previously I fixed an issue with the overall size of a drop down menu and text overlap when the text spacing was being modified. While that was happening the drop down menu also dropped down outside of the header. Initially I thought to address this at the same time, but upon looking into it further the fix would require quite a few more changes. In order to find the solution to the problem I looked into how the code they already had worked. Just below the header bar there is a second command bar which acted as expected in different circumstances. They way that was set up was as a flex-box.

image
Drop down dropping below the header bar when a bookmarklet is applied

Flex-box is a way of doing CSS that allows for easier and more powerful formatting and positioning. If there was problems with centering and positioning then it made sense to make the header bar a flex-box as well. Again this felt like a useful thing to learn beyond this one issue.

In order to learn more about flex-boxes I looked into some tool, and one that I found to be very useful was Flex-box Froggy. Flex-box Froggy was a simple web based “game” to learn how to use flex-boxes to achieve various goals. I found it incredibly useful in teaching me how to use them, it was really simple and fun to work through the puzzles.

Flexbox Froggy a game to learn how to use flex-boxes

After learning about flex-boxes I began working on the code base. The first step was to make the entire header bar a flex box. After that I played around with different flex box properties. I had some challenges here getting everything to work correctly. Whatever I changed I could not get all the contents of the header to end up in the correct place. Again I looked at the command bar to see how it was being done there. And that is when I noticed that the left side and right side of the command bar were wrapped in a a div that was also a flex-box. Flex boxes only effect the container and their direct children. Understanding this I created a new div to wrap the left side of the header bar and left the gear icon on the right separate. With this change I as able to get the drop down menu to remain centered while also positioning all the other contents in the right places.

 public render(): JSX.Element {
        return (
            <header className="header-bar">
                <div className="header-text-switcher">
                    <HeaderIcon deps={this.props.deps} />
                    <div className="ms-font-m header-text">{title}</div>
                    {this.renderSwitcher()}
                </div>
                {this.renderButton()}
            </header>
        );
    }
    .header-bar {
        padding-left: 12px;
        position: relative;
        z-index: 1000;
        display: flex;
        justify-content: space-between;
        min-width: 550px;
        .header-text {
            padding-top: unset;
        }
        .header-text-switcher {
            display: flex;
            align-items: center;
        }
    ...
    }
image
After changing the header bar into a flex box everything is correctly positioned

Conclusion

At the end of this new section of this course I am pretty happy with all the new things I have been able to learn. Between express routing and flex-boxes I have worked with two things I think and have been able to apply in other places. While taking this course I am also working on my capstone project, and I begun to implement both of these technologies into it.

Telescope:
Original Repo: Seneca-CDOT/telescope
My Fork: varshannagarajan/telescope
The Issue: https://github.com/Seneca-CDOT/telescope/issues/62
My Pull Request: https://github.com/Seneca-CDOT/telescope/pull/200

Accessibility Insights for Web:
Original Repo: microsoft/accessibility-insights-web
My Fork: varshannagarajan/accessibility-insights-web
The Issue: https://github.com/microsoft/accessibility-insights-web/issues/1219
My Pull Request: https://github.com/microsoft/accessibility-insights-web/pull/1693

Release 0.2.4 – Accessibility

Hacktoberfest is coming to a close, it is week 4! Last week was really good. I have gotten into the hang of how GitHub and contributing to the open source community works. I have learned quite a bit over the course of the past four weeks, but I will get more into that later. First up new week, new issue.

This weeks challenge was to find a issue in a project maintained by a major company. I had previously spent a lot time looking through the GitHub accounts of many major companies. I found it really difficult to find projects I was interested in working on and issues that weren’t already claimed that I could work on. In end I found the perfect project.

Accessibility Insights for Web

Chrome web store page for Accessibility Insights for Web

Accessibility Insights for Web is an Chrome/Edge extension made by Microsoft that helps developers make their websites more accessible. It has two main functionalities, FastPass and Assessment. FastPass quickly finds basic accessibility issues that are more common. It also very helpfully suggests changes to fix said issues. Assessment is quite a bit more through, it provides guided tests to make sure your website is even more accessible. This project was really perfect for me. I was looking for a project that I felt inspired by. This project can actually help make a big difference in a lot peoples lives. The web has become so critical to every day life and inaccessible websites can be a major problem for those who are already have difficulties in normal life.

Issue #1219

The issue that was posted was regarding the actual accessibility of the extension it self. W3C has an accessibility initiative to make the web more accessible, as a part of that there are some guidelines regarding text spacing. Criterion 1.4.12 requires that websites are able to handle with no loss of functionality the following properties:

  • Line height (line spacing) to at least 1.5 times the font size;
  • Spacing following paragraphs to at least 2 times the font size;
  • Letter spacing (tracking) to at least 0.12 times the font size;
  • Word spacing to at least 0.16 times the font size.

When these properties are applied there is a small bug with the drop down menu, where the arrow overlaps text.

Switcher with overlapping text
Drop down arrow overlaps the text “Assessment”

Set Up

Setting up the project on my local machine was what I thought would be the hardest part of this project. I had up until now never tried to build and test a chrome browser extension. Fortunately for the the documentation for this project was very through. After forking and cloning the repo I ran the yarn command to install all the required dependencies. After that to test the version I was working on I simply had to run yarn build to build it. In Google Chrome under the extensions tab I had to select the “load unpacked” option and navigate to the folder I needed. After that the extension was installed on my computer. I could re build it when needed and click the refresh icon to reload the new version quickly.

Extensions page where unpacked extensions can be added

The Fix

Actually working on finding the fix was a tad bit more difficult than I initially thought. At first I was wasting a lot of time trying different solutions and rebuilding each time in between. On my laptop the rebuilding process took longer than I wanted and I spent a lot of time just waiting. Fortunately I realized there was a better way. I could just inspect the element in Chrome and make changes to the CSS. This let me near instantly see the changes as I made them.

In the end I came up with two different solutions as how to address the issue. I could either set the size of the drop down box to be wider or have it resize depending on the text in it. This was not something I felt I should decide, I did believe it would be best to keep the size the same since that is how the app behaved previously but I wanted to ask and find out for sure. I left a message (with gifs) in the issue asking what would be best. I quickly got a response which was good, but unfortunately it was pointed out I had another problem I need to fix. The drop down box ended up moving down ever so slightly out of the header. I am currently working on a fix for this issue. I will update this blog once that is done.

StaticDropdown
Drop down with fixed size
DynamicDropdown
Drop down with varying size

Original Repo: microsoft/accessibility-insights-web
My Fork: varshannagarajan/accessibility-insights-web
The Issue:  https://github.com/microsoft/accessibility-insights-web/issues/1219
My Pull Request: 

Release 0.2.3 – Continuation

It’s week three of Hacktoberfest! Last week went pretty smoothly after I was able to find a issue to work on. This week instead of spending all that time looking for a new project to work on I decided to work on the same project. A quick recap of the project, Enterprise Policy Generator is a Firefox extension that allows enterprises to quickly and easily generate configuration files. Last week I worked on adding a policy configuration that would disable the ability to view passwords as you were typing them in. This was to make things a bit more secure by not allowing others to simply look over your shoulder and see your password. This week there was a new issue to set your browser to default to browsing in private mode.

Unlike last week I was not going into the issue blind. I had a bit of background knowledge about that project that I hoped would help me complete it faster. But even with that knowledge I knew the best strategy was to ask questions to get clarification before beginning work.

Message thread in issue discussing how to address this issue

Again the maintainer of this project was extremely helpful. If I had gone with my initial plan I would have gone down the wrong path. Thankful with the clarification that the maintainer provided I was able to add the new property to the existing Search Engine policy.

New property added to the SearchEngine policy
New property description added

In addition to the code to add the property I had to add the new description for the property. For all the languages I could not translate the message into I still had to add the default English message, these will hopefully be translated in the future by other contributors.

For my issue next week I am hoping to work on a bigger project maintained by a large company. Finding those has been a bit difficult but I am hopeful I will be able to find one.

Original Repo: cadeyrn/enterprise-policy-generator
My Fork: varshannagarajan/enterprise-policy-generator
The Issue: https://github.com/cadeyrn/enterprise-policy-generator/issues/111
My Pull Request: https://github.com/cadeyrn/enterprise-policy-generator/pull/113

Release 0.2.2 – Assistance

Its week two of Hacktoberfest! Last week I had a few hiccups but in the end I was able to submit my first pull request, and it’s now been merged! If you go to Civic Data Lab’s website the logo in the footer is now clickable. That is the first piece of code that I have written that has made it into the public! Its not the most impressive piece of code in the world but its a first step.

This week my goal was to go a bit further, to make a bigger impact this time. I ended up having a different problem from the ones i had last time. This time I struggled a lot even finding an issue I felt I could work on. I ended up going over 45 pages deep into GitHub search results for things labeled “good-first-issue”. It was not a pleasant experience. But in the end I was able to find a pretty interesting repo. It is a project called Enterprise Policy Generator, which is a Firefox extension that allows businesses and other enterprises to easily generate configuration files. These files let administrators configure and set up how they want Firefox to be setup across all devices regardless of platform. this seems like a pretty interesting project that can be very useful for businesses.

The issue was requesting some help in adding a new policy. Currently if you were typing in your password and wanted to see what you had typed so far there is an option to reveal what you’ve entered so far. This is pretty useful if you have a long password and think you have made a mistake. But it is also a security issue. It is possible someone looking at your screen will be able to see your password, and in many enterprise situations this could be disastrous. This new policy will allow admins to prevent users from revealing their passwords.

My initial worry was I had never tried worked with a Firefox extension before and was worried as how to get started. But I got some helpful advice from a professor. When working on a big project I really didn’t need to understand how the whole thing worked. I only needed to know how to do the small part I was working on. So that’s what I did. I looked through previous commits made in the repo looking to see other policies that were added to the project. I looked through and thought I knew what I needed to do, so I left a comment on the issue asking to work on it.

Fortunately for me the repo owner replied that I could work on it and that he would provide some instructions on how to add a new policy! This made my job even easier. After getting some very detailed and helpful instructions I was able to pretty easily add the new policy.

The code I added to the policies.js file
The changes to the messages.json file

I just had to add the new policy to the policies.js file and also the policy message to the messages.json file.

This week I got a lot of help from my professor and the repo owner of the project I was working on. I wasn’t expecting to have a member of the open source community be so willing to help and be so excited to have a random stranger on the internet participate in their project. It opened my eyes to how much this community is really about helping each other. I am really excited about continuing to participate in the community and contribute code. I might even keep working on this project if I am able to!

Original Repo: cadeyrn/enterprise-policy-generator
My Fork: varshannagarajan/enterprise-policy-generator
The Issue: https://github.com/cadeyrn/enterprise-policy-generator/issues/108
My Pull Request: https://github.com/cadeyrn/enterprise-policy-generator/pull/110

Release 0.2.1 – Hacktober Beings!

This week was the beginning of HackotberFest 2019! This is the first time participating in a hackathon, and so far it has been going well.

issue opened Issue #1

My first challenge was finding an issue to work on. Last week I had looked through some of the available issues on GitHub and found a couple I thought would be a good first step. I messaged the owner of the repo of one of these issues and asked to work on it. They replied really quickly and assigned me the issue. I didn’t begin working it right way as I wanted to wait until the official beginning of HacktoberFest. Unfortunately when I did go to work on the issue someone had already fixed it and submitted a pull request for it.

This was a bit discouraging at first. I had been thinking that I had an issue I could work on and that it would be my first step into the open source community. But after a bit of thought I realized it wasn’t a big deal. The person who fixed it just did so as part of a bigger commit. They didn’t come in a try to step on any ones toes. Not to mention it was a rather small and easy fix to make. I had not begun working on it yet so i really hadn’t wasted any time.

issue opened Issue #2

So I began my search all over again. Fortunately with Hacktoberfest in full swing now there are plenty of issues on GitHub to work on. I came across a few issues I thought I could handle as a first attempt. I settled upon a project called CivicDataLab, whose goal is “Harnessing Data, Tech, Design and Social Science to strengthen the course of Civic Engagements in India”. The project it self is rather large and made up several different repositories, I choose to work on a specific one, civicdatalab.github.io. This repository contains their actual website. They had a couple of issues in this repositories, issue #30 which was the one I chose was fairly easy. On their website they had their logo in their website which did not do anything. They were looking for the logo to be clickable.

green check mark Pull Request

To begin my pull request I made a comment on the issue offering to work on the fix.

I decided to start working on the project before they assigned it to me. I forked their project then cloned it to my local machine. Once that was done I created a new branch before beginning work on the project. The first challenge I faced was just finding where I was supposed to make a change. With a project this large there were many folders and sub folders. Eventually I was able to find there the footer was kept. The edit it self was fairly easy to make. I found the line where the footer was being displayed and made it into a link to their homepage.

Original Code

<div class="col-md-3">
   <img class="logo" src="../assets/img/logo_black.png" alt="civicdatalab">
</div>

My Changes

<div class="col-md-3">
  <a href="https://www.civicdatalab.in/">
    <img class="logo" src="../assets/img/logo_black.png" alt="civicdatalab">
  </a>
</div>

My code change was quite straight forward. I wrapped the image element in a <a> tag which is what is used to make links. The href attribute determines where the link takes you too.

Once I was done making the changes I had to test it to make sure the code worked and did not mess up any other part of the code. I launched the website locally and tested the link the footer. It worked perfectly. So then I added the file, and then committed it. After pushing it to the origin (my GitHub repo) I created a pull request.

issue opened Issue #3

This is where I encountered my next problem. I hadn’t realized was my editor changed all the line endings to Windows line ends from what they were originally. When I submitted my pull request I got a message back from the reviewer stating that all the lines of the file were edited not just the lines I need too. In order for them to accept my code I would need to make sure only to edit the lines I needed to.

So I went back to the project and changed the settings on my computer keep line endings the way they were. After that I moved my working branch back to the previous commit, which was the same as the latest master commit in the upstream repo. I then made the changes I needed and went through the steps to create the pull request again.

My initial commit with over 80 line changes
After my second fix only 3 lines were edited

As of right now I have submitted the new pull request with the necessary changes and am hoping it will be accepted. However if it is not I will continue to make the changes needed to get it accepted.

Original Project: CivicDataLab/civicdatalab.github.io
My fork: varshannagarajan/civicdatalab.github.io
Original Issue: https://github.com/CivicDataLab/civicdatalab.github.io/issues/30
My 1st Pull Request: https://github.com/CivicDataLab/civicdatalab.github.io/pull/32
My 2nd Pull Request: https://github.com/CivicDataLab/civicdatalab.github.io/pull/34

Let’s Start Hacking!

This October I will be participating in HacktoberFest 2019! This will be the first time I will have participated in any kind of hackathon. I have always thought about joining one but never really saw a good opportunity until now.

HacktoberFest is a bit different that other events, it focuses on supporting and participating in the open source community. Over the course of the month of October each participant will be aiming to go on GitHub and fix at least 4 different issues in open source projects.

My initial thoughts are “HOW AM I GOING TO FIND 4 ISSUES I CAN FIX?!?!?!?!?!” and “WILL ANYONE EVEN WANT THE WHATEVER I CHOOSE TO DO, WILL IT BE GOOD ENOUGH?!?!?!?!?!”. Needless to say I am a bit worried, nervous and anxious about this. It will be the first time I will really be putting myself out there into open source and computer science worlds. Up till now all the code I have written, and projects I have been worked on have been in school. The only people who see them are my classmates and teachers/professors. But now everyone on the internet will be able to see what I have done and judge me.

I think laying out my goals and intentions for this project will help me calm down a bit. They are as follows:

  1. Find a project I am passionate about and have a piece of my code make it into it
  2. Try and become more comfortable with putting myself (and my code) out there and participating in communities I care about

If I am able to achieve either of these goals I will consider this HacktoberFest a major success. I know the first will be harder to achieve, just because I am able to fix a problem or resolve an issue doesn’t mean it will be accepted. But I am going to try and focusing on making the best fixes I can, and being as active as I can in the community and just see what happens.

I have also started looking at some issues I could try and resolve. Some of the ones I have been able to find are:

  1. cybersemics/em-proto Issue #76
    This issue seems like a straight forward feature request. The user is asking for someone to add a new short cut to their project. As far as a first issue to tackle this seems like something I should be able to handle.
  2. gopinath-langote/1build Issue #154
    This issue will be a bit more work than the first. The user is asking for a text banner to be printed before each command is run.
  3. intermine/wizard Issue #15
    This is another rather straight forward issue to fix. The request is to modify their ESLint configuration to ignore a certain directory.

To begin I started with some more straight forward/simple issues. Going forward through out HacktoberFest I intend on finding more substantial issues to work on.

Working with GitHub

Pretty much every developer, and major project uses git to work on their software. It is a great tool that allows users to contribute to project while also managing version history. In large projects it can be difficult for a lot of people to work on the same code at the same time. Git and GitHub are powerful tools that can help make it easier to do.

This week in class we focused on helping each other make our notepad web applications better. We were each tasked with fixing a problem with someones code and also trying to help improve someones code as well.

In order to do this I needed to learn how to use GitHub a little better. Up until now most of my time on GitHub as been working on my own projects/assignments. It was easy to make changes because I was always working on my master branch and made simple commits directly to that branch whenever I wanted to create a snapshot of what I was doing. This time around working on someone else’s code involved a few extra steps.

In order to make some changes I first needed to find some changes I wanted to make. After looking through my classmates repositories I came across a couple I thought I could make improvements on.

First I found was lozinska’s my-note project, in it the save functions lacked any error message outputs. The write to file function always logged a message of “Saved!” no matter what.“““

fs.writeFile('/note',document.querySelector('#note').innerText );
console.log("Saved");

I thought it would be better if there was an error message if something went wrong. To make this change I first would need to file an issue. On their repository I created an issue letting them know of the problem.

Image of the issue I submitted on lozinka’s repo

After creating the issue the next thing I did was create a fork of the project. i wanted to be able to work on the problem and try to fix it. Once I created the fork I was able to clone it to my local machine and begin my work on it. The problem it self wasn’t a very difficult one to fix.

fs.writeFile('/note',document.querySelector('#note').innerText, function(e){
   if(e){
      console.log('Unable to save due to error', e);
   }else{
      console.log("Saved!");
   }
});

Once the fix was in place I viewed the site to make sure I hadn’t broken anything. Everything was working as expected so I then added the file to the staging area in git. I then committed the change to my local git before pushing it to my GitHub repo.

The final step in applying this change was to submit a pull request. On my repo I went into the pull request tab and requested to merge my branch into the master branch of lozinka’s repo. After submitting that it is up the owner of the repo to decide whether or not to apply the change. As of writing this blog it has not bee approved yet, I will try and update if it does.

The message on the issue page showing the commit I made referencing that issue

And that concludes my first attempt at making a fix to someone else’s code on GitHub. It was a pretty interesting experience that taught me a lot about the software development process. Most of the work I have done has usually been code I wrote from scratch. Reading through someone else’s code for the first time was a bit daunting but in the end it was quite satisfying being able to contribute to another persons project.

Update:
Since my initial post I actually received an issue on my repo and had someone fix it. The person suggested I add a clear button to my app. This was something I was thinking of adding but never had the time to do so. Having this project be open source has been helpful in the development of this project. With the help of the community I have been able to add a feature that may not have otherwise been able to be done.

The process of accepting the pull request was pretty straight forward. Once the pull request was submitted all I had to do was review the code that was submitted and make sure I was happy with the implementation. The code was exactly what I expected and was able to merge the code into my master branch with a single click.

Original repo: lozinka/my-note

My fork: varshannagarajan/my-note-1

Learning about Github

This week I tested out some of the features of git and Github. I worked on an open source web based note taking application. It is fairly rudimentary but it works!

Screenshot of my notepad

It has a simple text box in which you can write whatever you like and it will be saved. The site automatically saves every 10 seconds or you can do it manually by hitting the save button.

It definitely will not be replacing Microsoft Word any time soon but it’s on it’s way!

The more important part of this project was to really learn about Github. I have used it before but I was able to practice more with creating branches, pushing and pulling from my local version of the file.

The really new cool thing I learned about was Github Pages, which let me host my site really quickly.

If anyone wants to take a look at my repository they are more than welcome. Feel free to make suggestions, identify issues and even create a fork and make it better if you wish!

Repository: https://github.com/varshannagarajan/my-notepad

Live Version: https://varshannagarajan.github.io/my-notepad/

OpenCV

Computer vision is a new and rapidly growing technology. These days so many different products use computer vision in different and interesting ways. Whether is it identifying objects, tracking movement, following eye movements, or matching similar object there are so many different uses for it.

OpenCV (Open Source Computer Vision Library) makes it really easy and accessible to start working with computer vision. It being a BSD licensed project means that anyone can get started working with it or modifying it. It also has a lot of support from a great many developers on Github.

On the OpenCV website they even offer courses to help you get started and master how to use this library. This makes it a really great way for developers new to the technology a way to get more familiar with it.

Design a site like this with WordPress.com
Get started