DPS909 0.4 Release – Blog 3

Hello again. Its the end of the semester and I’m submitting my last pull request for my Open Source class. Like always, the semester has flown by but like always, I have to worry about major assignments being due, and final exams. Luckily I only have one exam this semester which does not seem to be too difficult. But before I get to studying for my final exam, I’ll have to make my final pull requests. Last week I talked about my other major assignments for my Web Services and iOS class. I was able to finish both major assignments for those classes which allowed me to direct my complete attention to my Open Source class. I also talked about having C# fresh in my head after completing my major assignment for Web Services so I was determined to find an external issue to work on that used C#. For the 0.4 Release, I had to complete one pull request in an external open source project and two pull requests for an internal open source project.

External Pull Request 1

External Pull Request 2

For my pull request for an external open source project, I was not able to find an issue in C# so I had to find another issue which used other languages. Even though I only needed to complete one pull request for the external open source project, I completed two. For the first external pull request, I added a source code file which would display the convex hull for an already set collection of points. The following is a link to the issue.

Convex Hull

With a given a set of points in the plane, the convex hull of the set is the smallest convex polygon that contains all the points of it.

ConvexHull

The following are the steps to find the convex hull.

Let points[0..n-1] be the input array.

  1. Find the bottom-most point by comparing y coordinate of all points. If there are two points with same y value, then the point with smaller x coordinate value is considered. Let the bottom-most point be P0. Put P0 at first position in output hull.
  2. Consider the remaining n-1 points and sort them by polor angle in counterclockwise order around points[0]. If polor angle of two points is same, then put the nearest point first.
  3. After sorting, check if two or more points have same angle. If two more points have same angle, then remove all same angle points except the point farthest from P0. Let the size of new array be m.
  4. If m is less than 3, return (Convex Hull not possible)
  5. Create an empty stack ‘S’ and push points[0], points[1] and points[2] to S.
  6. Process remaining m-3 points one by one. Do following for every point ‘points[i]’
  7. Keep removing points from stack while orientation of following 3 points is not counterclockwise (or they don’t make a left turn). a) Point next to top in stack b) Point at the top of stack c) points[i]
  8. Push points[i] to S
  9. Print contents of S

The following are the graphs containing the example points that were used to find the convex hull. The third image is what is displayed after the convex hull is found.

A4_PR1

A4_PR1_3

A4_PR1_2

For the second pull request in an external open source project, I was looking through some of my old pull requests that I made and I noticed that there was an issue for a repository that I made contributions for. So I decided to make a pull request for that issue.

Date does not update automatically #1

External Pull Request 2

For my pull requests in the internal open source projects, I continued my work for the GitHub-Dashboard. Last time I was able to download the files from a specific repository so I decided to make a count for the files that were downloaded. The following is the pull request.

Internal Pull Request 1

For the next pull request for the internal open source project, I decided to continue working with octokit/rest.js to gather metrics for the dashboard. Using octokit/rest.js I put together some source code to gather the pull requests and issues for a specific GitHub repository. The following is the pull request that I made.

Internal Pull Request 2

Overall, open source was a new experience mainly because of the collaborative aspect. Normally, I have worked on assignments on my own and it is something that I have gotten used too. I realize though that in the future, the experience that I have gained during this course can help if I get into a field that works with open source technology because I will need to collaborate with others, even if I don’t see them at all.

References

Convex Hull

octokit/rest.js

rest.js

Published by

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s